diff --git a/dist/js2flowchart.js b/dist/js2flowchart.js index b38ad81..c55b56a 100755 --- a/dist/js2flowchart.js +++ b/dist/js2flowchart.js @@ -1,55047 +1,9 @@ -(function webpackUniversalModuleDefinition(root, factory) { - if(typeof exports === 'object' && typeof module === 'object') - module.exports = factory(); - else if(typeof define === 'function' && define.amd) - define("js2flowchart", [], factory); - else if(typeof exports === 'object') - exports["js2flowchart"] = factory(); - else - root["js2flowchart"] = factory(); -})((typeof window !== 'undefined' ? window : this), function() { -return /******/ (function(modules) { // webpackBootstrap -/******/ // The module cache -/******/ var installedModules = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ -/******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) { -/******/ return installedModules[moduleId].exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ i: moduleId, -/******/ l: false, -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); -/******/ -/******/ // Flag the module as loaded -/******/ module.l = true; -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/******/ -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = modules; -/******/ -/******/ // expose the module cache -/******/ __webpack_require__.c = installedModules; -/******/ -/******/ // define getter function for harmony exports -/******/ __webpack_require__.d = function(exports, name, getter) { -/******/ if(!__webpack_require__.o(exports, name)) { -/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); -/******/ } -/******/ }; -/******/ -/******/ // define __esModule on exports -/******/ __webpack_require__.r = function(exports) { -/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { -/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -/******/ } -/******/ Object.defineProperty(exports, '__esModule', { value: true }); -/******/ }; -/******/ -/******/ // create a fake namespace object -/******/ // mode & 1: value is a module id, require it -/******/ // mode & 2: merge all properties of value into the ns -/******/ // mode & 4: return value when already ns object -/******/ // mode & 8|1: behave like require -/******/ __webpack_require__.t = function(value, mode) { -/******/ if(mode & 1) value = __webpack_require__(value); -/******/ if(mode & 8) return value; -/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; -/******/ var ns = Object.create(null); -/******/ __webpack_require__.r(ns); -/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); -/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); -/******/ return ns; -/******/ }; -/******/ -/******/ // getDefaultExport function for compatibility with non-harmony modules -/******/ __webpack_require__.n = function(module) { -/******/ var getter = module && module.__esModule ? -/******/ function getDefault() { return module['default']; } : -/******/ function getModuleExports() { return module; }; -/******/ __webpack_require__.d(getter, 'a', getter); -/******/ return getter; -/******/ }; -/******/ -/******/ // Object.prototype.hasOwnProperty.call -/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; -/******/ -/******/ // __webpack_public_path__ -/******/ __webpack_require__.p = ""; -/******/ -/******/ -/******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = "./index.js"); -/******/ }) -/************************************************************************/ -/******/ ({ - -/***/ "./index.js": -/*!******************!*\ - !*** ./index.js ***! - \******************/ -/*! exports provided: createFlowTreeBuilder, createFlowTreeModifier, createSVGRender, createShapesTreeEditor, createPresentationGenerator, ABSTRACTION_LEVELS, DEFINED_MODIFIERS, MODIFIER_PRESETS, TOKEN_TYPES, MODIFIED_TYPES, convertCodeToSvg, convertCodeToFlowTree, convertFlowTreeToSvg */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createFlowTreeBuilder", function() { return createFlowTreeBuilder; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createFlowTreeModifier", function() { return createFlowTreeModifier; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createSVGRender", function() { return createSVGRender; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createShapesTreeEditor", function() { return createShapesTreeEditor; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createPresentationGenerator", function() { return createPresentationGenerator; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "convertCodeToSvg", function() { return convertCodeToSvg; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "convertCodeToFlowTree", function() { return convertCodeToFlowTree; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "convertFlowTreeToSvg", function() { return convertFlowTreeToSvg; }); -/* harmony import */ var builder_FlowTreeBuilder__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! builder/FlowTreeBuilder */ "./src/builder/FlowTreeBuilder.js"); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ABSTRACTION_LEVELS", function() { return builder_FlowTreeBuilder__WEBPACK_IMPORTED_MODULE_0__["ABSTRACTION_LEVELS"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DEFINED_MODIFIERS", function() { return builder_FlowTreeBuilder__WEBPACK_IMPORTED_MODULE_0__["DEFINED_MODIFIERS"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MODIFIER_PRESETS", function() { return builder_FlowTreeBuilder__WEBPACK_IMPORTED_MODULE_0__["MODIFIER_PRESETS"]; }); - -/* harmony import */ var render_svg_SVGRender__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! render/svg/SVGRender */ "./src/render/svg/SVGRender.js"); -/* harmony import */ var presentation_generator_PresentationGenerator__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! presentation-generator/PresentationGenerator */ "./src/presentation-generator/PresentationGenerator.js"); -/* harmony import */ var shared_constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! shared/constants */ "./src/shared/constants.js"); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TOKEN_TYPES", function() { return shared_constants__WEBPACK_IMPORTED_MODULE_3__["TOKEN_TYPES"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MODIFIED_TYPES", function() { return shared_constants__WEBPACK_IMPORTED_MODULE_3__["MODIFIED_TYPES"]; }); - - - - - -var createFlowTreeBuilder = builder_FlowTreeBuilder__WEBPACK_IMPORTED_MODULE_0__["default"]; -var createFlowTreeModifier = builder_FlowTreeBuilder__WEBPACK_IMPORTED_MODULE_0__["createFlowTreeModifier"]; -var createSVGRender = render_svg_SVGRender__WEBPACK_IMPORTED_MODULE_1__["default"]; -var createShapesTreeEditor = render_svg_SVGRender__WEBPACK_IMPORTED_MODULE_1__["ShapesTreeEditor"]; -var createPresentationGenerator = presentation_generator_PresentationGenerator__WEBPACK_IMPORTED_MODULE_2__["default"]; - -var convertCodeToSvg = function convertCodeToSvg(code, printConfig) { - return convertFlowTreeToSvg(convertCodeToFlowTree(code), printConfig); -}; -var convertCodeToFlowTree = function convertCodeToFlowTree(code) { - var flowTreeBuilder = createFlowTreeBuilder(); - return flowTreeBuilder.build(code); -}; -var convertFlowTreeToSvg = function convertFlowTreeToSvg(flowTree, printConfig) { - var svgRender = createSVGRender(); - var shapesTree = svgRender.buildShapesTree(flowTree); - return shapesTree.print(printConfig); -}; - -/***/ }), - -/***/ "./node_modules/@babel/code-frame/lib/index.js": -/*!*****************************************************!*\ - !*** ./node_modules/@babel/code-frame/lib/index.js ***! - \*****************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/* WEBPACK VAR INJECTION */(function(process) { - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.codeFrameColumns = codeFrameColumns; -exports.default = _default; - -function _highlight() { - const data = _interopRequireWildcard(__webpack_require__(/*! @babel/highlight */ "./node_modules/@babel/highlight/lib/index.js")); - - _highlight = function () { - return data; - }; - - return data; -} - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -let deprecationWarningShown = false; - -function getDefs(chalk) { - return { - gutter: chalk.grey, - marker: chalk.red.bold, - message: chalk.red.bold - }; -} - -const NEWLINE = /\r\n|[\n\r\u2028\u2029]/; - -function getMarkerLines(loc, source, opts) { - const startLoc = Object.assign({ - column: 0, - line: -1 - }, loc.start); - const endLoc = Object.assign({}, startLoc, loc.end); - const { - linesAbove = 2, - linesBelow = 3 - } = opts || {}; - const startLine = startLoc.line; - const startColumn = startLoc.column; - const endLine = endLoc.line; - const endColumn = endLoc.column; - let start = Math.max(startLine - (linesAbove + 1), 0); - let end = Math.min(source.length, endLine + linesBelow); - - if (startLine === -1) { - start = 0; - } - - if (endLine === -1) { - end = source.length; - } - - const lineDiff = endLine - startLine; - const markerLines = {}; - - if (lineDiff) { - for (let i = 0; i <= lineDiff; i++) { - const lineNumber = i + startLine; - - if (!startColumn) { - markerLines[lineNumber] = true; - } else if (i === 0) { - const sourceLength = source[lineNumber - 1].length; - markerLines[lineNumber] = [startColumn, sourceLength - startColumn + 1]; - } else if (i === lineDiff) { - markerLines[lineNumber] = [0, endColumn]; - } else { - const sourceLength = source[lineNumber - i].length; - markerLines[lineNumber] = [0, sourceLength]; - } - } - } else { - if (startColumn === endColumn) { - if (startColumn) { - markerLines[startLine] = [startColumn, 0]; - } else { - markerLines[startLine] = true; - } - } else { - markerLines[startLine] = [startColumn, endColumn - startColumn]; - } - } - - return { - start, - end, - markerLines - }; -} - -function codeFrameColumns(rawLines, loc, opts = {}) { - const highlighted = (opts.highlightCode || opts.forceColor) && (0, _highlight().shouldHighlight)(opts); - const chalk = (0, _highlight().getChalk)(opts); - const defs = getDefs(chalk); - - const maybeHighlight = (chalkFn, string) => { - return highlighted ? chalkFn(string) : string; - }; - - const lines = rawLines.split(NEWLINE); - const { - start, - end, - markerLines - } = getMarkerLines(loc, lines, opts); - const hasColumns = loc.start && typeof loc.start.column === "number"; - const numberMaxWidth = String(end).length; - const highlightedLines = highlighted ? (0, _highlight().default)(rawLines, opts) : rawLines; - let frame = highlightedLines.split(NEWLINE).slice(start, end).map((line, index) => { - const number = start + 1 + index; - const paddedNumber = ` ${number}`.slice(-numberMaxWidth); - const gutter = ` ${paddedNumber} | `; - const hasMarker = markerLines[number]; - const lastMarkerLine = !markerLines[number + 1]; - - if (hasMarker) { - let markerLine = ""; - - if (Array.isArray(hasMarker)) { - const markerSpacing = line.slice(0, Math.max(hasMarker[0] - 1, 0)).replace(/[^\t]/g, " "); - const numberOfMarkers = hasMarker[1] || 1; - markerLine = ["\n ", maybeHighlight(defs.gutter, gutter.replace(/\d/g, " ")), markerSpacing, maybeHighlight(defs.marker, "^").repeat(numberOfMarkers)].join(""); - - if (lastMarkerLine && opts.message) { - markerLine += " " + maybeHighlight(defs.message, opts.message); - } - } - - return [maybeHighlight(defs.marker, ">"), maybeHighlight(defs.gutter, gutter), line, markerLine].join(""); - } else { - return ` ${maybeHighlight(defs.gutter, gutter)}${line}`; - } - }).join("\n"); - - if (opts.message && !hasColumns) { - frame = `${" ".repeat(numberMaxWidth + 1)}${opts.message}\n${frame}`; - } - - if (highlighted) { - return chalk.reset(frame); - } else { - return frame; - } -} - -function _default(rawLines, lineNumber, colNumber, opts = {}) { - if (!deprecationWarningShown) { - deprecationWarningShown = true; - const message = "Passing lineNumber and colNumber is deprecated to @babel/code-frame. Please use `codeFrameColumns`."; - - if (process.emitWarning) { - process.emitWarning(message, "DeprecationWarning"); - } else { - const deprecationError = new Error(message); - deprecationError.name = "DeprecationWarning"; - console.warn(new Error(message)); - } - } - - colNumber = Math.max(colNumber, 0); - const location = { - start: { - column: colNumber, - line: lineNumber - } - }; - return codeFrameColumns(rawLines, location, opts); -} -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../node-libs-browser/node_modules/process/browser.js */ "./node_modules/node-libs-browser/node_modules/process/browser.js"))) - -/***/ }), - -/***/ "./node_modules/@babel/generator/lib/buffer.js": -/*!*****************************************************!*\ - !*** ./node_modules/@babel/generator/lib/buffer.js ***! - \*****************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -function _trimRight() { - const data = _interopRequireDefault(__webpack_require__(/*! trim-right */ "./node_modules/trim-right/index.js")); - - _trimRight = function () { - return data; - }; - - return data; -} - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -const SPACES_RE = /^[ \t]+$/; - -class Buffer { - constructor(map) { - this._map = null; - this._buf = []; - this._last = ""; - this._queue = []; - this._position = { - line: 1, - column: 0 - }; - this._sourcePosition = { - identifierName: null, - line: null, - column: null, - filename: null - }; - this._disallowedPop = null; - this._map = map; - } - - get() { - this._flush(); - - const map = this._map; - const result = { - code: (0, _trimRight().default)(this._buf.join("")), - map: null, - rawMappings: map && map.getRawMappings() - }; - - if (map) { - Object.defineProperty(result, "map", { - configurable: true, - enumerable: true, - - get() { - return this.map = map.get(); - }, - - set(value) { - Object.defineProperty(this, "map", { - value, - writable: true - }); - } - - }); - } - - return result; - } - - append(str) { - this._flush(); - - const { - line, - column, - filename, - identifierName, - force - } = this._sourcePosition; - - this._append(str, line, column, identifierName, filename, force); - } - - queue(str) { - if (str === "\n") { - while (this._queue.length > 0 && SPACES_RE.test(this._queue[0][0])) { - this._queue.shift(); - } - } - - const { - line, - column, - filename, - identifierName, - force - } = this._sourcePosition; - - this._queue.unshift([str, line, column, identifierName, filename, force]); - } - - _flush() { - let item; - - while (item = this._queue.pop()) this._append(...item); - } - - _append(str, line, column, identifierName, filename, force) { - if (this._map && str[0] !== "\n") { - this._map.mark(this._position.line, this._position.column, line, column, identifierName, filename, force); - } - - this._buf.push(str); - - this._last = str[str.length - 1]; - - for (let i = 0; i < str.length; i++) { - if (str[i] === "\n") { - this._position.line++; - this._position.column = 0; - } else { - this._position.column++; - } - } - } - - removeTrailingNewline() { - if (this._queue.length > 0 && this._queue[0][0] === "\n") { - this._queue.shift(); - } - } - - removeLastSemicolon() { - if (this._queue.length > 0 && this._queue[0][0] === ";") { - this._queue.shift(); - } - } - - endsWith(suffix) { - if (suffix.length === 1) { - let last; - - if (this._queue.length > 0) { - const str = this._queue[0][0]; - last = str[str.length - 1]; - } else { - last = this._last; - } - - return last === suffix; - } - - const end = this._last + this._queue.reduce((acc, item) => item[0] + acc, ""); - - if (suffix.length <= end.length) { - return end.slice(-suffix.length) === suffix; - } - - return false; - } - - hasContent() { - return this._queue.length > 0 || !!this._last; - } - - exactSource(loc, cb) { - this.source("start", loc, true); - cb(); - this.source("end", loc); - - this._disallowPop("start", loc); - } - - source(prop, loc, force) { - if (prop && !loc) return; - - this._normalizePosition(prop, loc, this._sourcePosition, force); - } - - withSource(prop, loc, cb) { - if (!this._map) return cb(); - const originalLine = this._sourcePosition.line; - const originalColumn = this._sourcePosition.column; - const originalFilename = this._sourcePosition.filename; - const originalIdentifierName = this._sourcePosition.identifierName; - this.source(prop, loc); - cb(); - - if ((!this._sourcePosition.force || this._sourcePosition.line !== originalLine || this._sourcePosition.column !== originalColumn || this._sourcePosition.filename !== originalFilename) && (!this._disallowedPop || this._disallowedPop.line !== originalLine || this._disallowedPop.column !== originalColumn || this._disallowedPop.filename !== originalFilename)) { - this._sourcePosition.line = originalLine; - this._sourcePosition.column = originalColumn; - this._sourcePosition.filename = originalFilename; - this._sourcePosition.identifierName = originalIdentifierName; - this._sourcePosition.force = false; - this._disallowedPop = null; - } - } - - _disallowPop(prop, loc) { - if (prop && !loc) return; - this._disallowedPop = this._normalizePosition(prop, loc); - } - - _normalizePosition(prop, loc, targetObj, force) { - const pos = loc ? loc[prop] : null; - - if (targetObj === undefined) { - targetObj = { - identifierName: null, - line: null, - column: null, - filename: null, - force: false - }; - } - - const origLine = targetObj.line; - const origColumn = targetObj.column; - const origFilename = targetObj.filename; - targetObj.identifierName = prop === "start" && loc && loc.identifierName || null; - targetObj.line = pos ? pos.line : null; - targetObj.column = pos ? pos.column : null; - targetObj.filename = loc && loc.filename || null; - - if (force || targetObj.line !== origLine || targetObj.column !== origColumn || targetObj.filename !== origFilename) { - targetObj.force = force; - } - - return targetObj; - } - - getCurrentColumn() { - const extra = this._queue.reduce((acc, item) => item[0] + acc, ""); - - const lastIndex = extra.lastIndexOf("\n"); - return lastIndex === -1 ? this._position.column + extra.length : extra.length - 1 - lastIndex; - } - - getCurrentLine() { - const extra = this._queue.reduce((acc, item) => item[0] + acc, ""); - - let count = 0; - - for (let i = 0; i < extra.length; i++) { - if (extra[i] === "\n") count++; - } - - return this._position.line + count; - } - -} - -exports.default = Buffer; - -/***/ }), - -/***/ "./node_modules/@babel/generator/lib/generators/base.js": -/*!**************************************************************!*\ - !*** ./node_modules/@babel/generator/lib/generators/base.js ***! - \**************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.File = File; -exports.Program = Program; -exports.BlockStatement = BlockStatement; -exports.Noop = Noop; -exports.Directive = Directive; -exports.DirectiveLiteral = DirectiveLiteral; -exports.InterpreterDirective = InterpreterDirective; -exports.Placeholder = Placeholder; - -function File(node) { - if (node.program) { - this.print(node.program.interpreter, node); - } - - this.print(node.program, node); -} - -function Program(node) { - this.printInnerComments(node, false); - this.printSequence(node.directives, node); - if (node.directives && node.directives.length) this.newline(); - this.printSequence(node.body, node); -} - -function BlockStatement(node) { - this.token("{"); - this.printInnerComments(node); - const hasDirectives = node.directives && node.directives.length; - - if (node.body.length || hasDirectives) { - this.newline(); - this.printSequence(node.directives, node, { - indent: true - }); - if (hasDirectives) this.newline(); - this.printSequence(node.body, node, { - indent: true - }); - this.removeTrailingNewline(); - this.source("end", node.loc); - if (!this.endsWith("\n")) this.newline(); - this.rightBrace(); - } else { - this.source("end", node.loc); - this.token("}"); - } -} - -function Noop() {} - -function Directive(node) { - this.print(node.value, node); - this.semicolon(); -} - -const unescapedSingleQuoteRE = /(?:^|[^\\])(?:\\\\)*'/; -const unescapedDoubleQuoteRE = /(?:^|[^\\])(?:\\\\)*"/; - -function DirectiveLiteral(node) { - const raw = this.getPossibleRaw(node); - - if (raw != null) { - this.token(raw); - return; - } - - const { - value - } = node; - - if (!unescapedDoubleQuoteRE.test(value)) { - this.token(`"${value}"`); - } else if (!unescapedSingleQuoteRE.test(value)) { - this.token(`'${value}'`); - } else { - throw new Error("Malformed AST: it is not possible to print a directive containing" + " both unescaped single and double quotes."); - } -} - -function InterpreterDirective(node) { - this.token(`#!${node.value}\n`); -} - -function Placeholder(node) { - this.token("%%"); - this.print(node.name); - this.token("%%"); - - if (node.expectedNode === "Statement") { - this.semicolon(); - } -} - -/***/ }), - -/***/ "./node_modules/@babel/generator/lib/generators/classes.js": -/*!*****************************************************************!*\ - !*** ./node_modules/@babel/generator/lib/generators/classes.js ***! - \*****************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.ClassExpression = exports.ClassDeclaration = ClassDeclaration; -exports.ClassBody = ClassBody; -exports.ClassProperty = ClassProperty; -exports.ClassPrivateProperty = ClassPrivateProperty; -exports.ClassMethod = ClassMethod; -exports.ClassPrivateMethod = ClassPrivateMethod; -exports._classMethodHead = _classMethodHead; - -function t() { - const data = _interopRequireWildcard(__webpack_require__(/*! @babel/types */ "./node_modules/@babel/types/lib/index.js")); - - t = function () { - return data; - }; - - return data; -} - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -function ClassDeclaration(node, parent) { - if (!this.format.decoratorsBeforeExport || !t().isExportDefaultDeclaration(parent) && !t().isExportNamedDeclaration(parent)) { - this.printJoin(node.decorators, node); - } - - if (node.declare) { - this.word("declare"); - this.space(); - } - - if (node.abstract) { - this.word("abstract"); - this.space(); - } - - this.word("class"); - - if (node.id) { - this.space(); - this.print(node.id, node); - } - - this.print(node.typeParameters, node); - - if (node.superClass) { - this.space(); - this.word("extends"); - this.space(); - this.print(node.superClass, node); - this.print(node.superTypeParameters, node); - } - - if (node.implements) { - this.space(); - this.word("implements"); - this.space(); - this.printList(node.implements, node); - } - - this.space(); - this.print(node.body, node); -} - -function ClassBody(node) { - this.token("{"); - this.printInnerComments(node); - - if (node.body.length === 0) { - this.token("}"); - } else { - this.newline(); - this.indent(); - this.printSequence(node.body, node); - this.dedent(); - if (!this.endsWith("\n")) this.newline(); - this.rightBrace(); - } -} - -function ClassProperty(node) { - this.printJoin(node.decorators, node); - - if (node.accessibility) { - this.word(node.accessibility); - this.space(); - } - - if (node.static) { - this.word("static"); - this.space(); - } - - if (node.abstract) { - this.word("abstract"); - this.space(); - } - - if (node.readonly) { - this.word("readonly"); - this.space(); - } - - if (node.computed) { - this.token("["); - this.print(node.key, node); - this.token("]"); - } else { - this._variance(node); - - this.print(node.key, node); - } - - if (node.optional) { - this.token("?"); - } - - if (node.definite) { - this.token("!"); - } - - this.print(node.typeAnnotation, node); - - if (node.value) { - this.space(); - this.token("="); - this.space(); - this.print(node.value, node); - } - - this.semicolon(); -} - -function ClassPrivateProperty(node) { - if (node.static) { - this.word("static"); - this.space(); - } - - this.print(node.key, node); - this.print(node.typeAnnotation, node); - - if (node.value) { - this.space(); - this.token("="); - this.space(); - this.print(node.value, node); - } - - this.semicolon(); -} - -function ClassMethod(node) { - this._classMethodHead(node); - - this.space(); - this.print(node.body, node); -} - -function ClassPrivateMethod(node) { - this._classMethodHead(node); - - this.space(); - this.print(node.body, node); -} - -function _classMethodHead(node) { - this.printJoin(node.decorators, node); - - if (node.accessibility) { - this.word(node.accessibility); - this.space(); - } - - if (node.abstract) { - this.word("abstract"); - this.space(); - } - - if (node.static) { - this.word("static"); - this.space(); - } - - this._methodHead(node); -} - -/***/ }), - -/***/ "./node_modules/@babel/generator/lib/generators/expressions.js": -/*!*********************************************************************!*\ - !*** ./node_modules/@babel/generator/lib/generators/expressions.js ***! - \*********************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.UnaryExpression = UnaryExpression; -exports.DoExpression = DoExpression; -exports.ParenthesizedExpression = ParenthesizedExpression; -exports.UpdateExpression = UpdateExpression; -exports.ConditionalExpression = ConditionalExpression; -exports.NewExpression = NewExpression; -exports.SequenceExpression = SequenceExpression; -exports.ThisExpression = ThisExpression; -exports.Super = Super; -exports.Decorator = Decorator; -exports.OptionalMemberExpression = OptionalMemberExpression; -exports.OptionalCallExpression = OptionalCallExpression; -exports.CallExpression = CallExpression; -exports.Import = Import; -exports.EmptyStatement = EmptyStatement; -exports.ExpressionStatement = ExpressionStatement; -exports.AssignmentPattern = AssignmentPattern; -exports.LogicalExpression = exports.BinaryExpression = exports.AssignmentExpression = AssignmentExpression; -exports.BindExpression = BindExpression; -exports.MemberExpression = MemberExpression; -exports.MetaProperty = MetaProperty; -exports.PrivateName = PrivateName; -exports.AwaitExpression = exports.YieldExpression = void 0; - -function t() { - const data = _interopRequireWildcard(__webpack_require__(/*! @babel/types */ "./node_modules/@babel/types/lib/index.js")); - - t = function () { - return data; - }; - - return data; -} - -var n = _interopRequireWildcard(__webpack_require__(/*! ../node */ "./node_modules/@babel/generator/lib/node/index.js")); - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -function UnaryExpression(node) { - if (node.operator === "void" || node.operator === "delete" || node.operator === "typeof" || node.operator === "throw") { - this.word(node.operator); - this.space(); - } else { - this.token(node.operator); - } - - this.print(node.argument, node); -} - -function DoExpression(node) { - this.word("do"); - this.space(); - this.print(node.body, node); -} - -function ParenthesizedExpression(node) { - this.token("("); - this.print(node.expression, node); - this.token(")"); -} - -function UpdateExpression(node) { - if (node.prefix) { - this.token(node.operator); - this.print(node.argument, node); - } else { - this.startTerminatorless(true); - this.print(node.argument, node); - this.endTerminatorless(); - this.token(node.operator); - } -} - -function ConditionalExpression(node) { - this.print(node.test, node); - this.space(); - this.token("?"); - this.space(); - this.print(node.consequent, node); - this.space(); - this.token(":"); - this.space(); - this.print(node.alternate, node); -} - -function NewExpression(node, parent) { - this.word("new"); - this.space(); - this.print(node.callee, node); - - if (this.format.minified && node.arguments.length === 0 && !node.optional && !t().isCallExpression(parent, { - callee: node - }) && !t().isMemberExpression(parent) && !t().isNewExpression(parent)) { - return; - } - - this.print(node.typeArguments, node); - this.print(node.typeParameters, node); - - if (node.optional) { - this.token("?."); - } - - this.token("("); - this.printList(node.arguments, node); - this.token(")"); -} - -function SequenceExpression(node) { - this.printList(node.expressions, node); -} - -function ThisExpression() { - this.word("this"); -} - -function Super() { - this.word("super"); -} - -function Decorator(node) { - this.token("@"); - this.print(node.expression, node); - this.newline(); -} - -function OptionalMemberExpression(node) { - this.print(node.object, node); - - if (!node.computed && t().isMemberExpression(node.property)) { - throw new TypeError("Got a MemberExpression for MemberExpression property"); - } - - let computed = node.computed; - - if (t().isLiteral(node.property) && typeof node.property.value === "number") { - computed = true; - } - - if (node.optional) { - this.token("?."); - } - - if (computed) { - this.token("["); - this.print(node.property, node); - this.token("]"); - } else { - if (!node.optional) { - this.token("."); - } - - this.print(node.property, node); - } -} - -function OptionalCallExpression(node) { - this.print(node.callee, node); - this.print(node.typeArguments, node); - this.print(node.typeParameters, node); - - if (node.optional) { - this.token("?."); - } - - this.token("("); - this.printList(node.arguments, node); - this.token(")"); -} - -function CallExpression(node) { - this.print(node.callee, node); - this.print(node.typeArguments, node); - this.print(node.typeParameters, node); - this.token("("); - this.printList(node.arguments, node); - this.token(")"); -} - -function Import() { - this.word("import"); -} - -function buildYieldAwait(keyword) { - return function (node) { - this.word(keyword); - - if (node.delegate) { - this.token("*"); - } - - if (node.argument) { - this.space(); - const terminatorState = this.startTerminatorless(); - this.print(node.argument, node); - this.endTerminatorless(terminatorState); - } - }; -} - -const YieldExpression = buildYieldAwait("yield"); -exports.YieldExpression = YieldExpression; -const AwaitExpression = buildYieldAwait("await"); -exports.AwaitExpression = AwaitExpression; - -function EmptyStatement() { - this.semicolon(true); -} - -function ExpressionStatement(node) { - this.print(node.expression, node); - this.semicolon(); -} - -function AssignmentPattern(node) { - this.print(node.left, node); - if (node.left.optional) this.token("?"); - this.print(node.left.typeAnnotation, node); - this.space(); - this.token("="); - this.space(); - this.print(node.right, node); -} - -function AssignmentExpression(node, parent) { - const parens = this.inForStatementInitCounter && node.operator === "in" && !n.needsParens(node, parent); - - if (parens) { - this.token("("); - } - - this.print(node.left, node); - this.space(); - - if (node.operator === "in" || node.operator === "instanceof") { - this.word(node.operator); - } else { - this.token(node.operator); - } - - this.space(); - this.print(node.right, node); - - if (parens) { - this.token(")"); - } -} - -function BindExpression(node) { - this.print(node.object, node); - this.token("::"); - this.print(node.callee, node); -} - -function MemberExpression(node) { - this.print(node.object, node); - - if (!node.computed && t().isMemberExpression(node.property)) { - throw new TypeError("Got a MemberExpression for MemberExpression property"); - } - - let computed = node.computed; - - if (t().isLiteral(node.property) && typeof node.property.value === "number") { - computed = true; - } - - if (computed) { - this.token("["); - this.print(node.property, node); - this.token("]"); - } else { - this.token("."); - this.print(node.property, node); - } -} - -function MetaProperty(node) { - this.print(node.meta, node); - this.token("."); - this.print(node.property, node); -} - -function PrivateName(node) { - this.token("#"); - this.print(node.id, node); -} - -/***/ }), - -/***/ "./node_modules/@babel/generator/lib/generators/flow.js": -/*!**************************************************************!*\ - !*** ./node_modules/@babel/generator/lib/generators/flow.js ***! - \**************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.AnyTypeAnnotation = AnyTypeAnnotation; -exports.ArrayTypeAnnotation = ArrayTypeAnnotation; -exports.BooleanTypeAnnotation = BooleanTypeAnnotation; -exports.BooleanLiteralTypeAnnotation = BooleanLiteralTypeAnnotation; -exports.NullLiteralTypeAnnotation = NullLiteralTypeAnnotation; -exports.DeclareClass = DeclareClass; -exports.DeclareFunction = DeclareFunction; -exports.InferredPredicate = InferredPredicate; -exports.DeclaredPredicate = DeclaredPredicate; -exports.DeclareInterface = DeclareInterface; -exports.DeclareModule = DeclareModule; -exports.DeclareModuleExports = DeclareModuleExports; -exports.DeclareTypeAlias = DeclareTypeAlias; -exports.DeclareOpaqueType = DeclareOpaqueType; -exports.DeclareVariable = DeclareVariable; -exports.DeclareExportDeclaration = DeclareExportDeclaration; -exports.DeclareExportAllDeclaration = DeclareExportAllDeclaration; -exports.ExistsTypeAnnotation = ExistsTypeAnnotation; -exports.FunctionTypeAnnotation = FunctionTypeAnnotation; -exports.FunctionTypeParam = FunctionTypeParam; -exports.GenericTypeAnnotation = exports.ClassImplements = exports.InterfaceExtends = InterfaceExtends; -exports._interfaceish = _interfaceish; -exports._variance = _variance; -exports.InterfaceDeclaration = InterfaceDeclaration; -exports.InterfaceTypeAnnotation = InterfaceTypeAnnotation; -exports.IntersectionTypeAnnotation = IntersectionTypeAnnotation; -exports.MixedTypeAnnotation = MixedTypeAnnotation; -exports.EmptyTypeAnnotation = EmptyTypeAnnotation; -exports.NullableTypeAnnotation = NullableTypeAnnotation; -exports.NumberTypeAnnotation = NumberTypeAnnotation; -exports.StringTypeAnnotation = StringTypeAnnotation; -exports.ThisTypeAnnotation = ThisTypeAnnotation; -exports.TupleTypeAnnotation = TupleTypeAnnotation; -exports.TypeofTypeAnnotation = TypeofTypeAnnotation; -exports.TypeAlias = TypeAlias; -exports.TypeAnnotation = TypeAnnotation; -exports.TypeParameterDeclaration = exports.TypeParameterInstantiation = TypeParameterInstantiation; -exports.TypeParameter = TypeParameter; -exports.OpaqueType = OpaqueType; -exports.ObjectTypeAnnotation = ObjectTypeAnnotation; -exports.ObjectTypeInternalSlot = ObjectTypeInternalSlot; -exports.ObjectTypeCallProperty = ObjectTypeCallProperty; -exports.ObjectTypeIndexer = ObjectTypeIndexer; -exports.ObjectTypeProperty = ObjectTypeProperty; -exports.ObjectTypeSpreadProperty = ObjectTypeSpreadProperty; -exports.QualifiedTypeIdentifier = QualifiedTypeIdentifier; -exports.UnionTypeAnnotation = UnionTypeAnnotation; -exports.TypeCastExpression = TypeCastExpression; -exports.Variance = Variance; -exports.VoidTypeAnnotation = VoidTypeAnnotation; -Object.defineProperty(exports, "NumberLiteralTypeAnnotation", { - enumerable: true, - get: function () { - return _types2.NumericLiteral; - } -}); -Object.defineProperty(exports, "StringLiteralTypeAnnotation", { - enumerable: true, - get: function () { - return _types2.StringLiteral; - } -}); - -function t() { - const data = _interopRequireWildcard(__webpack_require__(/*! @babel/types */ "./node_modules/@babel/types/lib/index.js")); - - t = function () { - return data; - }; - - return data; -} - -var _modules = __webpack_require__(/*! ./modules */ "./node_modules/@babel/generator/lib/generators/modules.js"); - -var _types2 = __webpack_require__(/*! ./types */ "./node_modules/@babel/generator/lib/generators/types.js"); - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -function AnyTypeAnnotation() { - this.word("any"); -} - -function ArrayTypeAnnotation(node) { - this.print(node.elementType, node); - this.token("["); - this.token("]"); -} - -function BooleanTypeAnnotation() { - this.word("boolean"); -} - -function BooleanLiteralTypeAnnotation(node) { - this.word(node.value ? "true" : "false"); -} - -function NullLiteralTypeAnnotation() { - this.word("null"); -} - -function DeclareClass(node, parent) { - if (!t().isDeclareExportDeclaration(parent)) { - this.word("declare"); - this.space(); - } - - this.word("class"); - this.space(); - - this._interfaceish(node); -} - -function DeclareFunction(node, parent) { - if (!t().isDeclareExportDeclaration(parent)) { - this.word("declare"); - this.space(); - } - - this.word("function"); - this.space(); - this.print(node.id, node); - this.print(node.id.typeAnnotation.typeAnnotation, node); - - if (node.predicate) { - this.space(); - this.print(node.predicate, node); - } - - this.semicolon(); -} - -function InferredPredicate() { - this.token("%"); - this.word("checks"); -} - -function DeclaredPredicate(node) { - this.token("%"); - this.word("checks"); - this.token("("); - this.print(node.value, node); - this.token(")"); -} - -function DeclareInterface(node) { - this.word("declare"); - this.space(); - this.InterfaceDeclaration(node); -} - -function DeclareModule(node) { - this.word("declare"); - this.space(); - this.word("module"); - this.space(); - this.print(node.id, node); - this.space(); - this.print(node.body, node); -} - -function DeclareModuleExports(node) { - this.word("declare"); - this.space(); - this.word("module"); - this.token("."); - this.word("exports"); - this.print(node.typeAnnotation, node); -} - -function DeclareTypeAlias(node) { - this.word("declare"); - this.space(); - this.TypeAlias(node); -} - -function DeclareOpaqueType(node, parent) { - if (!t().isDeclareExportDeclaration(parent)) { - this.word("declare"); - this.space(); - } - - this.OpaqueType(node); -} - -function DeclareVariable(node, parent) { - if (!t().isDeclareExportDeclaration(parent)) { - this.word("declare"); - this.space(); - } - - this.word("var"); - this.space(); - this.print(node.id, node); - this.print(node.id.typeAnnotation, node); - this.semicolon(); -} - -function DeclareExportDeclaration(node) { - this.word("declare"); - this.space(); - this.word("export"); - this.space(); - - if (node.default) { - this.word("default"); - this.space(); - } - - FlowExportDeclaration.apply(this, arguments); -} - -function DeclareExportAllDeclaration() { - this.word("declare"); - this.space(); - - _modules.ExportAllDeclaration.apply(this, arguments); -} - -function FlowExportDeclaration(node) { - if (node.declaration) { - const declar = node.declaration; - this.print(declar, node); - if (!t().isStatement(declar)) this.semicolon(); - } else { - this.token("{"); - - if (node.specifiers.length) { - this.space(); - this.printList(node.specifiers, node); - this.space(); - } - - this.token("}"); - - if (node.source) { - this.space(); - this.word("from"); - this.space(); - this.print(node.source, node); - } - - this.semicolon(); - } -} - -function ExistsTypeAnnotation() { - this.token("*"); -} - -function FunctionTypeAnnotation(node, parent) { - this.print(node.typeParameters, node); - this.token("("); - this.printList(node.params, node); - - if (node.rest) { - if (node.params.length) { - this.token(","); - this.space(); - } - - this.token("..."); - this.print(node.rest, node); - } - - this.token(")"); - - if (parent.type === "ObjectTypeCallProperty" || parent.type === "DeclareFunction" || parent.type === "ObjectTypeProperty" && parent.method) { - this.token(":"); - } else { - this.space(); - this.token("=>"); - } - - this.space(); - this.print(node.returnType, node); -} - -function FunctionTypeParam(node) { - this.print(node.name, node); - if (node.optional) this.token("?"); - - if (node.name) { - this.token(":"); - this.space(); - } - - this.print(node.typeAnnotation, node); -} - -function InterfaceExtends(node) { - this.print(node.id, node); - this.print(node.typeParameters, node); -} - -function _interfaceish(node) { - this.print(node.id, node); - this.print(node.typeParameters, node); - - if (node.extends.length) { - this.space(); - this.word("extends"); - this.space(); - this.printList(node.extends, node); - } - - if (node.mixins && node.mixins.length) { - this.space(); - this.word("mixins"); - this.space(); - this.printList(node.mixins, node); - } - - if (node.implements && node.implements.length) { - this.space(); - this.word("implements"); - this.space(); - this.printList(node.implements, node); - } - - this.space(); - this.print(node.body, node); -} - -function _variance(node) { - if (node.variance) { - if (node.variance.kind === "plus") { - this.token("+"); - } else if (node.variance.kind === "minus") { - this.token("-"); - } - } -} - -function InterfaceDeclaration(node) { - this.word("interface"); - this.space(); - - this._interfaceish(node); -} - -function andSeparator() { - this.space(); - this.token("&"); - this.space(); -} - -function InterfaceTypeAnnotation(node) { - this.word("interface"); - - if (node.extends && node.extends.length) { - this.space(); - this.word("extends"); - this.space(); - this.printList(node.extends, node); - } - - this.space(); - this.print(node.body, node); -} - -function IntersectionTypeAnnotation(node) { - this.printJoin(node.types, node, { - separator: andSeparator - }); -} - -function MixedTypeAnnotation() { - this.word("mixed"); -} - -function EmptyTypeAnnotation() { - this.word("empty"); -} - -function NullableTypeAnnotation(node) { - this.token("?"); - this.print(node.typeAnnotation, node); -} - -function NumberTypeAnnotation() { - this.word("number"); -} - -function StringTypeAnnotation() { - this.word("string"); -} - -function ThisTypeAnnotation() { - this.word("this"); -} - -function TupleTypeAnnotation(node) { - this.token("["); - this.printList(node.types, node); - this.token("]"); -} - -function TypeofTypeAnnotation(node) { - this.word("typeof"); - this.space(); - this.print(node.argument, node); -} - -function TypeAlias(node) { - this.word("type"); - this.space(); - this.print(node.id, node); - this.print(node.typeParameters, node); - this.space(); - this.token("="); - this.space(); - this.print(node.right, node); - this.semicolon(); -} - -function TypeAnnotation(node) { - this.token(":"); - this.space(); - if (node.optional) this.token("?"); - this.print(node.typeAnnotation, node); -} - -function TypeParameterInstantiation(node) { - this.token("<"); - this.printList(node.params, node, {}); - this.token(">"); -} - -function TypeParameter(node) { - this._variance(node); - - this.word(node.name); - - if (node.bound) { - this.print(node.bound, node); - } - - if (node.default) { - this.space(); - this.token("="); - this.space(); - this.print(node.default, node); - } -} - -function OpaqueType(node) { - this.word("opaque"); - this.space(); - this.word("type"); - this.space(); - this.print(node.id, node); - this.print(node.typeParameters, node); - - if (node.supertype) { - this.token(":"); - this.space(); - this.print(node.supertype, node); - } - - if (node.impltype) { - this.space(); - this.token("="); - this.space(); - this.print(node.impltype, node); - } - - this.semicolon(); -} - -function ObjectTypeAnnotation(node) { - if (node.exact) { - this.token("{|"); - } else { - this.token("{"); - } - - const props = node.properties.concat(node.callProperties || [], node.indexers || [], node.internalSlots || []); - - if (props.length) { - this.space(); - this.printJoin(props, node, { - addNewlines(leading) { - if (leading && !props[0]) return 1; - }, - - indent: true, - statement: true, - iterator: () => { - if (props.length !== 1 || node.inexact) { - this.token(","); - this.space(); - } - } - }); - this.space(); - } - - if (node.inexact) { - this.indent(); - this.token("..."); - - if (props.length) { - this.newline(); - } - - this.dedent(); - } - - if (node.exact) { - this.token("|}"); - } else { - this.token("}"); - } -} - -function ObjectTypeInternalSlot(node) { - if (node.static) { - this.word("static"); - this.space(); - } - - this.token("["); - this.token("["); - this.print(node.id, node); - this.token("]"); - this.token("]"); - if (node.optional) this.token("?"); - - if (!node.method) { - this.token(":"); - this.space(); - } - - this.print(node.value, node); -} - -function ObjectTypeCallProperty(node) { - if (node.static) { - this.word("static"); - this.space(); - } - - this.print(node.value, node); -} - -function ObjectTypeIndexer(node) { - if (node.static) { - this.word("static"); - this.space(); - } - - this._variance(node); - - this.token("["); - - if (node.id) { - this.print(node.id, node); - this.token(":"); - this.space(); - } - - this.print(node.key, node); - this.token("]"); - this.token(":"); - this.space(); - this.print(node.value, node); -} - -function ObjectTypeProperty(node) { - if (node.proto) { - this.word("proto"); - this.space(); - } - - if (node.static) { - this.word("static"); - this.space(); - } - - this._variance(node); - - this.print(node.key, node); - if (node.optional) this.token("?"); - - if (!node.method) { - this.token(":"); - this.space(); - } - - this.print(node.value, node); -} - -function ObjectTypeSpreadProperty(node) { - this.token("..."); - this.print(node.argument, node); -} - -function QualifiedTypeIdentifier(node) { - this.print(node.qualification, node); - this.token("."); - this.print(node.id, node); -} - -function orSeparator() { - this.space(); - this.token("|"); - this.space(); -} - -function UnionTypeAnnotation(node) { - this.printJoin(node.types, node, { - separator: orSeparator - }); -} - -function TypeCastExpression(node) { - this.token("("); - this.print(node.expression, node); - this.print(node.typeAnnotation, node); - this.token(")"); -} - -function Variance(node) { - if (node.kind === "plus") { - this.token("+"); - } else { - this.token("-"); - } -} - -function VoidTypeAnnotation() { - this.word("void"); -} - -/***/ }), - -/***/ "./node_modules/@babel/generator/lib/generators/index.js": -/*!***************************************************************!*\ - !*** ./node_modules/@babel/generator/lib/generators/index.js ***! - \***************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _templateLiterals = __webpack_require__(/*! ./template-literals */ "./node_modules/@babel/generator/lib/generators/template-literals.js"); - -Object.keys(_templateLiterals).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _templateLiterals[key]; - } - }); -}); - -var _expressions = __webpack_require__(/*! ./expressions */ "./node_modules/@babel/generator/lib/generators/expressions.js"); - -Object.keys(_expressions).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _expressions[key]; - } - }); -}); - -var _statements = __webpack_require__(/*! ./statements */ "./node_modules/@babel/generator/lib/generators/statements.js"); - -Object.keys(_statements).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _statements[key]; - } - }); -}); - -var _classes = __webpack_require__(/*! ./classes */ "./node_modules/@babel/generator/lib/generators/classes.js"); - -Object.keys(_classes).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _classes[key]; - } - }); -}); - -var _methods = __webpack_require__(/*! ./methods */ "./node_modules/@babel/generator/lib/generators/methods.js"); - -Object.keys(_methods).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _methods[key]; - } - }); -}); - -var _modules = __webpack_require__(/*! ./modules */ "./node_modules/@babel/generator/lib/generators/modules.js"); - -Object.keys(_modules).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _modules[key]; - } - }); -}); - -var _types = __webpack_require__(/*! ./types */ "./node_modules/@babel/generator/lib/generators/types.js"); - -Object.keys(_types).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _types[key]; - } - }); -}); - -var _flow = __webpack_require__(/*! ./flow */ "./node_modules/@babel/generator/lib/generators/flow.js"); - -Object.keys(_flow).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _flow[key]; - } - }); -}); - -var _base = __webpack_require__(/*! ./base */ "./node_modules/@babel/generator/lib/generators/base.js"); - -Object.keys(_base).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _base[key]; - } - }); -}); - -var _jsx = __webpack_require__(/*! ./jsx */ "./node_modules/@babel/generator/lib/generators/jsx.js"); - -Object.keys(_jsx).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _jsx[key]; - } - }); -}); - -var _typescript = __webpack_require__(/*! ./typescript */ "./node_modules/@babel/generator/lib/generators/typescript.js"); - -Object.keys(_typescript).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _typescript[key]; - } - }); -}); - -/***/ }), - -/***/ "./node_modules/@babel/generator/lib/generators/jsx.js": -/*!*************************************************************!*\ - !*** ./node_modules/@babel/generator/lib/generators/jsx.js ***! - \*************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.JSXAttribute = JSXAttribute; -exports.JSXIdentifier = JSXIdentifier; -exports.JSXNamespacedName = JSXNamespacedName; -exports.JSXMemberExpression = JSXMemberExpression; -exports.JSXSpreadAttribute = JSXSpreadAttribute; -exports.JSXExpressionContainer = JSXExpressionContainer; -exports.JSXSpreadChild = JSXSpreadChild; -exports.JSXText = JSXText; -exports.JSXElement = JSXElement; -exports.JSXOpeningElement = JSXOpeningElement; -exports.JSXClosingElement = JSXClosingElement; -exports.JSXEmptyExpression = JSXEmptyExpression; -exports.JSXFragment = JSXFragment; -exports.JSXOpeningFragment = JSXOpeningFragment; -exports.JSXClosingFragment = JSXClosingFragment; - -function JSXAttribute(node) { - this.print(node.name, node); - - if (node.value) { - this.token("="); - this.print(node.value, node); - } -} - -function JSXIdentifier(node) { - this.word(node.name); -} - -function JSXNamespacedName(node) { - this.print(node.namespace, node); - this.token(":"); - this.print(node.name, node); -} - -function JSXMemberExpression(node) { - this.print(node.object, node); - this.token("."); - this.print(node.property, node); -} - -function JSXSpreadAttribute(node) { - this.token("{"); - this.token("..."); - this.print(node.argument, node); - this.token("}"); -} - -function JSXExpressionContainer(node) { - this.token("{"); - this.print(node.expression, node); - this.token("}"); -} - -function JSXSpreadChild(node) { - this.token("{"); - this.token("..."); - this.print(node.expression, node); - this.token("}"); -} - -function JSXText(node) { - const raw = this.getPossibleRaw(node); - - if (raw != null) { - this.token(raw); - } else { - this.token(node.value); - } -} - -function JSXElement(node) { - const open = node.openingElement; - this.print(open, node); - if (open.selfClosing) return; - this.indent(); - - for (const child of node.children) { - this.print(child, node); - } - - this.dedent(); - this.print(node.closingElement, node); -} - -function spaceSeparator() { - this.space(); -} - -function JSXOpeningElement(node) { - this.token("<"); - this.print(node.name, node); - this.print(node.typeParameters, node); - - if (node.attributes.length > 0) { - this.space(); - this.printJoin(node.attributes, node, { - separator: spaceSeparator - }); - } - - if (node.selfClosing) { - this.space(); - this.token("/>"); - } else { - this.token(">"); - } -} - -function JSXClosingElement(node) { - this.token(""); -} - -function JSXEmptyExpression(node) { - this.printInnerComments(node); -} - -function JSXFragment(node) { - this.print(node.openingFragment, node); - this.indent(); - - for (const child of node.children) { - this.print(child, node); - } - - this.dedent(); - this.print(node.closingFragment, node); -} - -function JSXOpeningFragment() { - this.token("<"); - this.token(">"); -} - -function JSXClosingFragment() { - this.token(""); -} - -/***/ }), - -/***/ "./node_modules/@babel/generator/lib/generators/methods.js": -/*!*****************************************************************!*\ - !*** ./node_modules/@babel/generator/lib/generators/methods.js ***! - \*****************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports._params = _params; -exports._parameters = _parameters; -exports._param = _param; -exports._methodHead = _methodHead; -exports._predicate = _predicate; -exports._functionHead = _functionHead; -exports.FunctionDeclaration = exports.FunctionExpression = FunctionExpression; -exports.ArrowFunctionExpression = ArrowFunctionExpression; - -function t() { - const data = _interopRequireWildcard(__webpack_require__(/*! @babel/types */ "./node_modules/@babel/types/lib/index.js")); - - t = function () { - return data; - }; - - return data; -} - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -function _params(node) { - this.print(node.typeParameters, node); - this.token("("); - - this._parameters(node.params, node); - - this.token(")"); - this.print(node.returnType, node); -} - -function _parameters(parameters, parent) { - for (let i = 0; i < parameters.length; i++) { - this._param(parameters[i], parent); - - if (i < parameters.length - 1) { - this.token(","); - this.space(); - } - } -} - -function _param(parameter, parent) { - this.printJoin(parameter.decorators, parameter); - this.print(parameter, parent); - if (parameter.optional) this.token("?"); - this.print(parameter.typeAnnotation, parameter); -} - -function _methodHead(node) { - const kind = node.kind; - const key = node.key; - - if (kind === "get" || kind === "set") { - this.word(kind); - this.space(); - } - - if (node.async) { - this.word("async"); - this.space(); - } - - if (kind === "method" || kind === "init") { - if (node.generator) { - this.token("*"); - } - } - - if (node.computed) { - this.token("["); - this.print(key, node); - this.token("]"); - } else { - this.print(key, node); - } - - if (node.optional) { - this.token("?"); - } - - this._params(node); -} - -function _predicate(node) { - if (node.predicate) { - if (!node.returnType) { - this.token(":"); - } - - this.space(); - this.print(node.predicate, node); - } -} - -function _functionHead(node) { - if (node.async) { - this.word("async"); - this.space(); - } - - this.word("function"); - if (node.generator) this.token("*"); - this.space(); - - if (node.id) { - this.print(node.id, node); - } - - this._params(node); - - this._predicate(node); -} - -function FunctionExpression(node) { - this._functionHead(node); - - this.space(); - this.print(node.body, node); -} - -function ArrowFunctionExpression(node) { - if (node.async) { - this.word("async"); - this.space(); - } - - const firstParam = node.params[0]; - - if (node.params.length === 1 && t().isIdentifier(firstParam) && !hasTypes(node, firstParam)) { - if (this.format.retainLines && node.loc && node.body.loc && node.loc.start.line < node.body.loc.start.line) { - this.token("("); - - if (firstParam.loc && firstParam.loc.start.line > node.loc.start.line) { - this.indent(); - this.print(firstParam, node); - this.dedent(); - - this._catchUp("start", node.body.loc); - } else { - this.print(firstParam, node); - } - - this.token(")"); - } else { - this.print(firstParam, node); - } - } else { - this._params(node); - } - - this._predicate(node); - - this.space(); - this.token("=>"); - this.space(); - this.print(node.body, node); -} - -function hasTypes(node, param) { - return node.typeParameters || node.returnType || param.typeAnnotation || param.optional || param.trailingComments; -} - -/***/ }), - -/***/ "./node_modules/@babel/generator/lib/generators/modules.js": -/*!*****************************************************************!*\ - !*** ./node_modules/@babel/generator/lib/generators/modules.js ***! - \*****************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.ImportSpecifier = ImportSpecifier; -exports.ImportDefaultSpecifier = ImportDefaultSpecifier; -exports.ExportDefaultSpecifier = ExportDefaultSpecifier; -exports.ExportSpecifier = ExportSpecifier; -exports.ExportNamespaceSpecifier = ExportNamespaceSpecifier; -exports.ExportAllDeclaration = ExportAllDeclaration; -exports.ExportNamedDeclaration = ExportNamedDeclaration; -exports.ExportDefaultDeclaration = ExportDefaultDeclaration; -exports.ImportDeclaration = ImportDeclaration; -exports.ImportNamespaceSpecifier = ImportNamespaceSpecifier; - -function t() { - const data = _interopRequireWildcard(__webpack_require__(/*! @babel/types */ "./node_modules/@babel/types/lib/index.js")); - - t = function () { - return data; - }; - - return data; -} - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -function ImportSpecifier(node) { - if (node.importKind === "type" || node.importKind === "typeof") { - this.word(node.importKind); - this.space(); - } - - this.print(node.imported, node); - - if (node.local && node.local.name !== node.imported.name) { - this.space(); - this.word("as"); - this.space(); - this.print(node.local, node); - } -} - -function ImportDefaultSpecifier(node) { - this.print(node.local, node); -} - -function ExportDefaultSpecifier(node) { - this.print(node.exported, node); -} - -function ExportSpecifier(node) { - this.print(node.local, node); - - if (node.exported && node.local.name !== node.exported.name) { - this.space(); - this.word("as"); - this.space(); - this.print(node.exported, node); - } -} - -function ExportNamespaceSpecifier(node) { - this.token("*"); - this.space(); - this.word("as"); - this.space(); - this.print(node.exported, node); -} - -function ExportAllDeclaration(node) { - this.word("export"); - this.space(); - - if (node.exportKind === "type") { - this.word("type"); - this.space(); - } - - this.token("*"); - this.space(); - this.word("from"); - this.space(); - this.print(node.source, node); - this.semicolon(); -} - -function ExportNamedDeclaration(node) { - if (this.format.decoratorsBeforeExport && t().isClassDeclaration(node.declaration)) { - this.printJoin(node.declaration.decorators, node); - } - - this.word("export"); - this.space(); - ExportDeclaration.apply(this, arguments); -} - -function ExportDefaultDeclaration(node) { - if (this.format.decoratorsBeforeExport && t().isClassDeclaration(node.declaration)) { - this.printJoin(node.declaration.decorators, node); - } - - this.word("export"); - this.space(); - this.word("default"); - this.space(); - ExportDeclaration.apply(this, arguments); -} - -function ExportDeclaration(node) { - if (node.declaration) { - const declar = node.declaration; - this.print(declar, node); - if (!t().isStatement(declar)) this.semicolon(); - } else { - if (node.exportKind === "type") { - this.word("type"); - this.space(); - } - - const specifiers = node.specifiers.slice(0); - let hasSpecial = false; - - while (true) { - const first = specifiers[0]; - - if (t().isExportDefaultSpecifier(first) || t().isExportNamespaceSpecifier(first)) { - hasSpecial = true; - this.print(specifiers.shift(), node); - - if (specifiers.length) { - this.token(","); - this.space(); - } - } else { - break; - } - } - - if (specifiers.length || !specifiers.length && !hasSpecial) { - this.token("{"); - - if (specifiers.length) { - this.space(); - this.printList(specifiers, node); - this.space(); - } - - this.token("}"); - } - - if (node.source) { - this.space(); - this.word("from"); - this.space(); - this.print(node.source, node); - } - - this.semicolon(); - } -} - -function ImportDeclaration(node) { - this.word("import"); - this.space(); - - if (node.importKind === "type" || node.importKind === "typeof") { - this.word(node.importKind); - this.space(); - } - - const specifiers = node.specifiers.slice(0); - - if (specifiers && specifiers.length) { - while (true) { - const first = specifiers[0]; - - if (t().isImportDefaultSpecifier(first) || t().isImportNamespaceSpecifier(first)) { - this.print(specifiers.shift(), node); - - if (specifiers.length) { - this.token(","); - this.space(); - } - } else { - break; - } - } - - if (specifiers.length) { - this.token("{"); - this.space(); - this.printList(specifiers, node); - this.space(); - this.token("}"); - } - - this.space(); - this.word("from"); - this.space(); - } - - this.print(node.source, node); - this.semicolon(); -} - -function ImportNamespaceSpecifier(node) { - this.token("*"); - this.space(); - this.word("as"); - this.space(); - this.print(node.local, node); -} - -/***/ }), - -/***/ "./node_modules/@babel/generator/lib/generators/statements.js": -/*!********************************************************************!*\ - !*** ./node_modules/@babel/generator/lib/generators/statements.js ***! - \********************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.WithStatement = WithStatement; -exports.IfStatement = IfStatement; -exports.ForStatement = ForStatement; -exports.WhileStatement = WhileStatement; -exports.DoWhileStatement = DoWhileStatement; -exports.LabeledStatement = LabeledStatement; -exports.TryStatement = TryStatement; -exports.CatchClause = CatchClause; -exports.SwitchStatement = SwitchStatement; -exports.SwitchCase = SwitchCase; -exports.DebuggerStatement = DebuggerStatement; -exports.VariableDeclaration = VariableDeclaration; -exports.VariableDeclarator = VariableDeclarator; -exports.ThrowStatement = exports.BreakStatement = exports.ReturnStatement = exports.ContinueStatement = exports.ForOfStatement = exports.ForInStatement = void 0; - -function t() { - const data = _interopRequireWildcard(__webpack_require__(/*! @babel/types */ "./node_modules/@babel/types/lib/index.js")); - - t = function () { - return data; - }; - - return data; -} - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -function WithStatement(node) { - this.word("with"); - this.space(); - this.token("("); - this.print(node.object, node); - this.token(")"); - this.printBlock(node); -} - -function IfStatement(node) { - this.word("if"); - this.space(); - this.token("("); - this.print(node.test, node); - this.token(")"); - this.space(); - const needsBlock = node.alternate && t().isIfStatement(getLastStatement(node.consequent)); - - if (needsBlock) { - this.token("{"); - this.newline(); - this.indent(); - } - - this.printAndIndentOnComments(node.consequent, node); - - if (needsBlock) { - this.dedent(); - this.newline(); - this.token("}"); - } - - if (node.alternate) { - if (this.endsWith("}")) this.space(); - this.word("else"); - this.space(); - this.printAndIndentOnComments(node.alternate, node); - } -} - -function getLastStatement(statement) { - if (!t().isStatement(statement.body)) return statement; - return getLastStatement(statement.body); -} - -function ForStatement(node) { - this.word("for"); - this.space(); - this.token("("); - this.inForStatementInitCounter++; - this.print(node.init, node); - this.inForStatementInitCounter--; - this.token(";"); - - if (node.test) { - this.space(); - this.print(node.test, node); - } - - this.token(";"); - - if (node.update) { - this.space(); - this.print(node.update, node); - } - - this.token(")"); - this.printBlock(node); -} - -function WhileStatement(node) { - this.word("while"); - this.space(); - this.token("("); - this.print(node.test, node); - this.token(")"); - this.printBlock(node); -} - -const buildForXStatement = function (op) { - return function (node) { - this.word("for"); - this.space(); - - if (op === "of" && node.await) { - this.word("await"); - this.space(); - } - - this.token("("); - this.print(node.left, node); - this.space(); - this.word(op); - this.space(); - this.print(node.right, node); - this.token(")"); - this.printBlock(node); - }; -}; - -const ForInStatement = buildForXStatement("in"); -exports.ForInStatement = ForInStatement; -const ForOfStatement = buildForXStatement("of"); -exports.ForOfStatement = ForOfStatement; - -function DoWhileStatement(node) { - this.word("do"); - this.space(); - this.print(node.body, node); - this.space(); - this.word("while"); - this.space(); - this.token("("); - this.print(node.test, node); - this.token(")"); - this.semicolon(); -} - -function buildLabelStatement(prefix, key = "label") { - return function (node) { - this.word(prefix); - const label = node[key]; - - if (label) { - this.space(); - const isLabel = key == "label"; - const terminatorState = this.startTerminatorless(isLabel); - this.print(label, node); - this.endTerminatorless(terminatorState); - } - - this.semicolon(); - }; -} - -const ContinueStatement = buildLabelStatement("continue"); -exports.ContinueStatement = ContinueStatement; -const ReturnStatement = buildLabelStatement("return", "argument"); -exports.ReturnStatement = ReturnStatement; -const BreakStatement = buildLabelStatement("break"); -exports.BreakStatement = BreakStatement; -const ThrowStatement = buildLabelStatement("throw", "argument"); -exports.ThrowStatement = ThrowStatement; - -function LabeledStatement(node) { - this.print(node.label, node); - this.token(":"); - this.space(); - this.print(node.body, node); -} - -function TryStatement(node) { - this.word("try"); - this.space(); - this.print(node.block, node); - this.space(); - - if (node.handlers) { - this.print(node.handlers[0], node); - } else { - this.print(node.handler, node); - } - - if (node.finalizer) { - this.space(); - this.word("finally"); - this.space(); - this.print(node.finalizer, node); - } -} - -function CatchClause(node) { - this.word("catch"); - this.space(); - - if (node.param) { - this.token("("); - this.print(node.param, node); - this.token(")"); - this.space(); - } - - this.print(node.body, node); -} - -function SwitchStatement(node) { - this.word("switch"); - this.space(); - this.token("("); - this.print(node.discriminant, node); - this.token(")"); - this.space(); - this.token("{"); - this.printSequence(node.cases, node, { - indent: true, - - addNewlines(leading, cas) { - if (!leading && node.cases[node.cases.length - 1] === cas) return -1; - } - - }); - this.token("}"); -} - -function SwitchCase(node) { - if (node.test) { - this.word("case"); - this.space(); - this.print(node.test, node); - this.token(":"); - } else { - this.word("default"); - this.token(":"); - } - - if (node.consequent.length) { - this.newline(); - this.printSequence(node.consequent, node, { - indent: true - }); - } -} - -function DebuggerStatement() { - this.word("debugger"); - this.semicolon(); -} - -function variableDeclarationIndent() { - this.token(","); - this.newline(); - if (this.endsWith("\n")) for (let i = 0; i < 4; i++) this.space(true); -} - -function constDeclarationIndent() { - this.token(","); - this.newline(); - if (this.endsWith("\n")) for (let i = 0; i < 6; i++) this.space(true); -} - -function VariableDeclaration(node, parent) { - if (node.declare) { - this.word("declare"); - this.space(); - } - - this.word(node.kind); - this.space(); - let hasInits = false; - - if (!t().isFor(parent)) { - for (const declar of node.declarations) { - if (declar.init) { - hasInits = true; - } - } - } - - let separator; - - if (hasInits) { - separator = node.kind === "const" ? constDeclarationIndent : variableDeclarationIndent; - } - - this.printList(node.declarations, node, { - separator - }); - - if (t().isFor(parent)) { - if (parent.left === node || parent.init === node) return; - } - - this.semicolon(); -} - -function VariableDeclarator(node) { - this.print(node.id, node); - if (node.definite) this.token("!"); - this.print(node.id.typeAnnotation, node); - - if (node.init) { - this.space(); - this.token("="); - this.space(); - this.print(node.init, node); - } -} - -/***/ }), - -/***/ "./node_modules/@babel/generator/lib/generators/template-literals.js": -/*!***************************************************************************!*\ - !*** ./node_modules/@babel/generator/lib/generators/template-literals.js ***! - \***************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.TaggedTemplateExpression = TaggedTemplateExpression; -exports.TemplateElement = TemplateElement; -exports.TemplateLiteral = TemplateLiteral; - -function TaggedTemplateExpression(node) { - this.print(node.tag, node); - this.print(node.typeParameters, node); - this.print(node.quasi, node); -} - -function TemplateElement(node, parent) { - const isFirst = parent.quasis[0] === node; - const isLast = parent.quasis[parent.quasis.length - 1] === node; - const value = (isFirst ? "`" : "}") + node.value.raw + (isLast ? "`" : "${"); - this.token(value); -} - -function TemplateLiteral(node) { - const quasis = node.quasis; - - for (let i = 0; i < quasis.length; i++) { - this.print(quasis[i], node); - - if (i + 1 < quasis.length) { - this.print(node.expressions[i], node); - } - } -} - -/***/ }), - -/***/ "./node_modules/@babel/generator/lib/generators/types.js": -/*!***************************************************************!*\ - !*** ./node_modules/@babel/generator/lib/generators/types.js ***! - \***************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.Identifier = Identifier; -exports.ArgumentPlaceholder = ArgumentPlaceholder; -exports.SpreadElement = exports.RestElement = RestElement; -exports.ObjectPattern = exports.ObjectExpression = ObjectExpression; -exports.ObjectMethod = ObjectMethod; -exports.ObjectProperty = ObjectProperty; -exports.ArrayPattern = exports.ArrayExpression = ArrayExpression; -exports.RegExpLiteral = RegExpLiteral; -exports.BooleanLiteral = BooleanLiteral; -exports.NullLiteral = NullLiteral; -exports.NumericLiteral = NumericLiteral; -exports.StringLiteral = StringLiteral; -exports.BigIntLiteral = BigIntLiteral; -exports.PipelineTopicExpression = PipelineTopicExpression; -exports.PipelineBareFunction = PipelineBareFunction; -exports.PipelinePrimaryTopicReference = PipelinePrimaryTopicReference; - -function t() { - const data = _interopRequireWildcard(__webpack_require__(/*! @babel/types */ "./node_modules/@babel/types/lib/index.js")); - - t = function () { - return data; - }; - - return data; -} - -function _jsesc() { - const data = _interopRequireDefault(__webpack_require__(/*! jsesc */ "./node_modules/jsesc/jsesc.js")); - - _jsesc = function () { - return data; - }; - - return data; -} - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -function Identifier(node) { - this.exactSource(node.loc, () => { - this.word(node.name); - }); -} - -function ArgumentPlaceholder() { - this.token("?"); -} - -function RestElement(node) { - this.token("..."); - this.print(node.argument, node); -} - -function ObjectExpression(node) { - const props = node.properties; - this.token("{"); - this.printInnerComments(node); - - if (props.length) { - this.space(); - this.printList(props, node, { - indent: true, - statement: true - }); - this.space(); - } - - this.token("}"); -} - -function ObjectMethod(node) { - this.printJoin(node.decorators, node); - - this._methodHead(node); - - this.space(); - this.print(node.body, node); -} - -function ObjectProperty(node) { - this.printJoin(node.decorators, node); - - if (node.computed) { - this.token("["); - this.print(node.key, node); - this.token("]"); - } else { - if (t().isAssignmentPattern(node.value) && t().isIdentifier(node.key) && node.key.name === node.value.left.name) { - this.print(node.value, node); - return; - } - - this.print(node.key, node); - - if (node.shorthand && t().isIdentifier(node.key) && t().isIdentifier(node.value) && node.key.name === node.value.name) { - return; - } - } - - this.token(":"); - this.space(); - this.print(node.value, node); -} - -function ArrayExpression(node) { - const elems = node.elements; - const len = elems.length; - this.token("["); - this.printInnerComments(node); - - for (let i = 0; i < elems.length; i++) { - const elem = elems[i]; - - if (elem) { - if (i > 0) this.space(); - this.print(elem, node); - if (i < len - 1) this.token(","); - } else { - this.token(","); - } - } - - this.token("]"); -} - -function RegExpLiteral(node) { - this.word(`/${node.pattern}/${node.flags}`); -} - -function BooleanLiteral(node) { - this.word(node.value ? "true" : "false"); -} - -function NullLiteral() { - this.word("null"); -} - -function NumericLiteral(node) { - const raw = this.getPossibleRaw(node); - const value = node.value + ""; - - if (raw == null) { - this.number(value); - } else if (this.format.minified) { - this.number(raw.length < value.length ? raw : value); - } else { - this.number(raw); - } -} - -function StringLiteral(node) { - const raw = this.getPossibleRaw(node); - - if (!this.format.minified && raw != null) { - this.token(raw); - return; - } - - const opts = this.format.jsescOption; - - if (this.format.jsonCompatibleStrings) { - opts.json = true; - } - - const val = (0, _jsesc().default)(node.value, opts); - return this.token(val); -} - -function BigIntLiteral(node) { - const raw = this.getPossibleRaw(node); - - if (!this.format.minified && raw != null) { - this.token(raw); - return; - } - - this.token(node.value); -} - -function PipelineTopicExpression(node) { - this.print(node.expression, node); -} - -function PipelineBareFunction(node) { - this.print(node.callee, node); -} - -function PipelinePrimaryTopicReference() { - this.token("#"); -} - -/***/ }), - -/***/ "./node_modules/@babel/generator/lib/generators/typescript.js": -/*!********************************************************************!*\ - !*** ./node_modules/@babel/generator/lib/generators/typescript.js ***! - \********************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.TSTypeAnnotation = TSTypeAnnotation; -exports.TSTypeParameterDeclaration = exports.TSTypeParameterInstantiation = TSTypeParameterInstantiation; -exports.TSTypeParameter = TSTypeParameter; -exports.TSParameterProperty = TSParameterProperty; -exports.TSDeclareFunction = TSDeclareFunction; -exports.TSDeclareMethod = TSDeclareMethod; -exports.TSQualifiedName = TSQualifiedName; -exports.TSCallSignatureDeclaration = TSCallSignatureDeclaration; -exports.TSConstructSignatureDeclaration = TSConstructSignatureDeclaration; -exports.TSPropertySignature = TSPropertySignature; -exports.tsPrintPropertyOrMethodName = tsPrintPropertyOrMethodName; -exports.TSMethodSignature = TSMethodSignature; -exports.TSIndexSignature = TSIndexSignature; -exports.TSAnyKeyword = TSAnyKeyword; -exports.TSUnknownKeyword = TSUnknownKeyword; -exports.TSNumberKeyword = TSNumberKeyword; -exports.TSObjectKeyword = TSObjectKeyword; -exports.TSBooleanKeyword = TSBooleanKeyword; -exports.TSStringKeyword = TSStringKeyword; -exports.TSSymbolKeyword = TSSymbolKeyword; -exports.TSVoidKeyword = TSVoidKeyword; -exports.TSUndefinedKeyword = TSUndefinedKeyword; -exports.TSNullKeyword = TSNullKeyword; -exports.TSNeverKeyword = TSNeverKeyword; -exports.TSThisType = TSThisType; -exports.TSFunctionType = TSFunctionType; -exports.TSConstructorType = TSConstructorType; -exports.tsPrintFunctionOrConstructorType = tsPrintFunctionOrConstructorType; -exports.TSTypeReference = TSTypeReference; -exports.TSTypePredicate = TSTypePredicate; -exports.TSTypeQuery = TSTypeQuery; -exports.TSTypeLiteral = TSTypeLiteral; -exports.tsPrintTypeLiteralOrInterfaceBody = tsPrintTypeLiteralOrInterfaceBody; -exports.tsPrintBraced = tsPrintBraced; -exports.TSArrayType = TSArrayType; -exports.TSTupleType = TSTupleType; -exports.TSOptionalType = TSOptionalType; -exports.TSRestType = TSRestType; -exports.TSUnionType = TSUnionType; -exports.TSIntersectionType = TSIntersectionType; -exports.tsPrintUnionOrIntersectionType = tsPrintUnionOrIntersectionType; -exports.TSConditionalType = TSConditionalType; -exports.TSInferType = TSInferType; -exports.TSParenthesizedType = TSParenthesizedType; -exports.TSTypeOperator = TSTypeOperator; -exports.TSIndexedAccessType = TSIndexedAccessType; -exports.TSMappedType = TSMappedType; -exports.TSLiteralType = TSLiteralType; -exports.TSExpressionWithTypeArguments = TSExpressionWithTypeArguments; -exports.TSInterfaceDeclaration = TSInterfaceDeclaration; -exports.TSInterfaceBody = TSInterfaceBody; -exports.TSTypeAliasDeclaration = TSTypeAliasDeclaration; -exports.TSAsExpression = TSAsExpression; -exports.TSTypeAssertion = TSTypeAssertion; -exports.TSEnumDeclaration = TSEnumDeclaration; -exports.TSEnumMember = TSEnumMember; -exports.TSModuleDeclaration = TSModuleDeclaration; -exports.TSModuleBlock = TSModuleBlock; -exports.TSImportType = TSImportType; -exports.TSImportEqualsDeclaration = TSImportEqualsDeclaration; -exports.TSExternalModuleReference = TSExternalModuleReference; -exports.TSNonNullExpression = TSNonNullExpression; -exports.TSExportAssignment = TSExportAssignment; -exports.TSNamespaceExportDeclaration = TSNamespaceExportDeclaration; -exports.tsPrintSignatureDeclarationBase = tsPrintSignatureDeclarationBase; - -function TSTypeAnnotation(node) { - this.token(":"); - this.space(); - if (node.optional) this.token("?"); - this.print(node.typeAnnotation, node); -} - -function TSTypeParameterInstantiation(node) { - this.token("<"); - this.printList(node.params, node, {}); - this.token(">"); -} - -function TSTypeParameter(node) { - this.word(node.name); - - if (node.constraint) { - this.space(); - this.word("extends"); - this.space(); - this.print(node.constraint, node); - } - - if (node.default) { - this.space(); - this.token("="); - this.space(); - this.print(node.default, node); - } -} - -function TSParameterProperty(node) { - if (node.accessibility) { - this.word(node.accessibility); - this.space(); - } - - if (node.readonly) { - this.word("readonly"); - this.space(); - } - - this._param(node.parameter); -} - -function TSDeclareFunction(node) { - if (node.declare) { - this.word("declare"); - this.space(); - } - - this._functionHead(node); - - this.token(";"); -} - -function TSDeclareMethod(node) { - this._classMethodHead(node); - - this.token(";"); -} - -function TSQualifiedName(node) { - this.print(node.left, node); - this.token("."); - this.print(node.right, node); -} - -function TSCallSignatureDeclaration(node) { - this.tsPrintSignatureDeclarationBase(node); -} - -function TSConstructSignatureDeclaration(node) { - this.word("new"); - this.space(); - this.tsPrintSignatureDeclarationBase(node); -} - -function TSPropertySignature(node) { - const { - readonly, - initializer - } = node; - - if (readonly) { - this.word("readonly"); - this.space(); - } - - this.tsPrintPropertyOrMethodName(node); - this.print(node.typeAnnotation, node); - - if (initializer) { - this.space(); - this.token("="); - this.space(); - this.print(initializer, node); - } - - this.token(";"); -} - -function tsPrintPropertyOrMethodName(node) { - if (node.computed) { - this.token("["); - } - - this.print(node.key, node); - - if (node.computed) { - this.token("]"); - } - - if (node.optional) { - this.token("?"); - } -} - -function TSMethodSignature(node) { - this.tsPrintPropertyOrMethodName(node); - this.tsPrintSignatureDeclarationBase(node); - this.token(";"); -} - -function TSIndexSignature(node) { - const { - readonly - } = node; - - if (readonly) { - this.word("readonly"); - this.space(); - } - - this.token("["); - - this._parameters(node.parameters, node); - - this.token("]"); - this.print(node.typeAnnotation, node); - this.token(";"); -} - -function TSAnyKeyword() { - this.word("any"); -} - -function TSUnknownKeyword() { - this.word("unknown"); -} - -function TSNumberKeyword() { - this.word("number"); -} - -function TSObjectKeyword() { - this.word("object"); -} - -function TSBooleanKeyword() { - this.word("boolean"); -} - -function TSStringKeyword() { - this.word("string"); -} - -function TSSymbolKeyword() { - this.word("symbol"); -} - -function TSVoidKeyword() { - this.word("void"); -} - -function TSUndefinedKeyword() { - this.word("undefined"); -} - -function TSNullKeyword() { - this.word("null"); -} - -function TSNeverKeyword() { - this.word("never"); -} - -function TSThisType() { - this.word("this"); -} - -function TSFunctionType(node) { - this.tsPrintFunctionOrConstructorType(node); -} - -function TSConstructorType(node) { - this.word("new"); - this.space(); - this.tsPrintFunctionOrConstructorType(node); -} - -function tsPrintFunctionOrConstructorType(node) { - const { - typeParameters, - parameters - } = node; - this.print(typeParameters, node); - this.token("("); - - this._parameters(parameters, node); - - this.token(")"); - this.space(); - this.token("=>"); - this.space(); - this.print(node.typeAnnotation.typeAnnotation, node); -} - -function TSTypeReference(node) { - this.print(node.typeName, node); - this.print(node.typeParameters, node); -} - -function TSTypePredicate(node) { - this.print(node.parameterName); - this.space(); - this.word("is"); - this.space(); - this.print(node.typeAnnotation.typeAnnotation); -} - -function TSTypeQuery(node) { - this.word("typeof"); - this.space(); - this.print(node.exprName); -} - -function TSTypeLiteral(node) { - this.tsPrintTypeLiteralOrInterfaceBody(node.members, node); -} - -function tsPrintTypeLiteralOrInterfaceBody(members, node) { - this.tsPrintBraced(members, node); -} - -function tsPrintBraced(members, node) { - this.token("{"); - - if (members.length) { - this.indent(); - this.newline(); - - for (const member of members) { - this.print(member, node); - this.newline(); - } - - this.dedent(); - this.rightBrace(); - } else { - this.token("}"); - } -} - -function TSArrayType(node) { - this.print(node.elementType, node); - this.token("[]"); -} - -function TSTupleType(node) { - this.token("["); - this.printList(node.elementTypes, node); - this.token("]"); -} - -function TSOptionalType(node) { - this.print(node.typeAnnotation, node); - this.token("?"); -} - -function TSRestType(node) { - this.token("..."); - this.print(node.typeAnnotation, node); -} - -function TSUnionType(node) { - this.tsPrintUnionOrIntersectionType(node, "|"); -} - -function TSIntersectionType(node) { - this.tsPrintUnionOrIntersectionType(node, "&"); -} - -function tsPrintUnionOrIntersectionType(node, sep) { - this.printJoin(node.types, node, { - separator() { - this.space(); - this.token(sep); - this.space(); - } - - }); -} - -function TSConditionalType(node) { - this.print(node.checkType); - this.space(); - this.word("extends"); - this.space(); - this.print(node.extendsType); - this.space(); - this.token("?"); - this.space(); - this.print(node.trueType); - this.space(); - this.token(":"); - this.space(); - this.print(node.falseType); -} - -function TSInferType(node) { - this.token("infer"); - this.space(); - this.print(node.typeParameter); -} - -function TSParenthesizedType(node) { - this.token("("); - this.print(node.typeAnnotation, node); - this.token(")"); -} - -function TSTypeOperator(node) { - this.token(node.operator); - this.space(); - this.print(node.typeAnnotation, node); -} - -function TSIndexedAccessType(node) { - this.print(node.objectType, node); - this.token("["); - this.print(node.indexType, node); - this.token("]"); -} - -function TSMappedType(node) { - const { - readonly, - typeParameter, - optional - } = node; - this.token("{"); - this.space(); - - if (readonly) { - tokenIfPlusMinus(this, readonly); - this.word("readonly"); - this.space(); - } - - this.token("["); - this.word(typeParameter.name); - this.space(); - this.word("in"); - this.space(); - this.print(typeParameter.constraint, typeParameter); - this.token("]"); - - if (optional) { - tokenIfPlusMinus(this, optional); - this.token("?"); - } - - this.token(":"); - this.space(); - this.print(node.typeAnnotation, node); - this.space(); - this.token("}"); -} - -function tokenIfPlusMinus(self, tok) { - if (tok !== true) { - self.token(tok); - } -} - -function TSLiteralType(node) { - this.print(node.literal, node); -} - -function TSExpressionWithTypeArguments(node) { - this.print(node.expression, node); - this.print(node.typeParameters, node); -} - -function TSInterfaceDeclaration(node) { - const { - declare, - id, - typeParameters, - extends: extendz, - body - } = node; - - if (declare) { - this.word("declare"); - this.space(); - } - - this.word("interface"); - this.space(); - this.print(id, node); - this.print(typeParameters, node); - - if (extendz) { - this.space(); - this.word("extends"); - this.space(); - this.printList(extendz, node); - } - - this.space(); - this.print(body, node); -} - -function TSInterfaceBody(node) { - this.tsPrintTypeLiteralOrInterfaceBody(node.body, node); -} - -function TSTypeAliasDeclaration(node) { - const { - declare, - id, - typeParameters, - typeAnnotation - } = node; - - if (declare) { - this.word("declare"); - this.space(); - } - - this.word("type"); - this.space(); - this.print(id, node); - this.print(typeParameters, node); - this.space(); - this.token("="); - this.space(); - this.print(typeAnnotation, node); - this.token(";"); -} - -function TSAsExpression(node) { - const { - expression, - typeAnnotation - } = node; - this.print(expression, node); - this.space(); - this.word("as"); - this.space(); - this.print(typeAnnotation, node); -} - -function TSTypeAssertion(node) { - const { - typeAnnotation, - expression - } = node; - this.token("<"); - this.print(typeAnnotation, node); - this.token(">"); - this.space(); - this.print(expression, node); -} - -function TSEnumDeclaration(node) { - const { - declare, - const: isConst, - id, - members - } = node; - - if (declare) { - this.word("declare"); - this.space(); - } - - if (isConst) { - this.word("const"); - this.space(); - } - - this.word("enum"); - this.space(); - this.print(id, node); - this.space(); - this.tsPrintBraced(members, node); -} - -function TSEnumMember(node) { - const { - id, - initializer - } = node; - this.print(id, node); - - if (initializer) { - this.space(); - this.token("="); - this.space(); - this.print(initializer, node); - } - - this.token(","); -} - -function TSModuleDeclaration(node) { - const { - declare, - id - } = node; - - if (declare) { - this.word("declare"); - this.space(); - } - - if (!node.global) { - this.word(id.type === "Identifier" ? "namespace" : "module"); - this.space(); - } - - this.print(id, node); - - if (!node.body) { - this.token(";"); - return; - } - - let body = node.body; - - while (body.type === "TSModuleDeclaration") { - this.token("."); - this.print(body.id, body); - body = body.body; - } - - this.space(); - this.print(body, node); -} - -function TSModuleBlock(node) { - this.tsPrintBraced(node.body, node); -} - -function TSImportType(node) { - const { - argument, - qualifier, - typeParameters - } = node; - this.word("import"); - this.token("("); - this.print(argument, node); - this.token(")"); - - if (qualifier) { - this.token("."); - this.print(qualifier, node); - } - - if (typeParameters) { - this.print(typeParameters, node); - } -} - -function TSImportEqualsDeclaration(node) { - const { - isExport, - id, - moduleReference - } = node; - - if (isExport) { - this.word("export"); - this.space(); - } - - this.word("import"); - this.space(); - this.print(id, node); - this.space(); - this.token("="); - this.space(); - this.print(moduleReference, node); - this.token(";"); -} - -function TSExternalModuleReference(node) { - this.token("require("); - this.print(node.expression, node); - this.token(")"); -} - -function TSNonNullExpression(node) { - this.print(node.expression, node); - this.token("!"); -} - -function TSExportAssignment(node) { - this.word("export"); - this.space(); - this.token("="); - this.space(); - this.print(node.expression, node); - this.token(";"); -} - -function TSNamespaceExportDeclaration(node) { - this.word("export"); - this.space(); - this.word("as"); - this.space(); - this.word("namespace"); - this.space(); - this.print(node.id, node); -} - -function tsPrintSignatureDeclarationBase(node) { - const { - typeParameters, - parameters - } = node; - this.print(typeParameters, node); - this.token("("); - - this._parameters(parameters, node); - - this.token(")"); - this.print(node.typeAnnotation, node); -} - -/***/ }), - -/***/ "./node_modules/@babel/generator/lib/index.js": -/*!****************************************************!*\ - !*** ./node_modules/@babel/generator/lib/index.js ***! - \****************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = _default; -exports.CodeGenerator = void 0; - -var _sourceMap = _interopRequireDefault(__webpack_require__(/*! ./source-map */ "./node_modules/@babel/generator/lib/source-map.js")); - -var _printer = _interopRequireDefault(__webpack_require__(/*! ./printer */ "./node_modules/@babel/generator/lib/printer.js")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -class Generator extends _printer.default { - constructor(ast, opts = {}, code) { - const format = normalizeOptions(code, opts); - const map = opts.sourceMaps ? new _sourceMap.default(opts, code) : null; - super(format, map); - this.ast = ast; - } - - generate() { - return super.generate(this.ast); - } - -} - -function normalizeOptions(code, opts) { - const format = { - auxiliaryCommentBefore: opts.auxiliaryCommentBefore, - auxiliaryCommentAfter: opts.auxiliaryCommentAfter, - shouldPrintComment: opts.shouldPrintComment, - retainLines: opts.retainLines, - retainFunctionParens: opts.retainFunctionParens, - comments: opts.comments == null || opts.comments, - compact: opts.compact, - minified: opts.minified, - concise: opts.concise, - jsonCompatibleStrings: opts.jsonCompatibleStrings, - indent: { - adjustMultilineComment: true, - style: " ", - base: 0 - }, - decoratorsBeforeExport: !!opts.decoratorsBeforeExport, - jsescOption: Object.assign({ - quotes: "double", - wrap: true - }, opts.jsescOption) - }; - - if (format.minified) { - format.compact = true; - - format.shouldPrintComment = format.shouldPrintComment || (() => format.comments); - } else { - format.shouldPrintComment = format.shouldPrintComment || (value => format.comments || value.indexOf("@license") >= 0 || value.indexOf("@preserve") >= 0); - } - - if (format.compact === "auto") { - format.compact = code.length > 500000; - - if (format.compact) { - console.error("[BABEL] Note: The code generator has deoptimised the styling of " + `${opts.filename} as it exceeds the max of ${"500KB"}.`); - } - } - - if (format.compact) { - format.indent.adjustMultilineComment = false; - } - - return format; -} - -class CodeGenerator { - constructor(ast, opts, code) { - this._generator = new Generator(ast, opts, code); - } - - generate() { - return this._generator.generate(); - } - -} - -exports.CodeGenerator = CodeGenerator; - -function _default(ast, opts, code) { - const gen = new Generator(ast, opts, code); - return gen.generate(); -} - -/***/ }), - -/***/ "./node_modules/@babel/generator/lib/node/index.js": -/*!*********************************************************!*\ - !*** ./node_modules/@babel/generator/lib/node/index.js ***! - \*********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.needsWhitespace = needsWhitespace; -exports.needsWhitespaceBefore = needsWhitespaceBefore; -exports.needsWhitespaceAfter = needsWhitespaceAfter; -exports.needsParens = needsParens; - -var whitespace = _interopRequireWildcard(__webpack_require__(/*! ./whitespace */ "./node_modules/@babel/generator/lib/node/whitespace.js")); - -var parens = _interopRequireWildcard(__webpack_require__(/*! ./parentheses */ "./node_modules/@babel/generator/lib/node/parentheses.js")); - -function t() { - const data = _interopRequireWildcard(__webpack_require__(/*! @babel/types */ "./node_modules/@babel/types/lib/index.js")); - - t = function () { - return data; - }; - - return data; -} - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -function expandAliases(obj) { - const newObj = {}; - - function add(type, func) { - const fn = newObj[type]; - newObj[type] = fn ? function (node, parent, stack) { - const result = fn(node, parent, stack); - return result == null ? func(node, parent, stack) : result; - } : func; - } - - for (const type of Object.keys(obj)) { - const aliases = t().FLIPPED_ALIAS_KEYS[type]; - - if (aliases) { - for (const alias of aliases) { - add(alias, obj[type]); - } - } else { - add(type, obj[type]); - } - } - - return newObj; -} - -const expandedParens = expandAliases(parens); -const expandedWhitespaceNodes = expandAliases(whitespace.nodes); -const expandedWhitespaceList = expandAliases(whitespace.list); - -function find(obj, node, parent, printStack) { - const fn = obj[node.type]; - return fn ? fn(node, parent, printStack) : null; -} - -function isOrHasCallExpression(node) { - if (t().isCallExpression(node)) { - return true; - } - - if (t().isMemberExpression(node)) { - return isOrHasCallExpression(node.object) || !node.computed && isOrHasCallExpression(node.property); - } else { - return false; - } -} - -function needsWhitespace(node, parent, type) { - if (!node) return 0; - - if (t().isExpressionStatement(node)) { - node = node.expression; - } - - let linesInfo = find(expandedWhitespaceNodes, node, parent); - - if (!linesInfo) { - const items = find(expandedWhitespaceList, node, parent); - - if (items) { - for (let i = 0; i < items.length; i++) { - linesInfo = needsWhitespace(items[i], node, type); - if (linesInfo) break; - } - } - } - - if (typeof linesInfo === "object" && linesInfo !== null) { - return linesInfo[type] || 0; - } - - return 0; -} - -function needsWhitespaceBefore(node, parent) { - return needsWhitespace(node, parent, "before"); -} - -function needsWhitespaceAfter(node, parent) { - return needsWhitespace(node, parent, "after"); -} - -function needsParens(node, parent, printStack) { - if (!parent) return false; - - if (t().isNewExpression(parent) && parent.callee === node) { - if (isOrHasCallExpression(node)) return true; - } - - return find(expandedParens, node, parent, printStack); -} - -/***/ }), - -/***/ "./node_modules/@babel/generator/lib/node/parentheses.js": -/*!***************************************************************!*\ - !*** ./node_modules/@babel/generator/lib/node/parentheses.js ***! - \***************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.NullableTypeAnnotation = NullableTypeAnnotation; -exports.FunctionTypeAnnotation = FunctionTypeAnnotation; -exports.UpdateExpression = UpdateExpression; -exports.ObjectExpression = ObjectExpression; -exports.DoExpression = DoExpression; -exports.Binary = Binary; -exports.IntersectionTypeAnnotation = exports.UnionTypeAnnotation = UnionTypeAnnotation; -exports.TSAsExpression = TSAsExpression; -exports.TSTypeAssertion = TSTypeAssertion; -exports.TSIntersectionType = exports.TSUnionType = TSUnionType; -exports.BinaryExpression = BinaryExpression; -exports.SequenceExpression = SequenceExpression; -exports.AwaitExpression = exports.YieldExpression = YieldExpression; -exports.ClassExpression = ClassExpression; -exports.UnaryLike = UnaryLike; -exports.FunctionExpression = FunctionExpression; -exports.ArrowFunctionExpression = ArrowFunctionExpression; -exports.ConditionalExpression = ConditionalExpression; -exports.OptionalMemberExpression = OptionalMemberExpression; -exports.AssignmentExpression = AssignmentExpression; -exports.NewExpression = NewExpression; - -function t() { - const data = _interopRequireWildcard(__webpack_require__(/*! @babel/types */ "./node_modules/@babel/types/lib/index.js")); - - t = function () { - return data; - }; - - return data; -} - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -const PRECEDENCE = { - "||": 0, - "&&": 1, - "|": 2, - "^": 3, - "&": 4, - "==": 5, - "===": 5, - "!=": 5, - "!==": 5, - "<": 6, - ">": 6, - "<=": 6, - ">=": 6, - in: 6, - instanceof: 6, - ">>": 7, - "<<": 7, - ">>>": 7, - "+": 8, - "-": 8, - "*": 9, - "/": 9, - "%": 9, - "**": 10 -}; - -const isClassExtendsClause = (node, parent) => (t().isClassDeclaration(parent) || t().isClassExpression(parent)) && parent.superClass === node; - -function NullableTypeAnnotation(node, parent) { - return t().isArrayTypeAnnotation(parent); -} - -function FunctionTypeAnnotation(node, parent) { - return t().isUnionTypeAnnotation(parent) || t().isIntersectionTypeAnnotation(parent) || t().isArrayTypeAnnotation(parent); -} - -function UpdateExpression(node, parent) { - return t().isMemberExpression(parent, { - object: node - }) || t().isCallExpression(parent, { - callee: node - }) || t().isNewExpression(parent, { - callee: node - }) || isClassExtendsClause(node, parent); -} - -function ObjectExpression(node, parent, printStack) { - return isFirstInStatement(printStack, { - considerArrow: true - }); -} - -function DoExpression(node, parent, printStack) { - return isFirstInStatement(printStack); -} - -function Binary(node, parent) { - if (node.operator === "**" && t().isBinaryExpression(parent, { - operator: "**" - })) { - return parent.left === node; - } - - if (isClassExtendsClause(node, parent)) { - return true; - } - - if ((t().isCallExpression(parent) || t().isNewExpression(parent)) && parent.callee === node || t().isUnaryLike(parent) || t().isMemberExpression(parent) && parent.object === node || t().isAwaitExpression(parent)) { - return true; - } - - if (t().isBinary(parent)) { - const parentOp = parent.operator; - const parentPos = PRECEDENCE[parentOp]; - const nodeOp = node.operator; - const nodePos = PRECEDENCE[nodeOp]; - - if (parentPos === nodePos && parent.right === node && !t().isLogicalExpression(parent) || parentPos > nodePos) { - return true; - } - } - - return false; -} - -function UnionTypeAnnotation(node, parent) { - return t().isArrayTypeAnnotation(parent) || t().isNullableTypeAnnotation(parent) || t().isIntersectionTypeAnnotation(parent) || t().isUnionTypeAnnotation(parent); -} - -function TSAsExpression() { - return true; -} - -function TSTypeAssertion() { - return true; -} - -function TSUnionType(node, parent) { - return t().isTSArrayType(parent) || t().isTSOptionalType(parent) || t().isTSIntersectionType(parent) || t().isTSUnionType(parent) || t().isTSRestType(parent); -} - -function BinaryExpression(node, parent) { - return node.operator === "in" && (t().isVariableDeclarator(parent) || t().isFor(parent)); -} - -function SequenceExpression(node, parent) { - if (t().isForStatement(parent) || t().isThrowStatement(parent) || t().isReturnStatement(parent) || t().isIfStatement(parent) && parent.test === node || t().isWhileStatement(parent) && parent.test === node || t().isForInStatement(parent) && parent.right === node || t().isSwitchStatement(parent) && parent.discriminant === node || t().isExpressionStatement(parent) && parent.expression === node) { - return false; - } - - return true; -} - -function YieldExpression(node, parent) { - return t().isBinary(parent) || t().isUnaryLike(parent) || t().isCallExpression(parent) || t().isMemberExpression(parent) || t().isNewExpression(parent) || t().isAwaitExpression(parent) && t().isYieldExpression(node) || t().isConditionalExpression(parent) && node === parent.test || isClassExtendsClause(node, parent); -} - -function ClassExpression(node, parent, printStack) { - return isFirstInStatement(printStack, { - considerDefaultExports: true - }); -} - -function UnaryLike(node, parent) { - return t().isMemberExpression(parent, { - object: node - }) || t().isCallExpression(parent, { - callee: node - }) || t().isNewExpression(parent, { - callee: node - }) || t().isBinaryExpression(parent, { - operator: "**", - left: node - }) || isClassExtendsClause(node, parent); -} - -function FunctionExpression(node, parent, printStack) { - return isFirstInStatement(printStack, { - considerDefaultExports: true - }); -} - -function ArrowFunctionExpression(node, parent) { - return t().isExportDeclaration(parent) || ConditionalExpression(node, parent); -} - -function ConditionalExpression(node, parent) { - if (t().isUnaryLike(parent) || t().isBinary(parent) || t().isConditionalExpression(parent, { - test: node - }) || t().isAwaitExpression(parent) || t().isOptionalMemberExpression(parent) || t().isTaggedTemplateExpression(parent) || t().isTSTypeAssertion(parent) || t().isTSAsExpression(parent)) { - return true; - } - - return UnaryLike(node, parent); -} - -function OptionalMemberExpression(node, parent) { - return t().isCallExpression(parent) || t().isMemberExpression(parent); -} - -function AssignmentExpression(node) { - if (t().isObjectPattern(node.left)) { - return true; - } else { - return ConditionalExpression(...arguments); - } -} - -function NewExpression(node, parent) { - return isClassExtendsClause(node, parent); -} - -function isFirstInStatement(printStack, { - considerArrow = false, - considerDefaultExports = false -} = {}) { - let i = printStack.length - 1; - let node = printStack[i]; - i--; - let parent = printStack[i]; - - while (i > 0) { - if (t().isExpressionStatement(parent, { - expression: node - }) || t().isTaggedTemplateExpression(parent) || considerDefaultExports && t().isExportDefaultDeclaration(parent, { - declaration: node - }) || considerArrow && t().isArrowFunctionExpression(parent, { - body: node - })) { - return true; - } - - if (t().isCallExpression(parent, { - callee: node - }) || t().isSequenceExpression(parent) && parent.expressions[0] === node || t().isMemberExpression(parent, { - object: node - }) || t().isConditional(parent, { - test: node - }) || t().isBinary(parent, { - left: node - }) || t().isAssignmentExpression(parent, { - left: node - })) { - node = parent; - i--; - parent = printStack[i]; - } else { - return false; - } - } - - return false; -} - -/***/ }), - -/***/ "./node_modules/@babel/generator/lib/node/whitespace.js": -/*!**************************************************************!*\ - !*** ./node_modules/@babel/generator/lib/node/whitespace.js ***! - \**************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.list = exports.nodes = void 0; - -function t() { - const data = _interopRequireWildcard(__webpack_require__(/*! @babel/types */ "./node_modules/@babel/types/lib/index.js")); - - t = function () { - return data; - }; - - return data; -} - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -function crawl(node, state = {}) { - if (t().isMemberExpression(node)) { - crawl(node.object, state); - if (node.computed) crawl(node.property, state); - } else if (t().isBinary(node) || t().isAssignmentExpression(node)) { - crawl(node.left, state); - crawl(node.right, state); - } else if (t().isCallExpression(node)) { - state.hasCall = true; - crawl(node.callee, state); - } else if (t().isFunction(node)) { - state.hasFunction = true; - } else if (t().isIdentifier(node)) { - state.hasHelper = state.hasHelper || isHelper(node.callee); - } - - return state; -} - -function isHelper(node) { - if (t().isMemberExpression(node)) { - return isHelper(node.object) || isHelper(node.property); - } else if (t().isIdentifier(node)) { - return node.name === "require" || node.name[0] === "_"; - } else if (t().isCallExpression(node)) { - return isHelper(node.callee); - } else if (t().isBinary(node) || t().isAssignmentExpression(node)) { - return t().isIdentifier(node.left) && isHelper(node.left) || isHelper(node.right); - } else { - return false; - } -} - -function isType(node) { - return t().isLiteral(node) || t().isObjectExpression(node) || t().isArrayExpression(node) || t().isIdentifier(node) || t().isMemberExpression(node); -} - -const nodes = { - AssignmentExpression(node) { - const state = crawl(node.right); - - if (state.hasCall && state.hasHelper || state.hasFunction) { - return { - before: state.hasFunction, - after: true - }; - } - }, - - SwitchCase(node, parent) { - return { - before: node.consequent.length || parent.cases[0] === node, - after: !node.consequent.length && parent.cases[parent.cases.length - 1] === node - }; - }, - - LogicalExpression(node) { - if (t().isFunction(node.left) || t().isFunction(node.right)) { - return { - after: true - }; - } - }, - - Literal(node) { - if (node.value === "use strict") { - return { - after: true - }; - } - }, - - CallExpression(node) { - if (t().isFunction(node.callee) || isHelper(node)) { - return { - before: true, - after: true - }; - } - }, - - VariableDeclaration(node) { - for (let i = 0; i < node.declarations.length; i++) { - const declar = node.declarations[i]; - let enabled = isHelper(declar.id) && !isType(declar.init); - - if (!enabled) { - const state = crawl(declar.init); - enabled = isHelper(declar.init) && state.hasCall || state.hasFunction; - } - - if (enabled) { - return { - before: true, - after: true - }; - } - } - }, - - IfStatement(node) { - if (t().isBlockStatement(node.consequent)) { - return { - before: true, - after: true - }; - } - } - -}; -exports.nodes = nodes; - -nodes.ObjectProperty = nodes.ObjectTypeProperty = nodes.ObjectMethod = function (node, parent) { - if (parent.properties[0] === node) { - return { - before: true - }; - } -}; - -nodes.ObjectTypeCallProperty = function (node, parent) { - if (parent.callProperties[0] === node && (!parent.properties || !parent.properties.length)) { - return { - before: true - }; - } -}; - -nodes.ObjectTypeIndexer = function (node, parent) { - if (parent.indexers[0] === node && (!parent.properties || !parent.properties.length) && (!parent.callProperties || !parent.callProperties.length)) { - return { - before: true - }; - } -}; - -nodes.ObjectTypeInternalSlot = function (node, parent) { - if (parent.internalSlots[0] === node && (!parent.properties || !parent.properties.length) && (!parent.callProperties || !parent.callProperties.length) && (!parent.indexers || !parent.indexers.length)) { - return { - before: true - }; - } -}; - -const list = { - VariableDeclaration(node) { - return node.declarations.map(decl => decl.init); - }, - - ArrayExpression(node) { - return node.elements; - }, - - ObjectExpression(node) { - return node.properties; - } - -}; -exports.list = list; -[["Function", true], ["Class", true], ["Loop", true], ["LabeledStatement", true], ["SwitchStatement", true], ["TryStatement", true]].forEach(function ([type, amounts]) { - if (typeof amounts === "boolean") { - amounts = { - after: amounts, - before: amounts - }; - } - - [type].concat(t().FLIPPED_ALIAS_KEYS[type] || []).forEach(function (type) { - nodes[type] = function () { - return amounts; - }; - }); -}); - -/***/ }), - -/***/ "./node_modules/@babel/generator/lib/printer.js": -/*!******************************************************!*\ - !*** ./node_modules/@babel/generator/lib/printer.js ***! - \******************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -function _isInteger() { - const data = _interopRequireDefault(__webpack_require__(/*! lodash/isInteger */ "./node_modules/lodash/isInteger.js")); - - _isInteger = function () { - return data; - }; - - return data; -} - -function _repeat() { - const data = _interopRequireDefault(__webpack_require__(/*! lodash/repeat */ "./node_modules/lodash/repeat.js")); - - _repeat = function () { - return data; - }; - - return data; -} - -var _buffer = _interopRequireDefault(__webpack_require__(/*! ./buffer */ "./node_modules/@babel/generator/lib/buffer.js")); - -var n = _interopRequireWildcard(__webpack_require__(/*! ./node */ "./node_modules/@babel/generator/lib/node/index.js")); - -function t() { - const data = _interopRequireWildcard(__webpack_require__(/*! @babel/types */ "./node_modules/@babel/types/lib/index.js")); - - t = function () { - return data; - }; - - return data; -} - -var generatorFunctions = _interopRequireWildcard(__webpack_require__(/*! ./generators */ "./node_modules/@babel/generator/lib/generators/index.js")); - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -const SCIENTIFIC_NOTATION = /e/i; -const ZERO_DECIMAL_INTEGER = /\.0+$/; -const NON_DECIMAL_LITERAL = /^0[box]/; - -class Printer { - constructor(format, map) { - this.inForStatementInitCounter = 0; - this._printStack = []; - this._indent = 0; - this._insideAux = false; - this._printedCommentStarts = {}; - this._parenPushNewlineState = null; - this._noLineTerminator = false; - this._printAuxAfterOnNextUserNode = false; - this._printedComments = new WeakSet(); - this._endsWithInteger = false; - this._endsWithWord = false; - this.format = format || {}; - this._buf = new _buffer.default(map); - } - - generate(ast) { - this.print(ast); - - this._maybeAddAuxComment(); - - return this._buf.get(); - } - - indent() { - if (this.format.compact || this.format.concise) return; - this._indent++; - } - - dedent() { - if (this.format.compact || this.format.concise) return; - this._indent--; - } - - semicolon(force = false) { - this._maybeAddAuxComment(); - - this._append(";", !force); - } - - rightBrace() { - if (this.format.minified) { - this._buf.removeLastSemicolon(); - } - - this.token("}"); - } - - space(force = false) { - if (this.format.compact) return; - - if (this._buf.hasContent() && !this.endsWith(" ") && !this.endsWith("\n") || force) { - this._space(); - } - } - - word(str) { - if (this._endsWithWord || this.endsWith("/") && str.indexOf("/") === 0) { - this._space(); - } - - this._maybeAddAuxComment(); - - this._append(str); - - this._endsWithWord = true; - } - - number(str) { - this.word(str); - this._endsWithInteger = (0, _isInteger().default)(+str) && !NON_DECIMAL_LITERAL.test(str) && !SCIENTIFIC_NOTATION.test(str) && !ZERO_DECIMAL_INTEGER.test(str) && str[str.length - 1] !== "."; - } - - token(str) { - if (str === "--" && this.endsWith("!") || str[0] === "+" && this.endsWith("+") || str[0] === "-" && this.endsWith("-") || str[0] === "." && this._endsWithInteger) { - this._space(); - } - - this._maybeAddAuxComment(); - - this._append(str); - } - - newline(i) { - if (this.format.retainLines || this.format.compact) return; - - if (this.format.concise) { - this.space(); - return; - } - - if (this.endsWith("\n\n")) return; - if (typeof i !== "number") i = 1; - i = Math.min(2, i); - if (this.endsWith("{\n") || this.endsWith(":\n")) i--; - if (i <= 0) return; - - for (let j = 0; j < i; j++) { - this._newline(); - } - } - - endsWith(str) { - return this._buf.endsWith(str); - } - - removeTrailingNewline() { - this._buf.removeTrailingNewline(); - } - - exactSource(loc, cb) { - this._catchUp("start", loc); - - this._buf.exactSource(loc, cb); - } - - source(prop, loc) { - this._catchUp(prop, loc); - - this._buf.source(prop, loc); - } - - withSource(prop, loc, cb) { - this._catchUp(prop, loc); - - this._buf.withSource(prop, loc, cb); - } - - _space() { - this._append(" ", true); - } - - _newline() { - this._append("\n", true); - } - - _append(str, queue = false) { - this._maybeAddParen(str); - - this._maybeIndent(str); - - if (queue) this._buf.queue(str);else this._buf.append(str); - this._endsWithWord = false; - this._endsWithInteger = false; - } - - _maybeIndent(str) { - if (this._indent && this.endsWith("\n") && str[0] !== "\n") { - this._buf.queue(this._getIndent()); - } - } - - _maybeAddParen(str) { - const parenPushNewlineState = this._parenPushNewlineState; - if (!parenPushNewlineState) return; - this._parenPushNewlineState = null; - let i; - - for (i = 0; i < str.length && str[i] === " "; i++) continue; - - if (i === str.length) return; - const cha = str[i]; - - if (cha !== "\n") { - if (cha !== "/") return; - if (i + 1 === str.length) return; - const chaPost = str[i + 1]; - if (chaPost !== "/" && chaPost !== "*") return; - } - - this.token("("); - this.indent(); - parenPushNewlineState.printed = true; - } - - _catchUp(prop, loc) { - if (!this.format.retainLines) return; - const pos = loc ? loc[prop] : null; - - if (pos && pos.line !== null) { - const count = pos.line - this._buf.getCurrentLine(); - - for (let i = 0; i < count; i++) { - this._newline(); - } - } - } - - _getIndent() { - return (0, _repeat().default)(this.format.indent.style, this._indent); - } - - startTerminatorless(isLabel = false) { - if (isLabel) { - this._noLineTerminator = true; - return null; - } else { - return this._parenPushNewlineState = { - printed: false - }; - } - } - - endTerminatorless(state) { - this._noLineTerminator = false; - - if (state && state.printed) { - this.dedent(); - this.newline(); - this.token(")"); - } - } - - print(node, parent) { - if (!node) return; - const oldConcise = this.format.concise; - - if (node._compact) { - this.format.concise = true; - } - - const printMethod = this[node.type]; - - if (!printMethod) { - throw new ReferenceError(`unknown node of type ${JSON.stringify(node.type)} with constructor ${JSON.stringify(node && node.constructor.name)}`); - } - - this._printStack.push(node); - - const oldInAux = this._insideAux; - this._insideAux = !node.loc; - - this._maybeAddAuxComment(this._insideAux && !oldInAux); - - let needsParens = n.needsParens(node, parent, this._printStack); - - if (this.format.retainFunctionParens && node.type === "FunctionExpression" && node.extra && node.extra.parenthesized) { - needsParens = true; - } - - if (needsParens) this.token("("); - - this._printLeadingComments(node); - - const loc = t().isProgram(node) || t().isFile(node) ? null : node.loc; - this.withSource("start", loc, () => { - printMethod.call(this, node, parent); - }); - - this._printTrailingComments(node); - - if (needsParens) this.token(")"); - - this._printStack.pop(); - - this.format.concise = oldConcise; - this._insideAux = oldInAux; - } - - _maybeAddAuxComment(enteredPositionlessNode) { - if (enteredPositionlessNode) this._printAuxBeforeComment(); - if (!this._insideAux) this._printAuxAfterComment(); - } - - _printAuxBeforeComment() { - if (this._printAuxAfterOnNextUserNode) return; - this._printAuxAfterOnNextUserNode = true; - const comment = this.format.auxiliaryCommentBefore; - - if (comment) { - this._printComment({ - type: "CommentBlock", - value: comment - }); - } - } - - _printAuxAfterComment() { - if (!this._printAuxAfterOnNextUserNode) return; - this._printAuxAfterOnNextUserNode = false; - const comment = this.format.auxiliaryCommentAfter; - - if (comment) { - this._printComment({ - type: "CommentBlock", - value: comment - }); - } - } - - getPossibleRaw(node) { - const extra = node.extra; - - if (extra && extra.raw != null && extra.rawValue != null && node.value === extra.rawValue) { - return extra.raw; - } - } - - printJoin(nodes, parent, opts = {}) { - if (!nodes || !nodes.length) return; - if (opts.indent) this.indent(); - const newlineOpts = { - addNewlines: opts.addNewlines - }; - - for (let i = 0; i < nodes.length; i++) { - const node = nodes[i]; - if (!node) continue; - if (opts.statement) this._printNewline(true, node, parent, newlineOpts); - this.print(node, parent); - - if (opts.iterator) { - opts.iterator(node, i); - } - - if (opts.separator && i < nodes.length - 1) { - opts.separator.call(this); - } - - if (opts.statement) this._printNewline(false, node, parent, newlineOpts); - } - - if (opts.indent) this.dedent(); - } - - printAndIndentOnComments(node, parent) { - const indent = node.leadingComments && node.leadingComments.length > 0; - if (indent) this.indent(); - this.print(node, parent); - if (indent) this.dedent(); - } - - printBlock(parent) { - const node = parent.body; - - if (!t().isEmptyStatement(node)) { - this.space(); - } - - this.print(node, parent); - } - - _printTrailingComments(node) { - this._printComments(this._getComments(false, node)); - } - - _printLeadingComments(node) { - this._printComments(this._getComments(true, node)); - } - - printInnerComments(node, indent = true) { - if (!node.innerComments || !node.innerComments.length) return; - if (indent) this.indent(); - - this._printComments(node.innerComments); - - if (indent) this.dedent(); - } - - printSequence(nodes, parent, opts = {}) { - opts.statement = true; - return this.printJoin(nodes, parent, opts); - } - - printList(items, parent, opts = {}) { - if (opts.separator == null) { - opts.separator = commaSeparator; - } - - return this.printJoin(items, parent, opts); - } - - _printNewline(leading, node, parent, opts) { - if (this.format.retainLines || this.format.compact) return; - - if (this.format.concise) { - this.space(); - return; - } - - let lines = 0; - - if (this._buf.hasContent()) { - if (!leading) lines++; - if (opts.addNewlines) lines += opts.addNewlines(leading, node) || 0; - const needs = leading ? n.needsWhitespaceBefore : n.needsWhitespaceAfter; - if (needs(node, parent)) lines++; - } - - this.newline(lines); - } - - _getComments(leading, node) { - return node && (leading ? node.leadingComments : node.trailingComments) || []; - } - - _printComment(comment) { - if (!this.format.shouldPrintComment(comment.value)) return; - if (comment.ignore) return; - if (this._printedComments.has(comment)) return; - - this._printedComments.add(comment); - - if (comment.start != null) { - if (this._printedCommentStarts[comment.start]) return; - this._printedCommentStarts[comment.start] = true; - } - - const isBlockComment = comment.type === "CommentBlock"; - this.newline(this._buf.hasContent() && !this._noLineTerminator && isBlockComment ? 1 : 0); - if (!this.endsWith("[") && !this.endsWith("{")) this.space(); - let val = !isBlockComment && !this._noLineTerminator ? `//${comment.value}\n` : `/*${comment.value}*/`; - - if (isBlockComment && this.format.indent.adjustMultilineComment) { - const offset = comment.loc && comment.loc.start.column; - - if (offset) { - const newlineRegex = new RegExp("\\n\\s{1," + offset + "}", "g"); - val = val.replace(newlineRegex, "\n"); - } - - const indentSize = Math.max(this._getIndent().length, this._buf.getCurrentColumn()); - val = val.replace(/\n(?!$)/g, `\n${(0, _repeat().default)(" ", indentSize)}`); - } - - if (this.endsWith("/")) this._space(); - this.withSource("start", comment.loc, () => { - this._append(val); - }); - this.newline(isBlockComment && !this._noLineTerminator ? 1 : 0); - } - - _printComments(comments) { - if (!comments || !comments.length) return; - - for (const comment of comments) { - this._printComment(comment); - } - } - -} - -exports.default = Printer; -Object.assign(Printer.prototype, generatorFunctions); - -function commaSeparator() { - this.token(","); - this.space(); -} - -/***/ }), - -/***/ "./node_modules/@babel/generator/lib/source-map.js": -/*!*********************************************************!*\ - !*** ./node_modules/@babel/generator/lib/source-map.js ***! - \*********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -function _sourceMap() { - const data = _interopRequireDefault(__webpack_require__(/*! source-map */ "./node_modules/source-map/source-map.js")); - - _sourceMap = function () { - return data; - }; - - return data; -} - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -class SourceMap { - constructor(opts, code) { - this._cachedMap = null; - this._code = code; - this._opts = opts; - this._rawMappings = []; - } - - get() { - if (!this._cachedMap) { - const map = this._cachedMap = new (_sourceMap().default.SourceMapGenerator)({ - sourceRoot: this._opts.sourceRoot - }); - const code = this._code; - - if (typeof code === "string") { - map.setSourceContent(this._opts.sourceFileName, code); - } else if (typeof code === "object") { - Object.keys(code).forEach(sourceFileName => { - map.setSourceContent(sourceFileName, code[sourceFileName]); - }); - } - - this._rawMappings.forEach(map.addMapping, map); - } - - return this._cachedMap.toJSON(); - } - - getRawMappings() { - return this._rawMappings.slice(); - } - - mark(generatedLine, generatedColumn, line, column, identifierName, filename, force) { - if (this._lastGenLine !== generatedLine && line === null) return; - - if (!force && this._lastGenLine === generatedLine && this._lastSourceLine === line && this._lastSourceColumn === column) { - return; - } - - this._cachedMap = null; - this._lastGenLine = generatedLine; - this._lastSourceLine = line; - this._lastSourceColumn = column; - - this._rawMappings.push({ - name: identifierName || undefined, - generated: { - line: generatedLine, - column: generatedColumn - }, - source: line == null ? undefined : filename || this._opts.sourceFileName, - original: line == null ? undefined : { - line: line, - column: column - } - }); - } - -} - -exports.default = SourceMap; - -/***/ }), - -/***/ "./node_modules/@babel/helper-function-name/lib/index.js": -/*!***************************************************************!*\ - !*** ./node_modules/@babel/helper-function-name/lib/index.js ***! - \***************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = _default; - -function _helperGetFunctionArity() { - const data = _interopRequireDefault(__webpack_require__(/*! @babel/helper-get-function-arity */ "./node_modules/@babel/helper-get-function-arity/lib/index.js")); - - _helperGetFunctionArity = function () { - return data; - }; - - return data; -} - -function _template() { - const data = _interopRequireDefault(__webpack_require__(/*! @babel/template */ "./node_modules/@babel/template/lib/index.js")); - - _template = function () { - return data; - }; - - return data; -} - -function t() { - const data = _interopRequireWildcard(__webpack_require__(/*! @babel/types */ "./node_modules/@babel/types/lib/index.js")); - - t = function () { - return data; - }; - - return data; -} - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -const buildPropertyMethodAssignmentWrapper = (0, _template().default)(` - (function (FUNCTION_KEY) { - function FUNCTION_ID() { - return FUNCTION_KEY.apply(this, arguments); - } - - FUNCTION_ID.toString = function () { - return FUNCTION_KEY.toString(); - } - - return FUNCTION_ID; - })(FUNCTION) -`); -const buildGeneratorPropertyMethodAssignmentWrapper = (0, _template().default)(` - (function (FUNCTION_KEY) { - function* FUNCTION_ID() { - return yield* FUNCTION_KEY.apply(this, arguments); - } - - FUNCTION_ID.toString = function () { - return FUNCTION_KEY.toString(); - }; - - return FUNCTION_ID; - })(FUNCTION) -`); -const visitor = { - "ReferencedIdentifier|BindingIdentifier"(path, state) { - if (path.node.name !== state.name) return; - const localDeclar = path.scope.getBindingIdentifier(state.name); - if (localDeclar !== state.outerDeclar) return; - state.selfReference = true; - path.stop(); - } - -}; - -function getNameFromLiteralId(id) { - if (t().isNullLiteral(id)) { - return "null"; - } - - if (t().isRegExpLiteral(id)) { - return `_${id.pattern}_${id.flags}`; - } - - if (t().isTemplateLiteral(id)) { - return id.quasis.map(quasi => quasi.value.raw).join(""); - } - - if (id.value !== undefined) { - return id.value + ""; - } - - return ""; -} - -function wrap(state, method, id, scope) { - if (state.selfReference) { - if (scope.hasBinding(id.name) && !scope.hasGlobal(id.name)) { - scope.rename(id.name); - } else { - if (!t().isFunction(method)) return; - let build = buildPropertyMethodAssignmentWrapper; - - if (method.generator) { - build = buildGeneratorPropertyMethodAssignmentWrapper; - } - - const template = build({ - FUNCTION: method, - FUNCTION_ID: id, - FUNCTION_KEY: scope.generateUidIdentifier(id.name) - }).expression; - const params = template.callee.body.body[0].params; - - for (let i = 0, len = (0, _helperGetFunctionArity().default)(method); i < len; i++) { - params.push(scope.generateUidIdentifier("x")); - } - - return template; - } - } - - method.id = id; - scope.getProgramParent().references[id.name] = true; -} - -function visit(node, name, scope) { - const state = { - selfAssignment: false, - selfReference: false, - outerDeclar: scope.getBindingIdentifier(name), - references: [], - name: name - }; - const binding = scope.getOwnBinding(name); - - if (binding) { - if (binding.kind === "param") { - state.selfReference = true; - } else {} - } else if (state.outerDeclar || scope.hasGlobal(name)) { - scope.traverse(node, visitor, state); - } - - return state; -} - -function _default({ - node, - parent, - scope, - id -}, localBinding = false) { - if (node.id) return; - - if ((t().isObjectProperty(parent) || t().isObjectMethod(parent, { - kind: "method" - })) && (!parent.computed || t().isLiteral(parent.key))) { - id = parent.key; - } else if (t().isVariableDeclarator(parent)) { - id = parent.id; - - if (t().isIdentifier(id) && !localBinding) { - const binding = scope.parent.getBinding(id.name); - - if (binding && binding.constant && scope.getBinding(id.name) === binding) { - node.id = t().cloneNode(id); - node.id[t().NOT_LOCAL_BINDING] = true; - return; - } - } - } else if (t().isAssignmentExpression(parent)) { - id = parent.left; - } else if (!id) { - return; - } - - let name; - - if (id && t().isLiteral(id)) { - name = getNameFromLiteralId(id); - } else if (id && t().isIdentifier(id)) { - name = id.name; - } - - if (name === undefined) { - return; - } - - name = t().toBindingIdentifierName(name); - id = t().identifier(name); - id[t().NOT_LOCAL_BINDING] = true; - const state = visit(node, name, scope); - return wrap(state, node, id, scope) || node; -} - -/***/ }), - -/***/ "./node_modules/@babel/helper-get-function-arity/lib/index.js": -/*!********************************************************************!*\ - !*** ./node_modules/@babel/helper-get-function-arity/lib/index.js ***! - \********************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = _default; - -function t() { - const data = _interopRequireWildcard(__webpack_require__(/*! @babel/types */ "./node_modules/@babel/types/lib/index.js")); - - t = function () { - return data; - }; - - return data; -} - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -function _default(node) { - const params = node.params; - - for (let i = 0; i < params.length; i++) { - const param = params[i]; - - if (t().isAssignmentPattern(param) || t().isRestElement(param)) { - return i; - } - } - - return params.length; -} - -/***/ }), - -/***/ "./node_modules/@babel/helper-split-export-declaration/lib/index.js": -/*!**************************************************************************!*\ - !*** ./node_modules/@babel/helper-split-export-declaration/lib/index.js ***! - \**************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = splitExportDeclaration; - -function t() { - const data = _interopRequireWildcard(__webpack_require__(/*! @babel/types */ "./node_modules/@babel/types/lib/index.js")); - - t = function () { - return data; - }; - - return data; -} - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -function splitExportDeclaration(exportDeclaration) { - if (!exportDeclaration.isExportDeclaration()) { - throw new Error("Only export declarations can be splitted."); - } - - const isDefault = exportDeclaration.isExportDefaultDeclaration(); - const declaration = exportDeclaration.get("declaration"); - const isClassDeclaration = declaration.isClassDeclaration(); - - if (isDefault) { - const standaloneDeclaration = declaration.isFunctionDeclaration() || isClassDeclaration; - const scope = declaration.isScope() ? declaration.scope.parent : declaration.scope; - let id = declaration.node.id; - let needBindingRegistration = false; - - if (!id) { - needBindingRegistration = true; - id = scope.generateUidIdentifier("default"); - - if (standaloneDeclaration || declaration.isFunctionExpression() || declaration.isClassExpression()) { - declaration.node.id = t().cloneNode(id); - } - } - - const updatedDeclaration = standaloneDeclaration ? declaration : t().variableDeclaration("var", [t().variableDeclarator(t().cloneNode(id), declaration.node)]); - const updatedExportDeclaration = t().exportNamedDeclaration(null, [t().exportSpecifier(t().cloneNode(id), t().identifier("default"))]); - exportDeclaration.insertAfter(updatedExportDeclaration); - exportDeclaration.replaceWith(updatedDeclaration); - - if (needBindingRegistration) { - scope.registerDeclaration(exportDeclaration); - } - - return exportDeclaration; - } - - if (exportDeclaration.get("specifiers").length > 0) { - throw new Error("It doesn't make sense to split exported specifiers."); - } - - const bindingIdentifiers = declaration.getOuterBindingIdentifiers(); - const specifiers = Object.keys(bindingIdentifiers).map(name => { - return t().exportSpecifier(t().identifier(name), t().identifier(name)); - }); - const aliasDeclar = t().exportNamedDeclaration(null, specifiers); - exportDeclaration.insertAfter(aliasDeclar); - exportDeclaration.replaceWith(declaration.node); - return exportDeclaration; -} - -/***/ }), - -/***/ "./node_modules/@babel/highlight/lib/index.js": -/*!****************************************************!*\ - !*** ./node_modules/@babel/highlight/lib/index.js ***! - \****************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.shouldHighlight = shouldHighlight; -exports.getChalk = getChalk; -exports.default = highlight; - -function _jsTokens() { - const data = _interopRequireWildcard(__webpack_require__(/*! js-tokens */ "./node_modules/js-tokens/index.js")); - - _jsTokens = function () { - return data; - }; - - return data; -} - -function _esutils() { - const data = _interopRequireDefault(__webpack_require__(/*! esutils */ "./node_modules/esutils/lib/utils.js")); - - _esutils = function () { - return data; - }; - - return data; -} - -function _chalk() { - const data = _interopRequireDefault(__webpack_require__(/*! chalk */ "./node_modules/chalk/index.js")); - - _chalk = function () { - return data; - }; - - return data; -} - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -function getDefs(chalk) { - return { - keyword: chalk.cyan, - capitalized: chalk.yellow, - jsx_tag: chalk.yellow, - punctuator: chalk.yellow, - number: chalk.magenta, - string: chalk.green, - regex: chalk.magenta, - comment: chalk.grey, - invalid: chalk.white.bgRed.bold - }; -} - -const NEWLINE = /\r\n|[\n\r\u2028\u2029]/; -const JSX_TAG = /^[a-z][\w-]*$/i; -const BRACKET = /^[()[\]{}]$/; - -function getTokenType(match) { - const [offset, text] = match.slice(-2); - const token = (0, _jsTokens().matchToToken)(match); - - if (token.type === "name") { - if (_esutils().default.keyword.isReservedWordES6(token.value)) { - return "keyword"; - } - - if (JSX_TAG.test(token.value) && (text[offset - 1] === "<" || text.substr(offset - 2, 2) == " colorize(str)).join("\n"); - } else { - return args[0]; - } - }); -} - -function shouldHighlight(options) { - return _chalk().default.supportsColor || options.forceColor; -} - -function getChalk(options) { - let chalk = _chalk().default; - - if (options.forceColor) { - chalk = new (_chalk().default.constructor)({ - enabled: true, - level: 1 - }); - } - - return chalk; -} - -function highlight(code, options = {}) { - if (shouldHighlight(options)) { - const chalk = getChalk(options); - const defs = getDefs(chalk); - return highlightTokens(defs, code); - } else { - return code; - } -} - -/***/ }), - -/***/ "./node_modules/@babel/parser/lib/index.js": -/*!*************************************************!*\ - !*** ./node_modules/@babel/parser/lib/index.js ***! - \*************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, '__esModule', { value: true }); - -const beforeExpr = true; -const startsExpr = true; -const isLoop = true; -const isAssign = true; -const prefix = true; -const postfix = true; -class TokenType { - constructor(label, conf = {}) { - this.label = label; - this.keyword = conf.keyword; - this.beforeExpr = !!conf.beforeExpr; - this.startsExpr = !!conf.startsExpr; - this.rightAssociative = !!conf.rightAssociative; - this.isLoop = !!conf.isLoop; - this.isAssign = !!conf.isAssign; - this.prefix = !!conf.prefix; - this.postfix = !!conf.postfix; - this.binop = conf.binop != null ? conf.binop : null; - this.updateContext = null; - } - -} -const keywords = new Map(); - -function createKeyword(name, options = {}) { - options.keyword = name; - const token = new TokenType(name, options); - keywords.set(name, token); - return token; -} - -function createBinop(name, binop) { - return new TokenType(name, { - beforeExpr, - binop - }); -} - -const types = { - num: new TokenType("num", { - startsExpr - }), - bigint: new TokenType("bigint", { - startsExpr - }), - regexp: new TokenType("regexp", { - startsExpr - }), - string: new TokenType("string", { - startsExpr - }), - name: new TokenType("name", { - startsExpr - }), - eof: new TokenType("eof"), - bracketL: new TokenType("[", { - beforeExpr, - startsExpr - }), - bracketR: new TokenType("]"), - braceL: new TokenType("{", { - beforeExpr, - startsExpr - }), - braceBarL: new TokenType("{|", { - beforeExpr, - startsExpr - }), - braceR: new TokenType("}"), - braceBarR: new TokenType("|}"), - parenL: new TokenType("(", { - beforeExpr, - startsExpr - }), - parenR: new TokenType(")"), - comma: new TokenType(",", { - beforeExpr - }), - semi: new TokenType(";", { - beforeExpr - }), - colon: new TokenType(":", { - beforeExpr - }), - doubleColon: new TokenType("::", { - beforeExpr - }), - dot: new TokenType("."), - question: new TokenType("?", { - beforeExpr - }), - questionDot: new TokenType("?."), - arrow: new TokenType("=>", { - beforeExpr - }), - template: new TokenType("template"), - ellipsis: new TokenType("...", { - beforeExpr - }), - backQuote: new TokenType("`", { - startsExpr - }), - dollarBraceL: new TokenType("${", { - beforeExpr, - startsExpr - }), - at: new TokenType("@"), - hash: new TokenType("#", { - startsExpr - }), - interpreterDirective: new TokenType("#!..."), - eq: new TokenType("=", { - beforeExpr, - isAssign - }), - assign: new TokenType("_=", { - beforeExpr, - isAssign - }), - incDec: new TokenType("++/--", { - prefix, - postfix, - startsExpr - }), - bang: new TokenType("!", { - beforeExpr, - prefix, - startsExpr - }), - tilde: new TokenType("~", { - beforeExpr, - prefix, - startsExpr - }), - pipeline: createBinop("|>", 0), - nullishCoalescing: createBinop("??", 1), - logicalOR: createBinop("||", 1), - logicalAND: createBinop("&&", 2), - bitwiseOR: createBinop("|", 3), - bitwiseXOR: createBinop("^", 4), - bitwiseAND: createBinop("&", 5), - equality: createBinop("==/!=/===/!==", 6), - relational: createBinop("/<=/>=", 7), - bitShift: createBinop("<>/>>>", 8), - plusMin: new TokenType("+/-", { - beforeExpr, - binop: 9, - prefix, - startsExpr - }), - modulo: createBinop("%", 10), - star: createBinop("*", 10), - slash: createBinop("/", 10), - exponent: new TokenType("**", { - beforeExpr, - binop: 11, - rightAssociative: true - }), - _break: createKeyword("break"), - _case: createKeyword("case", { - beforeExpr - }), - _catch: createKeyword("catch"), - _continue: createKeyword("continue"), - _debugger: createKeyword("debugger"), - _default: createKeyword("default", { - beforeExpr - }), - _do: createKeyword("do", { - isLoop, - beforeExpr - }), - _else: createKeyword("else", { - beforeExpr - }), - _finally: createKeyword("finally"), - _for: createKeyword("for", { - isLoop - }), - _function: createKeyword("function", { - startsExpr - }), - _if: createKeyword("if"), - _return: createKeyword("return", { - beforeExpr - }), - _switch: createKeyword("switch"), - _throw: createKeyword("throw", { - beforeExpr, - prefix, - startsExpr - }), - _try: createKeyword("try"), - _var: createKeyword("var"), - _const: createKeyword("const"), - _while: createKeyword("while", { - isLoop - }), - _with: createKeyword("with"), - _new: createKeyword("new", { - beforeExpr, - startsExpr - }), - _this: createKeyword("this", { - startsExpr - }), - _super: createKeyword("super", { - startsExpr - }), - _class: createKeyword("class", { - startsExpr - }), - _extends: createKeyword("extends", { - beforeExpr - }), - _export: createKeyword("export"), - _import: createKeyword("import", { - startsExpr - }), - _null: createKeyword("null", { - startsExpr - }), - _true: createKeyword("true", { - startsExpr - }), - _false: createKeyword("false", { - startsExpr - }), - _in: createKeyword("in", { - beforeExpr, - binop: 7 - }), - _instanceof: createKeyword("instanceof", { - beforeExpr, - binop: 7 - }), - _typeof: createKeyword("typeof", { - beforeExpr, - prefix, - startsExpr - }), - _void: createKeyword("void", { - beforeExpr, - prefix, - startsExpr - }), - _delete: createKeyword("delete", { - beforeExpr, - prefix, - startsExpr - }) -}; - -const SCOPE_OTHER = 0b000000000, - SCOPE_PROGRAM = 0b000000001, - SCOPE_FUNCTION = 0b000000010, - SCOPE_ASYNC = 0b000000100, - SCOPE_GENERATOR = 0b000001000, - SCOPE_ARROW = 0b000010000, - SCOPE_SIMPLE_CATCH = 0b000100000, - SCOPE_SUPER = 0b001000000, - SCOPE_DIRECT_SUPER = 0b010000000, - SCOPE_CLASS = 0b100000000, - SCOPE_VAR = SCOPE_PROGRAM | SCOPE_FUNCTION; -function functionFlags(isAsync, isGenerator) { - return SCOPE_FUNCTION | (isAsync ? SCOPE_ASYNC : 0) | (isGenerator ? SCOPE_GENERATOR : 0); -} -const BIND_KIND_VALUE = 0b00000000001, - BIND_KIND_TYPE = 0b00000000010, - BIND_SCOPE_VAR = 0b00000000100, - BIND_SCOPE_LEXICAL = 0b00000001000, - BIND_SCOPE_FUNCTION = 0b00000010000, - BIND_FLAGS_NONE = 0b00001000000, - BIND_FLAGS_CLASS = 0b00010000000, - BIND_FLAGS_TS_ENUM = 0b00100000000, - BIND_FLAGS_TS_CONST_ENUM = 0b01000000000, - BIND_FLAGS_TS_EXPORT_ONLY = 0b10000000000; -const BIND_CLASS = BIND_KIND_VALUE | BIND_KIND_TYPE | BIND_SCOPE_LEXICAL | BIND_FLAGS_CLASS, - BIND_LEXICAL = BIND_KIND_VALUE | 0 | BIND_SCOPE_LEXICAL | 0, - BIND_VAR = BIND_KIND_VALUE | 0 | BIND_SCOPE_VAR | 0, - BIND_FUNCTION = BIND_KIND_VALUE | 0 | BIND_SCOPE_FUNCTION | 0, - BIND_TS_INTERFACE = 0 | BIND_KIND_TYPE | 0 | BIND_FLAGS_CLASS, - BIND_TS_TYPE = 0 | BIND_KIND_TYPE | 0 | 0, - BIND_TS_ENUM = BIND_KIND_VALUE | BIND_KIND_TYPE | BIND_SCOPE_LEXICAL | BIND_FLAGS_TS_ENUM, - BIND_TS_FN_TYPE = 0 | 0 | 0 | BIND_FLAGS_TS_EXPORT_ONLY, - BIND_NONE = 0 | 0 | 0 | BIND_FLAGS_NONE, - BIND_OUTSIDE = BIND_KIND_VALUE | 0 | 0 | BIND_FLAGS_NONE, - BIND_TS_CONST_ENUM = BIND_TS_ENUM | BIND_FLAGS_TS_CONST_ENUM, - BIND_TS_NAMESPACE = BIND_TS_FN_TYPE; - -function isSimpleProperty(node) { - return node != null && node.type === "Property" && node.kind === "init" && node.method === false; -} - -var estree = (superClass => class extends superClass { - estreeParseRegExpLiteral({ - pattern, - flags - }) { - let regex = null; - - try { - regex = new RegExp(pattern, flags); - } catch (e) {} - - const node = this.estreeParseLiteral(regex); - node.regex = { - pattern, - flags - }; - return node; - } - - estreeParseLiteral(value) { - return this.parseLiteral(value, "Literal"); - } - - directiveToStmt(directive) { - const directiveLiteral = directive.value; - const stmt = this.startNodeAt(directive.start, directive.loc.start); - const expression = this.startNodeAt(directiveLiteral.start, directiveLiteral.loc.start); - expression.value = directiveLiteral.value; - expression.raw = directiveLiteral.extra.raw; - stmt.expression = this.finishNodeAt(expression, "Literal", directiveLiteral.end, directiveLiteral.loc.end); - stmt.directive = directiveLiteral.extra.raw.slice(1, -1); - return this.finishNodeAt(stmt, "ExpressionStatement", directive.end, directive.loc.end); - } - - initFunction(node, isAsync) { - super.initFunction(node, isAsync); - node.expression = false; - } - - checkDeclaration(node) { - if (isSimpleProperty(node)) { - this.checkDeclaration(node.value); - } else { - super.checkDeclaration(node); - } - } - - checkGetterSetterParams(method) { - const prop = method; - const paramCount = prop.kind === "get" ? 0 : 1; - const start = prop.start; - - if (prop.value.params.length !== paramCount) { - if (prop.kind === "get") { - this.raise(start, "getter must not have any formal parameters"); - } else { - this.raise(start, "setter must have exactly one formal parameter"); - } - } - - if (prop.kind === "set" && prop.value.params[0].type === "RestElement") { - this.raise(start, "setter function argument must not be a rest parameter"); - } - } - - checkLVal(expr, bindingType = BIND_NONE, checkClashes, contextDescription) { - switch (expr.type) { - case "ObjectPattern": - expr.properties.forEach(prop => { - this.checkLVal(prop.type === "Property" ? prop.value : prop, bindingType, checkClashes, "object destructuring pattern"); - }); - break; - - default: - super.checkLVal(expr, bindingType, checkClashes, contextDescription); - } - } - - checkPropClash(prop, propHash) { - if (prop.type === "SpreadElement" || prop.computed || prop.method || prop.shorthand) { - return; - } - - const key = prop.key; - const name = key.type === "Identifier" ? key.name : String(key.value); - - if (name === "__proto__" && prop.kind === "init") { - if (propHash.proto) { - this.raise(key.start, "Redefinition of __proto__ property"); - } - - propHash.proto = true; - } - } - - isStrictBody(node) { - const isBlockStatement = node.body.type === "BlockStatement"; - - if (isBlockStatement && node.body.body.length > 0) { - for (let _i = 0, _node$body$body = node.body.body; _i < _node$body$body.length; _i++) { - const directive = _node$body$body[_i]; - - if (directive.type === "ExpressionStatement" && directive.expression.type === "Literal") { - if (directive.expression.value === "use strict") return true; - } else { - break; - } - } - } - - return false; - } - - isValidDirective(stmt) { - return stmt.type === "ExpressionStatement" && stmt.expression.type === "Literal" && typeof stmt.expression.value === "string" && (!stmt.expression.extra || !stmt.expression.extra.parenthesized); - } - - stmtToDirective(stmt) { - const directive = super.stmtToDirective(stmt); - const value = stmt.expression.value; - directive.value.value = value; - return directive; - } - - parseBlockBody(node, allowDirectives, topLevel, end) { - super.parseBlockBody(node, allowDirectives, topLevel, end); - const directiveStatements = node.directives.map(d => this.directiveToStmt(d)); - node.body = directiveStatements.concat(node.body); - delete node.directives; - } - - pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper) { - this.parseMethod(method, isGenerator, isAsync, isConstructor, allowsDirectSuper, "ClassMethod", true); - - if (method.typeParameters) { - method.value.typeParameters = method.typeParameters; - delete method.typeParameters; - } - - classBody.body.push(method); - } - - parseExprAtom(refShorthandDefaultPos) { - switch (this.state.type) { - case types.regexp: - return this.estreeParseRegExpLiteral(this.state.value); - - case types.num: - case types.string: - return this.estreeParseLiteral(this.state.value); - - case types._null: - return this.estreeParseLiteral(null); - - case types._true: - return this.estreeParseLiteral(true); - - case types._false: - return this.estreeParseLiteral(false); - - default: - return super.parseExprAtom(refShorthandDefaultPos); - } - } - - parseLiteral(value, type, startPos, startLoc) { - const node = super.parseLiteral(value, type, startPos, startLoc); - node.raw = node.extra.raw; - delete node.extra; - return node; - } - - parseFunctionBody(node, allowExpression, isMethod = false) { - super.parseFunctionBody(node, allowExpression, isMethod); - node.expression = node.body.type !== "BlockStatement"; - } - - parseMethod(node, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope = false) { - let funcNode = this.startNode(); - funcNode.kind = node.kind; - funcNode = super.parseMethod(funcNode, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope); - funcNode.type = "FunctionExpression"; - delete funcNode.kind; - node.value = funcNode; - type = type === "ClassMethod" ? "MethodDefinition" : type; - return this.finishNode(node, type); - } - - parseObjectMethod(prop, isGenerator, isAsync, isPattern, containsEsc) { - const node = super.parseObjectMethod(prop, isGenerator, isAsync, isPattern, containsEsc); - - if (node) { - node.type = "Property"; - if (node.kind === "method") node.kind = "init"; - node.shorthand = false; - } - - return node; - } - - parseObjectProperty(prop, startPos, startLoc, isPattern, refShorthandDefaultPos) { - const node = super.parseObjectProperty(prop, startPos, startLoc, isPattern, refShorthandDefaultPos); - - if (node) { - node.kind = "init"; - node.type = "Property"; - } - - return node; - } - - toAssignable(node, isBinding, contextDescription) { - if (isSimpleProperty(node)) { - this.toAssignable(node.value, isBinding, contextDescription); - return node; - } - - return super.toAssignable(node, isBinding, contextDescription); - } - - toAssignableObjectExpressionProp(prop, isBinding, isLast) { - if (prop.kind === "get" || prop.kind === "set") { - this.raise(prop.key.start, "Object pattern can't contain getter or setter"); - } else if (prop.method) { - this.raise(prop.key.start, "Object pattern can't contain methods"); - } else { - super.toAssignableObjectExpressionProp(prop, isBinding, isLast); - } - } - -}); - -const lineBreak = /\r\n?|[\n\u2028\u2029]/; -const lineBreakG = new RegExp(lineBreak.source, "g"); -function isNewLine(code) { - switch (code) { - case 10: - case 13: - case 8232: - case 8233: - return true; - - default: - return false; - } -} -const skipWhiteSpace = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g; -function isWhitespace(code) { - switch (code) { - case 0x0009: - case 0x000b: - case 0x000c: - case 32: - case 160: - case 5760: - case 0x2000: - case 0x2001: - case 0x2002: - case 0x2003: - case 0x2004: - case 0x2005: - case 0x2006: - case 0x2007: - case 0x2008: - case 0x2009: - case 0x200a: - case 0x202f: - case 0x205f: - case 0x3000: - case 0xfeff: - return true; - - default: - return false; - } -} - -class TokContext { - constructor(token, isExpr, preserveSpace, override) { - this.token = token; - this.isExpr = !!isExpr; - this.preserveSpace = !!preserveSpace; - this.override = override; - } - -} -const types$1 = { - braceStatement: new TokContext("{", false), - braceExpression: new TokContext("{", true), - templateQuasi: new TokContext("${", false), - parenStatement: new TokContext("(", false), - parenExpression: new TokContext("(", true), - template: new TokContext("`", true, true, p => p.readTmplToken()), - functionExpression: new TokContext("function", true), - functionStatement: new TokContext("function", false) -}; - -types.parenR.updateContext = types.braceR.updateContext = function () { - if (this.state.context.length === 1) { - this.state.exprAllowed = true; - return; - } - - let out = this.state.context.pop(); - - if (out === types$1.braceStatement && this.curContext().token === "function") { - out = this.state.context.pop(); - } - - this.state.exprAllowed = !out.isExpr; -}; - -types.name.updateContext = function (prevType) { - let allowed = false; - - if (prevType !== types.dot) { - if (this.state.value === "of" && !this.state.exprAllowed || this.state.value === "yield" && this.scope.inGenerator) { - allowed = true; - } - } - - this.state.exprAllowed = allowed; - - if (this.state.isIterator) { - this.state.isIterator = false; - } -}; - -types.braceL.updateContext = function (prevType) { - this.state.context.push(this.braceIsBlock(prevType) ? types$1.braceStatement : types$1.braceExpression); - this.state.exprAllowed = true; -}; - -types.dollarBraceL.updateContext = function () { - this.state.context.push(types$1.templateQuasi); - this.state.exprAllowed = true; -}; - -types.parenL.updateContext = function (prevType) { - const statementParens = prevType === types._if || prevType === types._for || prevType === types._with || prevType === types._while; - this.state.context.push(statementParens ? types$1.parenStatement : types$1.parenExpression); - this.state.exprAllowed = true; -}; - -types.incDec.updateContext = function () {}; - -types._function.updateContext = types._class.updateContext = function (prevType) { - if (prevType.beforeExpr && prevType !== types.semi && prevType !== types._else && !(prevType === types._return && lineBreak.test(this.input.slice(this.state.lastTokEnd, this.state.start))) && !((prevType === types.colon || prevType === types.braceL) && this.curContext() === types$1.b_stat)) { - this.state.context.push(types$1.functionExpression); - } else { - this.state.context.push(types$1.functionStatement); - } - - this.state.exprAllowed = false; -}; - -types.backQuote.updateContext = function () { - if (this.curContext() === types$1.template) { - this.state.context.pop(); - } else { - this.state.context.push(types$1.template); - } - - this.state.exprAllowed = false; -}; - -const reservedWords = { - strict: ["implements", "interface", "let", "package", "private", "protected", "public", "static", "yield"], - strictBind: ["eval", "arguments"] -}; -const reservedWordsStrictSet = new Set(reservedWords.strict); -const reservedWordsStrictBindSet = new Set(reservedWords.strict.concat(reservedWords.strictBind)); -const isReservedWord = (word, inModule) => { - return inModule && word === "await" || word === "enum"; -}; -function isStrictReservedWord(word, inModule) { - return isReservedWord(word, inModule) || reservedWordsStrictSet.has(word); -} -function isStrictBindReservedWord(word, inModule) { - return isReservedWord(word, inModule) || reservedWordsStrictBindSet.has(word); -} -function isKeyword(word) { - return keywords.has(word); -} -const keywordRelationalOperator = /^in(stanceof)?$/; -let nonASCIIidentifierStartChars = "\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u037f\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u052f\u0531-\u0556\u0559\u0560-\u0588\u05d0-\u05ea\u05ef-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u0860-\u086a\u08a0-\u08b4\u08b6-\u08bd\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u09fc\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0af9\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c39\u0c3d\u0c58-\u0c5a\u0c60\u0c61\u0c80\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d54-\u0d56\u0d5f-\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e86-\u0e8a\u0e8c-\u0ea3\u0ea5\u0ea7-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f5\u13f8-\u13fd\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f8\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1878\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191e\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19b0-\u19c9\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1c80-\u1c88\u1c90-\u1cba\u1cbd-\u1cbf\u1ce9-\u1cec\u1cee-\u1cf3\u1cf5\u1cf6\u1cfa\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2118-\u211d\u2124\u2126\u2128\u212a-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309b-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312f\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fef\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua69d\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua7bf\ua7c2-\ua7c6\ua7f7-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua8fd\ua8fe\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\ua9e0-\ua9e4\ua9e6-\ua9ef\ua9fa-\ua9fe\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa7e-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uab30-\uab5a\uab5c-\uab67\uab70-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc"; -let nonASCIIidentifierChars = "\u200c\u200d\xb7\u0300-\u036f\u0387\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u07fd\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u08d3-\u08e1\u08e3-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u09e6-\u09ef\u09fe\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0ae6-\u0aef\u0afa-\u0aff\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c00-\u0c04\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c81-\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0d00-\u0d03\u0d3b\u0d3c\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d82\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0de6-\u0def\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0ebc\u0ec8-\u0ecd\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1369-\u1371\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u1810-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19d0-\u19da\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1ab0-\u1abd\u1b00-\u1b04\u1b34-\u1b44\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1bad\u1bb0-\u1bb9\u1be6-\u1bf3\u1c24-\u1c37\u1c40-\u1c49\u1c50-\u1c59\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf4\u1cf7-\u1cf9\u1dc0-\u1df9\u1dfb-\u1dff\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua620-\ua629\ua66f\ua674-\ua67d\ua69e\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua880\ua881\ua8b4-\ua8c5\ua8d0-\ua8d9\ua8e0-\ua8f1\ua8ff-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\ua9e5\ua9f0-\ua9f9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b-\uaa7d\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f"; -const nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]"); -const nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]"); -nonASCIIidentifierStartChars = nonASCIIidentifierChars = null; -const astralIdentifierStartCodes = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 14, 29, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 19, 35, 5, 35, 5, 39, 9, 51, 157, 310, 10, 21, 11, 7, 153, 5, 3, 0, 2, 43, 2, 1, 4, 0, 3, 22, 11, 22, 10, 30, 66, 18, 2, 1, 11, 21, 11, 25, 71, 55, 7, 1, 65, 0, 16, 3, 2, 2, 2, 28, 43, 28, 4, 28, 36, 7, 2, 27, 28, 53, 11, 21, 11, 18, 14, 17, 111, 72, 56, 50, 14, 50, 14, 35, 477, 28, 11, 0, 9, 21, 155, 22, 13, 52, 76, 44, 33, 24, 27, 35, 30, 0, 12, 34, 4, 0, 13, 47, 15, 3, 22, 0, 2, 0, 36, 17, 2, 24, 85, 6, 2, 0, 2, 3, 2, 14, 2, 9, 8, 46, 39, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 4, 0, 19, 0, 13, 4, 159, 52, 19, 3, 21, 0, 33, 47, 21, 1, 2, 0, 185, 46, 42, 3, 37, 47, 21, 0, 60, 42, 14, 0, 72, 26, 230, 43, 117, 63, 32, 0, 161, 7, 3, 38, 17, 0, 2, 0, 29, 0, 11, 39, 8, 0, 22, 0, 12, 45, 20, 0, 35, 56, 264, 8, 2, 36, 18, 0, 50, 29, 113, 6, 2, 1, 2, 37, 22, 0, 26, 5, 2, 1, 2, 31, 15, 0, 328, 18, 270, 921, 103, 110, 18, 195, 2749, 1070, 4050, 582, 8634, 568, 8, 30, 114, 29, 19, 47, 17, 3, 32, 20, 6, 18, 689, 63, 129, 74, 6, 0, 67, 12, 65, 1, 2, 0, 29, 6135, 9, 754, 9486, 286, 50, 2, 18, 3, 9, 395, 2309, 106, 6, 12, 4, 8, 8, 9, 5991, 84, 2, 70, 2, 1, 3, 0, 3, 1, 3, 3, 2, 11, 2, 0, 2, 6, 2, 64, 2, 3, 3, 7, 2, 6, 2, 27, 2, 3, 2, 4, 2, 0, 4, 6, 2, 339, 3, 24, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 7, 2357, 44, 11, 6, 17, 0, 370, 43, 1301, 196, 60, 67, 8, 0, 1205, 3, 2, 26, 2, 1, 2, 0, 3, 0, 2, 9, 2, 3, 2, 0, 2, 0, 7, 0, 5, 0, 2, 0, 2, 0, 2, 2, 2, 1, 2, 0, 3, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 1, 2, 0, 3, 3, 2, 6, 2, 3, 2, 3, 2, 0, 2, 9, 2, 16, 6, 2, 2, 4, 2, 16, 4421, 42710, 42, 4148, 12, 221, 3, 5761, 15, 7472, 3104, 541]; -const astralIdentifierCodes = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 574, 3, 9, 9, 525, 10, 176, 2, 54, 14, 32, 9, 16, 3, 46, 10, 54, 9, 7, 2, 37, 13, 2, 9, 6, 1, 45, 0, 13, 2, 49, 13, 9, 3, 4, 9, 83, 11, 7, 0, 161, 11, 6, 9, 7, 3, 56, 1, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 193, 17, 10, 9, 5, 0, 82, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 84, 14, 5, 9, 243, 14, 166, 9, 232, 6, 3, 6, 4, 0, 29, 9, 41, 6, 2, 3, 9, 0, 10, 10, 47, 15, 406, 7, 2, 7, 17, 9, 57, 21, 2, 13, 123, 5, 4, 0, 2, 1, 2, 6, 2, 0, 9, 9, 49, 4, 2, 1, 2, 4, 9, 9, 330, 3, 19306, 9, 135, 4, 60, 6, 26, 9, 1014, 0, 2, 54, 8, 3, 19723, 1, 5319, 4, 4, 5, 9, 7, 3, 6, 31, 3, 149, 2, 1418, 49, 513, 54, 5, 49, 9, 0, 15, 0, 23, 4, 2, 14, 1361, 6, 2, 16, 3, 6, 2, 1, 2, 4, 262, 6, 10, 9, 419, 13, 1495, 6, 110, 6, 6, 9, 792487, 239]; - -function isInAstralSet(code, set) { - let pos = 0x10000; - - for (let i = 0, length = set.length; i < length; i += 2) { - pos += set[i]; - if (pos > code) return false; - pos += set[i + 1]; - if (pos >= code) return true; - } - - return false; -} - -function isIdentifierStart(code) { - if (code < 65) return code === 36; - if (code <= 90) return true; - if (code < 97) return code === 95; - if (code <= 122) return true; - - if (code <= 0xffff) { - return code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code)); - } - - return isInAstralSet(code, astralIdentifierStartCodes); -} -function isIteratorStart(current, next) { - return current === 64 && next === 64; -} -function isIdentifierChar(code) { - if (code < 48) return code === 36; - if (code < 58) return true; - if (code < 65) return false; - if (code <= 90) return true; - if (code < 97) return code === 95; - if (code <= 122) return true; - - if (code <= 0xffff) { - return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code)); - } - - return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes); -} - -const reservedTypes = ["any", "bool", "boolean", "empty", "false", "mixed", "null", "number", "static", "string", "true", "typeof", "void", "interface", "extends", "_"]; - -function isEsModuleType(bodyElement) { - return bodyElement.type === "DeclareExportAllDeclaration" || bodyElement.type === "DeclareExportDeclaration" && (!bodyElement.declaration || bodyElement.declaration.type !== "TypeAlias" && bodyElement.declaration.type !== "InterfaceDeclaration"); -} - -function hasTypeImportKind(node) { - return node.importKind === "type" || node.importKind === "typeof"; -} - -function isMaybeDefaultImport(state) { - return (state.type === types.name || !!state.type.keyword) && state.value !== "from"; -} - -const exportSuggestions = { - const: "declare export var", - let: "declare export var", - type: "export type", - interface: "export interface" -}; - -function partition(list, test) { - const list1 = []; - const list2 = []; - - for (let i = 0; i < list.length; i++) { - (test(list[i], i, list) ? list1 : list2).push(list[i]); - } - - return [list1, list2]; -} - -const FLOW_PRAGMA_REGEX = /\*?\s*@((?:no)?flow)\b/; -var flow = (superClass => class extends superClass { - constructor(options, input) { - super(options, input); - this.flowPragma = undefined; - } - - shouldParseTypes() { - return this.getPluginOption("flow", "all") || this.flowPragma === "flow"; - } - - finishToken(type, val) { - if (type !== types.string && type !== types.semi && type !== types.interpreterDirective) { - if (this.flowPragma === undefined) { - this.flowPragma = null; - } - } - - return super.finishToken(type, val); - } - - addComment(comment) { - if (this.flowPragma === undefined) { - const matches = FLOW_PRAGMA_REGEX.exec(comment.value); - - if (!matches) ; else if (matches[1] === "flow") { - this.flowPragma = "flow"; - } else if (matches[1] === "noflow") { - this.flowPragma = "noflow"; - } else { - throw new Error("Unexpected flow pragma"); - } - } - - return super.addComment(comment); - } - - flowParseTypeInitialiser(tok) { - const oldInType = this.state.inType; - this.state.inType = true; - this.expect(tok || types.colon); - const type = this.flowParseType(); - this.state.inType = oldInType; - return type; - } - - flowParsePredicate() { - const node = this.startNode(); - const moduloLoc = this.state.startLoc; - const moduloPos = this.state.start; - this.expect(types.modulo); - const checksLoc = this.state.startLoc; - this.expectContextual("checks"); - - if (moduloLoc.line !== checksLoc.line || moduloLoc.column !== checksLoc.column - 1) { - this.raise(moduloPos, "Spaces between ´%´ and ´checks´ are not allowed here."); - } - - if (this.eat(types.parenL)) { - node.value = this.parseExpression(); - this.expect(types.parenR); - return this.finishNode(node, "DeclaredPredicate"); - } else { - return this.finishNode(node, "InferredPredicate"); - } - } - - flowParseTypeAndPredicateInitialiser() { - const oldInType = this.state.inType; - this.state.inType = true; - this.expect(types.colon); - let type = null; - let predicate = null; - - if (this.match(types.modulo)) { - this.state.inType = oldInType; - predicate = this.flowParsePredicate(); - } else { - type = this.flowParseType(); - this.state.inType = oldInType; - - if (this.match(types.modulo)) { - predicate = this.flowParsePredicate(); - } - } - - return [type, predicate]; - } - - flowParseDeclareClass(node) { - this.next(); - this.flowParseInterfaceish(node, true); - return this.finishNode(node, "DeclareClass"); - } - - flowParseDeclareFunction(node) { - this.next(); - const id = node.id = this.parseIdentifier(); - const typeNode = this.startNode(); - const typeContainer = this.startNode(); - - if (this.isRelational("<")) { - typeNode.typeParameters = this.flowParseTypeParameterDeclaration(); - } else { - typeNode.typeParameters = null; - } - - this.expect(types.parenL); - const tmp = this.flowParseFunctionTypeParams(); - typeNode.params = tmp.params; - typeNode.rest = tmp.rest; - this.expect(types.parenR); - [typeNode.returnType, node.predicate] = this.flowParseTypeAndPredicateInitialiser(); - typeContainer.typeAnnotation = this.finishNode(typeNode, "FunctionTypeAnnotation"); - id.typeAnnotation = this.finishNode(typeContainer, "TypeAnnotation"); - this.resetEndLocation(id); - this.semicolon(); - return this.finishNode(node, "DeclareFunction"); - } - - flowParseDeclare(node, insideModule) { - if (this.match(types._class)) { - return this.flowParseDeclareClass(node); - } else if (this.match(types._function)) { - return this.flowParseDeclareFunction(node); - } else if (this.match(types._var)) { - return this.flowParseDeclareVariable(node); - } else if (this.eatContextual("module")) { - if (this.match(types.dot)) { - return this.flowParseDeclareModuleExports(node); - } else { - if (insideModule) { - this.unexpected(this.state.lastTokStart, "`declare module` cannot be used inside another `declare module`"); - } - - return this.flowParseDeclareModule(node); - } - } else if (this.isContextual("type")) { - return this.flowParseDeclareTypeAlias(node); - } else if (this.isContextual("opaque")) { - return this.flowParseDeclareOpaqueType(node); - } else if (this.isContextual("interface")) { - return this.flowParseDeclareInterface(node); - } else if (this.match(types._export)) { - return this.flowParseDeclareExportDeclaration(node, insideModule); - } else { - throw this.unexpected(); - } - } - - flowParseDeclareVariable(node) { - this.next(); - node.id = this.flowParseTypeAnnotatableIdentifier(true); - this.semicolon(); - return this.finishNode(node, "DeclareVariable"); - } - - flowParseDeclareModule(node) { - this.scope.enter(SCOPE_OTHER); - - if (this.match(types.string)) { - node.id = this.parseExprAtom(); - } else { - node.id = this.parseIdentifier(); - } - - const bodyNode = node.body = this.startNode(); - const body = bodyNode.body = []; - this.expect(types.braceL); - - while (!this.match(types.braceR)) { - let bodyNode = this.startNode(); - - if (this.match(types._import)) { - this.next(); - - if (!this.isContextual("type") && !this.match(types._typeof)) { - this.unexpected(this.state.lastTokStart, "Imports within a `declare module` body must always be `import type` or `import typeof`"); - } - - this.parseImport(bodyNode); - } else { - this.expectContextual("declare", "Only declares and type imports are allowed inside declare module"); - bodyNode = this.flowParseDeclare(bodyNode, true); - } - - body.push(bodyNode); - } - - this.scope.exit(); - this.expect(types.braceR); - this.finishNode(bodyNode, "BlockStatement"); - let kind = null; - let hasModuleExport = false; - const errorMessage = "Found both `declare module.exports` and `declare export` in the same module. " + "Modules can only have 1 since they are either an ES module or they are a CommonJS module"; - body.forEach(bodyElement => { - if (isEsModuleType(bodyElement)) { - if (kind === "CommonJS") { - this.unexpected(bodyElement.start, errorMessage); - } - - kind = "ES"; - } else if (bodyElement.type === "DeclareModuleExports") { - if (hasModuleExport) { - this.unexpected(bodyElement.start, "Duplicate `declare module.exports` statement"); - } - - if (kind === "ES") this.unexpected(bodyElement.start, errorMessage); - kind = "CommonJS"; - hasModuleExport = true; - } - }); - node.kind = kind || "CommonJS"; - return this.finishNode(node, "DeclareModule"); - } - - flowParseDeclareExportDeclaration(node, insideModule) { - this.expect(types._export); - - if (this.eat(types._default)) { - if (this.match(types._function) || this.match(types._class)) { - node.declaration = this.flowParseDeclare(this.startNode()); - } else { - node.declaration = this.flowParseType(); - this.semicolon(); - } - - node.default = true; - return this.finishNode(node, "DeclareExportDeclaration"); - } else { - if (this.match(types._const) || this.isLet() || (this.isContextual("type") || this.isContextual("interface")) && !insideModule) { - const label = this.state.value; - const suggestion = exportSuggestions[label]; - this.unexpected(this.state.start, `\`declare export ${label}\` is not supported. Use \`${suggestion}\` instead`); - } - - if (this.match(types._var) || this.match(types._function) || this.match(types._class) || this.isContextual("opaque")) { - node.declaration = this.flowParseDeclare(this.startNode()); - node.default = false; - return this.finishNode(node, "DeclareExportDeclaration"); - } else if (this.match(types.star) || this.match(types.braceL) || this.isContextual("interface") || this.isContextual("type") || this.isContextual("opaque")) { - node = this.parseExport(node); - - if (node.type === "ExportNamedDeclaration") { - node.type = "ExportDeclaration"; - node.default = false; - delete node.exportKind; - } - - node.type = "Declare" + node.type; - return node; - } - } - - throw this.unexpected(); - } - - flowParseDeclareModuleExports(node) { - this.next(); - this.expectContextual("exports"); - node.typeAnnotation = this.flowParseTypeAnnotation(); - this.semicolon(); - return this.finishNode(node, "DeclareModuleExports"); - } - - flowParseDeclareTypeAlias(node) { - this.next(); - this.flowParseTypeAlias(node); - node.type = "DeclareTypeAlias"; - return node; - } - - flowParseDeclareOpaqueType(node) { - this.next(); - this.flowParseOpaqueType(node, true); - node.type = "DeclareOpaqueType"; - return node; - } - - flowParseDeclareInterface(node) { - this.next(); - this.flowParseInterfaceish(node); - return this.finishNode(node, "DeclareInterface"); - } - - flowParseInterfaceish(node, isClass = false) { - node.id = this.flowParseRestrictedIdentifier(!isClass); - - if (this.isRelational("<")) { - node.typeParameters = this.flowParseTypeParameterDeclaration(); - } else { - node.typeParameters = null; - } - - node.extends = []; - node.implements = []; - node.mixins = []; - - if (this.eat(types._extends)) { - do { - node.extends.push(this.flowParseInterfaceExtends()); - } while (!isClass && this.eat(types.comma)); - } - - if (this.isContextual("mixins")) { - this.next(); - - do { - node.mixins.push(this.flowParseInterfaceExtends()); - } while (this.eat(types.comma)); - } - - if (this.isContextual("implements")) { - this.next(); - - do { - node.implements.push(this.flowParseInterfaceExtends()); - } while (this.eat(types.comma)); - } - - node.body = this.flowParseObjectType({ - allowStatic: isClass, - allowExact: false, - allowSpread: false, - allowProto: isClass, - allowInexact: false - }); - } - - flowParseInterfaceExtends() { - const node = this.startNode(); - node.id = this.flowParseQualifiedTypeIdentifier(); - - if (this.isRelational("<")) { - node.typeParameters = this.flowParseTypeParameterInstantiation(); - } else { - node.typeParameters = null; - } - - return this.finishNode(node, "InterfaceExtends"); - } - - flowParseInterface(node) { - this.flowParseInterfaceish(node); - return this.finishNode(node, "InterfaceDeclaration"); - } - - checkNotUnderscore(word) { - if (word === "_") { - throw this.unexpected(null, "`_` is only allowed as a type argument to call or new"); - } - } - - checkReservedType(word, startLoc) { - if (reservedTypes.indexOf(word) > -1) { - this.raise(startLoc, `Cannot overwrite reserved type ${word}`); - } - } - - flowParseRestrictedIdentifier(liberal) { - this.checkReservedType(this.state.value, this.state.start); - return this.parseIdentifier(liberal); - } - - flowParseTypeAlias(node) { - node.id = this.flowParseRestrictedIdentifier(); - this.scope.declareName(node.id.name, BIND_LEXICAL, node.id.start); - - if (this.isRelational("<")) { - node.typeParameters = this.flowParseTypeParameterDeclaration(); - } else { - node.typeParameters = null; - } - - node.right = this.flowParseTypeInitialiser(types.eq); - this.semicolon(); - return this.finishNode(node, "TypeAlias"); - } - - flowParseOpaqueType(node, declare) { - this.expectContextual("type"); - node.id = this.flowParseRestrictedIdentifier(true); - this.scope.declareName(node.id.name, BIND_LEXICAL, node.id.start); - - if (this.isRelational("<")) { - node.typeParameters = this.flowParseTypeParameterDeclaration(); - } else { - node.typeParameters = null; - } - - node.supertype = null; - - if (this.match(types.colon)) { - node.supertype = this.flowParseTypeInitialiser(types.colon); - } - - node.impltype = null; - - if (!declare) { - node.impltype = this.flowParseTypeInitialiser(types.eq); - } - - this.semicolon(); - return this.finishNode(node, "OpaqueType"); - } - - flowParseTypeParameter(requireDefault = false) { - const nodeStart = this.state.start; - const node = this.startNode(); - const variance = this.flowParseVariance(); - const ident = this.flowParseTypeAnnotatableIdentifier(); - node.name = ident.name; - node.variance = variance; - node.bound = ident.typeAnnotation; - - if (this.match(types.eq)) { - this.eat(types.eq); - node.default = this.flowParseType(); - } else { - if (requireDefault) { - this.unexpected(nodeStart, "Type parameter declaration needs a default, since a preceding type parameter declaration has a default."); - } - } - - return this.finishNode(node, "TypeParameter"); - } - - flowParseTypeParameterDeclaration() { - const oldInType = this.state.inType; - const node = this.startNode(); - node.params = []; - this.state.inType = true; - - if (this.isRelational("<") || this.match(types.jsxTagStart)) { - this.next(); - } else { - this.unexpected(); - } - - let defaultRequired = false; - - do { - const typeParameter = this.flowParseTypeParameter(defaultRequired); - node.params.push(typeParameter); - - if (typeParameter.default) { - defaultRequired = true; - } - - if (!this.isRelational(">")) { - this.expect(types.comma); - } - } while (!this.isRelational(">")); - - this.expectRelational(">"); - this.state.inType = oldInType; - return this.finishNode(node, "TypeParameterDeclaration"); - } - - flowParseTypeParameterInstantiation() { - const node = this.startNode(); - const oldInType = this.state.inType; - node.params = []; - this.state.inType = true; - this.expectRelational("<"); - const oldNoAnonFunctionType = this.state.noAnonFunctionType; - this.state.noAnonFunctionType = false; - - while (!this.isRelational(">")) { - node.params.push(this.flowParseType()); - - if (!this.isRelational(">")) { - this.expect(types.comma); - } - } - - this.state.noAnonFunctionType = oldNoAnonFunctionType; - this.expectRelational(">"); - this.state.inType = oldInType; - return this.finishNode(node, "TypeParameterInstantiation"); - } - - flowParseTypeParameterInstantiationCallOrNew() { - const node = this.startNode(); - const oldInType = this.state.inType; - node.params = []; - this.state.inType = true; - this.expectRelational("<"); - - while (!this.isRelational(">")) { - node.params.push(this.flowParseTypeOrImplicitInstantiation()); - - if (!this.isRelational(">")) { - this.expect(types.comma); - } - } - - this.expectRelational(">"); - this.state.inType = oldInType; - return this.finishNode(node, "TypeParameterInstantiation"); - } - - flowParseInterfaceType() { - const node = this.startNode(); - this.expectContextual("interface"); - node.extends = []; - - if (this.eat(types._extends)) { - do { - node.extends.push(this.flowParseInterfaceExtends()); - } while (this.eat(types.comma)); - } - - node.body = this.flowParseObjectType({ - allowStatic: false, - allowExact: false, - allowSpread: false, - allowProto: false, - allowInexact: false - }); - return this.finishNode(node, "InterfaceTypeAnnotation"); - } - - flowParseObjectPropertyKey() { - return this.match(types.num) || this.match(types.string) ? this.parseExprAtom() : this.parseIdentifier(true); - } - - flowParseObjectTypeIndexer(node, isStatic, variance) { - node.static = isStatic; - - if (this.lookahead().type === types.colon) { - node.id = this.flowParseObjectPropertyKey(); - node.key = this.flowParseTypeInitialiser(); - } else { - node.id = null; - node.key = this.flowParseType(); - } - - this.expect(types.bracketR); - node.value = this.flowParseTypeInitialiser(); - node.variance = variance; - return this.finishNode(node, "ObjectTypeIndexer"); - } - - flowParseObjectTypeInternalSlot(node, isStatic) { - node.static = isStatic; - node.id = this.flowParseObjectPropertyKey(); - this.expect(types.bracketR); - this.expect(types.bracketR); - - if (this.isRelational("<") || this.match(types.parenL)) { - node.method = true; - node.optional = false; - node.value = this.flowParseObjectTypeMethodish(this.startNodeAt(node.start, node.loc.start)); - } else { - node.method = false; - - if (this.eat(types.question)) { - node.optional = true; - } - - node.value = this.flowParseTypeInitialiser(); - } - - return this.finishNode(node, "ObjectTypeInternalSlot"); - } - - flowParseObjectTypeMethodish(node) { - node.params = []; - node.rest = null; - node.typeParameters = null; - - if (this.isRelational("<")) { - node.typeParameters = this.flowParseTypeParameterDeclaration(); - } - - this.expect(types.parenL); - - while (!this.match(types.parenR) && !this.match(types.ellipsis)) { - node.params.push(this.flowParseFunctionTypeParam()); - - if (!this.match(types.parenR)) { - this.expect(types.comma); - } - } - - if (this.eat(types.ellipsis)) { - node.rest = this.flowParseFunctionTypeParam(); - } - - this.expect(types.parenR); - node.returnType = this.flowParseTypeInitialiser(); - return this.finishNode(node, "FunctionTypeAnnotation"); - } - - flowParseObjectTypeCallProperty(node, isStatic) { - const valueNode = this.startNode(); - node.static = isStatic; - node.value = this.flowParseObjectTypeMethodish(valueNode); - return this.finishNode(node, "ObjectTypeCallProperty"); - } - - flowParseObjectType({ - allowStatic, - allowExact, - allowSpread, - allowProto, - allowInexact - }) { - const oldInType = this.state.inType; - this.state.inType = true; - const nodeStart = this.startNode(); - nodeStart.callProperties = []; - nodeStart.properties = []; - nodeStart.indexers = []; - nodeStart.internalSlots = []; - let endDelim; - let exact; - let inexact = false; - - if (allowExact && this.match(types.braceBarL)) { - this.expect(types.braceBarL); - endDelim = types.braceBarR; - exact = true; - } else { - this.expect(types.braceL); - endDelim = types.braceR; - exact = false; - } - - nodeStart.exact = exact; - - while (!this.match(endDelim)) { - let isStatic = false; - let protoStart = null; - const node = this.startNode(); - - if (allowProto && this.isContextual("proto")) { - const lookahead = this.lookahead(); - - if (lookahead.type !== types.colon && lookahead.type !== types.question) { - this.next(); - protoStart = this.state.start; - allowStatic = false; - } - } - - if (allowStatic && this.isContextual("static")) { - const lookahead = this.lookahead(); - - if (lookahead.type !== types.colon && lookahead.type !== types.question) { - this.next(); - isStatic = true; - } - } - - const variance = this.flowParseVariance(); - - if (this.eat(types.bracketL)) { - if (protoStart != null) { - this.unexpected(protoStart); - } - - if (this.eat(types.bracketL)) { - if (variance) { - this.unexpected(variance.start); - } - - nodeStart.internalSlots.push(this.flowParseObjectTypeInternalSlot(node, isStatic)); - } else { - nodeStart.indexers.push(this.flowParseObjectTypeIndexer(node, isStatic, variance)); - } - } else if (this.match(types.parenL) || this.isRelational("<")) { - if (protoStart != null) { - this.unexpected(protoStart); - } - - if (variance) { - this.unexpected(variance.start); - } - - nodeStart.callProperties.push(this.flowParseObjectTypeCallProperty(node, isStatic)); - } else { - let kind = "init"; - - if (this.isContextual("get") || this.isContextual("set")) { - const lookahead = this.lookahead(); - - if (lookahead.type === types.name || lookahead.type === types.string || lookahead.type === types.num) { - kind = this.state.value; - this.next(); - } - } - - const propOrInexact = this.flowParseObjectTypeProperty(node, isStatic, protoStart, variance, kind, allowSpread, allowInexact); - - if (propOrInexact === null) { - inexact = true; - } else { - nodeStart.properties.push(propOrInexact); - } - } - - this.flowObjectTypeSemicolon(); - } - - this.expect(endDelim); - - if (allowSpread) { - nodeStart.inexact = inexact; - } - - const out = this.finishNode(nodeStart, "ObjectTypeAnnotation"); - this.state.inType = oldInType; - return out; - } - - flowParseObjectTypeProperty(node, isStatic, protoStart, variance, kind, allowSpread, allowInexact) { - if (this.match(types.ellipsis)) { - if (!allowSpread) { - this.unexpected(null, "Spread operator cannot appear in class or interface definitions"); - } - - if (protoStart != null) { - this.unexpected(protoStart); - } - - if (variance) { - this.unexpected(variance.start, "Spread properties cannot have variance"); - } - - this.expect(types.ellipsis); - const isInexactToken = this.eat(types.comma) || this.eat(types.semi); - - if (this.match(types.braceR)) { - if (allowInexact) return null; - this.unexpected(null, "Explicit inexact syntax is only allowed inside inexact objects"); - } - - if (this.match(types.braceBarR)) { - this.unexpected(null, "Explicit inexact syntax cannot appear inside an explicit exact object type"); - } - - if (isInexactToken) { - this.unexpected(null, "Explicit inexact syntax must appear at the end of an inexact object"); - } - - node.argument = this.flowParseType(); - return this.finishNode(node, "ObjectTypeSpreadProperty"); - } else { - node.key = this.flowParseObjectPropertyKey(); - node.static = isStatic; - node.proto = protoStart != null; - node.kind = kind; - let optional = false; - - if (this.isRelational("<") || this.match(types.parenL)) { - node.method = true; - - if (protoStart != null) { - this.unexpected(protoStart); - } - - if (variance) { - this.unexpected(variance.start); - } - - node.value = this.flowParseObjectTypeMethodish(this.startNodeAt(node.start, node.loc.start)); - - if (kind === "get" || kind === "set") { - this.flowCheckGetterSetterParams(node); - } - } else { - if (kind !== "init") this.unexpected(); - node.method = false; - - if (this.eat(types.question)) { - optional = true; - } - - node.value = this.flowParseTypeInitialiser(); - node.variance = variance; - } - - node.optional = optional; - return this.finishNode(node, "ObjectTypeProperty"); - } - } - - flowCheckGetterSetterParams(property) { - const paramCount = property.kind === "get" ? 0 : 1; - const start = property.start; - const length = property.value.params.length + (property.value.rest ? 1 : 0); - - if (length !== paramCount) { - if (property.kind === "get") { - this.raise(start, "getter must not have any formal parameters"); - } else { - this.raise(start, "setter must have exactly one formal parameter"); - } - } - - if (property.kind === "set" && property.value.rest) { - this.raise(start, "setter function argument must not be a rest parameter"); - } - } - - flowObjectTypeSemicolon() { - if (!this.eat(types.semi) && !this.eat(types.comma) && !this.match(types.braceR) && !this.match(types.braceBarR)) { - this.unexpected(); - } - } - - flowParseQualifiedTypeIdentifier(startPos, startLoc, id) { - startPos = startPos || this.state.start; - startLoc = startLoc || this.state.startLoc; - let node = id || this.parseIdentifier(); - - while (this.eat(types.dot)) { - const node2 = this.startNodeAt(startPos, startLoc); - node2.qualification = node; - node2.id = this.parseIdentifier(); - node = this.finishNode(node2, "QualifiedTypeIdentifier"); - } - - return node; - } - - flowParseGenericType(startPos, startLoc, id) { - const node = this.startNodeAt(startPos, startLoc); - node.typeParameters = null; - node.id = this.flowParseQualifiedTypeIdentifier(startPos, startLoc, id); - - if (this.isRelational("<")) { - node.typeParameters = this.flowParseTypeParameterInstantiation(); - } - - return this.finishNode(node, "GenericTypeAnnotation"); - } - - flowParseTypeofType() { - const node = this.startNode(); - this.expect(types._typeof); - node.argument = this.flowParsePrimaryType(); - return this.finishNode(node, "TypeofTypeAnnotation"); - } - - flowParseTupleType() { - const node = this.startNode(); - node.types = []; - this.expect(types.bracketL); - - while (this.state.pos < this.length && !this.match(types.bracketR)) { - node.types.push(this.flowParseType()); - if (this.match(types.bracketR)) break; - this.expect(types.comma); - } - - this.expect(types.bracketR); - return this.finishNode(node, "TupleTypeAnnotation"); - } - - flowParseFunctionTypeParam() { - let name = null; - let optional = false; - let typeAnnotation = null; - const node = this.startNode(); - const lh = this.lookahead(); - - if (lh.type === types.colon || lh.type === types.question) { - name = this.parseIdentifier(); - - if (this.eat(types.question)) { - optional = true; - } - - typeAnnotation = this.flowParseTypeInitialiser(); - } else { - typeAnnotation = this.flowParseType(); - } - - node.name = name; - node.optional = optional; - node.typeAnnotation = typeAnnotation; - return this.finishNode(node, "FunctionTypeParam"); - } - - reinterpretTypeAsFunctionTypeParam(type) { - const node = this.startNodeAt(type.start, type.loc.start); - node.name = null; - node.optional = false; - node.typeAnnotation = type; - return this.finishNode(node, "FunctionTypeParam"); - } - - flowParseFunctionTypeParams(params = []) { - let rest = null; - - while (!this.match(types.parenR) && !this.match(types.ellipsis)) { - params.push(this.flowParseFunctionTypeParam()); - - if (!this.match(types.parenR)) { - this.expect(types.comma); - } - } - - if (this.eat(types.ellipsis)) { - rest = this.flowParseFunctionTypeParam(); - } - - return { - params, - rest - }; - } - - flowIdentToTypeAnnotation(startPos, startLoc, node, id) { - switch (id.name) { - case "any": - return this.finishNode(node, "AnyTypeAnnotation"); - - case "bool": - case "boolean": - return this.finishNode(node, "BooleanTypeAnnotation"); - - case "mixed": - return this.finishNode(node, "MixedTypeAnnotation"); - - case "empty": - return this.finishNode(node, "EmptyTypeAnnotation"); - - case "number": - return this.finishNode(node, "NumberTypeAnnotation"); - - case "string": - return this.finishNode(node, "StringTypeAnnotation"); - - default: - this.checkNotUnderscore(id.name); - return this.flowParseGenericType(startPos, startLoc, id); - } - } - - flowParsePrimaryType() { - const startPos = this.state.start; - const startLoc = this.state.startLoc; - const node = this.startNode(); - let tmp; - let type; - let isGroupedType = false; - const oldNoAnonFunctionType = this.state.noAnonFunctionType; - - switch (this.state.type) { - case types.name: - if (this.isContextual("interface")) { - return this.flowParseInterfaceType(); - } - - return this.flowIdentToTypeAnnotation(startPos, startLoc, node, this.parseIdentifier()); - - case types.braceL: - return this.flowParseObjectType({ - allowStatic: false, - allowExact: false, - allowSpread: true, - allowProto: false, - allowInexact: true - }); - - case types.braceBarL: - return this.flowParseObjectType({ - allowStatic: false, - allowExact: true, - allowSpread: true, - allowProto: false, - allowInexact: false - }); - - case types.bracketL: - this.state.noAnonFunctionType = false; - type = this.flowParseTupleType(); - this.state.noAnonFunctionType = oldNoAnonFunctionType; - return type; - - case types.relational: - if (this.state.value === "<") { - node.typeParameters = this.flowParseTypeParameterDeclaration(); - this.expect(types.parenL); - tmp = this.flowParseFunctionTypeParams(); - node.params = tmp.params; - node.rest = tmp.rest; - this.expect(types.parenR); - this.expect(types.arrow); - node.returnType = this.flowParseType(); - return this.finishNode(node, "FunctionTypeAnnotation"); - } - - break; - - case types.parenL: - this.next(); - - if (!this.match(types.parenR) && !this.match(types.ellipsis)) { - if (this.match(types.name)) { - const token = this.lookahead().type; - isGroupedType = token !== types.question && token !== types.colon; - } else { - isGroupedType = true; - } - } - - if (isGroupedType) { - this.state.noAnonFunctionType = false; - type = this.flowParseType(); - this.state.noAnonFunctionType = oldNoAnonFunctionType; - - if (this.state.noAnonFunctionType || !(this.match(types.comma) || this.match(types.parenR) && this.lookahead().type === types.arrow)) { - this.expect(types.parenR); - return type; - } else { - this.eat(types.comma); - } - } - - if (type) { - tmp = this.flowParseFunctionTypeParams([this.reinterpretTypeAsFunctionTypeParam(type)]); - } else { - tmp = this.flowParseFunctionTypeParams(); - } - - node.params = tmp.params; - node.rest = tmp.rest; - this.expect(types.parenR); - this.expect(types.arrow); - node.returnType = this.flowParseType(); - node.typeParameters = null; - return this.finishNode(node, "FunctionTypeAnnotation"); - - case types.string: - return this.parseLiteral(this.state.value, "StringLiteralTypeAnnotation"); - - case types._true: - case types._false: - node.value = this.match(types._true); - this.next(); - return this.finishNode(node, "BooleanLiteralTypeAnnotation"); - - case types.plusMin: - if (this.state.value === "-") { - this.next(); - - if (this.match(types.num)) { - return this.parseLiteral(-this.state.value, "NumberLiteralTypeAnnotation", node.start, node.loc.start); - } - - if (this.match(types.bigint)) { - return this.parseLiteral(-this.state.value, "BigIntLiteralTypeAnnotation", node.start, node.loc.start); - } - - this.unexpected(null, `Unexpected token, expected "number" or "bigint"`); - } - - this.unexpected(); - - case types.num: - return this.parseLiteral(this.state.value, "NumberLiteralTypeAnnotation"); - - case types.bigint: - return this.parseLiteral(this.state.value, "BigIntLiteralTypeAnnotation"); - - case types._void: - this.next(); - return this.finishNode(node, "VoidTypeAnnotation"); - - case types._null: - this.next(); - return this.finishNode(node, "NullLiteralTypeAnnotation"); - - case types._this: - this.next(); - return this.finishNode(node, "ThisTypeAnnotation"); - - case types.star: - this.next(); - return this.finishNode(node, "ExistsTypeAnnotation"); - - default: - if (this.state.type.keyword === "typeof") { - return this.flowParseTypeofType(); - } else if (this.state.type.keyword) { - const label = this.state.type.label; - this.next(); - return super.createIdentifier(node, label); - } - - } - - throw this.unexpected(); - } - - flowParsePostfixType() { - const startPos = this.state.start, - startLoc = this.state.startLoc; - let type = this.flowParsePrimaryType(); - - while (this.match(types.bracketL) && !this.canInsertSemicolon()) { - const node = this.startNodeAt(startPos, startLoc); - node.elementType = type; - this.expect(types.bracketL); - this.expect(types.bracketR); - type = this.finishNode(node, "ArrayTypeAnnotation"); - } - - return type; - } - - flowParsePrefixType() { - const node = this.startNode(); - - if (this.eat(types.question)) { - node.typeAnnotation = this.flowParsePrefixType(); - return this.finishNode(node, "NullableTypeAnnotation"); - } else { - return this.flowParsePostfixType(); - } - } - - flowParseAnonFunctionWithoutParens() { - const param = this.flowParsePrefixType(); - - if (!this.state.noAnonFunctionType && this.eat(types.arrow)) { - const node = this.startNodeAt(param.start, param.loc.start); - node.params = [this.reinterpretTypeAsFunctionTypeParam(param)]; - node.rest = null; - node.returnType = this.flowParseType(); - node.typeParameters = null; - return this.finishNode(node, "FunctionTypeAnnotation"); - } - - return param; - } - - flowParseIntersectionType() { - const node = this.startNode(); - this.eat(types.bitwiseAND); - const type = this.flowParseAnonFunctionWithoutParens(); - node.types = [type]; - - while (this.eat(types.bitwiseAND)) { - node.types.push(this.flowParseAnonFunctionWithoutParens()); - } - - return node.types.length === 1 ? type : this.finishNode(node, "IntersectionTypeAnnotation"); - } - - flowParseUnionType() { - const node = this.startNode(); - this.eat(types.bitwiseOR); - const type = this.flowParseIntersectionType(); - node.types = [type]; - - while (this.eat(types.bitwiseOR)) { - node.types.push(this.flowParseIntersectionType()); - } - - return node.types.length === 1 ? type : this.finishNode(node, "UnionTypeAnnotation"); - } - - flowParseType() { - const oldInType = this.state.inType; - this.state.inType = true; - const type = this.flowParseUnionType(); - this.state.inType = oldInType; - this.state.exprAllowed = this.state.exprAllowed || this.state.noAnonFunctionType; - return type; - } - - flowParseTypeOrImplicitInstantiation() { - if (this.state.type === types.name && this.state.value === "_") { - const startPos = this.state.start; - const startLoc = this.state.startLoc; - const node = this.parseIdentifier(); - return this.flowParseGenericType(startPos, startLoc, node); - } else { - return this.flowParseType(); - } - } - - flowParseTypeAnnotation() { - const node = this.startNode(); - node.typeAnnotation = this.flowParseTypeInitialiser(); - return this.finishNode(node, "TypeAnnotation"); - } - - flowParseTypeAnnotatableIdentifier(allowPrimitiveOverride) { - const ident = allowPrimitiveOverride ? this.parseIdentifier() : this.flowParseRestrictedIdentifier(); - - if (this.match(types.colon)) { - ident.typeAnnotation = this.flowParseTypeAnnotation(); - this.resetEndLocation(ident); - } - - return ident; - } - - typeCastToParameter(node) { - node.expression.typeAnnotation = node.typeAnnotation; - this.resetEndLocation(node.expression, node.typeAnnotation.end, node.typeAnnotation.loc.end); - return node.expression; - } - - flowParseVariance() { - let variance = null; - - if (this.match(types.plusMin)) { - variance = this.startNode(); - - if (this.state.value === "+") { - variance.kind = "plus"; - } else { - variance.kind = "minus"; - } - - this.next(); - this.finishNode(variance, "Variance"); - } - - return variance; - } - - parseFunctionBody(node, allowExpressionBody, isMethod = false) { - if (allowExpressionBody) { - return this.forwardNoArrowParamsConversionAt(node, () => super.parseFunctionBody(node, true, isMethod)); - } - - return super.parseFunctionBody(node, false, isMethod); - } - - parseFunctionBodyAndFinish(node, type, isMethod = false) { - if (this.match(types.colon)) { - const typeNode = this.startNode(); - [typeNode.typeAnnotation, node.predicate] = this.flowParseTypeAndPredicateInitialiser(); - node.returnType = typeNode.typeAnnotation ? this.finishNode(typeNode, "TypeAnnotation") : null; - } - - super.parseFunctionBodyAndFinish(node, type, isMethod); - } - - parseStatement(context, topLevel) { - if (this.state.strict && this.match(types.name) && this.state.value === "interface") { - const node = this.startNode(); - this.next(); - return this.flowParseInterface(node); - } else { - const stmt = super.parseStatement(context, topLevel); - - if (this.flowPragma === undefined && !this.isValidDirective(stmt)) { - this.flowPragma = null; - } - - return stmt; - } - } - - parseExpressionStatement(node, expr) { - if (expr.type === "Identifier") { - if (expr.name === "declare") { - if (this.match(types._class) || this.match(types.name) || this.match(types._function) || this.match(types._var) || this.match(types._export)) { - return this.flowParseDeclare(node); - } - } else if (this.match(types.name)) { - if (expr.name === "interface") { - return this.flowParseInterface(node); - } else if (expr.name === "type") { - return this.flowParseTypeAlias(node); - } else if (expr.name === "opaque") { - return this.flowParseOpaqueType(node, false); - } - } - } - - return super.parseExpressionStatement(node, expr); - } - - shouldParseExportDeclaration() { - return this.isContextual("type") || this.isContextual("interface") || this.isContextual("opaque") || super.shouldParseExportDeclaration(); - } - - isExportDefaultSpecifier() { - if (this.match(types.name) && (this.state.value === "type" || this.state.value === "interface" || this.state.value === "opaque")) { - return false; - } - - return super.isExportDefaultSpecifier(); - } - - parseConditional(expr, noIn, startPos, startLoc, refNeedsArrowPos) { - if (!this.match(types.question)) return expr; - - if (refNeedsArrowPos) { - const state = this.state.clone(); - - try { - return super.parseConditional(expr, noIn, startPos, startLoc); - } catch (err) { - if (err instanceof SyntaxError) { - this.state = state; - refNeedsArrowPos.start = err.pos || this.state.start; - return expr; - } else { - throw err; - } - } - } - - this.expect(types.question); - const state = this.state.clone(); - const originalNoArrowAt = this.state.noArrowAt; - const node = this.startNodeAt(startPos, startLoc); - let { - consequent, - failed - } = this.tryParseConditionalConsequent(); - let [valid, invalid] = this.getArrowLikeExpressions(consequent); - - if (failed || invalid.length > 0) { - const noArrowAt = [...originalNoArrowAt]; - - if (invalid.length > 0) { - this.state = state; - this.state.noArrowAt = noArrowAt; - - for (let i = 0; i < invalid.length; i++) { - noArrowAt.push(invalid[i].start); - } - - ({ - consequent, - failed - } = this.tryParseConditionalConsequent()); - [valid, invalid] = this.getArrowLikeExpressions(consequent); - } - - if (failed && valid.length > 1) { - this.raise(state.start, "Ambiguous expression: wrap the arrow functions in parentheses to disambiguate."); - } - - if (failed && valid.length === 1) { - this.state = state; - this.state.noArrowAt = noArrowAt.concat(valid[0].start); - ({ - consequent, - failed - } = this.tryParseConditionalConsequent()); - } - - this.getArrowLikeExpressions(consequent, true); - } - - this.state.noArrowAt = originalNoArrowAt; - this.expect(types.colon); - node.test = expr; - node.consequent = consequent; - node.alternate = this.forwardNoArrowParamsConversionAt(node, () => this.parseMaybeAssign(noIn, undefined, undefined, undefined)); - return this.finishNode(node, "ConditionalExpression"); - } - - tryParseConditionalConsequent() { - this.state.noArrowParamsConversionAt.push(this.state.start); - const consequent = this.parseMaybeAssign(); - const failed = !this.match(types.colon); - this.state.noArrowParamsConversionAt.pop(); - return { - consequent, - failed - }; - } - - getArrowLikeExpressions(node, disallowInvalid) { - const stack = [node]; - const arrows = []; - - while (stack.length !== 0) { - const node = stack.pop(); - - if (node.type === "ArrowFunctionExpression") { - if (node.typeParameters || !node.returnType) { - this.toAssignableList(node.params, true, "arrow function parameters"); - this.scope.enter(functionFlags(false, false) | SCOPE_ARROW); - super.checkParams(node, false, true); - this.scope.exit(); - } else { - arrows.push(node); - } - - stack.push(node.body); - } else if (node.type === "ConditionalExpression") { - stack.push(node.consequent); - stack.push(node.alternate); - } - } - - if (disallowInvalid) { - for (let i = 0; i < arrows.length; i++) { - this.toAssignableList(node.params, true, "arrow function parameters"); - } - - return [arrows, []]; - } - - return partition(arrows, node => { - try { - this.toAssignableList(node.params, true, "arrow function parameters"); - return true; - } catch (err) { - return false; - } - }); - } - - forwardNoArrowParamsConversionAt(node, parse) { - let result; - - if (this.state.noArrowParamsConversionAt.indexOf(node.start) !== -1) { - this.state.noArrowParamsConversionAt.push(this.state.start); - result = parse(); - this.state.noArrowParamsConversionAt.pop(); - } else { - result = parse(); - } - - return result; - } - - parseParenItem(node, startPos, startLoc) { - node = super.parseParenItem(node, startPos, startLoc); - - if (this.eat(types.question)) { - node.optional = true; - this.resetEndLocation(node); - } - - if (this.match(types.colon)) { - const typeCastNode = this.startNodeAt(startPos, startLoc); - typeCastNode.expression = node; - typeCastNode.typeAnnotation = this.flowParseTypeAnnotation(); - return this.finishNode(typeCastNode, "TypeCastExpression"); - } - - return node; - } - - assertModuleNodeAllowed(node) { - if (node.type === "ImportDeclaration" && (node.importKind === "type" || node.importKind === "typeof") || node.type === "ExportNamedDeclaration" && node.exportKind === "type" || node.type === "ExportAllDeclaration" && node.exportKind === "type") { - return; - } - - super.assertModuleNodeAllowed(node); - } - - parseExport(node) { - const decl = super.parseExport(node); - - if (decl.type === "ExportNamedDeclaration" || decl.type === "ExportAllDeclaration") { - decl.exportKind = decl.exportKind || "value"; - } - - return decl; - } - - parseExportDeclaration(node) { - if (this.isContextual("type")) { - node.exportKind = "type"; - const declarationNode = this.startNode(); - this.next(); - - if (this.match(types.braceL)) { - node.specifiers = this.parseExportSpecifiers(); - this.parseExportFrom(node); - return null; - } else { - return this.flowParseTypeAlias(declarationNode); - } - } else if (this.isContextual("opaque")) { - node.exportKind = "type"; - const declarationNode = this.startNode(); - this.next(); - return this.flowParseOpaqueType(declarationNode, false); - } else if (this.isContextual("interface")) { - node.exportKind = "type"; - const declarationNode = this.startNode(); - this.next(); - return this.flowParseInterface(declarationNode); - } else { - return super.parseExportDeclaration(node); - } - } - - eatExportStar(node) { - if (super.eatExportStar(...arguments)) return true; - - if (this.isContextual("type") && this.lookahead().type === types.star) { - node.exportKind = "type"; - this.next(); - this.next(); - return true; - } - - return false; - } - - maybeParseExportNamespaceSpecifier(node) { - const pos = this.state.start; - const hasNamespace = super.maybeParseExportNamespaceSpecifier(node); - - if (hasNamespace && node.exportKind === "type") { - this.unexpected(pos); - } - - return hasNamespace; - } - - parseClassId(node, isStatement, optionalId) { - super.parseClassId(node, isStatement, optionalId); - - if (this.isRelational("<")) { - node.typeParameters = this.flowParseTypeParameterDeclaration(); - } - } - - getTokenFromCode(code) { - const next = this.input.charCodeAt(this.state.pos + 1); - - if (code === 123 && next === 124) { - return this.finishOp(types.braceBarL, 2); - } else if (this.state.inType && (code === 62 || code === 60)) { - return this.finishOp(types.relational, 1); - } else if (isIteratorStart(code, next)) { - this.state.isIterator = true; - return super.readWord(); - } else { - return super.getTokenFromCode(code); - } - } - - toAssignable(node, isBinding, contextDescription) { - if (node.type === "TypeCastExpression") { - return super.toAssignable(this.typeCastToParameter(node), isBinding, contextDescription); - } else { - return super.toAssignable(node, isBinding, contextDescription); - } - } - - toAssignableList(exprList, isBinding, contextDescription) { - for (let i = 0; i < exprList.length; i++) { - const expr = exprList[i]; - - if (expr && expr.type === "TypeCastExpression") { - exprList[i] = this.typeCastToParameter(expr); - } - } - - return super.toAssignableList(exprList, isBinding, contextDescription); - } - - toReferencedList(exprList, isParenthesizedExpr) { - for (let i = 0; i < exprList.length; i++) { - const expr = exprList[i]; - - if (expr && expr.type === "TypeCastExpression" && (!expr.extra || !expr.extra.parenthesized) && (exprList.length > 1 || !isParenthesizedExpr)) { - this.raise(expr.typeAnnotation.start, "The type cast expression is expected to be wrapped with parenthesis"); - } - } - - return exprList; - } - - checkLVal(expr, bindingType = BIND_NONE, checkClashes, contextDescription) { - if (expr.type !== "TypeCastExpression") { - return super.checkLVal(expr, bindingType, checkClashes, contextDescription); - } - } - - parseClassProperty(node) { - if (this.match(types.colon)) { - node.typeAnnotation = this.flowParseTypeAnnotation(); - } - - return super.parseClassProperty(node); - } - - parseClassPrivateProperty(node) { - if (this.match(types.colon)) { - node.typeAnnotation = this.flowParseTypeAnnotation(); - } - - return super.parseClassPrivateProperty(node); - } - - isClassMethod() { - return this.isRelational("<") || super.isClassMethod(); - } - - isClassProperty() { - return this.match(types.colon) || super.isClassProperty(); - } - - isNonstaticConstructor(method) { - return !this.match(types.colon) && super.isNonstaticConstructor(method); - } - - pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper) { - if (method.variance) { - this.unexpected(method.variance.start); - } - - delete method.variance; - - if (this.isRelational("<")) { - method.typeParameters = this.flowParseTypeParameterDeclaration(); - } - - super.pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper); - } - - pushClassPrivateMethod(classBody, method, isGenerator, isAsync) { - if (method.variance) { - this.unexpected(method.variance.start); - } - - delete method.variance; - - if (this.isRelational("<")) { - method.typeParameters = this.flowParseTypeParameterDeclaration(); - } - - super.pushClassPrivateMethod(classBody, method, isGenerator, isAsync); - } - - parseClassSuper(node) { - super.parseClassSuper(node); - - if (node.superClass && this.isRelational("<")) { - node.superTypeParameters = this.flowParseTypeParameterInstantiation(); - } - - if (this.isContextual("implements")) { - this.next(); - const implemented = node.implements = []; - - do { - const node = this.startNode(); - node.id = this.flowParseRestrictedIdentifier(true); - - if (this.isRelational("<")) { - node.typeParameters = this.flowParseTypeParameterInstantiation(); - } else { - node.typeParameters = null; - } - - implemented.push(this.finishNode(node, "ClassImplements")); - } while (this.eat(types.comma)); - } - } - - parsePropertyName(node) { - const variance = this.flowParseVariance(); - const key = super.parsePropertyName(node); - node.variance = variance; - return key; - } - - parseObjPropValue(prop, startPos, startLoc, isGenerator, isAsync, isPattern, refShorthandDefaultPos, containsEsc) { - if (prop.variance) { - this.unexpected(prop.variance.start); - } - - delete prop.variance; - let typeParameters; - - if (this.isRelational("<")) { - typeParameters = this.flowParseTypeParameterDeclaration(); - if (!this.match(types.parenL)) this.unexpected(); - } - - super.parseObjPropValue(prop, startPos, startLoc, isGenerator, isAsync, isPattern, refShorthandDefaultPos, containsEsc); - - if (typeParameters) { - (prop.value || prop).typeParameters = typeParameters; - } - } - - parseAssignableListItemTypes(param) { - if (this.eat(types.question)) { - if (param.type !== "Identifier") { - throw this.raise(param.start, "A binding pattern parameter cannot be optional in an implementation signature."); - } - - param.optional = true; - } - - if (this.match(types.colon)) { - param.typeAnnotation = this.flowParseTypeAnnotation(); - } - - this.resetEndLocation(param); - return param; - } - - parseMaybeDefault(startPos, startLoc, left) { - const node = super.parseMaybeDefault(startPos, startLoc, left); - - if (node.type === "AssignmentPattern" && node.typeAnnotation && node.right.start < node.typeAnnotation.start) { - this.raise(node.typeAnnotation.start, "Type annotations must come before default assignments, " + "e.g. instead of `age = 25: number` use `age: number = 25`"); - } - - return node; - } - - shouldParseDefaultImport(node) { - if (!hasTypeImportKind(node)) { - return super.shouldParseDefaultImport(node); - } - - return isMaybeDefaultImport(this.state); - } - - parseImportSpecifierLocal(node, specifier, type, contextDescription) { - specifier.local = hasTypeImportKind(node) ? this.flowParseRestrictedIdentifier(true) : this.parseIdentifier(); - this.checkLVal(specifier.local, BIND_LEXICAL, undefined, contextDescription); - node.specifiers.push(this.finishNode(specifier, type)); - } - - maybeParseDefaultImportSpecifier(node) { - node.importKind = "value"; - let kind = null; - - if (this.match(types._typeof)) { - kind = "typeof"; - } else if (this.isContextual("type")) { - kind = "type"; - } - - if (kind) { - const lh = this.lookahead(); - - if (kind === "type" && lh.type === types.star) { - this.unexpected(lh.start); - } - - if (isMaybeDefaultImport(lh) || lh.type === types.braceL || lh.type === types.star) { - this.next(); - node.importKind = kind; - } - } - - return super.maybeParseDefaultImportSpecifier(node); - } - - parseImportSpecifier(node) { - const specifier = this.startNode(); - const firstIdentLoc = this.state.start; - const firstIdent = this.parseIdentifier(true); - let specifierTypeKind = null; - - if (firstIdent.name === "type") { - specifierTypeKind = "type"; - } else if (firstIdent.name === "typeof") { - specifierTypeKind = "typeof"; - } - - let isBinding = false; - - if (this.isContextual("as") && !this.isLookaheadContextual("as")) { - const as_ident = this.parseIdentifier(true); - - if (specifierTypeKind !== null && !this.match(types.name) && !this.state.type.keyword) { - specifier.imported = as_ident; - specifier.importKind = specifierTypeKind; - specifier.local = as_ident.__clone(); - } else { - specifier.imported = firstIdent; - specifier.importKind = null; - specifier.local = this.parseIdentifier(); - } - } else if (specifierTypeKind !== null && (this.match(types.name) || this.state.type.keyword)) { - specifier.imported = this.parseIdentifier(true); - specifier.importKind = specifierTypeKind; - - if (this.eatContextual("as")) { - specifier.local = this.parseIdentifier(); - } else { - isBinding = true; - specifier.local = specifier.imported.__clone(); - } - } else { - isBinding = true; - specifier.imported = firstIdent; - specifier.importKind = null; - specifier.local = specifier.imported.__clone(); - } - - const nodeIsTypeImport = hasTypeImportKind(node); - const specifierIsTypeImport = hasTypeImportKind(specifier); - - if (nodeIsTypeImport && specifierIsTypeImport) { - this.raise(firstIdentLoc, "The `type` and `typeof` keywords on named imports can only be used on regular " + "`import` statements. It cannot be used with `import type` or `import typeof` statements"); - } - - if (nodeIsTypeImport || specifierIsTypeImport) { - this.checkReservedType(specifier.local.name, specifier.local.start); - } - - if (isBinding && !nodeIsTypeImport && !specifierIsTypeImport) { - this.checkReservedWord(specifier.local.name, specifier.start, true, true); - } - - this.checkLVal(specifier.local, BIND_LEXICAL, undefined, "import specifier"); - node.specifiers.push(this.finishNode(specifier, "ImportSpecifier")); - } - - parseFunctionParams(node, allowModifiers) { - const kind = node.kind; - - if (kind !== "get" && kind !== "set" && this.isRelational("<")) { - node.typeParameters = this.flowParseTypeParameterDeclaration(); - } - - super.parseFunctionParams(node, allowModifiers); - } - - parseVarId(decl, kind) { - super.parseVarId(decl, kind); - - if (this.match(types.colon)) { - decl.id.typeAnnotation = this.flowParseTypeAnnotation(); - this.resetEndLocation(decl.id); - } - } - - parseAsyncArrowFromCallExpression(node, call) { - if (this.match(types.colon)) { - const oldNoAnonFunctionType = this.state.noAnonFunctionType; - this.state.noAnonFunctionType = true; - node.returnType = this.flowParseTypeAnnotation(); - this.state.noAnonFunctionType = oldNoAnonFunctionType; - } - - return super.parseAsyncArrowFromCallExpression(node, call); - } - - shouldParseAsyncArrow() { - return this.match(types.colon) || super.shouldParseAsyncArrow(); - } - - parseMaybeAssign(noIn, refShorthandDefaultPos, afterLeftParse, refNeedsArrowPos) { - let jsxError = null; - - if (this.hasPlugin("jsx") && (this.match(types.jsxTagStart) || this.isRelational("<"))) { - const state = this.state.clone(); - - try { - return super.parseMaybeAssign(noIn, refShorthandDefaultPos, afterLeftParse, refNeedsArrowPos); - } catch (err) { - if (err instanceof SyntaxError) { - this.state = state; - const cLength = this.state.context.length; - - if (this.state.context[cLength - 1] === types$1.j_oTag) { - this.state.context.length -= 2; - } - - jsxError = err; - } else { - throw err; - } - } - } - - if (jsxError != null || this.isRelational("<")) { - let arrowExpression; - let typeParameters; - - try { - typeParameters = this.flowParseTypeParameterDeclaration(); - arrowExpression = this.forwardNoArrowParamsConversionAt(typeParameters, () => super.parseMaybeAssign(noIn, refShorthandDefaultPos, afterLeftParse, refNeedsArrowPos)); - arrowExpression.typeParameters = typeParameters; - this.resetStartLocationFromNode(arrowExpression, typeParameters); - } catch (err) { - throw jsxError || err; - } - - if (arrowExpression.type === "ArrowFunctionExpression") { - return arrowExpression; - } else if (jsxError != null) { - throw jsxError; - } else { - this.raise(typeParameters.start, "Expected an arrow function after this type parameter declaration"); - } - } - - return super.parseMaybeAssign(noIn, refShorthandDefaultPos, afterLeftParse, refNeedsArrowPos); - } - - parseArrow(node) { - if (this.match(types.colon)) { - const state = this.state.clone(); - - try { - const oldNoAnonFunctionType = this.state.noAnonFunctionType; - this.state.noAnonFunctionType = true; - const typeNode = this.startNode(); - [typeNode.typeAnnotation, node.predicate] = this.flowParseTypeAndPredicateInitialiser(); - this.state.noAnonFunctionType = oldNoAnonFunctionType; - if (this.canInsertSemicolon()) this.unexpected(); - if (!this.match(types.arrow)) this.unexpected(); - node.returnType = typeNode.typeAnnotation ? this.finishNode(typeNode, "TypeAnnotation") : null; - } catch (err) { - if (err instanceof SyntaxError) { - this.state = state; - } else { - throw err; - } - } - } - - return super.parseArrow(node); - } - - shouldParseArrow() { - return this.match(types.colon) || super.shouldParseArrow(); - } - - setArrowFunctionParameters(node, params) { - if (this.state.noArrowParamsConversionAt.indexOf(node.start) !== -1) { - node.params = params; - } else { - super.setArrowFunctionParameters(node, params); - } - } - - checkParams(node, allowDuplicates, isArrowFunction) { - if (isArrowFunction && this.state.noArrowParamsConversionAt.indexOf(node.start) !== -1) { - return; - } - - return super.checkParams(node, allowDuplicates, isArrowFunction); - } - - parseParenAndDistinguishExpression(canBeArrow) { - return super.parseParenAndDistinguishExpression(canBeArrow && this.state.noArrowAt.indexOf(this.state.start) === -1); - } - - parseSubscripts(base, startPos, startLoc, noCalls) { - if (base.type === "Identifier" && base.name === "async" && this.state.noArrowAt.indexOf(startPos) !== -1) { - this.next(); - const node = this.startNodeAt(startPos, startLoc); - node.callee = base; - node.arguments = this.parseCallExpressionArguments(types.parenR, false); - base = this.finishNode(node, "CallExpression"); - } else if (base.type === "Identifier" && base.name === "async" && this.isRelational("<")) { - const state = this.state.clone(); - let error; - - try { - const node = this.parseAsyncArrowWithTypeParameters(startPos, startLoc); - if (node) return node; - } catch (e) { - error = e; - } - - this.state = state; - - try { - return super.parseSubscripts(base, startPos, startLoc, noCalls); - } catch (e) { - throw error || e; - } - } - - return super.parseSubscripts(base, startPos, startLoc, noCalls); - } - - parseSubscript(base, startPos, startLoc, noCalls, subscriptState, maybeAsyncArrow) { - if (this.match(types.questionDot) && this.isLookaheadRelational("<")) { - this.expectPlugin("optionalChaining"); - subscriptState.optionalChainMember = true; - - if (noCalls) { - subscriptState.stop = true; - return base; - } - - this.next(); - const node = this.startNodeAt(startPos, startLoc); - node.callee = base; - node.typeArguments = this.flowParseTypeParameterInstantiation(); - this.expect(types.parenL); - node.arguments = this.parseCallExpressionArguments(types.parenR, false); - node.optional = true; - return this.finishNode(node, "OptionalCallExpression"); - } else if (!noCalls && this.shouldParseTypes() && this.isRelational("<")) { - const node = this.startNodeAt(startPos, startLoc); - node.callee = base; - const state = this.state.clone(); - - try { - node.typeArguments = this.flowParseTypeParameterInstantiationCallOrNew(); - this.expect(types.parenL); - node.arguments = this.parseCallExpressionArguments(types.parenR, false); - - if (subscriptState.optionalChainMember) { - node.optional = false; - return this.finishNode(node, "OptionalCallExpression"); - } - - return this.finishNode(node, "CallExpression"); - } catch (e) { - if (e instanceof SyntaxError) { - this.state = state; - } else { - throw e; - } - } - } - - return super.parseSubscript(base, startPos, startLoc, noCalls, subscriptState, maybeAsyncArrow); - } - - parseNewArguments(node) { - let targs = null; - - if (this.shouldParseTypes() && this.isRelational("<")) { - const state = this.state.clone(); - - try { - targs = this.flowParseTypeParameterInstantiationCallOrNew(); - } catch (e) { - if (e instanceof SyntaxError) { - this.state = state; - } else { - throw e; - } - } - } - - node.typeArguments = targs; - super.parseNewArguments(node); - } - - parseAsyncArrowWithTypeParameters(startPos, startLoc) { - const node = this.startNodeAt(startPos, startLoc); - this.parseFunctionParams(node); - if (!this.parseArrow(node)) return; - return this.parseArrowExpression(node, undefined, true); - } - - readToken_mult_modulo(code) { - const next = this.input.charCodeAt(this.state.pos + 1); - - if (code === 42 && next === 47 && this.state.hasFlowComment) { - this.state.hasFlowComment = false; - this.state.pos += 2; - this.nextToken(); - return; - } - - super.readToken_mult_modulo(code); - } - - readToken_pipe_amp(code) { - const next = this.input.charCodeAt(this.state.pos + 1); - - if (code === 124 && next === 125) { - this.finishOp(types.braceBarR, 2); - return; - } - - super.readToken_pipe_amp(code); - } - - parseTopLevel(file, program) { - const fileNode = super.parseTopLevel(file, program); - - if (this.state.hasFlowComment) { - this.unexpected(null, "Unterminated flow-comment"); - } - - return fileNode; - } - - skipBlockComment() { - if (this.hasPlugin("flowComments") && this.skipFlowComment()) { - if (this.state.hasFlowComment) { - this.unexpected(null, "Cannot have a flow comment inside another flow comment"); - } - - this.hasFlowCommentCompletion(); - this.state.pos += this.skipFlowComment(); - this.state.hasFlowComment = true; - return; - } - - if (this.state.hasFlowComment) { - const end = this.input.indexOf("*-/", this.state.pos += 2); - if (end === -1) this.raise(this.state.pos - 2, "Unterminated comment"); - this.state.pos = end + 3; - return; - } - - super.skipBlockComment(); - } - - skipFlowComment() { - const { - pos - } = this.state; - let shiftToFirstNonWhiteSpace = 2; - - while ([32, 9].includes(this.input.charCodeAt(pos + shiftToFirstNonWhiteSpace))) { - shiftToFirstNonWhiteSpace++; - } - - const ch2 = this.input.charCodeAt(shiftToFirstNonWhiteSpace + pos); - const ch3 = this.input.charCodeAt(shiftToFirstNonWhiteSpace + pos + 1); - - if (ch2 === 58 && ch3 === 58) { - return shiftToFirstNonWhiteSpace + 2; - } - - if (this.input.slice(shiftToFirstNonWhiteSpace + pos, shiftToFirstNonWhiteSpace + pos + 12) === "flow-include") { - return shiftToFirstNonWhiteSpace + 12; - } - - if (ch2 === 58 && ch3 !== 58) { - return shiftToFirstNonWhiteSpace; - } - - return false; - } - - hasFlowCommentCompletion() { - const end = this.input.indexOf("*/", this.state.pos); - - if (end === -1) { - this.raise(this.state.pos, "Unterminated comment"); - } - } - -}); - -const entities = { - quot: "\u0022", - amp: "&", - apos: "\u0027", - lt: "<", - gt: ">", - nbsp: "\u00A0", - iexcl: "\u00A1", - cent: "\u00A2", - pound: "\u00A3", - curren: "\u00A4", - yen: "\u00A5", - brvbar: "\u00A6", - sect: "\u00A7", - uml: "\u00A8", - copy: "\u00A9", - ordf: "\u00AA", - laquo: "\u00AB", - not: "\u00AC", - shy: "\u00AD", - reg: "\u00AE", - macr: "\u00AF", - deg: "\u00B0", - plusmn: "\u00B1", - sup2: "\u00B2", - sup3: "\u00B3", - acute: "\u00B4", - micro: "\u00B5", - para: "\u00B6", - middot: "\u00B7", - cedil: "\u00B8", - sup1: "\u00B9", - ordm: "\u00BA", - raquo: "\u00BB", - frac14: "\u00BC", - frac12: "\u00BD", - frac34: "\u00BE", - iquest: "\u00BF", - Agrave: "\u00C0", - Aacute: "\u00C1", - Acirc: "\u00C2", - Atilde: "\u00C3", - Auml: "\u00C4", - Aring: "\u00C5", - AElig: "\u00C6", - Ccedil: "\u00C7", - Egrave: "\u00C8", - Eacute: "\u00C9", - Ecirc: "\u00CA", - Euml: "\u00CB", - Igrave: "\u00CC", - Iacute: "\u00CD", - Icirc: "\u00CE", - Iuml: "\u00CF", - ETH: "\u00D0", - Ntilde: "\u00D1", - Ograve: "\u00D2", - Oacute: "\u00D3", - Ocirc: "\u00D4", - Otilde: "\u00D5", - Ouml: "\u00D6", - times: "\u00D7", - Oslash: "\u00D8", - Ugrave: "\u00D9", - Uacute: "\u00DA", - Ucirc: "\u00DB", - Uuml: "\u00DC", - Yacute: "\u00DD", - THORN: "\u00DE", - szlig: "\u00DF", - agrave: "\u00E0", - aacute: "\u00E1", - acirc: "\u00E2", - atilde: "\u00E3", - auml: "\u00E4", - aring: "\u00E5", - aelig: "\u00E6", - ccedil: "\u00E7", - egrave: "\u00E8", - eacute: "\u00E9", - ecirc: "\u00EA", - euml: "\u00EB", - igrave: "\u00EC", - iacute: "\u00ED", - icirc: "\u00EE", - iuml: "\u00EF", - eth: "\u00F0", - ntilde: "\u00F1", - ograve: "\u00F2", - oacute: "\u00F3", - ocirc: "\u00F4", - otilde: "\u00F5", - ouml: "\u00F6", - divide: "\u00F7", - oslash: "\u00F8", - ugrave: "\u00F9", - uacute: "\u00FA", - ucirc: "\u00FB", - uuml: "\u00FC", - yacute: "\u00FD", - thorn: "\u00FE", - yuml: "\u00FF", - OElig: "\u0152", - oelig: "\u0153", - Scaron: "\u0160", - scaron: "\u0161", - Yuml: "\u0178", - fnof: "\u0192", - circ: "\u02C6", - tilde: "\u02DC", - Alpha: "\u0391", - Beta: "\u0392", - Gamma: "\u0393", - Delta: "\u0394", - Epsilon: "\u0395", - Zeta: "\u0396", - Eta: "\u0397", - Theta: "\u0398", - Iota: "\u0399", - Kappa: "\u039A", - Lambda: "\u039B", - Mu: "\u039C", - Nu: "\u039D", - Xi: "\u039E", - Omicron: "\u039F", - Pi: "\u03A0", - Rho: "\u03A1", - Sigma: "\u03A3", - Tau: "\u03A4", - Upsilon: "\u03A5", - Phi: "\u03A6", - Chi: "\u03A7", - Psi: "\u03A8", - Omega: "\u03A9", - alpha: "\u03B1", - beta: "\u03B2", - gamma: "\u03B3", - delta: "\u03B4", - epsilon: "\u03B5", - zeta: "\u03B6", - eta: "\u03B7", - theta: "\u03B8", - iota: "\u03B9", - kappa: "\u03BA", - lambda: "\u03BB", - mu: "\u03BC", - nu: "\u03BD", - xi: "\u03BE", - omicron: "\u03BF", - pi: "\u03C0", - rho: "\u03C1", - sigmaf: "\u03C2", - sigma: "\u03C3", - tau: "\u03C4", - upsilon: "\u03C5", - phi: "\u03C6", - chi: "\u03C7", - psi: "\u03C8", - omega: "\u03C9", - thetasym: "\u03D1", - upsih: "\u03D2", - piv: "\u03D6", - ensp: "\u2002", - emsp: "\u2003", - thinsp: "\u2009", - zwnj: "\u200C", - zwj: "\u200D", - lrm: "\u200E", - rlm: "\u200F", - ndash: "\u2013", - mdash: "\u2014", - lsquo: "\u2018", - rsquo: "\u2019", - sbquo: "\u201A", - ldquo: "\u201C", - rdquo: "\u201D", - bdquo: "\u201E", - dagger: "\u2020", - Dagger: "\u2021", - bull: "\u2022", - hellip: "\u2026", - permil: "\u2030", - prime: "\u2032", - Prime: "\u2033", - lsaquo: "\u2039", - rsaquo: "\u203A", - oline: "\u203E", - frasl: "\u2044", - euro: "\u20AC", - image: "\u2111", - weierp: "\u2118", - real: "\u211C", - trade: "\u2122", - alefsym: "\u2135", - larr: "\u2190", - uarr: "\u2191", - rarr: "\u2192", - darr: "\u2193", - harr: "\u2194", - crarr: "\u21B5", - lArr: "\u21D0", - uArr: "\u21D1", - rArr: "\u21D2", - dArr: "\u21D3", - hArr: "\u21D4", - forall: "\u2200", - part: "\u2202", - exist: "\u2203", - empty: "\u2205", - nabla: "\u2207", - isin: "\u2208", - notin: "\u2209", - ni: "\u220B", - prod: "\u220F", - sum: "\u2211", - minus: "\u2212", - lowast: "\u2217", - radic: "\u221A", - prop: "\u221D", - infin: "\u221E", - ang: "\u2220", - and: "\u2227", - or: "\u2228", - cap: "\u2229", - cup: "\u222A", - int: "\u222B", - there4: "\u2234", - sim: "\u223C", - cong: "\u2245", - asymp: "\u2248", - ne: "\u2260", - equiv: "\u2261", - le: "\u2264", - ge: "\u2265", - sub: "\u2282", - sup: "\u2283", - nsub: "\u2284", - sube: "\u2286", - supe: "\u2287", - oplus: "\u2295", - otimes: "\u2297", - perp: "\u22A5", - sdot: "\u22C5", - lceil: "\u2308", - rceil: "\u2309", - lfloor: "\u230A", - rfloor: "\u230B", - lang: "\u2329", - rang: "\u232A", - loz: "\u25CA", - spades: "\u2660", - clubs: "\u2663", - hearts: "\u2665", - diams: "\u2666" -}; - -const HEX_NUMBER = /^[\da-fA-F]+$/; -const DECIMAL_NUMBER = /^\d+$/; -types$1.j_oTag = new TokContext("...", true, true); -types.jsxName = new TokenType("jsxName"); -types.jsxText = new TokenType("jsxText", { - beforeExpr: true -}); -types.jsxTagStart = new TokenType("jsxTagStart", { - startsExpr: true -}); -types.jsxTagEnd = new TokenType("jsxTagEnd"); - -types.jsxTagStart.updateContext = function () { - this.state.context.push(types$1.j_expr); - this.state.context.push(types$1.j_oTag); - this.state.exprAllowed = false; -}; - -types.jsxTagEnd.updateContext = function (prevType) { - const out = this.state.context.pop(); - - if (out === types$1.j_oTag && prevType === types.slash || out === types$1.j_cTag) { - this.state.context.pop(); - this.state.exprAllowed = this.curContext() === types$1.j_expr; - } else { - this.state.exprAllowed = true; - } -}; - -function isFragment(object) { - return object ? object.type === "JSXOpeningFragment" || object.type === "JSXClosingFragment" : false; -} - -function getQualifiedJSXName(object) { - if (object.type === "JSXIdentifier") { - return object.name; - } - - if (object.type === "JSXNamespacedName") { - return object.namespace.name + ":" + object.name.name; - } - - if (object.type === "JSXMemberExpression") { - return getQualifiedJSXName(object.object) + "." + getQualifiedJSXName(object.property); - } - - throw new Error("Node had unexpected type: " + object.type); -} - -var jsx = (superClass => class extends superClass { - jsxReadToken() { - let out = ""; - let chunkStart = this.state.pos; - - for (;;) { - if (this.state.pos >= this.length) { - this.raise(this.state.start, "Unterminated JSX contents"); - } - - const ch = this.input.charCodeAt(this.state.pos); - - switch (ch) { - case 60: - case 123: - if (this.state.pos === this.state.start) { - if (ch === 60 && this.state.exprAllowed) { - ++this.state.pos; - return this.finishToken(types.jsxTagStart); - } - - return super.getTokenFromCode(ch); - } - - out += this.input.slice(chunkStart, this.state.pos); - return this.finishToken(types.jsxText, out); - - case 38: - out += this.input.slice(chunkStart, this.state.pos); - out += this.jsxReadEntity(); - chunkStart = this.state.pos; - break; - - default: - if (isNewLine(ch)) { - out += this.input.slice(chunkStart, this.state.pos); - out += this.jsxReadNewLine(true); - chunkStart = this.state.pos; - } else { - ++this.state.pos; - } - - } - } - } - - jsxReadNewLine(normalizeCRLF) { - const ch = this.input.charCodeAt(this.state.pos); - let out; - ++this.state.pos; - - if (ch === 13 && this.input.charCodeAt(this.state.pos) === 10) { - ++this.state.pos; - out = normalizeCRLF ? "\n" : "\r\n"; - } else { - out = String.fromCharCode(ch); - } - - ++this.state.curLine; - this.state.lineStart = this.state.pos; - return out; - } - - jsxReadString(quote) { - let out = ""; - let chunkStart = ++this.state.pos; - - for (;;) { - if (this.state.pos >= this.length) { - this.raise(this.state.start, "Unterminated string constant"); - } - - const ch = this.input.charCodeAt(this.state.pos); - if (ch === quote) break; - - if (ch === 38) { - out += this.input.slice(chunkStart, this.state.pos); - out += this.jsxReadEntity(); - chunkStart = this.state.pos; - } else if (isNewLine(ch)) { - out += this.input.slice(chunkStart, this.state.pos); - out += this.jsxReadNewLine(false); - chunkStart = this.state.pos; - } else { - ++this.state.pos; - } - } - - out += this.input.slice(chunkStart, this.state.pos++); - return this.finishToken(types.string, out); - } - - jsxReadEntity() { - let str = ""; - let count = 0; - let entity; - let ch = this.input[this.state.pos]; - const startPos = ++this.state.pos; - - while (this.state.pos < this.length && count++ < 10) { - ch = this.input[this.state.pos++]; - - if (ch === ";") { - if (str[0] === "#") { - if (str[1] === "x") { - str = str.substr(2); - - if (HEX_NUMBER.test(str)) { - entity = String.fromCodePoint(parseInt(str, 16)); - } - } else { - str = str.substr(1); - - if (DECIMAL_NUMBER.test(str)) { - entity = String.fromCodePoint(parseInt(str, 10)); - } - } - } else { - entity = entities[str]; - } - - break; - } - - str += ch; - } - - if (!entity) { - this.state.pos = startPos; - return "&"; - } - - return entity; - } - - jsxReadWord() { - let ch; - const start = this.state.pos; - - do { - ch = this.input.charCodeAt(++this.state.pos); - } while (isIdentifierChar(ch) || ch === 45); - - return this.finishToken(types.jsxName, this.input.slice(start, this.state.pos)); - } - - jsxParseIdentifier() { - const node = this.startNode(); - - if (this.match(types.jsxName)) { - node.name = this.state.value; - } else if (this.state.type.keyword) { - node.name = this.state.type.keyword; - } else { - this.unexpected(); - } - - this.next(); - return this.finishNode(node, "JSXIdentifier"); - } - - jsxParseNamespacedName() { - const startPos = this.state.start; - const startLoc = this.state.startLoc; - const name = this.jsxParseIdentifier(); - if (!this.eat(types.colon)) return name; - const node = this.startNodeAt(startPos, startLoc); - node.namespace = name; - node.name = this.jsxParseIdentifier(); - return this.finishNode(node, "JSXNamespacedName"); - } - - jsxParseElementName() { - const startPos = this.state.start; - const startLoc = this.state.startLoc; - let node = this.jsxParseNamespacedName(); - - while (this.eat(types.dot)) { - const newNode = this.startNodeAt(startPos, startLoc); - newNode.object = node; - newNode.property = this.jsxParseIdentifier(); - node = this.finishNode(newNode, "JSXMemberExpression"); - } - - return node; - } - - jsxParseAttributeValue() { - let node; - - switch (this.state.type) { - case types.braceL: - node = this.startNode(); - this.next(); - node = this.jsxParseExpressionContainer(node); - - if (node.expression.type === "JSXEmptyExpression") { - throw this.raise(node.start, "JSX attributes must only be assigned a non-empty expression"); - } else { - return node; - } - - case types.jsxTagStart: - case types.string: - return this.parseExprAtom(); - - default: - throw this.raise(this.state.start, "JSX value should be either an expression or a quoted JSX text"); - } - } - - jsxParseEmptyExpression() { - const node = this.startNodeAt(this.state.lastTokEnd, this.state.lastTokEndLoc); - return this.finishNodeAt(node, "JSXEmptyExpression", this.state.start, this.state.startLoc); - } - - jsxParseSpreadChild(node) { - this.next(); - node.expression = this.parseExpression(); - this.expect(types.braceR); - return this.finishNode(node, "JSXSpreadChild"); - } - - jsxParseExpressionContainer(node) { - if (this.match(types.braceR)) { - node.expression = this.jsxParseEmptyExpression(); - } else { - node.expression = this.parseExpression(); - } - - this.expect(types.braceR); - return this.finishNode(node, "JSXExpressionContainer"); - } - - jsxParseAttribute() { - const node = this.startNode(); - - if (this.eat(types.braceL)) { - this.expect(types.ellipsis); - node.argument = this.parseMaybeAssign(); - this.expect(types.braceR); - return this.finishNode(node, "JSXSpreadAttribute"); - } - - node.name = this.jsxParseNamespacedName(); - node.value = this.eat(types.eq) ? this.jsxParseAttributeValue() : null; - return this.finishNode(node, "JSXAttribute"); - } - - jsxParseOpeningElementAt(startPos, startLoc) { - const node = this.startNodeAt(startPos, startLoc); - - if (this.match(types.jsxTagEnd)) { - this.expect(types.jsxTagEnd); - return this.finishNode(node, "JSXOpeningFragment"); - } - - node.name = this.jsxParseElementName(); - return this.jsxParseOpeningElementAfterName(node); - } - - jsxParseOpeningElementAfterName(node) { - const attributes = []; - - while (!this.match(types.slash) && !this.match(types.jsxTagEnd)) { - attributes.push(this.jsxParseAttribute()); - } - - node.attributes = attributes; - node.selfClosing = this.eat(types.slash); - this.expect(types.jsxTagEnd); - return this.finishNode(node, "JSXOpeningElement"); - } - - jsxParseClosingElementAt(startPos, startLoc) { - const node = this.startNodeAt(startPos, startLoc); - - if (this.match(types.jsxTagEnd)) { - this.expect(types.jsxTagEnd); - return this.finishNode(node, "JSXClosingFragment"); - } - - node.name = this.jsxParseElementName(); - this.expect(types.jsxTagEnd); - return this.finishNode(node, "JSXClosingElement"); - } - - jsxParseElementAt(startPos, startLoc) { - const node = this.startNodeAt(startPos, startLoc); - const children = []; - const openingElement = this.jsxParseOpeningElementAt(startPos, startLoc); - let closingElement = null; - - if (!openingElement.selfClosing) { - contents: for (;;) { - switch (this.state.type) { - case types.jsxTagStart: - startPos = this.state.start; - startLoc = this.state.startLoc; - this.next(); - - if (this.eat(types.slash)) { - closingElement = this.jsxParseClosingElementAt(startPos, startLoc); - break contents; - } - - children.push(this.jsxParseElementAt(startPos, startLoc)); - break; - - case types.jsxText: - children.push(this.parseExprAtom()); - break; - - case types.braceL: - { - const node = this.startNode(); - this.next(); - - if (this.match(types.ellipsis)) { - children.push(this.jsxParseSpreadChild(node)); - } else { - children.push(this.jsxParseExpressionContainer(node)); - } - - break; - } - - default: - throw this.unexpected(); - } - } - - if (isFragment(openingElement) && !isFragment(closingElement)) { - this.raise(closingElement.start, "Expected corresponding JSX closing tag for <>"); - } else if (!isFragment(openingElement) && isFragment(closingElement)) { - this.raise(closingElement.start, "Expected corresponding JSX closing tag for <" + getQualifiedJSXName(openingElement.name) + ">"); - } else if (!isFragment(openingElement) && !isFragment(closingElement)) { - if (getQualifiedJSXName(closingElement.name) !== getQualifiedJSXName(openingElement.name)) { - this.raise(closingElement.start, "Expected corresponding JSX closing tag for <" + getQualifiedJSXName(openingElement.name) + ">"); - } - } - } - - if (isFragment(openingElement)) { - node.openingFragment = openingElement; - node.closingFragment = closingElement; - } else { - node.openingElement = openingElement; - node.closingElement = closingElement; - } - - node.children = children; - - if (this.match(types.relational) && this.state.value === "<") { - this.raise(this.state.start, "Adjacent JSX elements must be wrapped in an enclosing tag. " + "Did you want a JSX fragment <>...?"); - } - - return isFragment(openingElement) ? this.finishNode(node, "JSXFragment") : this.finishNode(node, "JSXElement"); - } - - jsxParseElement() { - const startPos = this.state.start; - const startLoc = this.state.startLoc; - this.next(); - return this.jsxParseElementAt(startPos, startLoc); - } - - parseExprAtom(refShortHandDefaultPos) { - if (this.match(types.jsxText)) { - return this.parseLiteral(this.state.value, "JSXText"); - } else if (this.match(types.jsxTagStart)) { - return this.jsxParseElement(); - } else if (this.isRelational("<") && this.input.charCodeAt(this.state.pos) !== 33) { - this.finishToken(types.jsxTagStart); - return this.jsxParseElement(); - } else { - return super.parseExprAtom(refShortHandDefaultPos); - } - } - - getTokenFromCode(code) { - if (this.state.inPropertyName) return super.getTokenFromCode(code); - const context = this.curContext(); - - if (context === types$1.j_expr) { - return this.jsxReadToken(); - } - - if (context === types$1.j_oTag || context === types$1.j_cTag) { - if (isIdentifierStart(code)) { - return this.jsxReadWord(); - } - - if (code === 62) { - ++this.state.pos; - return this.finishToken(types.jsxTagEnd); - } - - if ((code === 34 || code === 39) && context === types$1.j_oTag) { - return this.jsxReadString(code); - } - } - - if (code === 60 && this.state.exprAllowed && this.input.charCodeAt(this.state.pos + 1) !== 33) { - ++this.state.pos; - return this.finishToken(types.jsxTagStart); - } - - return super.getTokenFromCode(code); - } - - updateContext(prevType) { - if (this.match(types.braceL)) { - const curContext = this.curContext(); - - if (curContext === types$1.j_oTag) { - this.state.context.push(types$1.braceExpression); - } else if (curContext === types$1.j_expr) { - this.state.context.push(types$1.templateQuasi); - } else { - super.updateContext(prevType); - } - - this.state.exprAllowed = true; - } else if (this.match(types.slash) && prevType === types.jsxTagStart) { - this.state.context.length -= 2; - this.state.context.push(types$1.j_cTag); - this.state.exprAllowed = false; - } else { - return super.updateContext(prevType); - } - } - -}); - -class Scope { - constructor(flags) { - this.var = []; - this.lexical = []; - this.functions = []; - this.flags = flags; - } - -} -class ScopeHandler { - constructor(raise, inModule) { - this.scopeStack = []; - this.undefinedExports = new Map(); - this.raise = raise; - this.inModule = inModule; - } - - get inFunction() { - return (this.currentVarScope().flags & SCOPE_FUNCTION) > 0; - } - - get inGenerator() { - return (this.currentVarScope().flags & SCOPE_GENERATOR) > 0; - } - - get inAsync() { - return (this.currentVarScope().flags & SCOPE_ASYNC) > 0; - } - - get allowSuper() { - return (this.currentThisScope().flags & SCOPE_SUPER) > 0; - } - - get allowDirectSuper() { - return (this.currentThisScope().flags & SCOPE_DIRECT_SUPER) > 0; - } - - get inNonArrowFunction() { - return (this.currentThisScope().flags & SCOPE_FUNCTION) > 0; - } - - get treatFunctionsAsVar() { - return this.treatFunctionsAsVarInScope(this.currentScope()); - } - - createScope(flags) { - return new Scope(flags); - } - - enter(flags) { - this.scopeStack.push(this.createScope(flags)); - } - - exit() { - this.scopeStack.pop(); - } - - treatFunctionsAsVarInScope(scope) { - return !!(scope.flags & SCOPE_FUNCTION || !this.inModule && scope.flags & SCOPE_PROGRAM); - } - - declareName(name, bindingType, pos) { - let scope = this.currentScope(); - - if (bindingType & BIND_SCOPE_LEXICAL || bindingType & BIND_SCOPE_FUNCTION) { - this.checkRedeclarationInScope(scope, name, bindingType, pos); - - if (bindingType & BIND_SCOPE_FUNCTION) { - scope.functions.push(name); - } else { - scope.lexical.push(name); - } - - if (bindingType & BIND_SCOPE_LEXICAL) { - this.maybeExportDefined(scope, name); - } - } else if (bindingType & BIND_SCOPE_VAR) { - for (let i = this.scopeStack.length - 1; i >= 0; --i) { - scope = this.scopeStack[i]; - this.checkRedeclarationInScope(scope, name, bindingType, pos); - scope.var.push(name); - this.maybeExportDefined(scope, name); - if (scope.flags & SCOPE_VAR) break; - } - } - - if (this.inModule && scope.flags & SCOPE_PROGRAM) { - this.undefinedExports.delete(name); - } - } - - maybeExportDefined(scope, name) { - if (this.inModule && scope.flags & SCOPE_PROGRAM) { - this.undefinedExports.delete(name); - } - } - - checkRedeclarationInScope(scope, name, bindingType, pos) { - if (this.isRedeclaredInScope(scope, name, bindingType)) { - this.raise(pos, `Identifier '${name}' has already been declared`); - } - } - - isRedeclaredInScope(scope, name, bindingType) { - if (!(bindingType & BIND_KIND_VALUE)) return false; - - if (bindingType & BIND_SCOPE_LEXICAL) { - return scope.lexical.indexOf(name) > -1 || scope.functions.indexOf(name) > -1 || scope.var.indexOf(name) > -1; - } - - if (bindingType & BIND_SCOPE_FUNCTION) { - return scope.lexical.indexOf(name) > -1 || !this.treatFunctionsAsVarInScope(scope) && scope.var.indexOf(name) > -1; - } - - return scope.lexical.indexOf(name) > -1 && !(scope.flags & SCOPE_SIMPLE_CATCH && scope.lexical[0] === name) || !this.treatFunctionsAsVarInScope(scope) && scope.functions.indexOf(name) > -1; - } - - checkLocalExport(id) { - if (this.scopeStack[0].lexical.indexOf(id.name) === -1 && this.scopeStack[0].var.indexOf(id.name) === -1 && this.scopeStack[0].functions.indexOf(id.name) === -1) { - this.undefinedExports.set(id.name, id.start); - } - } - - currentScope() { - return this.scopeStack[this.scopeStack.length - 1]; - } - - currentVarScope() { - for (let i = this.scopeStack.length - 1;; i--) { - const scope = this.scopeStack[i]; - - if (scope.flags & SCOPE_VAR) { - return scope; - } - } - } - - currentThisScope() { - for (let i = this.scopeStack.length - 1;; i--) { - const scope = this.scopeStack[i]; - - if ((scope.flags & SCOPE_VAR || scope.flags & SCOPE_CLASS) && !(scope.flags & SCOPE_ARROW)) { - return scope; - } - } - } - -} - -class TypeScriptScope extends Scope { - constructor(...args) { - super(...args); - this.types = []; - this.enums = []; - this.constEnums = []; - this.classes = []; - this.exportOnlyBindings = []; - } - -} - -class TypeScriptScopeHandler extends ScopeHandler { - createScope(flags) { - return new TypeScriptScope(flags); - } - - declareName(name, bindingType, pos) { - const scope = this.currentScope(); - - if (bindingType & BIND_FLAGS_TS_EXPORT_ONLY) { - this.maybeExportDefined(scope, name); - scope.exportOnlyBindings.push(name); - return; - } - - super.declareName(...arguments); - - if (bindingType & BIND_KIND_TYPE) { - if (!(bindingType & BIND_KIND_VALUE)) { - this.checkRedeclarationInScope(scope, name, bindingType, pos); - this.maybeExportDefined(scope, name); - } - - scope.types.push(name); - } - - if (bindingType & BIND_FLAGS_TS_ENUM) scope.enums.push(name); - if (bindingType & BIND_FLAGS_TS_CONST_ENUM) scope.constEnums.push(name); - if (bindingType & BIND_FLAGS_CLASS) scope.classes.push(name); - } - - isRedeclaredInScope(scope, name, bindingType) { - if (scope.enums.indexOf(name) > -1) { - if (bindingType & BIND_FLAGS_TS_ENUM) { - const isConst = !!(bindingType & BIND_FLAGS_TS_CONST_ENUM); - const wasConst = scope.constEnums.indexOf(name) > -1; - return isConst !== wasConst; - } - - return true; - } - - if (bindingType & BIND_FLAGS_CLASS && scope.classes.indexOf(name) > -1) { - if (scope.lexical.indexOf(name) > -1) { - return !!(bindingType & BIND_KIND_VALUE); - } else { - return false; - } - } - - if (bindingType & BIND_KIND_TYPE && scope.types.indexOf(name) > -1) { - return true; - } - - return super.isRedeclaredInScope(...arguments); - } - - checkLocalExport(id) { - if (this.scopeStack[0].types.indexOf(id.name) === -1 && this.scopeStack[0].exportOnlyBindings.indexOf(id.name) === -1) { - super.checkLocalExport(id); - } - } - -} - -function nonNull(x) { - if (x == null) { - throw new Error(`Unexpected ${x} value.`); - } - - return x; -} - -function assert(x) { - if (!x) { - throw new Error("Assert fail"); - } -} - -function keywordTypeFromName(value) { - switch (value) { - case "any": - return "TSAnyKeyword"; - - case "boolean": - return "TSBooleanKeyword"; - - case "bigint": - return "TSBigIntKeyword"; - - case "never": - return "TSNeverKeyword"; - - case "number": - return "TSNumberKeyword"; - - case "object": - return "TSObjectKeyword"; - - case "string": - return "TSStringKeyword"; - - case "symbol": - return "TSSymbolKeyword"; - - case "undefined": - return "TSUndefinedKeyword"; - - case "unknown": - return "TSUnknownKeyword"; - - default: - return undefined; - } -} - -var typescript = (superClass => class extends superClass { - getScopeHandler() { - return TypeScriptScopeHandler; - } - - tsIsIdentifier() { - return this.match(types.name); - } - - tsNextTokenCanFollowModifier() { - this.next(); - return !this.hasPrecedingLineBreak() && !this.match(types.parenL) && !this.match(types.parenR) && !this.match(types.colon) && !this.match(types.eq) && !this.match(types.question) && !this.match(types.bang); - } - - tsParseModifier(allowedModifiers) { - if (!this.match(types.name)) { - return undefined; - } - - const modifier = this.state.value; - - if (allowedModifiers.indexOf(modifier) !== -1 && this.tsTryParse(this.tsNextTokenCanFollowModifier.bind(this))) { - return modifier; - } - - return undefined; - } - - tsIsListTerminator(kind) { - switch (kind) { - case "EnumMembers": - case "TypeMembers": - return this.match(types.braceR); - - case "HeritageClauseElement": - return this.match(types.braceL); - - case "TupleElementTypes": - return this.match(types.bracketR); - - case "TypeParametersOrArguments": - return this.isRelational(">"); - } - - throw new Error("Unreachable"); - } - - tsParseList(kind, parseElement) { - const result = []; - - while (!this.tsIsListTerminator(kind)) { - result.push(parseElement()); - } - - return result; - } - - tsParseDelimitedList(kind, parseElement) { - return nonNull(this.tsParseDelimitedListWorker(kind, parseElement, true)); - } - - tsParseDelimitedListWorker(kind, parseElement, expectSuccess) { - const result = []; - - while (true) { - if (this.tsIsListTerminator(kind)) { - break; - } - - const element = parseElement(); - - if (element == null) { - return undefined; - } - - result.push(element); - - if (this.eat(types.comma)) { - continue; - } - - if (this.tsIsListTerminator(kind)) { - break; - } - - if (expectSuccess) { - this.expect(types.comma); - } - - return undefined; - } - - return result; - } - - tsParseBracketedList(kind, parseElement, bracket, skipFirstToken) { - if (!skipFirstToken) { - if (bracket) { - this.expect(types.bracketL); - } else { - this.expectRelational("<"); - } - } - - const result = this.tsParseDelimitedList(kind, parseElement); - - if (bracket) { - this.expect(types.bracketR); - } else { - this.expectRelational(">"); - } - - return result; - } - - tsParseImportType() { - const node = this.startNode(); - this.expect(types._import); - this.expect(types.parenL); - - if (!this.match(types.string)) { - throw this.unexpected(null, "Argument in a type import must be a string literal"); - } - - node.argument = this.parseExprAtom(); - this.expect(types.parenR); - - if (this.eat(types.dot)) { - node.qualifier = this.tsParseEntityName(true); - } - - if (this.isRelational("<")) { - node.typeParameters = this.tsParseTypeArguments(); - } - - return this.finishNode(node, "TSImportType"); - } - - tsParseEntityName(allowReservedWords) { - let entity = this.parseIdentifier(); - - while (this.eat(types.dot)) { - const node = this.startNodeAtNode(entity); - node.left = entity; - node.right = this.parseIdentifier(allowReservedWords); - entity = this.finishNode(node, "TSQualifiedName"); - } - - return entity; - } - - tsParseTypeReference() { - const node = this.startNode(); - node.typeName = this.tsParseEntityName(false); - - if (!this.hasPrecedingLineBreak() && this.isRelational("<")) { - node.typeParameters = this.tsParseTypeArguments(); - } - - return this.finishNode(node, "TSTypeReference"); - } - - tsParseThisTypePredicate(lhs) { - this.next(); - const node = this.startNodeAtNode(lhs); - node.parameterName = lhs; - node.typeAnnotation = this.tsParseTypeAnnotation(false); - return this.finishNode(node, "TSTypePredicate"); - } - - tsParseThisTypeNode() { - const node = this.startNode(); - this.next(); - return this.finishNode(node, "TSThisType"); - } - - tsParseTypeQuery() { - const node = this.startNode(); - this.expect(types._typeof); - - if (this.match(types._import)) { - node.exprName = this.tsParseImportType(); - } else { - node.exprName = this.tsParseEntityName(true); - } - - return this.finishNode(node, "TSTypeQuery"); - } - - tsParseTypeParameter() { - const node = this.startNode(); - node.name = this.parseIdentifierName(node.start); - node.constraint = this.tsEatThenParseType(types._extends); - node.default = this.tsEatThenParseType(types.eq); - return this.finishNode(node, "TSTypeParameter"); - } - - tsTryParseTypeParameters() { - if (this.isRelational("<")) { - return this.tsParseTypeParameters(); - } - } - - tsParseTypeParameters() { - const node = this.startNode(); - - if (this.isRelational("<") || this.match(types.jsxTagStart)) { - this.next(); - } else { - this.unexpected(); - } - - node.params = this.tsParseBracketedList("TypeParametersOrArguments", this.tsParseTypeParameter.bind(this), false, true); - return this.finishNode(node, "TSTypeParameterDeclaration"); - } - - tsTryNextParseConstantContext() { - if (this.lookahead().type === types._const) { - this.next(); - return this.tsParseTypeReference(); - } - - return null; - } - - tsFillSignature(returnToken, signature) { - const returnTokenRequired = returnToken === types.arrow; - signature.typeParameters = this.tsTryParseTypeParameters(); - this.expect(types.parenL); - signature.parameters = this.tsParseBindingListForSignature(); - - if (returnTokenRequired) { - signature.typeAnnotation = this.tsParseTypeOrTypePredicateAnnotation(returnToken); - } else if (this.match(returnToken)) { - signature.typeAnnotation = this.tsParseTypeOrTypePredicateAnnotation(returnToken); - } - } - - tsParseBindingListForSignature() { - return this.parseBindingList(types.parenR).map(pattern => { - if (pattern.type !== "Identifier" && pattern.type !== "RestElement" && pattern.type !== "ObjectPattern" && pattern.type !== "ArrayPattern") { - throw this.unexpected(pattern.start, `Name in a signature must be an Identifier, ObjectPattern or ArrayPattern, instead got ${pattern.type}`); - } - - return pattern; - }); - } - - tsParseTypeMemberSemicolon() { - if (!this.eat(types.comma)) { - this.semicolon(); - } - } - - tsParseSignatureMember(kind, node) { - this.tsFillSignature(types.colon, node); - this.tsParseTypeMemberSemicolon(); - return this.finishNode(node, kind); - } - - tsIsUnambiguouslyIndexSignature() { - this.next(); - return this.eat(types.name) && this.match(types.colon); - } - - tsTryParseIndexSignature(node) { - if (!(this.match(types.bracketL) && this.tsLookAhead(this.tsIsUnambiguouslyIndexSignature.bind(this)))) { - return undefined; - } - - this.expect(types.bracketL); - const id = this.parseIdentifier(); - id.typeAnnotation = this.tsParseTypeAnnotation(); - this.resetEndLocation(id); - this.expect(types.bracketR); - node.parameters = [id]; - const type = this.tsTryParseTypeAnnotation(); - if (type) node.typeAnnotation = type; - this.tsParseTypeMemberSemicolon(); - return this.finishNode(node, "TSIndexSignature"); - } - - tsParsePropertyOrMethodSignature(node, readonly) { - if (this.eat(types.question)) node.optional = true; - const nodeAny = node; - - if (!readonly && (this.match(types.parenL) || this.isRelational("<"))) { - const method = nodeAny; - this.tsFillSignature(types.colon, method); - this.tsParseTypeMemberSemicolon(); - return this.finishNode(method, "TSMethodSignature"); - } else { - const property = nodeAny; - if (readonly) property.readonly = true; - const type = this.tsTryParseTypeAnnotation(); - if (type) property.typeAnnotation = type; - this.tsParseTypeMemberSemicolon(); - return this.finishNode(property, "TSPropertySignature"); - } - } - - tsParseTypeMember() { - const node = this.startNode(); - - if (this.match(types.parenL) || this.isRelational("<")) { - return this.tsParseSignatureMember("TSCallSignatureDeclaration", node); - } - - if (this.match(types._new)) { - const id = this.startNode(); - this.next(); - - if (this.match(types.parenL) || this.isRelational("<")) { - return this.tsParseSignatureMember("TSConstructSignatureDeclaration", node); - } else { - node.key = this.createIdentifier(id, "new"); - return this.tsParsePropertyOrMethodSignature(node, false); - } - } - - const readonly = !!this.tsParseModifier(["readonly"]); - const idx = this.tsTryParseIndexSignature(node); - - if (idx) { - if (readonly) node.readonly = true; - return idx; - } - - this.parsePropertyName(node); - return this.tsParsePropertyOrMethodSignature(node, readonly); - } - - tsParseTypeLiteral() { - const node = this.startNode(); - node.members = this.tsParseObjectTypeMembers(); - return this.finishNode(node, "TSTypeLiteral"); - } - - tsParseObjectTypeMembers() { - this.expect(types.braceL); - const members = this.tsParseList("TypeMembers", this.tsParseTypeMember.bind(this)); - this.expect(types.braceR); - return members; - } - - tsIsStartOfMappedType() { - this.next(); - - if (this.eat(types.plusMin)) { - return this.isContextual("readonly"); - } - - if (this.isContextual("readonly")) { - this.next(); - } - - if (!this.match(types.bracketL)) { - return false; - } - - this.next(); - - if (!this.tsIsIdentifier()) { - return false; - } - - this.next(); - return this.match(types._in); - } - - tsParseMappedTypeParameter() { - const node = this.startNode(); - node.name = this.parseIdentifierName(node.start); - node.constraint = this.tsExpectThenParseType(types._in); - return this.finishNode(node, "TSTypeParameter"); - } - - tsParseMappedType() { - const node = this.startNode(); - this.expect(types.braceL); - - if (this.match(types.plusMin)) { - node.readonly = this.state.value; - this.next(); - this.expectContextual("readonly"); - } else if (this.eatContextual("readonly")) { - node.readonly = true; - } - - this.expect(types.bracketL); - node.typeParameter = this.tsParseMappedTypeParameter(); - this.expect(types.bracketR); - - if (this.match(types.plusMin)) { - node.optional = this.state.value; - this.next(); - this.expect(types.question); - } else if (this.eat(types.question)) { - node.optional = true; - } - - node.typeAnnotation = this.tsTryParseType(); - this.semicolon(); - this.expect(types.braceR); - return this.finishNode(node, "TSMappedType"); - } - - tsParseTupleType() { - const node = this.startNode(); - node.elementTypes = this.tsParseBracketedList("TupleElementTypes", this.tsParseTupleElementType.bind(this), true, false); - let seenOptionalElement = false; - node.elementTypes.forEach(elementNode => { - if (elementNode.type === "TSOptionalType") { - seenOptionalElement = true; - } else if (seenOptionalElement && elementNode.type !== "TSRestType") { - this.raise(elementNode.start, "A required element cannot follow an optional element."); - } - }); - return this.finishNode(node, "TSTupleType"); - } - - tsParseTupleElementType() { - if (this.match(types.ellipsis)) { - const restNode = this.startNode(); - this.next(); - restNode.typeAnnotation = this.tsParseType(); - this.checkCommaAfterRest(); - return this.finishNode(restNode, "TSRestType"); - } - - const type = this.tsParseType(); - - if (this.eat(types.question)) { - const optionalTypeNode = this.startNodeAtNode(type); - optionalTypeNode.typeAnnotation = type; - return this.finishNode(optionalTypeNode, "TSOptionalType"); - } - - return type; - } - - tsParseParenthesizedType() { - const node = this.startNode(); - this.expect(types.parenL); - node.typeAnnotation = this.tsParseType(); - this.expect(types.parenR); - return this.finishNode(node, "TSParenthesizedType"); - } - - tsParseFunctionOrConstructorType(type) { - const node = this.startNode(); - - if (type === "TSConstructorType") { - this.expect(types._new); - } - - this.tsFillSignature(types.arrow, node); - return this.finishNode(node, type); - } - - tsParseLiteralTypeNode() { - const node = this.startNode(); - - node.literal = (() => { - switch (this.state.type) { - case types.num: - case types.string: - case types._true: - case types._false: - return this.parseExprAtom(); - - default: - throw this.unexpected(); - } - })(); - - return this.finishNode(node, "TSLiteralType"); - } - - tsParseTemplateLiteralType() { - const node = this.startNode(); - const templateNode = this.parseTemplate(false); - - if (templateNode.expressions.length > 0) { - throw this.raise(templateNode.expressions[0].start, "Template literal types cannot have any substitution"); - } - - node.literal = templateNode; - return this.finishNode(node, "TSLiteralType"); - } - - tsParseNonArrayType() { - switch (this.state.type) { - case types.name: - case types._void: - case types._null: - { - const type = this.match(types._void) ? "TSVoidKeyword" : this.match(types._null) ? "TSNullKeyword" : keywordTypeFromName(this.state.value); - - if (type !== undefined && this.lookahead().type !== types.dot) { - const node = this.startNode(); - this.next(); - return this.finishNode(node, type); - } - - return this.tsParseTypeReference(); - } - - case types.string: - case types.num: - case types._true: - case types._false: - return this.tsParseLiteralTypeNode(); - - case types.plusMin: - if (this.state.value === "-") { - const node = this.startNode(); - - if (this.lookahead().type !== types.num) { - throw this.unexpected(); - } - - node.literal = this.parseMaybeUnary(); - return this.finishNode(node, "TSLiteralType"); - } - - break; - - case types._this: - { - const thisKeyword = this.tsParseThisTypeNode(); - - if (this.isContextual("is") && !this.hasPrecedingLineBreak()) { - return this.tsParseThisTypePredicate(thisKeyword); - } else { - return thisKeyword; - } - } - - case types._typeof: - return this.tsParseTypeQuery(); - - case types._import: - return this.tsParseImportType(); - - case types.braceL: - return this.tsLookAhead(this.tsIsStartOfMappedType.bind(this)) ? this.tsParseMappedType() : this.tsParseTypeLiteral(); - - case types.bracketL: - return this.tsParseTupleType(); - - case types.parenL: - return this.tsParseParenthesizedType(); - - case types.backQuote: - return this.tsParseTemplateLiteralType(); - } - - throw this.unexpected(); - } - - tsParseArrayTypeOrHigher() { - let type = this.tsParseNonArrayType(); - - while (!this.hasPrecedingLineBreak() && this.eat(types.bracketL)) { - if (this.match(types.bracketR)) { - const node = this.startNodeAtNode(type); - node.elementType = type; - this.expect(types.bracketR); - type = this.finishNode(node, "TSArrayType"); - } else { - const node = this.startNodeAtNode(type); - node.objectType = type; - node.indexType = this.tsParseType(); - this.expect(types.bracketR); - type = this.finishNode(node, "TSIndexedAccessType"); - } - } - - return type; - } - - tsParseTypeOperator(operator) { - const node = this.startNode(); - this.expectContextual(operator); - node.operator = operator; - node.typeAnnotation = this.tsParseTypeOperatorOrHigher(); - - if (operator === "readonly") { - this.tsCheckTypeAnnotationForReadOnly(node); - } - - return this.finishNode(node, "TSTypeOperator"); - } - - tsCheckTypeAnnotationForReadOnly(node) { - switch (node.typeAnnotation.type) { - case "TSTupleType": - case "TSArrayType": - return; - - default: - this.raise(node.start, "'readonly' type modifier is only permitted on array and tuple literal types."); - } - } - - tsParseInferType() { - const node = this.startNode(); - this.expectContextual("infer"); - const typeParameter = this.startNode(); - typeParameter.name = this.parseIdentifierName(typeParameter.start); - node.typeParameter = this.finishNode(typeParameter, "TSTypeParameter"); - return this.finishNode(node, "TSInferType"); - } - - tsParseTypeOperatorOrHigher() { - const operator = ["keyof", "unique", "readonly"].find(kw => this.isContextual(kw)); - return operator ? this.tsParseTypeOperator(operator) : this.isContextual("infer") ? this.tsParseInferType() : this.tsParseArrayTypeOrHigher(); - } - - tsParseUnionOrIntersectionType(kind, parseConstituentType, operator) { - this.eat(operator); - let type = parseConstituentType(); - - if (this.match(operator)) { - const types = [type]; - - while (this.eat(operator)) { - types.push(parseConstituentType()); - } - - const node = this.startNodeAtNode(type); - node.types = types; - type = this.finishNode(node, kind); - } - - return type; - } - - tsParseIntersectionTypeOrHigher() { - return this.tsParseUnionOrIntersectionType("TSIntersectionType", this.tsParseTypeOperatorOrHigher.bind(this), types.bitwiseAND); - } - - tsParseUnionTypeOrHigher() { - return this.tsParseUnionOrIntersectionType("TSUnionType", this.tsParseIntersectionTypeOrHigher.bind(this), types.bitwiseOR); - } - - tsIsStartOfFunctionType() { - if (this.isRelational("<")) { - return true; - } - - return this.match(types.parenL) && this.tsLookAhead(this.tsIsUnambiguouslyStartOfFunctionType.bind(this)); - } - - tsSkipParameterStart() { - if (this.match(types.name) || this.match(types._this)) { - this.next(); - return true; - } - - if (this.match(types.braceL)) { - let braceStackCounter = 1; - this.next(); - - while (braceStackCounter > 0) { - if (this.match(types.braceL)) { - ++braceStackCounter; - } else if (this.match(types.braceR)) { - --braceStackCounter; - } - - this.next(); - } - - return true; - } - - if (this.match(types.bracketL)) { - let braceStackCounter = 1; - this.next(); - - while (braceStackCounter > 0) { - if (this.match(types.bracketL)) { - ++braceStackCounter; - } else if (this.match(types.bracketR)) { - --braceStackCounter; - } - - this.next(); - } - - return true; - } - - return false; - } - - tsIsUnambiguouslyStartOfFunctionType() { - this.next(); - - if (this.match(types.parenR) || this.match(types.ellipsis)) { - return true; - } - - if (this.tsSkipParameterStart()) { - if (this.match(types.colon) || this.match(types.comma) || this.match(types.question) || this.match(types.eq)) { - return true; - } - - if (this.match(types.parenR)) { - this.next(); - - if (this.match(types.arrow)) { - return true; - } - } - } - - return false; - } - - tsParseTypeOrTypePredicateAnnotation(returnToken) { - return this.tsInType(() => { - const t = this.startNode(); - this.expect(returnToken); - const typePredicateVariable = this.tsIsIdentifier() && this.tsTryParse(this.tsParseTypePredicatePrefix.bind(this)); - - if (!typePredicateVariable) { - return this.tsParseTypeAnnotation(false, t); - } - - const type = this.tsParseTypeAnnotation(false); - const node = this.startNodeAtNode(typePredicateVariable); - node.parameterName = typePredicateVariable; - node.typeAnnotation = type; - t.typeAnnotation = this.finishNode(node, "TSTypePredicate"); - return this.finishNode(t, "TSTypeAnnotation"); - }); - } - - tsTryParseTypeOrTypePredicateAnnotation() { - return this.match(types.colon) ? this.tsParseTypeOrTypePredicateAnnotation(types.colon) : undefined; - } - - tsTryParseTypeAnnotation() { - return this.match(types.colon) ? this.tsParseTypeAnnotation() : undefined; - } - - tsTryParseType() { - return this.tsEatThenParseType(types.colon); - } - - tsParseTypePredicatePrefix() { - const id = this.parseIdentifier(); - - if (this.isContextual("is") && !this.hasPrecedingLineBreak()) { - this.next(); - return id; - } - } - - tsParseTypeAnnotation(eatColon = true, t = this.startNode()) { - this.tsInType(() => { - if (eatColon) this.expect(types.colon); - t.typeAnnotation = this.tsParseType(); - }); - return this.finishNode(t, "TSTypeAnnotation"); - } - - tsParseType() { - assert(this.state.inType); - const type = this.tsParseNonConditionalType(); - - if (this.hasPrecedingLineBreak() || !this.eat(types._extends)) { - return type; - } - - const node = this.startNodeAtNode(type); - node.checkType = type; - node.extendsType = this.tsParseNonConditionalType(); - this.expect(types.question); - node.trueType = this.tsParseType(); - this.expect(types.colon); - node.falseType = this.tsParseType(); - return this.finishNode(node, "TSConditionalType"); - } - - tsParseNonConditionalType() { - if (this.tsIsStartOfFunctionType()) { - return this.tsParseFunctionOrConstructorType("TSFunctionType"); - } - - if (this.match(types._new)) { - return this.tsParseFunctionOrConstructorType("TSConstructorType"); - } - - return this.tsParseUnionTypeOrHigher(); - } - - tsParseTypeAssertion() { - const node = this.startNode(); - - const _const = this.tsTryNextParseConstantContext(); - - node.typeAnnotation = _const || this.tsNextThenParseType(); - this.expectRelational(">"); - node.expression = this.parseMaybeUnary(); - return this.finishNode(node, "TSTypeAssertion"); - } - - tsParseHeritageClause(descriptor) { - const originalStart = this.state.start; - const delimitedList = this.tsParseDelimitedList("HeritageClauseElement", this.tsParseExpressionWithTypeArguments.bind(this)); - - if (!delimitedList.length) { - this.raise(originalStart, `'${descriptor}' list cannot be empty.`); - } - - return delimitedList; - } - - tsParseExpressionWithTypeArguments() { - const node = this.startNode(); - node.expression = this.tsParseEntityName(false); - - if (this.isRelational("<")) { - node.typeParameters = this.tsParseTypeArguments(); - } - - return this.finishNode(node, "TSExpressionWithTypeArguments"); - } - - tsParseInterfaceDeclaration(node) { - node.id = this.parseIdentifier(); - this.checkLVal(node.id, BIND_TS_INTERFACE, undefined, "typescript interface declaration"); - node.typeParameters = this.tsTryParseTypeParameters(); - - if (this.eat(types._extends)) { - node.extends = this.tsParseHeritageClause("extends"); - } - - const body = this.startNode(); - body.body = this.tsInType(this.tsParseObjectTypeMembers.bind(this)); - node.body = this.finishNode(body, "TSInterfaceBody"); - return this.finishNode(node, "TSInterfaceDeclaration"); - } - - tsParseTypeAliasDeclaration(node) { - node.id = this.parseIdentifier(); - this.checkLVal(node.id, BIND_TS_TYPE, undefined, "typescript type alias"); - node.typeParameters = this.tsTryParseTypeParameters(); - node.typeAnnotation = this.tsExpectThenParseType(types.eq); - this.semicolon(); - return this.finishNode(node, "TSTypeAliasDeclaration"); - } - - tsInNoContext(cb) { - const oldContext = this.state.context; - this.state.context = [oldContext[0]]; - - try { - return cb(); - } finally { - this.state.context = oldContext; - } - } - - tsInType(cb) { - const oldInType = this.state.inType; - this.state.inType = true; - - try { - return cb(); - } finally { - this.state.inType = oldInType; - } - } - - tsEatThenParseType(token) { - return !this.match(token) ? undefined : this.tsNextThenParseType(); - } - - tsExpectThenParseType(token) { - return this.tsDoThenParseType(() => this.expect(token)); - } - - tsNextThenParseType() { - return this.tsDoThenParseType(() => this.next()); - } - - tsDoThenParseType(cb) { - return this.tsInType(() => { - cb(); - return this.tsParseType(); - }); - } - - tsParseEnumMember() { - const node = this.startNode(); - node.id = this.match(types.string) ? this.parseExprAtom() : this.parseIdentifier(true); - - if (this.eat(types.eq)) { - node.initializer = this.parseMaybeAssign(); - } - - return this.finishNode(node, "TSEnumMember"); - } - - tsParseEnumDeclaration(node, isConst) { - if (isConst) node.const = true; - node.id = this.parseIdentifier(); - this.checkLVal(node.id, isConst ? BIND_TS_CONST_ENUM : BIND_TS_ENUM, undefined, "typescript enum declaration"); - this.expect(types.braceL); - node.members = this.tsParseDelimitedList("EnumMembers", this.tsParseEnumMember.bind(this)); - this.expect(types.braceR); - return this.finishNode(node, "TSEnumDeclaration"); - } - - tsParseModuleBlock() { - const node = this.startNode(); - this.scope.enter(SCOPE_OTHER); - this.expect(types.braceL); - this.parseBlockOrModuleBlockBody(node.body = [], undefined, true, types.braceR); - this.scope.exit(); - return this.finishNode(node, "TSModuleBlock"); - } - - tsParseModuleOrNamespaceDeclaration(node, nested = false) { - node.id = this.parseIdentifier(); - - if (!nested) { - this.checkLVal(node.id, BIND_TS_NAMESPACE, null, "module or namespace declaration"); - } - - if (this.eat(types.dot)) { - const inner = this.startNode(); - this.tsParseModuleOrNamespaceDeclaration(inner, true); - node.body = inner; - } else { - node.body = this.tsParseModuleBlock(); - } - - return this.finishNode(node, "TSModuleDeclaration"); - } - - tsParseAmbientExternalModuleDeclaration(node) { - if (this.isContextual("global")) { - node.global = true; - node.id = this.parseIdentifier(); - } else if (this.match(types.string)) { - node.id = this.parseExprAtom(); - } else { - this.unexpected(); - } - - if (this.match(types.braceL)) { - node.body = this.tsParseModuleBlock(); - } else { - this.semicolon(); - } - - return this.finishNode(node, "TSModuleDeclaration"); - } - - tsParseImportEqualsDeclaration(node, isExport) { - node.isExport = isExport || false; - node.id = this.parseIdentifier(); - this.expect(types.eq); - node.moduleReference = this.tsParseModuleReference(); - this.semicolon(); - return this.finishNode(node, "TSImportEqualsDeclaration"); - } - - tsIsExternalModuleReference() { - return this.isContextual("require") && this.lookahead().type === types.parenL; - } - - tsParseModuleReference() { - return this.tsIsExternalModuleReference() ? this.tsParseExternalModuleReference() : this.tsParseEntityName(false); - } - - tsParseExternalModuleReference() { - const node = this.startNode(); - this.expectContextual("require"); - this.expect(types.parenL); - - if (!this.match(types.string)) { - throw this.unexpected(); - } - - node.expression = this.parseExprAtom(); - this.expect(types.parenR); - return this.finishNode(node, "TSExternalModuleReference"); - } - - tsLookAhead(f) { - const state = this.state.clone(); - const res = f(); - this.state = state; - return res; - } - - tsTryParseAndCatch(f) { - const state = this.state.clone(); - - try { - return f(); - } catch (e) { - if (e instanceof SyntaxError) { - this.state = state; - return undefined; - } - - throw e; - } - } - - tsTryParse(f) { - const state = this.state.clone(); - const result = f(); - - if (result !== undefined && result !== false) { - return result; - } else { - this.state = state; - return undefined; - } - } - - tsTryParseDeclare(nany) { - if (this.isLineTerminator()) { - return; - } - - let starttype = this.state.type; - let kind; - - if (this.isContextual("let")) { - starttype = types._var; - kind = "let"; - } - - switch (starttype) { - case types._function: - return this.parseFunctionStatement(nany, false, true); - - case types._class: - return this.parseClass(nany, true, false); - - case types._const: - if (this.match(types._const) && this.isLookaheadContextual("enum")) { - this.expect(types._const); - this.expectContextual("enum"); - return this.tsParseEnumDeclaration(nany, true); - } - - case types._var: - kind = kind || this.state.value; - return this.parseVarStatement(nany, kind); - - case types.name: - { - const value = this.state.value; - - if (value === "global") { - return this.tsParseAmbientExternalModuleDeclaration(nany); - } else { - return this.tsParseDeclaration(nany, value, true); - } - } - } - } - - tsTryParseExportDeclaration() { - return this.tsParseDeclaration(this.startNode(), this.state.value, true); - } - - tsParseExpressionStatement(node, expr) { - switch (expr.name) { - case "declare": - { - const declaration = this.tsTryParseDeclare(node); - - if (declaration) { - declaration.declare = true; - return declaration; - } - - break; - } - - case "global": - if (this.match(types.braceL)) { - const mod = node; - mod.global = true; - mod.id = expr; - mod.body = this.tsParseModuleBlock(); - return this.finishNode(mod, "TSModuleDeclaration"); - } - - break; - - default: - return this.tsParseDeclaration(node, expr.name, false); - } - } - - tsParseDeclaration(node, value, next) { - switch (value) { - case "abstract": - if (this.tsCheckLineTerminatorAndMatch(types._class, next)) { - const cls = node; - cls.abstract = true; - - if (next) { - this.next(); - - if (!this.match(types._class)) { - this.unexpected(null, types._class); - } - } - - return this.parseClass(cls, true, false); - } - - break; - - case "enum": - if (next || this.match(types.name)) { - if (next) this.next(); - return this.tsParseEnumDeclaration(node, false); - } - - break; - - case "interface": - if (this.tsCheckLineTerminatorAndMatch(types.name, next)) { - if (next) this.next(); - return this.tsParseInterfaceDeclaration(node); - } - - break; - - case "module": - if (next) this.next(); - - if (this.match(types.string)) { - return this.tsParseAmbientExternalModuleDeclaration(node); - } else if (this.tsCheckLineTerminatorAndMatch(types.name, next)) { - return this.tsParseModuleOrNamespaceDeclaration(node); - } - - break; - - case "namespace": - if (this.tsCheckLineTerminatorAndMatch(types.name, next)) { - if (next) this.next(); - return this.tsParseModuleOrNamespaceDeclaration(node); - } - - break; - - case "type": - if (this.tsCheckLineTerminatorAndMatch(types.name, next)) { - if (next) this.next(); - return this.tsParseTypeAliasDeclaration(node); - } - - break; - } - } - - tsCheckLineTerminatorAndMatch(tokenType, next) { - return (next || this.match(tokenType)) && !this.isLineTerminator(); - } - - tsTryParseGenericAsyncArrowFunction(startPos, startLoc) { - if (!this.isRelational("<")) { - return undefined; - } - - const res = this.tsTryParseAndCatch(() => { - const node = this.startNodeAt(startPos, startLoc); - node.typeParameters = this.tsParseTypeParameters(); - super.parseFunctionParams(node); - node.returnType = this.tsTryParseTypeOrTypePredicateAnnotation(); - this.expect(types.arrow); - return node; - }); - - if (!res) { - return undefined; - } - - return this.parseArrowExpression(res, null, true); - } - - tsParseTypeArguments() { - const node = this.startNode(); - node.params = this.tsInType(() => this.tsInNoContext(() => { - this.expectRelational("<"); - return this.tsParseDelimitedList("TypeParametersOrArguments", this.tsParseType.bind(this)); - })); - this.state.exprAllowed = false; - this.expectRelational(">"); - return this.finishNode(node, "TSTypeParameterInstantiation"); - } - - tsIsDeclarationStart() { - if (this.match(types.name)) { - switch (this.state.value) { - case "abstract": - case "declare": - case "enum": - case "interface": - case "module": - case "namespace": - case "type": - return true; - } - } - - return false; - } - - isExportDefaultSpecifier() { - if (this.tsIsDeclarationStart()) return false; - return super.isExportDefaultSpecifier(); - } - - parseAssignableListItem(allowModifiers, decorators) { - const startPos = this.state.start; - const startLoc = this.state.startLoc; - let accessibility; - let readonly = false; - - if (allowModifiers) { - accessibility = this.parseAccessModifier(); - readonly = !!this.tsParseModifier(["readonly"]); - } - - const left = this.parseMaybeDefault(); - this.parseAssignableListItemTypes(left); - const elt = this.parseMaybeDefault(left.start, left.loc.start, left); - - if (accessibility || readonly) { - const pp = this.startNodeAt(startPos, startLoc); - - if (decorators.length) { - pp.decorators = decorators; - } - - if (accessibility) pp.accessibility = accessibility; - if (readonly) pp.readonly = readonly; - - if (elt.type !== "Identifier" && elt.type !== "AssignmentPattern") { - throw this.raise(pp.start, "A parameter property may not be declared using a binding pattern."); - } - - pp.parameter = elt; - return this.finishNode(pp, "TSParameterProperty"); - } - - if (decorators.length) { - left.decorators = decorators; - } - - return elt; - } - - parseFunctionBodyAndFinish(node, type, isMethod = false) { - if (this.match(types.colon)) { - node.returnType = this.tsParseTypeOrTypePredicateAnnotation(types.colon); - } - - const bodilessType = type === "FunctionDeclaration" ? "TSDeclareFunction" : type === "ClassMethod" ? "TSDeclareMethod" : undefined; - - if (bodilessType && !this.match(types.braceL) && this.isLineTerminator()) { - this.finishNode(node, bodilessType); - return; - } - - super.parseFunctionBodyAndFinish(node, type, isMethod); - } - - checkFunctionStatementId(node) { - if (!node.body && node.id) { - this.checkLVal(node.id, BIND_TS_FN_TYPE, null, "function name"); - } else { - super.checkFunctionStatementId(...arguments); - } - } - - parseSubscript(base, startPos, startLoc, noCalls, state, maybeAsyncArrow) { - if (!this.hasPrecedingLineBreak() && this.match(types.bang)) { - this.state.exprAllowed = false; - this.next(); - const nonNullExpression = this.startNodeAt(startPos, startLoc); - nonNullExpression.expression = base; - return this.finishNode(nonNullExpression, "TSNonNullExpression"); - } - - if (this.isRelational("<")) { - const result = this.tsTryParseAndCatch(() => { - if (!noCalls && this.atPossibleAsync(base)) { - const asyncArrowFn = this.tsTryParseGenericAsyncArrowFunction(startPos, startLoc); - - if (asyncArrowFn) { - return asyncArrowFn; - } - } - - const node = this.startNodeAt(startPos, startLoc); - node.callee = base; - const typeArguments = this.tsParseTypeArguments(); - - if (typeArguments) { - if (!noCalls && this.eat(types.parenL)) { - node.arguments = this.parseCallExpressionArguments(types.parenR, false); - node.typeParameters = typeArguments; - return this.finishCallExpression(node); - } else if (this.match(types.backQuote)) { - return this.parseTaggedTemplateExpression(startPos, startLoc, base, state, typeArguments); - } - } - - this.unexpected(); - }); - if (result) return result; - } - - return super.parseSubscript(base, startPos, startLoc, noCalls, state, maybeAsyncArrow); - } - - parseNewArguments(node) { - if (this.isRelational("<")) { - const typeParameters = this.tsTryParseAndCatch(() => { - const args = this.tsParseTypeArguments(); - if (!this.match(types.parenL)) this.unexpected(); - return args; - }); - - if (typeParameters) { - node.typeParameters = typeParameters; - } - } - - super.parseNewArguments(node); - } - - parseExprOp(left, leftStartPos, leftStartLoc, minPrec, noIn) { - if (nonNull(types._in.binop) > minPrec && !this.hasPrecedingLineBreak() && this.isContextual("as")) { - const node = this.startNodeAt(leftStartPos, leftStartLoc); - node.expression = left; - - const _const = this.tsTryNextParseConstantContext(); - - if (_const) { - node.typeAnnotation = _const; - } else { - node.typeAnnotation = this.tsNextThenParseType(); - } - - this.finishNode(node, "TSAsExpression"); - return this.parseExprOp(node, leftStartPos, leftStartLoc, minPrec, noIn); - } - - return super.parseExprOp(left, leftStartPos, leftStartLoc, minPrec, noIn); - } - - checkReservedWord(word, startLoc, checkKeywords, isBinding) {} - - checkDuplicateExports() {} - - parseImport(node) { - if (this.match(types.name) && this.lookahead().type === types.eq) { - return this.tsParseImportEqualsDeclaration(node); - } - - return super.parseImport(node); - } - - parseExport(node) { - if (this.match(types._import)) { - this.expect(types._import); - return this.tsParseImportEqualsDeclaration(node, true); - } else if (this.eat(types.eq)) { - const assign = node; - assign.expression = this.parseExpression(); - this.semicolon(); - return this.finishNode(assign, "TSExportAssignment"); - } else if (this.eatContextual("as")) { - const decl = node; - this.expectContextual("namespace"); - decl.id = this.parseIdentifier(); - this.semicolon(); - return this.finishNode(decl, "TSNamespaceExportDeclaration"); - } else { - return super.parseExport(node); - } - } - - isAbstractClass() { - return this.isContextual("abstract") && this.lookahead().type === types._class; - } - - parseExportDefaultExpression() { - if (this.isAbstractClass()) { - const cls = this.startNode(); - this.next(); - this.parseClass(cls, true, true); - cls.abstract = true; - return cls; - } - - if (this.state.value === "interface") { - const result = this.tsParseDeclaration(this.startNode(), this.state.value, true); - if (result) return result; - } - - return super.parseExportDefaultExpression(); - } - - parseStatementContent(context, topLevel) { - if (this.state.type === types._const) { - const ahead = this.lookahead(); - - if (ahead.type === types.name && ahead.value === "enum") { - const node = this.startNode(); - this.expect(types._const); - this.expectContextual("enum"); - return this.tsParseEnumDeclaration(node, true); - } - } - - return super.parseStatementContent(context, topLevel); - } - - parseAccessModifier() { - return this.tsParseModifier(["public", "protected", "private"]); - } - - parseClassMember(classBody, member, state, constructorAllowsSuper) { - const accessibility = this.parseAccessModifier(); - if (accessibility) member.accessibility = accessibility; - super.parseClassMember(classBody, member, state, constructorAllowsSuper); - } - - parseClassMemberWithIsStatic(classBody, member, state, isStatic, constructorAllowsSuper) { - const methodOrProp = member; - const prop = member; - const propOrIdx = member; - let abstract = false, - readonly = false; - const mod = this.tsParseModifier(["abstract", "readonly"]); - - switch (mod) { - case "readonly": - readonly = true; - abstract = !!this.tsParseModifier(["abstract"]); - break; - - case "abstract": - abstract = true; - readonly = !!this.tsParseModifier(["readonly"]); - break; - } - - if (abstract) methodOrProp.abstract = true; - if (readonly) propOrIdx.readonly = true; - - if (!abstract && !isStatic && !methodOrProp.accessibility) { - const idx = this.tsTryParseIndexSignature(member); - - if (idx) { - classBody.body.push(idx); - return; - } - } - - if (readonly) { - methodOrProp.static = isStatic; - this.parseClassPropertyName(prop); - this.parsePostMemberNameModifiers(methodOrProp); - this.pushClassProperty(classBody, prop); - return; - } - - super.parseClassMemberWithIsStatic(classBody, member, state, isStatic, constructorAllowsSuper); - } - - parsePostMemberNameModifiers(methodOrProp) { - const optional = this.eat(types.question); - if (optional) methodOrProp.optional = true; - } - - parseExpressionStatement(node, expr) { - const decl = expr.type === "Identifier" ? this.tsParseExpressionStatement(node, expr) : undefined; - return decl || super.parseExpressionStatement(node, expr); - } - - shouldParseExportDeclaration() { - if (this.tsIsDeclarationStart()) return true; - return super.shouldParseExportDeclaration(); - } - - parseConditional(expr, noIn, startPos, startLoc, refNeedsArrowPos) { - if (!refNeedsArrowPos || !this.match(types.question)) { - return super.parseConditional(expr, noIn, startPos, startLoc, refNeedsArrowPos); - } - - const state = this.state.clone(); - - try { - return super.parseConditional(expr, noIn, startPos, startLoc); - } catch (err) { - if (!(err instanceof SyntaxError)) { - throw err; - } - - this.state = state; - refNeedsArrowPos.start = err.pos || this.state.start; - return expr; - } - } - - parseParenItem(node, startPos, startLoc) { - node = super.parseParenItem(node, startPos, startLoc); - - if (this.eat(types.question)) { - node.optional = true; - this.resetEndLocation(node); - } - - if (this.match(types.colon)) { - const typeCastNode = this.startNodeAt(startPos, startLoc); - typeCastNode.expression = node; - typeCastNode.typeAnnotation = this.tsParseTypeAnnotation(); - return this.finishNode(typeCastNode, "TSTypeCastExpression"); - } - - return node; - } - - parseExportDeclaration(node) { - const startPos = this.state.start; - const startLoc = this.state.startLoc; - const isDeclare = this.eatContextual("declare"); - let declaration; - - if (this.match(types.name)) { - declaration = this.tsTryParseExportDeclaration(); - } - - if (!declaration) { - declaration = super.parseExportDeclaration(node); - } - - if (declaration && isDeclare) { - this.resetStartLocation(declaration, startPos, startLoc); - declaration.declare = true; - } - - return declaration; - } - - parseClassId(node, isStatement, optionalId) { - if ((!isStatement || optionalId) && this.isContextual("implements")) { - return; - } - - super.parseClassId(...arguments); - const typeParameters = this.tsTryParseTypeParameters(); - if (typeParameters) node.typeParameters = typeParameters; - } - - parseClassProperty(node) { - if (!node.optional && this.eat(types.bang)) { - node.definite = true; - } - - const type = this.tsTryParseTypeAnnotation(); - if (type) node.typeAnnotation = type; - return super.parseClassProperty(node); - } - - pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper) { - const typeParameters = this.tsTryParseTypeParameters(); - if (typeParameters) method.typeParameters = typeParameters; - super.pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper); - } - - pushClassPrivateMethod(classBody, method, isGenerator, isAsync) { - const typeParameters = this.tsTryParseTypeParameters(); - if (typeParameters) method.typeParameters = typeParameters; - super.pushClassPrivateMethod(classBody, method, isGenerator, isAsync); - } - - parseClassSuper(node) { - super.parseClassSuper(node); - - if (node.superClass && this.isRelational("<")) { - node.superTypeParameters = this.tsParseTypeArguments(); - } - - if (this.eatContextual("implements")) { - node.implements = this.tsParseHeritageClause("implements"); - } - } - - parseObjPropValue(prop, ...args) { - const typeParameters = this.tsTryParseTypeParameters(); - if (typeParameters) prop.typeParameters = typeParameters; - super.parseObjPropValue(prop, ...args); - } - - parseFunctionParams(node, allowModifiers) { - const typeParameters = this.tsTryParseTypeParameters(); - if (typeParameters) node.typeParameters = typeParameters; - super.parseFunctionParams(node, allowModifiers); - } - - parseVarId(decl, kind) { - super.parseVarId(decl, kind); - - if (decl.id.type === "Identifier" && this.eat(types.bang)) { - decl.definite = true; - } - - const type = this.tsTryParseTypeAnnotation(); - - if (type) { - decl.id.typeAnnotation = type; - this.resetEndLocation(decl.id); - } - } - - parseAsyncArrowFromCallExpression(node, call) { - if (this.match(types.colon)) { - node.returnType = this.tsParseTypeAnnotation(); - } - - return super.parseAsyncArrowFromCallExpression(node, call); - } - - parseMaybeAssign(...args) { - let jsxError; - - if (this.match(types.jsxTagStart)) { - const context = this.curContext(); - assert(context === types$1.j_oTag); - assert(this.state.context[this.state.context.length - 2] === types$1.j_expr); - const state = this.state.clone(); - - try { - return super.parseMaybeAssign(...args); - } catch (err) { - if (!(err instanceof SyntaxError)) { - throw err; - } - - this.state = state; - assert(this.curContext() === types$1.j_oTag); - this.state.context.pop(); - assert(this.curContext() === types$1.j_expr); - this.state.context.pop(); - jsxError = err; - } - } - - if (jsxError === undefined && !this.isRelational("<")) { - return super.parseMaybeAssign(...args); - } - - let arrowExpression; - let typeParameters; - const state = this.state.clone(); - - try { - typeParameters = this.tsParseTypeParameters(); - arrowExpression = super.parseMaybeAssign(...args); - - if (arrowExpression.type !== "ArrowFunctionExpression" || arrowExpression.extra && arrowExpression.extra.parenthesized) { - this.unexpected(); - } - } catch (err) { - if (!(err instanceof SyntaxError)) { - throw err; - } - - if (jsxError) { - throw jsxError; - } - - assert(!this.hasPlugin("jsx")); - this.state = state; - return super.parseMaybeAssign(...args); - } - - if (typeParameters && typeParameters.params.length !== 0) { - this.resetStartLocationFromNode(arrowExpression, typeParameters); - } - - arrowExpression.typeParameters = typeParameters; - return arrowExpression; - } - - parseMaybeUnary(refShorthandDefaultPos) { - if (!this.hasPlugin("jsx") && this.isRelational("<")) { - return this.tsParseTypeAssertion(); - } else { - return super.parseMaybeUnary(refShorthandDefaultPos); - } - } - - parseArrow(node) { - if (this.match(types.colon)) { - const state = this.state.clone(); - - try { - const returnType = this.tsParseTypeOrTypePredicateAnnotation(types.colon); - - if (this.canInsertSemicolon() || !this.match(types.arrow)) { - this.state = state; - return undefined; - } - - node.returnType = returnType; - } catch (err) { - if (err instanceof SyntaxError) { - this.state = state; - } else { - throw err; - } - } - } - - return super.parseArrow(node); - } - - parseAssignableListItemTypes(param) { - if (this.eat(types.question)) { - if (param.type !== "Identifier") { - throw this.raise(param.start, "A binding pattern parameter cannot be optional in an implementation signature."); - } - - param.optional = true; - } - - const type = this.tsTryParseTypeAnnotation(); - if (type) param.typeAnnotation = type; - this.resetEndLocation(param); - return param; - } - - toAssignable(node, isBinding, contextDescription) { - switch (node.type) { - case "TSTypeCastExpression": - return super.toAssignable(this.typeCastToParameter(node), isBinding, contextDescription); - - case "TSParameterProperty": - return super.toAssignable(node, isBinding, contextDescription); - - case "TSAsExpression": - case "TSNonNullExpression": - case "TSTypeAssertion": - node.expression = this.toAssignable(node.expression, isBinding, contextDescription); - return node; - - default: - return super.toAssignable(node, isBinding, contextDescription); - } - } - - checkLVal(expr, bindingType = BIND_NONE, checkClashes, contextDescription) { - switch (expr.type) { - case "TSTypeCastExpression": - return; - - case "TSParameterProperty": - this.checkLVal(expr.parameter, bindingType, checkClashes, "parameter property"); - return; - - case "TSAsExpression": - case "TSNonNullExpression": - case "TSTypeAssertion": - this.checkLVal(expr.expression, bindingType, checkClashes, contextDescription); - return; - - default: - super.checkLVal(expr, bindingType, checkClashes, contextDescription); - return; - } - } - - parseBindingAtom() { - switch (this.state.type) { - case types._this: - return this.parseIdentifier(true); - - default: - return super.parseBindingAtom(); - } - } - - parseMaybeDecoratorArguments(expr) { - if (this.isRelational("<")) { - const typeArguments = this.tsParseTypeArguments(); - - if (this.match(types.parenL)) { - const call = super.parseMaybeDecoratorArguments(expr); - call.typeParameters = typeArguments; - return call; - } - - this.unexpected(this.state.start, types.parenL); - } - - return super.parseMaybeDecoratorArguments(expr); - } - - isClassMethod() { - return this.isRelational("<") || super.isClassMethod(); - } - - isClassProperty() { - return this.match(types.bang) || this.match(types.colon) || super.isClassProperty(); - } - - parseMaybeDefault(...args) { - const node = super.parseMaybeDefault(...args); - - if (node.type === "AssignmentPattern" && node.typeAnnotation && node.right.start < node.typeAnnotation.start) { - this.raise(node.typeAnnotation.start, "Type annotations must come before default assignments, " + "e.g. instead of `age = 25: number` use `age: number = 25`"); - } - - return node; - } - - getTokenFromCode(code) { - if (this.state.inType && (code === 62 || code === 60)) { - return this.finishOp(types.relational, 1); - } else { - return super.getTokenFromCode(code); - } - } - - toAssignableList(exprList, isBinding, contextDescription) { - for (let i = 0; i < exprList.length; i++) { - const expr = exprList[i]; - if (!expr) continue; - - switch (expr.type) { - case "TSTypeCastExpression": - exprList[i] = this.typeCastToParameter(expr); - break; - - case "TSAsExpression": - case "TSTypeAssertion": - this.raise(expr.start, "Unexpected type cast in parameter position."); - break; - } - } - - return super.toAssignableList(exprList, isBinding, contextDescription); - } - - typeCastToParameter(node) { - node.expression.typeAnnotation = node.typeAnnotation; - this.resetEndLocation(node.expression, node.typeAnnotation.end, node.typeAnnotation.loc.end); - return node.expression; - } - - toReferencedList(exprList, isInParens) { - for (let i = 0; i < exprList.length; i++) { - const expr = exprList[i]; - - if (expr && expr._exprListItem && expr.type === "TsTypeCastExpression") { - this.raise(expr.start, "Did not expect a type annotation here."); - } - } - - return exprList; - } - - shouldParseArrow() { - return this.match(types.colon) || super.shouldParseArrow(); - } - - shouldParseAsyncArrow() { - return this.match(types.colon) || super.shouldParseAsyncArrow(); - } - - canHaveLeadingDecorator() { - return super.canHaveLeadingDecorator() || this.isAbstractClass(); - } - - jsxParseOpeningElementAfterName(node) { - if (this.isRelational("<")) { - const typeArguments = this.tsTryParseAndCatch(() => this.tsParseTypeArguments()); - if (typeArguments) node.typeParameters = typeArguments; - } - - return super.jsxParseOpeningElementAfterName(node); - } - - getGetterSetterExpectedParamCount(method) { - const baseCount = super.getGetterSetterExpectedParamCount(method); - const firstParam = method.params[0]; - const hasContextParam = firstParam && firstParam.type === "Identifier" && firstParam.name === "this"; - return hasContextParam ? baseCount + 1 : baseCount; - } - -}); - -types.placeholder = new TokenType("%%", { - startsExpr: true -}); -var placeholders = (superClass => class extends superClass { - parsePlaceholder(expectedNode) { - if (this.match(types.placeholder)) { - const node = this.startNode(); - this.next(); - this.assertNoSpace("Unexpected space in placeholder."); - node.name = super.parseIdentifier(true); - this.assertNoSpace("Unexpected space in placeholder."); - this.expect(types.placeholder); - return this.finishPlaceholder(node, expectedNode); - } - } - - finishPlaceholder(node, expectedNode) { - const isFinished = !!(node.expectedNode && node.type === "Placeholder"); - node.expectedNode = expectedNode; - return isFinished ? node : this.finishNode(node, "Placeholder"); - } - - getTokenFromCode(code) { - if (code === 37 && this.input.charCodeAt(this.state.pos + 1) === 37) { - return this.finishOp(types.placeholder, 2); - } - - return super.getTokenFromCode(...arguments); - } - - parseExprAtom() { - return this.parsePlaceholder("Expression") || super.parseExprAtom(...arguments); - } - - parseIdentifier() { - return this.parsePlaceholder("Identifier") || super.parseIdentifier(...arguments); - } - - checkReservedWord(word) { - if (word !== undefined) super.checkReservedWord(...arguments); - } - - parseBindingAtom() { - return this.parsePlaceholder("Pattern") || super.parseBindingAtom(...arguments); - } - - checkLVal(expr) { - if (expr.type !== "Placeholder") super.checkLVal(...arguments); - } - - toAssignable(node) { - if (node && node.type === "Placeholder" && node.expectedNode === "Expression") { - node.expectedNode = "Pattern"; - return node; - } - - return super.toAssignable(...arguments); - } - - verifyBreakContinue(node) { - if (node.label && node.label.type === "Placeholder") return; - super.verifyBreakContinue(...arguments); - } - - parseExpressionStatement(node, expr) { - if (expr.type !== "Placeholder" || expr.extra && expr.extra.parenthesized) { - return super.parseExpressionStatement(...arguments); - } - - if (this.match(types.colon)) { - const stmt = node; - stmt.label = this.finishPlaceholder(expr, "Identifier"); - this.next(); - stmt.body = this.parseStatement("label"); - return this.finishNode(stmt, "LabeledStatement"); - } - - this.semicolon(); - node.name = expr.name; - return this.finishPlaceholder(node, "Statement"); - } - - parseBlock() { - return this.parsePlaceholder("BlockStatement") || super.parseBlock(...arguments); - } - - parseFunctionId() { - return this.parsePlaceholder("Identifier") || super.parseFunctionId(...arguments); - } - - parseClass(node, isStatement, optionalId) { - const type = isStatement ? "ClassDeclaration" : "ClassExpression"; - this.next(); - this.takeDecorators(node); - const placeholder = this.parsePlaceholder("Identifier"); - - if (placeholder) { - if (this.match(types._extends) || this.match(types.placeholder) || this.match(types.braceL)) { - node.id = placeholder; - } else if (optionalId || !isStatement) { - node.id = null; - node.body = this.finishPlaceholder(placeholder, "ClassBody"); - return this.finishNode(node, type); - } else { - this.unexpected(null, "A class name is required"); - } - } else { - this.parseClassId(node, isStatement, optionalId); - } - - this.parseClassSuper(node); - node.body = this.parsePlaceholder("ClassBody") || this.parseClassBody(!!node.superClass); - return this.finishNode(node, type); - } - - parseExport(node) { - const placeholder = this.parsePlaceholder("Identifier"); - if (!placeholder) return super.parseExport(...arguments); - - if (!this.isContextual("from") && !this.match(types.comma)) { - node.specifiers = []; - node.source = null; - node.declaration = this.finishPlaceholder(placeholder, "Declaration"); - return this.finishNode(node, "ExportNamedDeclaration"); - } - - this.expectPlugin("exportDefaultFrom"); - const specifier = this.startNode(); - specifier.exported = placeholder; - node.specifiers = [this.finishNode(specifier, "ExportDefaultSpecifier")]; - return super.parseExport(node); - } - - maybeParseExportDefaultSpecifier(node) { - if (node.specifiers && node.specifiers.length > 0) { - return true; - } - - return super.maybeParseExportDefaultSpecifier(...arguments); - } - - checkExport(node) { - const { - specifiers - } = node; - - if (specifiers && specifiers.length) { - node.specifiers = specifiers.filter(node => node.exported.type === "Placeholder"); - } - - super.checkExport(node); - node.specifiers = specifiers; - } - - parseImport(node) { - const placeholder = this.parsePlaceholder("Identifier"); - if (!placeholder) return super.parseImport(...arguments); - node.specifiers = []; - - if (!this.isContextual("from") && !this.match(types.comma)) { - node.source = this.finishPlaceholder(placeholder, "StringLiteral"); - this.semicolon(); - return this.finishNode(node, "ImportDeclaration"); - } - - const specifier = this.startNodeAtNode(placeholder); - specifier.local = placeholder; - this.finishNode(specifier, "ImportDefaultSpecifier"); - node.specifiers.push(specifier); - - if (this.eat(types.comma)) { - const hasStarImport = this.maybeParseStarImportSpecifier(node); - if (!hasStarImport) this.parseNamedImportSpecifiers(node); - } - - this.expectContextual("from"); - node.source = this.parseImportSource(); - this.semicolon(); - return this.finishNode(node, "ImportDeclaration"); - } - - parseImportSource() { - return this.parsePlaceholder("StringLiteral") || super.parseImportSource(...arguments); - } - -}); - -function hasPlugin(plugins, name) { - return plugins.some(plugin => { - if (Array.isArray(plugin)) { - return plugin[0] === name; - } else { - return plugin === name; - } - }); -} -function getPluginOption(plugins, name, option) { - const plugin = plugins.find(plugin => { - if (Array.isArray(plugin)) { - return plugin[0] === name; - } else { - return plugin === name; - } - }); - - if (plugin && Array.isArray(plugin)) { - return plugin[1][option]; - } - - return null; -} -const PIPELINE_PROPOSALS = ["minimal", "smart", "fsharp"]; -function validatePlugins(plugins) { - if (hasPlugin(plugins, "decorators")) { - if (hasPlugin(plugins, "decorators-legacy")) { - throw new Error("Cannot use the decorators and decorators-legacy plugin together"); - } - - const decoratorsBeforeExport = getPluginOption(plugins, "decorators", "decoratorsBeforeExport"); - - if (decoratorsBeforeExport == null) { - throw new Error("The 'decorators' plugin requires a 'decoratorsBeforeExport' option," + " whose value must be a boolean. If you are migrating from" + " Babylon/Babel 6 or want to use the old decorators proposal, you" + " should use the 'decorators-legacy' plugin instead of 'decorators'."); - } else if (typeof decoratorsBeforeExport !== "boolean") { - throw new Error("'decoratorsBeforeExport' must be a boolean."); - } - } - - if (hasPlugin(plugins, "flow") && hasPlugin(plugins, "typescript")) { - throw new Error("Cannot combine flow and typescript plugins."); - } - - if (hasPlugin(plugins, "pipelineOperator") && !PIPELINE_PROPOSALS.includes(getPluginOption(plugins, "pipelineOperator", "proposal"))) { - throw new Error("'pipelineOperator' requires 'proposal' option whose value should be one of: " + PIPELINE_PROPOSALS.map(p => `'${p}'`).join(", ")); - } -} -const mixinPlugins = { - estree, - jsx, - flow, - typescript, - placeholders -}; -const mixinPluginNames = Object.keys(mixinPlugins); - -const defaultOptions = { - sourceType: "script", - sourceFilename: undefined, - startLine: 1, - allowAwaitOutsideFunction: false, - allowReturnOutsideFunction: false, - allowImportExportEverywhere: false, - allowSuperOutsideMethod: false, - allowUndeclaredExports: false, - plugins: [], - strictMode: null, - ranges: false, - tokens: false, - createParenthesizedExpressions: false -}; -function getOptions(opts) { - const options = {}; - - for (let _i = 0, _Object$keys = Object.keys(defaultOptions); _i < _Object$keys.length; _i++) { - const key = _Object$keys[_i]; - options[key] = opts && opts[key] != null ? opts[key] : defaultOptions[key]; - } - - return options; -} - -class Position { - constructor(line, col) { - this.line = line; - this.column = col; - } - -} -class SourceLocation { - constructor(start, end) { - this.start = start; - this.end = end; - } - -} -function getLineInfo(input, offset) { - let line = 1; - let lineStart = 0; - let match; - lineBreakG.lastIndex = 0; - - while ((match = lineBreakG.exec(input)) && match.index < offset) { - line++; - lineStart = lineBreakG.lastIndex; - } - - return new Position(line, offset - lineStart); -} - -class BaseParser { - constructor() { - this.sawUnambiguousESM = false; - } - - hasPlugin(name) { - return this.plugins.has(name); - } - - getPluginOption(plugin, name) { - if (this.hasPlugin(plugin)) return this.plugins.get(plugin)[name]; - } - -} - -function last(stack) { - return stack[stack.length - 1]; -} - -class CommentsParser extends BaseParser { - addComment(comment) { - if (this.filename) comment.loc.filename = this.filename; - this.state.trailingComments.push(comment); - this.state.leadingComments.push(comment); - } - - processComment(node) { - if (node.type === "Program" && node.body.length > 0) return; - const stack = this.state.commentStack; - let firstChild, lastChild, trailingComments, i, j; - - if (this.state.trailingComments.length > 0) { - if (this.state.trailingComments[0].start >= node.end) { - trailingComments = this.state.trailingComments; - this.state.trailingComments = []; - } else { - this.state.trailingComments.length = 0; - } - } else if (stack.length > 0) { - const lastInStack = last(stack); - - if (lastInStack.trailingComments && lastInStack.trailingComments[0].start >= node.end) { - trailingComments = lastInStack.trailingComments; - delete lastInStack.trailingComments; - } - } - - if (stack.length > 0 && last(stack).start >= node.start) { - firstChild = stack.pop(); - } - - while (stack.length > 0 && last(stack).start >= node.start) { - lastChild = stack.pop(); - } - - if (!lastChild && firstChild) lastChild = firstChild; - - if (firstChild && this.state.leadingComments.length > 0) { - const lastComment = last(this.state.leadingComments); - - if (firstChild.type === "ObjectProperty") { - if (lastComment.start >= node.start) { - if (this.state.commentPreviousNode) { - for (j = 0; j < this.state.leadingComments.length; j++) { - if (this.state.leadingComments[j].end < this.state.commentPreviousNode.end) { - this.state.leadingComments.splice(j, 1); - j--; - } - } - - if (this.state.leadingComments.length > 0) { - firstChild.trailingComments = this.state.leadingComments; - this.state.leadingComments = []; - } - } - } - } else if (node.type === "CallExpression" && node.arguments && node.arguments.length) { - const lastArg = last(node.arguments); - - if (lastArg && lastComment.start >= lastArg.start && lastComment.end <= node.end) { - if (this.state.commentPreviousNode) { - for (j = 0; j < this.state.leadingComments.length; j++) { - if (this.state.leadingComments[j].end < this.state.commentPreviousNode.end) { - this.state.leadingComments.splice(j, 1); - j--; - } - } - - if (this.state.leadingComments.length > 0) { - lastArg.trailingComments = this.state.leadingComments; - this.state.leadingComments = []; - } - } - } - } - } - - if (lastChild) { - if (lastChild.leadingComments) { - if (lastChild !== node && lastChild.leadingComments.length > 0 && last(lastChild.leadingComments).end <= node.start) { - node.leadingComments = lastChild.leadingComments; - delete lastChild.leadingComments; - } else { - for (i = lastChild.leadingComments.length - 2; i >= 0; --i) { - if (lastChild.leadingComments[i].end <= node.start) { - node.leadingComments = lastChild.leadingComments.splice(0, i + 1); - break; - } - } - } - } - } else if (this.state.leadingComments.length > 0) { - if (last(this.state.leadingComments).end <= node.start) { - if (this.state.commentPreviousNode) { - for (j = 0; j < this.state.leadingComments.length; j++) { - if (this.state.leadingComments[j].end < this.state.commentPreviousNode.end) { - this.state.leadingComments.splice(j, 1); - j--; - } - } - } - - if (this.state.leadingComments.length > 0) { - node.leadingComments = this.state.leadingComments; - this.state.leadingComments = []; - } - } else { - for (i = 0; i < this.state.leadingComments.length; i++) { - if (this.state.leadingComments[i].end > node.start) { - break; - } - } - - const leadingComments = this.state.leadingComments.slice(0, i); - - if (leadingComments.length) { - node.leadingComments = leadingComments; - } - - trailingComments = this.state.leadingComments.slice(i); - - if (trailingComments.length === 0) { - trailingComments = null; - } - } - } - - this.state.commentPreviousNode = node; - - if (trailingComments) { - if (trailingComments.length && trailingComments[0].start >= node.start && last(trailingComments).end <= node.end) { - node.innerComments = trailingComments; - } else { - node.trailingComments = trailingComments; - } - } - - stack.push(node); - } - -} - -class LocationParser extends CommentsParser { - getLocationForPosition(pos) { - let loc; - if (pos === this.state.start) loc = this.state.startLoc;else if (pos === this.state.lastTokStart) loc = this.state.lastTokStartLoc;else if (pos === this.state.end) loc = this.state.endLoc;else if (pos === this.state.lastTokEnd) loc = this.state.lastTokEndLoc;else loc = getLineInfo(this.input, pos); - return loc; - } - - raise(pos, message, { - missingPluginNames, - code - } = {}) { - const loc = this.getLocationForPosition(pos); - message += ` (${loc.line}:${loc.column})`; - const err = new SyntaxError(message); - err.pos = pos; - err.loc = loc; - - if (missingPluginNames) { - err.missingPlugin = missingPluginNames; - } - - if (code !== undefined) { - err.code = code; - } - - throw err; - } - -} - -class State { - constructor() { - this.potentialArrowAt = -1; - this.noArrowAt = []; - this.noArrowParamsConversionAt = []; - this.commaAfterSpreadAt = -1; - this.inParameters = false; - this.maybeInArrowParameters = false; - this.inPipeline = false; - this.inType = false; - this.noAnonFunctionType = false; - this.inPropertyName = false; - this.inClassProperty = false; - this.hasFlowComment = false; - this.isIterator = false; - this.topicContext = { - maxNumOfResolvableTopics: 0, - maxTopicIndex: null - }; - this.soloAwait = false; - this.inFSharpPipelineDirectBody = false; - this.classLevel = 0; - this.labels = []; - this.decoratorStack = [[]]; - this.yieldPos = 0; - this.awaitPos = 0; - this.tokens = []; - this.comments = []; - this.trailingComments = []; - this.leadingComments = []; - this.commentStack = []; - this.commentPreviousNode = null; - this.pos = 0; - this.lineStart = 0; - this.type = types.eof; - this.value = null; - this.start = 0; - this.end = 0; - this.lastTokEndLoc = null; - this.lastTokStartLoc = null; - this.lastTokStart = 0; - this.lastTokEnd = 0; - this.context = [types$1.braceStatement]; - this.exprAllowed = true; - this.containsEsc = false; - this.containsOctal = false; - this.octalPosition = null; - this.exportedIdentifiers = []; - this.invalidTemplateEscapePosition = null; - } - - init(options) { - this.strict = options.strictMode === false ? false : options.sourceType === "module"; - this.curLine = options.startLine; - this.startLoc = this.endLoc = this.curPosition(); - } - - curPosition() { - return new Position(this.curLine, this.pos - this.lineStart); - } - - clone(skipArrays) { - const state = new State(); - const keys = Object.keys(this); - - for (let i = 0, length = keys.length; i < length; i++) { - const key = keys[i]; - let val = this[key]; - - if (!skipArrays && Array.isArray(val)) { - val = val.slice(); - } - - state[key] = val; - } - - return state; - } - -} - -var _isDigit = function isDigit(code) { - return code >= 48 && code <= 57; -}; -const VALID_REGEX_FLAGS = new Set(["g", "m", "s", "i", "y", "u"]); -const forbiddenNumericSeparatorSiblings = { - decBinOct: [46, 66, 69, 79, 95, 98, 101, 111], - hex: [46, 88, 95, 120] -}; -const allowedNumericSeparatorSiblings = {}; -allowedNumericSeparatorSiblings.bin = [48, 49]; -allowedNumericSeparatorSiblings.oct = [...allowedNumericSeparatorSiblings.bin, 50, 51, 52, 53, 54, 55]; -allowedNumericSeparatorSiblings.dec = [...allowedNumericSeparatorSiblings.oct, 56, 57]; -allowedNumericSeparatorSiblings.hex = [...allowedNumericSeparatorSiblings.dec, 65, 66, 67, 68, 69, 70, 97, 98, 99, 100, 101, 102]; -class Token { - constructor(state) { - this.type = state.type; - this.value = state.value; - this.start = state.start; - this.end = state.end; - this.loc = new SourceLocation(state.startLoc, state.endLoc); - } - -} -class Tokenizer extends LocationParser { - constructor(options, input) { - super(); - this.state = new State(); - this.state.init(options); - this.input = input; - this.length = input.length; - this.isLookahead = false; - } - - next() { - if (this.options.tokens && !this.isLookahead) { - this.state.tokens.push(new Token(this.state)); - } - - this.state.lastTokEnd = this.state.end; - this.state.lastTokStart = this.state.start; - this.state.lastTokEndLoc = this.state.endLoc; - this.state.lastTokStartLoc = this.state.startLoc; - this.nextToken(); - } - - eat(type) { - if (this.match(type)) { - this.next(); - return true; - } else { - return false; - } - } - - match(type) { - return this.state.type === type; - } - - lookahead() { - const old = this.state; - this.state = old.clone(true); - this.isLookahead = true; - this.next(); - this.isLookahead = false; - const curr = this.state; - this.state = old; - return curr; - } - - setStrict(strict) { - this.state.strict = strict; - if (!this.match(types.num) && !this.match(types.string)) return; - this.state.pos = this.state.start; - - while (this.state.pos < this.state.lineStart) { - this.state.lineStart = this.input.lastIndexOf("\n", this.state.lineStart - 2) + 1; - --this.state.curLine; - } - - this.nextToken(); - } - - curContext() { - return this.state.context[this.state.context.length - 1]; - } - - nextToken() { - const curContext = this.curContext(); - if (!curContext || !curContext.preserveSpace) this.skipSpace(); - this.state.containsOctal = false; - this.state.octalPosition = null; - this.state.start = this.state.pos; - this.state.startLoc = this.state.curPosition(); - - if (this.state.pos >= this.length) { - this.finishToken(types.eof); - return; - } - - if (curContext.override) { - curContext.override(this); - } else { - this.getTokenFromCode(this.input.codePointAt(this.state.pos)); - } - } - - pushComment(block, text, start, end, startLoc, endLoc) { - const comment = { - type: block ? "CommentBlock" : "CommentLine", - value: text, - start: start, - end: end, - loc: new SourceLocation(startLoc, endLoc) - }; - if (this.options.tokens) this.state.tokens.push(comment); - this.state.comments.push(comment); - this.addComment(comment); - } - - skipBlockComment() { - const startLoc = this.state.curPosition(); - const start = this.state.pos; - const end = this.input.indexOf("*/", this.state.pos += 2); - if (end === -1) this.raise(this.state.pos - 2, "Unterminated comment"); - this.state.pos = end + 2; - lineBreakG.lastIndex = start; - let match; - - while ((match = lineBreakG.exec(this.input)) && match.index < this.state.pos) { - ++this.state.curLine; - this.state.lineStart = match.index + match[0].length; - } - - if (this.isLookahead) return; - this.pushComment(true, this.input.slice(start + 2, end), start, this.state.pos, startLoc, this.state.curPosition()); - } - - skipLineComment(startSkip) { - const start = this.state.pos; - const startLoc = this.state.curPosition(); - let ch = this.input.charCodeAt(this.state.pos += startSkip); - - if (this.state.pos < this.length) { - while (ch !== 10 && ch !== 13 && ch !== 8232 && ch !== 8233 && ++this.state.pos < this.length) { - ch = this.input.charCodeAt(this.state.pos); - } - } - - if (this.isLookahead) return; - this.pushComment(false, this.input.slice(start + startSkip, this.state.pos), start, this.state.pos, startLoc, this.state.curPosition()); - } - - skipSpace() { - loop: while (this.state.pos < this.length) { - const ch = this.input.charCodeAt(this.state.pos); - - switch (ch) { - case 32: - case 160: - case 9: - ++this.state.pos; - break; - - case 13: - if (this.input.charCodeAt(this.state.pos + 1) === 10) { - ++this.state.pos; - } - - case 10: - case 8232: - case 8233: - ++this.state.pos; - ++this.state.curLine; - this.state.lineStart = this.state.pos; - break; - - case 47: - switch (this.input.charCodeAt(this.state.pos + 1)) { - case 42: - this.skipBlockComment(); - break; - - case 47: - this.skipLineComment(2); - break; - - default: - break loop; - } - - break; - - default: - if (isWhitespace(ch)) { - ++this.state.pos; - } else { - break loop; - } - - } - } - } - - finishToken(type, val) { - this.state.end = this.state.pos; - this.state.endLoc = this.state.curPosition(); - const prevType = this.state.type; - this.state.type = type; - this.state.value = val; - if (!this.isLookahead) this.updateContext(prevType); - } - - readToken_numberSign() { - if (this.state.pos === 0 && this.readToken_interpreter()) { - return; - } - - const nextPos = this.state.pos + 1; - const next = this.input.charCodeAt(nextPos); - - if (next >= 48 && next <= 57) { - this.raise(this.state.pos, "Unexpected digit after hash token"); - } - - if ((this.hasPlugin("classPrivateProperties") || this.hasPlugin("classPrivateMethods")) && this.state.classLevel > 0) { - ++this.state.pos; - this.finishToken(types.hash); - return; - } else if (this.getPluginOption("pipelineOperator", "proposal") === "smart") { - this.finishOp(types.hash, 1); - } else { - this.raise(this.state.pos, "Unexpected character '#'"); - } - } - - readToken_dot() { - const next = this.input.charCodeAt(this.state.pos + 1); - - if (next >= 48 && next <= 57) { - this.readNumber(true); - return; - } - - const next2 = this.input.charCodeAt(this.state.pos + 2); - - if (next === 46 && next2 === 46) { - this.state.pos += 3; - this.finishToken(types.ellipsis); - } else { - ++this.state.pos; - this.finishToken(types.dot); - } - } - - readToken_slash() { - if (this.state.exprAllowed && !this.state.inType) { - ++this.state.pos; - this.readRegexp(); - return; - } - - const next = this.input.charCodeAt(this.state.pos + 1); - - if (next === 61) { - this.finishOp(types.assign, 2); - } else { - this.finishOp(types.slash, 1); - } - } - - readToken_interpreter() { - if (this.state.pos !== 0 || this.length < 2) return false; - const start = this.state.pos; - this.state.pos += 1; - let ch = this.input.charCodeAt(this.state.pos); - if (ch !== 33) return false; - - while (ch !== 10 && ch !== 13 && ch !== 8232 && ch !== 8233 && ++this.state.pos < this.length) { - ch = this.input.charCodeAt(this.state.pos); - } - - const value = this.input.slice(start + 2, this.state.pos); - this.finishToken(types.interpreterDirective, value); - return true; - } - - readToken_mult_modulo(code) { - let type = code === 42 ? types.star : types.modulo; - let width = 1; - let next = this.input.charCodeAt(this.state.pos + 1); - const exprAllowed = this.state.exprAllowed; - - if (code === 42 && next === 42) { - width++; - next = this.input.charCodeAt(this.state.pos + 2); - type = types.exponent; - } - - if (next === 61 && !exprAllowed) { - width++; - type = types.assign; - } - - this.finishOp(type, width); - } - - readToken_pipe_amp(code) { - const next = this.input.charCodeAt(this.state.pos + 1); - - if (next === code) { - if (this.input.charCodeAt(this.state.pos + 2) === 61) { - this.finishOp(types.assign, 3); - } else { - this.finishOp(code === 124 ? types.logicalOR : types.logicalAND, 2); - } - - return; - } - - if (code === 124) { - if (next === 62) { - this.finishOp(types.pipeline, 2); - return; - } - } - - if (next === 61) { - this.finishOp(types.assign, 2); - return; - } - - this.finishOp(code === 124 ? types.bitwiseOR : types.bitwiseAND, 1); - } - - readToken_caret() { - const next = this.input.charCodeAt(this.state.pos + 1); - - if (next === 61) { - this.finishOp(types.assign, 2); - } else { - this.finishOp(types.bitwiseXOR, 1); - } - } - - readToken_plus_min(code) { - const next = this.input.charCodeAt(this.state.pos + 1); - - if (next === code) { - if (next === 45 && !this.inModule && this.input.charCodeAt(this.state.pos + 2) === 62 && (this.state.lastTokEnd === 0 || lineBreak.test(this.input.slice(this.state.lastTokEnd, this.state.pos)))) { - this.skipLineComment(3); - this.skipSpace(); - this.nextToken(); - return; - } - - this.finishOp(types.incDec, 2); - return; - } - - if (next === 61) { - this.finishOp(types.assign, 2); - } else { - this.finishOp(types.plusMin, 1); - } - } - - readToken_lt_gt(code) { - const next = this.input.charCodeAt(this.state.pos + 1); - let size = 1; - - if (next === code) { - size = code === 62 && this.input.charCodeAt(this.state.pos + 2) === 62 ? 3 : 2; - - if (this.input.charCodeAt(this.state.pos + size) === 61) { - this.finishOp(types.assign, size + 1); - return; - } - - this.finishOp(types.bitShift, size); - return; - } - - if (next === 33 && code === 60 && !this.inModule && this.input.charCodeAt(this.state.pos + 2) === 45 && this.input.charCodeAt(this.state.pos + 3) === 45) { - this.skipLineComment(4); - this.skipSpace(); - this.nextToken(); - return; - } - - if (next === 61) { - size = 2; - } - - this.finishOp(types.relational, size); - } - - readToken_eq_excl(code) { - const next = this.input.charCodeAt(this.state.pos + 1); - - if (next === 61) { - this.finishOp(types.equality, this.input.charCodeAt(this.state.pos + 2) === 61 ? 3 : 2); - return; - } - - if (code === 61 && next === 62) { - this.state.pos += 2; - this.finishToken(types.arrow); - return; - } - - this.finishOp(code === 61 ? types.eq : types.bang, 1); - } - - readToken_question() { - const next = this.input.charCodeAt(this.state.pos + 1); - const next2 = this.input.charCodeAt(this.state.pos + 2); - - if (next === 63 && !this.state.inType) { - if (next2 === 61) { - this.finishOp(types.assign, 3); - } else { - this.finishOp(types.nullishCoalescing, 2); - } - } else if (next === 46 && !(next2 >= 48 && next2 <= 57)) { - this.state.pos += 2; - this.finishToken(types.questionDot); - } else { - ++this.state.pos; - this.finishToken(types.question); - } - } - - getTokenFromCode(code) { - switch (code) { - case 46: - this.readToken_dot(); - return; - - case 40: - ++this.state.pos; - this.finishToken(types.parenL); - return; - - case 41: - ++this.state.pos; - this.finishToken(types.parenR); - return; - - case 59: - ++this.state.pos; - this.finishToken(types.semi); - return; - - case 44: - ++this.state.pos; - this.finishToken(types.comma); - return; - - case 91: - ++this.state.pos; - this.finishToken(types.bracketL); - return; - - case 93: - ++this.state.pos; - this.finishToken(types.bracketR); - return; - - case 123: - ++this.state.pos; - this.finishToken(types.braceL); - return; - - case 125: - ++this.state.pos; - this.finishToken(types.braceR); - return; - - case 58: - if (this.hasPlugin("functionBind") && this.input.charCodeAt(this.state.pos + 1) === 58) { - this.finishOp(types.doubleColon, 2); - } else { - ++this.state.pos; - this.finishToken(types.colon); - } - - return; - - case 63: - this.readToken_question(); - return; - - case 96: - ++this.state.pos; - this.finishToken(types.backQuote); - return; - - case 48: - { - const next = this.input.charCodeAt(this.state.pos + 1); - - if (next === 120 || next === 88) { - this.readRadixNumber(16); - return; - } - - if (next === 111 || next === 79) { - this.readRadixNumber(8); - return; - } - - if (next === 98 || next === 66) { - this.readRadixNumber(2); - return; - } - } - - case 49: - case 50: - case 51: - case 52: - case 53: - case 54: - case 55: - case 56: - case 57: - this.readNumber(false); - return; - - case 34: - case 39: - this.readString(code); - return; - - case 47: - this.readToken_slash(); - return; - - case 37: - case 42: - this.readToken_mult_modulo(code); - return; - - case 124: - case 38: - this.readToken_pipe_amp(code); - return; - - case 94: - this.readToken_caret(); - return; - - case 43: - case 45: - this.readToken_plus_min(code); - return; - - case 60: - case 62: - this.readToken_lt_gt(code); - return; - - case 61: - case 33: - this.readToken_eq_excl(code); - return; - - case 126: - this.finishOp(types.tilde, 1); - return; - - case 64: - ++this.state.pos; - this.finishToken(types.at); - return; - - case 35: - this.readToken_numberSign(); - return; - - case 92: - this.readWord(); - return; - - default: - if (isIdentifierStart(code)) { - this.readWord(); - return; - } - - } - - this.raise(this.state.pos, `Unexpected character '${String.fromCodePoint(code)}'`); - } - - finishOp(type, size) { - const str = this.input.slice(this.state.pos, this.state.pos + size); - this.state.pos += size; - this.finishToken(type, str); - } - - readRegexp() { - const start = this.state.pos; - let escaped, inClass; - - for (;;) { - if (this.state.pos >= this.length) { - this.raise(start, "Unterminated regular expression"); - } - - const ch = this.input.charAt(this.state.pos); - - if (lineBreak.test(ch)) { - this.raise(start, "Unterminated regular expression"); - } - - if (escaped) { - escaped = false; - } else { - if (ch === "[") { - inClass = true; - } else if (ch === "]" && inClass) { - inClass = false; - } else if (ch === "/" && !inClass) { - break; - } - - escaped = ch === "\\"; - } - - ++this.state.pos; - } - - const content = this.input.slice(start, this.state.pos); - ++this.state.pos; - let mods = ""; - - while (this.state.pos < this.length) { - const char = this.input[this.state.pos]; - const charCode = this.input.codePointAt(this.state.pos); - - if (VALID_REGEX_FLAGS.has(char)) { - if (mods.indexOf(char) > -1) { - this.raise(this.state.pos + 1, "Duplicate regular expression flag"); - } - - ++this.state.pos; - mods += char; - } else if (isIdentifierChar(charCode) || charCode === 92) { - this.raise(this.state.pos + 1, "Invalid regular expression flag"); - } else { - break; - } - } - - this.finishToken(types.regexp, { - pattern: content, - flags: mods - }); - } - - readInt(radix, len) { - const start = this.state.pos; - const forbiddenSiblings = radix === 16 ? forbiddenNumericSeparatorSiblings.hex : forbiddenNumericSeparatorSiblings.decBinOct; - const allowedSiblings = radix === 16 ? allowedNumericSeparatorSiblings.hex : radix === 10 ? allowedNumericSeparatorSiblings.dec : radix === 8 ? allowedNumericSeparatorSiblings.oct : allowedNumericSeparatorSiblings.bin; - let total = 0; - - for (let i = 0, e = len == null ? Infinity : len; i < e; ++i) { - const code = this.input.charCodeAt(this.state.pos); - let val; - - if (this.hasPlugin("numericSeparator")) { - const prev = this.input.charCodeAt(this.state.pos - 1); - const next = this.input.charCodeAt(this.state.pos + 1); - - if (code === 95) { - if (allowedSiblings.indexOf(next) === -1) { - this.raise(this.state.pos, "Invalid or unexpected token"); - } - - if (forbiddenSiblings.indexOf(prev) > -1 || forbiddenSiblings.indexOf(next) > -1 || Number.isNaN(next)) { - this.raise(this.state.pos, "Invalid or unexpected token"); - } - - ++this.state.pos; - continue; - } - } - - if (code >= 97) { - val = code - 97 + 10; - } else if (code >= 65) { - val = code - 65 + 10; - } else if (_isDigit(code)) { - val = code - 48; - } else { - val = Infinity; - } - - if (val >= radix) break; - ++this.state.pos; - total = total * radix + val; - } - - if (this.state.pos === start || len != null && this.state.pos - start !== len) { - return null; - } - - return total; - } - - readRadixNumber(radix) { - const start = this.state.pos; - let isBigInt = false; - this.state.pos += 2; - const val = this.readInt(radix); - - if (val == null) { - this.raise(this.state.start + 2, "Expected number in radix " + radix); - } - - if (this.hasPlugin("bigInt")) { - if (this.input.charCodeAt(this.state.pos) === 110) { - ++this.state.pos; - isBigInt = true; - } - } - - if (isIdentifierStart(this.input.codePointAt(this.state.pos))) { - this.raise(this.state.pos, "Identifier directly after number"); - } - - if (isBigInt) { - const str = this.input.slice(start, this.state.pos).replace(/[_n]/g, ""); - this.finishToken(types.bigint, str); - return; - } - - this.finishToken(types.num, val); - } - - readNumber(startsWithDot) { - const start = this.state.pos; - let isFloat = false; - let isBigInt = false; - - if (!startsWithDot && this.readInt(10) === null) { - this.raise(start, "Invalid number"); - } - - let octal = this.state.pos - start >= 2 && this.input.charCodeAt(start) === 48; - - if (octal) { - if (this.state.strict) { - this.raise(start, "Legacy octal literals are not allowed in strict mode"); - } - - if (/[89]/.test(this.input.slice(start, this.state.pos))) { - octal = false; - } - } - - let next = this.input.charCodeAt(this.state.pos); - - if (next === 46 && !octal) { - ++this.state.pos; - this.readInt(10); - isFloat = true; - next = this.input.charCodeAt(this.state.pos); - } - - if ((next === 69 || next === 101) && !octal) { - next = this.input.charCodeAt(++this.state.pos); - - if (next === 43 || next === 45) { - ++this.state.pos; - } - - if (this.readInt(10) === null) this.raise(start, "Invalid number"); - isFloat = true; - next = this.input.charCodeAt(this.state.pos); - } - - if (this.hasPlugin("bigInt")) { - if (next === 110) { - if (isFloat || octal) this.raise(start, "Invalid BigIntLiteral"); - ++this.state.pos; - isBigInt = true; - } - } - - if (isIdentifierStart(this.input.codePointAt(this.state.pos))) { - this.raise(this.state.pos, "Identifier directly after number"); - } - - const str = this.input.slice(start, this.state.pos).replace(/[_n]/g, ""); - - if (isBigInt) { - this.finishToken(types.bigint, str); - return; - } - - const val = octal ? parseInt(str, 8) : parseFloat(str); - this.finishToken(types.num, val); - } - - readCodePoint(throwOnInvalid) { - const ch = this.input.charCodeAt(this.state.pos); - let code; - - if (ch === 123) { - const codePos = ++this.state.pos; - code = this.readHexChar(this.input.indexOf("}", this.state.pos) - this.state.pos, throwOnInvalid); - ++this.state.pos; - - if (code === null) { - --this.state.invalidTemplateEscapePosition; - } else if (code > 0x10ffff) { - if (throwOnInvalid) { - this.raise(codePos, "Code point out of bounds"); - } else { - this.state.invalidTemplateEscapePosition = codePos - 2; - return null; - } - } - } else { - code = this.readHexChar(4, throwOnInvalid); - } - - return code; - } - - readString(quote) { - let out = "", - chunkStart = ++this.state.pos; - - for (;;) { - if (this.state.pos >= this.length) { - this.raise(this.state.start, "Unterminated string constant"); - } - - const ch = this.input.charCodeAt(this.state.pos); - if (ch === quote) break; - - if (ch === 92) { - out += this.input.slice(chunkStart, this.state.pos); - out += this.readEscapedChar(false); - chunkStart = this.state.pos; - } else if (ch === 8232 || ch === 8233) { - ++this.state.pos; - ++this.state.curLine; - } else if (isNewLine(ch)) { - this.raise(this.state.start, "Unterminated string constant"); - } else { - ++this.state.pos; - } - } - - out += this.input.slice(chunkStart, this.state.pos++); - this.finishToken(types.string, out); - } - - readTmplToken() { - let out = "", - chunkStart = this.state.pos, - containsInvalid = false; - - for (;;) { - if (this.state.pos >= this.length) { - this.raise(this.state.start, "Unterminated template"); - } - - const ch = this.input.charCodeAt(this.state.pos); - - if (ch === 96 || ch === 36 && this.input.charCodeAt(this.state.pos + 1) === 123) { - if (this.state.pos === this.state.start && this.match(types.template)) { - if (ch === 36) { - this.state.pos += 2; - this.finishToken(types.dollarBraceL); - return; - } else { - ++this.state.pos; - this.finishToken(types.backQuote); - return; - } - } - - out += this.input.slice(chunkStart, this.state.pos); - this.finishToken(types.template, containsInvalid ? null : out); - return; - } - - if (ch === 92) { - out += this.input.slice(chunkStart, this.state.pos); - const escaped = this.readEscapedChar(true); - - if (escaped === null) { - containsInvalid = true; - } else { - out += escaped; - } - - chunkStart = this.state.pos; - } else if (isNewLine(ch)) { - out += this.input.slice(chunkStart, this.state.pos); - ++this.state.pos; - - switch (ch) { - case 13: - if (this.input.charCodeAt(this.state.pos) === 10) { - ++this.state.pos; - } - - case 10: - out += "\n"; - break; - - default: - out += String.fromCharCode(ch); - break; - } - - ++this.state.curLine; - this.state.lineStart = this.state.pos; - chunkStart = this.state.pos; - } else { - ++this.state.pos; - } - } - } - - readEscapedChar(inTemplate) { - const throwOnInvalid = !inTemplate; - const ch = this.input.charCodeAt(++this.state.pos); - ++this.state.pos; - - switch (ch) { - case 110: - return "\n"; - - case 114: - return "\r"; - - case 120: - { - const code = this.readHexChar(2, throwOnInvalid); - return code === null ? null : String.fromCharCode(code); - } - - case 117: - { - const code = this.readCodePoint(throwOnInvalid); - return code === null ? null : String.fromCodePoint(code); - } - - case 116: - return "\t"; - - case 98: - return "\b"; - - case 118: - return "\u000b"; - - case 102: - return "\f"; - - case 13: - if (this.input.charCodeAt(this.state.pos) === 10) { - ++this.state.pos; - } - - case 10: - this.state.lineStart = this.state.pos; - ++this.state.curLine; - - case 8232: - case 8233: - return ""; - - default: - if (ch >= 48 && ch <= 55) { - const codePos = this.state.pos - 1; - let octalStr = this.input.substr(this.state.pos - 1, 3).match(/^[0-7]+/)[0]; - let octal = parseInt(octalStr, 8); - - if (octal > 255) { - octalStr = octalStr.slice(0, -1); - octal = parseInt(octalStr, 8); - } - - this.state.pos += octalStr.length - 1; - const next = this.input.charCodeAt(this.state.pos); - - if (octalStr !== "0" || next === 56 || next === 57) { - if (inTemplate) { - this.state.invalidTemplateEscapePosition = codePos; - return null; - } else if (this.state.strict) { - this.raise(codePos, "Octal literal in strict mode"); - } else if (!this.state.containsOctal) { - this.state.containsOctal = true; - this.state.octalPosition = codePos; - } - } - - return String.fromCharCode(octal); - } - - return String.fromCharCode(ch); - } - } - - readHexChar(len, throwOnInvalid) { - const codePos = this.state.pos; - const n = this.readInt(16, len); - - if (n === null) { - if (throwOnInvalid) { - this.raise(codePos, "Bad character escape sequence"); - } else { - this.state.pos = codePos - 1; - this.state.invalidTemplateEscapePosition = codePos - 1; - } - } - - return n; - } - - readWord1() { - let word = ""; - this.state.containsEsc = false; - const start = this.state.pos; - let chunkStart = this.state.pos; - - while (this.state.pos < this.length) { - const ch = this.input.codePointAt(this.state.pos); - - if (isIdentifierChar(ch)) { - this.state.pos += ch <= 0xffff ? 1 : 2; - } else if (this.state.isIterator && ch === 64) { - ++this.state.pos; - } else if (ch === 92) { - this.state.containsEsc = true; - word += this.input.slice(chunkStart, this.state.pos); - const escStart = this.state.pos; - const identifierCheck = this.state.pos === start ? isIdentifierStart : isIdentifierChar; - - if (this.input.charCodeAt(++this.state.pos) !== 117) { - this.raise(this.state.pos, "Expecting Unicode escape sequence \\uXXXX"); - } - - ++this.state.pos; - const esc = this.readCodePoint(true); - - if (!identifierCheck(esc, true)) { - this.raise(escStart, "Invalid Unicode escape"); - } - - word += String.fromCodePoint(esc); - chunkStart = this.state.pos; - } else { - break; - } - } - - return word + this.input.slice(chunkStart, this.state.pos); - } - - isIterator(word) { - return word === "@@iterator" || word === "@@asyncIterator"; - } - - readWord() { - const word = this.readWord1(); - const type = keywords.get(word) || types.name; - - if (type.keyword && this.state.containsEsc) { - this.raise(this.state.pos, `Escape sequence in keyword ${word}`); - } - - if (this.state.isIterator && (!this.isIterator(word) || !this.state.inType)) { - this.raise(this.state.pos, `Invalid identifier ${word}`); - } - - this.finishToken(type, word); - } - - braceIsBlock(prevType) { - const parent = this.curContext(); - - if (parent === types$1.functionExpression || parent === types$1.functionStatement) { - return true; - } - - if (prevType === types.colon && (parent === types$1.braceStatement || parent === types$1.braceExpression)) { - return !parent.isExpr; - } - - if (prevType === types._return || prevType === types.name && this.state.exprAllowed) { - return lineBreak.test(this.input.slice(this.state.lastTokEnd, this.state.start)); - } - - if (prevType === types._else || prevType === types.semi || prevType === types.eof || prevType === types.parenR || prevType === types.arrow) { - return true; - } - - if (prevType === types.braceL) { - return parent === types$1.braceStatement; - } - - if (prevType === types._var || prevType === types._const || prevType === types.name) { - return false; - } - - if (prevType === types.relational) { - return true; - } - - return !this.state.exprAllowed; - } - - updateContext(prevType) { - const type = this.state.type; - let update; - - if (type.keyword && (prevType === types.dot || prevType === types.questionDot)) { - this.state.exprAllowed = false; - } else if (update = type.updateContext) { - update.call(this, prevType); - } else { - this.state.exprAllowed = type.beforeExpr; - } - } - -} - -const literal = /^('|")((?:\\?.)*?)\1/; -class UtilParser extends Tokenizer { - addExtra(node, key, val) { - if (!node) return; - const extra = node.extra = node.extra || {}; - extra[key] = val; - } - - isRelational(op) { - return this.match(types.relational) && this.state.value === op; - } - - isLookaheadRelational(op) { - const l = this.lookahead(); - return l.type === types.relational && l.value === op; - } - - expectRelational(op) { - if (this.isRelational(op)) { - this.next(); - } else { - this.unexpected(null, types.relational); - } - } - - eatRelational(op) { - if (this.isRelational(op)) { - this.next(); - return true; - } - - return false; - } - - isContextual(name) { - return this.match(types.name) && this.state.value === name && !this.state.containsEsc; - } - - isLookaheadContextual(name) { - const l = this.lookahead(); - return l.type === types.name && l.value === name; - } - - eatContextual(name) { - return this.isContextual(name) && this.eat(types.name); - } - - expectContextual(name, message) { - if (!this.eatContextual(name)) this.unexpected(null, message); - } - - canInsertSemicolon() { - return this.match(types.eof) || this.match(types.braceR) || this.hasPrecedingLineBreak(); - } - - hasPrecedingLineBreak() { - return lineBreak.test(this.input.slice(this.state.lastTokEnd, this.state.start)); - } - - isLineTerminator() { - return this.eat(types.semi) || this.canInsertSemicolon(); - } - - semicolon() { - if (!this.isLineTerminator()) this.unexpected(null, types.semi); - } - - expect(type, pos) { - this.eat(type) || this.unexpected(pos, type); - } - - assertNoSpace(message = "Unexpected space.") { - if (this.state.start > this.state.lastTokEnd) { - this.raise(this.state.lastTokEnd, message); - } - } - - unexpected(pos, messageOrType = "Unexpected token") { - if (typeof messageOrType !== "string") { - messageOrType = `Unexpected token, expected "${messageOrType.label}"`; - } - - throw this.raise(pos != null ? pos : this.state.start, messageOrType); - } - - expectPlugin(name, pos) { - if (!this.hasPlugin(name)) { - throw this.raise(pos != null ? pos : this.state.start, `This experimental syntax requires enabling the parser plugin: '${name}'`, { - missingPluginNames: [name] - }); - } - - return true; - } - - expectOnePlugin(names, pos) { - if (!names.some(n => this.hasPlugin(n))) { - throw this.raise(pos != null ? pos : this.state.start, `This experimental syntax requires enabling one of the following parser plugin(s): '${names.join(", ")}'`, { - missingPluginNames: names - }); - } - } - - checkYieldAwaitInDefaultParams() { - if (this.state.yieldPos && (!this.state.awaitPos || this.state.yieldPos < this.state.awaitPos)) { - this.raise(this.state.yieldPos, "Yield cannot be used as name inside a generator function"); - } - - if (this.state.awaitPos) { - this.raise(this.state.awaitPos, "Await cannot be used as name inside an async function"); - } - } - - strictDirective(start) { - for (;;) { - skipWhiteSpace.lastIndex = start; - start += skipWhiteSpace.exec(this.input)[0].length; - const match = literal.exec(this.input.slice(start)); - if (!match) break; - if (match[2] === "use strict") return true; - start += match[0].length; - skipWhiteSpace.lastIndex = start; - start += skipWhiteSpace.exec(this.input)[0].length; - - if (this.input[start] === ";") { - start++; - } - } - - return false; - } - -} - -class Node { - constructor(parser, pos, loc) { - this.type = ""; - this.start = pos; - this.end = 0; - this.loc = new SourceLocation(loc); - if (parser && parser.options.ranges) this.range = [pos, 0]; - if (parser && parser.filename) this.loc.filename = parser.filename; - } - - __clone() { - const newNode = new Node(); - const keys = Object.keys(this); - - for (let i = 0, length = keys.length; i < length; i++) { - const key = keys[i]; - - if (key !== "leadingComments" && key !== "trailingComments" && key !== "innerComments") { - newNode[key] = this[key]; - } - } - - return newNode; - } - -} - -class NodeUtils extends UtilParser { - startNode() { - return new Node(this, this.state.start, this.state.startLoc); - } - - startNodeAt(pos, loc) { - return new Node(this, pos, loc); - } - - startNodeAtNode(type) { - return this.startNodeAt(type.start, type.loc.start); - } - - finishNode(node, type) { - return this.finishNodeAt(node, type, this.state.lastTokEnd, this.state.lastTokEndLoc); - } - - finishNodeAt(node, type, pos, loc) { - - node.type = type; - node.end = pos; - node.loc.end = loc; - if (this.options.ranges) node.range[1] = pos; - this.processComment(node); - return node; - } - - resetStartLocation(node, start, startLoc) { - node.start = start; - node.loc.start = startLoc; - if (this.options.ranges) node.range[0] = start; - } - - resetEndLocation(node, end = this.state.lastTokEnd, endLoc = this.state.lastTokEndLoc) { - node.end = end; - node.loc.end = endLoc; - if (this.options.ranges) node.range[1] = end; - } - - resetStartLocationFromNode(node, locationNode) { - this.resetStartLocation(node, locationNode.start, locationNode.loc.start); - } - -} - -class LValParser extends NodeUtils { - toAssignable(node, isBinding, contextDescription) { - if (node) { - switch (node.type) { - case "Identifier": - case "ObjectPattern": - case "ArrayPattern": - case "AssignmentPattern": - break; - - case "ObjectExpression": - node.type = "ObjectPattern"; - - for (let i = 0, length = node.properties.length, last = length - 1; i < length; i++) { - const prop = node.properties[i]; - const isLast = i === last; - this.toAssignableObjectExpressionProp(prop, isBinding, isLast); - } - - break; - - case "ObjectProperty": - this.toAssignable(node.value, isBinding, contextDescription); - break; - - case "SpreadElement": - { - this.checkToRestConversion(node); - node.type = "RestElement"; - const arg = node.argument; - this.toAssignable(arg, isBinding, contextDescription); - break; - } - - case "ArrayExpression": - node.type = "ArrayPattern"; - this.toAssignableList(node.elements, isBinding, contextDescription); - break; - - case "AssignmentExpression": - if (node.operator === "=") { - node.type = "AssignmentPattern"; - delete node.operator; - } else { - this.raise(node.left.end, "Only '=' operator can be used for specifying default value."); - } - - break; - - case "ParenthesizedExpression": - node.expression = this.toAssignable(node.expression, isBinding, contextDescription); - break; - - case "MemberExpression": - if (!isBinding) break; - - default: - { - const message = "Invalid left-hand side" + (contextDescription ? " in " + contextDescription : "expression"); - this.raise(node.start, message); - } - } - } - - return node; - } - - toAssignableObjectExpressionProp(prop, isBinding, isLast) { - if (prop.type === "ObjectMethod") { - const error = prop.kind === "get" || prop.kind === "set" ? "Object pattern can't contain getter or setter" : "Object pattern can't contain methods"; - this.raise(prop.key.start, error); - } else if (prop.type === "SpreadElement" && !isLast) { - this.raiseRestNotLast(prop.start); - } else { - this.toAssignable(prop, isBinding, "object destructuring pattern"); - } - } - - toAssignableList(exprList, isBinding, contextDescription) { - let end = exprList.length; - - if (end) { - const last = exprList[end - 1]; - - if (last && last.type === "RestElement") { - --end; - } else if (last && last.type === "SpreadElement") { - last.type = "RestElement"; - const arg = last.argument; - this.toAssignable(arg, isBinding, contextDescription); - - if (arg.type !== "Identifier" && arg.type !== "MemberExpression" && arg.type !== "ArrayPattern" && arg.type !== "ObjectPattern") { - this.unexpected(arg.start); - } - - --end; - } - } - - for (let i = 0; i < end; i++) { - const elt = exprList[i]; - - if (elt) { - this.toAssignable(elt, isBinding, contextDescription); - - if (elt.type === "RestElement") { - this.raiseRestNotLast(elt.start); - } - } - } - - return exprList; - } - - toReferencedList(exprList, isParenthesizedExpr) { - return exprList; - } - - toReferencedListDeep(exprList, isParenthesizedExpr) { - this.toReferencedList(exprList, isParenthesizedExpr); - - for (let _i = 0; _i < exprList.length; _i++) { - const expr = exprList[_i]; - - if (expr && expr.type === "ArrayExpression") { - this.toReferencedListDeep(expr.elements); - } - } - - return exprList; - } - - parseSpread(refShorthandDefaultPos, refNeedsArrowPos) { - const node = this.startNode(); - this.next(); - node.argument = this.parseMaybeAssign(false, refShorthandDefaultPos, undefined, refNeedsArrowPos); - - if (this.state.commaAfterSpreadAt === -1 && this.match(types.comma)) { - this.state.commaAfterSpreadAt = this.state.start; - } - - return this.finishNode(node, "SpreadElement"); - } - - parseRestBinding() { - const node = this.startNode(); - this.next(); - node.argument = this.parseBindingAtom(); - return this.finishNode(node, "RestElement"); - } - - parseBindingAtom() { - switch (this.state.type) { - case types.bracketL: - { - const node = this.startNode(); - this.next(); - node.elements = this.parseBindingList(types.bracketR, true); - return this.finishNode(node, "ArrayPattern"); - } - - case types.braceL: - return this.parseObj(true); - } - - return this.parseIdentifier(); - } - - parseBindingList(close, allowEmpty, allowModifiers) { - const elts = []; - let first = true; - - while (!this.eat(close)) { - if (first) { - first = false; - } else { - this.expect(types.comma); - } - - if (allowEmpty && this.match(types.comma)) { - elts.push(null); - } else if (this.eat(close)) { - break; - } else if (this.match(types.ellipsis)) { - elts.push(this.parseAssignableListItemTypes(this.parseRestBinding())); - this.checkCommaAfterRest(); - this.expect(close); - break; - } else { - const decorators = []; - - if (this.match(types.at) && this.hasPlugin("decorators")) { - this.raise(this.state.start, "Stage 2 decorators cannot be used to decorate parameters"); - } - - while (this.match(types.at)) { - decorators.push(this.parseDecorator()); - } - - elts.push(this.parseAssignableListItem(allowModifiers, decorators)); - } - } - - return elts; - } - - parseAssignableListItem(allowModifiers, decorators) { - const left = this.parseMaybeDefault(); - this.parseAssignableListItemTypes(left); - const elt = this.parseMaybeDefault(left.start, left.loc.start, left); - - if (decorators.length) { - left.decorators = decorators; - } - - return elt; - } - - parseAssignableListItemTypes(param) { - return param; - } - - parseMaybeDefault(startPos, startLoc, left) { - startLoc = startLoc || this.state.startLoc; - startPos = startPos || this.state.start; - left = left || this.parseBindingAtom(); - if (!this.eat(types.eq)) return left; - const node = this.startNodeAt(startPos, startLoc); - node.left = left; - node.right = this.parseMaybeAssign(); - return this.finishNode(node, "AssignmentPattern"); - } - - checkLVal(expr, bindingType = BIND_NONE, checkClashes, contextDescription) { - switch (expr.type) { - case "Identifier": - if (this.state.strict && isStrictBindReservedWord(expr.name, this.inModule)) { - this.raise(expr.start, `${bindingType === BIND_NONE ? "Assigning to" : "Binding"} '${expr.name}' in strict mode`); - } - - if (checkClashes) { - const key = `_${expr.name}`; - - if (checkClashes[key]) { - this.raise(expr.start, "Argument name clash"); - } else { - checkClashes[key] = true; - } - } - - if (bindingType === BIND_LEXICAL && expr.name === "let") { - this.raise(expr.start, "'let' is not allowed to be used as a name in 'let' or 'const' declarations."); - } - - if (!(bindingType & BIND_NONE)) { - this.scope.declareName(expr.name, bindingType, expr.start); - } - - break; - - case "MemberExpression": - if (bindingType !== BIND_NONE) { - this.raise(expr.start, "Binding member expression"); - } - - break; - - case "ObjectPattern": - for (let _i2 = 0, _expr$properties = expr.properties; _i2 < _expr$properties.length; _i2++) { - let prop = _expr$properties[_i2]; - if (prop.type === "ObjectProperty") prop = prop.value; - this.checkLVal(prop, bindingType, checkClashes, "object destructuring pattern"); - } - - break; - - case "ArrayPattern": - for (let _i3 = 0, _expr$elements = expr.elements; _i3 < _expr$elements.length; _i3++) { - const elem = _expr$elements[_i3]; - - if (elem) { - this.checkLVal(elem, bindingType, checkClashes, "array destructuring pattern"); - } - } - - break; - - case "AssignmentPattern": - this.checkLVal(expr.left, bindingType, checkClashes, "assignment pattern"); - break; - - case "RestElement": - this.checkLVal(expr.argument, bindingType, checkClashes, "rest element"); - break; - - case "ParenthesizedExpression": - this.checkLVal(expr.expression, bindingType, checkClashes, "parenthesized expression"); - break; - - default: - { - const message = (bindingType === BIND_NONE ? "Invalid" : "Binding invalid") + " left-hand side" + (contextDescription ? " in " + contextDescription : "expression"); - this.raise(expr.start, message); - } - } - } - - checkToRestConversion(node) { - if (node.argument.type !== "Identifier" && node.argument.type !== "MemberExpression") { - this.raise(node.argument.start, "Invalid rest operator's argument"); - } - } - - checkCommaAfterRest() { - if (this.match(types.comma)) { - this.raiseRestNotLast(this.state.start); - } - } - - checkCommaAfterRestFromSpread() { - if (this.state.commaAfterSpreadAt > -1) { - this.raiseRestNotLast(this.state.commaAfterSpreadAt); - } - } - - raiseRestNotLast(pos) { - this.raise(pos, `Rest element must be last element`); - } - -} - -const unwrapParenthesizedExpression = node => { - return node.type === "ParenthesizedExpression" ? unwrapParenthesizedExpression(node.expression) : node; -}; - -class ExpressionParser extends LValParser { - checkPropClash(prop, propHash) { - if (prop.type === "SpreadElement" || prop.computed || prop.kind || prop.shorthand) { - return; - } - - const key = prop.key; - const name = key.type === "Identifier" ? key.name : String(key.value); - - if (name === "__proto__") { - if (propHash.proto) { - this.raise(key.start, "Redefinition of __proto__ property"); - } - - propHash.proto = true; - } - } - - getExpression() { - this.scope.enter(SCOPE_PROGRAM); - this.nextToken(); - const expr = this.parseExpression(); - - if (!this.match(types.eof)) { - this.unexpected(); - } - - expr.comments = this.state.comments; - return expr; - } - - parseExpression(noIn, refShorthandDefaultPos) { - const startPos = this.state.start; - const startLoc = this.state.startLoc; - const expr = this.parseMaybeAssign(noIn, refShorthandDefaultPos); - - if (this.match(types.comma)) { - const node = this.startNodeAt(startPos, startLoc); - node.expressions = [expr]; - - while (this.eat(types.comma)) { - node.expressions.push(this.parseMaybeAssign(noIn, refShorthandDefaultPos)); - } - - this.toReferencedList(node.expressions); - return this.finishNode(node, "SequenceExpression"); - } - - return expr; - } - - parseMaybeAssign(noIn, refShorthandDefaultPos, afterLeftParse, refNeedsArrowPos) { - const startPos = this.state.start; - const startLoc = this.state.startLoc; - - if (this.isContextual("yield")) { - if (this.scope.inGenerator) { - let left = this.parseYield(noIn); - - if (afterLeftParse) { - left = afterLeftParse.call(this, left, startPos, startLoc); - } - - return left; - } else { - this.state.exprAllowed = false; - } - } - - const oldCommaAfterSpreadAt = this.state.commaAfterSpreadAt; - this.state.commaAfterSpreadAt = -1; - let failOnShorthandAssign; - - if (refShorthandDefaultPos) { - failOnShorthandAssign = false; - } else { - refShorthandDefaultPos = { - start: 0 - }; - failOnShorthandAssign = true; - } - - if (this.match(types.parenL) || this.match(types.name)) { - this.state.potentialArrowAt = this.state.start; - } - - let left = this.parseMaybeConditional(noIn, refShorthandDefaultPos, refNeedsArrowPos); - - if (afterLeftParse) { - left = afterLeftParse.call(this, left, startPos, startLoc); - } - - if (this.state.type.isAssign) { - const node = this.startNodeAt(startPos, startLoc); - const operator = this.state.value; - node.operator = operator; - - if (operator === "??=") { - this.expectPlugin("nullishCoalescingOperator"); - this.expectPlugin("logicalAssignment"); - } - - if (operator === "||=" || operator === "&&=") { - this.expectPlugin("logicalAssignment"); - } - - node.left = this.match(types.eq) ? this.toAssignable(left, undefined, "assignment expression") : left; - refShorthandDefaultPos.start = 0; - this.checkLVal(left, undefined, undefined, "assignment expression"); - const maybePattern = unwrapParenthesizedExpression(left); - let patternErrorMsg; - - if (maybePattern.type === "ObjectPattern") { - patternErrorMsg = "`({a}) = 0` use `({a} = 0)`"; - } else if (maybePattern.type === "ArrayPattern") { - patternErrorMsg = "`([a]) = 0` use `([a] = 0)`"; - } - - if (patternErrorMsg && (left.extra && left.extra.parenthesized || left.type === "ParenthesizedExpression")) { - this.raise(maybePattern.start, `You're trying to assign to a parenthesized expression, eg. instead of ${patternErrorMsg}`); - } - - if (patternErrorMsg) this.checkCommaAfterRestFromSpread(); - this.state.commaAfterSpreadAt = oldCommaAfterSpreadAt; - this.next(); - node.right = this.parseMaybeAssign(noIn); - return this.finishNode(node, "AssignmentExpression"); - } else if (failOnShorthandAssign && refShorthandDefaultPos.start) { - this.unexpected(refShorthandDefaultPos.start); - } - - this.state.commaAfterSpreadAt = oldCommaAfterSpreadAt; - return left; - } - - parseMaybeConditional(noIn, refShorthandDefaultPos, refNeedsArrowPos) { - const startPos = this.state.start; - const startLoc = this.state.startLoc; - const potentialArrowAt = this.state.potentialArrowAt; - const expr = this.parseExprOps(noIn, refShorthandDefaultPos); - - if (expr.type === "ArrowFunctionExpression" && expr.start === potentialArrowAt) { - return expr; - } - - if (refShorthandDefaultPos && refShorthandDefaultPos.start) return expr; - return this.parseConditional(expr, noIn, startPos, startLoc, refNeedsArrowPos); - } - - parseConditional(expr, noIn, startPos, startLoc, refNeedsArrowPos) { - if (this.eat(types.question)) { - const node = this.startNodeAt(startPos, startLoc); - node.test = expr; - node.consequent = this.parseMaybeAssign(); - this.expect(types.colon); - node.alternate = this.parseMaybeAssign(noIn); - return this.finishNode(node, "ConditionalExpression"); - } - - return expr; - } - - parseExprOps(noIn, refShorthandDefaultPos) { - const startPos = this.state.start; - const startLoc = this.state.startLoc; - const potentialArrowAt = this.state.potentialArrowAt; - const expr = this.parseMaybeUnary(refShorthandDefaultPos); - - if (expr.type === "ArrowFunctionExpression" && expr.start === potentialArrowAt) { - return expr; - } - - if (refShorthandDefaultPos && refShorthandDefaultPos.start) { - return expr; - } - - return this.parseExprOp(expr, startPos, startLoc, -1, noIn); - } - - parseExprOp(left, leftStartPos, leftStartLoc, minPrec, noIn) { - const prec = this.state.type.binop; - - if (prec != null && (!noIn || !this.match(types._in))) { - if (prec > minPrec) { - const operator = this.state.value; - - if (operator === "|>" && this.state.inFSharpPipelineDirectBody) { - return left; - } - - const node = this.startNodeAt(leftStartPos, leftStartLoc); - node.left = left; - node.operator = operator; - - if (operator === "**" && left.type === "UnaryExpression" && (this.options.createParenthesizedExpressions || !(left.extra && left.extra.parenthesized))) { - this.raise(left.argument.start, "Illegal expression. Wrap left hand side or entire exponentiation in parentheses."); - } - - const op = this.state.type; - - if (op === types.pipeline) { - this.expectPlugin("pipelineOperator"); - this.state.inPipeline = true; - this.checkPipelineAtInfixOperator(left, leftStartPos); - } else if (op === types.nullishCoalescing) { - this.expectPlugin("nullishCoalescingOperator"); - } - - this.next(); - - if (op === types.pipeline && this.getPluginOption("pipelineOperator", "proposal") === "minimal") { - if (this.match(types.name) && this.state.value === "await" && this.scope.inAsync) { - throw this.raise(this.state.start, `Unexpected "await" after pipeline body; await must have parentheses in minimal proposal`); - } - } - - node.right = this.parseExprOpRightExpr(op, prec, noIn); - this.finishNode(node, op === types.logicalOR || op === types.logicalAND || op === types.nullishCoalescing ? "LogicalExpression" : "BinaryExpression"); - return this.parseExprOp(node, leftStartPos, leftStartLoc, minPrec, noIn); - } - } - - return left; - } - - parseExprOpRightExpr(op, prec, noIn) { - const startPos = this.state.start; - const startLoc = this.state.startLoc; - - switch (op) { - case types.pipeline: - switch (this.getPluginOption("pipelineOperator", "proposal")) { - case "smart": - return this.withTopicPermittingContext(() => { - return this.parseSmartPipelineBody(this.parseExprOpBaseRightExpr(op, prec, noIn), startPos, startLoc); - }); - - case "fsharp": - return this.withSoloAwaitPermittingContext(() => { - return this.parseFSharpPipelineBody(prec, noIn); - }); - } - - default: - return this.parseExprOpBaseRightExpr(op, prec, noIn); - } - } - - parseExprOpBaseRightExpr(op, prec, noIn) { - const startPos = this.state.start; - const startLoc = this.state.startLoc; - return this.parseExprOp(this.parseMaybeUnary(), startPos, startLoc, op.rightAssociative ? prec - 1 : prec, noIn); - } - - parseMaybeUnary(refShorthandDefaultPos) { - if (this.isContextual("await") && (this.scope.inAsync || !this.scope.inFunction && this.options.allowAwaitOutsideFunction)) { - return this.parseAwait(); - } else if (this.state.type.prefix) { - const node = this.startNode(); - const update = this.match(types.incDec); - node.operator = this.state.value; - node.prefix = true; - - if (node.operator === "throw") { - this.expectPlugin("throwExpressions"); - } - - this.next(); - node.argument = this.parseMaybeUnary(); - - if (refShorthandDefaultPos && refShorthandDefaultPos.start) { - this.unexpected(refShorthandDefaultPos.start); - } - - if (update) { - this.checkLVal(node.argument, undefined, undefined, "prefix operation"); - } else if (this.state.strict && node.operator === "delete") { - const arg = node.argument; - - if (arg.type === "Identifier") { - this.raise(node.start, "Deleting local variable in strict mode"); - } else if (arg.type === "MemberExpression" && arg.property.type === "PrivateName") { - this.raise(node.start, "Deleting a private field is not allowed"); - } - } - - return this.finishNode(node, update ? "UpdateExpression" : "UnaryExpression"); - } - - const startPos = this.state.start; - const startLoc = this.state.startLoc; - let expr = this.parseExprSubscripts(refShorthandDefaultPos); - if (refShorthandDefaultPos && refShorthandDefaultPos.start) return expr; - - while (this.state.type.postfix && !this.canInsertSemicolon()) { - const node = this.startNodeAt(startPos, startLoc); - node.operator = this.state.value; - node.prefix = false; - node.argument = expr; - this.checkLVal(expr, undefined, undefined, "postfix operation"); - this.next(); - expr = this.finishNode(node, "UpdateExpression"); - } - - return expr; - } - - parseExprSubscripts(refShorthandDefaultPos) { - const startPos = this.state.start; - const startLoc = this.state.startLoc; - const potentialArrowAt = this.state.potentialArrowAt; - const expr = this.parseExprAtom(refShorthandDefaultPos); - - if (expr.type === "ArrowFunctionExpression" && expr.start === potentialArrowAt) { - return expr; - } - - if (refShorthandDefaultPos && refShorthandDefaultPos.start) { - return expr; - } - - return this.parseSubscripts(expr, startPos, startLoc); - } - - parseSubscripts(base, startPos, startLoc, noCalls) { - const maybeAsyncArrow = this.atPossibleAsync(base); - const state = { - optionalChainMember: false, - stop: false - }; - - do { - base = this.parseSubscript(base, startPos, startLoc, noCalls, state, maybeAsyncArrow); - } while (!state.stop); - - return base; - } - - parseSubscript(base, startPos, startLoc, noCalls, state, maybeAsyncArrow) { - if (!noCalls && this.eat(types.doubleColon)) { - const node = this.startNodeAt(startPos, startLoc); - node.object = base; - node.callee = this.parseNoCallExpr(); - state.stop = true; - return this.parseSubscripts(this.finishNode(node, "BindExpression"), startPos, startLoc, noCalls); - } else if (this.match(types.questionDot)) { - this.expectPlugin("optionalChaining"); - state.optionalChainMember = true; - - if (noCalls && this.lookahead().type === types.parenL) { - state.stop = true; - return base; - } - - this.next(); - const node = this.startNodeAt(startPos, startLoc); - - if (this.eat(types.bracketL)) { - node.object = base; - node.property = this.parseExpression(); - node.computed = true; - node.optional = true; - this.expect(types.bracketR); - return this.finishNode(node, "OptionalMemberExpression"); - } else if (this.eat(types.parenL)) { - node.callee = base; - node.arguments = this.parseCallExpressionArguments(types.parenR, false); - node.optional = true; - return this.finishNode(node, "OptionalCallExpression"); - } else { - node.object = base; - node.property = this.parseIdentifier(true); - node.computed = false; - node.optional = true; - return this.finishNode(node, "OptionalMemberExpression"); - } - } else if (this.eat(types.dot)) { - const node = this.startNodeAt(startPos, startLoc); - node.object = base; - node.property = this.parseMaybePrivateName(); - node.computed = false; - - if (state.optionalChainMember) { - node.optional = false; - return this.finishNode(node, "OptionalMemberExpression"); - } - - return this.finishNode(node, "MemberExpression"); - } else if (this.eat(types.bracketL)) { - const node = this.startNodeAt(startPos, startLoc); - node.object = base; - node.property = this.parseExpression(); - node.computed = true; - this.expect(types.bracketR); - - if (state.optionalChainMember) { - node.optional = false; - return this.finishNode(node, "OptionalMemberExpression"); - } - - return this.finishNode(node, "MemberExpression"); - } else if (!noCalls && this.match(types.parenL)) { - const oldMaybeInArrowParameters = this.state.maybeInArrowParameters; - const oldYieldPos = this.state.yieldPos; - const oldAwaitPos = this.state.awaitPos; - this.state.maybeInArrowParameters = true; - this.state.yieldPos = 0; - this.state.awaitPos = 0; - this.next(); - let node = this.startNodeAt(startPos, startLoc); - node.callee = base; - const oldCommaAfterSpreadAt = this.state.commaAfterSpreadAt; - this.state.commaAfterSpreadAt = -1; - node.arguments = this.parseCallExpressionArguments(types.parenR, maybeAsyncArrow, base.type === "Import", base.type !== "Super"); - - if (!state.optionalChainMember) { - this.finishCallExpression(node); - } else { - this.finishOptionalCallExpression(node); - } - - if (maybeAsyncArrow && this.shouldParseAsyncArrow()) { - state.stop = true; - this.checkCommaAfterRestFromSpread(); - node = this.parseAsyncArrowFromCallExpression(this.startNodeAt(startPos, startLoc), node); - this.checkYieldAwaitInDefaultParams(); - this.state.yieldPos = oldYieldPos; - this.state.awaitPos = oldAwaitPos; - } else { - this.toReferencedListDeep(node.arguments); - this.state.yieldPos = oldYieldPos || this.state.yieldPos; - this.state.awaitPos = oldAwaitPos || this.state.awaitPos; - } - - this.state.maybeInArrowParameters = oldMaybeInArrowParameters; - this.state.commaAfterSpreadAt = oldCommaAfterSpreadAt; - return node; - } else if (this.match(types.backQuote)) { - return this.parseTaggedTemplateExpression(startPos, startLoc, base, state); - } else { - state.stop = true; - return base; - } - } - - parseTaggedTemplateExpression(startPos, startLoc, base, state, typeArguments) { - const node = this.startNodeAt(startPos, startLoc); - node.tag = base; - node.quasi = this.parseTemplate(true); - if (typeArguments) node.typeParameters = typeArguments; - - if (state.optionalChainMember) { - this.raise(startPos, "Tagged Template Literals are not allowed in optionalChain"); - } - - return this.finishNode(node, "TaggedTemplateExpression"); - } - - atPossibleAsync(base) { - return base.type === "Identifier" && base.name === "async" && this.state.lastTokEnd === base.end && !this.canInsertSemicolon() && this.input.slice(base.start, base.end) === "async"; - } - - finishCallExpression(node) { - if (node.callee.type === "Import") { - if (node.arguments.length !== 1) { - this.raise(node.start, "import() requires exactly one argument"); - } - - const importArg = node.arguments[0]; - - if (importArg && importArg.type === "SpreadElement") { - this.raise(importArg.start, "... is not allowed in import()"); - } - } - - return this.finishNode(node, "CallExpression"); - } - - finishOptionalCallExpression(node) { - if (node.callee.type === "Import") { - if (node.arguments.length !== 1) { - this.raise(node.start, "import() requires exactly one argument"); - } - - const importArg = node.arguments[0]; - - if (importArg && importArg.type === "SpreadElement") { - this.raise(importArg.start, "... is not allowed in import()"); - } - } - - return this.finishNode(node, "OptionalCallExpression"); - } - - parseCallExpressionArguments(close, possibleAsyncArrow, dynamicImport, allowPlaceholder) { - const elts = []; - let innerParenStart; - let first = true; - const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody; - this.state.inFSharpPipelineDirectBody = false; - - while (!this.eat(close)) { - if (first) { - first = false; - } else { - this.expect(types.comma); - - if (this.eat(close)) { - if (dynamicImport) { - this.raise(this.state.lastTokStart, "Trailing comma is disallowed inside import(...) arguments"); - } - - break; - } - } - - if (this.match(types.parenL) && !innerParenStart) { - innerParenStart = this.state.start; - } - - elts.push(this.parseExprListItem(false, possibleAsyncArrow ? { - start: 0 - } : undefined, possibleAsyncArrow ? { - start: 0 - } : undefined, allowPlaceholder)); - } - - if (possibleAsyncArrow && innerParenStart && this.shouldParseAsyncArrow()) { - this.unexpected(); - } - - this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody; - return elts; - } - - shouldParseAsyncArrow() { - return this.match(types.arrow) && !this.canInsertSemicolon(); - } - - parseAsyncArrowFromCallExpression(node, call) { - this.expect(types.arrow); - this.parseArrowExpression(node, call.arguments, true); - return node; - } - - parseNoCallExpr() { - const startPos = this.state.start; - const startLoc = this.state.startLoc; - return this.parseSubscripts(this.parseExprAtom(), startPos, startLoc, true); - } - - parseExprAtom(refShorthandDefaultPos) { - if (this.state.type === types.slash) this.readRegexp(); - const canBeArrow = this.state.potentialArrowAt === this.state.start; - let node; - - switch (this.state.type) { - case types._super: - if (!this.scope.allowSuper && !this.options.allowSuperOutsideMethod) { - this.raise(this.state.start, "super is only allowed in object methods and classes"); - } - - node = this.startNode(); - this.next(); - - if (this.match(types.parenL) && !this.scope.allowDirectSuper && !this.options.allowSuperOutsideMethod) { - this.raise(node.start, "super() is only valid inside a class constructor of a subclass. " + "Maybe a typo in the method name ('constructor') or not extending another class?"); - } - - if (!this.match(types.parenL) && !this.match(types.bracketL) && !this.match(types.dot)) { - this.unexpected(); - } - - return this.finishNode(node, "Super"); - - case types._import: - node = this.startNode(); - this.next(); - - if (this.match(types.dot)) { - return this.parseImportMetaProperty(node); - } - - this.expectPlugin("dynamicImport", node.start); - - if (!this.match(types.parenL)) { - this.unexpected(null, types.parenL); - } - - return this.finishNode(node, "Import"); - - case types._this: - node = this.startNode(); - this.next(); - return this.finishNode(node, "ThisExpression"); - - case types.name: - { - node = this.startNode(); - const containsEsc = this.state.containsEsc; - const id = this.parseIdentifier(); - - if (!containsEsc && id.name === "async" && this.match(types._function) && !this.canInsertSemicolon()) { - this.next(); - return this.parseFunction(node, undefined, true); - } else if (canBeArrow && !containsEsc && id.name === "async" && this.match(types.name) && !this.canInsertSemicolon()) { - const params = [this.parseIdentifier()]; - this.expect(types.arrow); - this.parseArrowExpression(node, params, true); - return node; - } - - if (canBeArrow && this.match(types.arrow) && !this.canInsertSemicolon()) { - this.next(); - this.parseArrowExpression(node, [id], false); - return node; - } - - return id; - } - - case types._do: - { - this.expectPlugin("doExpressions"); - const node = this.startNode(); - this.next(); - const oldLabels = this.state.labels; - this.state.labels = []; - node.body = this.parseBlock(); - this.state.labels = oldLabels; - return this.finishNode(node, "DoExpression"); - } - - case types.regexp: - { - const value = this.state.value; - node = this.parseLiteral(value.value, "RegExpLiteral"); - node.pattern = value.pattern; - node.flags = value.flags; - return node; - } - - case types.num: - return this.parseLiteral(this.state.value, "NumericLiteral"); - - case types.bigint: - return this.parseLiteral(this.state.value, "BigIntLiteral"); - - case types.string: - return this.parseLiteral(this.state.value, "StringLiteral"); - - case types._null: - node = this.startNode(); - this.next(); - return this.finishNode(node, "NullLiteral"); - - case types._true: - case types._false: - return this.parseBooleanLiteral(); - - case types.parenL: - return this.parseParenAndDistinguishExpression(canBeArrow); - - case types.bracketL: - { - const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody; - this.state.inFSharpPipelineDirectBody = false; - node = this.startNode(); - this.next(); - node.elements = this.parseExprList(types.bracketR, true, refShorthandDefaultPos); - - if (!this.state.maybeInArrowParameters) { - this.toReferencedList(node.elements); - } - - this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody; - return this.finishNode(node, "ArrayExpression"); - } - - case types.braceL: - { - const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody; - this.state.inFSharpPipelineDirectBody = false; - const ret = this.parseObj(false, refShorthandDefaultPos); - this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody; - return ret; - } - - case types._function: - return this.parseFunctionExpression(); - - case types.at: - this.parseDecorators(); - - case types._class: - node = this.startNode(); - this.takeDecorators(node); - return this.parseClass(node, false); - - case types._new: - return this.parseNew(); - - case types.backQuote: - return this.parseTemplate(false); - - case types.doubleColon: - { - node = this.startNode(); - this.next(); - node.object = null; - const callee = node.callee = this.parseNoCallExpr(); - - if (callee.type === "MemberExpression") { - return this.finishNode(node, "BindExpression"); - } else { - throw this.raise(callee.start, "Binding should be performed on object property."); - } - } - - case types.hash: - { - if (this.state.inPipeline) { - node = this.startNode(); - - if (this.getPluginOption("pipelineOperator", "proposal") !== "smart") { - this.raise(node.start, "Primary Topic Reference found but pipelineOperator not passed 'smart' for 'proposal' option."); - } - - this.next(); - - if (this.primaryTopicReferenceIsAllowedInCurrentTopicContext()) { - this.registerTopicReference(); - return this.finishNode(node, "PipelinePrimaryTopicReference"); - } else { - throw this.raise(node.start, `Topic reference was used in a lexical context without topic binding`); - } - } - } - - default: - throw this.unexpected(); - } - } - - parseBooleanLiteral() { - const node = this.startNode(); - node.value = this.match(types._true); - this.next(); - return this.finishNode(node, "BooleanLiteral"); - } - - parseMaybePrivateName() { - const isPrivate = this.match(types.hash); - - if (isPrivate) { - this.expectOnePlugin(["classPrivateProperties", "classPrivateMethods"]); - const node = this.startNode(); - this.next(); - this.assertNoSpace("Unexpected space between # and identifier"); - node.id = this.parseIdentifier(true); - return this.finishNode(node, "PrivateName"); - } else { - return this.parseIdentifier(true); - } - } - - parseFunctionExpression() { - const node = this.startNode(); - let meta = this.startNode(); - this.next(); - meta = this.createIdentifier(meta, "function"); - - if (this.scope.inGenerator && this.eat(types.dot)) { - return this.parseMetaProperty(node, meta, "sent"); - } - - return this.parseFunction(node); - } - - parseMetaProperty(node, meta, propertyName) { - node.meta = meta; - - if (meta.name === "function" && propertyName === "sent") { - if (this.isContextual(propertyName)) { - this.expectPlugin("functionSent"); - } else if (!this.hasPlugin("functionSent")) { - this.unexpected(); - } - } - - const containsEsc = this.state.containsEsc; - node.property = this.parseIdentifier(true); - - if (node.property.name !== propertyName || containsEsc) { - this.raise(node.property.start, `The only valid meta property for ${meta.name} is ${meta.name}.${propertyName}`); - } - - return this.finishNode(node, "MetaProperty"); - } - - parseImportMetaProperty(node) { - const id = this.createIdentifier(this.startNodeAtNode(node), "import"); - this.expect(types.dot); - - if (this.isContextual("meta")) { - this.expectPlugin("importMeta"); - } else if (!this.hasPlugin("importMeta")) { - this.raise(id.start, `Dynamic imports require a parameter: import('a.js')`); - } - - if (!this.inModule) { - this.raise(id.start, `import.meta may appear only with 'sourceType: "module"'`, { - code: "BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED" - }); - } - - this.sawUnambiguousESM = true; - return this.parseMetaProperty(node, id, "meta"); - } - - parseLiteral(value, type, startPos, startLoc) { - startPos = startPos || this.state.start; - startLoc = startLoc || this.state.startLoc; - const node = this.startNodeAt(startPos, startLoc); - this.addExtra(node, "rawValue", value); - this.addExtra(node, "raw", this.input.slice(startPos, this.state.end)); - node.value = value; - this.next(); - return this.finishNode(node, type); - } - - parseParenAndDistinguishExpression(canBeArrow) { - const startPos = this.state.start; - const startLoc = this.state.startLoc; - let val; - this.expect(types.parenL); - const oldMaybeInArrowParameters = this.state.maybeInArrowParameters; - const oldYieldPos = this.state.yieldPos; - const oldAwaitPos = this.state.awaitPos; - const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody; - this.state.maybeInArrowParameters = true; - this.state.yieldPos = 0; - this.state.awaitPos = 0; - this.state.inFSharpPipelineDirectBody = false; - const innerStartPos = this.state.start; - const innerStartLoc = this.state.startLoc; - const exprList = []; - const refShorthandDefaultPos = { - start: 0 - }; - const refNeedsArrowPos = { - start: 0 - }; - let first = true; - let spreadStart; - let optionalCommaStart; - - while (!this.match(types.parenR)) { - if (first) { - first = false; - } else { - this.expect(types.comma, refNeedsArrowPos.start || null); - - if (this.match(types.parenR)) { - optionalCommaStart = this.state.start; - break; - } - } - - if (this.match(types.ellipsis)) { - const spreadNodeStartPos = this.state.start; - const spreadNodeStartLoc = this.state.startLoc; - spreadStart = this.state.start; - exprList.push(this.parseParenItem(this.parseRestBinding(), spreadNodeStartPos, spreadNodeStartLoc)); - this.checkCommaAfterRest(); - break; - } else { - exprList.push(this.parseMaybeAssign(false, refShorthandDefaultPos, this.parseParenItem, refNeedsArrowPos)); - } - } - - const innerEndPos = this.state.start; - const innerEndLoc = this.state.startLoc; - this.expect(types.parenR); - this.state.maybeInArrowParameters = oldMaybeInArrowParameters; - this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody; - let arrowNode = this.startNodeAt(startPos, startLoc); - - if (canBeArrow && this.shouldParseArrow() && (arrowNode = this.parseArrow(arrowNode))) { - this.checkYieldAwaitInDefaultParams(); - this.state.yieldPos = oldYieldPos; - this.state.awaitPos = oldAwaitPos; - - for (let _i = 0; _i < exprList.length; _i++) { - const param = exprList[_i]; - - if (param.extra && param.extra.parenthesized) { - this.unexpected(param.extra.parenStart); - } - } - - this.parseArrowExpression(arrowNode, exprList, false); - return arrowNode; - } - - this.state.yieldPos = oldYieldPos || this.state.yieldPos; - this.state.awaitPos = oldAwaitPos || this.state.awaitPos; - - if (!exprList.length) { - this.unexpected(this.state.lastTokStart); - } - - if (optionalCommaStart) this.unexpected(optionalCommaStart); - if (spreadStart) this.unexpected(spreadStart); - - if (refShorthandDefaultPos.start) { - this.unexpected(refShorthandDefaultPos.start); - } - - if (refNeedsArrowPos.start) this.unexpected(refNeedsArrowPos.start); - this.toReferencedListDeep(exprList, true); - - if (exprList.length > 1) { - val = this.startNodeAt(innerStartPos, innerStartLoc); - val.expressions = exprList; - this.finishNodeAt(val, "SequenceExpression", innerEndPos, innerEndLoc); - } else { - val = exprList[0]; - } - - if (!this.options.createParenthesizedExpressions) { - this.addExtra(val, "parenthesized", true); - this.addExtra(val, "parenStart", startPos); - return val; - } - - const parenExpression = this.startNodeAt(startPos, startLoc); - parenExpression.expression = val; - this.finishNode(parenExpression, "ParenthesizedExpression"); - return parenExpression; - } - - shouldParseArrow() { - return !this.canInsertSemicolon(); - } - - parseArrow(node) { - if (this.eat(types.arrow)) { - return node; - } - } - - parseParenItem(node, startPos, startLoc) { - return node; - } - - parseNew() { - const node = this.startNode(); - const meta = this.parseIdentifier(true); - - if (this.eat(types.dot)) { - const metaProp = this.parseMetaProperty(node, meta, "target"); - - if (!this.scope.inNonArrowFunction && !this.state.inClassProperty) { - let error = "new.target can only be used in functions"; - - if (this.hasPlugin("classProperties")) { - error += " or class properties"; - } - - this.raise(metaProp.start, error); - } - - return metaProp; - } - - node.callee = this.parseNoCallExpr(); - - if (node.callee.type === "Import") { - this.raise(node.callee.start, "Cannot use new with import(...)"); - } else if (node.callee.type === "OptionalMemberExpression" || node.callee.type === "OptionalCallExpression") { - this.raise(this.state.lastTokEnd, "constructors in/after an Optional Chain are not allowed"); - } else if (this.eat(types.questionDot)) { - this.raise(this.state.start, "constructors in/after an Optional Chain are not allowed"); - } - - this.parseNewArguments(node); - return this.finishNode(node, "NewExpression"); - } - - parseNewArguments(node) { - if (this.eat(types.parenL)) { - const args = this.parseExprList(types.parenR); - this.toReferencedList(args); - node.arguments = args; - } else { - node.arguments = []; - } - } - - parseTemplateElement(isTagged) { - const elem = this.startNode(); - - if (this.state.value === null) { - if (!isTagged) { - this.raise(this.state.invalidTemplateEscapePosition || 0, "Invalid escape sequence in template"); - } else { - this.state.invalidTemplateEscapePosition = null; - } - } - - elem.value = { - raw: this.input.slice(this.state.start, this.state.end).replace(/\r\n?/g, "\n"), - cooked: this.state.value - }; - this.next(); - elem.tail = this.match(types.backQuote); - return this.finishNode(elem, "TemplateElement"); - } - - parseTemplate(isTagged) { - const node = this.startNode(); - this.next(); - node.expressions = []; - let curElt = this.parseTemplateElement(isTagged); - node.quasis = [curElt]; - - while (!curElt.tail) { - this.expect(types.dollarBraceL); - node.expressions.push(this.parseExpression()); - this.expect(types.braceR); - node.quasis.push(curElt = this.parseTemplateElement(isTagged)); - } - - this.next(); - return this.finishNode(node, "TemplateLiteral"); - } - - parseObj(isPattern, refShorthandDefaultPos) { - const propHash = Object.create(null); - let first = true; - const node = this.startNode(); - node.properties = []; - this.next(); - - while (!this.eat(types.braceR)) { - if (first) { - first = false; - } else { - this.expect(types.comma); - if (this.eat(types.braceR)) break; - } - - const prop = this.parseObjectMember(isPattern, refShorthandDefaultPos); - if (!isPattern) this.checkPropClash(prop, propHash); - - if (prop.shorthand) { - this.addExtra(prop, "shorthand", true); - } - - node.properties.push(prop); - } - - return this.finishNode(node, isPattern ? "ObjectPattern" : "ObjectExpression"); - } - - isAsyncProp(prop) { - return !prop.computed && prop.key.type === "Identifier" && prop.key.name === "async" && (this.match(types.name) || this.match(types.num) || this.match(types.string) || this.match(types.bracketL) || this.state.type.keyword || this.match(types.star)) && !this.hasPrecedingLineBreak(); - } - - parseObjectMember(isPattern, refShorthandDefaultPos) { - let decorators = []; - - if (this.match(types.at)) { - if (this.hasPlugin("decorators")) { - this.raise(this.state.start, "Stage 2 decorators disallow object literal property decorators"); - } else { - while (this.match(types.at)) { - decorators.push(this.parseDecorator()); - } - } - } - - const prop = this.startNode(); - let isGenerator = false; - let isAsync = false; - let startPos; - let startLoc; - - if (this.match(types.ellipsis)) { - if (decorators.length) this.unexpected(); - - if (isPattern) { - this.next(); - prop.argument = this.parseIdentifier(); - this.checkCommaAfterRest(); - return this.finishNode(prop, "RestElement"); - } - - return this.parseSpread(); - } - - if (decorators.length) { - prop.decorators = decorators; - decorators = []; - } - - prop.method = false; - - if (isPattern || refShorthandDefaultPos) { - startPos = this.state.start; - startLoc = this.state.startLoc; - } - - if (!isPattern) { - isGenerator = this.eat(types.star); - } - - const containsEsc = this.state.containsEsc; - this.parsePropertyName(prop); - - if (!isPattern && !containsEsc && !isGenerator && this.isAsyncProp(prop)) { - isAsync = true; - isGenerator = this.eat(types.star); - this.parsePropertyName(prop); - } else { - isAsync = false; - } - - this.parseObjPropValue(prop, startPos, startLoc, isGenerator, isAsync, isPattern, refShorthandDefaultPos, containsEsc); - return prop; - } - - isGetterOrSetterMethod(prop, isPattern) { - return !isPattern && !prop.computed && prop.key.type === "Identifier" && (prop.key.name === "get" || prop.key.name === "set") && (this.match(types.string) || this.match(types.num) || this.match(types.bracketL) || this.match(types.name) || !!this.state.type.keyword); - } - - getGetterSetterExpectedParamCount(method) { - return method.kind === "get" ? 0 : 1; - } - - checkGetterSetterParams(method) { - const paramCount = this.getGetterSetterExpectedParamCount(method); - const start = method.start; - - if (method.params.length !== paramCount) { - if (method.kind === "get") { - this.raise(start, "getter must not have any formal parameters"); - } else { - this.raise(start, "setter must have exactly one formal parameter"); - } - } - - if (method.kind === "set" && method.params[method.params.length - 1].type === "RestElement") { - this.raise(start, "setter function argument must not be a rest parameter"); - } - } - - parseObjectMethod(prop, isGenerator, isAsync, isPattern, containsEsc) { - if (isAsync || isGenerator || this.match(types.parenL)) { - if (isPattern) this.unexpected(); - prop.kind = "method"; - prop.method = true; - return this.parseMethod(prop, isGenerator, isAsync, false, false, "ObjectMethod"); - } - - if (!containsEsc && this.isGetterOrSetterMethod(prop, isPattern)) { - if (isGenerator || isAsync) this.unexpected(); - prop.kind = prop.key.name; - this.parsePropertyName(prop); - this.parseMethod(prop, false, false, false, false, "ObjectMethod"); - this.checkGetterSetterParams(prop); - return prop; - } - } - - parseObjectProperty(prop, startPos, startLoc, isPattern, refShorthandDefaultPos) { - prop.shorthand = false; - - if (this.eat(types.colon)) { - prop.value = isPattern ? this.parseMaybeDefault(this.state.start, this.state.startLoc) : this.parseMaybeAssign(false, refShorthandDefaultPos); - return this.finishNode(prop, "ObjectProperty"); - } - - if (!prop.computed && prop.key.type === "Identifier") { - this.checkReservedWord(prop.key.name, prop.key.start, true, true); - - if (isPattern) { - prop.value = this.parseMaybeDefault(startPos, startLoc, prop.key.__clone()); - } else if (this.match(types.eq) && refShorthandDefaultPos) { - if (!refShorthandDefaultPos.start) { - refShorthandDefaultPos.start = this.state.start; - } - - prop.value = this.parseMaybeDefault(startPos, startLoc, prop.key.__clone()); - } else { - prop.value = prop.key.__clone(); - } - - prop.shorthand = true; - return this.finishNode(prop, "ObjectProperty"); - } - } - - parseObjPropValue(prop, startPos, startLoc, isGenerator, isAsync, isPattern, refShorthandDefaultPos, containsEsc) { - const node = this.parseObjectMethod(prop, isGenerator, isAsync, isPattern, containsEsc) || this.parseObjectProperty(prop, startPos, startLoc, isPattern, refShorthandDefaultPos); - if (!node) this.unexpected(); - return node; - } - - parsePropertyName(prop) { - if (this.eat(types.bracketL)) { - prop.computed = true; - prop.key = this.parseMaybeAssign(); - this.expect(types.bracketR); - } else { - const oldInPropertyName = this.state.inPropertyName; - this.state.inPropertyName = true; - prop.key = this.match(types.num) || this.match(types.string) ? this.parseExprAtom() : this.parseMaybePrivateName(); - - if (prop.key.type !== "PrivateName") { - prop.computed = false; - } - - this.state.inPropertyName = oldInPropertyName; - } - - return prop.key; - } - - initFunction(node, isAsync) { - node.id = null; - node.generator = false; - node.async = !!isAsync; - } - - parseMethod(node, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope = false) { - const oldYieldPos = this.state.yieldPos; - const oldAwaitPos = this.state.awaitPos; - this.state.yieldPos = 0; - this.state.awaitPos = 0; - this.initFunction(node, isAsync); - node.generator = !!isGenerator; - const allowModifiers = isConstructor; - this.scope.enter(functionFlags(isAsync, node.generator) | SCOPE_SUPER | (inClassScope ? SCOPE_CLASS : 0) | (allowDirectSuper ? SCOPE_DIRECT_SUPER : 0)); - this.parseFunctionParams(node, allowModifiers); - this.checkYieldAwaitInDefaultParams(); - this.parseFunctionBodyAndFinish(node, type, true); - this.scope.exit(); - this.state.yieldPos = oldYieldPos; - this.state.awaitPos = oldAwaitPos; - return node; - } - - parseArrowExpression(node, params, isAsync) { - this.scope.enter(functionFlags(isAsync, false) | SCOPE_ARROW); - this.initFunction(node, isAsync); - const oldMaybeInArrowParameters = this.state.maybeInArrowParameters; - const oldYieldPos = this.state.yieldPos; - const oldAwaitPos = this.state.awaitPos; - this.state.maybeInArrowParameters = false; - this.state.yieldPos = 0; - this.state.awaitPos = 0; - if (params) this.setArrowFunctionParameters(node, params); - this.parseFunctionBody(node, true); - this.scope.exit(); - this.state.maybeInArrowParameters = oldMaybeInArrowParameters; - this.state.yieldPos = oldYieldPos; - this.state.awaitPos = oldAwaitPos; - return this.finishNode(node, "ArrowFunctionExpression"); - } - - setArrowFunctionParameters(node, params) { - node.params = this.toAssignableList(params, true, "arrow function parameters"); - } - - isStrictBody(node) { - const isBlockStatement = node.body.type === "BlockStatement"; - - if (isBlockStatement && node.body.directives.length) { - for (let _i2 = 0, _node$body$directives = node.body.directives; _i2 < _node$body$directives.length; _i2++) { - const directive = _node$body$directives[_i2]; - - if (directive.value.value === "use strict") { - return true; - } - } - } - - return false; - } - - parseFunctionBodyAndFinish(node, type, isMethod = false) { - this.parseFunctionBody(node, false, isMethod); - this.finishNode(node, type); - } - - parseFunctionBody(node, allowExpression, isMethod = false) { - const isExpression = allowExpression && !this.match(types.braceL); - const oldStrict = this.state.strict; - let useStrict = false; - const oldInParameters = this.state.inParameters; - this.state.inParameters = false; - - if (isExpression) { - node.body = this.parseMaybeAssign(); - this.checkParams(node, false, allowExpression); - } else { - const nonSimple = !this.isSimpleParamList(node.params); - - if (!oldStrict || nonSimple) { - useStrict = this.strictDirective(this.state.end); - - if (useStrict && nonSimple) { - const errorPos = (node.kind === "method" || node.kind === "constructor") && !!node.key ? node.key.end : node.start; - this.raise(errorPos, "Illegal 'use strict' directive in function with non-simple parameter list"); - } - } - - const oldLabels = this.state.labels; - this.state.labels = []; - if (useStrict) this.state.strict = true; - this.checkParams(node, !oldStrict && !useStrict && !allowExpression && !isMethod && !nonSimple, allowExpression); - node.body = this.parseBlock(true, false); - this.state.labels = oldLabels; - } - - this.state.inParameters = oldInParameters; - - if (this.state.strict && node.id) { - this.checkLVal(node.id, BIND_OUTSIDE, undefined, "function name"); - } - - this.state.strict = oldStrict; - } - - isSimpleParamList(params) { - for (let i = 0, len = params.length; i < len; i++) { - if (params[i].type !== "Identifier") return false; - } - - return true; - } - - checkParams(node, allowDuplicates, isArrowFunction) { - const nameHash = Object.create(null); - - for (let i = 0; i < node.params.length; i++) { - this.checkLVal(node.params[i], BIND_VAR, allowDuplicates ? null : nameHash, "function paramter list"); - } - } - - parseExprList(close, allowEmpty, refShorthandDefaultPos) { - const elts = []; - let first = true; - - while (!this.eat(close)) { - if (first) { - first = false; - } else { - this.expect(types.comma); - if (this.eat(close)) break; - } - - elts.push(this.parseExprListItem(allowEmpty, refShorthandDefaultPos)); - } - - return elts; - } - - parseExprListItem(allowEmpty, refShorthandDefaultPos, refNeedsArrowPos, allowPlaceholder) { - let elt; - - if (allowEmpty && this.match(types.comma)) { - elt = null; - } else if (this.match(types.ellipsis)) { - const spreadNodeStartPos = this.state.start; - const spreadNodeStartLoc = this.state.startLoc; - elt = this.parseParenItem(this.parseSpread(refShorthandDefaultPos, refNeedsArrowPos), spreadNodeStartPos, spreadNodeStartLoc); - } else if (this.match(types.question)) { - this.expectPlugin("partialApplication"); - - if (!allowPlaceholder) { - this.raise(this.state.start, "Unexpected argument placeholder"); - } - - const node = this.startNode(); - this.next(); - elt = this.finishNode(node, "ArgumentPlaceholder"); - } else { - elt = this.parseMaybeAssign(false, refShorthandDefaultPos, this.parseParenItem, refNeedsArrowPos); - } - - return elt; - } - - parseIdentifier(liberal) { - const node = this.startNode(); - const name = this.parseIdentifierName(node.start, liberal); - return this.createIdentifier(node, name); - } - - createIdentifier(node, name) { - node.name = name; - node.loc.identifierName = name; - return this.finishNode(node, "Identifier"); - } - - parseIdentifierName(pos, liberal) { - let name; - - if (this.match(types.name)) { - name = this.state.value; - } else if (this.state.type.keyword) { - name = this.state.type.keyword; - - if ((name === "class" || name === "function") && (this.state.lastTokEnd !== this.state.lastTokStart + 1 || this.input.charCodeAt(this.state.lastTokStart) !== 46)) { - this.state.context.pop(); - } - } else { - throw this.unexpected(); - } - - if (!liberal) { - this.checkReservedWord(name, this.state.start, !!this.state.type.keyword, false); - } - - this.next(); - return name; - } - - checkReservedWord(word, startLoc, checkKeywords, isBinding) { - if (this.scope.inGenerator && word === "yield") { - this.raise(startLoc, "Can not use 'yield' as identifier inside a generator"); - } - - if (this.scope.inAsync && word === "await") { - this.raise(startLoc, "Can not use 'await' as identifier inside an async function"); - } - - if (this.state.inClassProperty && word === "arguments") { - this.raise(startLoc, "'arguments' is not allowed in class field initializer"); - } - - if (checkKeywords && isKeyword(word)) { - this.raise(startLoc, `Unexpected keyword '${word}'`); - } - - const reservedTest = !this.state.strict ? isReservedWord : isBinding ? isStrictBindReservedWord : isStrictReservedWord; - - if (reservedTest(word, this.inModule)) { - if (!this.scope.inAsync && word === "await") { - this.raise(startLoc, "Can not use keyword 'await' outside an async function"); - } - - this.raise(startLoc, `Unexpected reserved word '${word}'`); - } - } - - parseAwait() { - if (!this.state.awaitPos) { - this.state.awaitPos = this.state.start; - } - - const node = this.startNode(); - this.next(); - - if (this.state.inParameters) { - this.raise(node.start, "await is not allowed in async function parameters"); - } - - if (this.match(types.star)) { - this.raise(node.start, "await* has been removed from the async functions proposal. Use Promise.all() instead."); - } - - if (!this.state.soloAwait) { - node.argument = this.parseMaybeUnary(); - } - - return this.finishNode(node, "AwaitExpression"); - } - - parseYield(noIn) { - if (!this.state.yieldPos) { - this.state.yieldPos = this.state.start; - } - - const node = this.startNode(); - - if (this.state.inParameters) { - this.raise(node.start, "yield is not allowed in generator parameters"); - } - - this.next(); - - if (this.match(types.semi) || !this.match(types.star) && !this.state.type.startsExpr || this.canInsertSemicolon()) { - node.delegate = false; - node.argument = null; - } else { - node.delegate = this.eat(types.star); - node.argument = this.parseMaybeAssign(noIn); - } - - return this.finishNode(node, "YieldExpression"); - } - - checkPipelineAtInfixOperator(left, leftStartPos) { - if (this.getPluginOption("pipelineOperator", "proposal") === "smart") { - if (left.type === "SequenceExpression") { - throw this.raise(leftStartPos, `Pipeline head should not be a comma-separated sequence expression`); - } - } - } - - parseSmartPipelineBody(childExpression, startPos, startLoc) { - const pipelineStyle = this.checkSmartPipelineBodyStyle(childExpression); - this.checkSmartPipelineBodyEarlyErrors(childExpression, pipelineStyle, startPos); - return this.parseSmartPipelineBodyInStyle(childExpression, pipelineStyle, startPos, startLoc); - } - - checkSmartPipelineBodyEarlyErrors(childExpression, pipelineStyle, startPos) { - if (this.match(types.arrow)) { - throw this.raise(this.state.start, `Unexpected arrow "=>" after pipeline body; arrow function in pipeline body must be parenthesized`); - } else if (pipelineStyle === "PipelineTopicExpression" && childExpression.type === "SequenceExpression") { - throw this.raise(startPos, `Pipeline body may not be a comma-separated sequence expression`); - } - } - - parseSmartPipelineBodyInStyle(childExpression, pipelineStyle, startPos, startLoc) { - const bodyNode = this.startNodeAt(startPos, startLoc); - - switch (pipelineStyle) { - case "PipelineBareFunction": - bodyNode.callee = childExpression; - break; - - case "PipelineBareConstructor": - bodyNode.callee = childExpression.callee; - break; - - case "PipelineBareAwaitedFunction": - bodyNode.callee = childExpression.argument; - break; - - case "PipelineTopicExpression": - if (!this.topicReferenceWasUsedInCurrentTopicContext()) { - throw this.raise(startPos, `Pipeline is in topic style but does not use topic reference`); - } - - bodyNode.expression = childExpression; - break; - - default: - throw this.raise(startPos, `Unknown pipeline style ${pipelineStyle}`); - } - - return this.finishNode(bodyNode, pipelineStyle); - } - - checkSmartPipelineBodyStyle(expression) { - switch (expression.type) { - default: - return this.isSimpleReference(expression) ? "PipelineBareFunction" : "PipelineTopicExpression"; - } - } - - isSimpleReference(expression) { - switch (expression.type) { - case "MemberExpression": - return !expression.computed && this.isSimpleReference(expression.object); - - case "Identifier": - return true; - - default: - return false; - } - } - - withTopicPermittingContext(callback) { - const outerContextTopicState = this.state.topicContext; - this.state.topicContext = { - maxNumOfResolvableTopics: 1, - maxTopicIndex: null - }; - - try { - return callback(); - } finally { - this.state.topicContext = outerContextTopicState; - } - } - - withTopicForbiddingContext(callback) { - const outerContextTopicState = this.state.topicContext; - this.state.topicContext = { - maxNumOfResolvableTopics: 0, - maxTopicIndex: null - }; - - try { - return callback(); - } finally { - this.state.topicContext = outerContextTopicState; - } - } - - withSoloAwaitPermittingContext(callback) { - const outerContextSoloAwaitState = this.state.soloAwait; - this.state.soloAwait = true; - - try { - return callback(); - } finally { - this.state.soloAwait = outerContextSoloAwaitState; - } - } - - registerTopicReference() { - this.state.topicContext.maxTopicIndex = 0; - } - - primaryTopicReferenceIsAllowedInCurrentTopicContext() { - return this.state.topicContext.maxNumOfResolvableTopics >= 1; - } - - topicReferenceWasUsedInCurrentTopicContext() { - return this.state.topicContext.maxTopicIndex != null && this.state.topicContext.maxTopicIndex >= 0; - } - - parseFSharpPipelineBody(prec, noIn) { - const startPos = this.state.start; - const startLoc = this.state.startLoc; - this.state.potentialArrowAt = this.state.start; - const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody; - this.state.inFSharpPipelineDirectBody = true; - const ret = this.parseExprOp(this.parseMaybeUnary(), startPos, startLoc, prec, noIn); - this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody; - return ret; - } - -} - -const loopLabel = { - kind: "loop" -}, - switchLabel = { - kind: "switch" -}; -const FUNC_NO_FLAGS = 0b000, - FUNC_STATEMENT = 0b001, - FUNC_HANGING_STATEMENT = 0b010, - FUNC_NULLABLE_ID = 0b100; -class StatementParser extends ExpressionParser { - parseTopLevel(file, program) { - program.sourceType = this.options.sourceType; - program.interpreter = this.parseInterpreterDirective(); - this.parseBlockBody(program, true, true, types.eof); - - if (this.inModule && !this.options.allowUndeclaredExports && this.scope.undefinedExports.size > 0) { - for (let _i = 0, _Array$from = Array.from(this.scope.undefinedExports); _i < _Array$from.length; _i++) { - const [name] = _Array$from[_i]; - const pos = this.scope.undefinedExports.get(name); - this.raise(pos, `Export '${name}' is not defined`); - } - } - - file.program = this.finishNode(program, "Program"); - file.comments = this.state.comments; - if (this.options.tokens) file.tokens = this.state.tokens; - return this.finishNode(file, "File"); - } - - stmtToDirective(stmt) { - const expr = stmt.expression; - const directiveLiteral = this.startNodeAt(expr.start, expr.loc.start); - const directive = this.startNodeAt(stmt.start, stmt.loc.start); - const raw = this.input.slice(expr.start, expr.end); - const val = directiveLiteral.value = raw.slice(1, -1); - this.addExtra(directiveLiteral, "raw", raw); - this.addExtra(directiveLiteral, "rawValue", val); - directive.value = this.finishNodeAt(directiveLiteral, "DirectiveLiteral", expr.end, expr.loc.end); - return this.finishNodeAt(directive, "Directive", stmt.end, stmt.loc.end); - } - - parseInterpreterDirective() { - if (!this.match(types.interpreterDirective)) { - return null; - } - - const node = this.startNode(); - node.value = this.state.value; - this.next(); - return this.finishNode(node, "InterpreterDirective"); - } - - isLet(context) { - if (!this.isContextual("let")) { - return false; - } - - skipWhiteSpace.lastIndex = this.state.pos; - const skip = skipWhiteSpace.exec(this.input); - const next = this.state.pos + skip[0].length; - const nextCh = this.input.charCodeAt(next); - if (nextCh === 91) return true; - if (context) return false; - if (nextCh === 123) return true; - - if (isIdentifierStart(nextCh)) { - let pos = next + 1; - - while (isIdentifierChar(this.input.charCodeAt(pos))) { - ++pos; - } - - const ident = this.input.slice(next, pos); - if (!keywordRelationalOperator.test(ident)) return true; - } - - return false; - } - - parseStatement(context, topLevel) { - if (this.match(types.at)) { - this.parseDecorators(true); - } - - return this.parseStatementContent(context, topLevel); - } - - parseStatementContent(context, topLevel) { - let starttype = this.state.type; - const node = this.startNode(); - let kind; - - if (this.isLet(context)) { - starttype = types._var; - kind = "let"; - } - - switch (starttype) { - case types._break: - case types._continue: - return this.parseBreakContinueStatement(node, starttype.keyword); - - case types._debugger: - return this.parseDebuggerStatement(node); - - case types._do: - return this.parseDoStatement(node); - - case types._for: - return this.parseForStatement(node); - - case types._function: - if (this.lookahead().type === types.dot) break; - - if (context) { - if (this.state.strict) { - this.raise(this.state.start, "In strict mode code, functions can only be declared at top level or inside a block"); - } else if (context !== "if" && context !== "label") { - this.raise(this.state.start, "In non-strict mode code, functions can only be declared at top level, " + "inside a block, or as the body of an if statement"); - } - } - - return this.parseFunctionStatement(node, false, !context); - - case types._class: - if (context) this.unexpected(); - return this.parseClass(node, true); - - case types._if: - return this.parseIfStatement(node); - - case types._return: - return this.parseReturnStatement(node); - - case types._switch: - return this.parseSwitchStatement(node); - - case types._throw: - return this.parseThrowStatement(node); - - case types._try: - return this.parseTryStatement(node); - - case types._const: - case types._var: - kind = kind || this.state.value; - - if (context && kind !== "var") { - this.unexpected(this.state.start, "Lexical declaration cannot appear in a single-statement context"); - } - - return this.parseVarStatement(node, kind); - - case types._while: - return this.parseWhileStatement(node); - - case types._with: - return this.parseWithStatement(node); - - case types.braceL: - return this.parseBlock(); - - case types.semi: - return this.parseEmptyStatement(node); - - case types._export: - case types._import: - { - const nextToken = this.lookahead(); - - if (nextToken.type === types.parenL || nextToken.type === types.dot) { - break; - } - - if (!this.options.allowImportExportEverywhere && !topLevel) { - this.raise(this.state.start, "'import' and 'export' may only appear at the top level"); - } - - this.next(); - let result; - - if (starttype === types._import) { - result = this.parseImport(node); - - if (result.type === "ImportDeclaration" && (!result.importKind || result.importKind === "value")) { - this.sawUnambiguousESM = true; - } - } else { - result = this.parseExport(node); - - if (result.type === "ExportNamedDeclaration" && (!result.exportKind || result.exportKind === "value") || result.type === "ExportAllDeclaration" && (!result.exportKind || result.exportKind === "value") || result.type === "ExportDefaultDeclaration") { - this.sawUnambiguousESM = true; - } - } - - this.assertModuleNodeAllowed(node); - return result; - } - - default: - { - if (this.isAsyncFunction()) { - if (context) { - this.unexpected(null, "Async functions can only be declared at the top level or inside a block"); - } - - this.next(); - return this.parseFunctionStatement(node, true, !context); - } - } - } - - const maybeName = this.state.value; - const expr = this.parseExpression(); - - if (starttype === types.name && expr.type === "Identifier" && this.eat(types.colon)) { - return this.parseLabeledStatement(node, maybeName, expr, context); - } else { - return this.parseExpressionStatement(node, expr); - } - } - - assertModuleNodeAllowed(node) { - if (!this.options.allowImportExportEverywhere && !this.inModule) { - this.raise(node.start, `'import' and 'export' may appear only with 'sourceType: "module"'`, { - code: "BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED" - }); - } - } - - takeDecorators(node) { - const decorators = this.state.decoratorStack[this.state.decoratorStack.length - 1]; - - if (decorators.length) { - node.decorators = decorators; - this.resetStartLocationFromNode(node, decorators[0]); - this.state.decoratorStack[this.state.decoratorStack.length - 1] = []; - } - } - - canHaveLeadingDecorator() { - return this.match(types._class); - } - - parseDecorators(allowExport) { - const currentContextDecorators = this.state.decoratorStack[this.state.decoratorStack.length - 1]; - - while (this.match(types.at)) { - const decorator = this.parseDecorator(); - currentContextDecorators.push(decorator); - } - - if (this.match(types._export)) { - if (!allowExport) { - this.unexpected(); - } - - if (this.hasPlugin("decorators") && !this.getPluginOption("decorators", "decoratorsBeforeExport")) { - this.raise(this.state.start, "Using the export keyword between a decorator and a class is not allowed. " + "Please use `export @dec class` instead."); - } - } else if (!this.canHaveLeadingDecorator()) { - this.raise(this.state.start, "Leading decorators must be attached to a class declaration"); - } - } - - parseDecorator() { - this.expectOnePlugin(["decorators-legacy", "decorators"]); - const node = this.startNode(); - this.next(); - - if (this.hasPlugin("decorators")) { - this.state.decoratorStack.push([]); - const startPos = this.state.start; - const startLoc = this.state.startLoc; - let expr; - - if (this.eat(types.parenL)) { - expr = this.parseExpression(); - this.expect(types.parenR); - } else { - expr = this.parseIdentifier(false); - - while (this.eat(types.dot)) { - const node = this.startNodeAt(startPos, startLoc); - node.object = expr; - node.property = this.parseIdentifier(true); - node.computed = false; - expr = this.finishNode(node, "MemberExpression"); - } - } - - node.expression = this.parseMaybeDecoratorArguments(expr); - this.state.decoratorStack.pop(); - } else { - node.expression = this.parseExprSubscripts(); - } - - return this.finishNode(node, "Decorator"); - } - - parseMaybeDecoratorArguments(expr) { - if (this.eat(types.parenL)) { - const node = this.startNodeAtNode(expr); - node.callee = expr; - node.arguments = this.parseCallExpressionArguments(types.parenR, false); - this.toReferencedList(node.arguments); - return this.finishNode(node, "CallExpression"); - } - - return expr; - } - - parseBreakContinueStatement(node, keyword) { - const isBreak = keyword === "break"; - this.next(); - - if (this.isLineTerminator()) { - node.label = null; - } else { - node.label = this.parseIdentifier(); - this.semicolon(); - } - - this.verifyBreakContinue(node, keyword); - return this.finishNode(node, isBreak ? "BreakStatement" : "ContinueStatement"); - } - - verifyBreakContinue(node, keyword) { - const isBreak = keyword === "break"; - let i; - - for (i = 0; i < this.state.labels.length; ++i) { - const lab = this.state.labels[i]; - - if (node.label == null || lab.name === node.label.name) { - if (lab.kind != null && (isBreak || lab.kind === "loop")) break; - if (node.label && isBreak) break; - } - } - - if (i === this.state.labels.length) { - this.raise(node.start, "Unsyntactic " + keyword); - } - } - - parseDebuggerStatement(node) { - this.next(); - this.semicolon(); - return this.finishNode(node, "DebuggerStatement"); - } - - parseHeaderExpression() { - this.expect(types.parenL); - const val = this.parseExpression(); - this.expect(types.parenR); - return val; - } - - parseDoStatement(node) { - this.next(); - this.state.labels.push(loopLabel); - node.body = this.withTopicForbiddingContext(() => this.parseStatement("do")); - this.state.labels.pop(); - this.expect(types._while); - node.test = this.parseHeaderExpression(); - this.eat(types.semi); - return this.finishNode(node, "DoWhileStatement"); - } - - parseForStatement(node) { - this.next(); - this.state.labels.push(loopLabel); - let awaitAt = -1; - - if ((this.scope.inAsync || !this.scope.inFunction && this.options.allowAwaitOutsideFunction) && this.eatContextual("await")) { - awaitAt = this.state.lastTokStart; - } - - this.scope.enter(SCOPE_OTHER); - this.expect(types.parenL); - - if (this.match(types.semi)) { - if (awaitAt > -1) { - this.unexpected(awaitAt); - } - - return this.parseFor(node, null); - } - - const isLet = this.isLet(); - - if (this.match(types._var) || this.match(types._const) || isLet) { - const init = this.startNode(); - const kind = isLet ? "let" : this.state.value; - this.next(); - this.parseVar(init, true, kind); - this.finishNode(init, "VariableDeclaration"); - - if ((this.match(types._in) || this.isContextual("of")) && init.declarations.length === 1) { - return this.parseForIn(node, init, awaitAt); - } - - if (awaitAt > -1) { - this.unexpected(awaitAt); - } - - return this.parseFor(node, init); - } - - const refShorthandDefaultPos = { - start: 0 - }; - const init = this.parseExpression(true, refShorthandDefaultPos); - - if (this.match(types._in) || this.isContextual("of")) { - const description = this.isContextual("of") ? "for-of statement" : "for-in statement"; - this.toAssignable(init, undefined, description); - this.checkLVal(init, undefined, undefined, description); - return this.parseForIn(node, init, awaitAt); - } else if (refShorthandDefaultPos.start) { - this.unexpected(refShorthandDefaultPos.start); - } - - if (awaitAt > -1) { - this.unexpected(awaitAt); - } - - return this.parseFor(node, init); - } - - parseFunctionStatement(node, isAsync, declarationPosition) { - this.next(); - return this.parseFunction(node, FUNC_STATEMENT | (declarationPosition ? 0 : FUNC_HANGING_STATEMENT), isAsync); - } - - parseIfStatement(node) { - this.next(); - node.test = this.parseHeaderExpression(); - node.consequent = this.parseStatement("if"); - node.alternate = this.eat(types._else) ? this.parseStatement("if") : null; - return this.finishNode(node, "IfStatement"); - } - - parseReturnStatement(node) { - if (!this.scope.inFunction && !this.options.allowReturnOutsideFunction) { - this.raise(this.state.start, "'return' outside of function"); - } - - this.next(); - - if (this.isLineTerminator()) { - node.argument = null; - } else { - node.argument = this.parseExpression(); - this.semicolon(); - } - - return this.finishNode(node, "ReturnStatement"); - } - - parseSwitchStatement(node) { - this.next(); - node.discriminant = this.parseHeaderExpression(); - const cases = node.cases = []; - this.expect(types.braceL); - this.state.labels.push(switchLabel); - this.scope.enter(SCOPE_OTHER); - let cur; - - for (let sawDefault; !this.match(types.braceR);) { - if (this.match(types._case) || this.match(types._default)) { - const isCase = this.match(types._case); - if (cur) this.finishNode(cur, "SwitchCase"); - cases.push(cur = this.startNode()); - cur.consequent = []; - this.next(); - - if (isCase) { - cur.test = this.parseExpression(); - } else { - if (sawDefault) { - this.raise(this.state.lastTokStart, "Multiple default clauses"); - } - - sawDefault = true; - cur.test = null; - } - - this.expect(types.colon); - } else { - if (cur) { - cur.consequent.push(this.parseStatement(null)); - } else { - this.unexpected(); - } - } - } - - this.scope.exit(); - if (cur) this.finishNode(cur, "SwitchCase"); - this.next(); - this.state.labels.pop(); - return this.finishNode(node, "SwitchStatement"); - } - - parseThrowStatement(node) { - this.next(); - - if (lineBreak.test(this.input.slice(this.state.lastTokEnd, this.state.start))) { - this.raise(this.state.lastTokEnd, "Illegal newline after throw"); - } - - node.argument = this.parseExpression(); - this.semicolon(); - return this.finishNode(node, "ThrowStatement"); - } - - parseTryStatement(node) { - this.next(); - node.block = this.parseBlock(); - node.handler = null; - - if (this.match(types._catch)) { - const clause = this.startNode(); - this.next(); - - if (this.match(types.parenL)) { - this.expect(types.parenL); - clause.param = this.parseBindingAtom(); - const simple = clause.param.type === "Identifier"; - this.scope.enter(simple ? SCOPE_SIMPLE_CATCH : 0); - this.checkLVal(clause.param, BIND_LEXICAL, null, "catch clause"); - this.expect(types.parenR); - } else { - clause.param = null; - this.scope.enter(SCOPE_OTHER); - } - - clause.body = this.withTopicForbiddingContext(() => this.parseBlock(false, false)); - this.scope.exit(); - node.handler = this.finishNode(clause, "CatchClause"); - } - - node.finalizer = this.eat(types._finally) ? this.parseBlock() : null; - - if (!node.handler && !node.finalizer) { - this.raise(node.start, "Missing catch or finally clause"); - } - - return this.finishNode(node, "TryStatement"); - } - - parseVarStatement(node, kind) { - this.next(); - this.parseVar(node, false, kind); - this.semicolon(); - return this.finishNode(node, "VariableDeclaration"); - } - - parseWhileStatement(node) { - this.next(); - node.test = this.parseHeaderExpression(); - this.state.labels.push(loopLabel); - node.body = this.withTopicForbiddingContext(() => this.parseStatement("while")); - this.state.labels.pop(); - return this.finishNode(node, "WhileStatement"); - } - - parseWithStatement(node) { - if (this.state.strict) { - this.raise(this.state.start, "'with' in strict mode"); - } - - this.next(); - node.object = this.parseHeaderExpression(); - node.body = this.withTopicForbiddingContext(() => this.parseStatement("with")); - return this.finishNode(node, "WithStatement"); - } - - parseEmptyStatement(node) { - this.next(); - return this.finishNode(node, "EmptyStatement"); - } - - parseLabeledStatement(node, maybeName, expr, context) { - for (let _i2 = 0, _this$state$labels = this.state.labels; _i2 < _this$state$labels.length; _i2++) { - const label = _this$state$labels[_i2]; - - if (label.name === maybeName) { - this.raise(expr.start, `Label '${maybeName}' is already declared`); - } - } - - const kind = this.state.type.isLoop ? "loop" : this.match(types._switch) ? "switch" : null; - - for (let i = this.state.labels.length - 1; i >= 0; i--) { - const label = this.state.labels[i]; - - if (label.statementStart === node.start) { - label.statementStart = this.state.start; - label.kind = kind; - } else { - break; - } - } - - this.state.labels.push({ - name: maybeName, - kind: kind, - statementStart: this.state.start - }); - node.body = this.parseStatement(context ? context.indexOf("label") === -1 ? context + "label" : context : "label"); - this.state.labels.pop(); - node.label = expr; - return this.finishNode(node, "LabeledStatement"); - } - - parseExpressionStatement(node, expr) { - node.expression = expr; - this.semicolon(); - return this.finishNode(node, "ExpressionStatement"); - } - - parseBlock(allowDirectives = false, createNewLexicalScope = true) { - const node = this.startNode(); - this.expect(types.braceL); - - if (createNewLexicalScope) { - this.scope.enter(SCOPE_OTHER); - } - - this.parseBlockBody(node, allowDirectives, false, types.braceR); - - if (createNewLexicalScope) { - this.scope.exit(); - } - - return this.finishNode(node, "BlockStatement"); - } - - isValidDirective(stmt) { - return stmt.type === "ExpressionStatement" && stmt.expression.type === "StringLiteral" && !stmt.expression.extra.parenthesized; - } - - parseBlockBody(node, allowDirectives, topLevel, end) { - const body = node.body = []; - const directives = node.directives = []; - this.parseBlockOrModuleBlockBody(body, allowDirectives ? directives : undefined, topLevel, end); - } - - parseBlockOrModuleBlockBody(body, directives, topLevel, end) { - let parsedNonDirective = false; - let oldStrict; - let octalPosition; - - while (!this.eat(end)) { - if (!parsedNonDirective && this.state.containsOctal && !octalPosition) { - octalPosition = this.state.octalPosition; - } - - const stmt = this.parseStatement(null, topLevel); - - if (directives && !parsedNonDirective && this.isValidDirective(stmt)) { - const directive = this.stmtToDirective(stmt); - directives.push(directive); - - if (oldStrict === undefined && directive.value.value === "use strict") { - oldStrict = this.state.strict; - this.setStrict(true); - - if (octalPosition) { - this.raise(octalPosition, "Octal literal in strict mode"); - } - } - - continue; - } - - parsedNonDirective = true; - body.push(stmt); - } - - if (oldStrict === false) { - this.setStrict(false); - } - } - - parseFor(node, init) { - node.init = init; - this.expect(types.semi); - node.test = this.match(types.semi) ? null : this.parseExpression(); - this.expect(types.semi); - node.update = this.match(types.parenR) ? null : this.parseExpression(); - this.expect(types.parenR); - node.body = this.withTopicForbiddingContext(() => this.parseStatement("for")); - this.scope.exit(); - this.state.labels.pop(); - return this.finishNode(node, "ForStatement"); - } - - parseForIn(node, init, awaitAt) { - const isForIn = this.match(types._in); - this.next(); - - if (isForIn) { - if (awaitAt > -1) this.unexpected(awaitAt); - } else { - node.await = awaitAt > -1; - } - - if (init.type === "VariableDeclaration" && init.declarations[0].init != null && (!isForIn || this.state.strict || init.kind !== "var" || init.declarations[0].id.type !== "Identifier")) { - this.raise(init.start, `${isForIn ? "for-in" : "for-of"} loop variable declaration may not have an initializer`); - } else if (init.type === "AssignmentPattern") { - this.raise(init.start, "Invalid left-hand side in for-loop"); - } - - node.left = init; - node.right = isForIn ? this.parseExpression() : this.parseMaybeAssign(); - this.expect(types.parenR); - node.body = this.withTopicForbiddingContext(() => this.parseStatement("for")); - this.scope.exit(); - this.state.labels.pop(); - return this.finishNode(node, isForIn ? "ForInStatement" : "ForOfStatement"); - } - - parseVar(node, isFor, kind) { - const declarations = node.declarations = []; - const isTypescript = this.hasPlugin("typescript"); - node.kind = kind; - - for (;;) { - const decl = this.startNode(); - this.parseVarId(decl, kind); - - if (this.eat(types.eq)) { - decl.init = this.parseMaybeAssign(isFor); - } else { - if (kind === "const" && !(this.match(types._in) || this.isContextual("of"))) { - if (!isTypescript) { - this.unexpected(); - } - } else if (decl.id.type !== "Identifier" && !(isFor && (this.match(types._in) || this.isContextual("of")))) { - this.raise(this.state.lastTokEnd, "Complex binding patterns require an initialization value"); - } - - decl.init = null; - } - - declarations.push(this.finishNode(decl, "VariableDeclarator")); - if (!this.eat(types.comma)) break; - } - - return node; - } - - parseVarId(decl, kind) { - decl.id = this.parseBindingAtom(); - this.checkLVal(decl.id, kind === "var" ? BIND_VAR : BIND_LEXICAL, undefined, "variable declaration"); - } - - parseFunction(node, statement = FUNC_NO_FLAGS, isAsync = false) { - const isStatement = statement & FUNC_STATEMENT; - const isHangingStatement = statement & FUNC_HANGING_STATEMENT; - const requireId = !!isStatement && !(statement & FUNC_NULLABLE_ID); - this.initFunction(node, isAsync); - - if (this.match(types.star) && isHangingStatement) { - this.unexpected(this.state.start, "Generators can only be declared at the top level or inside a block"); - } - - node.generator = this.eat(types.star); - - if (isStatement) { - node.id = this.parseFunctionId(requireId); - } - - const oldInClassProperty = this.state.inClassProperty; - const oldYieldPos = this.state.yieldPos; - const oldAwaitPos = this.state.awaitPos; - this.state.inClassProperty = false; - this.state.yieldPos = 0; - this.state.awaitPos = 0; - this.scope.enter(functionFlags(node.async, node.generator)); - - if (!isStatement) { - node.id = this.parseFunctionId(); - } - - this.parseFunctionParams(node); - this.withTopicForbiddingContext(() => { - this.parseFunctionBodyAndFinish(node, isStatement ? "FunctionDeclaration" : "FunctionExpression"); - }); - this.scope.exit(); - - if (isStatement && !isHangingStatement) { - this.checkFunctionStatementId(node); - } - - this.state.inClassProperty = oldInClassProperty; - this.state.yieldPos = oldYieldPos; - this.state.awaitPos = oldAwaitPos; - return node; - } - - parseFunctionId(requireId) { - return requireId || this.match(types.name) ? this.parseIdentifier() : null; - } - - parseFunctionParams(node, allowModifiers) { - const oldInParameters = this.state.inParameters; - this.state.inParameters = true; - this.expect(types.parenL); - node.params = this.parseBindingList(types.parenR, false, allowModifiers); - this.state.inParameters = oldInParameters; - this.checkYieldAwaitInDefaultParams(); - } - - checkFunctionStatementId(node) { - if (!node.id) return; - this.checkLVal(node.id, this.state.strict || node.generator || node.async ? this.scope.treatFunctionsAsVar ? BIND_VAR : BIND_LEXICAL : BIND_FUNCTION, null, "function name"); - } - - parseClass(node, isStatement, optionalId) { - this.next(); - this.takeDecorators(node); - const oldStrict = this.state.strict; - this.state.strict = true; - this.parseClassId(node, isStatement, optionalId); - this.parseClassSuper(node); - node.body = this.parseClassBody(!!node.superClass); - this.state.strict = oldStrict; - return this.finishNode(node, isStatement ? "ClassDeclaration" : "ClassExpression"); - } - - isClassProperty() { - return this.match(types.eq) || this.match(types.semi) || this.match(types.braceR); - } - - isClassMethod() { - return this.match(types.parenL); - } - - isNonstaticConstructor(method) { - return !method.computed && !method.static && (method.key.name === "constructor" || method.key.value === "constructor"); - } - - parseClassBody(constructorAllowsSuper) { - this.state.classLevel++; - const state = { - hadConstructor: false - }; - let decorators = []; - const classBody = this.startNode(); - classBody.body = []; - this.expect(types.braceL); - this.withTopicForbiddingContext(() => { - while (!this.eat(types.braceR)) { - if (this.eat(types.semi)) { - if (decorators.length > 0) { - this.raise(this.state.lastTokEnd, "Decorators must not be followed by a semicolon"); - } - - continue; - } - - if (this.match(types.at)) { - decorators.push(this.parseDecorator()); - continue; - } - - const member = this.startNode(); - - if (decorators.length) { - member.decorators = decorators; - this.resetStartLocationFromNode(member, decorators[0]); - decorators = []; - } - - this.parseClassMember(classBody, member, state, constructorAllowsSuper); - - if (member.kind === "constructor" && member.decorators && member.decorators.length > 0) { - this.raise(member.start, "Decorators can't be used with a constructor. Did you mean '@dec class { ... }'?"); - } - } - }); - - if (decorators.length) { - this.raise(this.state.start, "You have trailing decorators with no method"); - } - - this.state.classLevel--; - return this.finishNode(classBody, "ClassBody"); - } - - parseClassMember(classBody, member, state, constructorAllowsSuper) { - let isStatic = false; - const containsEsc = this.state.containsEsc; - - if (this.match(types.name) && this.state.value === "static") { - const key = this.parseIdentifier(true); - - if (this.isClassMethod()) { - const method = member; - method.kind = "method"; - method.computed = false; - method.key = key; - method.static = false; - this.pushClassMethod(classBody, method, false, false, false, false); - return; - } else if (this.isClassProperty()) { - const prop = member; - prop.computed = false; - prop.key = key; - prop.static = false; - classBody.body.push(this.parseClassProperty(prop)); - return; - } else if (containsEsc) { - throw this.unexpected(); - } - - isStatic = true; - } - - this.parseClassMemberWithIsStatic(classBody, member, state, isStatic, constructorAllowsSuper); - } - - parseClassMemberWithIsStatic(classBody, member, state, isStatic, constructorAllowsSuper) { - const publicMethod = member; - const privateMethod = member; - const publicProp = member; - const privateProp = member; - const method = publicMethod; - const publicMember = publicMethod; - member.static = isStatic; - - if (this.eat(types.star)) { - method.kind = "method"; - this.parseClassPropertyName(method); - - if (method.key.type === "PrivateName") { - this.pushClassPrivateMethod(classBody, privateMethod, true, false); - return; - } - - if (this.isNonstaticConstructor(publicMethod)) { - this.raise(publicMethod.key.start, "Constructor can't be a generator"); - } - - this.pushClassMethod(classBody, publicMethod, true, false, false, false); - return; - } - - const containsEsc = this.state.containsEsc; - const key = this.parseClassPropertyName(member); - const isPrivate = key.type === "PrivateName"; - const isSimple = key.type === "Identifier"; - this.parsePostMemberNameModifiers(publicMember); - - if (this.isClassMethod()) { - method.kind = "method"; - - if (isPrivate) { - this.pushClassPrivateMethod(classBody, privateMethod, false, false); - return; - } - - const isConstructor = this.isNonstaticConstructor(publicMethod); - let allowsDirectSuper = false; - - if (isConstructor) { - publicMethod.kind = "constructor"; - - if (publicMethod.decorators) { - this.raise(publicMethod.start, "You can't attach decorators to a class constructor"); - } - - if (state.hadConstructor && !this.hasPlugin("typescript")) { - this.raise(key.start, "Duplicate constructor in the same class"); - } - - state.hadConstructor = true; - allowsDirectSuper = constructorAllowsSuper; - } - - this.pushClassMethod(classBody, publicMethod, false, false, isConstructor, allowsDirectSuper); - } else if (this.isClassProperty()) { - if (isPrivate) { - this.pushClassPrivateProperty(classBody, privateProp); - } else { - this.pushClassProperty(classBody, publicProp); - } - } else if (isSimple && key.name === "async" && !containsEsc && !this.isLineTerminator()) { - const isGenerator = this.eat(types.star); - method.kind = "method"; - this.parseClassPropertyName(method); - - if (method.key.type === "PrivateName") { - this.pushClassPrivateMethod(classBody, privateMethod, isGenerator, true); - } else { - if (this.isNonstaticConstructor(publicMethod)) { - this.raise(publicMethod.key.start, "Constructor can't be an async function"); - } - - this.pushClassMethod(classBody, publicMethod, isGenerator, true, false, false); - } - } else if (isSimple && (key.name === "get" || key.name === "set") && !containsEsc && !(this.match(types.star) && this.isLineTerminator())) { - method.kind = key.name; - this.parseClassPropertyName(publicMethod); - - if (method.key.type === "PrivateName") { - this.pushClassPrivateMethod(classBody, privateMethod, false, false); - } else { - if (this.isNonstaticConstructor(publicMethod)) { - this.raise(publicMethod.key.start, "Constructor can't have get/set modifier"); - } - - this.pushClassMethod(classBody, publicMethod, false, false, false, false); - } - - this.checkGetterSetterParams(publicMethod); - } else if (this.isLineTerminator()) { - if (isPrivate) { - this.pushClassPrivateProperty(classBody, privateProp); - } else { - this.pushClassProperty(classBody, publicProp); - } - } else { - this.unexpected(); - } - } - - parseClassPropertyName(member) { - const key = this.parsePropertyName(member); - - if (!member.computed && member.static && (key.name === "prototype" || key.value === "prototype")) { - this.raise(key.start, "Classes may not have static property named prototype"); - } - - if (key.type === "PrivateName" && key.id.name === "constructor") { - this.raise(key.start, "Classes may not have a private field named '#constructor'"); - } - - return key; - } - - pushClassProperty(classBody, prop) { - if (this.isNonstaticConstructor(prop)) { - this.raise(prop.key.start, "Classes may not have a non-static field named 'constructor'"); - } - - classBody.body.push(this.parseClassProperty(prop)); - } - - pushClassPrivateProperty(classBody, prop) { - this.expectPlugin("classPrivateProperties", prop.key.start); - classBody.body.push(this.parseClassPrivateProperty(prop)); - } - - pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper) { - classBody.body.push(this.parseMethod(method, isGenerator, isAsync, isConstructor, allowsDirectSuper, "ClassMethod", true)); - } - - pushClassPrivateMethod(classBody, method, isGenerator, isAsync) { - this.expectPlugin("classPrivateMethods", method.key.start); - classBody.body.push(this.parseMethod(method, isGenerator, isAsync, false, false, "ClassPrivateMethod", true)); - } - - parsePostMemberNameModifiers(methodOrProp) {} - - parseAccessModifier() { - return undefined; - } - - parseClassPrivateProperty(node) { - this.state.inClassProperty = true; - this.scope.enter(SCOPE_CLASS | SCOPE_SUPER); - node.value = this.eat(types.eq) ? this.parseMaybeAssign() : null; - this.semicolon(); - this.state.inClassProperty = false; - this.scope.exit(); - return this.finishNode(node, "ClassPrivateProperty"); - } - - parseClassProperty(node) { - if (!node.typeAnnotation) { - this.expectPlugin("classProperties"); - } - - this.state.inClassProperty = true; - this.scope.enter(SCOPE_CLASS | SCOPE_SUPER); - - if (this.match(types.eq)) { - this.expectPlugin("classProperties"); - this.next(); - node.value = this.parseMaybeAssign(); - } else { - node.value = null; - } - - this.semicolon(); - this.state.inClassProperty = false; - this.scope.exit(); - return this.finishNode(node, "ClassProperty"); - } - - parseClassId(node, isStatement, optionalId) { - if (this.match(types.name)) { - node.id = this.parseIdentifier(); - - if (isStatement) { - this.checkLVal(node.id, BIND_CLASS, undefined, "class name"); - } - } else { - if (optionalId || !isStatement) { - node.id = null; - } else { - this.unexpected(null, "A class name is required"); - } - } - } - - parseClassSuper(node) { - node.superClass = this.eat(types._extends) ? this.parseExprSubscripts() : null; - } - - parseExport(node) { - const hasDefault = this.maybeParseExportDefaultSpecifier(node); - const parseAfterDefault = !hasDefault || this.eat(types.comma); - const hasStar = parseAfterDefault && this.eatExportStar(node); - const hasNamespace = hasStar && this.maybeParseExportNamespaceSpecifier(node); - const parseAfterNamespace = parseAfterDefault && (!hasNamespace || this.eat(types.comma)); - const isFromRequired = hasDefault || hasStar; - - if (hasStar && !hasNamespace) { - if (hasDefault) this.unexpected(); - this.parseExportFrom(node, true); - return this.finishNode(node, "ExportAllDeclaration"); - } - - const hasSpecifiers = this.maybeParseExportNamedSpecifiers(node); - - if (hasDefault && parseAfterDefault && !hasStar && !hasSpecifiers || hasNamespace && parseAfterNamespace && !hasSpecifiers) { - throw this.unexpected(null, types.braceL); - } - - let hasDeclaration; - - if (isFromRequired || hasSpecifiers) { - hasDeclaration = false; - this.parseExportFrom(node, isFromRequired); - } else { - hasDeclaration = this.maybeParseExportDeclaration(node); - } - - if (isFromRequired || hasSpecifiers || hasDeclaration) { - this.checkExport(node, true, false, !!node.source); - return this.finishNode(node, "ExportNamedDeclaration"); - } - - if (this.eat(types._default)) { - node.declaration = this.parseExportDefaultExpression(); - this.checkExport(node, true, true); - return this.finishNode(node, "ExportDefaultDeclaration"); - } - - throw this.unexpected(null, types.braceL); - } - - eatExportStar(node) { - return this.eat(types.star); - } - - maybeParseExportDefaultSpecifier(node) { - if (this.isExportDefaultSpecifier()) { - this.expectPlugin("exportDefaultFrom"); - const specifier = this.startNode(); - specifier.exported = this.parseIdentifier(true); - node.specifiers = [this.finishNode(specifier, "ExportDefaultSpecifier")]; - return true; - } - - return false; - } - - maybeParseExportNamespaceSpecifier(node) { - if (this.isContextual("as")) { - if (!node.specifiers) node.specifiers = []; - this.expectPlugin("exportNamespaceFrom"); - const specifier = this.startNodeAt(this.state.lastTokStart, this.state.lastTokStartLoc); - this.next(); - specifier.exported = this.parseIdentifier(true); - node.specifiers.push(this.finishNode(specifier, "ExportNamespaceSpecifier")); - return true; - } - - return false; - } - - maybeParseExportNamedSpecifiers(node) { - if (this.match(types.braceL)) { - if (!node.specifiers) node.specifiers = []; - node.specifiers.push(...this.parseExportSpecifiers()); - node.source = null; - node.declaration = null; - return true; - } - - return false; - } - - maybeParseExportDeclaration(node) { - if (this.shouldParseExportDeclaration()) { - if (this.isContextual("async")) { - const next = this.lookahead(); - - if (next.type !== types._function) { - this.unexpected(next.start, `Unexpected token, expected "function"`); - } - } - - node.specifiers = []; - node.source = null; - node.declaration = this.parseExportDeclaration(node); - return true; - } - - return false; - } - - isAsyncFunction() { - if (!this.isContextual("async")) return false; - const { - pos - } = this.state; - skipWhiteSpace.lastIndex = pos; - const skip = skipWhiteSpace.exec(this.input); - if (!skip || !skip.length) return false; - const next = pos + skip[0].length; - return !lineBreak.test(this.input.slice(pos, next)) && this.input.slice(next, next + 8) === "function" && (next + 8 === this.length || !isIdentifierChar(this.input.charCodeAt(next + 8))); - } - - parseExportDefaultExpression() { - const expr = this.startNode(); - const isAsync = this.isAsyncFunction(); - - if (this.match(types._function) || isAsync) { - this.next(); - - if (isAsync) { - this.next(); - } - - return this.parseFunction(expr, FUNC_STATEMENT | FUNC_NULLABLE_ID, isAsync); - } else if (this.match(types._class)) { - return this.parseClass(expr, true, true); - } else if (this.match(types.at)) { - if (this.hasPlugin("decorators") && this.getPluginOption("decorators", "decoratorsBeforeExport")) { - this.unexpected(this.state.start, "Decorators must be placed *before* the 'export' keyword." + " You can set the 'decoratorsBeforeExport' option to false to use" + " the 'export @decorator class {}' syntax"); - } - - this.parseDecorators(false); - return this.parseClass(expr, true, true); - } else if (this.match(types._const) || this.match(types._var) || this.isLet()) { - return this.raise(this.state.start, "Only expressions, functions or classes are allowed as the `default` export."); - } else { - const res = this.parseMaybeAssign(); - this.semicolon(); - return res; - } - } - - parseExportDeclaration(node) { - return this.parseStatement(null); - } - - isExportDefaultSpecifier() { - if (this.match(types.name)) { - return this.state.value !== "async" && this.state.value !== "let"; - } - - if (!this.match(types._default)) { - return false; - } - - const lookahead = this.lookahead(); - return lookahead.type === types.comma || lookahead.type === types.name && lookahead.value === "from"; - } - - parseExportFrom(node, expect) { - if (this.eatContextual("from")) { - node.source = this.parseImportSource(); - this.checkExport(node); - } else { - if (expect) { - this.unexpected(); - } else { - node.source = null; - } - } - - this.semicolon(); - } - - shouldParseExportDeclaration() { - if (this.match(types.at)) { - this.expectOnePlugin(["decorators", "decorators-legacy"]); - - if (this.hasPlugin("decorators")) { - if (this.getPluginOption("decorators", "decoratorsBeforeExport")) { - this.unexpected(this.state.start, "Decorators must be placed *before* the 'export' keyword." + " You can set the 'decoratorsBeforeExport' option to false to use" + " the 'export @decorator class {}' syntax"); - } else { - return true; - } - } - } - - return this.state.type.keyword === "var" || this.state.type.keyword === "const" || this.state.type.keyword === "function" || this.state.type.keyword === "class" || this.isLet() || this.isAsyncFunction(); - } - - checkExport(node, checkNames, isDefault, isFrom) { - if (checkNames) { - if (isDefault) { - this.checkDuplicateExports(node, "default"); - } else if (node.specifiers && node.specifiers.length) { - for (let _i3 = 0, _node$specifiers = node.specifiers; _i3 < _node$specifiers.length; _i3++) { - const specifier = _node$specifiers[_i3]; - this.checkDuplicateExports(specifier, specifier.exported.name); - - if (!isFrom && specifier.local) { - this.checkReservedWord(specifier.local.name, specifier.local.start, true, false); - this.scope.checkLocalExport(specifier.local); - } - } - } else if (node.declaration) { - if (node.declaration.type === "FunctionDeclaration" || node.declaration.type === "ClassDeclaration") { - const id = node.declaration.id; - if (!id) throw new Error("Assertion failure"); - this.checkDuplicateExports(node, id.name); - } else if (node.declaration.type === "VariableDeclaration") { - for (let _i4 = 0, _node$declaration$dec = node.declaration.declarations; _i4 < _node$declaration$dec.length; _i4++) { - const declaration = _node$declaration$dec[_i4]; - this.checkDeclaration(declaration.id); - } - } - } - } - - const currentContextDecorators = this.state.decoratorStack[this.state.decoratorStack.length - 1]; - - if (currentContextDecorators.length) { - const isClass = node.declaration && (node.declaration.type === "ClassDeclaration" || node.declaration.type === "ClassExpression"); - - if (!node.declaration || !isClass) { - throw this.raise(node.start, "You can only use decorators on an export when exporting a class"); - } - - this.takeDecorators(node.declaration); - } - } - - checkDeclaration(node) { - if (node.type === "Identifier") { - this.checkDuplicateExports(node, node.name); - } else if (node.type === "ObjectPattern") { - for (let _i5 = 0, _node$properties = node.properties; _i5 < _node$properties.length; _i5++) { - const prop = _node$properties[_i5]; - this.checkDeclaration(prop); - } - } else if (node.type === "ArrayPattern") { - for (let _i6 = 0, _node$elements = node.elements; _i6 < _node$elements.length; _i6++) { - const elem = _node$elements[_i6]; - - if (elem) { - this.checkDeclaration(elem); - } - } - } else if (node.type === "ObjectProperty") { - this.checkDeclaration(node.value); - } else if (node.type === "RestElement") { - this.checkDeclaration(node.argument); - } else if (node.type === "AssignmentPattern") { - this.checkDeclaration(node.left); - } - } - - checkDuplicateExports(node, name) { - if (this.state.exportedIdentifiers.indexOf(name) > -1) { - throw this.raise(node.start, name === "default" ? "Only one default export allowed per module." : `\`${name}\` has already been exported. Exported identifiers must be unique.`); - } - - this.state.exportedIdentifiers.push(name); - } - - parseExportSpecifiers() { - const nodes = []; - let first = true; - this.expect(types.braceL); - - while (!this.eat(types.braceR)) { - if (first) { - first = false; - } else { - this.expect(types.comma); - if (this.eat(types.braceR)) break; - } - - const node = this.startNode(); - node.local = this.parseIdentifier(true); - node.exported = this.eatContextual("as") ? this.parseIdentifier(true) : node.local.__clone(); - nodes.push(this.finishNode(node, "ExportSpecifier")); - } - - return nodes; - } - - parseImport(node) { - node.specifiers = []; - - if (!this.match(types.string)) { - const hasDefault = this.maybeParseDefaultImportSpecifier(node); - const parseNext = !hasDefault || this.eat(types.comma); - const hasStar = parseNext && this.maybeParseStarImportSpecifier(node); - if (parseNext && !hasStar) this.parseNamedImportSpecifiers(node); - this.expectContextual("from"); - } - - node.source = this.parseImportSource(); - this.semicolon(); - return this.finishNode(node, "ImportDeclaration"); - } - - parseImportSource() { - if (!this.match(types.string)) this.unexpected(); - return this.parseExprAtom(); - } - - shouldParseDefaultImport(node) { - return this.match(types.name); - } - - parseImportSpecifierLocal(node, specifier, type, contextDescription) { - specifier.local = this.parseIdentifier(); - this.checkLVal(specifier.local, BIND_LEXICAL, undefined, contextDescription); - node.specifiers.push(this.finishNode(specifier, type)); - } - - maybeParseDefaultImportSpecifier(node) { - if (this.shouldParseDefaultImport(node)) { - this.parseImportSpecifierLocal(node, this.startNode(), "ImportDefaultSpecifier", "default import specifier"); - return true; - } - - return false; - } - - maybeParseStarImportSpecifier(node) { - if (this.match(types.star)) { - const specifier = this.startNode(); - this.next(); - this.expectContextual("as"); - this.parseImportSpecifierLocal(node, specifier, "ImportNamespaceSpecifier", "import namespace specifier"); - return true; - } - - return false; - } - - parseNamedImportSpecifiers(node) { - let first = true; - this.expect(types.braceL); - - while (!this.eat(types.braceR)) { - if (first) { - first = false; - } else { - if (this.eat(types.colon)) { - this.unexpected(null, "ES2015 named imports do not destructure. " + "Use another statement for destructuring after the import."); - } - - this.expect(types.comma); - if (this.eat(types.braceR)) break; - } - - this.parseImportSpecifier(node); - } - } - - parseImportSpecifier(node) { - const specifier = this.startNode(); - specifier.imported = this.parseIdentifier(true); - - if (this.eatContextual("as")) { - specifier.local = this.parseIdentifier(); - } else { - this.checkReservedWord(specifier.imported.name, specifier.start, true, true); - specifier.local = specifier.imported.__clone(); - } - - this.checkLVal(specifier.local, BIND_LEXICAL, undefined, "import specifier"); - node.specifiers.push(this.finishNode(specifier, "ImportSpecifier")); - } - -} - -class Parser extends StatementParser { - constructor(options, input) { - options = getOptions(options); - super(options, input); - const ScopeHandler = this.getScopeHandler(); - this.options = options; - this.inModule = this.options.sourceType === "module"; - this.scope = new ScopeHandler(this.raise.bind(this), this.inModule); - this.plugins = pluginsMap(this.options.plugins); - this.filename = options.sourceFilename; - } - - getScopeHandler() { - return ScopeHandler; - } - - parse() { - this.scope.enter(SCOPE_PROGRAM); - const file = this.startNode(); - const program = this.startNode(); - this.nextToken(); - return this.parseTopLevel(file, program); - } - -} - -function pluginsMap(plugins) { - const pluginMap = new Map(); - - for (let _i = 0; _i < plugins.length; _i++) { - const plugin = plugins[_i]; - const [name, options] = Array.isArray(plugin) ? plugin : [plugin, {}]; - if (!pluginMap.has(name)) pluginMap.set(name, options || {}); - } - - return pluginMap; -} - -function parse(input, options) { - if (options && options.sourceType === "unambiguous") { - options = Object.assign({}, options); - - try { - options.sourceType = "module"; - const parser = getParser(options, input); - const ast = parser.parse(); - if (!parser.sawUnambiguousESM) ast.program.sourceType = "script"; - return ast; - } catch (moduleError) { - try { - options.sourceType = "script"; - return getParser(options, input).parse(); - } catch (scriptError) {} - - throw moduleError; - } - } else { - return getParser(options, input).parse(); - } -} -function parseExpression(input, options) { - const parser = getParser(options, input); - - if (parser.options.strictMode) { - parser.state.strict = true; - } - - return parser.getExpression(); -} - -function getParser(options, input) { - let cls = Parser; - - if (options && options.plugins) { - validatePlugins(options.plugins); - cls = getParserClass(options.plugins); - } - - return new cls(options, input); -} - -const parserClassCache = {}; - -function getParserClass(pluginsFromOptions) { - const pluginList = mixinPluginNames.filter(name => hasPlugin(pluginsFromOptions, name)); - const key = pluginList.join("/"); - let cls = parserClassCache[key]; - - if (!cls) { - cls = Parser; - - for (let _i = 0; _i < pluginList.length; _i++) { - const plugin = pluginList[_i]; - cls = mixinPlugins[plugin](cls); - } - - parserClassCache[key] = cls; - } - - return cls; -} - -exports.parse = parse; -exports.parseExpression = parseExpression; -exports.tokTypes = types; - - -/***/ }), - -/***/ "./node_modules/@babel/template/lib/builder.js": -/*!*****************************************************!*\ - !*** ./node_modules/@babel/template/lib/builder.js ***! - \*****************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = createTemplateBuilder; - -var _options = __webpack_require__(/*! ./options */ "./node_modules/@babel/template/lib/options.js"); - -var _string = _interopRequireDefault(__webpack_require__(/*! ./string */ "./node_modules/@babel/template/lib/string.js")); - -var _literal = _interopRequireDefault(__webpack_require__(/*! ./literal */ "./node_modules/@babel/template/lib/literal.js")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -const NO_PLACEHOLDER = (0, _options.validate)({ - placeholderPattern: false -}); - -function createTemplateBuilder(formatter, defaultOpts) { - const templateFnCache = new WeakMap(); - const templateAstCache = new WeakMap(); - const cachedOpts = defaultOpts || (0, _options.validate)(null); - return Object.assign((tpl, ...args) => { - if (typeof tpl === "string") { - if (args.length > 1) throw new Error("Unexpected extra params."); - return extendedTrace((0, _string.default)(formatter, tpl, (0, _options.merge)(cachedOpts, (0, _options.validate)(args[0])))); - } else if (Array.isArray(tpl)) { - let builder = templateFnCache.get(tpl); - - if (!builder) { - builder = (0, _literal.default)(formatter, tpl, cachedOpts); - templateFnCache.set(tpl, builder); - } - - return extendedTrace(builder(args)); - } else if (typeof tpl === "object" && tpl) { - if (args.length > 0) throw new Error("Unexpected extra params."); - return createTemplateBuilder(formatter, (0, _options.merge)(cachedOpts, (0, _options.validate)(tpl))); - } - - throw new Error(`Unexpected template param ${typeof tpl}`); - }, { - ast: (tpl, ...args) => { - if (typeof tpl === "string") { - if (args.length > 1) throw new Error("Unexpected extra params."); - return (0, _string.default)(formatter, tpl, (0, _options.merge)((0, _options.merge)(cachedOpts, (0, _options.validate)(args[0])), NO_PLACEHOLDER))(); - } else if (Array.isArray(tpl)) { - let builder = templateAstCache.get(tpl); - - if (!builder) { - builder = (0, _literal.default)(formatter, tpl, (0, _options.merge)(cachedOpts, NO_PLACEHOLDER)); - templateAstCache.set(tpl, builder); - } - - return builder(args)(); - } - - throw new Error(`Unexpected template param ${typeof tpl}`); - } - }); -} - -function extendedTrace(fn) { - let rootStack = ""; - - try { - throw new Error(); - } catch (error) { - if (error.stack) { - rootStack = error.stack.split("\n").slice(3).join("\n"); - } - } - - return arg => { - try { - return fn(arg); - } catch (err) { - err.stack += `\n =============\n${rootStack}`; - throw err; - } - }; -} - -/***/ }), - -/***/ "./node_modules/@babel/template/lib/formatters.js": -/*!********************************************************!*\ - !*** ./node_modules/@babel/template/lib/formatters.js ***! - \********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.program = exports.expression = exports.statement = exports.statements = exports.smart = void 0; - -function makeStatementFormatter(fn) { - return { - code: str => `/* @babel/template */;\n${str}`, - validate: () => {}, - unwrap: ast => { - return fn(ast.program.body.slice(1)); - } - }; -} - -const smart = makeStatementFormatter(body => { - if (body.length > 1) { - return body; - } else { - return body[0]; - } -}); -exports.smart = smart; -const statements = makeStatementFormatter(body => body); -exports.statements = statements; -const statement = makeStatementFormatter(body => { - if (body.length === 0) { - throw new Error("Found nothing to return."); - } - - if (body.length > 1) { - throw new Error("Found multiple statements but wanted one"); - } - - return body[0]; -}); -exports.statement = statement; -const expression = { - code: str => `(\n${str}\n)`, - validate: ({ - program - }) => { - if (program.body.length > 1) { - throw new Error("Found multiple statements but wanted one"); - } - - const expression = program.body[0].expression; - - if (expression.start === 0) { - throw new Error("Parse result included parens."); - } - }, - unwrap: ast => ast.program.body[0].expression -}; -exports.expression = expression; -const program = { - code: str => str, - validate: () => {}, - unwrap: ast => ast.program -}; -exports.program = program; - -/***/ }), - -/***/ "./node_modules/@babel/template/lib/index.js": -/*!***************************************************!*\ - !*** ./node_modules/@babel/template/lib/index.js ***! - \***************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = exports.program = exports.expression = exports.statements = exports.statement = exports.smart = void 0; - -var formatters = _interopRequireWildcard(__webpack_require__(/*! ./formatters */ "./node_modules/@babel/template/lib/formatters.js")); - -var _builder = _interopRequireDefault(__webpack_require__(/*! ./builder */ "./node_modules/@babel/template/lib/builder.js")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -const smart = (0, _builder.default)(formatters.smart); -exports.smart = smart; -const statement = (0, _builder.default)(formatters.statement); -exports.statement = statement; -const statements = (0, _builder.default)(formatters.statements); -exports.statements = statements; -const expression = (0, _builder.default)(formatters.expression); -exports.expression = expression; -const program = (0, _builder.default)(formatters.program); -exports.program = program; - -var _default = Object.assign(smart.bind(undefined), { - smart, - statement, - statements, - expression, - program, - ast: smart.ast -}); - -exports.default = _default; - -/***/ }), - -/***/ "./node_modules/@babel/template/lib/literal.js": -/*!*****************************************************!*\ - !*** ./node_modules/@babel/template/lib/literal.js ***! - \*****************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = literalTemplate; - -var _options = __webpack_require__(/*! ./options */ "./node_modules/@babel/template/lib/options.js"); - -var _parse = _interopRequireDefault(__webpack_require__(/*! ./parse */ "./node_modules/@babel/template/lib/parse.js")); - -var _populate = _interopRequireDefault(__webpack_require__(/*! ./populate */ "./node_modules/@babel/template/lib/populate.js")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function literalTemplate(formatter, tpl, opts) { - const { - metadata, - names - } = buildLiteralData(formatter, tpl, opts); - return arg => { - const defaultReplacements = arg.reduce((acc, replacement, i) => { - acc[names[i]] = replacement; - return acc; - }, {}); - return arg => { - const replacements = (0, _options.normalizeReplacements)(arg); - - if (replacements) { - Object.keys(replacements).forEach(key => { - if (Object.prototype.hasOwnProperty.call(defaultReplacements, key)) { - throw new Error("Unexpected replacement overlap."); - } - }); - } - - return formatter.unwrap((0, _populate.default)(metadata, replacements ? Object.assign(replacements, defaultReplacements) : defaultReplacements)); - }; - }; -} - -function buildLiteralData(formatter, tpl, opts) { - let names; - let nameSet; - let metadata; - let prefix = ""; - - do { - prefix += "$"; - const result = buildTemplateCode(tpl, prefix); - names = result.names; - nameSet = new Set(names); - metadata = (0, _parse.default)(formatter, formatter.code(result.code), { - parser: opts.parser, - placeholderWhitelist: new Set(result.names.concat(opts.placeholderWhitelist ? Array.from(opts.placeholderWhitelist) : [])), - placeholderPattern: opts.placeholderPattern, - preserveComments: opts.preserveComments, - syntacticPlaceholders: opts.syntacticPlaceholders - }); - } while (metadata.placeholders.some(placeholder => placeholder.isDuplicate && nameSet.has(placeholder.name))); - - return { - metadata, - names - }; -} - -function buildTemplateCode(tpl, prefix) { - const names = []; - let code = tpl[0]; - - for (let i = 1; i < tpl.length; i++) { - const value = `${prefix}${i - 1}`; - names.push(value); - code += value + tpl[i]; - } - - return { - names, - code - }; -} - -/***/ }), - -/***/ "./node_modules/@babel/template/lib/options.js": -/*!*****************************************************!*\ - !*** ./node_modules/@babel/template/lib/options.js ***! - \*****************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.merge = merge; -exports.validate = validate; -exports.normalizeReplacements = normalizeReplacements; - -function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } - -function merge(a, b) { - const { - placeholderWhitelist = a.placeholderWhitelist, - placeholderPattern = a.placeholderPattern, - preserveComments = a.preserveComments, - syntacticPlaceholders = a.syntacticPlaceholders - } = b; - return { - parser: Object.assign({}, a.parser, b.parser), - placeholderWhitelist, - placeholderPattern, - preserveComments, - syntacticPlaceholders - }; -} - -function validate(opts) { - if (opts != null && typeof opts !== "object") { - throw new Error("Unknown template options."); - } - - const _ref = opts || {}, - { - placeholderWhitelist, - placeholderPattern, - preserveComments, - syntacticPlaceholders - } = _ref, - parser = _objectWithoutPropertiesLoose(_ref, ["placeholderWhitelist", "placeholderPattern", "preserveComments", "syntacticPlaceholders"]); - - if (placeholderWhitelist != null && !(placeholderWhitelist instanceof Set)) { - throw new Error("'.placeholderWhitelist' must be a Set, null, or undefined"); - } - - if (placeholderPattern != null && !(placeholderPattern instanceof RegExp) && placeholderPattern !== false) { - throw new Error("'.placeholderPattern' must be a RegExp, false, null, or undefined"); - } - - if (preserveComments != null && typeof preserveComments !== "boolean") { - throw new Error("'.preserveComments' must be a boolean, null, or undefined"); - } - - if (syntacticPlaceholders != null && typeof syntacticPlaceholders !== "boolean") { - throw new Error("'.syntacticPlaceholders' must be a boolean, null, or undefined"); - } - - if (syntacticPlaceholders === true && (placeholderWhitelist != null || placeholderPattern != null)) { - throw new Error("'.placeholderWhitelist' and '.placeholderPattern' aren't compatible" + " with '.syntacticPlaceholders: true'"); - } - - return { - parser, - placeholderWhitelist: placeholderWhitelist || undefined, - placeholderPattern: placeholderPattern == null ? undefined : placeholderPattern, - preserveComments: preserveComments == null ? false : preserveComments, - syntacticPlaceholders: syntacticPlaceholders == null ? undefined : syntacticPlaceholders - }; -} - -function normalizeReplacements(replacements) { - if (Array.isArray(replacements)) { - return replacements.reduce((acc, replacement, i) => { - acc["$" + i] = replacement; - return acc; - }, {}); - } else if (typeof replacements === "object" || replacements == null) { - return replacements || undefined; - } - - throw new Error("Template replacements must be an array, object, null, or undefined"); -} - -/***/ }), - -/***/ "./node_modules/@babel/template/lib/parse.js": -/*!***************************************************!*\ - !*** ./node_modules/@babel/template/lib/parse.js ***! - \***************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = parseAndBuildMetadata; - -function t() { - const data = _interopRequireWildcard(__webpack_require__(/*! @babel/types */ "./node_modules/@babel/types/lib/index.js")); - - t = function () { - return data; - }; - - return data; -} - -function _parser() { - const data = __webpack_require__(/*! @babel/parser */ "./node_modules/@babel/parser/lib/index.js"); - - _parser = function () { - return data; - }; - - return data; -} - -function _codeFrame() { - const data = __webpack_require__(/*! @babel/code-frame */ "./node_modules/@babel/code-frame/lib/index.js"); - - _codeFrame = function () { - return data; - }; - - return data; -} - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -const PATTERN = /^[_$A-Z0-9]+$/; - -function parseAndBuildMetadata(formatter, code, opts) { - const ast = parseWithCodeFrame(code, opts.parser); - const { - placeholderWhitelist, - placeholderPattern, - preserveComments, - syntacticPlaceholders - } = opts; - t().removePropertiesDeep(ast, { - preserveComments - }); - formatter.validate(ast); - const syntactic = { - placeholders: [], - placeholderNames: new Set() - }; - const legacy = { - placeholders: [], - placeholderNames: new Set() - }; - const isLegacyRef = { - value: undefined - }; - t().traverse(ast, placeholderVisitorHandler, { - syntactic, - legacy, - isLegacyRef, - placeholderWhitelist, - placeholderPattern, - syntacticPlaceholders - }); - return Object.assign({ - ast - }, isLegacyRef.value ? legacy : syntactic); -} - -function placeholderVisitorHandler(node, ancestors, state) { - let name; - - if (t().isPlaceholder(node)) { - if (state.syntacticPlaceholders === false) { - throw new Error("%%foo%%-style placeholders can't be used when " + "'.syntacticPlaceholders' is false."); - } else { - name = node.name.name; - state.isLegacyRef.value = false; - } - } else if (state.isLegacyRef.value === false || state.syntacticPlaceholders) { - return; - } else if (t().isIdentifier(node) || t().isJSXIdentifier(node)) { - name = node.name; - state.isLegacyRef.value = true; - } else if (t().isStringLiteral(node)) { - name = node.value; - state.isLegacyRef.value = true; - } else { - return; - } - - if (!state.isLegacyRef.value && (state.placeholderPattern != null || state.placeholderWhitelist != null)) { - throw new Error("'.placeholderWhitelist' and '.placeholderPattern' aren't compatible" + " with '.syntacticPlaceholders: true'"); - } - - if (state.isLegacyRef.value && (state.placeholderPattern === false || !(state.placeholderPattern || PATTERN).test(name)) && (!state.placeholderWhitelist || !state.placeholderWhitelist.has(name))) { - return; - } - - ancestors = ancestors.slice(); - const { - node: parent, - key - } = ancestors[ancestors.length - 1]; - let type; - - if (t().isStringLiteral(node) || t().isPlaceholder(node, { - expectedNode: "StringLiteral" - })) { - type = "string"; - } else if (t().isNewExpression(parent) && key === "arguments" || t().isCallExpression(parent) && key === "arguments" || t().isFunction(parent) && key === "params") { - type = "param"; - } else if (t().isExpressionStatement(parent) && !t().isPlaceholder(node)) { - type = "statement"; - ancestors = ancestors.slice(0, -1); - } else if (t().isStatement(node) && t().isPlaceholder(node)) { - type = "statement"; - } else { - type = "other"; - } - - const { - placeholders, - placeholderNames - } = state.isLegacyRef.value ? state.legacy : state.syntactic; - placeholders.push({ - name, - type, - resolve: ast => resolveAncestors(ast, ancestors), - isDuplicate: placeholderNames.has(name) - }); - placeholderNames.add(name); -} - -function resolveAncestors(ast, ancestors) { - let parent = ast; - - for (let i = 0; i < ancestors.length - 1; i++) { - const { - key, - index - } = ancestors[i]; - - if (index === undefined) { - parent = parent[key]; - } else { - parent = parent[key][index]; - } - } - - const { - key, - index - } = ancestors[ancestors.length - 1]; - return { - parent, - key, - index - }; -} - -function parseWithCodeFrame(code, parserOpts) { - parserOpts = Object.assign({ - allowReturnOutsideFunction: true, - allowSuperOutsideMethod: true, - sourceType: "module" - }, parserOpts, { - plugins: (parserOpts.plugins || []).concat("placeholders") - }); - - try { - return (0, _parser().parse)(code, parserOpts); - } catch (err) { - const loc = err.loc; - - if (loc) { - err.message += "\n" + (0, _codeFrame().codeFrameColumns)(code, { - start: loc - }); - err.code = "BABEL_TEMPLATE_PARSE_ERROR"; - } - - throw err; - } -} - -/***/ }), - -/***/ "./node_modules/@babel/template/lib/populate.js": -/*!******************************************************!*\ - !*** ./node_modules/@babel/template/lib/populate.js ***! - \******************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = populatePlaceholders; - -function t() { - const data = _interopRequireWildcard(__webpack_require__(/*! @babel/types */ "./node_modules/@babel/types/lib/index.js")); - - t = function () { - return data; - }; - - return data; -} - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -function populatePlaceholders(metadata, replacements) { - const ast = t().cloneNode(metadata.ast); - - if (replacements) { - metadata.placeholders.forEach(placeholder => { - if (!Object.prototype.hasOwnProperty.call(replacements, placeholder.name)) { - const placeholderName = placeholder.name; - throw new Error(`Error: No substitution given for "${placeholderName}". If this is not meant to be a - placeholder you may want to consider passing one of the following options to @babel/template: - - { placeholderPattern: false, placeholderWhitelist: new Set(['${placeholderName}'])} - - { placeholderPattern: /^${placeholderName}$/ }`); - } - }); - Object.keys(replacements).forEach(key => { - if (!metadata.placeholderNames.has(key)) { - throw new Error(`Unknown substitution "${key}" given`); - } - }); - } - - metadata.placeholders.slice().reverse().forEach(placeholder => { - try { - applyReplacement(placeholder, ast, replacements && replacements[placeholder.name] || null); - } catch (e) { - e.message = `@babel/template placeholder "${placeholder.name}": ${e.message}`; - throw e; - } - }); - return ast; -} - -function applyReplacement(placeholder, ast, replacement) { - if (placeholder.isDuplicate) { - if (Array.isArray(replacement)) { - replacement = replacement.map(node => t().cloneNode(node)); - } else if (typeof replacement === "object") { - replacement = t().cloneNode(replacement); - } - } - - const { - parent, - key, - index - } = placeholder.resolve(ast); - - if (placeholder.type === "string") { - if (typeof replacement === "string") { - replacement = t().stringLiteral(replacement); - } - - if (!replacement || !t().isStringLiteral(replacement)) { - throw new Error("Expected string substitution"); - } - } else if (placeholder.type === "statement") { - if (index === undefined) { - if (!replacement) { - replacement = t().emptyStatement(); - } else if (Array.isArray(replacement)) { - replacement = t().blockStatement(replacement); - } else if (typeof replacement === "string") { - replacement = t().expressionStatement(t().identifier(replacement)); - } else if (!t().isStatement(replacement)) { - replacement = t().expressionStatement(replacement); - } - } else { - if (replacement && !Array.isArray(replacement)) { - if (typeof replacement === "string") { - replacement = t().identifier(replacement); - } - - if (!t().isStatement(replacement)) { - replacement = t().expressionStatement(replacement); - } - } - } - } else if (placeholder.type === "param") { - if (typeof replacement === "string") { - replacement = t().identifier(replacement); - } - - if (index === undefined) throw new Error("Assertion failure."); - } else { - if (typeof replacement === "string") { - replacement = t().identifier(replacement); - } - - if (Array.isArray(replacement)) { - throw new Error("Cannot replace single expression with an array."); - } - } - - if (index === undefined) { - t().validate(parent, key, replacement); - parent[key] = replacement; - } else { - const items = parent[key].slice(); - - if (placeholder.type === "statement" || placeholder.type === "param") { - if (replacement == null) { - items.splice(index, 1); - } else if (Array.isArray(replacement)) { - items.splice(index, 1, ...replacement); - } else { - items[index] = replacement; - } - } else { - items[index] = replacement; - } - - t().validate(parent, key, items); - parent[key] = items; - } -} - -/***/ }), - -/***/ "./node_modules/@babel/template/lib/string.js": -/*!****************************************************!*\ - !*** ./node_modules/@babel/template/lib/string.js ***! - \****************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = stringTemplate; - -var _options = __webpack_require__(/*! ./options */ "./node_modules/@babel/template/lib/options.js"); - -var _parse = _interopRequireDefault(__webpack_require__(/*! ./parse */ "./node_modules/@babel/template/lib/parse.js")); - -var _populate = _interopRequireDefault(__webpack_require__(/*! ./populate */ "./node_modules/@babel/template/lib/populate.js")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function stringTemplate(formatter, code, opts) { - code = formatter.code(code); - let metadata; - return arg => { - const replacements = (0, _options.normalizeReplacements)(arg); - if (!metadata) metadata = (0, _parse.default)(formatter, code, opts); - return formatter.unwrap((0, _populate.default)(metadata, replacements)); - }; -} - -/***/ }), - -/***/ "./node_modules/@babel/traverse/lib/cache.js": -/*!***************************************************!*\ - !*** ./node_modules/@babel/traverse/lib/cache.js ***! - \***************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.clear = clear; -exports.clearPath = clearPath; -exports.clearScope = clearScope; -exports.scope = exports.path = void 0; -let path = new WeakMap(); -exports.path = path; -let scope = new WeakMap(); -exports.scope = scope; - -function clear() { - clearPath(); - clearScope(); -} - -function clearPath() { - exports.path = path = new WeakMap(); -} - -function clearScope() { - exports.scope = scope = new WeakMap(); -} - -/***/ }), - -/***/ "./node_modules/@babel/traverse/lib/context.js": -/*!*****************************************************!*\ - !*** ./node_modules/@babel/traverse/lib/context.js ***! - \*****************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -var _path = _interopRequireDefault(__webpack_require__(/*! ./path */ "./node_modules/@babel/traverse/lib/path/index.js")); - -function t() { - const data = _interopRequireWildcard(__webpack_require__(/*! @babel/types */ "./node_modules/@babel/types/lib/index.js")); - - t = function () { - return data; - }; - - return data; -} - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -const testing = "development" === "test"; - -class TraversalContext { - constructor(scope, opts, state, parentPath) { - this.queue = null; - this.parentPath = parentPath; - this.scope = scope; - this.state = state; - this.opts = opts; - } - - shouldVisit(node) { - const opts = this.opts; - if (opts.enter || opts.exit) return true; - if (opts[node.type]) return true; - const keys = t().VISITOR_KEYS[node.type]; - if (!keys || !keys.length) return false; - - for (const key of keys) { - if (node[key]) return true; - } - - return false; - } - - create(node, obj, key, listKey) { - return _path.default.get({ - parentPath: this.parentPath, - parent: node, - container: obj, - key: key, - listKey - }); - } - - maybeQueue(path, notPriority) { - if (this.trap) { - throw new Error("Infinite cycle detected"); - } - - if (this.queue) { - if (notPriority) { - this.queue.push(path); - } else { - this.priorityQueue.push(path); - } - } - } - - visitMultiple(container, parent, listKey) { - if (container.length === 0) return false; - const queue = []; - - for (let key = 0; key < container.length; key++) { - const node = container[key]; - - if (node && this.shouldVisit(node)) { - queue.push(this.create(parent, container, key, listKey)); - } - } - - return this.visitQueue(queue); - } - - visitSingle(node, key) { - if (this.shouldVisit(node[key])) { - return this.visitQueue([this.create(node, node, key)]); - } else { - return false; - } - } - - visitQueue(queue) { - this.queue = queue; - this.priorityQueue = []; - const visited = []; - let stop = false; - - for (const path of queue) { - path.resync(); - - if (path.contexts.length === 0 || path.contexts[path.contexts.length - 1] !== this) { - path.pushContext(this); - } - - if (path.key === null) continue; - - if (testing && queue.length >= 10000) { - this.trap = true; - } - - if (visited.indexOf(path.node) >= 0) continue; - visited.push(path.node); - - if (path.visit()) { - stop = true; - break; - } - - if (this.priorityQueue.length) { - stop = this.visitQueue(this.priorityQueue); - this.priorityQueue = []; - this.queue = queue; - if (stop) break; - } - } - - for (const path of queue) { - path.popContext(); - } - - this.queue = null; - return stop; - } - - visit(node, key) { - const nodes = node[key]; - if (!nodes) return false; - - if (Array.isArray(nodes)) { - return this.visitMultiple(nodes, node, key); - } else { - return this.visitSingle(node, key); - } - } - -} - -exports.default = TraversalContext; - -/***/ }), - -/***/ "./node_modules/@babel/traverse/lib/hub.js": -/*!*************************************************!*\ - !*** ./node_modules/@babel/traverse/lib/hub.js ***! - \*************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -class Hub { - getCode() {} - - getScope() {} - - addHelper() { - throw new Error("Helpers are not supported by the default hub."); - } - - buildError(node, msg, Error = TypeError) { - return new Error(msg); - } - -} - -exports.default = Hub; - -/***/ }), - -/***/ "./node_modules/@babel/traverse/lib/index.js": -/*!***************************************************!*\ - !*** ./node_modules/@babel/traverse/lib/index.js ***! - \***************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = traverse; -Object.defineProperty(exports, "NodePath", { - enumerable: true, - get: function () { - return _path.default; - } -}); -Object.defineProperty(exports, "Scope", { - enumerable: true, - get: function () { - return _scope.default; - } -}); -Object.defineProperty(exports, "Hub", { - enumerable: true, - get: function () { - return _hub.default; - } -}); -exports.visitors = void 0; - -var _context = _interopRequireDefault(__webpack_require__(/*! ./context */ "./node_modules/@babel/traverse/lib/context.js")); - -var visitors = _interopRequireWildcard(__webpack_require__(/*! ./visitors */ "./node_modules/@babel/traverse/lib/visitors.js")); - -exports.visitors = visitors; - -function _includes() { - const data = _interopRequireDefault(__webpack_require__(/*! lodash/includes */ "./node_modules/lodash/includes.js")); - - _includes = function () { - return data; - }; - - return data; -} - -function t() { - const data = _interopRequireWildcard(__webpack_require__(/*! @babel/types */ "./node_modules/@babel/types/lib/index.js")); - - t = function () { - return data; - }; - - return data; -} - -var cache = _interopRequireWildcard(__webpack_require__(/*! ./cache */ "./node_modules/@babel/traverse/lib/cache.js")); - -var _path = _interopRequireDefault(__webpack_require__(/*! ./path */ "./node_modules/@babel/traverse/lib/path/index.js")); - -var _scope = _interopRequireDefault(__webpack_require__(/*! ./scope */ "./node_modules/@babel/traverse/lib/scope/index.js")); - -var _hub = _interopRequireDefault(__webpack_require__(/*! ./hub */ "./node_modules/@babel/traverse/lib/hub.js")); - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function traverse(parent, opts, scope, state, parentPath) { - if (!parent) return; - if (!opts) opts = {}; - - if (!opts.noScope && !scope) { - if (parent.type !== "Program" && parent.type !== "File") { - throw new Error("You must pass a scope and parentPath unless traversing a Program/File. " + `Instead of that you tried to traverse a ${parent.type} node without ` + "passing scope and parentPath."); - } - } - - visitors.explode(opts); - traverse.node(parent, opts, scope, state, parentPath); -} - -traverse.visitors = visitors; -traverse.verify = visitors.verify; -traverse.explode = visitors.explode; - -traverse.cheap = function (node, enter) { - return t().traverseFast(node, enter); -}; - -traverse.node = function (node, opts, scope, state, parentPath, skipKeys) { - const keys = t().VISITOR_KEYS[node.type]; - if (!keys) return; - const context = new _context.default(scope, opts, state, parentPath); - - for (const key of keys) { - if (skipKeys && skipKeys[key]) continue; - if (context.visit(node, key)) return; - } -}; - -traverse.clearNode = function (node, opts) { - t().removeProperties(node, opts); - cache.path.delete(node); -}; - -traverse.removeProperties = function (tree, opts) { - t().traverseFast(tree, traverse.clearNode, opts); - return tree; -}; - -function hasBlacklistedType(path, state) { - if (path.node.type === state.type) { - state.has = true; - path.stop(); - } -} - -traverse.hasType = function (tree, type, blacklistTypes) { - if ((0, _includes().default)(blacklistTypes, tree.type)) return false; - if (tree.type === type) return true; - const state = { - has: false, - type: type - }; - traverse(tree, { - noScope: true, - blacklist: blacklistTypes, - enter: hasBlacklistedType - }, null, state); - return state.has; -}; - -traverse.cache = cache; - -/***/ }), - -/***/ "./node_modules/@babel/traverse/lib/path/ancestry.js": -/*!***********************************************************!*\ - !*** ./node_modules/@babel/traverse/lib/path/ancestry.js ***! - \***********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.findParent = findParent; -exports.find = find; -exports.getFunctionParent = getFunctionParent; -exports.getStatementParent = getStatementParent; -exports.getEarliestCommonAncestorFrom = getEarliestCommonAncestorFrom; -exports.getDeepestCommonAncestorFrom = getDeepestCommonAncestorFrom; -exports.getAncestry = getAncestry; -exports.isAncestor = isAncestor; -exports.isDescendant = isDescendant; -exports.inType = inType; - -function t() { - const data = _interopRequireWildcard(__webpack_require__(/*! @babel/types */ "./node_modules/@babel/types/lib/index.js")); - - t = function () { - return data; - }; - - return data; -} - -var _index = _interopRequireDefault(__webpack_require__(/*! ./index */ "./node_modules/@babel/traverse/lib/path/index.js")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -function findParent(callback) { - let path = this; - - while (path = path.parentPath) { - if (callback(path)) return path; - } - - return null; -} - -function find(callback) { - let path = this; - - do { - if (callback(path)) return path; - } while (path = path.parentPath); - - return null; -} - -function getFunctionParent() { - return this.findParent(p => p.isFunction()); -} - -function getStatementParent() { - let path = this; - - do { - if (!path.parentPath || Array.isArray(path.container) && path.isStatement()) { - break; - } else { - path = path.parentPath; - } - } while (path); - - if (path && (path.isProgram() || path.isFile())) { - throw new Error("File/Program node, we can't possibly find a statement parent to this"); - } - - return path; -} - -function getEarliestCommonAncestorFrom(paths) { - return this.getDeepestCommonAncestorFrom(paths, function (deepest, i, ancestries) { - let earliest; - const keys = t().VISITOR_KEYS[deepest.type]; - - for (const ancestry of ancestries) { - const path = ancestry[i + 1]; - - if (!earliest) { - earliest = path; - continue; - } - - if (path.listKey && earliest.listKey === path.listKey) { - if (path.key < earliest.key) { - earliest = path; - continue; - } - } - - const earliestKeyIndex = keys.indexOf(earliest.parentKey); - const currentKeyIndex = keys.indexOf(path.parentKey); - - if (earliestKeyIndex > currentKeyIndex) { - earliest = path; - } - } - - return earliest; - }); -} - -function getDeepestCommonAncestorFrom(paths, filter) { - if (!paths.length) { - return this; - } - - if (paths.length === 1) { - return paths[0]; - } - - let minDepth = Infinity; - let lastCommonIndex, lastCommon; - const ancestries = paths.map(path => { - const ancestry = []; - - do { - ancestry.unshift(path); - } while ((path = path.parentPath) && path !== this); - - if (ancestry.length < minDepth) { - minDepth = ancestry.length; - } - - return ancestry; - }); - const first = ancestries[0]; - - depthLoop: for (let i = 0; i < minDepth; i++) { - const shouldMatch = first[i]; - - for (const ancestry of ancestries) { - if (ancestry[i] !== shouldMatch) { - break depthLoop; - } - } - - lastCommonIndex = i; - lastCommon = shouldMatch; - } - - if (lastCommon) { - if (filter) { - return filter(lastCommon, lastCommonIndex, ancestries); - } else { - return lastCommon; - } - } else { - throw new Error("Couldn't find intersection"); - } -} - -function getAncestry() { - let path = this; - const paths = []; - - do { - paths.push(path); - } while (path = path.parentPath); - - return paths; -} - -function isAncestor(maybeDescendant) { - return maybeDescendant.isDescendant(this); -} - -function isDescendant(maybeAncestor) { - return !!this.findParent(parent => parent === maybeAncestor); -} - -function inType() { - let path = this; - - while (path) { - for (const type of arguments) { - if (path.node.type === type) return true; - } - - path = path.parentPath; - } - - return false; -} - -/***/ }), - -/***/ "./node_modules/@babel/traverse/lib/path/comments.js": -/*!***********************************************************!*\ - !*** ./node_modules/@babel/traverse/lib/path/comments.js ***! - \***********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.shareCommentsWithSiblings = shareCommentsWithSiblings; -exports.addComment = addComment; -exports.addComments = addComments; - -function t() { - const data = _interopRequireWildcard(__webpack_require__(/*! @babel/types */ "./node_modules/@babel/types/lib/index.js")); - - t = function () { - return data; - }; - - return data; -} - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -function shareCommentsWithSiblings() { - if (typeof this.key === "string") return; - const node = this.node; - if (!node) return; - const trailing = node.trailingComments; - const leading = node.leadingComments; - if (!trailing && !leading) return; - const prev = this.getSibling(this.key - 1); - const next = this.getSibling(this.key + 1); - const hasPrev = Boolean(prev.node); - const hasNext = Boolean(next.node); - - if (hasPrev && hasNext) {} else if (hasPrev) { - prev.addComments("trailing", trailing); - } else if (hasNext) { - next.addComments("leading", leading); - } -} - -function addComment(type, content, line) { - t().addComment(this.node, type, content, line); -} - -function addComments(type, comments) { - t().addComments(this.node, type, comments); -} - -/***/ }), - -/***/ "./node_modules/@babel/traverse/lib/path/context.js": -/*!**********************************************************!*\ - !*** ./node_modules/@babel/traverse/lib/path/context.js ***! - \**********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.call = call; -exports._call = _call; -exports.isBlacklisted = isBlacklisted; -exports.visit = visit; -exports.skip = skip; -exports.skipKey = skipKey; -exports.stop = stop; -exports.setScope = setScope; -exports.setContext = setContext; -exports.resync = resync; -exports._resyncParent = _resyncParent; -exports._resyncKey = _resyncKey; -exports._resyncList = _resyncList; -exports._resyncRemoved = _resyncRemoved; -exports.popContext = popContext; -exports.pushContext = pushContext; -exports.setup = setup; -exports.setKey = setKey; -exports.requeue = requeue; -exports._getQueueContexts = _getQueueContexts; - -var _index = _interopRequireDefault(__webpack_require__(/*! ../index */ "./node_modules/@babel/traverse/lib/index.js")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function call(key) { - const opts = this.opts; - this.debug(key); - - if (this.node) { - if (this._call(opts[key])) return true; - } - - if (this.node) { - return this._call(opts[this.node.type] && opts[this.node.type][key]); - } - - return false; -} - -function _call(fns) { - if (!fns) return false; - - for (const fn of fns) { - if (!fn) continue; - const node = this.node; - if (!node) return true; - const ret = fn.call(this.state, this, this.state); - - if (ret && typeof ret === "object" && typeof ret.then === "function") { - throw new Error(`You appear to be using a plugin with an async traversal visitor, ` + `which your current version of Babel does not support. ` + `If you're using a published plugin, you may need to upgrade ` + `your @babel/core version.`); - } - - if (ret) { - throw new Error(`Unexpected return value from visitor method ${fn}`); - } - - if (this.node !== node) return true; - if (this.shouldStop || this.shouldSkip || this.removed) return true; - } - - return false; -} - -function isBlacklisted() { - const blacklist = this.opts.blacklist; - return blacklist && blacklist.indexOf(this.node.type) > -1; -} - -function visit() { - if (!this.node) { - return false; - } - - if (this.isBlacklisted()) { - return false; - } - - if (this.opts.shouldSkip && this.opts.shouldSkip(this)) { - return false; - } - - if (this.call("enter") || this.shouldSkip) { - this.debug("Skip..."); - return this.shouldStop; - } - - this.debug("Recursing into..."); - - _index.default.node(this.node, this.opts, this.scope, this.state, this, this.skipKeys); - - this.call("exit"); - return this.shouldStop; -} - -function skip() { - this.shouldSkip = true; -} - -function skipKey(key) { - this.skipKeys[key] = true; -} - -function stop() { - this.shouldStop = true; - this.shouldSkip = true; -} - -function setScope() { - if (this.opts && this.opts.noScope) return; - let path = this.parentPath; - let target; - - while (path && !target) { - if (path.opts && path.opts.noScope) return; - target = path.scope; - path = path.parentPath; - } - - this.scope = this.getScope(target); - if (this.scope) this.scope.init(); -} - -function setContext(context) { - this.shouldSkip = false; - this.shouldStop = false; - this.removed = false; - this.skipKeys = {}; - - if (context) { - this.context = context; - this.state = context.state; - this.opts = context.opts; - } - - this.setScope(); - return this; -} - -function resync() { - if (this.removed) return; - - this._resyncParent(); - - this._resyncList(); - - this._resyncKey(); -} - -function _resyncParent() { - if (this.parentPath) { - this.parent = this.parentPath.node; - } -} - -function _resyncKey() { - if (!this.container) return; - if (this.node === this.container[this.key]) return; - - if (Array.isArray(this.container)) { - for (let i = 0; i < this.container.length; i++) { - if (this.container[i] === this.node) { - return this.setKey(i); - } - } - } else { - for (const key of Object.keys(this.container)) { - if (this.container[key] === this.node) { - return this.setKey(key); - } - } - } - - this.key = null; -} - -function _resyncList() { - if (!this.parent || !this.inList) return; - const newContainer = this.parent[this.listKey]; - if (this.container === newContainer) return; - this.container = newContainer || null; -} - -function _resyncRemoved() { - if (this.key == null || !this.container || this.container[this.key] !== this.node) { - this._markRemoved(); - } -} - -function popContext() { - this.contexts.pop(); - - if (this.contexts.length > 0) { - this.setContext(this.contexts[this.contexts.length - 1]); - } else { - this.setContext(undefined); - } -} - -function pushContext(context) { - this.contexts.push(context); - this.setContext(context); -} - -function setup(parentPath, container, listKey, key) { - this.inList = !!listKey; - this.listKey = listKey; - this.parentKey = listKey || key; - this.container = container; - this.parentPath = parentPath || this.parentPath; - this.setKey(key); -} - -function setKey(key) { - this.key = key; - this.node = this.container[this.key]; - this.type = this.node && this.node.type; -} - -function requeue(pathToQueue = this) { - if (pathToQueue.removed) return; - const contexts = this.contexts; - - for (const context of contexts) { - context.maybeQueue(pathToQueue); - } -} - -function _getQueueContexts() { - let path = this; - let contexts = this.contexts; - - while (!contexts.length) { - path = path.parentPath; - if (!path) break; - contexts = path.contexts; - } - - return contexts; -} - -/***/ }), - -/***/ "./node_modules/@babel/traverse/lib/path/conversion.js": -/*!*************************************************************!*\ - !*** ./node_modules/@babel/traverse/lib/path/conversion.js ***! - \*************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.toComputedKey = toComputedKey; -exports.ensureBlock = ensureBlock; -exports.arrowFunctionToShadowed = arrowFunctionToShadowed; -exports.unwrapFunctionEnvironment = unwrapFunctionEnvironment; -exports.arrowFunctionToExpression = arrowFunctionToExpression; - -function t() { - const data = _interopRequireWildcard(__webpack_require__(/*! @babel/types */ "./node_modules/@babel/types/lib/index.js")); - - t = function () { - return data; - }; - - return data; -} - -function _helperFunctionName() { - const data = _interopRequireDefault(__webpack_require__(/*! @babel/helper-function-name */ "./node_modules/@babel/helper-function-name/lib/index.js")); - - _helperFunctionName = function () { - return data; - }; - - return data; -} - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -function toComputedKey() { - const node = this.node; - let key; - - if (this.isMemberExpression()) { - key = node.property; - } else if (this.isProperty() || this.isMethod()) { - key = node.key; - } else { - throw new ReferenceError("todo"); - } - - if (!node.computed) { - if (t().isIdentifier(key)) key = t().stringLiteral(key.name); - } - - return key; -} - -function ensureBlock() { - const body = this.get("body"); - const bodyNode = body.node; - - if (Array.isArray(body)) { - throw new Error("Can't convert array path to a block statement"); - } - - if (!bodyNode) { - throw new Error("Can't convert node without a body"); - } - - if (body.isBlockStatement()) { - return bodyNode; - } - - const statements = []; - let stringPath = "body"; - let key; - let listKey; - - if (body.isStatement()) { - listKey = "body"; - key = 0; - statements.push(body.node); - } else { - stringPath += ".body.0"; - - if (this.isFunction()) { - key = "argument"; - statements.push(t().returnStatement(body.node)); - } else { - key = "expression"; - statements.push(t().expressionStatement(body.node)); - } - } - - this.node.body = t().blockStatement(statements); - const parentPath = this.get(stringPath); - body.setup(parentPath, listKey ? parentPath.node[listKey] : parentPath.node, listKey, key); - return this.node; -} - -function arrowFunctionToShadowed() { - if (!this.isArrowFunctionExpression()) return; - this.arrowFunctionToExpression(); -} - -function unwrapFunctionEnvironment() { - if (!this.isArrowFunctionExpression() && !this.isFunctionExpression() && !this.isFunctionDeclaration()) { - throw this.buildCodeFrameError("Can only unwrap the environment of a function."); - } - - hoistFunctionEnvironment(this); -} - -function arrowFunctionToExpression({ - allowInsertArrow = true, - specCompliant = false -} = {}) { - if (!this.isArrowFunctionExpression()) { - throw this.buildCodeFrameError("Cannot convert non-arrow function to a function expression."); - } - - const thisBinding = hoistFunctionEnvironment(this, specCompliant, allowInsertArrow); - this.ensureBlock(); - this.node.type = "FunctionExpression"; - - if (specCompliant) { - const checkBinding = thisBinding ? null : this.parentPath.scope.generateUidIdentifier("arrowCheckId"); - - if (checkBinding) { - this.parentPath.scope.push({ - id: checkBinding, - init: t().objectExpression([]) - }); - } - - this.get("body").unshiftContainer("body", t().expressionStatement(t().callExpression(this.hub.addHelper("newArrowCheck"), [t().thisExpression(), checkBinding ? t().identifier(checkBinding.name) : t().identifier(thisBinding)]))); - this.replaceWith(t().callExpression(t().memberExpression((0, _helperFunctionName().default)(this, true) || this.node, t().identifier("bind")), [checkBinding ? t().identifier(checkBinding.name) : t().thisExpression()])); - } -} - -function hoistFunctionEnvironment(fnPath, specCompliant = false, allowInsertArrow = true) { - const thisEnvFn = fnPath.findParent(p => { - return p.isFunction() && !p.isArrowFunctionExpression() || p.isProgram() || p.isClassProperty({ - static: false - }); - }); - const inConstructor = thisEnvFn && thisEnvFn.node.kind === "constructor"; - - if (thisEnvFn.isClassProperty()) { - throw fnPath.buildCodeFrameError("Unable to transform arrow inside class property"); - } - - const { - thisPaths, - argumentsPaths, - newTargetPaths, - superProps, - superCalls - } = getScopeInformation(fnPath); - - if (inConstructor && superCalls.length > 0) { - if (!allowInsertArrow) { - throw superCalls[0].buildCodeFrameError("Unable to handle nested super() usage in arrow"); - } - - const allSuperCalls = []; - thisEnvFn.traverse({ - Function(child) { - if (child.isArrowFunctionExpression()) return; - child.skip(); - }, - - ClassProperty(child) { - child.skip(); - }, - - CallExpression(child) { - if (!child.get("callee").isSuper()) return; - allSuperCalls.push(child); - } - - }); - const superBinding = getSuperBinding(thisEnvFn); - allSuperCalls.forEach(superCall => { - const callee = t().identifier(superBinding); - callee.loc = superCall.node.callee.loc; - superCall.get("callee").replaceWith(callee); - }); - } - - let thisBinding; - - if (thisPaths.length > 0 || specCompliant) { - thisBinding = getThisBinding(thisEnvFn, inConstructor); - - if (!specCompliant || inConstructor && hasSuperClass(thisEnvFn)) { - thisPaths.forEach(thisChild => { - const thisRef = thisChild.isJSX() ? t().jsxIdentifier(thisBinding) : t().identifier(thisBinding); - thisRef.loc = thisChild.node.loc; - thisChild.replaceWith(thisRef); - }); - if (specCompliant) thisBinding = null; - } - } - - if (argumentsPaths.length > 0) { - const argumentsBinding = getBinding(thisEnvFn, "arguments", () => t().identifier("arguments")); - argumentsPaths.forEach(argumentsChild => { - const argsRef = t().identifier(argumentsBinding); - argsRef.loc = argumentsChild.node.loc; - argumentsChild.replaceWith(argsRef); - }); - } - - if (newTargetPaths.length > 0) { - const newTargetBinding = getBinding(thisEnvFn, "newtarget", () => t().metaProperty(t().identifier("new"), t().identifier("target"))); - newTargetPaths.forEach(targetChild => { - const targetRef = t().identifier(newTargetBinding); - targetRef.loc = targetChild.node.loc; - targetChild.replaceWith(targetRef); - }); - } - - if (superProps.length > 0) { - if (!allowInsertArrow) { - throw superProps[0].buildCodeFrameError("Unable to handle nested super.prop usage"); - } - - const flatSuperProps = superProps.reduce((acc, superProp) => acc.concat(standardizeSuperProperty(superProp)), []); - flatSuperProps.forEach(superProp => { - const key = superProp.node.computed ? "" : superProp.get("property").node.name; - - if (superProp.parentPath.isCallExpression({ - callee: superProp.node - })) { - const superBinding = getSuperPropCallBinding(thisEnvFn, key); - - if (superProp.node.computed) { - const prop = superProp.get("property").node; - superProp.replaceWith(t().identifier(superBinding)); - superProp.parentPath.node.arguments.unshift(prop); - } else { - superProp.replaceWith(t().identifier(superBinding)); - } - } else { - const isAssignment = superProp.parentPath.isAssignmentExpression({ - left: superProp.node - }); - const superBinding = getSuperPropBinding(thisEnvFn, isAssignment, key); - const args = []; - - if (superProp.node.computed) { - args.push(superProp.get("property").node); - } - - if (isAssignment) { - const value = superProp.parentPath.node.right; - args.push(value); - superProp.parentPath.replaceWith(t().callExpression(t().identifier(superBinding), args)); - } else { - superProp.replaceWith(t().callExpression(t().identifier(superBinding), args)); - } - } - }); - } - - return thisBinding; -} - -function standardizeSuperProperty(superProp) { - if (superProp.parentPath.isAssignmentExpression() && superProp.parentPath.node.operator !== "=") { - const assignmentPath = superProp.parentPath; - const op = assignmentPath.node.operator.slice(0, -1); - const value = assignmentPath.node.right; - assignmentPath.node.operator = "="; - - if (superProp.node.computed) { - const tmp = superProp.scope.generateDeclaredUidIdentifier("tmp"); - assignmentPath.get("left").replaceWith(t().memberExpression(superProp.node.object, t().assignmentExpression("=", tmp, superProp.node.property), true)); - assignmentPath.get("right").replaceWith(t().binaryExpression(op, t().memberExpression(superProp.node.object, t().identifier(tmp.name), true), value)); - } else { - assignmentPath.get("left").replaceWith(t().memberExpression(superProp.node.object, superProp.node.property)); - assignmentPath.get("right").replaceWith(t().binaryExpression(op, t().memberExpression(superProp.node.object, t().identifier(superProp.node.property.name)), value)); - } - - return [assignmentPath.get("left"), assignmentPath.get("right").get("left")]; - } else if (superProp.parentPath.isUpdateExpression()) { - const updateExpr = superProp.parentPath; - const tmp = superProp.scope.generateDeclaredUidIdentifier("tmp"); - const computedKey = superProp.node.computed ? superProp.scope.generateDeclaredUidIdentifier("prop") : null; - const parts = [t().assignmentExpression("=", tmp, t().memberExpression(superProp.node.object, computedKey ? t().assignmentExpression("=", computedKey, superProp.node.property) : superProp.node.property, superProp.node.computed)), t().assignmentExpression("=", t().memberExpression(superProp.node.object, computedKey ? t().identifier(computedKey.name) : superProp.node.property, superProp.node.computed), t().binaryExpression("+", t().identifier(tmp.name), t().numericLiteral(1)))]; - - if (!superProp.parentPath.node.prefix) { - parts.push(t().identifier(tmp.name)); - } - - updateExpr.replaceWith(t().sequenceExpression(parts)); - const left = updateExpr.get("expressions.0.right"); - const right = updateExpr.get("expressions.1.left"); - return [left, right]; - } - - return [superProp]; -} - -function hasSuperClass(thisEnvFn) { - return thisEnvFn.isClassMethod() && !!thisEnvFn.parentPath.parentPath.node.superClass; -} - -function getThisBinding(thisEnvFn, inConstructor) { - return getBinding(thisEnvFn, "this", thisBinding => { - if (!inConstructor || !hasSuperClass(thisEnvFn)) return t().thisExpression(); - const supers = new WeakSet(); - thisEnvFn.traverse({ - Function(child) { - if (child.isArrowFunctionExpression()) return; - child.skip(); - }, - - ClassProperty(child) { - child.skip(); - }, - - CallExpression(child) { - if (!child.get("callee").isSuper()) return; - if (supers.has(child.node)) return; - supers.add(child.node); - child.replaceWithMultiple([child.node, t().assignmentExpression("=", t().identifier(thisBinding), t().identifier("this"))]); - } - - }); - }); -} - -function getSuperBinding(thisEnvFn) { - return getBinding(thisEnvFn, "supercall", () => { - const argsBinding = thisEnvFn.scope.generateUidIdentifier("args"); - return t().arrowFunctionExpression([t().restElement(argsBinding)], t().callExpression(t().super(), [t().spreadElement(t().identifier(argsBinding.name))])); - }); -} - -function getSuperPropCallBinding(thisEnvFn, propName) { - return getBinding(thisEnvFn, `superprop_call:${propName || ""}`, () => { - const argsBinding = thisEnvFn.scope.generateUidIdentifier("args"); - const argsList = [t().restElement(argsBinding)]; - let fnBody; - - if (propName) { - fnBody = t().callExpression(t().memberExpression(t().super(), t().identifier(propName)), [t().spreadElement(t().identifier(argsBinding.name))]); - } else { - const method = thisEnvFn.scope.generateUidIdentifier("prop"); - argsList.unshift(method); - fnBody = t().callExpression(t().memberExpression(t().super(), t().identifier(method.name), true), [t().spreadElement(t().identifier(argsBinding.name))]); - } - - return t().arrowFunctionExpression(argsList, fnBody); - }); -} - -function getSuperPropBinding(thisEnvFn, isAssignment, propName) { - const op = isAssignment ? "set" : "get"; - return getBinding(thisEnvFn, `superprop_${op}:${propName || ""}`, () => { - const argsList = []; - let fnBody; - - if (propName) { - fnBody = t().memberExpression(t().super(), t().identifier(propName)); - } else { - const method = thisEnvFn.scope.generateUidIdentifier("prop"); - argsList.unshift(method); - fnBody = t().memberExpression(t().super(), t().identifier(method.name), true); - } - - if (isAssignment) { - const valueIdent = thisEnvFn.scope.generateUidIdentifier("value"); - argsList.push(valueIdent); - fnBody = t().assignmentExpression("=", fnBody, t().identifier(valueIdent.name)); - } - - return t().arrowFunctionExpression(argsList, fnBody); - }); -} - -function getBinding(thisEnvFn, key, init) { - const cacheKey = "binding:" + key; - let data = thisEnvFn.getData(cacheKey); - - if (!data) { - const id = thisEnvFn.scope.generateUidIdentifier(key); - data = id.name; - thisEnvFn.setData(cacheKey, data); - thisEnvFn.scope.push({ - id: id, - init: init(data) - }); - } - - return data; -} - -function getScopeInformation(fnPath) { - const thisPaths = []; - const argumentsPaths = []; - const newTargetPaths = []; - const superProps = []; - const superCalls = []; - fnPath.traverse({ - ClassProperty(child) { - child.skip(); - }, - - Function(child) { - if (child.isArrowFunctionExpression()) return; - child.skip(); - }, - - ThisExpression(child) { - thisPaths.push(child); - }, - - JSXIdentifier(child) { - if (child.node.name !== "this") return; - - if (!child.parentPath.isJSXMemberExpression({ - object: child.node - }) && !child.parentPath.isJSXOpeningElement({ - name: child.node - })) { - return; - } - - thisPaths.push(child); - }, - - CallExpression(child) { - if (child.get("callee").isSuper()) superCalls.push(child); - }, - - MemberExpression(child) { - if (child.get("object").isSuper()) superProps.push(child); - }, - - ReferencedIdentifier(child) { - if (child.node.name !== "arguments") return; - argumentsPaths.push(child); - }, - - MetaProperty(child) { - if (!child.get("meta").isIdentifier({ - name: "new" - })) return; - if (!child.get("property").isIdentifier({ - name: "target" - })) return; - newTargetPaths.push(child); - } - - }); - return { - thisPaths, - argumentsPaths, - newTargetPaths, - superProps, - superCalls - }; -} - -/***/ }), - -/***/ "./node_modules/@babel/traverse/lib/path/evaluation.js": -/*!*************************************************************!*\ - !*** ./node_modules/@babel/traverse/lib/path/evaluation.js ***! - \*************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/* WEBPACK VAR INJECTION */(function(global) { - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.evaluateTruthy = evaluateTruthy; -exports.evaluate = evaluate; -const VALID_CALLEES = ["String", "Number", "Math"]; -const INVALID_METHODS = ["random"]; - -function evaluateTruthy() { - const res = this.evaluate(); - if (res.confident) return !!res.value; -} - -function deopt(path, state) { - if (!state.confident) return; - state.deoptPath = path; - state.confident = false; -} - -function evaluateCached(path, state) { - const { - node - } = path; - const { - seen - } = state; - - if (seen.has(node)) { - const existing = seen.get(node); - - if (existing.resolved) { - return existing.value; - } else { - deopt(path, state); - return; - } - } else { - const item = { - resolved: false - }; - seen.set(node, item); - - const val = _evaluate(path, state); - - if (state.confident) { - item.resolved = true; - item.value = val; - } - - return val; - } -} - -function _evaluate(path, state) { - if (!state.confident) return; - const { - node - } = path; - - if (path.isSequenceExpression()) { - const exprs = path.get("expressions"); - return evaluateCached(exprs[exprs.length - 1], state); - } - - if (path.isStringLiteral() || path.isNumericLiteral() || path.isBooleanLiteral()) { - return node.value; - } - - if (path.isNullLiteral()) { - return null; - } - - if (path.isTemplateLiteral()) { - return evaluateQuasis(path, node.quasis, state); - } - - if (path.isTaggedTemplateExpression() && path.get("tag").isMemberExpression()) { - const object = path.get("tag.object"); - const { - node: { - name - } - } = object; - const property = path.get("tag.property"); - - if (object.isIdentifier() && name === "String" && !path.scope.getBinding(name, true) && property.isIdentifier && property.node.name === "raw") { - return evaluateQuasis(path, node.quasi.quasis, state, true); - } - } - - if (path.isConditionalExpression()) { - const testResult = evaluateCached(path.get("test"), state); - if (!state.confident) return; - - if (testResult) { - return evaluateCached(path.get("consequent"), state); - } else { - return evaluateCached(path.get("alternate"), state); - } - } - - if (path.isExpressionWrapper()) { - return evaluateCached(path.get("expression"), state); - } - - if (path.isMemberExpression() && !path.parentPath.isCallExpression({ - callee: node - })) { - const property = path.get("property"); - const object = path.get("object"); - - if (object.isLiteral() && property.isIdentifier()) { - const value = object.node.value; - const type = typeof value; - - if (type === "number" || type === "string") { - return value[property.node.name]; - } - } - } - - if (path.isReferencedIdentifier()) { - const binding = path.scope.getBinding(node.name); - - if (binding && binding.constantViolations.length > 0) { - return deopt(binding.path, state); - } - - if (binding && path.node.start < binding.path.node.end) { - return deopt(binding.path, state); - } - - if (binding && binding.hasValue) { - return binding.value; - } else { - if (node.name === "undefined") { - return binding ? deopt(binding.path, state) : undefined; - } else if (node.name === "Infinity") { - return binding ? deopt(binding.path, state) : Infinity; - } else if (node.name === "NaN") { - return binding ? deopt(binding.path, state) : NaN; - } - - const resolved = path.resolve(); - - if (resolved === path) { - return deopt(path, state); - } else { - return evaluateCached(resolved, state); - } - } - } - - if (path.isUnaryExpression({ - prefix: true - })) { - if (node.operator === "void") { - return undefined; - } - - const argument = path.get("argument"); - - if (node.operator === "typeof" && (argument.isFunction() || argument.isClass())) { - return "function"; - } - - const arg = evaluateCached(argument, state); - if (!state.confident) return; - - switch (node.operator) { - case "!": - return !arg; - - case "+": - return +arg; - - case "-": - return -arg; - - case "~": - return ~arg; - - case "typeof": - return typeof arg; - } - } - - if (path.isArrayExpression()) { - const arr = []; - const elems = path.get("elements"); - - for (const elem of elems) { - const elemValue = elem.evaluate(); - - if (elemValue.confident) { - arr.push(elemValue.value); - } else { - return deopt(elem, state); - } - } - - return arr; - } - - if (path.isObjectExpression()) { - const obj = {}; - const props = path.get("properties"); - - for (const prop of props) { - if (prop.isObjectMethod() || prop.isSpreadElement()) { - return deopt(prop, state); - } - - const keyPath = prop.get("key"); - let key = keyPath; - - if (prop.node.computed) { - key = key.evaluate(); - - if (!key.confident) { - return deopt(keyPath, state); - } - - key = key.value; - } else if (key.isIdentifier()) { - key = key.node.name; - } else { - key = key.node.value; - } - - const valuePath = prop.get("value"); - let value = valuePath.evaluate(); - - if (!value.confident) { - return deopt(valuePath, state); - } - - value = value.value; - obj[key] = value; - } - - return obj; - } - - if (path.isLogicalExpression()) { - const wasConfident = state.confident; - const left = evaluateCached(path.get("left"), state); - const leftConfident = state.confident; - state.confident = wasConfident; - const right = evaluateCached(path.get("right"), state); - const rightConfident = state.confident; - - switch (node.operator) { - case "||": - state.confident = leftConfident && (!!left || rightConfident); - if (!state.confident) return; - return left || right; - - case "&&": - state.confident = leftConfident && (!left || rightConfident); - if (!state.confident) return; - return left && right; - } - } - - if (path.isBinaryExpression()) { - const left = evaluateCached(path.get("left"), state); - if (!state.confident) return; - const right = evaluateCached(path.get("right"), state); - if (!state.confident) return; - - switch (node.operator) { - case "-": - return left - right; - - case "+": - return left + right; - - case "/": - return left / right; - - case "*": - return left * right; - - case "%": - return left % right; - - case "**": - return Math.pow(left, right); - - case "<": - return left < right; - - case ">": - return left > right; - - case "<=": - return left <= right; - - case ">=": - return left >= right; - - case "==": - return left == right; - - case "!=": - return left != right; - - case "===": - return left === right; - - case "!==": - return left !== right; - - case "|": - return left | right; - - case "&": - return left & right; - - case "^": - return left ^ right; - - case "<<": - return left << right; - - case ">>": - return left >> right; - - case ">>>": - return left >>> right; - } - } - - if (path.isCallExpression()) { - const callee = path.get("callee"); - let context; - let func; - - if (callee.isIdentifier() && !path.scope.getBinding(callee.node.name, true) && VALID_CALLEES.indexOf(callee.node.name) >= 0) { - func = global[node.callee.name]; - } - - if (callee.isMemberExpression()) { - const object = callee.get("object"); - const property = callee.get("property"); - - if (object.isIdentifier() && property.isIdentifier() && VALID_CALLEES.indexOf(object.node.name) >= 0 && INVALID_METHODS.indexOf(property.node.name) < 0) { - context = global[object.node.name]; - func = context[property.node.name]; - } - - if (object.isLiteral() && property.isIdentifier()) { - const type = typeof object.node.value; - - if (type === "string" || type === "number") { - context = object.node.value; - func = context[property.node.name]; - } - } - } - - if (func) { - const args = path.get("arguments").map(arg => evaluateCached(arg, state)); - if (!state.confident) return; - return func.apply(context, args); - } - } - - deopt(path, state); -} - -function evaluateQuasis(path, quasis, state, raw = false) { - let str = ""; - let i = 0; - const exprs = path.get("expressions"); - - for (const elem of quasis) { - if (!state.confident) break; - str += raw ? elem.value.raw : elem.value.cooked; - const expr = exprs[i++]; - if (expr) str += String(evaluateCached(expr, state)); - } - - if (!state.confident) return; - return str; -} - -function evaluate() { - const state = { - confident: true, - deoptPath: null, - seen: new Map() - }; - let value = evaluateCached(this, state); - if (!state.confident) value = undefined; - return { - confident: state.confident, - deopt: state.deoptPath, - value: value - }; -} -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js"))) - -/***/ }), - -/***/ "./node_modules/@babel/traverse/lib/path/family.js": -/*!*********************************************************!*\ - !*** ./node_modules/@babel/traverse/lib/path/family.js ***! - \*********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.getOpposite = getOpposite; -exports.getCompletionRecords = getCompletionRecords; -exports.getSibling = getSibling; -exports.getPrevSibling = getPrevSibling; -exports.getNextSibling = getNextSibling; -exports.getAllNextSiblings = getAllNextSiblings; -exports.getAllPrevSiblings = getAllPrevSiblings; -exports.get = get; -exports._getKey = _getKey; -exports._getPattern = _getPattern; -exports.getBindingIdentifiers = getBindingIdentifiers; -exports.getOuterBindingIdentifiers = getOuterBindingIdentifiers; -exports.getBindingIdentifierPaths = getBindingIdentifierPaths; -exports.getOuterBindingIdentifierPaths = getOuterBindingIdentifierPaths; - -var _index = _interopRequireDefault(__webpack_require__(/*! ./index */ "./node_modules/@babel/traverse/lib/path/index.js")); - -function t() { - const data = _interopRequireWildcard(__webpack_require__(/*! @babel/types */ "./node_modules/@babel/types/lib/index.js")); - - t = function () { - return data; - }; - - return data; -} - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function getOpposite() { - if (this.key === "left") { - return this.getSibling("right"); - } else if (this.key === "right") { - return this.getSibling("left"); - } -} - -function addCompletionRecords(path, paths) { - if (path) return paths.concat(path.getCompletionRecords()); - return paths; -} - -function getCompletionRecords() { - let paths = []; - - if (this.isIfStatement()) { - paths = addCompletionRecords(this.get("consequent"), paths); - paths = addCompletionRecords(this.get("alternate"), paths); - } else if (this.isDoExpression() || this.isFor() || this.isWhile()) { - paths = addCompletionRecords(this.get("body"), paths); - } else if (this.isProgram() || this.isBlockStatement()) { - paths = addCompletionRecords(this.get("body").pop(), paths); - } else if (this.isFunction()) { - return this.get("body").getCompletionRecords(); - } else if (this.isTryStatement()) { - paths = addCompletionRecords(this.get("block"), paths); - paths = addCompletionRecords(this.get("handler"), paths); - paths = addCompletionRecords(this.get("finalizer"), paths); - } else if (this.isCatchClause()) { - paths = addCompletionRecords(this.get("body"), paths); - } else { - paths.push(this); - } - - return paths; -} - -function getSibling(key) { - return _index.default.get({ - parentPath: this.parentPath, - parent: this.parent, - container: this.container, - listKey: this.listKey, - key: key - }); -} - -function getPrevSibling() { - return this.getSibling(this.key - 1); -} - -function getNextSibling() { - return this.getSibling(this.key + 1); -} - -function getAllNextSiblings() { - let _key = this.key; - let sibling = this.getSibling(++_key); - const siblings = []; - - while (sibling.node) { - siblings.push(sibling); - sibling = this.getSibling(++_key); - } - - return siblings; -} - -function getAllPrevSiblings() { - let _key = this.key; - let sibling = this.getSibling(--_key); - const siblings = []; - - while (sibling.node) { - siblings.push(sibling); - sibling = this.getSibling(--_key); - } - - return siblings; -} - -function get(key, context) { - if (context === true) context = this.context; - const parts = key.split("."); - - if (parts.length === 1) { - return this._getKey(key, context); - } else { - return this._getPattern(parts, context); - } -} - -function _getKey(key, context) { - const node = this.node; - const container = node[key]; - - if (Array.isArray(container)) { - return container.map((_, i) => { - return _index.default.get({ - listKey: key, - parentPath: this, - parent: node, - container: container, - key: i - }).setContext(context); - }); - } else { - return _index.default.get({ - parentPath: this, - parent: node, - container: node, - key: key - }).setContext(context); - } -} - -function _getPattern(parts, context) { - let path = this; - - for (const part of parts) { - if (part === ".") { - path = path.parentPath; - } else { - if (Array.isArray(path)) { - path = path[part]; - } else { - path = path.get(part, context); - } - } - } - - return path; -} - -function getBindingIdentifiers(duplicates) { - return t().getBindingIdentifiers(this.node, duplicates); -} - -function getOuterBindingIdentifiers(duplicates) { - return t().getOuterBindingIdentifiers(this.node, duplicates); -} - -function getBindingIdentifierPaths(duplicates = false, outerOnly = false) { - const path = this; - let search = [].concat(path); - const ids = Object.create(null); - - while (search.length) { - const id = search.shift(); - if (!id) continue; - if (!id.node) continue; - const keys = t().getBindingIdentifiers.keys[id.node.type]; - - if (id.isIdentifier()) { - if (duplicates) { - const _ids = ids[id.node.name] = ids[id.node.name] || []; - - _ids.push(id); - } else { - ids[id.node.name] = id; - } - - continue; - } - - if (id.isExportDeclaration()) { - const declaration = id.get("declaration"); - - if (declaration.isDeclaration()) { - search.push(declaration); - } - - continue; - } - - if (outerOnly) { - if (id.isFunctionDeclaration()) { - search.push(id.get("id")); - continue; - } - - if (id.isFunctionExpression()) { - continue; - } - } - - if (keys) { - for (let i = 0; i < keys.length; i++) { - const key = keys[i]; - const child = id.get(key); - - if (Array.isArray(child) || child.node) { - search = search.concat(child); - } - } - } - } - - return ids; -} - -function getOuterBindingIdentifierPaths(duplicates) { - return this.getBindingIdentifierPaths(duplicates, true); -} - -/***/ }), - -/***/ "./node_modules/@babel/traverse/lib/path/index.js": -/*!********************************************************!*\ - !*** ./node_modules/@babel/traverse/lib/path/index.js ***! - \********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -var virtualTypes = _interopRequireWildcard(__webpack_require__(/*! ./lib/virtual-types */ "./node_modules/@babel/traverse/lib/path/lib/virtual-types.js")); - -function _debug() { - const data = _interopRequireDefault(__webpack_require__(/*! debug */ "./node_modules/debug/src/browser.js")); - - _debug = function () { - return data; - }; - - return data; -} - -var _index = _interopRequireDefault(__webpack_require__(/*! ../index */ "./node_modules/@babel/traverse/lib/index.js")); - -var _scope = _interopRequireDefault(__webpack_require__(/*! ../scope */ "./node_modules/@babel/traverse/lib/scope/index.js")); - -function t() { - const data = _interopRequireWildcard(__webpack_require__(/*! @babel/types */ "./node_modules/@babel/types/lib/index.js")); - - t = function () { - return data; - }; - - return data; -} - -var _cache = __webpack_require__(/*! ../cache */ "./node_modules/@babel/traverse/lib/cache.js"); - -function _generator() { - const data = _interopRequireDefault(__webpack_require__(/*! @babel/generator */ "./node_modules/@babel/generator/lib/index.js")); - - _generator = function () { - return data; - }; - - return data; -} - -var NodePath_ancestry = _interopRequireWildcard(__webpack_require__(/*! ./ancestry */ "./node_modules/@babel/traverse/lib/path/ancestry.js")); - -var NodePath_inference = _interopRequireWildcard(__webpack_require__(/*! ./inference */ "./node_modules/@babel/traverse/lib/path/inference/index.js")); - -var NodePath_replacement = _interopRequireWildcard(__webpack_require__(/*! ./replacement */ "./node_modules/@babel/traverse/lib/path/replacement.js")); - -var NodePath_evaluation = _interopRequireWildcard(__webpack_require__(/*! ./evaluation */ "./node_modules/@babel/traverse/lib/path/evaluation.js")); - -var NodePath_conversion = _interopRequireWildcard(__webpack_require__(/*! ./conversion */ "./node_modules/@babel/traverse/lib/path/conversion.js")); - -var NodePath_introspection = _interopRequireWildcard(__webpack_require__(/*! ./introspection */ "./node_modules/@babel/traverse/lib/path/introspection.js")); - -var NodePath_context = _interopRequireWildcard(__webpack_require__(/*! ./context */ "./node_modules/@babel/traverse/lib/path/context.js")); - -var NodePath_removal = _interopRequireWildcard(__webpack_require__(/*! ./removal */ "./node_modules/@babel/traverse/lib/path/removal.js")); - -var NodePath_modification = _interopRequireWildcard(__webpack_require__(/*! ./modification */ "./node_modules/@babel/traverse/lib/path/modification.js")); - -var NodePath_family = _interopRequireWildcard(__webpack_require__(/*! ./family */ "./node_modules/@babel/traverse/lib/path/family.js")); - -var NodePath_comments = _interopRequireWildcard(__webpack_require__(/*! ./comments */ "./node_modules/@babel/traverse/lib/path/comments.js")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -const debug = (0, _debug().default)("babel"); - -class NodePath { - constructor(hub, parent) { - this.parent = parent; - this.hub = hub; - this.contexts = []; - this.data = Object.create(null); - this.shouldSkip = false; - this.shouldStop = false; - this.removed = false; - this.state = null; - this.opts = null; - this.skipKeys = null; - this.parentPath = null; - this.context = null; - this.container = null; - this.listKey = null; - this.inList = false; - this.parentKey = null; - this.key = null; - this.node = null; - this.scope = null; - this.type = null; - this.typeAnnotation = null; - } - - static get({ - hub, - parentPath, - parent, - container, - listKey, - key - }) { - if (!hub && parentPath) { - hub = parentPath.hub; - } - - if (!parent) { - throw new Error("To get a node path the parent needs to exist"); - } - - const targetNode = container[key]; - const paths = _cache.path.get(parent) || []; - - if (!_cache.path.has(parent)) { - _cache.path.set(parent, paths); - } - - let path; - - for (let i = 0; i < paths.length; i++) { - const pathCheck = paths[i]; - - if (pathCheck.node === targetNode) { - path = pathCheck; - break; - } - } - - if (!path) { - path = new NodePath(hub, parent); - paths.push(path); - } - - path.setup(parentPath, container, listKey, key); - return path; - } - - getScope(scope) { - return this.isScope() ? new _scope.default(this) : scope; - } - - setData(key, val) { - return this.data[key] = val; - } - - getData(key, def) { - let val = this.data[key]; - if (val === undefined && def !== undefined) val = this.data[key] = def; - return val; - } - - buildCodeFrameError(msg, Error = SyntaxError) { - return this.hub.buildError(this.node, msg, Error); - } - - traverse(visitor, state) { - (0, _index.default)(this.node, visitor, this.scope, state, this); - } - - set(key, node) { - t().validate(this.node, key, node); - this.node[key] = node; - } - - getPathLocation() { - const parts = []; - let path = this; - - do { - let key = path.key; - if (path.inList) key = `${path.listKey}[${key}]`; - parts.unshift(key); - } while (path = path.parentPath); - - return parts.join("."); - } - - debug(message) { - if (!debug.enabled) return; - debug(`${this.getPathLocation()} ${this.type}: ${message}`); - } - - toString() { - return (0, _generator().default)(this.node).code; - } - -} - -exports.default = NodePath; -Object.assign(NodePath.prototype, NodePath_ancestry, NodePath_inference, NodePath_replacement, NodePath_evaluation, NodePath_conversion, NodePath_introspection, NodePath_context, NodePath_removal, NodePath_modification, NodePath_family, NodePath_comments); - -for (const type of t().TYPES) { - const typeKey = `is${type}`; - const fn = t()[typeKey]; - - NodePath.prototype[typeKey] = function (opts) { - return fn(this.node, opts); - }; - - NodePath.prototype[`assert${type}`] = function (opts) { - if (!fn(this.node, opts)) { - throw new TypeError(`Expected node path of type ${type}`); - } - }; -} - -for (const type of Object.keys(virtualTypes)) { - if (type[0] === "_") continue; - if (t().TYPES.indexOf(type) < 0) t().TYPES.push(type); - const virtualType = virtualTypes[type]; - - NodePath.prototype[`is${type}`] = function (opts) { - return virtualType.checkPath(this, opts); - }; -} - -/***/ }), - -/***/ "./node_modules/@babel/traverse/lib/path/inference/index.js": -/*!******************************************************************!*\ - !*** ./node_modules/@babel/traverse/lib/path/inference/index.js ***! - \******************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.getTypeAnnotation = getTypeAnnotation; -exports._getTypeAnnotation = _getTypeAnnotation; -exports.isBaseType = isBaseType; -exports.couldBeBaseType = couldBeBaseType; -exports.baseTypeStrictlyMatches = baseTypeStrictlyMatches; -exports.isGenericType = isGenericType; - -var inferers = _interopRequireWildcard(__webpack_require__(/*! ./inferers */ "./node_modules/@babel/traverse/lib/path/inference/inferers.js")); - -function t() { - const data = _interopRequireWildcard(__webpack_require__(/*! @babel/types */ "./node_modules/@babel/types/lib/index.js")); - - t = function () { - return data; - }; - - return data; -} - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -function getTypeAnnotation() { - if (this.typeAnnotation) return this.typeAnnotation; - let type = this._getTypeAnnotation() || t().anyTypeAnnotation(); - if (t().isTypeAnnotation(type)) type = type.typeAnnotation; - return this.typeAnnotation = type; -} - -function _getTypeAnnotation() { - const node = this.node; - - if (!node) { - if (this.key === "init" && this.parentPath.isVariableDeclarator()) { - const declar = this.parentPath.parentPath; - const declarParent = declar.parentPath; - - if (declar.key === "left" && declarParent.isForInStatement()) { - return t().stringTypeAnnotation(); - } - - if (declar.key === "left" && declarParent.isForOfStatement()) { - return t().anyTypeAnnotation(); - } - - return t().voidTypeAnnotation(); - } else { - return; - } - } - - if (node.typeAnnotation) { - return node.typeAnnotation; - } - - let inferer = inferers[node.type]; - - if (inferer) { - return inferer.call(this, node); - } - - inferer = inferers[this.parentPath.type]; - - if (inferer && inferer.validParent) { - return this.parentPath.getTypeAnnotation(); - } -} - -function isBaseType(baseName, soft) { - return _isBaseType(baseName, this.getTypeAnnotation(), soft); -} - -function _isBaseType(baseName, type, soft) { - if (baseName === "string") { - return t().isStringTypeAnnotation(type); - } else if (baseName === "number") { - return t().isNumberTypeAnnotation(type); - } else if (baseName === "boolean") { - return t().isBooleanTypeAnnotation(type); - } else if (baseName === "any") { - return t().isAnyTypeAnnotation(type); - } else if (baseName === "mixed") { - return t().isMixedTypeAnnotation(type); - } else if (baseName === "empty") { - return t().isEmptyTypeAnnotation(type); - } else if (baseName === "void") { - return t().isVoidTypeAnnotation(type); - } else { - if (soft) { - return false; - } else { - throw new Error(`Unknown base type ${baseName}`); - } - } -} - -function couldBeBaseType(name) { - const type = this.getTypeAnnotation(); - if (t().isAnyTypeAnnotation(type)) return true; - - if (t().isUnionTypeAnnotation(type)) { - for (const type2 of type.types) { - if (t().isAnyTypeAnnotation(type2) || _isBaseType(name, type2, true)) { - return true; - } - } - - return false; - } else { - return _isBaseType(name, type, true); - } -} - -function baseTypeStrictlyMatches(right) { - const left = this.getTypeAnnotation(); - right = right.getTypeAnnotation(); - - if (!t().isAnyTypeAnnotation(left) && t().isFlowBaseAnnotation(left)) { - return right.type === left.type; - } -} - -function isGenericType(genericName) { - const type = this.getTypeAnnotation(); - return t().isGenericTypeAnnotation(type) && t().isIdentifier(type.id, { - name: genericName - }); -} - -/***/ }), - -/***/ "./node_modules/@babel/traverse/lib/path/inference/inferer-reference.js": -/*!******************************************************************************!*\ - !*** ./node_modules/@babel/traverse/lib/path/inference/inferer-reference.js ***! - \******************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = _default; - -function t() { - const data = _interopRequireWildcard(__webpack_require__(/*! @babel/types */ "./node_modules/@babel/types/lib/index.js")); - - t = function () { - return data; - }; - - return data; -} - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -function _default(node) { - if (!this.isReferenced()) return; - const binding = this.scope.getBinding(node.name); - - if (binding) { - if (binding.identifier.typeAnnotation) { - return binding.identifier.typeAnnotation; - } else { - return getTypeAnnotationBindingConstantViolations(binding, this, node.name); - } - } - - if (node.name === "undefined") { - return t().voidTypeAnnotation(); - } else if (node.name === "NaN" || node.name === "Infinity") { - return t().numberTypeAnnotation(); - } else if (node.name === "arguments") {} -} - -function getTypeAnnotationBindingConstantViolations(binding, path, name) { - const types = []; - const functionConstantViolations = []; - let constantViolations = getConstantViolationsBefore(binding, path, functionConstantViolations); - const testType = getConditionalAnnotation(binding, path, name); - - if (testType) { - const testConstantViolations = getConstantViolationsBefore(binding, testType.ifStatement); - constantViolations = constantViolations.filter(path => testConstantViolations.indexOf(path) < 0); - types.push(testType.typeAnnotation); - } - - if (constantViolations.length) { - constantViolations = constantViolations.concat(functionConstantViolations); - - for (const violation of constantViolations) { - types.push(violation.getTypeAnnotation()); - } - } - - if (types.length) { - return t().createUnionTypeAnnotation(types); - } -} - -function getConstantViolationsBefore(binding, path, functions) { - const violations = binding.constantViolations.slice(); - violations.unshift(binding.path); - return violations.filter(violation => { - violation = violation.resolve(); - - const status = violation._guessExecutionStatusRelativeTo(path); - - if (functions && status === "function") functions.push(violation); - return status === "before"; - }); -} - -function inferAnnotationFromBinaryExpression(name, path) { - const operator = path.node.operator; - const right = path.get("right").resolve(); - const left = path.get("left").resolve(); - let target; - - if (left.isIdentifier({ - name - })) { - target = right; - } else if (right.isIdentifier({ - name - })) { - target = left; - } - - if (target) { - if (operator === "===") { - return target.getTypeAnnotation(); - } - - if (t().BOOLEAN_NUMBER_BINARY_OPERATORS.indexOf(operator) >= 0) { - return t().numberTypeAnnotation(); - } - - return; - } - - if (operator !== "===" && operator !== "==") return; - let typeofPath; - let typePath; - - if (left.isUnaryExpression({ - operator: "typeof" - })) { - typeofPath = left; - typePath = right; - } else if (right.isUnaryExpression({ - operator: "typeof" - })) { - typeofPath = right; - typePath = left; - } - - if (!typeofPath) return; - if (!typeofPath.get("argument").isIdentifier({ - name - })) return; - typePath = typePath.resolve(); - if (!typePath.isLiteral()) return; - const typeValue = typePath.node.value; - if (typeof typeValue !== "string") return; - return t().createTypeAnnotationBasedOnTypeof(typeValue); -} - -function getParentConditionalPath(binding, path, name) { - let parentPath; - - while (parentPath = path.parentPath) { - if (parentPath.isIfStatement() || parentPath.isConditionalExpression()) { - if (path.key === "test") { - return; - } - - return parentPath; - } - - if (parentPath.isFunction()) { - if (parentPath.parentPath.scope.getBinding(name) !== binding) return; - } - - path = parentPath; - } -} - -function getConditionalAnnotation(binding, path, name) { - const ifStatement = getParentConditionalPath(binding, path, name); - if (!ifStatement) return; - const test = ifStatement.get("test"); - const paths = [test]; - const types = []; - - for (let i = 0; i < paths.length; i++) { - const path = paths[i]; - - if (path.isLogicalExpression()) { - if (path.node.operator === "&&") { - paths.push(path.get("left")); - paths.push(path.get("right")); - } - } else if (path.isBinaryExpression()) { - const type = inferAnnotationFromBinaryExpression(name, path); - if (type) types.push(type); - } - } - - if (types.length) { - return { - typeAnnotation: t().createUnionTypeAnnotation(types), - ifStatement - }; - } - - return getConditionalAnnotation(ifStatement, name); -} - -/***/ }), - -/***/ "./node_modules/@babel/traverse/lib/path/inference/inferers.js": -/*!*********************************************************************!*\ - !*** ./node_modules/@babel/traverse/lib/path/inference/inferers.js ***! - \*********************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.VariableDeclarator = VariableDeclarator; -exports.TypeCastExpression = TypeCastExpression; -exports.NewExpression = NewExpression; -exports.TemplateLiteral = TemplateLiteral; -exports.UnaryExpression = UnaryExpression; -exports.BinaryExpression = BinaryExpression; -exports.LogicalExpression = LogicalExpression; -exports.ConditionalExpression = ConditionalExpression; -exports.SequenceExpression = SequenceExpression; -exports.ParenthesizedExpression = ParenthesizedExpression; -exports.AssignmentExpression = AssignmentExpression; -exports.UpdateExpression = UpdateExpression; -exports.StringLiteral = StringLiteral; -exports.NumericLiteral = NumericLiteral; -exports.BooleanLiteral = BooleanLiteral; -exports.NullLiteral = NullLiteral; -exports.RegExpLiteral = RegExpLiteral; -exports.ObjectExpression = ObjectExpression; -exports.ArrayExpression = ArrayExpression; -exports.RestElement = RestElement; -exports.ClassDeclaration = exports.ClassExpression = exports.FunctionDeclaration = exports.ArrowFunctionExpression = exports.FunctionExpression = Func; -exports.CallExpression = CallExpression; -exports.TaggedTemplateExpression = TaggedTemplateExpression; -Object.defineProperty(exports, "Identifier", { - enumerable: true, - get: function () { - return _infererReference.default; - } -}); - -function t() { - const data = _interopRequireWildcard(__webpack_require__(/*! @babel/types */ "./node_modules/@babel/types/lib/index.js")); - - t = function () { - return data; - }; - - return data; -} - -var _infererReference = _interopRequireDefault(__webpack_require__(/*! ./inferer-reference */ "./node_modules/@babel/traverse/lib/path/inference/inferer-reference.js")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -function VariableDeclarator() { - const id = this.get("id"); - if (!id.isIdentifier()) return; - const init = this.get("init"); - let type = init.getTypeAnnotation(); - - if (type && type.type === "AnyTypeAnnotation") { - if (init.isCallExpression() && init.get("callee").isIdentifier({ - name: "Array" - }) && !init.scope.hasBinding("Array", true)) { - type = ArrayExpression(); - } - } - - return type; -} - -function TypeCastExpression(node) { - return node.typeAnnotation; -} - -TypeCastExpression.validParent = true; - -function NewExpression(node) { - if (this.get("callee").isIdentifier()) { - return t().genericTypeAnnotation(node.callee); - } -} - -function TemplateLiteral() { - return t().stringTypeAnnotation(); -} - -function UnaryExpression(node) { - const operator = node.operator; - - if (operator === "void") { - return t().voidTypeAnnotation(); - } else if (t().NUMBER_UNARY_OPERATORS.indexOf(operator) >= 0) { - return t().numberTypeAnnotation(); - } else if (t().STRING_UNARY_OPERATORS.indexOf(operator) >= 0) { - return t().stringTypeAnnotation(); - } else if (t().BOOLEAN_UNARY_OPERATORS.indexOf(operator) >= 0) { - return t().booleanTypeAnnotation(); - } -} - -function BinaryExpression(node) { - const operator = node.operator; - - if (t().NUMBER_BINARY_OPERATORS.indexOf(operator) >= 0) { - return t().numberTypeAnnotation(); - } else if (t().BOOLEAN_BINARY_OPERATORS.indexOf(operator) >= 0) { - return t().booleanTypeAnnotation(); - } else if (operator === "+") { - const right = this.get("right"); - const left = this.get("left"); - - if (left.isBaseType("number") && right.isBaseType("number")) { - return t().numberTypeAnnotation(); - } else if (left.isBaseType("string") || right.isBaseType("string")) { - return t().stringTypeAnnotation(); - } - - return t().unionTypeAnnotation([t().stringTypeAnnotation(), t().numberTypeAnnotation()]); - } -} - -function LogicalExpression() { - return t().createUnionTypeAnnotation([this.get("left").getTypeAnnotation(), this.get("right").getTypeAnnotation()]); -} - -function ConditionalExpression() { - return t().createUnionTypeAnnotation([this.get("consequent").getTypeAnnotation(), this.get("alternate").getTypeAnnotation()]); -} - -function SequenceExpression() { - return this.get("expressions").pop().getTypeAnnotation(); -} - -function ParenthesizedExpression() { - return this.get("expression").getTypeAnnotation(); -} - -function AssignmentExpression() { - return this.get("right").getTypeAnnotation(); -} - -function UpdateExpression(node) { - const operator = node.operator; - - if (operator === "++" || operator === "--") { - return t().numberTypeAnnotation(); - } -} - -function StringLiteral() { - return t().stringTypeAnnotation(); -} - -function NumericLiteral() { - return t().numberTypeAnnotation(); -} - -function BooleanLiteral() { - return t().booleanTypeAnnotation(); -} - -function NullLiteral() { - return t().nullLiteralTypeAnnotation(); -} - -function RegExpLiteral() { - return t().genericTypeAnnotation(t().identifier("RegExp")); -} - -function ObjectExpression() { - return t().genericTypeAnnotation(t().identifier("Object")); -} - -function ArrayExpression() { - return t().genericTypeAnnotation(t().identifier("Array")); -} - -function RestElement() { - return ArrayExpression(); -} - -RestElement.validParent = true; - -function Func() { - return t().genericTypeAnnotation(t().identifier("Function")); -} - -const isArrayFrom = t().buildMatchMemberExpression("Array.from"); -const isObjectKeys = t().buildMatchMemberExpression("Object.keys"); -const isObjectValues = t().buildMatchMemberExpression("Object.values"); -const isObjectEntries = t().buildMatchMemberExpression("Object.entries"); - -function CallExpression() { - const { - callee - } = this.node; - - if (isObjectKeys(callee)) { - return t().arrayTypeAnnotation(t().stringTypeAnnotation()); - } else if (isArrayFrom(callee) || isObjectValues(callee)) { - return t().arrayTypeAnnotation(t().anyTypeAnnotation()); - } else if (isObjectEntries(callee)) { - return t().arrayTypeAnnotation(t().tupleTypeAnnotation([t().stringTypeAnnotation(), t().anyTypeAnnotation()])); - } - - return resolveCall(this.get("callee")); -} - -function TaggedTemplateExpression() { - return resolveCall(this.get("tag")); -} - -function resolveCall(callee) { - callee = callee.resolve(); - - if (callee.isFunction()) { - if (callee.is("async")) { - if (callee.is("generator")) { - return t().genericTypeAnnotation(t().identifier("AsyncIterator")); - } else { - return t().genericTypeAnnotation(t().identifier("Promise")); - } - } else { - if (callee.node.returnType) { - return callee.node.returnType; - } else {} - } - } -} - -/***/ }), - -/***/ "./node_modules/@babel/traverse/lib/path/introspection.js": -/*!****************************************************************!*\ - !*** ./node_modules/@babel/traverse/lib/path/introspection.js ***! - \****************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.matchesPattern = matchesPattern; -exports.has = has; -exports.isStatic = isStatic; -exports.isnt = isnt; -exports.equals = equals; -exports.isNodeType = isNodeType; -exports.canHaveVariableDeclarationOrExpression = canHaveVariableDeclarationOrExpression; -exports.canSwapBetweenExpressionAndStatement = canSwapBetweenExpressionAndStatement; -exports.isCompletionRecord = isCompletionRecord; -exports.isStatementOrBlock = isStatementOrBlock; -exports.referencesImport = referencesImport; -exports.getSource = getSource; -exports.willIMaybeExecuteBefore = willIMaybeExecuteBefore; -exports._guessExecutionStatusRelativeTo = _guessExecutionStatusRelativeTo; -exports._guessExecutionStatusRelativeToDifferentFunctions = _guessExecutionStatusRelativeToDifferentFunctions; -exports.resolve = resolve; -exports._resolve = _resolve; -exports.isConstantExpression = isConstantExpression; -exports.isInStrictMode = isInStrictMode; -exports.is = void 0; - -function _includes() { - const data = _interopRequireDefault(__webpack_require__(/*! lodash/includes */ "./node_modules/lodash/includes.js")); - - _includes = function () { - return data; - }; - - return data; -} - -function t() { - const data = _interopRequireWildcard(__webpack_require__(/*! @babel/types */ "./node_modules/@babel/types/lib/index.js")); - - t = function () { - return data; - }; - - return data; -} - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function matchesPattern(pattern, allowPartial) { - return t().matchesPattern(this.node, pattern, allowPartial); -} - -function has(key) { - const val = this.node && this.node[key]; - - if (val && Array.isArray(val)) { - return !!val.length; - } else { - return !!val; - } -} - -function isStatic() { - return this.scope.isStatic(this.node); -} - -const is = has; -exports.is = is; - -function isnt(key) { - return !this.has(key); -} - -function equals(key, value) { - return this.node[key] === value; -} - -function isNodeType(type) { - return t().isType(this.type, type); -} - -function canHaveVariableDeclarationOrExpression() { - return (this.key === "init" || this.key === "left") && this.parentPath.isFor(); -} - -function canSwapBetweenExpressionAndStatement(replacement) { - if (this.key !== "body" || !this.parentPath.isArrowFunctionExpression()) { - return false; - } - - if (this.isExpression()) { - return t().isBlockStatement(replacement); - } else if (this.isBlockStatement()) { - return t().isExpression(replacement); - } - - return false; -} - -function isCompletionRecord(allowInsideFunction) { - let path = this; - let first = true; - - do { - const container = path.container; - - if (path.isFunction() && !first) { - return !!allowInsideFunction; - } - - first = false; - - if (Array.isArray(container) && path.key !== container.length - 1) { - return false; - } - } while ((path = path.parentPath) && !path.isProgram()); - - return true; -} - -function isStatementOrBlock() { - if (this.parentPath.isLabeledStatement() || t().isBlockStatement(this.container)) { - return false; - } else { - return (0, _includes().default)(t().STATEMENT_OR_BLOCK_KEYS, this.key); - } -} - -function referencesImport(moduleSource, importName) { - if (!this.isReferencedIdentifier()) return false; - const binding = this.scope.getBinding(this.node.name); - if (!binding || binding.kind !== "module") return false; - const path = binding.path; - const parent = path.parentPath; - if (!parent.isImportDeclaration()) return false; - - if (parent.node.source.value === moduleSource) { - if (!importName) return true; - } else { - return false; - } - - if (path.isImportDefaultSpecifier() && importName === "default") { - return true; - } - - if (path.isImportNamespaceSpecifier() && importName === "*") { - return true; - } - - if (path.isImportSpecifier() && path.node.imported.name === importName) { - return true; - } - - return false; -} - -function getSource() { - const node = this.node; - - if (node.end) { - const code = this.hub.getCode(); - if (code) return code.slice(node.start, node.end); - } - - return ""; -} - -function willIMaybeExecuteBefore(target) { - return this._guessExecutionStatusRelativeTo(target) !== "after"; -} - -function _guessExecutionStatusRelativeTo(target) { - const targetFuncParent = target.scope.getFunctionParent() || target.scope.getProgramParent(); - const selfFuncParent = this.scope.getFunctionParent() || target.scope.getProgramParent(); - - if (targetFuncParent.node !== selfFuncParent.node) { - const status = this._guessExecutionStatusRelativeToDifferentFunctions(targetFuncParent); - - if (status) { - return status; - } else { - target = targetFuncParent.path; - } - } - - const targetPaths = target.getAncestry(); - if (targetPaths.indexOf(this) >= 0) return "after"; - const selfPaths = this.getAncestry(); - let commonPath; - let targetIndex; - let selfIndex; - - for (selfIndex = 0; selfIndex < selfPaths.length; selfIndex++) { - const selfPath = selfPaths[selfIndex]; - targetIndex = targetPaths.indexOf(selfPath); - - if (targetIndex >= 0) { - commonPath = selfPath; - break; - } - } - - if (!commonPath) { - return "before"; - } - - const targetRelationship = targetPaths[targetIndex - 1]; - const selfRelationship = selfPaths[selfIndex - 1]; - - if (!targetRelationship || !selfRelationship) { - return "before"; - } - - if (targetRelationship.listKey && targetRelationship.container === selfRelationship.container) { - return targetRelationship.key > selfRelationship.key ? "before" : "after"; - } - - const keys = t().VISITOR_KEYS[commonPath.type]; - const targetKeyPosition = keys.indexOf(targetRelationship.key); - const selfKeyPosition = keys.indexOf(selfRelationship.key); - return targetKeyPosition > selfKeyPosition ? "before" : "after"; -} - -function _guessExecutionStatusRelativeToDifferentFunctions(targetFuncParent) { - const targetFuncPath = targetFuncParent.path; - if (!targetFuncPath.isFunctionDeclaration()) return; - const binding = targetFuncPath.scope.getBinding(targetFuncPath.node.id.name); - if (!binding.references) return "before"; - const referencePaths = binding.referencePaths; - - for (const path of referencePaths) { - if (path.key !== "callee" || !path.parentPath.isCallExpression()) { - return; - } - } - - let allStatus; - - for (const path of referencePaths) { - const childOfFunction = !!path.find(path => path.node === targetFuncPath.node); - if (childOfFunction) continue; - - const status = this._guessExecutionStatusRelativeTo(path); - - if (allStatus) { - if (allStatus !== status) return; - } else { - allStatus = status; - } - } - - return allStatus; -} - -function resolve(dangerous, resolved) { - return this._resolve(dangerous, resolved) || this; -} - -function _resolve(dangerous, resolved) { - if (resolved && resolved.indexOf(this) >= 0) return; - resolved = resolved || []; - resolved.push(this); - - if (this.isVariableDeclarator()) { - if (this.get("id").isIdentifier()) { - return this.get("init").resolve(dangerous, resolved); - } else {} - } else if (this.isReferencedIdentifier()) { - const binding = this.scope.getBinding(this.node.name); - if (!binding) return; - if (!binding.constant) return; - if (binding.kind === "module") return; - - if (binding.path !== this) { - const ret = binding.path.resolve(dangerous, resolved); - if (this.find(parent => parent.node === ret.node)) return; - return ret; - } - } else if (this.isTypeCastExpression()) { - return this.get("expression").resolve(dangerous, resolved); - } else if (dangerous && this.isMemberExpression()) { - const targetKey = this.toComputedKey(); - if (!t().isLiteral(targetKey)) return; - const targetName = targetKey.value; - const target = this.get("object").resolve(dangerous, resolved); - - if (target.isObjectExpression()) { - const props = target.get("properties"); - - for (const prop of props) { - if (!prop.isProperty()) continue; - const key = prop.get("key"); - let match = prop.isnt("computed") && key.isIdentifier({ - name: targetName - }); - match = match || key.isLiteral({ - value: targetName - }); - if (match) return prop.get("value").resolve(dangerous, resolved); - } - } else if (target.isArrayExpression() && !isNaN(+targetName)) { - const elems = target.get("elements"); - const elem = elems[targetName]; - if (elem) return elem.resolve(dangerous, resolved); - } - } -} - -function isConstantExpression() { - if (this.isIdentifier()) { - const binding = this.scope.getBinding(this.node.name); - if (!binding) return false; - return binding.constant; - } - - if (this.isLiteral()) { - if (this.isRegExpLiteral()) { - return false; - } - - if (this.isTemplateLiteral()) { - return this.get("expressions").every(expression => expression.isConstantExpression()); - } - - return true; - } - - if (this.isUnaryExpression()) { - if (this.get("operator").node !== "void") { - return false; - } - - return this.get("argument").isConstantExpression(); - } - - if (this.isBinaryExpression()) { - return this.get("left").isConstantExpression() && this.get("right").isConstantExpression(); - } - - return false; -} - -function isInStrictMode() { - const start = this.isProgram() ? this : this.parentPath; - const strictParent = start.find(path => { - if (path.isProgram({ - sourceType: "module" - })) return true; - if (path.isClass()) return true; - if (!path.isProgram() && !path.isFunction()) return false; - - if (path.isArrowFunctionExpression() && !path.get("body").isBlockStatement()) { - return false; - } - - let { - node - } = path; - if (path.isFunction()) node = node.body; - - for (const directive of node.directives) { - if (directive.value.value === "use strict") { - return true; - } - } - }); - return !!strictParent; -} - -/***/ }), - -/***/ "./node_modules/@babel/traverse/lib/path/lib/hoister.js": -/*!**************************************************************!*\ - !*** ./node_modules/@babel/traverse/lib/path/lib/hoister.js ***! - \**************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -function t() { - const data = _interopRequireWildcard(__webpack_require__(/*! @babel/types */ "./node_modules/@babel/types/lib/index.js")); - - t = function () { - return data; - }; - - return data; -} - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -const referenceVisitor = { - ReferencedIdentifier(path, state) { - if (path.isJSXIdentifier() && t().react.isCompatTag(path.node.name) && !path.parentPath.isJSXMemberExpression()) { - return; - } - - if (path.node.name === "this") { - let scope = path.scope; - - do { - if (scope.path.isFunction() && !scope.path.isArrowFunctionExpression()) { - break; - } - } while (scope = scope.parent); - - if (scope) state.breakOnScopePaths.push(scope.path); - } - - const binding = path.scope.getBinding(path.node.name); - if (!binding) return; - if (binding !== state.scope.getBinding(path.node.name)) return; - state.bindings[path.node.name] = binding; - } - -}; - -class PathHoister { - constructor(path, scope) { - this.breakOnScopePaths = []; - this.bindings = {}; - this.scopes = []; - this.scope = scope; - this.path = path; - this.attachAfter = false; - } - - isCompatibleScope(scope) { - for (const key of Object.keys(this.bindings)) { - const binding = this.bindings[key]; - - if (!scope.bindingIdentifierEquals(key, binding.identifier)) { - return false; - } - } - - return true; - } - - getCompatibleScopes() { - let scope = this.path.scope; - - do { - if (this.isCompatibleScope(scope)) { - this.scopes.push(scope); - } else { - break; - } - - if (this.breakOnScopePaths.indexOf(scope.path) >= 0) { - break; - } - } while (scope = scope.parent); - } - - getAttachmentPath() { - let path = this._getAttachmentPath(); - - if (!path) return; - let targetScope = path.scope; - - if (targetScope.path === path) { - targetScope = path.scope.parent; - } - - if (targetScope.path.isProgram() || targetScope.path.isFunction()) { - for (const name of Object.keys(this.bindings)) { - if (!targetScope.hasOwnBinding(name)) continue; - const binding = this.bindings[name]; - - if (binding.kind === "param" || binding.path.parentKey === "params") { - continue; - } - - const bindingParentPath = this.getAttachmentParentForPath(binding.path); - - if (bindingParentPath.key >= path.key) { - this.attachAfter = true; - path = binding.path; - - for (const violationPath of binding.constantViolations) { - if (this.getAttachmentParentForPath(violationPath).key > path.key) { - path = violationPath; - } - } - } - } - } - - return path; - } - - _getAttachmentPath() { - const scopes = this.scopes; - const scope = scopes.pop(); - if (!scope) return; - - if (scope.path.isFunction()) { - if (this.hasOwnParamBindings(scope)) { - if (this.scope === scope) return; - const bodies = scope.path.get("body").get("body"); - - for (let i = 0; i < bodies.length; i++) { - if (bodies[i].node._blockHoist) continue; - return bodies[i]; - } - } else { - return this.getNextScopeAttachmentParent(); - } - } else if (scope.path.isProgram()) { - return this.getNextScopeAttachmentParent(); - } - } - - getNextScopeAttachmentParent() { - const scope = this.scopes.pop(); - if (scope) return this.getAttachmentParentForPath(scope.path); - } - - getAttachmentParentForPath(path) { - do { - if (!path.parentPath || Array.isArray(path.container) && path.isStatement()) { - return path; - } - } while (path = path.parentPath); - } - - hasOwnParamBindings(scope) { - for (const name of Object.keys(this.bindings)) { - if (!scope.hasOwnBinding(name)) continue; - const binding = this.bindings[name]; - if (binding.kind === "param" && binding.constant) return true; - } - - return false; - } - - run() { - this.path.traverse(referenceVisitor, this); - this.getCompatibleScopes(); - const attachTo = this.getAttachmentPath(); - if (!attachTo) return; - if (attachTo.getFunctionParent() === this.path.getFunctionParent()) return; - let uid = attachTo.scope.generateUidIdentifier("ref"); - const declarator = t().variableDeclarator(uid, this.path.node); - const insertFn = this.attachAfter ? "insertAfter" : "insertBefore"; - const [attached] = attachTo[insertFn]([attachTo.isVariableDeclarator() ? declarator : t().variableDeclaration("var", [declarator])]); - const parent = this.path.parentPath; - - if (parent.isJSXElement() && this.path.container === parent.node.children) { - uid = t().JSXExpressionContainer(uid); - } - - this.path.replaceWith(t().cloneNode(uid)); - return attachTo.isVariableDeclarator() ? attached.get("init") : attached.get("declarations.0.init"); - } - -} - -exports.default = PathHoister; - -/***/ }), - -/***/ "./node_modules/@babel/traverse/lib/path/lib/removal-hooks.js": -/*!********************************************************************!*\ - !*** ./node_modules/@babel/traverse/lib/path/lib/removal-hooks.js ***! - \********************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.hooks = void 0; -const hooks = [function (self, parent) { - const removeParent = self.key === "test" && (parent.isWhile() || parent.isSwitchCase()) || self.key === "declaration" && parent.isExportDeclaration() || self.key === "body" && parent.isLabeledStatement() || self.listKey === "declarations" && parent.isVariableDeclaration() && parent.node.declarations.length === 1 || self.key === "expression" && parent.isExpressionStatement(); - - if (removeParent) { - parent.remove(); - return true; - } -}, function (self, parent) { - if (parent.isSequenceExpression() && parent.node.expressions.length === 1) { - parent.replaceWith(parent.node.expressions[0]); - return true; - } -}, function (self, parent) { - if (parent.isBinary()) { - if (self.key === "left") { - parent.replaceWith(parent.node.right); - } else { - parent.replaceWith(parent.node.left); - } - - return true; - } -}, function (self, parent) { - if (parent.isIfStatement() && (self.key === "consequent" || self.key === "alternate") || self.key === "body" && (parent.isLoop() || parent.isArrowFunctionExpression())) { - self.replaceWith({ - type: "BlockStatement", - body: [] - }); - return true; - } -}]; -exports.hooks = hooks; - -/***/ }), - -/***/ "./node_modules/@babel/traverse/lib/path/lib/virtual-types.js": -/*!********************************************************************!*\ - !*** ./node_modules/@babel/traverse/lib/path/lib/virtual-types.js ***! - \********************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.ForAwaitStatement = exports.NumericLiteralTypeAnnotation = exports.ExistentialTypeParam = exports.SpreadProperty = exports.RestProperty = exports.Flow = exports.Pure = exports.Generated = exports.User = exports.Var = exports.BlockScoped = exports.Referenced = exports.Scope = exports.Expression = exports.Statement = exports.BindingIdentifier = exports.ReferencedMemberExpression = exports.ReferencedIdentifier = void 0; - -function t() { - const data = _interopRequireWildcard(__webpack_require__(/*! @babel/types */ "./node_modules/@babel/types/lib/index.js")); - - t = function () { - return data; - }; - - return data; -} - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -const ReferencedIdentifier = { - types: ["Identifier", "JSXIdentifier"], - - checkPath(path, opts) { - const { - node, - parent - } = path; - - if (!t().isIdentifier(node, opts) && !t().isJSXMemberExpression(parent, opts)) { - if (t().isJSXIdentifier(node, opts)) { - if (t().react.isCompatTag(node.name)) return false; - } else { - return false; - } - } - - return t().isReferenced(node, parent, path.parentPath.parent); - } - -}; -exports.ReferencedIdentifier = ReferencedIdentifier; -const ReferencedMemberExpression = { - types: ["MemberExpression"], - - checkPath({ - node, - parent - }) { - return t().isMemberExpression(node) && t().isReferenced(node, parent); - } - -}; -exports.ReferencedMemberExpression = ReferencedMemberExpression; -const BindingIdentifier = { - types: ["Identifier"], - - checkPath(path) { - const { - node, - parent - } = path; - const grandparent = path.parentPath.parent; - return t().isIdentifier(node) && t().isBinding(node, parent, grandparent); - } - -}; -exports.BindingIdentifier = BindingIdentifier; -const Statement = { - types: ["Statement"], - - checkPath({ - node, - parent - }) { - if (t().isStatement(node)) { - if (t().isVariableDeclaration(node)) { - if (t().isForXStatement(parent, { - left: node - })) return false; - if (t().isForStatement(parent, { - init: node - })) return false; - } - - return true; - } else { - return false; - } - } - -}; -exports.Statement = Statement; -const Expression = { - types: ["Expression"], - - checkPath(path) { - if (path.isIdentifier()) { - return path.isReferencedIdentifier(); - } else { - return t().isExpression(path.node); - } - } - -}; -exports.Expression = Expression; -const Scope = { - types: ["Scopable"], - - checkPath(path) { - return t().isScope(path.node, path.parent); - } - -}; -exports.Scope = Scope; -const Referenced = { - checkPath(path) { - return t().isReferenced(path.node, path.parent); - } - -}; -exports.Referenced = Referenced; -const BlockScoped = { - checkPath(path) { - return t().isBlockScoped(path.node); - } - -}; -exports.BlockScoped = BlockScoped; -const Var = { - types: ["VariableDeclaration"], - - checkPath(path) { - return t().isVar(path.node); - } - -}; -exports.Var = Var; -const User = { - checkPath(path) { - return path.node && !!path.node.loc; - } - -}; -exports.User = User; -const Generated = { - checkPath(path) { - return !path.isUser(); - } - -}; -exports.Generated = Generated; -const Pure = { - checkPath(path, opts) { - return path.scope.isPure(path.node, opts); - } - -}; -exports.Pure = Pure; -const Flow = { - types: ["Flow", "ImportDeclaration", "ExportDeclaration", "ImportSpecifier"], - - checkPath({ - node - }) { - if (t().isFlow(node)) { - return true; - } else if (t().isImportDeclaration(node)) { - return node.importKind === "type" || node.importKind === "typeof"; - } else if (t().isExportDeclaration(node)) { - return node.exportKind === "type"; - } else if (t().isImportSpecifier(node)) { - return node.importKind === "type" || node.importKind === "typeof"; - } else { - return false; - } - } - -}; -exports.Flow = Flow; -const RestProperty = { - types: ["RestElement"], - - checkPath(path) { - return path.parentPath && path.parentPath.isObjectPattern(); - } - -}; -exports.RestProperty = RestProperty; -const SpreadProperty = { - types: ["RestElement"], - - checkPath(path) { - return path.parentPath && path.parentPath.isObjectExpression(); - } - -}; -exports.SpreadProperty = SpreadProperty; -const ExistentialTypeParam = { - types: ["ExistsTypeAnnotation"] -}; -exports.ExistentialTypeParam = ExistentialTypeParam; -const NumericLiteralTypeAnnotation = { - types: ["NumberLiteralTypeAnnotation"] -}; -exports.NumericLiteralTypeAnnotation = NumericLiteralTypeAnnotation; -const ForAwaitStatement = { - types: ["ForOfStatement"], - - checkPath({ - node - }) { - return node.await === true; - } - -}; -exports.ForAwaitStatement = ForAwaitStatement; - -/***/ }), - -/***/ "./node_modules/@babel/traverse/lib/path/modification.js": -/*!***************************************************************!*\ - !*** ./node_modules/@babel/traverse/lib/path/modification.js ***! - \***************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.insertBefore = insertBefore; -exports._containerInsert = _containerInsert; -exports._containerInsertBefore = _containerInsertBefore; -exports._containerInsertAfter = _containerInsertAfter; -exports.insertAfter = insertAfter; -exports.updateSiblingKeys = updateSiblingKeys; -exports._verifyNodeList = _verifyNodeList; -exports.unshiftContainer = unshiftContainer; -exports.pushContainer = pushContainer; -exports.hoist = hoist; - -var _cache = __webpack_require__(/*! ../cache */ "./node_modules/@babel/traverse/lib/cache.js"); - -var _hoister = _interopRequireDefault(__webpack_require__(/*! ./lib/hoister */ "./node_modules/@babel/traverse/lib/path/lib/hoister.js")); - -var _index = _interopRequireDefault(__webpack_require__(/*! ./index */ "./node_modules/@babel/traverse/lib/path/index.js")); - -function t() { - const data = _interopRequireWildcard(__webpack_require__(/*! @babel/types */ "./node_modules/@babel/types/lib/index.js")); - - t = function () { - return data; - }; - - return data; -} - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function insertBefore(nodes) { - this._assertUnremoved(); - - nodes = this._verifyNodeList(nodes); - const { - parentPath - } = this; - - if (parentPath.isExpressionStatement() || parentPath.isLabeledStatement() || parentPath.isExportNamedDeclaration() || parentPath.isExportDefaultDeclaration() && this.isDeclaration()) { - return parentPath.insertBefore(nodes); - } else if (this.isNodeType("Expression") && !this.isJSXElement() || parentPath.isForStatement() && this.key === "init") { - if (this.node) nodes.push(this.node); - return this.replaceExpressionWithStatements(nodes); - } else if (Array.isArray(this.container)) { - return this._containerInsertBefore(nodes); - } else if (this.isStatementOrBlock()) { - const shouldInsertCurrentNode = this.node && (!this.isExpressionStatement() || this.node.expression != null); - this.replaceWith(t().blockStatement(shouldInsertCurrentNode ? [this.node] : [])); - return this.unshiftContainer("body", nodes); - } else { - throw new Error("We don't know what to do with this node type. " + "We were previously a Statement but we can't fit in here?"); - } -} - -function _containerInsert(from, nodes) { - this.updateSiblingKeys(from, nodes.length); - const paths = []; - this.container.splice(from, 0, ...nodes); - - for (let i = 0; i < nodes.length; i++) { - const to = from + i; - const path = this.getSibling(to); - paths.push(path); - - if (this.context && this.context.queue) { - path.pushContext(this.context); - } - } - - const contexts = this._getQueueContexts(); - - for (const path of paths) { - path.setScope(); - path.debug("Inserted."); - - for (const context of contexts) { - context.maybeQueue(path, true); - } - } - - return paths; -} - -function _containerInsertBefore(nodes) { - return this._containerInsert(this.key, nodes); -} - -function _containerInsertAfter(nodes) { - return this._containerInsert(this.key + 1, nodes); -} - -function insertAfter(nodes) { - this._assertUnremoved(); - - nodes = this._verifyNodeList(nodes); - const { - parentPath - } = this; - - if (parentPath.isExpressionStatement() || parentPath.isLabeledStatement() || parentPath.isExportNamedDeclaration() || parentPath.isExportDefaultDeclaration() && this.isDeclaration()) { - return parentPath.insertAfter(nodes.map(node => { - return t().isExpression(node) ? t().expressionStatement(node) : node; - })); - } else if (this.isNodeType("Expression") && !this.isJSXElement() || parentPath.isForStatement() && this.key === "init") { - if (this.node) { - let { - scope - } = this; - - if (parentPath.isMethod({ - computed: true, - key: this.node - })) { - scope = scope.parent; - } - - const temp = scope.generateDeclaredUidIdentifier(); - nodes.unshift(t().expressionStatement(t().assignmentExpression("=", t().cloneNode(temp), this.node))); - nodes.push(t().expressionStatement(t().cloneNode(temp))); - } - - return this.replaceExpressionWithStatements(nodes); - } else if (Array.isArray(this.container)) { - return this._containerInsertAfter(nodes); - } else if (this.isStatementOrBlock()) { - const shouldInsertCurrentNode = this.node && (!this.isExpressionStatement() || this.node.expression != null); - this.replaceWith(t().blockStatement(shouldInsertCurrentNode ? [this.node] : [])); - return this.pushContainer("body", nodes); - } else { - throw new Error("We don't know what to do with this node type. " + "We were previously a Statement but we can't fit in here?"); - } -} - -function updateSiblingKeys(fromIndex, incrementBy) { - if (!this.parent) return; - - const paths = _cache.path.get(this.parent); - - for (let i = 0; i < paths.length; i++) { - const path = paths[i]; - - if (path.key >= fromIndex) { - path.key += incrementBy; - } - } -} - -function _verifyNodeList(nodes) { - if (!nodes) { - return []; - } - - if (nodes.constructor !== Array) { - nodes = [nodes]; - } - - for (let i = 0; i < nodes.length; i++) { - const node = nodes[i]; - let msg; - - if (!node) { - msg = "has falsy node"; - } else if (typeof node !== "object") { - msg = "contains a non-object node"; - } else if (!node.type) { - msg = "without a type"; - } else if (node instanceof _index.default) { - msg = "has a NodePath when it expected a raw object"; - } - - if (msg) { - const type = Array.isArray(node) ? "array" : typeof node; - throw new Error(`Node list ${msg} with the index of ${i} and type of ${type}`); - } - } - - return nodes; -} - -function unshiftContainer(listKey, nodes) { - this._assertUnremoved(); - - nodes = this._verifyNodeList(nodes); - - const path = _index.default.get({ - parentPath: this, - parent: this.node, - container: this.node[listKey], - listKey, - key: 0 - }); - - return path._containerInsertBefore(nodes); -} - -function pushContainer(listKey, nodes) { - this._assertUnremoved(); - - nodes = this._verifyNodeList(nodes); - const container = this.node[listKey]; - - const path = _index.default.get({ - parentPath: this, - parent: this.node, - container: container, - listKey, - key: container.length - }); - - return path.replaceWithMultiple(nodes); -} - -function hoist(scope = this.scope) { - const hoister = new _hoister.default(this, scope); - return hoister.run(); -} - -/***/ }), - -/***/ "./node_modules/@babel/traverse/lib/path/removal.js": -/*!**********************************************************!*\ - !*** ./node_modules/@babel/traverse/lib/path/removal.js ***! - \**********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.remove = remove; -exports._removeFromScope = _removeFromScope; -exports._callRemovalHooks = _callRemovalHooks; -exports._remove = _remove; -exports._markRemoved = _markRemoved; -exports._assertUnremoved = _assertUnremoved; - -var _removalHooks = __webpack_require__(/*! ./lib/removal-hooks */ "./node_modules/@babel/traverse/lib/path/lib/removal-hooks.js"); - -function remove() { - this._assertUnremoved(); - - this.resync(); - - this._removeFromScope(); - - if (this._callRemovalHooks()) { - this._markRemoved(); - - return; - } - - this.shareCommentsWithSiblings(); - - this._remove(); - - this._markRemoved(); -} - -function _removeFromScope() { - const bindings = this.getBindingIdentifiers(); - Object.keys(bindings).forEach(name => this.scope.removeBinding(name)); -} - -function _callRemovalHooks() { - for (const fn of _removalHooks.hooks) { - if (fn(this, this.parentPath)) return true; - } -} - -function _remove() { - if (Array.isArray(this.container)) { - this.container.splice(this.key, 1); - this.updateSiblingKeys(this.key, -1); - } else { - this._replaceWith(null); - } -} - -function _markRemoved() { - this.shouldSkip = true; - this.removed = true; - this.node = null; -} - -function _assertUnremoved() { - if (this.removed) { - throw this.buildCodeFrameError("NodePath has been removed so is read-only."); - } -} - -/***/ }), - -/***/ "./node_modules/@babel/traverse/lib/path/replacement.js": -/*!**************************************************************!*\ - !*** ./node_modules/@babel/traverse/lib/path/replacement.js ***! - \**************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.replaceWithMultiple = replaceWithMultiple; -exports.replaceWithSourceString = replaceWithSourceString; -exports.replaceWith = replaceWith; -exports._replaceWith = _replaceWith; -exports.replaceExpressionWithStatements = replaceExpressionWithStatements; -exports.replaceInline = replaceInline; - -function _codeFrame() { - const data = __webpack_require__(/*! @babel/code-frame */ "./node_modules/@babel/code-frame/lib/index.js"); - - _codeFrame = function () { - return data; - }; - - return data; -} - -var _index = _interopRequireDefault(__webpack_require__(/*! ../index */ "./node_modules/@babel/traverse/lib/index.js")); - -var _index2 = _interopRequireDefault(__webpack_require__(/*! ./index */ "./node_modules/@babel/traverse/lib/path/index.js")); - -function _parser() { - const data = __webpack_require__(/*! @babel/parser */ "./node_modules/@babel/parser/lib/index.js"); - - _parser = function () { - return data; - }; - - return data; -} - -function t() { - const data = _interopRequireWildcard(__webpack_require__(/*! @babel/types */ "./node_modules/@babel/types/lib/index.js")); - - t = function () { - return data; - }; - - return data; -} - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -const hoistVariablesVisitor = { - Function(path) { - path.skip(); - }, - - VariableDeclaration(path) { - if (path.node.kind !== "var") return; - const bindings = path.getBindingIdentifiers(); - - for (const key of Object.keys(bindings)) { - path.scope.push({ - id: bindings[key] - }); - } - - const exprs = []; - - for (const declar of path.node.declarations) { - if (declar.init) { - exprs.push(t().expressionStatement(t().assignmentExpression("=", declar.id, declar.init))); - } - } - - path.replaceWithMultiple(exprs); - } - -}; - -function replaceWithMultiple(nodes) { - this.resync(); - nodes = this._verifyNodeList(nodes); - t().inheritLeadingComments(nodes[0], this.node); - t().inheritTrailingComments(nodes[nodes.length - 1], this.node); - this.node = this.container[this.key] = null; - const paths = this.insertAfter(nodes); - - if (this.node) { - this.requeue(); - } else { - this.remove(); - } - - return paths; -} - -function replaceWithSourceString(replacement) { - this.resync(); - - try { - replacement = `(${replacement})`; - replacement = (0, _parser().parse)(replacement); - } catch (err) { - const loc = err.loc; - - if (loc) { - err.message += " - make sure this is an expression.\n" + (0, _codeFrame().codeFrameColumns)(replacement, { - start: { - line: loc.line, - column: loc.column + 1 - } - }); - err.code = "BABEL_REPLACE_SOURCE_ERROR"; - } - - throw err; - } - - replacement = replacement.program.body[0].expression; - - _index.default.removeProperties(replacement); - - return this.replaceWith(replacement); -} - -function replaceWith(replacement) { - this.resync(); - - if (this.removed) { - throw new Error("You can't replace this node, we've already removed it"); - } - - if (replacement instanceof _index2.default) { - replacement = replacement.node; - } - - if (!replacement) { - throw new Error("You passed `path.replaceWith()` a falsy node, use `path.remove()` instead"); - } - - if (this.node === replacement) { - return [this]; - } - - if (this.isProgram() && !t().isProgram(replacement)) { - throw new Error("You can only replace a Program root node with another Program node"); - } - - if (Array.isArray(replacement)) { - throw new Error("Don't use `path.replaceWith()` with an array of nodes, use `path.replaceWithMultiple()`"); - } - - if (typeof replacement === "string") { - throw new Error("Don't use `path.replaceWith()` with a source string, use `path.replaceWithSourceString()`"); - } - - let nodePath = ""; - - if (this.isNodeType("Statement") && t().isExpression(replacement)) { - if (!this.canHaveVariableDeclarationOrExpression() && !this.canSwapBetweenExpressionAndStatement(replacement) && !this.parentPath.isExportDefaultDeclaration()) { - replacement = t().expressionStatement(replacement); - nodePath = "expression"; - } - } - - if (this.isNodeType("Expression") && t().isStatement(replacement)) { - if (!this.canHaveVariableDeclarationOrExpression() && !this.canSwapBetweenExpressionAndStatement(replacement)) { - return this.replaceExpressionWithStatements([replacement]); - } - } - - const oldNode = this.node; - - if (oldNode) { - t().inheritsComments(replacement, oldNode); - t().removeComments(oldNode); - } - - this._replaceWith(replacement); - - this.type = replacement.type; - this.setScope(); - this.requeue(); - return [nodePath ? this.get(nodePath) : this]; -} - -function _replaceWith(node) { - if (!this.container) { - throw new ReferenceError("Container is falsy"); - } - - if (this.inList) { - t().validate(this.parent, this.key, [node]); - } else { - t().validate(this.parent, this.key, node); - } - - this.debug(`Replace with ${node && node.type}`); - this.node = this.container[this.key] = node; -} - -function replaceExpressionWithStatements(nodes) { - this.resync(); - const toSequenceExpression = t().toSequenceExpression(nodes, this.scope); - - if (toSequenceExpression) { - return this.replaceWith(toSequenceExpression)[0].get("expressions"); - } - - const functionParent = this.getFunctionParent(); - const isParentAsync = functionParent && functionParent.is("async"); - const container = t().arrowFunctionExpression([], t().blockStatement(nodes)); - this.replaceWith(t().callExpression(container, [])); - this.traverse(hoistVariablesVisitor); - const completionRecords = this.get("callee").getCompletionRecords(); - - for (const path of completionRecords) { - if (!path.isExpressionStatement()) continue; - const loop = path.findParent(path => path.isLoop()); - - if (loop) { - let uid = loop.getData("expressionReplacementReturnUid"); - - if (!uid) { - const callee = this.get("callee"); - uid = callee.scope.generateDeclaredUidIdentifier("ret"); - callee.get("body").pushContainer("body", t().returnStatement(t().cloneNode(uid))); - loop.setData("expressionReplacementReturnUid", uid); - } else { - uid = t().identifier(uid.name); - } - - path.get("expression").replaceWith(t().assignmentExpression("=", t().cloneNode(uid), path.node.expression)); - } else { - path.replaceWith(t().returnStatement(path.node.expression)); - } - } - - const callee = this.get("callee"); - callee.arrowFunctionToExpression(); - - if (isParentAsync && _index.default.hasType(this.get("callee.body").node, "AwaitExpression", t().FUNCTION_TYPES)) { - callee.set("async", true); - this.replaceWith(t().awaitExpression(this.node)); - } - - return callee.get("body.body"); -} - -function replaceInline(nodes) { - this.resync(); - - if (Array.isArray(nodes)) { - if (Array.isArray(this.container)) { - nodes = this._verifyNodeList(nodes); - - const paths = this._containerInsertAfter(nodes); - - this.remove(); - return paths; - } else { - return this.replaceWithMultiple(nodes); - } - } else { - return this.replaceWith(nodes); - } -} - -/***/ }), - -/***/ "./node_modules/@babel/traverse/lib/scope/binding.js": -/*!***********************************************************!*\ - !*** ./node_modules/@babel/traverse/lib/scope/binding.js ***! - \***********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -class Binding { - constructor({ - identifier, - scope, - path, - kind - }) { - this.identifier = identifier; - this.scope = scope; - this.path = path; - this.kind = kind; - this.constantViolations = []; - this.constant = true; - this.referencePaths = []; - this.referenced = false; - this.references = 0; - this.clearValue(); - } - - deoptValue() { - this.clearValue(); - this.hasDeoptedValue = true; - } - - setValue(value) { - if (this.hasDeoptedValue) return; - this.hasValue = true; - this.value = value; - } - - clearValue() { - this.hasDeoptedValue = false; - this.hasValue = false; - this.value = null; - } - - reassign(path) { - this.constant = false; - - if (this.constantViolations.indexOf(path) !== -1) { - return; - } - - this.constantViolations.push(path); - } - - reference(path) { - if (this.referencePaths.indexOf(path) !== -1) { - return; - } - - this.referenced = true; - this.references++; - this.referencePaths.push(path); - } - - dereference() { - this.references--; - this.referenced = !!this.references; - } - -} - -exports.default = Binding; - -/***/ }), - -/***/ "./node_modules/@babel/traverse/lib/scope/index.js": -/*!*********************************************************!*\ - !*** ./node_modules/@babel/traverse/lib/scope/index.js ***! - \*********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -function _includes() { - const data = _interopRequireDefault(__webpack_require__(/*! lodash/includes */ "./node_modules/lodash/includes.js")); - - _includes = function () { - return data; - }; - - return data; -} - -function _repeat() { - const data = _interopRequireDefault(__webpack_require__(/*! lodash/repeat */ "./node_modules/lodash/repeat.js")); - - _repeat = function () { - return data; - }; - - return data; -} - -var _renamer = _interopRequireDefault(__webpack_require__(/*! ./lib/renamer */ "./node_modules/@babel/traverse/lib/scope/lib/renamer.js")); - -var _index = _interopRequireDefault(__webpack_require__(/*! ../index */ "./node_modules/@babel/traverse/lib/index.js")); - -function _defaults() { - const data = _interopRequireDefault(__webpack_require__(/*! lodash/defaults */ "./node_modules/lodash/defaults.js")); - - _defaults = function () { - return data; - }; - - return data; -} - -var _binding = _interopRequireDefault(__webpack_require__(/*! ./binding */ "./node_modules/@babel/traverse/lib/scope/binding.js")); - -function _globals() { - const data = _interopRequireDefault(__webpack_require__(/*! globals */ "./node_modules/globals/index.js")); - - _globals = function () { - return data; - }; - - return data; -} - -function t() { - const data = _interopRequireWildcard(__webpack_require__(/*! @babel/types */ "./node_modules/@babel/types/lib/index.js")); - - t = function () { - return data; - }; - - return data; -} - -var _cache = __webpack_require__(/*! ../cache */ "./node_modules/@babel/traverse/lib/cache.js"); - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function gatherNodeParts(node, parts) { - if (t().isModuleDeclaration(node)) { - if (node.source) { - gatherNodeParts(node.source, parts); - } else if (node.specifiers && node.specifiers.length) { - for (const specifier of node.specifiers) { - gatherNodeParts(specifier, parts); - } - } else if (node.declaration) { - gatherNodeParts(node.declaration, parts); - } - } else if (t().isModuleSpecifier(node)) { - gatherNodeParts(node.local, parts); - } else if (t().isMemberExpression(node)) { - gatherNodeParts(node.object, parts); - gatherNodeParts(node.property, parts); - } else if (t().isIdentifier(node)) { - parts.push(node.name); - } else if (t().isLiteral(node)) { - parts.push(node.value); - } else if (t().isCallExpression(node)) { - gatherNodeParts(node.callee, parts); - } else if (t().isObjectExpression(node) || t().isObjectPattern(node)) { - for (const prop of node.properties) { - gatherNodeParts(prop.key || prop.argument, parts); - } - } else if (t().isPrivateName(node)) { - gatherNodeParts(node.id, parts); - } else if (t().isThisExpression(node)) { - parts.push("this"); - } else if (t().isSuper(node)) { - parts.push("super"); - } -} - -const collectorVisitor = { - For(path) { - for (const key of t().FOR_INIT_KEYS) { - const declar = path.get(key); - - if (declar.isVar()) { - const parentScope = path.scope.getFunctionParent() || path.scope.getProgramParent(); - parentScope.registerBinding("var", declar); - } - } - }, - - Declaration(path) { - if (path.isBlockScoped()) return; - - if (path.isExportDeclaration() && path.get("declaration").isDeclaration()) { - return; - } - - const parent = path.scope.getFunctionParent() || path.scope.getProgramParent(); - parent.registerDeclaration(path); - }, - - ReferencedIdentifier(path, state) { - state.references.push(path); - }, - - ForXStatement(path, state) { - const left = path.get("left"); - - if (left.isPattern() || left.isIdentifier()) { - state.constantViolations.push(path); - } - }, - - ExportDeclaration: { - exit(path) { - const { - node, - scope - } = path; - const declar = node.declaration; - - if (t().isClassDeclaration(declar) || t().isFunctionDeclaration(declar)) { - const id = declar.id; - if (!id) return; - const binding = scope.getBinding(id.name); - if (binding) binding.reference(path); - } else if (t().isVariableDeclaration(declar)) { - for (const decl of declar.declarations) { - for (const name of Object.keys(t().getBindingIdentifiers(decl))) { - const binding = scope.getBinding(name); - if (binding) binding.reference(path); - } - } - } - } - - }, - - LabeledStatement(path) { - path.scope.getProgramParent().addGlobal(path.node); - path.scope.getBlockParent().registerDeclaration(path); - }, - - AssignmentExpression(path, state) { - state.assignments.push(path); - }, - - UpdateExpression(path, state) { - state.constantViolations.push(path); - }, - - UnaryExpression(path, state) { - if (path.node.operator === "delete") { - state.constantViolations.push(path); - } - }, - - BlockScoped(path) { - let scope = path.scope; - if (scope.path === path) scope = scope.parent; - scope.getBlockParent().registerDeclaration(path); - }, - - ClassDeclaration(path) { - const id = path.node.id; - if (!id) return; - const name = id.name; - path.scope.bindings[name] = path.scope.getBinding(name); - }, - - Block(path) { - const paths = path.get("body"); - - for (const bodyPath of paths) { - if (bodyPath.isFunctionDeclaration()) { - path.scope.getBlockParent().registerDeclaration(bodyPath); - } - } - } - -}; -let uid = 0; - -class Scope { - constructor(path) { - const { - node - } = path; - - const cached = _cache.scope.get(node); - - if (cached && cached.path === path) { - return cached; - } - - _cache.scope.set(node, this); - - this.uid = uid++; - this.block = node; - this.path = path; - this.labels = new Map(); - } - - get parent() { - const parent = this.path.findParent(p => p.isScope()); - return parent && parent.scope; - } - - get parentBlock() { - return this.path.parent; - } - - get hub() { - return this.path.hub; - } - - traverse(node, opts, state) { - (0, _index.default)(node, opts, this, state, this.path); - } - - generateDeclaredUidIdentifier(name) { - const id = this.generateUidIdentifier(name); - this.push({ - id - }); - return t().cloneNode(id); - } - - generateUidIdentifier(name) { - return t().identifier(this.generateUid(name)); - } - - generateUid(name = "temp") { - name = t().toIdentifier(name).replace(/^_+/, "").replace(/[0-9]+$/g, ""); - let uid; - let i = 0; - - do { - uid = this._generateUid(name, i); - i++; - } while (this.hasLabel(uid) || this.hasBinding(uid) || this.hasGlobal(uid) || this.hasReference(uid)); - - const program = this.getProgramParent(); - program.references[uid] = true; - program.uids[uid] = true; - return uid; - } - - _generateUid(name, i) { - let id = name; - if (i > 1) id += i; - return `_${id}`; - } - - generateUidBasedOnNode(parent, defaultName) { - let node = parent; - - if (t().isAssignmentExpression(parent)) { - node = parent.left; - } else if (t().isVariableDeclarator(parent)) { - node = parent.id; - } else if (t().isObjectProperty(node) || t().isObjectMethod(node)) { - node = node.key; - } - - const parts = []; - gatherNodeParts(node, parts); - let id = parts.join("$"); - id = id.replace(/^_/, "") || defaultName || "ref"; - return this.generateUid(id.slice(0, 20)); - } - - generateUidIdentifierBasedOnNode(parent, defaultName) { - return t().identifier(this.generateUidBasedOnNode(parent, defaultName)); - } - - isStatic(node) { - if (t().isThisExpression(node) || t().isSuper(node)) { - return true; - } - - if (t().isIdentifier(node)) { - const binding = this.getBinding(node.name); - - if (binding) { - return binding.constant; - } else { - return this.hasBinding(node.name); - } - } - - return false; - } - - maybeGenerateMemoised(node, dontPush) { - if (this.isStatic(node)) { - return null; - } else { - const id = this.generateUidIdentifierBasedOnNode(node); - - if (!dontPush) { - this.push({ - id - }); - return t().cloneNode(id); - } - - return id; - } - } - - checkBlockScopedCollisions(local, kind, name, id) { - if (kind === "param") return; - if (local.kind === "local") return; - const duplicate = kind === "let" || local.kind === "let" || local.kind === "const" || local.kind === "module" || local.kind === "param" && (kind === "let" || kind === "const"); - - if (duplicate) { - throw this.hub.buildError(id, `Duplicate declaration "${name}"`, TypeError); - } - } - - rename(oldName, newName, block) { - const binding = this.getBinding(oldName); - - if (binding) { - newName = newName || this.generateUidIdentifier(oldName).name; - return new _renamer.default(binding, oldName, newName).rename(block); - } - } - - _renameFromMap(map, oldName, newName, value) { - if (map[oldName]) { - map[newName] = value; - map[oldName] = null; - } - } - - dump() { - const sep = (0, _repeat().default)("-", 60); - console.log(sep); - let scope = this; - - do { - console.log("#", scope.block.type); - - for (const name of Object.keys(scope.bindings)) { - const binding = scope.bindings[name]; - console.log(" -", name, { - constant: binding.constant, - references: binding.references, - violations: binding.constantViolations.length, - kind: binding.kind - }); - } - } while (scope = scope.parent); - - console.log(sep); - } - - toArray(node, i) { - if (t().isIdentifier(node)) { - const binding = this.getBinding(node.name); - - if (binding && binding.constant && binding.path.isGenericType("Array")) { - return node; - } - } - - if (t().isArrayExpression(node)) { - return node; - } - - if (t().isIdentifier(node, { - name: "arguments" - })) { - return t().callExpression(t().memberExpression(t().memberExpression(t().memberExpression(t().identifier("Array"), t().identifier("prototype")), t().identifier("slice")), t().identifier("call")), [node]); - } - - let helperName; - const args = [node]; - - if (i === true) { - helperName = "toConsumableArray"; - } else if (i) { - args.push(t().numericLiteral(i)); - helperName = "slicedToArray"; - } else { - helperName = "toArray"; - } - - return t().callExpression(this.hub.addHelper(helperName), args); - } - - hasLabel(name) { - return !!this.getLabel(name); - } - - getLabel(name) { - return this.labels.get(name); - } - - registerLabel(path) { - this.labels.set(path.node.label.name, path); - } - - registerDeclaration(path) { - if (path.isLabeledStatement()) { - this.registerLabel(path); - } else if (path.isFunctionDeclaration()) { - this.registerBinding("hoisted", path.get("id"), path); - } else if (path.isVariableDeclaration()) { - const declarations = path.get("declarations"); - - for (const declar of declarations) { - this.registerBinding(path.node.kind, declar); - } - } else if (path.isClassDeclaration()) { - this.registerBinding("let", path); - } else if (path.isImportDeclaration()) { - const specifiers = path.get("specifiers"); - - for (const specifier of specifiers) { - this.registerBinding("module", specifier); - } - } else if (path.isExportDeclaration()) { - const declar = path.get("declaration"); - - if (declar.isClassDeclaration() || declar.isFunctionDeclaration() || declar.isVariableDeclaration()) { - this.registerDeclaration(declar); - } - } else { - this.registerBinding("unknown", path); - } - } - - buildUndefinedNode() { - if (this.hasBinding("undefined")) { - return t().unaryExpression("void", t().numericLiteral(0), true); - } else { - return t().identifier("undefined"); - } - } - - registerConstantViolation(path) { - const ids = path.getBindingIdentifiers(); - - for (const name of Object.keys(ids)) { - const binding = this.getBinding(name); - if (binding) binding.reassign(path); - } - } - - registerBinding(kind, path, bindingPath = path) { - if (!kind) throw new ReferenceError("no `kind`"); - - if (path.isVariableDeclaration()) { - const declarators = path.get("declarations"); - - for (const declar of declarators) { - this.registerBinding(kind, declar); - } - - return; - } - - const parent = this.getProgramParent(); - const ids = path.getOuterBindingIdentifiers(true); - - for (const name of Object.keys(ids)) { - for (const id of ids[name]) { - const local = this.getOwnBinding(name); - - if (local) { - if (local.identifier === id) continue; - this.checkBlockScopedCollisions(local, kind, name, id); - } - - parent.references[name] = true; - - if (local) { - this.registerConstantViolation(bindingPath); - } else { - this.bindings[name] = new _binding.default({ - identifier: id, - scope: this, - path: bindingPath, - kind: kind - }); - } - } - } - } - - addGlobal(node) { - this.globals[node.name] = node; - } - - hasUid(name) { - let scope = this; - - do { - if (scope.uids[name]) return true; - } while (scope = scope.parent); - - return false; - } - - hasGlobal(name) { - let scope = this; - - do { - if (scope.globals[name]) return true; - } while (scope = scope.parent); - - return false; - } - - hasReference(name) { - let scope = this; - - do { - if (scope.references[name]) return true; - } while (scope = scope.parent); - - return false; - } - - isPure(node, constantsOnly) { - if (t().isIdentifier(node)) { - const binding = this.getBinding(node.name); - if (!binding) return false; - if (constantsOnly) return binding.constant; - return true; - } else if (t().isClass(node)) { - if (node.superClass && !this.isPure(node.superClass, constantsOnly)) { - return false; - } - - return this.isPure(node.body, constantsOnly); - } else if (t().isClassBody(node)) { - for (const method of node.body) { - if (!this.isPure(method, constantsOnly)) return false; - } - - return true; - } else if (t().isBinary(node)) { - return this.isPure(node.left, constantsOnly) && this.isPure(node.right, constantsOnly); - } else if (t().isArrayExpression(node)) { - for (const elem of node.elements) { - if (!this.isPure(elem, constantsOnly)) return false; - } - - return true; - } else if (t().isObjectExpression(node)) { - for (const prop of node.properties) { - if (!this.isPure(prop, constantsOnly)) return false; - } - - return true; - } else if (t().isClassMethod(node)) { - if (node.computed && !this.isPure(node.key, constantsOnly)) return false; - if (node.kind === "get" || node.kind === "set") return false; - return true; - } else if (t().isProperty(node)) { - if (node.computed && !this.isPure(node.key, constantsOnly)) return false; - return this.isPure(node.value, constantsOnly); - } else if (t().isUnaryExpression(node)) { - return this.isPure(node.argument, constantsOnly); - } else if (t().isTaggedTemplateExpression(node)) { - return t().matchesPattern(node.tag, "String.raw") && !this.hasBinding("String", true) && this.isPure(node.quasi, constantsOnly); - } else if (t().isTemplateLiteral(node)) { - for (const expression of node.expressions) { - if (!this.isPure(expression, constantsOnly)) return false; - } - - return true; - } else { - return t().isPureish(node); - } - } - - setData(key, val) { - return this.data[key] = val; - } - - getData(key) { - let scope = this; - - do { - const data = scope.data[key]; - if (data != null) return data; - } while (scope = scope.parent); - } - - removeData(key) { - let scope = this; - - do { - const data = scope.data[key]; - if (data != null) scope.data[key] = null; - } while (scope = scope.parent); - } - - init() { - if (!this.references) this.crawl(); - } - - crawl() { - const path = this.path; - this.references = Object.create(null); - this.bindings = Object.create(null); - this.globals = Object.create(null); - this.uids = Object.create(null); - this.data = Object.create(null); - - if (path.isLoop()) { - for (const key of t().FOR_INIT_KEYS) { - const node = path.get(key); - if (node.isBlockScoped()) this.registerBinding(node.node.kind, node); - } - } - - if (path.isFunctionExpression() && path.has("id")) { - if (!path.get("id").node[t().NOT_LOCAL_BINDING]) { - this.registerBinding("local", path.get("id"), path); - } - } - - if (path.isClassExpression() && path.has("id")) { - if (!path.get("id").node[t().NOT_LOCAL_BINDING]) { - this.registerBinding("local", path); - } - } - - if (path.isFunction()) { - const params = path.get("params"); - - for (const param of params) { - this.registerBinding("param", param); - } - } - - if (path.isCatchClause()) { - this.registerBinding("let", path); - } - - const parent = this.getProgramParent(); - if (parent.crawling) return; - const state = { - references: [], - constantViolations: [], - assignments: [] - }; - this.crawling = true; - path.traverse(collectorVisitor, state); - this.crawling = false; - - for (const path of state.assignments) { - const ids = path.getBindingIdentifiers(); - let programParent; - - for (const name of Object.keys(ids)) { - if (path.scope.getBinding(name)) continue; - programParent = programParent || path.scope.getProgramParent(); - programParent.addGlobal(ids[name]); - } - - path.scope.registerConstantViolation(path); - } - - for (const ref of state.references) { - const binding = ref.scope.getBinding(ref.node.name); - - if (binding) { - binding.reference(ref); - } else { - ref.scope.getProgramParent().addGlobal(ref.node); - } - } - - for (const path of state.constantViolations) { - path.scope.registerConstantViolation(path); - } - } - - push(opts) { - let path = this.path; - - if (!path.isBlockStatement() && !path.isProgram()) { - path = this.getBlockParent().path; - } - - if (path.isSwitchStatement()) { - path = (this.getFunctionParent() || this.getProgramParent()).path; - } - - if (path.isLoop() || path.isCatchClause() || path.isFunction()) { - path.ensureBlock(); - path = path.get("body"); - } - - const unique = opts.unique; - const kind = opts.kind || "var"; - const blockHoist = opts._blockHoist == null ? 2 : opts._blockHoist; - const dataKey = `declaration:${kind}:${blockHoist}`; - let declarPath = !unique && path.getData(dataKey); - - if (!declarPath) { - const declar = t().variableDeclaration(kind, []); - declar._blockHoist = blockHoist; - [declarPath] = path.unshiftContainer("body", [declar]); - if (!unique) path.setData(dataKey, declarPath); - } - - const declarator = t().variableDeclarator(opts.id, opts.init); - declarPath.node.declarations.push(declarator); - this.registerBinding(kind, declarPath.get("declarations").pop()); - } - - getProgramParent() { - let scope = this; - - do { - if (scope.path.isProgram()) { - return scope; - } - } while (scope = scope.parent); - - throw new Error("Couldn't find a Program"); - } - - getFunctionParent() { - let scope = this; - - do { - if (scope.path.isFunctionParent()) { - return scope; - } - } while (scope = scope.parent); - - return null; - } - - getBlockParent() { - let scope = this; - - do { - if (scope.path.isBlockParent()) { - return scope; - } - } while (scope = scope.parent); - - throw new Error("We couldn't find a BlockStatement, For, Switch, Function, Loop or Program..."); - } - - getAllBindings() { - const ids = Object.create(null); - let scope = this; - - do { - (0, _defaults().default)(ids, scope.bindings); - scope = scope.parent; - } while (scope); - - return ids; - } - - getAllBindingsOfKind() { - const ids = Object.create(null); - - for (const kind of arguments) { - let scope = this; - - do { - for (const name of Object.keys(scope.bindings)) { - const binding = scope.bindings[name]; - if (binding.kind === kind) ids[name] = binding; - } - - scope = scope.parent; - } while (scope); - } - - return ids; - } - - bindingIdentifierEquals(name, node) { - return this.getBindingIdentifier(name) === node; - } - - getBinding(name) { - let scope = this; - - do { - const binding = scope.getOwnBinding(name); - if (binding) return binding; - } while (scope = scope.parent); - } - - getOwnBinding(name) { - return this.bindings[name]; - } - - getBindingIdentifier(name) { - const info = this.getBinding(name); - return info && info.identifier; - } - - getOwnBindingIdentifier(name) { - const binding = this.bindings[name]; - return binding && binding.identifier; - } - - hasOwnBinding(name) { - return !!this.getOwnBinding(name); - } - - hasBinding(name, noGlobals) { - if (!name) return false; - if (this.hasOwnBinding(name)) return true; - if (this.parentHasBinding(name, noGlobals)) return true; - if (this.hasUid(name)) return true; - if (!noGlobals && (0, _includes().default)(Scope.globals, name)) return true; - if (!noGlobals && (0, _includes().default)(Scope.contextVariables, name)) return true; - return false; - } - - parentHasBinding(name, noGlobals) { - return this.parent && this.parent.hasBinding(name, noGlobals); - } - - moveBindingTo(name, scope) { - const info = this.getBinding(name); - - if (info) { - info.scope.removeOwnBinding(name); - info.scope = scope; - scope.bindings[name] = info; - } - } - - removeOwnBinding(name) { - delete this.bindings[name]; - } - - removeBinding(name) { - const info = this.getBinding(name); - - if (info) { - info.scope.removeOwnBinding(name); - } - - let scope = this; - - do { - if (scope.uids[name]) { - scope.uids[name] = false; - } - } while (scope = scope.parent); - } - -} - -exports.default = Scope; -Scope.globals = Object.keys(_globals().default.builtin); -Scope.contextVariables = ["arguments", "undefined", "Infinity", "NaN"]; - -/***/ }), - -/***/ "./node_modules/@babel/traverse/lib/scope/lib/renamer.js": -/*!***************************************************************!*\ - !*** ./node_modules/@babel/traverse/lib/scope/lib/renamer.js ***! - \***************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -var _binding = _interopRequireDefault(__webpack_require__(/*! ../binding */ "./node_modules/@babel/traverse/lib/scope/binding.js")); - -function _helperSplitExportDeclaration() { - const data = _interopRequireDefault(__webpack_require__(/*! @babel/helper-split-export-declaration */ "./node_modules/@babel/helper-split-export-declaration/lib/index.js")); - - _helperSplitExportDeclaration = function () { - return data; - }; - - return data; -} - -function t() { - const data = _interopRequireWildcard(__webpack_require__(/*! @babel/types */ "./node_modules/@babel/types/lib/index.js")); - - t = function () { - return data; - }; - - return data; -} - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -const renameVisitor = { - ReferencedIdentifier({ - node - }, state) { - if (node.name === state.oldName) { - node.name = state.newName; - } - }, - - Scope(path, state) { - if (!path.scope.bindingIdentifierEquals(state.oldName, state.binding.identifier)) { - path.skip(); - } - }, - - "AssignmentExpression|Declaration"(path, state) { - const ids = path.getOuterBindingIdentifiers(); - - for (const name in ids) { - if (name === state.oldName) ids[name].name = state.newName; - } - } - -}; - -class Renamer { - constructor(binding, oldName, newName) { - this.newName = newName; - this.oldName = oldName; - this.binding = binding; - } - - maybeConvertFromExportDeclaration(parentDeclar) { - const maybeExportDeclar = parentDeclar.parentPath; - - if (!maybeExportDeclar.isExportDeclaration()) { - return; - } - - if (maybeExportDeclar.isExportDefaultDeclaration() && !maybeExportDeclar.get("declaration").node.id) { - return; - } - - (0, _helperSplitExportDeclaration().default)(maybeExportDeclar); - } - - maybeConvertFromClassFunctionDeclaration(path) { - return; - if (!path.isFunctionDeclaration() && !path.isClassDeclaration()) return; - if (this.binding.kind !== "hoisted") return; - path.node.id = t().identifier(this.oldName); - path.node._blockHoist = 3; - path.replaceWith(t().variableDeclaration("let", [t().variableDeclarator(t().identifier(this.newName), t().toExpression(path.node))])); - } - - maybeConvertFromClassFunctionExpression(path) { - return; - if (!path.isFunctionExpression() && !path.isClassExpression()) return; - if (this.binding.kind !== "local") return; - path.node.id = t().identifier(this.oldName); - this.binding.scope.parent.push({ - id: t().identifier(this.newName) - }); - path.replaceWith(t().assignmentExpression("=", t().identifier(this.newName), path.node)); - } - - rename(block) { - const { - binding, - oldName, - newName - } = this; - const { - scope, - path - } = binding; - const parentDeclar = path.find(path => path.isDeclaration() || path.isFunctionExpression() || path.isClassExpression()); - - if (parentDeclar) { - const bindingIds = parentDeclar.getOuterBindingIdentifiers(); - - if (bindingIds[oldName] === binding.identifier) { - this.maybeConvertFromExportDeclaration(parentDeclar); - } - } - - scope.traverse(block || scope.block, renameVisitor, this); - - if (!block) { - scope.removeOwnBinding(oldName); - scope.bindings[newName] = binding; - this.binding.identifier.name = newName; - } - - if (binding.type === "hoisted") {} - - if (parentDeclar) { - this.maybeConvertFromClassFunctionDeclaration(parentDeclar); - this.maybeConvertFromClassFunctionExpression(parentDeclar); - } - } - -} - -exports.default = Renamer; - -/***/ }), - -/***/ "./node_modules/@babel/traverse/lib/visitors.js": -/*!******************************************************!*\ - !*** ./node_modules/@babel/traverse/lib/visitors.js ***! - \******************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.explode = explode; -exports.verify = verify; -exports.merge = merge; - -var virtualTypes = _interopRequireWildcard(__webpack_require__(/*! ./path/lib/virtual-types */ "./node_modules/@babel/traverse/lib/path/lib/virtual-types.js")); - -function t() { - const data = _interopRequireWildcard(__webpack_require__(/*! @babel/types */ "./node_modules/@babel/types/lib/index.js")); - - t = function () { - return data; - }; - - return data; -} - -function _clone() { - const data = _interopRequireDefault(__webpack_require__(/*! lodash/clone */ "./node_modules/lodash/clone.js")); - - _clone = function () { - return data; - }; - - return data; -} - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -function explode(visitor) { - if (visitor._exploded) return visitor; - visitor._exploded = true; - - for (const nodeType of Object.keys(visitor)) { - if (shouldIgnoreKey(nodeType)) continue; - const parts = nodeType.split("|"); - if (parts.length === 1) continue; - const fns = visitor[nodeType]; - delete visitor[nodeType]; - - for (const part of parts) { - visitor[part] = fns; - } - } - - verify(visitor); - delete visitor.__esModule; - ensureEntranceObjects(visitor); - ensureCallbackArrays(visitor); - - for (const nodeType of Object.keys(visitor)) { - if (shouldIgnoreKey(nodeType)) continue; - const wrapper = virtualTypes[nodeType]; - if (!wrapper) continue; - const fns = visitor[nodeType]; - - for (const type of Object.keys(fns)) { - fns[type] = wrapCheck(wrapper, fns[type]); - } - - delete visitor[nodeType]; - - if (wrapper.types) { - for (const type of wrapper.types) { - if (visitor[type]) { - mergePair(visitor[type], fns); - } else { - visitor[type] = fns; - } - } - } else { - mergePair(visitor, fns); - } - } - - for (const nodeType of Object.keys(visitor)) { - if (shouldIgnoreKey(nodeType)) continue; - const fns = visitor[nodeType]; - let aliases = t().FLIPPED_ALIAS_KEYS[nodeType]; - const deprecratedKey = t().DEPRECATED_KEYS[nodeType]; - - if (deprecratedKey) { - console.trace(`Visitor defined for ${nodeType} but it has been renamed to ${deprecratedKey}`); - aliases = [deprecratedKey]; - } - - if (!aliases) continue; - delete visitor[nodeType]; - - for (const alias of aliases) { - const existing = visitor[alias]; - - if (existing) { - mergePair(existing, fns); - } else { - visitor[alias] = (0, _clone().default)(fns); - } - } - } - - for (const nodeType of Object.keys(visitor)) { - if (shouldIgnoreKey(nodeType)) continue; - ensureCallbackArrays(visitor[nodeType]); - } - - return visitor; -} - -function verify(visitor) { - if (visitor._verified) return; - - if (typeof visitor === "function") { - throw new Error("You passed `traverse()` a function when it expected a visitor object, " + "are you sure you didn't mean `{ enter: Function }`?"); - } - - for (const nodeType of Object.keys(visitor)) { - if (nodeType === "enter" || nodeType === "exit") { - validateVisitorMethods(nodeType, visitor[nodeType]); - } - - if (shouldIgnoreKey(nodeType)) continue; - - if (t().TYPES.indexOf(nodeType) < 0) { - throw new Error(`You gave us a visitor for the node type ${nodeType} but it's not a valid type`); - } - - const visitors = visitor[nodeType]; - - if (typeof visitors === "object") { - for (const visitorKey of Object.keys(visitors)) { - if (visitorKey === "enter" || visitorKey === "exit") { - validateVisitorMethods(`${nodeType}.${visitorKey}`, visitors[visitorKey]); - } else { - throw new Error("You passed `traverse()` a visitor object with the property " + `${nodeType} that has the invalid property ${visitorKey}`); - } - } - } - } - - visitor._verified = true; -} - -function validateVisitorMethods(path, val) { - const fns = [].concat(val); - - for (const fn of fns) { - if (typeof fn !== "function") { - throw new TypeError(`Non-function found defined in ${path} with type ${typeof fn}`); - } - } -} - -function merge(visitors, states = [], wrapper) { - const rootVisitor = {}; - - for (let i = 0; i < visitors.length; i++) { - const visitor = visitors[i]; - const state = states[i]; - explode(visitor); - - for (const type of Object.keys(visitor)) { - let visitorType = visitor[type]; - - if (state || wrapper) { - visitorType = wrapWithStateOrWrapper(visitorType, state, wrapper); - } - - const nodeVisitor = rootVisitor[type] = rootVisitor[type] || {}; - mergePair(nodeVisitor, visitorType); - } - } - - return rootVisitor; -} - -function wrapWithStateOrWrapper(oldVisitor, state, wrapper) { - const newVisitor = {}; - - for (const key of Object.keys(oldVisitor)) { - let fns = oldVisitor[key]; - if (!Array.isArray(fns)) continue; - fns = fns.map(function (fn) { - let newFn = fn; - - if (state) { - newFn = function (path) { - return fn.call(state, path, state); - }; - } - - if (wrapper) { - newFn = wrapper(state.key, key, newFn); - } - - return newFn; - }); - newVisitor[key] = fns; - } - - return newVisitor; -} - -function ensureEntranceObjects(obj) { - for (const key of Object.keys(obj)) { - if (shouldIgnoreKey(key)) continue; - const fns = obj[key]; - - if (typeof fns === "function") { - obj[key] = { - enter: fns - }; - } - } -} - -function ensureCallbackArrays(obj) { - if (obj.enter && !Array.isArray(obj.enter)) obj.enter = [obj.enter]; - if (obj.exit && !Array.isArray(obj.exit)) obj.exit = [obj.exit]; -} - -function wrapCheck(wrapper, fn) { - const newFn = function (path) { - if (wrapper.checkPath(path)) { - return fn.apply(this, arguments); - } - }; - - newFn.toString = () => fn.toString(); - - return newFn; -} - -function shouldIgnoreKey(key) { - if (key[0] === "_") return true; - if (key === "enter" || key === "exit" || key === "shouldSkip") return true; - - if (key === "blacklist" || key === "noScope" || key === "skipKeys") { - return true; - } - - return false; -} - -function mergePair(dest, src) { - for (const key of Object.keys(src)) { - dest[key] = [].concat(dest[key] || [], src[key]); - } -} - -/***/ }), - -/***/ "./node_modules/@babel/types/lib/asserts/assertNode.js": -/*!*************************************************************!*\ - !*** ./node_modules/@babel/types/lib/asserts/assertNode.js ***! - \*************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = assertNode; - -var _isNode = _interopRequireDefault(__webpack_require__(/*! ../validators/isNode */ "./node_modules/@babel/types/lib/validators/isNode.js")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function assertNode(node) { - if (!(0, _isNode.default)(node)) { - const type = node && node.type || JSON.stringify(node); - throw new TypeError(`Not a valid node of type "${type}"`); - } -} - -/***/ }), - -/***/ "./node_modules/@babel/types/lib/asserts/generated/index.js": -/*!******************************************************************!*\ - !*** ./node_modules/@babel/types/lib/asserts/generated/index.js ***! - \******************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.assertArrayExpression = assertArrayExpression; -exports.assertAssignmentExpression = assertAssignmentExpression; -exports.assertBinaryExpression = assertBinaryExpression; -exports.assertInterpreterDirective = assertInterpreterDirective; -exports.assertDirective = assertDirective; -exports.assertDirectiveLiteral = assertDirectiveLiteral; -exports.assertBlockStatement = assertBlockStatement; -exports.assertBreakStatement = assertBreakStatement; -exports.assertCallExpression = assertCallExpression; -exports.assertCatchClause = assertCatchClause; -exports.assertConditionalExpression = assertConditionalExpression; -exports.assertContinueStatement = assertContinueStatement; -exports.assertDebuggerStatement = assertDebuggerStatement; -exports.assertDoWhileStatement = assertDoWhileStatement; -exports.assertEmptyStatement = assertEmptyStatement; -exports.assertExpressionStatement = assertExpressionStatement; -exports.assertFile = assertFile; -exports.assertForInStatement = assertForInStatement; -exports.assertForStatement = assertForStatement; -exports.assertFunctionDeclaration = assertFunctionDeclaration; -exports.assertFunctionExpression = assertFunctionExpression; -exports.assertIdentifier = assertIdentifier; -exports.assertIfStatement = assertIfStatement; -exports.assertLabeledStatement = assertLabeledStatement; -exports.assertStringLiteral = assertStringLiteral; -exports.assertNumericLiteral = assertNumericLiteral; -exports.assertNullLiteral = assertNullLiteral; -exports.assertBooleanLiteral = assertBooleanLiteral; -exports.assertRegExpLiteral = assertRegExpLiteral; -exports.assertLogicalExpression = assertLogicalExpression; -exports.assertMemberExpression = assertMemberExpression; -exports.assertNewExpression = assertNewExpression; -exports.assertProgram = assertProgram; -exports.assertObjectExpression = assertObjectExpression; -exports.assertObjectMethod = assertObjectMethod; -exports.assertObjectProperty = assertObjectProperty; -exports.assertRestElement = assertRestElement; -exports.assertReturnStatement = assertReturnStatement; -exports.assertSequenceExpression = assertSequenceExpression; -exports.assertParenthesizedExpression = assertParenthesizedExpression; -exports.assertSwitchCase = assertSwitchCase; -exports.assertSwitchStatement = assertSwitchStatement; -exports.assertThisExpression = assertThisExpression; -exports.assertThrowStatement = assertThrowStatement; -exports.assertTryStatement = assertTryStatement; -exports.assertUnaryExpression = assertUnaryExpression; -exports.assertUpdateExpression = assertUpdateExpression; -exports.assertVariableDeclaration = assertVariableDeclaration; -exports.assertVariableDeclarator = assertVariableDeclarator; -exports.assertWhileStatement = assertWhileStatement; -exports.assertWithStatement = assertWithStatement; -exports.assertAssignmentPattern = assertAssignmentPattern; -exports.assertArrayPattern = assertArrayPattern; -exports.assertArrowFunctionExpression = assertArrowFunctionExpression; -exports.assertClassBody = assertClassBody; -exports.assertClassDeclaration = assertClassDeclaration; -exports.assertClassExpression = assertClassExpression; -exports.assertExportAllDeclaration = assertExportAllDeclaration; -exports.assertExportDefaultDeclaration = assertExportDefaultDeclaration; -exports.assertExportNamedDeclaration = assertExportNamedDeclaration; -exports.assertExportSpecifier = assertExportSpecifier; -exports.assertForOfStatement = assertForOfStatement; -exports.assertImportDeclaration = assertImportDeclaration; -exports.assertImportDefaultSpecifier = assertImportDefaultSpecifier; -exports.assertImportNamespaceSpecifier = assertImportNamespaceSpecifier; -exports.assertImportSpecifier = assertImportSpecifier; -exports.assertMetaProperty = assertMetaProperty; -exports.assertClassMethod = assertClassMethod; -exports.assertObjectPattern = assertObjectPattern; -exports.assertSpreadElement = assertSpreadElement; -exports.assertSuper = assertSuper; -exports.assertTaggedTemplateExpression = assertTaggedTemplateExpression; -exports.assertTemplateElement = assertTemplateElement; -exports.assertTemplateLiteral = assertTemplateLiteral; -exports.assertYieldExpression = assertYieldExpression; -exports.assertAnyTypeAnnotation = assertAnyTypeAnnotation; -exports.assertArrayTypeAnnotation = assertArrayTypeAnnotation; -exports.assertBooleanTypeAnnotation = assertBooleanTypeAnnotation; -exports.assertBooleanLiteralTypeAnnotation = assertBooleanLiteralTypeAnnotation; -exports.assertNullLiteralTypeAnnotation = assertNullLiteralTypeAnnotation; -exports.assertClassImplements = assertClassImplements; -exports.assertDeclareClass = assertDeclareClass; -exports.assertDeclareFunction = assertDeclareFunction; -exports.assertDeclareInterface = assertDeclareInterface; -exports.assertDeclareModule = assertDeclareModule; -exports.assertDeclareModuleExports = assertDeclareModuleExports; -exports.assertDeclareTypeAlias = assertDeclareTypeAlias; -exports.assertDeclareOpaqueType = assertDeclareOpaqueType; -exports.assertDeclareVariable = assertDeclareVariable; -exports.assertDeclareExportDeclaration = assertDeclareExportDeclaration; -exports.assertDeclareExportAllDeclaration = assertDeclareExportAllDeclaration; -exports.assertDeclaredPredicate = assertDeclaredPredicate; -exports.assertExistsTypeAnnotation = assertExistsTypeAnnotation; -exports.assertFunctionTypeAnnotation = assertFunctionTypeAnnotation; -exports.assertFunctionTypeParam = assertFunctionTypeParam; -exports.assertGenericTypeAnnotation = assertGenericTypeAnnotation; -exports.assertInferredPredicate = assertInferredPredicate; -exports.assertInterfaceExtends = assertInterfaceExtends; -exports.assertInterfaceDeclaration = assertInterfaceDeclaration; -exports.assertInterfaceTypeAnnotation = assertInterfaceTypeAnnotation; -exports.assertIntersectionTypeAnnotation = assertIntersectionTypeAnnotation; -exports.assertMixedTypeAnnotation = assertMixedTypeAnnotation; -exports.assertEmptyTypeAnnotation = assertEmptyTypeAnnotation; -exports.assertNullableTypeAnnotation = assertNullableTypeAnnotation; -exports.assertNumberLiteralTypeAnnotation = assertNumberLiteralTypeAnnotation; -exports.assertNumberTypeAnnotation = assertNumberTypeAnnotation; -exports.assertObjectTypeAnnotation = assertObjectTypeAnnotation; -exports.assertObjectTypeInternalSlot = assertObjectTypeInternalSlot; -exports.assertObjectTypeCallProperty = assertObjectTypeCallProperty; -exports.assertObjectTypeIndexer = assertObjectTypeIndexer; -exports.assertObjectTypeProperty = assertObjectTypeProperty; -exports.assertObjectTypeSpreadProperty = assertObjectTypeSpreadProperty; -exports.assertOpaqueType = assertOpaqueType; -exports.assertQualifiedTypeIdentifier = assertQualifiedTypeIdentifier; -exports.assertStringLiteralTypeAnnotation = assertStringLiteralTypeAnnotation; -exports.assertStringTypeAnnotation = assertStringTypeAnnotation; -exports.assertThisTypeAnnotation = assertThisTypeAnnotation; -exports.assertTupleTypeAnnotation = assertTupleTypeAnnotation; -exports.assertTypeofTypeAnnotation = assertTypeofTypeAnnotation; -exports.assertTypeAlias = assertTypeAlias; -exports.assertTypeAnnotation = assertTypeAnnotation; -exports.assertTypeCastExpression = assertTypeCastExpression; -exports.assertTypeParameter = assertTypeParameter; -exports.assertTypeParameterDeclaration = assertTypeParameterDeclaration; -exports.assertTypeParameterInstantiation = assertTypeParameterInstantiation; -exports.assertUnionTypeAnnotation = assertUnionTypeAnnotation; -exports.assertVariance = assertVariance; -exports.assertVoidTypeAnnotation = assertVoidTypeAnnotation; -exports.assertJSXAttribute = assertJSXAttribute; -exports.assertJSXClosingElement = assertJSXClosingElement; -exports.assertJSXElement = assertJSXElement; -exports.assertJSXEmptyExpression = assertJSXEmptyExpression; -exports.assertJSXExpressionContainer = assertJSXExpressionContainer; -exports.assertJSXSpreadChild = assertJSXSpreadChild; -exports.assertJSXIdentifier = assertJSXIdentifier; -exports.assertJSXMemberExpression = assertJSXMemberExpression; -exports.assertJSXNamespacedName = assertJSXNamespacedName; -exports.assertJSXOpeningElement = assertJSXOpeningElement; -exports.assertJSXSpreadAttribute = assertJSXSpreadAttribute; -exports.assertJSXText = assertJSXText; -exports.assertJSXFragment = assertJSXFragment; -exports.assertJSXOpeningFragment = assertJSXOpeningFragment; -exports.assertJSXClosingFragment = assertJSXClosingFragment; -exports.assertNoop = assertNoop; -exports.assertPlaceholder = assertPlaceholder; -exports.assertArgumentPlaceholder = assertArgumentPlaceholder; -exports.assertAwaitExpression = assertAwaitExpression; -exports.assertBindExpression = assertBindExpression; -exports.assertClassProperty = assertClassProperty; -exports.assertOptionalMemberExpression = assertOptionalMemberExpression; -exports.assertPipelineTopicExpression = assertPipelineTopicExpression; -exports.assertPipelineBareFunction = assertPipelineBareFunction; -exports.assertPipelinePrimaryTopicReference = assertPipelinePrimaryTopicReference; -exports.assertOptionalCallExpression = assertOptionalCallExpression; -exports.assertClassPrivateProperty = assertClassPrivateProperty; -exports.assertClassPrivateMethod = assertClassPrivateMethod; -exports.assertImport = assertImport; -exports.assertDecorator = assertDecorator; -exports.assertDoExpression = assertDoExpression; -exports.assertExportDefaultSpecifier = assertExportDefaultSpecifier; -exports.assertExportNamespaceSpecifier = assertExportNamespaceSpecifier; -exports.assertPrivateName = assertPrivateName; -exports.assertBigIntLiteral = assertBigIntLiteral; -exports.assertTSParameterProperty = assertTSParameterProperty; -exports.assertTSDeclareFunction = assertTSDeclareFunction; -exports.assertTSDeclareMethod = assertTSDeclareMethod; -exports.assertTSQualifiedName = assertTSQualifiedName; -exports.assertTSCallSignatureDeclaration = assertTSCallSignatureDeclaration; -exports.assertTSConstructSignatureDeclaration = assertTSConstructSignatureDeclaration; -exports.assertTSPropertySignature = assertTSPropertySignature; -exports.assertTSMethodSignature = assertTSMethodSignature; -exports.assertTSIndexSignature = assertTSIndexSignature; -exports.assertTSAnyKeyword = assertTSAnyKeyword; -exports.assertTSUnknownKeyword = assertTSUnknownKeyword; -exports.assertTSNumberKeyword = assertTSNumberKeyword; -exports.assertTSObjectKeyword = assertTSObjectKeyword; -exports.assertTSBooleanKeyword = assertTSBooleanKeyword; -exports.assertTSStringKeyword = assertTSStringKeyword; -exports.assertTSSymbolKeyword = assertTSSymbolKeyword; -exports.assertTSVoidKeyword = assertTSVoidKeyword; -exports.assertTSUndefinedKeyword = assertTSUndefinedKeyword; -exports.assertTSNullKeyword = assertTSNullKeyword; -exports.assertTSNeverKeyword = assertTSNeverKeyword; -exports.assertTSThisType = assertTSThisType; -exports.assertTSFunctionType = assertTSFunctionType; -exports.assertTSConstructorType = assertTSConstructorType; -exports.assertTSTypeReference = assertTSTypeReference; -exports.assertTSTypePredicate = assertTSTypePredicate; -exports.assertTSTypeQuery = assertTSTypeQuery; -exports.assertTSTypeLiteral = assertTSTypeLiteral; -exports.assertTSArrayType = assertTSArrayType; -exports.assertTSTupleType = assertTSTupleType; -exports.assertTSOptionalType = assertTSOptionalType; -exports.assertTSRestType = assertTSRestType; -exports.assertTSUnionType = assertTSUnionType; -exports.assertTSIntersectionType = assertTSIntersectionType; -exports.assertTSConditionalType = assertTSConditionalType; -exports.assertTSInferType = assertTSInferType; -exports.assertTSParenthesizedType = assertTSParenthesizedType; -exports.assertTSTypeOperator = assertTSTypeOperator; -exports.assertTSIndexedAccessType = assertTSIndexedAccessType; -exports.assertTSMappedType = assertTSMappedType; -exports.assertTSLiteralType = assertTSLiteralType; -exports.assertTSExpressionWithTypeArguments = assertTSExpressionWithTypeArguments; -exports.assertTSInterfaceDeclaration = assertTSInterfaceDeclaration; -exports.assertTSInterfaceBody = assertTSInterfaceBody; -exports.assertTSTypeAliasDeclaration = assertTSTypeAliasDeclaration; -exports.assertTSAsExpression = assertTSAsExpression; -exports.assertTSTypeAssertion = assertTSTypeAssertion; -exports.assertTSEnumDeclaration = assertTSEnumDeclaration; -exports.assertTSEnumMember = assertTSEnumMember; -exports.assertTSModuleDeclaration = assertTSModuleDeclaration; -exports.assertTSModuleBlock = assertTSModuleBlock; -exports.assertTSImportType = assertTSImportType; -exports.assertTSImportEqualsDeclaration = assertTSImportEqualsDeclaration; -exports.assertTSExternalModuleReference = assertTSExternalModuleReference; -exports.assertTSNonNullExpression = assertTSNonNullExpression; -exports.assertTSExportAssignment = assertTSExportAssignment; -exports.assertTSNamespaceExportDeclaration = assertTSNamespaceExportDeclaration; -exports.assertTSTypeAnnotation = assertTSTypeAnnotation; -exports.assertTSTypeParameterInstantiation = assertTSTypeParameterInstantiation; -exports.assertTSTypeParameterDeclaration = assertTSTypeParameterDeclaration; -exports.assertTSTypeParameter = assertTSTypeParameter; -exports.assertExpression = assertExpression; -exports.assertBinary = assertBinary; -exports.assertScopable = assertScopable; -exports.assertBlockParent = assertBlockParent; -exports.assertBlock = assertBlock; -exports.assertStatement = assertStatement; -exports.assertTerminatorless = assertTerminatorless; -exports.assertCompletionStatement = assertCompletionStatement; -exports.assertConditional = assertConditional; -exports.assertLoop = assertLoop; -exports.assertWhile = assertWhile; -exports.assertExpressionWrapper = assertExpressionWrapper; -exports.assertFor = assertFor; -exports.assertForXStatement = assertForXStatement; -exports.assertFunction = assertFunction; -exports.assertFunctionParent = assertFunctionParent; -exports.assertPureish = assertPureish; -exports.assertDeclaration = assertDeclaration; -exports.assertPatternLike = assertPatternLike; -exports.assertLVal = assertLVal; -exports.assertTSEntityName = assertTSEntityName; -exports.assertLiteral = assertLiteral; -exports.assertImmutable = assertImmutable; -exports.assertUserWhitespacable = assertUserWhitespacable; -exports.assertMethod = assertMethod; -exports.assertObjectMember = assertObjectMember; -exports.assertProperty = assertProperty; -exports.assertUnaryLike = assertUnaryLike; -exports.assertPattern = assertPattern; -exports.assertClass = assertClass; -exports.assertModuleDeclaration = assertModuleDeclaration; -exports.assertExportDeclaration = assertExportDeclaration; -exports.assertModuleSpecifier = assertModuleSpecifier; -exports.assertFlow = assertFlow; -exports.assertFlowType = assertFlowType; -exports.assertFlowBaseAnnotation = assertFlowBaseAnnotation; -exports.assertFlowDeclaration = assertFlowDeclaration; -exports.assertFlowPredicate = assertFlowPredicate; -exports.assertJSX = assertJSX; -exports.assertPrivate = assertPrivate; -exports.assertTSTypeElement = assertTSTypeElement; -exports.assertTSType = assertTSType; -exports.assertNumberLiteral = assertNumberLiteral; -exports.assertRegexLiteral = assertRegexLiteral; -exports.assertRestProperty = assertRestProperty; -exports.assertSpreadProperty = assertSpreadProperty; - -var _is = _interopRequireDefault(__webpack_require__(/*! ../../validators/is */ "./node_modules/@babel/types/lib/validators/is.js")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function assert(type, node, opts) { - if (!(0, _is.default)(type, node, opts)) { - throw new Error(`Expected type "${type}" with option ${JSON.stringify(opts)}, but instead got "${node.type}".`); - } -} - -function assertArrayExpression(node, opts = {}) { - assert("ArrayExpression", node, opts); -} - -function assertAssignmentExpression(node, opts = {}) { - assert("AssignmentExpression", node, opts); -} - -function assertBinaryExpression(node, opts = {}) { - assert("BinaryExpression", node, opts); -} - -function assertInterpreterDirective(node, opts = {}) { - assert("InterpreterDirective", node, opts); -} - -function assertDirective(node, opts = {}) { - assert("Directive", node, opts); -} - -function assertDirectiveLiteral(node, opts = {}) { - assert("DirectiveLiteral", node, opts); -} - -function assertBlockStatement(node, opts = {}) { - assert("BlockStatement", node, opts); -} - -function assertBreakStatement(node, opts = {}) { - assert("BreakStatement", node, opts); -} - -function assertCallExpression(node, opts = {}) { - assert("CallExpression", node, opts); -} - -function assertCatchClause(node, opts = {}) { - assert("CatchClause", node, opts); -} - -function assertConditionalExpression(node, opts = {}) { - assert("ConditionalExpression", node, opts); -} - -function assertContinueStatement(node, opts = {}) { - assert("ContinueStatement", node, opts); -} - -function assertDebuggerStatement(node, opts = {}) { - assert("DebuggerStatement", node, opts); -} - -function assertDoWhileStatement(node, opts = {}) { - assert("DoWhileStatement", node, opts); -} - -function assertEmptyStatement(node, opts = {}) { - assert("EmptyStatement", node, opts); -} - -function assertExpressionStatement(node, opts = {}) { - assert("ExpressionStatement", node, opts); -} - -function assertFile(node, opts = {}) { - assert("File", node, opts); -} - -function assertForInStatement(node, opts = {}) { - assert("ForInStatement", node, opts); -} - -function assertForStatement(node, opts = {}) { - assert("ForStatement", node, opts); -} - -function assertFunctionDeclaration(node, opts = {}) { - assert("FunctionDeclaration", node, opts); -} - -function assertFunctionExpression(node, opts = {}) { - assert("FunctionExpression", node, opts); -} - -function assertIdentifier(node, opts = {}) { - assert("Identifier", node, opts); -} - -function assertIfStatement(node, opts = {}) { - assert("IfStatement", node, opts); -} - -function assertLabeledStatement(node, opts = {}) { - assert("LabeledStatement", node, opts); -} - -function assertStringLiteral(node, opts = {}) { - assert("StringLiteral", node, opts); -} - -function assertNumericLiteral(node, opts = {}) { - assert("NumericLiteral", node, opts); -} - -function assertNullLiteral(node, opts = {}) { - assert("NullLiteral", node, opts); -} - -function assertBooleanLiteral(node, opts = {}) { - assert("BooleanLiteral", node, opts); -} - -function assertRegExpLiteral(node, opts = {}) { - assert("RegExpLiteral", node, opts); -} - -function assertLogicalExpression(node, opts = {}) { - assert("LogicalExpression", node, opts); -} - -function assertMemberExpression(node, opts = {}) { - assert("MemberExpression", node, opts); -} - -function assertNewExpression(node, opts = {}) { - assert("NewExpression", node, opts); -} - -function assertProgram(node, opts = {}) { - assert("Program", node, opts); -} - -function assertObjectExpression(node, opts = {}) { - assert("ObjectExpression", node, opts); -} - -function assertObjectMethod(node, opts = {}) { - assert("ObjectMethod", node, opts); -} - -function assertObjectProperty(node, opts = {}) { - assert("ObjectProperty", node, opts); -} - -function assertRestElement(node, opts = {}) { - assert("RestElement", node, opts); -} - -function assertReturnStatement(node, opts = {}) { - assert("ReturnStatement", node, opts); -} - -function assertSequenceExpression(node, opts = {}) { - assert("SequenceExpression", node, opts); -} - -function assertParenthesizedExpression(node, opts = {}) { - assert("ParenthesizedExpression", node, opts); -} - -function assertSwitchCase(node, opts = {}) { - assert("SwitchCase", node, opts); -} - -function assertSwitchStatement(node, opts = {}) { - assert("SwitchStatement", node, opts); -} - -function assertThisExpression(node, opts = {}) { - assert("ThisExpression", node, opts); -} - -function assertThrowStatement(node, opts = {}) { - assert("ThrowStatement", node, opts); -} - -function assertTryStatement(node, opts = {}) { - assert("TryStatement", node, opts); -} - -function assertUnaryExpression(node, opts = {}) { - assert("UnaryExpression", node, opts); -} - -function assertUpdateExpression(node, opts = {}) { - assert("UpdateExpression", node, opts); -} - -function assertVariableDeclaration(node, opts = {}) { - assert("VariableDeclaration", node, opts); -} - -function assertVariableDeclarator(node, opts = {}) { - assert("VariableDeclarator", node, opts); -} - -function assertWhileStatement(node, opts = {}) { - assert("WhileStatement", node, opts); -} - -function assertWithStatement(node, opts = {}) { - assert("WithStatement", node, opts); -} - -function assertAssignmentPattern(node, opts = {}) { - assert("AssignmentPattern", node, opts); -} - -function assertArrayPattern(node, opts = {}) { - assert("ArrayPattern", node, opts); -} - -function assertArrowFunctionExpression(node, opts = {}) { - assert("ArrowFunctionExpression", node, opts); -} - -function assertClassBody(node, opts = {}) { - assert("ClassBody", node, opts); -} - -function assertClassDeclaration(node, opts = {}) { - assert("ClassDeclaration", node, opts); -} - -function assertClassExpression(node, opts = {}) { - assert("ClassExpression", node, opts); -} - -function assertExportAllDeclaration(node, opts = {}) { - assert("ExportAllDeclaration", node, opts); -} - -function assertExportDefaultDeclaration(node, opts = {}) { - assert("ExportDefaultDeclaration", node, opts); -} - -function assertExportNamedDeclaration(node, opts = {}) { - assert("ExportNamedDeclaration", node, opts); -} - -function assertExportSpecifier(node, opts = {}) { - assert("ExportSpecifier", node, opts); -} - -function assertForOfStatement(node, opts = {}) { - assert("ForOfStatement", node, opts); -} - -function assertImportDeclaration(node, opts = {}) { - assert("ImportDeclaration", node, opts); -} - -function assertImportDefaultSpecifier(node, opts = {}) { - assert("ImportDefaultSpecifier", node, opts); -} - -function assertImportNamespaceSpecifier(node, opts = {}) { - assert("ImportNamespaceSpecifier", node, opts); -} - -function assertImportSpecifier(node, opts = {}) { - assert("ImportSpecifier", node, opts); -} - -function assertMetaProperty(node, opts = {}) { - assert("MetaProperty", node, opts); -} - -function assertClassMethod(node, opts = {}) { - assert("ClassMethod", node, opts); -} - -function assertObjectPattern(node, opts = {}) { - assert("ObjectPattern", node, opts); -} - -function assertSpreadElement(node, opts = {}) { - assert("SpreadElement", node, opts); -} - -function assertSuper(node, opts = {}) { - assert("Super", node, opts); -} - -function assertTaggedTemplateExpression(node, opts = {}) { - assert("TaggedTemplateExpression", node, opts); -} - -function assertTemplateElement(node, opts = {}) { - assert("TemplateElement", node, opts); -} - -function assertTemplateLiteral(node, opts = {}) { - assert("TemplateLiteral", node, opts); -} - -function assertYieldExpression(node, opts = {}) { - assert("YieldExpression", node, opts); -} - -function assertAnyTypeAnnotation(node, opts = {}) { - assert("AnyTypeAnnotation", node, opts); -} - -function assertArrayTypeAnnotation(node, opts = {}) { - assert("ArrayTypeAnnotation", node, opts); -} - -function assertBooleanTypeAnnotation(node, opts = {}) { - assert("BooleanTypeAnnotation", node, opts); -} - -function assertBooleanLiteralTypeAnnotation(node, opts = {}) { - assert("BooleanLiteralTypeAnnotation", node, opts); -} - -function assertNullLiteralTypeAnnotation(node, opts = {}) { - assert("NullLiteralTypeAnnotation", node, opts); -} - -function assertClassImplements(node, opts = {}) { - assert("ClassImplements", node, opts); -} - -function assertDeclareClass(node, opts = {}) { - assert("DeclareClass", node, opts); -} - -function assertDeclareFunction(node, opts = {}) { - assert("DeclareFunction", node, opts); -} - -function assertDeclareInterface(node, opts = {}) { - assert("DeclareInterface", node, opts); -} - -function assertDeclareModule(node, opts = {}) { - assert("DeclareModule", node, opts); -} - -function assertDeclareModuleExports(node, opts = {}) { - assert("DeclareModuleExports", node, opts); -} - -function assertDeclareTypeAlias(node, opts = {}) { - assert("DeclareTypeAlias", node, opts); -} - -function assertDeclareOpaqueType(node, opts = {}) { - assert("DeclareOpaqueType", node, opts); -} - -function assertDeclareVariable(node, opts = {}) { - assert("DeclareVariable", node, opts); -} - -function assertDeclareExportDeclaration(node, opts = {}) { - assert("DeclareExportDeclaration", node, opts); -} - -function assertDeclareExportAllDeclaration(node, opts = {}) { - assert("DeclareExportAllDeclaration", node, opts); -} - -function assertDeclaredPredicate(node, opts = {}) { - assert("DeclaredPredicate", node, opts); -} - -function assertExistsTypeAnnotation(node, opts = {}) { - assert("ExistsTypeAnnotation", node, opts); -} - -function assertFunctionTypeAnnotation(node, opts = {}) { - assert("FunctionTypeAnnotation", node, opts); -} - -function assertFunctionTypeParam(node, opts = {}) { - assert("FunctionTypeParam", node, opts); -} - -function assertGenericTypeAnnotation(node, opts = {}) { - assert("GenericTypeAnnotation", node, opts); -} - -function assertInferredPredicate(node, opts = {}) { - assert("InferredPredicate", node, opts); -} - -function assertInterfaceExtends(node, opts = {}) { - assert("InterfaceExtends", node, opts); -} - -function assertInterfaceDeclaration(node, opts = {}) { - assert("InterfaceDeclaration", node, opts); -} - -function assertInterfaceTypeAnnotation(node, opts = {}) { - assert("InterfaceTypeAnnotation", node, opts); -} - -function assertIntersectionTypeAnnotation(node, opts = {}) { - assert("IntersectionTypeAnnotation", node, opts); -} - -function assertMixedTypeAnnotation(node, opts = {}) { - assert("MixedTypeAnnotation", node, opts); -} - -function assertEmptyTypeAnnotation(node, opts = {}) { - assert("EmptyTypeAnnotation", node, opts); -} - -function assertNullableTypeAnnotation(node, opts = {}) { - assert("NullableTypeAnnotation", node, opts); -} - -function assertNumberLiteralTypeAnnotation(node, opts = {}) { - assert("NumberLiteralTypeAnnotation", node, opts); -} - -function assertNumberTypeAnnotation(node, opts = {}) { - assert("NumberTypeAnnotation", node, opts); -} - -function assertObjectTypeAnnotation(node, opts = {}) { - assert("ObjectTypeAnnotation", node, opts); -} - -function assertObjectTypeInternalSlot(node, opts = {}) { - assert("ObjectTypeInternalSlot", node, opts); -} - -function assertObjectTypeCallProperty(node, opts = {}) { - assert("ObjectTypeCallProperty", node, opts); -} - -function assertObjectTypeIndexer(node, opts = {}) { - assert("ObjectTypeIndexer", node, opts); -} - -function assertObjectTypeProperty(node, opts = {}) { - assert("ObjectTypeProperty", node, opts); -} - -function assertObjectTypeSpreadProperty(node, opts = {}) { - assert("ObjectTypeSpreadProperty", node, opts); -} - -function assertOpaqueType(node, opts = {}) { - assert("OpaqueType", node, opts); -} - -function assertQualifiedTypeIdentifier(node, opts = {}) { - assert("QualifiedTypeIdentifier", node, opts); -} - -function assertStringLiteralTypeAnnotation(node, opts = {}) { - assert("StringLiteralTypeAnnotation", node, opts); -} - -function assertStringTypeAnnotation(node, opts = {}) { - assert("StringTypeAnnotation", node, opts); -} - -function assertThisTypeAnnotation(node, opts = {}) { - assert("ThisTypeAnnotation", node, opts); -} - -function assertTupleTypeAnnotation(node, opts = {}) { - assert("TupleTypeAnnotation", node, opts); -} - -function assertTypeofTypeAnnotation(node, opts = {}) { - assert("TypeofTypeAnnotation", node, opts); -} - -function assertTypeAlias(node, opts = {}) { - assert("TypeAlias", node, opts); -} - -function assertTypeAnnotation(node, opts = {}) { - assert("TypeAnnotation", node, opts); -} - -function assertTypeCastExpression(node, opts = {}) { - assert("TypeCastExpression", node, opts); -} - -function assertTypeParameter(node, opts = {}) { - assert("TypeParameter", node, opts); -} - -function assertTypeParameterDeclaration(node, opts = {}) { - assert("TypeParameterDeclaration", node, opts); -} - -function assertTypeParameterInstantiation(node, opts = {}) { - assert("TypeParameterInstantiation", node, opts); -} - -function assertUnionTypeAnnotation(node, opts = {}) { - assert("UnionTypeAnnotation", node, opts); -} - -function assertVariance(node, opts = {}) { - assert("Variance", node, opts); -} - -function assertVoidTypeAnnotation(node, opts = {}) { - assert("VoidTypeAnnotation", node, opts); -} - -function assertJSXAttribute(node, opts = {}) { - assert("JSXAttribute", node, opts); -} - -function assertJSXClosingElement(node, opts = {}) { - assert("JSXClosingElement", node, opts); -} - -function assertJSXElement(node, opts = {}) { - assert("JSXElement", node, opts); -} - -function assertJSXEmptyExpression(node, opts = {}) { - assert("JSXEmptyExpression", node, opts); -} - -function assertJSXExpressionContainer(node, opts = {}) { - assert("JSXExpressionContainer", node, opts); -} - -function assertJSXSpreadChild(node, opts = {}) { - assert("JSXSpreadChild", node, opts); -} - -function assertJSXIdentifier(node, opts = {}) { - assert("JSXIdentifier", node, opts); -} - -function assertJSXMemberExpression(node, opts = {}) { - assert("JSXMemberExpression", node, opts); -} - -function assertJSXNamespacedName(node, opts = {}) { - assert("JSXNamespacedName", node, opts); -} - -function assertJSXOpeningElement(node, opts = {}) { - assert("JSXOpeningElement", node, opts); -} - -function assertJSXSpreadAttribute(node, opts = {}) { - assert("JSXSpreadAttribute", node, opts); -} - -function assertJSXText(node, opts = {}) { - assert("JSXText", node, opts); -} - -function assertJSXFragment(node, opts = {}) { - assert("JSXFragment", node, opts); -} - -function assertJSXOpeningFragment(node, opts = {}) { - assert("JSXOpeningFragment", node, opts); -} - -function assertJSXClosingFragment(node, opts = {}) { - assert("JSXClosingFragment", node, opts); -} - -function assertNoop(node, opts = {}) { - assert("Noop", node, opts); -} - -function assertPlaceholder(node, opts = {}) { - assert("Placeholder", node, opts); -} - -function assertArgumentPlaceholder(node, opts = {}) { - assert("ArgumentPlaceholder", node, opts); -} - -function assertAwaitExpression(node, opts = {}) { - assert("AwaitExpression", node, opts); -} - -function assertBindExpression(node, opts = {}) { - assert("BindExpression", node, opts); -} - -function assertClassProperty(node, opts = {}) { - assert("ClassProperty", node, opts); -} - -function assertOptionalMemberExpression(node, opts = {}) { - assert("OptionalMemberExpression", node, opts); -} - -function assertPipelineTopicExpression(node, opts = {}) { - assert("PipelineTopicExpression", node, opts); -} - -function assertPipelineBareFunction(node, opts = {}) { - assert("PipelineBareFunction", node, opts); -} - -function assertPipelinePrimaryTopicReference(node, opts = {}) { - assert("PipelinePrimaryTopicReference", node, opts); -} - -function assertOptionalCallExpression(node, opts = {}) { - assert("OptionalCallExpression", node, opts); -} - -function assertClassPrivateProperty(node, opts = {}) { - assert("ClassPrivateProperty", node, opts); -} - -function assertClassPrivateMethod(node, opts = {}) { - assert("ClassPrivateMethod", node, opts); -} - -function assertImport(node, opts = {}) { - assert("Import", node, opts); -} - -function assertDecorator(node, opts = {}) { - assert("Decorator", node, opts); -} - -function assertDoExpression(node, opts = {}) { - assert("DoExpression", node, opts); -} - -function assertExportDefaultSpecifier(node, opts = {}) { - assert("ExportDefaultSpecifier", node, opts); -} - -function assertExportNamespaceSpecifier(node, opts = {}) { - assert("ExportNamespaceSpecifier", node, opts); -} - -function assertPrivateName(node, opts = {}) { - assert("PrivateName", node, opts); -} - -function assertBigIntLiteral(node, opts = {}) { - assert("BigIntLiteral", node, opts); -} - -function assertTSParameterProperty(node, opts = {}) { - assert("TSParameterProperty", node, opts); -} - -function assertTSDeclareFunction(node, opts = {}) { - assert("TSDeclareFunction", node, opts); -} - -function assertTSDeclareMethod(node, opts = {}) { - assert("TSDeclareMethod", node, opts); -} - -function assertTSQualifiedName(node, opts = {}) { - assert("TSQualifiedName", node, opts); -} - -function assertTSCallSignatureDeclaration(node, opts = {}) { - assert("TSCallSignatureDeclaration", node, opts); -} - -function assertTSConstructSignatureDeclaration(node, opts = {}) { - assert("TSConstructSignatureDeclaration", node, opts); -} - -function assertTSPropertySignature(node, opts = {}) { - assert("TSPropertySignature", node, opts); -} - -function assertTSMethodSignature(node, opts = {}) { - assert("TSMethodSignature", node, opts); -} - -function assertTSIndexSignature(node, opts = {}) { - assert("TSIndexSignature", node, opts); -} - -function assertTSAnyKeyword(node, opts = {}) { - assert("TSAnyKeyword", node, opts); -} - -function assertTSUnknownKeyword(node, opts = {}) { - assert("TSUnknownKeyword", node, opts); -} - -function assertTSNumberKeyword(node, opts = {}) { - assert("TSNumberKeyword", node, opts); -} - -function assertTSObjectKeyword(node, opts = {}) { - assert("TSObjectKeyword", node, opts); -} - -function assertTSBooleanKeyword(node, opts = {}) { - assert("TSBooleanKeyword", node, opts); -} - -function assertTSStringKeyword(node, opts = {}) { - assert("TSStringKeyword", node, opts); -} - -function assertTSSymbolKeyword(node, opts = {}) { - assert("TSSymbolKeyword", node, opts); -} - -function assertTSVoidKeyword(node, opts = {}) { - assert("TSVoidKeyword", node, opts); -} - -function assertTSUndefinedKeyword(node, opts = {}) { - assert("TSUndefinedKeyword", node, opts); -} - -function assertTSNullKeyword(node, opts = {}) { - assert("TSNullKeyword", node, opts); -} - -function assertTSNeverKeyword(node, opts = {}) { - assert("TSNeverKeyword", node, opts); -} - -function assertTSThisType(node, opts = {}) { - assert("TSThisType", node, opts); -} - -function assertTSFunctionType(node, opts = {}) { - assert("TSFunctionType", node, opts); -} - -function assertTSConstructorType(node, opts = {}) { - assert("TSConstructorType", node, opts); -} - -function assertTSTypeReference(node, opts = {}) { - assert("TSTypeReference", node, opts); -} - -function assertTSTypePredicate(node, opts = {}) { - assert("TSTypePredicate", node, opts); -} - -function assertTSTypeQuery(node, opts = {}) { - assert("TSTypeQuery", node, opts); -} - -function assertTSTypeLiteral(node, opts = {}) { - assert("TSTypeLiteral", node, opts); -} - -function assertTSArrayType(node, opts = {}) { - assert("TSArrayType", node, opts); -} - -function assertTSTupleType(node, opts = {}) { - assert("TSTupleType", node, opts); -} - -function assertTSOptionalType(node, opts = {}) { - assert("TSOptionalType", node, opts); -} - -function assertTSRestType(node, opts = {}) { - assert("TSRestType", node, opts); -} - -function assertTSUnionType(node, opts = {}) { - assert("TSUnionType", node, opts); -} - -function assertTSIntersectionType(node, opts = {}) { - assert("TSIntersectionType", node, opts); -} - -function assertTSConditionalType(node, opts = {}) { - assert("TSConditionalType", node, opts); -} - -function assertTSInferType(node, opts = {}) { - assert("TSInferType", node, opts); -} - -function assertTSParenthesizedType(node, opts = {}) { - assert("TSParenthesizedType", node, opts); -} - -function assertTSTypeOperator(node, opts = {}) { - assert("TSTypeOperator", node, opts); -} - -function assertTSIndexedAccessType(node, opts = {}) { - assert("TSIndexedAccessType", node, opts); -} - -function assertTSMappedType(node, opts = {}) { - assert("TSMappedType", node, opts); -} - -function assertTSLiteralType(node, opts = {}) { - assert("TSLiteralType", node, opts); -} - -function assertTSExpressionWithTypeArguments(node, opts = {}) { - assert("TSExpressionWithTypeArguments", node, opts); -} - -function assertTSInterfaceDeclaration(node, opts = {}) { - assert("TSInterfaceDeclaration", node, opts); -} - -function assertTSInterfaceBody(node, opts = {}) { - assert("TSInterfaceBody", node, opts); -} - -function assertTSTypeAliasDeclaration(node, opts = {}) { - assert("TSTypeAliasDeclaration", node, opts); -} - -function assertTSAsExpression(node, opts = {}) { - assert("TSAsExpression", node, opts); -} - -function assertTSTypeAssertion(node, opts = {}) { - assert("TSTypeAssertion", node, opts); -} - -function assertTSEnumDeclaration(node, opts = {}) { - assert("TSEnumDeclaration", node, opts); -} - -function assertTSEnumMember(node, opts = {}) { - assert("TSEnumMember", node, opts); -} - -function assertTSModuleDeclaration(node, opts = {}) { - assert("TSModuleDeclaration", node, opts); -} - -function assertTSModuleBlock(node, opts = {}) { - assert("TSModuleBlock", node, opts); -} - -function assertTSImportType(node, opts = {}) { - assert("TSImportType", node, opts); -} - -function assertTSImportEqualsDeclaration(node, opts = {}) { - assert("TSImportEqualsDeclaration", node, opts); -} - -function assertTSExternalModuleReference(node, opts = {}) { - assert("TSExternalModuleReference", node, opts); -} - -function assertTSNonNullExpression(node, opts = {}) { - assert("TSNonNullExpression", node, opts); -} - -function assertTSExportAssignment(node, opts = {}) { - assert("TSExportAssignment", node, opts); -} - -function assertTSNamespaceExportDeclaration(node, opts = {}) { - assert("TSNamespaceExportDeclaration", node, opts); -} - -function assertTSTypeAnnotation(node, opts = {}) { - assert("TSTypeAnnotation", node, opts); -} - -function assertTSTypeParameterInstantiation(node, opts = {}) { - assert("TSTypeParameterInstantiation", node, opts); -} - -function assertTSTypeParameterDeclaration(node, opts = {}) { - assert("TSTypeParameterDeclaration", node, opts); -} - -function assertTSTypeParameter(node, opts = {}) { - assert("TSTypeParameter", node, opts); -} - -function assertExpression(node, opts = {}) { - assert("Expression", node, opts); -} - -function assertBinary(node, opts = {}) { - assert("Binary", node, opts); -} - -function assertScopable(node, opts = {}) { - assert("Scopable", node, opts); -} - -function assertBlockParent(node, opts = {}) { - assert("BlockParent", node, opts); -} - -function assertBlock(node, opts = {}) { - assert("Block", node, opts); -} - -function assertStatement(node, opts = {}) { - assert("Statement", node, opts); -} - -function assertTerminatorless(node, opts = {}) { - assert("Terminatorless", node, opts); -} - -function assertCompletionStatement(node, opts = {}) { - assert("CompletionStatement", node, opts); -} - -function assertConditional(node, opts = {}) { - assert("Conditional", node, opts); -} - -function assertLoop(node, opts = {}) { - assert("Loop", node, opts); -} - -function assertWhile(node, opts = {}) { - assert("While", node, opts); -} - -function assertExpressionWrapper(node, opts = {}) { - assert("ExpressionWrapper", node, opts); -} - -function assertFor(node, opts = {}) { - assert("For", node, opts); -} - -function assertForXStatement(node, opts = {}) { - assert("ForXStatement", node, opts); -} - -function assertFunction(node, opts = {}) { - assert("Function", node, opts); -} - -function assertFunctionParent(node, opts = {}) { - assert("FunctionParent", node, opts); -} - -function assertPureish(node, opts = {}) { - assert("Pureish", node, opts); -} - -function assertDeclaration(node, opts = {}) { - assert("Declaration", node, opts); -} - -function assertPatternLike(node, opts = {}) { - assert("PatternLike", node, opts); -} - -function assertLVal(node, opts = {}) { - assert("LVal", node, opts); -} - -function assertTSEntityName(node, opts = {}) { - assert("TSEntityName", node, opts); -} - -function assertLiteral(node, opts = {}) { - assert("Literal", node, opts); -} - -function assertImmutable(node, opts = {}) { - assert("Immutable", node, opts); -} - -function assertUserWhitespacable(node, opts = {}) { - assert("UserWhitespacable", node, opts); -} - -function assertMethod(node, opts = {}) { - assert("Method", node, opts); -} - -function assertObjectMember(node, opts = {}) { - assert("ObjectMember", node, opts); -} - -function assertProperty(node, opts = {}) { - assert("Property", node, opts); -} - -function assertUnaryLike(node, opts = {}) { - assert("UnaryLike", node, opts); -} - -function assertPattern(node, opts = {}) { - assert("Pattern", node, opts); -} - -function assertClass(node, opts = {}) { - assert("Class", node, opts); -} - -function assertModuleDeclaration(node, opts = {}) { - assert("ModuleDeclaration", node, opts); -} - -function assertExportDeclaration(node, opts = {}) { - assert("ExportDeclaration", node, opts); -} - -function assertModuleSpecifier(node, opts = {}) { - assert("ModuleSpecifier", node, opts); -} - -function assertFlow(node, opts = {}) { - assert("Flow", node, opts); -} - -function assertFlowType(node, opts = {}) { - assert("FlowType", node, opts); -} - -function assertFlowBaseAnnotation(node, opts = {}) { - assert("FlowBaseAnnotation", node, opts); -} - -function assertFlowDeclaration(node, opts = {}) { - assert("FlowDeclaration", node, opts); -} - -function assertFlowPredicate(node, opts = {}) { - assert("FlowPredicate", node, opts); -} - -function assertJSX(node, opts = {}) { - assert("JSX", node, opts); -} - -function assertPrivate(node, opts = {}) { - assert("Private", node, opts); -} - -function assertTSTypeElement(node, opts = {}) { - assert("TSTypeElement", node, opts); -} - -function assertTSType(node, opts = {}) { - assert("TSType", node, opts); -} - -function assertNumberLiteral(node, opts) { - console.trace("The node type NumberLiteral has been renamed to NumericLiteral"); - assert("NumberLiteral", node, opts); -} - -function assertRegexLiteral(node, opts) { - console.trace("The node type RegexLiteral has been renamed to RegExpLiteral"); - assert("RegexLiteral", node, opts); -} - -function assertRestProperty(node, opts) { - console.trace("The node type RestProperty has been renamed to RestElement"); - assert("RestProperty", node, opts); -} - -function assertSpreadProperty(node, opts) { - console.trace("The node type SpreadProperty has been renamed to SpreadElement"); - assert("SpreadProperty", node, opts); -} - -/***/ }), - -/***/ "./node_modules/@babel/types/lib/builders/builder.js": -/*!***********************************************************!*\ - !*** ./node_modules/@babel/types/lib/builders/builder.js ***! - \***********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = builder; - -function _clone() { - const data = _interopRequireDefault(__webpack_require__(/*! lodash/clone */ "./node_modules/lodash/clone.js")); - - _clone = function () { - return data; - }; - - return data; -} - -var _definitions = __webpack_require__(/*! ../definitions */ "./node_modules/@babel/types/lib/definitions/index.js"); - -var _validate = _interopRequireDefault(__webpack_require__(/*! ../validators/validate */ "./node_modules/@babel/types/lib/validators/validate.js")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function builder(type, ...args) { - const keys = _definitions.BUILDER_KEYS[type]; - const countArgs = args.length; - - if (countArgs > keys.length) { - throw new Error(`${type}: Too many arguments passed. Received ${countArgs} but can receive no more than ${keys.length}`); - } - - const node = { - type - }; - let i = 0; - keys.forEach(key => { - const field = _definitions.NODE_FIELDS[type][key]; - let arg; - if (i < countArgs) arg = args[i]; - if (arg === undefined) arg = (0, _clone().default)(field.default); - node[key] = arg; - i++; - }); - - for (const key of Object.keys(node)) { - (0, _validate.default)(node, key, node[key]); - } - - return node; -} - -/***/ }), - -/***/ "./node_modules/@babel/types/lib/builders/flow/createTypeAnnotationBasedOnTypeof.js": -/*!******************************************************************************************!*\ - !*** ./node_modules/@babel/types/lib/builders/flow/createTypeAnnotationBasedOnTypeof.js ***! - \******************************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = createTypeAnnotationBasedOnTypeof; - -var _generated = __webpack_require__(/*! ../generated */ "./node_modules/@babel/types/lib/builders/generated/index.js"); - -function createTypeAnnotationBasedOnTypeof(type) { - if (type === "string") { - return (0, _generated.stringTypeAnnotation)(); - } else if (type === "number") { - return (0, _generated.numberTypeAnnotation)(); - } else if (type === "undefined") { - return (0, _generated.voidTypeAnnotation)(); - } else if (type === "boolean") { - return (0, _generated.booleanTypeAnnotation)(); - } else if (type === "function") { - return (0, _generated.genericTypeAnnotation)((0, _generated.identifier)("Function")); - } else if (type === "object") { - return (0, _generated.genericTypeAnnotation)((0, _generated.identifier)("Object")); - } else if (type === "symbol") { - return (0, _generated.genericTypeAnnotation)((0, _generated.identifier)("Symbol")); - } else { - throw new Error("Invalid typeof value"); - } -} - -/***/ }), - -/***/ "./node_modules/@babel/types/lib/builders/flow/createUnionTypeAnnotation.js": -/*!**********************************************************************************!*\ - !*** ./node_modules/@babel/types/lib/builders/flow/createUnionTypeAnnotation.js ***! - \**********************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = createUnionTypeAnnotation; - -var _generated = __webpack_require__(/*! ../generated */ "./node_modules/@babel/types/lib/builders/generated/index.js"); - -var _removeTypeDuplicates = _interopRequireDefault(__webpack_require__(/*! ../../modifications/flow/removeTypeDuplicates */ "./node_modules/@babel/types/lib/modifications/flow/removeTypeDuplicates.js")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function createUnionTypeAnnotation(types) { - const flattened = (0, _removeTypeDuplicates.default)(types); - - if (flattened.length === 1) { - return flattened[0]; - } else { - return (0, _generated.unionTypeAnnotation)(flattened); - } -} - -/***/ }), - -/***/ "./node_modules/@babel/types/lib/builders/generated/index.js": -/*!*******************************************************************!*\ - !*** ./node_modules/@babel/types/lib/builders/generated/index.js ***! - \*******************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.arrayExpression = exports.ArrayExpression = ArrayExpression; -exports.assignmentExpression = exports.AssignmentExpression = AssignmentExpression; -exports.binaryExpression = exports.BinaryExpression = BinaryExpression; -exports.interpreterDirective = exports.InterpreterDirective = InterpreterDirective; -exports.directive = exports.Directive = Directive; -exports.directiveLiteral = exports.DirectiveLiteral = DirectiveLiteral; -exports.blockStatement = exports.BlockStatement = BlockStatement; -exports.breakStatement = exports.BreakStatement = BreakStatement; -exports.callExpression = exports.CallExpression = CallExpression; -exports.catchClause = exports.CatchClause = CatchClause; -exports.conditionalExpression = exports.ConditionalExpression = ConditionalExpression; -exports.continueStatement = exports.ContinueStatement = ContinueStatement; -exports.debuggerStatement = exports.DebuggerStatement = DebuggerStatement; -exports.doWhileStatement = exports.DoWhileStatement = DoWhileStatement; -exports.emptyStatement = exports.EmptyStatement = EmptyStatement; -exports.expressionStatement = exports.ExpressionStatement = ExpressionStatement; -exports.file = exports.File = File; -exports.forInStatement = exports.ForInStatement = ForInStatement; -exports.forStatement = exports.ForStatement = ForStatement; -exports.functionDeclaration = exports.FunctionDeclaration = FunctionDeclaration; -exports.functionExpression = exports.FunctionExpression = FunctionExpression; -exports.identifier = exports.Identifier = Identifier; -exports.ifStatement = exports.IfStatement = IfStatement; -exports.labeledStatement = exports.LabeledStatement = LabeledStatement; -exports.stringLiteral = exports.StringLiteral = StringLiteral; -exports.numericLiteral = exports.NumericLiteral = NumericLiteral; -exports.nullLiteral = exports.NullLiteral = NullLiteral; -exports.booleanLiteral = exports.BooleanLiteral = BooleanLiteral; -exports.regExpLiteral = exports.RegExpLiteral = RegExpLiteral; -exports.logicalExpression = exports.LogicalExpression = LogicalExpression; -exports.memberExpression = exports.MemberExpression = MemberExpression; -exports.newExpression = exports.NewExpression = NewExpression; -exports.program = exports.Program = Program; -exports.objectExpression = exports.ObjectExpression = ObjectExpression; -exports.objectMethod = exports.ObjectMethod = ObjectMethod; -exports.objectProperty = exports.ObjectProperty = ObjectProperty; -exports.restElement = exports.RestElement = RestElement; -exports.returnStatement = exports.ReturnStatement = ReturnStatement; -exports.sequenceExpression = exports.SequenceExpression = SequenceExpression; -exports.parenthesizedExpression = exports.ParenthesizedExpression = ParenthesizedExpression; -exports.switchCase = exports.SwitchCase = SwitchCase; -exports.switchStatement = exports.SwitchStatement = SwitchStatement; -exports.thisExpression = exports.ThisExpression = ThisExpression; -exports.throwStatement = exports.ThrowStatement = ThrowStatement; -exports.tryStatement = exports.TryStatement = TryStatement; -exports.unaryExpression = exports.UnaryExpression = UnaryExpression; -exports.updateExpression = exports.UpdateExpression = UpdateExpression; -exports.variableDeclaration = exports.VariableDeclaration = VariableDeclaration; -exports.variableDeclarator = exports.VariableDeclarator = VariableDeclarator; -exports.whileStatement = exports.WhileStatement = WhileStatement; -exports.withStatement = exports.WithStatement = WithStatement; -exports.assignmentPattern = exports.AssignmentPattern = AssignmentPattern; -exports.arrayPattern = exports.ArrayPattern = ArrayPattern; -exports.arrowFunctionExpression = exports.ArrowFunctionExpression = ArrowFunctionExpression; -exports.classBody = exports.ClassBody = ClassBody; -exports.classDeclaration = exports.ClassDeclaration = ClassDeclaration; -exports.classExpression = exports.ClassExpression = ClassExpression; -exports.exportAllDeclaration = exports.ExportAllDeclaration = ExportAllDeclaration; -exports.exportDefaultDeclaration = exports.ExportDefaultDeclaration = ExportDefaultDeclaration; -exports.exportNamedDeclaration = exports.ExportNamedDeclaration = ExportNamedDeclaration; -exports.exportSpecifier = exports.ExportSpecifier = ExportSpecifier; -exports.forOfStatement = exports.ForOfStatement = ForOfStatement; -exports.importDeclaration = exports.ImportDeclaration = ImportDeclaration; -exports.importDefaultSpecifier = exports.ImportDefaultSpecifier = ImportDefaultSpecifier; -exports.importNamespaceSpecifier = exports.ImportNamespaceSpecifier = ImportNamespaceSpecifier; -exports.importSpecifier = exports.ImportSpecifier = ImportSpecifier; -exports.metaProperty = exports.MetaProperty = MetaProperty; -exports.classMethod = exports.ClassMethod = ClassMethod; -exports.objectPattern = exports.ObjectPattern = ObjectPattern; -exports.spreadElement = exports.SpreadElement = SpreadElement; -exports.super = exports.Super = Super; -exports.taggedTemplateExpression = exports.TaggedTemplateExpression = TaggedTemplateExpression; -exports.templateElement = exports.TemplateElement = TemplateElement; -exports.templateLiteral = exports.TemplateLiteral = TemplateLiteral; -exports.yieldExpression = exports.YieldExpression = YieldExpression; -exports.anyTypeAnnotation = exports.AnyTypeAnnotation = AnyTypeAnnotation; -exports.arrayTypeAnnotation = exports.ArrayTypeAnnotation = ArrayTypeAnnotation; -exports.booleanTypeAnnotation = exports.BooleanTypeAnnotation = BooleanTypeAnnotation; -exports.booleanLiteralTypeAnnotation = exports.BooleanLiteralTypeAnnotation = BooleanLiteralTypeAnnotation; -exports.nullLiteralTypeAnnotation = exports.NullLiteralTypeAnnotation = NullLiteralTypeAnnotation; -exports.classImplements = exports.ClassImplements = ClassImplements; -exports.declareClass = exports.DeclareClass = DeclareClass; -exports.declareFunction = exports.DeclareFunction = DeclareFunction; -exports.declareInterface = exports.DeclareInterface = DeclareInterface; -exports.declareModule = exports.DeclareModule = DeclareModule; -exports.declareModuleExports = exports.DeclareModuleExports = DeclareModuleExports; -exports.declareTypeAlias = exports.DeclareTypeAlias = DeclareTypeAlias; -exports.declareOpaqueType = exports.DeclareOpaqueType = DeclareOpaqueType; -exports.declareVariable = exports.DeclareVariable = DeclareVariable; -exports.declareExportDeclaration = exports.DeclareExportDeclaration = DeclareExportDeclaration; -exports.declareExportAllDeclaration = exports.DeclareExportAllDeclaration = DeclareExportAllDeclaration; -exports.declaredPredicate = exports.DeclaredPredicate = DeclaredPredicate; -exports.existsTypeAnnotation = exports.ExistsTypeAnnotation = ExistsTypeAnnotation; -exports.functionTypeAnnotation = exports.FunctionTypeAnnotation = FunctionTypeAnnotation; -exports.functionTypeParam = exports.FunctionTypeParam = FunctionTypeParam; -exports.genericTypeAnnotation = exports.GenericTypeAnnotation = GenericTypeAnnotation; -exports.inferredPredicate = exports.InferredPredicate = InferredPredicate; -exports.interfaceExtends = exports.InterfaceExtends = InterfaceExtends; -exports.interfaceDeclaration = exports.InterfaceDeclaration = InterfaceDeclaration; -exports.interfaceTypeAnnotation = exports.InterfaceTypeAnnotation = InterfaceTypeAnnotation; -exports.intersectionTypeAnnotation = exports.IntersectionTypeAnnotation = IntersectionTypeAnnotation; -exports.mixedTypeAnnotation = exports.MixedTypeAnnotation = MixedTypeAnnotation; -exports.emptyTypeAnnotation = exports.EmptyTypeAnnotation = EmptyTypeAnnotation; -exports.nullableTypeAnnotation = exports.NullableTypeAnnotation = NullableTypeAnnotation; -exports.numberLiteralTypeAnnotation = exports.NumberLiteralTypeAnnotation = NumberLiteralTypeAnnotation; -exports.numberTypeAnnotation = exports.NumberTypeAnnotation = NumberTypeAnnotation; -exports.objectTypeAnnotation = exports.ObjectTypeAnnotation = ObjectTypeAnnotation; -exports.objectTypeInternalSlot = exports.ObjectTypeInternalSlot = ObjectTypeInternalSlot; -exports.objectTypeCallProperty = exports.ObjectTypeCallProperty = ObjectTypeCallProperty; -exports.objectTypeIndexer = exports.ObjectTypeIndexer = ObjectTypeIndexer; -exports.objectTypeProperty = exports.ObjectTypeProperty = ObjectTypeProperty; -exports.objectTypeSpreadProperty = exports.ObjectTypeSpreadProperty = ObjectTypeSpreadProperty; -exports.opaqueType = exports.OpaqueType = OpaqueType; -exports.qualifiedTypeIdentifier = exports.QualifiedTypeIdentifier = QualifiedTypeIdentifier; -exports.stringLiteralTypeAnnotation = exports.StringLiteralTypeAnnotation = StringLiteralTypeAnnotation; -exports.stringTypeAnnotation = exports.StringTypeAnnotation = StringTypeAnnotation; -exports.thisTypeAnnotation = exports.ThisTypeAnnotation = ThisTypeAnnotation; -exports.tupleTypeAnnotation = exports.TupleTypeAnnotation = TupleTypeAnnotation; -exports.typeofTypeAnnotation = exports.TypeofTypeAnnotation = TypeofTypeAnnotation; -exports.typeAlias = exports.TypeAlias = TypeAlias; -exports.typeAnnotation = exports.TypeAnnotation = TypeAnnotation; -exports.typeCastExpression = exports.TypeCastExpression = TypeCastExpression; -exports.typeParameter = exports.TypeParameter = TypeParameter; -exports.typeParameterDeclaration = exports.TypeParameterDeclaration = TypeParameterDeclaration; -exports.typeParameterInstantiation = exports.TypeParameterInstantiation = TypeParameterInstantiation; -exports.unionTypeAnnotation = exports.UnionTypeAnnotation = UnionTypeAnnotation; -exports.variance = exports.Variance = Variance; -exports.voidTypeAnnotation = exports.VoidTypeAnnotation = VoidTypeAnnotation; -exports.jSXAttribute = exports.jsxAttribute = exports.JSXAttribute = JSXAttribute; -exports.jSXClosingElement = exports.jsxClosingElement = exports.JSXClosingElement = JSXClosingElement; -exports.jSXElement = exports.jsxElement = exports.JSXElement = JSXElement; -exports.jSXEmptyExpression = exports.jsxEmptyExpression = exports.JSXEmptyExpression = JSXEmptyExpression; -exports.jSXExpressionContainer = exports.jsxExpressionContainer = exports.JSXExpressionContainer = JSXExpressionContainer; -exports.jSXSpreadChild = exports.jsxSpreadChild = exports.JSXSpreadChild = JSXSpreadChild; -exports.jSXIdentifier = exports.jsxIdentifier = exports.JSXIdentifier = JSXIdentifier; -exports.jSXMemberExpression = exports.jsxMemberExpression = exports.JSXMemberExpression = JSXMemberExpression; -exports.jSXNamespacedName = exports.jsxNamespacedName = exports.JSXNamespacedName = JSXNamespacedName; -exports.jSXOpeningElement = exports.jsxOpeningElement = exports.JSXOpeningElement = JSXOpeningElement; -exports.jSXSpreadAttribute = exports.jsxSpreadAttribute = exports.JSXSpreadAttribute = JSXSpreadAttribute; -exports.jSXText = exports.jsxText = exports.JSXText = JSXText; -exports.jSXFragment = exports.jsxFragment = exports.JSXFragment = JSXFragment; -exports.jSXOpeningFragment = exports.jsxOpeningFragment = exports.JSXOpeningFragment = JSXOpeningFragment; -exports.jSXClosingFragment = exports.jsxClosingFragment = exports.JSXClosingFragment = JSXClosingFragment; -exports.noop = exports.Noop = Noop; -exports.placeholder = exports.Placeholder = Placeholder; -exports.argumentPlaceholder = exports.ArgumentPlaceholder = ArgumentPlaceholder; -exports.awaitExpression = exports.AwaitExpression = AwaitExpression; -exports.bindExpression = exports.BindExpression = BindExpression; -exports.classProperty = exports.ClassProperty = ClassProperty; -exports.optionalMemberExpression = exports.OptionalMemberExpression = OptionalMemberExpression; -exports.pipelineTopicExpression = exports.PipelineTopicExpression = PipelineTopicExpression; -exports.pipelineBareFunction = exports.PipelineBareFunction = PipelineBareFunction; -exports.pipelinePrimaryTopicReference = exports.PipelinePrimaryTopicReference = PipelinePrimaryTopicReference; -exports.optionalCallExpression = exports.OptionalCallExpression = OptionalCallExpression; -exports.classPrivateProperty = exports.ClassPrivateProperty = ClassPrivateProperty; -exports.classPrivateMethod = exports.ClassPrivateMethod = ClassPrivateMethod; -exports.import = exports.Import = Import; -exports.decorator = exports.Decorator = Decorator; -exports.doExpression = exports.DoExpression = DoExpression; -exports.exportDefaultSpecifier = exports.ExportDefaultSpecifier = ExportDefaultSpecifier; -exports.exportNamespaceSpecifier = exports.ExportNamespaceSpecifier = ExportNamespaceSpecifier; -exports.privateName = exports.PrivateName = PrivateName; -exports.bigIntLiteral = exports.BigIntLiteral = BigIntLiteral; -exports.tSParameterProperty = exports.tsParameterProperty = exports.TSParameterProperty = TSParameterProperty; -exports.tSDeclareFunction = exports.tsDeclareFunction = exports.TSDeclareFunction = TSDeclareFunction; -exports.tSDeclareMethod = exports.tsDeclareMethod = exports.TSDeclareMethod = TSDeclareMethod; -exports.tSQualifiedName = exports.tsQualifiedName = exports.TSQualifiedName = TSQualifiedName; -exports.tSCallSignatureDeclaration = exports.tsCallSignatureDeclaration = exports.TSCallSignatureDeclaration = TSCallSignatureDeclaration; -exports.tSConstructSignatureDeclaration = exports.tsConstructSignatureDeclaration = exports.TSConstructSignatureDeclaration = TSConstructSignatureDeclaration; -exports.tSPropertySignature = exports.tsPropertySignature = exports.TSPropertySignature = TSPropertySignature; -exports.tSMethodSignature = exports.tsMethodSignature = exports.TSMethodSignature = TSMethodSignature; -exports.tSIndexSignature = exports.tsIndexSignature = exports.TSIndexSignature = TSIndexSignature; -exports.tSAnyKeyword = exports.tsAnyKeyword = exports.TSAnyKeyword = TSAnyKeyword; -exports.tSUnknownKeyword = exports.tsUnknownKeyword = exports.TSUnknownKeyword = TSUnknownKeyword; -exports.tSNumberKeyword = exports.tsNumberKeyword = exports.TSNumberKeyword = TSNumberKeyword; -exports.tSObjectKeyword = exports.tsObjectKeyword = exports.TSObjectKeyword = TSObjectKeyword; -exports.tSBooleanKeyword = exports.tsBooleanKeyword = exports.TSBooleanKeyword = TSBooleanKeyword; -exports.tSStringKeyword = exports.tsStringKeyword = exports.TSStringKeyword = TSStringKeyword; -exports.tSSymbolKeyword = exports.tsSymbolKeyword = exports.TSSymbolKeyword = TSSymbolKeyword; -exports.tSVoidKeyword = exports.tsVoidKeyword = exports.TSVoidKeyword = TSVoidKeyword; -exports.tSUndefinedKeyword = exports.tsUndefinedKeyword = exports.TSUndefinedKeyword = TSUndefinedKeyword; -exports.tSNullKeyword = exports.tsNullKeyword = exports.TSNullKeyword = TSNullKeyword; -exports.tSNeverKeyword = exports.tsNeverKeyword = exports.TSNeverKeyword = TSNeverKeyword; -exports.tSThisType = exports.tsThisType = exports.TSThisType = TSThisType; -exports.tSFunctionType = exports.tsFunctionType = exports.TSFunctionType = TSFunctionType; -exports.tSConstructorType = exports.tsConstructorType = exports.TSConstructorType = TSConstructorType; -exports.tSTypeReference = exports.tsTypeReference = exports.TSTypeReference = TSTypeReference; -exports.tSTypePredicate = exports.tsTypePredicate = exports.TSTypePredicate = TSTypePredicate; -exports.tSTypeQuery = exports.tsTypeQuery = exports.TSTypeQuery = TSTypeQuery; -exports.tSTypeLiteral = exports.tsTypeLiteral = exports.TSTypeLiteral = TSTypeLiteral; -exports.tSArrayType = exports.tsArrayType = exports.TSArrayType = TSArrayType; -exports.tSTupleType = exports.tsTupleType = exports.TSTupleType = TSTupleType; -exports.tSOptionalType = exports.tsOptionalType = exports.TSOptionalType = TSOptionalType; -exports.tSRestType = exports.tsRestType = exports.TSRestType = TSRestType; -exports.tSUnionType = exports.tsUnionType = exports.TSUnionType = TSUnionType; -exports.tSIntersectionType = exports.tsIntersectionType = exports.TSIntersectionType = TSIntersectionType; -exports.tSConditionalType = exports.tsConditionalType = exports.TSConditionalType = TSConditionalType; -exports.tSInferType = exports.tsInferType = exports.TSInferType = TSInferType; -exports.tSParenthesizedType = exports.tsParenthesizedType = exports.TSParenthesizedType = TSParenthesizedType; -exports.tSTypeOperator = exports.tsTypeOperator = exports.TSTypeOperator = TSTypeOperator; -exports.tSIndexedAccessType = exports.tsIndexedAccessType = exports.TSIndexedAccessType = TSIndexedAccessType; -exports.tSMappedType = exports.tsMappedType = exports.TSMappedType = TSMappedType; -exports.tSLiteralType = exports.tsLiteralType = exports.TSLiteralType = TSLiteralType; -exports.tSExpressionWithTypeArguments = exports.tsExpressionWithTypeArguments = exports.TSExpressionWithTypeArguments = TSExpressionWithTypeArguments; -exports.tSInterfaceDeclaration = exports.tsInterfaceDeclaration = exports.TSInterfaceDeclaration = TSInterfaceDeclaration; -exports.tSInterfaceBody = exports.tsInterfaceBody = exports.TSInterfaceBody = TSInterfaceBody; -exports.tSTypeAliasDeclaration = exports.tsTypeAliasDeclaration = exports.TSTypeAliasDeclaration = TSTypeAliasDeclaration; -exports.tSAsExpression = exports.tsAsExpression = exports.TSAsExpression = TSAsExpression; -exports.tSTypeAssertion = exports.tsTypeAssertion = exports.TSTypeAssertion = TSTypeAssertion; -exports.tSEnumDeclaration = exports.tsEnumDeclaration = exports.TSEnumDeclaration = TSEnumDeclaration; -exports.tSEnumMember = exports.tsEnumMember = exports.TSEnumMember = TSEnumMember; -exports.tSModuleDeclaration = exports.tsModuleDeclaration = exports.TSModuleDeclaration = TSModuleDeclaration; -exports.tSModuleBlock = exports.tsModuleBlock = exports.TSModuleBlock = TSModuleBlock; -exports.tSImportType = exports.tsImportType = exports.TSImportType = TSImportType; -exports.tSImportEqualsDeclaration = exports.tsImportEqualsDeclaration = exports.TSImportEqualsDeclaration = TSImportEqualsDeclaration; -exports.tSExternalModuleReference = exports.tsExternalModuleReference = exports.TSExternalModuleReference = TSExternalModuleReference; -exports.tSNonNullExpression = exports.tsNonNullExpression = exports.TSNonNullExpression = TSNonNullExpression; -exports.tSExportAssignment = exports.tsExportAssignment = exports.TSExportAssignment = TSExportAssignment; -exports.tSNamespaceExportDeclaration = exports.tsNamespaceExportDeclaration = exports.TSNamespaceExportDeclaration = TSNamespaceExportDeclaration; -exports.tSTypeAnnotation = exports.tsTypeAnnotation = exports.TSTypeAnnotation = TSTypeAnnotation; -exports.tSTypeParameterInstantiation = exports.tsTypeParameterInstantiation = exports.TSTypeParameterInstantiation = TSTypeParameterInstantiation; -exports.tSTypeParameterDeclaration = exports.tsTypeParameterDeclaration = exports.TSTypeParameterDeclaration = TSTypeParameterDeclaration; -exports.tSTypeParameter = exports.tsTypeParameter = exports.TSTypeParameter = TSTypeParameter; -exports.numberLiteral = exports.NumberLiteral = NumberLiteral; -exports.regexLiteral = exports.RegexLiteral = RegexLiteral; -exports.restProperty = exports.RestProperty = RestProperty; -exports.spreadProperty = exports.SpreadProperty = SpreadProperty; - -var _builder = _interopRequireDefault(__webpack_require__(/*! ../builder */ "./node_modules/@babel/types/lib/builders/builder.js")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function ArrayExpression(...args) { - return (0, _builder.default)("ArrayExpression", ...args); -} - -function AssignmentExpression(...args) { - return (0, _builder.default)("AssignmentExpression", ...args); -} - -function BinaryExpression(...args) { - return (0, _builder.default)("BinaryExpression", ...args); -} - -function InterpreterDirective(...args) { - return (0, _builder.default)("InterpreterDirective", ...args); -} - -function Directive(...args) { - return (0, _builder.default)("Directive", ...args); -} - -function DirectiveLiteral(...args) { - return (0, _builder.default)("DirectiveLiteral", ...args); -} - -function BlockStatement(...args) { - return (0, _builder.default)("BlockStatement", ...args); -} - -function BreakStatement(...args) { - return (0, _builder.default)("BreakStatement", ...args); -} - -function CallExpression(...args) { - return (0, _builder.default)("CallExpression", ...args); -} - -function CatchClause(...args) { - return (0, _builder.default)("CatchClause", ...args); -} - -function ConditionalExpression(...args) { - return (0, _builder.default)("ConditionalExpression", ...args); -} - -function ContinueStatement(...args) { - return (0, _builder.default)("ContinueStatement", ...args); -} - -function DebuggerStatement(...args) { - return (0, _builder.default)("DebuggerStatement", ...args); -} - -function DoWhileStatement(...args) { - return (0, _builder.default)("DoWhileStatement", ...args); -} - -function EmptyStatement(...args) { - return (0, _builder.default)("EmptyStatement", ...args); -} - -function ExpressionStatement(...args) { - return (0, _builder.default)("ExpressionStatement", ...args); -} - -function File(...args) { - return (0, _builder.default)("File", ...args); -} - -function ForInStatement(...args) { - return (0, _builder.default)("ForInStatement", ...args); -} - -function ForStatement(...args) { - return (0, _builder.default)("ForStatement", ...args); -} - -function FunctionDeclaration(...args) { - return (0, _builder.default)("FunctionDeclaration", ...args); -} - -function FunctionExpression(...args) { - return (0, _builder.default)("FunctionExpression", ...args); -} - -function Identifier(...args) { - return (0, _builder.default)("Identifier", ...args); -} - -function IfStatement(...args) { - return (0, _builder.default)("IfStatement", ...args); -} - -function LabeledStatement(...args) { - return (0, _builder.default)("LabeledStatement", ...args); -} - -function StringLiteral(...args) { - return (0, _builder.default)("StringLiteral", ...args); -} - -function NumericLiteral(...args) { - return (0, _builder.default)("NumericLiteral", ...args); -} - -function NullLiteral(...args) { - return (0, _builder.default)("NullLiteral", ...args); -} - -function BooleanLiteral(...args) { - return (0, _builder.default)("BooleanLiteral", ...args); -} - -function RegExpLiteral(...args) { - return (0, _builder.default)("RegExpLiteral", ...args); -} - -function LogicalExpression(...args) { - return (0, _builder.default)("LogicalExpression", ...args); -} - -function MemberExpression(...args) { - return (0, _builder.default)("MemberExpression", ...args); -} - -function NewExpression(...args) { - return (0, _builder.default)("NewExpression", ...args); -} - -function Program(...args) { - return (0, _builder.default)("Program", ...args); -} - -function ObjectExpression(...args) { - return (0, _builder.default)("ObjectExpression", ...args); -} - -function ObjectMethod(...args) { - return (0, _builder.default)("ObjectMethod", ...args); -} - -function ObjectProperty(...args) { - return (0, _builder.default)("ObjectProperty", ...args); -} - -function RestElement(...args) { - return (0, _builder.default)("RestElement", ...args); -} - -function ReturnStatement(...args) { - return (0, _builder.default)("ReturnStatement", ...args); -} - -function SequenceExpression(...args) { - return (0, _builder.default)("SequenceExpression", ...args); -} - -function ParenthesizedExpression(...args) { - return (0, _builder.default)("ParenthesizedExpression", ...args); -} - -function SwitchCase(...args) { - return (0, _builder.default)("SwitchCase", ...args); -} - -function SwitchStatement(...args) { - return (0, _builder.default)("SwitchStatement", ...args); -} - -function ThisExpression(...args) { - return (0, _builder.default)("ThisExpression", ...args); -} - -function ThrowStatement(...args) { - return (0, _builder.default)("ThrowStatement", ...args); -} - -function TryStatement(...args) { - return (0, _builder.default)("TryStatement", ...args); -} - -function UnaryExpression(...args) { - return (0, _builder.default)("UnaryExpression", ...args); -} - -function UpdateExpression(...args) { - return (0, _builder.default)("UpdateExpression", ...args); -} - -function VariableDeclaration(...args) { - return (0, _builder.default)("VariableDeclaration", ...args); -} - -function VariableDeclarator(...args) { - return (0, _builder.default)("VariableDeclarator", ...args); -} - -function WhileStatement(...args) { - return (0, _builder.default)("WhileStatement", ...args); -} - -function WithStatement(...args) { - return (0, _builder.default)("WithStatement", ...args); -} - -function AssignmentPattern(...args) { - return (0, _builder.default)("AssignmentPattern", ...args); -} - -function ArrayPattern(...args) { - return (0, _builder.default)("ArrayPattern", ...args); -} - -function ArrowFunctionExpression(...args) { - return (0, _builder.default)("ArrowFunctionExpression", ...args); -} - -function ClassBody(...args) { - return (0, _builder.default)("ClassBody", ...args); -} - -function ClassDeclaration(...args) { - return (0, _builder.default)("ClassDeclaration", ...args); -} - -function ClassExpression(...args) { - return (0, _builder.default)("ClassExpression", ...args); -} - -function ExportAllDeclaration(...args) { - return (0, _builder.default)("ExportAllDeclaration", ...args); -} - -function ExportDefaultDeclaration(...args) { - return (0, _builder.default)("ExportDefaultDeclaration", ...args); -} - -function ExportNamedDeclaration(...args) { - return (0, _builder.default)("ExportNamedDeclaration", ...args); -} - -function ExportSpecifier(...args) { - return (0, _builder.default)("ExportSpecifier", ...args); -} - -function ForOfStatement(...args) { - return (0, _builder.default)("ForOfStatement", ...args); -} - -function ImportDeclaration(...args) { - return (0, _builder.default)("ImportDeclaration", ...args); -} - -function ImportDefaultSpecifier(...args) { - return (0, _builder.default)("ImportDefaultSpecifier", ...args); -} - -function ImportNamespaceSpecifier(...args) { - return (0, _builder.default)("ImportNamespaceSpecifier", ...args); -} - -function ImportSpecifier(...args) { - return (0, _builder.default)("ImportSpecifier", ...args); -} - -function MetaProperty(...args) { - return (0, _builder.default)("MetaProperty", ...args); -} - -function ClassMethod(...args) { - return (0, _builder.default)("ClassMethod", ...args); -} - -function ObjectPattern(...args) { - return (0, _builder.default)("ObjectPattern", ...args); -} - -function SpreadElement(...args) { - return (0, _builder.default)("SpreadElement", ...args); -} - -function Super(...args) { - return (0, _builder.default)("Super", ...args); -} - -function TaggedTemplateExpression(...args) { - return (0, _builder.default)("TaggedTemplateExpression", ...args); -} - -function TemplateElement(...args) { - return (0, _builder.default)("TemplateElement", ...args); -} - -function TemplateLiteral(...args) { - return (0, _builder.default)("TemplateLiteral", ...args); -} - -function YieldExpression(...args) { - return (0, _builder.default)("YieldExpression", ...args); -} - -function AnyTypeAnnotation(...args) { - return (0, _builder.default)("AnyTypeAnnotation", ...args); -} - -function ArrayTypeAnnotation(...args) { - return (0, _builder.default)("ArrayTypeAnnotation", ...args); -} - -function BooleanTypeAnnotation(...args) { - return (0, _builder.default)("BooleanTypeAnnotation", ...args); -} - -function BooleanLiteralTypeAnnotation(...args) { - return (0, _builder.default)("BooleanLiteralTypeAnnotation", ...args); -} - -function NullLiteralTypeAnnotation(...args) { - return (0, _builder.default)("NullLiteralTypeAnnotation", ...args); -} - -function ClassImplements(...args) { - return (0, _builder.default)("ClassImplements", ...args); -} - -function DeclareClass(...args) { - return (0, _builder.default)("DeclareClass", ...args); -} - -function DeclareFunction(...args) { - return (0, _builder.default)("DeclareFunction", ...args); -} - -function DeclareInterface(...args) { - return (0, _builder.default)("DeclareInterface", ...args); -} - -function DeclareModule(...args) { - return (0, _builder.default)("DeclareModule", ...args); -} - -function DeclareModuleExports(...args) { - return (0, _builder.default)("DeclareModuleExports", ...args); -} - -function DeclareTypeAlias(...args) { - return (0, _builder.default)("DeclareTypeAlias", ...args); -} - -function DeclareOpaqueType(...args) { - return (0, _builder.default)("DeclareOpaqueType", ...args); -} - -function DeclareVariable(...args) { - return (0, _builder.default)("DeclareVariable", ...args); -} - -function DeclareExportDeclaration(...args) { - return (0, _builder.default)("DeclareExportDeclaration", ...args); -} - -function DeclareExportAllDeclaration(...args) { - return (0, _builder.default)("DeclareExportAllDeclaration", ...args); -} - -function DeclaredPredicate(...args) { - return (0, _builder.default)("DeclaredPredicate", ...args); -} - -function ExistsTypeAnnotation(...args) { - return (0, _builder.default)("ExistsTypeAnnotation", ...args); -} - -function FunctionTypeAnnotation(...args) { - return (0, _builder.default)("FunctionTypeAnnotation", ...args); -} - -function FunctionTypeParam(...args) { - return (0, _builder.default)("FunctionTypeParam", ...args); -} - -function GenericTypeAnnotation(...args) { - return (0, _builder.default)("GenericTypeAnnotation", ...args); -} - -function InferredPredicate(...args) { - return (0, _builder.default)("InferredPredicate", ...args); -} - -function InterfaceExtends(...args) { - return (0, _builder.default)("InterfaceExtends", ...args); -} - -function InterfaceDeclaration(...args) { - return (0, _builder.default)("InterfaceDeclaration", ...args); -} - -function InterfaceTypeAnnotation(...args) { - return (0, _builder.default)("InterfaceTypeAnnotation", ...args); -} - -function IntersectionTypeAnnotation(...args) { - return (0, _builder.default)("IntersectionTypeAnnotation", ...args); -} - -function MixedTypeAnnotation(...args) { - return (0, _builder.default)("MixedTypeAnnotation", ...args); -} - -function EmptyTypeAnnotation(...args) { - return (0, _builder.default)("EmptyTypeAnnotation", ...args); -} - -function NullableTypeAnnotation(...args) { - return (0, _builder.default)("NullableTypeAnnotation", ...args); -} - -function NumberLiteralTypeAnnotation(...args) { - return (0, _builder.default)("NumberLiteralTypeAnnotation", ...args); -} - -function NumberTypeAnnotation(...args) { - return (0, _builder.default)("NumberTypeAnnotation", ...args); -} - -function ObjectTypeAnnotation(...args) { - return (0, _builder.default)("ObjectTypeAnnotation", ...args); -} - -function ObjectTypeInternalSlot(...args) { - return (0, _builder.default)("ObjectTypeInternalSlot", ...args); -} - -function ObjectTypeCallProperty(...args) { - return (0, _builder.default)("ObjectTypeCallProperty", ...args); -} - -function ObjectTypeIndexer(...args) { - return (0, _builder.default)("ObjectTypeIndexer", ...args); -} - -function ObjectTypeProperty(...args) { - return (0, _builder.default)("ObjectTypeProperty", ...args); -} - -function ObjectTypeSpreadProperty(...args) { - return (0, _builder.default)("ObjectTypeSpreadProperty", ...args); -} - -function OpaqueType(...args) { - return (0, _builder.default)("OpaqueType", ...args); -} - -function QualifiedTypeIdentifier(...args) { - return (0, _builder.default)("QualifiedTypeIdentifier", ...args); -} - -function StringLiteralTypeAnnotation(...args) { - return (0, _builder.default)("StringLiteralTypeAnnotation", ...args); -} - -function StringTypeAnnotation(...args) { - return (0, _builder.default)("StringTypeAnnotation", ...args); -} - -function ThisTypeAnnotation(...args) { - return (0, _builder.default)("ThisTypeAnnotation", ...args); -} - -function TupleTypeAnnotation(...args) { - return (0, _builder.default)("TupleTypeAnnotation", ...args); -} - -function TypeofTypeAnnotation(...args) { - return (0, _builder.default)("TypeofTypeAnnotation", ...args); -} - -function TypeAlias(...args) { - return (0, _builder.default)("TypeAlias", ...args); -} - -function TypeAnnotation(...args) { - return (0, _builder.default)("TypeAnnotation", ...args); -} - -function TypeCastExpression(...args) { - return (0, _builder.default)("TypeCastExpression", ...args); -} - -function TypeParameter(...args) { - return (0, _builder.default)("TypeParameter", ...args); -} - -function TypeParameterDeclaration(...args) { - return (0, _builder.default)("TypeParameterDeclaration", ...args); -} - -function TypeParameterInstantiation(...args) { - return (0, _builder.default)("TypeParameterInstantiation", ...args); -} - -function UnionTypeAnnotation(...args) { - return (0, _builder.default)("UnionTypeAnnotation", ...args); -} - -function Variance(...args) { - return (0, _builder.default)("Variance", ...args); -} - -function VoidTypeAnnotation(...args) { - return (0, _builder.default)("VoidTypeAnnotation", ...args); -} - -function JSXAttribute(...args) { - return (0, _builder.default)("JSXAttribute", ...args); -} - -function JSXClosingElement(...args) { - return (0, _builder.default)("JSXClosingElement", ...args); -} - -function JSXElement(...args) { - return (0, _builder.default)("JSXElement", ...args); -} - -function JSXEmptyExpression(...args) { - return (0, _builder.default)("JSXEmptyExpression", ...args); -} - -function JSXExpressionContainer(...args) { - return (0, _builder.default)("JSXExpressionContainer", ...args); -} - -function JSXSpreadChild(...args) { - return (0, _builder.default)("JSXSpreadChild", ...args); -} - -function JSXIdentifier(...args) { - return (0, _builder.default)("JSXIdentifier", ...args); -} - -function JSXMemberExpression(...args) { - return (0, _builder.default)("JSXMemberExpression", ...args); -} - -function JSXNamespacedName(...args) { - return (0, _builder.default)("JSXNamespacedName", ...args); -} - -function JSXOpeningElement(...args) { - return (0, _builder.default)("JSXOpeningElement", ...args); -} - -function JSXSpreadAttribute(...args) { - return (0, _builder.default)("JSXSpreadAttribute", ...args); -} - -function JSXText(...args) { - return (0, _builder.default)("JSXText", ...args); -} - -function JSXFragment(...args) { - return (0, _builder.default)("JSXFragment", ...args); -} - -function JSXOpeningFragment(...args) { - return (0, _builder.default)("JSXOpeningFragment", ...args); -} - -function JSXClosingFragment(...args) { - return (0, _builder.default)("JSXClosingFragment", ...args); -} - -function Noop(...args) { - return (0, _builder.default)("Noop", ...args); -} - -function Placeholder(...args) { - return (0, _builder.default)("Placeholder", ...args); -} - -function ArgumentPlaceholder(...args) { - return (0, _builder.default)("ArgumentPlaceholder", ...args); -} - -function AwaitExpression(...args) { - return (0, _builder.default)("AwaitExpression", ...args); -} - -function BindExpression(...args) { - return (0, _builder.default)("BindExpression", ...args); -} - -function ClassProperty(...args) { - return (0, _builder.default)("ClassProperty", ...args); -} - -function OptionalMemberExpression(...args) { - return (0, _builder.default)("OptionalMemberExpression", ...args); -} - -function PipelineTopicExpression(...args) { - return (0, _builder.default)("PipelineTopicExpression", ...args); -} - -function PipelineBareFunction(...args) { - return (0, _builder.default)("PipelineBareFunction", ...args); -} - -function PipelinePrimaryTopicReference(...args) { - return (0, _builder.default)("PipelinePrimaryTopicReference", ...args); -} - -function OptionalCallExpression(...args) { - return (0, _builder.default)("OptionalCallExpression", ...args); -} - -function ClassPrivateProperty(...args) { - return (0, _builder.default)("ClassPrivateProperty", ...args); -} - -function ClassPrivateMethod(...args) { - return (0, _builder.default)("ClassPrivateMethod", ...args); -} - -function Import(...args) { - return (0, _builder.default)("Import", ...args); -} - -function Decorator(...args) { - return (0, _builder.default)("Decorator", ...args); -} - -function DoExpression(...args) { - return (0, _builder.default)("DoExpression", ...args); -} - -function ExportDefaultSpecifier(...args) { - return (0, _builder.default)("ExportDefaultSpecifier", ...args); -} - -function ExportNamespaceSpecifier(...args) { - return (0, _builder.default)("ExportNamespaceSpecifier", ...args); -} - -function PrivateName(...args) { - return (0, _builder.default)("PrivateName", ...args); -} - -function BigIntLiteral(...args) { - return (0, _builder.default)("BigIntLiteral", ...args); -} - -function TSParameterProperty(...args) { - return (0, _builder.default)("TSParameterProperty", ...args); -} - -function TSDeclareFunction(...args) { - return (0, _builder.default)("TSDeclareFunction", ...args); -} - -function TSDeclareMethod(...args) { - return (0, _builder.default)("TSDeclareMethod", ...args); -} - -function TSQualifiedName(...args) { - return (0, _builder.default)("TSQualifiedName", ...args); -} - -function TSCallSignatureDeclaration(...args) { - return (0, _builder.default)("TSCallSignatureDeclaration", ...args); -} - -function TSConstructSignatureDeclaration(...args) { - return (0, _builder.default)("TSConstructSignatureDeclaration", ...args); -} - -function TSPropertySignature(...args) { - return (0, _builder.default)("TSPropertySignature", ...args); -} - -function TSMethodSignature(...args) { - return (0, _builder.default)("TSMethodSignature", ...args); -} - -function TSIndexSignature(...args) { - return (0, _builder.default)("TSIndexSignature", ...args); -} - -function TSAnyKeyword(...args) { - return (0, _builder.default)("TSAnyKeyword", ...args); -} - -function TSUnknownKeyword(...args) { - return (0, _builder.default)("TSUnknownKeyword", ...args); -} - -function TSNumberKeyword(...args) { - return (0, _builder.default)("TSNumberKeyword", ...args); -} - -function TSObjectKeyword(...args) { - return (0, _builder.default)("TSObjectKeyword", ...args); -} - -function TSBooleanKeyword(...args) { - return (0, _builder.default)("TSBooleanKeyword", ...args); -} - -function TSStringKeyword(...args) { - return (0, _builder.default)("TSStringKeyword", ...args); -} - -function TSSymbolKeyword(...args) { - return (0, _builder.default)("TSSymbolKeyword", ...args); -} - -function TSVoidKeyword(...args) { - return (0, _builder.default)("TSVoidKeyword", ...args); -} - -function TSUndefinedKeyword(...args) { - return (0, _builder.default)("TSUndefinedKeyword", ...args); -} - -function TSNullKeyword(...args) { - return (0, _builder.default)("TSNullKeyword", ...args); -} - -function TSNeverKeyword(...args) { - return (0, _builder.default)("TSNeverKeyword", ...args); -} - -function TSThisType(...args) { - return (0, _builder.default)("TSThisType", ...args); -} - -function TSFunctionType(...args) { - return (0, _builder.default)("TSFunctionType", ...args); -} - -function TSConstructorType(...args) { - return (0, _builder.default)("TSConstructorType", ...args); -} - -function TSTypeReference(...args) { - return (0, _builder.default)("TSTypeReference", ...args); -} - -function TSTypePredicate(...args) { - return (0, _builder.default)("TSTypePredicate", ...args); -} - -function TSTypeQuery(...args) { - return (0, _builder.default)("TSTypeQuery", ...args); -} - -function TSTypeLiteral(...args) { - return (0, _builder.default)("TSTypeLiteral", ...args); -} - -function TSArrayType(...args) { - return (0, _builder.default)("TSArrayType", ...args); -} - -function TSTupleType(...args) { - return (0, _builder.default)("TSTupleType", ...args); -} - -function TSOptionalType(...args) { - return (0, _builder.default)("TSOptionalType", ...args); -} - -function TSRestType(...args) { - return (0, _builder.default)("TSRestType", ...args); -} - -function TSUnionType(...args) { - return (0, _builder.default)("TSUnionType", ...args); -} - -function TSIntersectionType(...args) { - return (0, _builder.default)("TSIntersectionType", ...args); -} - -function TSConditionalType(...args) { - return (0, _builder.default)("TSConditionalType", ...args); -} - -function TSInferType(...args) { - return (0, _builder.default)("TSInferType", ...args); -} - -function TSParenthesizedType(...args) { - return (0, _builder.default)("TSParenthesizedType", ...args); -} - -function TSTypeOperator(...args) { - return (0, _builder.default)("TSTypeOperator", ...args); -} - -function TSIndexedAccessType(...args) { - return (0, _builder.default)("TSIndexedAccessType", ...args); -} - -function TSMappedType(...args) { - return (0, _builder.default)("TSMappedType", ...args); -} - -function TSLiteralType(...args) { - return (0, _builder.default)("TSLiteralType", ...args); -} - -function TSExpressionWithTypeArguments(...args) { - return (0, _builder.default)("TSExpressionWithTypeArguments", ...args); -} - -function TSInterfaceDeclaration(...args) { - return (0, _builder.default)("TSInterfaceDeclaration", ...args); -} - -function TSInterfaceBody(...args) { - return (0, _builder.default)("TSInterfaceBody", ...args); -} - -function TSTypeAliasDeclaration(...args) { - return (0, _builder.default)("TSTypeAliasDeclaration", ...args); -} - -function TSAsExpression(...args) { - return (0, _builder.default)("TSAsExpression", ...args); -} - -function TSTypeAssertion(...args) { - return (0, _builder.default)("TSTypeAssertion", ...args); -} - -function TSEnumDeclaration(...args) { - return (0, _builder.default)("TSEnumDeclaration", ...args); -} - -function TSEnumMember(...args) { - return (0, _builder.default)("TSEnumMember", ...args); -} - -function TSModuleDeclaration(...args) { - return (0, _builder.default)("TSModuleDeclaration", ...args); -} - -function TSModuleBlock(...args) { - return (0, _builder.default)("TSModuleBlock", ...args); -} - -function TSImportType(...args) { - return (0, _builder.default)("TSImportType", ...args); -} - -function TSImportEqualsDeclaration(...args) { - return (0, _builder.default)("TSImportEqualsDeclaration", ...args); -} - -function TSExternalModuleReference(...args) { - return (0, _builder.default)("TSExternalModuleReference", ...args); -} - -function TSNonNullExpression(...args) { - return (0, _builder.default)("TSNonNullExpression", ...args); -} - -function TSExportAssignment(...args) { - return (0, _builder.default)("TSExportAssignment", ...args); -} - -function TSNamespaceExportDeclaration(...args) { - return (0, _builder.default)("TSNamespaceExportDeclaration", ...args); -} - -function TSTypeAnnotation(...args) { - return (0, _builder.default)("TSTypeAnnotation", ...args); -} - -function TSTypeParameterInstantiation(...args) { - return (0, _builder.default)("TSTypeParameterInstantiation", ...args); -} - -function TSTypeParameterDeclaration(...args) { - return (0, _builder.default)("TSTypeParameterDeclaration", ...args); -} - -function TSTypeParameter(...args) { - return (0, _builder.default)("TSTypeParameter", ...args); -} - -function NumberLiteral(...args) { - console.trace("The node type NumberLiteral has been renamed to NumericLiteral"); - return NumberLiteral("NumberLiteral", ...args); -} - -function RegexLiteral(...args) { - console.trace("The node type RegexLiteral has been renamed to RegExpLiteral"); - return RegexLiteral("RegexLiteral", ...args); -} - -function RestProperty(...args) { - console.trace("The node type RestProperty has been renamed to RestElement"); - return RestProperty("RestProperty", ...args); -} - -function SpreadProperty(...args) { - console.trace("The node type SpreadProperty has been renamed to SpreadElement"); - return SpreadProperty("SpreadProperty", ...args); -} - -/***/ }), - -/***/ "./node_modules/@babel/types/lib/builders/react/buildChildren.js": -/*!***********************************************************************!*\ - !*** ./node_modules/@babel/types/lib/builders/react/buildChildren.js ***! - \***********************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = buildChildren; - -var _generated = __webpack_require__(/*! ../../validators/generated */ "./node_modules/@babel/types/lib/validators/generated/index.js"); - -var _cleanJSXElementLiteralChild = _interopRequireDefault(__webpack_require__(/*! ../../utils/react/cleanJSXElementLiteralChild */ "./node_modules/@babel/types/lib/utils/react/cleanJSXElementLiteralChild.js")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function buildChildren(node) { - const elements = []; - - for (let i = 0; i < node.children.length; i++) { - let child = node.children[i]; - - if ((0, _generated.isJSXText)(child)) { - (0, _cleanJSXElementLiteralChild.default)(child, elements); - continue; - } - - if ((0, _generated.isJSXExpressionContainer)(child)) child = child.expression; - if ((0, _generated.isJSXEmptyExpression)(child)) continue; - elements.push(child); - } - - return elements; -} - -/***/ }), - -/***/ "./node_modules/@babel/types/lib/clone/clone.js": -/*!******************************************************!*\ - !*** ./node_modules/@babel/types/lib/clone/clone.js ***! - \******************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = clone; - -var _cloneNode = _interopRequireDefault(__webpack_require__(/*! ./cloneNode */ "./node_modules/@babel/types/lib/clone/cloneNode.js")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function clone(node) { - return (0, _cloneNode.default)(node, false); -} - -/***/ }), - -/***/ "./node_modules/@babel/types/lib/clone/cloneDeep.js": -/*!**********************************************************!*\ - !*** ./node_modules/@babel/types/lib/clone/cloneDeep.js ***! - \**********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = cloneDeep; - -var _cloneNode = _interopRequireDefault(__webpack_require__(/*! ./cloneNode */ "./node_modules/@babel/types/lib/clone/cloneNode.js")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function cloneDeep(node) { - return (0, _cloneNode.default)(node); -} - -/***/ }), - -/***/ "./node_modules/@babel/types/lib/clone/cloneNode.js": -/*!**********************************************************!*\ - !*** ./node_modules/@babel/types/lib/clone/cloneNode.js ***! - \**********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = cloneNode; - -var _definitions = __webpack_require__(/*! ../definitions */ "./node_modules/@babel/types/lib/definitions/index.js"); - -const has = Function.call.bind(Object.prototype.hasOwnProperty); - -function cloneIfNode(obj, deep) { - if (obj && typeof obj.type === "string" && obj.type !== "CommentLine" && obj.type !== "CommentBlock") { - return cloneNode(obj, deep); - } - - return obj; -} - -function cloneIfNodeOrArray(obj, deep) { - if (Array.isArray(obj)) { - return obj.map(node => cloneIfNode(node, deep)); - } - - return cloneIfNode(obj, deep); -} - -function cloneNode(node, deep = true) { - if (!node) return node; - const { - type - } = node; - const newNode = { - type - }; - - if (type === "Identifier") { - newNode.name = node.name; - - if (has(node, "optional") && typeof node.optional === "boolean") { - newNode.optional = node.optional; - } - - if (has(node, "typeAnnotation")) { - newNode.typeAnnotation = deep ? cloneIfNodeOrArray(node.typeAnnotation, true) : node.typeAnnotation; - } - } else if (!has(_definitions.NODE_FIELDS, type)) { - throw new Error(`Unknown node type: "${type}"`); - } else { - for (const field of Object.keys(_definitions.NODE_FIELDS[type])) { - if (has(node, field)) { - newNode[field] = deep ? cloneIfNodeOrArray(node[field], true) : node[field]; - } - } - } - - if (has(node, "loc")) { - newNode.loc = node.loc; - } - - if (has(node, "leadingComments")) { - newNode.leadingComments = node.leadingComments; - } - - if (has(node, "innerComments")) { - newNode.innerComments = node.innerComments; - } - - if (has(node, "trailingComments")) { - newNode.trailingComments = node.trailingComments; - } - - if (has(node, "extra")) { - newNode.extra = Object.assign({}, node.extra); - } - - return newNode; -} - -/***/ }), - -/***/ "./node_modules/@babel/types/lib/clone/cloneWithoutLoc.js": -/*!****************************************************************!*\ - !*** ./node_modules/@babel/types/lib/clone/cloneWithoutLoc.js ***! - \****************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = cloneWithoutLoc; - -var _clone = _interopRequireDefault(__webpack_require__(/*! ./clone */ "./node_modules/@babel/types/lib/clone/clone.js")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function cloneWithoutLoc(node) { - const newNode = (0, _clone.default)(node); - newNode.loc = null; - return newNode; -} - -/***/ }), - -/***/ "./node_modules/@babel/types/lib/comments/addComment.js": -/*!**************************************************************!*\ - !*** ./node_modules/@babel/types/lib/comments/addComment.js ***! - \**************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = addComment; - -var _addComments = _interopRequireDefault(__webpack_require__(/*! ./addComments */ "./node_modules/@babel/types/lib/comments/addComments.js")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function addComment(node, type, content, line) { - return (0, _addComments.default)(node, type, [{ - type: line ? "CommentLine" : "CommentBlock", - value: content - }]); -} - -/***/ }), - -/***/ "./node_modules/@babel/types/lib/comments/addComments.js": -/*!***************************************************************!*\ - !*** ./node_modules/@babel/types/lib/comments/addComments.js ***! - \***************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = addComments; - -function addComments(node, type, comments) { - if (!comments || !node) return node; - const key = `${type}Comments`; - - if (node[key]) { - if (type === "leading") { - node[key] = comments.concat(node[key]); - } else { - node[key] = node[key].concat(comments); - } - } else { - node[key] = comments; - } - - return node; -} - -/***/ }), - -/***/ "./node_modules/@babel/types/lib/comments/inheritInnerComments.js": -/*!************************************************************************!*\ - !*** ./node_modules/@babel/types/lib/comments/inheritInnerComments.js ***! - \************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = inheritInnerComments; - -var _inherit = _interopRequireDefault(__webpack_require__(/*! ../utils/inherit */ "./node_modules/@babel/types/lib/utils/inherit.js")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function inheritInnerComments(child, parent) { - (0, _inherit.default)("innerComments", child, parent); -} - -/***/ }), - -/***/ "./node_modules/@babel/types/lib/comments/inheritLeadingComments.js": -/*!**************************************************************************!*\ - !*** ./node_modules/@babel/types/lib/comments/inheritLeadingComments.js ***! - \**************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = inheritLeadingComments; - -var _inherit = _interopRequireDefault(__webpack_require__(/*! ../utils/inherit */ "./node_modules/@babel/types/lib/utils/inherit.js")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function inheritLeadingComments(child, parent) { - (0, _inherit.default)("leadingComments", child, parent); -} - -/***/ }), - -/***/ "./node_modules/@babel/types/lib/comments/inheritTrailingComments.js": -/*!***************************************************************************!*\ - !*** ./node_modules/@babel/types/lib/comments/inheritTrailingComments.js ***! - \***************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = inheritTrailingComments; - -var _inherit = _interopRequireDefault(__webpack_require__(/*! ../utils/inherit */ "./node_modules/@babel/types/lib/utils/inherit.js")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function inheritTrailingComments(child, parent) { - (0, _inherit.default)("trailingComments", child, parent); -} - -/***/ }), - -/***/ "./node_modules/@babel/types/lib/comments/inheritsComments.js": -/*!********************************************************************!*\ - !*** ./node_modules/@babel/types/lib/comments/inheritsComments.js ***! - \********************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = inheritsComments; - -var _inheritTrailingComments = _interopRequireDefault(__webpack_require__(/*! ./inheritTrailingComments */ "./node_modules/@babel/types/lib/comments/inheritTrailingComments.js")); - -var _inheritLeadingComments = _interopRequireDefault(__webpack_require__(/*! ./inheritLeadingComments */ "./node_modules/@babel/types/lib/comments/inheritLeadingComments.js")); - -var _inheritInnerComments = _interopRequireDefault(__webpack_require__(/*! ./inheritInnerComments */ "./node_modules/@babel/types/lib/comments/inheritInnerComments.js")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function inheritsComments(child, parent) { - (0, _inheritTrailingComments.default)(child, parent); - (0, _inheritLeadingComments.default)(child, parent); - (0, _inheritInnerComments.default)(child, parent); - return child; -} - -/***/ }), - -/***/ "./node_modules/@babel/types/lib/comments/removeComments.js": -/*!******************************************************************!*\ - !*** ./node_modules/@babel/types/lib/comments/removeComments.js ***! - \******************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = removeComments; - -var _constants = __webpack_require__(/*! ../constants */ "./node_modules/@babel/types/lib/constants/index.js"); - -function removeComments(node) { - _constants.COMMENT_KEYS.forEach(key => { - node[key] = null; - }); - - return node; -} - -/***/ }), - -/***/ "./node_modules/@babel/types/lib/constants/generated/index.js": -/*!********************************************************************!*\ - !*** ./node_modules/@babel/types/lib/constants/generated/index.js ***! - \********************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.TSTYPE_TYPES = exports.TSTYPEELEMENT_TYPES = exports.PRIVATE_TYPES = exports.JSX_TYPES = exports.FLOWPREDICATE_TYPES = exports.FLOWDECLARATION_TYPES = exports.FLOWBASEANNOTATION_TYPES = exports.FLOWTYPE_TYPES = exports.FLOW_TYPES = exports.MODULESPECIFIER_TYPES = exports.EXPORTDECLARATION_TYPES = exports.MODULEDECLARATION_TYPES = exports.CLASS_TYPES = exports.PATTERN_TYPES = exports.UNARYLIKE_TYPES = exports.PROPERTY_TYPES = exports.OBJECTMEMBER_TYPES = exports.METHOD_TYPES = exports.USERWHITESPACABLE_TYPES = exports.IMMUTABLE_TYPES = exports.LITERAL_TYPES = exports.TSENTITYNAME_TYPES = exports.LVAL_TYPES = exports.PATTERNLIKE_TYPES = exports.DECLARATION_TYPES = exports.PUREISH_TYPES = exports.FUNCTIONPARENT_TYPES = exports.FUNCTION_TYPES = exports.FORXSTATEMENT_TYPES = exports.FOR_TYPES = exports.EXPRESSIONWRAPPER_TYPES = exports.WHILE_TYPES = exports.LOOP_TYPES = exports.CONDITIONAL_TYPES = exports.COMPLETIONSTATEMENT_TYPES = exports.TERMINATORLESS_TYPES = exports.STATEMENT_TYPES = exports.BLOCK_TYPES = exports.BLOCKPARENT_TYPES = exports.SCOPABLE_TYPES = exports.BINARY_TYPES = exports.EXPRESSION_TYPES = void 0; - -var _definitions = __webpack_require__(/*! ../../definitions */ "./node_modules/@babel/types/lib/definitions/index.js"); - -const EXPRESSION_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Expression"]; -exports.EXPRESSION_TYPES = EXPRESSION_TYPES; -const BINARY_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Binary"]; -exports.BINARY_TYPES = BINARY_TYPES; -const SCOPABLE_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Scopable"]; -exports.SCOPABLE_TYPES = SCOPABLE_TYPES; -const BLOCKPARENT_TYPES = _definitions.FLIPPED_ALIAS_KEYS["BlockParent"]; -exports.BLOCKPARENT_TYPES = BLOCKPARENT_TYPES; -const BLOCK_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Block"]; -exports.BLOCK_TYPES = BLOCK_TYPES; -const STATEMENT_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Statement"]; -exports.STATEMENT_TYPES = STATEMENT_TYPES; -const TERMINATORLESS_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Terminatorless"]; -exports.TERMINATORLESS_TYPES = TERMINATORLESS_TYPES; -const COMPLETIONSTATEMENT_TYPES = _definitions.FLIPPED_ALIAS_KEYS["CompletionStatement"]; -exports.COMPLETIONSTATEMENT_TYPES = COMPLETIONSTATEMENT_TYPES; -const CONDITIONAL_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Conditional"]; -exports.CONDITIONAL_TYPES = CONDITIONAL_TYPES; -const LOOP_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Loop"]; -exports.LOOP_TYPES = LOOP_TYPES; -const WHILE_TYPES = _definitions.FLIPPED_ALIAS_KEYS["While"]; -exports.WHILE_TYPES = WHILE_TYPES; -const EXPRESSIONWRAPPER_TYPES = _definitions.FLIPPED_ALIAS_KEYS["ExpressionWrapper"]; -exports.EXPRESSIONWRAPPER_TYPES = EXPRESSIONWRAPPER_TYPES; -const FOR_TYPES = _definitions.FLIPPED_ALIAS_KEYS["For"]; -exports.FOR_TYPES = FOR_TYPES; -const FORXSTATEMENT_TYPES = _definitions.FLIPPED_ALIAS_KEYS["ForXStatement"]; -exports.FORXSTATEMENT_TYPES = FORXSTATEMENT_TYPES; -const FUNCTION_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Function"]; -exports.FUNCTION_TYPES = FUNCTION_TYPES; -const FUNCTIONPARENT_TYPES = _definitions.FLIPPED_ALIAS_KEYS["FunctionParent"]; -exports.FUNCTIONPARENT_TYPES = FUNCTIONPARENT_TYPES; -const PUREISH_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Pureish"]; -exports.PUREISH_TYPES = PUREISH_TYPES; -const DECLARATION_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Declaration"]; -exports.DECLARATION_TYPES = DECLARATION_TYPES; -const PATTERNLIKE_TYPES = _definitions.FLIPPED_ALIAS_KEYS["PatternLike"]; -exports.PATTERNLIKE_TYPES = PATTERNLIKE_TYPES; -const LVAL_TYPES = _definitions.FLIPPED_ALIAS_KEYS["LVal"]; -exports.LVAL_TYPES = LVAL_TYPES; -const TSENTITYNAME_TYPES = _definitions.FLIPPED_ALIAS_KEYS["TSEntityName"]; -exports.TSENTITYNAME_TYPES = TSENTITYNAME_TYPES; -const LITERAL_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Literal"]; -exports.LITERAL_TYPES = LITERAL_TYPES; -const IMMUTABLE_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Immutable"]; -exports.IMMUTABLE_TYPES = IMMUTABLE_TYPES; -const USERWHITESPACABLE_TYPES = _definitions.FLIPPED_ALIAS_KEYS["UserWhitespacable"]; -exports.USERWHITESPACABLE_TYPES = USERWHITESPACABLE_TYPES; -const METHOD_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Method"]; -exports.METHOD_TYPES = METHOD_TYPES; -const OBJECTMEMBER_TYPES = _definitions.FLIPPED_ALIAS_KEYS["ObjectMember"]; -exports.OBJECTMEMBER_TYPES = OBJECTMEMBER_TYPES; -const PROPERTY_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Property"]; -exports.PROPERTY_TYPES = PROPERTY_TYPES; -const UNARYLIKE_TYPES = _definitions.FLIPPED_ALIAS_KEYS["UnaryLike"]; -exports.UNARYLIKE_TYPES = UNARYLIKE_TYPES; -const PATTERN_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Pattern"]; -exports.PATTERN_TYPES = PATTERN_TYPES; -const CLASS_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Class"]; -exports.CLASS_TYPES = CLASS_TYPES; -const MODULEDECLARATION_TYPES = _definitions.FLIPPED_ALIAS_KEYS["ModuleDeclaration"]; -exports.MODULEDECLARATION_TYPES = MODULEDECLARATION_TYPES; -const EXPORTDECLARATION_TYPES = _definitions.FLIPPED_ALIAS_KEYS["ExportDeclaration"]; -exports.EXPORTDECLARATION_TYPES = EXPORTDECLARATION_TYPES; -const MODULESPECIFIER_TYPES = _definitions.FLIPPED_ALIAS_KEYS["ModuleSpecifier"]; -exports.MODULESPECIFIER_TYPES = MODULESPECIFIER_TYPES; -const FLOW_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Flow"]; -exports.FLOW_TYPES = FLOW_TYPES; -const FLOWTYPE_TYPES = _definitions.FLIPPED_ALIAS_KEYS["FlowType"]; -exports.FLOWTYPE_TYPES = FLOWTYPE_TYPES; -const FLOWBASEANNOTATION_TYPES = _definitions.FLIPPED_ALIAS_KEYS["FlowBaseAnnotation"]; -exports.FLOWBASEANNOTATION_TYPES = FLOWBASEANNOTATION_TYPES; -const FLOWDECLARATION_TYPES = _definitions.FLIPPED_ALIAS_KEYS["FlowDeclaration"]; -exports.FLOWDECLARATION_TYPES = FLOWDECLARATION_TYPES; -const FLOWPREDICATE_TYPES = _definitions.FLIPPED_ALIAS_KEYS["FlowPredicate"]; -exports.FLOWPREDICATE_TYPES = FLOWPREDICATE_TYPES; -const JSX_TYPES = _definitions.FLIPPED_ALIAS_KEYS["JSX"]; -exports.JSX_TYPES = JSX_TYPES; -const PRIVATE_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Private"]; -exports.PRIVATE_TYPES = PRIVATE_TYPES; -const TSTYPEELEMENT_TYPES = _definitions.FLIPPED_ALIAS_KEYS["TSTypeElement"]; -exports.TSTYPEELEMENT_TYPES = TSTYPEELEMENT_TYPES; -const TSTYPE_TYPES = _definitions.FLIPPED_ALIAS_KEYS["TSType"]; -exports.TSTYPE_TYPES = TSTYPE_TYPES; - -/***/ }), - -/***/ "./node_modules/@babel/types/lib/constants/index.js": -/*!**********************************************************!*\ - !*** ./node_modules/@babel/types/lib/constants/index.js ***! - \**********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.NOT_LOCAL_BINDING = exports.BLOCK_SCOPED_SYMBOL = exports.INHERIT_KEYS = exports.UNARY_OPERATORS = exports.STRING_UNARY_OPERATORS = exports.NUMBER_UNARY_OPERATORS = exports.BOOLEAN_UNARY_OPERATORS = exports.BINARY_OPERATORS = exports.NUMBER_BINARY_OPERATORS = exports.BOOLEAN_BINARY_OPERATORS = exports.COMPARISON_BINARY_OPERATORS = exports.EQUALITY_BINARY_OPERATORS = exports.BOOLEAN_NUMBER_BINARY_OPERATORS = exports.UPDATE_OPERATORS = exports.LOGICAL_OPERATORS = exports.COMMENT_KEYS = exports.FOR_INIT_KEYS = exports.FLATTENABLE_KEYS = exports.STATEMENT_OR_BLOCK_KEYS = void 0; -const STATEMENT_OR_BLOCK_KEYS = ["consequent", "body", "alternate"]; -exports.STATEMENT_OR_BLOCK_KEYS = STATEMENT_OR_BLOCK_KEYS; -const FLATTENABLE_KEYS = ["body", "expressions"]; -exports.FLATTENABLE_KEYS = FLATTENABLE_KEYS; -const FOR_INIT_KEYS = ["left", "init"]; -exports.FOR_INIT_KEYS = FOR_INIT_KEYS; -const COMMENT_KEYS = ["leadingComments", "trailingComments", "innerComments"]; -exports.COMMENT_KEYS = COMMENT_KEYS; -const LOGICAL_OPERATORS = ["||", "&&", "??"]; -exports.LOGICAL_OPERATORS = LOGICAL_OPERATORS; -const UPDATE_OPERATORS = ["++", "--"]; -exports.UPDATE_OPERATORS = UPDATE_OPERATORS; -const BOOLEAN_NUMBER_BINARY_OPERATORS = [">", "<", ">=", "<="]; -exports.BOOLEAN_NUMBER_BINARY_OPERATORS = BOOLEAN_NUMBER_BINARY_OPERATORS; -const EQUALITY_BINARY_OPERATORS = ["==", "===", "!=", "!=="]; -exports.EQUALITY_BINARY_OPERATORS = EQUALITY_BINARY_OPERATORS; -const COMPARISON_BINARY_OPERATORS = [...EQUALITY_BINARY_OPERATORS, "in", "instanceof"]; -exports.COMPARISON_BINARY_OPERATORS = COMPARISON_BINARY_OPERATORS; -const BOOLEAN_BINARY_OPERATORS = [...COMPARISON_BINARY_OPERATORS, ...BOOLEAN_NUMBER_BINARY_OPERATORS]; -exports.BOOLEAN_BINARY_OPERATORS = BOOLEAN_BINARY_OPERATORS; -const NUMBER_BINARY_OPERATORS = ["-", "/", "%", "*", "**", "&", "|", ">>", ">>>", "<<", "^"]; -exports.NUMBER_BINARY_OPERATORS = NUMBER_BINARY_OPERATORS; -const BINARY_OPERATORS = ["+", ...NUMBER_BINARY_OPERATORS, ...BOOLEAN_BINARY_OPERATORS]; -exports.BINARY_OPERATORS = BINARY_OPERATORS; -const BOOLEAN_UNARY_OPERATORS = ["delete", "!"]; -exports.BOOLEAN_UNARY_OPERATORS = BOOLEAN_UNARY_OPERATORS; -const NUMBER_UNARY_OPERATORS = ["+", "-", "~"]; -exports.NUMBER_UNARY_OPERATORS = NUMBER_UNARY_OPERATORS; -const STRING_UNARY_OPERATORS = ["typeof"]; -exports.STRING_UNARY_OPERATORS = STRING_UNARY_OPERATORS; -const UNARY_OPERATORS = ["void", "throw", ...BOOLEAN_UNARY_OPERATORS, ...NUMBER_UNARY_OPERATORS, ...STRING_UNARY_OPERATORS]; -exports.UNARY_OPERATORS = UNARY_OPERATORS; -const INHERIT_KEYS = { - optional: ["typeAnnotation", "typeParameters", "returnType"], - force: ["start", "loc", "end"] -}; -exports.INHERIT_KEYS = INHERIT_KEYS; -const BLOCK_SCOPED_SYMBOL = Symbol.for("var used to be block scoped"); -exports.BLOCK_SCOPED_SYMBOL = BLOCK_SCOPED_SYMBOL; -const NOT_LOCAL_BINDING = Symbol.for("should not be considered a local binding"); -exports.NOT_LOCAL_BINDING = NOT_LOCAL_BINDING; - -/***/ }), - -/***/ "./node_modules/@babel/types/lib/converters/ensureBlock.js": -/*!*****************************************************************!*\ - !*** ./node_modules/@babel/types/lib/converters/ensureBlock.js ***! - \*****************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = ensureBlock; - -var _toBlock = _interopRequireDefault(__webpack_require__(/*! ./toBlock */ "./node_modules/@babel/types/lib/converters/toBlock.js")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function ensureBlock(node, key = "body") { - return node[key] = (0, _toBlock.default)(node[key], node); -} - -/***/ }), - -/***/ "./node_modules/@babel/types/lib/converters/gatherSequenceExpressions.js": -/*!*******************************************************************************!*\ - !*** ./node_modules/@babel/types/lib/converters/gatherSequenceExpressions.js ***! - \*******************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = gatherSequenceExpressions; - -var _getBindingIdentifiers = _interopRequireDefault(__webpack_require__(/*! ../retrievers/getBindingIdentifiers */ "./node_modules/@babel/types/lib/retrievers/getBindingIdentifiers.js")); - -var _generated = __webpack_require__(/*! ../validators/generated */ "./node_modules/@babel/types/lib/validators/generated/index.js"); - -var _generated2 = __webpack_require__(/*! ../builders/generated */ "./node_modules/@babel/types/lib/builders/generated/index.js"); - -var _cloneNode = _interopRequireDefault(__webpack_require__(/*! ../clone/cloneNode */ "./node_modules/@babel/types/lib/clone/cloneNode.js")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function gatherSequenceExpressions(nodes, scope, declars) { - const exprs = []; - let ensureLastUndefined = true; - - for (const node of nodes) { - ensureLastUndefined = false; - - if ((0, _generated.isExpression)(node)) { - exprs.push(node); - } else if ((0, _generated.isExpressionStatement)(node)) { - exprs.push(node.expression); - } else if ((0, _generated.isVariableDeclaration)(node)) { - if (node.kind !== "var") return; - - for (const declar of node.declarations) { - const bindings = (0, _getBindingIdentifiers.default)(declar); - - for (const key of Object.keys(bindings)) { - declars.push({ - kind: node.kind, - id: (0, _cloneNode.default)(bindings[key]) - }); - } - - if (declar.init) { - exprs.push((0, _generated2.assignmentExpression)("=", declar.id, declar.init)); - } - } - - ensureLastUndefined = true; - } else if ((0, _generated.isIfStatement)(node)) { - const consequent = node.consequent ? gatherSequenceExpressions([node.consequent], scope, declars) : scope.buildUndefinedNode(); - const alternate = node.alternate ? gatherSequenceExpressions([node.alternate], scope, declars) : scope.buildUndefinedNode(); - if (!consequent || !alternate) return; - exprs.push((0, _generated2.conditionalExpression)(node.test, consequent, alternate)); - } else if ((0, _generated.isBlockStatement)(node)) { - const body = gatherSequenceExpressions(node.body, scope, declars); - if (!body) return; - exprs.push(body); - } else if ((0, _generated.isEmptyStatement)(node)) { - ensureLastUndefined = true; - } else { - return; - } - } - - if (ensureLastUndefined) { - exprs.push(scope.buildUndefinedNode()); - } - - if (exprs.length === 1) { - return exprs[0]; - } else { - return (0, _generated2.sequenceExpression)(exprs); - } -} - -/***/ }), - -/***/ "./node_modules/@babel/types/lib/converters/toBindingIdentifierName.js": -/*!*****************************************************************************!*\ - !*** ./node_modules/@babel/types/lib/converters/toBindingIdentifierName.js ***! - \*****************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = toBindingIdentifierName; - -var _toIdentifier = _interopRequireDefault(__webpack_require__(/*! ./toIdentifier */ "./node_modules/@babel/types/lib/converters/toIdentifier.js")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function toBindingIdentifierName(name) { - name = (0, _toIdentifier.default)(name); - if (name === "eval" || name === "arguments") name = "_" + name; - return name; -} - -/***/ }), - -/***/ "./node_modules/@babel/types/lib/converters/toBlock.js": -/*!*************************************************************!*\ - !*** ./node_modules/@babel/types/lib/converters/toBlock.js ***! - \*************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = toBlock; - -var _generated = __webpack_require__(/*! ../validators/generated */ "./node_modules/@babel/types/lib/validators/generated/index.js"); - -var _generated2 = __webpack_require__(/*! ../builders/generated */ "./node_modules/@babel/types/lib/builders/generated/index.js"); - -function toBlock(node, parent) { - if ((0, _generated.isBlockStatement)(node)) { - return node; - } - - let blockNodes = []; - - if ((0, _generated.isEmptyStatement)(node)) { - blockNodes = []; - } else { - if (!(0, _generated.isStatement)(node)) { - if ((0, _generated.isFunction)(parent)) { - node = (0, _generated2.returnStatement)(node); - } else { - node = (0, _generated2.expressionStatement)(node); - } - } - - blockNodes = [node]; - } - - return (0, _generated2.blockStatement)(blockNodes); -} - -/***/ }), - -/***/ "./node_modules/@babel/types/lib/converters/toComputedKey.js": -/*!*******************************************************************!*\ - !*** ./node_modules/@babel/types/lib/converters/toComputedKey.js ***! - \*******************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = toComputedKey; - -var _generated = __webpack_require__(/*! ../validators/generated */ "./node_modules/@babel/types/lib/validators/generated/index.js"); - -var _generated2 = __webpack_require__(/*! ../builders/generated */ "./node_modules/@babel/types/lib/builders/generated/index.js"); - -function toComputedKey(node, key = node.key || node.property) { - if (!node.computed && (0, _generated.isIdentifier)(key)) key = (0, _generated2.stringLiteral)(key.name); - return key; -} - -/***/ }), - -/***/ "./node_modules/@babel/types/lib/converters/toExpression.js": -/*!******************************************************************!*\ - !*** ./node_modules/@babel/types/lib/converters/toExpression.js ***! - \******************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = toExpression; - -var _generated = __webpack_require__(/*! ../validators/generated */ "./node_modules/@babel/types/lib/validators/generated/index.js"); - -function toExpression(node) { - if ((0, _generated.isExpressionStatement)(node)) { - node = node.expression; - } - - if ((0, _generated.isExpression)(node)) { - return node; - } - - if ((0, _generated.isClass)(node)) { - node.type = "ClassExpression"; - } else if ((0, _generated.isFunction)(node)) { - node.type = "FunctionExpression"; - } - - if (!(0, _generated.isExpression)(node)) { - throw new Error(`cannot turn ${node.type} to an expression`); - } - - return node; -} - -/***/ }), - -/***/ "./node_modules/@babel/types/lib/converters/toIdentifier.js": -/*!******************************************************************!*\ - !*** ./node_modules/@babel/types/lib/converters/toIdentifier.js ***! - \******************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = toIdentifier; - -var _isValidIdentifier = _interopRequireDefault(__webpack_require__(/*! ../validators/isValidIdentifier */ "./node_modules/@babel/types/lib/validators/isValidIdentifier.js")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function toIdentifier(name) { - name = name + ""; - name = name.replace(/[^a-zA-Z0-9$_]/g, "-"); - name = name.replace(/^[-0-9]+/, ""); - name = name.replace(/[-\s]+(.)?/g, function (match, c) { - return c ? c.toUpperCase() : ""; - }); - - if (!(0, _isValidIdentifier.default)(name)) { - name = `_${name}`; - } - - return name || "_"; -} - -/***/ }), - -/***/ "./node_modules/@babel/types/lib/converters/toKeyAlias.js": -/*!****************************************************************!*\ - !*** ./node_modules/@babel/types/lib/converters/toKeyAlias.js ***! - \****************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = toKeyAlias; - -var _generated = __webpack_require__(/*! ../validators/generated */ "./node_modules/@babel/types/lib/validators/generated/index.js"); - -var _cloneNode = _interopRequireDefault(__webpack_require__(/*! ../clone/cloneNode */ "./node_modules/@babel/types/lib/clone/cloneNode.js")); - -var _removePropertiesDeep = _interopRequireDefault(__webpack_require__(/*! ../modifications/removePropertiesDeep */ "./node_modules/@babel/types/lib/modifications/removePropertiesDeep.js")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function toKeyAlias(node, key = node.key) { - let alias; - - if (node.kind === "method") { - return toKeyAlias.increment() + ""; - } else if ((0, _generated.isIdentifier)(key)) { - alias = key.name; - } else if ((0, _generated.isStringLiteral)(key)) { - alias = JSON.stringify(key.value); - } else { - alias = JSON.stringify((0, _removePropertiesDeep.default)((0, _cloneNode.default)(key))); - } - - if (node.computed) { - alias = `[${alias}]`; - } - - if (node.static) { - alias = `static:${alias}`; - } - - return alias; -} - -toKeyAlias.uid = 0; - -toKeyAlias.increment = function () { - if (toKeyAlias.uid >= Number.MAX_SAFE_INTEGER) { - return toKeyAlias.uid = 0; - } else { - return toKeyAlias.uid++; - } -}; - -/***/ }), - -/***/ "./node_modules/@babel/types/lib/converters/toSequenceExpression.js": -/*!**************************************************************************!*\ - !*** ./node_modules/@babel/types/lib/converters/toSequenceExpression.js ***! - \**************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = toSequenceExpression; - -var _gatherSequenceExpressions = _interopRequireDefault(__webpack_require__(/*! ./gatherSequenceExpressions */ "./node_modules/@babel/types/lib/converters/gatherSequenceExpressions.js")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function toSequenceExpression(nodes, scope) { - if (!nodes || !nodes.length) return; - const declars = []; - const result = (0, _gatherSequenceExpressions.default)(nodes, scope, declars); - if (!result) return; - - for (const declar of declars) { - scope.push(declar); - } - - return result; -} - -/***/ }), - -/***/ "./node_modules/@babel/types/lib/converters/toStatement.js": -/*!*****************************************************************!*\ - !*** ./node_modules/@babel/types/lib/converters/toStatement.js ***! - \*****************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = toStatement; - -var _generated = __webpack_require__(/*! ../validators/generated */ "./node_modules/@babel/types/lib/validators/generated/index.js"); - -var _generated2 = __webpack_require__(/*! ../builders/generated */ "./node_modules/@babel/types/lib/builders/generated/index.js"); - -function toStatement(node, ignore) { - if ((0, _generated.isStatement)(node)) { - return node; - } - - let mustHaveId = false; - let newType; - - if ((0, _generated.isClass)(node)) { - mustHaveId = true; - newType = "ClassDeclaration"; - } else if ((0, _generated.isFunction)(node)) { - mustHaveId = true; - newType = "FunctionDeclaration"; - } else if ((0, _generated.isAssignmentExpression)(node)) { - return (0, _generated2.expressionStatement)(node); - } - - if (mustHaveId && !node.id) { - newType = false; - } - - if (!newType) { - if (ignore) { - return false; - } else { - throw new Error(`cannot turn ${node.type} to a statement`); - } - } - - node.type = newType; - return node; -} - -/***/ }), - -/***/ "./node_modules/@babel/types/lib/converters/valueToNode.js": -/*!*****************************************************************!*\ - !*** ./node_modules/@babel/types/lib/converters/valueToNode.js ***! - \*****************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = valueToNode; - -function _isPlainObject() { - const data = _interopRequireDefault(__webpack_require__(/*! lodash/isPlainObject */ "./node_modules/lodash/isPlainObject.js")); - - _isPlainObject = function () { - return data; - }; - - return data; -} - -function _isRegExp() { - const data = _interopRequireDefault(__webpack_require__(/*! lodash/isRegExp */ "./node_modules/lodash/isRegExp.js")); - - _isRegExp = function () { - return data; - }; - - return data; -} - -var _isValidIdentifier = _interopRequireDefault(__webpack_require__(/*! ../validators/isValidIdentifier */ "./node_modules/@babel/types/lib/validators/isValidIdentifier.js")); - -var _generated = __webpack_require__(/*! ../builders/generated */ "./node_modules/@babel/types/lib/builders/generated/index.js"); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function valueToNode(value) { - if (value === undefined) { - return (0, _generated.identifier)("undefined"); - } - - if (value === true || value === false) { - return (0, _generated.booleanLiteral)(value); - } - - if (value === null) { - return (0, _generated.nullLiteral)(); - } - - if (typeof value === "string") { - return (0, _generated.stringLiteral)(value); - } - - if (typeof value === "number") { - let result; - - if (Number.isFinite(value)) { - result = (0, _generated.numericLiteral)(Math.abs(value)); - } else { - let numerator; - - if (Number.isNaN(value)) { - numerator = (0, _generated.numericLiteral)(0); - } else { - numerator = (0, _generated.numericLiteral)(1); - } - - result = (0, _generated.binaryExpression)("/", numerator, (0, _generated.numericLiteral)(0)); - } - - if (value < 0 || Object.is(value, -0)) { - result = (0, _generated.unaryExpression)("-", result); - } - - return result; - } - - if ((0, _isRegExp().default)(value)) { - const pattern = value.source; - const flags = value.toString().match(/\/([a-z]+|)$/)[1]; - return (0, _generated.regExpLiteral)(pattern, flags); - } - - if (Array.isArray(value)) { - return (0, _generated.arrayExpression)(value.map(valueToNode)); - } - - if ((0, _isPlainObject().default)(value)) { - const props = []; - - for (const key of Object.keys(value)) { - let nodeKey; - - if ((0, _isValidIdentifier.default)(key)) { - nodeKey = (0, _generated.identifier)(key); - } else { - nodeKey = (0, _generated.stringLiteral)(key); - } - - props.push((0, _generated.objectProperty)(nodeKey, valueToNode(value[key]))); - } - - return (0, _generated.objectExpression)(props); - } - - throw new Error("don't know how to turn this value into a node"); -} - -/***/ }), - -/***/ "./node_modules/@babel/types/lib/definitions/core.js": -/*!***********************************************************!*\ - !*** ./node_modules/@babel/types/lib/definitions/core.js ***! - \***********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.patternLikeCommon = exports.functionDeclarationCommon = exports.functionTypeAnnotationCommon = exports.functionCommon = void 0; - -var _isValidIdentifier = _interopRequireDefault(__webpack_require__(/*! ../validators/isValidIdentifier */ "./node_modules/@babel/types/lib/validators/isValidIdentifier.js")); - -var _constants = __webpack_require__(/*! ../constants */ "./node_modules/@babel/types/lib/constants/index.js"); - -var _utils = _interopRequireWildcard(__webpack_require__(/*! ./utils */ "./node_modules/@babel/types/lib/definitions/utils.js")); - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -(0, _utils.default)("ArrayExpression", { - fields: { - elements: { - validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeOrValueType)("null", "Expression", "SpreadElement"))), - default: [] - } - }, - visitor: ["elements"], - aliases: ["Expression"] -}); -(0, _utils.default)("AssignmentExpression", { - fields: { - operator: { - validate: (0, _utils.assertValueType)("string") - }, - left: { - validate: (0, _utils.assertNodeType)("LVal") - }, - right: { - validate: (0, _utils.assertNodeType)("Expression") - } - }, - builder: ["operator", "left", "right"], - visitor: ["left", "right"], - aliases: ["Expression"] -}); -(0, _utils.default)("BinaryExpression", { - builder: ["operator", "left", "right"], - fields: { - operator: { - validate: (0, _utils.assertOneOf)(..._constants.BINARY_OPERATORS) - }, - left: { - validate: (0, _utils.assertNodeType)("Expression") - }, - right: { - validate: (0, _utils.assertNodeType)("Expression") - } - }, - visitor: ["left", "right"], - aliases: ["Binary", "Expression"] -}); -(0, _utils.default)("InterpreterDirective", { - builder: ["value"], - fields: { - value: { - validate: (0, _utils.assertValueType)("string") - } - } -}); -(0, _utils.default)("Directive", { - visitor: ["value"], - fields: { - value: { - validate: (0, _utils.assertNodeType)("DirectiveLiteral") - } - } -}); -(0, _utils.default)("DirectiveLiteral", { - builder: ["value"], - fields: { - value: { - validate: (0, _utils.assertValueType)("string") - } - } -}); -(0, _utils.default)("BlockStatement", { - builder: ["body", "directives"], - visitor: ["directives", "body"], - fields: { - directives: { - validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Directive"))), - default: [] - }, - body: { - validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Statement"))) - } - }, - aliases: ["Scopable", "BlockParent", "Block", "Statement"] -}); -(0, _utils.default)("BreakStatement", { - visitor: ["label"], - fields: { - label: { - validate: (0, _utils.assertNodeType)("Identifier"), - optional: true - } - }, - aliases: ["Statement", "Terminatorless", "CompletionStatement"] -}); -(0, _utils.default)("CallExpression", { - visitor: ["callee", "arguments", "typeParameters", "typeArguments"], - builder: ["callee", "arguments"], - aliases: ["Expression"], - fields: { - callee: { - validate: (0, _utils.assertNodeType)("Expression") - }, - arguments: { - validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Expression", "SpreadElement", "JSXNamespacedName", "ArgumentPlaceholder"))) - }, - optional: { - validate: (0, _utils.assertOneOf)(true, false), - optional: true - }, - typeArguments: { - validate: (0, _utils.assertNodeType)("TypeParameterInstantiation"), - optional: true - }, - typeParameters: { - validate: (0, _utils.assertNodeType)("TSTypeParameterInstantiation"), - optional: true - } - } -}); -(0, _utils.default)("CatchClause", { - visitor: ["param", "body"], - fields: { - param: { - validate: (0, _utils.assertNodeType)("Identifier"), - optional: true - }, - body: { - validate: (0, _utils.assertNodeType)("BlockStatement") - } - }, - aliases: ["Scopable", "BlockParent"] -}); -(0, _utils.default)("ConditionalExpression", { - visitor: ["test", "consequent", "alternate"], - fields: { - test: { - validate: (0, _utils.assertNodeType)("Expression") - }, - consequent: { - validate: (0, _utils.assertNodeType)("Expression") - }, - alternate: { - validate: (0, _utils.assertNodeType)("Expression") - } - }, - aliases: ["Expression", "Conditional"] -}); -(0, _utils.default)("ContinueStatement", { - visitor: ["label"], - fields: { - label: { - validate: (0, _utils.assertNodeType)("Identifier"), - optional: true - } - }, - aliases: ["Statement", "Terminatorless", "CompletionStatement"] -}); -(0, _utils.default)("DebuggerStatement", { - aliases: ["Statement"] -}); -(0, _utils.default)("DoWhileStatement", { - visitor: ["test", "body"], - fields: { - test: { - validate: (0, _utils.assertNodeType)("Expression") - }, - body: { - validate: (0, _utils.assertNodeType)("Statement") - } - }, - aliases: ["Statement", "BlockParent", "Loop", "While", "Scopable"] -}); -(0, _utils.default)("EmptyStatement", { - aliases: ["Statement"] -}); -(0, _utils.default)("ExpressionStatement", { - visitor: ["expression"], - fields: { - expression: { - validate: (0, _utils.assertNodeType)("Expression") - } - }, - aliases: ["Statement", "ExpressionWrapper"] -}); -(0, _utils.default)("File", { - builder: ["program", "comments", "tokens"], - visitor: ["program"], - fields: { - program: { - validate: (0, _utils.assertNodeType)("Program") - } - } -}); -(0, _utils.default)("ForInStatement", { - visitor: ["left", "right", "body"], - aliases: ["Scopable", "Statement", "For", "BlockParent", "Loop", "ForXStatement"], - fields: { - left: { - validate: (0, _utils.assertNodeType)("VariableDeclaration", "LVal") - }, - right: { - validate: (0, _utils.assertNodeType)("Expression") - }, - body: { - validate: (0, _utils.assertNodeType)("Statement") - } - } -}); -(0, _utils.default)("ForStatement", { - visitor: ["init", "test", "update", "body"], - aliases: ["Scopable", "Statement", "For", "BlockParent", "Loop"], - fields: { - init: { - validate: (0, _utils.assertNodeType)("VariableDeclaration", "Expression"), - optional: true - }, - test: { - validate: (0, _utils.assertNodeType)("Expression"), - optional: true - }, - update: { - validate: (0, _utils.assertNodeType)("Expression"), - optional: true - }, - body: { - validate: (0, _utils.assertNodeType)("Statement") - } - } -}); -const functionCommon = { - params: { - validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Identifier", "Pattern", "RestElement", "TSParameterProperty"))) - }, - generator: { - default: false, - validate: (0, _utils.assertValueType)("boolean") - }, - async: { - validate: (0, _utils.assertValueType)("boolean"), - default: false - } -}; -exports.functionCommon = functionCommon; -const functionTypeAnnotationCommon = { - returnType: { - validate: (0, _utils.assertNodeType)("TypeAnnotation", "TSTypeAnnotation", "Noop"), - optional: true - }, - typeParameters: { - validate: (0, _utils.assertNodeType)("TypeParameterDeclaration", "TSTypeParameterDeclaration", "Noop"), - optional: true - } -}; -exports.functionTypeAnnotationCommon = functionTypeAnnotationCommon; -const functionDeclarationCommon = Object.assign({}, functionCommon, { - declare: { - validate: (0, _utils.assertValueType)("boolean"), - optional: true - }, - id: { - validate: (0, _utils.assertNodeType)("Identifier"), - optional: true - } -}); -exports.functionDeclarationCommon = functionDeclarationCommon; -(0, _utils.default)("FunctionDeclaration", { - builder: ["id", "params", "body", "generator", "async"], - visitor: ["id", "params", "body", "returnType", "typeParameters"], - fields: Object.assign({}, functionDeclarationCommon, functionTypeAnnotationCommon, { - body: { - validate: (0, _utils.assertNodeType)("BlockStatement") - } - }), - aliases: ["Scopable", "Function", "BlockParent", "FunctionParent", "Statement", "Pureish", "Declaration"] -}); -(0, _utils.default)("FunctionExpression", { - inherits: "FunctionDeclaration", - aliases: ["Scopable", "Function", "BlockParent", "FunctionParent", "Expression", "Pureish"], - fields: Object.assign({}, functionCommon, functionTypeAnnotationCommon, { - id: { - validate: (0, _utils.assertNodeType)("Identifier"), - optional: true - }, - body: { - validate: (0, _utils.assertNodeType)("BlockStatement") - } - }) -}); -const patternLikeCommon = { - typeAnnotation: { - validate: (0, _utils.assertNodeType)("TypeAnnotation", "TSTypeAnnotation", "Noop"), - optional: true - }, - decorators: { - validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Decorator"))) - } -}; -exports.patternLikeCommon = patternLikeCommon; -(0, _utils.default)("Identifier", { - builder: ["name"], - visitor: ["typeAnnotation", "decorators"], - aliases: ["Expression", "PatternLike", "LVal", "TSEntityName"], - fields: Object.assign({}, patternLikeCommon, { - name: { - validate: (0, _utils.chain)(function (node, key, val) { - if (!(0, _isValidIdentifier.default)(val)) {} - }, (0, _utils.assertValueType)("string")) - }, - optional: { - validate: (0, _utils.assertValueType)("boolean"), - optional: true - } - }) -}); -(0, _utils.default)("IfStatement", { - visitor: ["test", "consequent", "alternate"], - aliases: ["Statement", "Conditional"], - fields: { - test: { - validate: (0, _utils.assertNodeType)("Expression") - }, - consequent: { - validate: (0, _utils.assertNodeType)("Statement") - }, - alternate: { - optional: true, - validate: (0, _utils.assertNodeType)("Statement") - } - } -}); -(0, _utils.default)("LabeledStatement", { - visitor: ["label", "body"], - aliases: ["Statement"], - fields: { - label: { - validate: (0, _utils.assertNodeType)("Identifier") - }, - body: { - validate: (0, _utils.assertNodeType)("Statement") - } - } -}); -(0, _utils.default)("StringLiteral", { - builder: ["value"], - fields: { - value: { - validate: (0, _utils.assertValueType)("string") - } - }, - aliases: ["Expression", "Pureish", "Literal", "Immutable"] -}); -(0, _utils.default)("NumericLiteral", { - builder: ["value"], - deprecatedAlias: "NumberLiteral", - fields: { - value: { - validate: (0, _utils.assertValueType)("number") - } - }, - aliases: ["Expression", "Pureish", "Literal", "Immutable"] -}); -(0, _utils.default)("NullLiteral", { - aliases: ["Expression", "Pureish", "Literal", "Immutable"] -}); -(0, _utils.default)("BooleanLiteral", { - builder: ["value"], - fields: { - value: { - validate: (0, _utils.assertValueType)("boolean") - } - }, - aliases: ["Expression", "Pureish", "Literal", "Immutable"] -}); -(0, _utils.default)("RegExpLiteral", { - builder: ["pattern", "flags"], - deprecatedAlias: "RegexLiteral", - aliases: ["Expression", "Literal"], - fields: { - pattern: { - validate: (0, _utils.assertValueType)("string") - }, - flags: { - validate: (0, _utils.assertValueType)("string"), - default: "" - } - } -}); -(0, _utils.default)("LogicalExpression", { - builder: ["operator", "left", "right"], - visitor: ["left", "right"], - aliases: ["Binary", "Expression"], - fields: { - operator: { - validate: (0, _utils.assertOneOf)(..._constants.LOGICAL_OPERATORS) - }, - left: { - validate: (0, _utils.assertNodeType)("Expression") - }, - right: { - validate: (0, _utils.assertNodeType)("Expression") - } - } -}); -(0, _utils.default)("MemberExpression", { - builder: ["object", "property", "computed", "optional"], - visitor: ["object", "property"], - aliases: ["Expression", "LVal"], - fields: { - object: { - validate: (0, _utils.assertNodeType)("Expression") - }, - property: { - validate: function () { - const normal = (0, _utils.assertNodeType)("Identifier", "PrivateName"); - const computed = (0, _utils.assertNodeType)("Expression"); - return function (node, key, val) { - const validator = node.computed ? computed : normal; - validator(node, key, val); - }; - }() - }, - computed: { - default: false - }, - optional: { - validate: (0, _utils.assertOneOf)(true, false), - optional: true - } - } -}); -(0, _utils.default)("NewExpression", { - inherits: "CallExpression" -}); -(0, _utils.default)("Program", { - visitor: ["directives", "body"], - builder: ["body", "directives", "sourceType", "interpreter"], - fields: { - sourceFile: { - validate: (0, _utils.assertValueType)("string") - }, - sourceType: { - validate: (0, _utils.assertOneOf)("script", "module"), - default: "script" - }, - interpreter: { - validate: (0, _utils.assertNodeType)("InterpreterDirective"), - default: null, - optional: true - }, - directives: { - validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Directive"))), - default: [] - }, - body: { - validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Statement"))) - } - }, - aliases: ["Scopable", "BlockParent", "Block"] -}); -(0, _utils.default)("ObjectExpression", { - visitor: ["properties"], - aliases: ["Expression"], - fields: { - properties: { - validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("ObjectMethod", "ObjectProperty", "SpreadElement"))) - } - } -}); -(0, _utils.default)("ObjectMethod", { - builder: ["kind", "key", "params", "body", "computed"], - fields: Object.assign({}, functionCommon, functionTypeAnnotationCommon, { - kind: { - validate: (0, _utils.chain)((0, _utils.assertValueType)("string"), (0, _utils.assertOneOf)("method", "get", "set")), - default: "method" - }, - computed: { - validate: (0, _utils.assertValueType)("boolean"), - default: false - }, - key: { - validate: function () { - const normal = (0, _utils.assertNodeType)("Identifier", "StringLiteral", "NumericLiteral"); - const computed = (0, _utils.assertNodeType)("Expression"); - return function (node, key, val) { - const validator = node.computed ? computed : normal; - validator(node, key, val); - }; - }() - }, - decorators: { - validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Decorator"))) - }, - body: { - validate: (0, _utils.assertNodeType)("BlockStatement") - } - }), - visitor: ["key", "params", "body", "decorators", "returnType", "typeParameters"], - aliases: ["UserWhitespacable", "Function", "Scopable", "BlockParent", "FunctionParent", "Method", "ObjectMember"] -}); -(0, _utils.default)("ObjectProperty", { - builder: ["key", "value", "computed", "shorthand", "decorators"], - fields: { - computed: { - validate: (0, _utils.assertValueType)("boolean"), - default: false - }, - key: { - validate: function () { - const normal = (0, _utils.assertNodeType)("Identifier", "StringLiteral", "NumericLiteral"); - const computed = (0, _utils.assertNodeType)("Expression"); - return function (node, key, val) { - const validator = node.computed ? computed : normal; - validator(node, key, val); - }; - }() - }, - value: { - validate: (0, _utils.assertNodeType)("Expression", "PatternLike") - }, - shorthand: { - validate: (0, _utils.assertValueType)("boolean"), - default: false - }, - decorators: { - validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Decorator"))), - optional: true - } - }, - visitor: ["key", "value", "decorators"], - aliases: ["UserWhitespacable", "Property", "ObjectMember"] -}); -(0, _utils.default)("RestElement", { - visitor: ["argument", "typeAnnotation"], - builder: ["argument"], - aliases: ["LVal", "PatternLike"], - deprecatedAlias: "RestProperty", - fields: Object.assign({}, patternLikeCommon, { - argument: { - validate: (0, _utils.assertNodeType)("LVal") - } - }) -}); -(0, _utils.default)("ReturnStatement", { - visitor: ["argument"], - aliases: ["Statement", "Terminatorless", "CompletionStatement"], - fields: { - argument: { - validate: (0, _utils.assertNodeType)("Expression"), - optional: true - } - } -}); -(0, _utils.default)("SequenceExpression", { - visitor: ["expressions"], - fields: { - expressions: { - validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Expression"))) - } - }, - aliases: ["Expression"] -}); -(0, _utils.default)("ParenthesizedExpression", { - visitor: ["expression"], - aliases: ["Expression", "ExpressionWrapper"], - fields: { - expression: { - validate: (0, _utils.assertNodeType)("Expression") - } - } -}); -(0, _utils.default)("SwitchCase", { - visitor: ["test", "consequent"], - fields: { - test: { - validate: (0, _utils.assertNodeType)("Expression"), - optional: true - }, - consequent: { - validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Statement"))) - } - } -}); -(0, _utils.default)("SwitchStatement", { - visitor: ["discriminant", "cases"], - aliases: ["Statement", "BlockParent", "Scopable"], - fields: { - discriminant: { - validate: (0, _utils.assertNodeType)("Expression") - }, - cases: { - validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("SwitchCase"))) - } - } -}); -(0, _utils.default)("ThisExpression", { - aliases: ["Expression"] -}); -(0, _utils.default)("ThrowStatement", { - visitor: ["argument"], - aliases: ["Statement", "Terminatorless", "CompletionStatement"], - fields: { - argument: { - validate: (0, _utils.assertNodeType)("Expression") - } - } -}); -(0, _utils.default)("TryStatement", { - visitor: ["block", "handler", "finalizer"], - aliases: ["Statement"], - fields: { - block: { - validate: (0, _utils.assertNodeType)("BlockStatement") - }, - handler: { - optional: true, - validate: (0, _utils.assertNodeType)("CatchClause") - }, - finalizer: { - optional: true, - validate: (0, _utils.assertNodeType)("BlockStatement") - } - } -}); -(0, _utils.default)("UnaryExpression", { - builder: ["operator", "argument", "prefix"], - fields: { - prefix: { - default: true - }, - argument: { - validate: (0, _utils.assertNodeType)("Expression") - }, - operator: { - validate: (0, _utils.assertOneOf)(..._constants.UNARY_OPERATORS) - } - }, - visitor: ["argument"], - aliases: ["UnaryLike", "Expression"] -}); -(0, _utils.default)("UpdateExpression", { - builder: ["operator", "argument", "prefix"], - fields: { - prefix: { - default: false - }, - argument: { - validate: (0, _utils.assertNodeType)("Expression") - }, - operator: { - validate: (0, _utils.assertOneOf)(..._constants.UPDATE_OPERATORS) - } - }, - visitor: ["argument"], - aliases: ["Expression"] -}); -(0, _utils.default)("VariableDeclaration", { - builder: ["kind", "declarations"], - visitor: ["declarations"], - aliases: ["Statement", "Declaration"], - fields: { - declare: { - validate: (0, _utils.assertValueType)("boolean"), - optional: true - }, - kind: { - validate: (0, _utils.chain)((0, _utils.assertValueType)("string"), (0, _utils.assertOneOf)("var", "let", "const")) - }, - declarations: { - validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("VariableDeclarator"))) - } - } -}); -(0, _utils.default)("VariableDeclarator", { - visitor: ["id", "init"], - fields: { - id: { - validate: (0, _utils.assertNodeType)("LVal") - }, - definite: { - optional: true, - validate: (0, _utils.assertValueType)("boolean") - }, - init: { - optional: true, - validate: (0, _utils.assertNodeType)("Expression") - } - } -}); -(0, _utils.default)("WhileStatement", { - visitor: ["test", "body"], - aliases: ["Statement", "BlockParent", "Loop", "While", "Scopable"], - fields: { - test: { - validate: (0, _utils.assertNodeType)("Expression") - }, - body: { - validate: (0, _utils.assertNodeType)("BlockStatement", "Statement") - } - } -}); -(0, _utils.default)("WithStatement", { - visitor: ["object", "body"], - aliases: ["Statement"], - fields: { - object: { - validate: (0, _utils.assertNodeType)("Expression") - }, - body: { - validate: (0, _utils.assertNodeType)("BlockStatement", "Statement") - } - } -}); - -/***/ }), - -/***/ "./node_modules/@babel/types/lib/definitions/es2015.js": -/*!*************************************************************!*\ - !*** ./node_modules/@babel/types/lib/definitions/es2015.js ***! - \*************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.classMethodOrDeclareMethodCommon = exports.classMethodOrPropertyCommon = void 0; - -var _utils = _interopRequireWildcard(__webpack_require__(/*! ./utils */ "./node_modules/@babel/types/lib/definitions/utils.js")); - -var _core = __webpack_require__(/*! ./core */ "./node_modules/@babel/types/lib/definitions/core.js"); - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -(0, _utils.default)("AssignmentPattern", { - visitor: ["left", "right", "decorators"], - builder: ["left", "right"], - aliases: ["Pattern", "PatternLike", "LVal"], - fields: Object.assign({}, _core.patternLikeCommon, { - left: { - validate: (0, _utils.assertNodeType)("Identifier", "ObjectPattern", "ArrayPattern", "MemberExpression") - }, - right: { - validate: (0, _utils.assertNodeType)("Expression") - }, - decorators: { - validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Decorator"))) - } - }) -}); -(0, _utils.default)("ArrayPattern", { - visitor: ["elements", "typeAnnotation"], - builder: ["elements"], - aliases: ["Pattern", "PatternLike", "LVal"], - fields: Object.assign({}, _core.patternLikeCommon, { - elements: { - validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("PatternLike"))) - }, - decorators: { - validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Decorator"))) - } - }) -}); -(0, _utils.default)("ArrowFunctionExpression", { - builder: ["params", "body", "async"], - visitor: ["params", "body", "returnType", "typeParameters"], - aliases: ["Scopable", "Function", "BlockParent", "FunctionParent", "Expression", "Pureish"], - fields: Object.assign({}, _core.functionCommon, _core.functionTypeAnnotationCommon, { - expression: { - validate: (0, _utils.assertValueType)("boolean") - }, - body: { - validate: (0, _utils.assertNodeType)("BlockStatement", "Expression") - } - }) -}); -(0, _utils.default)("ClassBody", { - visitor: ["body"], - fields: { - body: { - validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("ClassMethod", "ClassPrivateMethod", "ClassProperty", "ClassPrivateProperty", "TSDeclareMethod", "TSIndexSignature"))) - } - } -}); -const classCommon = { - typeParameters: { - validate: (0, _utils.assertNodeType)("TypeParameterDeclaration", "TSTypeParameterDeclaration", "Noop"), - optional: true - }, - body: { - validate: (0, _utils.assertNodeType)("ClassBody") - }, - superClass: { - optional: true, - validate: (0, _utils.assertNodeType)("Expression") - }, - superTypeParameters: { - validate: (0, _utils.assertNodeType)("TypeParameterInstantiation", "TSTypeParameterInstantiation"), - optional: true - }, - implements: { - validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("TSExpressionWithTypeArguments", "ClassImplements"))), - optional: true - } -}; -(0, _utils.default)("ClassDeclaration", { - builder: ["id", "superClass", "body", "decorators"], - visitor: ["id", "body", "superClass", "mixins", "typeParameters", "superTypeParameters", "implements", "decorators"], - aliases: ["Scopable", "Class", "Statement", "Declaration", "Pureish"], - fields: Object.assign({}, classCommon, { - declare: { - validate: (0, _utils.assertValueType)("boolean"), - optional: true - }, - abstract: { - validate: (0, _utils.assertValueType)("boolean"), - optional: true - }, - id: { - validate: (0, _utils.assertNodeType)("Identifier"), - optional: true - }, - decorators: { - validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Decorator"))), - optional: true - } - }) -}); -(0, _utils.default)("ClassExpression", { - inherits: "ClassDeclaration", - aliases: ["Scopable", "Class", "Expression", "Pureish"], - fields: Object.assign({}, classCommon, { - id: { - optional: true, - validate: (0, _utils.assertNodeType)("Identifier") - }, - body: { - validate: (0, _utils.assertNodeType)("ClassBody") - }, - superClass: { - optional: true, - validate: (0, _utils.assertNodeType)("Expression") - }, - decorators: { - validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Decorator"))), - optional: true - } - }) -}); -(0, _utils.default)("ExportAllDeclaration", { - visitor: ["source"], - aliases: ["Statement", "Declaration", "ModuleDeclaration", "ExportDeclaration"], - fields: { - source: { - validate: (0, _utils.assertNodeType)("StringLiteral") - } - } -}); -(0, _utils.default)("ExportDefaultDeclaration", { - visitor: ["declaration"], - aliases: ["Statement", "Declaration", "ModuleDeclaration", "ExportDeclaration"], - fields: { - declaration: { - validate: (0, _utils.assertNodeType)("FunctionDeclaration", "TSDeclareFunction", "ClassDeclaration", "Expression") - } - } -}); -(0, _utils.default)("ExportNamedDeclaration", { - visitor: ["declaration", "specifiers", "source"], - aliases: ["Statement", "Declaration", "ModuleDeclaration", "ExportDeclaration"], - fields: { - declaration: { - validate: (0, _utils.assertNodeType)("Declaration"), - optional: true - }, - specifiers: { - validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("ExportSpecifier", "ExportDefaultSpecifier", "ExportNamespaceSpecifier"))) - }, - source: { - validate: (0, _utils.assertNodeType)("StringLiteral"), - optional: true - }, - exportKind: (0, _utils.validateOptional)((0, _utils.assertOneOf)("type", "value")) - } -}); -(0, _utils.default)("ExportSpecifier", { - visitor: ["local", "exported"], - aliases: ["ModuleSpecifier"], - fields: { - local: { - validate: (0, _utils.assertNodeType)("Identifier") - }, - exported: { - validate: (0, _utils.assertNodeType)("Identifier") - } - } -}); -(0, _utils.default)("ForOfStatement", { - visitor: ["left", "right", "body"], - aliases: ["Scopable", "Statement", "For", "BlockParent", "Loop", "ForXStatement"], - fields: { - left: { - validate: (0, _utils.assertNodeType)("VariableDeclaration", "LVal") - }, - right: { - validate: (0, _utils.assertNodeType)("Expression") - }, - body: { - validate: (0, _utils.assertNodeType)("Statement") - }, - await: { - default: false, - validate: (0, _utils.assertValueType)("boolean") - } - } -}); -(0, _utils.default)("ImportDeclaration", { - visitor: ["specifiers", "source"], - aliases: ["Statement", "Declaration", "ModuleDeclaration"], - fields: { - specifiers: { - validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("ImportSpecifier", "ImportDefaultSpecifier", "ImportNamespaceSpecifier"))) - }, - source: { - validate: (0, _utils.assertNodeType)("StringLiteral") - }, - importKind: { - validate: (0, _utils.assertOneOf)("type", "typeof", "value"), - optional: true - } - } -}); -(0, _utils.default)("ImportDefaultSpecifier", { - visitor: ["local"], - aliases: ["ModuleSpecifier"], - fields: { - local: { - validate: (0, _utils.assertNodeType)("Identifier") - } - } -}); -(0, _utils.default)("ImportNamespaceSpecifier", { - visitor: ["local"], - aliases: ["ModuleSpecifier"], - fields: { - local: { - validate: (0, _utils.assertNodeType)("Identifier") - } - } -}); -(0, _utils.default)("ImportSpecifier", { - visitor: ["local", "imported"], - aliases: ["ModuleSpecifier"], - fields: { - local: { - validate: (0, _utils.assertNodeType)("Identifier") - }, - imported: { - validate: (0, _utils.assertNodeType)("Identifier") - }, - importKind: { - validate: (0, _utils.assertOneOf)("type", "typeof"), - optional: true - } - } -}); -(0, _utils.default)("MetaProperty", { - visitor: ["meta", "property"], - aliases: ["Expression"], - fields: { - meta: { - validate: (0, _utils.assertNodeType)("Identifier") - }, - property: { - validate: (0, _utils.assertNodeType)("Identifier") - } - } -}); -const classMethodOrPropertyCommon = { - abstract: { - validate: (0, _utils.assertValueType)("boolean"), - optional: true - }, - accessibility: { - validate: (0, _utils.chain)((0, _utils.assertValueType)("string"), (0, _utils.assertOneOf)("public", "private", "protected")), - optional: true - }, - static: { - validate: (0, _utils.assertValueType)("boolean"), - optional: true - }, - computed: { - default: false, - validate: (0, _utils.assertValueType)("boolean") - }, - optional: { - validate: (0, _utils.assertValueType)("boolean"), - optional: true - }, - key: { - validate: (0, _utils.chain)(function () { - const normal = (0, _utils.assertNodeType)("Identifier", "StringLiteral", "NumericLiteral"); - const computed = (0, _utils.assertNodeType)("Expression"); - return function (node, key, val) { - const validator = node.computed ? computed : normal; - validator(node, key, val); - }; - }(), (0, _utils.assertNodeType)("Identifier", "StringLiteral", "NumericLiteral", "Expression")) - } -}; -exports.classMethodOrPropertyCommon = classMethodOrPropertyCommon; -const classMethodOrDeclareMethodCommon = Object.assign({}, _core.functionCommon, classMethodOrPropertyCommon, { - kind: { - validate: (0, _utils.chain)((0, _utils.assertValueType)("string"), (0, _utils.assertOneOf)("get", "set", "method", "constructor")), - default: "method" - }, - access: { - validate: (0, _utils.chain)((0, _utils.assertValueType)("string"), (0, _utils.assertOneOf)("public", "private", "protected")), - optional: true - }, - decorators: { - validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Decorator"))), - optional: true - } -}); -exports.classMethodOrDeclareMethodCommon = classMethodOrDeclareMethodCommon; -(0, _utils.default)("ClassMethod", { - aliases: ["Function", "Scopable", "BlockParent", "FunctionParent", "Method"], - builder: ["kind", "key", "params", "body", "computed", "static"], - visitor: ["key", "params", "body", "decorators", "returnType", "typeParameters"], - fields: Object.assign({}, classMethodOrDeclareMethodCommon, _core.functionTypeAnnotationCommon, { - body: { - validate: (0, _utils.assertNodeType)("BlockStatement") - } - }) -}); -(0, _utils.default)("ObjectPattern", { - visitor: ["properties", "typeAnnotation", "decorators"], - builder: ["properties"], - aliases: ["Pattern", "PatternLike", "LVal"], - fields: Object.assign({}, _core.patternLikeCommon, { - properties: { - validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("RestElement", "ObjectProperty"))) - } - }) -}); -(0, _utils.default)("SpreadElement", { - visitor: ["argument"], - aliases: ["UnaryLike"], - deprecatedAlias: "SpreadProperty", - fields: { - argument: { - validate: (0, _utils.assertNodeType)("Expression") - } - } -}); -(0, _utils.default)("Super", { - aliases: ["Expression"] -}); -(0, _utils.default)("TaggedTemplateExpression", { - visitor: ["tag", "quasi"], - aliases: ["Expression"], - fields: { - tag: { - validate: (0, _utils.assertNodeType)("Expression") - }, - quasi: { - validate: (0, _utils.assertNodeType)("TemplateLiteral") - }, - typeParameters: { - validate: (0, _utils.assertNodeType)("TypeParameterInstantiation", "TSTypeParameterInstantiation"), - optional: true - } - } -}); -(0, _utils.default)("TemplateElement", { - builder: ["value", "tail"], - fields: { - value: { - validate: (0, _utils.assertShape)({ - raw: { - validate: (0, _utils.assertValueType)("string") - }, - cooked: { - validate: (0, _utils.assertValueType)("string"), - optional: true - } - }) - }, - tail: { - validate: (0, _utils.assertValueType)("boolean"), - default: false - } - } -}); -(0, _utils.default)("TemplateLiteral", { - visitor: ["quasis", "expressions"], - aliases: ["Expression", "Literal"], - fields: { - quasis: { - validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("TemplateElement"))) - }, - expressions: { - validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Expression"))) - } - } -}); -(0, _utils.default)("YieldExpression", { - builder: ["argument", "delegate"], - visitor: ["argument"], - aliases: ["Expression", "Terminatorless"], - fields: { - delegate: { - validate: (0, _utils.assertValueType)("boolean"), - default: false - }, - argument: { - optional: true, - validate: (0, _utils.assertNodeType)("Expression") - } - } -}); - -/***/ }), - -/***/ "./node_modules/@babel/types/lib/definitions/experimental.js": -/*!*******************************************************************!*\ - !*** ./node_modules/@babel/types/lib/definitions/experimental.js ***! - \*******************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _utils = _interopRequireWildcard(__webpack_require__(/*! ./utils */ "./node_modules/@babel/types/lib/definitions/utils.js")); - -var _es = __webpack_require__(/*! ./es2015 */ "./node_modules/@babel/types/lib/definitions/es2015.js"); - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -(0, _utils.default)("ArgumentPlaceholder", {}); -(0, _utils.default)("AwaitExpression", { - builder: ["argument"], - visitor: ["argument"], - aliases: ["Expression", "Terminatorless"], - fields: { - argument: { - validate: (0, _utils.assertNodeType)("Expression") - } - } -}); -(0, _utils.default)("BindExpression", { - visitor: ["object", "callee"], - aliases: ["Expression"], - fields: {} -}); -(0, _utils.default)("ClassProperty", { - visitor: ["key", "value", "typeAnnotation", "decorators"], - builder: ["key", "value", "typeAnnotation", "decorators", "computed"], - aliases: ["Property"], - fields: Object.assign({}, _es.classMethodOrPropertyCommon, { - value: { - validate: (0, _utils.assertNodeType)("Expression"), - optional: true - }, - definite: { - validate: (0, _utils.assertValueType)("boolean"), - optional: true - }, - typeAnnotation: { - validate: (0, _utils.assertNodeType)("TypeAnnotation", "TSTypeAnnotation", "Noop"), - optional: true - }, - decorators: { - validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Decorator"))), - optional: true - }, - readonly: { - validate: (0, _utils.assertValueType)("boolean"), - optional: true - } - }) -}); -(0, _utils.default)("OptionalMemberExpression", { - builder: ["object", "property", "computed", "optional"], - visitor: ["object", "property"], - aliases: ["Expression"], - fields: { - object: { - validate: (0, _utils.assertNodeType)("Expression") - }, - property: { - validate: function () { - const normal = (0, _utils.assertNodeType)("Identifier"); - const computed = (0, _utils.assertNodeType)("Expression"); - return function (node, key, val) { - const validator = node.computed ? computed : normal; - validator(node, key, val); - }; - }() - }, - computed: { - default: false - }, - optional: { - validate: (0, _utils.assertValueType)("boolean") - } - } -}); -(0, _utils.default)("PipelineTopicExpression", { - builder: ["expression"], - visitor: ["expression"], - fields: { - expression: { - validate: (0, _utils.assertNodeType)("Expression") - } - } -}); -(0, _utils.default)("PipelineBareFunction", { - builder: ["callee"], - visitor: ["callee"], - fields: { - callee: { - validate: (0, _utils.assertNodeType)("Expression") - } - } -}); -(0, _utils.default)("PipelinePrimaryTopicReference", { - aliases: ["Expression"] -}); -(0, _utils.default)("OptionalCallExpression", { - visitor: ["callee", "arguments", "typeParameters", "typeArguments"], - builder: ["callee", "arguments", "optional"], - aliases: ["Expression"], - fields: { - callee: { - validate: (0, _utils.assertNodeType)("Expression") - }, - arguments: { - validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Expression", "SpreadElement", "JSXNamespacedName"))) - }, - optional: { - validate: (0, _utils.assertValueType)("boolean") - }, - typeArguments: { - validate: (0, _utils.assertNodeType)("TypeParameterInstantiation"), - optional: true - }, - typeParameters: { - validate: (0, _utils.assertNodeType)("TSTypeParameterInstantiation"), - optional: true - } - } -}); -(0, _utils.default)("ClassPrivateProperty", { - visitor: ["key", "value"], - builder: ["key", "value"], - aliases: ["Property", "Private"], - fields: { - key: { - validate: (0, _utils.assertNodeType)("PrivateName") - }, - value: { - validate: (0, _utils.assertNodeType)("Expression"), - optional: true - } - } -}); -(0, _utils.default)("ClassPrivateMethod", { - builder: ["kind", "key", "params", "body", "static"], - visitor: ["key", "params", "body", "decorators", "returnType", "typeParameters"], - aliases: ["Function", "Scopable", "BlockParent", "FunctionParent", "Method", "Private"], - fields: Object.assign({}, _es.classMethodOrDeclareMethodCommon, { - key: { - validate: (0, _utils.assertNodeType)("PrivateName") - }, - body: { - validate: (0, _utils.assertNodeType)("BlockStatement") - } - }) -}); -(0, _utils.default)("Import", { - aliases: ["Expression"] -}); -(0, _utils.default)("Decorator", { - visitor: ["expression"], - fields: { - expression: { - validate: (0, _utils.assertNodeType)("Expression") - } - } -}); -(0, _utils.default)("DoExpression", { - visitor: ["body"], - aliases: ["Expression"], - fields: { - body: { - validate: (0, _utils.assertNodeType)("BlockStatement") - } - } -}); -(0, _utils.default)("ExportDefaultSpecifier", { - visitor: ["exported"], - aliases: ["ModuleSpecifier"], - fields: { - exported: { - validate: (0, _utils.assertNodeType)("Identifier") - } - } -}); -(0, _utils.default)("ExportNamespaceSpecifier", { - visitor: ["exported"], - aliases: ["ModuleSpecifier"], - fields: { - exported: { - validate: (0, _utils.assertNodeType)("Identifier") - } - } -}); -(0, _utils.default)("PrivateName", { - visitor: ["id"], - aliases: ["Private"], - fields: { - id: { - validate: (0, _utils.assertNodeType)("Identifier") - } - } -}); -(0, _utils.default)("BigIntLiteral", { - builder: ["value"], - fields: { - value: { - validate: (0, _utils.assertValueType)("string") - } - }, - aliases: ["Expression", "Pureish", "Literal", "Immutable"] -}); - -/***/ }), - -/***/ "./node_modules/@babel/types/lib/definitions/flow.js": -/*!***********************************************************!*\ - !*** ./node_modules/@babel/types/lib/definitions/flow.js ***! - \***********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _utils = _interopRequireWildcard(__webpack_require__(/*! ./utils */ "./node_modules/@babel/types/lib/definitions/utils.js")); - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -const defineInterfaceishType = (name, typeParameterType = "TypeParameterDeclaration") => { - (0, _utils.default)(name, { - builder: ["id", "typeParameters", "extends", "body"], - visitor: ["id", "typeParameters", "extends", "mixins", "implements", "body"], - aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"], - fields: { - id: (0, _utils.validateType)("Identifier"), - typeParameters: (0, _utils.validateOptionalType)(typeParameterType), - extends: (0, _utils.validateOptional)((0, _utils.arrayOfType)("InterfaceExtends")), - mixins: (0, _utils.validateOptional)((0, _utils.arrayOfType)("InterfaceExtends")), - implements: (0, _utils.validateOptional)((0, _utils.arrayOfType)("ClassImplements")), - body: (0, _utils.validateType)("ObjectTypeAnnotation") - } - }); -}; - -(0, _utils.default)("AnyTypeAnnotation", { - aliases: ["Flow", "FlowType", "FlowBaseAnnotation"] -}); -(0, _utils.default)("ArrayTypeAnnotation", { - visitor: ["elementType"], - aliases: ["Flow", "FlowType"], - fields: { - elementType: (0, _utils.validateType)("FlowType") - } -}); -(0, _utils.default)("BooleanTypeAnnotation", { - aliases: ["Flow", "FlowType", "FlowBaseAnnotation"] -}); -(0, _utils.default)("BooleanLiteralTypeAnnotation", { - builder: ["value"], - aliases: ["Flow", "FlowType"], - fields: { - value: (0, _utils.validate)((0, _utils.assertValueType)("boolean")) - } -}); -(0, _utils.default)("NullLiteralTypeAnnotation", { - aliases: ["Flow", "FlowType", "FlowBaseAnnotation"] -}); -(0, _utils.default)("ClassImplements", { - visitor: ["id", "typeParameters"], - aliases: ["Flow"], - fields: { - id: (0, _utils.validateType)("Identifier"), - typeParameters: (0, _utils.validateOptionalType)("TypeParameterInstantiation") - } -}); -defineInterfaceishType("DeclareClass"); -(0, _utils.default)("DeclareFunction", { - visitor: ["id"], - aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"], - fields: { - id: (0, _utils.validateType)("Identifier"), - predicate: (0, _utils.validateOptionalType)("DeclaredPredicate") - } -}); -defineInterfaceishType("DeclareInterface"); -(0, _utils.default)("DeclareModule", { - builder: ["id", "body", "kind"], - visitor: ["id", "body"], - aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"], - fields: { - id: (0, _utils.validateType)(["Identifier", "StringLiteral"]), - body: (0, _utils.validateType)("BlockStatement"), - kind: (0, _utils.validateOptional)((0, _utils.assertOneOf)("CommonJS", "ES")) - } -}); -(0, _utils.default)("DeclareModuleExports", { - visitor: ["typeAnnotation"], - aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"], - fields: { - typeAnnotation: (0, _utils.validateType)("TypeAnnotation") - } -}); -(0, _utils.default)("DeclareTypeAlias", { - visitor: ["id", "typeParameters", "right"], - aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"], - fields: { - id: (0, _utils.validateType)("Identifier"), - typeParameters: (0, _utils.validateOptionalType)("TypeParameterDeclaration"), - right: (0, _utils.validateType)("FlowType") - } -}); -(0, _utils.default)("DeclareOpaqueType", { - visitor: ["id", "typeParameters", "supertype"], - aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"], - fields: { - id: (0, _utils.validateType)("Identifier"), - typeParameters: (0, _utils.validateOptionalType)("TypeParameterDeclaration"), - supertype: (0, _utils.validateOptionalType)("FlowType") - } -}); -(0, _utils.default)("DeclareVariable", { - visitor: ["id"], - aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"], - fields: { - id: (0, _utils.validateType)("Identifier") - } -}); -(0, _utils.default)("DeclareExportDeclaration", { - visitor: ["declaration", "specifiers", "source"], - aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"], - fields: { - declaration: (0, _utils.validateOptionalType)("Flow"), - specifiers: (0, _utils.validateOptional)((0, _utils.arrayOfType)(["ExportSpecifier", "ExportNamespaceSpecifier"])), - source: (0, _utils.validateOptionalType)("StringLiteral"), - default: (0, _utils.validateOptional)((0, _utils.assertValueType)("boolean")) - } -}); -(0, _utils.default)("DeclareExportAllDeclaration", { - visitor: ["source"], - aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"], - fields: { - source: (0, _utils.validateType)("StringLiteral"), - exportKind: (0, _utils.validateOptional)((0, _utils.assertOneOf)("type", "value")) - } -}); -(0, _utils.default)("DeclaredPredicate", { - visitor: ["value"], - aliases: ["Flow", "FlowPredicate"], - fields: { - value: (0, _utils.validateType)("Flow") - } -}); -(0, _utils.default)("ExistsTypeAnnotation", { - aliases: ["Flow", "FlowType"] -}); -(0, _utils.default)("FunctionTypeAnnotation", { - visitor: ["typeParameters", "params", "rest", "returnType"], - aliases: ["Flow", "FlowType"], - fields: { - typeParameters: (0, _utils.validateOptionalType)("TypeParameterDeclaration"), - params: (0, _utils.validate)((0, _utils.arrayOfType)("FunctionTypeParam")), - rest: (0, _utils.validateOptionalType)("FunctionTypeParam"), - returnType: (0, _utils.validateType)("FlowType") - } -}); -(0, _utils.default)("FunctionTypeParam", { - visitor: ["name", "typeAnnotation"], - aliases: ["Flow"], - fields: { - name: (0, _utils.validateOptionalType)("Identifier"), - typeAnnotation: (0, _utils.validateType)("FlowType"), - optional: (0, _utils.validateOptional)((0, _utils.assertValueType)("boolean")) - } -}); -(0, _utils.default)("GenericTypeAnnotation", { - visitor: ["id", "typeParameters"], - aliases: ["Flow", "FlowType"], - fields: { - id: (0, _utils.validateType)(["Identifier", "QualifiedTypeIdentifier"]), - typeParameters: (0, _utils.validateOptionalType)("TypeParameterInstantiation") - } -}); -(0, _utils.default)("InferredPredicate", { - aliases: ["Flow", "FlowPredicate"] -}); -(0, _utils.default)("InterfaceExtends", { - visitor: ["id", "typeParameters"], - aliases: ["Flow"], - fields: { - id: (0, _utils.validateType)(["Identifier", "QualifiedTypeIdentifier"]), - typeParameters: (0, _utils.validateOptionalType)("TypeParameterInstantiation") - } -}); -defineInterfaceishType("InterfaceDeclaration"); -(0, _utils.default)("InterfaceTypeAnnotation", { - visitor: ["extends", "body"], - aliases: ["Flow", "FlowType"], - fields: { - extends: (0, _utils.validateOptional)((0, _utils.arrayOfType)("InterfaceExtends")), - body: (0, _utils.validateType)("ObjectTypeAnnotation") - } -}); -(0, _utils.default)("IntersectionTypeAnnotation", { - visitor: ["types"], - aliases: ["Flow", "FlowType"], - fields: { - types: (0, _utils.validate)((0, _utils.arrayOfType)("FlowType")) - } -}); -(0, _utils.default)("MixedTypeAnnotation", { - aliases: ["Flow", "FlowType", "FlowBaseAnnotation"] -}); -(0, _utils.default)("EmptyTypeAnnotation", { - aliases: ["Flow", "FlowType", "FlowBaseAnnotation"] -}); -(0, _utils.default)("NullableTypeAnnotation", { - visitor: ["typeAnnotation"], - aliases: ["Flow", "FlowType"], - fields: { - typeAnnotation: (0, _utils.validateType)("FlowType") - } -}); -(0, _utils.default)("NumberLiteralTypeAnnotation", { - builder: ["value"], - aliases: ["Flow", "FlowType"], - fields: { - value: (0, _utils.validate)((0, _utils.assertValueType)("number")) - } -}); -(0, _utils.default)("NumberTypeAnnotation", { - aliases: ["Flow", "FlowType", "FlowBaseAnnotation"] -}); -(0, _utils.default)("ObjectTypeAnnotation", { - visitor: ["properties", "indexers", "callProperties", "internalSlots"], - aliases: ["Flow", "FlowType"], - builder: ["properties", "indexers", "callProperties", "internalSlots", "exact"], - fields: { - properties: (0, _utils.validate)((0, _utils.arrayOfType)(["ObjectTypeProperty", "ObjectTypeSpreadProperty"])), - indexers: (0, _utils.validateOptional)((0, _utils.arrayOfType)("ObjectTypeIndexer")), - callProperties: (0, _utils.validateOptional)((0, _utils.arrayOfType)("ObjectTypeCallProperty")), - internalSlots: (0, _utils.validateOptional)((0, _utils.arrayOfType)("ObjectTypeInternalSlot")), - exact: { - validate: (0, _utils.assertValueType)("boolean"), - default: false - }, - inexact: (0, _utils.validateOptional)((0, _utils.assertValueType)("boolean")) - } -}); -(0, _utils.default)("ObjectTypeInternalSlot", { - visitor: ["id", "value", "optional", "static", "method"], - aliases: ["Flow", "UserWhitespacable"], - fields: { - id: (0, _utils.validateType)("Identifier"), - value: (0, _utils.validateType)("FlowType"), - optional: (0, _utils.validate)((0, _utils.assertValueType)("boolean")), - static: (0, _utils.validate)((0, _utils.assertValueType)("boolean")), - method: (0, _utils.validate)((0, _utils.assertValueType)("boolean")) - } -}); -(0, _utils.default)("ObjectTypeCallProperty", { - visitor: ["value"], - aliases: ["Flow", "UserWhitespacable"], - fields: { - value: (0, _utils.validateType)("FlowType"), - static: (0, _utils.validate)((0, _utils.assertValueType)("boolean")) - } -}); -(0, _utils.default)("ObjectTypeIndexer", { - visitor: ["id", "key", "value", "variance"], - aliases: ["Flow", "UserWhitespacable"], - fields: { - id: (0, _utils.validateOptionalType)("Identifier"), - key: (0, _utils.validateType)("FlowType"), - value: (0, _utils.validateType)("FlowType"), - static: (0, _utils.validate)((0, _utils.assertValueType)("boolean")), - variance: (0, _utils.validateOptionalType)("Variance") - } -}); -(0, _utils.default)("ObjectTypeProperty", { - visitor: ["key", "value", "variance"], - aliases: ["Flow", "UserWhitespacable"], - fields: { - key: (0, _utils.validateType)(["Identifier", "StringLiteral"]), - value: (0, _utils.validateType)("FlowType"), - kind: (0, _utils.validate)((0, _utils.assertOneOf)("init", "get", "set")), - static: (0, _utils.validate)((0, _utils.assertValueType)("boolean")), - proto: (0, _utils.validate)((0, _utils.assertValueType)("boolean")), - optional: (0, _utils.validate)((0, _utils.assertValueType)("boolean")), - variance: (0, _utils.validateOptionalType)("Variance") - } -}); -(0, _utils.default)("ObjectTypeSpreadProperty", { - visitor: ["argument"], - aliases: ["Flow", "UserWhitespacable"], - fields: { - argument: (0, _utils.validateType)("FlowType") - } -}); -(0, _utils.default)("OpaqueType", { - visitor: ["id", "typeParameters", "supertype", "impltype"], - aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"], - fields: { - id: (0, _utils.validateType)("Identifier"), - typeParameters: (0, _utils.validateOptionalType)("TypeParameterDeclaration"), - supertype: (0, _utils.validateOptionalType)("FlowType"), - impltype: (0, _utils.validateType)("FlowType") - } -}); -(0, _utils.default)("QualifiedTypeIdentifier", { - visitor: ["id", "qualification"], - aliases: ["Flow"], - fields: { - id: (0, _utils.validateType)("Identifier"), - qualification: (0, _utils.validateType)(["Identifier", "QualifiedTypeIdentifier"]) - } -}); -(0, _utils.default)("StringLiteralTypeAnnotation", { - builder: ["value"], - aliases: ["Flow", "FlowType"], - fields: { - value: (0, _utils.validate)((0, _utils.assertValueType)("string")) - } -}); -(0, _utils.default)("StringTypeAnnotation", { - aliases: ["Flow", "FlowType", "FlowBaseAnnotation"] -}); -(0, _utils.default)("ThisTypeAnnotation", { - aliases: ["Flow", "FlowType", "FlowBaseAnnotation"] -}); -(0, _utils.default)("TupleTypeAnnotation", { - visitor: ["types"], - aliases: ["Flow", "FlowType"], - fields: { - types: (0, _utils.validate)((0, _utils.arrayOfType)("FlowType")) - } -}); -(0, _utils.default)("TypeofTypeAnnotation", { - visitor: ["argument"], - aliases: ["Flow", "FlowType"], - fields: { - argument: (0, _utils.validateType)("FlowType") - } -}); -(0, _utils.default)("TypeAlias", { - visitor: ["id", "typeParameters", "right"], - aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"], - fields: { - id: (0, _utils.validateType)("Identifier"), - typeParameters: (0, _utils.validateOptionalType)("TypeParameterDeclaration"), - right: (0, _utils.validateType)("FlowType") - } -}); -(0, _utils.default)("TypeAnnotation", { - aliases: ["Flow"], - visitor: ["typeAnnotation"], - fields: { - typeAnnotation: (0, _utils.validateType)("FlowType") - } -}); -(0, _utils.default)("TypeCastExpression", { - visitor: ["expression", "typeAnnotation"], - aliases: ["Flow", "ExpressionWrapper", "Expression"], - fields: { - expression: (0, _utils.validateType)("Expression"), - typeAnnotation: (0, _utils.validateType)("TypeAnnotation") - } -}); -(0, _utils.default)("TypeParameter", { - aliases: ["Flow"], - visitor: ["bound", "default", "variance"], - fields: { - name: (0, _utils.validate)((0, _utils.assertValueType)("string")), - bound: (0, _utils.validateOptionalType)("TypeAnnotation"), - default: (0, _utils.validateOptionalType)("FlowType"), - variance: (0, _utils.validateOptionalType)("Variance") - } -}); -(0, _utils.default)("TypeParameterDeclaration", { - aliases: ["Flow"], - visitor: ["params"], - fields: { - params: (0, _utils.validate)((0, _utils.arrayOfType)("TypeParameter")) - } -}); -(0, _utils.default)("TypeParameterInstantiation", { - aliases: ["Flow"], - visitor: ["params"], - fields: { - params: (0, _utils.validate)((0, _utils.arrayOfType)("FlowType")) - } -}); -(0, _utils.default)("UnionTypeAnnotation", { - visitor: ["types"], - aliases: ["Flow", "FlowType"], - fields: { - types: (0, _utils.validate)((0, _utils.arrayOfType)("FlowType")) - } -}); -(0, _utils.default)("Variance", { - aliases: ["Flow"], - builder: ["kind"], - fields: { - kind: (0, _utils.validate)((0, _utils.assertOneOf)("minus", "plus")) - } -}); -(0, _utils.default)("VoidTypeAnnotation", { - aliases: ["Flow", "FlowType", "FlowBaseAnnotation"] -}); - -/***/ }), - -/***/ "./node_modules/@babel/types/lib/definitions/index.js": -/*!************************************************************!*\ - !*** ./node_modules/@babel/types/lib/definitions/index.js ***! - \************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -Object.defineProperty(exports, "VISITOR_KEYS", { - enumerable: true, - get: function () { - return _utils.VISITOR_KEYS; - } -}); -Object.defineProperty(exports, "ALIAS_KEYS", { - enumerable: true, - get: function () { - return _utils.ALIAS_KEYS; - } -}); -Object.defineProperty(exports, "FLIPPED_ALIAS_KEYS", { - enumerable: true, - get: function () { - return _utils.FLIPPED_ALIAS_KEYS; - } -}); -Object.defineProperty(exports, "NODE_FIELDS", { - enumerable: true, - get: function () { - return _utils.NODE_FIELDS; - } -}); -Object.defineProperty(exports, "BUILDER_KEYS", { - enumerable: true, - get: function () { - return _utils.BUILDER_KEYS; - } -}); -Object.defineProperty(exports, "DEPRECATED_KEYS", { - enumerable: true, - get: function () { - return _utils.DEPRECATED_KEYS; - } -}); -Object.defineProperty(exports, "PLACEHOLDERS", { - enumerable: true, - get: function () { - return _placeholders.PLACEHOLDERS; - } -}); -Object.defineProperty(exports, "PLACEHOLDERS_ALIAS", { - enumerable: true, - get: function () { - return _placeholders.PLACEHOLDERS_ALIAS; - } -}); -Object.defineProperty(exports, "PLACEHOLDERS_FLIPPED_ALIAS", { - enumerable: true, - get: function () { - return _placeholders.PLACEHOLDERS_FLIPPED_ALIAS; - } -}); -exports.TYPES = void 0; - -function _toFastProperties() { - const data = _interopRequireDefault(__webpack_require__(/*! to-fast-properties */ "./node_modules/to-fast-properties/index.js")); - - _toFastProperties = function () { - return data; - }; - - return data; -} - -__webpack_require__(/*! ./core */ "./node_modules/@babel/types/lib/definitions/core.js"); - -__webpack_require__(/*! ./es2015 */ "./node_modules/@babel/types/lib/definitions/es2015.js"); - -__webpack_require__(/*! ./flow */ "./node_modules/@babel/types/lib/definitions/flow.js"); - -__webpack_require__(/*! ./jsx */ "./node_modules/@babel/types/lib/definitions/jsx.js"); - -__webpack_require__(/*! ./misc */ "./node_modules/@babel/types/lib/definitions/misc.js"); - -__webpack_require__(/*! ./experimental */ "./node_modules/@babel/types/lib/definitions/experimental.js"); - -__webpack_require__(/*! ./typescript */ "./node_modules/@babel/types/lib/definitions/typescript.js"); - -var _utils = __webpack_require__(/*! ./utils */ "./node_modules/@babel/types/lib/definitions/utils.js"); - -var _placeholders = __webpack_require__(/*! ./placeholders */ "./node_modules/@babel/types/lib/definitions/placeholders.js"); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -(0, _toFastProperties().default)(_utils.VISITOR_KEYS); -(0, _toFastProperties().default)(_utils.ALIAS_KEYS); -(0, _toFastProperties().default)(_utils.FLIPPED_ALIAS_KEYS); -(0, _toFastProperties().default)(_utils.NODE_FIELDS); -(0, _toFastProperties().default)(_utils.BUILDER_KEYS); -(0, _toFastProperties().default)(_utils.DEPRECATED_KEYS); -(0, _toFastProperties().default)(_placeholders.PLACEHOLDERS_ALIAS); -(0, _toFastProperties().default)(_placeholders.PLACEHOLDERS_FLIPPED_ALIAS); -const TYPES = Object.keys(_utils.VISITOR_KEYS).concat(Object.keys(_utils.FLIPPED_ALIAS_KEYS)).concat(Object.keys(_utils.DEPRECATED_KEYS)); -exports.TYPES = TYPES; - -/***/ }), - -/***/ "./node_modules/@babel/types/lib/definitions/jsx.js": -/*!**********************************************************!*\ - !*** ./node_modules/@babel/types/lib/definitions/jsx.js ***! - \**********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _utils = _interopRequireWildcard(__webpack_require__(/*! ./utils */ "./node_modules/@babel/types/lib/definitions/utils.js")); - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -(0, _utils.default)("JSXAttribute", { - visitor: ["name", "value"], - aliases: ["JSX", "Immutable"], - fields: { - name: { - validate: (0, _utils.assertNodeType)("JSXIdentifier", "JSXNamespacedName") - }, - value: { - optional: true, - validate: (0, _utils.assertNodeType)("JSXElement", "JSXFragment", "StringLiteral", "JSXExpressionContainer") - } - } -}); -(0, _utils.default)("JSXClosingElement", { - visitor: ["name"], - aliases: ["JSX", "Immutable"], - fields: { - name: { - validate: (0, _utils.assertNodeType)("JSXIdentifier", "JSXMemberExpression") - } - } -}); -(0, _utils.default)("JSXElement", { - builder: ["openingElement", "closingElement", "children", "selfClosing"], - visitor: ["openingElement", "children", "closingElement"], - aliases: ["JSX", "Immutable", "Expression"], - fields: { - openingElement: { - validate: (0, _utils.assertNodeType)("JSXOpeningElement") - }, - closingElement: { - optional: true, - validate: (0, _utils.assertNodeType)("JSXClosingElement") - }, - children: { - validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("JSXText", "JSXExpressionContainer", "JSXSpreadChild", "JSXElement", "JSXFragment"))) - } - } -}); -(0, _utils.default)("JSXEmptyExpression", { - aliases: ["JSX"] -}); -(0, _utils.default)("JSXExpressionContainer", { - visitor: ["expression"], - aliases: ["JSX", "Immutable"], - fields: { - expression: { - validate: (0, _utils.assertNodeType)("Expression", "JSXEmptyExpression") - } - } -}); -(0, _utils.default)("JSXSpreadChild", { - visitor: ["expression"], - aliases: ["JSX", "Immutable"], - fields: { - expression: { - validate: (0, _utils.assertNodeType)("Expression") - } - } -}); -(0, _utils.default)("JSXIdentifier", { - builder: ["name"], - aliases: ["JSX"], - fields: { - name: { - validate: (0, _utils.assertValueType)("string") - } - } -}); -(0, _utils.default)("JSXMemberExpression", { - visitor: ["object", "property"], - aliases: ["JSX"], - fields: { - object: { - validate: (0, _utils.assertNodeType)("JSXMemberExpression", "JSXIdentifier") - }, - property: { - validate: (0, _utils.assertNodeType)("JSXIdentifier") - } - } -}); -(0, _utils.default)("JSXNamespacedName", { - visitor: ["namespace", "name"], - aliases: ["JSX"], - fields: { - namespace: { - validate: (0, _utils.assertNodeType)("JSXIdentifier") - }, - name: { - validate: (0, _utils.assertNodeType)("JSXIdentifier") - } - } -}); -(0, _utils.default)("JSXOpeningElement", { - builder: ["name", "attributes", "selfClosing"], - visitor: ["name", "attributes"], - aliases: ["JSX", "Immutable"], - fields: { - name: { - validate: (0, _utils.assertNodeType)("JSXIdentifier", "JSXMemberExpression") - }, - selfClosing: { - default: false, - validate: (0, _utils.assertValueType)("boolean") - }, - attributes: { - validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("JSXAttribute", "JSXSpreadAttribute"))) - }, - typeParameters: { - validate: (0, _utils.assertNodeType)("TypeParameterInstantiation", "TSTypeParameterInstantiation"), - optional: true - } - } -}); -(0, _utils.default)("JSXSpreadAttribute", { - visitor: ["argument"], - aliases: ["JSX"], - fields: { - argument: { - validate: (0, _utils.assertNodeType)("Expression") - } - } -}); -(0, _utils.default)("JSXText", { - aliases: ["JSX", "Immutable"], - builder: ["value"], - fields: { - value: { - validate: (0, _utils.assertValueType)("string") - } - } -}); -(0, _utils.default)("JSXFragment", { - builder: ["openingFragment", "closingFragment", "children"], - visitor: ["openingFragment", "children", "closingFragment"], - aliases: ["JSX", "Immutable", "Expression"], - fields: { - openingFragment: { - validate: (0, _utils.assertNodeType)("JSXOpeningFragment") - }, - closingFragment: { - validate: (0, _utils.assertNodeType)("JSXClosingFragment") - }, - children: { - validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("JSXText", "JSXExpressionContainer", "JSXSpreadChild", "JSXElement", "JSXFragment"))) - } - } -}); -(0, _utils.default)("JSXOpeningFragment", { - aliases: ["JSX", "Immutable"] -}); -(0, _utils.default)("JSXClosingFragment", { - aliases: ["JSX", "Immutable"] -}); - -/***/ }), - -/***/ "./node_modules/@babel/types/lib/definitions/misc.js": -/*!***********************************************************!*\ - !*** ./node_modules/@babel/types/lib/definitions/misc.js ***! - \***********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _utils = _interopRequireWildcard(__webpack_require__(/*! ./utils */ "./node_modules/@babel/types/lib/definitions/utils.js")); - -var _placeholders = __webpack_require__(/*! ./placeholders */ "./node_modules/@babel/types/lib/definitions/placeholders.js"); - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -(0, _utils.default)("Noop", { - visitor: [] -}); -(0, _utils.default)("Placeholder", { - visitor: [], - builder: ["expectedNode", "name"], - fields: { - name: { - validate: (0, _utils.assertNodeType)("Identifier") - }, - expectedNode: { - validate: (0, _utils.assertOneOf)(..._placeholders.PLACEHOLDERS) - } - } -}); - -/***/ }), - -/***/ "./node_modules/@babel/types/lib/definitions/placeholders.js": -/*!*******************************************************************!*\ - !*** ./node_modules/@babel/types/lib/definitions/placeholders.js ***! - \*******************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.PLACEHOLDERS_FLIPPED_ALIAS = exports.PLACEHOLDERS_ALIAS = exports.PLACEHOLDERS = void 0; - -var _utils = __webpack_require__(/*! ./utils */ "./node_modules/@babel/types/lib/definitions/utils.js"); - -const PLACEHOLDERS = ["Identifier", "StringLiteral", "Expression", "Statement", "Declaration", "BlockStatement", "ClassBody", "Pattern"]; -exports.PLACEHOLDERS = PLACEHOLDERS; -const PLACEHOLDERS_ALIAS = { - Declaration: ["Statement"], - Pattern: ["PatternLike", "LVal"] -}; -exports.PLACEHOLDERS_ALIAS = PLACEHOLDERS_ALIAS; - -for (const type of PLACEHOLDERS) { - const alias = _utils.ALIAS_KEYS[type]; - if (alias && alias.length) PLACEHOLDERS_ALIAS[type] = alias; -} - -const PLACEHOLDERS_FLIPPED_ALIAS = {}; -exports.PLACEHOLDERS_FLIPPED_ALIAS = PLACEHOLDERS_FLIPPED_ALIAS; -Object.keys(PLACEHOLDERS_ALIAS).forEach(type => { - PLACEHOLDERS_ALIAS[type].forEach(alias => { - if (!Object.hasOwnProperty.call(PLACEHOLDERS_FLIPPED_ALIAS, alias)) { - PLACEHOLDERS_FLIPPED_ALIAS[alias] = []; - } - - PLACEHOLDERS_FLIPPED_ALIAS[alias].push(type); - }); -}); - -/***/ }), - -/***/ "./node_modules/@babel/types/lib/definitions/typescript.js": -/*!*****************************************************************!*\ - !*** ./node_modules/@babel/types/lib/definitions/typescript.js ***! - \*****************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _utils = _interopRequireWildcard(__webpack_require__(/*! ./utils */ "./node_modules/@babel/types/lib/definitions/utils.js")); - -var _core = __webpack_require__(/*! ./core */ "./node_modules/@babel/types/lib/definitions/core.js"); - -var _es = __webpack_require__(/*! ./es2015 */ "./node_modules/@babel/types/lib/definitions/es2015.js"); - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -const bool = (0, _utils.assertValueType)("boolean"); -const tSFunctionTypeAnnotationCommon = { - returnType: { - validate: (0, _utils.assertNodeType)("TSTypeAnnotation", "Noop"), - optional: true - }, - typeParameters: { - validate: (0, _utils.assertNodeType)("TSTypeParameterDeclaration", "Noop"), - optional: true - } -}; -(0, _utils.default)("TSParameterProperty", { - aliases: ["LVal"], - visitor: ["parameter"], - fields: { - accessibility: { - validate: (0, _utils.assertOneOf)("public", "private", "protected"), - optional: true - }, - readonly: { - validate: (0, _utils.assertValueType)("boolean"), - optional: true - }, - parameter: { - validate: (0, _utils.assertNodeType)("Identifier", "AssignmentPattern") - } - } -}); -(0, _utils.default)("TSDeclareFunction", { - aliases: ["Statement", "Declaration"], - visitor: ["id", "typeParameters", "params", "returnType"], - fields: Object.assign({}, _core.functionDeclarationCommon, tSFunctionTypeAnnotationCommon) -}); -(0, _utils.default)("TSDeclareMethod", { - visitor: ["decorators", "key", "typeParameters", "params", "returnType"], - fields: Object.assign({}, _es.classMethodOrDeclareMethodCommon, tSFunctionTypeAnnotationCommon) -}); -(0, _utils.default)("TSQualifiedName", { - aliases: ["TSEntityName"], - visitor: ["left", "right"], - fields: { - left: (0, _utils.validateType)("TSEntityName"), - right: (0, _utils.validateType)("Identifier") - } -}); -const signatureDeclarationCommon = { - typeParameters: (0, _utils.validateOptionalType)("TSTypeParameterDeclaration"), - parameters: (0, _utils.validateArrayOfType)(["Identifier", "RestElement"]), - typeAnnotation: (0, _utils.validateOptionalType)("TSTypeAnnotation") -}; -const callConstructSignatureDeclaration = { - aliases: ["TSTypeElement"], - visitor: ["typeParameters", "parameters", "typeAnnotation"], - fields: signatureDeclarationCommon -}; -(0, _utils.default)("TSCallSignatureDeclaration", callConstructSignatureDeclaration); -(0, _utils.default)("TSConstructSignatureDeclaration", callConstructSignatureDeclaration); -const namedTypeElementCommon = { - key: (0, _utils.validateType)("Expression"), - computed: (0, _utils.validate)(bool), - optional: (0, _utils.validateOptional)(bool) -}; -(0, _utils.default)("TSPropertySignature", { - aliases: ["TSTypeElement"], - visitor: ["key", "typeAnnotation", "initializer"], - fields: Object.assign({}, namedTypeElementCommon, { - readonly: (0, _utils.validateOptional)(bool), - typeAnnotation: (0, _utils.validateOptionalType)("TSTypeAnnotation"), - initializer: (0, _utils.validateOptionalType)("Expression") - }) -}); -(0, _utils.default)("TSMethodSignature", { - aliases: ["TSTypeElement"], - visitor: ["key", "typeParameters", "parameters", "typeAnnotation"], - fields: Object.assign({}, signatureDeclarationCommon, namedTypeElementCommon) -}); -(0, _utils.default)("TSIndexSignature", { - aliases: ["TSTypeElement"], - visitor: ["parameters", "typeAnnotation"], - fields: { - readonly: (0, _utils.validateOptional)(bool), - parameters: (0, _utils.validateArrayOfType)("Identifier"), - typeAnnotation: (0, _utils.validateOptionalType)("TSTypeAnnotation") - } -}); -const tsKeywordTypes = ["TSAnyKeyword", "TSUnknownKeyword", "TSNumberKeyword", "TSObjectKeyword", "TSBooleanKeyword", "TSStringKeyword", "TSSymbolKeyword", "TSVoidKeyword", "TSUndefinedKeyword", "TSNullKeyword", "TSNeverKeyword"]; - -for (const type of tsKeywordTypes) { - (0, _utils.default)(type, { - aliases: ["TSType"], - visitor: [], - fields: {} - }); -} - -(0, _utils.default)("TSThisType", { - aliases: ["TSType"], - visitor: [], - fields: {} -}); -const fnOrCtr = { - aliases: ["TSType"], - visitor: ["typeParameters", "parameters", "typeAnnotation"], - fields: signatureDeclarationCommon -}; -(0, _utils.default)("TSFunctionType", fnOrCtr); -(0, _utils.default)("TSConstructorType", fnOrCtr); -(0, _utils.default)("TSTypeReference", { - aliases: ["TSType"], - visitor: ["typeName", "typeParameters"], - fields: { - typeName: (0, _utils.validateType)("TSEntityName"), - typeParameters: (0, _utils.validateOptionalType)("TSTypeParameterInstantiation") - } -}); -(0, _utils.default)("TSTypePredicate", { - aliases: ["TSType"], - visitor: ["parameterName", "typeAnnotation"], - fields: { - parameterName: (0, _utils.validateType)(["Identifier", "TSThisType"]), - typeAnnotation: (0, _utils.validateType)("TSTypeAnnotation") - } -}); -(0, _utils.default)("TSTypeQuery", { - aliases: ["TSType"], - visitor: ["exprName"], - fields: { - exprName: (0, _utils.validateType)(["TSEntityName", "TSImportType"]) - } -}); -(0, _utils.default)("TSTypeLiteral", { - aliases: ["TSType"], - visitor: ["members"], - fields: { - members: (0, _utils.validateArrayOfType)("TSTypeElement") - } -}); -(0, _utils.default)("TSArrayType", { - aliases: ["TSType"], - visitor: ["elementType"], - fields: { - elementType: (0, _utils.validateType)("TSType") - } -}); -(0, _utils.default)("TSTupleType", { - aliases: ["TSType"], - visitor: ["elementTypes"], - fields: { - elementTypes: (0, _utils.validateArrayOfType)("TSType") - } -}); -(0, _utils.default)("TSOptionalType", { - aliases: ["TSType"], - visitor: ["typeAnnotation"], - fields: { - typeAnnotation: (0, _utils.validateType)("TSType") - } -}); -(0, _utils.default)("TSRestType", { - aliases: ["TSType"], - visitor: ["typeAnnotation"], - fields: { - typeAnnotation: (0, _utils.validateType)("TSType") - } -}); -const unionOrIntersection = { - aliases: ["TSType"], - visitor: ["types"], - fields: { - types: (0, _utils.validateArrayOfType)("TSType") - } -}; -(0, _utils.default)("TSUnionType", unionOrIntersection); -(0, _utils.default)("TSIntersectionType", unionOrIntersection); -(0, _utils.default)("TSConditionalType", { - aliases: ["TSType"], - visitor: ["checkType", "extendsType", "trueType", "falseType"], - fields: { - checkType: (0, _utils.validateType)("TSType"), - extendsType: (0, _utils.validateType)("TSType"), - trueType: (0, _utils.validateType)("TSType"), - falseType: (0, _utils.validateType)("TSType") - } -}); -(0, _utils.default)("TSInferType", { - aliases: ["TSType"], - visitor: ["typeParameter"], - fields: { - typeParameter: (0, _utils.validateType)("TSTypeParameter") - } -}); -(0, _utils.default)("TSParenthesizedType", { - aliases: ["TSType"], - visitor: ["typeAnnotation"], - fields: { - typeAnnotation: (0, _utils.validateType)("TSType") - } -}); -(0, _utils.default)("TSTypeOperator", { - aliases: ["TSType"], - visitor: ["typeAnnotation"], - fields: { - operator: (0, _utils.validate)((0, _utils.assertValueType)("string")), - typeAnnotation: (0, _utils.validateType)("TSType") - } -}); -(0, _utils.default)("TSIndexedAccessType", { - aliases: ["TSType"], - visitor: ["objectType", "indexType"], - fields: { - objectType: (0, _utils.validateType)("TSType"), - indexType: (0, _utils.validateType)("TSType") - } -}); -(0, _utils.default)("TSMappedType", { - aliases: ["TSType"], - visitor: ["typeParameter", "typeAnnotation"], - fields: { - readonly: (0, _utils.validateOptional)(bool), - typeParameter: (0, _utils.validateType)("TSTypeParameter"), - optional: (0, _utils.validateOptional)(bool), - typeAnnotation: (0, _utils.validateOptionalType)("TSType") - } -}); -(0, _utils.default)("TSLiteralType", { - aliases: ["TSType"], - visitor: ["literal"], - fields: { - literal: (0, _utils.validateType)(["NumericLiteral", "StringLiteral", "BooleanLiteral"]) - } -}); -(0, _utils.default)("TSExpressionWithTypeArguments", { - aliases: ["TSType"], - visitor: ["expression", "typeParameters"], - fields: { - expression: (0, _utils.validateType)("TSEntityName"), - typeParameters: (0, _utils.validateOptionalType)("TSTypeParameterInstantiation") - } -}); -(0, _utils.default)("TSInterfaceDeclaration", { - aliases: ["Statement", "Declaration"], - visitor: ["id", "typeParameters", "extends", "body"], - fields: { - declare: (0, _utils.validateOptional)(bool), - id: (0, _utils.validateType)("Identifier"), - typeParameters: (0, _utils.validateOptionalType)("TSTypeParameterDeclaration"), - extends: (0, _utils.validateOptional)((0, _utils.arrayOfType)("TSExpressionWithTypeArguments")), - body: (0, _utils.validateType)("TSInterfaceBody") - } -}); -(0, _utils.default)("TSInterfaceBody", { - visitor: ["body"], - fields: { - body: (0, _utils.validateArrayOfType)("TSTypeElement") - } -}); -(0, _utils.default)("TSTypeAliasDeclaration", { - aliases: ["Statement", "Declaration"], - visitor: ["id", "typeParameters", "typeAnnotation"], - fields: { - declare: (0, _utils.validateOptional)(bool), - id: (0, _utils.validateType)("Identifier"), - typeParameters: (0, _utils.validateOptionalType)("TSTypeParameterDeclaration"), - typeAnnotation: (0, _utils.validateType)("TSType") - } -}); -(0, _utils.default)("TSAsExpression", { - aliases: ["Expression"], - visitor: ["expression", "typeAnnotation"], - fields: { - expression: (0, _utils.validateType)("Expression"), - typeAnnotation: (0, _utils.validateType)("TSType") - } -}); -(0, _utils.default)("TSTypeAssertion", { - aliases: ["Expression"], - visitor: ["typeAnnotation", "expression"], - fields: { - typeAnnotation: (0, _utils.validateType)("TSType"), - expression: (0, _utils.validateType)("Expression") - } -}); -(0, _utils.default)("TSEnumDeclaration", { - aliases: ["Statement", "Declaration"], - visitor: ["id", "members"], - fields: { - declare: (0, _utils.validateOptional)(bool), - const: (0, _utils.validateOptional)(bool), - id: (0, _utils.validateType)("Identifier"), - members: (0, _utils.validateArrayOfType)("TSEnumMember"), - initializer: (0, _utils.validateOptionalType)("Expression") - } -}); -(0, _utils.default)("TSEnumMember", { - visitor: ["id", "initializer"], - fields: { - id: (0, _utils.validateType)(["Identifier", "StringLiteral"]), - initializer: (0, _utils.validateOptionalType)("Expression") - } -}); -(0, _utils.default)("TSModuleDeclaration", { - aliases: ["Statement", "Declaration"], - visitor: ["id", "body"], - fields: { - declare: (0, _utils.validateOptional)(bool), - global: (0, _utils.validateOptional)(bool), - id: (0, _utils.validateType)(["Identifier", "StringLiteral"]), - body: (0, _utils.validateType)(["TSModuleBlock", "TSModuleDeclaration"]) - } -}); -(0, _utils.default)("TSModuleBlock", { - aliases: ["Scopable", "Block", "BlockParent"], - visitor: ["body"], - fields: { - body: (0, _utils.validateArrayOfType)("Statement") - } -}); -(0, _utils.default)("TSImportType", { - aliases: ["TSType"], - visitor: ["argument", "qualifier", "typeParameters"], - fields: { - argument: (0, _utils.validateType)("StringLiteral"), - qualifier: (0, _utils.validateOptionalType)("TSEntityName"), - typeParameters: (0, _utils.validateOptionalType)("TSTypeParameterInstantiation") - } -}); -(0, _utils.default)("TSImportEqualsDeclaration", { - aliases: ["Statement"], - visitor: ["id", "moduleReference"], - fields: { - isExport: (0, _utils.validate)(bool), - id: (0, _utils.validateType)("Identifier"), - moduleReference: (0, _utils.validateType)(["TSEntityName", "TSExternalModuleReference"]) - } -}); -(0, _utils.default)("TSExternalModuleReference", { - visitor: ["expression"], - fields: { - expression: (0, _utils.validateType)("StringLiteral") - } -}); -(0, _utils.default)("TSNonNullExpression", { - aliases: ["Expression"], - visitor: ["expression"], - fields: { - expression: (0, _utils.validateType)("Expression") - } -}); -(0, _utils.default)("TSExportAssignment", { - aliases: ["Statement"], - visitor: ["expression"], - fields: { - expression: (0, _utils.validateType)("Expression") - } -}); -(0, _utils.default)("TSNamespaceExportDeclaration", { - aliases: ["Statement"], - visitor: ["id"], - fields: { - id: (0, _utils.validateType)("Identifier") - } -}); -(0, _utils.default)("TSTypeAnnotation", { - visitor: ["typeAnnotation"], - fields: { - typeAnnotation: { - validate: (0, _utils.assertNodeType)("TSType") - } - } -}); -(0, _utils.default)("TSTypeParameterInstantiation", { - visitor: ["params"], - fields: { - params: { - validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("TSType"))) - } - } -}); -(0, _utils.default)("TSTypeParameterDeclaration", { - visitor: ["params"], - fields: { - params: { - validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("TSTypeParameter"))) - } - } -}); -(0, _utils.default)("TSTypeParameter", { - visitor: ["constraint", "default"], - fields: { - name: { - validate: (0, _utils.assertValueType)("string") - }, - constraint: { - validate: (0, _utils.assertNodeType)("TSType"), - optional: true - }, - default: { - validate: (0, _utils.assertNodeType)("TSType"), - optional: true - } - } -}); - -/***/ }), - -/***/ "./node_modules/@babel/types/lib/definitions/utils.js": -/*!************************************************************!*\ - !*** ./node_modules/@babel/types/lib/definitions/utils.js ***! - \************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.validate = validate; -exports.typeIs = typeIs; -exports.validateType = validateType; -exports.validateOptional = validateOptional; -exports.validateOptionalType = validateOptionalType; -exports.arrayOf = arrayOf; -exports.arrayOfType = arrayOfType; -exports.validateArrayOfType = validateArrayOfType; -exports.assertEach = assertEach; -exports.assertOneOf = assertOneOf; -exports.assertNodeType = assertNodeType; -exports.assertNodeOrValueType = assertNodeOrValueType; -exports.assertValueType = assertValueType; -exports.assertShape = assertShape; -exports.chain = chain; -exports.default = defineType; -exports.DEPRECATED_KEYS = exports.BUILDER_KEYS = exports.NODE_FIELDS = exports.FLIPPED_ALIAS_KEYS = exports.ALIAS_KEYS = exports.VISITOR_KEYS = void 0; - -var _is = _interopRequireDefault(__webpack_require__(/*! ../validators/is */ "./node_modules/@babel/types/lib/validators/is.js")); - -var _validate = __webpack_require__(/*! ../validators/validate */ "./node_modules/@babel/types/lib/validators/validate.js"); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -const VISITOR_KEYS = {}; -exports.VISITOR_KEYS = VISITOR_KEYS; -const ALIAS_KEYS = {}; -exports.ALIAS_KEYS = ALIAS_KEYS; -const FLIPPED_ALIAS_KEYS = {}; -exports.FLIPPED_ALIAS_KEYS = FLIPPED_ALIAS_KEYS; -const NODE_FIELDS = {}; -exports.NODE_FIELDS = NODE_FIELDS; -const BUILDER_KEYS = {}; -exports.BUILDER_KEYS = BUILDER_KEYS; -const DEPRECATED_KEYS = {}; -exports.DEPRECATED_KEYS = DEPRECATED_KEYS; - -function getType(val) { - if (Array.isArray(val)) { - return "array"; - } else if (val === null) { - return "null"; - } else if (val === undefined) { - return "undefined"; - } else { - return typeof val; - } -} - -function validate(validate) { - return { - validate - }; -} - -function typeIs(typeName) { - return typeof typeName === "string" ? assertNodeType(typeName) : assertNodeType(...typeName); -} - -function validateType(typeName) { - return validate(typeIs(typeName)); -} - -function validateOptional(validate) { - return { - validate, - optional: true - }; -} - -function validateOptionalType(typeName) { - return { - validate: typeIs(typeName), - optional: true - }; -} - -function arrayOf(elementType) { - return chain(assertValueType("array"), assertEach(elementType)); -} - -function arrayOfType(typeName) { - return arrayOf(typeIs(typeName)); -} - -function validateArrayOfType(typeName) { - return validate(arrayOfType(typeName)); -} - -function assertEach(callback) { - function validator(node, key, val) { - if (!Array.isArray(val)) return; - - for (let i = 0; i < val.length; i++) { - callback(node, `${key}[${i}]`, val[i]); - } - } - - validator.each = callback; - return validator; -} - -function assertOneOf(...values) { - function validate(node, key, val) { - if (values.indexOf(val) < 0) { - throw new TypeError(`Property ${key} expected value to be one of ${JSON.stringify(values)} but got ${JSON.stringify(val)}`); - } - } - - validate.oneOf = values; - return validate; -} - -function assertNodeType(...types) { - function validate(node, key, val) { - let valid = false; - - for (const type of types) { - if ((0, _is.default)(type, val)) { - valid = true; - break; - } - } - - if (!valid) { - throw new TypeError(`Property ${key} of ${node.type} expected node to be of a type ${JSON.stringify(types)} ` + `but instead got ${JSON.stringify(val && val.type)}`); - } - } - - validate.oneOfNodeTypes = types; - return validate; -} - -function assertNodeOrValueType(...types) { - function validate(node, key, val) { - let valid = false; - - for (const type of types) { - if (getType(val) === type || (0, _is.default)(type, val)) { - valid = true; - break; - } - } - - if (!valid) { - throw new TypeError(`Property ${key} of ${node.type} expected node to be of a type ${JSON.stringify(types)} ` + `but instead got ${JSON.stringify(val && val.type)}`); - } - } - - validate.oneOfNodeOrValueTypes = types; - return validate; -} - -function assertValueType(type) { - function validate(node, key, val) { - const valid = getType(val) === type; - - if (!valid) { - throw new TypeError(`Property ${key} expected type of ${type} but got ${getType(val)}`); - } - } - - validate.type = type; - return validate; -} - -function assertShape(shape) { - function validate(node, key, val) { - const errors = []; - - for (const property of Object.keys(shape)) { - try { - (0, _validate.validateField)(node, property, val[property], shape[property]); - } catch (error) { - if (error instanceof TypeError) { - errors.push(error.message); - continue; - } - - throw error; - } - } - - if (errors.length) { - throw new TypeError(`Property ${key} of ${node.type} expected to have the following:\n${errors.join("\n")}`); - } - } - - validate.shapeOf = shape; - return validate; -} - -function chain(...fns) { - function validate(...args) { - for (const fn of fns) { - fn(...args); - } - } - - validate.chainOf = fns; - return validate; -} - -function defineType(type, opts = {}) { - const inherits = opts.inherits && store[opts.inherits] || {}; - const fields = opts.fields || inherits.fields || {}; - const visitor = opts.visitor || inherits.visitor || []; - const aliases = opts.aliases || inherits.aliases || []; - const builder = opts.builder || inherits.builder || opts.visitor || []; - - if (opts.deprecatedAlias) { - DEPRECATED_KEYS[opts.deprecatedAlias] = type; - } - - for (const key of visitor.concat(builder)) { - fields[key] = fields[key] || {}; - } - - for (const key of Object.keys(fields)) { - const field = fields[key]; - - if (builder.indexOf(key) === -1) { - field.optional = true; - } - - if (field.default === undefined) { - field.default = null; - } else if (!field.validate) { - field.validate = assertValueType(getType(field.default)); - } - } - - VISITOR_KEYS[type] = opts.visitor = visitor; - BUILDER_KEYS[type] = opts.builder = builder; - NODE_FIELDS[type] = opts.fields = fields; - ALIAS_KEYS[type] = opts.aliases = aliases; - aliases.forEach(alias => { - FLIPPED_ALIAS_KEYS[alias] = FLIPPED_ALIAS_KEYS[alias] || []; - FLIPPED_ALIAS_KEYS[alias].push(type); - }); - store[type] = opts; -} - -const store = {}; - -/***/ }), - -/***/ "./node_modules/@babel/types/lib/index.js": -/*!************************************************!*\ - !*** ./node_modules/@babel/types/lib/index.js ***! - \************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -var _exportNames = { - react: true, - assertNode: true, - createTypeAnnotationBasedOnTypeof: true, - createUnionTypeAnnotation: true, - cloneNode: true, - clone: true, - cloneDeep: true, - cloneWithoutLoc: true, - addComment: true, - addComments: true, - inheritInnerComments: true, - inheritLeadingComments: true, - inheritsComments: true, - inheritTrailingComments: true, - removeComments: true, - ensureBlock: true, - toBindingIdentifierName: true, - toBlock: true, - toComputedKey: true, - toExpression: true, - toIdentifier: true, - toKeyAlias: true, - toSequenceExpression: true, - toStatement: true, - valueToNode: true, - appendToMemberExpression: true, - inherits: true, - prependToMemberExpression: true, - removeProperties: true, - removePropertiesDeep: true, - removeTypeDuplicates: true, - getBindingIdentifiers: true, - getOuterBindingIdentifiers: true, - traverse: true, - traverseFast: true, - shallowEqual: true, - is: true, - isBinding: true, - isBlockScoped: true, - isImmutable: true, - isLet: true, - isNode: true, - isNodesEquivalent: true, - isPlaceholderType: true, - isReferenced: true, - isScope: true, - isSpecifierDefault: true, - isType: true, - isValidES3Identifier: true, - isValidIdentifier: true, - isVar: true, - matchesPattern: true, - validate: true, - buildMatchMemberExpression: true -}; -Object.defineProperty(exports, "assertNode", { - enumerable: true, - get: function () { - return _assertNode.default; - } -}); -Object.defineProperty(exports, "createTypeAnnotationBasedOnTypeof", { - enumerable: true, - get: function () { - return _createTypeAnnotationBasedOnTypeof.default; - } -}); -Object.defineProperty(exports, "createUnionTypeAnnotation", { - enumerable: true, - get: function () { - return _createUnionTypeAnnotation.default; - } -}); -Object.defineProperty(exports, "cloneNode", { - enumerable: true, - get: function () { - return _cloneNode.default; - } -}); -Object.defineProperty(exports, "clone", { - enumerable: true, - get: function () { - return _clone.default; - } -}); -Object.defineProperty(exports, "cloneDeep", { - enumerable: true, - get: function () { - return _cloneDeep.default; - } -}); -Object.defineProperty(exports, "cloneWithoutLoc", { - enumerable: true, - get: function () { - return _cloneWithoutLoc.default; - } -}); -Object.defineProperty(exports, "addComment", { - enumerable: true, - get: function () { - return _addComment.default; - } -}); -Object.defineProperty(exports, "addComments", { - enumerable: true, - get: function () { - return _addComments.default; - } -}); -Object.defineProperty(exports, "inheritInnerComments", { - enumerable: true, - get: function () { - return _inheritInnerComments.default; - } -}); -Object.defineProperty(exports, "inheritLeadingComments", { - enumerable: true, - get: function () { - return _inheritLeadingComments.default; - } -}); -Object.defineProperty(exports, "inheritsComments", { - enumerable: true, - get: function () { - return _inheritsComments.default; - } -}); -Object.defineProperty(exports, "inheritTrailingComments", { - enumerable: true, - get: function () { - return _inheritTrailingComments.default; - } -}); -Object.defineProperty(exports, "removeComments", { - enumerable: true, - get: function () { - return _removeComments.default; - } -}); -Object.defineProperty(exports, "ensureBlock", { - enumerable: true, - get: function () { - return _ensureBlock.default; - } -}); -Object.defineProperty(exports, "toBindingIdentifierName", { - enumerable: true, - get: function () { - return _toBindingIdentifierName.default; - } -}); -Object.defineProperty(exports, "toBlock", { - enumerable: true, - get: function () { - return _toBlock.default; - } -}); -Object.defineProperty(exports, "toComputedKey", { - enumerable: true, - get: function () { - return _toComputedKey.default; - } -}); -Object.defineProperty(exports, "toExpression", { - enumerable: true, - get: function () { - return _toExpression.default; - } -}); -Object.defineProperty(exports, "toIdentifier", { - enumerable: true, - get: function () { - return _toIdentifier.default; - } -}); -Object.defineProperty(exports, "toKeyAlias", { - enumerable: true, - get: function () { - return _toKeyAlias.default; - } -}); -Object.defineProperty(exports, "toSequenceExpression", { - enumerable: true, - get: function () { - return _toSequenceExpression.default; - } -}); -Object.defineProperty(exports, "toStatement", { - enumerable: true, - get: function () { - return _toStatement.default; - } -}); -Object.defineProperty(exports, "valueToNode", { - enumerable: true, - get: function () { - return _valueToNode.default; - } -}); -Object.defineProperty(exports, "appendToMemberExpression", { - enumerable: true, - get: function () { - return _appendToMemberExpression.default; - } -}); -Object.defineProperty(exports, "inherits", { - enumerable: true, - get: function () { - return _inherits.default; - } -}); -Object.defineProperty(exports, "prependToMemberExpression", { - enumerable: true, - get: function () { - return _prependToMemberExpression.default; - } -}); -Object.defineProperty(exports, "removeProperties", { - enumerable: true, - get: function () { - return _removeProperties.default; - } -}); -Object.defineProperty(exports, "removePropertiesDeep", { - enumerable: true, - get: function () { - return _removePropertiesDeep.default; - } -}); -Object.defineProperty(exports, "removeTypeDuplicates", { - enumerable: true, - get: function () { - return _removeTypeDuplicates.default; - } -}); -Object.defineProperty(exports, "getBindingIdentifiers", { - enumerable: true, - get: function () { - return _getBindingIdentifiers.default; - } -}); -Object.defineProperty(exports, "getOuterBindingIdentifiers", { - enumerable: true, - get: function () { - return _getOuterBindingIdentifiers.default; - } -}); -Object.defineProperty(exports, "traverse", { - enumerable: true, - get: function () { - return _traverse.default; - } -}); -Object.defineProperty(exports, "traverseFast", { - enumerable: true, - get: function () { - return _traverseFast.default; - } -}); -Object.defineProperty(exports, "shallowEqual", { - enumerable: true, - get: function () { - return _shallowEqual.default; - } -}); -Object.defineProperty(exports, "is", { - enumerable: true, - get: function () { - return _is.default; - } -}); -Object.defineProperty(exports, "isBinding", { - enumerable: true, - get: function () { - return _isBinding.default; - } -}); -Object.defineProperty(exports, "isBlockScoped", { - enumerable: true, - get: function () { - return _isBlockScoped.default; - } -}); -Object.defineProperty(exports, "isImmutable", { - enumerable: true, - get: function () { - return _isImmutable.default; - } -}); -Object.defineProperty(exports, "isLet", { - enumerable: true, - get: function () { - return _isLet.default; - } -}); -Object.defineProperty(exports, "isNode", { - enumerable: true, - get: function () { - return _isNode.default; - } -}); -Object.defineProperty(exports, "isNodesEquivalent", { - enumerable: true, - get: function () { - return _isNodesEquivalent.default; - } -}); -Object.defineProperty(exports, "isPlaceholderType", { - enumerable: true, - get: function () { - return _isPlaceholderType.default; - } -}); -Object.defineProperty(exports, "isReferenced", { - enumerable: true, - get: function () { - return _isReferenced.default; - } -}); -Object.defineProperty(exports, "isScope", { - enumerable: true, - get: function () { - return _isScope.default; - } -}); -Object.defineProperty(exports, "isSpecifierDefault", { - enumerable: true, - get: function () { - return _isSpecifierDefault.default; - } -}); -Object.defineProperty(exports, "isType", { - enumerable: true, - get: function () { - return _isType.default; - } -}); -Object.defineProperty(exports, "isValidES3Identifier", { - enumerable: true, - get: function () { - return _isValidES3Identifier.default; - } -}); -Object.defineProperty(exports, "isValidIdentifier", { - enumerable: true, - get: function () { - return _isValidIdentifier.default; - } -}); -Object.defineProperty(exports, "isVar", { - enumerable: true, - get: function () { - return _isVar.default; - } -}); -Object.defineProperty(exports, "matchesPattern", { - enumerable: true, - get: function () { - return _matchesPattern.default; - } -}); -Object.defineProperty(exports, "validate", { - enumerable: true, - get: function () { - return _validate.default; - } -}); -Object.defineProperty(exports, "buildMatchMemberExpression", { - enumerable: true, - get: function () { - return _buildMatchMemberExpression.default; - } -}); -exports.react = void 0; - -var _isReactComponent = _interopRequireDefault(__webpack_require__(/*! ./validators/react/isReactComponent */ "./node_modules/@babel/types/lib/validators/react/isReactComponent.js")); - -var _isCompatTag = _interopRequireDefault(__webpack_require__(/*! ./validators/react/isCompatTag */ "./node_modules/@babel/types/lib/validators/react/isCompatTag.js")); - -var _buildChildren = _interopRequireDefault(__webpack_require__(/*! ./builders/react/buildChildren */ "./node_modules/@babel/types/lib/builders/react/buildChildren.js")); - -var _assertNode = _interopRequireDefault(__webpack_require__(/*! ./asserts/assertNode */ "./node_modules/@babel/types/lib/asserts/assertNode.js")); - -var _generated = __webpack_require__(/*! ./asserts/generated */ "./node_modules/@babel/types/lib/asserts/generated/index.js"); - -Object.keys(_generated).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _generated[key]; - } - }); -}); - -var _createTypeAnnotationBasedOnTypeof = _interopRequireDefault(__webpack_require__(/*! ./builders/flow/createTypeAnnotationBasedOnTypeof */ "./node_modules/@babel/types/lib/builders/flow/createTypeAnnotationBasedOnTypeof.js")); - -var _createUnionTypeAnnotation = _interopRequireDefault(__webpack_require__(/*! ./builders/flow/createUnionTypeAnnotation */ "./node_modules/@babel/types/lib/builders/flow/createUnionTypeAnnotation.js")); - -var _generated2 = __webpack_require__(/*! ./builders/generated */ "./node_modules/@babel/types/lib/builders/generated/index.js"); - -Object.keys(_generated2).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _generated2[key]; - } - }); -}); - -var _cloneNode = _interopRequireDefault(__webpack_require__(/*! ./clone/cloneNode */ "./node_modules/@babel/types/lib/clone/cloneNode.js")); - -var _clone = _interopRequireDefault(__webpack_require__(/*! ./clone/clone */ "./node_modules/@babel/types/lib/clone/clone.js")); - -var _cloneDeep = _interopRequireDefault(__webpack_require__(/*! ./clone/cloneDeep */ "./node_modules/@babel/types/lib/clone/cloneDeep.js")); - -var _cloneWithoutLoc = _interopRequireDefault(__webpack_require__(/*! ./clone/cloneWithoutLoc */ "./node_modules/@babel/types/lib/clone/cloneWithoutLoc.js")); - -var _addComment = _interopRequireDefault(__webpack_require__(/*! ./comments/addComment */ "./node_modules/@babel/types/lib/comments/addComment.js")); - -var _addComments = _interopRequireDefault(__webpack_require__(/*! ./comments/addComments */ "./node_modules/@babel/types/lib/comments/addComments.js")); - -var _inheritInnerComments = _interopRequireDefault(__webpack_require__(/*! ./comments/inheritInnerComments */ "./node_modules/@babel/types/lib/comments/inheritInnerComments.js")); - -var _inheritLeadingComments = _interopRequireDefault(__webpack_require__(/*! ./comments/inheritLeadingComments */ "./node_modules/@babel/types/lib/comments/inheritLeadingComments.js")); - -var _inheritsComments = _interopRequireDefault(__webpack_require__(/*! ./comments/inheritsComments */ "./node_modules/@babel/types/lib/comments/inheritsComments.js")); - -var _inheritTrailingComments = _interopRequireDefault(__webpack_require__(/*! ./comments/inheritTrailingComments */ "./node_modules/@babel/types/lib/comments/inheritTrailingComments.js")); - -var _removeComments = _interopRequireDefault(__webpack_require__(/*! ./comments/removeComments */ "./node_modules/@babel/types/lib/comments/removeComments.js")); - -var _generated3 = __webpack_require__(/*! ./constants/generated */ "./node_modules/@babel/types/lib/constants/generated/index.js"); - -Object.keys(_generated3).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _generated3[key]; - } - }); -}); - -var _constants = __webpack_require__(/*! ./constants */ "./node_modules/@babel/types/lib/constants/index.js"); - -Object.keys(_constants).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _constants[key]; - } - }); -}); - -var _ensureBlock = _interopRequireDefault(__webpack_require__(/*! ./converters/ensureBlock */ "./node_modules/@babel/types/lib/converters/ensureBlock.js")); - -var _toBindingIdentifierName = _interopRequireDefault(__webpack_require__(/*! ./converters/toBindingIdentifierName */ "./node_modules/@babel/types/lib/converters/toBindingIdentifierName.js")); - -var _toBlock = _interopRequireDefault(__webpack_require__(/*! ./converters/toBlock */ "./node_modules/@babel/types/lib/converters/toBlock.js")); - -var _toComputedKey = _interopRequireDefault(__webpack_require__(/*! ./converters/toComputedKey */ "./node_modules/@babel/types/lib/converters/toComputedKey.js")); - -var _toExpression = _interopRequireDefault(__webpack_require__(/*! ./converters/toExpression */ "./node_modules/@babel/types/lib/converters/toExpression.js")); - -var _toIdentifier = _interopRequireDefault(__webpack_require__(/*! ./converters/toIdentifier */ "./node_modules/@babel/types/lib/converters/toIdentifier.js")); - -var _toKeyAlias = _interopRequireDefault(__webpack_require__(/*! ./converters/toKeyAlias */ "./node_modules/@babel/types/lib/converters/toKeyAlias.js")); - -var _toSequenceExpression = _interopRequireDefault(__webpack_require__(/*! ./converters/toSequenceExpression */ "./node_modules/@babel/types/lib/converters/toSequenceExpression.js")); - -var _toStatement = _interopRequireDefault(__webpack_require__(/*! ./converters/toStatement */ "./node_modules/@babel/types/lib/converters/toStatement.js")); - -var _valueToNode = _interopRequireDefault(__webpack_require__(/*! ./converters/valueToNode */ "./node_modules/@babel/types/lib/converters/valueToNode.js")); - -var _definitions = __webpack_require__(/*! ./definitions */ "./node_modules/@babel/types/lib/definitions/index.js"); - -Object.keys(_definitions).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _definitions[key]; - } - }); -}); - -var _appendToMemberExpression = _interopRequireDefault(__webpack_require__(/*! ./modifications/appendToMemberExpression */ "./node_modules/@babel/types/lib/modifications/appendToMemberExpression.js")); - -var _inherits = _interopRequireDefault(__webpack_require__(/*! ./modifications/inherits */ "./node_modules/@babel/types/lib/modifications/inherits.js")); - -var _prependToMemberExpression = _interopRequireDefault(__webpack_require__(/*! ./modifications/prependToMemberExpression */ "./node_modules/@babel/types/lib/modifications/prependToMemberExpression.js")); - -var _removeProperties = _interopRequireDefault(__webpack_require__(/*! ./modifications/removeProperties */ "./node_modules/@babel/types/lib/modifications/removeProperties.js")); - -var _removePropertiesDeep = _interopRequireDefault(__webpack_require__(/*! ./modifications/removePropertiesDeep */ "./node_modules/@babel/types/lib/modifications/removePropertiesDeep.js")); - -var _removeTypeDuplicates = _interopRequireDefault(__webpack_require__(/*! ./modifications/flow/removeTypeDuplicates */ "./node_modules/@babel/types/lib/modifications/flow/removeTypeDuplicates.js")); - -var _getBindingIdentifiers = _interopRequireDefault(__webpack_require__(/*! ./retrievers/getBindingIdentifiers */ "./node_modules/@babel/types/lib/retrievers/getBindingIdentifiers.js")); - -var _getOuterBindingIdentifiers = _interopRequireDefault(__webpack_require__(/*! ./retrievers/getOuterBindingIdentifiers */ "./node_modules/@babel/types/lib/retrievers/getOuterBindingIdentifiers.js")); - -var _traverse = _interopRequireDefault(__webpack_require__(/*! ./traverse/traverse */ "./node_modules/@babel/types/lib/traverse/traverse.js")); - -var _traverseFast = _interopRequireDefault(__webpack_require__(/*! ./traverse/traverseFast */ "./node_modules/@babel/types/lib/traverse/traverseFast.js")); - -var _shallowEqual = _interopRequireDefault(__webpack_require__(/*! ./utils/shallowEqual */ "./node_modules/@babel/types/lib/utils/shallowEqual.js")); - -var _is = _interopRequireDefault(__webpack_require__(/*! ./validators/is */ "./node_modules/@babel/types/lib/validators/is.js")); - -var _isBinding = _interopRequireDefault(__webpack_require__(/*! ./validators/isBinding */ "./node_modules/@babel/types/lib/validators/isBinding.js")); - -var _isBlockScoped = _interopRequireDefault(__webpack_require__(/*! ./validators/isBlockScoped */ "./node_modules/@babel/types/lib/validators/isBlockScoped.js")); - -var _isImmutable = _interopRequireDefault(__webpack_require__(/*! ./validators/isImmutable */ "./node_modules/@babel/types/lib/validators/isImmutable.js")); - -var _isLet = _interopRequireDefault(__webpack_require__(/*! ./validators/isLet */ "./node_modules/@babel/types/lib/validators/isLet.js")); - -var _isNode = _interopRequireDefault(__webpack_require__(/*! ./validators/isNode */ "./node_modules/@babel/types/lib/validators/isNode.js")); - -var _isNodesEquivalent = _interopRequireDefault(__webpack_require__(/*! ./validators/isNodesEquivalent */ "./node_modules/@babel/types/lib/validators/isNodesEquivalent.js")); - -var _isPlaceholderType = _interopRequireDefault(__webpack_require__(/*! ./validators/isPlaceholderType */ "./node_modules/@babel/types/lib/validators/isPlaceholderType.js")); - -var _isReferenced = _interopRequireDefault(__webpack_require__(/*! ./validators/isReferenced */ "./node_modules/@babel/types/lib/validators/isReferenced.js")); - -var _isScope = _interopRequireDefault(__webpack_require__(/*! ./validators/isScope */ "./node_modules/@babel/types/lib/validators/isScope.js")); - -var _isSpecifierDefault = _interopRequireDefault(__webpack_require__(/*! ./validators/isSpecifierDefault */ "./node_modules/@babel/types/lib/validators/isSpecifierDefault.js")); - -var _isType = _interopRequireDefault(__webpack_require__(/*! ./validators/isType */ "./node_modules/@babel/types/lib/validators/isType.js")); - -var _isValidES3Identifier = _interopRequireDefault(__webpack_require__(/*! ./validators/isValidES3Identifier */ "./node_modules/@babel/types/lib/validators/isValidES3Identifier.js")); - -var _isValidIdentifier = _interopRequireDefault(__webpack_require__(/*! ./validators/isValidIdentifier */ "./node_modules/@babel/types/lib/validators/isValidIdentifier.js")); - -var _isVar = _interopRequireDefault(__webpack_require__(/*! ./validators/isVar */ "./node_modules/@babel/types/lib/validators/isVar.js")); - -var _matchesPattern = _interopRequireDefault(__webpack_require__(/*! ./validators/matchesPattern */ "./node_modules/@babel/types/lib/validators/matchesPattern.js")); - -var _validate = _interopRequireDefault(__webpack_require__(/*! ./validators/validate */ "./node_modules/@babel/types/lib/validators/validate.js")); - -var _buildMatchMemberExpression = _interopRequireDefault(__webpack_require__(/*! ./validators/buildMatchMemberExpression */ "./node_modules/@babel/types/lib/validators/buildMatchMemberExpression.js")); - -var _generated4 = __webpack_require__(/*! ./validators/generated */ "./node_modules/@babel/types/lib/validators/generated/index.js"); - -Object.keys(_generated4).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _generated4[key]; - } - }); -}); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -const react = { - isReactComponent: _isReactComponent.default, - isCompatTag: _isCompatTag.default, - buildChildren: _buildChildren.default -}; -exports.react = react; - -/***/ }), - -/***/ "./node_modules/@babel/types/lib/modifications/appendToMemberExpression.js": -/*!*********************************************************************************!*\ - !*** ./node_modules/@babel/types/lib/modifications/appendToMemberExpression.js ***! - \*********************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = appendToMemberExpression; - -var _generated = __webpack_require__(/*! ../builders/generated */ "./node_modules/@babel/types/lib/builders/generated/index.js"); - -function appendToMemberExpression(member, append, computed = false) { - member.object = (0, _generated.memberExpression)(member.object, member.property, member.computed); - member.property = append; - member.computed = !!computed; - return member; -} - -/***/ }), - -/***/ "./node_modules/@babel/types/lib/modifications/flow/removeTypeDuplicates.js": -/*!**********************************************************************************!*\ - !*** ./node_modules/@babel/types/lib/modifications/flow/removeTypeDuplicates.js ***! - \**********************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = removeTypeDuplicates; - -var _generated = __webpack_require__(/*! ../../validators/generated */ "./node_modules/@babel/types/lib/validators/generated/index.js"); - -function removeTypeDuplicates(nodes) { - const generics = {}; - const bases = {}; - const typeGroups = []; - const types = []; - - for (let i = 0; i < nodes.length; i++) { - const node = nodes[i]; - if (!node) continue; - - if (types.indexOf(node) >= 0) { - continue; - } - - if ((0, _generated.isAnyTypeAnnotation)(node)) { - return [node]; - } - - if ((0, _generated.isFlowBaseAnnotation)(node)) { - bases[node.type] = node; - continue; - } - - if ((0, _generated.isUnionTypeAnnotation)(node)) { - if (typeGroups.indexOf(node.types) < 0) { - nodes = nodes.concat(node.types); - typeGroups.push(node.types); - } - - continue; - } - - if ((0, _generated.isGenericTypeAnnotation)(node)) { - const name = node.id.name; - - if (generics[name]) { - let existing = generics[name]; - - if (existing.typeParameters) { - if (node.typeParameters) { - existing.typeParameters.params = removeTypeDuplicates(existing.typeParameters.params.concat(node.typeParameters.params)); - } - } else { - existing = node.typeParameters; - } - } else { - generics[name] = node; - } - - continue; - } - - types.push(node); - } - - for (const type of Object.keys(bases)) { - types.push(bases[type]); - } - - for (const name of Object.keys(generics)) { - types.push(generics[name]); - } - - return types; -} - -/***/ }), - -/***/ "./node_modules/@babel/types/lib/modifications/inherits.js": -/*!*****************************************************************!*\ - !*** ./node_modules/@babel/types/lib/modifications/inherits.js ***! - \*****************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = inherits; - -var _constants = __webpack_require__(/*! ../constants */ "./node_modules/@babel/types/lib/constants/index.js"); - -var _inheritsComments = _interopRequireDefault(__webpack_require__(/*! ../comments/inheritsComments */ "./node_modules/@babel/types/lib/comments/inheritsComments.js")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function inherits(child, parent) { - if (!child || !parent) return child; - - for (const key of _constants.INHERIT_KEYS.optional) { - if (child[key] == null) { - child[key] = parent[key]; - } - } - - for (const key of Object.keys(parent)) { - if (key[0] === "_" && key !== "__clone") child[key] = parent[key]; - } - - for (const key of _constants.INHERIT_KEYS.force) { - child[key] = parent[key]; - } - - (0, _inheritsComments.default)(child, parent); - return child; -} - -/***/ }), - -/***/ "./node_modules/@babel/types/lib/modifications/prependToMemberExpression.js": -/*!**********************************************************************************!*\ - !*** ./node_modules/@babel/types/lib/modifications/prependToMemberExpression.js ***! - \**********************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = prependToMemberExpression; - -var _generated = __webpack_require__(/*! ../builders/generated */ "./node_modules/@babel/types/lib/builders/generated/index.js"); - -function prependToMemberExpression(member, prepend) { - member.object = (0, _generated.memberExpression)(prepend, member.object); - return member; -} - -/***/ }), - -/***/ "./node_modules/@babel/types/lib/modifications/removeProperties.js": -/*!*************************************************************************!*\ - !*** ./node_modules/@babel/types/lib/modifications/removeProperties.js ***! - \*************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = removeProperties; - -var _constants = __webpack_require__(/*! ../constants */ "./node_modules/@babel/types/lib/constants/index.js"); - -const CLEAR_KEYS = ["tokens", "start", "end", "loc", "raw", "rawValue"]; - -const CLEAR_KEYS_PLUS_COMMENTS = _constants.COMMENT_KEYS.concat(["comments"]).concat(CLEAR_KEYS); - -function removeProperties(node, opts = {}) { - const map = opts.preserveComments ? CLEAR_KEYS : CLEAR_KEYS_PLUS_COMMENTS; - - for (const key of map) { - if (node[key] != null) node[key] = undefined; - } - - for (const key of Object.keys(node)) { - if (key[0] === "_" && node[key] != null) node[key] = undefined; - } - - const symbols = Object.getOwnPropertySymbols(node); - - for (const sym of symbols) { - node[sym] = null; - } -} - -/***/ }), - -/***/ "./node_modules/@babel/types/lib/modifications/removePropertiesDeep.js": -/*!*****************************************************************************!*\ - !*** ./node_modules/@babel/types/lib/modifications/removePropertiesDeep.js ***! - \*****************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = removePropertiesDeep; - -var _traverseFast = _interopRequireDefault(__webpack_require__(/*! ../traverse/traverseFast */ "./node_modules/@babel/types/lib/traverse/traverseFast.js")); - -var _removeProperties = _interopRequireDefault(__webpack_require__(/*! ./removeProperties */ "./node_modules/@babel/types/lib/modifications/removeProperties.js")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function removePropertiesDeep(tree, opts) { - (0, _traverseFast.default)(tree, _removeProperties.default, opts); - return tree; -} - -/***/ }), - -/***/ "./node_modules/@babel/types/lib/retrievers/getBindingIdentifiers.js": -/*!***************************************************************************!*\ - !*** ./node_modules/@babel/types/lib/retrievers/getBindingIdentifiers.js ***! - \***************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = getBindingIdentifiers; - -var _generated = __webpack_require__(/*! ../validators/generated */ "./node_modules/@babel/types/lib/validators/generated/index.js"); - -function getBindingIdentifiers(node, duplicates, outerOnly) { - let search = [].concat(node); - const ids = Object.create(null); - - while (search.length) { - const id = search.shift(); - if (!id) continue; - const keys = getBindingIdentifiers.keys[id.type]; - - if ((0, _generated.isIdentifier)(id)) { - if (duplicates) { - const _ids = ids[id.name] = ids[id.name] || []; - - _ids.push(id); - } else { - ids[id.name] = id; - } - - continue; - } - - if ((0, _generated.isExportDeclaration)(id)) { - if ((0, _generated.isDeclaration)(id.declaration)) { - search.push(id.declaration); - } - - continue; - } - - if (outerOnly) { - if ((0, _generated.isFunctionDeclaration)(id)) { - search.push(id.id); - continue; - } - - if ((0, _generated.isFunctionExpression)(id)) { - continue; - } - } - - if (keys) { - for (let i = 0; i < keys.length; i++) { - const key = keys[i]; - - if (id[key]) { - search = search.concat(id[key]); - } - } - } - } - - return ids; -} - -getBindingIdentifiers.keys = { - DeclareClass: ["id"], - DeclareFunction: ["id"], - DeclareModule: ["id"], - DeclareVariable: ["id"], - DeclareInterface: ["id"], - DeclareTypeAlias: ["id"], - DeclareOpaqueType: ["id"], - InterfaceDeclaration: ["id"], - TypeAlias: ["id"], - OpaqueType: ["id"], - CatchClause: ["param"], - LabeledStatement: ["label"], - UnaryExpression: ["argument"], - AssignmentExpression: ["left"], - ImportSpecifier: ["local"], - ImportNamespaceSpecifier: ["local"], - ImportDefaultSpecifier: ["local"], - ImportDeclaration: ["specifiers"], - ExportSpecifier: ["exported"], - ExportNamespaceSpecifier: ["exported"], - ExportDefaultSpecifier: ["exported"], - FunctionDeclaration: ["id", "params"], - FunctionExpression: ["id", "params"], - ArrowFunctionExpression: ["params"], - ObjectMethod: ["params"], - ClassMethod: ["params"], - ForInStatement: ["left"], - ForOfStatement: ["left"], - ClassDeclaration: ["id"], - ClassExpression: ["id"], - RestElement: ["argument"], - UpdateExpression: ["argument"], - ObjectProperty: ["value"], - AssignmentPattern: ["left"], - ArrayPattern: ["elements"], - ObjectPattern: ["properties"], - VariableDeclaration: ["declarations"], - VariableDeclarator: ["id"] -}; - -/***/ }), - -/***/ "./node_modules/@babel/types/lib/retrievers/getOuterBindingIdentifiers.js": -/*!********************************************************************************!*\ - !*** ./node_modules/@babel/types/lib/retrievers/getOuterBindingIdentifiers.js ***! - \********************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = getOuterBindingIdentifiers; - -var _getBindingIdentifiers = _interopRequireDefault(__webpack_require__(/*! ./getBindingIdentifiers */ "./node_modules/@babel/types/lib/retrievers/getBindingIdentifiers.js")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function getOuterBindingIdentifiers(node, duplicates) { - return (0, _getBindingIdentifiers.default)(node, duplicates, true); -} - -/***/ }), - -/***/ "./node_modules/@babel/types/lib/traverse/traverse.js": -/*!************************************************************!*\ - !*** ./node_modules/@babel/types/lib/traverse/traverse.js ***! - \************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = traverse; - -var _definitions = __webpack_require__(/*! ../definitions */ "./node_modules/@babel/types/lib/definitions/index.js"); - -function traverse(node, handlers, state) { - if (typeof handlers === "function") { - handlers = { - enter: handlers - }; - } - - const { - enter, - exit - } = handlers; - traverseSimpleImpl(node, enter, exit, state, []); -} - -function traverseSimpleImpl(node, enter, exit, state, ancestors) { - const keys = _definitions.VISITOR_KEYS[node.type]; - if (!keys) return; - if (enter) enter(node, ancestors, state); - - for (const key of keys) { - const subNode = node[key]; - - if (Array.isArray(subNode)) { - for (let i = 0; i < subNode.length; i++) { - const child = subNode[i]; - if (!child) continue; - ancestors.push({ - node, - key, - index: i - }); - traverseSimpleImpl(child, enter, exit, state, ancestors); - ancestors.pop(); - } - } else if (subNode) { - ancestors.push({ - node, - key - }); - traverseSimpleImpl(subNode, enter, exit, state, ancestors); - ancestors.pop(); - } - } - - if (exit) exit(node, ancestors, state); -} - -/***/ }), - -/***/ "./node_modules/@babel/types/lib/traverse/traverseFast.js": -/*!****************************************************************!*\ - !*** ./node_modules/@babel/types/lib/traverse/traverseFast.js ***! - \****************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = traverseFast; - -var _definitions = __webpack_require__(/*! ../definitions */ "./node_modules/@babel/types/lib/definitions/index.js"); - -function traverseFast(node, enter, opts) { - if (!node) return; - const keys = _definitions.VISITOR_KEYS[node.type]; - if (!keys) return; - opts = opts || {}; - enter(node, opts); - - for (const key of keys) { - const subNode = node[key]; - - if (Array.isArray(subNode)) { - for (const node of subNode) { - traverseFast(node, enter, opts); - } - } else { - traverseFast(subNode, enter, opts); - } - } -} - -/***/ }), - -/***/ "./node_modules/@babel/types/lib/utils/inherit.js": -/*!********************************************************!*\ - !*** ./node_modules/@babel/types/lib/utils/inherit.js ***! - \********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = inherit; - -function _uniq() { - const data = _interopRequireDefault(__webpack_require__(/*! lodash/uniq */ "./node_modules/lodash/uniq.js")); - - _uniq = function () { - return data; - }; - - return data; -} - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function inherit(key, child, parent) { - if (child && parent) { - child[key] = (0, _uniq().default)([].concat(child[key], parent[key]).filter(Boolean)); - } -} - -/***/ }), - -/***/ "./node_modules/@babel/types/lib/utils/react/cleanJSXElementLiteralChild.js": -/*!**********************************************************************************!*\ - !*** ./node_modules/@babel/types/lib/utils/react/cleanJSXElementLiteralChild.js ***! - \**********************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = cleanJSXElementLiteralChild; - -var _generated = __webpack_require__(/*! ../../builders/generated */ "./node_modules/@babel/types/lib/builders/generated/index.js"); - -function cleanJSXElementLiteralChild(child, args) { - const lines = child.value.split(/\r\n|\n|\r/); - let lastNonEmptyLine = 0; - - for (let i = 0; i < lines.length; i++) { - if (lines[i].match(/[^ \t]/)) { - lastNonEmptyLine = i; - } - } - - let str = ""; - - for (let i = 0; i < lines.length; i++) { - const line = lines[i]; - const isFirstLine = i === 0; - const isLastLine = i === lines.length - 1; - const isLastNonEmptyLine = i === lastNonEmptyLine; - let trimmedLine = line.replace(/\t/g, " "); - - if (!isFirstLine) { - trimmedLine = trimmedLine.replace(/^[ ]+/, ""); - } - - if (!isLastLine) { - trimmedLine = trimmedLine.replace(/[ ]+$/, ""); - } - - if (trimmedLine) { - if (!isLastNonEmptyLine) { - trimmedLine += " "; - } - - str += trimmedLine; - } - } - - if (str) args.push((0, _generated.stringLiteral)(str)); -} - -/***/ }), - -/***/ "./node_modules/@babel/types/lib/utils/shallowEqual.js": -/*!*************************************************************!*\ - !*** ./node_modules/@babel/types/lib/utils/shallowEqual.js ***! - \*************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = shallowEqual; - -function shallowEqual(actual, expected) { - const keys = Object.keys(expected); - - for (const key of keys) { - if (actual[key] !== expected[key]) { - return false; - } - } - - return true; -} - -/***/ }), - -/***/ "./node_modules/@babel/types/lib/validators/buildMatchMemberExpression.js": -/*!********************************************************************************!*\ - !*** ./node_modules/@babel/types/lib/validators/buildMatchMemberExpression.js ***! - \********************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = buildMatchMemberExpression; - -var _matchesPattern = _interopRequireDefault(__webpack_require__(/*! ./matchesPattern */ "./node_modules/@babel/types/lib/validators/matchesPattern.js")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function buildMatchMemberExpression(match, allowPartial) { - const parts = match.split("."); - return member => (0, _matchesPattern.default)(member, parts, allowPartial); -} - -/***/ }), - -/***/ "./node_modules/@babel/types/lib/validators/generated/index.js": -/*!*********************************************************************!*\ - !*** ./node_modules/@babel/types/lib/validators/generated/index.js ***! - \*********************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.isArrayExpression = isArrayExpression; -exports.isAssignmentExpression = isAssignmentExpression; -exports.isBinaryExpression = isBinaryExpression; -exports.isInterpreterDirective = isInterpreterDirective; -exports.isDirective = isDirective; -exports.isDirectiveLiteral = isDirectiveLiteral; -exports.isBlockStatement = isBlockStatement; -exports.isBreakStatement = isBreakStatement; -exports.isCallExpression = isCallExpression; -exports.isCatchClause = isCatchClause; -exports.isConditionalExpression = isConditionalExpression; -exports.isContinueStatement = isContinueStatement; -exports.isDebuggerStatement = isDebuggerStatement; -exports.isDoWhileStatement = isDoWhileStatement; -exports.isEmptyStatement = isEmptyStatement; -exports.isExpressionStatement = isExpressionStatement; -exports.isFile = isFile; -exports.isForInStatement = isForInStatement; -exports.isForStatement = isForStatement; -exports.isFunctionDeclaration = isFunctionDeclaration; -exports.isFunctionExpression = isFunctionExpression; -exports.isIdentifier = isIdentifier; -exports.isIfStatement = isIfStatement; -exports.isLabeledStatement = isLabeledStatement; -exports.isStringLiteral = isStringLiteral; -exports.isNumericLiteral = isNumericLiteral; -exports.isNullLiteral = isNullLiteral; -exports.isBooleanLiteral = isBooleanLiteral; -exports.isRegExpLiteral = isRegExpLiteral; -exports.isLogicalExpression = isLogicalExpression; -exports.isMemberExpression = isMemberExpression; -exports.isNewExpression = isNewExpression; -exports.isProgram = isProgram; -exports.isObjectExpression = isObjectExpression; -exports.isObjectMethod = isObjectMethod; -exports.isObjectProperty = isObjectProperty; -exports.isRestElement = isRestElement; -exports.isReturnStatement = isReturnStatement; -exports.isSequenceExpression = isSequenceExpression; -exports.isParenthesizedExpression = isParenthesizedExpression; -exports.isSwitchCase = isSwitchCase; -exports.isSwitchStatement = isSwitchStatement; -exports.isThisExpression = isThisExpression; -exports.isThrowStatement = isThrowStatement; -exports.isTryStatement = isTryStatement; -exports.isUnaryExpression = isUnaryExpression; -exports.isUpdateExpression = isUpdateExpression; -exports.isVariableDeclaration = isVariableDeclaration; -exports.isVariableDeclarator = isVariableDeclarator; -exports.isWhileStatement = isWhileStatement; -exports.isWithStatement = isWithStatement; -exports.isAssignmentPattern = isAssignmentPattern; -exports.isArrayPattern = isArrayPattern; -exports.isArrowFunctionExpression = isArrowFunctionExpression; -exports.isClassBody = isClassBody; -exports.isClassDeclaration = isClassDeclaration; -exports.isClassExpression = isClassExpression; -exports.isExportAllDeclaration = isExportAllDeclaration; -exports.isExportDefaultDeclaration = isExportDefaultDeclaration; -exports.isExportNamedDeclaration = isExportNamedDeclaration; -exports.isExportSpecifier = isExportSpecifier; -exports.isForOfStatement = isForOfStatement; -exports.isImportDeclaration = isImportDeclaration; -exports.isImportDefaultSpecifier = isImportDefaultSpecifier; -exports.isImportNamespaceSpecifier = isImportNamespaceSpecifier; -exports.isImportSpecifier = isImportSpecifier; -exports.isMetaProperty = isMetaProperty; -exports.isClassMethod = isClassMethod; -exports.isObjectPattern = isObjectPattern; -exports.isSpreadElement = isSpreadElement; -exports.isSuper = isSuper; -exports.isTaggedTemplateExpression = isTaggedTemplateExpression; -exports.isTemplateElement = isTemplateElement; -exports.isTemplateLiteral = isTemplateLiteral; -exports.isYieldExpression = isYieldExpression; -exports.isAnyTypeAnnotation = isAnyTypeAnnotation; -exports.isArrayTypeAnnotation = isArrayTypeAnnotation; -exports.isBooleanTypeAnnotation = isBooleanTypeAnnotation; -exports.isBooleanLiteralTypeAnnotation = isBooleanLiteralTypeAnnotation; -exports.isNullLiteralTypeAnnotation = isNullLiteralTypeAnnotation; -exports.isClassImplements = isClassImplements; -exports.isDeclareClass = isDeclareClass; -exports.isDeclareFunction = isDeclareFunction; -exports.isDeclareInterface = isDeclareInterface; -exports.isDeclareModule = isDeclareModule; -exports.isDeclareModuleExports = isDeclareModuleExports; -exports.isDeclareTypeAlias = isDeclareTypeAlias; -exports.isDeclareOpaqueType = isDeclareOpaqueType; -exports.isDeclareVariable = isDeclareVariable; -exports.isDeclareExportDeclaration = isDeclareExportDeclaration; -exports.isDeclareExportAllDeclaration = isDeclareExportAllDeclaration; -exports.isDeclaredPredicate = isDeclaredPredicate; -exports.isExistsTypeAnnotation = isExistsTypeAnnotation; -exports.isFunctionTypeAnnotation = isFunctionTypeAnnotation; -exports.isFunctionTypeParam = isFunctionTypeParam; -exports.isGenericTypeAnnotation = isGenericTypeAnnotation; -exports.isInferredPredicate = isInferredPredicate; -exports.isInterfaceExtends = isInterfaceExtends; -exports.isInterfaceDeclaration = isInterfaceDeclaration; -exports.isInterfaceTypeAnnotation = isInterfaceTypeAnnotation; -exports.isIntersectionTypeAnnotation = isIntersectionTypeAnnotation; -exports.isMixedTypeAnnotation = isMixedTypeAnnotation; -exports.isEmptyTypeAnnotation = isEmptyTypeAnnotation; -exports.isNullableTypeAnnotation = isNullableTypeAnnotation; -exports.isNumberLiteralTypeAnnotation = isNumberLiteralTypeAnnotation; -exports.isNumberTypeAnnotation = isNumberTypeAnnotation; -exports.isObjectTypeAnnotation = isObjectTypeAnnotation; -exports.isObjectTypeInternalSlot = isObjectTypeInternalSlot; -exports.isObjectTypeCallProperty = isObjectTypeCallProperty; -exports.isObjectTypeIndexer = isObjectTypeIndexer; -exports.isObjectTypeProperty = isObjectTypeProperty; -exports.isObjectTypeSpreadProperty = isObjectTypeSpreadProperty; -exports.isOpaqueType = isOpaqueType; -exports.isQualifiedTypeIdentifier = isQualifiedTypeIdentifier; -exports.isStringLiteralTypeAnnotation = isStringLiteralTypeAnnotation; -exports.isStringTypeAnnotation = isStringTypeAnnotation; -exports.isThisTypeAnnotation = isThisTypeAnnotation; -exports.isTupleTypeAnnotation = isTupleTypeAnnotation; -exports.isTypeofTypeAnnotation = isTypeofTypeAnnotation; -exports.isTypeAlias = isTypeAlias; -exports.isTypeAnnotation = isTypeAnnotation; -exports.isTypeCastExpression = isTypeCastExpression; -exports.isTypeParameter = isTypeParameter; -exports.isTypeParameterDeclaration = isTypeParameterDeclaration; -exports.isTypeParameterInstantiation = isTypeParameterInstantiation; -exports.isUnionTypeAnnotation = isUnionTypeAnnotation; -exports.isVariance = isVariance; -exports.isVoidTypeAnnotation = isVoidTypeAnnotation; -exports.isJSXAttribute = isJSXAttribute; -exports.isJSXClosingElement = isJSXClosingElement; -exports.isJSXElement = isJSXElement; -exports.isJSXEmptyExpression = isJSXEmptyExpression; -exports.isJSXExpressionContainer = isJSXExpressionContainer; -exports.isJSXSpreadChild = isJSXSpreadChild; -exports.isJSXIdentifier = isJSXIdentifier; -exports.isJSXMemberExpression = isJSXMemberExpression; -exports.isJSXNamespacedName = isJSXNamespacedName; -exports.isJSXOpeningElement = isJSXOpeningElement; -exports.isJSXSpreadAttribute = isJSXSpreadAttribute; -exports.isJSXText = isJSXText; -exports.isJSXFragment = isJSXFragment; -exports.isJSXOpeningFragment = isJSXOpeningFragment; -exports.isJSXClosingFragment = isJSXClosingFragment; -exports.isNoop = isNoop; -exports.isPlaceholder = isPlaceholder; -exports.isArgumentPlaceholder = isArgumentPlaceholder; -exports.isAwaitExpression = isAwaitExpression; -exports.isBindExpression = isBindExpression; -exports.isClassProperty = isClassProperty; -exports.isOptionalMemberExpression = isOptionalMemberExpression; -exports.isPipelineTopicExpression = isPipelineTopicExpression; -exports.isPipelineBareFunction = isPipelineBareFunction; -exports.isPipelinePrimaryTopicReference = isPipelinePrimaryTopicReference; -exports.isOptionalCallExpression = isOptionalCallExpression; -exports.isClassPrivateProperty = isClassPrivateProperty; -exports.isClassPrivateMethod = isClassPrivateMethod; -exports.isImport = isImport; -exports.isDecorator = isDecorator; -exports.isDoExpression = isDoExpression; -exports.isExportDefaultSpecifier = isExportDefaultSpecifier; -exports.isExportNamespaceSpecifier = isExportNamespaceSpecifier; -exports.isPrivateName = isPrivateName; -exports.isBigIntLiteral = isBigIntLiteral; -exports.isTSParameterProperty = isTSParameterProperty; -exports.isTSDeclareFunction = isTSDeclareFunction; -exports.isTSDeclareMethod = isTSDeclareMethod; -exports.isTSQualifiedName = isTSQualifiedName; -exports.isTSCallSignatureDeclaration = isTSCallSignatureDeclaration; -exports.isTSConstructSignatureDeclaration = isTSConstructSignatureDeclaration; -exports.isTSPropertySignature = isTSPropertySignature; -exports.isTSMethodSignature = isTSMethodSignature; -exports.isTSIndexSignature = isTSIndexSignature; -exports.isTSAnyKeyword = isTSAnyKeyword; -exports.isTSUnknownKeyword = isTSUnknownKeyword; -exports.isTSNumberKeyword = isTSNumberKeyword; -exports.isTSObjectKeyword = isTSObjectKeyword; -exports.isTSBooleanKeyword = isTSBooleanKeyword; -exports.isTSStringKeyword = isTSStringKeyword; -exports.isTSSymbolKeyword = isTSSymbolKeyword; -exports.isTSVoidKeyword = isTSVoidKeyword; -exports.isTSUndefinedKeyword = isTSUndefinedKeyword; -exports.isTSNullKeyword = isTSNullKeyword; -exports.isTSNeverKeyword = isTSNeverKeyword; -exports.isTSThisType = isTSThisType; -exports.isTSFunctionType = isTSFunctionType; -exports.isTSConstructorType = isTSConstructorType; -exports.isTSTypeReference = isTSTypeReference; -exports.isTSTypePredicate = isTSTypePredicate; -exports.isTSTypeQuery = isTSTypeQuery; -exports.isTSTypeLiteral = isTSTypeLiteral; -exports.isTSArrayType = isTSArrayType; -exports.isTSTupleType = isTSTupleType; -exports.isTSOptionalType = isTSOptionalType; -exports.isTSRestType = isTSRestType; -exports.isTSUnionType = isTSUnionType; -exports.isTSIntersectionType = isTSIntersectionType; -exports.isTSConditionalType = isTSConditionalType; -exports.isTSInferType = isTSInferType; -exports.isTSParenthesizedType = isTSParenthesizedType; -exports.isTSTypeOperator = isTSTypeOperator; -exports.isTSIndexedAccessType = isTSIndexedAccessType; -exports.isTSMappedType = isTSMappedType; -exports.isTSLiteralType = isTSLiteralType; -exports.isTSExpressionWithTypeArguments = isTSExpressionWithTypeArguments; -exports.isTSInterfaceDeclaration = isTSInterfaceDeclaration; -exports.isTSInterfaceBody = isTSInterfaceBody; -exports.isTSTypeAliasDeclaration = isTSTypeAliasDeclaration; -exports.isTSAsExpression = isTSAsExpression; -exports.isTSTypeAssertion = isTSTypeAssertion; -exports.isTSEnumDeclaration = isTSEnumDeclaration; -exports.isTSEnumMember = isTSEnumMember; -exports.isTSModuleDeclaration = isTSModuleDeclaration; -exports.isTSModuleBlock = isTSModuleBlock; -exports.isTSImportType = isTSImportType; -exports.isTSImportEqualsDeclaration = isTSImportEqualsDeclaration; -exports.isTSExternalModuleReference = isTSExternalModuleReference; -exports.isTSNonNullExpression = isTSNonNullExpression; -exports.isTSExportAssignment = isTSExportAssignment; -exports.isTSNamespaceExportDeclaration = isTSNamespaceExportDeclaration; -exports.isTSTypeAnnotation = isTSTypeAnnotation; -exports.isTSTypeParameterInstantiation = isTSTypeParameterInstantiation; -exports.isTSTypeParameterDeclaration = isTSTypeParameterDeclaration; -exports.isTSTypeParameter = isTSTypeParameter; -exports.isExpression = isExpression; -exports.isBinary = isBinary; -exports.isScopable = isScopable; -exports.isBlockParent = isBlockParent; -exports.isBlock = isBlock; -exports.isStatement = isStatement; -exports.isTerminatorless = isTerminatorless; -exports.isCompletionStatement = isCompletionStatement; -exports.isConditional = isConditional; -exports.isLoop = isLoop; -exports.isWhile = isWhile; -exports.isExpressionWrapper = isExpressionWrapper; -exports.isFor = isFor; -exports.isForXStatement = isForXStatement; -exports.isFunction = isFunction; -exports.isFunctionParent = isFunctionParent; -exports.isPureish = isPureish; -exports.isDeclaration = isDeclaration; -exports.isPatternLike = isPatternLike; -exports.isLVal = isLVal; -exports.isTSEntityName = isTSEntityName; -exports.isLiteral = isLiteral; -exports.isImmutable = isImmutable; -exports.isUserWhitespacable = isUserWhitespacable; -exports.isMethod = isMethod; -exports.isObjectMember = isObjectMember; -exports.isProperty = isProperty; -exports.isUnaryLike = isUnaryLike; -exports.isPattern = isPattern; -exports.isClass = isClass; -exports.isModuleDeclaration = isModuleDeclaration; -exports.isExportDeclaration = isExportDeclaration; -exports.isModuleSpecifier = isModuleSpecifier; -exports.isFlow = isFlow; -exports.isFlowType = isFlowType; -exports.isFlowBaseAnnotation = isFlowBaseAnnotation; -exports.isFlowDeclaration = isFlowDeclaration; -exports.isFlowPredicate = isFlowPredicate; -exports.isJSX = isJSX; -exports.isPrivate = isPrivate; -exports.isTSTypeElement = isTSTypeElement; -exports.isTSType = isTSType; -exports.isNumberLiteral = isNumberLiteral; -exports.isRegexLiteral = isRegexLiteral; -exports.isRestProperty = isRestProperty; -exports.isSpreadProperty = isSpreadProperty; - -var _shallowEqual = _interopRequireDefault(__webpack_require__(/*! ../../utils/shallowEqual */ "./node_modules/@babel/types/lib/utils/shallowEqual.js")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function isArrayExpression(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "ArrayExpression") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isAssignmentExpression(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "AssignmentExpression") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isBinaryExpression(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "BinaryExpression") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isInterpreterDirective(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "InterpreterDirective") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isDirective(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "Directive") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isDirectiveLiteral(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "DirectiveLiteral") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isBlockStatement(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "BlockStatement") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isBreakStatement(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "BreakStatement") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isCallExpression(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "CallExpression") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isCatchClause(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "CatchClause") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isConditionalExpression(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "ConditionalExpression") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isContinueStatement(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "ContinueStatement") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isDebuggerStatement(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "DebuggerStatement") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isDoWhileStatement(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "DoWhileStatement") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isEmptyStatement(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "EmptyStatement") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isExpressionStatement(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "ExpressionStatement") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isFile(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "File") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isForInStatement(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "ForInStatement") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isForStatement(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "ForStatement") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isFunctionDeclaration(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "FunctionDeclaration") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isFunctionExpression(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "FunctionExpression") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isIdentifier(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "Identifier") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isIfStatement(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "IfStatement") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isLabeledStatement(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "LabeledStatement") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isStringLiteral(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "StringLiteral") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isNumericLiteral(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "NumericLiteral") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isNullLiteral(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "NullLiteral") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isBooleanLiteral(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "BooleanLiteral") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isRegExpLiteral(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "RegExpLiteral") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isLogicalExpression(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "LogicalExpression") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isMemberExpression(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "MemberExpression") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isNewExpression(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "NewExpression") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isProgram(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "Program") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isObjectExpression(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "ObjectExpression") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isObjectMethod(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "ObjectMethod") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isObjectProperty(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "ObjectProperty") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isRestElement(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "RestElement") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isReturnStatement(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "ReturnStatement") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isSequenceExpression(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "SequenceExpression") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isParenthesizedExpression(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "ParenthesizedExpression") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isSwitchCase(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "SwitchCase") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isSwitchStatement(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "SwitchStatement") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isThisExpression(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "ThisExpression") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isThrowStatement(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "ThrowStatement") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTryStatement(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TryStatement") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isUnaryExpression(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "UnaryExpression") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isUpdateExpression(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "UpdateExpression") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isVariableDeclaration(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "VariableDeclaration") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isVariableDeclarator(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "VariableDeclarator") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isWhileStatement(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "WhileStatement") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isWithStatement(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "WithStatement") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isAssignmentPattern(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "AssignmentPattern") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isArrayPattern(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "ArrayPattern") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isArrowFunctionExpression(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "ArrowFunctionExpression") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isClassBody(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "ClassBody") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isClassDeclaration(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "ClassDeclaration") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isClassExpression(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "ClassExpression") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isExportAllDeclaration(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "ExportAllDeclaration") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isExportDefaultDeclaration(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "ExportDefaultDeclaration") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isExportNamedDeclaration(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "ExportNamedDeclaration") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isExportSpecifier(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "ExportSpecifier") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isForOfStatement(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "ForOfStatement") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isImportDeclaration(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "ImportDeclaration") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isImportDefaultSpecifier(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "ImportDefaultSpecifier") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isImportNamespaceSpecifier(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "ImportNamespaceSpecifier") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isImportSpecifier(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "ImportSpecifier") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isMetaProperty(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "MetaProperty") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isClassMethod(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "ClassMethod") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isObjectPattern(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "ObjectPattern") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isSpreadElement(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "SpreadElement") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isSuper(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "Super") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTaggedTemplateExpression(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TaggedTemplateExpression") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTemplateElement(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TemplateElement") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTemplateLiteral(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TemplateLiteral") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isYieldExpression(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "YieldExpression") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isAnyTypeAnnotation(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "AnyTypeAnnotation") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isArrayTypeAnnotation(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "ArrayTypeAnnotation") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isBooleanTypeAnnotation(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "BooleanTypeAnnotation") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isBooleanLiteralTypeAnnotation(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "BooleanLiteralTypeAnnotation") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isNullLiteralTypeAnnotation(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "NullLiteralTypeAnnotation") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isClassImplements(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "ClassImplements") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isDeclareClass(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "DeclareClass") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isDeclareFunction(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "DeclareFunction") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isDeclareInterface(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "DeclareInterface") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isDeclareModule(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "DeclareModule") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isDeclareModuleExports(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "DeclareModuleExports") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isDeclareTypeAlias(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "DeclareTypeAlias") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isDeclareOpaqueType(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "DeclareOpaqueType") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isDeclareVariable(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "DeclareVariable") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isDeclareExportDeclaration(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "DeclareExportDeclaration") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isDeclareExportAllDeclaration(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "DeclareExportAllDeclaration") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isDeclaredPredicate(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "DeclaredPredicate") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isExistsTypeAnnotation(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "ExistsTypeAnnotation") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isFunctionTypeAnnotation(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "FunctionTypeAnnotation") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isFunctionTypeParam(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "FunctionTypeParam") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isGenericTypeAnnotation(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "GenericTypeAnnotation") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isInferredPredicate(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "InferredPredicate") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isInterfaceExtends(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "InterfaceExtends") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isInterfaceDeclaration(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "InterfaceDeclaration") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isInterfaceTypeAnnotation(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "InterfaceTypeAnnotation") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isIntersectionTypeAnnotation(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "IntersectionTypeAnnotation") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isMixedTypeAnnotation(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "MixedTypeAnnotation") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isEmptyTypeAnnotation(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "EmptyTypeAnnotation") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isNullableTypeAnnotation(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "NullableTypeAnnotation") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isNumberLiteralTypeAnnotation(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "NumberLiteralTypeAnnotation") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isNumberTypeAnnotation(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "NumberTypeAnnotation") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isObjectTypeAnnotation(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "ObjectTypeAnnotation") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isObjectTypeInternalSlot(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "ObjectTypeInternalSlot") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isObjectTypeCallProperty(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "ObjectTypeCallProperty") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isObjectTypeIndexer(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "ObjectTypeIndexer") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isObjectTypeProperty(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "ObjectTypeProperty") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isObjectTypeSpreadProperty(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "ObjectTypeSpreadProperty") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isOpaqueType(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "OpaqueType") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isQualifiedTypeIdentifier(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "QualifiedTypeIdentifier") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isStringLiteralTypeAnnotation(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "StringLiteralTypeAnnotation") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isStringTypeAnnotation(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "StringTypeAnnotation") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isThisTypeAnnotation(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "ThisTypeAnnotation") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTupleTypeAnnotation(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TupleTypeAnnotation") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTypeofTypeAnnotation(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TypeofTypeAnnotation") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTypeAlias(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TypeAlias") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTypeAnnotation(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TypeAnnotation") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTypeCastExpression(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TypeCastExpression") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTypeParameter(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TypeParameter") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTypeParameterDeclaration(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TypeParameterDeclaration") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTypeParameterInstantiation(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TypeParameterInstantiation") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isUnionTypeAnnotation(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "UnionTypeAnnotation") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isVariance(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "Variance") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isVoidTypeAnnotation(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "VoidTypeAnnotation") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isJSXAttribute(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "JSXAttribute") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isJSXClosingElement(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "JSXClosingElement") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isJSXElement(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "JSXElement") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isJSXEmptyExpression(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "JSXEmptyExpression") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isJSXExpressionContainer(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "JSXExpressionContainer") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isJSXSpreadChild(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "JSXSpreadChild") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isJSXIdentifier(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "JSXIdentifier") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isJSXMemberExpression(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "JSXMemberExpression") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isJSXNamespacedName(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "JSXNamespacedName") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isJSXOpeningElement(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "JSXOpeningElement") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isJSXSpreadAttribute(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "JSXSpreadAttribute") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isJSXText(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "JSXText") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isJSXFragment(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "JSXFragment") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isJSXOpeningFragment(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "JSXOpeningFragment") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isJSXClosingFragment(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "JSXClosingFragment") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isNoop(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "Noop") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isPlaceholder(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "Placeholder") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isArgumentPlaceholder(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "ArgumentPlaceholder") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isAwaitExpression(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "AwaitExpression") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isBindExpression(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "BindExpression") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isClassProperty(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "ClassProperty") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isOptionalMemberExpression(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "OptionalMemberExpression") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isPipelineTopicExpression(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "PipelineTopicExpression") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isPipelineBareFunction(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "PipelineBareFunction") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isPipelinePrimaryTopicReference(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "PipelinePrimaryTopicReference") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isOptionalCallExpression(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "OptionalCallExpression") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isClassPrivateProperty(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "ClassPrivateProperty") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isClassPrivateMethod(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "ClassPrivateMethod") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isImport(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "Import") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isDecorator(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "Decorator") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isDoExpression(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "DoExpression") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isExportDefaultSpecifier(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "ExportDefaultSpecifier") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isExportNamespaceSpecifier(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "ExportNamespaceSpecifier") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isPrivateName(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "PrivateName") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isBigIntLiteral(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "BigIntLiteral") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSParameterProperty(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TSParameterProperty") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSDeclareFunction(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TSDeclareFunction") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSDeclareMethod(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TSDeclareMethod") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSQualifiedName(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TSQualifiedName") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSCallSignatureDeclaration(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TSCallSignatureDeclaration") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSConstructSignatureDeclaration(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TSConstructSignatureDeclaration") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSPropertySignature(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TSPropertySignature") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSMethodSignature(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TSMethodSignature") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSIndexSignature(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TSIndexSignature") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSAnyKeyword(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TSAnyKeyword") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSUnknownKeyword(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TSUnknownKeyword") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSNumberKeyword(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TSNumberKeyword") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSObjectKeyword(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TSObjectKeyword") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSBooleanKeyword(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TSBooleanKeyword") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSStringKeyword(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TSStringKeyword") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSSymbolKeyword(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TSSymbolKeyword") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSVoidKeyword(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TSVoidKeyword") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSUndefinedKeyword(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TSUndefinedKeyword") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSNullKeyword(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TSNullKeyword") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSNeverKeyword(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TSNeverKeyword") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSThisType(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TSThisType") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSFunctionType(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TSFunctionType") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSConstructorType(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TSConstructorType") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSTypeReference(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TSTypeReference") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSTypePredicate(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TSTypePredicate") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSTypeQuery(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TSTypeQuery") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSTypeLiteral(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TSTypeLiteral") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSArrayType(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TSArrayType") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSTupleType(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TSTupleType") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSOptionalType(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TSOptionalType") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSRestType(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TSRestType") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSUnionType(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TSUnionType") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSIntersectionType(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TSIntersectionType") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSConditionalType(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TSConditionalType") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSInferType(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TSInferType") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSParenthesizedType(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TSParenthesizedType") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSTypeOperator(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TSTypeOperator") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSIndexedAccessType(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TSIndexedAccessType") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSMappedType(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TSMappedType") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSLiteralType(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TSLiteralType") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSExpressionWithTypeArguments(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TSExpressionWithTypeArguments") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSInterfaceDeclaration(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TSInterfaceDeclaration") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSInterfaceBody(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TSInterfaceBody") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSTypeAliasDeclaration(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TSTypeAliasDeclaration") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSAsExpression(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TSAsExpression") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSTypeAssertion(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TSTypeAssertion") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSEnumDeclaration(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TSEnumDeclaration") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSEnumMember(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TSEnumMember") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSModuleDeclaration(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TSModuleDeclaration") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSModuleBlock(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TSModuleBlock") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSImportType(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TSImportType") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSImportEqualsDeclaration(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TSImportEqualsDeclaration") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSExternalModuleReference(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TSExternalModuleReference") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSNonNullExpression(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TSNonNullExpression") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSExportAssignment(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TSExportAssignment") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSNamespaceExportDeclaration(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TSNamespaceExportDeclaration") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSTypeAnnotation(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TSTypeAnnotation") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSTypeParameterInstantiation(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TSTypeParameterInstantiation") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSTypeParameterDeclaration(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TSTypeParameterDeclaration") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSTypeParameter(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TSTypeParameter") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isExpression(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "Expression" || "ArrayExpression" === nodeType || "AssignmentExpression" === nodeType || "BinaryExpression" === nodeType || "CallExpression" === nodeType || "ConditionalExpression" === nodeType || "FunctionExpression" === nodeType || "Identifier" === nodeType || "StringLiteral" === nodeType || "NumericLiteral" === nodeType || "NullLiteral" === nodeType || "BooleanLiteral" === nodeType || "RegExpLiteral" === nodeType || "LogicalExpression" === nodeType || "MemberExpression" === nodeType || "NewExpression" === nodeType || "ObjectExpression" === nodeType || "SequenceExpression" === nodeType || "ParenthesizedExpression" === nodeType || "ThisExpression" === nodeType || "UnaryExpression" === nodeType || "UpdateExpression" === nodeType || "ArrowFunctionExpression" === nodeType || "ClassExpression" === nodeType || "MetaProperty" === nodeType || "Super" === nodeType || "TaggedTemplateExpression" === nodeType || "TemplateLiteral" === nodeType || "YieldExpression" === nodeType || "TypeCastExpression" === nodeType || "JSXElement" === nodeType || "JSXFragment" === nodeType || "AwaitExpression" === nodeType || "BindExpression" === nodeType || "OptionalMemberExpression" === nodeType || "PipelinePrimaryTopicReference" === nodeType || "OptionalCallExpression" === nodeType || "Import" === nodeType || "DoExpression" === nodeType || "BigIntLiteral" === nodeType || "TSAsExpression" === nodeType || "TSTypeAssertion" === nodeType || "TSNonNullExpression" === nodeType || nodeType === "Placeholder" && ("Expression" === node.expectedNode || "Identifier" === node.expectedNode || "StringLiteral" === node.expectedNode)) { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isBinary(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "Binary" || "BinaryExpression" === nodeType || "LogicalExpression" === nodeType) { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isScopable(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "Scopable" || "BlockStatement" === nodeType || "CatchClause" === nodeType || "DoWhileStatement" === nodeType || "ForInStatement" === nodeType || "ForStatement" === nodeType || "FunctionDeclaration" === nodeType || "FunctionExpression" === nodeType || "Program" === nodeType || "ObjectMethod" === nodeType || "SwitchStatement" === nodeType || "WhileStatement" === nodeType || "ArrowFunctionExpression" === nodeType || "ClassDeclaration" === nodeType || "ClassExpression" === nodeType || "ForOfStatement" === nodeType || "ClassMethod" === nodeType || "ClassPrivateMethod" === nodeType || "TSModuleBlock" === nodeType || nodeType === "Placeholder" && "BlockStatement" === node.expectedNode) { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isBlockParent(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "BlockParent" || "BlockStatement" === nodeType || "CatchClause" === nodeType || "DoWhileStatement" === nodeType || "ForInStatement" === nodeType || "ForStatement" === nodeType || "FunctionDeclaration" === nodeType || "FunctionExpression" === nodeType || "Program" === nodeType || "ObjectMethod" === nodeType || "SwitchStatement" === nodeType || "WhileStatement" === nodeType || "ArrowFunctionExpression" === nodeType || "ForOfStatement" === nodeType || "ClassMethod" === nodeType || "ClassPrivateMethod" === nodeType || "TSModuleBlock" === nodeType || nodeType === "Placeholder" && "BlockStatement" === node.expectedNode) { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isBlock(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "Block" || "BlockStatement" === nodeType || "Program" === nodeType || "TSModuleBlock" === nodeType || nodeType === "Placeholder" && "BlockStatement" === node.expectedNode) { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isStatement(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "Statement" || "BlockStatement" === nodeType || "BreakStatement" === nodeType || "ContinueStatement" === nodeType || "DebuggerStatement" === nodeType || "DoWhileStatement" === nodeType || "EmptyStatement" === nodeType || "ExpressionStatement" === nodeType || "ForInStatement" === nodeType || "ForStatement" === nodeType || "FunctionDeclaration" === nodeType || "IfStatement" === nodeType || "LabeledStatement" === nodeType || "ReturnStatement" === nodeType || "SwitchStatement" === nodeType || "ThrowStatement" === nodeType || "TryStatement" === nodeType || "VariableDeclaration" === nodeType || "WhileStatement" === nodeType || "WithStatement" === nodeType || "ClassDeclaration" === nodeType || "ExportAllDeclaration" === nodeType || "ExportDefaultDeclaration" === nodeType || "ExportNamedDeclaration" === nodeType || "ForOfStatement" === nodeType || "ImportDeclaration" === nodeType || "DeclareClass" === nodeType || "DeclareFunction" === nodeType || "DeclareInterface" === nodeType || "DeclareModule" === nodeType || "DeclareModuleExports" === nodeType || "DeclareTypeAlias" === nodeType || "DeclareOpaqueType" === nodeType || "DeclareVariable" === nodeType || "DeclareExportDeclaration" === nodeType || "DeclareExportAllDeclaration" === nodeType || "InterfaceDeclaration" === nodeType || "OpaqueType" === nodeType || "TypeAlias" === nodeType || "TSDeclareFunction" === nodeType || "TSInterfaceDeclaration" === nodeType || "TSTypeAliasDeclaration" === nodeType || "TSEnumDeclaration" === nodeType || "TSModuleDeclaration" === nodeType || "TSImportEqualsDeclaration" === nodeType || "TSExportAssignment" === nodeType || "TSNamespaceExportDeclaration" === nodeType || nodeType === "Placeholder" && ("Statement" === node.expectedNode || "Declaration" === node.expectedNode || "BlockStatement" === node.expectedNode)) { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTerminatorless(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "Terminatorless" || "BreakStatement" === nodeType || "ContinueStatement" === nodeType || "ReturnStatement" === nodeType || "ThrowStatement" === nodeType || "YieldExpression" === nodeType || "AwaitExpression" === nodeType) { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isCompletionStatement(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "CompletionStatement" || "BreakStatement" === nodeType || "ContinueStatement" === nodeType || "ReturnStatement" === nodeType || "ThrowStatement" === nodeType) { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isConditional(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "Conditional" || "ConditionalExpression" === nodeType || "IfStatement" === nodeType) { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isLoop(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "Loop" || "DoWhileStatement" === nodeType || "ForInStatement" === nodeType || "ForStatement" === nodeType || "WhileStatement" === nodeType || "ForOfStatement" === nodeType) { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isWhile(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "While" || "DoWhileStatement" === nodeType || "WhileStatement" === nodeType) { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isExpressionWrapper(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "ExpressionWrapper" || "ExpressionStatement" === nodeType || "ParenthesizedExpression" === nodeType || "TypeCastExpression" === nodeType) { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isFor(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "For" || "ForInStatement" === nodeType || "ForStatement" === nodeType || "ForOfStatement" === nodeType) { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isForXStatement(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "ForXStatement" || "ForInStatement" === nodeType || "ForOfStatement" === nodeType) { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isFunction(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "Function" || "FunctionDeclaration" === nodeType || "FunctionExpression" === nodeType || "ObjectMethod" === nodeType || "ArrowFunctionExpression" === nodeType || "ClassMethod" === nodeType || "ClassPrivateMethod" === nodeType) { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isFunctionParent(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "FunctionParent" || "FunctionDeclaration" === nodeType || "FunctionExpression" === nodeType || "ObjectMethod" === nodeType || "ArrowFunctionExpression" === nodeType || "ClassMethod" === nodeType || "ClassPrivateMethod" === nodeType) { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isPureish(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "Pureish" || "FunctionDeclaration" === nodeType || "FunctionExpression" === nodeType || "StringLiteral" === nodeType || "NumericLiteral" === nodeType || "NullLiteral" === nodeType || "BooleanLiteral" === nodeType || "ArrowFunctionExpression" === nodeType || "ClassDeclaration" === nodeType || "ClassExpression" === nodeType || "BigIntLiteral" === nodeType || nodeType === "Placeholder" && "StringLiteral" === node.expectedNode) { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isDeclaration(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "Declaration" || "FunctionDeclaration" === nodeType || "VariableDeclaration" === nodeType || "ClassDeclaration" === nodeType || "ExportAllDeclaration" === nodeType || "ExportDefaultDeclaration" === nodeType || "ExportNamedDeclaration" === nodeType || "ImportDeclaration" === nodeType || "DeclareClass" === nodeType || "DeclareFunction" === nodeType || "DeclareInterface" === nodeType || "DeclareModule" === nodeType || "DeclareModuleExports" === nodeType || "DeclareTypeAlias" === nodeType || "DeclareOpaqueType" === nodeType || "DeclareVariable" === nodeType || "DeclareExportDeclaration" === nodeType || "DeclareExportAllDeclaration" === nodeType || "InterfaceDeclaration" === nodeType || "OpaqueType" === nodeType || "TypeAlias" === nodeType || "TSDeclareFunction" === nodeType || "TSInterfaceDeclaration" === nodeType || "TSTypeAliasDeclaration" === nodeType || "TSEnumDeclaration" === nodeType || "TSModuleDeclaration" === nodeType || nodeType === "Placeholder" && "Declaration" === node.expectedNode) { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isPatternLike(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "PatternLike" || "Identifier" === nodeType || "RestElement" === nodeType || "AssignmentPattern" === nodeType || "ArrayPattern" === nodeType || "ObjectPattern" === nodeType || nodeType === "Placeholder" && ("Pattern" === node.expectedNode || "Identifier" === node.expectedNode)) { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isLVal(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "LVal" || "Identifier" === nodeType || "MemberExpression" === nodeType || "RestElement" === nodeType || "AssignmentPattern" === nodeType || "ArrayPattern" === nodeType || "ObjectPattern" === nodeType || "TSParameterProperty" === nodeType || nodeType === "Placeholder" && ("Pattern" === node.expectedNode || "Identifier" === node.expectedNode)) { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSEntityName(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TSEntityName" || "Identifier" === nodeType || "TSQualifiedName" === nodeType || nodeType === "Placeholder" && "Identifier" === node.expectedNode) { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isLiteral(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "Literal" || "StringLiteral" === nodeType || "NumericLiteral" === nodeType || "NullLiteral" === nodeType || "BooleanLiteral" === nodeType || "RegExpLiteral" === nodeType || "TemplateLiteral" === nodeType || "BigIntLiteral" === nodeType || nodeType === "Placeholder" && "StringLiteral" === node.expectedNode) { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isImmutable(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "Immutable" || "StringLiteral" === nodeType || "NumericLiteral" === nodeType || "NullLiteral" === nodeType || "BooleanLiteral" === nodeType || "JSXAttribute" === nodeType || "JSXClosingElement" === nodeType || "JSXElement" === nodeType || "JSXExpressionContainer" === nodeType || "JSXSpreadChild" === nodeType || "JSXOpeningElement" === nodeType || "JSXText" === nodeType || "JSXFragment" === nodeType || "JSXOpeningFragment" === nodeType || "JSXClosingFragment" === nodeType || "BigIntLiteral" === nodeType || nodeType === "Placeholder" && "StringLiteral" === node.expectedNode) { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isUserWhitespacable(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "UserWhitespacable" || "ObjectMethod" === nodeType || "ObjectProperty" === nodeType || "ObjectTypeInternalSlot" === nodeType || "ObjectTypeCallProperty" === nodeType || "ObjectTypeIndexer" === nodeType || "ObjectTypeProperty" === nodeType || "ObjectTypeSpreadProperty" === nodeType) { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isMethod(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "Method" || "ObjectMethod" === nodeType || "ClassMethod" === nodeType || "ClassPrivateMethod" === nodeType) { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isObjectMember(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "ObjectMember" || "ObjectMethod" === nodeType || "ObjectProperty" === nodeType) { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isProperty(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "Property" || "ObjectProperty" === nodeType || "ClassProperty" === nodeType || "ClassPrivateProperty" === nodeType) { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isUnaryLike(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "UnaryLike" || "UnaryExpression" === nodeType || "SpreadElement" === nodeType) { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isPattern(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "Pattern" || "AssignmentPattern" === nodeType || "ArrayPattern" === nodeType || "ObjectPattern" === nodeType || nodeType === "Placeholder" && "Pattern" === node.expectedNode) { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isClass(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "Class" || "ClassDeclaration" === nodeType || "ClassExpression" === nodeType) { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isModuleDeclaration(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "ModuleDeclaration" || "ExportAllDeclaration" === nodeType || "ExportDefaultDeclaration" === nodeType || "ExportNamedDeclaration" === nodeType || "ImportDeclaration" === nodeType) { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isExportDeclaration(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "ExportDeclaration" || "ExportAllDeclaration" === nodeType || "ExportDefaultDeclaration" === nodeType || "ExportNamedDeclaration" === nodeType) { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isModuleSpecifier(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "ModuleSpecifier" || "ExportSpecifier" === nodeType || "ImportDefaultSpecifier" === nodeType || "ImportNamespaceSpecifier" === nodeType || "ImportSpecifier" === nodeType || "ExportDefaultSpecifier" === nodeType || "ExportNamespaceSpecifier" === nodeType) { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isFlow(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "Flow" || "AnyTypeAnnotation" === nodeType || "ArrayTypeAnnotation" === nodeType || "BooleanTypeAnnotation" === nodeType || "BooleanLiteralTypeAnnotation" === nodeType || "NullLiteralTypeAnnotation" === nodeType || "ClassImplements" === nodeType || "DeclareClass" === nodeType || "DeclareFunction" === nodeType || "DeclareInterface" === nodeType || "DeclareModule" === nodeType || "DeclareModuleExports" === nodeType || "DeclareTypeAlias" === nodeType || "DeclareOpaqueType" === nodeType || "DeclareVariable" === nodeType || "DeclareExportDeclaration" === nodeType || "DeclareExportAllDeclaration" === nodeType || "DeclaredPredicate" === nodeType || "ExistsTypeAnnotation" === nodeType || "FunctionTypeAnnotation" === nodeType || "FunctionTypeParam" === nodeType || "GenericTypeAnnotation" === nodeType || "InferredPredicate" === nodeType || "InterfaceExtends" === nodeType || "InterfaceDeclaration" === nodeType || "InterfaceTypeAnnotation" === nodeType || "IntersectionTypeAnnotation" === nodeType || "MixedTypeAnnotation" === nodeType || "EmptyTypeAnnotation" === nodeType || "NullableTypeAnnotation" === nodeType || "NumberLiteralTypeAnnotation" === nodeType || "NumberTypeAnnotation" === nodeType || "ObjectTypeAnnotation" === nodeType || "ObjectTypeInternalSlot" === nodeType || "ObjectTypeCallProperty" === nodeType || "ObjectTypeIndexer" === nodeType || "ObjectTypeProperty" === nodeType || "ObjectTypeSpreadProperty" === nodeType || "OpaqueType" === nodeType || "QualifiedTypeIdentifier" === nodeType || "StringLiteralTypeAnnotation" === nodeType || "StringTypeAnnotation" === nodeType || "ThisTypeAnnotation" === nodeType || "TupleTypeAnnotation" === nodeType || "TypeofTypeAnnotation" === nodeType || "TypeAlias" === nodeType || "TypeAnnotation" === nodeType || "TypeCastExpression" === nodeType || "TypeParameter" === nodeType || "TypeParameterDeclaration" === nodeType || "TypeParameterInstantiation" === nodeType || "UnionTypeAnnotation" === nodeType || "Variance" === nodeType || "VoidTypeAnnotation" === nodeType) { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isFlowType(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "FlowType" || "AnyTypeAnnotation" === nodeType || "ArrayTypeAnnotation" === nodeType || "BooleanTypeAnnotation" === nodeType || "BooleanLiteralTypeAnnotation" === nodeType || "NullLiteralTypeAnnotation" === nodeType || "ExistsTypeAnnotation" === nodeType || "FunctionTypeAnnotation" === nodeType || "GenericTypeAnnotation" === nodeType || "InterfaceTypeAnnotation" === nodeType || "IntersectionTypeAnnotation" === nodeType || "MixedTypeAnnotation" === nodeType || "EmptyTypeAnnotation" === nodeType || "NullableTypeAnnotation" === nodeType || "NumberLiteralTypeAnnotation" === nodeType || "NumberTypeAnnotation" === nodeType || "ObjectTypeAnnotation" === nodeType || "StringLiteralTypeAnnotation" === nodeType || "StringTypeAnnotation" === nodeType || "ThisTypeAnnotation" === nodeType || "TupleTypeAnnotation" === nodeType || "TypeofTypeAnnotation" === nodeType || "UnionTypeAnnotation" === nodeType || "VoidTypeAnnotation" === nodeType) { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isFlowBaseAnnotation(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "FlowBaseAnnotation" || "AnyTypeAnnotation" === nodeType || "BooleanTypeAnnotation" === nodeType || "NullLiteralTypeAnnotation" === nodeType || "MixedTypeAnnotation" === nodeType || "EmptyTypeAnnotation" === nodeType || "NumberTypeAnnotation" === nodeType || "StringTypeAnnotation" === nodeType || "ThisTypeAnnotation" === nodeType || "VoidTypeAnnotation" === nodeType) { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isFlowDeclaration(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "FlowDeclaration" || "DeclareClass" === nodeType || "DeclareFunction" === nodeType || "DeclareInterface" === nodeType || "DeclareModule" === nodeType || "DeclareModuleExports" === nodeType || "DeclareTypeAlias" === nodeType || "DeclareOpaqueType" === nodeType || "DeclareVariable" === nodeType || "DeclareExportDeclaration" === nodeType || "DeclareExportAllDeclaration" === nodeType || "InterfaceDeclaration" === nodeType || "OpaqueType" === nodeType || "TypeAlias" === nodeType) { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isFlowPredicate(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "FlowPredicate" || "DeclaredPredicate" === nodeType || "InferredPredicate" === nodeType) { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isJSX(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "JSX" || "JSXAttribute" === nodeType || "JSXClosingElement" === nodeType || "JSXElement" === nodeType || "JSXEmptyExpression" === nodeType || "JSXExpressionContainer" === nodeType || "JSXSpreadChild" === nodeType || "JSXIdentifier" === nodeType || "JSXMemberExpression" === nodeType || "JSXNamespacedName" === nodeType || "JSXOpeningElement" === nodeType || "JSXSpreadAttribute" === nodeType || "JSXText" === nodeType || "JSXFragment" === nodeType || "JSXOpeningFragment" === nodeType || "JSXClosingFragment" === nodeType) { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isPrivate(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "Private" || "ClassPrivateProperty" === nodeType || "ClassPrivateMethod" === nodeType || "PrivateName" === nodeType) { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSTypeElement(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TSTypeElement" || "TSCallSignatureDeclaration" === nodeType || "TSConstructSignatureDeclaration" === nodeType || "TSPropertySignature" === nodeType || "TSMethodSignature" === nodeType || "TSIndexSignature" === nodeType) { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSType(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TSType" || "TSAnyKeyword" === nodeType || "TSUnknownKeyword" === nodeType || "TSNumberKeyword" === nodeType || "TSObjectKeyword" === nodeType || "TSBooleanKeyword" === nodeType || "TSStringKeyword" === nodeType || "TSSymbolKeyword" === nodeType || "TSVoidKeyword" === nodeType || "TSUndefinedKeyword" === nodeType || "TSNullKeyword" === nodeType || "TSNeverKeyword" === nodeType || "TSThisType" === nodeType || "TSFunctionType" === nodeType || "TSConstructorType" === nodeType || "TSTypeReference" === nodeType || "TSTypePredicate" === nodeType || "TSTypeQuery" === nodeType || "TSTypeLiteral" === nodeType || "TSArrayType" === nodeType || "TSTupleType" === nodeType || "TSOptionalType" === nodeType || "TSRestType" === nodeType || "TSUnionType" === nodeType || "TSIntersectionType" === nodeType || "TSConditionalType" === nodeType || "TSInferType" === nodeType || "TSParenthesizedType" === nodeType || "TSTypeOperator" === nodeType || "TSIndexedAccessType" === nodeType || "TSMappedType" === nodeType || "TSLiteralType" === nodeType || "TSExpressionWithTypeArguments" === nodeType || "TSImportType" === nodeType) { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isNumberLiteral(node, opts) { - console.trace("The node type NumberLiteral has been renamed to NumericLiteral"); - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "NumberLiteral") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isRegexLiteral(node, opts) { - console.trace("The node type RegexLiteral has been renamed to RegExpLiteral"); - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "RegexLiteral") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isRestProperty(node, opts) { - console.trace("The node type RestProperty has been renamed to RestElement"); - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "RestProperty") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isSpreadProperty(node, opts) { - console.trace("The node type SpreadProperty has been renamed to SpreadElement"); - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "SpreadProperty") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -/***/ }), - -/***/ "./node_modules/@babel/types/lib/validators/is.js": -/*!********************************************************!*\ - !*** ./node_modules/@babel/types/lib/validators/is.js ***! - \********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = is; - -var _shallowEqual = _interopRequireDefault(__webpack_require__(/*! ../utils/shallowEqual */ "./node_modules/@babel/types/lib/utils/shallowEqual.js")); - -var _isType = _interopRequireDefault(__webpack_require__(/*! ./isType */ "./node_modules/@babel/types/lib/validators/isType.js")); - -var _isPlaceholderType = _interopRequireDefault(__webpack_require__(/*! ./isPlaceholderType */ "./node_modules/@babel/types/lib/validators/isPlaceholderType.js")); - -var _definitions = __webpack_require__(/*! ../definitions */ "./node_modules/@babel/types/lib/definitions/index.js"); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function is(type, node, opts) { - if (!node) return false; - const matches = (0, _isType.default)(node.type, type); - - if (!matches) { - if (!opts && node.type === "Placeholder" && type in _definitions.FLIPPED_ALIAS_KEYS) { - return (0, _isPlaceholderType.default)(node.expectedNode, type); - } - - return false; - } - - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } -} - -/***/ }), - -/***/ "./node_modules/@babel/types/lib/validators/isBinding.js": -/*!***************************************************************!*\ - !*** ./node_modules/@babel/types/lib/validators/isBinding.js ***! - \***************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = isBinding; - -var _getBindingIdentifiers = _interopRequireDefault(__webpack_require__(/*! ../retrievers/getBindingIdentifiers */ "./node_modules/@babel/types/lib/retrievers/getBindingIdentifiers.js")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function isBinding(node, parent, grandparent) { - if (grandparent && node.type === "Identifier" && parent.type === "ObjectProperty" && grandparent.type === "ObjectExpression") { - return false; - } - - const keys = _getBindingIdentifiers.default.keys[parent.type]; - - if (keys) { - for (let i = 0; i < keys.length; i++) { - const key = keys[i]; - const val = parent[key]; - - if (Array.isArray(val)) { - if (val.indexOf(node) >= 0) return true; - } else { - if (val === node) return true; - } - } - } - - return false; -} - -/***/ }), - -/***/ "./node_modules/@babel/types/lib/validators/isBlockScoped.js": -/*!*******************************************************************!*\ - !*** ./node_modules/@babel/types/lib/validators/isBlockScoped.js ***! - \*******************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = isBlockScoped; - -var _generated = __webpack_require__(/*! ./generated */ "./node_modules/@babel/types/lib/validators/generated/index.js"); - -var _isLet = _interopRequireDefault(__webpack_require__(/*! ./isLet */ "./node_modules/@babel/types/lib/validators/isLet.js")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function isBlockScoped(node) { - return (0, _generated.isFunctionDeclaration)(node) || (0, _generated.isClassDeclaration)(node) || (0, _isLet.default)(node); -} - -/***/ }), - -/***/ "./node_modules/@babel/types/lib/validators/isImmutable.js": -/*!*****************************************************************!*\ - !*** ./node_modules/@babel/types/lib/validators/isImmutable.js ***! - \*****************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = isImmutable; - -var _isType = _interopRequireDefault(__webpack_require__(/*! ./isType */ "./node_modules/@babel/types/lib/validators/isType.js")); - -var _generated = __webpack_require__(/*! ./generated */ "./node_modules/@babel/types/lib/validators/generated/index.js"); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function isImmutable(node) { - if ((0, _isType.default)(node.type, "Immutable")) return true; - - if ((0, _generated.isIdentifier)(node)) { - if (node.name === "undefined") { - return true; - } else { - return false; - } - } - - return false; -} - -/***/ }), - -/***/ "./node_modules/@babel/types/lib/validators/isLet.js": -/*!***********************************************************!*\ - !*** ./node_modules/@babel/types/lib/validators/isLet.js ***! - \***********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = isLet; - -var _generated = __webpack_require__(/*! ./generated */ "./node_modules/@babel/types/lib/validators/generated/index.js"); - -var _constants = __webpack_require__(/*! ../constants */ "./node_modules/@babel/types/lib/constants/index.js"); - -function isLet(node) { - return (0, _generated.isVariableDeclaration)(node) && (node.kind !== "var" || node[_constants.BLOCK_SCOPED_SYMBOL]); -} - -/***/ }), - -/***/ "./node_modules/@babel/types/lib/validators/isNode.js": -/*!************************************************************!*\ - !*** ./node_modules/@babel/types/lib/validators/isNode.js ***! - \************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = isNode; - -var _definitions = __webpack_require__(/*! ../definitions */ "./node_modules/@babel/types/lib/definitions/index.js"); - -function isNode(node) { - return !!(node && _definitions.VISITOR_KEYS[node.type]); -} - -/***/ }), - -/***/ "./node_modules/@babel/types/lib/validators/isNodesEquivalent.js": -/*!***********************************************************************!*\ - !*** ./node_modules/@babel/types/lib/validators/isNodesEquivalent.js ***! - \***********************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = isNodesEquivalent; - -var _definitions = __webpack_require__(/*! ../definitions */ "./node_modules/@babel/types/lib/definitions/index.js"); - -function isNodesEquivalent(a, b) { - if (typeof a !== "object" || typeof b !== "object" || a == null || b == null) { - return a === b; - } - - if (a.type !== b.type) { - return false; - } - - const fields = Object.keys(_definitions.NODE_FIELDS[a.type] || a.type); - const visitorKeys = _definitions.VISITOR_KEYS[a.type]; - - for (const field of fields) { - if (typeof a[field] !== typeof b[field]) { - return false; - } - - if (a[field] == null && b[field] == null) { - continue; - } else if (a[field] == null || b[field] == null) { - return false; - } - - if (Array.isArray(a[field])) { - if (!Array.isArray(b[field])) { - return false; - } - - if (a[field].length !== b[field].length) { - return false; - } - - for (let i = 0; i < a[field].length; i++) { - if (!isNodesEquivalent(a[field][i], b[field][i])) { - return false; - } - } - - continue; - } - - if (typeof a[field] === "object" && (!visitorKeys || !visitorKeys.includes(field))) { - for (const key of Object.keys(a[field])) { - if (a[field][key] !== b[field][key]) { - return false; - } - } - - continue; - } - - if (!isNodesEquivalent(a[field], b[field])) { - return false; - } - } - - return true; -} - -/***/ }), - -/***/ "./node_modules/@babel/types/lib/validators/isPlaceholderType.js": -/*!***********************************************************************!*\ - !*** ./node_modules/@babel/types/lib/validators/isPlaceholderType.js ***! - \***********************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = isPlaceholderType; - -var _definitions = __webpack_require__(/*! ../definitions */ "./node_modules/@babel/types/lib/definitions/index.js"); - -function isPlaceholderType(placeholderType, targetType) { - if (placeholderType === targetType) return true; - const aliases = _definitions.PLACEHOLDERS_ALIAS[placeholderType]; - - if (aliases) { - for (const alias of aliases) { - if (targetType === alias) return true; - } - } - - return false; -} - -/***/ }), - -/***/ "./node_modules/@babel/types/lib/validators/isReferenced.js": -/*!******************************************************************!*\ - !*** ./node_modules/@babel/types/lib/validators/isReferenced.js ***! - \******************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = isReferenced; - -function isReferenced(node, parent, grandparent) { - switch (parent.type) { - case "MemberExpression": - case "JSXMemberExpression": - case "OptionalMemberExpression": - if (parent.property === node) { - return !!parent.computed; - } - - return parent.object === node; - - case "VariableDeclarator": - return parent.init === node; - - case "ArrowFunctionExpression": - return parent.body === node; - - case "ExportSpecifier": - if (parent.source) { - return false; - } - - return parent.local === node; - - case "PrivateName": - return false; - - case "ObjectProperty": - case "ClassProperty": - case "ClassPrivateProperty": - case "ClassMethod": - case "ClassPrivateMethod": - case "ObjectMethod": - if (parent.key === node) { - return !!parent.computed; - } - - if (parent.value === node) { - return !grandparent || grandparent.type !== "ObjectPattern"; - } - - return true; - - case "ClassDeclaration": - case "ClassExpression": - return parent.superClass === node; - - case "AssignmentExpression": - return parent.right === node; - - case "AssignmentPattern": - return parent.right === node; - - case "LabeledStatement": - return false; - - case "CatchClause": - return false; - - case "RestElement": - return false; - - case "BreakStatement": - case "ContinueStatement": - return false; - - case "FunctionDeclaration": - case "FunctionExpression": - return false; - - case "ExportNamespaceSpecifier": - case "ExportDefaultSpecifier": - return false; - - case "ImportDefaultSpecifier": - case "ImportNamespaceSpecifier": - case "ImportSpecifier": - return false; - - case "JSXAttribute": - return false; - - case "ObjectPattern": - case "ArrayPattern": - return false; - - case "MetaProperty": - return false; - - case "ObjectTypeProperty": - return parent.key !== node; - - case "TSEnumMember": - return parent.id !== node; - - case "TSPropertySignature": - if (parent.key === node) { - return !!parent.computed; - } - - return true; - } - - return true; -} - -/***/ }), - -/***/ "./node_modules/@babel/types/lib/validators/isScope.js": -/*!*************************************************************!*\ - !*** ./node_modules/@babel/types/lib/validators/isScope.js ***! - \*************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = isScope; - -var _generated = __webpack_require__(/*! ./generated */ "./node_modules/@babel/types/lib/validators/generated/index.js"); - -function isScope(node, parent) { - if ((0, _generated.isBlockStatement)(node) && (0, _generated.isFunction)(parent, { - body: node - })) { - return false; - } - - if ((0, _generated.isBlockStatement)(node) && (0, _generated.isCatchClause)(parent, { - body: node - })) { - return false; - } - - return (0, _generated.isScopable)(node); -} - -/***/ }), - -/***/ "./node_modules/@babel/types/lib/validators/isSpecifierDefault.js": -/*!************************************************************************!*\ - !*** ./node_modules/@babel/types/lib/validators/isSpecifierDefault.js ***! - \************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = isSpecifierDefault; - -var _generated = __webpack_require__(/*! ./generated */ "./node_modules/@babel/types/lib/validators/generated/index.js"); - -function isSpecifierDefault(specifier) { - return (0, _generated.isImportDefaultSpecifier)(specifier) || (0, _generated.isIdentifier)(specifier.imported || specifier.exported, { - name: "default" - }); -} - -/***/ }), - -/***/ "./node_modules/@babel/types/lib/validators/isType.js": -/*!************************************************************!*\ - !*** ./node_modules/@babel/types/lib/validators/isType.js ***! - \************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = isType; - -var _definitions = __webpack_require__(/*! ../definitions */ "./node_modules/@babel/types/lib/definitions/index.js"); - -function isType(nodeType, targetType) { - if (nodeType === targetType) return true; - if (_definitions.ALIAS_KEYS[targetType]) return false; - const aliases = _definitions.FLIPPED_ALIAS_KEYS[targetType]; - - if (aliases) { - if (aliases[0] === nodeType) return true; - - for (const alias of aliases) { - if (nodeType === alias) return true; - } - } - - return false; -} - -/***/ }), - -/***/ "./node_modules/@babel/types/lib/validators/isValidES3Identifier.js": -/*!**************************************************************************!*\ - !*** ./node_modules/@babel/types/lib/validators/isValidES3Identifier.js ***! - \**************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = isValidES3Identifier; - -var _isValidIdentifier = _interopRequireDefault(__webpack_require__(/*! ./isValidIdentifier */ "./node_modules/@babel/types/lib/validators/isValidIdentifier.js")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -const RESERVED_WORDS_ES3_ONLY = new Set(["abstract", "boolean", "byte", "char", "double", "enum", "final", "float", "goto", "implements", "int", "interface", "long", "native", "package", "private", "protected", "public", "short", "static", "synchronized", "throws", "transient", "volatile"]); - -function isValidES3Identifier(name) { - return (0, _isValidIdentifier.default)(name) && !RESERVED_WORDS_ES3_ONLY.has(name); -} - -/***/ }), - -/***/ "./node_modules/@babel/types/lib/validators/isValidIdentifier.js": -/*!***********************************************************************!*\ - !*** ./node_modules/@babel/types/lib/validators/isValidIdentifier.js ***! - \***********************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = isValidIdentifier; - -function _esutils() { - const data = _interopRequireDefault(__webpack_require__(/*! esutils */ "./node_modules/esutils/lib/utils.js")); - - _esutils = function () { - return data; - }; - - return data; -} - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function isValidIdentifier(name) { - if (typeof name !== "string" || _esutils().default.keyword.isReservedWordES6(name, true)) { - return false; - } else if (name === "await") { - return false; - } else { - return _esutils().default.keyword.isIdentifierNameES6(name); - } -} - -/***/ }), - -/***/ "./node_modules/@babel/types/lib/validators/isVar.js": -/*!***********************************************************!*\ - !*** ./node_modules/@babel/types/lib/validators/isVar.js ***! - \***********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = isVar; - -var _generated = __webpack_require__(/*! ./generated */ "./node_modules/@babel/types/lib/validators/generated/index.js"); - -var _constants = __webpack_require__(/*! ../constants */ "./node_modules/@babel/types/lib/constants/index.js"); - -function isVar(node) { - return (0, _generated.isVariableDeclaration)(node, { - kind: "var" - }) && !node[_constants.BLOCK_SCOPED_SYMBOL]; -} - -/***/ }), - -/***/ "./node_modules/@babel/types/lib/validators/matchesPattern.js": -/*!********************************************************************!*\ - !*** ./node_modules/@babel/types/lib/validators/matchesPattern.js ***! - \********************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = matchesPattern; - -var _generated = __webpack_require__(/*! ./generated */ "./node_modules/@babel/types/lib/validators/generated/index.js"); - -function matchesPattern(member, match, allowPartial) { - if (!(0, _generated.isMemberExpression)(member)) return false; - const parts = Array.isArray(match) ? match : match.split("."); - const nodes = []; - let node; - - for (node = member; (0, _generated.isMemberExpression)(node); node = node.object) { - nodes.push(node.property); - } - - nodes.push(node); - if (nodes.length < parts.length) return false; - if (!allowPartial && nodes.length > parts.length) return false; - - for (let i = 0, j = nodes.length - 1; i < parts.length; i++, j--) { - const node = nodes[j]; - let value; - - if ((0, _generated.isIdentifier)(node)) { - value = node.name; - } else if ((0, _generated.isStringLiteral)(node)) { - value = node.value; - } else { - return false; - } - - if (parts[i] !== value) return false; - } - - return true; -} - -/***/ }), - -/***/ "./node_modules/@babel/types/lib/validators/react/isCompatTag.js": -/*!***********************************************************************!*\ - !*** ./node_modules/@babel/types/lib/validators/react/isCompatTag.js ***! - \***********************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = isCompatTag; - -function isCompatTag(tagName) { - return !!tagName && /^[a-z]/.test(tagName); -} - -/***/ }), - -/***/ "./node_modules/@babel/types/lib/validators/react/isReactComponent.js": -/*!****************************************************************************!*\ - !*** ./node_modules/@babel/types/lib/validators/react/isReactComponent.js ***! - \****************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -var _buildMatchMemberExpression = _interopRequireDefault(__webpack_require__(/*! ../buildMatchMemberExpression */ "./node_modules/@babel/types/lib/validators/buildMatchMemberExpression.js")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -const isReactComponent = (0, _buildMatchMemberExpression.default)("React.Component"); -var _default = isReactComponent; -exports.default = _default; - -/***/ }), - -/***/ "./node_modules/@babel/types/lib/validators/validate.js": -/*!**************************************************************!*\ - !*** ./node_modules/@babel/types/lib/validators/validate.js ***! - \**************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = validate; -exports.validateField = validateField; - -var _definitions = __webpack_require__(/*! ../definitions */ "./node_modules/@babel/types/lib/definitions/index.js"); - -function validate(node, key, val) { - if (!node) return; - const fields = _definitions.NODE_FIELDS[node.type]; - if (!fields) return; - const field = fields[key]; - validateField(node, key, val, field); -} - -function validateField(node, key, val, field) { - if (!field || !field.validate) return; - if (field.optional && val == null) return; - field.validate(node, key, val); -} - -/***/ }), - -/***/ "./node_modules/ansi-regex/index.js": -/*!******************************************!*\ - !*** ./node_modules/ansi-regex/index.js ***! - \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -module.exports = function () { - return /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-PRZcf-nqry=><]/g; -}; - - -/***/ }), - -/***/ "./node_modules/ansi-styles/index.js": -/*!*******************************************!*\ - !*** ./node_modules/ansi-styles/index.js ***! - \*******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/* WEBPACK VAR INJECTION */(function(module) { -const colorConvert = __webpack_require__(/*! color-convert */ "./node_modules/color-convert/index.js"); - -const wrapAnsi16 = (fn, offset) => function () { - const code = fn.apply(colorConvert, arguments); - return `\u001B[${code + offset}m`; -}; - -const wrapAnsi256 = (fn, offset) => function () { - const code = fn.apply(colorConvert, arguments); - return `\u001B[${38 + offset};5;${code}m`; -}; - -const wrapAnsi16m = (fn, offset) => function () { - const rgb = fn.apply(colorConvert, arguments); - return `\u001B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`; -}; - -function assembleStyles() { - const codes = new Map(); - const styles = { - modifier: { - reset: [0, 0], - // 21 isn't widely supported and 22 does the same thing - bold: [1, 22], - dim: [2, 22], - italic: [3, 23], - underline: [4, 24], - inverse: [7, 27], - hidden: [8, 28], - strikethrough: [9, 29] - }, - color: { - black: [30, 39], - red: [31, 39], - green: [32, 39], - yellow: [33, 39], - blue: [34, 39], - magenta: [35, 39], - cyan: [36, 39], - white: [37, 39], - gray: [90, 39], - - // Bright color - redBright: [91, 39], - greenBright: [92, 39], - yellowBright: [93, 39], - blueBright: [94, 39], - magentaBright: [95, 39], - cyanBright: [96, 39], - whiteBright: [97, 39] - }, - bgColor: { - bgBlack: [40, 49], - bgRed: [41, 49], - bgGreen: [42, 49], - bgYellow: [43, 49], - bgBlue: [44, 49], - bgMagenta: [45, 49], - bgCyan: [46, 49], - bgWhite: [47, 49], - - // Bright color - bgBlackBright: [100, 49], - bgRedBright: [101, 49], - bgGreenBright: [102, 49], - bgYellowBright: [103, 49], - bgBlueBright: [104, 49], - bgMagentaBright: [105, 49], - bgCyanBright: [106, 49], - bgWhiteBright: [107, 49] - } - }; - - // Fix humans - styles.color.grey = styles.color.gray; - - for (const groupName of Object.keys(styles)) { - const group = styles[groupName]; - - for (const styleName of Object.keys(group)) { - const style = group[styleName]; - - styles[styleName] = { - open: `\u001B[${style[0]}m`, - close: `\u001B[${style[1]}m` - }; - - group[styleName] = styles[styleName]; - - codes.set(style[0], style[1]); - } - - Object.defineProperty(styles, groupName, { - value: group, - enumerable: false - }); - - Object.defineProperty(styles, 'codes', { - value: codes, - enumerable: false - }); - } - - const ansi2ansi = n => n; - const rgb2rgb = (r, g, b) => [r, g, b]; - - styles.color.close = '\u001B[39m'; - styles.bgColor.close = '\u001B[49m'; - - styles.color.ansi = { - ansi: wrapAnsi16(ansi2ansi, 0) - }; - styles.color.ansi256 = { - ansi256: wrapAnsi256(ansi2ansi, 0) - }; - styles.color.ansi16m = { - rgb: wrapAnsi16m(rgb2rgb, 0) - }; - - styles.bgColor.ansi = { - ansi: wrapAnsi16(ansi2ansi, 10) - }; - styles.bgColor.ansi256 = { - ansi256: wrapAnsi256(ansi2ansi, 10) - }; - styles.bgColor.ansi16m = { - rgb: wrapAnsi16m(rgb2rgb, 10) - }; - - for (let key of Object.keys(colorConvert)) { - if (typeof colorConvert[key] !== 'object') { - continue; - } - - const suite = colorConvert[key]; - - if (key === 'ansi16') { - key = 'ansi'; - } - - if ('ansi16' in suite) { - styles.color.ansi[key] = wrapAnsi16(suite.ansi16, 0); - styles.bgColor.ansi[key] = wrapAnsi16(suite.ansi16, 10); - } - - if ('ansi256' in suite) { - styles.color.ansi256[key] = wrapAnsi256(suite.ansi256, 0); - styles.bgColor.ansi256[key] = wrapAnsi256(suite.ansi256, 10); - } - - if ('rgb' in suite) { - styles.color.ansi16m[key] = wrapAnsi16m(suite.rgb, 0); - styles.bgColor.ansi16m[key] = wrapAnsi16m(suite.rgb, 10); - } - } - - return styles; -} - -// Make the export immutable -Object.defineProperty(module, 'exports', { - enumerable: true, - get: assembleStyles -}); - -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/module.js */ "./node_modules/webpack/buildin/module.js")(module))) - -/***/ }), - -/***/ "./node_modules/base64-js/index.js": -/*!*****************************************!*\ - !*** ./node_modules/base64-js/index.js ***! - \*****************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -exports.byteLength = byteLength -exports.toByteArray = toByteArray -exports.fromByteArray = fromByteArray - -var lookup = [] -var revLookup = [] -var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array - -var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' -for (var i = 0, len = code.length; i < len; ++i) { - lookup[i] = code[i] - revLookup[code.charCodeAt(i)] = i -} - -revLookup['-'.charCodeAt(0)] = 62 -revLookup['_'.charCodeAt(0)] = 63 - -function placeHoldersCount (b64) { - var len = b64.length - if (len % 4 > 0) { - throw new Error('Invalid string. Length must be a multiple of 4') - } - - // the number of equal signs (place holders) - // if there are two placeholders, than the two characters before it - // represent one byte - // if there is only one, then the three characters before it represent 2 bytes - // this is just a cheap hack to not do indexOf twice - return b64[len - 2] === '=' ? 2 : b64[len - 1] === '=' ? 1 : 0 -} - -function byteLength (b64) { - // base64 is 4/3 + up to two characters of the original data - return (b64.length * 3 / 4) - placeHoldersCount(b64) -} - -function toByteArray (b64) { - var i, l, tmp, placeHolders, arr - var len = b64.length - placeHolders = placeHoldersCount(b64) - - arr = new Arr((len * 3 / 4) - placeHolders) - - // if there are placeholders, only get up to the last complete 4 chars - l = placeHolders > 0 ? len - 4 : len - - var L = 0 - - for (i = 0; i < l; i += 4) { - tmp = (revLookup[b64.charCodeAt(i)] << 18) | (revLookup[b64.charCodeAt(i + 1)] << 12) | (revLookup[b64.charCodeAt(i + 2)] << 6) | revLookup[b64.charCodeAt(i + 3)] - arr[L++] = (tmp >> 16) & 0xFF - arr[L++] = (tmp >> 8) & 0xFF - arr[L++] = tmp & 0xFF - } - - if (placeHolders === 2) { - tmp = (revLookup[b64.charCodeAt(i)] << 2) | (revLookup[b64.charCodeAt(i + 1)] >> 4) - arr[L++] = tmp & 0xFF - } else if (placeHolders === 1) { - tmp = (revLookup[b64.charCodeAt(i)] << 10) | (revLookup[b64.charCodeAt(i + 1)] << 4) | (revLookup[b64.charCodeAt(i + 2)] >> 2) - arr[L++] = (tmp >> 8) & 0xFF - arr[L++] = tmp & 0xFF - } - - return arr -} - -function tripletToBase64 (num) { - return lookup[num >> 18 & 0x3F] + lookup[num >> 12 & 0x3F] + lookup[num >> 6 & 0x3F] + lookup[num & 0x3F] -} - -function encodeChunk (uint8, start, end) { - var tmp - var output = [] - for (var i = start; i < end; i += 3) { - tmp = (uint8[i] << 16) + (uint8[i + 1] << 8) + (uint8[i + 2]) - output.push(tripletToBase64(tmp)) - } - return output.join('') -} - -function fromByteArray (uint8) { - var tmp - var len = uint8.length - var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes - var output = '' - var parts = [] - var maxChunkLength = 16383 // must be multiple of 3 - - // go through the array every three bytes, we'll deal with trailing stuff later - for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) { - parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength))) - } - - // pad the end with zeros, but make sure to not forget the extra bytes - if (extraBytes === 1) { - tmp = uint8[len - 1] - output += lookup[tmp >> 2] - output += lookup[(tmp << 4) & 0x3F] - output += '==' - } else if (extraBytes === 2) { - tmp = (uint8[len - 2] << 8) + (uint8[len - 1]) - output += lookup[tmp >> 10] - output += lookup[(tmp >> 4) & 0x3F] - output += lookup[(tmp << 2) & 0x3F] - output += '=' - } - - parts.push(output) - - return parts.join('') -} - - -/***/ }), - -/***/ "./node_modules/buffer/index.js": -/*!**************************************!*\ - !*** ./node_modules/buffer/index.js ***! - \**************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/* WEBPACK VAR INJECTION */(function(global) {/*! +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("js2flowchart",[],t):"object"==typeof exports?exports.js2flowchart=t():e.js2flowchart=t()}("undefined"!=typeof window?window:this,function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=330)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r={react:!0,assertNode:!0,createTypeAnnotationBasedOnTypeof:!0,createUnionTypeAnnotation:!0,cloneNode:!0,clone:!0,cloneDeep:!0,cloneWithoutLoc:!0,addComment:!0,addComments:!0,inheritInnerComments:!0,inheritLeadingComments:!0,inheritsComments:!0,inheritTrailingComments:!0,removeComments:!0,ensureBlock:!0,toBindingIdentifierName:!0,toBlock:!0,toComputedKey:!0,toExpression:!0,toIdentifier:!0,toKeyAlias:!0,toSequenceExpression:!0,toStatement:!0,valueToNode:!0,appendToMemberExpression:!0,inherits:!0,prependToMemberExpression:!0,removeProperties:!0,removePropertiesDeep:!0,removeTypeDuplicates:!0,getBindingIdentifiers:!0,getOuterBindingIdentifiers:!0,traverse:!0,traverseFast:!0,shallowEqual:!0,is:!0,isBinding:!0,isBlockScoped:!0,isImmutable:!0,isLet:!0,isNode:!0,isNodesEquivalent:!0,isPlaceholderType:!0,isReferenced:!0,isScope:!0,isSpecifierDefault:!0,isType:!0,isValidES3Identifier:!0,isValidIdentifier:!0,isVar:!0,matchesPattern:!0,validate:!0,buildMatchMemberExpression:!0};Object.defineProperty(t,"assertNode",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(t,"createTypeAnnotationBasedOnTypeof",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(t,"createUnionTypeAnnotation",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(t,"cloneNode",{enumerable:!0,get:function(){return h.default}}),Object.defineProperty(t,"clone",{enumerable:!0,get:function(){return f.default}}),Object.defineProperty(t,"cloneDeep",{enumerable:!0,get:function(){return d.default}}),Object.defineProperty(t,"cloneWithoutLoc",{enumerable:!0,get:function(){return y.default}}),Object.defineProperty(t,"addComment",{enumerable:!0,get:function(){return m.default}}),Object.defineProperty(t,"addComments",{enumerable:!0,get:function(){return g.default}}),Object.defineProperty(t,"inheritInnerComments",{enumerable:!0,get:function(){return E.default}}),Object.defineProperty(t,"inheritLeadingComments",{enumerable:!0,get:function(){return T.default}}),Object.defineProperty(t,"inheritsComments",{enumerable:!0,get:function(){return A.default}}),Object.defineProperty(t,"inheritTrailingComments",{enumerable:!0,get:function(){return S.default}}),Object.defineProperty(t,"removeComments",{enumerable:!0,get:function(){return b.default}}),Object.defineProperty(t,"ensureBlock",{enumerable:!0,get:function(){return v.default}}),Object.defineProperty(t,"toBindingIdentifierName",{enumerable:!0,get:function(){return D.default}}),Object.defineProperty(t,"toBlock",{enumerable:!0,get:function(){return C.default}}),Object.defineProperty(t,"toComputedKey",{enumerable:!0,get:function(){return O.default}}),Object.defineProperty(t,"toExpression",{enumerable:!0,get:function(){return w.default}}),Object.defineProperty(t,"toIdentifier",{enumerable:!0,get:function(){return F.default}}),Object.defineProperty(t,"toKeyAlias",{enumerable:!0,get:function(){return _.default}}),Object.defineProperty(t,"toSequenceExpression",{enumerable:!0,get:function(){return N.default}}),Object.defineProperty(t,"toStatement",{enumerable:!0,get:function(){return I.default}}),Object.defineProperty(t,"valueToNode",{enumerable:!0,get:function(){return k.default}}),Object.defineProperty(t,"appendToMemberExpression",{enumerable:!0,get:function(){return L.default}}),Object.defineProperty(t,"inherits",{enumerable:!0,get:function(){return M.default}}),Object.defineProperty(t,"prependToMemberExpression",{enumerable:!0,get:function(){return j.default}}),Object.defineProperty(t,"removeProperties",{enumerable:!0,get:function(){return R.default}}),Object.defineProperty(t,"removePropertiesDeep",{enumerable:!0,get:function(){return U.default}}),Object.defineProperty(t,"removeTypeDuplicates",{enumerable:!0,get:function(){return V.default}}),Object.defineProperty(t,"getBindingIdentifiers",{enumerable:!0,get:function(){return X.default}}),Object.defineProperty(t,"getOuterBindingIdentifiers",{enumerable:!0,get:function(){return W.default}}),Object.defineProperty(t,"traverse",{enumerable:!0,get:function(){return Y.default}}),Object.defineProperty(t,"traverseFast",{enumerable:!0,get:function(){return K.default}}),Object.defineProperty(t,"shallowEqual",{enumerable:!0,get:function(){return q.default}}),Object.defineProperty(t,"is",{enumerable:!0,get:function(){return J.default}}),Object.defineProperty(t,"isBinding",{enumerable:!0,get:function(){return G.default}}),Object.defineProperty(t,"isBlockScoped",{enumerable:!0,get:function(){return H.default}}),Object.defineProperty(t,"isImmutable",{enumerable:!0,get:function(){return $.default}}),Object.defineProperty(t,"isLet",{enumerable:!0,get:function(){return z.default}}),Object.defineProperty(t,"isNode",{enumerable:!0,get:function(){return Q.default}}),Object.defineProperty(t,"isNodesEquivalent",{enumerable:!0,get:function(){return Z.default}}),Object.defineProperty(t,"isPlaceholderType",{enumerable:!0,get:function(){return ee.default}}),Object.defineProperty(t,"isReferenced",{enumerable:!0,get:function(){return te.default}}),Object.defineProperty(t,"isScope",{enumerable:!0,get:function(){return ne.default}}),Object.defineProperty(t,"isSpecifierDefault",{enumerable:!0,get:function(){return re.default}}),Object.defineProperty(t,"isType",{enumerable:!0,get:function(){return ie.default}}),Object.defineProperty(t,"isValidES3Identifier",{enumerable:!0,get:function(){return se.default}}),Object.defineProperty(t,"isValidIdentifier",{enumerable:!0,get:function(){return oe.default}}),Object.defineProperty(t,"isVar",{enumerable:!0,get:function(){return ae.default}}),Object.defineProperty(t,"matchesPattern",{enumerable:!0,get:function(){return ue.default}}),Object.defineProperty(t,"validate",{enumerable:!0,get:function(){return ce.default}}),Object.defineProperty(t,"buildMatchMemberExpression",{enumerable:!0,get:function(){return le.default}}),t.react=void 0;var i=he(n(116)),s=he(n(117)),o=he(n(118)),a=he(n(195)),u=n(196);Object.keys(u).forEach(function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(r,e)||Object.defineProperty(t,e,{enumerable:!0,get:function(){return u[e]}}))});var c=he(n(197)),l=he(n(198)),p=n(4);Object.keys(p).forEach(function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(r,e)||Object.defineProperty(t,e,{enumerable:!0,get:function(){return p[e]}}))});var h=he(n(16)),f=he(n(80)),d=he(n(199)),y=he(n(200)),m=he(n(201)),g=he(n(81)),E=he(n(82)),T=he(n(85)),A=he(n(86)),S=he(n(87)),b=he(n(215)),x=n(216);Object.keys(x).forEach(function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(r,e)||Object.defineProperty(t,e,{enumerable:!0,get:function(){return x[e]}}))});var P=n(11);Object.keys(P).forEach(function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(r,e)||Object.defineProperty(t,e,{enumerable:!0,get:function(){return P[e]}}))});var v=he(n(217)),D=he(n(218)),C=he(n(88)),O=he(n(219)),w=he(n(220)),F=he(n(89)),_=he(n(221)),N=he(n(222)),I=he(n(224)),k=he(n(225)),B=n(3);Object.keys(B).forEach(function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(r,e)||Object.defineProperty(t,e,{enumerable:!0,get:function(){return B[e]}}))});var L=he(n(229)),M=he(n(230)),j=he(n(231)),R=he(n(92)),U=he(n(90)),V=he(n(79)),X=he(n(30)),W=he(n(232)),Y=he(n(233)),K=he(n(91)),q=he(n(33)),J=he(n(43)),G=he(n(234)),H=he(n(235)),$=he(n(236)),z=he(n(93)),Q=he(n(78)),Z=he(n(237)),ee=he(n(76)),te=he(n(238)),ne=he(n(239)),re=he(n(240)),ie=he(n(44)),se=he(n(241)),oe=he(n(15)),ae=he(n(242)),ue=he(n(55)),ce=he(n(45)),le=he(n(54)),pe=n(2);function he(e){return e&&e.__esModule?e:{default:e}}Object.keys(pe).forEach(function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(r,e)||Object.defineProperty(t,e,{enumerable:!0,get:function(){return pe[e]}}))});const fe={isReactComponent:i.default,isCompatTag:s.default,buildChildren:o.default};t.react=fe},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n){return new o(e,t,n).generate()},t.CodeGenerator=void 0;var r=s(n(266)),i=s(n(274));function s(e){return e&&e.__esModule?e:{default:e}}class o extends i.default{constructor(e,t={},n){super(function(e,t){const n={auxiliaryCommentBefore:t.auxiliaryCommentBefore,auxiliaryCommentAfter:t.auxiliaryCommentAfter,shouldPrintComment:t.shouldPrintComment,retainLines:t.retainLines,retainFunctionParens:t.retainFunctionParens,comments:null==t.comments||t.comments,compact:t.compact,minified:t.minified,concise:t.concise,jsonCompatibleStrings:t.jsonCompatibleStrings,indent:{adjustMultilineComment:!0,style:" ",base:0},decoratorsBeforeExport:!!t.decoratorsBeforeExport,jsescOption:Object.assign({quotes:"double",wrap:!0},t.jsescOption)};n.minified?(n.compact=!0,n.shouldPrintComment=n.shouldPrintComment||(()=>n.comments)):n.shouldPrintComment=n.shouldPrintComment||(e=>n.comments||e.indexOf("@license")>=0||e.indexOf("@preserve")>=0);"auto"===n.compact&&(n.compact=e.length>5e5,n.compact&&console.error("[BABEL] Note: The code generator has deoptimised the styling of "+`${t.filename} as it exceeds the max of 500KB.`));n.compact&&(n.indent.adjustMultilineComment=!1);return n}(n,t),t.sourceMaps?new r.default(t,n):null),this.ast=e}generate(){return super.generate(this.ast)}}t.CodeGenerator=class{constructor(e,t,n){this._generator=new o(e,t,n)}generate(){return this._generator.generate()}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isArrayExpression=function(e,t){if(!e)return!1;if("ArrayExpression"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isAssignmentExpression=function(e,t){if(!e)return!1;if("AssignmentExpression"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isBinaryExpression=function(e,t){if(!e)return!1;if("BinaryExpression"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isInterpreterDirective=function(e,t){if(!e)return!1;if("InterpreterDirective"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isDirective=function(e,t){if(!e)return!1;if("Directive"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isDirectiveLiteral=function(e,t){if(!e)return!1;if("DirectiveLiteral"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isBlockStatement=function(e,t){if(!e)return!1;if("BlockStatement"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isBreakStatement=function(e,t){if(!e)return!1;if("BreakStatement"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isCallExpression=function(e,t){if(!e)return!1;if("CallExpression"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isCatchClause=function(e,t){if(!e)return!1;if("CatchClause"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isConditionalExpression=function(e,t){if(!e)return!1;if("ConditionalExpression"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isContinueStatement=function(e,t){if(!e)return!1;if("ContinueStatement"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isDebuggerStatement=function(e,t){if(!e)return!1;if("DebuggerStatement"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isDoWhileStatement=function(e,t){if(!e)return!1;if("DoWhileStatement"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isEmptyStatement=function(e,t){if(!e)return!1;if("EmptyStatement"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isExpressionStatement=function(e,t){if(!e)return!1;if("ExpressionStatement"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isFile=function(e,t){if(!e)return!1;if("File"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isForInStatement=function(e,t){if(!e)return!1;if("ForInStatement"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isForStatement=function(e,t){if(!e)return!1;if("ForStatement"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isFunctionDeclaration=function(e,t){if(!e)return!1;if("FunctionDeclaration"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isFunctionExpression=function(e,t){if(!e)return!1;if("FunctionExpression"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isIdentifier=function(e,t){if(!e)return!1;if("Identifier"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isIfStatement=function(e,t){if(!e)return!1;if("IfStatement"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isLabeledStatement=function(e,t){if(!e)return!1;if("LabeledStatement"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isStringLiteral=function(e,t){if(!e)return!1;if("StringLiteral"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isNumericLiteral=function(e,t){if(!e)return!1;if("NumericLiteral"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isNullLiteral=function(e,t){if(!e)return!1;if("NullLiteral"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isBooleanLiteral=function(e,t){if(!e)return!1;if("BooleanLiteral"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isRegExpLiteral=function(e,t){if(!e)return!1;if("RegExpLiteral"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isLogicalExpression=function(e,t){if(!e)return!1;if("LogicalExpression"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isMemberExpression=function(e,t){if(!e)return!1;if("MemberExpression"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isNewExpression=function(e,t){if(!e)return!1;if("NewExpression"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isProgram=function(e,t){if(!e)return!1;if("Program"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isObjectExpression=function(e,t){if(!e)return!1;if("ObjectExpression"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isObjectMethod=function(e,t){if(!e)return!1;if("ObjectMethod"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isObjectProperty=function(e,t){if(!e)return!1;if("ObjectProperty"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isRestElement=function(e,t){if(!e)return!1;if("RestElement"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isReturnStatement=function(e,t){if(!e)return!1;if("ReturnStatement"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isSequenceExpression=function(e,t){if(!e)return!1;if("SequenceExpression"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isParenthesizedExpression=function(e,t){if(!e)return!1;if("ParenthesizedExpression"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isSwitchCase=function(e,t){if(!e)return!1;if("SwitchCase"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isSwitchStatement=function(e,t){if(!e)return!1;if("SwitchStatement"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isThisExpression=function(e,t){if(!e)return!1;if("ThisExpression"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isThrowStatement=function(e,t){if(!e)return!1;if("ThrowStatement"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isTryStatement=function(e,t){if(!e)return!1;if("TryStatement"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isUnaryExpression=function(e,t){if(!e)return!1;if("UnaryExpression"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isUpdateExpression=function(e,t){if(!e)return!1;if("UpdateExpression"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isVariableDeclaration=function(e,t){if(!e)return!1;if("VariableDeclaration"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isVariableDeclarator=function(e,t){if(!e)return!1;if("VariableDeclarator"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isWhileStatement=function(e,t){if(!e)return!1;if("WhileStatement"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isWithStatement=function(e,t){if(!e)return!1;if("WithStatement"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isAssignmentPattern=function(e,t){if(!e)return!1;if("AssignmentPattern"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isArrayPattern=function(e,t){if(!e)return!1;if("ArrayPattern"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isArrowFunctionExpression=function(e,t){if(!e)return!1;if("ArrowFunctionExpression"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isClassBody=function(e,t){if(!e)return!1;if("ClassBody"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isClassDeclaration=function(e,t){if(!e)return!1;if("ClassDeclaration"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isClassExpression=function(e,t){if(!e)return!1;if("ClassExpression"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isExportAllDeclaration=function(e,t){if(!e)return!1;if("ExportAllDeclaration"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isExportDefaultDeclaration=function(e,t){if(!e)return!1;if("ExportDefaultDeclaration"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isExportNamedDeclaration=function(e,t){if(!e)return!1;if("ExportNamedDeclaration"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isExportSpecifier=function(e,t){if(!e)return!1;if("ExportSpecifier"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isForOfStatement=function(e,t){if(!e)return!1;if("ForOfStatement"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isImportDeclaration=function(e,t){if(!e)return!1;if("ImportDeclaration"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isImportDefaultSpecifier=function(e,t){if(!e)return!1;if("ImportDefaultSpecifier"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isImportNamespaceSpecifier=function(e,t){if(!e)return!1;if("ImportNamespaceSpecifier"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isImportSpecifier=function(e,t){if(!e)return!1;if("ImportSpecifier"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isMetaProperty=function(e,t){if(!e)return!1;if("MetaProperty"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isClassMethod=function(e,t){if(!e)return!1;if("ClassMethod"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isObjectPattern=function(e,t){if(!e)return!1;if("ObjectPattern"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isSpreadElement=function(e,t){if(!e)return!1;if("SpreadElement"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isSuper=function(e,t){if(!e)return!1;if("Super"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isTaggedTemplateExpression=function(e,t){if(!e)return!1;if("TaggedTemplateExpression"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isTemplateElement=function(e,t){if(!e)return!1;if("TemplateElement"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isTemplateLiteral=function(e,t){if(!e)return!1;if("TemplateLiteral"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isYieldExpression=function(e,t){if(!e)return!1;if("YieldExpression"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isAnyTypeAnnotation=function(e,t){if(!e)return!1;if("AnyTypeAnnotation"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isArrayTypeAnnotation=function(e,t){if(!e)return!1;if("ArrayTypeAnnotation"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isBooleanTypeAnnotation=function(e,t){if(!e)return!1;if("BooleanTypeAnnotation"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isBooleanLiteralTypeAnnotation=function(e,t){if(!e)return!1;if("BooleanLiteralTypeAnnotation"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isNullLiteralTypeAnnotation=function(e,t){if(!e)return!1;if("NullLiteralTypeAnnotation"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isClassImplements=function(e,t){if(!e)return!1;if("ClassImplements"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isDeclareClass=function(e,t){if(!e)return!1;if("DeclareClass"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isDeclareFunction=function(e,t){if(!e)return!1;if("DeclareFunction"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isDeclareInterface=function(e,t){if(!e)return!1;if("DeclareInterface"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isDeclareModule=function(e,t){if(!e)return!1;if("DeclareModule"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isDeclareModuleExports=function(e,t){if(!e)return!1;if("DeclareModuleExports"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isDeclareTypeAlias=function(e,t){if(!e)return!1;if("DeclareTypeAlias"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isDeclareOpaqueType=function(e,t){if(!e)return!1;if("DeclareOpaqueType"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isDeclareVariable=function(e,t){if(!e)return!1;if("DeclareVariable"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isDeclareExportDeclaration=function(e,t){if(!e)return!1;if("DeclareExportDeclaration"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isDeclareExportAllDeclaration=function(e,t){if(!e)return!1;if("DeclareExportAllDeclaration"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isDeclaredPredicate=function(e,t){if(!e)return!1;if("DeclaredPredicate"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isExistsTypeAnnotation=function(e,t){if(!e)return!1;if("ExistsTypeAnnotation"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isFunctionTypeAnnotation=function(e,t){if(!e)return!1;if("FunctionTypeAnnotation"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isFunctionTypeParam=function(e,t){if(!e)return!1;if("FunctionTypeParam"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isGenericTypeAnnotation=function(e,t){if(!e)return!1;if("GenericTypeAnnotation"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isInferredPredicate=function(e,t){if(!e)return!1;if("InferredPredicate"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isInterfaceExtends=function(e,t){if(!e)return!1;if("InterfaceExtends"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isInterfaceDeclaration=function(e,t){if(!e)return!1;if("InterfaceDeclaration"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isInterfaceTypeAnnotation=function(e,t){if(!e)return!1;if("InterfaceTypeAnnotation"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isIntersectionTypeAnnotation=function(e,t){if(!e)return!1;if("IntersectionTypeAnnotation"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isMixedTypeAnnotation=function(e,t){if(!e)return!1;if("MixedTypeAnnotation"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isEmptyTypeAnnotation=function(e,t){if(!e)return!1;if("EmptyTypeAnnotation"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isNullableTypeAnnotation=function(e,t){if(!e)return!1;if("NullableTypeAnnotation"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isNumberLiteralTypeAnnotation=function(e,t){if(!e)return!1;if("NumberLiteralTypeAnnotation"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isNumberTypeAnnotation=function(e,t){if(!e)return!1;if("NumberTypeAnnotation"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isObjectTypeAnnotation=function(e,t){if(!e)return!1;if("ObjectTypeAnnotation"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isObjectTypeInternalSlot=function(e,t){if(!e)return!1;if("ObjectTypeInternalSlot"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isObjectTypeCallProperty=function(e,t){if(!e)return!1;if("ObjectTypeCallProperty"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isObjectTypeIndexer=function(e,t){if(!e)return!1;if("ObjectTypeIndexer"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isObjectTypeProperty=function(e,t){if(!e)return!1;if("ObjectTypeProperty"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isObjectTypeSpreadProperty=function(e,t){if(!e)return!1;if("ObjectTypeSpreadProperty"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isOpaqueType=function(e,t){if(!e)return!1;if("OpaqueType"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isQualifiedTypeIdentifier=function(e,t){if(!e)return!1;if("QualifiedTypeIdentifier"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isStringLiteralTypeAnnotation=function(e,t){if(!e)return!1;if("StringLiteralTypeAnnotation"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isStringTypeAnnotation=function(e,t){if(!e)return!1;if("StringTypeAnnotation"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isThisTypeAnnotation=function(e,t){if(!e)return!1;if("ThisTypeAnnotation"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isTupleTypeAnnotation=function(e,t){if(!e)return!1;if("TupleTypeAnnotation"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isTypeofTypeAnnotation=function(e,t){if(!e)return!1;if("TypeofTypeAnnotation"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isTypeAlias=function(e,t){if(!e)return!1;if("TypeAlias"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isTypeAnnotation=function(e,t){if(!e)return!1;if("TypeAnnotation"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isTypeCastExpression=function(e,t){if(!e)return!1;if("TypeCastExpression"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isTypeParameter=function(e,t){if(!e)return!1;if("TypeParameter"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isTypeParameterDeclaration=function(e,t){if(!e)return!1;if("TypeParameterDeclaration"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isTypeParameterInstantiation=function(e,t){if(!e)return!1;if("TypeParameterInstantiation"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isUnionTypeAnnotation=function(e,t){if(!e)return!1;if("UnionTypeAnnotation"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isVariance=function(e,t){if(!e)return!1;if("Variance"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isVoidTypeAnnotation=function(e,t){if(!e)return!1;if("VoidTypeAnnotation"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isJSXAttribute=function(e,t){if(!e)return!1;if("JSXAttribute"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isJSXClosingElement=function(e,t){if(!e)return!1;if("JSXClosingElement"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isJSXElement=function(e,t){if(!e)return!1;if("JSXElement"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isJSXEmptyExpression=function(e,t){if(!e)return!1;if("JSXEmptyExpression"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isJSXExpressionContainer=function(e,t){if(!e)return!1;if("JSXExpressionContainer"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isJSXSpreadChild=function(e,t){if(!e)return!1;if("JSXSpreadChild"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isJSXIdentifier=function(e,t){if(!e)return!1;if("JSXIdentifier"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isJSXMemberExpression=function(e,t){if(!e)return!1;if("JSXMemberExpression"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isJSXNamespacedName=function(e,t){if(!e)return!1;if("JSXNamespacedName"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isJSXOpeningElement=function(e,t){if(!e)return!1;if("JSXOpeningElement"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isJSXSpreadAttribute=function(e,t){if(!e)return!1;if("JSXSpreadAttribute"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isJSXText=function(e,t){if(!e)return!1;if("JSXText"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isJSXFragment=function(e,t){if(!e)return!1;if("JSXFragment"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isJSXOpeningFragment=function(e,t){if(!e)return!1;if("JSXOpeningFragment"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isJSXClosingFragment=function(e,t){if(!e)return!1;if("JSXClosingFragment"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isNoop=function(e,t){if(!e)return!1;if("Noop"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isPlaceholder=function(e,t){if(!e)return!1;if("Placeholder"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isArgumentPlaceholder=function(e,t){if(!e)return!1;if("ArgumentPlaceholder"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isAwaitExpression=function(e,t){if(!e)return!1;if("AwaitExpression"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isBindExpression=function(e,t){if(!e)return!1;if("BindExpression"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isClassProperty=function(e,t){if(!e)return!1;if("ClassProperty"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isOptionalMemberExpression=function(e,t){if(!e)return!1;if("OptionalMemberExpression"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isPipelineTopicExpression=function(e,t){if(!e)return!1;if("PipelineTopicExpression"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isPipelineBareFunction=function(e,t){if(!e)return!1;if("PipelineBareFunction"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isPipelinePrimaryTopicReference=function(e,t){if(!e)return!1;if("PipelinePrimaryTopicReference"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isOptionalCallExpression=function(e,t){if(!e)return!1;if("OptionalCallExpression"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isClassPrivateProperty=function(e,t){if(!e)return!1;if("ClassPrivateProperty"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isClassPrivateMethod=function(e,t){if(!e)return!1;if("ClassPrivateMethod"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isImport=function(e,t){if(!e)return!1;if("Import"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isDecorator=function(e,t){if(!e)return!1;if("Decorator"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isDoExpression=function(e,t){if(!e)return!1;if("DoExpression"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isExportDefaultSpecifier=function(e,t){if(!e)return!1;if("ExportDefaultSpecifier"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isExportNamespaceSpecifier=function(e,t){if(!e)return!1;if("ExportNamespaceSpecifier"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isPrivateName=function(e,t){if(!e)return!1;if("PrivateName"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isBigIntLiteral=function(e,t){if(!e)return!1;if("BigIntLiteral"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isTSParameterProperty=function(e,t){if(!e)return!1;if("TSParameterProperty"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isTSDeclareFunction=function(e,t){if(!e)return!1;if("TSDeclareFunction"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isTSDeclareMethod=function(e,t){if(!e)return!1;if("TSDeclareMethod"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isTSQualifiedName=function(e,t){if(!e)return!1;if("TSQualifiedName"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isTSCallSignatureDeclaration=function(e,t){if(!e)return!1;if("TSCallSignatureDeclaration"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isTSConstructSignatureDeclaration=function(e,t){if(!e)return!1;if("TSConstructSignatureDeclaration"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isTSPropertySignature=function(e,t){if(!e)return!1;if("TSPropertySignature"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isTSMethodSignature=function(e,t){if(!e)return!1;if("TSMethodSignature"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isTSIndexSignature=function(e,t){if(!e)return!1;if("TSIndexSignature"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isTSAnyKeyword=function(e,t){if(!e)return!1;if("TSAnyKeyword"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isTSUnknownKeyword=function(e,t){if(!e)return!1;if("TSUnknownKeyword"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isTSNumberKeyword=function(e,t){if(!e)return!1;if("TSNumberKeyword"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isTSObjectKeyword=function(e,t){if(!e)return!1;if("TSObjectKeyword"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isTSBooleanKeyword=function(e,t){if(!e)return!1;if("TSBooleanKeyword"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isTSStringKeyword=function(e,t){if(!e)return!1;if("TSStringKeyword"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isTSSymbolKeyword=function(e,t){if(!e)return!1;if("TSSymbolKeyword"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isTSVoidKeyword=function(e,t){if(!e)return!1;if("TSVoidKeyword"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isTSUndefinedKeyword=function(e,t){if(!e)return!1;if("TSUndefinedKeyword"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isTSNullKeyword=function(e,t){if(!e)return!1;if("TSNullKeyword"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isTSNeverKeyword=function(e,t){if(!e)return!1;if("TSNeverKeyword"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isTSThisType=function(e,t){if(!e)return!1;if("TSThisType"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isTSFunctionType=function(e,t){if(!e)return!1;if("TSFunctionType"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isTSConstructorType=function(e,t){if(!e)return!1;if("TSConstructorType"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isTSTypeReference=function(e,t){if(!e)return!1;if("TSTypeReference"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isTSTypePredicate=function(e,t){if(!e)return!1;if("TSTypePredicate"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isTSTypeQuery=function(e,t){if(!e)return!1;if("TSTypeQuery"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isTSTypeLiteral=function(e,t){if(!e)return!1;if("TSTypeLiteral"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isTSArrayType=function(e,t){if(!e)return!1;if("TSArrayType"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isTSTupleType=function(e,t){if(!e)return!1;if("TSTupleType"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isTSOptionalType=function(e,t){if(!e)return!1;if("TSOptionalType"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isTSRestType=function(e,t){if(!e)return!1;if("TSRestType"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isTSUnionType=function(e,t){if(!e)return!1;if("TSUnionType"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isTSIntersectionType=function(e,t){if(!e)return!1;if("TSIntersectionType"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isTSConditionalType=function(e,t){if(!e)return!1;if("TSConditionalType"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isTSInferType=function(e,t){if(!e)return!1;if("TSInferType"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isTSParenthesizedType=function(e,t){if(!e)return!1;if("TSParenthesizedType"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isTSTypeOperator=function(e,t){if(!e)return!1;if("TSTypeOperator"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isTSIndexedAccessType=function(e,t){if(!e)return!1;if("TSIndexedAccessType"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isTSMappedType=function(e,t){if(!e)return!1;if("TSMappedType"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isTSLiteralType=function(e,t){if(!e)return!1;if("TSLiteralType"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isTSExpressionWithTypeArguments=function(e,t){if(!e)return!1;if("TSExpressionWithTypeArguments"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isTSInterfaceDeclaration=function(e,t){if(!e)return!1;if("TSInterfaceDeclaration"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isTSInterfaceBody=function(e,t){if(!e)return!1;if("TSInterfaceBody"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isTSTypeAliasDeclaration=function(e,t){if(!e)return!1;if("TSTypeAliasDeclaration"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isTSAsExpression=function(e,t){if(!e)return!1;if("TSAsExpression"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isTSTypeAssertion=function(e,t){if(!e)return!1;if("TSTypeAssertion"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isTSEnumDeclaration=function(e,t){if(!e)return!1;if("TSEnumDeclaration"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isTSEnumMember=function(e,t){if(!e)return!1;if("TSEnumMember"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isTSModuleDeclaration=function(e,t){if(!e)return!1;if("TSModuleDeclaration"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isTSModuleBlock=function(e,t){if(!e)return!1;if("TSModuleBlock"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isTSImportType=function(e,t){if(!e)return!1;if("TSImportType"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isTSImportEqualsDeclaration=function(e,t){if(!e)return!1;if("TSImportEqualsDeclaration"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isTSExternalModuleReference=function(e,t){if(!e)return!1;if("TSExternalModuleReference"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isTSNonNullExpression=function(e,t){if(!e)return!1;if("TSNonNullExpression"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isTSExportAssignment=function(e,t){if(!e)return!1;if("TSExportAssignment"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isTSNamespaceExportDeclaration=function(e,t){if(!e)return!1;if("TSNamespaceExportDeclaration"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isTSTypeAnnotation=function(e,t){if(!e)return!1;if("TSTypeAnnotation"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isTSTypeParameterInstantiation=function(e,t){if(!e)return!1;if("TSTypeParameterInstantiation"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isTSTypeParameterDeclaration=function(e,t){if(!e)return!1;if("TSTypeParameterDeclaration"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isTSTypeParameter=function(e,t){if(!e)return!1;if("TSTypeParameter"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isExpression=function(e,t){if(!e)return!1;const n=e.type;if("Expression"===n||"ArrayExpression"===n||"AssignmentExpression"===n||"BinaryExpression"===n||"CallExpression"===n||"ConditionalExpression"===n||"FunctionExpression"===n||"Identifier"===n||"StringLiteral"===n||"NumericLiteral"===n||"NullLiteral"===n||"BooleanLiteral"===n||"RegExpLiteral"===n||"LogicalExpression"===n||"MemberExpression"===n||"NewExpression"===n||"ObjectExpression"===n||"SequenceExpression"===n||"ParenthesizedExpression"===n||"ThisExpression"===n||"UnaryExpression"===n||"UpdateExpression"===n||"ArrowFunctionExpression"===n||"ClassExpression"===n||"MetaProperty"===n||"Super"===n||"TaggedTemplateExpression"===n||"TemplateLiteral"===n||"YieldExpression"===n||"TypeCastExpression"===n||"JSXElement"===n||"JSXFragment"===n||"AwaitExpression"===n||"BindExpression"===n||"OptionalMemberExpression"===n||"PipelinePrimaryTopicReference"===n||"OptionalCallExpression"===n||"Import"===n||"DoExpression"===n||"BigIntLiteral"===n||"TSAsExpression"===n||"TSTypeAssertion"===n||"TSNonNullExpression"===n||"Placeholder"===n&&("Expression"===e.expectedNode||"Identifier"===e.expectedNode||"StringLiteral"===e.expectedNode))return void 0===t||(0,r.default)(e,t);return!1},t.isBinary=function(e,t){if(!e)return!1;const n=e.type;if("Binary"===n||"BinaryExpression"===n||"LogicalExpression"===n)return void 0===t||(0,r.default)(e,t);return!1},t.isScopable=function(e,t){if(!e)return!1;const n=e.type;if("Scopable"===n||"BlockStatement"===n||"CatchClause"===n||"DoWhileStatement"===n||"ForInStatement"===n||"ForStatement"===n||"FunctionDeclaration"===n||"FunctionExpression"===n||"Program"===n||"ObjectMethod"===n||"SwitchStatement"===n||"WhileStatement"===n||"ArrowFunctionExpression"===n||"ClassDeclaration"===n||"ClassExpression"===n||"ForOfStatement"===n||"ClassMethod"===n||"ClassPrivateMethod"===n||"TSModuleBlock"===n||"Placeholder"===n&&"BlockStatement"===e.expectedNode)return void 0===t||(0,r.default)(e,t);return!1},t.isBlockParent=function(e,t){if(!e)return!1;const n=e.type;if("BlockParent"===n||"BlockStatement"===n||"CatchClause"===n||"DoWhileStatement"===n||"ForInStatement"===n||"ForStatement"===n||"FunctionDeclaration"===n||"FunctionExpression"===n||"Program"===n||"ObjectMethod"===n||"SwitchStatement"===n||"WhileStatement"===n||"ArrowFunctionExpression"===n||"ForOfStatement"===n||"ClassMethod"===n||"ClassPrivateMethod"===n||"TSModuleBlock"===n||"Placeholder"===n&&"BlockStatement"===e.expectedNode)return void 0===t||(0,r.default)(e,t);return!1},t.isBlock=function(e,t){if(!e)return!1;const n=e.type;if("Block"===n||"BlockStatement"===n||"Program"===n||"TSModuleBlock"===n||"Placeholder"===n&&"BlockStatement"===e.expectedNode)return void 0===t||(0,r.default)(e,t);return!1},t.isStatement=function(e,t){if(!e)return!1;const n=e.type;if("Statement"===n||"BlockStatement"===n||"BreakStatement"===n||"ContinueStatement"===n||"DebuggerStatement"===n||"DoWhileStatement"===n||"EmptyStatement"===n||"ExpressionStatement"===n||"ForInStatement"===n||"ForStatement"===n||"FunctionDeclaration"===n||"IfStatement"===n||"LabeledStatement"===n||"ReturnStatement"===n||"SwitchStatement"===n||"ThrowStatement"===n||"TryStatement"===n||"VariableDeclaration"===n||"WhileStatement"===n||"WithStatement"===n||"ClassDeclaration"===n||"ExportAllDeclaration"===n||"ExportDefaultDeclaration"===n||"ExportNamedDeclaration"===n||"ForOfStatement"===n||"ImportDeclaration"===n||"DeclareClass"===n||"DeclareFunction"===n||"DeclareInterface"===n||"DeclareModule"===n||"DeclareModuleExports"===n||"DeclareTypeAlias"===n||"DeclareOpaqueType"===n||"DeclareVariable"===n||"DeclareExportDeclaration"===n||"DeclareExportAllDeclaration"===n||"InterfaceDeclaration"===n||"OpaqueType"===n||"TypeAlias"===n||"TSDeclareFunction"===n||"TSInterfaceDeclaration"===n||"TSTypeAliasDeclaration"===n||"TSEnumDeclaration"===n||"TSModuleDeclaration"===n||"TSImportEqualsDeclaration"===n||"TSExportAssignment"===n||"TSNamespaceExportDeclaration"===n||"Placeholder"===n&&("Statement"===e.expectedNode||"Declaration"===e.expectedNode||"BlockStatement"===e.expectedNode))return void 0===t||(0,r.default)(e,t);return!1},t.isTerminatorless=function(e,t){if(!e)return!1;const n=e.type;if("Terminatorless"===n||"BreakStatement"===n||"ContinueStatement"===n||"ReturnStatement"===n||"ThrowStatement"===n||"YieldExpression"===n||"AwaitExpression"===n)return void 0===t||(0,r.default)(e,t);return!1},t.isCompletionStatement=function(e,t){if(!e)return!1;const n=e.type;if("CompletionStatement"===n||"BreakStatement"===n||"ContinueStatement"===n||"ReturnStatement"===n||"ThrowStatement"===n)return void 0===t||(0,r.default)(e,t);return!1},t.isConditional=function(e,t){if(!e)return!1;const n=e.type;if("Conditional"===n||"ConditionalExpression"===n||"IfStatement"===n)return void 0===t||(0,r.default)(e,t);return!1},t.isLoop=function(e,t){if(!e)return!1;const n=e.type;if("Loop"===n||"DoWhileStatement"===n||"ForInStatement"===n||"ForStatement"===n||"WhileStatement"===n||"ForOfStatement"===n)return void 0===t||(0,r.default)(e,t);return!1},t.isWhile=function(e,t){if(!e)return!1;const n=e.type;if("While"===n||"DoWhileStatement"===n||"WhileStatement"===n)return void 0===t||(0,r.default)(e,t);return!1},t.isExpressionWrapper=function(e,t){if(!e)return!1;const n=e.type;if("ExpressionWrapper"===n||"ExpressionStatement"===n||"ParenthesizedExpression"===n||"TypeCastExpression"===n)return void 0===t||(0,r.default)(e,t);return!1},t.isFor=function(e,t){if(!e)return!1;const n=e.type;if("For"===n||"ForInStatement"===n||"ForStatement"===n||"ForOfStatement"===n)return void 0===t||(0,r.default)(e,t);return!1},t.isForXStatement=function(e,t){if(!e)return!1;const n=e.type;if("ForXStatement"===n||"ForInStatement"===n||"ForOfStatement"===n)return void 0===t||(0,r.default)(e,t);return!1},t.isFunction=function(e,t){if(!e)return!1;const n=e.type;if("Function"===n||"FunctionDeclaration"===n||"FunctionExpression"===n||"ObjectMethod"===n||"ArrowFunctionExpression"===n||"ClassMethod"===n||"ClassPrivateMethod"===n)return void 0===t||(0,r.default)(e,t);return!1},t.isFunctionParent=function(e,t){if(!e)return!1;const n=e.type;if("FunctionParent"===n||"FunctionDeclaration"===n||"FunctionExpression"===n||"ObjectMethod"===n||"ArrowFunctionExpression"===n||"ClassMethod"===n||"ClassPrivateMethod"===n)return void 0===t||(0,r.default)(e,t);return!1},t.isPureish=function(e,t){if(!e)return!1;const n=e.type;if("Pureish"===n||"FunctionDeclaration"===n||"FunctionExpression"===n||"StringLiteral"===n||"NumericLiteral"===n||"NullLiteral"===n||"BooleanLiteral"===n||"ArrowFunctionExpression"===n||"ClassDeclaration"===n||"ClassExpression"===n||"BigIntLiteral"===n||"Placeholder"===n&&"StringLiteral"===e.expectedNode)return void 0===t||(0,r.default)(e,t);return!1},t.isDeclaration=function(e,t){if(!e)return!1;const n=e.type;if("Declaration"===n||"FunctionDeclaration"===n||"VariableDeclaration"===n||"ClassDeclaration"===n||"ExportAllDeclaration"===n||"ExportDefaultDeclaration"===n||"ExportNamedDeclaration"===n||"ImportDeclaration"===n||"DeclareClass"===n||"DeclareFunction"===n||"DeclareInterface"===n||"DeclareModule"===n||"DeclareModuleExports"===n||"DeclareTypeAlias"===n||"DeclareOpaqueType"===n||"DeclareVariable"===n||"DeclareExportDeclaration"===n||"DeclareExportAllDeclaration"===n||"InterfaceDeclaration"===n||"OpaqueType"===n||"TypeAlias"===n||"TSDeclareFunction"===n||"TSInterfaceDeclaration"===n||"TSTypeAliasDeclaration"===n||"TSEnumDeclaration"===n||"TSModuleDeclaration"===n||"Placeholder"===n&&"Declaration"===e.expectedNode)return void 0===t||(0,r.default)(e,t);return!1},t.isPatternLike=function(e,t){if(!e)return!1;const n=e.type;if("PatternLike"===n||"Identifier"===n||"RestElement"===n||"AssignmentPattern"===n||"ArrayPattern"===n||"ObjectPattern"===n||"Placeholder"===n&&("Pattern"===e.expectedNode||"Identifier"===e.expectedNode))return void 0===t||(0,r.default)(e,t);return!1},t.isLVal=function(e,t){if(!e)return!1;const n=e.type;if("LVal"===n||"Identifier"===n||"MemberExpression"===n||"RestElement"===n||"AssignmentPattern"===n||"ArrayPattern"===n||"ObjectPattern"===n||"TSParameterProperty"===n||"Placeholder"===n&&("Pattern"===e.expectedNode||"Identifier"===e.expectedNode))return void 0===t||(0,r.default)(e,t);return!1},t.isTSEntityName=function(e,t){if(!e)return!1;const n=e.type;if("TSEntityName"===n||"Identifier"===n||"TSQualifiedName"===n||"Placeholder"===n&&"Identifier"===e.expectedNode)return void 0===t||(0,r.default)(e,t);return!1},t.isLiteral=function(e,t){if(!e)return!1;const n=e.type;if("Literal"===n||"StringLiteral"===n||"NumericLiteral"===n||"NullLiteral"===n||"BooleanLiteral"===n||"RegExpLiteral"===n||"TemplateLiteral"===n||"BigIntLiteral"===n||"Placeholder"===n&&"StringLiteral"===e.expectedNode)return void 0===t||(0,r.default)(e,t);return!1},t.isImmutable=function(e,t){if(!e)return!1;const n=e.type;if("Immutable"===n||"StringLiteral"===n||"NumericLiteral"===n||"NullLiteral"===n||"BooleanLiteral"===n||"JSXAttribute"===n||"JSXClosingElement"===n||"JSXElement"===n||"JSXExpressionContainer"===n||"JSXSpreadChild"===n||"JSXOpeningElement"===n||"JSXText"===n||"JSXFragment"===n||"JSXOpeningFragment"===n||"JSXClosingFragment"===n||"BigIntLiteral"===n||"Placeholder"===n&&"StringLiteral"===e.expectedNode)return void 0===t||(0,r.default)(e,t);return!1},t.isUserWhitespacable=function(e,t){if(!e)return!1;const n=e.type;if("UserWhitespacable"===n||"ObjectMethod"===n||"ObjectProperty"===n||"ObjectTypeInternalSlot"===n||"ObjectTypeCallProperty"===n||"ObjectTypeIndexer"===n||"ObjectTypeProperty"===n||"ObjectTypeSpreadProperty"===n)return void 0===t||(0,r.default)(e,t);return!1},t.isMethod=function(e,t){if(!e)return!1;const n=e.type;if("Method"===n||"ObjectMethod"===n||"ClassMethod"===n||"ClassPrivateMethod"===n)return void 0===t||(0,r.default)(e,t);return!1},t.isObjectMember=function(e,t){if(!e)return!1;const n=e.type;if("ObjectMember"===n||"ObjectMethod"===n||"ObjectProperty"===n)return void 0===t||(0,r.default)(e,t);return!1},t.isProperty=function(e,t){if(!e)return!1;const n=e.type;if("Property"===n||"ObjectProperty"===n||"ClassProperty"===n||"ClassPrivateProperty"===n)return void 0===t||(0,r.default)(e,t);return!1},t.isUnaryLike=function(e,t){if(!e)return!1;const n=e.type;if("UnaryLike"===n||"UnaryExpression"===n||"SpreadElement"===n)return void 0===t||(0,r.default)(e,t);return!1},t.isPattern=function(e,t){if(!e)return!1;const n=e.type;if("Pattern"===n||"AssignmentPattern"===n||"ArrayPattern"===n||"ObjectPattern"===n||"Placeholder"===n&&"Pattern"===e.expectedNode)return void 0===t||(0,r.default)(e,t);return!1},t.isClass=function(e,t){if(!e)return!1;const n=e.type;if("Class"===n||"ClassDeclaration"===n||"ClassExpression"===n)return void 0===t||(0,r.default)(e,t);return!1},t.isModuleDeclaration=function(e,t){if(!e)return!1;const n=e.type;if("ModuleDeclaration"===n||"ExportAllDeclaration"===n||"ExportDefaultDeclaration"===n||"ExportNamedDeclaration"===n||"ImportDeclaration"===n)return void 0===t||(0,r.default)(e,t);return!1},t.isExportDeclaration=function(e,t){if(!e)return!1;const n=e.type;if("ExportDeclaration"===n||"ExportAllDeclaration"===n||"ExportDefaultDeclaration"===n||"ExportNamedDeclaration"===n)return void 0===t||(0,r.default)(e,t);return!1},t.isModuleSpecifier=function(e,t){if(!e)return!1;const n=e.type;if("ModuleSpecifier"===n||"ExportSpecifier"===n||"ImportDefaultSpecifier"===n||"ImportNamespaceSpecifier"===n||"ImportSpecifier"===n||"ExportDefaultSpecifier"===n||"ExportNamespaceSpecifier"===n)return void 0===t||(0,r.default)(e,t);return!1},t.isFlow=function(e,t){if(!e)return!1;const n=e.type;if("Flow"===n||"AnyTypeAnnotation"===n||"ArrayTypeAnnotation"===n||"BooleanTypeAnnotation"===n||"BooleanLiteralTypeAnnotation"===n||"NullLiteralTypeAnnotation"===n||"ClassImplements"===n||"DeclareClass"===n||"DeclareFunction"===n||"DeclareInterface"===n||"DeclareModule"===n||"DeclareModuleExports"===n||"DeclareTypeAlias"===n||"DeclareOpaqueType"===n||"DeclareVariable"===n||"DeclareExportDeclaration"===n||"DeclareExportAllDeclaration"===n||"DeclaredPredicate"===n||"ExistsTypeAnnotation"===n||"FunctionTypeAnnotation"===n||"FunctionTypeParam"===n||"GenericTypeAnnotation"===n||"InferredPredicate"===n||"InterfaceExtends"===n||"InterfaceDeclaration"===n||"InterfaceTypeAnnotation"===n||"IntersectionTypeAnnotation"===n||"MixedTypeAnnotation"===n||"EmptyTypeAnnotation"===n||"NullableTypeAnnotation"===n||"NumberLiteralTypeAnnotation"===n||"NumberTypeAnnotation"===n||"ObjectTypeAnnotation"===n||"ObjectTypeInternalSlot"===n||"ObjectTypeCallProperty"===n||"ObjectTypeIndexer"===n||"ObjectTypeProperty"===n||"ObjectTypeSpreadProperty"===n||"OpaqueType"===n||"QualifiedTypeIdentifier"===n||"StringLiteralTypeAnnotation"===n||"StringTypeAnnotation"===n||"ThisTypeAnnotation"===n||"TupleTypeAnnotation"===n||"TypeofTypeAnnotation"===n||"TypeAlias"===n||"TypeAnnotation"===n||"TypeCastExpression"===n||"TypeParameter"===n||"TypeParameterDeclaration"===n||"TypeParameterInstantiation"===n||"UnionTypeAnnotation"===n||"Variance"===n||"VoidTypeAnnotation"===n)return void 0===t||(0,r.default)(e,t);return!1},t.isFlowType=function(e,t){if(!e)return!1;const n=e.type;if("FlowType"===n||"AnyTypeAnnotation"===n||"ArrayTypeAnnotation"===n||"BooleanTypeAnnotation"===n||"BooleanLiteralTypeAnnotation"===n||"NullLiteralTypeAnnotation"===n||"ExistsTypeAnnotation"===n||"FunctionTypeAnnotation"===n||"GenericTypeAnnotation"===n||"InterfaceTypeAnnotation"===n||"IntersectionTypeAnnotation"===n||"MixedTypeAnnotation"===n||"EmptyTypeAnnotation"===n||"NullableTypeAnnotation"===n||"NumberLiteralTypeAnnotation"===n||"NumberTypeAnnotation"===n||"ObjectTypeAnnotation"===n||"StringLiteralTypeAnnotation"===n||"StringTypeAnnotation"===n||"ThisTypeAnnotation"===n||"TupleTypeAnnotation"===n||"TypeofTypeAnnotation"===n||"UnionTypeAnnotation"===n||"VoidTypeAnnotation"===n)return void 0===t||(0,r.default)(e,t);return!1},t.isFlowBaseAnnotation=function(e,t){if(!e)return!1;const n=e.type;if("FlowBaseAnnotation"===n||"AnyTypeAnnotation"===n||"BooleanTypeAnnotation"===n||"NullLiteralTypeAnnotation"===n||"MixedTypeAnnotation"===n||"EmptyTypeAnnotation"===n||"NumberTypeAnnotation"===n||"StringTypeAnnotation"===n||"ThisTypeAnnotation"===n||"VoidTypeAnnotation"===n)return void 0===t||(0,r.default)(e,t);return!1},t.isFlowDeclaration=function(e,t){if(!e)return!1;const n=e.type;if("FlowDeclaration"===n||"DeclareClass"===n||"DeclareFunction"===n||"DeclareInterface"===n||"DeclareModule"===n||"DeclareModuleExports"===n||"DeclareTypeAlias"===n||"DeclareOpaqueType"===n||"DeclareVariable"===n||"DeclareExportDeclaration"===n||"DeclareExportAllDeclaration"===n||"InterfaceDeclaration"===n||"OpaqueType"===n||"TypeAlias"===n)return void 0===t||(0,r.default)(e,t);return!1},t.isFlowPredicate=function(e,t){if(!e)return!1;const n=e.type;if("FlowPredicate"===n||"DeclaredPredicate"===n||"InferredPredicate"===n)return void 0===t||(0,r.default)(e,t);return!1},t.isJSX=function(e,t){if(!e)return!1;const n=e.type;if("JSX"===n||"JSXAttribute"===n||"JSXClosingElement"===n||"JSXElement"===n||"JSXEmptyExpression"===n||"JSXExpressionContainer"===n||"JSXSpreadChild"===n||"JSXIdentifier"===n||"JSXMemberExpression"===n||"JSXNamespacedName"===n||"JSXOpeningElement"===n||"JSXSpreadAttribute"===n||"JSXText"===n||"JSXFragment"===n||"JSXOpeningFragment"===n||"JSXClosingFragment"===n)return void 0===t||(0,r.default)(e,t);return!1},t.isPrivate=function(e,t){if(!e)return!1;const n=e.type;if("Private"===n||"ClassPrivateProperty"===n||"ClassPrivateMethod"===n||"PrivateName"===n)return void 0===t||(0,r.default)(e,t);return!1},t.isTSTypeElement=function(e,t){if(!e)return!1;const n=e.type;if("TSTypeElement"===n||"TSCallSignatureDeclaration"===n||"TSConstructSignatureDeclaration"===n||"TSPropertySignature"===n||"TSMethodSignature"===n||"TSIndexSignature"===n)return void 0===t||(0,r.default)(e,t);return!1},t.isTSType=function(e,t){if(!e)return!1;const n=e.type;if("TSType"===n||"TSAnyKeyword"===n||"TSUnknownKeyword"===n||"TSNumberKeyword"===n||"TSObjectKeyword"===n||"TSBooleanKeyword"===n||"TSStringKeyword"===n||"TSSymbolKeyword"===n||"TSVoidKeyword"===n||"TSUndefinedKeyword"===n||"TSNullKeyword"===n||"TSNeverKeyword"===n||"TSThisType"===n||"TSFunctionType"===n||"TSConstructorType"===n||"TSTypeReference"===n||"TSTypePredicate"===n||"TSTypeQuery"===n||"TSTypeLiteral"===n||"TSArrayType"===n||"TSTupleType"===n||"TSOptionalType"===n||"TSRestType"===n||"TSUnionType"===n||"TSIntersectionType"===n||"TSConditionalType"===n||"TSInferType"===n||"TSParenthesizedType"===n||"TSTypeOperator"===n||"TSIndexedAccessType"===n||"TSMappedType"===n||"TSLiteralType"===n||"TSExpressionWithTypeArguments"===n||"TSImportType"===n)return void 0===t||(0,r.default)(e,t);return!1},t.isNumberLiteral=function(e,t){if(console.trace("The node type NumberLiteral has been renamed to NumericLiteral"),!e)return!1;if("NumberLiteral"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isRegexLiteral=function(e,t){if(console.trace("The node type RegexLiteral has been renamed to RegExpLiteral"),!e)return!1;if("RegexLiteral"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isRestProperty=function(e,t){if(console.trace("The node type RestProperty has been renamed to RestElement"),!e)return!1;if("RestProperty"===e.type)return void 0===t||(0,r.default)(e,t);return!1},t.isSpreadProperty=function(e,t){if(console.trace("The node type SpreadProperty has been renamed to SpreadElement"),!e)return!1;if("SpreadProperty"===e.type)return void 0===t||(0,r.default)(e,t);return!1};var r=function(e){return e&&e.__esModule?e:{default:e}}(n(33))},function(e,t,n){"use strict";function r(){const e=function(e){return e&&e.__esModule?e:{default:e}}(n(187));return r=function(){return e},e}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"VISITOR_KEYS",{enumerable:!0,get:function(){return i.VISITOR_KEYS}}),Object.defineProperty(t,"ALIAS_KEYS",{enumerable:!0,get:function(){return i.ALIAS_KEYS}}),Object.defineProperty(t,"FLIPPED_ALIAS_KEYS",{enumerable:!0,get:function(){return i.FLIPPED_ALIAS_KEYS}}),Object.defineProperty(t,"NODE_FIELDS",{enumerable:!0,get:function(){return i.NODE_FIELDS}}),Object.defineProperty(t,"BUILDER_KEYS",{enumerable:!0,get:function(){return i.BUILDER_KEYS}}),Object.defineProperty(t,"DEPRECATED_KEYS",{enumerable:!0,get:function(){return i.DEPRECATED_KEYS}}),Object.defineProperty(t,"PLACEHOLDERS",{enumerable:!0,get:function(){return s.PLACEHOLDERS}}),Object.defineProperty(t,"PLACEHOLDERS_ALIAS",{enumerable:!0,get:function(){return s.PLACEHOLDERS_ALIAS}}),Object.defineProperty(t,"PLACEHOLDERS_FLIPPED_ALIAS",{enumerable:!0,get:function(){return s.PLACEHOLDERS_FLIPPED_ALIAS}}),t.TYPES=void 0,n(42),n(46),n(190),n(191),n(192),n(193),n(194);var i=n(7),s=n(77);(0,r().default)(i.VISITOR_KEYS),(0,r().default)(i.ALIAS_KEYS),(0,r().default)(i.FLIPPED_ALIAS_KEYS),(0,r().default)(i.NODE_FIELDS),(0,r().default)(i.BUILDER_KEYS),(0,r().default)(i.DEPRECATED_KEYS),(0,r().default)(s.PLACEHOLDERS_ALIAS),(0,r().default)(s.PLACEHOLDERS_FLIPPED_ALIAS);const o=Object.keys(i.VISITOR_KEYS).concat(Object.keys(i.FLIPPED_ALIAS_KEYS)).concat(Object.keys(i.DEPRECATED_KEYS));t.TYPES=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.arrayExpression=t.ArrayExpression=function(...e){return(0,r.default)("ArrayExpression",...e)},t.assignmentExpression=t.AssignmentExpression=function(...e){return(0,r.default)("AssignmentExpression",...e)},t.binaryExpression=t.BinaryExpression=function(...e){return(0,r.default)("BinaryExpression",...e)},t.interpreterDirective=t.InterpreterDirective=function(...e){return(0,r.default)("InterpreterDirective",...e)},t.directive=t.Directive=function(...e){return(0,r.default)("Directive",...e)},t.directiveLiteral=t.DirectiveLiteral=function(...e){return(0,r.default)("DirectiveLiteral",...e)},t.blockStatement=t.BlockStatement=function(...e){return(0,r.default)("BlockStatement",...e)},t.breakStatement=t.BreakStatement=function(...e){return(0,r.default)("BreakStatement",...e)},t.callExpression=t.CallExpression=function(...e){return(0,r.default)("CallExpression",...e)},t.catchClause=t.CatchClause=function(...e){return(0,r.default)("CatchClause",...e)},t.conditionalExpression=t.ConditionalExpression=function(...e){return(0,r.default)("ConditionalExpression",...e)},t.continueStatement=t.ContinueStatement=function(...e){return(0,r.default)("ContinueStatement",...e)},t.debuggerStatement=t.DebuggerStatement=function(...e){return(0,r.default)("DebuggerStatement",...e)},t.doWhileStatement=t.DoWhileStatement=function(...e){return(0,r.default)("DoWhileStatement",...e)},t.emptyStatement=t.EmptyStatement=function(...e){return(0,r.default)("EmptyStatement",...e)},t.expressionStatement=t.ExpressionStatement=function(...e){return(0,r.default)("ExpressionStatement",...e)},t.file=t.File=function(...e){return(0,r.default)("File",...e)},t.forInStatement=t.ForInStatement=function(...e){return(0,r.default)("ForInStatement",...e)},t.forStatement=t.ForStatement=function(...e){return(0,r.default)("ForStatement",...e)},t.functionDeclaration=t.FunctionDeclaration=function(...e){return(0,r.default)("FunctionDeclaration",...e)},t.functionExpression=t.FunctionExpression=function(...e){return(0,r.default)("FunctionExpression",...e)},t.identifier=t.Identifier=function(...e){return(0,r.default)("Identifier",...e)},t.ifStatement=t.IfStatement=function(...e){return(0,r.default)("IfStatement",...e)},t.labeledStatement=t.LabeledStatement=function(...e){return(0,r.default)("LabeledStatement",...e)},t.stringLiteral=t.StringLiteral=function(...e){return(0,r.default)("StringLiteral",...e)},t.numericLiteral=t.NumericLiteral=function(...e){return(0,r.default)("NumericLiteral",...e)},t.nullLiteral=t.NullLiteral=function(...e){return(0,r.default)("NullLiteral",...e)},t.booleanLiteral=t.BooleanLiteral=function(...e){return(0,r.default)("BooleanLiteral",...e)},t.regExpLiteral=t.RegExpLiteral=function(...e){return(0,r.default)("RegExpLiteral",...e)},t.logicalExpression=t.LogicalExpression=function(...e){return(0,r.default)("LogicalExpression",...e)},t.memberExpression=t.MemberExpression=function(...e){return(0,r.default)("MemberExpression",...e)},t.newExpression=t.NewExpression=function(...e){return(0,r.default)("NewExpression",...e)},t.program=t.Program=function(...e){return(0,r.default)("Program",...e)},t.objectExpression=t.ObjectExpression=function(...e){return(0,r.default)("ObjectExpression",...e)},t.objectMethod=t.ObjectMethod=function(...e){return(0,r.default)("ObjectMethod",...e)},t.objectProperty=t.ObjectProperty=function(...e){return(0,r.default)("ObjectProperty",...e)},t.restElement=t.RestElement=function(...e){return(0,r.default)("RestElement",...e)},t.returnStatement=t.ReturnStatement=function(...e){return(0,r.default)("ReturnStatement",...e)},t.sequenceExpression=t.SequenceExpression=function(...e){return(0,r.default)("SequenceExpression",...e)},t.parenthesizedExpression=t.ParenthesizedExpression=function(...e){return(0,r.default)("ParenthesizedExpression",...e)},t.switchCase=t.SwitchCase=function(...e){return(0,r.default)("SwitchCase",...e)},t.switchStatement=t.SwitchStatement=function(...e){return(0,r.default)("SwitchStatement",...e)},t.thisExpression=t.ThisExpression=function(...e){return(0,r.default)("ThisExpression",...e)},t.throwStatement=t.ThrowStatement=function(...e){return(0,r.default)("ThrowStatement",...e)},t.tryStatement=t.TryStatement=function(...e){return(0,r.default)("TryStatement",...e)},t.unaryExpression=t.UnaryExpression=function(...e){return(0,r.default)("UnaryExpression",...e)},t.updateExpression=t.UpdateExpression=function(...e){return(0,r.default)("UpdateExpression",...e)},t.variableDeclaration=t.VariableDeclaration=function(...e){return(0,r.default)("VariableDeclaration",...e)},t.variableDeclarator=t.VariableDeclarator=function(...e){return(0,r.default)("VariableDeclarator",...e)},t.whileStatement=t.WhileStatement=function(...e){return(0,r.default)("WhileStatement",...e)},t.withStatement=t.WithStatement=function(...e){return(0,r.default)("WithStatement",...e)},t.assignmentPattern=t.AssignmentPattern=function(...e){return(0,r.default)("AssignmentPattern",...e)},t.arrayPattern=t.ArrayPattern=function(...e){return(0,r.default)("ArrayPattern",...e)},t.arrowFunctionExpression=t.ArrowFunctionExpression=function(...e){return(0,r.default)("ArrowFunctionExpression",...e)},t.classBody=t.ClassBody=function(...e){return(0,r.default)("ClassBody",...e)},t.classDeclaration=t.ClassDeclaration=function(...e){return(0,r.default)("ClassDeclaration",...e)},t.classExpression=t.ClassExpression=function(...e){return(0,r.default)("ClassExpression",...e)},t.exportAllDeclaration=t.ExportAllDeclaration=function(...e){return(0,r.default)("ExportAllDeclaration",...e)},t.exportDefaultDeclaration=t.ExportDefaultDeclaration=function(...e){return(0,r.default)("ExportDefaultDeclaration",...e)},t.exportNamedDeclaration=t.ExportNamedDeclaration=function(...e){return(0,r.default)("ExportNamedDeclaration",...e)},t.exportSpecifier=t.ExportSpecifier=function(...e){return(0,r.default)("ExportSpecifier",...e)},t.forOfStatement=t.ForOfStatement=function(...e){return(0,r.default)("ForOfStatement",...e)},t.importDeclaration=t.ImportDeclaration=function(...e){return(0,r.default)("ImportDeclaration",...e)},t.importDefaultSpecifier=t.ImportDefaultSpecifier=function(...e){return(0,r.default)("ImportDefaultSpecifier",...e)},t.importNamespaceSpecifier=t.ImportNamespaceSpecifier=function(...e){return(0,r.default)("ImportNamespaceSpecifier",...e)},t.importSpecifier=t.ImportSpecifier=function(...e){return(0,r.default)("ImportSpecifier",...e)},t.metaProperty=t.MetaProperty=function(...e){return(0,r.default)("MetaProperty",...e)},t.classMethod=t.ClassMethod=function(...e){return(0,r.default)("ClassMethod",...e)},t.objectPattern=t.ObjectPattern=function(...e){return(0,r.default)("ObjectPattern",...e)},t.spreadElement=t.SpreadElement=function(...e){return(0,r.default)("SpreadElement",...e)},t.super=t.Super=function(...e){return(0,r.default)("Super",...e)},t.taggedTemplateExpression=t.TaggedTemplateExpression=function(...e){return(0,r.default)("TaggedTemplateExpression",...e)},t.templateElement=t.TemplateElement=function(...e){return(0,r.default)("TemplateElement",...e)},t.templateLiteral=t.TemplateLiteral=function(...e){return(0,r.default)("TemplateLiteral",...e)},t.yieldExpression=t.YieldExpression=function(...e){return(0,r.default)("YieldExpression",...e)},t.anyTypeAnnotation=t.AnyTypeAnnotation=function(...e){return(0,r.default)("AnyTypeAnnotation",...e)},t.arrayTypeAnnotation=t.ArrayTypeAnnotation=function(...e){return(0,r.default)("ArrayTypeAnnotation",...e)},t.booleanTypeAnnotation=t.BooleanTypeAnnotation=function(...e){return(0,r.default)("BooleanTypeAnnotation",...e)},t.booleanLiteralTypeAnnotation=t.BooleanLiteralTypeAnnotation=function(...e){return(0,r.default)("BooleanLiteralTypeAnnotation",...e)},t.nullLiteralTypeAnnotation=t.NullLiteralTypeAnnotation=function(...e){return(0,r.default)("NullLiteralTypeAnnotation",...e)},t.classImplements=t.ClassImplements=function(...e){return(0,r.default)("ClassImplements",...e)},t.declareClass=t.DeclareClass=function(...e){return(0,r.default)("DeclareClass",...e)},t.declareFunction=t.DeclareFunction=function(...e){return(0,r.default)("DeclareFunction",...e)},t.declareInterface=t.DeclareInterface=function(...e){return(0,r.default)("DeclareInterface",...e)},t.declareModule=t.DeclareModule=function(...e){return(0,r.default)("DeclareModule",...e)},t.declareModuleExports=t.DeclareModuleExports=function(...e){return(0,r.default)("DeclareModuleExports",...e)},t.declareTypeAlias=t.DeclareTypeAlias=function(...e){return(0,r.default)("DeclareTypeAlias",...e)},t.declareOpaqueType=t.DeclareOpaqueType=function(...e){return(0,r.default)("DeclareOpaqueType",...e)},t.declareVariable=t.DeclareVariable=function(...e){return(0,r.default)("DeclareVariable",...e)},t.declareExportDeclaration=t.DeclareExportDeclaration=function(...e){return(0,r.default)("DeclareExportDeclaration",...e)},t.declareExportAllDeclaration=t.DeclareExportAllDeclaration=function(...e){return(0,r.default)("DeclareExportAllDeclaration",...e)},t.declaredPredicate=t.DeclaredPredicate=function(...e){return(0,r.default)("DeclaredPredicate",...e)},t.existsTypeAnnotation=t.ExistsTypeAnnotation=function(...e){return(0,r.default)("ExistsTypeAnnotation",...e)},t.functionTypeAnnotation=t.FunctionTypeAnnotation=function(...e){return(0,r.default)("FunctionTypeAnnotation",...e)},t.functionTypeParam=t.FunctionTypeParam=function(...e){return(0,r.default)("FunctionTypeParam",...e)},t.genericTypeAnnotation=t.GenericTypeAnnotation=function(...e){return(0,r.default)("GenericTypeAnnotation",...e)},t.inferredPredicate=t.InferredPredicate=function(...e){return(0,r.default)("InferredPredicate",...e)},t.interfaceExtends=t.InterfaceExtends=function(...e){return(0,r.default)("InterfaceExtends",...e)},t.interfaceDeclaration=t.InterfaceDeclaration=function(...e){return(0,r.default)("InterfaceDeclaration",...e)},t.interfaceTypeAnnotation=t.InterfaceTypeAnnotation=function(...e){return(0,r.default)("InterfaceTypeAnnotation",...e)},t.intersectionTypeAnnotation=t.IntersectionTypeAnnotation=function(...e){return(0,r.default)("IntersectionTypeAnnotation",...e)},t.mixedTypeAnnotation=t.MixedTypeAnnotation=function(...e){return(0,r.default)("MixedTypeAnnotation",...e)},t.emptyTypeAnnotation=t.EmptyTypeAnnotation=function(...e){return(0,r.default)("EmptyTypeAnnotation",...e)},t.nullableTypeAnnotation=t.NullableTypeAnnotation=function(...e){return(0,r.default)("NullableTypeAnnotation",...e)},t.numberLiteralTypeAnnotation=t.NumberLiteralTypeAnnotation=function(...e){return(0,r.default)("NumberLiteralTypeAnnotation",...e)},t.numberTypeAnnotation=t.NumberTypeAnnotation=function(...e){return(0,r.default)("NumberTypeAnnotation",...e)},t.objectTypeAnnotation=t.ObjectTypeAnnotation=function(...e){return(0,r.default)("ObjectTypeAnnotation",...e)},t.objectTypeInternalSlot=t.ObjectTypeInternalSlot=function(...e){return(0,r.default)("ObjectTypeInternalSlot",...e)},t.objectTypeCallProperty=t.ObjectTypeCallProperty=function(...e){return(0,r.default)("ObjectTypeCallProperty",...e)},t.objectTypeIndexer=t.ObjectTypeIndexer=function(...e){return(0,r.default)("ObjectTypeIndexer",...e)},t.objectTypeProperty=t.ObjectTypeProperty=function(...e){return(0,r.default)("ObjectTypeProperty",...e)},t.objectTypeSpreadProperty=t.ObjectTypeSpreadProperty=function(...e){return(0,r.default)("ObjectTypeSpreadProperty",...e)},t.opaqueType=t.OpaqueType=function(...e){return(0,r.default)("OpaqueType",...e)},t.qualifiedTypeIdentifier=t.QualifiedTypeIdentifier=function(...e){return(0,r.default)("QualifiedTypeIdentifier",...e)},t.stringLiteralTypeAnnotation=t.StringLiteralTypeAnnotation=function(...e){return(0,r.default)("StringLiteralTypeAnnotation",...e)},t.stringTypeAnnotation=t.StringTypeAnnotation=function(...e){return(0,r.default)("StringTypeAnnotation",...e)},t.thisTypeAnnotation=t.ThisTypeAnnotation=function(...e){return(0,r.default)("ThisTypeAnnotation",...e)},t.tupleTypeAnnotation=t.TupleTypeAnnotation=function(...e){return(0,r.default)("TupleTypeAnnotation",...e)},t.typeofTypeAnnotation=t.TypeofTypeAnnotation=function(...e){return(0,r.default)("TypeofTypeAnnotation",...e)},t.typeAlias=t.TypeAlias=function(...e){return(0,r.default)("TypeAlias",...e)},t.typeAnnotation=t.TypeAnnotation=function(...e){return(0,r.default)("TypeAnnotation",...e)},t.typeCastExpression=t.TypeCastExpression=function(...e){return(0,r.default)("TypeCastExpression",...e)},t.typeParameter=t.TypeParameter=function(...e){return(0,r.default)("TypeParameter",...e)},t.typeParameterDeclaration=t.TypeParameterDeclaration=function(...e){return(0,r.default)("TypeParameterDeclaration",...e)},t.typeParameterInstantiation=t.TypeParameterInstantiation=function(...e){return(0,r.default)("TypeParameterInstantiation",...e)},t.unionTypeAnnotation=t.UnionTypeAnnotation=function(...e){return(0,r.default)("UnionTypeAnnotation",...e)},t.variance=t.Variance=function(...e){return(0,r.default)("Variance",...e)},t.voidTypeAnnotation=t.VoidTypeAnnotation=function(...e){return(0,r.default)("VoidTypeAnnotation",...e)},t.jSXAttribute=t.jsxAttribute=t.JSXAttribute=function(...e){return(0,r.default)("JSXAttribute",...e)},t.jSXClosingElement=t.jsxClosingElement=t.JSXClosingElement=function(...e){return(0,r.default)("JSXClosingElement",...e)},t.jSXElement=t.jsxElement=t.JSXElement=function(...e){return(0,r.default)("JSXElement",...e)},t.jSXEmptyExpression=t.jsxEmptyExpression=t.JSXEmptyExpression=function(...e){return(0,r.default)("JSXEmptyExpression",...e)},t.jSXExpressionContainer=t.jsxExpressionContainer=t.JSXExpressionContainer=function(...e){return(0,r.default)("JSXExpressionContainer",...e)},t.jSXSpreadChild=t.jsxSpreadChild=t.JSXSpreadChild=function(...e){return(0,r.default)("JSXSpreadChild",...e)},t.jSXIdentifier=t.jsxIdentifier=t.JSXIdentifier=function(...e){return(0,r.default)("JSXIdentifier",...e)},t.jSXMemberExpression=t.jsxMemberExpression=t.JSXMemberExpression=function(...e){return(0,r.default)("JSXMemberExpression",...e)},t.jSXNamespacedName=t.jsxNamespacedName=t.JSXNamespacedName=function(...e){return(0,r.default)("JSXNamespacedName",...e)},t.jSXOpeningElement=t.jsxOpeningElement=t.JSXOpeningElement=function(...e){return(0,r.default)("JSXOpeningElement",...e)},t.jSXSpreadAttribute=t.jsxSpreadAttribute=t.JSXSpreadAttribute=function(...e){return(0,r.default)("JSXSpreadAttribute",...e)},t.jSXText=t.jsxText=t.JSXText=function(...e){return(0,r.default)("JSXText",...e)},t.jSXFragment=t.jsxFragment=t.JSXFragment=function(...e){return(0,r.default)("JSXFragment",...e)},t.jSXOpeningFragment=t.jsxOpeningFragment=t.JSXOpeningFragment=function(...e){return(0,r.default)("JSXOpeningFragment",...e)},t.jSXClosingFragment=t.jsxClosingFragment=t.JSXClosingFragment=function(...e){return(0,r.default)("JSXClosingFragment",...e)},t.noop=t.Noop=function(...e){return(0,r.default)("Noop",...e)},t.placeholder=t.Placeholder=function(...e){return(0,r.default)("Placeholder",...e)},t.argumentPlaceholder=t.ArgumentPlaceholder=function(...e){return(0,r.default)("ArgumentPlaceholder",...e)},t.awaitExpression=t.AwaitExpression=function(...e){return(0,r.default)("AwaitExpression",...e)},t.bindExpression=t.BindExpression=function(...e){return(0,r.default)("BindExpression",...e)},t.classProperty=t.ClassProperty=function(...e){return(0,r.default)("ClassProperty",...e)},t.optionalMemberExpression=t.OptionalMemberExpression=function(...e){return(0,r.default)("OptionalMemberExpression",...e)},t.pipelineTopicExpression=t.PipelineTopicExpression=function(...e){return(0,r.default)("PipelineTopicExpression",...e)},t.pipelineBareFunction=t.PipelineBareFunction=function(...e){return(0,r.default)("PipelineBareFunction",...e)},t.pipelinePrimaryTopicReference=t.PipelinePrimaryTopicReference=function(...e){return(0,r.default)("PipelinePrimaryTopicReference",...e)},t.optionalCallExpression=t.OptionalCallExpression=function(...e){return(0,r.default)("OptionalCallExpression",...e)},t.classPrivateProperty=t.ClassPrivateProperty=function(...e){return(0,r.default)("ClassPrivateProperty",...e)},t.classPrivateMethod=t.ClassPrivateMethod=function(...e){return(0,r.default)("ClassPrivateMethod",...e)},t.import=t.Import=function(...e){return(0,r.default)("Import",...e)},t.decorator=t.Decorator=function(...e){return(0,r.default)("Decorator",...e)},t.doExpression=t.DoExpression=function(...e){return(0,r.default)("DoExpression",...e)},t.exportDefaultSpecifier=t.ExportDefaultSpecifier=function(...e){return(0,r.default)("ExportDefaultSpecifier",...e)},t.exportNamespaceSpecifier=t.ExportNamespaceSpecifier=function(...e){return(0,r.default)("ExportNamespaceSpecifier",...e)},t.privateName=t.PrivateName=function(...e){return(0,r.default)("PrivateName",...e)},t.bigIntLiteral=t.BigIntLiteral=function(...e){return(0,r.default)("BigIntLiteral",...e)},t.tSParameterProperty=t.tsParameterProperty=t.TSParameterProperty=function(...e){return(0,r.default)("TSParameterProperty",...e)},t.tSDeclareFunction=t.tsDeclareFunction=t.TSDeclareFunction=function(...e){return(0,r.default)("TSDeclareFunction",...e)},t.tSDeclareMethod=t.tsDeclareMethod=t.TSDeclareMethod=function(...e){return(0,r.default)("TSDeclareMethod",...e)},t.tSQualifiedName=t.tsQualifiedName=t.TSQualifiedName=function(...e){return(0,r.default)("TSQualifiedName",...e)},t.tSCallSignatureDeclaration=t.tsCallSignatureDeclaration=t.TSCallSignatureDeclaration=function(...e){return(0,r.default)("TSCallSignatureDeclaration",...e)},t.tSConstructSignatureDeclaration=t.tsConstructSignatureDeclaration=t.TSConstructSignatureDeclaration=function(...e){return(0,r.default)("TSConstructSignatureDeclaration",...e)},t.tSPropertySignature=t.tsPropertySignature=t.TSPropertySignature=function(...e){return(0,r.default)("TSPropertySignature",...e)},t.tSMethodSignature=t.tsMethodSignature=t.TSMethodSignature=function(...e){return(0,r.default)("TSMethodSignature",...e)},t.tSIndexSignature=t.tsIndexSignature=t.TSIndexSignature=function(...e){return(0,r.default)("TSIndexSignature",...e)},t.tSAnyKeyword=t.tsAnyKeyword=t.TSAnyKeyword=function(...e){return(0,r.default)("TSAnyKeyword",...e)},t.tSUnknownKeyword=t.tsUnknownKeyword=t.TSUnknownKeyword=function(...e){return(0,r.default)("TSUnknownKeyword",...e)},t.tSNumberKeyword=t.tsNumberKeyword=t.TSNumberKeyword=function(...e){return(0,r.default)("TSNumberKeyword",...e)},t.tSObjectKeyword=t.tsObjectKeyword=t.TSObjectKeyword=function(...e){return(0,r.default)("TSObjectKeyword",...e)},t.tSBooleanKeyword=t.tsBooleanKeyword=t.TSBooleanKeyword=function(...e){return(0,r.default)("TSBooleanKeyword",...e)},t.tSStringKeyword=t.tsStringKeyword=t.TSStringKeyword=function(...e){return(0,r.default)("TSStringKeyword",...e)},t.tSSymbolKeyword=t.tsSymbolKeyword=t.TSSymbolKeyword=function(...e){return(0,r.default)("TSSymbolKeyword",...e)},t.tSVoidKeyword=t.tsVoidKeyword=t.TSVoidKeyword=function(...e){return(0,r.default)("TSVoidKeyword",...e)},t.tSUndefinedKeyword=t.tsUndefinedKeyword=t.TSUndefinedKeyword=function(...e){return(0,r.default)("TSUndefinedKeyword",...e)},t.tSNullKeyword=t.tsNullKeyword=t.TSNullKeyword=function(...e){return(0,r.default)("TSNullKeyword",...e)},t.tSNeverKeyword=t.tsNeverKeyword=t.TSNeverKeyword=function(...e){return(0,r.default)("TSNeverKeyword",...e)},t.tSThisType=t.tsThisType=t.TSThisType=function(...e){return(0,r.default)("TSThisType",...e)},t.tSFunctionType=t.tsFunctionType=t.TSFunctionType=function(...e){return(0,r.default)("TSFunctionType",...e)},t.tSConstructorType=t.tsConstructorType=t.TSConstructorType=function(...e){return(0,r.default)("TSConstructorType",...e)},t.tSTypeReference=t.tsTypeReference=t.TSTypeReference=function(...e){return(0,r.default)("TSTypeReference",...e)},t.tSTypePredicate=t.tsTypePredicate=t.TSTypePredicate=function(...e){return(0,r.default)("TSTypePredicate",...e)},t.tSTypeQuery=t.tsTypeQuery=t.TSTypeQuery=function(...e){return(0,r.default)("TSTypeQuery",...e)},t.tSTypeLiteral=t.tsTypeLiteral=t.TSTypeLiteral=function(...e){return(0,r.default)("TSTypeLiteral",...e)},t.tSArrayType=t.tsArrayType=t.TSArrayType=function(...e){return(0,r.default)("TSArrayType",...e)},t.tSTupleType=t.tsTupleType=t.TSTupleType=function(...e){return(0,r.default)("TSTupleType",...e)},t.tSOptionalType=t.tsOptionalType=t.TSOptionalType=function(...e){return(0,r.default)("TSOptionalType",...e)},t.tSRestType=t.tsRestType=t.TSRestType=function(...e){return(0,r.default)("TSRestType",...e)},t.tSUnionType=t.tsUnionType=t.TSUnionType=function(...e){return(0,r.default)("TSUnionType",...e)},t.tSIntersectionType=t.tsIntersectionType=t.TSIntersectionType=function(...e){return(0,r.default)("TSIntersectionType",...e)},t.tSConditionalType=t.tsConditionalType=t.TSConditionalType=function(...e){return(0,r.default)("TSConditionalType",...e)},t.tSInferType=t.tsInferType=t.TSInferType=function(...e){return(0,r.default)("TSInferType",...e)},t.tSParenthesizedType=t.tsParenthesizedType=t.TSParenthesizedType=function(...e){return(0,r.default)("TSParenthesizedType",...e)},t.tSTypeOperator=t.tsTypeOperator=t.TSTypeOperator=function(...e){return(0,r.default)("TSTypeOperator",...e)},t.tSIndexedAccessType=t.tsIndexedAccessType=t.TSIndexedAccessType=function(...e){return(0,r.default)("TSIndexedAccessType",...e)},t.tSMappedType=t.tsMappedType=t.TSMappedType=function(...e){return(0,r.default)("TSMappedType",...e)},t.tSLiteralType=t.tsLiteralType=t.TSLiteralType=function(...e){return(0,r.default)("TSLiteralType",...e)},t.tSExpressionWithTypeArguments=t.tsExpressionWithTypeArguments=t.TSExpressionWithTypeArguments=function(...e){return(0,r.default)("TSExpressionWithTypeArguments",...e)},t.tSInterfaceDeclaration=t.tsInterfaceDeclaration=t.TSInterfaceDeclaration=function(...e){return(0,r.default)("TSInterfaceDeclaration",...e)},t.tSInterfaceBody=t.tsInterfaceBody=t.TSInterfaceBody=function(...e){return(0,r.default)("TSInterfaceBody",...e)},t.tSTypeAliasDeclaration=t.tsTypeAliasDeclaration=t.TSTypeAliasDeclaration=function(...e){return(0,r.default)("TSTypeAliasDeclaration",...e)},t.tSAsExpression=t.tsAsExpression=t.TSAsExpression=function(...e){return(0,r.default)("TSAsExpression",...e)},t.tSTypeAssertion=t.tsTypeAssertion=t.TSTypeAssertion=function(...e){return(0,r.default)("TSTypeAssertion",...e)},t.tSEnumDeclaration=t.tsEnumDeclaration=t.TSEnumDeclaration=function(...e){return(0,r.default)("TSEnumDeclaration",...e)},t.tSEnumMember=t.tsEnumMember=t.TSEnumMember=function(...e){return(0,r.default)("TSEnumMember",...e)},t.tSModuleDeclaration=t.tsModuleDeclaration=t.TSModuleDeclaration=function(...e){return(0,r.default)("TSModuleDeclaration",...e)},t.tSModuleBlock=t.tsModuleBlock=t.TSModuleBlock=function(...e){return(0,r.default)("TSModuleBlock",...e)},t.tSImportType=t.tsImportType=t.TSImportType=function(...e){return(0,r.default)("TSImportType",...e)},t.tSImportEqualsDeclaration=t.tsImportEqualsDeclaration=t.TSImportEqualsDeclaration=function(...e){return(0,r.default)("TSImportEqualsDeclaration",...e)},t.tSExternalModuleReference=t.tsExternalModuleReference=t.TSExternalModuleReference=function(...e){return(0,r.default)("TSExternalModuleReference",...e)},t.tSNonNullExpression=t.tsNonNullExpression=t.TSNonNullExpression=function(...e){return(0,r.default)("TSNonNullExpression",...e)},t.tSExportAssignment=t.tsExportAssignment=t.TSExportAssignment=function(...e){return(0,r.default)("TSExportAssignment",...e)},t.tSNamespaceExportDeclaration=t.tsNamespaceExportDeclaration=t.TSNamespaceExportDeclaration=function(...e){return(0,r.default)("TSNamespaceExportDeclaration",...e)},t.tSTypeAnnotation=t.tsTypeAnnotation=t.TSTypeAnnotation=function(...e){return(0,r.default)("TSTypeAnnotation",...e)},t.tSTypeParameterInstantiation=t.tsTypeParameterInstantiation=t.TSTypeParameterInstantiation=function(...e){return(0,r.default)("TSTypeParameterInstantiation",...e)},t.tSTypeParameterDeclaration=t.tsTypeParameterDeclaration=t.TSTypeParameterDeclaration=function(...e){return(0,r.default)("TSTypeParameterDeclaration",...e)},t.tSTypeParameter=t.tsTypeParameter=t.TSTypeParameter=function(...e){return(0,r.default)("TSTypeParameter",...e)},t.numberLiteral=t.NumberLiteral=function e(...t){console.trace("The node type NumberLiteral has been renamed to NumericLiteral");return e("NumberLiteral",...t)},t.regexLiteral=t.RegexLiteral=function e(...t){console.trace("The node type RegexLiteral has been renamed to RegExpLiteral");return e("RegexLiteral",...t)},t.restProperty=t.RestProperty=function e(...t){console.trace("The node type RestProperty has been renamed to RestElement");return e("RestProperty",...t)},t.spreadProperty=t.SpreadProperty=function e(...t){console.trace("The node type SpreadProperty has been renamed to SpreadElement");return e("SpreadProperty",...t)};var r=function(e){return e&&e.__esModule?e:{default:e}}(n(120))},function(e,t,n){var r=n(58),i="object"==typeof self&&self&&self.Object===Object&&self,s=r||i||Function("return this")();e.exports=s},function(e,t){e.exports=function(e){return null!=e&&"object"==typeof e}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validate=h,t.typeIs=f,t.validateType=function(e){return h(f(e))},t.validateOptional=function(e){return{validate:e,optional:!0}},t.validateOptionalType=function(e){return{validate:f(e),optional:!0}},t.arrayOf=d,t.arrayOfType=y,t.validateArrayOfType=function(e){return h(y(e))},t.assertEach=m,t.assertOneOf=function(...e){function t(t,n,r){if(e.indexOf(r)<0)throw new TypeError(`Property ${n} expected value to be one of ${JSON.stringify(e)} but got ${JSON.stringify(r)}`)}return t.oneOf=e,t},t.assertNodeType=g,t.assertNodeOrValueType=function(...e){function t(t,n,i){let s=!1;for(const t of e)if(p(i)===t||(0,r.default)(t,i)){s=!0;break}if(!s)throw new TypeError(`Property ${n} of ${t.type} expected node to be of a type ${JSON.stringify(e)} `+`but instead got ${JSON.stringify(i&&i.type)}`)}return t.oneOfNodeOrValueTypes=e,t},t.assertValueType=E,t.assertShape=function(e){function t(t,n,r){const s=[];for(const n of Object.keys(e))try{(0,i.validateField)(t,n,r[n],e[n])}catch(e){if(e instanceof TypeError){s.push(e.message);continue}throw e}if(s.length)throw new TypeError(`Property ${n} of ${t.type} expected to have the following:\n${s.join("\n")}`)}return t.shapeOf=e,t},t.chain=T,t.default=function(e,t={}){const n=t.inherits&&A[t.inherits]||{},r=t.fields||n.fields||{},i=t.visitor||n.visitor||[],h=t.aliases||n.aliases||[],f=t.builder||n.builder||t.visitor||[];t.deprecatedAlias&&(l[t.deprecatedAlias]=e);for(const e of i.concat(f))r[e]=r[e]||{};for(const e of Object.keys(r)){const t=r[e];-1===f.indexOf(e)&&(t.optional=!0),void 0===t.default?t.default=null:t.validate||(t.validate=E(p(t.default)))}s[e]=t.visitor=i,c[e]=t.builder=f,u[e]=t.fields=r,o[e]=t.aliases=h,h.forEach(t=>{a[t]=a[t]||[],a[t].push(e)}),A[e]=t},t.DEPRECATED_KEYS=t.BUILDER_KEYS=t.NODE_FIELDS=t.FLIPPED_ALIAS_KEYS=t.ALIAS_KEYS=t.VISITOR_KEYS=void 0;var r=function(e){return e&&e.__esModule?e:{default:e}}(n(43)),i=n(45);const s={};t.VISITOR_KEYS=s;const o={};t.ALIAS_KEYS=o;const a={};t.FLIPPED_ALIAS_KEYS=a;const u={};t.NODE_FIELDS=u;const c={};t.BUILDER_KEYS=c;const l={};function p(e){return Array.isArray(e)?"array":null===e?"null":void 0===e?"undefined":typeof e}function h(e){return{validate:e}}function f(e){return"string"==typeof e?g(e):g(...e)}function d(e){return T(E("array"),m(e))}function y(e){return d(f(e))}function m(e){function t(t,n,r){if(Array.isArray(r))for(let i=0;i","<",">=","<="];t.BOOLEAN_NUMBER_BINARY_OPERATORS=r;const i=["==","===","!=","!=="];t.EQUALITY_BINARY_OPERATORS=i;const s=[...i,"in","instanceof"];t.COMPARISON_BINARY_OPERATORS=s;const o=[...s,...r];t.BOOLEAN_BINARY_OPERATORS=o;const a=["-","/","%","*","**","&","|",">>",">>>","<<","^"];t.NUMBER_BINARY_OPERATORS=a;const u=["+",...a,...o];t.BINARY_OPERATORS=u;const c=["delete","!"];t.BOOLEAN_UNARY_OPERATORS=c;const l=["+","-","~"];t.NUMBER_UNARY_OPERATORS=l;const p=["typeof"];t.STRING_UNARY_OPERATORS=p;const h=["void","throw",...c,...l,...p];t.UNARY_OPERATORS=h;t.INHERIT_KEYS={optional:["typeAnnotation","typeParameters","returnType"],force:["start","loc","end"]};const f=Symbol.for("var used to be block scoped");t.BLOCK_SCOPED_SYMBOL=f;const d=Symbol.for("should not be considered a local binding");t.NOT_LOCAL_BINDING=d},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=b(n(53));function i(){const e=S(n(243));return i=function(){return e},e}var s=S(n(13)),o=S(n(94));function a(){const e=b(n(0));return a=function(){return e},e}var u=n(31);function c(){const e=S(n(1));return c=function(){return e},e}var l=b(n(295)),p=b(n(296)),h=b(n(299)),f=b(n(310)),d=b(n(311)),y=b(n(319)),m=b(n(320)),g=b(n(321)),E=b(n(323)),T=b(n(325)),A=b(n(326));function S(e){return e&&e.__esModule?e:{default:e}}function b(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var r=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(e,n):{};r.get||r.set?Object.defineProperty(t,n,r):t[n]=e[n]}return t.default=e,t}const x=(0,i().default)("babel");class P{constructor(e,t){this.parent=t,this.hub=e,this.contexts=[],this.data=Object.create(null),this.shouldSkip=!1,this.shouldStop=!1,this.removed=!1,this.state=null,this.opts=null,this.skipKeys=null,this.parentPath=null,this.context=null,this.container=null,this.listKey=null,this.inList=!1,this.parentKey=null,this.key=null,this.node=null,this.scope=null,this.type=null,this.typeAnnotation=null}static get({hub:e,parentPath:t,parent:n,container:r,listKey:i,key:s}){if(!e&&t&&(e=t.hub),!n)throw new Error("To get a node path the parent needs to exist");const o=r[s],a=u.path.get(n)||[];let c;u.path.has(n)||u.path.set(n,a);for(let e=0;es(e,t)):s(e,t)}function a(e,t=!0){if(!e)return e;const{type:n}=e,s={type:n};if("Identifier"===n)s.name=e.name,i(e,"optional")&&"boolean"==typeof e.optional&&(s.optional=e.optional),i(e,"typeAnnotation")&&(s.typeAnnotation=t?o(e.typeAnnotation,!0):e.typeAnnotation);else{if(!i(r.NODE_FIELDS,n))throw new Error(`Unknown node type: "${n}"`);for(const a of Object.keys(r.NODE_FIELDS[n]))i(e,a)&&(s[a]=t?o(e[a],!0):e[a])}return i(e,"loc")&&(s.loc=e.loc),i(e,"leadingComments")&&(s.leadingComments=e.leadingComments),i(e,"innerComments")&&(s.innerComments=e.innerComments),i(e,"trailingComments")&&(s.trailingComments=e.trailingComments),i(e,"extra")&&(s.extra=Object.assign({},e.extra)),s}},function(e,t){t.getArg=function(e,t,n){if(t in e)return e[t];if(3===arguments.length)return n;throw new Error('"'+t+'" is a required argument.')};var n=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.]*)(?::(\d+))?(\S*)$/,r=/^data:.+\,.+$/;function i(e){var t=e.match(n);return t?{scheme:t[1],auth:t[2],host:t[3],port:t[4],path:t[5]}:null}function s(e){var t="";return e.scheme&&(t+=e.scheme+":"),t+="//",e.auth&&(t+=e.auth+"@"),e.host&&(t+=e.host),e.port&&(t+=":"+e.port),e.path&&(t+=e.path),t}function o(e){var n=e,r=i(e);if(r){if(!r.path)return e;n=r.path}for(var o,a=t.isAbsolute(n),u=n.split(/\/+/),c=0,l=u.length-1;l>=0;l--)"."===(o=u[l])?u.splice(l,1):".."===o?c++:c>0&&(""===o?(u.splice(l+1,c),c=0):(u.splice(l,2),c--));return""===(n=u.join("/"))&&(n=a?"/":"."),r?(r.path=n,s(r)):n}t.urlParse=i,t.urlGenerate=s,t.normalize=o,t.join=function(e,t){""===e&&(e="."),""===t&&(t=".");var n=i(t),a=i(e);if(a&&(e=a.path||"/"),n&&!n.scheme)return a&&(n.scheme=a.scheme),s(n);if(n||t.match(r))return t;if(a&&!a.host&&!a.path)return a.host=t,s(a);var u="/"===t.charAt(0)?t:o(e.replace(/\/+$/,"")+"/"+t);return a?(a.path=u,s(a)):u},t.isAbsolute=function(e){return"/"===e.charAt(0)||!!e.match(n)},t.relative=function(e,t){""===e&&(e="."),e=e.replace(/\/$/,"");for(var n=0;0!==t.indexOf(e+"/");){var r=e.lastIndexOf("/");if(r<0)return t;if((e=e.slice(0,r)).match(/^([^\/]+:\/)?\/*$/))return t;++n}return Array(n+1).join("../")+t.substr(e.length+1)};var a=!("__proto__"in Object.create(null));function u(e){return e}function c(e){if(!e)return!1;var t=e.length;if(t<9)return!1;if(95!==e.charCodeAt(t-1)||95!==e.charCodeAt(t-2)||111!==e.charCodeAt(t-3)||116!==e.charCodeAt(t-4)||111!==e.charCodeAt(t-5)||114!==e.charCodeAt(t-6)||112!==e.charCodeAt(t-7)||95!==e.charCodeAt(t-8)||95!==e.charCodeAt(t-9))return!1;for(var n=t-10;n>=0;n--)if(36!==e.charCodeAt(n))return!1;return!0}function l(e,t){return e===t?0:e>t?1:-1}t.toSetString=a?u:function(e){return c(e)?"$"+e:e},t.fromSetString=a?u:function(e){return c(e)?e.slice(1):e},t.compareByOriginalPositions=function(e,t,n){var r=e.source-t.source;return 0!==r?r:0!=(r=e.originalLine-t.originalLine)?r:0!=(r=e.originalColumn-t.originalColumn)||n?r:0!=(r=e.generatedColumn-t.generatedColumn)?r:0!=(r=e.generatedLine-t.generatedLine)?r:e.name-t.name},t.compareByGeneratedPositionsDeflated=function(e,t,n){var r=e.generatedLine-t.generatedLine;return 0!==r?r:0!=(r=e.generatedColumn-t.generatedColumn)||n?r:0!=(r=e.source-t.source)?r:0!=(r=e.originalLine-t.originalLine)?r:0!=(r=e.originalColumn-t.originalColumn)?r:e.name-t.name},t.compareByGeneratedPositionsInflated=function(e,t){var n=e.generatedLine-t.generatedLine;return 0!==n?n:0!=(n=e.generatedColumn-t.generatedColumn)?n:0!==(n=l(e.source,t.source))?n:0!=(n=e.originalLine-t.originalLine)?n:0!=(n=e.originalColumn-t.originalColumn)?n:l(e.name,t.name)}},function(e,t,n){var r=n(123),i=n(124),s=n(125),o=n(126),a=n(127);function u(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t",{beforeExpr:r}),template:new i("template"),ellipsis:new i("...",{beforeExpr:r}),backQuote:new i("`",{startsExpr:!0}),dollarBraceL:new i("${",{beforeExpr:r,startsExpr:!0}),at:new i("@"),hash:new i("#",{startsExpr:!0}),interpreterDirective:new i("#!..."),eq:new i("=",{beforeExpr:r,isAssign:!0}),assign:new i("_=",{beforeExpr:r,isAssign:!0}),incDec:new i("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),bang:new i("!",{beforeExpr:r,prefix:!0,startsExpr:!0}),tilde:new i("~",{beforeExpr:r,prefix:!0,startsExpr:!0}),pipeline:a("|>",0),nullishCoalescing:a("??",1),logicalOR:a("||",1),logicalAND:a("&&",2),bitwiseOR:a("|",3),bitwiseXOR:a("^",4),bitwiseAND:a("&",5),equality:a("==/!=/===/!==",6),relational:a("/<=/>=",7),bitShift:a("<>/>>>",8),plusMin:new i("+/-",{beforeExpr:r,binop:9,prefix:!0,startsExpr:!0}),modulo:a("%",10),star:a("*",10),slash:a("/",10),exponent:new i("**",{beforeExpr:r,binop:11,rightAssociative:!0}),_break:o("break"),_case:o("case",{beforeExpr:r}),_catch:o("catch"),_continue:o("continue"),_debugger:o("debugger"),_default:o("default",{beforeExpr:r}),_do:o("do",{isLoop:!0,beforeExpr:r}),_else:o("else",{beforeExpr:r}),_finally:o("finally"),_for:o("for",{isLoop:!0}),_function:o("function",{startsExpr:!0}),_if:o("if"),_return:o("return",{beforeExpr:r}),_switch:o("switch"),_throw:o("throw",{beforeExpr:r,prefix:!0,startsExpr:!0}),_try:o("try"),_var:o("var"),_const:o("const"),_while:o("while",{isLoop:!0}),_with:o("with"),_new:o("new",{beforeExpr:r,startsExpr:!0}),_this:o("this",{startsExpr:!0}),_super:o("super",{startsExpr:!0}),_class:o("class",{startsExpr:!0}),_extends:o("extends",{beforeExpr:r}),_export:o("export"),_import:o("import",{startsExpr:!0}),_null:o("null",{startsExpr:!0}),_true:o("true",{startsExpr:!0}),_false:o("false",{startsExpr:!0}),_in:o("in",{beforeExpr:r,binop:7}),_instanceof:o("instanceof",{beforeExpr:r,binop:7}),_typeof:o("typeof",{beforeExpr:r,prefix:!0,startsExpr:!0}),_void:o("void",{beforeExpr:r,prefix:!0,startsExpr:!0}),_delete:o("delete",{beforeExpr:r,prefix:!0,startsExpr:!0})},c=0,l=1,p=2,h=4,f=8,d=16,y=32,m=64,g=128,E=256,T=l|p;function A(e,t){return p|(e?h:0)|(t?f:0)}const S=1,b=2,x=4,P=8,v=16,D=128,C=256,O=512,w=1024,F=S|b|P|D,_=0|S|P|0,N=0|S|x|0,I=0|S|v|0,k=0|b|D,B=0|b,L=S|b|P|C,M=0|w,j=64,R=64|S,U=L|O,V=M;function X(e){return null!=e&&"Property"===e.type&&"init"===e.kind&&!1===e.method}const W=/\r\n?|[\n\u2028\u2029]/,Y=new RegExp(W.source,"g");function K(e){switch(e){case 10:case 13:case 8232:case 8233:return!0;default:return!1}}const q=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g;function J(e){switch(e){case 9:case 11:case 12:case 32:case 160:case 5760:case 8192:case 8193:case 8194:case 8195:case 8196:case 8197:case 8198:case 8199:case 8200:case 8201:case 8202:case 8239:case 8287:case 12288:case 65279:return!0;default:return!1}}class G{constructor(e,t,n,r){this.token=e,this.isExpr=!!t,this.preserveSpace=!!n,this.override=r}}const H={braceStatement:new G("{",!1),braceExpression:new G("{",!0),templateQuasi:new G("${",!1),parenStatement:new G("(",!1),parenExpression:new G("(",!0),template:new G("`",!0,!0,e=>e.readTmplToken()),functionExpression:new G("function",!0),functionStatement:new G("function",!1)};u.parenR.updateContext=u.braceR.updateContext=function(){if(1===this.state.context.length)return void(this.state.exprAllowed=!0);let e=this.state.context.pop();e===H.braceStatement&&"function"===this.curContext().token&&(e=this.state.context.pop()),this.state.exprAllowed=!e.isExpr},u.name.updateContext=function(e){let t=!1;e!==u.dot&&("of"===this.state.value&&!this.state.exprAllowed||"yield"===this.state.value&&this.scope.inGenerator)&&(t=!0),this.state.exprAllowed=t,this.state.isIterator&&(this.state.isIterator=!1)},u.braceL.updateContext=function(e){this.state.context.push(this.braceIsBlock(e)?H.braceStatement:H.braceExpression),this.state.exprAllowed=!0},u.dollarBraceL.updateContext=function(){this.state.context.push(H.templateQuasi),this.state.exprAllowed=!0},u.parenL.updateContext=function(e){const t=e===u._if||e===u._for||e===u._with||e===u._while;this.state.context.push(t?H.parenStatement:H.parenExpression),this.state.exprAllowed=!0},u.incDec.updateContext=function(){},u._function.updateContext=u._class.updateContext=function(e){!e.beforeExpr||e===u.semi||e===u._else||e===u._return&&W.test(this.input.slice(this.state.lastTokEnd,this.state.start))||(e===u.colon||e===u.braceL)&&this.curContext()===H.b_stat?this.state.context.push(H.functionStatement):this.state.context.push(H.functionExpression),this.state.exprAllowed=!1},u.backQuote.updateContext=function(){this.curContext()===H.template?this.state.context.pop():this.state.context.push(H.template),this.state.exprAllowed=!1};const $={strict:["implements","interface","let","package","private","protected","public","static","yield"],strictBind:["eval","arguments"]},z=new Set($.strict),Q=new Set($.strict.concat($.strictBind)),Z=(e,t)=>t&&"await"===e||"enum"===e;function ee(e,t){return Z(e,t)||z.has(e)}function te(e,t){return Z(e,t)||Q.has(e)}const ne=/^in(stanceof)?$/;let re="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࢠ-ࢴࢶ-ࢽऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲈᲐ-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿯ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞿꟂ-Ᶎꟷ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭧꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",ie="‌‍·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛࣓-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍ୖୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ංඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-ໍ໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜔ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠐-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷹᷻-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_";const se=new RegExp("["+re+"]"),oe=new RegExp("["+re+ie+"]");re=ie=null;const ae=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,157,310,10,21,11,7,153,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,477,28,11,0,9,21,155,22,13,52,76,44,33,24,27,35,30,0,12,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,85,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,21,0,33,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,230,43,117,63,32,0,161,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,35,56,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,270,921,103,110,18,195,2749,1070,4050,582,8634,568,8,30,114,29,19,47,17,3,32,20,6,18,689,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,754,9486,286,50,2,18,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,2357,44,11,6,17,0,370,43,1301,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42710,42,4148,12,221,3,5761,15,7472,3104,541],ue=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,525,10,176,2,54,14,32,9,16,3,46,10,54,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,4,9,83,11,7,0,161,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,243,14,166,9,232,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,406,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,19306,9,135,4,60,6,26,9,1014,0,2,54,8,3,19723,1,5319,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,262,6,10,9,419,13,1495,6,110,6,6,9,792487,239];function ce(e,t){let n=65536;for(let r=0,i=t.length;re)return!1;if((n+=t[r+1])>=e)return!0}return!1}function le(e){return e<65?36===e:e<=90||(e<97?95===e:e<=122||(e<=65535?e>=170&&se.test(String.fromCharCode(e)):ce(e,ae)))}function pe(e){return e<48?36===e:e<58||!(e<65)&&(e<=90||(e<97?95===e:e<=122||(e<=65535?e>=170&&oe.test(String.fromCharCode(e)):ce(e,ae)||ce(e,ue))))}const he=["any","bool","boolean","empty","false","mixed","null","number","static","string","true","typeof","void","interface","extends","_"];function fe(e){return"type"===e.importKind||"typeof"===e.importKind}function de(e){return(e.type===u.name||!!e.type.keyword)&&"from"!==e.value}const ye={const:"declare export var",let:"declare export var",type:"export type",interface:"export interface"};const me=/\*?\s*@((?:no)?flow)\b/;const ge={quot:'"',amp:"&",apos:"'",lt:"<",gt:">",nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"­",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",fnof:"ƒ",circ:"ˆ",tilde:"˜",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",ensp:" ",emsp:" ",thinsp:" ",zwnj:"‌",zwj:"‍",lrm:"‎",rlm:"‏",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",bull:"•",hellip:"…",permil:"‰",prime:"′",Prime:"″",lsaquo:"‹",rsaquo:"›",oline:"‾",frasl:"⁄",euro:"€",image:"ℑ",weierp:"℘",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦"},Ee=/^[\da-fA-F]+$/,Te=/^\d+$/;function Ae(e){return!!e&&("JSXOpeningFragment"===e.type||"JSXClosingFragment"===e.type)}function Se(e){if("JSXIdentifier"===e.type)return e.name;if("JSXNamespacedName"===e.type)return e.namespace.name+":"+e.name.name;if("JSXMemberExpression"===e.type)return Se(e.object)+"."+Se(e.property);throw new Error("Node had unexpected type: "+e.type)}H.j_oTag=new G("...",!0,!0),u.jsxName=new i("jsxName"),u.jsxText=new i("jsxText",{beforeExpr:!0}),u.jsxTagStart=new i("jsxTagStart",{startsExpr:!0}),u.jsxTagEnd=new i("jsxTagEnd"),u.jsxTagStart.updateContext=function(){this.state.context.push(H.j_expr),this.state.context.push(H.j_oTag),this.state.exprAllowed=!1},u.jsxTagEnd.updateContext=function(e){const t=this.state.context.pop();t===H.j_oTag&&e===u.slash||t===H.j_cTag?(this.state.context.pop(),this.state.exprAllowed=this.curContext()===H.j_expr):this.state.exprAllowed=!0};class be{constructor(e){this.var=[],this.lexical=[],this.functions=[],this.flags=e}}class xe{constructor(e,t){this.scopeStack=[],this.undefinedExports=new Map,this.raise=e,this.inModule=t}get inFunction(){return(this.currentVarScope().flags&p)>0}get inGenerator(){return(this.currentVarScope().flags&f)>0}get inAsync(){return(this.currentVarScope().flags&h)>0}get allowSuper(){return(this.currentThisScope().flags&m)>0}get allowDirectSuper(){return(this.currentThisScope().flags&g)>0}get inNonArrowFunction(){return(this.currentThisScope().flags&p)>0}get treatFunctionsAsVar(){return this.treatFunctionsAsVarInScope(this.currentScope())}createScope(e){return new be(e)}enter(e){this.scopeStack.push(this.createScope(e))}exit(){this.scopeStack.pop()}treatFunctionsAsVarInScope(e){return!!(e.flags&p||!this.inModule&&e.flags&l)}declareName(e,t,n){let r=this.currentScope();if(t&P||t&v)this.checkRedeclarationInScope(r,e,t,n),t&v?r.functions.push(e):r.lexical.push(e),t&P&&this.maybeExportDefined(r,e);else if(t&x)for(let i=this.scopeStack.length-1;i>=0&&(r=this.scopeStack[i],this.checkRedeclarationInScope(r,e,t,n),r.var.push(e),this.maybeExportDefined(r,e),!(r.flags&T));--i);this.inModule&&r.flags&l&&this.undefinedExports.delete(e)}maybeExportDefined(e,t){this.inModule&&e.flags&l&&this.undefinedExports.delete(t)}checkRedeclarationInScope(e,t,n,r){this.isRedeclaredInScope(e,t,n)&&this.raise(r,`Identifier '${t}' has already been declared`)}isRedeclaredInScope(e,t,n){return!!(n&S)&&(n&P?e.lexical.indexOf(t)>-1||e.functions.indexOf(t)>-1||e.var.indexOf(t)>-1:n&v?e.lexical.indexOf(t)>-1||!this.treatFunctionsAsVarInScope(e)&&e.var.indexOf(t)>-1:e.lexical.indexOf(t)>-1&&!(e.flags&y&&e.lexical[0]===t)||!this.treatFunctionsAsVarInScope(e)&&e.functions.indexOf(t)>-1)}checkLocalExport(e){-1===this.scopeStack[0].lexical.indexOf(e.name)&&-1===this.scopeStack[0].var.indexOf(e.name)&&-1===this.scopeStack[0].functions.indexOf(e.name)&&this.undefinedExports.set(e.name,e.start)}currentScope(){return this.scopeStack[this.scopeStack.length-1]}currentVarScope(){for(let e=this.scopeStack.length-1;;e--){const t=this.scopeStack[e];if(t.flags&T)return t}}currentThisScope(){for(let e=this.scopeStack.length-1;;e--){const t=this.scopeStack[e];if((t.flags&T||t.flags&E)&&!(t.flags&d))return t}}}class Pe extends be{constructor(...e){super(...e),this.types=[],this.enums=[],this.constEnums=[],this.classes=[],this.exportOnlyBindings=[]}}class ve extends xe{createScope(e){return new Pe(e)}declareName(e,t,n){const r=this.currentScope();if(t&w)return this.maybeExportDefined(r,e),void r.exportOnlyBindings.push(e);super.declareName(...arguments),t&b&&(t&S||(this.checkRedeclarationInScope(r,e,t,n),this.maybeExportDefined(r,e)),r.types.push(e)),t&C&&r.enums.push(e),t&O&&r.constEnums.push(e),t&D&&r.classes.push(e)}isRedeclaredInScope(e,t,n){if(e.enums.indexOf(t)>-1){if(n&C){return!!(n&O)!==e.constEnums.indexOf(t)>-1}return!0}return n&D&&e.classes.indexOf(t)>-1?e.lexical.indexOf(t)>-1&&!!(n&S):!!(n&b&&e.types.indexOf(t)>-1)||super.isRedeclaredInScope(...arguments)}checkLocalExport(e){-1===this.scopeStack[0].types.indexOf(e.name)&&-1===this.scopeStack[0].exportOnlyBindings.indexOf(e.name)&&super.checkLocalExport(e)}}function De(e){if(null==e)throw new Error(`Unexpected ${e} value.`);return e}function Ce(e){if(!e)throw new Error("Assert fail")}u.placeholder=new i("%%",{startsExpr:!0});function Oe(e,t){return e.some(e=>Array.isArray(e)?e[0]===t:e===t)}function we(e,t,n){const r=e.find(e=>Array.isArray(e)?e[0]===t:e===t);return r&&Array.isArray(r)?r[1][n]:null}const Fe=["minimal","smart","fsharp"];const _e={estree:e=>(class extends e{estreeParseRegExpLiteral({pattern:e,flags:t}){let n=null;try{n=new RegExp(e,t)}catch(e){}const r=this.estreeParseLiteral(n);return r.regex={pattern:e,flags:t},r}estreeParseLiteral(e){return this.parseLiteral(e,"Literal")}directiveToStmt(e){const t=e.value,n=this.startNodeAt(e.start,e.loc.start),r=this.startNodeAt(t.start,t.loc.start);return r.value=t.value,r.raw=t.extra.raw,n.expression=this.finishNodeAt(r,"Literal",t.end,t.loc.end),n.directive=t.extra.raw.slice(1,-1),this.finishNodeAt(n,"ExpressionStatement",e.end,e.loc.end)}initFunction(e,t){super.initFunction(e,t),e.expression=!1}checkDeclaration(e){X(e)?this.checkDeclaration(e.value):super.checkDeclaration(e)}checkGetterSetterParams(e){const t=e,n="get"===t.kind?0:1,r=t.start;t.value.params.length!==n&&("get"===t.kind?this.raise(r,"getter must not have any formal parameters"):this.raise(r,"setter must have exactly one formal parameter")),"set"===t.kind&&"RestElement"===t.value.params[0].type&&this.raise(r,"setter function argument must not be a rest parameter")}checkLVal(e,t=j,n,r){switch(e.type){case"ObjectPattern":e.properties.forEach(e=>{this.checkLVal("Property"===e.type?e.value:e,t,n,"object destructuring pattern")});break;default:super.checkLVal(e,t,n,r)}}checkPropClash(e,t){if("SpreadElement"===e.type||e.computed||e.method||e.shorthand)return;const n=e.key;"__proto__"===("Identifier"===n.type?n.name:String(n.value))&&"init"===e.kind&&(t.proto&&this.raise(n.start,"Redefinition of __proto__ property"),t.proto=!0)}isStrictBody(e){if("BlockStatement"===e.body.type&&e.body.body.length>0)for(let t=0,n=e.body.body;tthis.directiveToStmt(e));e.body=i.concat(e.body),delete e.directives}pushClassMethod(e,t,n,r,i,s){this.parseMethod(t,n,r,i,s,"ClassMethod",!0),t.typeParameters&&(t.value.typeParameters=t.typeParameters,delete t.typeParameters),e.body.push(t)}parseExprAtom(e){switch(this.state.type){case u.regexp:return this.estreeParseRegExpLiteral(this.state.value);case u.num:case u.string:return this.estreeParseLiteral(this.state.value);case u._null:return this.estreeParseLiteral(null);case u._true:return this.estreeParseLiteral(!0);case u._false:return this.estreeParseLiteral(!1);default:return super.parseExprAtom(e)}}parseLiteral(e,t,n,r){const i=super.parseLiteral(e,t,n,r);return i.raw=i.extra.raw,delete i.extra,i}parseFunctionBody(e,t,n=!1){super.parseFunctionBody(e,t,n),e.expression="BlockStatement"!==e.body.type}parseMethod(e,t,n,r,i,s,o=!1){let a=this.startNode();return a.kind=e.kind,(a=super.parseMethod(a,t,n,r,i,s,o)).type="FunctionExpression",delete a.kind,e.value=a,s="ClassMethod"===s?"MethodDefinition":s,this.finishNode(e,s)}parseObjectMethod(e,t,n,r,i){const s=super.parseObjectMethod(e,t,n,r,i);return s&&(s.type="Property","method"===s.kind&&(s.kind="init"),s.shorthand=!1),s}parseObjectProperty(e,t,n,r,i){const s=super.parseObjectProperty(e,t,n,r,i);return s&&(s.kind="init",s.type="Property"),s}toAssignable(e,t,n){return X(e)?(this.toAssignable(e.value,t,n),e):super.toAssignable(e,t,n)}toAssignableObjectExpressionProp(e,t,n){"get"===e.kind||"set"===e.kind?this.raise(e.key.start,"Object pattern can't contain getter or setter"):e.method?this.raise(e.key.start,"Object pattern can't contain methods"):super.toAssignableObjectExpressionProp(e,t,n)}}),jsx:e=>(class extends e{jsxReadToken(){let e="",t=this.state.pos;for(;;){this.state.pos>=this.length&&this.raise(this.state.start,"Unterminated JSX contents");const n=this.input.charCodeAt(this.state.pos);switch(n){case 60:case 123:return this.state.pos===this.state.start?60===n&&this.state.exprAllowed?(++this.state.pos,this.finishToken(u.jsxTagStart)):super.getTokenFromCode(n):(e+=this.input.slice(t,this.state.pos),this.finishToken(u.jsxText,e));case 38:e+=this.input.slice(t,this.state.pos),e+=this.jsxReadEntity(),t=this.state.pos;break;default:K(n)?(e+=this.input.slice(t,this.state.pos),e+=this.jsxReadNewLine(!0),t=this.state.pos):++this.state.pos}}}jsxReadNewLine(e){const t=this.input.charCodeAt(this.state.pos);let n;return++this.state.pos,13===t&&10===this.input.charCodeAt(this.state.pos)?(++this.state.pos,n=e?"\n":"\r\n"):n=String.fromCharCode(t),++this.state.curLine,this.state.lineStart=this.state.pos,n}jsxReadString(e){let t="",n=++this.state.pos;for(;;){this.state.pos>=this.length&&this.raise(this.state.start,"Unterminated string constant");const r=this.input.charCodeAt(this.state.pos);if(r===e)break;38===r?(t+=this.input.slice(n,this.state.pos),t+=this.jsxReadEntity(),n=this.state.pos):K(r)?(t+=this.input.slice(n,this.state.pos),t+=this.jsxReadNewLine(!1),n=this.state.pos):++this.state.pos}return t+=this.input.slice(n,this.state.pos++),this.finishToken(u.string,t)}jsxReadEntity(){let e,t="",n=0,r=this.input[this.state.pos];const i=++this.state.pos;for(;this.state.pos"):!Ae(i)&&Ae(s)?this.raise(s.start,"Expected corresponding JSX closing tag for <"+Se(i.name)+">"):Ae(i)||Ae(s)||Se(s.name)!==Se(i.name)&&this.raise(s.start,"Expected corresponding JSX closing tag for <"+Se(i.name)+">")}return Ae(i)?(n.openingFragment=i,n.closingFragment=s):(n.openingElement=i,n.closingElement=s),n.children=r,this.match(u.relational)&&"<"===this.state.value&&this.raise(this.state.start,"Adjacent JSX elements must be wrapped in an enclosing tag. Did you want a JSX fragment <>...?"),Ae(i)?this.finishNode(n,"JSXFragment"):this.finishNode(n,"JSXElement")}jsxParseElement(){const e=this.state.start,t=this.state.startLoc;return this.next(),this.jsxParseElementAt(e,t)}parseExprAtom(e){return this.match(u.jsxText)?this.parseLiteral(this.state.value,"JSXText"):this.match(u.jsxTagStart)?this.jsxParseElement():this.isRelational("<")&&33!==this.input.charCodeAt(this.state.pos)?(this.finishToken(u.jsxTagStart),this.jsxParseElement()):super.parseExprAtom(e)}getTokenFromCode(e){if(this.state.inPropertyName)return super.getTokenFromCode(e);const t=this.curContext();if(t===H.j_expr)return this.jsxReadToken();if(t===H.j_oTag||t===H.j_cTag){if(le(e))return this.jsxReadWord();if(62===e)return++this.state.pos,this.finishToken(u.jsxTagEnd);if((34===e||39===e)&&t===H.j_oTag)return this.jsxReadString(e)}return 60===e&&this.state.exprAllowed&&33!==this.input.charCodeAt(this.state.pos+1)?(++this.state.pos,this.finishToken(u.jsxTagStart)):super.getTokenFromCode(e)}updateContext(e){if(this.match(u.braceL)){const t=this.curContext();t===H.j_oTag?this.state.context.push(H.braceExpression):t===H.j_expr?this.state.context.push(H.templateQuasi):super.updateContext(e),this.state.exprAllowed=!0}else{if(!this.match(u.slash)||e!==u.jsxTagStart)return super.updateContext(e);this.state.context.length-=2,this.state.context.push(H.j_cTag),this.state.exprAllowed=!1}}}),flow:e=>(class extends e{constructor(e,t){super(e,t),this.flowPragma=void 0}shouldParseTypes(){return this.getPluginOption("flow","all")||"flow"===this.flowPragma}finishToken(e,t){return e!==u.string&&e!==u.semi&&e!==u.interpreterDirective&&void 0===this.flowPragma&&(this.flowPragma=null),super.finishToken(e,t)}addComment(e){if(void 0===this.flowPragma){const t=me.exec(e.value);if(t)if("flow"===t[1])this.flowPragma="flow";else{if("noflow"!==t[1])throw new Error("Unexpected flow pragma");this.flowPragma="noflow"}}return super.addComment(e)}flowParseTypeInitialiser(e){const t=this.state.inType;this.state.inType=!0,this.expect(e||u.colon);const n=this.flowParseType();return this.state.inType=t,n}flowParsePredicate(){const e=this.startNode(),t=this.state.startLoc,n=this.state.start;this.expect(u.modulo);const r=this.state.startLoc;return this.expectContextual("checks"),t.line===r.line&&t.column===r.column-1||this.raise(n,"Spaces between ´%´ and ´checks´ are not allowed here."),this.eat(u.parenL)?(e.value=this.parseExpression(),this.expect(u.parenR),this.finishNode(e,"DeclaredPredicate")):this.finishNode(e,"InferredPredicate")}flowParseTypeAndPredicateInitialiser(){const e=this.state.inType;this.state.inType=!0,this.expect(u.colon);let t=null,n=null;return this.match(u.modulo)?(this.state.inType=e,n=this.flowParsePredicate()):(t=this.flowParseType(),this.state.inType=e,this.match(u.modulo)&&(n=this.flowParsePredicate())),[t,n]}flowParseDeclareClass(e){return this.next(),this.flowParseInterfaceish(e,!0),this.finishNode(e,"DeclareClass")}flowParseDeclareFunction(e){this.next();const t=e.id=this.parseIdentifier(),n=this.startNode(),r=this.startNode();this.isRelational("<")?n.typeParameters=this.flowParseTypeParameterDeclaration():n.typeParameters=null,this.expect(u.parenL);const i=this.flowParseFunctionTypeParams();return n.params=i.params,n.rest=i.rest,this.expect(u.parenR),[n.returnType,e.predicate]=this.flowParseTypeAndPredicateInitialiser(),r.typeAnnotation=this.finishNode(n,"FunctionTypeAnnotation"),t.typeAnnotation=this.finishNode(r,"TypeAnnotation"),this.resetEndLocation(t),this.semicolon(),this.finishNode(e,"DeclareFunction")}flowParseDeclare(e,t){if(this.match(u._class))return this.flowParseDeclareClass(e);if(this.match(u._function))return this.flowParseDeclareFunction(e);if(this.match(u._var))return this.flowParseDeclareVariable(e);if(this.eatContextual("module"))return this.match(u.dot)?this.flowParseDeclareModuleExports(e):(t&&this.unexpected(this.state.lastTokStart,"`declare module` cannot be used inside another `declare module`"),this.flowParseDeclareModule(e));if(this.isContextual("type"))return this.flowParseDeclareTypeAlias(e);if(this.isContextual("opaque"))return this.flowParseDeclareOpaqueType(e);if(this.isContextual("interface"))return this.flowParseDeclareInterface(e);if(this.match(u._export))return this.flowParseDeclareExportDeclaration(e,t);throw this.unexpected()}flowParseDeclareVariable(e){return this.next(),e.id=this.flowParseTypeAnnotatableIdentifier(!0),this.semicolon(),this.finishNode(e,"DeclareVariable")}flowParseDeclareModule(e){this.scope.enter(c),this.match(u.string)?e.id=this.parseExprAtom():e.id=this.parseIdentifier();const t=e.body=this.startNode(),n=t.body=[];for(this.expect(u.braceL);!this.match(u.braceR);){let e=this.startNode();this.match(u._import)?(this.next(),this.isContextual("type")||this.match(u._typeof)||this.unexpected(this.state.lastTokStart,"Imports within a `declare module` body must always be `import type` or `import typeof`"),this.parseImport(e)):(this.expectContextual("declare","Only declares and type imports are allowed inside declare module"),e=this.flowParseDeclare(e,!0)),n.push(e)}this.scope.exit(),this.expect(u.braceR),this.finishNode(t,"BlockStatement");let r=null,i=!1;const s="Found both `declare module.exports` and `declare export` in the same module. Modules can only have 1 since they are either an ES module or they are a CommonJS module";return n.forEach(e=>{!function(e){return"DeclareExportAllDeclaration"===e.type||"DeclareExportDeclaration"===e.type&&(!e.declaration||"TypeAlias"!==e.declaration.type&&"InterfaceDeclaration"!==e.declaration.type)}(e)?"DeclareModuleExports"===e.type&&(i&&this.unexpected(e.start,"Duplicate `declare module.exports` statement"),"ES"===r&&this.unexpected(e.start,s),r="CommonJS",i=!0):("CommonJS"===r&&this.unexpected(e.start,s),r="ES")}),e.kind=r||"CommonJS",this.finishNode(e,"DeclareModule")}flowParseDeclareExportDeclaration(e,t){if(this.expect(u._export),this.eat(u._default))return this.match(u._function)||this.match(u._class)?e.declaration=this.flowParseDeclare(this.startNode()):(e.declaration=this.flowParseType(),this.semicolon()),e.default=!0,this.finishNode(e,"DeclareExportDeclaration");if(this.match(u._const)||this.isLet()||(this.isContextual("type")||this.isContextual("interface"))&&!t){const e=this.state.value,t=ye[e];this.unexpected(this.state.start,`\`declare export ${e}\` is not supported. Use \`${t}\` instead`)}if(this.match(u._var)||this.match(u._function)||this.match(u._class)||this.isContextual("opaque"))return e.declaration=this.flowParseDeclare(this.startNode()),e.default=!1,this.finishNode(e,"DeclareExportDeclaration");if(this.match(u.star)||this.match(u.braceL)||this.isContextual("interface")||this.isContextual("type")||this.isContextual("opaque"))return"ExportNamedDeclaration"===(e=this.parseExport(e)).type&&(e.type="ExportDeclaration",e.default=!1,delete e.exportKind),e.type="Declare"+e.type,e;throw this.unexpected()}flowParseDeclareModuleExports(e){return this.next(),this.expectContextual("exports"),e.typeAnnotation=this.flowParseTypeAnnotation(),this.semicolon(),this.finishNode(e,"DeclareModuleExports")}flowParseDeclareTypeAlias(e){return this.next(),this.flowParseTypeAlias(e),e.type="DeclareTypeAlias",e}flowParseDeclareOpaqueType(e){return this.next(),this.flowParseOpaqueType(e,!0),e.type="DeclareOpaqueType",e}flowParseDeclareInterface(e){return this.next(),this.flowParseInterfaceish(e),this.finishNode(e,"DeclareInterface")}flowParseInterfaceish(e,t=!1){if(e.id=this.flowParseRestrictedIdentifier(!t),this.isRelational("<")?e.typeParameters=this.flowParseTypeParameterDeclaration():e.typeParameters=null,e.extends=[],e.implements=[],e.mixins=[],this.eat(u._extends))do{e.extends.push(this.flowParseInterfaceExtends())}while(!t&&this.eat(u.comma));if(this.isContextual("mixins")){this.next();do{e.mixins.push(this.flowParseInterfaceExtends())}while(this.eat(u.comma))}if(this.isContextual("implements")){this.next();do{e.implements.push(this.flowParseInterfaceExtends())}while(this.eat(u.comma))}e.body=this.flowParseObjectType({allowStatic:t,allowExact:!1,allowSpread:!1,allowProto:t,allowInexact:!1})}flowParseInterfaceExtends(){const e=this.startNode();return e.id=this.flowParseQualifiedTypeIdentifier(),this.isRelational("<")?e.typeParameters=this.flowParseTypeParameterInstantiation():e.typeParameters=null,this.finishNode(e,"InterfaceExtends")}flowParseInterface(e){return this.flowParseInterfaceish(e),this.finishNode(e,"InterfaceDeclaration")}checkNotUnderscore(e){if("_"===e)throw this.unexpected(null,"`_` is only allowed as a type argument to call or new")}checkReservedType(e,t){he.indexOf(e)>-1&&this.raise(t,`Cannot overwrite reserved type ${e}`)}flowParseRestrictedIdentifier(e){return this.checkReservedType(this.state.value,this.state.start),this.parseIdentifier(e)}flowParseTypeAlias(e){return e.id=this.flowParseRestrictedIdentifier(),this.scope.declareName(e.id.name,_,e.id.start),this.isRelational("<")?e.typeParameters=this.flowParseTypeParameterDeclaration():e.typeParameters=null,e.right=this.flowParseTypeInitialiser(u.eq),this.semicolon(),this.finishNode(e,"TypeAlias")}flowParseOpaqueType(e,t){return this.expectContextual("type"),e.id=this.flowParseRestrictedIdentifier(!0),this.scope.declareName(e.id.name,_,e.id.start),this.isRelational("<")?e.typeParameters=this.flowParseTypeParameterDeclaration():e.typeParameters=null,e.supertype=null,this.match(u.colon)&&(e.supertype=this.flowParseTypeInitialiser(u.colon)),e.impltype=null,t||(e.impltype=this.flowParseTypeInitialiser(u.eq)),this.semicolon(),this.finishNode(e,"OpaqueType")}flowParseTypeParameter(e=!1){const t=this.state.start,n=this.startNode(),r=this.flowParseVariance(),i=this.flowParseTypeAnnotatableIdentifier();return n.name=i.name,n.variance=r,n.bound=i.typeAnnotation,this.match(u.eq)?(this.eat(u.eq),n.default=this.flowParseType()):e&&this.unexpected(t,"Type parameter declaration needs a default, since a preceding type parameter declaration has a default."),this.finishNode(n,"TypeParameter")}flowParseTypeParameterDeclaration(){const e=this.state.inType,t=this.startNode();t.params=[],this.state.inType=!0,this.isRelational("<")||this.match(u.jsxTagStart)?this.next():this.unexpected();let n=!1;do{const e=this.flowParseTypeParameter(n);t.params.push(e),e.default&&(n=!0),this.isRelational(">")||this.expect(u.comma)}while(!this.isRelational(">"));return this.expectRelational(">"),this.state.inType=e,this.finishNode(t,"TypeParameterDeclaration")}flowParseTypeParameterInstantiation(){const e=this.startNode(),t=this.state.inType;e.params=[],this.state.inType=!0,this.expectRelational("<");const n=this.state.noAnonFunctionType;for(this.state.noAnonFunctionType=!1;!this.isRelational(">");)e.params.push(this.flowParseType()),this.isRelational(">")||this.expect(u.comma);return this.state.noAnonFunctionType=n,this.expectRelational(">"),this.state.inType=t,this.finishNode(e,"TypeParameterInstantiation")}flowParseTypeParameterInstantiationCallOrNew(){const e=this.startNode(),t=this.state.inType;for(e.params=[],this.state.inType=!0,this.expectRelational("<");!this.isRelational(">");)e.params.push(this.flowParseTypeOrImplicitInstantiation()),this.isRelational(">")||this.expect(u.comma);return this.expectRelational(">"),this.state.inType=t,this.finishNode(e,"TypeParameterInstantiation")}flowParseInterfaceType(){const e=this.startNode();if(this.expectContextual("interface"),e.extends=[],this.eat(u._extends))do{e.extends.push(this.flowParseInterfaceExtends())}while(this.eat(u.comma));return e.body=this.flowParseObjectType({allowStatic:!1,allowExact:!1,allowSpread:!1,allowProto:!1,allowInexact:!1}),this.finishNode(e,"InterfaceTypeAnnotation")}flowParseObjectPropertyKey(){return this.match(u.num)||this.match(u.string)?this.parseExprAtom():this.parseIdentifier(!0)}flowParseObjectTypeIndexer(e,t,n){return e.static=t,this.lookahead().type===u.colon?(e.id=this.flowParseObjectPropertyKey(),e.key=this.flowParseTypeInitialiser()):(e.id=null,e.key=this.flowParseType()),this.expect(u.bracketR),e.value=this.flowParseTypeInitialiser(),e.variance=n,this.finishNode(e,"ObjectTypeIndexer")}flowParseObjectTypeInternalSlot(e,t){return e.static=t,e.id=this.flowParseObjectPropertyKey(),this.expect(u.bracketR),this.expect(u.bracketR),this.isRelational("<")||this.match(u.parenL)?(e.method=!0,e.optional=!1,e.value=this.flowParseObjectTypeMethodish(this.startNodeAt(e.start,e.loc.start))):(e.method=!1,this.eat(u.question)&&(e.optional=!0),e.value=this.flowParseTypeInitialiser()),this.finishNode(e,"ObjectTypeInternalSlot")}flowParseObjectTypeMethodish(e){for(e.params=[],e.rest=null,e.typeParameters=null,this.isRelational("<")&&(e.typeParameters=this.flowParseTypeParameterDeclaration()),this.expect(u.parenL);!this.match(u.parenR)&&!this.match(u.ellipsis);)e.params.push(this.flowParseFunctionTypeParam()),this.match(u.parenR)||this.expect(u.comma);return this.eat(u.ellipsis)&&(e.rest=this.flowParseFunctionTypeParam()),this.expect(u.parenR),e.returnType=this.flowParseTypeInitialiser(),this.finishNode(e,"FunctionTypeAnnotation")}flowParseObjectTypeCallProperty(e,t){const n=this.startNode();return e.static=t,e.value=this.flowParseObjectTypeMethodish(n),this.finishNode(e,"ObjectTypeCallProperty")}flowParseObjectType({allowStatic:e,allowExact:t,allowSpread:n,allowProto:r,allowInexact:i}){const s=this.state.inType;this.state.inType=!0;const o=this.startNode();let a,c;o.callProperties=[],o.properties=[],o.indexers=[],o.internalSlots=[];let l=!1;for(t&&this.match(u.braceBarL)?(this.expect(u.braceBarL),a=u.braceBarR,c=!0):(this.expect(u.braceL),a=u.braceR,c=!1),o.exact=c;!this.match(a);){let t=!1,s=null;const a=this.startNode();if(r&&this.isContextual("proto")){const t=this.lookahead();t.type!==u.colon&&t.type!==u.question&&(this.next(),s=this.state.start,e=!1)}if(e&&this.isContextual("static")){const e=this.lookahead();e.type!==u.colon&&e.type!==u.question&&(this.next(),t=!0)}const c=this.flowParseVariance();if(this.eat(u.bracketL))null!=s&&this.unexpected(s),this.eat(u.bracketL)?(c&&this.unexpected(c.start),o.internalSlots.push(this.flowParseObjectTypeInternalSlot(a,t))):o.indexers.push(this.flowParseObjectTypeIndexer(a,t,c));else if(this.match(u.parenL)||this.isRelational("<"))null!=s&&this.unexpected(s),c&&this.unexpected(c.start),o.callProperties.push(this.flowParseObjectTypeCallProperty(a,t));else{let e="init";if(this.isContextual("get")||this.isContextual("set")){const t=this.lookahead();t.type!==u.name&&t.type!==u.string&&t.type!==u.num||(e=this.state.value,this.next())}const r=this.flowParseObjectTypeProperty(a,t,s,c,e,n,i);null===r?l=!0:o.properties.push(r)}this.flowObjectTypeSemicolon()}this.expect(a),n&&(o.inexact=l);const p=this.finishNode(o,"ObjectTypeAnnotation");return this.state.inType=s,p}flowParseObjectTypeProperty(e,t,n,r,i,s,o){if(this.match(u.ellipsis)){s||this.unexpected(null,"Spread operator cannot appear in class or interface definitions"),null!=n&&this.unexpected(n),r&&this.unexpected(r.start,"Spread properties cannot have variance"),this.expect(u.ellipsis);const t=this.eat(u.comma)||this.eat(u.semi);if(this.match(u.braceR)){if(o)return null;this.unexpected(null,"Explicit inexact syntax is only allowed inside inexact objects")}return this.match(u.braceBarR)&&this.unexpected(null,"Explicit inexact syntax cannot appear inside an explicit exact object type"),t&&this.unexpected(null,"Explicit inexact syntax must appear at the end of an inexact object"),e.argument=this.flowParseType(),this.finishNode(e,"ObjectTypeSpreadProperty")}{e.key=this.flowParseObjectPropertyKey(),e.static=t,e.proto=null!=n,e.kind=i;let s=!1;return this.isRelational("<")||this.match(u.parenL)?(e.method=!0,null!=n&&this.unexpected(n),r&&this.unexpected(r.start),e.value=this.flowParseObjectTypeMethodish(this.startNodeAt(e.start,e.loc.start)),"get"!==i&&"set"!==i||this.flowCheckGetterSetterParams(e)):("init"!==i&&this.unexpected(),e.method=!1,this.eat(u.question)&&(s=!0),e.value=this.flowParseTypeInitialiser(),e.variance=r),e.optional=s,this.finishNode(e,"ObjectTypeProperty")}}flowCheckGetterSetterParams(e){const t="get"===e.kind?0:1,n=e.start;e.value.params.length+(e.value.rest?1:0)!==t&&("get"===e.kind?this.raise(n,"getter must not have any formal parameters"):this.raise(n,"setter must have exactly one formal parameter")),"set"===e.kind&&e.value.rest&&this.raise(n,"setter function argument must not be a rest parameter")}flowObjectTypeSemicolon(){this.eat(u.semi)||this.eat(u.comma)||this.match(u.braceR)||this.match(u.braceBarR)||this.unexpected()}flowParseQualifiedTypeIdentifier(e,t,n){e=e||this.state.start,t=t||this.state.startLoc;let r=n||this.parseIdentifier();for(;this.eat(u.dot);){const n=this.startNodeAt(e,t);n.qualification=r,n.id=this.parseIdentifier(),r=this.finishNode(n,"QualifiedTypeIdentifier")}return r}flowParseGenericType(e,t,n){const r=this.startNodeAt(e,t);return r.typeParameters=null,r.id=this.flowParseQualifiedTypeIdentifier(e,t,n),this.isRelational("<")&&(r.typeParameters=this.flowParseTypeParameterInstantiation()),this.finishNode(r,"GenericTypeAnnotation")}flowParseTypeofType(){const e=this.startNode();return this.expect(u._typeof),e.argument=this.flowParsePrimaryType(),this.finishNode(e,"TypeofTypeAnnotation")}flowParseTupleType(){const e=this.startNode();for(e.types=[],this.expect(u.bracketL);this.state.possuper.parseFunctionBody(e,!0,n)):super.parseFunctionBody(e,!1,n)}parseFunctionBodyAndFinish(e,t,n=!1){if(this.match(u.colon)){const t=this.startNode();[t.typeAnnotation,e.predicate]=this.flowParseTypeAndPredicateInitialiser(),e.returnType=t.typeAnnotation?this.finishNode(t,"TypeAnnotation"):null}super.parseFunctionBodyAndFinish(e,t,n)}parseStatement(e,t){if(this.state.strict&&this.match(u.name)&&"interface"===this.state.value){const e=this.startNode();return this.next(),this.flowParseInterface(e)}{const n=super.parseStatement(e,t);return void 0!==this.flowPragma||this.isValidDirective(n)||(this.flowPragma=null),n}}parseExpressionStatement(e,t){if("Identifier"===t.type)if("declare"===t.name){if(this.match(u._class)||this.match(u.name)||this.match(u._function)||this.match(u._var)||this.match(u._export))return this.flowParseDeclare(e)}else if(this.match(u.name)){if("interface"===t.name)return this.flowParseInterface(e);if("type"===t.name)return this.flowParseTypeAlias(e);if("opaque"===t.name)return this.flowParseOpaqueType(e,!1)}return super.parseExpressionStatement(e,t)}shouldParseExportDeclaration(){return this.isContextual("type")||this.isContextual("interface")||this.isContextual("opaque")||super.shouldParseExportDeclaration()}isExportDefaultSpecifier(){return(!this.match(u.name)||"type"!==this.state.value&&"interface"!==this.state.value&&"opaque"!==this.state.value)&&super.isExportDefaultSpecifier()}parseConditional(e,t,n,r,i){if(!this.match(u.question))return e;if(i){const s=this.state.clone();try{return super.parseConditional(e,t,n,r)}catch(t){if(t instanceof SyntaxError)return this.state=s,i.start=t.pos||this.state.start,e;throw t}}this.expect(u.question);const s=this.state.clone(),o=this.state.noArrowAt,a=this.startNodeAt(n,r);let{consequent:c,failed:l}=this.tryParseConditionalConsequent(),[p,h]=this.getArrowLikeExpressions(c);if(l||h.length>0){const e=[...o];if(h.length>0){this.state=s,this.state.noArrowAt=e;for(let t=0;t1&&this.raise(s.start,"Ambiguous expression: wrap the arrow functions in parentheses to disambiguate."),l&&1===p.length&&(this.state=s,this.state.noArrowAt=e.concat(p[0].start),({consequent:c,failed:l}=this.tryParseConditionalConsequent())),this.getArrowLikeExpressions(c,!0)}return this.state.noArrowAt=o,this.expect(u.colon),a.test=e,a.consequent=c,a.alternate=this.forwardNoArrowParamsConversionAt(a,()=>this.parseMaybeAssign(t,void 0,void 0,void 0)),this.finishNode(a,"ConditionalExpression")}tryParseConditionalConsequent(){this.state.noArrowParamsConversionAt.push(this.state.start);const e=this.parseMaybeAssign(),t=!this.match(u.colon);return this.state.noArrowParamsConversionAt.pop(),{consequent:e,failed:t}}getArrowLikeExpressions(e,t){const n=[e],r=[];for(;0!==n.length;){const e=n.pop();"ArrowFunctionExpression"===e.type?(e.typeParameters||!e.returnType?(this.toAssignableList(e.params,!0,"arrow function parameters"),this.scope.enter(A(!1,!1)|d),super.checkParams(e,!1,!0),this.scope.exit()):r.push(e),n.push(e.body)):"ConditionalExpression"===e.type&&(n.push(e.consequent),n.push(e.alternate))}if(t){for(let t=0;t{try{return this.toAssignableList(e.params,!0,"arrow function parameters"),!0}catch(e){return!1}})}forwardNoArrowParamsConversionAt(e,t){let n;return-1!==this.state.noArrowParamsConversionAt.indexOf(e.start)?(this.state.noArrowParamsConversionAt.push(this.state.start),n=t(),this.state.noArrowParamsConversionAt.pop()):n=t(),n}parseParenItem(e,t,n){if(e=super.parseParenItem(e,t,n),this.eat(u.question)&&(e.optional=!0,this.resetEndLocation(e)),this.match(u.colon)){const r=this.startNodeAt(t,n);return r.expression=e,r.typeAnnotation=this.flowParseTypeAnnotation(),this.finishNode(r,"TypeCastExpression")}return e}assertModuleNodeAllowed(e){"ImportDeclaration"===e.type&&("type"===e.importKind||"typeof"===e.importKind)||"ExportNamedDeclaration"===e.type&&"type"===e.exportKind||"ExportAllDeclaration"===e.type&&"type"===e.exportKind||super.assertModuleNodeAllowed(e)}parseExport(e){const t=super.parseExport(e);return"ExportNamedDeclaration"!==t.type&&"ExportAllDeclaration"!==t.type||(t.exportKind=t.exportKind||"value"),t}parseExportDeclaration(e){if(this.isContextual("type")){e.exportKind="type";const t=this.startNode();return this.next(),this.match(u.braceL)?(e.specifiers=this.parseExportSpecifiers(),this.parseExportFrom(e),null):this.flowParseTypeAlias(t)}if(this.isContextual("opaque")){e.exportKind="type";const t=this.startNode();return this.next(),this.flowParseOpaqueType(t,!1)}if(this.isContextual("interface")){e.exportKind="type";const t=this.startNode();return this.next(),this.flowParseInterface(t)}return super.parseExportDeclaration(e)}eatExportStar(e){return!!super.eatExportStar(...arguments)||!(!this.isContextual("type")||this.lookahead().type!==u.star)&&(e.exportKind="type",this.next(),this.next(),!0)}maybeParseExportNamespaceSpecifier(e){const t=this.state.start,n=super.maybeParseExportNamespaceSpecifier(e);return n&&"type"===e.exportKind&&this.unexpected(t),n}parseClassId(e,t,n){super.parseClassId(e,t,n),this.isRelational("<")&&(e.typeParameters=this.flowParseTypeParameterDeclaration())}getTokenFromCode(e){const t=this.input.charCodeAt(this.state.pos+1);return 123===e&&124===t?this.finishOp(u.braceBarL,2):!this.state.inType||62!==e&&60!==e?function(e,t){return 64===e&&64===t}(e,t)?(this.state.isIterator=!0,super.readWord()):super.getTokenFromCode(e):this.finishOp(u.relational,1)}toAssignable(e,t,n){return"TypeCastExpression"===e.type?super.toAssignable(this.typeCastToParameter(e),t,n):super.toAssignable(e,t,n)}toAssignableList(e,t,n){for(let t=0;t1)&&t||this.raise(r.typeAnnotation.start,"The type cast expression is expected to be wrapped with parenthesis")}return e}checkLVal(e,t=j,n,r){if("TypeCastExpression"!==e.type)return super.checkLVal(e,t,n,r)}parseClassProperty(e){return this.match(u.colon)&&(e.typeAnnotation=this.flowParseTypeAnnotation()),super.parseClassProperty(e)}parseClassPrivateProperty(e){return this.match(u.colon)&&(e.typeAnnotation=this.flowParseTypeAnnotation()),super.parseClassPrivateProperty(e)}isClassMethod(){return this.isRelational("<")||super.isClassMethod()}isClassProperty(){return this.match(u.colon)||super.isClassProperty()}isNonstaticConstructor(e){return!this.match(u.colon)&&super.isNonstaticConstructor(e)}pushClassMethod(e,t,n,r,i,s){t.variance&&this.unexpected(t.variance.start),delete t.variance,this.isRelational("<")&&(t.typeParameters=this.flowParseTypeParameterDeclaration()),super.pushClassMethod(e,t,n,r,i,s)}pushClassPrivateMethod(e,t,n,r){t.variance&&this.unexpected(t.variance.start),delete t.variance,this.isRelational("<")&&(t.typeParameters=this.flowParseTypeParameterDeclaration()),super.pushClassPrivateMethod(e,t,n,r)}parseClassSuper(e){if(super.parseClassSuper(e),e.superClass&&this.isRelational("<")&&(e.superTypeParameters=this.flowParseTypeParameterInstantiation()),this.isContextual("implements")){this.next();const t=e.implements=[];do{const e=this.startNode();e.id=this.flowParseRestrictedIdentifier(!0),this.isRelational("<")?e.typeParameters=this.flowParseTypeParameterInstantiation():e.typeParameters=null,t.push(this.finishNode(e,"ClassImplements"))}while(this.eat(u.comma))}}parsePropertyName(e){const t=this.flowParseVariance(),n=super.parsePropertyName(e);return e.variance=t,n}parseObjPropValue(e,t,n,r,i,s,o,a){let c;e.variance&&this.unexpected(e.variance.start),delete e.variance,this.isRelational("<")&&(c=this.flowParseTypeParameterDeclaration(),this.match(u.parenL)||this.unexpected()),super.parseObjPropValue(e,t,n,r,i,s,o,a),c&&((e.value||e).typeParameters=c)}parseAssignableListItemTypes(e){if(this.eat(u.question)){if("Identifier"!==e.type)throw this.raise(e.start,"A binding pattern parameter cannot be optional in an implementation signature.");e.optional=!0}return this.match(u.colon)&&(e.typeAnnotation=this.flowParseTypeAnnotation()),this.resetEndLocation(e),e}parseMaybeDefault(e,t,n){const r=super.parseMaybeDefault(e,t,n);return"AssignmentPattern"===r.type&&r.typeAnnotation&&r.right.startsuper.parseMaybeAssign(e,t,n,r))).typeParameters=o,this.resetStartLocationFromNode(s,o)}catch(e){throw i||e}if("ArrowFunctionExpression"===s.type)return s;if(null!=i)throw i;this.raise(o.start,"Expected an arrow function after this type parameter declaration")}return super.parseMaybeAssign(e,t,n,r)}parseArrow(e){if(this.match(u.colon)){const t=this.state.clone();try{const n=this.state.noAnonFunctionType;this.state.noAnonFunctionType=!0;const r=this.startNode();[r.typeAnnotation,e.predicate]=this.flowParseTypeAndPredicateInitialiser(),this.state.noAnonFunctionType=n,this.canInsertSemicolon()&&this.unexpected(),this.match(u.arrow)||this.unexpected(),e.returnType=r.typeAnnotation?this.finishNode(r,"TypeAnnotation"):null}catch(e){if(!(e instanceof SyntaxError))throw e;this.state=t}}return super.parseArrow(e)}shouldParseArrow(){return this.match(u.colon)||super.shouldParseArrow()}setArrowFunctionParameters(e,t){-1!==this.state.noArrowParamsConversionAt.indexOf(e.start)?e.params=t:super.setArrowFunctionParameters(e,t)}checkParams(e,t,n){if(!n||-1===this.state.noArrowParamsConversionAt.indexOf(e.start))return super.checkParams(e,t,n)}parseParenAndDistinguishExpression(e){return super.parseParenAndDistinguishExpression(e&&-1===this.state.noArrowAt.indexOf(this.state.start))}parseSubscripts(e,t,n,r){if("Identifier"===e.type&&"async"===e.name&&-1!==this.state.noArrowAt.indexOf(t)){this.next();const r=this.startNodeAt(t,n);r.callee=e,r.arguments=this.parseCallExpressionArguments(u.parenR,!1),e=this.finishNode(r,"CallExpression")}else if("Identifier"===e.type&&"async"===e.name&&this.isRelational("<")){const i=this.state.clone();let s;try{const e=this.parseAsyncArrowWithTypeParameters(t,n);if(e)return e}catch(e){s=e}this.state=i;try{return super.parseSubscripts(e,t,n,r)}catch(e){throw s||e}}return super.parseSubscripts(e,t,n,r)}parseSubscript(e,t,n,r,i,s){if(this.match(u.questionDot)&&this.isLookaheadRelational("<")){if(this.expectPlugin("optionalChaining"),i.optionalChainMember=!0,r)return i.stop=!0,e;this.next();const s=this.startNodeAt(t,n);return s.callee=e,s.typeArguments=this.flowParseTypeParameterInstantiation(),this.expect(u.parenL),s.arguments=this.parseCallExpressionArguments(u.parenR,!1),s.optional=!0,this.finishNode(s,"OptionalCallExpression")}if(!r&&this.shouldParseTypes()&&this.isRelational("<")){const r=this.startNodeAt(t,n);r.callee=e;const s=this.state.clone();try{return r.typeArguments=this.flowParseTypeParameterInstantiationCallOrNew(),this.expect(u.parenL),r.arguments=this.parseCallExpressionArguments(u.parenR,!1),i.optionalChainMember?(r.optional=!1,this.finishNode(r,"OptionalCallExpression")):this.finishNode(r,"CallExpression")}catch(e){if(!(e instanceof SyntaxError))throw e;this.state=s}}return super.parseSubscript(e,t,n,r,i,s)}parseNewArguments(e){let t=null;if(this.shouldParseTypes()&&this.isRelational("<")){const e=this.state.clone();try{t=this.flowParseTypeParameterInstantiationCallOrNew()}catch(t){if(!(t instanceof SyntaxError))throw t;this.state=e}}e.typeArguments=t,super.parseNewArguments(e)}parseAsyncArrowWithTypeParameters(e,t){const n=this.startNodeAt(e,t);if(this.parseFunctionParams(n),this.parseArrow(n))return this.parseArrowExpression(n,void 0,!0)}readToken_mult_modulo(e){const t=this.input.charCodeAt(this.state.pos+1);if(42===e&&47===t&&this.state.hasFlowComment)return this.state.hasFlowComment=!1,this.state.pos+=2,void this.nextToken();super.readToken_mult_modulo(e)}readToken_pipe_amp(e){const t=this.input.charCodeAt(this.state.pos+1);124!==e||125!==t?super.readToken_pipe_amp(e):this.finishOp(u.braceBarR,2)}parseTopLevel(e,t){const n=super.parseTopLevel(e,t);return this.state.hasFlowComment&&this.unexpected(null,"Unterminated flow-comment"),n}skipBlockComment(){if(this.hasPlugin("flowComments")&&this.skipFlowComment())return this.state.hasFlowComment&&this.unexpected(null,"Cannot have a flow comment inside another flow comment"),this.hasFlowCommentCompletion(),this.state.pos+=this.skipFlowComment(),void(this.state.hasFlowComment=!0);if(this.state.hasFlowComment){const e=this.input.indexOf("*-/",this.state.pos+=2);return-1===e&&this.raise(this.state.pos-2,"Unterminated comment"),void(this.state.pos=e+3)}super.skipBlockComment()}skipFlowComment(){const{pos:e}=this.state;let t=2;for(;[32,9].includes(this.input.charCodeAt(e+t));)t++;const n=this.input.charCodeAt(t+e),r=this.input.charCodeAt(t+e+1);return 58===n&&58===r?t+2:"flow-include"===this.input.slice(t+e,t+e+12)?t+12:58===n&&58!==r&&t}hasFlowCommentCompletion(){-1===this.input.indexOf("*/",this.state.pos)&&this.raise(this.state.pos,"Unterminated comment")}}),typescript:e=>(class extends e{getScopeHandler(){return ve}tsIsIdentifier(){return this.match(u.name)}tsNextTokenCanFollowModifier(){return this.next(),!(this.hasPrecedingLineBreak()||this.match(u.parenL)||this.match(u.parenR)||this.match(u.colon)||this.match(u.eq)||this.match(u.question)||this.match(u.bang))}tsParseModifier(e){if(!this.match(u.name))return;const t=this.state.value;return-1!==e.indexOf(t)&&this.tsTryParse(this.tsNextTokenCanFollowModifier.bind(this))?t:void 0}tsIsListTerminator(e){switch(e){case"EnumMembers":case"TypeMembers":return this.match(u.braceR);case"HeritageClauseElement":return this.match(u.braceL);case"TupleElementTypes":return this.match(u.bracketR);case"TypeParametersOrArguments":return this.isRelational(">")}throw new Error("Unreachable")}tsParseList(e,t){const n=[];for(;!this.tsIsListTerminator(e);)n.push(t());return n}tsParseDelimitedList(e,t){return De(this.tsParseDelimitedListWorker(e,t,!0))}tsParseDelimitedListWorker(e,t,n){const r=[];for(;!this.tsIsListTerminator(e);){const i=t();if(null==i)return;if(r.push(i),!this.eat(u.comma)){if(this.tsIsListTerminator(e))break;return void(n&&this.expect(u.comma))}}return r}tsParseBracketedList(e,t,n,r){r||(n?this.expect(u.bracketL):this.expectRelational("<"));const i=this.tsParseDelimitedList(e,t);return n?this.expect(u.bracketR):this.expectRelational(">"),i}tsParseImportType(){const e=this.startNode();if(this.expect(u._import),this.expect(u.parenL),!this.match(u.string))throw this.unexpected(null,"Argument in a type import must be a string literal");return e.argument=this.parseExprAtom(),this.expect(u.parenR),this.eat(u.dot)&&(e.qualifier=this.tsParseEntityName(!0)),this.isRelational("<")&&(e.typeParameters=this.tsParseTypeArguments()),this.finishNode(e,"TSImportType")}tsParseEntityName(e){let t=this.parseIdentifier();for(;this.eat(u.dot);){const n=this.startNodeAtNode(t);n.left=t,n.right=this.parseIdentifier(e),t=this.finishNode(n,"TSQualifiedName")}return t}tsParseTypeReference(){const e=this.startNode();return e.typeName=this.tsParseEntityName(!1),!this.hasPrecedingLineBreak()&&this.isRelational("<")&&(e.typeParameters=this.tsParseTypeArguments()),this.finishNode(e,"TSTypeReference")}tsParseThisTypePredicate(e){this.next();const t=this.startNodeAtNode(e);return t.parameterName=e,t.typeAnnotation=this.tsParseTypeAnnotation(!1),this.finishNode(t,"TSTypePredicate")}tsParseThisTypeNode(){const e=this.startNode();return this.next(),this.finishNode(e,"TSThisType")}tsParseTypeQuery(){const e=this.startNode();return this.expect(u._typeof),this.match(u._import)?e.exprName=this.tsParseImportType():e.exprName=this.tsParseEntityName(!0),this.finishNode(e,"TSTypeQuery")}tsParseTypeParameter(){const e=this.startNode();return e.name=this.parseIdentifierName(e.start),e.constraint=this.tsEatThenParseType(u._extends),e.default=this.tsEatThenParseType(u.eq),this.finishNode(e,"TSTypeParameter")}tsTryParseTypeParameters(){if(this.isRelational("<"))return this.tsParseTypeParameters()}tsParseTypeParameters(){const e=this.startNode();return this.isRelational("<")||this.match(u.jsxTagStart)?this.next():this.unexpected(),e.params=this.tsParseBracketedList("TypeParametersOrArguments",this.tsParseTypeParameter.bind(this),!1,!0),this.finishNode(e,"TSTypeParameterDeclaration")}tsTryNextParseConstantContext(){return this.lookahead().type===u._const?(this.next(),this.tsParseTypeReference()):null}tsFillSignature(e,t){const n=e===u.arrow;t.typeParameters=this.tsTryParseTypeParameters(),this.expect(u.parenL),t.parameters=this.tsParseBindingListForSignature(),n?t.typeAnnotation=this.tsParseTypeOrTypePredicateAnnotation(e):this.match(e)&&(t.typeAnnotation=this.tsParseTypeOrTypePredicateAnnotation(e))}tsParseBindingListForSignature(){return this.parseBindingList(u.parenR).map(e=>{if("Identifier"!==e.type&&"RestElement"!==e.type&&"ObjectPattern"!==e.type&&"ArrayPattern"!==e.type)throw this.unexpected(e.start,`Name in a signature must be an Identifier, ObjectPattern or ArrayPattern, instead got ${e.type}`);return e})}tsParseTypeMemberSemicolon(){this.eat(u.comma)||this.semicolon()}tsParseSignatureMember(e,t){return this.tsFillSignature(u.colon,t),this.tsParseTypeMemberSemicolon(),this.finishNode(t,e)}tsIsUnambiguouslyIndexSignature(){return this.next(),this.eat(u.name)&&this.match(u.colon)}tsTryParseIndexSignature(e){if(!this.match(u.bracketL)||!this.tsLookAhead(this.tsIsUnambiguouslyIndexSignature.bind(this)))return;this.expect(u.bracketL);const t=this.parseIdentifier();t.typeAnnotation=this.tsParseTypeAnnotation(),this.resetEndLocation(t),this.expect(u.bracketR),e.parameters=[t];const n=this.tsTryParseTypeAnnotation();return n&&(e.typeAnnotation=n),this.tsParseTypeMemberSemicolon(),this.finishNode(e,"TSIndexSignature")}tsParsePropertyOrMethodSignature(e,t){this.eat(u.question)&&(e.optional=!0);const n=e;if(t||!this.match(u.parenL)&&!this.isRelational("<")){const e=n;t&&(e.readonly=!0);const r=this.tsTryParseTypeAnnotation();return r&&(e.typeAnnotation=r),this.tsParseTypeMemberSemicolon(),this.finishNode(e,"TSPropertySignature")}{const e=n;return this.tsFillSignature(u.colon,e),this.tsParseTypeMemberSemicolon(),this.finishNode(e,"TSMethodSignature")}}tsParseTypeMember(){const e=this.startNode();if(this.match(u.parenL)||this.isRelational("<"))return this.tsParseSignatureMember("TSCallSignatureDeclaration",e);if(this.match(u._new)){const t=this.startNode();return this.next(),this.match(u.parenL)||this.isRelational("<")?this.tsParseSignatureMember("TSConstructSignatureDeclaration",e):(e.key=this.createIdentifier(t,"new"),this.tsParsePropertyOrMethodSignature(e,!1))}const t=!!this.tsParseModifier(["readonly"]),n=this.tsTryParseIndexSignature(e);return n?(t&&(e.readonly=!0),n):(this.parsePropertyName(e),this.tsParsePropertyOrMethodSignature(e,t))}tsParseTypeLiteral(){const e=this.startNode();return e.members=this.tsParseObjectTypeMembers(),this.finishNode(e,"TSTypeLiteral")}tsParseObjectTypeMembers(){this.expect(u.braceL);const e=this.tsParseList("TypeMembers",this.tsParseTypeMember.bind(this));return this.expect(u.braceR),e}tsIsStartOfMappedType(){return this.next(),this.eat(u.plusMin)?this.isContextual("readonly"):(this.isContextual("readonly")&&this.next(),!!this.match(u.bracketL)&&(this.next(),!!this.tsIsIdentifier()&&(this.next(),this.match(u._in))))}tsParseMappedTypeParameter(){const e=this.startNode();return e.name=this.parseIdentifierName(e.start),e.constraint=this.tsExpectThenParseType(u._in),this.finishNode(e,"TSTypeParameter")}tsParseMappedType(){const e=this.startNode();return this.expect(u.braceL),this.match(u.plusMin)?(e.readonly=this.state.value,this.next(),this.expectContextual("readonly")):this.eatContextual("readonly")&&(e.readonly=!0),this.expect(u.bracketL),e.typeParameter=this.tsParseMappedTypeParameter(),this.expect(u.bracketR),this.match(u.plusMin)?(e.optional=this.state.value,this.next(),this.expect(u.question)):this.eat(u.question)&&(e.optional=!0),e.typeAnnotation=this.tsTryParseType(),this.semicolon(),this.expect(u.braceR),this.finishNode(e,"TSMappedType")}tsParseTupleType(){const e=this.startNode();e.elementTypes=this.tsParseBracketedList("TupleElementTypes",this.tsParseTupleElementType.bind(this),!0,!1);let t=!1;return e.elementTypes.forEach(e=>{"TSOptionalType"===e.type?t=!0:t&&"TSRestType"!==e.type&&this.raise(e.start,"A required element cannot follow an optional element.")}),this.finishNode(e,"TSTupleType")}tsParseTupleElementType(){if(this.match(u.ellipsis)){const e=this.startNode();return this.next(),e.typeAnnotation=this.tsParseType(),this.checkCommaAfterRest(),this.finishNode(e,"TSRestType")}const e=this.tsParseType();if(this.eat(u.question)){const t=this.startNodeAtNode(e);return t.typeAnnotation=e,this.finishNode(t,"TSOptionalType")}return e}tsParseParenthesizedType(){const e=this.startNode();return this.expect(u.parenL),e.typeAnnotation=this.tsParseType(),this.expect(u.parenR),this.finishNode(e,"TSParenthesizedType")}tsParseFunctionOrConstructorType(e){const t=this.startNode();return"TSConstructorType"===e&&this.expect(u._new),this.tsFillSignature(u.arrow,t),this.finishNode(t,e)}tsParseLiteralTypeNode(){const e=this.startNode();return e.literal=(()=>{switch(this.state.type){case u.num:case u.string:case u._true:case u._false:return this.parseExprAtom();default:throw this.unexpected()}})(),this.finishNode(e,"TSLiteralType")}tsParseTemplateLiteralType(){const e=this.startNode(),t=this.parseTemplate(!1);if(t.expressions.length>0)throw this.raise(t.expressions[0].start,"Template literal types cannot have any substitution");return e.literal=t,this.finishNode(e,"TSLiteralType")}tsParseNonArrayType(){switch(this.state.type){case u.name:case u._void:case u._null:{const e=this.match(u._void)?"TSVoidKeyword":this.match(u._null)?"TSNullKeyword":function(e){switch(e){case"any":return"TSAnyKeyword";case"boolean":return"TSBooleanKeyword";case"bigint":return"TSBigIntKeyword";case"never":return"TSNeverKeyword";case"number":return"TSNumberKeyword";case"object":return"TSObjectKeyword";case"string":return"TSStringKeyword";case"symbol":return"TSSymbolKeyword";case"undefined":return"TSUndefinedKeyword";case"unknown":return"TSUnknownKeyword";default:return}}(this.state.value);if(void 0!==e&&this.lookahead().type!==u.dot){const t=this.startNode();return this.next(),this.finishNode(t,e)}return this.tsParseTypeReference()}case u.string:case u.num:case u._true:case u._false:return this.tsParseLiteralTypeNode();case u.plusMin:if("-"===this.state.value){const e=this.startNode();if(this.lookahead().type!==u.num)throw this.unexpected();return e.literal=this.parseMaybeUnary(),this.finishNode(e,"TSLiteralType")}break;case u._this:{const e=this.tsParseThisTypeNode();return this.isContextual("is")&&!this.hasPrecedingLineBreak()?this.tsParseThisTypePredicate(e):e}case u._typeof:return this.tsParseTypeQuery();case u._import:return this.tsParseImportType();case u.braceL:return this.tsLookAhead(this.tsIsStartOfMappedType.bind(this))?this.tsParseMappedType():this.tsParseTypeLiteral();case u.bracketL:return this.tsParseTupleType();case u.parenL:return this.tsParseParenthesizedType();case u.backQuote:return this.tsParseTemplateLiteralType()}throw this.unexpected()}tsParseArrayTypeOrHigher(){let e=this.tsParseNonArrayType();for(;!this.hasPrecedingLineBreak()&&this.eat(u.bracketL);)if(this.match(u.bracketR)){const t=this.startNodeAtNode(e);t.elementType=e,this.expect(u.bracketR),e=this.finishNode(t,"TSArrayType")}else{const t=this.startNodeAtNode(e);t.objectType=e,t.indexType=this.tsParseType(),this.expect(u.bracketR),e=this.finishNode(t,"TSIndexedAccessType")}return e}tsParseTypeOperator(e){const t=this.startNode();return this.expectContextual(e),t.operator=e,t.typeAnnotation=this.tsParseTypeOperatorOrHigher(),"readonly"===e&&this.tsCheckTypeAnnotationForReadOnly(t),this.finishNode(t,"TSTypeOperator")}tsCheckTypeAnnotationForReadOnly(e){switch(e.typeAnnotation.type){case"TSTupleType":case"TSArrayType":return;default:this.raise(e.start,"'readonly' type modifier is only permitted on array and tuple literal types.")}}tsParseInferType(){const e=this.startNode();this.expectContextual("infer");const t=this.startNode();return t.name=this.parseIdentifierName(t.start),e.typeParameter=this.finishNode(t,"TSTypeParameter"),this.finishNode(e,"TSInferType")}tsParseTypeOperatorOrHigher(){const e=["keyof","unique","readonly"].find(e=>this.isContextual(e));return e?this.tsParseTypeOperator(e):this.isContextual("infer")?this.tsParseInferType():this.tsParseArrayTypeOrHigher()}tsParseUnionOrIntersectionType(e,t,n){this.eat(n);let r=t();if(this.match(n)){const i=[r];for(;this.eat(n);)i.push(t());const s=this.startNodeAtNode(r);s.types=i,r=this.finishNode(s,e)}return r}tsParseIntersectionTypeOrHigher(){return this.tsParseUnionOrIntersectionType("TSIntersectionType",this.tsParseTypeOperatorOrHigher.bind(this),u.bitwiseAND)}tsParseUnionTypeOrHigher(){return this.tsParseUnionOrIntersectionType("TSUnionType",this.tsParseIntersectionTypeOrHigher.bind(this),u.bitwiseOR)}tsIsStartOfFunctionType(){return!!this.isRelational("<")||this.match(u.parenL)&&this.tsLookAhead(this.tsIsUnambiguouslyStartOfFunctionType.bind(this))}tsSkipParameterStart(){if(this.match(u.name)||this.match(u._this))return this.next(),!0;if(this.match(u.braceL)){let e=1;for(this.next();e>0;)this.match(u.braceL)?++e:this.match(u.braceR)&&--e,this.next();return!0}if(this.match(u.bracketL)){let e=1;for(this.next();e>0;)this.match(u.bracketL)?++e:this.match(u.bracketR)&&--e,this.next();return!0}return!1}tsIsUnambiguouslyStartOfFunctionType(){if(this.next(),this.match(u.parenR)||this.match(u.ellipsis))return!0;if(this.tsSkipParameterStart()){if(this.match(u.colon)||this.match(u.comma)||this.match(u.question)||this.match(u.eq))return!0;if(this.match(u.parenR)&&(this.next(),this.match(u.arrow)))return!0}return!1}tsParseTypeOrTypePredicateAnnotation(e){return this.tsInType(()=>{const t=this.startNode();this.expect(e);const n=this.tsIsIdentifier()&&this.tsTryParse(this.tsParseTypePredicatePrefix.bind(this));if(!n)return this.tsParseTypeAnnotation(!1,t);const r=this.tsParseTypeAnnotation(!1),i=this.startNodeAtNode(n);return i.parameterName=n,i.typeAnnotation=r,t.typeAnnotation=this.finishNode(i,"TSTypePredicate"),this.finishNode(t,"TSTypeAnnotation")})}tsTryParseTypeOrTypePredicateAnnotation(){return this.match(u.colon)?this.tsParseTypeOrTypePredicateAnnotation(u.colon):void 0}tsTryParseTypeAnnotation(){return this.match(u.colon)?this.tsParseTypeAnnotation():void 0}tsTryParseType(){return this.tsEatThenParseType(u.colon)}tsParseTypePredicatePrefix(){const e=this.parseIdentifier();if(this.isContextual("is")&&!this.hasPrecedingLineBreak())return this.next(),e}tsParseTypeAnnotation(e=!0,t=this.startNode()){return this.tsInType(()=>{e&&this.expect(u.colon),t.typeAnnotation=this.tsParseType()}),this.finishNode(t,"TSTypeAnnotation")}tsParseType(){Ce(this.state.inType);const e=this.tsParseNonConditionalType();if(this.hasPrecedingLineBreak()||!this.eat(u._extends))return e;const t=this.startNodeAtNode(e);return t.checkType=e,t.extendsType=this.tsParseNonConditionalType(),this.expect(u.question),t.trueType=this.tsParseType(),this.expect(u.colon),t.falseType=this.tsParseType(),this.finishNode(t,"TSConditionalType")}tsParseNonConditionalType(){return this.tsIsStartOfFunctionType()?this.tsParseFunctionOrConstructorType("TSFunctionType"):this.match(u._new)?this.tsParseFunctionOrConstructorType("TSConstructorType"):this.tsParseUnionTypeOrHigher()}tsParseTypeAssertion(){const e=this.startNode(),t=this.tsTryNextParseConstantContext();return e.typeAnnotation=t||this.tsNextThenParseType(),this.expectRelational(">"),e.expression=this.parseMaybeUnary(),this.finishNode(e,"TSTypeAssertion")}tsParseHeritageClause(e){const t=this.state.start,n=this.tsParseDelimitedList("HeritageClauseElement",this.tsParseExpressionWithTypeArguments.bind(this));return n.length||this.raise(t,`'${e}' list cannot be empty.`),n}tsParseExpressionWithTypeArguments(){const e=this.startNode();return e.expression=this.tsParseEntityName(!1),this.isRelational("<")&&(e.typeParameters=this.tsParseTypeArguments()),this.finishNode(e,"TSExpressionWithTypeArguments")}tsParseInterfaceDeclaration(e){e.id=this.parseIdentifier(),this.checkLVal(e.id,k,void 0,"typescript interface declaration"),e.typeParameters=this.tsTryParseTypeParameters(),this.eat(u._extends)&&(e.extends=this.tsParseHeritageClause("extends"));const t=this.startNode();return t.body=this.tsInType(this.tsParseObjectTypeMembers.bind(this)),e.body=this.finishNode(t,"TSInterfaceBody"),this.finishNode(e,"TSInterfaceDeclaration")}tsParseTypeAliasDeclaration(e){return e.id=this.parseIdentifier(),this.checkLVal(e.id,B,void 0,"typescript type alias"),e.typeParameters=this.tsTryParseTypeParameters(),e.typeAnnotation=this.tsExpectThenParseType(u.eq),this.semicolon(),this.finishNode(e,"TSTypeAliasDeclaration")}tsInNoContext(e){const t=this.state.context;this.state.context=[t[0]];try{return e()}finally{this.state.context=t}}tsInType(e){const t=this.state.inType;this.state.inType=!0;try{return e()}finally{this.state.inType=t}}tsEatThenParseType(e){return this.match(e)?this.tsNextThenParseType():void 0}tsExpectThenParseType(e){return this.tsDoThenParseType(()=>this.expect(e))}tsNextThenParseType(){return this.tsDoThenParseType(()=>this.next())}tsDoThenParseType(e){return this.tsInType(()=>(e(),this.tsParseType()))}tsParseEnumMember(){const e=this.startNode();return e.id=this.match(u.string)?this.parseExprAtom():this.parseIdentifier(!0),this.eat(u.eq)&&(e.initializer=this.parseMaybeAssign()),this.finishNode(e,"TSEnumMember")}tsParseEnumDeclaration(e,t){return t&&(e.const=!0),e.id=this.parseIdentifier(),this.checkLVal(e.id,t?U:L,void 0,"typescript enum declaration"),this.expect(u.braceL),e.members=this.tsParseDelimitedList("EnumMembers",this.tsParseEnumMember.bind(this)),this.expect(u.braceR),this.finishNode(e,"TSEnumDeclaration")}tsParseModuleBlock(){const e=this.startNode();return this.scope.enter(c),this.expect(u.braceL),this.parseBlockOrModuleBlockBody(e.body=[],void 0,!0,u.braceR),this.scope.exit(),this.finishNode(e,"TSModuleBlock")}tsParseModuleOrNamespaceDeclaration(e,t=!1){if(e.id=this.parseIdentifier(),t||this.checkLVal(e.id,V,null,"module or namespace declaration"),this.eat(u.dot)){const t=this.startNode();this.tsParseModuleOrNamespaceDeclaration(t,!0),e.body=t}else e.body=this.tsParseModuleBlock();return this.finishNode(e,"TSModuleDeclaration")}tsParseAmbientExternalModuleDeclaration(e){return this.isContextual("global")?(e.global=!0,e.id=this.parseIdentifier()):this.match(u.string)?e.id=this.parseExprAtom():this.unexpected(),this.match(u.braceL)?e.body=this.tsParseModuleBlock():this.semicolon(),this.finishNode(e,"TSModuleDeclaration")}tsParseImportEqualsDeclaration(e,t){return e.isExport=t||!1,e.id=this.parseIdentifier(),this.expect(u.eq),e.moduleReference=this.tsParseModuleReference(),this.semicolon(),this.finishNode(e,"TSImportEqualsDeclaration")}tsIsExternalModuleReference(){return this.isContextual("require")&&this.lookahead().type===u.parenL}tsParseModuleReference(){return this.tsIsExternalModuleReference()?this.tsParseExternalModuleReference():this.tsParseEntityName(!1)}tsParseExternalModuleReference(){const e=this.startNode();if(this.expectContextual("require"),this.expect(u.parenL),!this.match(u.string))throw this.unexpected();return e.expression=this.parseExprAtom(),this.expect(u.parenR),this.finishNode(e,"TSExternalModuleReference")}tsLookAhead(e){const t=this.state.clone(),n=e();return this.state=t,n}tsTryParseAndCatch(e){const t=this.state.clone();try{return e()}catch(e){if(e instanceof SyntaxError)return void(this.state=t);throw e}}tsTryParse(e){const t=this.state.clone(),n=e();return void 0!==n&&!1!==n?n:void(this.state=t)}tsTryParseDeclare(e){if(this.isLineTerminator())return;let t,n=this.state.type;switch(this.isContextual("let")&&(n=u._var,t="let"),n){case u._function:return this.parseFunctionStatement(e,!1,!0);case u._class:return this.parseClass(e,!0,!1);case u._const:if(this.match(u._const)&&this.isLookaheadContextual("enum"))return this.expect(u._const),this.expectContextual("enum"),this.tsParseEnumDeclaration(e,!0);case u._var:return t=t||this.state.value,this.parseVarStatement(e,t);case u.name:{const t=this.state.value;return"global"===t?this.tsParseAmbientExternalModuleDeclaration(e):this.tsParseDeclaration(e,t,!0)}}}tsTryParseExportDeclaration(){return this.tsParseDeclaration(this.startNode(),this.state.value,!0)}tsParseExpressionStatement(e,t){switch(t.name){case"declare":{const t=this.tsTryParseDeclare(e);if(t)return t.declare=!0,t;break}case"global":if(this.match(u.braceL)){const n=e;return n.global=!0,n.id=t,n.body=this.tsParseModuleBlock(),this.finishNode(n,"TSModuleDeclaration")}break;default:return this.tsParseDeclaration(e,t.name,!1)}}tsParseDeclaration(e,t,n){switch(t){case"abstract":if(this.tsCheckLineTerminatorAndMatch(u._class,n)){const t=e;return t.abstract=!0,n&&(this.next(),this.match(u._class)||this.unexpected(null,u._class)),this.parseClass(t,!0,!1)}break;case"enum":if(n||this.match(u.name))return n&&this.next(),this.tsParseEnumDeclaration(e,!1);break;case"interface":if(this.tsCheckLineTerminatorAndMatch(u.name,n))return n&&this.next(),this.tsParseInterfaceDeclaration(e);break;case"module":if(n&&this.next(),this.match(u.string))return this.tsParseAmbientExternalModuleDeclaration(e);if(this.tsCheckLineTerminatorAndMatch(u.name,n))return this.tsParseModuleOrNamespaceDeclaration(e);break;case"namespace":if(this.tsCheckLineTerminatorAndMatch(u.name,n))return n&&this.next(),this.tsParseModuleOrNamespaceDeclaration(e);break;case"type":if(this.tsCheckLineTerminatorAndMatch(u.name,n))return n&&this.next(),this.tsParseTypeAliasDeclaration(e)}}tsCheckLineTerminatorAndMatch(e,t){return(t||this.match(e))&&!this.isLineTerminator()}tsTryParseGenericAsyncArrowFunction(e,t){if(!this.isRelational("<"))return;const n=this.tsTryParseAndCatch(()=>{const n=this.startNodeAt(e,t);return n.typeParameters=this.tsParseTypeParameters(),super.parseFunctionParams(n),n.returnType=this.tsTryParseTypeOrTypePredicateAnnotation(),this.expect(u.arrow),n});return n?this.parseArrowExpression(n,null,!0):void 0}tsParseTypeArguments(){const e=this.startNode();return e.params=this.tsInType(()=>this.tsInNoContext(()=>(this.expectRelational("<"),this.tsParseDelimitedList("TypeParametersOrArguments",this.tsParseType.bind(this))))),this.state.exprAllowed=!1,this.expectRelational(">"),this.finishNode(e,"TSTypeParameterInstantiation")}tsIsDeclarationStart(){if(this.match(u.name))switch(this.state.value){case"abstract":case"declare":case"enum":case"interface":case"module":case"namespace":case"type":return!0}return!1}isExportDefaultSpecifier(){return!this.tsIsDeclarationStart()&&super.isExportDefaultSpecifier()}parseAssignableListItem(e,t){const n=this.state.start,r=this.state.startLoc;let i,s=!1;e&&(i=this.parseAccessModifier(),s=!!this.tsParseModifier(["readonly"]));const o=this.parseMaybeDefault();this.parseAssignableListItemTypes(o);const a=this.parseMaybeDefault(o.start,o.loc.start,o);if(i||s){const e=this.startNodeAt(n,r);if(t.length&&(e.decorators=t),i&&(e.accessibility=i),s&&(e.readonly=s),"Identifier"!==a.type&&"AssignmentPattern"!==a.type)throw this.raise(e.start,"A parameter property may not be declared using a binding pattern.");return e.parameter=a,this.finishNode(e,"TSParameterProperty")}return t.length&&(o.decorators=t),a}parseFunctionBodyAndFinish(e,t,n=!1){this.match(u.colon)&&(e.returnType=this.tsParseTypeOrTypePredicateAnnotation(u.colon));const r="FunctionDeclaration"===t?"TSDeclareFunction":"ClassMethod"===t?"TSDeclareMethod":void 0;r&&!this.match(u.braceL)&&this.isLineTerminator()?this.finishNode(e,r):super.parseFunctionBodyAndFinish(e,t,n)}checkFunctionStatementId(e){!e.body&&e.id?this.checkLVal(e.id,M,null,"function name"):super.checkFunctionStatementId(...arguments)}parseSubscript(e,t,n,r,i,s){if(!this.hasPrecedingLineBreak()&&this.match(u.bang)){this.state.exprAllowed=!1,this.next();const r=this.startNodeAt(t,n);return r.expression=e,this.finishNode(r,"TSNonNullExpression")}if(this.isRelational("<")){const s=this.tsTryParseAndCatch(()=>{if(!r&&this.atPossibleAsync(e)){const e=this.tsTryParseGenericAsyncArrowFunction(t,n);if(e)return e}const s=this.startNodeAt(t,n);s.callee=e;const o=this.tsParseTypeArguments();if(o){if(!r&&this.eat(u.parenL))return s.arguments=this.parseCallExpressionArguments(u.parenR,!1),s.typeParameters=o,this.finishCallExpression(s);if(this.match(u.backQuote))return this.parseTaggedTemplateExpression(t,n,e,i,o)}this.unexpected()});if(s)return s}return super.parseSubscript(e,t,n,r,i,s)}parseNewArguments(e){if(this.isRelational("<")){const t=this.tsTryParseAndCatch(()=>{const e=this.tsParseTypeArguments();return this.match(u.parenL)||this.unexpected(),e});t&&(e.typeParameters=t)}super.parseNewArguments(e)}parseExprOp(e,t,n,r,i){if(De(u._in.binop)>r&&!this.hasPrecedingLineBreak()&&this.isContextual("as")){const s=this.startNodeAt(t,n);s.expression=e;const o=this.tsTryNextParseConstantContext();return s.typeAnnotation=o||this.tsNextThenParseType(),this.finishNode(s,"TSAsExpression"),this.parseExprOp(s,t,n,r,i)}return super.parseExprOp(e,t,n,r,i)}checkReservedWord(e,t,n,r){}checkDuplicateExports(){}parseImport(e){return this.match(u.name)&&this.lookahead().type===u.eq?this.tsParseImportEqualsDeclaration(e):super.parseImport(e)}parseExport(e){if(this.match(u._import))return this.expect(u._import),this.tsParseImportEqualsDeclaration(e,!0);if(this.eat(u.eq)){const t=e;return t.expression=this.parseExpression(),this.semicolon(),this.finishNode(t,"TSExportAssignment")}if(this.eatContextual("as")){const t=e;return this.expectContextual("namespace"),t.id=this.parseIdentifier(),this.semicolon(),this.finishNode(t,"TSNamespaceExportDeclaration")}return super.parseExport(e)}isAbstractClass(){return this.isContextual("abstract")&&this.lookahead().type===u._class}parseExportDefaultExpression(){if(this.isAbstractClass()){const e=this.startNode();return this.next(),this.parseClass(e,!0,!0),e.abstract=!0,e}if("interface"===this.state.value){const e=this.tsParseDeclaration(this.startNode(),this.state.value,!0);if(e)return e}return super.parseExportDefaultExpression()}parseStatementContent(e,t){if(this.state.type===u._const){const e=this.lookahead();if(e.type===u.name&&"enum"===e.value){const e=this.startNode();return this.expect(u._const),this.expectContextual("enum"),this.tsParseEnumDeclaration(e,!0)}}return super.parseStatementContent(e,t)}parseAccessModifier(){return this.tsParseModifier(["public","protected","private"])}parseClassMember(e,t,n,r){const i=this.parseAccessModifier();i&&(t.accessibility=i),super.parseClassMember(e,t,n,r)}parseClassMemberWithIsStatic(e,t,n,r,i){const s=t,o=t,a=t;let u=!1,c=!1;switch(this.tsParseModifier(["abstract","readonly"])){case"readonly":c=!0,u=!!this.tsParseModifier(["abstract"]);break;case"abstract":u=!0,c=!!this.tsParseModifier(["readonly"])}if(u&&(s.abstract=!0),c&&(a.readonly=!0),!u&&!r&&!s.accessibility){const n=this.tsTryParseIndexSignature(t);if(n)return void e.body.push(n)}if(c)return s.static=r,this.parseClassPropertyName(o),this.parsePostMemberNameModifiers(s),void this.pushClassProperty(e,o);super.parseClassMemberWithIsStatic(e,t,n,r,i)}parsePostMemberNameModifiers(e){this.eat(u.question)&&(e.optional=!0)}parseExpressionStatement(e,t){return("Identifier"===t.type?this.tsParseExpressionStatement(e,t):void 0)||super.parseExpressionStatement(e,t)}shouldParseExportDeclaration(){return!!this.tsIsDeclarationStart()||super.shouldParseExportDeclaration()}parseConditional(e,t,n,r,i){if(!i||!this.match(u.question))return super.parseConditional(e,t,n,r,i);const s=this.state.clone();try{return super.parseConditional(e,t,n,r)}catch(t){if(!(t instanceof SyntaxError))throw t;return this.state=s,i.start=t.pos||this.state.start,e}}parseParenItem(e,t,n){if(e=super.parseParenItem(e,t,n),this.eat(u.question)&&(e.optional=!0,this.resetEndLocation(e)),this.match(u.colon)){const r=this.startNodeAt(t,n);return r.expression=e,r.typeAnnotation=this.tsParseTypeAnnotation(),this.finishNode(r,"TSTypeCastExpression")}return e}parseExportDeclaration(e){const t=this.state.start,n=this.state.startLoc,r=this.eatContextual("declare");let i;return this.match(u.name)&&(i=this.tsTryParseExportDeclaration()),i||(i=super.parseExportDeclaration(e)),i&&r&&(this.resetStartLocation(i,t,n),i.declare=!0),i}parseClassId(e,t,n){if((!t||n)&&this.isContextual("implements"))return;super.parseClassId(...arguments);const r=this.tsTryParseTypeParameters();r&&(e.typeParameters=r)}parseClassProperty(e){!e.optional&&this.eat(u.bang)&&(e.definite=!0);const t=this.tsTryParseTypeAnnotation();return t&&(e.typeAnnotation=t),super.parseClassProperty(e)}pushClassMethod(e,t,n,r,i,s){const o=this.tsTryParseTypeParameters();o&&(t.typeParameters=o),super.pushClassMethod(e,t,n,r,i,s)}pushClassPrivateMethod(e,t,n,r){const i=this.tsTryParseTypeParameters();i&&(t.typeParameters=i),super.pushClassPrivateMethod(e,t,n,r)}parseClassSuper(e){super.parseClassSuper(e),e.superClass&&this.isRelational("<")&&(e.superTypeParameters=this.tsParseTypeArguments()),this.eatContextual("implements")&&(e.implements=this.tsParseHeritageClause("implements"))}parseObjPropValue(e,...t){const n=this.tsTryParseTypeParameters();n&&(e.typeParameters=n),super.parseObjPropValue(e,...t)}parseFunctionParams(e,t){const n=this.tsTryParseTypeParameters();n&&(e.typeParameters=n),super.parseFunctionParams(e,t)}parseVarId(e,t){super.parseVarId(e,t),"Identifier"===e.id.type&&this.eat(u.bang)&&(e.definite=!0);const n=this.tsTryParseTypeAnnotation();n&&(e.id.typeAnnotation=n,this.resetEndLocation(e.id))}parseAsyncArrowFromCallExpression(e,t){return this.match(u.colon)&&(e.returnType=this.tsParseTypeAnnotation()),super.parseAsyncArrowFromCallExpression(e,t)}parseMaybeAssign(...e){let t,n,r;if(this.match(u.jsxTagStart)){Ce(this.curContext()===H.j_oTag),Ce(this.state.context[this.state.context.length-2]===H.j_expr);const n=this.state.clone();try{return super.parseMaybeAssign(...e)}catch(e){if(!(e instanceof SyntaxError))throw e;this.state=n,Ce(this.curContext()===H.j_oTag),this.state.context.pop(),Ce(this.curContext()===H.j_expr),this.state.context.pop(),t=e}}if(void 0===t&&!this.isRelational("<"))return super.parseMaybeAssign(...e);const i=this.state.clone();try{r=this.tsParseTypeParameters(),("ArrowFunctionExpression"!==(n=super.parseMaybeAssign(...e)).type||n.extra&&n.extra.parenthesized)&&this.unexpected()}catch(n){if(!(n instanceof SyntaxError))throw n;if(t)throw t;return Ce(!this.hasPlugin("jsx")),this.state=i,super.parseMaybeAssign(...e)}return r&&0!==r.params.length&&this.resetStartLocationFromNode(n,r),n.typeParameters=r,n}parseMaybeUnary(e){return!this.hasPlugin("jsx")&&this.isRelational("<")?this.tsParseTypeAssertion():super.parseMaybeUnary(e)}parseArrow(e){if(this.match(u.colon)){const t=this.state.clone();try{const n=this.tsParseTypeOrTypePredicateAnnotation(u.colon);if(this.canInsertSemicolon()||!this.match(u.arrow))return void(this.state=t);e.returnType=n}catch(e){if(!(e instanceof SyntaxError))throw e;this.state=t}}return super.parseArrow(e)}parseAssignableListItemTypes(e){if(this.eat(u.question)){if("Identifier"!==e.type)throw this.raise(e.start,"A binding pattern parameter cannot be optional in an implementation signature.");e.optional=!0}const t=this.tsTryParseTypeAnnotation();return t&&(e.typeAnnotation=t),this.resetEndLocation(e),e}toAssignable(e,t,n){switch(e.type){case"TSTypeCastExpression":return super.toAssignable(this.typeCastToParameter(e),t,n);case"TSParameterProperty":return super.toAssignable(e,t,n);case"TSAsExpression":case"TSNonNullExpression":case"TSTypeAssertion":return e.expression=this.toAssignable(e.expression,t,n),e;default:return super.toAssignable(e,t,n)}}checkLVal(e,t=j,n,r){switch(e.type){case"TSTypeCastExpression":return;case"TSParameterProperty":return void this.checkLVal(e.parameter,t,n,"parameter property");case"TSAsExpression":case"TSNonNullExpression":case"TSTypeAssertion":return void this.checkLVal(e.expression,t,n,r);default:return void super.checkLVal(e,t,n,r)}}parseBindingAtom(){switch(this.state.type){case u._this:return this.parseIdentifier(!0);default:return super.parseBindingAtom()}}parseMaybeDecoratorArguments(e){if(this.isRelational("<")){const t=this.tsParseTypeArguments();if(this.match(u.parenL)){const n=super.parseMaybeDecoratorArguments(e);return n.typeParameters=t,n}this.unexpected(this.state.start,u.parenL)}return super.parseMaybeDecoratorArguments(e)}isClassMethod(){return this.isRelational("<")||super.isClassMethod()}isClassProperty(){return this.match(u.bang)||this.match(u.colon)||super.isClassProperty()}parseMaybeDefault(...e){const t=super.parseMaybeDefault(...e);return"AssignmentPattern"===t.type&&t.typeAnnotation&&t.right.startthis.tsParseTypeArguments());t&&(e.typeParameters=t)}return super.jsxParseOpeningElementAfterName(e)}getGetterSetterExpectedParamCount(e){const t=super.getGetterSetterExpectedParamCount(e),n=e.params[0];return n&&"Identifier"===n.type&&"this"===n.name?t+1:t}}),placeholders:e=>(class extends e{parsePlaceholder(e){if(this.match(u.placeholder)){const t=this.startNode();return this.next(),this.assertNoSpace("Unexpected space in placeholder."),t.name=super.parseIdentifier(!0),this.assertNoSpace("Unexpected space in placeholder."),this.expect(u.placeholder),this.finishPlaceholder(t,e)}}finishPlaceholder(e,t){const n=!(!e.expectedNode||"Placeholder"!==e.type);return e.expectedNode=t,n?e:this.finishNode(e,"Placeholder")}getTokenFromCode(e){return 37===e&&37===this.input.charCodeAt(this.state.pos+1)?this.finishOp(u.placeholder,2):super.getTokenFromCode(...arguments)}parseExprAtom(){return this.parsePlaceholder("Expression")||super.parseExprAtom(...arguments)}parseIdentifier(){return this.parsePlaceholder("Identifier")||super.parseIdentifier(...arguments)}checkReservedWord(e){void 0!==e&&super.checkReservedWord(...arguments)}parseBindingAtom(){return this.parsePlaceholder("Pattern")||super.parseBindingAtom(...arguments)}checkLVal(e){"Placeholder"!==e.type&&super.checkLVal(...arguments)}toAssignable(e){return e&&"Placeholder"===e.type&&"Expression"===e.expectedNode?(e.expectedNode="Pattern",e):super.toAssignable(...arguments)}verifyBreakContinue(e){e.label&&"Placeholder"===e.label.type||super.verifyBreakContinue(...arguments)}parseExpressionStatement(e,t){if("Placeholder"!==t.type||t.extra&&t.extra.parenthesized)return super.parseExpressionStatement(...arguments);if(this.match(u.colon)){const n=e;return n.label=this.finishPlaceholder(t,"Identifier"),this.next(),n.body=this.parseStatement("label"),this.finishNode(n,"LabeledStatement")}return this.semicolon(),e.name=t.name,this.finishPlaceholder(e,"Statement")}parseBlock(){return this.parsePlaceholder("BlockStatement")||super.parseBlock(...arguments)}parseFunctionId(){return this.parsePlaceholder("Identifier")||super.parseFunctionId(...arguments)}parseClass(e,t,n){const r=t?"ClassDeclaration":"ClassExpression";this.next(),this.takeDecorators(e);const i=this.parsePlaceholder("Identifier");if(i)if(this.match(u._extends)||this.match(u.placeholder)||this.match(u.braceL))e.id=i;else{if(n||!t)return e.id=null,e.body=this.finishPlaceholder(i,"ClassBody"),this.finishNode(e,r);this.unexpected(null,"A class name is required")}else this.parseClassId(e,t,n);return this.parseClassSuper(e),e.body=this.parsePlaceholder("ClassBody")||this.parseClassBody(!!e.superClass),this.finishNode(e,r)}parseExport(e){const t=this.parsePlaceholder("Identifier");if(!t)return super.parseExport(...arguments);if(!this.isContextual("from")&&!this.match(u.comma))return e.specifiers=[],e.source=null,e.declaration=this.finishPlaceholder(t,"Declaration"),this.finishNode(e,"ExportNamedDeclaration");this.expectPlugin("exportDefaultFrom");const n=this.startNode();return n.exported=t,e.specifiers=[this.finishNode(n,"ExportDefaultSpecifier")],super.parseExport(e)}maybeParseExportDefaultSpecifier(e){return!!(e.specifiers&&e.specifiers.length>0)||super.maybeParseExportDefaultSpecifier(...arguments)}checkExport(e){const{specifiers:t}=e;t&&t.length&&(e.specifiers=t.filter(e=>"Placeholder"===e.exported.type)),super.checkExport(e),e.specifiers=t}parseImport(e){const t=this.parsePlaceholder("Identifier");if(!t)return super.parseImport(...arguments);if(e.specifiers=[],!this.isContextual("from")&&!this.match(u.comma))return e.source=this.finishPlaceholder(t,"StringLiteral"),this.semicolon(),this.finishNode(e,"ImportDeclaration");const n=this.startNodeAtNode(t);return n.local=t,this.finishNode(n,"ImportDefaultSpecifier"),e.specifiers.push(n),this.eat(u.comma)&&(this.maybeParseStarImportSpecifier(e)||this.parseNamedImportSpecifiers(e)),this.expectContextual("from"),e.source=this.parseImportSource(),this.semicolon(),this.finishNode(e,"ImportDeclaration")}parseImportSource(){return this.parsePlaceholder("StringLiteral")||super.parseImportSource(...arguments)}})},Ne=Object.keys(_e),Ie={sourceType:"script",sourceFilename:void 0,startLine:1,allowAwaitOutsideFunction:!1,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowSuperOutsideMethod:!1,allowUndeclaredExports:!1,plugins:[],strictMode:null,ranges:!1,tokens:!1,createParenthesizedExpressions:!1};class ke{constructor(e,t){this.line=e,this.column=t}}class Be{constructor(e,t){this.start=e,this.end=t}}class Le{constructor(){this.sawUnambiguousESM=!1}hasPlugin(e){return this.plugins.has(e)}getPluginOption(e,t){if(this.hasPlugin(e))return this.plugins.get(e)[t]}}function Me(e){return e[e.length-1]}class je extends Le{addComment(e){this.filename&&(e.loc.filename=this.filename),this.state.trailingComments.push(e),this.state.leadingComments.push(e)}processComment(e){if("Program"===e.type&&e.body.length>0)return;const t=this.state.commentStack;let n,r,i,s,o;if(this.state.trailingComments.length>0)this.state.trailingComments[0].start>=e.end?(i=this.state.trailingComments,this.state.trailingComments=[]):this.state.trailingComments.length=0;else if(t.length>0){const n=Me(t);n.trailingComments&&n.trailingComments[0].start>=e.end&&(i=n.trailingComments,delete n.trailingComments)}for(t.length>0&&Me(t).start>=e.start&&(n=t.pop());t.length>0&&Me(t).start>=e.start;)r=t.pop();if(!r&&n&&(r=n),n&&this.state.leadingComments.length>0){const t=Me(this.state.leadingComments);if("ObjectProperty"===n.type){if(t.start>=e.start&&this.state.commentPreviousNode){for(o=0;o0&&(n.trailingComments=this.state.leadingComments,this.state.leadingComments=[])}}else if("CallExpression"===e.type&&e.arguments&&e.arguments.length){const n=Me(e.arguments);if(n&&t.start>=n.start&&t.end<=e.end&&this.state.commentPreviousNode){for(o=0;o0&&(n.trailingComments=this.state.leadingComments,this.state.leadingComments=[])}}}if(r){if(r.leadingComments)if(r!==e&&r.leadingComments.length>0&&Me(r.leadingComments).end<=e.start)e.leadingComments=r.leadingComments,delete r.leadingComments;else for(s=r.leadingComments.length-2;s>=0;--s)if(r.leadingComments[s].end<=e.start){e.leadingComments=r.leadingComments.splice(0,s+1);break}}else if(this.state.leadingComments.length>0)if(Me(this.state.leadingComments).end<=e.start){if(this.state.commentPreviousNode)for(o=0;o0&&(e.leadingComments=this.state.leadingComments,this.state.leadingComments=[])}else{for(s=0;se.start);s++);const t=this.state.leadingComments.slice(0,s);t.length&&(e.leadingComments=t),0===(i=this.state.leadingComments.slice(s)).length&&(i=null)}this.state.commentPreviousNode=e,i&&(i.length&&i[0].start>=e.start&&Me(i).end<=e.end?e.innerComments=i:e.trailingComments=i),t.push(e)}}class Re extends je{getLocationForPosition(e){let t;return t=e===this.state.start?this.state.startLoc:e===this.state.lastTokStart?this.state.lastTokStartLoc:e===this.state.end?this.state.endLoc:e===this.state.lastTokEnd?this.state.lastTokEndLoc:function(e,t){let n,r=1,i=0;for(Y.lastIndex=0;(n=Y.exec(e))&&n.index=48&&e<=57};const Xe=new Set(["g","m","s","i","y","u"]),We={decBinOct:[46,66,69,79,95,98,101,111],hex:[46,88,95,120]},Ye={bin:[48,49]};Ye.oct=[...Ye.bin,50,51,52,53,54,55],Ye.dec=[...Ye.oct,56,57],Ye.hex=[...Ye.dec,65,66,67,68,69,70,97,98,99,100,101,102];class Ke{constructor(e){this.type=e.type,this.value=e.value,this.start=e.start,this.end=e.end,this.loc=new Be(e.startLoc,e.endLoc)}}class qe extends Re{constructor(e,t){super(),this.state=new Ue,this.state.init(e),this.input=t,this.length=t.length,this.isLookahead=!1}next(){this.options.tokens&&!this.isLookahead&&this.state.tokens.push(new Ke(this.state)),this.state.lastTokEnd=this.state.end,this.state.lastTokStart=this.state.start,this.state.lastTokEndLoc=this.state.endLoc,this.state.lastTokStartLoc=this.state.startLoc,this.nextToken()}eat(e){return!!this.match(e)&&(this.next(),!0)}match(e){return this.state.type===e}lookahead(){const e=this.state;this.state=e.clone(!0),this.isLookahead=!0,this.next(),this.isLookahead=!1;const t=this.state;return this.state=e,t}setStrict(e){if(this.state.strict=e,this.match(u.num)||this.match(u.string)){for(this.state.pos=this.state.start;this.state.pos=this.length?this.finishToken(u.eof):e.override?e.override(this):this.getTokenFromCode(this.input.codePointAt(this.state.pos))}pushComment(e,t,n,r,i,s){const o={type:e?"CommentBlock":"CommentLine",value:t,start:n,end:r,loc:new Be(i,s)};this.options.tokens&&this.state.tokens.push(o),this.state.comments.push(o),this.addComment(o)}skipBlockComment(){const e=this.state.curPosition(),t=this.state.pos,n=this.input.indexOf("*/",this.state.pos+=2);let r;for(-1===n&&this.raise(this.state.pos-2,"Unterminated comment"),this.state.pos=n+2,Y.lastIndex=t;(r=Y.exec(this.input))&&r.index=48&&t<=57&&this.raise(this.state.pos,"Unexpected digit after hash token"),(this.hasPlugin("classPrivateProperties")||this.hasPlugin("classPrivateMethods"))&&this.state.classLevel>0)return++this.state.pos,void this.finishToken(u.hash);"smart"===this.getPluginOption("pipelineOperator","proposal")?this.finishOp(u.hash,1):this.raise(this.state.pos,"Unexpected character '#'")}readToken_dot(){const e=this.input.charCodeAt(this.state.pos+1);if(e>=48&&e<=57)return void this.readNumber(!0);const t=this.input.charCodeAt(this.state.pos+2);46===e&&46===t?(this.state.pos+=3,this.finishToken(u.ellipsis)):(++this.state.pos,this.finishToken(u.dot))}readToken_slash(){if(this.state.exprAllowed&&!this.state.inType)return++this.state.pos,void this.readRegexp();61===this.input.charCodeAt(this.state.pos+1)?this.finishOp(u.assign,2):this.finishOp(u.slash,1)}readToken_interpreter(){if(0!==this.state.pos||this.length<2)return!1;const e=this.state.pos;this.state.pos+=1;let t=this.input.charCodeAt(this.state.pos);if(33!==t)return!1;for(;10!==t&&13!==t&&8232!==t&&8233!==t&&++this.state.pos=48&&t<=57?(++this.state.pos,this.finishToken(u.question)):(this.state.pos+=2,this.finishToken(u.questionDot)):61===t?this.finishOp(u.assign,3):this.finishOp(u.nullishCoalescing,2)}getTokenFromCode(e){switch(e){case 46:return void this.readToken_dot();case 40:return++this.state.pos,void this.finishToken(u.parenL);case 41:return++this.state.pos,void this.finishToken(u.parenR);case 59:return++this.state.pos,void this.finishToken(u.semi);case 44:return++this.state.pos,void this.finishToken(u.comma);case 91:return++this.state.pos,void this.finishToken(u.bracketL);case 93:return++this.state.pos,void this.finishToken(u.bracketR);case 123:return++this.state.pos,void this.finishToken(u.braceL);case 125:return++this.state.pos,void this.finishToken(u.braceR);case 58:return void(this.hasPlugin("functionBind")&&58===this.input.charCodeAt(this.state.pos+1)?this.finishOp(u.doubleColon,2):(++this.state.pos,this.finishToken(u.colon)));case 63:return void this.readToken_question();case 96:return++this.state.pos,void this.finishToken(u.backQuote);case 48:{const e=this.input.charCodeAt(this.state.pos+1);if(120===e||88===e)return void this.readRadixNumber(16);if(111===e||79===e)return void this.readRadixNumber(8);if(98===e||66===e)return void this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return void this.readNumber(!1);case 34:case 39:return void this.readString(e);case 47:return void this.readToken_slash();case 37:case 42:return void this.readToken_mult_modulo(e);case 124:case 38:return void this.readToken_pipe_amp(e);case 94:return void this.readToken_caret();case 43:case 45:return void this.readToken_plus_min(e);case 60:case 62:return void this.readToken_lt_gt(e);case 61:case 33:return void this.readToken_eq_excl(e);case 126:return void this.finishOp(u.tilde,1);case 64:return++this.state.pos,void this.finishToken(u.at);case 35:return void this.readToken_numberSign();case 92:return void this.readWord();default:if(le(e))return void this.readWord()}this.raise(this.state.pos,`Unexpected character '${String.fromCodePoint(e)}'`)}finishOp(e,t){const n=this.input.slice(this.state.pos,this.state.pos+t);this.state.pos+=t,this.finishToken(e,n)}readRegexp(){const e=this.state.pos;let t,n;for(;;){this.state.pos>=this.length&&this.raise(e,"Unterminated regular expression");const r=this.input.charAt(this.state.pos);if(W.test(r)&&this.raise(e,"Unterminated regular expression"),t)t=!1;else{if("["===r)n=!0;else if("]"===r&&n)n=!1;else if("/"===r&&!n)break;t="\\"===r}++this.state.pos}const r=this.input.slice(e,this.state.pos);++this.state.pos;let i="";for(;this.state.pos-1&&this.raise(this.state.pos+1,"Duplicate regular expression flag"),++this.state.pos,i+=e;else{if(!pe(t)&&92!==t)break;this.raise(this.state.pos+1,"Invalid regular expression flag")}}this.finishToken(u.regexp,{pattern:r,flags:i})}readInt(e,t){const n=this.state.pos,r=16===e?We.hex:We.decBinOct,i=16===e?Ye.hex:10===e?Ye.dec:8===e?Ye.oct:Ye.bin;let s=0;for(let n=0,o=null==t?1/0:t;n-1||r.indexOf(n)>-1||Number.isNaN(n))&&this.raise(this.state.pos,"Invalid or unexpected token"),++this.state.pos;continue}}if((n=t>=97?t-97+10:t>=65?t-65+10:Ve(t)?t-48:1/0)>=e)break;++this.state.pos,s=s*e+n}return this.state.pos===n||null!=t&&this.state.pos-n!==t?null:s}readRadixNumber(e){const t=this.state.pos;let n=!1;this.state.pos+=2;const r=this.readInt(e);if(null==r&&this.raise(this.state.start+2,"Expected number in radix "+e),this.hasPlugin("bigInt")&&110===this.input.charCodeAt(this.state.pos)&&(++this.state.pos,n=!0),le(this.input.codePointAt(this.state.pos))&&this.raise(this.state.pos,"Identifier directly after number"),n){const e=this.input.slice(t,this.state.pos).replace(/[_n]/g,"");this.finishToken(u.bigint,e)}else this.finishToken(u.num,r)}readNumber(e){const t=this.state.pos;let n=!1,r=!1;e||null!==this.readInt(10)||this.raise(t,"Invalid number");let i=this.state.pos-t>=2&&48===this.input.charCodeAt(t);i&&(this.state.strict&&this.raise(t,"Legacy octal literals are not allowed in strict mode"),/[89]/.test(this.input.slice(t,this.state.pos))&&(i=!1));let s=this.input.charCodeAt(this.state.pos);46!==s||i||(++this.state.pos,this.readInt(10),n=!0,s=this.input.charCodeAt(this.state.pos)),69!==s&&101!==s||i||(43!==(s=this.input.charCodeAt(++this.state.pos))&&45!==s||++this.state.pos,null===this.readInt(10)&&this.raise(t,"Invalid number"),n=!0,s=this.input.charCodeAt(this.state.pos)),this.hasPlugin("bigInt")&&110===s&&((n||i)&&this.raise(t,"Invalid BigIntLiteral"),++this.state.pos,r=!0),le(this.input.codePointAt(this.state.pos))&&this.raise(this.state.pos,"Identifier directly after number");const o=this.input.slice(t,this.state.pos).replace(/[_n]/g,"");if(r)return void this.finishToken(u.bigint,o);const a=i?parseInt(o,8):parseFloat(o);this.finishToken(u.num,a)}readCodePoint(e){let t;if(123===this.input.charCodeAt(this.state.pos)){const n=++this.state.pos;if(t=this.readHexChar(this.input.indexOf("}",this.state.pos)-this.state.pos,e),++this.state.pos,null===t)--this.state.invalidTemplateEscapePosition;else if(t>1114111){if(!e)return this.state.invalidTemplateEscapePosition=n-2,null;this.raise(n,"Code point out of bounds")}}else t=this.readHexChar(4,e);return t}readString(e){let t="",n=++this.state.pos;for(;;){this.state.pos>=this.length&&this.raise(this.state.start,"Unterminated string constant");const r=this.input.charCodeAt(this.state.pos);if(r===e)break;92===r?(t+=this.input.slice(n,this.state.pos),t+=this.readEscapedChar(!1),n=this.state.pos):8232===r||8233===r?(++this.state.pos,++this.state.curLine):K(r)?this.raise(this.state.start,"Unterminated string constant"):++this.state.pos}t+=this.input.slice(n,this.state.pos++),this.finishToken(u.string,t)}readTmplToken(){let e="",t=this.state.pos,n=!1;for(;;){this.state.pos>=this.length&&this.raise(this.state.start,"Unterminated template");const r=this.input.charCodeAt(this.state.pos);if(96===r||36===r&&123===this.input.charCodeAt(this.state.pos+1))return this.state.pos===this.state.start&&this.match(u.template)?36===r?(this.state.pos+=2,void this.finishToken(u.dollarBraceL)):(++this.state.pos,void this.finishToken(u.backQuote)):(e+=this.input.slice(t,this.state.pos),void this.finishToken(u.template,n?null:e));if(92===r){e+=this.input.slice(t,this.state.pos);const r=this.readEscapedChar(!0);null===r?n=!0:e+=r,t=this.state.pos}else if(K(r)){switch(e+=this.input.slice(t,this.state.pos),++this.state.pos,r){case 13:10===this.input.charCodeAt(this.state.pos)&&++this.state.pos;case 10:e+="\n";break;default:e+=String.fromCharCode(r)}++this.state.curLine,this.state.lineStart=this.state.pos,t=this.state.pos}else++this.state.pos}}readEscapedChar(e){const t=!e,n=this.input.charCodeAt(++this.state.pos);switch(++this.state.pos,n){case 110:return"\n";case 114:return"\r";case 120:{const e=this.readHexChar(2,t);return null===e?null:String.fromCharCode(e)}case 117:{const e=this.readCodePoint(t);return null===e?null:String.fromCodePoint(e)}case 116:return"\t";case 98:return"\b";case 118:return"\v";case 102:return"\f";case 13:10===this.input.charCodeAt(this.state.pos)&&++this.state.pos;case 10:this.state.lineStart=this.state.pos,++this.state.curLine;case 8232:case 8233:return"";default:if(n>=48&&n<=55){const t=this.state.pos-1;let n=this.input.substr(this.state.pos-1,3).match(/^[0-7]+/)[0],r=parseInt(n,8);r>255&&(n=n.slice(0,-1),r=parseInt(n,8)),this.state.pos+=n.length-1;const i=this.input.charCodeAt(this.state.pos);if("0"!==n||56===i||57===i){if(e)return this.state.invalidTemplateEscapePosition=t,null;this.state.strict?this.raise(t,"Octal literal in strict mode"):this.state.containsOctal||(this.state.containsOctal=!0,this.state.octalPosition=t)}return String.fromCharCode(r)}return String.fromCharCode(n)}}readHexChar(e,t){const n=this.state.pos,r=this.readInt(16,e);return null===r&&(t?this.raise(n,"Bad character escape sequence"):(this.state.pos=n-1,this.state.invalidTemplateEscapePosition=n-1)),r}readWord1(){let e="";this.state.containsEsc=!1;const t=this.state.pos;let n=this.state.pos;for(;this.state.posthis.state.lastTokEnd&&this.raise(this.state.lastTokEnd,e)}unexpected(e,t="Unexpected token"){throw"string"!=typeof t&&(t=`Unexpected token, expected "${t.label}"`),this.raise(null!=e?e:this.state.start,t)}expectPlugin(e,t){if(!this.hasPlugin(e))throw this.raise(null!=t?t:this.state.start,`This experimental syntax requires enabling the parser plugin: '${e}'`,{missingPluginNames:[e]});return!0}expectOnePlugin(e,t){if(!e.some(e=>this.hasPlugin(e)))throw this.raise(null!=t?t:this.state.start,`This experimental syntax requires enabling one of the following parser plugin(s): '${e.join(", ")}'`,{missingPluginNames:e})}checkYieldAwaitInDefaultParams(){this.state.yieldPos&&(!this.state.awaitPos||this.state.yieldPos-1&&this.raiseRestNotLast(this.state.commaAfterSpreadAt)}raiseRestNotLast(e){this.raise(e,"Rest element must be last element")}}const Qe=e=>"ParenthesizedExpression"===e.type?Qe(e.expression):e;class Ze extends ze{checkPropClash(e,t){if("SpreadElement"===e.type||e.computed||e.kind||e.shorthand)return;const n=e.key;"__proto__"===("Identifier"===n.type?n.name:String(n.value))&&(t.proto&&this.raise(n.start,"Redefinition of __proto__ property"),t.proto=!0)}getExpression(){this.scope.enter(l),this.nextToken();const e=this.parseExpression();return this.match(u.eof)||this.unexpected(),e.comments=this.state.comments,e}parseExpression(e,t){const n=this.state.start,r=this.state.startLoc,i=this.parseMaybeAssign(e,t);if(this.match(u.comma)){const s=this.startNodeAt(n,r);for(s.expressions=[i];this.eat(u.comma);)s.expressions.push(this.parseMaybeAssign(e,t));return this.toReferencedList(s.expressions),this.finishNode(s,"SequenceExpression")}return i}parseMaybeAssign(e,t,n,r){const i=this.state.start,s=this.state.startLoc;if(this.isContextual("yield")){if(this.scope.inGenerator){let t=this.parseYield(e);return n&&(t=n.call(this,t,i,s)),t}this.state.exprAllowed=!1}const o=this.state.commaAfterSpreadAt;let a;this.state.commaAfterSpreadAt=-1,t?a=!1:(t={start:0},a=!0),(this.match(u.parenL)||this.match(u.name))&&(this.state.potentialArrowAt=this.state.start);let c=this.parseMaybeConditional(e,t,r);if(n&&(c=n.call(this,c,i,s)),this.state.type.isAssign){const n=this.startNodeAt(i,s),r=this.state.value;n.operator=r,"??="===r&&(this.expectPlugin("nullishCoalescingOperator"),this.expectPlugin("logicalAssignment")),"||="!==r&&"&&="!==r||this.expectPlugin("logicalAssignment"),n.left=this.match(u.eq)?this.toAssignable(c,void 0,"assignment expression"):c,t.start=0,this.checkLVal(c,void 0,void 0,"assignment expression");const a=Qe(c);let l;return"ObjectPattern"===a.type?l="`({a}) = 0` use `({a} = 0)`":"ArrayPattern"===a.type&&(l="`([a]) = 0` use `([a] = 0)`"),l&&(c.extra&&c.extra.parenthesized||"ParenthesizedExpression"===c.type)&&this.raise(a.start,`You're trying to assign to a parenthesized expression, eg. instead of ${l}`),l&&this.checkCommaAfterRestFromSpread(),this.state.commaAfterSpreadAt=o,this.next(),n.right=this.parseMaybeAssign(e),this.finishNode(n,"AssignmentExpression")}return a&&t.start&&this.unexpected(t.start),this.state.commaAfterSpreadAt=o,c}parseMaybeConditional(e,t,n){const r=this.state.start,i=this.state.startLoc,s=this.state.potentialArrowAt,o=this.parseExprOps(e,t);return"ArrowFunctionExpression"===o.type&&o.start===s?o:t&&t.start?o:this.parseConditional(o,e,r,i,n)}parseConditional(e,t,n,r,i){if(this.eat(u.question)){const i=this.startNodeAt(n,r);return i.test=e,i.consequent=this.parseMaybeAssign(),this.expect(u.colon),i.alternate=this.parseMaybeAssign(t),this.finishNode(i,"ConditionalExpression")}return e}parseExprOps(e,t){const n=this.state.start,r=this.state.startLoc,i=this.state.potentialArrowAt,s=this.parseMaybeUnary(t);return"ArrowFunctionExpression"===s.type&&s.start===i?s:t&&t.start?s:this.parseExprOp(s,n,r,-1,e)}parseExprOp(e,t,n,r,i){const s=this.state.type.binop;if(!(null==s||i&&this.match(u._in))&&s>r){const o=this.state.value;if("|>"===o&&this.state.inFSharpPipelineDirectBody)return e;const a=this.startNodeAt(t,n);a.left=e,a.operator=o,"**"!==o||"UnaryExpression"!==e.type||!this.options.createParenthesizedExpressions&&e.extra&&e.extra.parenthesized||this.raise(e.argument.start,"Illegal expression. Wrap left hand side or entire exponentiation in parentheses.");const c=this.state.type;if(c===u.pipeline?(this.expectPlugin("pipelineOperator"),this.state.inPipeline=!0,this.checkPipelineAtInfixOperator(e,t)):c===u.nullishCoalescing&&this.expectPlugin("nullishCoalescingOperator"),this.next(),c===u.pipeline&&"minimal"===this.getPluginOption("pipelineOperator","proposal")&&this.match(u.name)&&"await"===this.state.value&&this.scope.inAsync)throw this.raise(this.state.start,'Unexpected "await" after pipeline body; await must have parentheses in minimal proposal');return a.right=this.parseExprOpRightExpr(c,s,i),this.finishNode(a,c===u.logicalOR||c===u.logicalAND||c===u.nullishCoalescing?"LogicalExpression":"BinaryExpression"),this.parseExprOp(a,t,n,r,i)}return e}parseExprOpRightExpr(e,t,n){const r=this.state.start,i=this.state.startLoc;switch(e){case u.pipeline:switch(this.getPluginOption("pipelineOperator","proposal")){case"smart":return this.withTopicPermittingContext(()=>this.parseSmartPipelineBody(this.parseExprOpBaseRightExpr(e,t,n),r,i));case"fsharp":return this.withSoloAwaitPermittingContext(()=>this.parseFSharpPipelineBody(t,n))}default:return this.parseExprOpBaseRightExpr(e,t,n)}}parseExprOpBaseRightExpr(e,t,n){const r=this.state.start,i=this.state.startLoc;return this.parseExprOp(this.parseMaybeUnary(),r,i,e.rightAssociative?t-1:t,n)}parseMaybeUnary(e){if(this.isContextual("await")&&(this.scope.inAsync||!this.scope.inFunction&&this.options.allowAwaitOutsideFunction))return this.parseAwait();if(this.state.type.prefix){const t=this.startNode(),n=this.match(u.incDec);if(t.operator=this.state.value,t.prefix=!0,"throw"===t.operator&&this.expectPlugin("throwExpressions"),this.next(),t.argument=this.parseMaybeUnary(),e&&e.start&&this.unexpected(e.start),n)this.checkLVal(t.argument,void 0,void 0,"prefix operation");else if(this.state.strict&&"delete"===t.operator){const e=t.argument;"Identifier"===e.type?this.raise(t.start,"Deleting local variable in strict mode"):"MemberExpression"===e.type&&"PrivateName"===e.property.type&&this.raise(t.start,"Deleting a private field is not allowed")}return this.finishNode(t,n?"UpdateExpression":"UnaryExpression")}const t=this.state.start,n=this.state.startLoc;let r=this.parseExprSubscripts(e);if(e&&e.start)return r;for(;this.state.type.postfix&&!this.canInsertSemicolon();){const e=this.startNodeAt(t,n);e.operator=this.state.value,e.prefix=!1,e.argument=r,this.checkLVal(r,void 0,void 0,"postfix operation"),this.next(),r=this.finishNode(e,"UpdateExpression")}return r}parseExprSubscripts(e){const t=this.state.start,n=this.state.startLoc,r=this.state.potentialArrowAt,i=this.parseExprAtom(e);return"ArrowFunctionExpression"===i.type&&i.start===r?i:e&&e.start?i:this.parseSubscripts(i,t,n)}parseSubscripts(e,t,n,r){const i=this.atPossibleAsync(e),s={optionalChainMember:!1,stop:!1};do{e=this.parseSubscript(e,t,n,r,s,i)}while(!s.stop);return e}parseSubscript(e,t,n,r,i,s){if(!r&&this.eat(u.doubleColon)){const s=this.startNodeAt(t,n);return s.object=e,s.callee=this.parseNoCallExpr(),i.stop=!0,this.parseSubscripts(this.finishNode(s,"BindExpression"),t,n,r)}if(this.match(u.questionDot)){if(this.expectPlugin("optionalChaining"),i.optionalChainMember=!0,r&&this.lookahead().type===u.parenL)return i.stop=!0,e;this.next();const s=this.startNodeAt(t,n);return this.eat(u.bracketL)?(s.object=e,s.property=this.parseExpression(),s.computed=!0,s.optional=!0,this.expect(u.bracketR),this.finishNode(s,"OptionalMemberExpression")):this.eat(u.parenL)?(s.callee=e,s.arguments=this.parseCallExpressionArguments(u.parenR,!1),s.optional=!0,this.finishNode(s,"OptionalCallExpression")):(s.object=e,s.property=this.parseIdentifier(!0),s.computed=!1,s.optional=!0,this.finishNode(s,"OptionalMemberExpression"))}if(this.eat(u.dot)){const r=this.startNodeAt(t,n);return r.object=e,r.property=this.parseMaybePrivateName(),r.computed=!1,i.optionalChainMember?(r.optional=!1,this.finishNode(r,"OptionalMemberExpression")):this.finishNode(r,"MemberExpression")}if(this.eat(u.bracketL)){const r=this.startNodeAt(t,n);return r.object=e,r.property=this.parseExpression(),r.computed=!0,this.expect(u.bracketR),i.optionalChainMember?(r.optional=!1,this.finishNode(r,"OptionalMemberExpression")):this.finishNode(r,"MemberExpression")}if(!r&&this.match(u.parenL)){const r=this.state.maybeInArrowParameters,o=this.state.yieldPos,a=this.state.awaitPos;this.state.maybeInArrowParameters=!0,this.state.yieldPos=0,this.state.awaitPos=0,this.next();let c=this.startNodeAt(t,n);c.callee=e;const l=this.state.commaAfterSpreadAt;return this.state.commaAfterSpreadAt=-1,c.arguments=this.parseCallExpressionArguments(u.parenR,s,"Import"===e.type,"Super"!==e.type),i.optionalChainMember?this.finishOptionalCallExpression(c):this.finishCallExpression(c),s&&this.shouldParseAsyncArrow()?(i.stop=!0,this.checkCommaAfterRestFromSpread(),c=this.parseAsyncArrowFromCallExpression(this.startNodeAt(t,n),c),this.checkYieldAwaitInDefaultParams(),this.state.yieldPos=o,this.state.awaitPos=a):(this.toReferencedListDeep(c.arguments),this.state.yieldPos=o||this.state.yieldPos,this.state.awaitPos=a||this.state.awaitPos),this.state.maybeInArrowParameters=r,this.state.commaAfterSpreadAt=l,c}return this.match(u.backQuote)?this.parseTaggedTemplateExpression(t,n,e,i):(i.stop=!0,e)}parseTaggedTemplateExpression(e,t,n,r,i){const s=this.startNodeAt(e,t);return s.tag=n,s.quasi=this.parseTemplate(!0),i&&(s.typeParameters=i),r.optionalChainMember&&this.raise(e,"Tagged Template Literals are not allowed in optionalChain"),this.finishNode(s,"TaggedTemplateExpression")}atPossibleAsync(e){return"Identifier"===e.type&&"async"===e.name&&this.state.lastTokEnd===e.end&&!this.canInsertSemicolon()&&"async"===this.input.slice(e.start,e.end)}finishCallExpression(e){if("Import"===e.callee.type){1!==e.arguments.length&&this.raise(e.start,"import() requires exactly one argument");const t=e.arguments[0];t&&"SpreadElement"===t.type&&this.raise(t.start,"... is not allowed in import()")}return this.finishNode(e,"CallExpression")}finishOptionalCallExpression(e){if("Import"===e.callee.type){1!==e.arguments.length&&this.raise(e.start,"import() requires exactly one argument");const t=e.arguments[0];t&&"SpreadElement"===t.type&&this.raise(t.start,"... is not allowed in import()")}return this.finishNode(e,"OptionalCallExpression")}parseCallExpressionArguments(e,t,n,r){const i=[];let s,o=!0;const a=this.state.inFSharpPipelineDirectBody;for(this.state.inFSharpPipelineDirectBody=!1;!this.eat(e);){if(o)o=!1;else if(this.expect(u.comma),this.eat(e)){n&&this.raise(this.state.lastTokStart,"Trailing comma is disallowed inside import(...) arguments");break}this.match(u.parenL)&&!s&&(s=this.state.start),i.push(this.parseExprListItem(!1,t?{start:0}:void 0,t?{start:0}:void 0,r))}return t&&s&&this.shouldParseAsyncArrow()&&this.unexpected(),this.state.inFSharpPipelineDirectBody=a,i}shouldParseAsyncArrow(){return this.match(u.arrow)&&!this.canInsertSemicolon()}parseAsyncArrowFromCallExpression(e,t){return this.expect(u.arrow),this.parseArrowExpression(e,t.arguments,!0),e}parseNoCallExpr(){const e=this.state.start,t=this.state.startLoc;return this.parseSubscripts(this.parseExprAtom(),e,t,!0)}parseExprAtom(e){this.state.type===u.slash&&this.readRegexp();const t=this.state.potentialArrowAt===this.state.start;let n;switch(this.state.type){case u._super:return this.scope.allowSuper||this.options.allowSuperOutsideMethod||this.raise(this.state.start,"super is only allowed in object methods and classes"),n=this.startNode(),this.next(),!this.match(u.parenL)||this.scope.allowDirectSuper||this.options.allowSuperOutsideMethod||this.raise(n.start,"super() is only valid inside a class constructor of a subclass. Maybe a typo in the method name ('constructor') or not extending another class?"),this.match(u.parenL)||this.match(u.bracketL)||this.match(u.dot)||this.unexpected(),this.finishNode(n,"Super");case u._import:return n=this.startNode(),this.next(),this.match(u.dot)?this.parseImportMetaProperty(n):(this.expectPlugin("dynamicImport",n.start),this.match(u.parenL)||this.unexpected(null,u.parenL),this.finishNode(n,"Import"));case u._this:return n=this.startNode(),this.next(),this.finishNode(n,"ThisExpression");case u.name:{n=this.startNode();const e=this.state.containsEsc,r=this.parseIdentifier();if(!e&&"async"===r.name&&this.match(u._function)&&!this.canInsertSemicolon())return this.next(),this.parseFunction(n,void 0,!0);if(t&&!e&&"async"===r.name&&this.match(u.name)&&!this.canInsertSemicolon()){const e=[this.parseIdentifier()];return this.expect(u.arrow),this.parseArrowExpression(n,e,!0),n}return t&&this.match(u.arrow)&&!this.canInsertSemicolon()?(this.next(),this.parseArrowExpression(n,[r],!1),n):r}case u._do:{this.expectPlugin("doExpressions");const e=this.startNode();this.next();const t=this.state.labels;return this.state.labels=[],e.body=this.parseBlock(),this.state.labels=t,this.finishNode(e,"DoExpression")}case u.regexp:{const e=this.state.value;return(n=this.parseLiteral(e.value,"RegExpLiteral")).pattern=e.pattern,n.flags=e.flags,n}case u.num:return this.parseLiteral(this.state.value,"NumericLiteral");case u.bigint:return this.parseLiteral(this.state.value,"BigIntLiteral");case u.string:return this.parseLiteral(this.state.value,"StringLiteral");case u._null:return n=this.startNode(),this.next(),this.finishNode(n,"NullLiteral");case u._true:case u._false:return this.parseBooleanLiteral();case u.parenL:return this.parseParenAndDistinguishExpression(t);case u.bracketL:{const t=this.state.inFSharpPipelineDirectBody;return this.state.inFSharpPipelineDirectBody=!1,n=this.startNode(),this.next(),n.elements=this.parseExprList(u.bracketR,!0,e),this.state.maybeInArrowParameters||this.toReferencedList(n.elements),this.state.inFSharpPipelineDirectBody=t,this.finishNode(n,"ArrayExpression")}case u.braceL:{const t=this.state.inFSharpPipelineDirectBody;this.state.inFSharpPipelineDirectBody=!1;const n=this.parseObj(!1,e);return this.state.inFSharpPipelineDirectBody=t,n}case u._function:return this.parseFunctionExpression();case u.at:this.parseDecorators();case u._class:return n=this.startNode(),this.takeDecorators(n),this.parseClass(n,!1);case u._new:return this.parseNew();case u.backQuote:return this.parseTemplate(!1);case u.doubleColon:{n=this.startNode(),this.next(),n.object=null;const e=n.callee=this.parseNoCallExpr();if("MemberExpression"===e.type)return this.finishNode(n,"BindExpression");throw this.raise(e.start,"Binding should be performed on object property.")}case u.hash:if(this.state.inPipeline){if(n=this.startNode(),"smart"!==this.getPluginOption("pipelineOperator","proposal")&&this.raise(n.start,"Primary Topic Reference found but pipelineOperator not passed 'smart' for 'proposal' option."),this.next(),this.primaryTopicReferenceIsAllowedInCurrentTopicContext())return this.registerTopicReference(),this.finishNode(n,"PipelinePrimaryTopicReference");throw this.raise(n.start,"Topic reference was used in a lexical context without topic binding")}default:throw this.unexpected()}}parseBooleanLiteral(){const e=this.startNode();return e.value=this.match(u._true),this.next(),this.finishNode(e,"BooleanLiteral")}parseMaybePrivateName(){if(this.match(u.hash)){this.expectOnePlugin(["classPrivateProperties","classPrivateMethods"]);const e=this.startNode();return this.next(),this.assertNoSpace("Unexpected space between # and identifier"),e.id=this.parseIdentifier(!0),this.finishNode(e,"PrivateName")}return this.parseIdentifier(!0)}parseFunctionExpression(){const e=this.startNode();let t=this.startNode();return this.next(),t=this.createIdentifier(t,"function"),this.scope.inGenerator&&this.eat(u.dot)?this.parseMetaProperty(e,t,"sent"):this.parseFunction(e)}parseMetaProperty(e,t,n){e.meta=t,"function"===t.name&&"sent"===n&&(this.isContextual(n)?this.expectPlugin("functionSent"):this.hasPlugin("functionSent")||this.unexpected());const r=this.state.containsEsc;return e.property=this.parseIdentifier(!0),(e.property.name!==n||r)&&this.raise(e.property.start,`The only valid meta property for ${t.name} is ${t.name}.${n}`),this.finishNode(e,"MetaProperty")}parseImportMetaProperty(e){const t=this.createIdentifier(this.startNodeAtNode(e),"import");return this.expect(u.dot),this.isContextual("meta")?this.expectPlugin("importMeta"):this.hasPlugin("importMeta")||this.raise(t.start,"Dynamic imports require a parameter: import('a.js')"),this.inModule||this.raise(t.start,"import.meta may appear only with 'sourceType: \"module\"'",{code:"BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED"}),this.sawUnambiguousESM=!0,this.parseMetaProperty(e,t,"meta")}parseLiteral(e,t,n,r){n=n||this.state.start,r=r||this.state.startLoc;const i=this.startNodeAt(n,r);return this.addExtra(i,"rawValue",e),this.addExtra(i,"raw",this.input.slice(n,this.state.end)),i.value=e,this.next(),this.finishNode(i,t)}parseParenAndDistinguishExpression(e){const t=this.state.start,n=this.state.startLoc;let r;this.expect(u.parenL);const i=this.state.maybeInArrowParameters,s=this.state.yieldPos,o=this.state.awaitPos,a=this.state.inFSharpPipelineDirectBody;this.state.maybeInArrowParameters=!0,this.state.yieldPos=0,this.state.awaitPos=0,this.state.inFSharpPipelineDirectBody=!1;const c=this.state.start,l=this.state.startLoc,p=[],h={start:0},f={start:0};let d,y,m=!0;for(;!this.match(u.parenR);){if(m)m=!1;else if(this.expect(u.comma,f.start||null),this.match(u.parenR)){y=this.state.start;break}if(this.match(u.ellipsis)){const e=this.state.start,t=this.state.startLoc;d=this.state.start,p.push(this.parseParenItem(this.parseRestBinding(),e,t)),this.checkCommaAfterRest();break}p.push(this.parseMaybeAssign(!1,h,this.parseParenItem,f))}const g=this.state.start,E=this.state.startLoc;this.expect(u.parenR),this.state.maybeInArrowParameters=i,this.state.inFSharpPipelineDirectBody=a;let T=this.startNodeAt(t,n);if(e&&this.shouldParseArrow()&&(T=this.parseArrow(T))){this.checkYieldAwaitInDefaultParams(),this.state.yieldPos=s,this.state.awaitPos=o;for(let e=0;e1?((r=this.startNodeAt(c,l)).expressions=p,this.finishNodeAt(r,"SequenceExpression",g,E)):r=p[0],!this.options.createParenthesizedExpressions)return this.addExtra(r,"parenthesized",!0),this.addExtra(r,"parenStart",t),r;const A=this.startNodeAt(t,n);return A.expression=r,this.finishNode(A,"ParenthesizedExpression"),A}shouldParseArrow(){return!this.canInsertSemicolon()}parseArrow(e){if(this.eat(u.arrow))return e}parseParenItem(e,t,n){return e}parseNew(){const e=this.startNode(),t=this.parseIdentifier(!0);if(this.eat(u.dot)){const n=this.parseMetaProperty(e,t,"target");if(!this.scope.inNonArrowFunction&&!this.state.inClassProperty){let e="new.target can only be used in functions";this.hasPlugin("classProperties")&&(e+=" or class properties"),this.raise(n.start,e)}return n}return e.callee=this.parseNoCallExpr(),"Import"===e.callee.type?this.raise(e.callee.start,"Cannot use new with import(...)"):"OptionalMemberExpression"===e.callee.type||"OptionalCallExpression"===e.callee.type?this.raise(this.state.lastTokEnd,"constructors in/after an Optional Chain are not allowed"):this.eat(u.questionDot)&&this.raise(this.state.start,"constructors in/after an Optional Chain are not allowed"),this.parseNewArguments(e),this.finishNode(e,"NewExpression")}parseNewArguments(e){if(this.eat(u.parenL)){const t=this.parseExprList(u.parenR);this.toReferencedList(t),e.arguments=t}else e.arguments=[]}parseTemplateElement(e){const t=this.startNode();return null===this.state.value&&(e?this.state.invalidTemplateEscapePosition=null:this.raise(this.state.invalidTemplateEscapePosition||0,"Invalid escape sequence in template")),t.value={raw:this.input.slice(this.state.start,this.state.end).replace(/\r\n?/g,"\n"),cooked:this.state.value},this.next(),t.tail=this.match(u.backQuote),this.finishNode(t,"TemplateElement")}parseTemplate(e){const t=this.startNode();this.next(),t.expressions=[];let n=this.parseTemplateElement(e);for(t.quasis=[n];!n.tail;)this.expect(u.dollarBraceL),t.expressions.push(this.parseExpression()),this.expect(u.braceR),t.quasis.push(n=this.parseTemplateElement(e));return this.next(),this.finishNode(t,"TemplateLiteral")}parseObj(e,t){const n=Object.create(null);let r=!0;const i=this.startNode();for(i.properties=[],this.next();!this.eat(u.braceR);){if(r)r=!1;else if(this.expect(u.comma),this.eat(u.braceR))break;const s=this.parseObjectMember(e,t);e||this.checkPropClash(s,n),s.shorthand&&this.addExtra(s,"shorthand",!0),i.properties.push(s)}return this.finishNode(i,e?"ObjectPattern":"ObjectExpression")}isAsyncProp(e){return!e.computed&&"Identifier"===e.key.type&&"async"===e.key.name&&(this.match(u.name)||this.match(u.num)||this.match(u.string)||this.match(u.bracketL)||this.state.type.keyword||this.match(u.star))&&!this.hasPrecedingLineBreak()}parseObjectMember(e,t){let n=[];if(this.match(u.at))if(this.hasPlugin("decorators"))this.raise(this.state.start,"Stage 2 decorators disallow object literal property decorators");else for(;this.match(u.at);)n.push(this.parseDecorator());const r=this.startNode();let i,s,o=!1,a=!1;if(this.match(u.ellipsis))return n.length&&this.unexpected(),e?(this.next(),r.argument=this.parseIdentifier(),this.checkCommaAfterRest(),this.finishNode(r,"RestElement")):this.parseSpread();n.length&&(r.decorators=n,n=[]),r.method=!1,(e||t)&&(i=this.state.start,s=this.state.startLoc),e||(o=this.eat(u.star));const c=this.state.containsEsc;return this.parsePropertyName(r),e||c||o||!this.isAsyncProp(r)?a=!1:(a=!0,o=this.eat(u.star),this.parsePropertyName(r)),this.parseObjPropValue(r,i,s,o,a,e,t,c),r}isGetterOrSetterMethod(e,t){return!t&&!e.computed&&"Identifier"===e.key.type&&("get"===e.key.name||"set"===e.key.name)&&(this.match(u.string)||this.match(u.num)||this.match(u.bracketL)||this.match(u.name)||!!this.state.type.keyword)}getGetterSetterExpectedParamCount(e){return"get"===e.kind?0:1}checkGetterSetterParams(e){const t=this.getGetterSetterExpectedParamCount(e),n=e.start;e.params.length!==t&&("get"===e.kind?this.raise(n,"getter must not have any formal parameters"):this.raise(n,"setter must have exactly one formal parameter")),"set"===e.kind&&"RestElement"===e.params[e.params.length-1].type&&this.raise(n,"setter function argument must not be a rest parameter")}parseObjectMethod(e,t,n,r,i){return n||t||this.match(u.parenL)?(r&&this.unexpected(),e.kind="method",e.method=!0,this.parseMethod(e,t,n,!1,!1,"ObjectMethod")):!i&&this.isGetterOrSetterMethod(e,r)?((t||n)&&this.unexpected(),e.kind=e.key.name,this.parsePropertyName(e),this.parseMethod(e,!1,!1,!1,!1,"ObjectMethod"),this.checkGetterSetterParams(e),e):void 0}parseObjectProperty(e,t,n,r,i){return e.shorthand=!1,this.eat(u.colon)?(e.value=r?this.parseMaybeDefault(this.state.start,this.state.startLoc):this.parseMaybeAssign(!1,i),this.finishNode(e,"ObjectProperty")):e.computed||"Identifier"!==e.key.type?void 0:(this.checkReservedWord(e.key.name,e.key.start,!0,!0),r?e.value=this.parseMaybeDefault(t,n,e.key.__clone()):this.match(u.eq)&&i?(i.start||(i.start=this.state.start),e.value=this.parseMaybeDefault(t,n,e.key.__clone())):e.value=e.key.__clone(),e.shorthand=!0,this.finishNode(e,"ObjectProperty"))}parseObjPropValue(e,t,n,r,i,s,o,a){const u=this.parseObjectMethod(e,r,i,s,a)||this.parseObjectProperty(e,t,n,s,o);return u||this.unexpected(),u}parsePropertyName(e){if(this.eat(u.bracketL))e.computed=!0,e.key=this.parseMaybeAssign(),this.expect(u.bracketR);else{const t=this.state.inPropertyName;this.state.inPropertyName=!0,e.key=this.match(u.num)||this.match(u.string)?this.parseExprAtom():this.parseMaybePrivateName(),"PrivateName"!==e.key.type&&(e.computed=!1),this.state.inPropertyName=t}return e.key}initFunction(e,t){e.id=null,e.generator=!1,e.async=!!t}parseMethod(e,t,n,r,i,s,o=!1){const a=this.state.yieldPos,u=this.state.awaitPos;this.state.yieldPos=0,this.state.awaitPos=0,this.initFunction(e,n),e.generator=!!t;const c=r;return this.scope.enter(A(n,e.generator)|m|(o?E:0)|(i?g:0)),this.parseFunctionParams(e,c),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBodyAndFinish(e,s,!0),this.scope.exit(),this.state.yieldPos=a,this.state.awaitPos=u,e}parseArrowExpression(e,t,n){this.scope.enter(A(n,!1)|d),this.initFunction(e,n);const r=this.state.maybeInArrowParameters,i=this.state.yieldPos,s=this.state.awaitPos;return this.state.maybeInArrowParameters=!1,this.state.yieldPos=0,this.state.awaitPos=0,t&&this.setArrowFunctionParameters(e,t),this.parseFunctionBody(e,!0),this.scope.exit(),this.state.maybeInArrowParameters=r,this.state.yieldPos=i,this.state.awaitPos=s,this.finishNode(e,"ArrowFunctionExpression")}setArrowFunctionParameters(e,t){e.params=this.toAssignableList(t,!0,"arrow function parameters")}isStrictBody(e){if("BlockStatement"===e.body.type&&e.body.directives.length)for(let t=0,n=e.body.directives;t" after pipeline body; arrow function in pipeline body must be parenthesized');if("PipelineTopicExpression"===t&&"SequenceExpression"===e.type)throw this.raise(n,"Pipeline body may not be a comma-separated sequence expression")}parseSmartPipelineBodyInStyle(e,t,n,r){const i=this.startNodeAt(n,r);switch(t){case"PipelineBareFunction":i.callee=e;break;case"PipelineBareConstructor":i.callee=e.callee;break;case"PipelineBareAwaitedFunction":i.callee=e.argument;break;case"PipelineTopicExpression":if(!this.topicReferenceWasUsedInCurrentTopicContext())throw this.raise(n,"Pipeline is in topic style but does not use topic reference");i.expression=e;break;default:throw this.raise(n,`Unknown pipeline style ${t}`)}return this.finishNode(i,t)}checkSmartPipelineBodyStyle(e){return e.type,this.isSimpleReference(e)?"PipelineBareFunction":"PipelineTopicExpression"}isSimpleReference(e){switch(e.type){case"MemberExpression":return!e.computed&&this.isSimpleReference(e.object);case"Identifier":return!0;default:return!1}}withTopicPermittingContext(e){const t=this.state.topicContext;this.state.topicContext={maxNumOfResolvableTopics:1,maxTopicIndex:null};try{return e()}finally{this.state.topicContext=t}}withTopicForbiddingContext(e){const t=this.state.topicContext;this.state.topicContext={maxNumOfResolvableTopics:0,maxTopicIndex:null};try{return e()}finally{this.state.topicContext=t}}withSoloAwaitPermittingContext(e){const t=this.state.soloAwait;this.state.soloAwait=!0;try{return e()}finally{this.state.soloAwait=t}}registerTopicReference(){this.state.topicContext.maxTopicIndex=0}primaryTopicReferenceIsAllowedInCurrentTopicContext(){return this.state.topicContext.maxNumOfResolvableTopics>=1}topicReferenceWasUsedInCurrentTopicContext(){return null!=this.state.topicContext.maxTopicIndex&&this.state.topicContext.maxTopicIndex>=0}parseFSharpPipelineBody(e,t){const n=this.state.start,r=this.state.startLoc;this.state.potentialArrowAt=this.state.start;const i=this.state.inFSharpPipelineDirectBody;this.state.inFSharpPipelineDirectBody=!0;const s=this.parseExprOp(this.parseMaybeUnary(),n,r,e,t);return this.state.inFSharpPipelineDirectBody=i,s}}const et={kind:"loop"},tt={kind:"switch"},nt=0,rt=1,it=2,st=4;class ot extends Ze{parseTopLevel(e,t){if(t.sourceType=this.options.sourceType,t.interpreter=this.parseInterpreterDirective(),this.parseBlockBody(t,!0,!0,u.eof),this.inModule&&!this.options.allowUndeclaredExports&&this.scope.undefinedExports.size>0)for(let e=0,t=Array.from(this.scope.undefinedExports);ethis.parseStatement("do")),this.state.labels.pop(),this.expect(u._while),e.test=this.parseHeaderExpression(),this.eat(u.semi),this.finishNode(e,"DoWhileStatement")}parseForStatement(e){this.next(),this.state.labels.push(et);let t=-1;if((this.scope.inAsync||!this.scope.inFunction&&this.options.allowAwaitOutsideFunction)&&this.eatContextual("await")&&(t=this.state.lastTokStart),this.scope.enter(c),this.expect(u.parenL),this.match(u.semi))return t>-1&&this.unexpected(t),this.parseFor(e,null);const n=this.isLet();if(this.match(u._var)||this.match(u._const)||n){const r=this.startNode(),i=n?"let":this.state.value;return this.next(),this.parseVar(r,!0,i),this.finishNode(r,"VariableDeclaration"),(this.match(u._in)||this.isContextual("of"))&&1===r.declarations.length?this.parseForIn(e,r,t):(t>-1&&this.unexpected(t),this.parseFor(e,r))}const r={start:0},i=this.parseExpression(!0,r);if(this.match(u._in)||this.isContextual("of")){const n=this.isContextual("of")?"for-of statement":"for-in statement";return this.toAssignable(i,void 0,n),this.checkLVal(i,void 0,void 0,n),this.parseForIn(e,i,t)}return r.start&&this.unexpected(r.start),t>-1&&this.unexpected(t),this.parseFor(e,i)}parseFunctionStatement(e,t,n){return this.next(),this.parseFunction(e,rt|(n?0:it),t)}parseIfStatement(e){return this.next(),e.test=this.parseHeaderExpression(),e.consequent=this.parseStatement("if"),e.alternate=this.eat(u._else)?this.parseStatement("if"):null,this.finishNode(e,"IfStatement")}parseReturnStatement(e){return this.scope.inFunction||this.options.allowReturnOutsideFunction||this.raise(this.state.start,"'return' outside of function"),this.next(),this.isLineTerminator()?e.argument=null:(e.argument=this.parseExpression(),this.semicolon()),this.finishNode(e,"ReturnStatement")}parseSwitchStatement(e){this.next(),e.discriminant=this.parseHeaderExpression();const t=e.cases=[];let n,r;for(this.expect(u.braceL),this.state.labels.push(tt),this.scope.enter(c);!this.match(u.braceR);)if(this.match(u._case)||this.match(u._default)){const e=this.match(u._case);n&&this.finishNode(n,"SwitchCase"),t.push(n=this.startNode()),n.consequent=[],this.next(),e?n.test=this.parseExpression():(r&&this.raise(this.state.lastTokStart,"Multiple default clauses"),r=!0,n.test=null),this.expect(u.colon)}else n?n.consequent.push(this.parseStatement(null)):this.unexpected();return this.scope.exit(),n&&this.finishNode(n,"SwitchCase"),this.next(),this.state.labels.pop(),this.finishNode(e,"SwitchStatement")}parseThrowStatement(e){return this.next(),W.test(this.input.slice(this.state.lastTokEnd,this.state.start))&&this.raise(this.state.lastTokEnd,"Illegal newline after throw"),e.argument=this.parseExpression(),this.semicolon(),this.finishNode(e,"ThrowStatement")}parseTryStatement(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.match(u._catch)){const t=this.startNode();if(this.next(),this.match(u.parenL)){this.expect(u.parenL),t.param=this.parseBindingAtom();const e="Identifier"===t.param.type;this.scope.enter(e?y:0),this.checkLVal(t.param,_,null,"catch clause"),this.expect(u.parenR)}else t.param=null,this.scope.enter(c);t.body=this.withTopicForbiddingContext(()=>this.parseBlock(!1,!1)),this.scope.exit(),e.handler=this.finishNode(t,"CatchClause")}return e.finalizer=this.eat(u._finally)?this.parseBlock():null,e.handler||e.finalizer||this.raise(e.start,"Missing catch or finally clause"),this.finishNode(e,"TryStatement")}parseVarStatement(e,t){return this.next(),this.parseVar(e,!1,t),this.semicolon(),this.finishNode(e,"VariableDeclaration")}parseWhileStatement(e){return this.next(),e.test=this.parseHeaderExpression(),this.state.labels.push(et),e.body=this.withTopicForbiddingContext(()=>this.parseStatement("while")),this.state.labels.pop(),this.finishNode(e,"WhileStatement")}parseWithStatement(e){return this.state.strict&&this.raise(this.state.start,"'with' in strict mode"),this.next(),e.object=this.parseHeaderExpression(),e.body=this.withTopicForbiddingContext(()=>this.parseStatement("with")),this.finishNode(e,"WithStatement")}parseEmptyStatement(e){return this.next(),this.finishNode(e,"EmptyStatement")}parseLabeledStatement(e,t,n,r){for(let e=0,r=this.state.labels;e=0;t--){const n=this.state.labels[t];if(n.statementStart!==e.start)break;n.statementStart=this.state.start,n.kind=i}return this.state.labels.push({name:t,kind:i,statementStart:this.state.start}),e.body=this.parseStatement(r?-1===r.indexOf("label")?r+"label":r:"label"),this.state.labels.pop(),e.label=n,this.finishNode(e,"LabeledStatement")}parseExpressionStatement(e,t){return e.expression=t,this.semicolon(),this.finishNode(e,"ExpressionStatement")}parseBlock(e=!1,t=!0){const n=this.startNode();return this.expect(u.braceL),t&&this.scope.enter(c),this.parseBlockBody(n,e,!1,u.braceR),t&&this.scope.exit(),this.finishNode(n,"BlockStatement")}isValidDirective(e){return"ExpressionStatement"===e.type&&"StringLiteral"===e.expression.type&&!e.expression.extra.parenthesized}parseBlockBody(e,t,n,r){const i=e.body=[],s=e.directives=[];this.parseBlockOrModuleBlockBody(i,t?s:void 0,n,r)}parseBlockOrModuleBlockBody(e,t,n,r){let i,s,o=!1;for(;!this.eat(r);){o||!this.state.containsOctal||s||(s=this.state.octalPosition);const r=this.parseStatement(null,n);if(t&&!o&&this.isValidDirective(r)){const e=this.stmtToDirective(r);t.push(e),void 0===i&&"use strict"===e.value.value&&(i=this.state.strict,this.setStrict(!0),s&&this.raise(s,"Octal literal in strict mode"))}else o=!0,e.push(r)}!1===i&&this.setStrict(!1)}parseFor(e,t){return e.init=t,this.expect(u.semi),e.test=this.match(u.semi)?null:this.parseExpression(),this.expect(u.semi),e.update=this.match(u.parenR)?null:this.parseExpression(),this.expect(u.parenR),e.body=this.withTopicForbiddingContext(()=>this.parseStatement("for")),this.scope.exit(),this.state.labels.pop(),this.finishNode(e,"ForStatement")}parseForIn(e,t,n){const r=this.match(u._in);return this.next(),r?n>-1&&this.unexpected(n):e.await=n>-1,"VariableDeclaration"!==t.type||null==t.declarations[0].init||r&&!this.state.strict&&"var"===t.kind&&"Identifier"===t.declarations[0].id.type?"AssignmentPattern"===t.type&&this.raise(t.start,"Invalid left-hand side in for-loop"):this.raise(t.start,`${r?"for-in":"for-of"} loop variable declaration may not have an initializer`),e.left=t,e.right=r?this.parseExpression():this.parseMaybeAssign(),this.expect(u.parenR),e.body=this.withTopicForbiddingContext(()=>this.parseStatement("for")),this.scope.exit(),this.state.labels.pop(),this.finishNode(e,r?"ForInStatement":"ForOfStatement")}parseVar(e,t,n){const r=e.declarations=[],i=this.hasPlugin("typescript");for(e.kind=n;;){const e=this.startNode();if(this.parseVarId(e,n),this.eat(u.eq)?e.init=this.parseMaybeAssign(t):("const"!==n||this.match(u._in)||this.isContextual("of")?"Identifier"===e.id.type||t&&(this.match(u._in)||this.isContextual("of"))||this.raise(this.state.lastTokEnd,"Complex binding patterns require an initialization value"):i||this.unexpected(),e.init=null),r.push(this.finishNode(e,"VariableDeclarator")),!this.eat(u.comma))break}return e}parseVarId(e,t){e.id=this.parseBindingAtom(),this.checkLVal(e.id,"var"===t?N:_,void 0,"variable declaration")}parseFunction(e,t=nt,n=!1){const r=t&rt,i=t&it,s=!(!r||t&st);this.initFunction(e,n),this.match(u.star)&&i&&this.unexpected(this.state.start,"Generators can only be declared at the top level or inside a block"),e.generator=this.eat(u.star),r&&(e.id=this.parseFunctionId(s));const o=this.state.inClassProperty,a=this.state.yieldPos,c=this.state.awaitPos;return this.state.inClassProperty=!1,this.state.yieldPos=0,this.state.awaitPos=0,this.scope.enter(A(e.async,e.generator)),r||(e.id=this.parseFunctionId()),this.parseFunctionParams(e),this.withTopicForbiddingContext(()=>{this.parseFunctionBodyAndFinish(e,r?"FunctionDeclaration":"FunctionExpression")}),this.scope.exit(),r&&!i&&this.checkFunctionStatementId(e),this.state.inClassProperty=o,this.state.yieldPos=a,this.state.awaitPos=c,e}parseFunctionId(e){return e||this.match(u.name)?this.parseIdentifier():null}parseFunctionParams(e,t){const n=this.state.inParameters;this.state.inParameters=!0,this.expect(u.parenL),e.params=this.parseBindingList(u.parenR,!1,t),this.state.inParameters=n,this.checkYieldAwaitInDefaultParams()}checkFunctionStatementId(e){e.id&&this.checkLVal(e.id,this.state.strict||e.generator||e.async?this.scope.treatFunctionsAsVar?N:_:I,null,"function name")}parseClass(e,t,n){this.next(),this.takeDecorators(e);const r=this.state.strict;return this.state.strict=!0,this.parseClassId(e,t,n),this.parseClassSuper(e),e.body=this.parseClassBody(!!e.superClass),this.state.strict=r,this.finishNode(e,t?"ClassDeclaration":"ClassExpression")}isClassProperty(){return this.match(u.eq)||this.match(u.semi)||this.match(u.braceR)}isClassMethod(){return this.match(u.parenL)}isNonstaticConstructor(e){return!(e.computed||e.static||"constructor"!==e.key.name&&"constructor"!==e.key.value)}parseClassBody(e){this.state.classLevel++;const t={hadConstructor:!1};let n=[];const r=this.startNode();return r.body=[],this.expect(u.braceL),this.withTopicForbiddingContext(()=>{for(;!this.eat(u.braceR);){if(this.eat(u.semi)){n.length>0&&this.raise(this.state.lastTokEnd,"Decorators must not be followed by a semicolon");continue}if(this.match(u.at)){n.push(this.parseDecorator());continue}const i=this.startNode();n.length&&(i.decorators=n,this.resetStartLocationFromNode(i,n[0]),n=[]),this.parseClassMember(r,i,t,e),"constructor"===i.kind&&i.decorators&&i.decorators.length>0&&this.raise(i.start,"Decorators can't be used with a constructor. Did you mean '@dec class { ... }'?")}}),n.length&&this.raise(this.state.start,"You have trailing decorators with no method"),this.state.classLevel--,this.finishNode(r,"ClassBody")}parseClassMember(e,t,n,r){let i=!1;const s=this.state.containsEsc;if(this.match(u.name)&&"static"===this.state.value){const n=this.parseIdentifier(!0);if(this.isClassMethod()){const r=t;return r.kind="method",r.computed=!1,r.key=n,r.static=!1,void this.pushClassMethod(e,r,!1,!1,!1,!1)}if(this.isClassProperty()){const r=t;return r.computed=!1,r.key=n,r.static=!1,void e.body.push(this.parseClassProperty(r))}if(s)throw this.unexpected();i=!0}this.parseClassMemberWithIsStatic(e,t,n,i,r)}parseClassMemberWithIsStatic(e,t,n,r,i){const s=t,o=t,a=t,c=t,l=s,p=s;if(t.static=r,this.eat(u.star))return l.kind="method",this.parseClassPropertyName(l),"PrivateName"===l.key.type?void this.pushClassPrivateMethod(e,o,!0,!1):(this.isNonstaticConstructor(s)&&this.raise(s.key.start,"Constructor can't be a generator"),void this.pushClassMethod(e,s,!0,!1,!1,!1));const h=this.state.containsEsc,f=this.parseClassPropertyName(t),d="PrivateName"===f.type,y="Identifier"===f.type;if(this.parsePostMemberNameModifiers(p),this.isClassMethod()){if(l.kind="method",d)return void this.pushClassPrivateMethod(e,o,!1,!1);const t=this.isNonstaticConstructor(s);let r=!1;t&&(s.kind="constructor",s.decorators&&this.raise(s.start,"You can't attach decorators to a class constructor"),n.hadConstructor&&!this.hasPlugin("typescript")&&this.raise(f.start,"Duplicate constructor in the same class"),n.hadConstructor=!0,r=i),this.pushClassMethod(e,s,!1,!1,t,r)}else if(this.isClassProperty())d?this.pushClassPrivateProperty(e,c):this.pushClassProperty(e,a);else if(!y||"async"!==f.name||h||this.isLineTerminator())!y||"get"!==f.name&&"set"!==f.name||h||this.match(u.star)&&this.isLineTerminator()?this.isLineTerminator()?d?this.pushClassPrivateProperty(e,c):this.pushClassProperty(e,a):this.unexpected():(l.kind=f.name,this.parseClassPropertyName(s),"PrivateName"===l.key.type?this.pushClassPrivateMethod(e,o,!1,!1):(this.isNonstaticConstructor(s)&&this.raise(s.key.start,"Constructor can't have get/set modifier"),this.pushClassMethod(e,s,!1,!1,!1,!1)),this.checkGetterSetterParams(s));else{const t=this.eat(u.star);l.kind="method",this.parseClassPropertyName(l),"PrivateName"===l.key.type?this.pushClassPrivateMethod(e,o,t,!0):(this.isNonstaticConstructor(s)&&this.raise(s.key.start,"Constructor can't be an async function"),this.pushClassMethod(e,s,t,!0,!1,!1))}}parseClassPropertyName(e){const t=this.parsePropertyName(e);return e.computed||!e.static||"prototype"!==t.name&&"prototype"!==t.value||this.raise(t.start,"Classes may not have static property named prototype"),"PrivateName"===t.type&&"constructor"===t.id.name&&this.raise(t.start,"Classes may not have a private field named '#constructor'"),t}pushClassProperty(e,t){this.isNonstaticConstructor(t)&&this.raise(t.key.start,"Classes may not have a non-static field named 'constructor'"),e.body.push(this.parseClassProperty(t))}pushClassPrivateProperty(e,t){this.expectPlugin("classPrivateProperties",t.key.start),e.body.push(this.parseClassPrivateProperty(t))}pushClassMethod(e,t,n,r,i,s){e.body.push(this.parseMethod(t,n,r,i,s,"ClassMethod",!0))}pushClassPrivateMethod(e,t,n,r){this.expectPlugin("classPrivateMethods",t.key.start),e.body.push(this.parseMethod(t,n,r,!1,!1,"ClassPrivateMethod",!0))}parsePostMemberNameModifiers(e){}parseAccessModifier(){}parseClassPrivateProperty(e){return this.state.inClassProperty=!0,this.scope.enter(E|m),e.value=this.eat(u.eq)?this.parseMaybeAssign():null,this.semicolon(),this.state.inClassProperty=!1,this.scope.exit(),this.finishNode(e,"ClassPrivateProperty")}parseClassProperty(e){return e.typeAnnotation||this.expectPlugin("classProperties"),this.state.inClassProperty=!0,this.scope.enter(E|m),this.match(u.eq)?(this.expectPlugin("classProperties"),this.next(),e.value=this.parseMaybeAssign()):e.value=null,this.semicolon(),this.state.inClassProperty=!1,this.scope.exit(),this.finishNode(e,"ClassProperty")}parseClassId(e,t,n){this.match(u.name)?(e.id=this.parseIdentifier(),t&&this.checkLVal(e.id,F,void 0,"class name")):n||!t?e.id=null:this.unexpected(null,"A class name is required")}parseClassSuper(e){e.superClass=this.eat(u._extends)?this.parseExprSubscripts():null}parseExport(e){const t=this.maybeParseExportDefaultSpecifier(e),n=!t||this.eat(u.comma),r=n&&this.eatExportStar(e),i=r&&this.maybeParseExportNamespaceSpecifier(e),s=n&&(!i||this.eat(u.comma)),o=t||r;if(r&&!i)return t&&this.unexpected(),this.parseExportFrom(e,!0),this.finishNode(e,"ExportAllDeclaration");const a=this.maybeParseExportNamedSpecifiers(e);if(t&&n&&!r&&!a||i&&s&&!a)throw this.unexpected(null,u.braceL);let c;if(o||a?(c=!1,this.parseExportFrom(e,o)):c=this.maybeParseExportDeclaration(e),o||a||c)return this.checkExport(e,!0,!1,!!e.source),this.finishNode(e,"ExportNamedDeclaration");if(this.eat(u._default))return e.declaration=this.parseExportDefaultExpression(),this.checkExport(e,!0,!0),this.finishNode(e,"ExportDefaultDeclaration");throw this.unexpected(null,u.braceL)}eatExportStar(e){return this.eat(u.star)}maybeParseExportDefaultSpecifier(e){if(this.isExportDefaultSpecifier()){this.expectPlugin("exportDefaultFrom");const t=this.startNode();return t.exported=this.parseIdentifier(!0),e.specifiers=[this.finishNode(t,"ExportDefaultSpecifier")],!0}return!1}maybeParseExportNamespaceSpecifier(e){if(this.isContextual("as")){e.specifiers||(e.specifiers=[]),this.expectPlugin("exportNamespaceFrom");const t=this.startNodeAt(this.state.lastTokStart,this.state.lastTokStartLoc);return this.next(),t.exported=this.parseIdentifier(!0),e.specifiers.push(this.finishNode(t,"ExportNamespaceSpecifier")),!0}return!1}maybeParseExportNamedSpecifiers(e){return!!this.match(u.braceL)&&(e.specifiers||(e.specifiers=[]),e.specifiers.push(...this.parseExportSpecifiers()),e.source=null,e.declaration=null,!0)}maybeParseExportDeclaration(e){if(this.shouldParseExportDeclaration()){if(this.isContextual("async")){const e=this.lookahead();e.type!==u._function&&this.unexpected(e.start,'Unexpected token, expected "function"')}return e.specifiers=[],e.source=null,e.declaration=this.parseExportDeclaration(e),!0}return!1}isAsyncFunction(){if(!this.isContextual("async"))return!1;const{pos:e}=this.state;q.lastIndex=e;const t=q.exec(this.input);if(!t||!t.length)return!1;const n=e+t[0].length;return!(W.test(this.input.slice(e,n))||"function"!==this.input.slice(n,n+8)||n+8!==this.length&&pe(this.input.charCodeAt(n+8)))}parseExportDefaultExpression(){const e=this.startNode(),t=this.isAsyncFunction();if(this.match(u._function)||t)return this.next(),t&&this.next(),this.parseFunction(e,rt|st,t);if(this.match(u._class))return this.parseClass(e,!0,!0);if(this.match(u.at))return this.hasPlugin("decorators")&&this.getPluginOption("decorators","decoratorsBeforeExport")&&this.unexpected(this.state.start,"Decorators must be placed *before* the 'export' keyword. You can set the 'decoratorsBeforeExport' option to false to use the 'export @decorator class {}' syntax"),this.parseDecorators(!1),this.parseClass(e,!0,!0);if(this.match(u._const)||this.match(u._var)||this.isLet())return this.raise(this.state.start,"Only expressions, functions or classes are allowed as the `default` export.");{const e=this.parseMaybeAssign();return this.semicolon(),e}}parseExportDeclaration(e){return this.parseStatement(null)}isExportDefaultSpecifier(){if(this.match(u.name))return"async"!==this.state.value&&"let"!==this.state.value;if(!this.match(u._default))return!1;const e=this.lookahead();return e.type===u.comma||e.type===u.name&&"from"===e.value}parseExportFrom(e,t){this.eatContextual("from")?(e.source=this.parseImportSource(),this.checkExport(e)):t?this.unexpected():e.source=null,this.semicolon()}shouldParseExportDeclaration(){if(this.match(u.at)&&(this.expectOnePlugin(["decorators","decorators-legacy"]),this.hasPlugin("decorators"))){if(!this.getPluginOption("decorators","decoratorsBeforeExport"))return!0;this.unexpected(this.state.start,"Decorators must be placed *before* the 'export' keyword. You can set the 'decoratorsBeforeExport' option to false to use the 'export @decorator class {}' syntax")}return"var"===this.state.type.keyword||"const"===this.state.type.keyword||"function"===this.state.type.keyword||"class"===this.state.type.keyword||this.isLet()||this.isAsyncFunction()}checkExport(e,t,n,r){if(t)if(n)this.checkDuplicateExports(e,"default");else if(e.specifiers&&e.specifiers.length)for(let t=0,n=e.specifiers;t-1)throw this.raise(e.start,"default"===t?"Only one default export allowed per module.":`\`${t}\` has already been exported. Exported identifiers must be unique.`);this.state.exportedIdentifiers.push(t)}parseExportSpecifiers(){const e=[];let t=!0;for(this.expect(u.braceL);!this.eat(u.braceR);){if(t)t=!1;else if(this.expect(u.comma),this.eat(u.braceR))break;const n=this.startNode();n.local=this.parseIdentifier(!0),n.exported=this.eatContextual("as")?this.parseIdentifier(!0):n.local.__clone(),e.push(this.finishNode(n,"ExportSpecifier"))}return e}parseImport(e){if(e.specifiers=[],!this.match(u.string)){const t=!this.maybeParseDefaultImportSpecifier(e)||this.eat(u.comma),n=t&&this.maybeParseStarImportSpecifier(e);t&&!n&&this.parseNamedImportSpecifiers(e),this.expectContextual("from")}return e.source=this.parseImportSource(),this.semicolon(),this.finishNode(e,"ImportDeclaration")}parseImportSource(){return this.match(u.string)||this.unexpected(),this.parseExprAtom()}shouldParseDefaultImport(e){return this.match(u.name)}parseImportSpecifierLocal(e,t,n,r){t.local=this.parseIdentifier(),this.checkLVal(t.local,_,void 0,r),e.specifiers.push(this.finishNode(t,n))}maybeParseDefaultImportSpecifier(e){return!!this.shouldParseDefaultImport(e)&&(this.parseImportSpecifierLocal(e,this.startNode(),"ImportDefaultSpecifier","default import specifier"),!0)}maybeParseStarImportSpecifier(e){if(this.match(u.star)){const t=this.startNode();return this.next(),this.expectContextual("as"),this.parseImportSpecifierLocal(e,t,"ImportNamespaceSpecifier","import namespace specifier"),!0}return!1}parseNamedImportSpecifiers(e){let t=!0;for(this.expect(u.braceL);!this.eat(u.braceR);){if(t)t=!1;else if(this.eat(u.colon)&&this.unexpected(null,"ES2015 named imports do not destructure. Use another statement for destructuring after the import."),this.expect(u.comma),this.eat(u.braceR))break;this.parseImportSpecifier(e)}}parseImportSpecifier(e){const t=this.startNode();t.imported=this.parseIdentifier(!0),this.eatContextual("as")?t.local=this.parseIdentifier():(this.checkReservedWord(t.imported.name,t.start,!0,!0),t.local=t.imported.__clone()),this.checkLVal(t.local,_,void 0,"import specifier"),e.specifiers.push(this.finishNode(t,"ImportSpecifier"))}}class at extends ot{constructor(e,t){super(e=function(e){const t={};for(let n=0,r=Object.keys(Ie);n`'${e}'`).join(", "))}(e.plugins),n=function(e){const t=Ne.filter(t=>Oe(e,t)),n=t.join("/");let r=ct[n];if(!r){r=at;for(let e=0;e1)for(var n=1;n-1:!!l&&r(e,t,n)>-1}},function(e,t,n){var r=n(247);e.exports=function(e){var t=r(e),n=t%1;return t==t?n?t-n:t:0}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.merge=function(e,t){const{placeholderWhitelist:n=e.placeholderWhitelist,placeholderPattern:r=e.placeholderPattern,preserveComments:i=e.preserveComments,syntacticPlaceholders:s=e.syntacticPlaceholders}=t;return{parser:Object.assign({},e.parser,t.parser),placeholderWhitelist:n,placeholderPattern:r,preserveComments:i,syntacticPlaceholders:s}},t.validate=function(e){if(null!=e&&"object"!=typeof e)throw new Error("Unknown template options.");const t=e||{},{placeholderWhitelist:n,placeholderPattern:r,preserveComments:i,syntacticPlaceholders:s}=t,o=function(e,t){if(null==e)return{};var n,r,i={},s=Object.keys(e);for(r=0;r=0||(i[n]=e[n]);return i}(t,["placeholderWhitelist","placeholderPattern","preserveComments","syntacticPlaceholders"]);if(null!=n&&!(n instanceof Set))throw new Error("'.placeholderWhitelist' must be a Set, null, or undefined");if(null!=r&&!(r instanceof RegExp)&&!1!==r)throw new Error("'.placeholderPattern' must be a RegExp, false, null, or undefined");if(null!=i&&"boolean"!=typeof i)throw new Error("'.preserveComments' must be a boolean, null, or undefined");if(null!=s&&"boolean"!=typeof s)throw new Error("'.syntacticPlaceholders' must be a boolean, null, or undefined");if(!0===s&&(null!=n||null!=r))throw new Error("'.placeholderWhitelist' and '.placeholderPattern' aren't compatible with '.syntacticPlaceholders: true'");return{parser:o,placeholderWhitelist:n||void 0,placeholderPattern:null==r?void 0:r,preserveComments:null!=i&&i,syntacticPlaceholders:null==s?void 0:s}},t.normalizeReplacements=function(e){if(Array.isArray(e))return e.reduce((e,t,n)=>(e["$"+n]=t,e),{});if("object"==typeof e||null==e)return e||void 0;throw new Error("Template replacements must be an array, object, null, or undefined")}},function(e,t){(e.exports=function e(t,n){var r;if(null!==t&&void 0!==t)return n=(n||"").replace(/[^&"<>\']/g,""),r="([&\"<>'])".replace(new RegExp("["+n+"]","g"),""),t.replace(new RegExp(r,"g"),function(t,n){return e.map[n]})}).map={">":">","<":"<","'":"'",'"':""","&":"&"}},function(e,t,n){"use strict";function r(){const e=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var r=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(e,n):{};r.get||r.set?Object.defineProperty(t,n,r):t[n]=e[n]}return t.default=e,t}(n(0));return r=function(){return e},e}Object.defineProperty(t,"__esModule",{value:!0}),t.ForAwaitStatement=t.NumericLiteralTypeAnnotation=t.ExistentialTypeParam=t.SpreadProperty=t.RestProperty=t.Flow=t.Pure=t.Generated=t.User=t.Var=t.BlockScoped=t.Referenced=t.Scope=t.Expression=t.Statement=t.BindingIdentifier=t.ReferencedMemberExpression=t.ReferencedIdentifier=void 0;const i={types:["Identifier","JSXIdentifier"],checkPath(e,t){const{node:n,parent:i}=e;if(!r().isIdentifier(n,t)&&!r().isJSXMemberExpression(i,t)){if(!r().isJSXIdentifier(n,t))return!1;if(r().react.isCompatTag(n.name))return!1}return r().isReferenced(n,i,e.parentPath.parent)}};t.ReferencedIdentifier=i;const s={types:["MemberExpression"],checkPath:({node:e,parent:t})=>r().isMemberExpression(e)&&r().isReferenced(e,t)};t.ReferencedMemberExpression=s;const o={types:["Identifier"],checkPath(e){const{node:t,parent:n}=e,i=e.parentPath.parent;return r().isIdentifier(t)&&r().isBinding(t,n,i)}};t.BindingIdentifier=o;const a={types:["Statement"],checkPath({node:e,parent:t}){if(r().isStatement(e)){if(r().isVariableDeclaration(e)){if(r().isForXStatement(t,{left:e}))return!1;if(r().isForStatement(t,{init:e}))return!1}return!0}return!1}};t.Statement=a;const u={types:["Expression"],checkPath:e=>e.isIdentifier()?e.isReferencedIdentifier():r().isExpression(e.node)};t.Expression=u;const c={types:["Scopable"],checkPath:e=>r().isScope(e.node,e.parent)};t.Scope=c;const l={checkPath:e=>r().isReferenced(e.node,e.parent)};t.Referenced=l;const p={checkPath:e=>r().isBlockScoped(e.node)};t.BlockScoped=p;const h={types:["VariableDeclaration"],checkPath:e=>r().isVar(e.node)};t.Var=h;const f={checkPath:e=>e.node&&!!e.node.loc};t.User=f;const d={checkPath:e=>!e.isUser()};t.Generated=d;const y={checkPath:(e,t)=>e.scope.isPure(e.node,t)};t.Pure=y;const m={types:["Flow","ImportDeclaration","ExportDeclaration","ImportSpecifier"],checkPath:({node:e})=>!!r().isFlow(e)||(r().isImportDeclaration(e)?"type"===e.importKind||"typeof"===e.importKind:r().isExportDeclaration(e)?"type"===e.exportKind:!!r().isImportSpecifier(e)&&("type"===e.importKind||"typeof"===e.importKind))};t.Flow=m;const g={types:["RestElement"],checkPath:e=>e.parentPath&&e.parentPath.isObjectPattern()};t.RestProperty=g;const E={types:["RestElement"],checkPath:e=>e.parentPath&&e.parentPath.isObjectExpression()};t.SpreadProperty=E;t.ExistentialTypeParam={types:["ExistsTypeAnnotation"]};t.NumericLiteralTypeAnnotation={types:["NumberLiteralTypeAnnotation"]};const T={types:["ForOfStatement"],checkPath:({node:e})=>!0===e.await};t.ForAwaitStatement=T},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){const n=e.split(".");return e=>(0,r.default)(e,n,t)};var r=function(e){return e&&e.__esModule?e:{default:e}}(n(55))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n){if(!(0,r.isMemberExpression)(e))return!1;const i=Array.isArray(t)?t:t.split("."),s=[];let o;for(o=e;(0,r.isMemberExpression)(o);o=o.object)s.push(o.property);if(s.push(o),s.lengthi.length)return!1;for(let e=0,t=s.length-1;e-1&&e%1==0&&e-1&&e%1==0&&e<=n}},function(e,t){e.exports=function(e,t){return function(n){return e(t(n))}}},function(e,t){e.exports=function(){return[]}},function(e,t,n){var r=n(71),i=n(39),s=n(38),o=n(69),a=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)r(t,s(e)),e=i(e);return t}:o;e.exports=a},function(e,t){e.exports=function(e,t){for(var n=-1,r=t.length,i=e.length;++n=97&&o<=122||o>=65&&o<=90||36===o||95===o;for(s=new Array(128),o=0;o<128;++o)s[o]=o>=97&&o<=122||o>=65&&o<=90||o>=48&&o<=57||36===o||95===o;e.exports={isDecimalDigit:function(e){return 48<=e&&e<=57},isHexDigit:function(e){return 48<=e&&e<=57||97<=e&&e<=102||65<=e&&e<=70},isOctalDigit:function(e){return e>=48&&e<=55},isWhiteSpace:function(e){return 32===e||9===e||11===e||12===e||160===e||e>=5760&&r.indexOf(e)>=0},isLineTerminator:function(e){return 10===e||13===e||8232===e||8233===e},isIdentifierStartES5:function(e){return e<128?i[e]:n.NonAsciiIdentifierStart.test(a(e))},isIdentifierPartES5:function(e){return e<128?s[e]:n.NonAsciiIdentifierPart.test(a(e))},isIdentifierStartES6:function(e){return e<128?i[e]:t.NonAsciiIdentifierStart.test(a(e))},isIdentifierPartES6:function(e){return e<128?s[e]:t.NonAsciiIdentifierPart.test(a(e))}}}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if(e===t)return!0;const n=r.PLACEHOLDERS_ALIAS[e];if(n)for(const e of n)if(t===e)return!0;return!1};var r=n(3)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PLACEHOLDERS_FLIPPED_ALIAS=t.PLACEHOLDERS_ALIAS=t.PLACEHOLDERS=void 0;var r=n(7);const i=["Identifier","StringLiteral","Expression","Statement","Declaration","BlockStatement","ClassBody","Pattern"];t.PLACEHOLDERS=i;const s={Declaration:["Statement"],Pattern:["PatternLike","LVal"]};t.PLACEHOLDERS_ALIAS=s;for(const e of i){const t=r.ALIAS_KEYS[e];t&&t.length&&(s[e]=t)}const o={};t.PLACEHOLDERS_FLIPPED_ALIAS=o,Object.keys(s).forEach(e=>{s[e].forEach(t=>{Object.hasOwnProperty.call(o,t)||(o[t]=[]),o[t].push(e)})})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return!(!e||!r.VISITOR_KEYS[e.type])};var r=n(3)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function e(t){const n={};const i={};const s=[];const o=[];for(let a=0;a=0)){if((0,r.isAnyTypeAnnotation)(u))return[u];if((0,r.isFlowBaseAnnotation)(u))i[u.type]=u;else if((0,r.isUnionTypeAnnotation)(u))s.indexOf(u.types)<0&&(t=t.concat(u.types),s.push(u.types));else if((0,r.isGenericTypeAnnotation)(u)){const t=u.id.name;if(n[t]){let r=n[t];r.typeParameters?u.typeParameters&&(r.typeParameters.params=e(r.typeParameters.params.concat(u.typeParameters.params))):r=u.typeParameters}else n[t]=u}else o.push(u)}}for(const e of Object.keys(i))o.push(i[e]);for(const e of Object.keys(n))o.push(n[e]);return o};var r=n(2)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return(0,r.default)(e,!1)};var r=function(e){return e&&e.__esModule?e:{default:e}}(n(16))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n){if(!n||!e)return e;const r=`${t}Comments`;e[r]?e[r]="leading"===t?n.concat(e[r]):e[r].concat(n):e[r]=n;return e}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){(0,r.default)("innerComments",e,t)};var r=function(e){return e&&e.__esModule?e:{default:e}}(n(47))},function(e,t,n){var r=n(208),i=n(209),s=n(210);e.exports=function(e,t,n){return t==t?s(e,t,n):r(e,i,n)}},function(e,t){e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){(0,r.default)("leadingComments",e,t)};var r=function(e){return e&&e.__esModule?e:{default:e}}(n(47))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){return(0,r.default)(e,t),(0,i.default)(e,t),(0,s.default)(e,t),e};var r=o(n(87)),i=o(n(85)),s=o(n(82));function o(e){return e&&e.__esModule?e:{default:e}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){(0,r.default)("trailingComments",e,t)};var r=function(e){return e&&e.__esModule?e:{default:e}}(n(47))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if((0,r.isBlockStatement)(e))return e;let n=[];(0,r.isEmptyStatement)(e)?n=[]:((0,r.isStatement)(e)||(e=(0,r.isFunction)(t)?(0,i.returnStatement)(e):(0,i.expressionStatement)(e)),n=[e]);return(0,i.blockStatement)(n)};var r=n(2),i=n(4)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){e=(e=(e=(e+="").replace(/[^a-zA-Z0-9$_]/g,"-")).replace(/^[-0-9]+/,"")).replace(/[-\s]+(.)?/g,function(e,t){return t?t.toUpperCase():""}),(0,r.default)(e)||(e=`_${e}`);return e||"_"};var r=function(e){return e&&e.__esModule?e:{default:e}}(n(15))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){return(0,r.default)(e,i.default,t),e};var r=s(n(91)),i=s(n(92));function s(e){return e&&e.__esModule?e:{default:e}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function e(t,n,i){if(!t)return;const s=r.VISITOR_KEYS[t.type];if(!s)return;i=i||{};n(t,i);for(const r of s){const s=t[r];if(Array.isArray(s))for(const t of s)e(t,n,i);else e(s,n,i)}};var r=n(3)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t={}){const n=t.preserveComments?r:i;for(const t of n)null!=e[t]&&(e[t]=void 0);for(const t of Object.keys(e))"_"===t[0]&&null!=e[t]&&(e[t]=void 0);const s=Object.getOwnPropertySymbols(e);for(const t of s)e[t]=null};const r=["tokens","start","end","loc","raw","rawValue"],i=n(11).COMMENT_KEYS.concat(["comments"]).concat(r)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return(0,r.isVariableDeclaration)(e)&&("var"!==e.kind||e[i.BLOCK_SCOPED_SYMBOL])};var r=n(2),i=n(11)},function(e,t,n){"use strict";function r(){const e=h(n(49));return r=function(){return e},e}function i(){const e=h(n(97));return i=function(){return e},e}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var s=h(n(254)),o=h(n(13));function a(){const e=h(n(256));return a=function(){return e},e}var u=h(n(99));function c(){const e=h(n(264));return c=function(){return e},e}function l(){const e=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var r=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(e,n):{};r.get||r.set?Object.defineProperty(t,n,r):t[n]=e[n]}return t.default=e,t}(n(0));return l=function(){return e},e}var p=n(31);function h(e){return e&&e.__esModule?e:{default:e}}const f={For(e){for(const t of l().FOR_INIT_KEYS){const n=e.get(t);if(n.isVar()){(e.scope.getFunctionParent()||e.scope.getProgramParent()).registerBinding("var",n)}}},Declaration(e){if(e.isBlockScoped())return;if(e.isExportDeclaration()&&e.get("declaration").isDeclaration())return;(e.scope.getFunctionParent()||e.scope.getProgramParent()).registerDeclaration(e)},ReferencedIdentifier(e,t){t.references.push(e)},ForXStatement(e,t){const n=e.get("left");(n.isPattern()||n.isIdentifier())&&t.constantViolations.push(e)},ExportDeclaration:{exit(e){const{node:t,scope:n}=e,r=t.declaration;if(l().isClassDeclaration(r)||l().isFunctionDeclaration(r)){const t=r.id;if(!t)return;const i=n.getBinding(t.name);i&&i.reference(e)}else if(l().isVariableDeclaration(r))for(const t of r.declarations)for(const r of Object.keys(l().getBindingIdentifiers(t))){const t=n.getBinding(r);t&&t.reference(e)}}},LabeledStatement(e){e.scope.getProgramParent().addGlobal(e.node),e.scope.getBlockParent().registerDeclaration(e)},AssignmentExpression(e,t){t.assignments.push(e)},UpdateExpression(e,t){t.constantViolations.push(e)},UnaryExpression(e,t){"delete"===e.node.operator&&t.constantViolations.push(e)},BlockScoped(e){let t=e.scope;t.path===e&&(t=t.parent),t.getBlockParent().registerDeclaration(e)},ClassDeclaration(e){const t=e.node.id;if(!t)return;const n=t.name;e.scope.bindings[n]=e.scope.getBinding(n)},Block(e){const t=e.get("body");for(const n of t)n.isFunctionDeclaration()&&e.scope.getBlockParent().registerDeclaration(n)}};let d=0;class y{constructor(e){const{node:t}=e,n=p.scope.get(t);if(n&&n.path===e)return n;p.scope.set(t,this),this.uid=d++,this.block=t,this.path=e,this.labels=new Map}get parent(){const e=this.path.findParent(e=>e.isScope());return e&&e.scope}get parentBlock(){return this.path.parent}get hub(){return this.path.hub}traverse(e,t,n){(0,o.default)(e,t,this,n,this.path)}generateDeclaredUidIdentifier(e){const t=this.generateUidIdentifier(e);return this.push({id:t}),l().cloneNode(t)}generateUidIdentifier(e){return l().identifier(this.generateUid(e))}generateUid(e="temp"){let t;e=l().toIdentifier(e).replace(/^_+/,"").replace(/[0-9]+$/g,"");let n=0;do{t=this._generateUid(e,n),n++}while(this.hasLabel(t)||this.hasBinding(t)||this.hasGlobal(t)||this.hasReference(t));const r=this.getProgramParent();return r.references[t]=!0,r.uids[t]=!0,t}_generateUid(e,t){let n=e;return t>1&&(n+=t),`_${n}`}generateUidBasedOnNode(e,t){let n=e;l().isAssignmentExpression(e)?n=e.left:l().isVariableDeclarator(e)?n=e.id:(l().isObjectProperty(n)||l().isObjectMethod(n))&&(n=n.key);const r=[];!function e(t,n){if(l().isModuleDeclaration(t))if(t.source)e(t.source,n);else if(t.specifiers&&t.specifiers.length)for(const r of t.specifiers)e(r,n);else t.declaration&&e(t.declaration,n);else if(l().isModuleSpecifier(t))e(t.local,n);else if(l().isMemberExpression(t))e(t.object,n),e(t.property,n);else if(l().isIdentifier(t))n.push(t.name);else if(l().isLiteral(t))n.push(t.value);else if(l().isCallExpression(t))e(t.callee,n);else if(l().isObjectExpression(t)||l().isObjectPattern(t))for(const r of t.properties)e(r.key||r.argument,n);else l().isPrivateName(t)?e(t.id,n):l().isThisExpression(t)?n.push("this"):l().isSuper(t)&&n.push("super")}(n,r);let i=r.join("$");return i=i.replace(/^_/,"")||t||"ref",this.generateUid(i.slice(0,20))}generateUidIdentifierBasedOnNode(e,t){return l().identifier(this.generateUidBasedOnNode(e,t))}isStatic(e){if(l().isThisExpression(e)||l().isSuper(e))return!0;if(l().isIdentifier(e)){const t=this.getBinding(e.name);return t?t.constant:this.hasBinding(e.name)}return!1}maybeGenerateMemoised(e,t){if(this.isStatic(e))return null;{const n=this.generateUidIdentifierBasedOnNode(e);return t?n:(this.push({id:n}),l().cloneNode(n))}}checkBlockScopedCollisions(e,t,n,r){if("param"===t)return;if("local"===e.kind)return;if("let"===t||"let"===e.kind||"const"===e.kind||"module"===e.kind||"param"===e.kind&&("let"===t||"const"===t))throw this.hub.buildError(r,`Duplicate declaration "${n}"`,TypeError)}rename(e,t,n){const r=this.getBinding(e);if(r)return t=t||this.generateUidIdentifier(e).name,new s.default(r,e,t).rename(n)}_renameFromMap(e,t,n,r){e[t]&&(e[n]=r,e[t]=null)}dump(){const e=(0,i().default)("-",60);console.log(e);let t=this;do{console.log("#",t.block.type);for(const e of Object.keys(t.bindings)){const n=t.bindings[e];console.log(" -",e,{constant:n.constant,references:n.references,violations:n.constantViolations.length,kind:n.kind})}}while(t=t.parent);console.log(e)}toArray(e,t){if(l().isIdentifier(e)){const t=this.getBinding(e.name);if(t&&t.constant&&t.path.isGenericType("Array"))return e}if(l().isArrayExpression(e))return e;if(l().isIdentifier(e,{name:"arguments"}))return l().callExpression(l().memberExpression(l().memberExpression(l().memberExpression(l().identifier("Array"),l().identifier("prototype")),l().identifier("slice")),l().identifier("call")),[e]);let n;const r=[e];return!0===t?n="toConsumableArray":t?(r.push(l().numericLiteral(t)),n="slicedToArray"):n="toArray",l().callExpression(this.hub.addHelper(n),r)}hasLabel(e){return!!this.getLabel(e)}getLabel(e){return this.labels.get(e)}registerLabel(e){this.labels.set(e.node.label.name,e)}registerDeclaration(e){if(e.isLabeledStatement())this.registerLabel(e);else if(e.isFunctionDeclaration())this.registerBinding("hoisted",e.get("id"),e);else if(e.isVariableDeclaration()){const t=e.get("declarations");for(const n of t)this.registerBinding(e.node.kind,n)}else if(e.isClassDeclaration())this.registerBinding("let",e);else if(e.isImportDeclaration()){const t=e.get("specifiers");for(const e of t)this.registerBinding("module",e)}else if(e.isExportDeclaration()){const t=e.get("declaration");(t.isClassDeclaration()||t.isFunctionDeclaration()||t.isVariableDeclaration())&&this.registerDeclaration(t)}else this.registerBinding("unknown",e)}buildUndefinedNode(){return this.hasBinding("undefined")?l().unaryExpression("void",l().numericLiteral(0),!0):l().identifier("undefined")}registerConstantViolation(e){const t=e.getBindingIdentifiers();for(const n of Object.keys(t)){const t=this.getBinding(n);t&&t.reassign(e)}}registerBinding(e,t,n=t){if(!e)throw new ReferenceError("no `kind`");if(t.isVariableDeclaration()){const n=t.get("declarations");for(const t of n)this.registerBinding(e,t);return}const r=this.getProgramParent(),i=t.getOuterBindingIdentifiers(!0);for(const t of Object.keys(i))for(const s of i[t]){const i=this.getOwnBinding(t);if(i){if(i.identifier===s)continue;this.checkBlockScopedCollisions(i,e,t,s)}r.references[t]=!0,i?this.registerConstantViolation(n):this.bindings[t]=new u.default({identifier:s,scope:this,path:n,kind:e})}}addGlobal(e){this.globals[e.name]=e}hasUid(e){let t=this;do{if(t.uids[e])return!0}while(t=t.parent);return!1}hasGlobal(e){let t=this;do{if(t.globals[e])return!0}while(t=t.parent);return!1}hasReference(e){let t=this;do{if(t.references[e])return!0}while(t=t.parent);return!1}isPure(e,t){if(l().isIdentifier(e)){const n=this.getBinding(e.name);return!!n&&(!t||n.constant)}if(l().isClass(e))return!(e.superClass&&!this.isPure(e.superClass,t))&&this.isPure(e.body,t);if(l().isClassBody(e)){for(const n of e.body)if(!this.isPure(n,t))return!1;return!0}if(l().isBinary(e))return this.isPure(e.left,t)&&this.isPure(e.right,t);if(l().isArrayExpression(e)){for(const n of e.elements)if(!this.isPure(n,t))return!1;return!0}if(l().isObjectExpression(e)){for(const n of e.properties)if(!this.isPure(n,t))return!1;return!0}if(l().isClassMethod(e))return!(e.computed&&!this.isPure(e.key,t))&&("get"!==e.kind&&"set"!==e.kind);if(l().isProperty(e))return!(e.computed&&!this.isPure(e.key,t))&&this.isPure(e.value,t);if(l().isUnaryExpression(e))return this.isPure(e.argument,t);if(l().isTaggedTemplateExpression(e))return l().matchesPattern(e.tag,"String.raw")&&!this.hasBinding("String",!0)&&this.isPure(e.quasi,t);if(l().isTemplateLiteral(e)){for(const n of e.expressions)if(!this.isPure(n,t))return!1;return!0}return l().isPureish(e)}setData(e,t){return this.data[e]=t}getData(e){let t=this;do{const n=t.data[e];if(null!=n)return n}while(t=t.parent)}removeData(e){let t=this;do{null!=t.data[e]&&(t.data[e]=null)}while(t=t.parent)}init(){this.references||this.crawl()}crawl(){const e=this.path;if(this.references=Object.create(null),this.bindings=Object.create(null),this.globals=Object.create(null),this.uids=Object.create(null),this.data=Object.create(null),e.isLoop())for(const t of l().FOR_INIT_KEYS){const n=e.get(t);n.isBlockScoped()&&this.registerBinding(n.node.kind,n)}if(e.isFunctionExpression()&&e.has("id")&&(e.get("id").node[l().NOT_LOCAL_BINDING]||this.registerBinding("local",e.get("id"),e)),e.isClassExpression()&&e.has("id")&&(e.get("id").node[l().NOT_LOCAL_BINDING]||this.registerBinding("local",e)),e.isFunction()){const t=e.get("params");for(const e of t)this.registerBinding("param",e)}if(e.isCatchClause()&&this.registerBinding("let",e),this.getProgramParent().crawling)return;const t={references:[],constantViolations:[],assignments:[]};this.crawling=!0,e.traverse(f,t),this.crawling=!1;for(const e of t.assignments){const t=e.getBindingIdentifiers();let n;for(const r of Object.keys(t))e.scope.getBinding(r)||(n=n||e.scope.getProgramParent()).addGlobal(t[r]);e.scope.registerConstantViolation(e)}for(const e of t.references){const t=e.scope.getBinding(e.node.name);t?t.reference(e):e.scope.getProgramParent().addGlobal(e.node)}for(const e of t.constantViolations)e.scope.registerConstantViolation(e)}push(e){let t=this.path;t.isBlockStatement()||t.isProgram()||(t=this.getBlockParent().path),t.isSwitchStatement()&&(t=(this.getFunctionParent()||this.getProgramParent()).path),(t.isLoop()||t.isCatchClause()||t.isFunction())&&(t.ensureBlock(),t=t.get("body"));const n=e.unique,r=e.kind||"var",i=null==e._blockHoist?2:e._blockHoist,s=`declaration:${r}:${i}`;let o=!n&&t.getData(s);if(!o){const e=l().variableDeclaration(r,[]);e._blockHoist=i,[o]=t.unshiftContainer("body",[e]),n||t.setData(s,o)}const a=l().variableDeclarator(e.id,e.init);o.node.declarations.push(a),this.registerBinding(r,o.get("declarations").pop())}getProgramParent(){let e=this;do{if(e.path.isProgram())return e}while(e=e.parent);throw new Error("Couldn't find a Program")}getFunctionParent(){let e=this;do{if(e.path.isFunctionParent())return e}while(e=e.parent);return null}getBlockParent(){let e=this;do{if(e.path.isBlockParent())return e}while(e=e.parent);throw new Error("We couldn't find a BlockStatement, For, Switch, Function, Loop or Program...")}getAllBindings(){const e=Object.create(null);let t=this;do{(0,a().default)(e,t.bindings),t=t.parent}while(t);return e}getAllBindingsOfKind(){const e=Object.create(null);for(const t of arguments){let n=this;do{for(const r of Object.keys(n.bindings)){const i=n.bindings[r];i.kind===t&&(e[r]=i)}n=n.parent}while(n)}return e}bindingIdentifierEquals(e,t){return this.getBindingIdentifier(e)===t}getBinding(e){let t=this;do{const n=t.getOwnBinding(e);if(n)return n}while(t=t.parent)}getOwnBinding(e){return this.bindings[e]}getBindingIdentifier(e){const t=this.getBinding(e);return t&&t.identifier}getOwnBindingIdentifier(e){const t=this.bindings[e];return t&&t.identifier}hasOwnBinding(e){return!!this.getOwnBinding(e)}hasBinding(e,t){return!!e&&(!!this.hasOwnBinding(e)||(!!this.parentHasBinding(e,t)||(!!this.hasUid(e)||(!(t||!(0,r().default)(y.globals,e))||!(t||!(0,r().default)(y.contextVariables,e))))))}parentHasBinding(e,t){return this.parent&&this.parent.hasBinding(e,t)}moveBindingTo(e,t){const n=this.getBinding(e);n&&(n.scope.removeOwnBinding(e),n.scope=t,t.bindings[e]=n)}removeOwnBinding(e){delete this.bindings[e]}removeBinding(e){const t=this.getBinding(e);t&&t.scope.removeOwnBinding(e);let n=this;do{n.uids[e]&&(n.uids[e]=!1)}while(n=n.parent)}}t.default=y,y.globals=Object.keys(c().default.builtin),y.contextVariables=["arguments","undefined","Infinity","NaN"]},function(e,t,n){var r=n(8),i=n(6),s="[object Symbol]";e.exports=function(e){return"symbol"==typeof e||i(e)&&r(e)==s}},function(e,t){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++n0&&e.column>=0)||t||n||r)&&!(e&&"line"in e&&"column"in e&&t&&"line"in t&&"column"in t&&e.line>0&&e.column>=0&&t.line>0&&t.column>=0&&n))throw new Error("Invalid mapping: "+JSON.stringify({generated:e,source:n,original:t,name:r}))},a.prototype._serializeMappings=function(){for(var e,t,n,s,o=0,a=1,u=0,c=0,l=0,p=0,h="",f=this._mappings.toArray(),d=0,y=f.length;d0){if(!i.compareByGeneratedPositionsInflated(t,f[d-1]))continue;e+=","}e+=r.encode(t.generatedColumn-o),o=t.generatedColumn,null!=t.source&&(s=this._sources.indexOf(t.source),e+=r.encode(s-p),p=s,e+=r.encode(t.originalLine-1-c),c=t.originalLine-1,e+=r.encode(t.originalColumn-u),u=t.originalColumn,null!=t.name&&(n=this._names.indexOf(t.name),e+=r.encode(n-l),l=n)),h+=e}return h},a.prototype._generateSourcesContent=function(e,t){return e.map(function(e){if(!this._sourcesContents)return null;null!=t&&(e=i.relative(t,e));var n=i.toSetString(e);return Object.prototype.hasOwnProperty.call(this._sourcesContents,n)?this._sourcesContents[n]:null},this)},a.prototype.toJSON=function(){var e={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return null!=this._file&&(e.file=this._file),null!=this._sourceRoot&&(e.sourceRoot=this._sourceRoot),this._sourcesContents&&(e.sourcesContent=this._generateSourcesContent(e.sources,e.sourceRoot)),e},a.prototype.toString=function(){return JSON.stringify(this.toJSON())},t.SourceMapGenerator=a},function(e,t,n){var r=n(268);t.encode=function(e){var t,n="",i=function(e){return e<0?1+(-e<<1):0+(e<<1)}(e);do{t=31&i,(i>>>=5)>0&&(t|=32),n+=r.encode(t)}while(i>0);return n},t.decode=function(e,t,n){var i,s,o=e.length,a=0,u=0;do{if(t>=o)throw new Error("Expected more digits in base 64 VLQ value.");if(-1===(s=r.decode(e.charCodeAt(t++))))throw new Error("Invalid base64 digit: "+e.charAt(t-1));i=!!(32&s),a+=(s&=31)<>1;return 1==(1&e)?-t:t}(a),n.rest=t}},function(e,t,n){var r=n(17),i=Object.prototype.hasOwnProperty;function s(){this._array=[],this._set=Object.create(null)}s.fromArray=function(e,t){for(var n=new s,r=0,i=e.length;r=0&&e{this.word(e.name)})},t.ArgumentPlaceholder=function(){this.token("?")},t.SpreadElement=t.RestElement=function(e){this.token("..."),this.print(e.argument,e)},t.ObjectPattern=t.ObjectExpression=function(e){const t=e.properties;this.token("{"),this.printInnerComments(e),t.length&&(this.space(),this.printList(t,e,{indent:!0,statement:!0}),this.space());this.token("}")},t.ObjectMethod=function(e){this.printJoin(e.decorators,e),this._methodHead(e),this.space(),this.print(e.body,e)},t.ObjectProperty=function(e){if(this.printJoin(e.decorators,e),e.computed)this.token("["),this.print(e.key,e),this.token("]");else{if(r().isAssignmentPattern(e.value)&&r().isIdentifier(e.key)&&e.key.name===e.value.left.name)return void this.print(e.value,e);if(this.print(e.key,e),e.shorthand&&r().isIdentifier(e.key)&&r().isIdentifier(e.value)&&e.key.name===e.value.name)return}this.token(":"),this.space(),this.print(e.value,e)},t.ArrayPattern=t.ArrayExpression=function(e){const t=e.elements,n=t.length;this.token("["),this.printInnerComments(e);for(let r=0;r0&&this.space(),this.print(i,e),ri?e(t):t,c=e.split(s),{start:l,end:p,markerLines:h}=function(e,t,n){const r=Object.assign({column:0,line:-1},e.start),i=Object.assign({},r,e.end),{linesAbove:s=2,linesBelow:o=3}=n||{},a=r.line,u=r.column,c=i.line,l=i.column;let p=Math.max(a-(s+1),0),h=Math.min(t.length,c+o);-1===a&&(p=0),-1===c&&(h=t.length);const f=c-a,d={};if(f)for(let e=0;e<=f;e++){const n=e+a;if(u)if(0===e){const e=t[n-1].length;d[n]=[u,e-u+1]}else if(e===f)d[n]=[0,l];else{const r=t[n-e].length;d[n]=[0,r]}else d[n]=!0}else d[a]=u===l?!u||[u,0]:[u,l-u];return{start:p,end:h,markerLines:d}}(t,c,n),f=t.start&&"number"==typeof t.start.column,d=String(p).length;let y=(i?(0,r().default)(e,n):e).split(s).slice(l,p).map((e,t)=>{const r=l+1+t,i=` ${` ${r}`.slice(-d)} | `,s=h[r],o=!h[r+1];if(s){let t="";if(Array.isArray(s)){const r=e.slice(0,Math.max(s[0]-1,0)).replace(/[^\t]/g," "),c=s[1]||1;t=["\n ",u(a.gutter,i.replace(/\d/g," ")),r,u(a.marker,"^").repeat(c)].join(""),o&&n.message&&(t+=" "+u(a.message,n.message))}return[u(a.marker,">"),u(a.gutter,i),e,t].join("")}return` ${u(a.gutter,i)}${e}`}).join("\n");return n.message&&!f&&(y=`${" ".repeat(d+1)}${n.message}\n${y}`),i?o.reset(y):y}}).call(this,n(48))},function(e,t,n){var r=n(306),i={};for(var s in r)r.hasOwnProperty(s)&&(i[r[s]]=s);var o=e.exports={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};for(var a in o)if(o.hasOwnProperty(a)){if(!("channels"in o[a]))throw new Error("missing channels property: "+a);if(!("labels"in o[a]))throw new Error("missing channel labels property: "+a);if(o[a].labels.length!==o[a].channels)throw new Error("channel and label counts mismatch: "+a);var u=o[a].channels,c=o[a].labels;delete o[a].channels,delete o[a].labels,Object.defineProperty(o[a],"channels",{value:u}),Object.defineProperty(o[a],"labels",{value:c})}function l(e,t){return Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)+Math.pow(e[2]-t[2],2)}o.rgb.hsl=function(e){var t,n,r=e[0]/255,i=e[1]/255,s=e[2]/255,o=Math.min(r,i,s),a=Math.max(r,i,s),u=a-o;return a===o?t=0:r===a?t=(i-s)/u:i===a?t=2+(s-r)/u:s===a&&(t=4+(r-i)/u),(t=Math.min(60*t,360))<0&&(t+=360),n=(o+a)/2,[t,100*(a===o?0:n<=.5?u/(a+o):u/(2-a-o)),100*n]},o.rgb.hsv=function(e){var t,n,r=e[0],i=e[1],s=e[2],o=Math.min(r,i,s),a=Math.max(r,i,s),u=a-o;return n=0===a?0:u/a*1e3/10,a===o?t=0:r===a?t=(i-s)/u:i===a?t=2+(s-r)/u:s===a&&(t=4+(r-i)/u),(t=Math.min(60*t,360))<0&&(t+=360),[t,n,a/255*1e3/10]},o.rgb.hwb=function(e){var t=e[0],n=e[1],r=e[2];return[o.rgb.hsl(e)[0],100*(1/255*Math.min(t,Math.min(n,r))),100*(r=1-1/255*Math.max(t,Math.max(n,r)))]},o.rgb.cmyk=function(e){var t,n=e[0]/255,r=e[1]/255,i=e[2]/255;return[100*((1-n-(t=Math.min(1-n,1-r,1-i)))/(1-t)||0),100*((1-r-t)/(1-t)||0),100*((1-i-t)/(1-t)||0),100*t]},o.rgb.keyword=function(e){var t=i[e];if(t)return t;var n,s=1/0;for(var o in r)if(r.hasOwnProperty(o)){var a=l(e,r[o]);a.04045?Math.pow((t+.055)/1.055,2.4):t/12.92)+.3576*(n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92)+.1805*(r=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92)),100*(.2126*t+.7152*n+.0722*r),100*(.0193*t+.1192*n+.9505*r)]},o.rgb.lab=function(e){var t=o.rgb.xyz(e),n=t[0],r=t[1],i=t[2];return r/=100,i/=108.883,n=(n/=95.047)>.008856?Math.pow(n,1/3):7.787*n+16/116,[116*(r=r>.008856?Math.pow(r,1/3):7.787*r+16/116)-16,500*(n-r),200*(r-(i=i>.008856?Math.pow(i,1/3):7.787*i+16/116))]},o.hsl.rgb=function(e){var t,n,r,i,s,o=e[0]/360,a=e[1]/100,u=e[2]/100;if(0===a)return[s=255*u,s,s];t=2*u-(n=u<.5?u*(1+a):u+a-u*a),i=[0,0,0];for(var c=0;c<3;c++)(r=o+1/3*-(c-1))<0&&r++,r>1&&r--,s=6*r<1?t+6*(n-t)*r:2*r<1?n:3*r<2?t+(n-t)*(2/3-r)*6:t,i[c]=255*s;return i},o.hsl.hsv=function(e){var t=e[0],n=e[1]/100,r=e[2]/100,i=n,s=Math.max(r,.01);return n*=(r*=2)<=1?r:2-r,i*=s<=1?s:2-s,[t,100*(0===r?2*i/(s+i):2*n/(r+n)),100*((r+n)/2)]},o.hsv.rgb=function(e){var t=e[0]/60,n=e[1]/100,r=e[2]/100,i=Math.floor(t)%6,s=t-Math.floor(t),o=255*r*(1-n),a=255*r*(1-n*s),u=255*r*(1-n*(1-s));switch(r*=255,i){case 0:return[r,u,o];case 1:return[a,r,o];case 2:return[o,r,u];case 3:return[o,a,r];case 4:return[u,o,r];case 5:return[r,o,a]}},o.hsv.hsl=function(e){var t,n,r,i=e[0],s=e[1]/100,o=e[2]/100,a=Math.max(o,.01);return r=(2-s)*o,n=s*a,[i,100*(n=(n/=(t=(2-s)*a)<=1?t:2-t)||0),100*(r/=2)]},o.hwb.rgb=function(e){var t,n,r,i,s,o,a,u=e[0]/360,c=e[1]/100,l=e[2]/100,p=c+l;switch(p>1&&(c/=p,l/=p),n=1-l,r=6*u-(t=Math.floor(6*u)),0!=(1&t)&&(r=1-r),i=c+r*(n-c),t){default:case 6:case 0:s=n,o=i,a=c;break;case 1:s=i,o=n,a=c;break;case 2:s=c,o=n,a=i;break;case 3:s=c,o=i,a=n;break;case 4:s=i,o=c,a=n;break;case 5:s=n,o=c,a=i}return[255*s,255*o,255*a]},o.cmyk.rgb=function(e){var t=e[0]/100,n=e[1]/100,r=e[2]/100,i=e[3]/100;return[255*(1-Math.min(1,t*(1-i)+i)),255*(1-Math.min(1,n*(1-i)+i)),255*(1-Math.min(1,r*(1-i)+i))]},o.xyz.rgb=function(e){var t,n,r,i=e[0]/100,s=e[1]/100,o=e[2]/100;return n=-.9689*i+1.8758*s+.0415*o,r=.0557*i+-.204*s+1.057*o,t=(t=3.2406*i+-1.5372*s+-.4986*o)>.0031308?1.055*Math.pow(t,1/2.4)-.055:12.92*t,n=n>.0031308?1.055*Math.pow(n,1/2.4)-.055:12.92*n,r=r>.0031308?1.055*Math.pow(r,1/2.4)-.055:12.92*r,[255*(t=Math.min(Math.max(0,t),1)),255*(n=Math.min(Math.max(0,n),1)),255*(r=Math.min(Math.max(0,r),1))]},o.xyz.lab=function(e){var t=e[0],n=e[1],r=e[2];return n/=100,r/=108.883,t=(t/=95.047)>.008856?Math.pow(t,1/3):7.787*t+16/116,[116*(n=n>.008856?Math.pow(n,1/3):7.787*n+16/116)-16,500*(t-n),200*(n-(r=r>.008856?Math.pow(r,1/3):7.787*r+16/116))]},o.lab.xyz=function(e){var t,n,r,i=e[0],s=e[1],o=e[2];t=s/500+(n=(i+16)/116),r=n-o/200;var a=Math.pow(n,3),u=Math.pow(t,3),c=Math.pow(r,3);return n=a>.008856?a:(n-16/116)/7.787,t=u>.008856?u:(t-16/116)/7.787,r=c>.008856?c:(r-16/116)/7.787,[t*=95.047,n*=100,r*=108.883]},o.lab.lch=function(e){var t,n=e[0],r=e[1],i=e[2];return(t=360*Math.atan2(i,r)/2/Math.PI)<0&&(t+=360),[n,Math.sqrt(r*r+i*i),t]},o.lch.lab=function(e){var t,n=e[0],r=e[1];return t=e[2]/360*2*Math.PI,[n,r*Math.cos(t),r*Math.sin(t)]},o.rgb.ansi16=function(e){var t=e[0],n=e[1],r=e[2],i=1 in arguments?arguments[1]:o.rgb.hsv(e)[2];if(0===(i=Math.round(i/50)))return 30;var s=30+(Math.round(r/255)<<2|Math.round(n/255)<<1|Math.round(t/255));return 2===i&&(s+=60),s},o.hsv.ansi16=function(e){return o.rgb.ansi16(o.hsv.rgb(e),e[2])},o.rgb.ansi256=function(e){var t=e[0],n=e[1],r=e[2];return t===n&&n===r?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(n/255*5)+Math.round(r/255*5)},o.ansi16.rgb=function(e){var t=e%10;if(0===t||7===t)return e>50&&(t+=3.5),[t=t/10.5*255,t,t];var n=.5*(1+~~(e>50));return[(1&t)*n*255,(t>>1&1)*n*255,(t>>2&1)*n*255]},o.ansi256.rgb=function(e){if(e>=232){var t=10*(e-232)+8;return[t,t,t]}var n;return e-=16,[Math.floor(e/36)/5*255,Math.floor((n=e%36)/6)/5*255,n%6/5*255]},o.rgb.hex=function(e){var t=(((255&Math.round(e[0]))<<16)+((255&Math.round(e[1]))<<8)+(255&Math.round(e[2]))).toString(16).toUpperCase();return"000000".substring(t.length)+t},o.hex.rgb=function(e){var t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t)return[0,0,0];var n=t[0];3===t[0].length&&(n=n.split("").map(function(e){return e+e}).join(""));var r=parseInt(n,16);return[r>>16&255,r>>8&255,255&r]},o.rgb.hcg=function(e){var t,n,r=e[0]/255,i=e[1]/255,s=e[2]/255,o=Math.max(Math.max(r,i),s),a=Math.min(Math.min(r,i),s),u=o-a;return t=u<1?a/(1-u):0,n=u<=0?0:o===r?(i-s)/u%6:o===i?2+(s-r)/u:4+(r-i)/u+4,n/=6,[360*(n%=1),100*u,100*t]},o.hsl.hcg=function(e){var t=e[1]/100,n=e[2]/100,r=1,i=0;return(r=n<.5?2*t*n:2*t*(1-n))<1&&(i=(n-.5*r)/(1-r)),[e[0],100*r,100*i]},o.hsv.hcg=function(e){var t=e[1]/100,n=e[2]/100,r=t*n,i=0;return r<1&&(i=(n-r)/(1-r)),[e[0],100*r,100*i]},o.hcg.rgb=function(e){var t=e[0]/360,n=e[1]/100,r=e[2]/100;if(0===n)return[255*r,255*r,255*r];var i,s=[0,0,0],o=t%1*6,a=o%1,u=1-a;switch(Math.floor(o)){case 0:s[0]=1,s[1]=a,s[2]=0;break;case 1:s[0]=u,s[1]=1,s[2]=0;break;case 2:s[0]=0,s[1]=1,s[2]=a;break;case 3:s[0]=0,s[1]=u,s[2]=1;break;case 4:s[0]=a,s[1]=0,s[2]=1;break;default:s[0]=1,s[1]=0,s[2]=u}return i=(1-n)*r,[255*(n*s[0]+i),255*(n*s[1]+i),255*(n*s[2]+i)]},o.hcg.hsv=function(e){var t=e[1]/100,n=t+e[2]/100*(1-t),r=0;return n>0&&(r=t/n),[e[0],100*r,100*n]},o.hcg.hsl=function(e){var t=e[1]/100,n=e[2]/100*(1-t)+.5*t,r=0;return n>0&&n<.5?r=t/(2*n):n>=.5&&n<1&&(r=t/(2*(1-n))),[e[0],100*r,100*n]},o.hcg.hwb=function(e){var t=e[1]/100,n=t+e[2]/100*(1-t);return[e[0],100*(n-t),100*(1-n)]},o.hwb.hcg=function(e){var t=e[1]/100,n=1-e[2]/100,r=n-t,i=0;return r<1&&(i=(n-r)/(1-r)),[e[0],100*r,100*i]},o.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]},o.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]},o.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]},o.gray.hsl=o.gray.hsv=function(e){return[0,0,e[0]]},o.gray.hwb=function(e){return[0,100,e[0]]},o.gray.cmyk=function(e){return[0,0,0,e[0]]},o.gray.lab=function(e){return[e[0],0,0]},o.gray.hex=function(e){var t=255&Math.round(e[0]/100*255),n=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".substring(n.length)+n},o.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]}},function(e,t,n){"use strict";var r=n(110)();e.exports=function(e){return"string"==typeof e?e.replace(r,""):e}},function(e,t,n){"use strict";e.exports=function(){return/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-PRZcf-nqry=><]/g}},function(e,t,n){"use strict";function r(){const e=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var r=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(e,n):{};r.get||r.set?Object.defineProperty(t,n,r):t[n]=e[n]}return t.default=e,t}(n(0));return r=function(){return e},e}function i(){const e=n(32);return i=function(){return e},e}function s(){const e=n(107);return s=function(){return e},e}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n){const o=function(e,t){t=Object.assign({allowReturnOutsideFunction:!0,allowSuperOutsideMethod:!0,sourceType:"module"},t,{plugins:(t.plugins||[]).concat("placeholders")});try{return(0,i().parse)(e,t)}catch(t){const n=t.loc;throw n&&(t.message+="\n"+(0,s().codeFrameColumns)(e,{start:n}),t.code="BABEL_TEMPLATE_PARSE_ERROR"),t}}(t,n.parser),{placeholderWhitelist:u,placeholderPattern:c,preserveComments:l,syntacticPlaceholders:p}=n;r().removePropertiesDeep(o,{preserveComments:l}),e.validate(o);const h={placeholders:[],placeholderNames:new Set},f={placeholders:[],placeholderNames:new Set},d={value:void 0};return r().traverse(o,a,{syntactic:h,legacy:f,isLegacyRef:d,placeholderWhitelist:u,placeholderPattern:c,syntacticPlaceholders:p}),Object.assign({ast:o},d.value?f:h)};const o=/^[_$A-Z0-9]+$/;function a(e,t,n){let i;if(r().isPlaceholder(e)){if(!1===n.syntacticPlaceholders)throw new Error("%%foo%%-style placeholders can't be used when '.syntacticPlaceholders' is false.");i=e.name.name,n.isLegacyRef.value=!1}else{if(!1===n.isLegacyRef.value||n.syntacticPlaceholders)return;if(r().isIdentifier(e)||r().isJSXIdentifier(e))i=e.name,n.isLegacyRef.value=!0;else{if(!r().isStringLiteral(e))return;i=e.value,n.isLegacyRef.value=!0}}if(!n.isLegacyRef.value&&(null!=n.placeholderPattern||null!=n.placeholderWhitelist))throw new Error("'.placeholderWhitelist' and '.placeholderPattern' aren't compatible with '.syntacticPlaceholders: true'");if(n.isLegacyRef.value&&(!1===n.placeholderPattern||!(n.placeholderPattern||o).test(i))&&(!n.placeholderWhitelist||!n.placeholderWhitelist.has(i)))return;t=t.slice();const{node:s,key:a}=t[t.length-1];let u;r().isStringLiteral(e)||r().isPlaceholder(e,{expectedNode:"StringLiteral"})?u="string":r().isNewExpression(s)&&"arguments"===a||r().isCallExpression(s)&&"arguments"===a||r().isFunction(s)&&"params"===a?u="param":r().isExpressionStatement(s)&&!r().isPlaceholder(e)?(u="statement",t=t.slice(0,-1)):u=r().isStatement(e)&&r().isPlaceholder(e)?"statement":"other";const{placeholders:c,placeholderNames:l}=n.isLegacyRef.value?n.legacy:n.syntactic;c.push({name:i,type:u,resolve:e=>(function(e,t){let n=e;for(let e=0;e{if(!Object.prototype.hasOwnProperty.call(t,e.name)){const t=e.name;throw new Error(`Error: No substitution given for "${t}". If this is not meant to be a\n placeholder you may want to consider passing one of the following options to @babel/template:\n - { placeholderPattern: false, placeholderWhitelist: new Set(['${t}'])}\n - { placeholderPattern: /^${t}$/ }`)}}),Object.keys(t).forEach(t=>{if(!e.placeholderNames.has(t))throw new Error(`Unknown substitution "${t}" given`)}));return e.placeholders.slice().reverse().forEach(e=>{try{!function(e,t,n){e.isDuplicate&&(Array.isArray(n)?n=n.map(e=>r().cloneNode(e)):"object"==typeof n&&(n=r().cloneNode(n)));const{parent:i,key:s,index:o}=e.resolve(t);if("string"===e.type){if("string"==typeof n&&(n=r().stringLiteral(n)),!n||!r().isStringLiteral(n))throw new Error("Expected string substitution")}else if("statement"===e.type)void 0===o?n?Array.isArray(n)?n=r().blockStatement(n):"string"==typeof n?n=r().expressionStatement(r().identifier(n)):r().isStatement(n)||(n=r().expressionStatement(n)):n=r().emptyStatement():n&&!Array.isArray(n)&&("string"==typeof n&&(n=r().identifier(n)),r().isStatement(n)||(n=r().expressionStatement(n)));else if("param"===e.type){if("string"==typeof n&&(n=r().identifier(n)),void 0===o)throw new Error("Assertion failure.")}else if("string"==typeof n&&(n=r().identifier(n)),Array.isArray(n))throw new Error("Cannot replace single expression with an array.");if(void 0===o)r().validate(i,s,n),i[s]=n;else{const t=i[s].slice();"statement"===e.type||"param"===e.type?null==n?t.splice(o,1):Array.isArray(n)?t.splice(o,1,...n):t[o]=n:t[o]=n,r().validate(i,s,t),i[s]=t}}(e,n,t&&t[e.name]||null)}catch(t){throw t.message=`@babel/template placeholder "${e.name}": ${t.message}`,t}}),n}},function(e,t,n){"use strict";var r=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"!==t&&"[object Date]"!==t}(e)};function i(e,t){return t&&!0===t.clone&&r(e)?o(function(e){return Array.isArray(e)?[]:{}}(e),e,t):e}function s(e,t,n){var s=e.slice();return t.forEach(function(t,a){void 0===s[a]?s[a]=i(t,n):r(t)?s[a]=o(e[a],t,n):-1===e.indexOf(t)&&s.push(i(t,n))}),s}function o(e,t,n){var a=Array.isArray(t);return a===Array.isArray(e)?a?((n||{arrayMerge:s}).arrayMerge||s)(e,t,n):function(e,t,n){var s={};return r(e)&&Object.keys(e).forEach(function(t){s[t]=i(e[t],n)}),Object.keys(t).forEach(function(a){r(t[a])&&e[a]?s[a]=o(e[a],t[a],n):s[a]=i(t[a],n)}),s}(e,t,n):i(t,n)}o.all=function(e,t){if(!Array.isArray(e)||e.length<2)throw new Error("first argument should be an array with at least two elements");return e.reduce(function(e,n){return o(e,n,t)})};var a=o;e.exports=a},function(e,t,n){"use strict";const r=n(109),i=n(329);e.exports=(e=>{if("string"!=typeof e||0===e.length)return 0;e=r(e);let t=0;for(let n=0;n=127&&r<=159||(r>=768&&r<=879||(r>65535&&n++,t+=i(r)?2:1))}return t})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=function(e){return e&&e.__esModule?e:{default:e}}(n(12));function i(){const e=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var r=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(e,n):{};r.get||r.set?Object.defineProperty(t,n,r):t[n]=e[n]}return t.default=e,t}(n(0));return i=function(){return e},e}const s=!1;t.default=class{constructor(e,t,n,r){this.queue=null,this.parentPath=r,this.scope=e,this.state=n,this.opts=t}shouldVisit(e){const t=this.opts;if(t.enter||t.exit)return!0;if(t[e.type])return!0;const n=i().VISITOR_KEYS[e.type];if(!n||!n.length)return!1;for(const t of n)if(e[t])return!0;return!1}create(e,t,n,i){return r.default.get({parentPath:this.parentPath,parent:e,container:t,key:n,listKey:i})}maybeQueue(e,t){if(this.trap)throw new Error("Infinite cycle detected");this.queue&&(t?this.queue.push(e):this.priorityQueue.push(e))}visitMultiple(e,t,n){if(0===e.length)return!1;const r=[];for(let i=0;i=1e4&&(this.trap=!0),!(t.indexOf(r.node)>=0))){if(t.push(r.node),r.visit()){n=!0;break}if(this.priorityQueue.length&&(n=this.visitQueue(this.priorityQueue),this.priorityQueue=[],this.queue=e,n))break}for(const t of e)t.popContext();return this.queue=null,n}visit(e,t){const n=e[t];return!!n&&(Array.isArray(n)?this.visitMultiple(n,e,t):this.visitSingle(e,t))}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=(0,function(e){return e&&e.__esModule?e:{default:e}}(n(54)).default)("React.Component");t.default=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return!!e&&/^[a-z]/.test(e)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){const t=[];for(let n=0;nn.length)throw new Error(`${e}: Too many arguments passed. Received ${o} but can receive no more than ${n.length}`);const a={type:e};let u=0;n.forEach(n=>{const s=i.NODE_FIELDS[e][n];let c;u-1}},function(e,t,n){var r=n(19);e.exports=function(e,t){var n=this.__data__,i=r(n,e);return i<0?(++this.size,n.push([e,t])):n[i][1]=t,this}},function(e,t,n){var r=n(18);e.exports=function(){this.__data__=new r,this.size=0}},function(e,t){e.exports=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}},function(e,t){e.exports=function(e){return this.__data__.get(e)}},function(e,t){e.exports=function(e){return this.__data__.has(e)}},function(e,t,n){var r=n(18),i=n(34),s=n(60),o=200;e.exports=function(e,t){var n=this.__data__;if(n instanceof r){var a=n.__data__;if(!i||a.length=r)return!1;if(!(56320<=(s=e.charCodeAt(n))&&s<=57343))return!1;i=u(i,s)}if(!o(i))return!1;o=t.isIdentifierPartES6}return!0}e.exports={isKeywordES5:r,isKeywordES6:i,isReservedWordES5:s,isReservedWordES6:o,isRestrictedWord:function(e){return"eval"===e||"arguments"===e},isIdentifierNameES5:a,isIdentifierNameES6:c,isIdentifierES5:function(e,t){return a(e)&&!s(e,t)},isIdentifierES6:function(e,t){return c(e)&&!o(e,t)}}}()},function(e,t,n){"use strict";var r=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var r=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(e,n):{};r.get||r.set?Object.defineProperty(t,n,r):t[n]=e[n]}return t.default=e,t}(n(7));const i=(e,t="TypeParameterDeclaration")=>{(0,r.default)(e,{builder:["id","typeParameters","extends","body"],visitor:["id","typeParameters","extends","mixins","implements","body"],aliases:["Flow","FlowDeclaration","Statement","Declaration"],fields:{id:(0,r.validateType)("Identifier"),typeParameters:(0,r.validateOptionalType)(t),extends:(0,r.validateOptional)((0,r.arrayOfType)("InterfaceExtends")),mixins:(0,r.validateOptional)((0,r.arrayOfType)("InterfaceExtends")),implements:(0,r.validateOptional)((0,r.arrayOfType)("ClassImplements")),body:(0,r.validateType)("ObjectTypeAnnotation")}})};(0,r.default)("AnyTypeAnnotation",{aliases:["Flow","FlowType","FlowBaseAnnotation"]}),(0,r.default)("ArrayTypeAnnotation",{visitor:["elementType"],aliases:["Flow","FlowType"],fields:{elementType:(0,r.validateType)("FlowType")}}),(0,r.default)("BooleanTypeAnnotation",{aliases:["Flow","FlowType","FlowBaseAnnotation"]}),(0,r.default)("BooleanLiteralTypeAnnotation",{builder:["value"],aliases:["Flow","FlowType"],fields:{value:(0,r.validate)((0,r.assertValueType)("boolean"))}}),(0,r.default)("NullLiteralTypeAnnotation",{aliases:["Flow","FlowType","FlowBaseAnnotation"]}),(0,r.default)("ClassImplements",{visitor:["id","typeParameters"],aliases:["Flow"],fields:{id:(0,r.validateType)("Identifier"),typeParameters:(0,r.validateOptionalType)("TypeParameterInstantiation")}}),i("DeclareClass"),(0,r.default)("DeclareFunction",{visitor:["id"],aliases:["Flow","FlowDeclaration","Statement","Declaration"],fields:{id:(0,r.validateType)("Identifier"),predicate:(0,r.validateOptionalType)("DeclaredPredicate")}}),i("DeclareInterface"),(0,r.default)("DeclareModule",{builder:["id","body","kind"],visitor:["id","body"],aliases:["Flow","FlowDeclaration","Statement","Declaration"],fields:{id:(0,r.validateType)(["Identifier","StringLiteral"]),body:(0,r.validateType)("BlockStatement"),kind:(0,r.validateOptional)((0,r.assertOneOf)("CommonJS","ES"))}}),(0,r.default)("DeclareModuleExports",{visitor:["typeAnnotation"],aliases:["Flow","FlowDeclaration","Statement","Declaration"],fields:{typeAnnotation:(0,r.validateType)("TypeAnnotation")}}),(0,r.default)("DeclareTypeAlias",{visitor:["id","typeParameters","right"],aliases:["Flow","FlowDeclaration","Statement","Declaration"],fields:{id:(0,r.validateType)("Identifier"),typeParameters:(0,r.validateOptionalType)("TypeParameterDeclaration"),right:(0,r.validateType)("FlowType")}}),(0,r.default)("DeclareOpaqueType",{visitor:["id","typeParameters","supertype"],aliases:["Flow","FlowDeclaration","Statement","Declaration"],fields:{id:(0,r.validateType)("Identifier"),typeParameters:(0,r.validateOptionalType)("TypeParameterDeclaration"),supertype:(0,r.validateOptionalType)("FlowType")}}),(0,r.default)("DeclareVariable",{visitor:["id"],aliases:["Flow","FlowDeclaration","Statement","Declaration"],fields:{id:(0,r.validateType)("Identifier")}}),(0,r.default)("DeclareExportDeclaration",{visitor:["declaration","specifiers","source"],aliases:["Flow","FlowDeclaration","Statement","Declaration"],fields:{declaration:(0,r.validateOptionalType)("Flow"),specifiers:(0,r.validateOptional)((0,r.arrayOfType)(["ExportSpecifier","ExportNamespaceSpecifier"])),source:(0,r.validateOptionalType)("StringLiteral"),default:(0,r.validateOptional)((0,r.assertValueType)("boolean"))}}),(0,r.default)("DeclareExportAllDeclaration",{visitor:["source"],aliases:["Flow","FlowDeclaration","Statement","Declaration"],fields:{source:(0,r.validateType)("StringLiteral"),exportKind:(0,r.validateOptional)((0,r.assertOneOf)("type","value"))}}),(0,r.default)("DeclaredPredicate",{visitor:["value"],aliases:["Flow","FlowPredicate"],fields:{value:(0,r.validateType)("Flow")}}),(0,r.default)("ExistsTypeAnnotation",{aliases:["Flow","FlowType"]}),(0,r.default)("FunctionTypeAnnotation",{visitor:["typeParameters","params","rest","returnType"],aliases:["Flow","FlowType"],fields:{typeParameters:(0,r.validateOptionalType)("TypeParameterDeclaration"),params:(0,r.validate)((0,r.arrayOfType)("FunctionTypeParam")),rest:(0,r.validateOptionalType)("FunctionTypeParam"),returnType:(0,r.validateType)("FlowType")}}),(0,r.default)("FunctionTypeParam",{visitor:["name","typeAnnotation"],aliases:["Flow"],fields:{name:(0,r.validateOptionalType)("Identifier"),typeAnnotation:(0,r.validateType)("FlowType"),optional:(0,r.validateOptional)((0,r.assertValueType)("boolean"))}}),(0,r.default)("GenericTypeAnnotation",{visitor:["id","typeParameters"],aliases:["Flow","FlowType"],fields:{id:(0,r.validateType)(["Identifier","QualifiedTypeIdentifier"]),typeParameters:(0,r.validateOptionalType)("TypeParameterInstantiation")}}),(0,r.default)("InferredPredicate",{aliases:["Flow","FlowPredicate"]}),(0,r.default)("InterfaceExtends",{visitor:["id","typeParameters"],aliases:["Flow"],fields:{id:(0,r.validateType)(["Identifier","QualifiedTypeIdentifier"]),typeParameters:(0,r.validateOptionalType)("TypeParameterInstantiation")}}),i("InterfaceDeclaration"),(0,r.default)("InterfaceTypeAnnotation",{visitor:["extends","body"],aliases:["Flow","FlowType"],fields:{extends:(0,r.validateOptional)((0,r.arrayOfType)("InterfaceExtends")),body:(0,r.validateType)("ObjectTypeAnnotation")}}),(0,r.default)("IntersectionTypeAnnotation",{visitor:["types"],aliases:["Flow","FlowType"],fields:{types:(0,r.validate)((0,r.arrayOfType)("FlowType"))}}),(0,r.default)("MixedTypeAnnotation",{aliases:["Flow","FlowType","FlowBaseAnnotation"]}),(0,r.default)("EmptyTypeAnnotation",{aliases:["Flow","FlowType","FlowBaseAnnotation"]}),(0,r.default)("NullableTypeAnnotation",{visitor:["typeAnnotation"],aliases:["Flow","FlowType"],fields:{typeAnnotation:(0,r.validateType)("FlowType")}}),(0,r.default)("NumberLiteralTypeAnnotation",{builder:["value"],aliases:["Flow","FlowType"],fields:{value:(0,r.validate)((0,r.assertValueType)("number"))}}),(0,r.default)("NumberTypeAnnotation",{aliases:["Flow","FlowType","FlowBaseAnnotation"]}),(0,r.default)("ObjectTypeAnnotation",{visitor:["properties","indexers","callProperties","internalSlots"],aliases:["Flow","FlowType"],builder:["properties","indexers","callProperties","internalSlots","exact"],fields:{properties:(0,r.validate)((0,r.arrayOfType)(["ObjectTypeProperty","ObjectTypeSpreadProperty"])),indexers:(0,r.validateOptional)((0,r.arrayOfType)("ObjectTypeIndexer")),callProperties:(0,r.validateOptional)((0,r.arrayOfType)("ObjectTypeCallProperty")),internalSlots:(0,r.validateOptional)((0,r.arrayOfType)("ObjectTypeInternalSlot")),exact:{validate:(0,r.assertValueType)("boolean"),default:!1},inexact:(0,r.validateOptional)((0,r.assertValueType)("boolean"))}}),(0,r.default)("ObjectTypeInternalSlot",{visitor:["id","value","optional","static","method"],aliases:["Flow","UserWhitespacable"],fields:{id:(0,r.validateType)("Identifier"),value:(0,r.validateType)("FlowType"),optional:(0,r.validate)((0,r.assertValueType)("boolean")),static:(0,r.validate)((0,r.assertValueType)("boolean")),method:(0,r.validate)((0,r.assertValueType)("boolean"))}}),(0,r.default)("ObjectTypeCallProperty",{visitor:["value"],aliases:["Flow","UserWhitespacable"],fields:{value:(0,r.validateType)("FlowType"),static:(0,r.validate)((0,r.assertValueType)("boolean"))}}),(0,r.default)("ObjectTypeIndexer",{visitor:["id","key","value","variance"],aliases:["Flow","UserWhitespacable"],fields:{id:(0,r.validateOptionalType)("Identifier"),key:(0,r.validateType)("FlowType"),value:(0,r.validateType)("FlowType"),static:(0,r.validate)((0,r.assertValueType)("boolean")),variance:(0,r.validateOptionalType)("Variance")}}),(0,r.default)("ObjectTypeProperty",{visitor:["key","value","variance"],aliases:["Flow","UserWhitespacable"],fields:{key:(0,r.validateType)(["Identifier","StringLiteral"]),value:(0,r.validateType)("FlowType"),kind:(0,r.validate)((0,r.assertOneOf)("init","get","set")),static:(0,r.validate)((0,r.assertValueType)("boolean")),proto:(0,r.validate)((0,r.assertValueType)("boolean")),optional:(0,r.validate)((0,r.assertValueType)("boolean")),variance:(0,r.validateOptionalType)("Variance")}}),(0,r.default)("ObjectTypeSpreadProperty",{visitor:["argument"],aliases:["Flow","UserWhitespacable"],fields:{argument:(0,r.validateType)("FlowType")}}),(0,r.default)("OpaqueType",{visitor:["id","typeParameters","supertype","impltype"],aliases:["Flow","FlowDeclaration","Statement","Declaration"],fields:{id:(0,r.validateType)("Identifier"),typeParameters:(0,r.validateOptionalType)("TypeParameterDeclaration"),supertype:(0,r.validateOptionalType)("FlowType"),impltype:(0,r.validateType)("FlowType")}}),(0,r.default)("QualifiedTypeIdentifier",{visitor:["id","qualification"],aliases:["Flow"],fields:{id:(0,r.validateType)("Identifier"),qualification:(0,r.validateType)(["Identifier","QualifiedTypeIdentifier"])}}),(0,r.default)("StringLiteralTypeAnnotation",{builder:["value"],aliases:["Flow","FlowType"],fields:{value:(0,r.validate)((0,r.assertValueType)("string"))}}),(0,r.default)("StringTypeAnnotation",{aliases:["Flow","FlowType","FlowBaseAnnotation"]}),(0,r.default)("ThisTypeAnnotation",{aliases:["Flow","FlowType","FlowBaseAnnotation"]}),(0,r.default)("TupleTypeAnnotation",{visitor:["types"],aliases:["Flow","FlowType"],fields:{types:(0,r.validate)((0,r.arrayOfType)("FlowType"))}}),(0,r.default)("TypeofTypeAnnotation",{visitor:["argument"],aliases:["Flow","FlowType"],fields:{argument:(0,r.validateType)("FlowType")}}),(0,r.default)("TypeAlias",{visitor:["id","typeParameters","right"],aliases:["Flow","FlowDeclaration","Statement","Declaration"],fields:{id:(0,r.validateType)("Identifier"),typeParameters:(0,r.validateOptionalType)("TypeParameterDeclaration"),right:(0,r.validateType)("FlowType")}}),(0,r.default)("TypeAnnotation",{aliases:["Flow"],visitor:["typeAnnotation"],fields:{typeAnnotation:(0,r.validateType)("FlowType")}}),(0,r.default)("TypeCastExpression",{visitor:["expression","typeAnnotation"],aliases:["Flow","ExpressionWrapper","Expression"],fields:{expression:(0,r.validateType)("Expression"),typeAnnotation:(0,r.validateType)("TypeAnnotation")}}),(0,r.default)("TypeParameter",{aliases:["Flow"],visitor:["bound","default","variance"],fields:{name:(0,r.validate)((0,r.assertValueType)("string")),bound:(0,r.validateOptionalType)("TypeAnnotation"),default:(0,r.validateOptionalType)("FlowType"),variance:(0,r.validateOptionalType)("Variance")}}),(0,r.default)("TypeParameterDeclaration",{aliases:["Flow"],visitor:["params"],fields:{params:(0,r.validate)((0,r.arrayOfType)("TypeParameter"))}}),(0,r.default)("TypeParameterInstantiation",{aliases:["Flow"],visitor:["params"],fields:{params:(0,r.validate)((0,r.arrayOfType)("FlowType"))}}),(0,r.default)("UnionTypeAnnotation",{visitor:["types"],aliases:["Flow","FlowType"],fields:{types:(0,r.validate)((0,r.arrayOfType)("FlowType"))}}),(0,r.default)("Variance",{aliases:["Flow"],builder:["kind"],fields:{kind:(0,r.validate)((0,r.assertOneOf)("minus","plus"))}}),(0,r.default)("VoidTypeAnnotation",{aliases:["Flow","FlowType","FlowBaseAnnotation"]})},function(e,t,n){"use strict";var r=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var r=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(e,n):{};r.get||r.set?Object.defineProperty(t,n,r):t[n]=e[n]}return t.default=e,t}(n(7));(0,r.default)("JSXAttribute",{visitor:["name","value"],aliases:["JSX","Immutable"],fields:{name:{validate:(0,r.assertNodeType)("JSXIdentifier","JSXNamespacedName")},value:{optional:!0,validate:(0,r.assertNodeType)("JSXElement","JSXFragment","StringLiteral","JSXExpressionContainer")}}}),(0,r.default)("JSXClosingElement",{visitor:["name"],aliases:["JSX","Immutable"],fields:{name:{validate:(0,r.assertNodeType)("JSXIdentifier","JSXMemberExpression")}}}),(0,r.default)("JSXElement",{builder:["openingElement","closingElement","children","selfClosing"],visitor:["openingElement","children","closingElement"],aliases:["JSX","Immutable","Expression"],fields:{openingElement:{validate:(0,r.assertNodeType)("JSXOpeningElement")},closingElement:{optional:!0,validate:(0,r.assertNodeType)("JSXClosingElement")},children:{validate:(0,r.chain)((0,r.assertValueType)("array"),(0,r.assertEach)((0,r.assertNodeType)("JSXText","JSXExpressionContainer","JSXSpreadChild","JSXElement","JSXFragment")))}}}),(0,r.default)("JSXEmptyExpression",{aliases:["JSX"]}),(0,r.default)("JSXExpressionContainer",{visitor:["expression"],aliases:["JSX","Immutable"],fields:{expression:{validate:(0,r.assertNodeType)("Expression","JSXEmptyExpression")}}}),(0,r.default)("JSXSpreadChild",{visitor:["expression"],aliases:["JSX","Immutable"],fields:{expression:{validate:(0,r.assertNodeType)("Expression")}}}),(0,r.default)("JSXIdentifier",{builder:["name"],aliases:["JSX"],fields:{name:{validate:(0,r.assertValueType)("string")}}}),(0,r.default)("JSXMemberExpression",{visitor:["object","property"],aliases:["JSX"],fields:{object:{validate:(0,r.assertNodeType)("JSXMemberExpression","JSXIdentifier")},property:{validate:(0,r.assertNodeType)("JSXIdentifier")}}}),(0,r.default)("JSXNamespacedName",{visitor:["namespace","name"],aliases:["JSX"],fields:{namespace:{validate:(0,r.assertNodeType)("JSXIdentifier")},name:{validate:(0,r.assertNodeType)("JSXIdentifier")}}}),(0,r.default)("JSXOpeningElement",{builder:["name","attributes","selfClosing"],visitor:["name","attributes"],aliases:["JSX","Immutable"],fields:{name:{validate:(0,r.assertNodeType)("JSXIdentifier","JSXMemberExpression")},selfClosing:{default:!1,validate:(0,r.assertValueType)("boolean")},attributes:{validate:(0,r.chain)((0,r.assertValueType)("array"),(0,r.assertEach)((0,r.assertNodeType)("JSXAttribute","JSXSpreadAttribute")))},typeParameters:{validate:(0,r.assertNodeType)("TypeParameterInstantiation","TSTypeParameterInstantiation"),optional:!0}}}),(0,r.default)("JSXSpreadAttribute",{visitor:["argument"],aliases:["JSX"],fields:{argument:{validate:(0,r.assertNodeType)("Expression")}}}),(0,r.default)("JSXText",{aliases:["JSX","Immutable"],builder:["value"],fields:{value:{validate:(0,r.assertValueType)("string")}}}),(0,r.default)("JSXFragment",{builder:["openingFragment","closingFragment","children"],visitor:["openingFragment","children","closingFragment"],aliases:["JSX","Immutable","Expression"],fields:{openingFragment:{validate:(0,r.assertNodeType)("JSXOpeningFragment")},closingFragment:{validate:(0,r.assertNodeType)("JSXClosingFragment")},children:{validate:(0,r.chain)((0,r.assertValueType)("array"),(0,r.assertEach)((0,r.assertNodeType)("JSXText","JSXExpressionContainer","JSXSpreadChild","JSXElement","JSXFragment")))}}}),(0,r.default)("JSXOpeningFragment",{aliases:["JSX","Immutable"]}),(0,r.default)("JSXClosingFragment",{aliases:["JSX","Immutable"]})},function(e,t,n){"use strict";var r=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var r=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(e,n):{};r.get||r.set?Object.defineProperty(t,n,r):t[n]=e[n]}return t.default=e,t}(n(7)),i=n(77);(0,r.default)("Noop",{visitor:[]}),(0,r.default)("Placeholder",{visitor:[],builder:["expectedNode","name"],fields:{name:{validate:(0,r.assertNodeType)("Identifier")},expectedNode:{validate:(0,r.assertOneOf)(...i.PLACEHOLDERS)}}})},function(e,t,n){"use strict";var r=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var r=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(e,n):{};r.get||r.set?Object.defineProperty(t,n,r):t[n]=e[n]}return t.default=e,t}(n(7)),i=n(46);(0,r.default)("ArgumentPlaceholder",{}),(0,r.default)("AwaitExpression",{builder:["argument"],visitor:["argument"],aliases:["Expression","Terminatorless"],fields:{argument:{validate:(0,r.assertNodeType)("Expression")}}}),(0,r.default)("BindExpression",{visitor:["object","callee"],aliases:["Expression"],fields:{}}),(0,r.default)("ClassProperty",{visitor:["key","value","typeAnnotation","decorators"],builder:["key","value","typeAnnotation","decorators","computed"],aliases:["Property"],fields:Object.assign({},i.classMethodOrPropertyCommon,{value:{validate:(0,r.assertNodeType)("Expression"),optional:!0},definite:{validate:(0,r.assertValueType)("boolean"),optional:!0},typeAnnotation:{validate:(0,r.assertNodeType)("TypeAnnotation","TSTypeAnnotation","Noop"),optional:!0},decorators:{validate:(0,r.chain)((0,r.assertValueType)("array"),(0,r.assertEach)((0,r.assertNodeType)("Decorator"))),optional:!0},readonly:{validate:(0,r.assertValueType)("boolean"),optional:!0}})}),(0,r.default)("OptionalMemberExpression",{builder:["object","property","computed","optional"],visitor:["object","property"],aliases:["Expression"],fields:{object:{validate:(0,r.assertNodeType)("Expression")},property:{validate:function(){const e=(0,r.assertNodeType)("Identifier"),t=(0,r.assertNodeType)("Expression");return function(n,r,i){(n.computed?t:e)(n,r,i)}}()},computed:{default:!1},optional:{validate:(0,r.assertValueType)("boolean")}}}),(0,r.default)("PipelineTopicExpression",{builder:["expression"],visitor:["expression"],fields:{expression:{validate:(0,r.assertNodeType)("Expression")}}}),(0,r.default)("PipelineBareFunction",{builder:["callee"],visitor:["callee"],fields:{callee:{validate:(0,r.assertNodeType)("Expression")}}}),(0,r.default)("PipelinePrimaryTopicReference",{aliases:["Expression"]}),(0,r.default)("OptionalCallExpression",{visitor:["callee","arguments","typeParameters","typeArguments"],builder:["callee","arguments","optional"],aliases:["Expression"],fields:{callee:{validate:(0,r.assertNodeType)("Expression")},arguments:{validate:(0,r.chain)((0,r.assertValueType)("array"),(0,r.assertEach)((0,r.assertNodeType)("Expression","SpreadElement","JSXNamespacedName")))},optional:{validate:(0,r.assertValueType)("boolean")},typeArguments:{validate:(0,r.assertNodeType)("TypeParameterInstantiation"),optional:!0},typeParameters:{validate:(0,r.assertNodeType)("TSTypeParameterInstantiation"),optional:!0}}}),(0,r.default)("ClassPrivateProperty",{visitor:["key","value"],builder:["key","value"],aliases:["Property","Private"],fields:{key:{validate:(0,r.assertNodeType)("PrivateName")},value:{validate:(0,r.assertNodeType)("Expression"),optional:!0}}}),(0,r.default)("ClassPrivateMethod",{builder:["kind","key","params","body","static"],visitor:["key","params","body","decorators","returnType","typeParameters"],aliases:["Function","Scopable","BlockParent","FunctionParent","Method","Private"],fields:Object.assign({},i.classMethodOrDeclareMethodCommon,{key:{validate:(0,r.assertNodeType)("PrivateName")},body:{validate:(0,r.assertNodeType)("BlockStatement")}})}),(0,r.default)("Import",{aliases:["Expression"]}),(0,r.default)("Decorator",{visitor:["expression"],fields:{expression:{validate:(0,r.assertNodeType)("Expression")}}}),(0,r.default)("DoExpression",{visitor:["body"],aliases:["Expression"],fields:{body:{validate:(0,r.assertNodeType)("BlockStatement")}}}),(0,r.default)("ExportDefaultSpecifier",{visitor:["exported"],aliases:["ModuleSpecifier"],fields:{exported:{validate:(0,r.assertNodeType)("Identifier")}}}),(0,r.default)("ExportNamespaceSpecifier",{visitor:["exported"],aliases:["ModuleSpecifier"],fields:{exported:{validate:(0,r.assertNodeType)("Identifier")}}}),(0,r.default)("PrivateName",{visitor:["id"],aliases:["Private"],fields:{id:{validate:(0,r.assertNodeType)("Identifier")}}}),(0,r.default)("BigIntLiteral",{builder:["value"],fields:{value:{validate:(0,r.assertValueType)("string")}},aliases:["Expression","Pureish","Literal","Immutable"]})},function(e,t,n){"use strict";var r=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var r=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(e,n):{};r.get||r.set?Object.defineProperty(t,n,r):t[n]=e[n]}return t.default=e,t}(n(7)),i=n(42),s=n(46);const o=(0,r.assertValueType)("boolean"),a={returnType:{validate:(0,r.assertNodeType)("TSTypeAnnotation","Noop"),optional:!0},typeParameters:{validate:(0,r.assertNodeType)("TSTypeParameterDeclaration","Noop"),optional:!0}};(0,r.default)("TSParameterProperty",{aliases:["LVal"],visitor:["parameter"],fields:{accessibility:{validate:(0,r.assertOneOf)("public","private","protected"),optional:!0},readonly:{validate:(0,r.assertValueType)("boolean"),optional:!0},parameter:{validate:(0,r.assertNodeType)("Identifier","AssignmentPattern")}}}),(0,r.default)("TSDeclareFunction",{aliases:["Statement","Declaration"],visitor:["id","typeParameters","params","returnType"],fields:Object.assign({},i.functionDeclarationCommon,a)}),(0,r.default)("TSDeclareMethod",{visitor:["decorators","key","typeParameters","params","returnType"],fields:Object.assign({},s.classMethodOrDeclareMethodCommon,a)}),(0,r.default)("TSQualifiedName",{aliases:["TSEntityName"],visitor:["left","right"],fields:{left:(0,r.validateType)("TSEntityName"),right:(0,r.validateType)("Identifier")}});const u={typeParameters:(0,r.validateOptionalType)("TSTypeParameterDeclaration"),parameters:(0,r.validateArrayOfType)(["Identifier","RestElement"]),typeAnnotation:(0,r.validateOptionalType)("TSTypeAnnotation")},c={aliases:["TSTypeElement"],visitor:["typeParameters","parameters","typeAnnotation"],fields:u};(0,r.default)("TSCallSignatureDeclaration",c),(0,r.default)("TSConstructSignatureDeclaration",c);const l={key:(0,r.validateType)("Expression"),computed:(0,r.validate)(o),optional:(0,r.validateOptional)(o)};(0,r.default)("TSPropertySignature",{aliases:["TSTypeElement"],visitor:["key","typeAnnotation","initializer"],fields:Object.assign({},l,{readonly:(0,r.validateOptional)(o),typeAnnotation:(0,r.validateOptionalType)("TSTypeAnnotation"),initializer:(0,r.validateOptionalType)("Expression")})}),(0,r.default)("TSMethodSignature",{aliases:["TSTypeElement"],visitor:["key","typeParameters","parameters","typeAnnotation"],fields:Object.assign({},u,l)}),(0,r.default)("TSIndexSignature",{aliases:["TSTypeElement"],visitor:["parameters","typeAnnotation"],fields:{readonly:(0,r.validateOptional)(o),parameters:(0,r.validateArrayOfType)("Identifier"),typeAnnotation:(0,r.validateOptionalType)("TSTypeAnnotation")}});const p=["TSAnyKeyword","TSUnknownKeyword","TSNumberKeyword","TSObjectKeyword","TSBooleanKeyword","TSStringKeyword","TSSymbolKeyword","TSVoidKeyword","TSUndefinedKeyword","TSNullKeyword","TSNeverKeyword"];for(const e of p)(0,r.default)(e,{aliases:["TSType"],visitor:[],fields:{}});(0,r.default)("TSThisType",{aliases:["TSType"],visitor:[],fields:{}});const h={aliases:["TSType"],visitor:["typeParameters","parameters","typeAnnotation"],fields:u};(0,r.default)("TSFunctionType",h),(0,r.default)("TSConstructorType",h),(0,r.default)("TSTypeReference",{aliases:["TSType"],visitor:["typeName","typeParameters"],fields:{typeName:(0,r.validateType)("TSEntityName"),typeParameters:(0,r.validateOptionalType)("TSTypeParameterInstantiation")}}),(0,r.default)("TSTypePredicate",{aliases:["TSType"],visitor:["parameterName","typeAnnotation"],fields:{parameterName:(0,r.validateType)(["Identifier","TSThisType"]),typeAnnotation:(0,r.validateType)("TSTypeAnnotation")}}),(0,r.default)("TSTypeQuery",{aliases:["TSType"],visitor:["exprName"],fields:{exprName:(0,r.validateType)(["TSEntityName","TSImportType"])}}),(0,r.default)("TSTypeLiteral",{aliases:["TSType"],visitor:["members"],fields:{members:(0,r.validateArrayOfType)("TSTypeElement")}}),(0,r.default)("TSArrayType",{aliases:["TSType"],visitor:["elementType"],fields:{elementType:(0,r.validateType)("TSType")}}),(0,r.default)("TSTupleType",{aliases:["TSType"],visitor:["elementTypes"],fields:{elementTypes:(0,r.validateArrayOfType)("TSType")}}),(0,r.default)("TSOptionalType",{aliases:["TSType"],visitor:["typeAnnotation"],fields:{typeAnnotation:(0,r.validateType)("TSType")}}),(0,r.default)("TSRestType",{aliases:["TSType"],visitor:["typeAnnotation"],fields:{typeAnnotation:(0,r.validateType)("TSType")}});const f={aliases:["TSType"],visitor:["types"],fields:{types:(0,r.validateArrayOfType)("TSType")}};(0,r.default)("TSUnionType",f),(0,r.default)("TSIntersectionType",f),(0,r.default)("TSConditionalType",{aliases:["TSType"],visitor:["checkType","extendsType","trueType","falseType"],fields:{checkType:(0,r.validateType)("TSType"),extendsType:(0,r.validateType)("TSType"),trueType:(0,r.validateType)("TSType"),falseType:(0,r.validateType)("TSType")}}),(0,r.default)("TSInferType",{aliases:["TSType"],visitor:["typeParameter"],fields:{typeParameter:(0,r.validateType)("TSTypeParameter")}}),(0,r.default)("TSParenthesizedType",{aliases:["TSType"],visitor:["typeAnnotation"],fields:{typeAnnotation:(0,r.validateType)("TSType")}}),(0,r.default)("TSTypeOperator",{aliases:["TSType"],visitor:["typeAnnotation"],fields:{operator:(0,r.validate)((0,r.assertValueType)("string")),typeAnnotation:(0,r.validateType)("TSType")}}),(0,r.default)("TSIndexedAccessType",{aliases:["TSType"],visitor:["objectType","indexType"],fields:{objectType:(0,r.validateType)("TSType"),indexType:(0,r.validateType)("TSType")}}),(0,r.default)("TSMappedType",{aliases:["TSType"],visitor:["typeParameter","typeAnnotation"],fields:{readonly:(0,r.validateOptional)(o),typeParameter:(0,r.validateType)("TSTypeParameter"),optional:(0,r.validateOptional)(o),typeAnnotation:(0,r.validateOptionalType)("TSType")}}),(0,r.default)("TSLiteralType",{aliases:["TSType"],visitor:["literal"],fields:{literal:(0,r.validateType)(["NumericLiteral","StringLiteral","BooleanLiteral"])}}),(0,r.default)("TSExpressionWithTypeArguments",{aliases:["TSType"],visitor:["expression","typeParameters"],fields:{expression:(0,r.validateType)("TSEntityName"),typeParameters:(0,r.validateOptionalType)("TSTypeParameterInstantiation")}}),(0,r.default)("TSInterfaceDeclaration",{aliases:["Statement","Declaration"],visitor:["id","typeParameters","extends","body"],fields:{declare:(0,r.validateOptional)(o),id:(0,r.validateType)("Identifier"),typeParameters:(0,r.validateOptionalType)("TSTypeParameterDeclaration"),extends:(0,r.validateOptional)((0,r.arrayOfType)("TSExpressionWithTypeArguments")),body:(0,r.validateType)("TSInterfaceBody")}}),(0,r.default)("TSInterfaceBody",{visitor:["body"],fields:{body:(0,r.validateArrayOfType)("TSTypeElement")}}),(0,r.default)("TSTypeAliasDeclaration",{aliases:["Statement","Declaration"],visitor:["id","typeParameters","typeAnnotation"],fields:{declare:(0,r.validateOptional)(o),id:(0,r.validateType)("Identifier"),typeParameters:(0,r.validateOptionalType)("TSTypeParameterDeclaration"),typeAnnotation:(0,r.validateType)("TSType")}}),(0,r.default)("TSAsExpression",{aliases:["Expression"],visitor:["expression","typeAnnotation"],fields:{expression:(0,r.validateType)("Expression"),typeAnnotation:(0,r.validateType)("TSType")}}),(0,r.default)("TSTypeAssertion",{aliases:["Expression"],visitor:["typeAnnotation","expression"],fields:{typeAnnotation:(0,r.validateType)("TSType"),expression:(0,r.validateType)("Expression")}}),(0,r.default)("TSEnumDeclaration",{aliases:["Statement","Declaration"],visitor:["id","members"],fields:{declare:(0,r.validateOptional)(o),const:(0,r.validateOptional)(o),id:(0,r.validateType)("Identifier"),members:(0,r.validateArrayOfType)("TSEnumMember"),initializer:(0,r.validateOptionalType)("Expression")}}),(0,r.default)("TSEnumMember",{visitor:["id","initializer"],fields:{id:(0,r.validateType)(["Identifier","StringLiteral"]),initializer:(0,r.validateOptionalType)("Expression")}}),(0,r.default)("TSModuleDeclaration",{aliases:["Statement","Declaration"],visitor:["id","body"],fields:{declare:(0,r.validateOptional)(o),global:(0,r.validateOptional)(o),id:(0,r.validateType)(["Identifier","StringLiteral"]),body:(0,r.validateType)(["TSModuleBlock","TSModuleDeclaration"])}}),(0,r.default)("TSModuleBlock",{aliases:["Scopable","Block","BlockParent"],visitor:["body"],fields:{body:(0,r.validateArrayOfType)("Statement")}}),(0,r.default)("TSImportType",{aliases:["TSType"],visitor:["argument","qualifier","typeParameters"],fields:{argument:(0,r.validateType)("StringLiteral"),qualifier:(0,r.validateOptionalType)("TSEntityName"),typeParameters:(0,r.validateOptionalType)("TSTypeParameterInstantiation")}}),(0,r.default)("TSImportEqualsDeclaration",{aliases:["Statement"],visitor:["id","moduleReference"],fields:{isExport:(0,r.validate)(o),id:(0,r.validateType)("Identifier"),moduleReference:(0,r.validateType)(["TSEntityName","TSExternalModuleReference"])}}),(0,r.default)("TSExternalModuleReference",{visitor:["expression"],fields:{expression:(0,r.validateType)("StringLiteral")}}),(0,r.default)("TSNonNullExpression",{aliases:["Expression"],visitor:["expression"],fields:{expression:(0,r.validateType)("Expression")}}),(0,r.default)("TSExportAssignment",{aliases:["Statement"],visitor:["expression"],fields:{expression:(0,r.validateType)("Expression")}}),(0,r.default)("TSNamespaceExportDeclaration",{aliases:["Statement"],visitor:["id"],fields:{id:(0,r.validateType)("Identifier")}}),(0,r.default)("TSTypeAnnotation",{visitor:["typeAnnotation"],fields:{typeAnnotation:{validate:(0,r.assertNodeType)("TSType")}}}),(0,r.default)("TSTypeParameterInstantiation",{visitor:["params"],fields:{params:{validate:(0,r.chain)((0,r.assertValueType)("array"),(0,r.assertEach)((0,r.assertNodeType)("TSType")))}}}),(0,r.default)("TSTypeParameterDeclaration",{visitor:["params"],fields:{params:{validate:(0,r.chain)((0,r.assertValueType)("array"),(0,r.assertEach)((0,r.assertNodeType)("TSTypeParameter")))}}}),(0,r.default)("TSTypeParameter",{visitor:["constraint","default"],fields:{name:{validate:(0,r.assertValueType)("string")},constraint:{validate:(0,r.assertNodeType)("TSType"),optional:!0},default:{validate:(0,r.assertNodeType)("TSType"),optional:!0}}})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){if(!(0,r.default)(e)){const t=e&&e.type||JSON.stringify(e);throw new TypeError(`Not a valid node of type "${t}"`)}};var r=function(e){return e&&e.__esModule?e:{default:e}}(n(78))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.assertArrayExpression=function(e,t={}){i("ArrayExpression",e,t)},t.assertAssignmentExpression=function(e,t={}){i("AssignmentExpression",e,t)},t.assertBinaryExpression=function(e,t={}){i("BinaryExpression",e,t)},t.assertInterpreterDirective=function(e,t={}){i("InterpreterDirective",e,t)},t.assertDirective=function(e,t={}){i("Directive",e,t)},t.assertDirectiveLiteral=function(e,t={}){i("DirectiveLiteral",e,t)},t.assertBlockStatement=function(e,t={}){i("BlockStatement",e,t)},t.assertBreakStatement=function(e,t={}){i("BreakStatement",e,t)},t.assertCallExpression=function(e,t={}){i("CallExpression",e,t)},t.assertCatchClause=function(e,t={}){i("CatchClause",e,t)},t.assertConditionalExpression=function(e,t={}){i("ConditionalExpression",e,t)},t.assertContinueStatement=function(e,t={}){i("ContinueStatement",e,t)},t.assertDebuggerStatement=function(e,t={}){i("DebuggerStatement",e,t)},t.assertDoWhileStatement=function(e,t={}){i("DoWhileStatement",e,t)},t.assertEmptyStatement=function(e,t={}){i("EmptyStatement",e,t)},t.assertExpressionStatement=function(e,t={}){i("ExpressionStatement",e,t)},t.assertFile=function(e,t={}){i("File",e,t)},t.assertForInStatement=function(e,t={}){i("ForInStatement",e,t)},t.assertForStatement=function(e,t={}){i("ForStatement",e,t)},t.assertFunctionDeclaration=function(e,t={}){i("FunctionDeclaration",e,t)},t.assertFunctionExpression=function(e,t={}){i("FunctionExpression",e,t)},t.assertIdentifier=function(e,t={}){i("Identifier",e,t)},t.assertIfStatement=function(e,t={}){i("IfStatement",e,t)},t.assertLabeledStatement=function(e,t={}){i("LabeledStatement",e,t)},t.assertStringLiteral=function(e,t={}){i("StringLiteral",e,t)},t.assertNumericLiteral=function(e,t={}){i("NumericLiteral",e,t)},t.assertNullLiteral=function(e,t={}){i("NullLiteral",e,t)},t.assertBooleanLiteral=function(e,t={}){i("BooleanLiteral",e,t)},t.assertRegExpLiteral=function(e,t={}){i("RegExpLiteral",e,t)},t.assertLogicalExpression=function(e,t={}){i("LogicalExpression",e,t)},t.assertMemberExpression=function(e,t={}){i("MemberExpression",e,t)},t.assertNewExpression=function(e,t={}){i("NewExpression",e,t)},t.assertProgram=function(e,t={}){i("Program",e,t)},t.assertObjectExpression=function(e,t={}){i("ObjectExpression",e,t)},t.assertObjectMethod=function(e,t={}){i("ObjectMethod",e,t)},t.assertObjectProperty=function(e,t={}){i("ObjectProperty",e,t)},t.assertRestElement=function(e,t={}){i("RestElement",e,t)},t.assertReturnStatement=function(e,t={}){i("ReturnStatement",e,t)},t.assertSequenceExpression=function(e,t={}){i("SequenceExpression",e,t)},t.assertParenthesizedExpression=function(e,t={}){i("ParenthesizedExpression",e,t)},t.assertSwitchCase=function(e,t={}){i("SwitchCase",e,t)},t.assertSwitchStatement=function(e,t={}){i("SwitchStatement",e,t)},t.assertThisExpression=function(e,t={}){i("ThisExpression",e,t)},t.assertThrowStatement=function(e,t={}){i("ThrowStatement",e,t)},t.assertTryStatement=function(e,t={}){i("TryStatement",e,t)},t.assertUnaryExpression=function(e,t={}){i("UnaryExpression",e,t)},t.assertUpdateExpression=function(e,t={}){i("UpdateExpression",e,t)},t.assertVariableDeclaration=function(e,t={}){i("VariableDeclaration",e,t)},t.assertVariableDeclarator=function(e,t={}){i("VariableDeclarator",e,t)},t.assertWhileStatement=function(e,t={}){i("WhileStatement",e,t)},t.assertWithStatement=function(e,t={}){i("WithStatement",e,t)},t.assertAssignmentPattern=function(e,t={}){i("AssignmentPattern",e,t)},t.assertArrayPattern=function(e,t={}){i("ArrayPattern",e,t)},t.assertArrowFunctionExpression=function(e,t={}){i("ArrowFunctionExpression",e,t)},t.assertClassBody=function(e,t={}){i("ClassBody",e,t)},t.assertClassDeclaration=function(e,t={}){i("ClassDeclaration",e,t)},t.assertClassExpression=function(e,t={}){i("ClassExpression",e,t)},t.assertExportAllDeclaration=function(e,t={}){i("ExportAllDeclaration",e,t)},t.assertExportDefaultDeclaration=function(e,t={}){i("ExportDefaultDeclaration",e,t)},t.assertExportNamedDeclaration=function(e,t={}){i("ExportNamedDeclaration",e,t)},t.assertExportSpecifier=function(e,t={}){i("ExportSpecifier",e,t)},t.assertForOfStatement=function(e,t={}){i("ForOfStatement",e,t)},t.assertImportDeclaration=function(e,t={}){i("ImportDeclaration",e,t)},t.assertImportDefaultSpecifier=function(e,t={}){i("ImportDefaultSpecifier",e,t)},t.assertImportNamespaceSpecifier=function(e,t={}){i("ImportNamespaceSpecifier",e,t)},t.assertImportSpecifier=function(e,t={}){i("ImportSpecifier",e,t)},t.assertMetaProperty=function(e,t={}){i("MetaProperty",e,t)},t.assertClassMethod=function(e,t={}){i("ClassMethod",e,t)},t.assertObjectPattern=function(e,t={}){i("ObjectPattern",e,t)},t.assertSpreadElement=function(e,t={}){i("SpreadElement",e,t)},t.assertSuper=function(e,t={}){i("Super",e,t)},t.assertTaggedTemplateExpression=function(e,t={}){i("TaggedTemplateExpression",e,t)},t.assertTemplateElement=function(e,t={}){i("TemplateElement",e,t)},t.assertTemplateLiteral=function(e,t={}){i("TemplateLiteral",e,t)},t.assertYieldExpression=function(e,t={}){i("YieldExpression",e,t)},t.assertAnyTypeAnnotation=function(e,t={}){i("AnyTypeAnnotation",e,t)},t.assertArrayTypeAnnotation=function(e,t={}){i("ArrayTypeAnnotation",e,t)},t.assertBooleanTypeAnnotation=function(e,t={}){i("BooleanTypeAnnotation",e,t)},t.assertBooleanLiteralTypeAnnotation=function(e,t={}){i("BooleanLiteralTypeAnnotation",e,t)},t.assertNullLiteralTypeAnnotation=function(e,t={}){i("NullLiteralTypeAnnotation",e,t)},t.assertClassImplements=function(e,t={}){i("ClassImplements",e,t)},t.assertDeclareClass=function(e,t={}){i("DeclareClass",e,t)},t.assertDeclareFunction=function(e,t={}){i("DeclareFunction",e,t)},t.assertDeclareInterface=function(e,t={}){i("DeclareInterface",e,t)},t.assertDeclareModule=function(e,t={}){i("DeclareModule",e,t)},t.assertDeclareModuleExports=function(e,t={}){i("DeclareModuleExports",e,t)},t.assertDeclareTypeAlias=function(e,t={}){i("DeclareTypeAlias",e,t)},t.assertDeclareOpaqueType=function(e,t={}){i("DeclareOpaqueType",e,t)},t.assertDeclareVariable=function(e,t={}){i("DeclareVariable",e,t)},t.assertDeclareExportDeclaration=function(e,t={}){i("DeclareExportDeclaration",e,t)},t.assertDeclareExportAllDeclaration=function(e,t={}){i("DeclareExportAllDeclaration",e,t)},t.assertDeclaredPredicate=function(e,t={}){i("DeclaredPredicate",e,t)},t.assertExistsTypeAnnotation=function(e,t={}){i("ExistsTypeAnnotation",e,t)},t.assertFunctionTypeAnnotation=function(e,t={}){i("FunctionTypeAnnotation",e,t)},t.assertFunctionTypeParam=function(e,t={}){i("FunctionTypeParam",e,t)},t.assertGenericTypeAnnotation=function(e,t={}){i("GenericTypeAnnotation",e,t)},t.assertInferredPredicate=function(e,t={}){i("InferredPredicate",e,t)},t.assertInterfaceExtends=function(e,t={}){i("InterfaceExtends",e,t)},t.assertInterfaceDeclaration=function(e,t={}){i("InterfaceDeclaration",e,t)},t.assertInterfaceTypeAnnotation=function(e,t={}){i("InterfaceTypeAnnotation",e,t)},t.assertIntersectionTypeAnnotation=function(e,t={}){i("IntersectionTypeAnnotation",e,t)},t.assertMixedTypeAnnotation=function(e,t={}){i("MixedTypeAnnotation",e,t)},t.assertEmptyTypeAnnotation=function(e,t={}){i("EmptyTypeAnnotation",e,t)},t.assertNullableTypeAnnotation=function(e,t={}){i("NullableTypeAnnotation",e,t)},t.assertNumberLiteralTypeAnnotation=function(e,t={}){i("NumberLiteralTypeAnnotation",e,t)},t.assertNumberTypeAnnotation=function(e,t={}){i("NumberTypeAnnotation",e,t)},t.assertObjectTypeAnnotation=function(e,t={}){i("ObjectTypeAnnotation",e,t)},t.assertObjectTypeInternalSlot=function(e,t={}){i("ObjectTypeInternalSlot",e,t)},t.assertObjectTypeCallProperty=function(e,t={}){i("ObjectTypeCallProperty",e,t)},t.assertObjectTypeIndexer=function(e,t={}){i("ObjectTypeIndexer",e,t)},t.assertObjectTypeProperty=function(e,t={}){i("ObjectTypeProperty",e,t)},t.assertObjectTypeSpreadProperty=function(e,t={}){i("ObjectTypeSpreadProperty",e,t)},t.assertOpaqueType=function(e,t={}){i("OpaqueType",e,t)},t.assertQualifiedTypeIdentifier=function(e,t={}){i("QualifiedTypeIdentifier",e,t)},t.assertStringLiteralTypeAnnotation=function(e,t={}){i("StringLiteralTypeAnnotation",e,t)},t.assertStringTypeAnnotation=function(e,t={}){i("StringTypeAnnotation",e,t)},t.assertThisTypeAnnotation=function(e,t={}){i("ThisTypeAnnotation",e,t)},t.assertTupleTypeAnnotation=function(e,t={}){i("TupleTypeAnnotation",e,t)},t.assertTypeofTypeAnnotation=function(e,t={}){i("TypeofTypeAnnotation",e,t)},t.assertTypeAlias=function(e,t={}){i("TypeAlias",e,t)},t.assertTypeAnnotation=function(e,t={}){i("TypeAnnotation",e,t)},t.assertTypeCastExpression=function(e,t={}){i("TypeCastExpression",e,t)},t.assertTypeParameter=function(e,t={}){i("TypeParameter",e,t)},t.assertTypeParameterDeclaration=function(e,t={}){i("TypeParameterDeclaration",e,t)},t.assertTypeParameterInstantiation=function(e,t={}){i("TypeParameterInstantiation",e,t)},t.assertUnionTypeAnnotation=function(e,t={}){i("UnionTypeAnnotation",e,t)},t.assertVariance=function(e,t={}){i("Variance",e,t)},t.assertVoidTypeAnnotation=function(e,t={}){i("VoidTypeAnnotation",e,t)},t.assertJSXAttribute=function(e,t={}){i("JSXAttribute",e,t)},t.assertJSXClosingElement=function(e,t={}){i("JSXClosingElement",e,t)},t.assertJSXElement=function(e,t={}){i("JSXElement",e,t)},t.assertJSXEmptyExpression=function(e,t={}){i("JSXEmptyExpression",e,t)},t.assertJSXExpressionContainer=function(e,t={}){i("JSXExpressionContainer",e,t)},t.assertJSXSpreadChild=function(e,t={}){i("JSXSpreadChild",e,t)},t.assertJSXIdentifier=function(e,t={}){i("JSXIdentifier",e,t)},t.assertJSXMemberExpression=function(e,t={}){i("JSXMemberExpression",e,t)},t.assertJSXNamespacedName=function(e,t={}){i("JSXNamespacedName",e,t)},t.assertJSXOpeningElement=function(e,t={}){i("JSXOpeningElement",e,t)},t.assertJSXSpreadAttribute=function(e,t={}){i("JSXSpreadAttribute",e,t)},t.assertJSXText=function(e,t={}){i("JSXText",e,t)},t.assertJSXFragment=function(e,t={}){i("JSXFragment",e,t)},t.assertJSXOpeningFragment=function(e,t={}){i("JSXOpeningFragment",e,t)},t.assertJSXClosingFragment=function(e,t={}){i("JSXClosingFragment",e,t)},t.assertNoop=function(e,t={}){i("Noop",e,t)},t.assertPlaceholder=function(e,t={}){i("Placeholder",e,t)},t.assertArgumentPlaceholder=function(e,t={}){i("ArgumentPlaceholder",e,t)},t.assertAwaitExpression=function(e,t={}){i("AwaitExpression",e,t)},t.assertBindExpression=function(e,t={}){i("BindExpression",e,t)},t.assertClassProperty=function(e,t={}){i("ClassProperty",e,t)},t.assertOptionalMemberExpression=function(e,t={}){i("OptionalMemberExpression",e,t)},t.assertPipelineTopicExpression=function(e,t={}){i("PipelineTopicExpression",e,t)},t.assertPipelineBareFunction=function(e,t={}){i("PipelineBareFunction",e,t)},t.assertPipelinePrimaryTopicReference=function(e,t={}){i("PipelinePrimaryTopicReference",e,t)},t.assertOptionalCallExpression=function(e,t={}){i("OptionalCallExpression",e,t)},t.assertClassPrivateProperty=function(e,t={}){i("ClassPrivateProperty",e,t)},t.assertClassPrivateMethod=function(e,t={}){i("ClassPrivateMethod",e,t)},t.assertImport=function(e,t={}){i("Import",e,t)},t.assertDecorator=function(e,t={}){i("Decorator",e,t)},t.assertDoExpression=function(e,t={}){i("DoExpression",e,t)},t.assertExportDefaultSpecifier=function(e,t={}){i("ExportDefaultSpecifier",e,t)},t.assertExportNamespaceSpecifier=function(e,t={}){i("ExportNamespaceSpecifier",e,t)},t.assertPrivateName=function(e,t={}){i("PrivateName",e,t)},t.assertBigIntLiteral=function(e,t={}){i("BigIntLiteral",e,t)},t.assertTSParameterProperty=function(e,t={}){i("TSParameterProperty",e,t)},t.assertTSDeclareFunction=function(e,t={}){i("TSDeclareFunction",e,t)},t.assertTSDeclareMethod=function(e,t={}){i("TSDeclareMethod",e,t)},t.assertTSQualifiedName=function(e,t={}){i("TSQualifiedName",e,t)},t.assertTSCallSignatureDeclaration=function(e,t={}){i("TSCallSignatureDeclaration",e,t)},t.assertTSConstructSignatureDeclaration=function(e,t={}){i("TSConstructSignatureDeclaration",e,t)},t.assertTSPropertySignature=function(e,t={}){i("TSPropertySignature",e,t)},t.assertTSMethodSignature=function(e,t={}){i("TSMethodSignature",e,t)},t.assertTSIndexSignature=function(e,t={}){i("TSIndexSignature",e,t)},t.assertTSAnyKeyword=function(e,t={}){i("TSAnyKeyword",e,t)},t.assertTSUnknownKeyword=function(e,t={}){i("TSUnknownKeyword",e,t)},t.assertTSNumberKeyword=function(e,t={}){i("TSNumberKeyword",e,t)},t.assertTSObjectKeyword=function(e,t={}){i("TSObjectKeyword",e,t)},t.assertTSBooleanKeyword=function(e,t={}){i("TSBooleanKeyword",e,t)},t.assertTSStringKeyword=function(e,t={}){i("TSStringKeyword",e,t)},t.assertTSSymbolKeyword=function(e,t={}){i("TSSymbolKeyword",e,t)},t.assertTSVoidKeyword=function(e,t={}){i("TSVoidKeyword",e,t)},t.assertTSUndefinedKeyword=function(e,t={}){i("TSUndefinedKeyword",e,t)},t.assertTSNullKeyword=function(e,t={}){i("TSNullKeyword",e,t)},t.assertTSNeverKeyword=function(e,t={}){i("TSNeverKeyword",e,t)},t.assertTSThisType=function(e,t={}){i("TSThisType",e,t)},t.assertTSFunctionType=function(e,t={}){i("TSFunctionType",e,t)},t.assertTSConstructorType=function(e,t={}){i("TSConstructorType",e,t)},t.assertTSTypeReference=function(e,t={}){i("TSTypeReference",e,t)},t.assertTSTypePredicate=function(e,t={}){i("TSTypePredicate",e,t)},t.assertTSTypeQuery=function(e,t={}){i("TSTypeQuery",e,t)},t.assertTSTypeLiteral=function(e,t={}){i("TSTypeLiteral",e,t)},t.assertTSArrayType=function(e,t={}){i("TSArrayType",e,t)},t.assertTSTupleType=function(e,t={}){i("TSTupleType",e,t)},t.assertTSOptionalType=function(e,t={}){i("TSOptionalType",e,t)},t.assertTSRestType=function(e,t={}){i("TSRestType",e,t)},t.assertTSUnionType=function(e,t={}){i("TSUnionType",e,t)},t.assertTSIntersectionType=function(e,t={}){i("TSIntersectionType",e,t)},t.assertTSConditionalType=function(e,t={}){i("TSConditionalType",e,t)},t.assertTSInferType=function(e,t={}){i("TSInferType",e,t)},t.assertTSParenthesizedType=function(e,t={}){i("TSParenthesizedType",e,t)},t.assertTSTypeOperator=function(e,t={}){i("TSTypeOperator",e,t)},t.assertTSIndexedAccessType=function(e,t={}){i("TSIndexedAccessType",e,t)},t.assertTSMappedType=function(e,t={}){i("TSMappedType",e,t)},t.assertTSLiteralType=function(e,t={}){i("TSLiteralType",e,t)},t.assertTSExpressionWithTypeArguments=function(e,t={}){i("TSExpressionWithTypeArguments",e,t)},t.assertTSInterfaceDeclaration=function(e,t={}){i("TSInterfaceDeclaration",e,t)},t.assertTSInterfaceBody=function(e,t={}){i("TSInterfaceBody",e,t)},t.assertTSTypeAliasDeclaration=function(e,t={}){i("TSTypeAliasDeclaration",e,t)},t.assertTSAsExpression=function(e,t={}){i("TSAsExpression",e,t)},t.assertTSTypeAssertion=function(e,t={}){i("TSTypeAssertion",e,t)},t.assertTSEnumDeclaration=function(e,t={}){i("TSEnumDeclaration",e,t)},t.assertTSEnumMember=function(e,t={}){i("TSEnumMember",e,t)},t.assertTSModuleDeclaration=function(e,t={}){i("TSModuleDeclaration",e,t)},t.assertTSModuleBlock=function(e,t={}){i("TSModuleBlock",e,t)},t.assertTSImportType=function(e,t={}){i("TSImportType",e,t)},t.assertTSImportEqualsDeclaration=function(e,t={}){i("TSImportEqualsDeclaration",e,t)},t.assertTSExternalModuleReference=function(e,t={}){i("TSExternalModuleReference",e,t)},t.assertTSNonNullExpression=function(e,t={}){i("TSNonNullExpression",e,t)},t.assertTSExportAssignment=function(e,t={}){i("TSExportAssignment",e,t)},t.assertTSNamespaceExportDeclaration=function(e,t={}){i("TSNamespaceExportDeclaration",e,t)},t.assertTSTypeAnnotation=function(e,t={}){i("TSTypeAnnotation",e,t)},t.assertTSTypeParameterInstantiation=function(e,t={}){i("TSTypeParameterInstantiation",e,t)},t.assertTSTypeParameterDeclaration=function(e,t={}){i("TSTypeParameterDeclaration",e,t)},t.assertTSTypeParameter=function(e,t={}){i("TSTypeParameter",e,t)},t.assertExpression=function(e,t={}){i("Expression",e,t)},t.assertBinary=function(e,t={}){i("Binary",e,t)},t.assertScopable=function(e,t={}){i("Scopable",e,t)},t.assertBlockParent=function(e,t={}){i("BlockParent",e,t)},t.assertBlock=function(e,t={}){i("Block",e,t)},t.assertStatement=function(e,t={}){i("Statement",e,t)},t.assertTerminatorless=function(e,t={}){i("Terminatorless",e,t)},t.assertCompletionStatement=function(e,t={}){i("CompletionStatement",e,t)},t.assertConditional=function(e,t={}){i("Conditional",e,t)},t.assertLoop=function(e,t={}){i("Loop",e,t)},t.assertWhile=function(e,t={}){i("While",e,t)},t.assertExpressionWrapper=function(e,t={}){i("ExpressionWrapper",e,t)},t.assertFor=function(e,t={}){i("For",e,t)},t.assertForXStatement=function(e,t={}){i("ForXStatement",e,t)},t.assertFunction=function(e,t={}){i("Function",e,t)},t.assertFunctionParent=function(e,t={}){i("FunctionParent",e,t)},t.assertPureish=function(e,t={}){i("Pureish",e,t)},t.assertDeclaration=function(e,t={}){i("Declaration",e,t)},t.assertPatternLike=function(e,t={}){i("PatternLike",e,t)},t.assertLVal=function(e,t={}){i("LVal",e,t)},t.assertTSEntityName=function(e,t={}){i("TSEntityName",e,t)},t.assertLiteral=function(e,t={}){i("Literal",e,t)},t.assertImmutable=function(e,t={}){i("Immutable",e,t)},t.assertUserWhitespacable=function(e,t={}){i("UserWhitespacable",e,t)},t.assertMethod=function(e,t={}){i("Method",e,t)},t.assertObjectMember=function(e,t={}){i("ObjectMember",e,t)},t.assertProperty=function(e,t={}){i("Property",e,t)},t.assertUnaryLike=function(e,t={}){i("UnaryLike",e,t)},t.assertPattern=function(e,t={}){i("Pattern",e,t)},t.assertClass=function(e,t={}){i("Class",e,t)},t.assertModuleDeclaration=function(e,t={}){i("ModuleDeclaration",e,t)},t.assertExportDeclaration=function(e,t={}){i("ExportDeclaration",e,t)},t.assertModuleSpecifier=function(e,t={}){i("ModuleSpecifier",e,t)},t.assertFlow=function(e,t={}){i("Flow",e,t)},t.assertFlowType=function(e,t={}){i("FlowType",e,t)},t.assertFlowBaseAnnotation=function(e,t={}){i("FlowBaseAnnotation",e,t)},t.assertFlowDeclaration=function(e,t={}){i("FlowDeclaration",e,t)},t.assertFlowPredicate=function(e,t={}){i("FlowPredicate",e,t)},t.assertJSX=function(e,t={}){i("JSX",e,t)},t.assertPrivate=function(e,t={}){i("Private",e,t)},t.assertTSTypeElement=function(e,t={}){i("TSTypeElement",e,t)},t.assertTSType=function(e,t={}){i("TSType",e,t)},t.assertNumberLiteral=function(e,t){console.trace("The node type NumberLiteral has been renamed to NumericLiteral"),i("NumberLiteral",e,t)},t.assertRegexLiteral=function(e,t){console.trace("The node type RegexLiteral has been renamed to RegExpLiteral"),i("RegexLiteral",e,t)},t.assertRestProperty=function(e,t){console.trace("The node type RestProperty has been renamed to RestElement"),i("RestProperty",e,t)},t.assertSpreadProperty=function(e,t){console.trace("The node type SpreadProperty has been renamed to SpreadElement"),i("SpreadProperty",e,t)};var r=function(e){return e&&e.__esModule?e:{default:e}}(n(43));function i(e,t,n){if(!(0,r.default)(e,t,n))throw new Error(`Expected type "${e}" with option ${JSON.stringify(n)}, but instead got "${t.type}".`)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){if("string"===e)return(0,r.stringTypeAnnotation)();if("number"===e)return(0,r.numberTypeAnnotation)();if("undefined"===e)return(0,r.voidTypeAnnotation)();if("boolean"===e)return(0,r.booleanTypeAnnotation)();if("function"===e)return(0,r.genericTypeAnnotation)((0,r.identifier)("Function"));if("object"===e)return(0,r.genericTypeAnnotation)((0,r.identifier)("Object"));if("symbol"===e)return(0,r.genericTypeAnnotation)((0,r.identifier)("Symbol"));throw new Error("Invalid typeof value")};var r=n(4)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){const t=(0,i.default)(e);return 1===t.length?t[0]:(0,r.unionTypeAnnotation)(t)};var r=n(4),i=function(e){return e&&e.__esModule?e:{default:e}}(n(79))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return(0,r.default)(e)};var r=function(e){return e&&e.__esModule?e:{default:e}}(n(16))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){const t=(0,r.default)(e);return t.loc=null,t};var r=function(e){return e&&e.__esModule?e:{default:e}}(n(80))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n,i){return(0,r.default)(e,t,[{type:i?"CommentLine":"CommentBlock",value:n}])};var r=function(e){return e&&e.__esModule?e:{default:e}}(n(81))},function(e,t,n){var r=n(203);e.exports=function(e){return e&&e.length?r(e):[]}},function(e,t,n){var r=n(204),i=n(207),s=n(211),o=n(212),a=n(213),u=n(84),c=200;e.exports=function(e,t,n){var l=-1,p=i,h=e.length,f=!0,d=[],y=d;if(n)f=!1,p=s;else if(h>=c){var m=t?null:a(e);if(m)return u(m);f=!1,p=o,y=new r}else y=t?[]:d;e:for(;++l-1}},function(e,t){e.exports=function(e,t,n,r){for(var i=e.length,s=n+(r?1:-1);r?s--:++s{e[t]=null}),e};var r=n(11)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TSTYPE_TYPES=t.TSTYPEELEMENT_TYPES=t.PRIVATE_TYPES=t.JSX_TYPES=t.FLOWPREDICATE_TYPES=t.FLOWDECLARATION_TYPES=t.FLOWBASEANNOTATION_TYPES=t.FLOWTYPE_TYPES=t.FLOW_TYPES=t.MODULESPECIFIER_TYPES=t.EXPORTDECLARATION_TYPES=t.MODULEDECLARATION_TYPES=t.CLASS_TYPES=t.PATTERN_TYPES=t.UNARYLIKE_TYPES=t.PROPERTY_TYPES=t.OBJECTMEMBER_TYPES=t.METHOD_TYPES=t.USERWHITESPACABLE_TYPES=t.IMMUTABLE_TYPES=t.LITERAL_TYPES=t.TSENTITYNAME_TYPES=t.LVAL_TYPES=t.PATTERNLIKE_TYPES=t.DECLARATION_TYPES=t.PUREISH_TYPES=t.FUNCTIONPARENT_TYPES=t.FUNCTION_TYPES=t.FORXSTATEMENT_TYPES=t.FOR_TYPES=t.EXPRESSIONWRAPPER_TYPES=t.WHILE_TYPES=t.LOOP_TYPES=t.CONDITIONAL_TYPES=t.COMPLETIONSTATEMENT_TYPES=t.TERMINATORLESS_TYPES=t.STATEMENT_TYPES=t.BLOCK_TYPES=t.BLOCKPARENT_TYPES=t.SCOPABLE_TYPES=t.BINARY_TYPES=t.EXPRESSION_TYPES=void 0;var r=n(3);const i=r.FLIPPED_ALIAS_KEYS.Expression;t.EXPRESSION_TYPES=i;const s=r.FLIPPED_ALIAS_KEYS.Binary;t.BINARY_TYPES=s;const o=r.FLIPPED_ALIAS_KEYS.Scopable;t.SCOPABLE_TYPES=o;const a=r.FLIPPED_ALIAS_KEYS.BlockParent;t.BLOCKPARENT_TYPES=a;const u=r.FLIPPED_ALIAS_KEYS.Block;t.BLOCK_TYPES=u;const c=r.FLIPPED_ALIAS_KEYS.Statement;t.STATEMENT_TYPES=c;const l=r.FLIPPED_ALIAS_KEYS.Terminatorless;t.TERMINATORLESS_TYPES=l;const p=r.FLIPPED_ALIAS_KEYS.CompletionStatement;t.COMPLETIONSTATEMENT_TYPES=p;const h=r.FLIPPED_ALIAS_KEYS.Conditional;t.CONDITIONAL_TYPES=h;const f=r.FLIPPED_ALIAS_KEYS.Loop;t.LOOP_TYPES=f;const d=r.FLIPPED_ALIAS_KEYS.While;t.WHILE_TYPES=d;const y=r.FLIPPED_ALIAS_KEYS.ExpressionWrapper;t.EXPRESSIONWRAPPER_TYPES=y;const m=r.FLIPPED_ALIAS_KEYS.For;t.FOR_TYPES=m;const g=r.FLIPPED_ALIAS_KEYS.ForXStatement;t.FORXSTATEMENT_TYPES=g;const E=r.FLIPPED_ALIAS_KEYS.Function;t.FUNCTION_TYPES=E;const T=r.FLIPPED_ALIAS_KEYS.FunctionParent;t.FUNCTIONPARENT_TYPES=T;const A=r.FLIPPED_ALIAS_KEYS.Pureish;t.PUREISH_TYPES=A;const S=r.FLIPPED_ALIAS_KEYS.Declaration;t.DECLARATION_TYPES=S;const b=r.FLIPPED_ALIAS_KEYS.PatternLike;t.PATTERNLIKE_TYPES=b;const x=r.FLIPPED_ALIAS_KEYS.LVal;t.LVAL_TYPES=x;const P=r.FLIPPED_ALIAS_KEYS.TSEntityName;t.TSENTITYNAME_TYPES=P;const v=r.FLIPPED_ALIAS_KEYS.Literal;t.LITERAL_TYPES=v;const D=r.FLIPPED_ALIAS_KEYS.Immutable;t.IMMUTABLE_TYPES=D;const C=r.FLIPPED_ALIAS_KEYS.UserWhitespacable;t.USERWHITESPACABLE_TYPES=C;const O=r.FLIPPED_ALIAS_KEYS.Method;t.METHOD_TYPES=O;const w=r.FLIPPED_ALIAS_KEYS.ObjectMember;t.OBJECTMEMBER_TYPES=w;const F=r.FLIPPED_ALIAS_KEYS.Property;t.PROPERTY_TYPES=F;const _=r.FLIPPED_ALIAS_KEYS.UnaryLike;t.UNARYLIKE_TYPES=_;const N=r.FLIPPED_ALIAS_KEYS.Pattern;t.PATTERN_TYPES=N;const I=r.FLIPPED_ALIAS_KEYS.Class;t.CLASS_TYPES=I;const k=r.FLIPPED_ALIAS_KEYS.ModuleDeclaration;t.MODULEDECLARATION_TYPES=k;const B=r.FLIPPED_ALIAS_KEYS.ExportDeclaration;t.EXPORTDECLARATION_TYPES=B;const L=r.FLIPPED_ALIAS_KEYS.ModuleSpecifier;t.MODULESPECIFIER_TYPES=L;const M=r.FLIPPED_ALIAS_KEYS.Flow;t.FLOW_TYPES=M;const j=r.FLIPPED_ALIAS_KEYS.FlowType;t.FLOWTYPE_TYPES=j;const R=r.FLIPPED_ALIAS_KEYS.FlowBaseAnnotation;t.FLOWBASEANNOTATION_TYPES=R;const U=r.FLIPPED_ALIAS_KEYS.FlowDeclaration;t.FLOWDECLARATION_TYPES=U;const V=r.FLIPPED_ALIAS_KEYS.FlowPredicate;t.FLOWPREDICATE_TYPES=V;const X=r.FLIPPED_ALIAS_KEYS.JSX;t.JSX_TYPES=X;const W=r.FLIPPED_ALIAS_KEYS.Private;t.PRIVATE_TYPES=W;const Y=r.FLIPPED_ALIAS_KEYS.TSTypeElement;t.TSTYPEELEMENT_TYPES=Y;const K=r.FLIPPED_ALIAS_KEYS.TSType;t.TSTYPE_TYPES=K},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t="body"){return e[t]=(0,r.default)(e[t],e)};var r=function(e){return e&&e.__esModule?e:{default:e}}(n(88))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){"eval"!==(e=(0,r.default)(e))&&"arguments"!==e||(e="_"+e);return e};var r=function(e){return e&&e.__esModule?e:{default:e}}(n(89))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t=e.key||e.property){!e.computed&&(0,r.isIdentifier)(t)&&(t=(0,i.stringLiteral)(t.name));return t};var r=n(2),i=n(4)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){(0,r.isExpressionStatement)(e)&&(e=e.expression);if((0,r.isExpression)(e))return e;(0,r.isClass)(e)?e.type="ClassExpression":(0,r.isFunction)(e)&&(e.type="FunctionExpression");if(!(0,r.isExpression)(e))throw new Error(`cannot turn ${e.type} to an expression`);return e};var r=n(2)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=a;var r=n(2),i=o(n(16)),s=o(n(90));function o(e){return e&&e.__esModule?e:{default:e}}function a(e,t=e.key){let n;return"method"===e.kind?a.increment()+"":(n=(0,r.isIdentifier)(t)?t.name:(0,r.isStringLiteral)(t)?JSON.stringify(t.value):JSON.stringify((0,s.default)((0,i.default)(t))),e.computed&&(n=`[${n}]`),e.static&&(n=`static:${n}`),n)}a.uid=0,a.increment=function(){return a.uid>=Number.MAX_SAFE_INTEGER?a.uid=0:a.uid++}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if(!e||!e.length)return;const n=[],i=(0,r.default)(e,t,n);if(!i)return;for(const e of n)t.push(e);return i};var r=function(e){return e&&e.__esModule?e:{default:e}}(n(223))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function e(t,n,a){const u=[];let c=!0;for(const l of t)if(c=!1,(0,i.isExpression)(l))u.push(l);else if((0,i.isExpressionStatement)(l))u.push(l.expression);else if((0,i.isVariableDeclaration)(l)){if("var"!==l.kind)return;for(const e of l.declarations){const t=(0,r.default)(e);for(const e of Object.keys(t))a.push({kind:l.kind,id:(0,o.default)(t[e])});e.init&&u.push((0,s.assignmentExpression)("=",e.id,e.init))}c=!0}else if((0,i.isIfStatement)(l)){const t=l.consequent?e([l.consequent],n,a):n.buildUndefinedNode(),r=l.alternate?e([l.alternate],n,a):n.buildUndefinedNode();if(!t||!r)return;u.push((0,s.conditionalExpression)(l.test,t,r))}else if((0,i.isBlockStatement)(l)){const t=e(l.body,n,a);if(!t)return;u.push(t)}else{if(!(0,i.isEmptyStatement)(l))return;c=!0}c&&u.push(n.buildUndefinedNode());return 1===u.length?u[0]:(0,s.sequenceExpression)(u)};var r=a(n(30)),i=n(2),s=n(4),o=a(n(16));function a(e){return e&&e.__esModule?e:{default:e}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if((0,r.isStatement)(e))return e;let n,s=!1;if((0,r.isClass)(e))s=!0,n="ClassDeclaration";else if((0,r.isFunction)(e))s=!0,n="FunctionDeclaration";else if((0,r.isAssignmentExpression)(e))return(0,i.expressionStatement)(e);s&&!e.id&&(n=!1);if(!n){if(t)return!1;throw new Error(`cannot turn ${e.type} to a statement`)}return e.type=n,e};var r=n(2),i=n(4)},function(e,t,n){"use strict";function r(){const e=a(n(226));return r=function(){return e},e}function i(){const e=a(n(227));return i=function(){return e},e}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function e(t){if(void 0===t)return(0,o.identifier)("undefined");if(!0===t||!1===t)return(0,o.booleanLiteral)(t);if(null===t)return(0,o.nullLiteral)();if("string"==typeof t)return(0,o.stringLiteral)(t);if("number"==typeof t){let e;if(Number.isFinite(t))e=(0,o.numericLiteral)(Math.abs(t));else{let n;n=Number.isNaN(t)?(0,o.numericLiteral)(0):(0,o.numericLiteral)(1),e=(0,o.binaryExpression)("/",n,(0,o.numericLiteral)(0))}return(t<0||Object.is(t,-0))&&(e=(0,o.unaryExpression)("-",e)),e}if((0,i().default)(t)){const e=t.source,n=t.toString().match(/\/([a-z]+|)$/)[1];return(0,o.regExpLiteral)(e,n)}if(Array.isArray(t))return(0,o.arrayExpression)(t.map(e));if((0,r().default)(t)){const n=[];for(const r of Object.keys(t)){let i;i=(0,s.default)(r)?(0,o.identifier)(r):(0,o.stringLiteral)(r),n.push((0,o.objectProperty)(i,e(t[r])))}return(0,o.objectExpression)(n)}throw new Error("don't know how to turn this value into a node")};var s=a(n(15)),o=n(4);function a(e){return e&&e.__esModule?e:{default:e}}},function(e,t,n){var r=n(8),i=n(39),s=n(6),o="[object Object]",a=Function.prototype,u=Object.prototype,c=a.toString,l=u.hasOwnProperty,p=c.call(Object);e.exports=function(e){if(!s(e)||r(e)!=o)return!1;var t=i(e);if(null===t)return!0;var n=l.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&c.call(n)==p}},function(e,t,n){var r=n(228),i=n(27),s=n(28),o=s&&s.isRegExp,a=o?i(o):r;e.exports=a},function(e,t,n){var r=n(8),i=n(6),s="[object RegExp]";e.exports=function(e){return i(e)&&r(e)==s}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n=!1){return e.object=(0,r.memberExpression)(e.object,e.property,e.computed),e.property=t,e.computed=!!n,e};var r=n(4)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if(!e||!t)return e;for(const n of r.INHERIT_KEYS.optional)null==e[n]&&(e[n]=t[n]);for(const n of Object.keys(t))"_"===n[0]&&"__clone"!==n&&(e[n]=t[n]);for(const n of r.INHERIT_KEYS.force)e[n]=t[n];return(0,i.default)(e,t),e};var r=n(11),i=function(e){return e&&e.__esModule?e:{default:e}}(n(86))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){return e.object=(0,r.memberExpression)(t,e.object),e};var r=n(4)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){return(0,r.default)(e,t,!0)};var r=function(e){return e&&e.__esModule?e:{default:e}}(n(30))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n){"function"==typeof t&&(t={enter:t});const{enter:i,exit:s}=t;!function e(t,n,i,s,o){const a=r.VISITOR_KEYS[t.type];if(!a)return;n&&n(t,o,s);for(const r of a){const a=t[r];if(Array.isArray(a))for(let u=0;u=0)return!0}else if(s===e)return!0}return!1};var r=function(e){return e&&e.__esModule?e:{default:e}}(n(30))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return(0,r.isFunctionDeclaration)(e)||(0,r.isClassDeclaration)(e)||(0,i.default)(e)};var r=n(2),i=function(e){return e&&e.__esModule?e:{default:e}}(n(93))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){if((0,r.default)(e.type,"Immutable"))return!0;if((0,i.isIdentifier)(e))return"undefined"===e.name;return!1};var r=function(e){return e&&e.__esModule?e:{default:e}}(n(44)),i=n(2)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function e(t,n){if("object"!=typeof t||"object"!=typeof n||null==t||null==n)return t===n;if(t.type!==n.type)return!1;const i=Object.keys(r.NODE_FIELDS[t.type]||t.type);const s=r.VISITOR_KEYS[t.type];for(const r of i){if(typeof t[r]!=typeof n[r])return!1;if(null!=t[r]||null!=n[r]){if(null==t[r]||null==n[r])return!1;if(Array.isArray(t[r])){if(!Array.isArray(n[r]))return!1;if(t[r].length!==n[r].length)return!1;for(let i=0;i=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(e){}}(),t.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],t.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}},t.enable(i())}).call(this,n(48))},function(e,t,n){var r;function i(e){function n(){if(n.enabled){var e=n,i=+new Date,s=i-(r||i);e.diff=s,e.prev=r,e.curr=i,r=i;for(var o=new Array(arguments.length),a=0;a0)return function(e){if((e=String(e)).length>100)return;var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(!t)return;var a=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return a*o;case"days":case"day":case"d":return a*s;case"hours":case"hour":case"hrs":case"hr":case"h":return a*i;case"minutes":case"minute":case"mins":case"min":case"m":return a*r;case"seconds":case"second":case"secs":case"sec":case"s":return a*n;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return a;default:return}}(e);if("number"===u&&!1===isNaN(e))return t.long?function(e){return a(e,s,"day")||a(e,i,"hour")||a(e,r,"minute")||a(e,n,"second")||e+" ms"}(e):function(e){if(e>=s)return Math.round(e/s)+"d";if(e>=i)return Math.round(e/i)+"h";if(e>=r)return Math.round(e/r)+"m";if(e>=n)return Math.round(e/n)+"s";return e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},function(e,t,n){var r=n(8),i=n(14),s=n(6),o="[object String]";e.exports=function(e){return"string"==typeof e||!i(e)&&s(e)&&r(e)==o}},function(e,t,n){var r=n(248),i=1/0,s=1.7976931348623157e308;e.exports=function(e){return e?(e=r(e))===i||e===-i?(e<0?-1:1)*s:e==e?e:0:0===e?e:0}},function(e,t,n){var r=n(10),i=n(95),s=NaN,o=/^\s+|\s+$/g,a=/^[-+]0x[0-9a-f]+$/i,u=/^0b[01]+$/i,c=/^0o[0-7]+$/i,l=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(i(e))return s;if(r(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=r(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(o,"");var n=u.test(e);return n||c.test(e)?l(e.slice(2),n?2:8):a.test(e)?s:+e}},function(e,t,n){var r=n(250),i=n(25);e.exports=function(e){return null==e?[]:r(e,i(e))}},function(e,t,n){var r=n(96);e.exports=function(e,t){return r(t,function(t){return e[t]})}},function(e,t){var n=9007199254740991,r=Math.floor;e.exports=function(e,t){var i="";if(!e||t<1||t>n)return i;do{t%2&&(i+=e),(t=r(t/2))&&(e+=e)}while(t);return i}},function(e,t,n){var r=n(253);e.exports=function(e){return null==e?"":r(e)}},function(e,t,n){var r=n(21),i=n(96),s=n(14),o=n(95),a=1/0,u=r?r.prototype:void 0,c=u?u.toString:void 0;e.exports=function e(t){if("string"==typeof t)return t;if(s(t))return i(t,e)+"";if(o(t))return c?c.call(t):"";var n=t+"";return"0"==n&&1/t==-a?"-0":n}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;i(n(99));function r(){const e=i(n(255));return r=function(){return e},e}function i(e){return e&&e.__esModule?e:{default:e}}const s={ReferencedIdentifier({node:e},t){e.name===t.oldName&&(e.name=t.newName)},Scope(e,t){e.scope.bindingIdentifierEquals(t.oldName,t.binding.identifier)||e.skip()},"AssignmentExpression|Declaration"(e,t){const n=e.getOuterBindingIdentifiers();for(const e in n)e===t.oldName&&(n[e].name=t.newName)}};t.default=class{constructor(e,t,n){this.newName=n,this.oldName=t,this.binding=e}maybeConvertFromExportDeclaration(e){const t=e.parentPath;t.isExportDeclaration()&&(t.isExportDefaultDeclaration()&&!t.get("declaration").node.id||(0,r().default)(t))}maybeConvertFromClassFunctionDeclaration(e){}maybeConvertFromClassFunctionExpression(e){}rename(e){const{binding:t,oldName:n,newName:r}=this,{scope:i,path:o}=t,a=o.find(e=>e.isDeclaration()||e.isFunctionExpression()||e.isClassExpression());a&&a.getOuterBindingIdentifiers()[n]===t.identifier&&this.maybeConvertFromExportDeclaration(a),i.traverse(e||i.block,s,this),e||(i.removeOwnBinding(n),i.bindings[r]=t,this.binding.identifier.name=r),t.type,a&&(this.maybeConvertFromClassFunctionDeclaration(a),this.maybeConvertFromClassFunctionExpression(a))}}},function(e,t,n){"use strict";function r(){const e=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var r=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(e,n):{};r.get||r.set?Object.defineProperty(t,n,r):t[n]=e[n]}return t.default=e,t}(n(0));return r=function(){return e},e}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){if(!e.isExportDeclaration())throw new Error("Only export declarations can be splitted.");const t=e.isExportDefaultDeclaration(),n=e.get("declaration"),i=n.isClassDeclaration();if(t){const t=n.isFunctionDeclaration()||i,s=n.isScope()?n.scope.parent:n.scope;let o=n.node.id,a=!1;o||(a=!0,o=s.generateUidIdentifier("default"),(t||n.isFunctionExpression()||n.isClassExpression())&&(n.node.id=r().cloneNode(o)));const u=t?n:r().variableDeclaration("var",[r().variableDeclarator(r().cloneNode(o),n.node)]),c=r().exportNamedDeclaration(null,[r().exportSpecifier(r().cloneNode(o),r().identifier("default"))]);return e.insertAfter(c),e.replaceWith(u),a&&s.registerDeclaration(e),e}if(e.get("specifiers").length>0)throw new Error("It doesn't make sense to split exported specifiers.");const s=n.getOuterBindingIdentifiers(),o=Object.keys(s).map(e=>r().exportSpecifier(r().identifier(e),r().identifier(e))),a=r().exportNamedDeclaration(null,o);return e.insertAfter(a),e.replaceWith(n.node),e}},function(e,t,n){var r=n(257),i=n(20),s=n(98),o=n(37),a=Object.prototype,u=a.hasOwnProperty,c=r(function(e,t){e=Object(e);var n=-1,r=t.length,c=r>2?t[2]:void 0;for(c&&s(t[0],t[1],c)&&(r=1);++n0){if(++t>=n)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}},function(e,t,n){"use strict";e.exports=n(265)},function(e){e.exports={builtin:{Array:!1,ArrayBuffer:!1,Atomics:!1,BigInt:!1,BigInt64Array:!1,BigUint64Array:!1,Boolean:!1,constructor:!1,DataView:!1,Date:!1,decodeURI:!1,decodeURIComponent:!1,encodeURI:!1,encodeURIComponent:!1,Error:!1,escape:!1,eval:!1,EvalError:!1,Float32Array:!1,Float64Array:!1,Function:!1,globalThis:!1,hasOwnProperty:!1,Infinity:!1,Int16Array:!1,Int32Array:!1,Int8Array:!1,isFinite:!1,isNaN:!1,isPrototypeOf:!1,JSON:!1,Map:!1,Math:!1,NaN:!1,Number:!1,Object:!1,parseFloat:!1,parseInt:!1,Promise:!1,propertyIsEnumerable:!1,Proxy:!1,RangeError:!1,ReferenceError:!1,Reflect:!1,RegExp:!1,Set:!1,SharedArrayBuffer:!1,String:!1,Symbol:!1,SyntaxError:!1,toLocaleString:!1,toString:!1,TypeError:!1,Uint16Array:!1,Uint32Array:!1,Uint8Array:!1,Uint8ClampedArray:!1,undefined:!1,unescape:!1,URIError:!1,valueOf:!1,WeakMap:!1,WeakSet:!1},es5:{Array:!1,Boolean:!1,constructor:!1,Date:!1,decodeURI:!1,decodeURIComponent:!1,encodeURI:!1,encodeURIComponent:!1,Error:!1,escape:!1,eval:!1,EvalError:!1,Function:!1,hasOwnProperty:!1,Infinity:!1,isFinite:!1,isNaN:!1,isPrototypeOf:!1,JSON:!1,Math:!1,NaN:!1,Number:!1,Object:!1,parseFloat:!1,parseInt:!1,propertyIsEnumerable:!1,RangeError:!1,ReferenceError:!1,RegExp:!1,String:!1,SyntaxError:!1,toLocaleString:!1,toString:!1,TypeError:!1,undefined:!1,unescape:!1,URIError:!1,valueOf:!1},es2015:{Array:!1,ArrayBuffer:!1,Boolean:!1,constructor:!1,DataView:!1,Date:!1,decodeURI:!1,decodeURIComponent:!1,encodeURI:!1,encodeURIComponent:!1,Error:!1,escape:!1,eval:!1,EvalError:!1,Float32Array:!1,Float64Array:!1,Function:!1,hasOwnProperty:!1,Infinity:!1,Int16Array:!1,Int32Array:!1,Int8Array:!1,isFinite:!1,isNaN:!1,isPrototypeOf:!1,JSON:!1,Map:!1,Math:!1,NaN:!1,Number:!1,Object:!1,parseFloat:!1,parseInt:!1,Promise:!1,propertyIsEnumerable:!1,Proxy:!1,RangeError:!1,ReferenceError:!1,Reflect:!1,RegExp:!1,Set:!1,String:!1,Symbol:!1,SyntaxError:!1,toLocaleString:!1,toString:!1,TypeError:!1,Uint16Array:!1,Uint32Array:!1,Uint8Array:!1,Uint8ClampedArray:!1,undefined:!1,unescape:!1,URIError:!1,valueOf:!1,WeakMap:!1,WeakSet:!1},es2017:{Array:!1,ArrayBuffer:!1,Atomics:!1,Boolean:!1,constructor:!1,DataView:!1,Date:!1,decodeURI:!1,decodeURIComponent:!1,encodeURI:!1,encodeURIComponent:!1,Error:!1,escape:!1,eval:!1,EvalError:!1,Float32Array:!1,Float64Array:!1,Function:!1,hasOwnProperty:!1,Infinity:!1,Int16Array:!1,Int32Array:!1,Int8Array:!1,isFinite:!1,isNaN:!1,isPrototypeOf:!1,JSON:!1,Map:!1,Math:!1,NaN:!1,Number:!1,Object:!1,parseFloat:!1,parseInt:!1,Promise:!1,propertyIsEnumerable:!1,Proxy:!1,RangeError:!1,ReferenceError:!1,Reflect:!1,RegExp:!1,Set:!1,SharedArrayBuffer:!1,String:!1,Symbol:!1,SyntaxError:!1,toLocaleString:!1,toString:!1,TypeError:!1,Uint16Array:!1,Uint32Array:!1,Uint8Array:!1,Uint8ClampedArray:!1,undefined:!1,unescape:!1,URIError:!1,valueOf:!1,WeakMap:!1,WeakSet:!1},browser:{AbortController:!1,AbortSignal:!1,addEventListener:!1,alert:!1,AnalyserNode:!1,Animation:!1,AnimationEffectReadOnly:!1,AnimationEffectTiming:!1,AnimationEffectTimingReadOnly:!1,AnimationEvent:!1,AnimationPlaybackEvent:!1,AnimationTimeline:!1,applicationCache:!1,ApplicationCache:!1,ApplicationCacheErrorEvent:!1,atob:!1,Attr:!1,Audio:!1,AudioBuffer:!1,AudioBufferSourceNode:!1,AudioContext:!1,AudioDestinationNode:!1,AudioListener:!1,AudioNode:!1,AudioParam:!1,AudioProcessingEvent:!1,AudioScheduledSourceNode:!1,"AudioWorkletGlobalScope ":!1,AudioWorkletNode:!1,AudioWorkletProcessor:!1,BarProp:!1,BaseAudioContext:!1,BatteryManager:!1,BeforeUnloadEvent:!1,BiquadFilterNode:!1,Blob:!1,BlobEvent:!1,blur:!1,BroadcastChannel:!1,btoa:!1,BudgetService:!1,ByteLengthQueuingStrategy:!1,Cache:!1,caches:!1,CacheStorage:!1,cancelAnimationFrame:!1,cancelIdleCallback:!1,CanvasCaptureMediaStreamTrack:!1,CanvasGradient:!1,CanvasPattern:!1,CanvasRenderingContext2D:!1,ChannelMergerNode:!1,ChannelSplitterNode:!1,CharacterData:!1,clearInterval:!1,clearTimeout:!1,clientInformation:!1,ClipboardEvent:!1,close:!1,closed:!1,CloseEvent:!1,Comment:!1,CompositionEvent:!1,confirm:!1,console:!1,ConstantSourceNode:!1,ConvolverNode:!1,CountQueuingStrategy:!1,createImageBitmap:!1,Credential:!1,CredentialsContainer:!1,crypto:!1,Crypto:!1,CryptoKey:!1,CSS:!1,CSSConditionRule:!1,CSSFontFaceRule:!1,CSSGroupingRule:!1,CSSImportRule:!1,CSSKeyframeRule:!1,CSSKeyframesRule:!1,CSSMediaRule:!1,CSSNamespaceRule:!1,CSSPageRule:!1,CSSRule:!1,CSSRuleList:!1,CSSStyleDeclaration:!1,CSSStyleRule:!1,CSSStyleSheet:!1,CSSSupportsRule:!1,CustomElementRegistry:!1,customElements:!1,CustomEvent:!1,DataTransfer:!1,DataTransferItem:!1,DataTransferItemList:!1,defaultstatus:!1,defaultStatus:!1,DelayNode:!1,DeviceMotionEvent:!1,DeviceOrientationEvent:!1,devicePixelRatio:!1,dispatchEvent:!1,document:!1,Document:!1,DocumentFragment:!1,DocumentType:!1,DOMError:!1,DOMException:!1,DOMImplementation:!1,DOMMatrix:!1,DOMMatrixReadOnly:!1,DOMParser:!1,DOMPoint:!1,DOMPointReadOnly:!1,DOMQuad:!1,DOMRect:!1,DOMRectReadOnly:!1,DOMStringList:!1,DOMStringMap:!1,DOMTokenList:!1,DragEvent:!1,DynamicsCompressorNode:!1,Element:!1,ErrorEvent:!1,event:!1,Event:!1,EventSource:!1,EventTarget:!1,external:!1,fetch:!1,File:!1,FileList:!1,FileReader:!1,find:!1,focus:!1,FocusEvent:!1,FontFace:!1,FontFaceSetLoadEvent:!1,FormData:!1,frameElement:!1,frames:!1,GainNode:!1,Gamepad:!1,GamepadButton:!1,GamepadEvent:!1,getComputedStyle:!1,getSelection:!1,HashChangeEvent:!1,Headers:!1,history:!1,History:!1,HTMLAllCollection:!1,HTMLAnchorElement:!1,HTMLAreaElement:!1,HTMLAudioElement:!1,HTMLBaseElement:!1,HTMLBodyElement:!1,HTMLBRElement:!1,HTMLButtonElement:!1,HTMLCanvasElement:!1,HTMLCollection:!1,HTMLContentElement:!1,HTMLDataElement:!1,HTMLDataListElement:!1,HTMLDetailsElement:!1,HTMLDialogElement:!1,HTMLDirectoryElement:!1,HTMLDivElement:!1,HTMLDListElement:!1,HTMLDocument:!1,HTMLElement:!1,HTMLEmbedElement:!1,HTMLFieldSetElement:!1,HTMLFontElement:!1,HTMLFormControlsCollection:!1,HTMLFormElement:!1,HTMLFrameElement:!1,HTMLFrameSetElement:!1,HTMLHeadElement:!1,HTMLHeadingElement:!1,HTMLHRElement:!1,HTMLHtmlElement:!1,HTMLIFrameElement:!1,HTMLImageElement:!1,HTMLInputElement:!1,HTMLLabelElement:!1,HTMLLegendElement:!1,HTMLLIElement:!1,HTMLLinkElement:!1,HTMLMapElement:!1,HTMLMarqueeElement:!1,HTMLMediaElement:!1,HTMLMenuElement:!1,HTMLMetaElement:!1,HTMLMeterElement:!1,HTMLModElement:!1,HTMLObjectElement:!1,HTMLOListElement:!1,HTMLOptGroupElement:!1,HTMLOptionElement:!1,HTMLOptionsCollection:!1,HTMLOutputElement:!1,HTMLParagraphElement:!1,HTMLParamElement:!1,HTMLPictureElement:!1,HTMLPreElement:!1,HTMLProgressElement:!1,HTMLQuoteElement:!1,HTMLScriptElement:!1,HTMLSelectElement:!1,HTMLShadowElement:!1,HTMLSlotElement:!1,HTMLSourceElement:!1,HTMLSpanElement:!1,HTMLStyleElement:!1,HTMLTableCaptionElement:!1,HTMLTableCellElement:!1,HTMLTableColElement:!1,HTMLTableElement:!1,HTMLTableRowElement:!1,HTMLTableSectionElement:!1,HTMLTemplateElement:!1,HTMLTextAreaElement:!1,HTMLTimeElement:!1,HTMLTitleElement:!1,HTMLTrackElement:!1,HTMLUListElement:!1,HTMLUnknownElement:!1,HTMLVideoElement:!1,IDBCursor:!1,IDBCursorWithValue:!1,IDBDatabase:!1,IDBFactory:!1,IDBIndex:!1,IDBKeyRange:!1,IDBObjectStore:!1,IDBOpenDBRequest:!1,IDBRequest:!1,IDBTransaction:!1,IDBVersionChangeEvent:!1,IdleDeadline:!1,IIRFilterNode:!1,Image:!1,ImageBitmap:!1,ImageBitmapRenderingContext:!1,ImageCapture:!1,ImageData:!1,indexedDB:!1,innerHeight:!1,innerWidth:!1,InputEvent:!1,IntersectionObserver:!1,IntersectionObserverEntry:!1,Intl:!1,isSecureContext:!1,KeyboardEvent:!1,KeyframeEffect:!1,KeyframeEffectReadOnly:!1,length:!1,localStorage:!1,location:!0,Location:!1,locationbar:!1,matchMedia:!1,MediaDeviceInfo:!1,MediaDevices:!1,MediaElementAudioSourceNode:!1,MediaEncryptedEvent:!1,MediaError:!1,MediaKeyMessageEvent:!1,MediaKeySession:!1,MediaKeyStatusMap:!1,MediaKeySystemAccess:!1,MediaList:!1,MediaQueryList:!1,MediaQueryListEvent:!1,MediaRecorder:!1,MediaSettingsRange:!1,MediaSource:!1,MediaStream:!1,MediaStreamAudioDestinationNode:!1,MediaStreamAudioSourceNode:!1,MediaStreamEvent:!1,MediaStreamTrack:!1,MediaStreamTrackEvent:!1,menubar:!1,MessageChannel:!1,MessageEvent:!1,MessagePort:!1,MIDIAccess:!1,MIDIConnectionEvent:!1,MIDIInput:!1,MIDIInputMap:!1,MIDIMessageEvent:!1,MIDIOutput:!1,MIDIOutputMap:!1,MIDIPort:!1,MimeType:!1,MimeTypeArray:!1,MouseEvent:!1,moveBy:!1,moveTo:!1,MutationEvent:!1,MutationObserver:!1,MutationRecord:!1,name:!1,NamedNodeMap:!1,NavigationPreloadManager:!1,navigator:!1,Navigator:!1,NetworkInformation:!1,Node:!1,NodeFilter:!1,NodeIterator:!1,NodeList:!1,Notification:!1,OfflineAudioCompletionEvent:!1,OfflineAudioContext:!1,offscreenBuffering:!1,OffscreenCanvas:!0,onabort:!0,onafterprint:!0,onanimationend:!0,onanimationiteration:!0,onanimationstart:!0,onappinstalled:!0,onauxclick:!0,onbeforeinstallprompt:!0,onbeforeprint:!0,onbeforeunload:!0,onblur:!0,oncancel:!0,oncanplay:!0,oncanplaythrough:!0,onchange:!0,onclick:!0,onclose:!0,oncontextmenu:!0,oncuechange:!0,ondblclick:!0,ondevicemotion:!0,ondeviceorientation:!0,ondeviceorientationabsolute:!0,ondrag:!0,ondragend:!0,ondragenter:!0,ondragleave:!0,ondragover:!0,ondragstart:!0,ondrop:!0,ondurationchange:!0,onemptied:!0,onended:!0,onerror:!0,onfocus:!0,ongotpointercapture:!0,onhashchange:!0,oninput:!0,oninvalid:!0,onkeydown:!0,onkeypress:!0,onkeyup:!0,onlanguagechange:!0,onload:!0,onloadeddata:!0,onloadedmetadata:!0,onloadstart:!0,onlostpointercapture:!0,onmessage:!0,onmessageerror:!0,onmousedown:!0,onmouseenter:!0,onmouseleave:!0,onmousemove:!0,onmouseout:!0,onmouseover:!0,onmouseup:!0,onmousewheel:!0,onoffline:!0,ononline:!0,onpagehide:!0,onpageshow:!0,onpause:!0,onplay:!0,onplaying:!0,onpointercancel:!0,onpointerdown:!0,onpointerenter:!0,onpointerleave:!0,onpointermove:!0,onpointerout:!0,onpointerover:!0,onpointerup:!0,onpopstate:!0,onprogress:!0,onratechange:!0,onrejectionhandled:!0,onreset:!0,onresize:!0,onscroll:!0,onsearch:!0,onseeked:!0,onseeking:!0,onselect:!0,onstalled:!0,onstorage:!0,onsubmit:!0,onsuspend:!0,ontimeupdate:!0,ontoggle:!0,ontransitionend:!0,onunhandledrejection:!0,onunload:!0,onvolumechange:!0,onwaiting:!0,onwheel:!0,open:!1,openDatabase:!1,opener:!1,Option:!1,origin:!1,OscillatorNode:!1,outerHeight:!1,outerWidth:!1,PageTransitionEvent:!1,pageXOffset:!1,pageYOffset:!1,PannerNode:!1,parent:!1,Path2D:!1,PaymentAddress:!1,PaymentRequest:!1,PaymentRequestUpdateEvent:!1,PaymentResponse:!1,performance:!1,Performance:!1,PerformanceEntry:!1,PerformanceLongTaskTiming:!1,PerformanceMark:!1,PerformanceMeasure:!1,PerformanceNavigation:!1,PerformanceNavigationTiming:!1,PerformanceObserver:!1,PerformanceObserverEntryList:!1,PerformancePaintTiming:!1,PerformanceResourceTiming:!1,PerformanceTiming:!1,PeriodicWave:!1,Permissions:!1,PermissionStatus:!1,personalbar:!1,PhotoCapabilities:!1,Plugin:!1,PluginArray:!1,PointerEvent:!1,PopStateEvent:!1,postMessage:!1,Presentation:!1,PresentationAvailability:!1,PresentationConnection:!1,PresentationConnectionAvailableEvent:!1,PresentationConnectionCloseEvent:!1,PresentationConnectionList:!1,PresentationReceiver:!1,PresentationRequest:!1,print:!1,ProcessingInstruction:!1,ProgressEvent:!1,PromiseRejectionEvent:!1,prompt:!1,PushManager:!1,PushSubscription:!1,PushSubscriptionOptions:!1,queueMicrotask:!1,RadioNodeList:!1,Range:!1,ReadableStream:!1,registerProcessor:!1,RemotePlayback:!1,removeEventListener:!1,Request:!1,requestAnimationFrame:!1,requestIdleCallback:!1,resizeBy:!1,ResizeObserver:!1,ResizeObserverEntry:!1,resizeTo:!1,Response:!1,RTCCertificate:!1,RTCDataChannel:!1,RTCDataChannelEvent:!1,RTCDtlsTransport:!1,RTCIceCandidate:!1,RTCIceGatherer:!1,RTCIceTransport:!1,RTCPeerConnection:!1,RTCPeerConnectionIceEvent:!1,RTCRtpContributingSource:!1,RTCRtpReceiver:!1,RTCRtpSender:!1,RTCSctpTransport:!1,RTCSessionDescription:!1,RTCStatsReport:!1,RTCTrackEvent:!1,screen:!1,Screen:!1,screenLeft:!1,ScreenOrientation:!1,screenTop:!1,screenX:!1,screenY:!1,ScriptProcessorNode:!1,scroll:!1,scrollbars:!1,scrollBy:!1,scrollTo:!1,scrollX:!1,scrollY:!1,SecurityPolicyViolationEvent:!1,Selection:!1,self:!1,ServiceWorker:!1,ServiceWorkerContainer:!1,ServiceWorkerRegistration:!1,sessionStorage:!1,setInterval:!1,setTimeout:!1,ShadowRoot:!1,SharedWorker:!1,SourceBuffer:!1,SourceBufferList:!1,speechSynthesis:!1,SpeechSynthesisEvent:!1,SpeechSynthesisUtterance:!1,StaticRange:!1,status:!1,statusbar:!1,StereoPannerNode:!1,stop:!1,Storage:!1,StorageEvent:!1,StorageManager:!1,styleMedia:!1,StyleSheet:!1,StyleSheetList:!1,SubtleCrypto:!1,SVGAElement:!1,SVGAngle:!1,SVGAnimatedAngle:!1,SVGAnimatedBoolean:!1,SVGAnimatedEnumeration:!1,SVGAnimatedInteger:!1,SVGAnimatedLength:!1,SVGAnimatedLengthList:!1,SVGAnimatedNumber:!1,SVGAnimatedNumberList:!1,SVGAnimatedPreserveAspectRatio:!1,SVGAnimatedRect:!1,SVGAnimatedString:!1,SVGAnimatedTransformList:!1,SVGAnimateElement:!1,SVGAnimateMotionElement:!1,SVGAnimateTransformElement:!1,SVGAnimationElement:!1,SVGCircleElement:!1,SVGClipPathElement:!1,SVGComponentTransferFunctionElement:!1,SVGDefsElement:!1,SVGDescElement:!1,SVGDiscardElement:!1,SVGElement:!1,SVGEllipseElement:!1,SVGFEBlendElement:!1,SVGFEColorMatrixElement:!1,SVGFEComponentTransferElement:!1,SVGFECompositeElement:!1,SVGFEConvolveMatrixElement:!1,SVGFEDiffuseLightingElement:!1,SVGFEDisplacementMapElement:!1,SVGFEDistantLightElement:!1,SVGFEDropShadowElement:!1,SVGFEFloodElement:!1,SVGFEFuncAElement:!1,SVGFEFuncBElement:!1,SVGFEFuncGElement:!1,SVGFEFuncRElement:!1,SVGFEGaussianBlurElement:!1,SVGFEImageElement:!1,SVGFEMergeElement:!1,SVGFEMergeNodeElement:!1,SVGFEMorphologyElement:!1,SVGFEOffsetElement:!1,SVGFEPointLightElement:!1,SVGFESpecularLightingElement:!1,SVGFESpotLightElement:!1,SVGFETileElement:!1,SVGFETurbulenceElement:!1,SVGFilterElement:!1,SVGForeignObjectElement:!1,SVGGElement:!1,SVGGeometryElement:!1,SVGGradientElement:!1,SVGGraphicsElement:!1,SVGImageElement:!1,SVGLength:!1,SVGLengthList:!1,SVGLinearGradientElement:!1,SVGLineElement:!1,SVGMarkerElement:!1,SVGMaskElement:!1,SVGMatrix:!1,SVGMetadataElement:!1,SVGMPathElement:!1,SVGNumber:!1,SVGNumberList:!1,SVGPathElement:!1,SVGPatternElement:!1,SVGPoint:!1,SVGPointList:!1,SVGPolygonElement:!1,SVGPolylineElement:!1,SVGPreserveAspectRatio:!1,SVGRadialGradientElement:!1,SVGRect:!1,SVGRectElement:!1,SVGScriptElement:!1,SVGSetElement:!1,SVGStopElement:!1,SVGStringList:!1,SVGStyleElement:!1,SVGSVGElement:!1,SVGSwitchElement:!1,SVGSymbolElement:!1,SVGTextContentElement:!1,SVGTextElement:!1,SVGTextPathElement:!1,SVGTextPositioningElement:!1,SVGTitleElement:!1,SVGTransform:!1,SVGTransformList:!1,SVGTSpanElement:!1,SVGUnitTypes:!1,SVGUseElement:!1,SVGViewElement:!1,TaskAttributionTiming:!1,Text:!1,TextDecoder:!1,TextEncoder:!1,TextEvent:!1,TextMetrics:!1,TextTrack:!1,TextTrackCue:!1,TextTrackCueList:!1,TextTrackList:!1,TimeRanges:!1,toolbar:!1,top:!1,Touch:!1,TouchEvent:!1,TouchList:!1,TrackEvent:!1,TransitionEvent:!1,TreeWalker:!1,UIEvent:!1,URL:!1,URLSearchParams:!1,ValidityState:!1,visualViewport:!1,VisualViewport:!1,VTTCue:!1,WaveShaperNode:!1,WebAssembly:!1,WebGL2RenderingContext:!1,WebGLActiveInfo:!1,WebGLBuffer:!1,WebGLContextEvent:!1,WebGLFramebuffer:!1,WebGLProgram:!1,WebGLQuery:!1,WebGLRenderbuffer:!1,WebGLRenderingContext:!1,WebGLSampler:!1,WebGLShader:!1,WebGLShaderPrecisionFormat:!1,WebGLSync:!1,WebGLTexture:!1,WebGLTransformFeedback:!1,WebGLUniformLocation:!1,WebGLVertexArrayObject:!1,WebSocket:!1,WheelEvent:!1,window:!1,Window:!1,Worker:!1,WritableStream:!1,XMLDocument:!1,XMLHttpRequest:!1,XMLHttpRequestEventTarget:!1,XMLHttpRequestUpload:!1,XMLSerializer:!1,XPathEvaluator:!1,XPathExpression:!1,XPathResult:!1,XSLTProcessor:!1},worker:{addEventListener:!1,applicationCache:!1,atob:!1,Blob:!1,BroadcastChannel:!1,btoa:!1,Cache:!1,caches:!1,clearInterval:!1,clearTimeout:!1,close:!0,console:!1,fetch:!1,FileReaderSync:!1,FormData:!1,Headers:!1,IDBCursor:!1,IDBCursorWithValue:!1,IDBDatabase:!1,IDBFactory:!1,IDBIndex:!1,IDBKeyRange:!1,IDBObjectStore:!1,IDBOpenDBRequest:!1,IDBRequest:!1,IDBTransaction:!1,IDBVersionChangeEvent:!1,ImageData:!1,importScripts:!0,indexedDB:!1,location:!1,MessageChannel:!1,MessagePort:!1,name:!1,navigator:!1,Notification:!1,onclose:!0,onconnect:!0,onerror:!0,onlanguagechange:!0,onmessage:!0,onoffline:!0,ononline:!0,onrejectionhandled:!0,onunhandledrejection:!0,performance:!1,Performance:!1,PerformanceEntry:!1,PerformanceMark:!1,PerformanceMeasure:!1,PerformanceNavigation:!1,PerformanceResourceTiming:!1,PerformanceTiming:!1,postMessage:!0,Promise:!1,queueMicrotask:!1,removeEventListener:!1,Request:!1,Response:!1,self:!0,ServiceWorkerRegistration:!1,setInterval:!1,setTimeout:!1,TextDecoder:!1,TextEncoder:!1,URL:!1,URLSearchParams:!1,WebSocket:!1,Worker:!1,WorkerGlobalScope:!1,XMLHttpRequest:!1},node:{__dirname:!1,__filename:!1,Buffer:!1,clearImmediate:!1,clearInterval:!1,clearTimeout:!1,console:!1,exports:!0,global:!1,Intl:!1,module:!1,process:!1,queueMicrotask:!1,require:!1,setImmediate:!1,setInterval:!1,setTimeout:!1,TextDecoder:!1,TextEncoder:!1,URL:!1,URLSearchParams:!1},commonjs:{exports:!0,global:!1,module:!1,require:!1},amd:{define:!1,require:!1},mocha:{after:!1,afterEach:!1,before:!1,beforeEach:!1,context:!1,describe:!1,it:!1,mocha:!1,run:!1,setup:!1,specify:!1,suite:!1,suiteSetup:!1,suiteTeardown:!1,teardown:!1,test:!1,xcontext:!1,xdescribe:!1,xit:!1,xspecify:!1},jasmine:{afterAll:!1,afterEach:!1,beforeAll:!1,beforeEach:!1,describe:!1,expect:!1,fail:!1,fdescribe:!1,fit:!1,it:!1,jasmine:!1,pending:!1,runs:!1,spyOn:!1,spyOnProperty:!1,waits:!1,waitsFor:!1,xdescribe:!1,xit:!1},jest:{afterAll:!1,afterEach:!1,beforeAll:!1,beforeEach:!1,describe:!1,expect:!1,fdescribe:!1,fit:!1,it:!1,jest:!1,pit:!1,require:!1,test:!1,xdescribe:!1,xit:!1,xtest:!1},qunit:{asyncTest:!1,deepEqual:!1,equal:!1,expect:!1,module:!1,notDeepEqual:!1,notEqual:!1,notOk:!1,notPropEqual:!1,notStrictEqual:!1,ok:!1,propEqual:!1,QUnit:!1,raises:!1,start:!1,stop:!1,strictEqual:!1,test:!1,throws:!1},phantomjs:{console:!0,exports:!0,phantom:!0,require:!0,WebPage:!0},couch:{emit:!1,exports:!1,getRow:!1,log:!1,module:!1,provides:!1,require:!1,respond:!1,send:!1,start:!1,sum:!1},rhino:{defineClass:!1,deserialize:!1,gc:!1,help:!1,importClass:!1,importPackage:!1,java:!1,load:!1,loadClass:!1,Packages:!1,print:!1,quit:!1,readFile:!1,readUrl:!1,runCommand:!1,seal:!1,serialize:!1,spawn:!1,sync:!1,toint32:!1,version:!1},nashorn:{__DIR__:!1,__FILE__:!1,__LINE__:!1,com:!1,edu:!1,exit:!1,java:!1,Java:!1,javafx:!1,JavaImporter:!1,javax:!1,JSAdapter:!1,load:!1,loadWithNewGlobal:!1,org:!1,Packages:!1,print:!1,quit:!1},wsh:{ActiveXObject:!0,Enumerator:!0,GetObject:!0,ScriptEngine:!0,ScriptEngineBuildVersion:!0,ScriptEngineMajorVersion:!0,ScriptEngineMinorVersion:!0,VBArray:!0,WScript:!0,WSH:!0,XDomainRequest:!0},jquery:{$:!1,jQuery:!1},yui:{YAHOO:!1,YAHOO_config:!1,YUI:!1,YUI_config:!1},shelljs:{cat:!1,cd:!1,chmod:!1,config:!1,cp:!1,dirs:!1,echo:!1,env:!1,error:!1,exec:!1,exit:!1,find:!1,grep:!1,ln:!1,ls:!1,mkdir:!1,mv:!1,popd:!1,pushd:!1,pwd:!1,rm:!1,sed:!1,set:!1,target:!1,tempdir:!1,test:!1,touch:!1,which:!1},prototypejs:{$:!1,$$:!1,$A:!1,$break:!1,$continue:!1,$F:!1,$H:!1,$R:!1,$w:!1,Abstract:!1,Ajax:!1,Autocompleter:!1,Builder:!1,Class:!1,Control:!1,Draggable:!1,Draggables:!1,Droppables:!1,Effect:!1,Element:!1,Enumerable:!1,Event:!1,Field:!1,Form:!1,Hash:!1,Insertion:!1,ObjectRange:!1,PeriodicalExecuter:!1,Position:!1,Prototype:!1,Scriptaculous:!1,Selector:!1,Sortable:!1,SortableObserver:!1,Sound:!1,Template:!1,Toggle:!1,Try:!1},meteor:{_:!1,$:!1,Accounts:!1,AccountsClient:!1,AccountsCommon:!1,AccountsServer:!1,App:!1,Assets:!1,Blaze:!1,check:!1,Cordova:!1,DDP:!1,DDPRateLimiter:!1,DDPServer:!1,Deps:!1,EJSON:!1,Email:!1,HTTP:!1,Log:!1,Match:!1,Meteor:!1,Mongo:!1,MongoInternals:!1,Npm:!1,Package:!1,Plugin:!1,process:!1,Random:!1,ReactiveDict:!1,ReactiveVar:!1,Router:!1,ServiceConfiguration:!1,Session:!1,share:!1,Spacebars:!1,Template:!1,Tinytest:!1,Tracker:!1,UI:!1,Utils:!1,WebApp:!1,WebAppInternals:!1},mongo:{_isWindows:!1,_rand:!1,BulkWriteResult:!1,cat:!1,cd:!1,connect:!1,db:!1,getHostName:!1,getMemInfo:!1,hostname:!1,ISODate:!1,listFiles:!1,load:!1,ls:!1,md5sumFile:!1,mkdir:!1,Mongo:!1,NumberInt:!1,NumberLong:!1,ObjectId:!1,PlanCache:!1,print:!1,printjson:!1,pwd:!1,quit:!1,removeFile:!1,rs:!1,sh:!1,UUID:!1,version:!1,WriteResult:!1},applescript:{$:!1,Application:!1,Automation:!1,console:!1,delay:!1,Library:!1,ObjC:!1,ObjectSpecifier:!1,Path:!1,Progress:!1,Ref:!1},serviceworker:{addEventListener:!1,applicationCache:!1,atob:!1,Blob:!1,BroadcastChannel:!1,btoa:!1,Cache:!1,caches:!1,CacheStorage:!1,clearInterval:!1,clearTimeout:!1,Client:!1,clients:!1,Clients:!1,close:!0,console:!1,ExtendableEvent:!1,ExtendableMessageEvent:!1,fetch:!1,FetchEvent:!1,FileReaderSync:!1,FormData:!1,Headers:!1,IDBCursor:!1,IDBCursorWithValue:!1,IDBDatabase:!1,IDBFactory:!1,IDBIndex:!1,IDBKeyRange:!1,IDBObjectStore:!1,IDBOpenDBRequest:!1,IDBRequest:!1,IDBTransaction:!1,IDBVersionChangeEvent:!1,ImageData:!1,importScripts:!1,indexedDB:!1,location:!1,MessageChannel:!1,MessagePort:!1,name:!1,navigator:!1,Notification:!1,onclose:!0,onconnect:!0,onerror:!0,onfetch:!0,oninstall:!0,onlanguagechange:!0,onmessage:!0,onmessageerror:!0,onnotificationclick:!0,onnotificationclose:!0,onoffline:!0,ononline:!0,onpush:!0,onpushsubscriptionchange:!0,onrejectionhandled:!0,onsync:!0,onunhandledrejection:!0,performance:!1,Performance:!1,PerformanceEntry:!1,PerformanceMark:!1,PerformanceMeasure:!1,PerformanceNavigation:!1,PerformanceResourceTiming:!1,PerformanceTiming:!1,postMessage:!0,Promise:!1,queueMicrotask:!1,registration:!1,removeEventListener:!1,Request:!1,Response:!1,self:!1,ServiceWorker:!1,ServiceWorkerContainer:!1,ServiceWorkerGlobalScope:!1,ServiceWorkerMessageEvent:!1,ServiceWorkerRegistration:!1,setInterval:!1,setTimeout:!1,skipWaiting:!1,TextDecoder:!1,TextEncoder:!1,URL:!1,URLSearchParams:!1,WebSocket:!1,WindowClient:!1,Worker:!1,WorkerGlobalScope:!1,XMLHttpRequest:!1},atomtest:{advanceClock:!1,fakeClearInterval:!1,fakeClearTimeout:!1,fakeSetInterval:!1,fakeSetTimeout:!1,resetTimeouts:!1,waitsForPromise:!1},embertest:{andThen:!1,click:!1,currentPath:!1,currentRouteName:!1,currentURL:!1,fillIn:!1,find:!1,findAll:!1,findWithAssert:!1,keyEvent:!1,pauseTest:!1,resumeTest:!1,triggerEvent:!1,visit:!1,wait:!1},protractor:{$:!1,$$:!1,browser:!1,by:!1,By:!1,DartObject:!1,element:!1,protractor:!1},"shared-node-browser":{clearInterval:!1,clearTimeout:!1,console:!1,setInterval:!1,setTimeout:!1,URL:!1,URLSearchParams:!1},webextensions:{browser:!1,chrome:!1,opr:!1},greasemonkey:{cloneInto:!1,createObjectIn:!1,exportFunction:!1,GM:!1,GM_addStyle:!1,GM_deleteValue:!1,GM_getResourceText:!1,GM_getResourceURL:!1,GM_getValue:!1,GM_info:!1,GM_listValues:!1,GM_log:!1,GM_openInTab:!1,GM_registerMenuCommand:!1,GM_setClipboard:!1,GM_setValue:!1,GM_xmlhttpRequest:!1,unsafeWindow:!1},devtools:{$:!1,$_:!1,$$:!1,$0:!1,$1:!1,$2:!1,$3:!1,$4:!1,$x:!1,chrome:!1,clear:!1,copy:!1,debug:!1,dir:!1,dirxml:!1,getEventListeners:!1,inspect:!1,keys:!1,monitor:!1,monitorEvents:!1,profile:!1,profileEnd:!1,queryObjects:!1,table:!1,undebug:!1,unmonitor:!1,unmonitorEvents:!1,values:!1}}},function(e,t,n){"use strict";function r(){const e=function(e){return e&&e.__esModule?e:{default:e}}(n(267));return r=function(){return e},e}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default=class{constructor(e,t){this._cachedMap=null,this._code=t,this._opts=e,this._rawMappings=[]}get(){if(!this._cachedMap){const e=this._cachedMap=new(r().default.SourceMapGenerator)({sourceRoot:this._opts.sourceRoot}),t=this._code;"string"==typeof t?e.setSourceContent(this._opts.sourceFileName,t):"object"==typeof t&&Object.keys(t).forEach(n=>{e.setSourceContent(n,t[n])}),this._rawMappings.forEach(e.addMapping,e)}return this._cachedMap.toJSON()}getRawMappings(){return this._rawMappings.slice()}mark(e,t,n,r,i,s,o){this._lastGenLine!==e&&null===n||(o||this._lastGenLine!==e||this._lastSourceLine!==n||this._lastSourceColumn!==r)&&(this._cachedMap=null,this._lastGenLine=e,this._lastSourceLine=n,this._lastSourceColumn=r,this._rawMappings.push({name:i||void 0,generated:{line:e,column:t},source:null==n?void 0:s||this._opts.sourceFileName,original:null==n?void 0:{line:n,column:r}}))}}},function(e,t,n){t.SourceMapGenerator=n(101).SourceMapGenerator,t.SourceMapConsumer=n(270).SourceMapConsumer,t.SourceNode=n(273).SourceNode},function(e,t){var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");t.encode=function(e){if(0<=e&&en||i==n&&o>=s||r.compareByGeneratedPositionsInflated(e,t)<=0}(this._last,e)?(this._sorted=!1,this._array.push(e)):(this._last=e,this._array.push(e))},i.prototype.toArray=function(){return this._sorted||(this._array.sort(r.compareByGeneratedPositionsInflated),this._sorted=!0),this._array},t.MappingList=i},function(e,t,n){var r=n(17),i=n(271),s=n(103).ArraySet,o=n(102),a=n(272).quickSort;function u(e){var t=e;return"string"==typeof e&&(t=JSON.parse(e.replace(/^\)\]\}'/,""))),null!=t.sections?new p(t):new c(t)}function c(e){var t=e;"string"==typeof e&&(t=JSON.parse(e.replace(/^\)\]\}'/,"")));var n=r.getArg(t,"version"),i=r.getArg(t,"sources"),o=r.getArg(t,"names",[]),a=r.getArg(t,"sourceRoot",null),u=r.getArg(t,"sourcesContent",null),c=r.getArg(t,"mappings"),l=r.getArg(t,"file",null);if(n!=this._version)throw new Error("Unsupported version: "+n);i=i.map(String).map(r.normalize).map(function(e){return a&&r.isAbsolute(a)&&r.isAbsolute(e)?r.relative(a,e):e}),this._names=s.fromArray(o.map(String),!0),this._sources=s.fromArray(i,!0),this.sourceRoot=a,this.sourcesContent=u,this._mappings=c,this.file=l}function l(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}function p(e){var t=e;"string"==typeof e&&(t=JSON.parse(e.replace(/^\)\]\}'/,"")));var n=r.getArg(t,"version"),i=r.getArg(t,"sections");if(n!=this._version)throw new Error("Unsupported version: "+n);this._sources=new s,this._names=new s;var o={line:-1,column:0};this._sections=i.map(function(e){if(e.url)throw new Error("Support for url field in sections not implemented.");var t=r.getArg(e,"offset"),n=r.getArg(t,"line"),i=r.getArg(t,"column");if(n=0){var a=this._originalMappings[o];if(void 0===e.column)for(var u=a.originalLine;a&&a.originalLine===u;)s.push({line:r.getArg(a,"generatedLine",null),column:r.getArg(a,"generatedColumn",null),lastColumn:r.getArg(a,"lastGeneratedColumn",null)}),a=this._originalMappings[++o];else for(var c=a.originalColumn;a&&a.originalLine===t&&a.originalColumn==c;)s.push({line:r.getArg(a,"generatedLine",null),column:r.getArg(a,"generatedColumn",null),lastColumn:r.getArg(a,"lastGeneratedColumn",null)}),a=this._originalMappings[++o]}return s},t.SourceMapConsumer=u,c.prototype=Object.create(u.prototype),c.prototype.consumer=u,c.fromSourceMap=function(e){var t=Object.create(c.prototype),n=t._names=s.fromArray(e._names.toArray(),!0),i=t._sources=s.fromArray(e._sources.toArray(),!0);t.sourceRoot=e._sourceRoot,t.sourcesContent=e._generateSourcesContent(t._sources.toArray(),t.sourceRoot),t.file=e._file;for(var o=e._mappings.toArray().slice(),u=t.__generatedMappings=[],p=t.__originalMappings=[],h=0,f=o.length;h1&&(n.source=y+s[1],y+=s[1],n.originalLine=f+s[2],f=n.originalLine,n.originalLine+=1,n.originalColumn=d+s[3],d=n.originalColumn,s.length>4&&(n.name=m+s[4],m+=s[4])),b.push(n),"number"==typeof n.originalLine&&S.push(n)}a(b,r.compareByGeneratedPositionsDeflated),this.__generatedMappings=b,a(S,r.compareByOriginalPositions),this.__originalMappings=S},c.prototype._findMapping=function(e,t,n,r,s,o){if(e[n]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+e[n]);if(e[r]<0)throw new TypeError("Column must be greater than or equal to 0, got "+e[r]);return i.search(e,t,s,o)},c.prototype.computeColumnSpans=function(){for(var e=0;e=0){var i=this._generatedMappings[n];if(i.generatedLine===t.generatedLine){var s=r.getArg(i,"source",null);null!==s&&(s=this._sources.at(s),null!=this.sourceRoot&&(s=r.join(this.sourceRoot,s)));var o=r.getArg(i,"name",null);return null!==o&&(o=this._names.at(o)),{source:s,line:r.getArg(i,"originalLine",null),column:r.getArg(i,"originalColumn",null),name:o}}}return{source:null,line:null,column:null,name:null}},c.prototype.hasContentsOfAllSources=function(){return!!this.sourcesContent&&(this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(e){return null==e}))},c.prototype.sourceContentFor=function(e,t){if(!this.sourcesContent)return null;if(null!=this.sourceRoot&&(e=r.relative(this.sourceRoot,e)),this._sources.has(e))return this.sourcesContent[this._sources.indexOf(e)];var n;if(null!=this.sourceRoot&&(n=r.urlParse(this.sourceRoot))){var i=e.replace(/^file:\/\//,"");if("file"==n.scheme&&this._sources.has(i))return this.sourcesContent[this._sources.indexOf(i)];if((!n.path||"/"==n.path)&&this._sources.has("/"+e))return this.sourcesContent[this._sources.indexOf("/"+e)]}if(t)return null;throw new Error('"'+e+'" is not in the SourceMap.')},c.prototype.generatedPositionFor=function(e){var t=r.getArg(e,"source");if(null!=this.sourceRoot&&(t=r.relative(this.sourceRoot,t)),!this._sources.has(t))return{line:null,column:null,lastColumn:null};var n={source:t=this._sources.indexOf(t),originalLine:r.getArg(e,"line"),originalColumn:r.getArg(e,"column")},i=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",r.compareByOriginalPositions,r.getArg(e,"bias",u.GREATEST_LOWER_BOUND));if(i>=0){var s=this._originalMappings[i];if(s.source===n.source)return{line:r.getArg(s,"generatedLine",null),column:r.getArg(s,"generatedColumn",null),lastColumn:r.getArg(s,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}},t.BasicSourceMapConsumer=c,p.prototype=Object.create(u.prototype),p.prototype.constructor=u,p.prototype._version=3,Object.defineProperty(p.prototype,"sources",{get:function(){for(var e=[],t=0;t0?r-u>1?e(u,r,i,s,o,a):a==t.LEAST_UPPER_BOUND?r1?e(n,u,i,s,o,a):a==t.LEAST_UPPER_BOUND?u:n<0?-1:n}(-1,n.length,e,n,r,i||t.GREATEST_LOWER_BOUND);if(s<0)return-1;for(;s-1>=0&&0===r(n[s],n[s-1],!0);)--s;return s}},function(e,t){function n(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function r(e,t,i,s){if(i0&&(p&&h(p,u()),r.add(o.join(""))),t.sources.forEach(function(e){var s=t.sourceContentFor(e);null!=s&&(null!=n&&(e=i.join(n,e)),r.setSourceContent(e,s))}),r;function h(e,t){if(null===e||void 0===e.source)r.add(t);else{var s=n?i.join(n,e.source):e.source;r.add(new a(e.originalLine,e.originalColumn,s,t,e.name))}}},a.prototype.add=function(e){if(Array.isArray(e))e.forEach(function(e){this.add(e)},this);else{if(!e[o]&&"string"!=typeof e)throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);e&&this.children.push(e)}return this},a.prototype.prepend=function(e){if(Array.isArray(e))for(var t=e.length-1;t>=0;t--)this.prepend(e[t]);else{if(!e[o]&&"string"!=typeof e)throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);this.children.unshift(e)}return this},a.prototype.walk=function(e){for(var t,n=0,r=this.children.length;n0){for(t=[],n=0;n{r.call(this,e,t)}),this._printTrailingComments(e),s&&this.token(")"),this._printStack.pop(),this.format.concise=n,this._insideAux=i}_maybeAddAuxComment(e){e&&this._printAuxBeforeComment(),this._insideAux||this._printAuxAfterComment()}_printAuxBeforeComment(){if(this._printAuxAfterOnNextUserNode)return;this._printAuxAfterOnNextUserNode=!0;const e=this.format.auxiliaryCommentBefore;e&&this._printComment({type:"CommentBlock",value:e})}_printAuxAfterComment(){if(!this._printAuxAfterOnNextUserNode)return;this._printAuxAfterOnNextUserNode=!1;const e=this.format.auxiliaryCommentAfter;e&&this._printComment({type:"CommentBlock",value:e})}getPossibleRaw(e){const t=e.extra;if(t&&null!=t.raw&&null!=t.rawValue&&e.value===t.rawValue)return t.raw}printJoin(e,t,n={}){if(!e||!e.length)return;n.indent&&this.indent();const r={addNewlines:n.addNewlines};for(let i=0;i0;n&&this.indent(),this.print(e,t),n&&this.dedent()}printBlock(e){const t=e.body;a().isEmptyStatement(t)||this.space(),this.print(t,e)}_printTrailingComments(e){this._printComments(this._getComments(!1,e))}_printLeadingComments(e){this._printComments(this._getComments(!0,e))}printInnerComments(e,t=!0){e.innerComments&&e.innerComments.length&&(t&&this.indent(),this._printComments(e.innerComments),t&&this.dedent())}printSequence(e,t,n={}){return n.statement=!0,this.printJoin(e,t,n)}printList(e,t,n={}){return null==n.separator&&(n.separator=y),this.printJoin(e,t,n)}_printNewline(e,t,n,r){if(this.format.retainLines||this.format.compact)return;if(this.format.concise)return void this.space();let i=0;if(this._buf.hasContent()){e||i++,r.addNewlines&&(i+=r.addNewlines(e,t)||0),(e?o.needsWhitespaceBefore:o.needsWhitespaceAfter)(t,n)&&i++}this.newline(i)}_getComments(e,t){return t&&(e?t.leadingComments:t.trailingComments)||[]}_printComment(e){if(!this.format.shouldPrintComment(e.value))return;if(e.ignore)return;if(this._printedComments.has(e))return;if(this._printedComments.add(e),null!=e.start){if(this._printedCommentStarts[e.start])return;this._printedCommentStarts[e.start]=!0}const t="CommentBlock"===e.type;this.newline(this._buf.hasContent()&&!this._noLineTerminator&&t?1:0),this.endsWith("[")||this.endsWith("{")||this.space();let n=t||this._noLineTerminator?`/*${e.value}*/`:`//${e.value}\n`;if(t&&this.format.indent.adjustMultilineComment){const t=e.loc&&e.loc.start.column;if(t){const e=new RegExp("\\n\\s{1,"+t+"}","g");n=n.replace(e,"\n")}const r=Math.max(this._getIndent().length,this._buf.getCurrentColumn());n=n.replace(/\n(?!$)/g,`\n${(0,i().default)(" ",r)}`)}this.endsWith("/")&&this._space(),this.withSource("start",e.loc,()=>{this._append(n)}),this.newline(t&&!this._noLineTerminator?1:0)}_printComments(e){if(e&&e.length)for(const t of e)this._printComment(t)}}function y(){this.token(","),this.space()}t.default=d,Object.assign(d.prototype,u)},function(e,t,n){var r=n(50);e.exports=function(e){return"number"==typeof e&&e==r(e)}},function(e,t,n){"use strict";function r(){const e=function(e){return e&&e.__esModule?e:{default:e}}(n(277));return r=function(){return e},e}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;const i=/^[ \t]+$/;t.default=class{constructor(e){this._map=null,this._buf=[],this._last="",this._queue=[],this._position={line:1,column:0},this._sourcePosition={identifierName:null,line:null,column:null,filename:null},this._disallowedPop=null,this._map=e}get(){this._flush();const e=this._map,t={code:(0,r().default)(this._buf.join("")),map:null,rawMappings:e&&e.getRawMappings()};return e&&Object.defineProperty(t,"map",{configurable:!0,enumerable:!0,get(){return this.map=e.get()},set(e){Object.defineProperty(this,"map",{value:e,writable:!0})}}),t}append(e){this._flush();const{line:t,column:n,filename:r,identifierName:i,force:s}=this._sourcePosition;this._append(e,t,n,i,r,s)}queue(e){if("\n"===e)for(;this._queue.length>0&&i.test(this._queue[0][0]);)this._queue.shift();const{line:t,column:n,filename:r,identifierName:s,force:o}=this._sourcePosition;this._queue.unshift([e,t,n,s,r,o])}_flush(){let e;for(;e=this._queue.pop();)this._append(...e)}_append(e,t,n,r,i,s){this._map&&"\n"!==e[0]&&this._map.mark(this._position.line,this._position.column,t,n,r,i,s),this._buf.push(e),this._last=e[e.length-1];for(let t=0;t0&&"\n"===this._queue[0][0]&&this._queue.shift()}removeLastSemicolon(){this._queue.length>0&&";"===this._queue[0][0]&&this._queue.shift()}endsWith(e){if(1===e.length){let t;if(this._queue.length>0){const e=this._queue[0][0];t=e[e.length-1]}else t=this._last;return t===e}const t=this._last+this._queue.reduce((e,t)=>t[0]+e,"");return e.length<=t.length&&t.slice(-e.length)===e}hasContent(){return this._queue.length>0||!!this._last}exactSource(e,t){this.source("start",e,!0),t(),this.source("end",e),this._disallowPop("start",e)}source(e,t,n){e&&!t||this._normalizePosition(e,t,this._sourcePosition,n)}withSource(e,t,n){if(!this._map)return n();const r=this._sourcePosition.line,i=this._sourcePosition.column,s=this._sourcePosition.filename,o=this._sourcePosition.identifierName;this.source(e,t),n(),this._sourcePosition.force&&this._sourcePosition.line===r&&this._sourcePosition.column===i&&this._sourcePosition.filename===s||this._disallowedPop&&this._disallowedPop.line===r&&this._disallowedPop.column===i&&this._disallowedPop.filename===s||(this._sourcePosition.line=r,this._sourcePosition.column=i,this._sourcePosition.filename=s,this._sourcePosition.identifierName=o,this._sourcePosition.force=!1,this._disallowedPop=null)}_disallowPop(e,t){e&&!t||(this._disallowedPop=this._normalizePosition(e,t))}_normalizePosition(e,t,n,r){const i=t?t[e]:null;void 0===n&&(n={identifierName:null,line:null,column:null,filename:null,force:!1});const s=n.line,o=n.column,a=n.filename;return n.identifierName="start"===e&&t&&t.identifierName||null,n.line=i?i.line:null,n.column=i?i.column:null,n.filename=t&&t.filename||null,(r||n.line!==s||n.column!==o||n.filename!==a)&&(n.force=r),n}getCurrentColumn(){const e=this._queue.reduce((e,t)=>t[0]+e,""),t=e.lastIndexOf("\n");return-1===t?this._position.column+e.length:e.length-1-t}getCurrentLine(){const e=this._queue.reduce((e,t)=>t[0]+e,"");let t=0;for(let n=0;n({before:e.consequent.length||t.cases[0]===e,after:!e.consequent.length&&t.cases[t.cases.length-1]===e}),LogicalExpression(e){if(r().isFunction(e.left)||r().isFunction(e.right))return{after:!0}},Literal(e){if("use strict"===e.value)return{after:!0}},CallExpression(e){if(r().isFunction(e.callee)||s(e))return{before:!0,after:!0}},VariableDeclaration(e){for(let t=0;te.declarations.map(e=>e.init),ArrayExpression:e=>e.elements,ObjectExpression:e=>e.properties};t.list=u,[["Function",!0],["Class",!0],["Loop",!0],["LabeledStatement",!0],["SwitchStatement",!0],["TryStatement",!0]].forEach(function([e,t]){"boolean"==typeof t&&(t={after:t,before:t}),[e].concat(r().FLIPPED_ALIAS_KEYS[e]||[]).forEach(function(e){a[e]=function(){return t}})})},function(e,t,n){"use strict";function r(){const e=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var r=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(e,n):{};r.get||r.set?Object.defineProperty(t,n,r):t[n]=e[n]}return t.default=e,t}(n(0));return r=function(){return e},e}Object.defineProperty(t,"__esModule",{value:!0}),t.NullableTypeAnnotation=function(e,t){return r().isArrayTypeAnnotation(t)},t.FunctionTypeAnnotation=function(e,t){return r().isUnionTypeAnnotation(t)||r().isIntersectionTypeAnnotation(t)||r().isArrayTypeAnnotation(t)},t.UpdateExpression=function(e,t){return r().isMemberExpression(t,{object:e})||r().isCallExpression(t,{callee:e})||r().isNewExpression(t,{callee:e})||s(e,t)},t.ObjectExpression=function(e,t,n){return u(n,{considerArrow:!0})},t.DoExpression=function(e,t,n){return u(n)},t.Binary=function(e,t){if("**"===e.operator&&r().isBinaryExpression(t,{operator:"**"}))return t.left===e;if(s(e,t))return!0;if((r().isCallExpression(t)||r().isNewExpression(t))&&t.callee===e||r().isUnaryLike(t)||r().isMemberExpression(t)&&t.object===e||r().isAwaitExpression(t))return!0;if(r().isBinary(t)){const n=t.operator,s=i[n],o=e.operator,a=i[o];if(s===a&&t.right===e&&!r().isLogicalExpression(t)||s>a)return!0}return!1},t.IntersectionTypeAnnotation=t.UnionTypeAnnotation=function(e,t){return r().isArrayTypeAnnotation(t)||r().isNullableTypeAnnotation(t)||r().isIntersectionTypeAnnotation(t)||r().isUnionTypeAnnotation(t)},t.TSAsExpression=function(){return!0},t.TSTypeAssertion=function(){return!0},t.TSIntersectionType=t.TSUnionType=function(e,t){return r().isTSArrayType(t)||r().isTSOptionalType(t)||r().isTSIntersectionType(t)||r().isTSUnionType(t)||r().isTSRestType(t)},t.BinaryExpression=function(e,t){return"in"===e.operator&&(r().isVariableDeclarator(t)||r().isFor(t))},t.SequenceExpression=function(e,t){if(r().isForStatement(t)||r().isThrowStatement(t)||r().isReturnStatement(t)||r().isIfStatement(t)&&t.test===e||r().isWhileStatement(t)&&t.test===e||r().isForInStatement(t)&&t.right===e||r().isSwitchStatement(t)&&t.discriminant===e||r().isExpressionStatement(t)&&t.expression===e)return!1;return!0},t.AwaitExpression=t.YieldExpression=function(e,t){return r().isBinary(t)||r().isUnaryLike(t)||r().isCallExpression(t)||r().isMemberExpression(t)||r().isNewExpression(t)||r().isAwaitExpression(t)&&r().isYieldExpression(e)||r().isConditionalExpression(t)&&e===t.test||s(e,t)},t.ClassExpression=function(e,t,n){return u(n,{considerDefaultExports:!0})},t.UnaryLike=o,t.FunctionExpression=function(e,t,n){return u(n,{considerDefaultExports:!0})},t.ArrowFunctionExpression=function(e,t){return r().isExportDeclaration(t)||a(e,t)},t.ConditionalExpression=a,t.OptionalMemberExpression=function(e,t){return r().isCallExpression(t)||r().isMemberExpression(t)},t.AssignmentExpression=function(e){return!!r().isObjectPattern(e.left)||a(...arguments)},t.NewExpression=function(e,t){return s(e,t)};const i={"||":0,"&&":1,"|":2,"^":3,"&":4,"==":5,"===":5,"!=":5,"!==":5,"<":6,">":6,"<=":6,">=":6,in:6,instanceof:6,">>":7,"<<":7,">>>":7,"+":8,"-":8,"*":9,"/":9,"%":9,"**":10},s=(e,t)=>(r().isClassDeclaration(t)||r().isClassExpression(t))&&t.superClass===e;function o(e,t){return r().isMemberExpression(t,{object:e})||r().isCallExpression(t,{callee:e})||r().isNewExpression(t,{callee:e})||r().isBinaryExpression(t,{operator:"**",left:e})||s(e,t)}function a(e,t){return!!(r().isUnaryLike(t)||r().isBinary(t)||r().isConditionalExpression(t,{test:e})||r().isAwaitExpression(t)||r().isOptionalMemberExpression(t)||r().isTaggedTemplateExpression(t)||r().isTSTypeAssertion(t)||r().isTSAsExpression(t))||o(e,t)}function u(e,{considerArrow:t=!1,considerDefaultExports:n=!1}={}){let i=e.length-1,s=e[i],o=e[--i];for(;i>0;){if(r().isExpressionStatement(o,{expression:s})||r().isTaggedTemplateExpression(o)||n&&r().isExportDefaultDeclaration(o,{declaration:s})||t&&r().isArrowFunctionExpression(o,{body:s}))return!0;if(!(r().isCallExpression(o,{callee:s})||r().isSequenceExpression(o)&&o.expressions[0]===s||r().isMemberExpression(o,{object:s})||r().isConditional(o,{test:s})||r().isBinary(o,{left:s})||r().isAssignmentExpression(o,{left:s})))return!1;s=o,o=e[--i]}return!1}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(281);Object.keys(r).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return r[e]}})});var i=n(282);Object.keys(i).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return i[e]}})});var s=n(283);Object.keys(s).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return s[e]}})});var o=n(284);Object.keys(o).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return o[e]}})});var a=n(285);Object.keys(a).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return a[e]}})});var u=n(105);Object.keys(u).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return u[e]}})});var c=n(106);Object.keys(c).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return c[e]}})});var l=n(291);Object.keys(l).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return l[e]}})});var p=n(292);Object.keys(p).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return p[e]}})});var h=n(293);Object.keys(h).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return h[e]}})});var f=n(294);Object.keys(f).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return f[e]}})})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TaggedTemplateExpression=function(e){this.print(e.tag,e),this.print(e.typeParameters,e),this.print(e.quasi,e)},t.TemplateElement=function(e,t){const n=t.quasis[0]===e,r=t.quasis[t.quasis.length-1]===e,i=(n?"`":"}")+e.value.raw+(r?"`":"${");this.token(i)},t.TemplateLiteral=function(e){const t=e.quasis;for(let n=0;ne.loc.start.line?(this.indent(),this.print(t,e),this.dedent(),this._catchUp("start",e.body.loc)):this.print(t,e),this.token(")")):this.print(t,e):this._params(e);this._predicate(e),this.space(),this.token("=>"),this.space(),this.print(e.body,e)}},function(e,t,n){"use strict";(function(t){const n={},r=n.hasOwnProperty,i=(e,t)=>{for(const n in e)r.call(e,n)&&t(n,e[n])},s=n.toString,o=Array.isArray,a=t.isBuffer,u={'"':'\\"',"'":"\\'","\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t"},c=/["'\\\b\f\n\r\t]/,l=/[0-9]/,p=/[ !#-&\(-\[\]-~]/,h=(e,t)=>{const n=()=>{E=g,++t.indentLevel,g=t.indent.repeat(t.indentLevel)},r={escapeEverything:!1,minimal:!1,isScriptContext:!1,quotes:"single",wrap:!1,es6:!1,json:!1,compact:!0,lowercaseHex:!1,numbers:"decimal",indent:"\t",indentLevel:0,__inline1__:!1,__inline2__:!1},f=t&&t.json;f&&(r.quotes="double",r.wrap=!0),"single"!=(t=((e,t)=>t?(i(t,(t,n)=>{e[t]=n}),e):e)(r,t)).quotes&&"double"!=t.quotes&&"backtick"!=t.quotes&&(t.quotes="single");const d="double"==t.quotes?'"':"backtick"==t.quotes?"`":"'",y=t.compact,m=t.lowercaseHex;let g=t.indent.repeat(t.indentLevel),E="";const T=t.__inline1__,A=t.__inline2__,S=y?"":"\n";let b,x=!0;const P="binary"==t.numbers,v="octal"==t.numbers,D="decimal"==t.numbers,C="hexadecimal"==t.numbers;if(f&&e&&(e=>"function"==typeof e)(e.toJSON)&&(e=e.toJSON()),!(e=>"string"==typeof e||"[object String]"==s.call(e))(e)){if((e=>"[object Map]"==s.call(e))(e))return 0==e.size?"new Map()":(y||(t.__inline1__=!0,t.__inline2__=!1),"new Map("+h(Array.from(e),t)+")");if((e=>"[object Set]"==s.call(e))(e))return 0==e.size?"new Set()":"new Set("+h(Array.from(e),t)+")";if(a(e))return 0==e.length?"Buffer.from([])":"Buffer.from("+h(Array.from(e),t)+")";if(o(e))return b=[],t.wrap=!0,T&&(t.__inline1__=!1,t.__inline2__=!0),A||n(),((e,t)=>{const n=e.length;let r=-1;for(;++r{x=!1,A&&(t.__inline2__=!1),b.push((y||A?"":g)+h(e,t))}),x?"[]":A?"["+b.join(", ")+"]":"["+S+b.join(","+S)+S+(y?"":E)+"]";if(!(e=>"number"==typeof e||"[object Number]"==s.call(e))(e))return(e=>"[object Object]"==s.call(e))(e)?(b=[],t.wrap=!0,n(),i(e,(e,n)=>{x=!1,b.push((y?"":g)+h(e,t)+":"+(y?"":" ")+h(n,t))}),x?"{}":"{"+S+b.join(","+S)+S+(y?"":E)+"}"):f?JSON.stringify(e)||"null":String(e);if(f)return JSON.stringify(e);if(D)return String(e);if(C){let t=e.toString(16);return m||(t=t.toUpperCase()),"0x"+t}if(P)return"0b"+e.toString(2);if(v)return"0o"+e.toString(8)}const O=e;let w=-1;const F=O.length;for(b="";++w=55296&&e<=56319&&F>w+1){const t=O.charCodeAt(w+1);if(t>=56320&&t<=57343){let n=(1024*(e-55296)+t-56320+65536).toString(16);m||(n=n.toUpperCase()),b+="\\u{"+n+"}",++w;continue}}}if(!t.escapeEverything){if(p.test(e)){b+=e;continue}if('"'==e){b+=d==e?'\\"':e;continue}if("`"==e){b+=d==e?"\\`":e;continue}if("'"==e){b+=d==e?"\\'":e;continue}}if("\0"==e&&!f&&!l.test(O.charAt(w+1))){b+="\\0";continue}if(c.test(e)){b+=u[e];continue}const n=e.charCodeAt(0);if(t.minimal&&8232!=n&&8233!=n){b+=e;continue}let r=n.toString(16);m||(r=r.toUpperCase());const i=r.length>2||f,s="\\"+(i?"u":"x")+("0000"+r).slice(i?-4:-2);b+=s}return t.wrap&&(b=d+b+d),"`"==d&&(b=b.replace(/\$\{/g,"\\${")),t.isScriptContext?b.replace(/<\/(script|style)/gi,"<\\/$1").replace(/