summaryrefslogtreecommitdiffstats
path: root/devtools/client/debugger/dist
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 14:29:10 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 14:29:10 +0000
commit2aa4a82499d4becd2284cdb482213d541b8804dd (patch)
treeb80bf8bf13c3766139fbacc530efd0dd9d54394c /devtools/client/debugger/dist
parentInitial commit. (diff)
downloadfirefox-2aa4a82499d4becd2284cdb482213d541b8804dd.tar.xz
firefox-2aa4a82499d4becd2284cdb482213d541b8804dd.zip
Adding upstream version 86.0.1.upstream/86.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'devtools/client/debugger/dist')
-rw-r--r--devtools/client/debugger/dist/moz.build11
-rw-r--r--devtools/client/debugger/dist/parser-worker.js47445
-rw-r--r--devtools/client/debugger/dist/pretty-print-worker.js9637
-rw-r--r--devtools/client/debugger/dist/search-worker.js1237
-rw-r--r--devtools/client/debugger/dist/vendors.css104
-rw-r--r--devtools/client/debugger/dist/vendors.js3214
6 files changed, 61648 insertions, 0 deletions
diff --git a/devtools/client/debugger/dist/moz.build b/devtools/client/debugger/dist/moz.build
new file mode 100644
index 0000000000..64187f8ff6
--- /dev/null
+++ b/devtools/client/debugger/dist/moz.build
@@ -0,0 +1,11 @@
+# vim: set filetype=python:
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+DevToolsModules(
+ "parser-worker.js",
+ "pretty-print-worker.js",
+ "search-worker.js",
+ "vendors.js",
+)
diff --git a/devtools/client/debugger/dist/parser-worker.js b/devtools/client/debugger/dist/parser-worker.js
new file mode 100644
index 0000000000..14fef9b2bd
--- /dev/null
+++ b/devtools/client/debugger/dist/parser-worker.js
@@ -0,0 +1,47445 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+(function webpackUniversalModuleDefinition(root, factory) {
+ if(typeof exports === 'object' && typeof module === 'object')
+ module.exports = factory();
+ else if(typeof define === 'function' && define.amd)
+ define([], factory);
+ else {
+ var a = factory();
+ for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
+ }
+})(typeof self !== 'undefined' ? self : 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, {
+/******/ configurable: false,
+/******/ enumerable: true,
+/******/ get: getter
+/******/ });
+/******/ }
+/******/ };
+/******/
+/******/ // 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 = "/assets/build";
+/******/
+/******/ // Load entry module and return exports
+/******/ return __webpack_require__(__webpack_require__.s = 713);
+/******/ })
+/************************************************************************/
+/******/ ([
+/* 0 */,
+/* 1 */,
+/* 2 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+var _exportNames = {
+ react: true,
+ assertNode: true,
+ createTypeAnnotationBasedOnTypeof: true,
+ createUnionTypeAnnotation: true,
+ createFlowUnionType: true,
+ createTSUnionType: true,
+ cloneNode: true,
+ clone: true,
+ cloneDeep: true,
+ cloneDeepWithoutLoc: 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 _createFlowUnionType.default;
+ }
+});
+Object.defineProperty(exports, "createFlowUnionType", {
+ enumerable: true,
+ get: function () {
+ return _createFlowUnionType.default;
+ }
+});
+Object.defineProperty(exports, "createTSUnionType", {
+ enumerable: true,
+ get: function () {
+ return _createTSUnionType.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, "cloneDeepWithoutLoc", {
+ enumerable: true,
+ get: function () {
+ return _cloneDeepWithoutLoc.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__(715));
+
+var _isCompatTag = _interopRequireDefault(__webpack_require__(716));
+
+var _buildChildren = _interopRequireDefault(__webpack_require__(717));
+
+var _assertNode = _interopRequireDefault(__webpack_require__(788));
+
+var _generated = __webpack_require__(789);
+
+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__(790));
+
+var _createFlowUnionType = _interopRequireDefault(__webpack_require__(791));
+
+var _createTSUnionType = _interopRequireDefault(__webpack_require__(792));
+
+var _generated2 = __webpack_require__(561);
+
+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__(576));
+
+var _clone = _interopRequireDefault(__webpack_require__(794));
+
+var _cloneDeep = _interopRequireDefault(__webpack_require__(795));
+
+var _cloneDeepWithoutLoc = _interopRequireDefault(__webpack_require__(796));
+
+var _cloneWithoutLoc = _interopRequireDefault(__webpack_require__(797));
+
+var _addComment = _interopRequireDefault(__webpack_require__(798));
+
+var _addComments = _interopRequireDefault(__webpack_require__(671));
+
+var _inheritInnerComments = _interopRequireDefault(__webpack_require__(672));
+
+var _inheritLeadingComments = _interopRequireDefault(__webpack_require__(675));
+
+var _inheritsComments = _interopRequireDefault(__webpack_require__(676));
+
+var _inheritTrailingComments = _interopRequireDefault(__webpack_require__(677));
+
+var _removeComments = _interopRequireDefault(__webpack_require__(810));
+
+var _generated3 = __webpack_require__(811);
+
+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__(575);
+
+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__(812));
+
+var _toBindingIdentifierName = _interopRequireDefault(__webpack_require__(813));
+
+var _toBlock = _interopRequireDefault(__webpack_require__(678));
+
+var _toComputedKey = _interopRequireDefault(__webpack_require__(814));
+
+var _toExpression = _interopRequireDefault(__webpack_require__(815));
+
+var _toIdentifier = _interopRequireDefault(__webpack_require__(679));
+
+var _toKeyAlias = _interopRequireDefault(__webpack_require__(816));
+
+var _toSequenceExpression = _interopRequireDefault(__webpack_require__(817));
+
+var _toStatement = _interopRequireDefault(__webpack_require__(819));
+
+var _valueToNode = _interopRequireDefault(__webpack_require__(820));
+
+var _definitions = __webpack_require__(564);
+
+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__(824));
+
+var _inherits = _interopRequireDefault(__webpack_require__(825));
+
+var _prependToMemberExpression = _interopRequireDefault(__webpack_require__(826));
+
+var _removeProperties = _interopRequireDefault(__webpack_require__(682));
+
+var _removePropertiesDeep = _interopRequireDefault(__webpack_require__(680));
+
+var _removeTypeDuplicates = _interopRequireDefault(__webpack_require__(670));
+
+var _getBindingIdentifiers = _interopRequireDefault(__webpack_require__(601));
+
+var _getOuterBindingIdentifiers = _interopRequireDefault(__webpack_require__(827));
+
+var _traverse = _interopRequireDefault(__webpack_require__(828));
+
+var _traverseFast = _interopRequireDefault(__webpack_require__(681));
+
+var _shallowEqual = _interopRequireDefault(__webpack_require__(612));
+
+var _is = _interopRequireDefault(__webpack_require__(579));
+
+var _isBinding = _interopRequireDefault(__webpack_require__(829));
+
+var _isBlockScoped = _interopRequireDefault(__webpack_require__(830));
+
+var _isImmutable = _interopRequireDefault(__webpack_require__(831));
+
+var _isLet = _interopRequireDefault(__webpack_require__(683));
+
+var _isNode = _interopRequireDefault(__webpack_require__(669));
+
+var _isNodesEquivalent = _interopRequireDefault(__webpack_require__(832));
+
+var _isPlaceholderType = _interopRequireDefault(__webpack_require__(666));
+
+var _isReferenced = _interopRequireDefault(__webpack_require__(833));
+
+var _isScope = _interopRequireDefault(__webpack_require__(834));
+
+var _isSpecifierDefault = _interopRequireDefault(__webpack_require__(835));
+
+var _isType = _interopRequireDefault(__webpack_require__(626));
+
+var _isValidES3Identifier = _interopRequireDefault(__webpack_require__(836));
+
+var _isValidIdentifier = _interopRequireDefault(__webpack_require__(580));
+
+var _isVar = _interopRequireDefault(__webpack_require__(837));
+
+var _matchesPattern = _interopRequireDefault(__webpack_require__(650));
+
+var _validate = _interopRequireDefault(__webpack_require__(627));
+
+var _buildMatchMemberExpression = _interopRequireDefault(__webpack_require__(649));
+
+var _generated4 = __webpack_require__(559);
+
+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;
+
+/***/ }),
+/* 3 */,
+/* 4 */,
+/* 5 */,
+/* 6 */,
+/* 7 */,
+/* 8 */,
+/* 9 */,
+/* 10 */,
+/* 11 */,
+/* 12 */,
+/* 13 */,
+/* 14 */,
+/* 15 */,
+/* 16 */,
+/* 17 */,
+/* 18 */,
+/* 19 */,
+/* 20 */,
+/* 21 */,
+/* 22 */,
+/* 23 */,
+/* 24 */,
+/* 25 */,
+/* 26 */,
+/* 27 */,
+/* 28 */,
+/* 29 */,
+/* 30 */,
+/* 31 */,
+/* 32 */,
+/* 33 */,
+/* 34 */,
+/* 35 */,
+/* 36 */,
+/* 37 */,
+/* 38 */,
+/* 39 */,
+/* 40 */,
+/* 41 */,
+/* 42 */,
+/* 43 */,
+/* 44 */,
+/* 45 */,
+/* 46 */,
+/* 47 */,
+/* 48 */,
+/* 49 */,
+/* 50 */,
+/* 51 */,
+/* 52 */,
+/* 53 */,
+/* 54 */,
+/* 55 */,
+/* 56 */,
+/* 57 */,
+/* 58 */,
+/* 59 */,
+/* 60 */,
+/* 61 */,
+/* 62 */,
+/* 63 */,
+/* 64 */,
+/* 65 */,
+/* 66 */,
+/* 67 */,
+/* 68 */,
+/* 69 */,
+/* 70 */,
+/* 71 */,
+/* 72 */,
+/* 73 */,
+/* 74 */,
+/* 75 */,
+/* 76 */,
+/* 77 */,
+/* 78 */,
+/* 79 */,
+/* 80 */,
+/* 81 */,
+/* 82 */,
+/* 83 */,
+/* 84 */,
+/* 85 */,
+/* 86 */,
+/* 87 */,
+/* 88 */,
+/* 89 */,
+/* 90 */,
+/* 91 */,
+/* 92 */,
+/* 93 */,
+/* 94 */,
+/* 95 */,
+/* 96 */,
+/* 97 */,
+/* 98 */,
+/* 99 */,
+/* 100 */,
+/* 101 */,
+/* 102 */,
+/* 103 */,
+/* 104 */,
+/* 105 */,
+/* 106 */,
+/* 107 */,
+/* 108 */,
+/* 109 */,
+/* 110 */,
+/* 111 */,
+/* 112 */,
+/* 113 */,
+/* 114 */,
+/* 115 */,
+/* 116 */,
+/* 117 */,
+/* 118 */,
+/* 119 */,
+/* 120 */,
+/* 121 */,
+/* 122 */,
+/* 123 */,
+/* 124 */,
+/* 125 */,
+/* 126 */,
+/* 127 */,
+/* 128 */,
+/* 129 */,
+/* 130 */,
+/* 131 */,
+/* 132 */,
+/* 133 */,
+/* 134 */,
+/* 135 */,
+/* 136 */,
+/* 137 */,
+/* 138 */,
+/* 139 */,
+/* 140 */,
+/* 141 */,
+/* 142 */,
+/* 143 */,
+/* 144 */,
+/* 145 */,
+/* 146 */,
+/* 147 */,
+/* 148 */,
+/* 149 */,
+/* 150 */,
+/* 151 */,
+/* 152 */,
+/* 153 */,
+/* 154 */,
+/* 155 */,
+/* 156 */,
+/* 157 */,
+/* 158 */,
+/* 159 */,
+/* 160 */,
+/* 161 */,
+/* 162 */,
+/* 163 */,
+/* 164 */,
+/* 165 */,
+/* 166 */,
+/* 167 */,
+/* 168 */,
+/* 169 */,
+/* 170 */,
+/* 171 */,
+/* 172 */,
+/* 173 */,
+/* 174 */,
+/* 175 */,
+/* 176 */,
+/* 177 */,
+/* 178 */,
+/* 179 */,
+/* 180 */,
+/* 181 */,
+/* 182 */,
+/* 183 */,
+/* 184 */,
+/* 185 */,
+/* 186 */,
+/* 187 */,
+/* 188 */,
+/* 189 */,
+/* 190 */,
+/* 191 */,
+/* 192 */,
+/* 193 */,
+/* 194 */,
+/* 195 */,
+/* 196 */,
+/* 197 */,
+/* 198 */,
+/* 199 */,
+/* 200 */,
+/* 201 */,
+/* 202 */,
+/* 203 */,
+/* 204 */,
+/* 205 */,
+/* 206 */,
+/* 207 */,
+/* 208 */,
+/* 209 */,
+/* 210 */,
+/* 211 */,
+/* 212 */,
+/* 213 */,
+/* 214 */,
+/* 215 */,
+/* 216 */,
+/* 217 */,
+/* 218 */,
+/* 219 */,
+/* 220 */,
+/* 221 */,
+/* 222 */,
+/* 223 */,
+/* 224 */,
+/* 225 */,
+/* 226 */,
+/* 227 */,
+/* 228 */,
+/* 229 */,
+/* 230 */,
+/* 231 */,
+/* 232 */,
+/* 233 */,
+/* 234 */,
+/* 235 */,
+/* 236 */,
+/* 237 */,
+/* 238 */,
+/* 239 */,
+/* 240 */,
+/* 241 */,
+/* 242 */,
+/* 243 */,
+/* 244 */,
+/* 245 */,
+/* 246 */,
+/* 247 */,
+/* 248 */,
+/* 249 */,
+/* 250 */,
+/* 251 */,
+/* 252 */,
+/* 253 */,
+/* 254 */,
+/* 255 */,
+/* 256 */,
+/* 257 */,
+/* 258 */,
+/* 259 */,
+/* 260 */,
+/* 261 */,
+/* 262 */,
+/* 263 */,
+/* 264 */,
+/* 265 */,
+/* 266 */,
+/* 267 */,
+/* 268 */,
+/* 269 */,
+/* 270 */,
+/* 271 */,
+/* 272 */,
+/* 273 */,
+/* 274 */,
+/* 275 */,
+/* 276 */,
+/* 277 */,
+/* 278 */,
+/* 279 */,
+/* 280 */,
+/* 281 */,
+/* 282 */,
+/* 283 */,
+/* 284 */,
+/* 285 */,
+/* 286 */,
+/* 287 */,
+/* 288 */,
+/* 289 */,
+/* 290 */,
+/* 291 */,
+/* 292 */,
+/* 293 */,
+/* 294 */,
+/* 295 */,
+/* 296 */,
+/* 297 */,
+/* 298 */,
+/* 299 */,
+/* 300 */,
+/* 301 */,
+/* 302 */,
+/* 303 */,
+/* 304 */,
+/* 305 */,
+/* 306 */,
+/* 307 */,
+/* 308 */,
+/* 309 */,
+/* 310 */,
+/* 311 */,
+/* 312 */,
+/* 313 */,
+/* 314 */,
+/* 315 */,
+/* 316 */,
+/* 317 */,
+/* 318 */,
+/* 319 */,
+/* 320 */,
+/* 321 */,
+/* 322 */,
+/* 323 */,
+/* 324 */,
+/* 325 */,
+/* 326 */,
+/* 327 */,
+/* 328 */,
+/* 329 */,
+/* 330 */,
+/* 331 */,
+/* 332 */,
+/* 333 */,
+/* 334 */,
+/* 335 */,
+/* 336 */,
+/* 337 */,
+/* 338 */,
+/* 339 */,
+/* 340 */,
+/* 341 */,
+/* 342 */,
+/* 343 */,
+/* 344 */,
+/* 345 */,
+/* 346 */,
+/* 347 */,
+/* 348 */,
+/* 349 */,
+/* 350 */,
+/* 351 */,
+/* 352 */,
+/* 353 */,
+/* 354 */,
+/* 355 */,
+/* 356 */,
+/* 357 */,
+/* 358 */,
+/* 359 */,
+/* 360 */,
+/* 361 */,
+/* 362 */,
+/* 363 */,
+/* 364 */,
+/* 365 */,
+/* 366 */,
+/* 367 */,
+/* 368 */,
+/* 369 */,
+/* 370 */,
+/* 371 */,
+/* 372 */,
+/* 373 */,
+/* 374 */,
+/* 375 */,
+/* 376 */,
+/* 377 */,
+/* 378 */,
+/* 379 */,
+/* 380 */,
+/* 381 */,
+/* 382 */,
+/* 383 */,
+/* 384 */,
+/* 385 */,
+/* 386 */,
+/* 387 */,
+/* 388 */,
+/* 389 */,
+/* 390 */,
+/* 391 */,
+/* 392 */,
+/* 393 */,
+/* 394 */,
+/* 395 */,
+/* 396 */,
+/* 397 */,
+/* 398 */,
+/* 399 */,
+/* 400 */,
+/* 401 */,
+/* 402 */,
+/* 403 */,
+/* 404 */,
+/* 405 */,
+/* 406 */,
+/* 407 */,
+/* 408 */,
+/* 409 */,
+/* 410 */,
+/* 411 */,
+/* 412 */,
+/* 413 */,
+/* 414 */,
+/* 415 */,
+/* 416 */,
+/* 417 */,
+/* 418 */,
+/* 419 */,
+/* 420 */,
+/* 421 */,
+/* 422 */,
+/* 423 */,
+/* 424 */,
+/* 425 */,
+/* 426 */,
+/* 427 */,
+/* 428 */,
+/* 429 */,
+/* 430 */,
+/* 431 */,
+/* 432 */,
+/* 433 */,
+/* 434 */,
+/* 435 */,
+/* 436 */,
+/* 437 */,
+/* 438 */,
+/* 439 */,
+/* 440 */,
+/* 441 */,
+/* 442 */,
+/* 443 */,
+/* 444 */,
+/* 445 */,
+/* 446 */,
+/* 447 */,
+/* 448 */,
+/* 449 */,
+/* 450 */,
+/* 451 */,
+/* 452 */,
+/* 453 */,
+/* 454 */,
+/* 455 */,
+/* 456 */,
+/* 457 */,
+/* 458 */,
+/* 459 */,
+/* 460 */,
+/* 461 */,
+/* 462 */,
+/* 463 */,
+/* 464 */,
+/* 465 */,
+/* 466 */,
+/* 467 */,
+/* 468 */,
+/* 469 */,
+/* 470 */,
+/* 471 */,
+/* 472 */,
+/* 473 */,
+/* 474 */,
+/* 475 */,
+/* 476 */,
+/* 477 */,
+/* 478 */,
+/* 479 */,
+/* 480 */,
+/* 481 */,
+/* 482 */,
+/* 483 */,
+/* 484 */,
+/* 485 */,
+/* 486 */,
+/* 487 */,
+/* 488 */,
+/* 489 */,
+/* 490 */,
+/* 491 */,
+/* 492 */,
+/* 493 */,
+/* 494 */,
+/* 495 */,
+/* 496 */,
+/* 497 */,
+/* 498 */,
+/* 499 */,
+/* 500 */,
+/* 501 */,
+/* 502 */,
+/* 503 */,
+/* 504 */,
+/* 505 */,
+/* 506 */,
+/* 507 */,
+/* 508 */,
+/* 509 */,
+/* 510 */,
+/* 511 */,
+/* 512 */,
+/* 513 */,
+/* 514 */,
+/* 515 */,
+/* 516 */,
+/* 517 */,
+/* 518 */,
+/* 519 */,
+/* 520 */,
+/* 521 */,
+/* 522 */,
+/* 523 */,
+/* 524 */,
+/* 525 */,
+/* 526 */,
+/* 527 */,
+/* 528 */,
+/* 529 */,
+/* 530 */,
+/* 531 */,
+/* 532 */,
+/* 533 */,
+/* 534 */,
+/* 535 */,
+/* 536 */,
+/* 537 */,
+/* 538 */,
+/* 539 */,
+/* 540 */,
+/* 541 */,
+/* 542 */,
+/* 543 */,
+/* 544 */,
+/* 545 */,
+/* 546 */,
+/* 547 */,
+/* 548 */,
+/* 549 */,
+/* 550 */,
+/* 551 */,
+/* 552 */,
+/* 553 */,
+/* 554 */,
+/* 555 */,
+/* 556 */,
+/* 557 */,
+/* 558 */,
+/* 559 */
+/***/ (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.isClassExpression = isClassExpression;
+exports.isClassDeclaration = isClassDeclaration;
+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.isSymbolTypeAnnotation = isSymbolTypeAnnotation;
+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.isEnumDeclaration = isEnumDeclaration;
+exports.isEnumBooleanBody = isEnumBooleanBody;
+exports.isEnumNumberBody = isEnumNumberBody;
+exports.isEnumStringBody = isEnumStringBody;
+exports.isEnumSymbolBody = isEnumSymbolBody;
+exports.isEnumBooleanMember = isEnumBooleanMember;
+exports.isEnumNumberMember = isEnumNumberMember;
+exports.isEnumStringMember = isEnumStringMember;
+exports.isEnumDefaultedMember = isEnumDefaultedMember;
+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.isV8IntrinsicIdentifier = isV8IntrinsicIdentifier;
+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.isImportAttribute = isImportAttribute;
+exports.isDecorator = isDecorator;
+exports.isDoExpression = isDoExpression;
+exports.isExportDefaultSpecifier = isExportDefaultSpecifier;
+exports.isExportNamespaceSpecifier = isExportNamespaceSpecifier;
+exports.isPrivateName = isPrivateName;
+exports.isBigIntLiteral = isBigIntLiteral;
+exports.isRecordExpression = isRecordExpression;
+exports.isTupleExpression = isTupleExpression;
+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.isTSBooleanKeyword = isTSBooleanKeyword;
+exports.isTSBigIntKeyword = isTSBigIntKeyword;
+exports.isTSNeverKeyword = isTSNeverKeyword;
+exports.isTSNullKeyword = isTSNullKeyword;
+exports.isTSNumberKeyword = isTSNumberKeyword;
+exports.isTSObjectKeyword = isTSObjectKeyword;
+exports.isTSStringKeyword = isTSStringKeyword;
+exports.isTSSymbolKeyword = isTSSymbolKeyword;
+exports.isTSUndefinedKeyword = isTSUndefinedKeyword;
+exports.isTSUnknownKeyword = isTSUnknownKeyword;
+exports.isTSVoidKeyword = isTSVoidKeyword;
+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.isEnumBody = isEnumBody;
+exports.isEnumMember = isEnumMember;
+exports.isJSX = isJSX;
+exports.isPrivate = isPrivate;
+exports.isTSTypeElement = isTSTypeElement;
+exports.isTSType = isTSType;
+exports.isTSBaseType = isTSBaseType;
+exports.isNumberLiteral = isNumberLiteral;
+exports.isRegexLiteral = isRegexLiteral;
+exports.isRestProperty = isRestProperty;
+exports.isSpreadProperty = isSpreadProperty;
+
+var _shallowEqual = _interopRequireDefault(__webpack_require__(612));
+
+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 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 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 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 isSymbolTypeAnnotation(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "SymbolTypeAnnotation") {
+ 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 isEnumDeclaration(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "EnumDeclaration") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isEnumBooleanBody(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "EnumBooleanBody") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isEnumNumberBody(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "EnumNumberBody") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isEnumStringBody(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "EnumStringBody") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isEnumSymbolBody(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "EnumSymbolBody") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isEnumBooleanMember(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "EnumBooleanMember") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isEnumNumberMember(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "EnumNumberMember") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isEnumStringMember(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "EnumStringMember") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isEnumDefaultedMember(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "EnumDefaultedMember") {
+ 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 isV8IntrinsicIdentifier(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "V8IntrinsicIdentifier") {
+ 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 isImportAttribute(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "ImportAttribute") {
+ 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 isRecordExpression(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "RecordExpression") {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isTupleExpression(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TupleExpression") {
+ 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 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 isTSBigIntKeyword(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSBigIntKeyword") {
+ 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 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 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 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 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 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 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 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 || "RecordExpression" === nodeType || "TupleExpression" === 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 || "ClassExpression" === nodeType || "ClassDeclaration" === 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 || "EnumDeclaration" === 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 || "RegExpLiteral" === nodeType || "ArrowFunctionExpression" === 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 || "EnumDeclaration" === 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" || "ClassExpression" === nodeType || "ClassDeclaration" === 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 || "SymbolTypeAnnotation" === 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 || "SymbolTypeAnnotation" === 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 || "SymbolTypeAnnotation" === 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 isEnumBody(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "EnumBody" || "EnumBooleanBody" === nodeType || "EnumNumberBody" === nodeType || "EnumStringBody" === nodeType || "EnumSymbolBody" === nodeType) {
+ if (typeof opts === "undefined") {
+ return true;
+ } else {
+ return (0, _shallowEqual.default)(node, opts);
+ }
+ }
+
+ return false;
+}
+
+function isEnumMember(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "EnumMember" || "EnumBooleanMember" === nodeType || "EnumNumberMember" === nodeType || "EnumStringMember" === nodeType || "EnumDefaultedMember" === 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 || "TSBooleanKeyword" === nodeType || "TSBigIntKeyword" === nodeType || "TSNeverKeyword" === nodeType || "TSNullKeyword" === nodeType || "TSNumberKeyword" === nodeType || "TSObjectKeyword" === nodeType || "TSStringKeyword" === nodeType || "TSSymbolKeyword" === nodeType || "TSUndefinedKeyword" === nodeType || "TSUnknownKeyword" === nodeType || "TSVoidKeyword" === 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 isTSBaseType(node, opts) {
+ if (!node) return false;
+ const nodeType = node.type;
+
+ if (nodeType === "TSBaseType" || "TSAnyKeyword" === nodeType || "TSBooleanKeyword" === nodeType || "TSBigIntKeyword" === nodeType || "TSNeverKeyword" === nodeType || "TSNullKeyword" === nodeType || "TSNumberKeyword" === nodeType || "TSObjectKeyword" === nodeType || "TSStringKeyword" === nodeType || "TSSymbolKeyword" === nodeType || "TSUndefinedKeyword" === nodeType || "TSUnknownKeyword" === nodeType || "TSVoidKeyword" === nodeType || "TSThisType" === nodeType || "TSLiteralType" === 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;
+}
+
+/***/ }),
+/* 560 */
+/***/ (function(module, exports, __webpack_require__) {
+
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+const networkRequest = __webpack_require__(567);
+
+const workerUtils = __webpack_require__(568);
+
+module.exports = {
+ networkRequest,
+ workerUtils
+};
+
+/***/ }),
+/* 561 */
+/***/ (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.classExpression = exports.ClassExpression = ClassExpression;
+exports.classDeclaration = exports.ClassDeclaration = ClassDeclaration;
+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.symbolTypeAnnotation = exports.SymbolTypeAnnotation = SymbolTypeAnnotation;
+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.enumDeclaration = exports.EnumDeclaration = EnumDeclaration;
+exports.enumBooleanBody = exports.EnumBooleanBody = EnumBooleanBody;
+exports.enumNumberBody = exports.EnumNumberBody = EnumNumberBody;
+exports.enumStringBody = exports.EnumStringBody = EnumStringBody;
+exports.enumSymbolBody = exports.EnumSymbolBody = EnumSymbolBody;
+exports.enumBooleanMember = exports.EnumBooleanMember = EnumBooleanMember;
+exports.enumNumberMember = exports.EnumNumberMember = EnumNumberMember;
+exports.enumStringMember = exports.EnumStringMember = EnumStringMember;
+exports.enumDefaultedMember = exports.EnumDefaultedMember = EnumDefaultedMember;
+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.v8IntrinsicIdentifier = exports.V8IntrinsicIdentifier = V8IntrinsicIdentifier;
+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.importAttribute = exports.ImportAttribute = ImportAttribute;
+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.recordExpression = exports.RecordExpression = RecordExpression;
+exports.tupleExpression = exports.TupleExpression = TupleExpression;
+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.tSBooleanKeyword = exports.tsBooleanKeyword = exports.TSBooleanKeyword = TSBooleanKeyword;
+exports.tSBigIntKeyword = exports.tsBigIntKeyword = exports.TSBigIntKeyword = TSBigIntKeyword;
+exports.tSNeverKeyword = exports.tsNeverKeyword = exports.TSNeverKeyword = TSNeverKeyword;
+exports.tSNullKeyword = exports.tsNullKeyword = exports.TSNullKeyword = TSNullKeyword;
+exports.tSNumberKeyword = exports.tsNumberKeyword = exports.TSNumberKeyword = TSNumberKeyword;
+exports.tSObjectKeyword = exports.tsObjectKeyword = exports.TSObjectKeyword = TSObjectKeyword;
+exports.tSStringKeyword = exports.tsStringKeyword = exports.TSStringKeyword = TSStringKeyword;
+exports.tSSymbolKeyword = exports.tsSymbolKeyword = exports.TSSymbolKeyword = TSSymbolKeyword;
+exports.tSUndefinedKeyword = exports.tsUndefinedKeyword = exports.TSUndefinedKeyword = TSUndefinedKeyword;
+exports.tSUnknownKeyword = exports.tsUnknownKeyword = exports.TSUnknownKeyword = TSUnknownKeyword;
+exports.tSVoidKeyword = exports.tsVoidKeyword = exports.TSVoidKeyword = TSVoidKeyword;
+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__(719));
+
+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 ClassExpression(...args) {
+ return (0, _builder.default)("ClassExpression", ...args);
+}
+
+function ClassDeclaration(...args) {
+ return (0, _builder.default)("ClassDeclaration", ...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 SymbolTypeAnnotation(...args) {
+ return (0, _builder.default)("SymbolTypeAnnotation", ...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 EnumDeclaration(...args) {
+ return (0, _builder.default)("EnumDeclaration", ...args);
+}
+
+function EnumBooleanBody(...args) {
+ return (0, _builder.default)("EnumBooleanBody", ...args);
+}
+
+function EnumNumberBody(...args) {
+ return (0, _builder.default)("EnumNumberBody", ...args);
+}
+
+function EnumStringBody(...args) {
+ return (0, _builder.default)("EnumStringBody", ...args);
+}
+
+function EnumSymbolBody(...args) {
+ return (0, _builder.default)("EnumSymbolBody", ...args);
+}
+
+function EnumBooleanMember(...args) {
+ return (0, _builder.default)("EnumBooleanMember", ...args);
+}
+
+function EnumNumberMember(...args) {
+ return (0, _builder.default)("EnumNumberMember", ...args);
+}
+
+function EnumStringMember(...args) {
+ return (0, _builder.default)("EnumStringMember", ...args);
+}
+
+function EnumDefaultedMember(...args) {
+ return (0, _builder.default)("EnumDefaultedMember", ...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 V8IntrinsicIdentifier(...args) {
+ return (0, _builder.default)("V8IntrinsicIdentifier", ...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 ImportAttribute(...args) {
+ return (0, _builder.default)("ImportAttribute", ...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 RecordExpression(...args) {
+ return (0, _builder.default)("RecordExpression", ...args);
+}
+
+function TupleExpression(...args) {
+ return (0, _builder.default)("TupleExpression", ...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 TSBooleanKeyword(...args) {
+ return (0, _builder.default)("TSBooleanKeyword", ...args);
+}
+
+function TSBigIntKeyword(...args) {
+ return (0, _builder.default)("TSBigIntKeyword", ...args);
+}
+
+function TSNeverKeyword(...args) {
+ return (0, _builder.default)("TSNeverKeyword", ...args);
+}
+
+function TSNullKeyword(...args) {
+ return (0, _builder.default)("TSNullKeyword", ...args);
+}
+
+function TSNumberKeyword(...args) {
+ return (0, _builder.default)("TSNumberKeyword", ...args);
+}
+
+function TSObjectKeyword(...args) {
+ return (0, _builder.default)("TSObjectKeyword", ...args);
+}
+
+function TSStringKeyword(...args) {
+ return (0, _builder.default)("TSStringKeyword", ...args);
+}
+
+function TSSymbolKeyword(...args) {
+ return (0, _builder.default)("TSSymbolKeyword", ...args);
+}
+
+function TSUndefinedKeyword(...args) {
+ return (0, _builder.default)("TSUndefinedKeyword", ...args);
+}
+
+function TSUnknownKeyword(...args) {
+ return (0, _builder.default)("TSUnknownKeyword", ...args);
+}
+
+function TSVoidKeyword(...args) {
+ return (0, _builder.default)("TSVoidKeyword", ...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);
+}
+
+/***/ }),
+/* 562 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var freeGlobal = __webpack_require__(589);
+
+/** Detect free variable `self`. */
+var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
+
+/** Used as a reference to the global object. */
+var root = freeGlobal || freeSelf || Function('return this')();
+
+module.exports = root;
+
+
+/***/ }),
+/* 563 */
+/***/ (function(module, exports) {
+
+/**
+ * Checks if `value` is classified as an `Array` object.
+ *
+ * @static
+ * @memberOf _
+ * @since 0.1.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is an array, else `false`.
+ * @example
+ *
+ * _.isArray([1, 2, 3]);
+ * // => true
+ *
+ * _.isArray(document.body.children);
+ * // => false
+ *
+ * _.isArray('abc');
+ * // => false
+ *
+ * _.isArray(_.noop);
+ * // => false
+ */
+var isArray = Array.isArray;
+
+module.exports = isArray;
+
+
+/***/ }),
+/* 564 */
+/***/ (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, "NODE_PARENT_VALIDATIONS", {
+ enumerable: true,
+ get: function () {
+ return _utils.NODE_PARENT_VALIDATIONS;
+ }
+});
+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;
+
+var _toFastProperties = _interopRequireDefault(__webpack_require__(780));
+
+__webpack_require__(600);
+
+__webpack_require__(628);
+
+__webpack_require__(783);
+
+__webpack_require__(784);
+
+__webpack_require__(785);
+
+__webpack_require__(786);
+
+__webpack_require__(787);
+
+var _utils = __webpack_require__(571);
+
+var _placeholders = __webpack_require__(668);
+
+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;
+
+/***/ }),
+/* 565 */
+/***/ (function(module, exports) {
+
+/**
+ * Checks if `value` is object-like. A value is object-like if it's not `null`
+ * and has a `typeof` result of "object".
+ *
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
+ * @example
+ *
+ * _.isObjectLike({});
+ * // => true
+ *
+ * _.isObjectLike([1, 2, 3]);
+ * // => true
+ *
+ * _.isObjectLike(_.noop);
+ * // => false
+ *
+ * _.isObjectLike(null);
+ * // => false
+ */
+function isObjectLike(value) {
+ return value != null && typeof value == 'object';
+}
+
+module.exports = isObjectLike;
+
+
+/***/ }),
+/* 566 */
+/***/ (function(module, exports) {
+
+/* -*- Mode: js; js-indent-level: 2; -*- */
+/*
+ * Copyright 2011 Mozilla Foundation and contributors
+ * Licensed under the New BSD license. See LICENSE or:
+ * http://opensource.org/licenses/BSD-3-Clause
+ */
+
+/**
+ * This is a helper function for getting values from parameter/options
+ * objects.
+ *
+ * @param args The object we are extracting values from
+ * @param name The name of the property we are getting.
+ * @param defaultValue An optional value to return if the property is missing
+ * from the object. If this is not specified and the property is missing, an
+ * error will be thrown.
+ */
+function getArg(aArgs, aName, aDefaultValue) {
+ if (aName in aArgs) {
+ return aArgs[aName];
+ } else if (arguments.length === 3) {
+ return aDefaultValue;
+ } else {
+ throw new Error('"' + aName + '" is a required argument.');
+ }
+}
+exports.getArg = getArg;
+
+var urlRegexp = /^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.]*)(?::(\d+))?(\S*)$/;
+var dataUrlRegexp = /^data:.+\,.+$/;
+
+function urlParse(aUrl) {
+ var match = aUrl.match(urlRegexp);
+ if (!match) {
+ return null;
+ }
+ return {
+ scheme: match[1],
+ auth: match[2],
+ host: match[3],
+ port: match[4],
+ path: match[5]
+ };
+}
+exports.urlParse = urlParse;
+
+function urlGenerate(aParsedUrl) {
+ var url = '';
+ if (aParsedUrl.scheme) {
+ url += aParsedUrl.scheme + ':';
+ }
+ url += '//';
+ if (aParsedUrl.auth) {
+ url += aParsedUrl.auth + '@';
+ }
+ if (aParsedUrl.host) {
+ url += aParsedUrl.host;
+ }
+ if (aParsedUrl.port) {
+ url += ":" + aParsedUrl.port
+ }
+ if (aParsedUrl.path) {
+ url += aParsedUrl.path;
+ }
+ return url;
+}
+exports.urlGenerate = urlGenerate;
+
+/**
+ * Normalizes a path, or the path portion of a URL:
+ *
+ * - Replaces consecutive slashes with one slash.
+ * - Removes unnecessary '.' parts.
+ * - Removes unnecessary '<dir>/..' parts.
+ *
+ * Based on code in the Node.js 'path' core module.
+ *
+ * @param aPath The path or url to normalize.
+ */
+function normalize(aPath) {
+ var path = aPath;
+ var url = urlParse(aPath);
+ if (url) {
+ if (!url.path) {
+ return aPath;
+ }
+ path = url.path;
+ }
+ var isAbsolute = exports.isAbsolute(path);
+
+ var parts = path.split(/\/+/);
+ for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {
+ part = parts[i];
+ if (part === '.') {
+ parts.splice(i, 1);
+ } else if (part === '..') {
+ up++;
+ } else if (up > 0) {
+ if (part === '') {
+ // The first part is blank if the path is absolute. Trying to go
+ // above the root is a no-op. Therefore we can remove all '..' parts
+ // directly after the root.
+ parts.splice(i + 1, up);
+ up = 0;
+ } else {
+ parts.splice(i, 2);
+ up--;
+ }
+ }
+ }
+ path = parts.join('/');
+
+ if (path === '') {
+ path = isAbsolute ? '/' : '.';
+ }
+
+ if (url) {
+ url.path = path;
+ return urlGenerate(url);
+ }
+ return path;
+}
+exports.normalize = normalize;
+
+/**
+ * Joins two paths/URLs.
+ *
+ * @param aRoot The root path or URL.
+ * @param aPath The path or URL to be joined with the root.
+ *
+ * - If aPath is a URL or a data URI, aPath is returned, unless aPath is a
+ * scheme-relative URL: Then the scheme of aRoot, if any, is prepended
+ * first.
+ * - Otherwise aPath is a path. If aRoot is a URL, then its path portion
+ * is updated with the result and aRoot is returned. Otherwise the result
+ * is returned.
+ * - If aPath is absolute, the result is aPath.
+ * - Otherwise the two paths are joined with a slash.
+ * - Joining for example 'http://' and 'www.example.com' is also supported.
+ */
+function join(aRoot, aPath) {
+ if (aRoot === "") {
+ aRoot = ".";
+ }
+ if (aPath === "") {
+ aPath = ".";
+ }
+ var aPathUrl = urlParse(aPath);
+ var aRootUrl = urlParse(aRoot);
+ if (aRootUrl) {
+ aRoot = aRootUrl.path || '/';
+ }
+
+ // `join(foo, '//www.example.org')`
+ if (aPathUrl && !aPathUrl.scheme) {
+ if (aRootUrl) {
+ aPathUrl.scheme = aRootUrl.scheme;
+ }
+ return urlGenerate(aPathUrl);
+ }
+
+ if (aPathUrl || aPath.match(dataUrlRegexp)) {
+ return aPath;
+ }
+
+ // `join('http://', 'www.example.com')`
+ if (aRootUrl && !aRootUrl.host && !aRootUrl.path) {
+ aRootUrl.host = aPath;
+ return urlGenerate(aRootUrl);
+ }
+
+ var joined = aPath.charAt(0) === '/'
+ ? aPath
+ : normalize(aRoot.replace(/\/+$/, '') + '/' + aPath);
+
+ if (aRootUrl) {
+ aRootUrl.path = joined;
+ return urlGenerate(aRootUrl);
+ }
+ return joined;
+}
+exports.join = join;
+
+exports.isAbsolute = function (aPath) {
+ return aPath.charAt(0) === '/' || !!aPath.match(urlRegexp);
+};
+
+/**
+ * Make a path relative to a URL or another path.
+ *
+ * @param aRoot The root path or URL.
+ * @param aPath The path or URL to be made relative to aRoot.
+ */
+function relative(aRoot, aPath) {
+ if (aRoot === "") {
+ aRoot = ".";
+ }
+
+ aRoot = aRoot.replace(/\/$/, '');
+
+ // It is possible for the path to be above the root. In this case, simply
+ // checking whether the root is a prefix of the path won't work. Instead, we
+ // need to remove components from the root one by one, until either we find
+ // a prefix that fits, or we run out of components to remove.
+ var level = 0;
+ while (aPath.indexOf(aRoot + '/') !== 0) {
+ var index = aRoot.lastIndexOf("/");
+ if (index < 0) {
+ return aPath;
+ }
+
+ // If the only part of the root that is left is the scheme (i.e. http://,
+ // file:///, etc.), one or more slashes (/), or simply nothing at all, we
+ // have exhausted all components, so the path is not relative to the root.
+ aRoot = aRoot.slice(0, index);
+ if (aRoot.match(/^([^\/]+:\/)?\/*$/)) {
+ return aPath;
+ }
+
+ ++level;
+ }
+
+ // Make sure we add a "../" for each component we removed from the root.
+ return Array(level + 1).join("../") + aPath.substr(aRoot.length + 1);
+}
+exports.relative = relative;
+
+var supportsNullProto = (function () {
+ var obj = Object.create(null);
+ return !('__proto__' in obj);
+}());
+
+function identity (s) {
+ return s;
+}
+
+/**
+ * Because behavior goes wacky when you set `__proto__` on objects, we
+ * have to prefix all the strings in our set with an arbitrary character.
+ *
+ * See https://github.com/mozilla/source-map/pull/31 and
+ * https://github.com/mozilla/source-map/issues/30
+ *
+ * @param String aStr
+ */
+function toSetString(aStr) {
+ if (isProtoString(aStr)) {
+ return '$' + aStr;
+ }
+
+ return aStr;
+}
+exports.toSetString = supportsNullProto ? identity : toSetString;
+
+function fromSetString(aStr) {
+ if (isProtoString(aStr)) {
+ return aStr.slice(1);
+ }
+
+ return aStr;
+}
+exports.fromSetString = supportsNullProto ? identity : fromSetString;
+
+function isProtoString(s) {
+ if (!s) {
+ return false;
+ }
+
+ var length = s.length;
+
+ if (length < 9 /* "__proto__".length */) {
+ return false;
+ }
+
+ if (s.charCodeAt(length - 1) !== 95 /* '_' */ ||
+ s.charCodeAt(length - 2) !== 95 /* '_' */ ||
+ s.charCodeAt(length - 3) !== 111 /* 'o' */ ||
+ s.charCodeAt(length - 4) !== 116 /* 't' */ ||
+ s.charCodeAt(length - 5) !== 111 /* 'o' */ ||
+ s.charCodeAt(length - 6) !== 114 /* 'r' */ ||
+ s.charCodeAt(length - 7) !== 112 /* 'p' */ ||
+ s.charCodeAt(length - 8) !== 95 /* '_' */ ||
+ s.charCodeAt(length - 9) !== 95 /* '_' */) {
+ return false;
+ }
+
+ for (var i = length - 10; i >= 0; i--) {
+ if (s.charCodeAt(i) !== 36 /* '$' */) {
+ return false;
+ }
+ }
+
+ return true;
+}
+
+/**
+ * Comparator between two mappings where the original positions are compared.
+ *
+ * Optionally pass in `true` as `onlyCompareGenerated` to consider two
+ * mappings with the same original source/line/column, but different generated
+ * line and column the same. Useful when searching for a mapping with a
+ * stubbed out mapping.
+ */
+function compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) {
+ var cmp = mappingA.source - mappingB.source;
+ if (cmp !== 0) {
+ return cmp;
+ }
+
+ cmp = mappingA.originalLine - mappingB.originalLine;
+ if (cmp !== 0) {
+ return cmp;
+ }
+
+ cmp = mappingA.originalColumn - mappingB.originalColumn;
+ if (cmp !== 0 || onlyCompareOriginal) {
+ return cmp;
+ }
+
+ cmp = mappingA.generatedColumn - mappingB.generatedColumn;
+ if (cmp !== 0) {
+ return cmp;
+ }
+
+ cmp = mappingA.generatedLine - mappingB.generatedLine;
+ if (cmp !== 0) {
+ return cmp;
+ }
+
+ return mappingA.name - mappingB.name;
+}
+exports.compareByOriginalPositions = compareByOriginalPositions;
+
+/**
+ * Comparator between two mappings with deflated source and name indices where
+ * the generated positions are compared.
+ *
+ * Optionally pass in `true` as `onlyCompareGenerated` to consider two
+ * mappings with the same generated line and column, but different
+ * source/name/original line and column the same. Useful when searching for a
+ * mapping with a stubbed out mapping.
+ */
+function compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) {
+ var cmp = mappingA.generatedLine - mappingB.generatedLine;
+ if (cmp !== 0) {
+ return cmp;
+ }
+
+ cmp = mappingA.generatedColumn - mappingB.generatedColumn;
+ if (cmp !== 0 || onlyCompareGenerated) {
+ return cmp;
+ }
+
+ cmp = mappingA.source - mappingB.source;
+ if (cmp !== 0) {
+ return cmp;
+ }
+
+ cmp = mappingA.originalLine - mappingB.originalLine;
+ if (cmp !== 0) {
+ return cmp;
+ }
+
+ cmp = mappingA.originalColumn - mappingB.originalColumn;
+ if (cmp !== 0) {
+ return cmp;
+ }
+
+ return mappingA.name - mappingB.name;
+}
+exports.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated;
+
+function strcmp(aStr1, aStr2) {
+ if (aStr1 === aStr2) {
+ return 0;
+ }
+
+ if (aStr1 > aStr2) {
+ return 1;
+ }
+
+ return -1;
+}
+
+/**
+ * Comparator between two mappings with inflated source and name strings where
+ * the generated positions are compared.
+ */
+function compareByGeneratedPositionsInflated(mappingA, mappingB) {
+ var cmp = mappingA.generatedLine - mappingB.generatedLine;
+ if (cmp !== 0) {
+ return cmp;
+ }
+
+ cmp = mappingA.generatedColumn - mappingB.generatedColumn;
+ if (cmp !== 0) {
+ return cmp;
+ }
+
+ cmp = strcmp(mappingA.source, mappingB.source);
+ if (cmp !== 0) {
+ return cmp;
+ }
+
+ cmp = mappingA.originalLine - mappingB.originalLine;
+ if (cmp !== 0) {
+ return cmp;
+ }
+
+ cmp = mappingA.originalColumn - mappingB.originalColumn;
+ if (cmp !== 0) {
+ return cmp;
+ }
+
+ return strcmp(mappingA.name, mappingB.name);
+}
+exports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated;
+
+
+/***/ }),
+/* 567 */
+/***/ (function(module, exports) {
+
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+function networkRequest(url, opts) {
+ return fetch(url, {
+ cache: opts.loadFromCache ? "default" : "no-cache"
+ }).then(res => {
+ if (res.status >= 200 && res.status < 300) {
+ if (res.headers.get("Content-Type") === "application/wasm") {
+ return res.arrayBuffer().then(buffer => ({
+ content: buffer,
+ isDwarf: true
+ }));
+ }
+
+ return res.text().then(text => ({
+ content: text
+ }));
+ }
+
+ return Promise.reject(`request failed with status ${res.status}`);
+ });
+}
+
+module.exports = networkRequest;
+
+/***/ }),
+/* 568 */
+/***/ (function(module, exports) {
+
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+function WorkerDispatcher() {
+ this.msgId = 1;
+ this.worker = null;
+}
+
+WorkerDispatcher.prototype = {
+ start(url, win = window) {
+ this.worker = new win.Worker(url);
+
+ this.worker.onerror = err => {
+ console.error(`Error in worker ${url}`, err.message);
+ };
+ },
+
+ stop() {
+ if (!this.worker) {
+ return;
+ }
+
+ this.worker.terminate();
+ this.worker = null;
+ },
+
+ task(method, {
+ queue = false
+ } = {}) {
+ const calls = [];
+
+ const push = args => {
+ return new Promise((resolve, reject) => {
+ if (queue && calls.length === 0) {
+ Promise.resolve().then(flush);
+ }
+
+ calls.push([args, resolve, reject]);
+
+ if (!queue) {
+ flush();
+ }
+ });
+ };
+
+ const flush = () => {
+ const items = calls.slice();
+ calls.length = 0;
+
+ if (!this.worker) {
+ return;
+ }
+
+ const id = this.msgId++;
+ this.worker.postMessage({
+ id,
+ method,
+ calls: items.map(item => item[0])
+ });
+
+ const listener = ({
+ data: result
+ }) => {
+ if (result.id !== id) {
+ return;
+ }
+
+ if (!this.worker) {
+ return;
+ }
+
+ this.worker.removeEventListener("message", listener);
+ result.results.forEach((resultData, i) => {
+ const [, resolve, reject] = items[i];
+
+ if (resultData.error) {
+ const err = new Error(resultData.message);
+ err.metadata = resultData.metadata;
+ reject(err);
+ } else {
+ resolve(resultData.response);
+ }
+ });
+ };
+
+ this.worker.addEventListener("message", listener);
+ };
+
+ return (...args) => push(args);
+ },
+
+ invoke(method, ...args) {
+ return this.task(method)(...args);
+ }
+
+};
+
+function workerHandler(publicInterface) {
+ return function (msg) {
+ const {
+ id,
+ method,
+ calls
+ } = msg.data;
+ Promise.all(calls.map(args => {
+ try {
+ const response = publicInterface[method].apply(undefined, args);
+
+ if (response instanceof Promise) {
+ return response.then(val => ({
+ response: val
+ }), err => asErrorMessage(err));
+ }
+
+ return {
+ response
+ };
+ } catch (error) {
+ return asErrorMessage(error);
+ }
+ })).then(results => {
+ self.postMessage({
+ id,
+ results
+ });
+ });
+ };
+}
+
+function asErrorMessage(error) {
+ if (typeof error === "object" && error && "message" in error) {
+ // Error can't be sent via postMessage, so be sure to convert to
+ // string.
+ return {
+ error: true,
+ message: error.message,
+ metadata: error.metadata
+ };
+ }
+
+ return {
+ error: true,
+ message: error == null ? error : error.toString(),
+ metadata: undefined
+ };
+}
+
+module.exports = {
+ WorkerDispatcher,
+ workerHandler
+};
+
+/***/ }),
+/* 569 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var Symbol = __webpack_require__(570),
+ getRawTag = __webpack_require__(615),
+ objectToString = __webpack_require__(616);
+
+/** `Object#toString` result references. */
+var nullTag = '[object Null]',
+ undefinedTag = '[object Undefined]';
+
+/** Built-in value references. */
+var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
+
+/**
+ * The base implementation of `getTag` without fallbacks for buggy environments.
+ *
+ * @private
+ * @param {*} value The value to query.
+ * @returns {string} Returns the `toStringTag`.
+ */
+function baseGetTag(value) {
+ if (value == null) {
+ return value === undefined ? undefinedTag : nullTag;
+ }
+ return (symToStringTag && symToStringTag in Object(value))
+ ? getRawTag(value)
+ : objectToString(value);
+}
+
+module.exports = baseGetTag;
+
+
+/***/ }),
+/* 570 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var root = __webpack_require__(562);
+
+/** Built-in value references. */
+var Symbol = root.Symbol;
+
+module.exports = Symbol;
+
+
+/***/ }),
+/* 571 */
+/***/ (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.assertOptionalChainStart = assertOptionalChainStart;
+exports.chain = chain;
+exports.default = defineType;
+exports.NODE_PARENT_VALIDATIONS = 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__(579));
+
+var _validate = __webpack_require__(627);
+
+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;
+const NODE_PARENT_VALIDATIONS = {};
+exports.NODE_PARENT_VALIDATIONS = NODE_PARENT_VALIDATIONS;
+
+function getType(val) {
+ if (Array.isArray(val)) {
+ return "array";
+ } else if (val === null) {
+ return "null";
+ } 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++) {
+ const subkey = `${key}[${i}]`;
+ const v = val[i];
+ callback(node, subkey, v);
+ if (Object({"NODE_ENV":"production"}).BABEL_TYPES_8_BREAKING) (0, _validate.validateChild)(node, subkey, v);
+ }
+ }
+
+ 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) {
+ for (const type of types) {
+ if ((0, _is.default)(type, val)) {
+ (0, _validate.validateChild)(node, key, val);
+ return;
+ }
+ }
+
+ throw new TypeError(`Property ${key} of ${node.type} expected node to be of a type ${JSON.stringify(types)} but instead got ${JSON.stringify(val == null ? void 0 : val.type)}`);
+ }
+
+ validate.oneOfNodeTypes = types;
+ return validate;
+}
+
+function assertNodeOrValueType(...types) {
+ function validate(node, key, val) {
+ for (const type of types) {
+ if (getType(val) === type || (0, _is.default)(type, val)) {
+ (0, _validate.validateChild)(node, key, val);
+ return;
+ }
+ }
+
+ throw new TypeError(`Property ${key} of ${node.type} expected node to be of a type ${JSON.stringify(types)} but instead got ${JSON.stringify(val == null ? void 0 : 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 assertOptionalChainStart() {
+ function validate(node) {
+ var _current;
+
+ let current = node;
+
+ while (node) {
+ const {
+ type
+ } = current;
+
+ if (type === "OptionalCallExpression") {
+ if (current.optional) return;
+ current = current.callee;
+ continue;
+ }
+
+ if (type === "OptionalMemberExpression") {
+ if (current.optional) return;
+ current = current.object;
+ continue;
+ }
+
+ break;
+ }
+
+ throw new TypeError(`Non-optional ${node.type} must chain from an optional OptionalMemberExpression or OptionalCallExpression. Found chain from ${(_current = current) == null ? void 0 : _current.type}`);
+ }
+
+ return validate;
+}
+
+function chain(...fns) {
+ function validate(...args) {
+ for (const fn of fns) {
+ fn(...args);
+ }
+ }
+
+ validate.chainOf = fns;
+ return validate;
+}
+
+const validTypeOpts = ["aliases", "builder", "deprecatedAlias", "fields", "inherits", "visitor", "validate"];
+const validFieldKeys = ["default", "optional", "validate"];
+
+function defineType(type, opts = {}) {
+ const inherits = opts.inherits && store[opts.inherits] || {};
+ let fields = opts.fields;
+
+ if (!fields) {
+ fields = {};
+
+ if (inherits.fields) {
+ const keys = Object.getOwnPropertyNames(inherits.fields);
+
+ for (const key of keys) {
+ const field = inherits.fields[key];
+ fields[key] = {
+ default: field.default,
+ optional: field.optional,
+ validate: field.validate
+ };
+ }
+ }
+ }
+
+ const visitor = opts.visitor || inherits.visitor || [];
+ const aliases = opts.aliases || inherits.aliases || [];
+ const builder = opts.builder || inherits.builder || opts.visitor || [];
+
+ for (const k of Object.keys(opts)) {
+ if (validTypeOpts.indexOf(k) === -1) {
+ throw new Error(`Unknown type option "${k}" on ${type}`);
+ }
+ }
+
+ 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 (field.default !== undefined && builder.indexOf(key) === -1) {
+ field.optional = true;
+ }
+
+ if (field.default === undefined) {
+ field.default = null;
+ } else if (!field.validate && field.default != null) {
+ field.validate = assertValueType(getType(field.default));
+ }
+
+ for (const k of Object.keys(field)) {
+ if (validFieldKeys.indexOf(k) === -1) {
+ throw new Error(`Unknown field key "${k}" on ${type}.${key}`);
+ }
+ }
+ }
+
+ 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);
+ });
+
+ if (opts.validate) {
+ NODE_PARENT_VALIDATIONS[type] = opts.validate;
+ }
+
+ store[type] = opts;
+}
+
+const store = {};
+
+/***/ }),
+/* 572 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.parse = parse;
+exports.parseConsoleScript = parseConsoleScript;
+exports.parseScript = parseScript;
+exports.getAst = getAst;
+exports.clearASTs = clearASTs;
+exports.traverseAst = traverseAst;
+exports.hasNode = hasNode;
+exports.replaceNode = replaceNode;
+
+var _parseScriptTags = _interopRequireDefault(__webpack_require__(838));
+
+var babelParser = _interopRequireWildcard(__webpack_require__(685));
+
+var t = _interopRequireWildcard(__webpack_require__(2));
+
+var _isEmpty = _interopRequireDefault(__webpack_require__(686));
+
+var _sources = __webpack_require__(687);
+
+function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
+
+function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+let ASTs = new Map();
+
+function _parse(code, opts) {
+ return babelParser.parse(code, { ...opts,
+ tokens: true
+ });
+}
+
+const sourceOptions = {
+ generated: {
+ sourceType: "unambiguous",
+ tokens: true,
+ plugins: ["classProperties", "objectRestSpread", "optionalChaining", "nullishCoalescingOperator"]
+ },
+ original: {
+ sourceType: "unambiguous",
+ tokens: true,
+ plugins: ["jsx", "flow", "doExpressions", "optionalChaining", "nullishCoalescingOperator", "decorators-legacy", "objectRestSpread", "classProperties", "exportDefaultFrom", "exportNamespaceFrom", "asyncGenerators", "functionBind", "functionSent", "dynamicImport", "react-jsx"]
+ }
+};
+
+function parse(text, opts) {
+ let ast;
+
+ if (!text) {
+ return;
+ }
+
+ try {
+ ast = _parse(text, opts);
+ } catch (error) {
+ console.error(error);
+ ast = {};
+ }
+
+ return ast;
+} // Custom parser for parse-script-tags that adapts its input structure to
+// our parser's signature
+
+
+function htmlParser({
+ source,
+ line
+}) {
+ return parse(source, {
+ startLine: line,
+ ...sourceOptions.generated
+ });
+}
+
+const VUE_COMPONENT_START = /^\s*</;
+
+function vueParser({
+ source,
+ line
+}) {
+ return parse(source, {
+ startLine: line,
+ ...sourceOptions.original
+ });
+}
+
+function parseVueScript(code) {
+ if (typeof code !== "string") {
+ return;
+ }
+
+ let ast; // .vue files go through several passes, so while there is a
+ // single-file-component Vue template, there are also generally .vue files
+ // that are still just JS as well.
+
+ if (code.match(VUE_COMPONENT_START)) {
+ ast = (0, _parseScriptTags.default)(code, vueParser);
+
+ if (t.isFile(ast)) {
+ // parseScriptTags is currently hard-coded to return scripts, but Vue
+ // always expects ESM syntax, so we just hard-code it.
+ ast.program.sourceType = "module";
+ }
+ } else {
+ ast = parse(code, sourceOptions.original);
+ }
+
+ return ast;
+}
+
+function parseConsoleScript(text, opts) {
+ try {
+ return _parse(text, {
+ plugins: ["objectRestSpread", "dynamicImport", "nullishCoalescingOperator", "optionalChaining"],
+ ...opts,
+ allowAwaitOutsideFunction: true
+ });
+ } catch (e) {
+ return null;
+ }
+}
+
+function parseScript(text, opts) {
+ return _parse(text, opts);
+}
+
+function getAst(sourceId) {
+ if (ASTs.has(sourceId)) {
+ return ASTs.get(sourceId);
+ }
+
+ const source = (0, _sources.getSource)(sourceId);
+
+ if (source.isWasm) {
+ return null;
+ }
+
+ let ast = {};
+ const {
+ contentType
+ } = source;
+
+ if (contentType == "text/html") {
+ ast = (0, _parseScriptTags.default)(source.text, htmlParser) || {};
+ } else if (contentType && contentType === "text/vue") {
+ ast = parseVueScript(source.text) || {};
+ } else if (contentType && contentType.match(/(javascript|jsx)/) && !contentType.match(/typescript-jsx/)) {
+ const type = source.id.includes("original") ? "original" : "generated";
+ const options = sourceOptions[type];
+ ast = parse(source.text, options);
+ } else if (contentType && contentType.match(/typescript/)) {
+ const options = { ...sourceOptions.original,
+ plugins: [...sourceOptions.original.plugins.filter(p => p !== "flow" && p !== "decorators" && p !== "decorators2" && (p !== "jsx" || contentType.match(/typescript-jsx/))), "decorators-legacy", "typescript"]
+ };
+ ast = parse(source.text, options);
+ }
+
+ ASTs.set(source.id, ast);
+ return ast;
+}
+
+function clearASTs() {
+ ASTs = new Map();
+}
+
+function traverseAst(sourceId, visitor, state) {
+ const ast = getAst(sourceId);
+
+ if ((0, _isEmpty.default)(ast)) {
+ return null;
+ }
+
+ t.traverse(ast, visitor, state);
+ return ast;
+}
+
+function hasNode(rootNode, predicate) {
+ try {
+ t.traverse(rootNode, {
+ enter: (node, ancestors) => {
+ if (predicate(node, ancestors)) {
+ throw new Error("MATCH");
+ }
+ }
+ });
+ } catch (e) {
+ if (e.message === "MATCH") {
+ return true;
+ }
+ }
+
+ return false;
+}
+
+function replaceNode(ancestors, node) {
+ const parent = ancestors[ancestors.length - 1];
+
+ if (typeof parent.index === "number") {
+ if (Array.isArray(node)) {
+ parent.node[parent.key].splice(parent.index, 1, ...node);
+ } else {
+ parent.node[parent.key][parent.index] = node;
+ }
+ } else {
+ parent.node[parent.key] = node;
+ }
+}
+
+/***/ }),
+/* 573 */
+/***/ (function(module, exports) {
+
+/**
+ * Checks if `value` is the
+ * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
+ * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
+ *
+ * @static
+ * @memberOf _
+ * @since 0.1.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is an object, else `false`.
+ * @example
+ *
+ * _.isObject({});
+ * // => true
+ *
+ * _.isObject([1, 2, 3]);
+ * // => true
+ *
+ * _.isObject(_.noop);
+ * // => true
+ *
+ * _.isObject(null);
+ * // => false
+ */
+function isObject(value) {
+ var type = typeof value;
+ return value != null && (type == 'object' || type == 'function');
+}
+
+module.exports = isObject;
+
+
+/***/ }),
+/* 574 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var baseIsNative = __webpack_require__(732),
+ getValue = __webpack_require__(735);
+
+/**
+ * Gets the native function at `key` of `object`.
+ *
+ * @private
+ * @param {Object} object The object to query.
+ * @param {string} key The key of the method to get.
+ * @returns {*} Returns the function if it's native, else `undefined`.
+ */
+function getNative(object, key) {
+ var value = getValue(object, key);
+ return baseIsNative(value) ? value : undefined;
+}
+
+module.exports = getNative;
+
+
+/***/ }),
+/* 575 */
+/***/ (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.ASSIGNMENT_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 ASSIGNMENT_OPERATORS = ["=", "+=", ...NUMBER_BINARY_OPERATORS.map(op => op + "="), ...LOGICAL_OPERATORS.map(op => op + "=")];
+exports.ASSIGNMENT_OPERATORS = ASSIGNMENT_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;
+
+/***/ }),
+/* 576 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = cloneNode;
+
+var _definitions = __webpack_require__(564);
+
+const has = Function.call.bind(Object.prototype.hasOwnProperty);
+
+function cloneIfNode(obj, deep, withoutLoc) {
+ if (obj && typeof obj.type === "string") {
+ return cloneNode(obj, deep, withoutLoc);
+ }
+
+ return obj;
+}
+
+function cloneIfNodeOrArray(obj, deep, withoutLoc) {
+ if (Array.isArray(obj)) {
+ return obj.map(node => cloneIfNode(node, deep, withoutLoc));
+ }
+
+ return cloneIfNode(obj, deep, withoutLoc);
+}
+
+function cloneNode(node, deep = true, withoutLoc = false) {
+ 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, withoutLoc) : 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)) {
+ if (deep) {
+ newNode[field] = type === "File" && field === "comments" ? maybeCloneComments(node.comments, deep, withoutLoc) : cloneIfNodeOrArray(node[field], true, withoutLoc);
+ } else {
+ newNode[field] = node[field];
+ }
+ }
+ }
+ }
+
+ if (has(node, "loc")) {
+ if (withoutLoc) {
+ newNode.loc = null;
+ } else {
+ newNode.loc = node.loc;
+ }
+ }
+
+ if (has(node, "leadingComments")) {
+ newNode.leadingComments = maybeCloneComments(node.leadingComments, deep, withoutLoc);
+ }
+
+ if (has(node, "innerComments")) {
+ newNode.innerComments = maybeCloneComments(node.innerComments, deep, withoutLoc);
+ }
+
+ if (has(node, "trailingComments")) {
+ newNode.trailingComments = maybeCloneComments(node.trailingComments, deep, withoutLoc);
+ }
+
+ if (has(node, "extra")) {
+ newNode.extra = Object.assign({}, node.extra);
+ }
+
+ return newNode;
+}
+
+function cloneCommentsWithoutLoc(comments) {
+ return comments.map(({
+ type,
+ value
+ }) => ({
+ type,
+ value,
+ loc: null
+ }));
+}
+
+function maybeCloneComments(comments, deep, withoutLoc) {
+ return deep && withoutLoc ? cloneCommentsWithoutLoc(comments) : comments;
+}
+
+/***/ }),
+/* 577 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var baseGetTag = __webpack_require__(569),
+ isObjectLike = __webpack_require__(565);
+
+/** `Object#toString` result references. */
+var symbolTag = '[object Symbol]';
+
+/**
+ * Checks if `value` is classified as a `Symbol` primitive or object.
+ *
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
+ * @example
+ *
+ * _.isSymbol(Symbol.iterator);
+ * // => true
+ *
+ * _.isSymbol('abc');
+ * // => false
+ */
+function isSymbol(value) {
+ return typeof value == 'symbol' ||
+ (isObjectLike(value) && baseGetTag(value) == symbolTag);
+}
+
+module.exports = isSymbol;
+
+
+/***/ }),
+/* 578 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var DataView = __webpack_require__(765),
+ Map = __webpack_require__(614),
+ Promise = __webpack_require__(766),
+ Set = __webpack_require__(664),
+ WeakMap = __webpack_require__(767),
+ baseGetTag = __webpack_require__(569),
+ toSource = __webpack_require__(652);
+
+/** `Object#toString` result references. */
+var mapTag = '[object Map]',
+ objectTag = '[object Object]',
+ promiseTag = '[object Promise]',
+ setTag = '[object Set]',
+ weakMapTag = '[object WeakMap]';
+
+var dataViewTag = '[object DataView]';
+
+/** Used to detect maps, sets, and weakmaps. */
+var dataViewCtorString = toSource(DataView),
+ mapCtorString = toSource(Map),
+ promiseCtorString = toSource(Promise),
+ setCtorString = toSource(Set),
+ weakMapCtorString = toSource(WeakMap);
+
+/**
+ * Gets the `toStringTag` of `value`.
+ *
+ * @private
+ * @param {*} value The value to query.
+ * @returns {string} Returns the `toStringTag`.
+ */
+var getTag = baseGetTag;
+
+// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
+if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
+ (Map && getTag(new Map) != mapTag) ||
+ (Promise && getTag(Promise.resolve()) != promiseTag) ||
+ (Set && getTag(new Set) != setTag) ||
+ (WeakMap && getTag(new WeakMap) != weakMapTag)) {
+ getTag = function(value) {
+ var result = baseGetTag(value),
+ Ctor = result == objectTag ? value.constructor : undefined,
+ ctorString = Ctor ? toSource(Ctor) : '';
+
+ if (ctorString) {
+ switch (ctorString) {
+ case dataViewCtorString: return dataViewTag;
+ case mapCtorString: return mapTag;
+ case promiseCtorString: return promiseTag;
+ case setCtorString: return setTag;
+ case weakMapCtorString: return weakMapTag;
+ }
+ }
+ return result;
+ };
+}
+
+module.exports = getTag;
+
+
+/***/ }),
+/* 579 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = is;
+
+var _shallowEqual = _interopRequireDefault(__webpack_require__(612));
+
+var _isType = _interopRequireDefault(__webpack_require__(626));
+
+var _isPlaceholderType = _interopRequireDefault(__webpack_require__(666));
+
+var _definitions = __webpack_require__(564);
+
+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);
+ }
+}
+
+/***/ }),
+/* 580 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = isValidIdentifier;
+
+var _helperValidatorIdentifier = __webpack_require__(667);
+
+function isValidIdentifier(name, reserved = true) {
+ if (typeof name !== "string") return false;
+
+ if (reserved) {
+ if ((0, _helperValidatorIdentifier.isKeyword)(name) || (0, _helperValidatorIdentifier.isStrictReservedWord)(name)) {
+ return false;
+ } else if (name === "await") {
+ return false;
+ }
+ }
+
+ return (0, _helperValidatorIdentifier.isIdentifierName)(name);
+}
+
+/***/ }),
+/* 581 */
+/***/ (function(module, exports, __webpack_require__) {
+
+/* -*- Mode: js; js-indent-level: 2; -*- */
+/*
+ * Copyright 2011 Mozilla Foundation and contributors
+ * Licensed under the New BSD license. See LICENSE or:
+ * http://opensource.org/licenses/BSD-3-Clause
+ */
+
+var base64VLQ = __webpack_require__(582);
+var util = __webpack_require__(566);
+var ArraySet = __webpack_require__(583).ArraySet;
+var MappingList = __webpack_require__(634).MappingList;
+
+/**
+ * An instance of the SourceMapGenerator represents a source map which is
+ * being built incrementally. You may pass an object with the following
+ * properties:
+ *
+ * - file: The filename of the generated source.
+ * - sourceRoot: A root for all relative URLs in this source map.
+ */
+function SourceMapGenerator(aArgs) {
+ if (!aArgs) {
+ aArgs = {};
+ }
+ this._file = util.getArg(aArgs, 'file', null);
+ this._sourceRoot = util.getArg(aArgs, 'sourceRoot', null);
+ this._skipValidation = util.getArg(aArgs, 'skipValidation', false);
+ this._sources = new ArraySet();
+ this._names = new ArraySet();
+ this._mappings = new MappingList();
+ this._sourcesContents = null;
+}
+
+SourceMapGenerator.prototype._version = 3;
+
+/**
+ * Creates a new SourceMapGenerator based on a SourceMapConsumer
+ *
+ * @param aSourceMapConsumer The SourceMap.
+ */
+SourceMapGenerator.fromSourceMap =
+ function SourceMapGenerator_fromSourceMap(aSourceMapConsumer) {
+ var sourceRoot = aSourceMapConsumer.sourceRoot;
+ var generator = new SourceMapGenerator({
+ file: aSourceMapConsumer.file,
+ sourceRoot: sourceRoot
+ });
+ aSourceMapConsumer.eachMapping(function (mapping) {
+ var newMapping = {
+ generated: {
+ line: mapping.generatedLine,
+ column: mapping.generatedColumn
+ }
+ };
+
+ if (mapping.source != null) {
+ newMapping.source = mapping.source;
+ if (sourceRoot != null) {
+ newMapping.source = util.relative(sourceRoot, newMapping.source);
+ }
+
+ newMapping.original = {
+ line: mapping.originalLine,
+ column: mapping.originalColumn
+ };
+
+ if (mapping.name != null) {
+ newMapping.name = mapping.name;
+ }
+ }
+
+ generator.addMapping(newMapping);
+ });
+ aSourceMapConsumer.sources.forEach(function (sourceFile) {
+ var content = aSourceMapConsumer.sourceContentFor(sourceFile);
+ if (content != null) {
+ generator.setSourceContent(sourceFile, content);
+ }
+ });
+ return generator;
+ };
+
+/**
+ * Add a single mapping from original source line and column to the generated
+ * source's line and column for this source map being created. The mapping
+ * object should have the following properties:
+ *
+ * - generated: An object with the generated line and column positions.
+ * - original: An object with the original line and column positions.
+ * - source: The original source file (relative to the sourceRoot).
+ * - name: An optional original token name for this mapping.
+ */
+SourceMapGenerator.prototype.addMapping =
+ function SourceMapGenerator_addMapping(aArgs) {
+ var generated = util.getArg(aArgs, 'generated');
+ var original = util.getArg(aArgs, 'original', null);
+ var source = util.getArg(aArgs, 'source', null);
+ var name = util.getArg(aArgs, 'name', null);
+
+ if (!this._skipValidation) {
+ this._validateMapping(generated, original, source, name);
+ }
+
+ if (source != null) {
+ source = String(source);
+ if (!this._sources.has(source)) {
+ this._sources.add(source);
+ }
+ }
+
+ if (name != null) {
+ name = String(name);
+ if (!this._names.has(name)) {
+ this._names.add(name);
+ }
+ }
+
+ this._mappings.add({
+ generatedLine: generated.line,
+ generatedColumn: generated.column,
+ originalLine: original != null && original.line,
+ originalColumn: original != null && original.column,
+ source: source,
+ name: name
+ });
+ };
+
+/**
+ * Set the source content for a source file.
+ */
+SourceMapGenerator.prototype.setSourceContent =
+ function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) {
+ var source = aSourceFile;
+ if (this._sourceRoot != null) {
+ source = util.relative(this._sourceRoot, source);
+ }
+
+ if (aSourceContent != null) {
+ // Add the source content to the _sourcesContents map.
+ // Create a new _sourcesContents map if the property is null.
+ if (!this._sourcesContents) {
+ this._sourcesContents = Object.create(null);
+ }
+ this._sourcesContents[util.toSetString(source)] = aSourceContent;
+ } else if (this._sourcesContents) {
+ // Remove the source file from the _sourcesContents map.
+ // If the _sourcesContents map is empty, set the property to null.
+ delete this._sourcesContents[util.toSetString(source)];
+ if (Object.keys(this._sourcesContents).length === 0) {
+ this._sourcesContents = null;
+ }
+ }
+ };
+
+/**
+ * Applies the mappings of a sub-source-map for a specific source file to the
+ * source map being generated. Each mapping to the supplied source file is
+ * rewritten using the supplied source map. Note: The resolution for the
+ * resulting mappings is the minimium of this map and the supplied map.
+ *
+ * @param aSourceMapConsumer The source map to be applied.
+ * @param aSourceFile Optional. The filename of the source file.
+ * If omitted, SourceMapConsumer's file property will be used.
+ * @param aSourceMapPath Optional. The dirname of the path to the source map
+ * to be applied. If relative, it is relative to the SourceMapConsumer.
+ * This parameter is needed when the two source maps aren't in the same
+ * directory, and the source map to be applied contains relative source
+ * paths. If so, those relative source paths need to be rewritten
+ * relative to the SourceMapGenerator.
+ */
+SourceMapGenerator.prototype.applySourceMap =
+ function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) {
+ var sourceFile = aSourceFile;
+ // If aSourceFile is omitted, we will use the file property of the SourceMap
+ if (aSourceFile == null) {
+ if (aSourceMapConsumer.file == null) {
+ throw new Error(
+ 'SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, ' +
+ 'or the source map\'s "file" property. Both were omitted.'
+ );
+ }
+ sourceFile = aSourceMapConsumer.file;
+ }
+ var sourceRoot = this._sourceRoot;
+ // Make "sourceFile" relative if an absolute Url is passed.
+ if (sourceRoot != null) {
+ sourceFile = util.relative(sourceRoot, sourceFile);
+ }
+ // Applying the SourceMap can add and remove items from the sources and
+ // the names array.
+ var newSources = new ArraySet();
+ var newNames = new ArraySet();
+
+ // Find mappings for the "sourceFile"
+ this._mappings.unsortedForEach(function (mapping) {
+ if (mapping.source === sourceFile && mapping.originalLine != null) {
+ // Check if it can be mapped by the source map, then update the mapping.
+ var original = aSourceMapConsumer.originalPositionFor({
+ line: mapping.originalLine,
+ column: mapping.originalColumn
+ });
+ if (original.source != null) {
+ // Copy mapping
+ mapping.source = original.source;
+ if (aSourceMapPath != null) {
+ mapping.source = util.join(aSourceMapPath, mapping.source)
+ }
+ if (sourceRoot != null) {
+ mapping.source = util.relative(sourceRoot, mapping.source);
+ }
+ mapping.originalLine = original.line;
+ mapping.originalColumn = original.column;
+ if (original.name != null) {
+ mapping.name = original.name;
+ }
+ }
+ }
+
+ var source = mapping.source;
+ if (source != null && !newSources.has(source)) {
+ newSources.add(source);
+ }
+
+ var name = mapping.name;
+ if (name != null && !newNames.has(name)) {
+ newNames.add(name);
+ }
+
+ }, this);
+ this._sources = newSources;
+ this._names = newNames;
+
+ // Copy sourcesContents of applied map.
+ aSourceMapConsumer.sources.forEach(function (sourceFile) {
+ var content = aSourceMapConsumer.sourceContentFor(sourceFile);
+ if (content != null) {
+ if (aSourceMapPath != null) {
+ sourceFile = util.join(aSourceMapPath, sourceFile);
+ }
+ if (sourceRoot != null) {
+ sourceFile = util.relative(sourceRoot, sourceFile);
+ }
+ this.setSourceContent(sourceFile, content);
+ }
+ }, this);
+ };
+
+/**
+ * A mapping can have one of the three levels of data:
+ *
+ * 1. Just the generated position.
+ * 2. The Generated position, original position, and original source.
+ * 3. Generated and original position, original source, as well as a name
+ * token.
+ *
+ * To maintain consistency, we validate that any new mapping being added falls
+ * in to one of these categories.
+ */
+SourceMapGenerator.prototype._validateMapping =
+ function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource,
+ aName) {
+ // When aOriginal is truthy but has empty values for .line and .column,
+ // it is most likely a programmer error. In this case we throw a very
+ // specific error message to try to guide them the right way.
+ // For example: https://github.com/Polymer/polymer-bundler/pull/519
+ if (aOriginal && typeof aOriginal.line !== 'number' && typeof aOriginal.column !== 'number') {
+ throw new Error(
+ 'original.line and original.column are not numbers -- you probably meant to omit ' +
+ 'the original mapping entirely and only map the generated position. If so, pass ' +
+ 'null for the original mapping instead of an object with empty or null values.'
+ );
+ }
+
+ if (aGenerated && 'line' in aGenerated && 'column' in aGenerated
+ && aGenerated.line > 0 && aGenerated.column >= 0
+ && !aOriginal && !aSource && !aName) {
+ // Case 1.
+ return;
+ }
+ else if (aGenerated && 'line' in aGenerated && 'column' in aGenerated
+ && aOriginal && 'line' in aOriginal && 'column' in aOriginal
+ && aGenerated.line > 0 && aGenerated.column >= 0
+ && aOriginal.line > 0 && aOriginal.column >= 0
+ && aSource) {
+ // Cases 2 and 3.
+ return;
+ }
+ else {
+ throw new Error('Invalid mapping: ' + JSON.stringify({
+ generated: aGenerated,
+ source: aSource,
+ original: aOriginal,
+ name: aName
+ }));
+ }
+ };
+
+/**
+ * Serialize the accumulated mappings in to the stream of base 64 VLQs
+ * specified by the source map format.
+ */
+SourceMapGenerator.prototype._serializeMappings =
+ function SourceMapGenerator_serializeMappings() {
+ var previousGeneratedColumn = 0;
+ var previousGeneratedLine = 1;
+ var previousOriginalColumn = 0;
+ var previousOriginalLine = 0;
+ var previousName = 0;
+ var previousSource = 0;
+ var result = '';
+ var next;
+ var mapping;
+ var nameIdx;
+ var sourceIdx;
+
+ var mappings = this._mappings.toArray();
+ for (var i = 0, len = mappings.length; i < len; i++) {
+ mapping = mappings[i];
+ next = ''
+
+ if (mapping.generatedLine !== previousGeneratedLine) {
+ previousGeneratedColumn = 0;
+ while (mapping.generatedLine !== previousGeneratedLine) {
+ next += ';';
+ previousGeneratedLine++;
+ }
+ }
+ else {
+ if (i > 0) {
+ if (!util.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) {
+ continue;
+ }
+ next += ',';
+ }
+ }
+
+ next += base64VLQ.encode(mapping.generatedColumn
+ - previousGeneratedColumn);
+ previousGeneratedColumn = mapping.generatedColumn;
+
+ if (mapping.source != null) {
+ sourceIdx = this._sources.indexOf(mapping.source);
+ next += base64VLQ.encode(sourceIdx - previousSource);
+ previousSource = sourceIdx;
+
+ // lines are stored 0-based in SourceMap spec version 3
+ next += base64VLQ.encode(mapping.originalLine - 1
+ - previousOriginalLine);
+ previousOriginalLine = mapping.originalLine - 1;
+
+ next += base64VLQ.encode(mapping.originalColumn
+ - previousOriginalColumn);
+ previousOriginalColumn = mapping.originalColumn;
+
+ if (mapping.name != null) {
+ nameIdx = this._names.indexOf(mapping.name);
+ next += base64VLQ.encode(nameIdx - previousName);
+ previousName = nameIdx;
+ }
+ }
+
+ result += next;
+ }
+
+ return result;
+ };
+
+SourceMapGenerator.prototype._generateSourcesContent =
+ function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) {
+ return aSources.map(function (source) {
+ if (!this._sourcesContents) {
+ return null;
+ }
+ if (aSourceRoot != null) {
+ source = util.relative(aSourceRoot, source);
+ }
+ var key = util.toSetString(source);
+ return Object.prototype.hasOwnProperty.call(this._sourcesContents, key)
+ ? this._sourcesContents[key]
+ : null;
+ }, this);
+ };
+
+/**
+ * Externalize the source map.
+ */
+SourceMapGenerator.prototype.toJSON =
+ function SourceMapGenerator_toJSON() {
+ var map = {
+ version: this._version,
+ sources: this._sources.toArray(),
+ names: this._names.toArray(),
+ mappings: this._serializeMappings()
+ };
+ if (this._file != null) {
+ map.file = this._file;
+ }
+ if (this._sourceRoot != null) {
+ map.sourceRoot = this._sourceRoot;
+ }
+ if (this._sourcesContents) {
+ map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot);
+ }
+
+ return map;
+ };
+
+/**
+ * Render the source map being generated to a string.
+ */
+SourceMapGenerator.prototype.toString =
+ function SourceMapGenerator_toString() {
+ return JSON.stringify(this.toJSON());
+ };
+
+exports.SourceMapGenerator = SourceMapGenerator;
+
+
+/***/ }),
+/* 582 */
+/***/ (function(module, exports, __webpack_require__) {
+
+/* -*- Mode: js; js-indent-level: 2; -*- */
+/*
+ * Copyright 2011 Mozilla Foundation and contributors
+ * Licensed under the New BSD license. See LICENSE or:
+ * http://opensource.org/licenses/BSD-3-Clause
+ *
+ * Based on the Base 64 VLQ implementation in Closure Compiler:
+ * https://code.google.com/p/closure-compiler/source/browse/trunk/src/com/google/debugging/sourcemap/Base64VLQ.java
+ *
+ * Copyright 2011 The Closure Compiler Authors. All rights reserved.
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+var base64 = __webpack_require__(633);
+
+// A single base 64 digit can contain 6 bits of data. For the base 64 variable
+// length quantities we use in the source map spec, the first bit is the sign,
+// the next four bits are the actual value, and the 6th bit is the
+// continuation bit. The continuation bit tells us whether there are more
+// digits in this value following this digit.
+//
+// Continuation
+// | Sign
+// | |
+// V V
+// 101011
+
+var VLQ_BASE_SHIFT = 5;
+
+// binary: 100000
+var VLQ_BASE = 1 << VLQ_BASE_SHIFT;
+
+// binary: 011111
+var VLQ_BASE_MASK = VLQ_BASE - 1;
+
+// binary: 100000
+var VLQ_CONTINUATION_BIT = VLQ_BASE;
+
+/**
+ * Converts from a two-complement value to a value where the sign bit is
+ * placed in the least significant bit. For example, as decimals:
+ * 1 becomes 2 (10 binary), -1 becomes 3 (11 binary)
+ * 2 becomes 4 (100 binary), -2 becomes 5 (101 binary)
+ */
+function toVLQSigned(aValue) {
+ return aValue < 0
+ ? ((-aValue) << 1) + 1
+ : (aValue << 1) + 0;
+}
+
+/**
+ * Converts to a two-complement value from a value where the sign bit is
+ * placed in the least significant bit. For example, as decimals:
+ * 2 (10 binary) becomes 1, 3 (11 binary) becomes -1
+ * 4 (100 binary) becomes 2, 5 (101 binary) becomes -2
+ */
+function fromVLQSigned(aValue) {
+ var isNegative = (aValue & 1) === 1;
+ var shifted = aValue >> 1;
+ return isNegative
+ ? -shifted
+ : shifted;
+}
+
+/**
+ * Returns the base 64 VLQ encoded value.
+ */
+exports.encode = function base64VLQ_encode(aValue) {
+ var encoded = "";
+ var digit;
+
+ var vlq = toVLQSigned(aValue);
+
+ do {
+ digit = vlq & VLQ_BASE_MASK;
+ vlq >>>= VLQ_BASE_SHIFT;
+ if (vlq > 0) {
+ // There are still more digits in this value, so we must make sure the
+ // continuation bit is marked.
+ digit |= VLQ_CONTINUATION_BIT;
+ }
+ encoded += base64.encode(digit);
+ } while (vlq > 0);
+
+ return encoded;
+};
+
+/**
+ * Decodes the next base 64 VLQ value from the given string and returns the
+ * value and the rest of the string via the out parameter.
+ */
+exports.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) {
+ var strLen = aStr.length;
+ var result = 0;
+ var shift = 0;
+ var continuation, digit;
+
+ do {
+ if (aIndex >= strLen) {
+ throw new Error("Expected more digits in base 64 VLQ value.");
+ }
+
+ digit = base64.decode(aStr.charCodeAt(aIndex++));
+ if (digit === -1) {
+ throw new Error("Invalid base64 digit: " + aStr.charAt(aIndex - 1));
+ }
+
+ continuation = !!(digit & VLQ_CONTINUATION_BIT);
+ digit &= VLQ_BASE_MASK;
+ result = result + (digit << shift);
+ shift += VLQ_BASE_SHIFT;
+ } while (continuation);
+
+ aOutParam.value = fromVLQSigned(result);
+ aOutParam.rest = aIndex;
+};
+
+
+/***/ }),
+/* 583 */
+/***/ (function(module, exports, __webpack_require__) {
+
+/* -*- Mode: js; js-indent-level: 2; -*- */
+/*
+ * Copyright 2011 Mozilla Foundation and contributors
+ * Licensed under the New BSD license. See LICENSE or:
+ * http://opensource.org/licenses/BSD-3-Clause
+ */
+
+var util = __webpack_require__(566);
+var has = Object.prototype.hasOwnProperty;
+var hasNativeMap = typeof Map !== "undefined";
+
+/**
+ * A data structure which is a combination of an array and a set. Adding a new
+ * member is O(1), testing for membership is O(1), and finding the index of an
+ * element is O(1). Removing elements from the set is not supported. Only
+ * strings are supported for membership.
+ */
+function ArraySet() {
+ this._array = [];
+ this._set = hasNativeMap ? new Map() : Object.create(null);
+}
+
+/**
+ * Static method for creating ArraySet instances from an existing array.
+ */
+ArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) {
+ var set = new ArraySet();
+ for (var i = 0, len = aArray.length; i < len; i++) {
+ set.add(aArray[i], aAllowDuplicates);
+ }
+ return set;
+};
+
+/**
+ * Return how many unique items are in this ArraySet. If duplicates have been
+ * added, than those do not count towards the size.
+ *
+ * @returns Number
+ */
+ArraySet.prototype.size = function ArraySet_size() {
+ return hasNativeMap ? this._set.size : Object.getOwnPropertyNames(this._set).length;
+};
+
+/**
+ * Add the given string to this set.
+ *
+ * @param String aStr
+ */
+ArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) {
+ var sStr = hasNativeMap ? aStr : util.toSetString(aStr);
+ var isDuplicate = hasNativeMap ? this.has(aStr) : has.call(this._set, sStr);
+ var idx = this._array.length;
+ if (!isDuplicate || aAllowDuplicates) {
+ this._array.push(aStr);
+ }
+ if (!isDuplicate) {
+ if (hasNativeMap) {
+ this._set.set(aStr, idx);
+ } else {
+ this._set[sStr] = idx;
+ }
+ }
+};
+
+/**
+ * Is the given string a member of this set?
+ *
+ * @param String aStr
+ */
+ArraySet.prototype.has = function ArraySet_has(aStr) {
+ if (hasNativeMap) {
+ return this._set.has(aStr);
+ } else {
+ var sStr = util.toSetString(aStr);
+ return has.call(this._set, sStr);
+ }
+};
+
+/**
+ * What is the index of the given string in the array?
+ *
+ * @param String aStr
+ */
+ArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) {
+ if (hasNativeMap) {
+ var idx = this._set.get(aStr);
+ if (idx >= 0) {
+ return idx;
+ }
+ } else {
+ var sStr = util.toSetString(aStr);
+ if (has.call(this._set, sStr)) {
+ return this._set[sStr];
+ }
+ }
+
+ throw new Error('"' + aStr + '" is not in the set.');
+};
+
+/**
+ * What is the element at the given index?
+ *
+ * @param Number aIdx
+ */
+ArraySet.prototype.at = function ArraySet_at(aIdx) {
+ if (aIdx >= 0 && aIdx < this._array.length) {
+ return this._array[aIdx];
+ }
+ throw new Error('No element indexed by ' + aIdx);
+};
+
+/**
+ * Returns the array representation of this set (which has the proper indices
+ * indicated by indexOf). Note that this is a copy of the internal array used
+ * for storing the members so that no one can mess with internal state.
+ */
+ArraySet.prototype.toArray = function ArraySet_toArray() {
+ return this._array.slice();
+};
+
+exports.ArraySet = ArraySet;
+
+
+/***/ }),
+/* 584 */,
+/* 585 */,
+/* 586 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var listCacheClear = __webpack_require__(722),
+ listCacheDelete = __webpack_require__(723),
+ listCacheGet = __webpack_require__(724),
+ listCacheHas = __webpack_require__(725),
+ listCacheSet = __webpack_require__(726);
+
+/**
+ * Creates an list cache object.
+ *
+ * @private
+ * @constructor
+ * @param {Array} [entries] The key-value pairs to cache.
+ */
+function ListCache(entries) {
+ var index = -1,
+ length = entries == null ? 0 : entries.length;
+
+ this.clear();
+ while (++index < length) {
+ var entry = entries[index];
+ this.set(entry[0], entry[1]);
+ }
+}
+
+// Add methods to `ListCache`.
+ListCache.prototype.clear = listCacheClear;
+ListCache.prototype['delete'] = listCacheDelete;
+ListCache.prototype.get = listCacheGet;
+ListCache.prototype.has = listCacheHas;
+ListCache.prototype.set = listCacheSet;
+
+module.exports = ListCache;
+
+
+/***/ }),
+/* 587 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var eq = __webpack_require__(588);
+
+/**
+ * Gets the index at which the `key` is found in `array` of key-value pairs.
+ *
+ * @private
+ * @param {Array} array The array to inspect.
+ * @param {*} key The key to search for.
+ * @returns {number} Returns the index of the matched value, else `-1`.
+ */
+function assocIndexOf(array, key) {
+ var length = array.length;
+ while (length--) {
+ if (eq(array[length][0], key)) {
+ return length;
+ }
+ }
+ return -1;
+}
+
+module.exports = assocIndexOf;
+
+
+/***/ }),
+/* 588 */
+/***/ (function(module, exports) {
+
+/**
+ * Performs a
+ * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
+ * comparison between two values to determine if they are equivalent.
+ *
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @category Lang
+ * @param {*} value The value to compare.
+ * @param {*} other The other value to compare.
+ * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
+ * @example
+ *
+ * var object = { 'a': 1 };
+ * var other = { 'a': 1 };
+ *
+ * _.eq(object, object);
+ * // => true
+ *
+ * _.eq(object, other);
+ * // => false
+ *
+ * _.eq('a', 'a');
+ * // => true
+ *
+ * _.eq('a', Object('a'));
+ * // => false
+ *
+ * _.eq(NaN, NaN);
+ * // => true
+ */
+function eq(value, other) {
+ return value === other || (value !== value && other !== other);
+}
+
+module.exports = eq;
+
+
+/***/ }),
+/* 589 */
+/***/ (function(module, exports, __webpack_require__) {
+
+/* WEBPACK VAR INJECTION */(function(global) {/** Detect free variable `global` from Node.js. */
+var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
+
+module.exports = freeGlobal;
+
+/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(590)))
+
+/***/ }),
+/* 590 */
+/***/ (function(module, exports) {
+
+var g;
+
+// This works in non-strict mode
+g = (function() {
+ return this;
+})();
+
+try {
+ // This works if eval is allowed (see CSP)
+ g = g || Function("return this")() || (1,eval)("this");
+} catch(e) {
+ // This works if the window reference is available
+ if(typeof window === "object")
+ g = window;
+}
+
+// g can still be undefined, but nothing to do about it...
+// We return undefined, instead of nothing here, so it's
+// easier to handle this case. if(!global) { ...}
+
+module.exports = g;
+
+
+/***/ }),
+/* 591 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var getNative = __webpack_require__(574);
+
+/* Built-in method references that are verified to be native. */
+var nativeCreate = getNative(Object, 'create');
+
+module.exports = nativeCreate;
+
+
+/***/ }),
+/* 592 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var isKeyable = __webpack_require__(744);
+
+/**
+ * Gets the data for `map`.
+ *
+ * @private
+ * @param {Object} map The map to query.
+ * @param {string} key The reference key.
+ * @returns {*} Returns the map data.
+ */
+function getMapData(map, key) {
+ var data = map.__data__;
+ return isKeyable(key)
+ ? data[typeof key == 'string' ? 'string' : 'hash']
+ : data.map;
+}
+
+module.exports = getMapData;
+
+
+/***/ }),
+/* 593 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var assignValue = __webpack_require__(653),
+ baseAssignValue = __webpack_require__(654);
+
+/**
+ * Copies properties of `source` to `object`.
+ *
+ * @private
+ * @param {Object} source The object to copy properties from.
+ * @param {Array} props The property identifiers to copy.
+ * @param {Object} [object={}] The object to copy properties to.
+ * @param {Function} [customizer] The function to customize copied values.
+ * @returns {Object} Returns `object`.
+ */
+function copyObject(source, props, object, customizer) {
+ var isNew = !object;
+ object || (object = {});
+
+ var index = -1,
+ length = props.length;
+
+ while (++index < length) {
+ var key = props[index];
+
+ var newValue = customizer
+ ? customizer(object[key], source[key], key, object, source)
+ : undefined;
+
+ if (newValue === undefined) {
+ newValue = source[key];
+ }
+ if (isNew) {
+ baseAssignValue(object, key, newValue);
+ } else {
+ assignValue(object, key, newValue);
+ }
+ }
+ return object;
+}
+
+module.exports = copyObject;
+
+
+/***/ }),
+/* 594 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var arrayLikeKeys = __webpack_require__(655),
+ baseKeys = __webpack_require__(656),
+ isArrayLike = __webpack_require__(599);
+
+/**
+ * Creates an array of the own enumerable property names of `object`.
+ *
+ * **Note:** Non-object values are coerced to objects. See the
+ * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
+ * for more details.
+ *
+ * @static
+ * @since 0.1.0
+ * @memberOf _
+ * @category Object
+ * @param {Object} object The object to query.
+ * @returns {Array} Returns the array of property names.
+ * @example
+ *
+ * function Foo() {
+ * this.a = 1;
+ * this.b = 2;
+ * }
+ *
+ * Foo.prototype.c = 3;
+ *
+ * _.keys(new Foo);
+ * // => ['a', 'b'] (iteration order is not guaranteed)
+ *
+ * _.keys('hi');
+ * // => ['0', '1']
+ */
+function keys(object) {
+ return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
+}
+
+module.exports = keys;
+
+
+/***/ }),
+/* 595 */
+/***/ (function(module, exports, __webpack_require__) {
+
+/* WEBPACK VAR INJECTION */(function(module) {var root = __webpack_require__(562),
+ stubFalse = __webpack_require__(753);
+
+/** Detect free variable `exports`. */
+var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;
+
+/** Detect free variable `module`. */
+var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
+
+/** Detect the popular CommonJS extension `module.exports`. */
+var moduleExports = freeModule && freeModule.exports === freeExports;
+
+/** Built-in value references. */
+var Buffer = moduleExports ? root.Buffer : undefined;
+
+/* Built-in method references for those with the same name as other `lodash` methods. */
+var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;
+
+/**
+ * Checks if `value` is a buffer.
+ *
+ * @static
+ * @memberOf _
+ * @since 4.3.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
+ * @example
+ *
+ * _.isBuffer(new Buffer(2));
+ * // => true
+ *
+ * _.isBuffer(new Uint8Array(2));
+ * // => false
+ */
+var isBuffer = nativeIsBuffer || stubFalse;
+
+module.exports = isBuffer;
+
+/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(619)(module)))
+
+/***/ }),
+/* 596 */
+/***/ (function(module, exports) {
+
+/**
+ * The base implementation of `_.unary` without support for storing metadata.
+ *
+ * @private
+ * @param {Function} func The function to cap arguments for.
+ * @returns {Function} Returns the new capped function.
+ */
+function baseUnary(func) {
+ return function(value) {
+ return func(value);
+ };
+}
+
+module.exports = baseUnary;
+
+
+/***/ }),
+/* 597 */
+/***/ (function(module, exports, __webpack_require__) {
+
+/* WEBPACK VAR INJECTION */(function(module) {var freeGlobal = __webpack_require__(589);
+
+/** Detect free variable `exports`. */
+var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;
+
+/** Detect free variable `module`. */
+var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
+
+/** Detect the popular CommonJS extension `module.exports`. */
+var moduleExports = freeModule && freeModule.exports === freeExports;
+
+/** Detect free variable `process` from Node.js. */
+var freeProcess = moduleExports && freeGlobal.process;
+
+/** Used to access faster Node.js helpers. */
+var nodeUtil = (function() {
+ try {
+ // Use `util.types` for Node.js 10+.
+ var types = freeModule && freeModule.require && freeModule.require('util').types;
+
+ if (types) {
+ return types;
+ }
+
+ // Legacy `process.binding('util')` for Node.js < 10.
+ return freeProcess && freeProcess.binding && freeProcess.binding('util');
+ } catch (e) {}
+}());
+
+module.exports = nodeUtil;
+
+/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(619)(module)))
+
+/***/ }),
+/* 598 */
+/***/ (function(module, exports) {
+
+/** Used for built-in method references. */
+var objectProto = Object.prototype;
+
+/**
+ * Checks if `value` is likely a prototype object.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
+ */
+function isPrototype(value) {
+ var Ctor = value && value.constructor,
+ proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
+
+ return value === proto;
+}
+
+module.exports = isPrototype;
+
+
+/***/ }),
+/* 599 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var isFunction = __webpack_require__(651),
+ isLength = __webpack_require__(622);
+
+/**
+ * Checks if `value` is array-like. A value is considered array-like if it's
+ * not a function and has a `value.length` that's an integer greater than or
+ * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
+ *
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
+ * @example
+ *
+ * _.isArrayLike([1, 2, 3]);
+ * // => true
+ *
+ * _.isArrayLike(document.body.children);
+ * // => true
+ *
+ * _.isArrayLike('abc');
+ * // => true
+ *
+ * _.isArrayLike(_.noop);
+ * // => false
+ */
+function isArrayLike(value) {
+ return value != null && isLength(value.length) && !isFunction(value);
+}
+
+module.exports = isArrayLike;
+
+
+/***/ }),
+/* 600 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.patternLikeCommon = exports.functionDeclarationCommon = exports.functionTypeAnnotationCommon = exports.functionCommon = void 0;
+
+var _is = _interopRequireDefault(__webpack_require__(579));
+
+var _isValidIdentifier = _interopRequireDefault(__webpack_require__(580));
+
+var _helperValidatorIdentifier = __webpack_require__(667);
+
+var _constants = __webpack_require__(575);
+
+var _utils = _interopRequireWildcard(__webpack_require__(571));
+
+function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
+
+function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } 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: !Object({"NODE_ENV":"production"}).BABEL_TYPES_8_BREAKING ? [] : undefined
+ }
+ },
+ visitor: ["elements"],
+ aliases: ["Expression"]
+});
+(0, _utils.default)("AssignmentExpression", {
+ fields: {
+ operator: {
+ validate: function () {
+ if (!Object({"NODE_ENV":"production"}).BABEL_TYPES_8_BREAKING) {
+ return (0, _utils.assertValueType)("string");
+ }
+
+ const identifier = (0, _utils.assertOneOf)(..._constants.ASSIGNMENT_OPERATORS);
+ const pattern = (0, _utils.assertOneOf)("=");
+ return function (node, key, val) {
+ const validator = (0, _is.default)("Pattern", node.left) ? pattern : identifier;
+ validator(node, key, val);
+ };
+ }()
+ },
+ left: {
+ validate: !Object({"NODE_ENV":"production"}).BABEL_TYPES_8_BREAKING ? (0, _utils.assertNodeType)("LVal") : (0, _utils.assertNodeType)("Identifier", "MemberExpression", "ArrayPattern", "ObjectPattern")
+ },
+ 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: function () {
+ const expression = (0, _utils.assertNodeType)("Expression");
+ const inOp = (0, _utils.assertNodeType)("Expression", "PrivateName");
+
+ const validator = function (node, key, val) {
+ const validator = node.operator === "in" ? inOp : expression;
+ validator(node, key, val);
+ };
+
+ validator.oneOfNodeTypes = ["Expression", "PrivateName"];
+ return validator;
+ }()
+ },
+ 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: Object.assign({
+ callee: {
+ validate: (0, _utils.assertNodeType)("Expression", "V8IntrinsicIdentifier")
+ },
+ arguments: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Expression", "SpreadElement", "JSXNamespacedName", "ArgumentPlaceholder")))
+ }
+ }, !Object({"NODE_ENV":"production"}).BABEL_TYPES_8_BREAKING ? {
+ 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", "ArrayPattern", "ObjectPattern"),
+ 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")
+ },
+ comments: {
+ validate: !Object({"NODE_ENV":"production"}).BABEL_TYPES_8_BREAKING ? Object.assign(() => {}, {
+ each: {
+ oneOfNodeTypes: ["CommentBlock", "CommentLine"]
+ }
+ }) : (0, _utils.assertEach)((0, _utils.assertNodeType)("CommentBlock", "CommentLine")),
+ optional: true
+ },
+ tokens: {
+ validate: (0, _utils.assertEach)(Object.assign(() => {}, {
+ type: "any"
+ })),
+ optional: true
+ }
+ }
+});
+(0, _utils.default)("ForInStatement", {
+ visitor: ["left", "right", "body"],
+ aliases: ["Scopable", "Statement", "For", "BlockParent", "Loop", "ForXStatement"],
+ fields: {
+ left: {
+ validate: !Object({"NODE_ENV":"production"}).BABEL_TYPES_8_BREAKING ? (0, _utils.assertNodeType)("VariableDeclaration", "LVal") : (0, _utils.assertNodeType)("VariableDeclaration", "Identifier", "MemberExpression", "ArrayPattern", "ObjectPattern")
+ },
+ 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
+ },
+ async: {
+ 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"],
+ validate: function () {
+ if (!Object({"NODE_ENV":"production"}).BABEL_TYPES_8_BREAKING) return () => {};
+ const identifier = (0, _utils.assertNodeType)("Identifier");
+ return function (parent, key, node) {
+ if (!(0, _is.default)("ExportDefaultDeclaration", parent)) {
+ identifier(node, "id", node.id);
+ }
+ };
+ }()
+});
+(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)((0, _utils.assertValueType)("string"), Object.assign(function (node, key, val) {
+ if (!Object({"NODE_ENV":"production"}).BABEL_TYPES_8_BREAKING) return;
+
+ if (!(0, _isValidIdentifier.default)(val, false)) {
+ throw new TypeError(`"${val}" is not a valid identifier name`);
+ }
+ }, {
+ type: "string"
+ }))
+ },
+ optional: {
+ validate: (0, _utils.assertValueType)("boolean"),
+ optional: true
+ }
+ }),
+
+ validate(parent, key, node) {
+ if (!Object({"NODE_ENV":"production"}).BABEL_TYPES_8_BREAKING) return;
+ const match = /\.(\w+)$/.exec(key);
+ if (!match) return;
+ const [, parentKey] = match;
+ const nonComp = {
+ computed: false
+ };
+
+ if (parentKey === "property") {
+ if ((0, _is.default)("MemberExpression", parent, nonComp)) return;
+ if ((0, _is.default)("OptionalMemberExpression", parent, nonComp)) return;
+ } else if (parentKey === "key") {
+ if ((0, _is.default)("Property", parent, nonComp)) return;
+ if ((0, _is.default)("Method", parent, nonComp)) return;
+ } else if (parentKey === "exported") {
+ if ((0, _is.default)("ExportSpecifier", parent)) return;
+ } else if (parentKey === "imported") {
+ if ((0, _is.default)("ImportSpecifier", parent, {
+ imported: node
+ })) return;
+ } else if (parentKey === "meta") {
+ if ((0, _is.default)("MetaProperty", parent, {
+ meta: node
+ })) return;
+ }
+
+ if (((0, _helperValidatorIdentifier.isKeyword)(node.name) || (0, _helperValidatorIdentifier.isReservedWord)(node.name)) && node.name !== "this") {
+ throw new TypeError(`"${node.name}" is not a valid identifier`);
+ }
+ }
+
+});
+(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", "Pureish", "Literal"],
+ fields: {
+ pattern: {
+ validate: (0, _utils.assertValueType)("string")
+ },
+ flags: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("string"), Object.assign(function (node, key, val) {
+ if (!Object({"NODE_ENV":"production"}).BABEL_TYPES_8_BREAKING) return;
+ const invalid = /[^gimsuy]/.exec(val);
+
+ if (invalid) {
+ throw new TypeError(`"${invalid[0]}" is not a valid RegExp flag`);
+ }
+ }, {
+ type: "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.assign({
+ object: {
+ validate: (0, _utils.assertNodeType)("Expression")
+ },
+ property: {
+ validate: function () {
+ const normal = (0, _utils.assertNodeType)("Identifier", "PrivateName");
+ const computed = (0, _utils.assertNodeType)("Expression");
+
+ const validator = function (node, key, val) {
+ const validator = node.computed ? computed : normal;
+ validator(node, key, val);
+ };
+
+ validator.oneOfNodeTypes = ["Expression", "Identifier", "PrivateName"];
+ return validator;
+ }()
+ },
+ computed: {
+ default: false
+ }
+ }, !Object({"NODE_ENV":"production"}).BABEL_TYPES_8_BREAKING ? {
+ 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", "generator", "async"],
+ fields: Object.assign({}, functionCommon, functionTypeAnnotationCommon, {
+ kind: Object.assign({
+ validate: (0, _utils.assertOneOf)("method", "get", "set")
+ }, !Object({"NODE_ENV":"production"}).BABEL_TYPES_8_BREAKING ? {
+ default: "method"
+ } : {}),
+ computed: {
+ default: false
+ },
+ key: {
+ validate: function () {
+ const normal = (0, _utils.assertNodeType)("Identifier", "StringLiteral", "NumericLiteral");
+ const computed = (0, _utils.assertNodeType)("Expression");
+
+ const validator = function (node, key, val) {
+ const validator = node.computed ? computed : normal;
+ validator(node, key, val);
+ };
+
+ validator.oneOfNodeTypes = ["Expression", "Identifier", "StringLiteral", "NumericLiteral"];
+ return validator;
+ }()
+ },
+ decorators: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Decorator"))),
+ optional: true
+ },
+ 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", ...(!Object({"NODE_ENV":"production"}).BABEL_TYPES_8_BREAKING ? ["decorators"] : [])],
+ fields: {
+ computed: {
+ default: false
+ },
+ key: {
+ validate: function () {
+ const normal = (0, _utils.assertNodeType)("Identifier", "StringLiteral", "NumericLiteral");
+ const computed = (0, _utils.assertNodeType)("Expression");
+
+ const validator = function (node, key, val) {
+ const validator = node.computed ? computed : normal;
+ validator(node, key, val);
+ };
+
+ validator.oneOfNodeTypes = ["Expression", "Identifier", "StringLiteral", "NumericLiteral"];
+ return validator;
+ }()
+ },
+ value: {
+ validate: (0, _utils.assertNodeType)("Expression", "PatternLike")
+ },
+ shorthand: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("boolean"), Object.assign(function (node, key, val) {
+ if (!Object({"NODE_ENV":"production"}).BABEL_TYPES_8_BREAKING) return;
+
+ if (val && node.computed) {
+ throw new TypeError("Property shorthand of ObjectProperty cannot be true if computed is true");
+ }
+ }, {
+ type: "boolean"
+ }), function (node, key, val) {
+ if (!Object({"NODE_ENV":"production"}).BABEL_TYPES_8_BREAKING) return;
+
+ if (val && !(0, _is.default)("Identifier", node.key)) {
+ throw new TypeError("Property shorthand of ObjectProperty cannot be true if key is not an Identifier");
+ }
+ }),
+ 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"],
+ validate: function () {
+ const pattern = (0, _utils.assertNodeType)("Identifier", "Pattern");
+ const expression = (0, _utils.assertNodeType)("Expression");
+ return function (parent, key, node) {
+ if (!Object({"NODE_ENV":"production"}).BABEL_TYPES_8_BREAKING) return;
+ const validator = (0, _is.default)("ObjectPattern", parent) ? pattern : expression;
+ validator(node, "value", node.value);
+ };
+ }()
+});
+(0, _utils.default)("RestElement", {
+ visitor: ["argument", "typeAnnotation"],
+ builder: ["argument"],
+ aliases: ["LVal", "PatternLike"],
+ deprecatedAlias: "RestProperty",
+ fields: Object.assign({}, patternLikeCommon, {
+ argument: {
+ validate: !Object({"NODE_ENV":"production"}).BABEL_TYPES_8_BREAKING ? (0, _utils.assertNodeType)("LVal") : (0, _utils.assertNodeType)("Identifier", "Pattern", "MemberExpression")
+ }
+ }),
+
+ validate(parent, key) {
+ if (!Object({"NODE_ENV":"production"}).BABEL_TYPES_8_BREAKING) return;
+ const match = /(\w+)\[(\d+)\]/.exec(key);
+ if (!match) throw new Error("Internal Babel error: malformed key.");
+ const [, listKey, index] = match;
+
+ if (parent[listKey].length > index + 1) {
+ throw new TypeError(`RestElement must be last element of ${listKey}`);
+ }
+ }
+
+});
+(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.chain)((0, _utils.assertNodeType)("BlockStatement"), Object.assign(function (node) {
+ if (!Object({"NODE_ENV":"production"}).BABEL_TYPES_8_BREAKING) return;
+
+ if (!node.handler && !node.finalizer) {
+ throw new TypeError("TryStatement expects either a handler or finalizer, or both");
+ }
+ }, {
+ oneOfNodeTypes: ["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: !Object({"NODE_ENV":"production"}).BABEL_TYPES_8_BREAKING ? (0, _utils.assertNodeType)("Expression") : (0, _utils.assertNodeType)("Identifier", "MemberExpression")
+ },
+ 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.assertOneOf)("var", "let", "const")
+ },
+ declarations: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("VariableDeclarator")))
+ }
+ },
+
+ validate(parent, key, node) {
+ if (!Object({"NODE_ENV":"production"}).BABEL_TYPES_8_BREAKING) return;
+ if (!(0, _is.default)("ForXStatement", parent, {
+ left: node
+ })) return;
+
+ if (node.declarations.length !== 1) {
+ throw new TypeError(`Exactly one VariableDeclarator is required in the VariableDeclaration of a ${parent.type}`);
+ }
+ }
+
+});
+(0, _utils.default)("VariableDeclarator", {
+ visitor: ["id", "init"],
+ fields: {
+ id: {
+ validate: function () {
+ if (!Object({"NODE_ENV":"production"}).BABEL_TYPES_8_BREAKING) {
+ return (0, _utils.assertNodeType)("LVal");
+ }
+
+ const normal = (0, _utils.assertNodeType)("Identifier", "ArrayPattern", "ObjectPattern");
+ const without = (0, _utils.assertNodeType)("Identifier");
+ return function (node, key, val) {
+ const validator = node.init ? normal : without;
+ validator(node, key, val);
+ };
+ }()
+ },
+ 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)("Statement")
+ }
+ }
+});
+(0, _utils.default)("WithStatement", {
+ visitor: ["object", "body"],
+ aliases: ["Statement"],
+ fields: {
+ object: {
+ validate: (0, _utils.assertNodeType)("Expression")
+ },
+ body: {
+ validate: (0, _utils.assertNodeType)("Statement")
+ }
+ }
+});
+
+/***/ }),
+/* 601 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = getBindingIdentifiers;
+
+var _generated = __webpack_require__(559);
+
+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"]
+};
+
+/***/ }),
+/* 602 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.isFunction = isFunction;
+exports.isAwaitExpression = isAwaitExpression;
+exports.isYieldExpression = isYieldExpression;
+exports.isObjectShorthand = isObjectShorthand;
+exports.getObjectExpressionValue = getObjectExpressionValue;
+exports.getCode = getCode;
+exports.getComments = getComments;
+exports.getSpecifiers = getSpecifiers;
+exports.isComputedExpression = isComputedExpression;
+exports.getMemberExpression = getMemberExpression;
+exports.getVariables = getVariables;
+exports.getPatternIdentifiers = getPatternIdentifiers;
+exports.isTopLevel = isTopLevel;
+exports.nodeLocationKey = nodeLocationKey;
+exports.getFunctionParameterNames = getFunctionParameterNames;
+
+var t = _interopRequireWildcard(__webpack_require__(2));
+
+var _generator = _interopRequireDefault(__webpack_require__(603));
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
+
+function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
+
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+function isFunction(node) {
+ return t.isFunction(node) || t.isArrowFunctionExpression(node) || t.isObjectMethod(node) || t.isClassMethod(node);
+}
+
+function isAwaitExpression(path) {
+ const {
+ node,
+ parent
+ } = path;
+ return t.isAwaitExpression(node) || t.isAwaitExpression(parent.init) || t.isAwaitExpression(parent);
+}
+
+function isYieldExpression(path) {
+ const {
+ node,
+ parent
+ } = path;
+ return t.isYieldExpression(node) || t.isYieldExpression(parent.init) || t.isYieldExpression(parent);
+}
+
+function isObjectShorthand(parent) {
+ if (!t.isObjectProperty(parent)) {
+ return false;
+ }
+
+ if (parent.value && parent.value.left) {
+ return parent.value.type === "AssignmentPattern" && parent.value.left.type === "Identifier";
+ }
+
+ return parent.value && parent.key.start == parent.value.start && parent.key.loc.identifierName === parent.value.loc.identifierName;
+}
+
+function getObjectExpressionValue(node) {
+ const {
+ value
+ } = node;
+
+ if (t.isIdentifier(value)) {
+ return value.name;
+ }
+
+ if (t.isCallExpression(value) || t.isFunctionExpression(value)) {
+ return "";
+ }
+
+ const code = (0, _generator.default)(value).code;
+ const shouldWrap = t.isObjectExpression(value);
+ return shouldWrap ? `(${code})` : code;
+}
+
+function getCode(node) {
+ return (0, _generator.default)(node).code;
+}
+
+function getComments(ast) {
+ if (!ast || !ast.comments) {
+ return [];
+ }
+
+ return ast.comments.map(comment => ({
+ name: comment.location,
+ location: comment.loc
+ }));
+}
+
+function getSpecifiers(specifiers) {
+ if (!specifiers) {
+ return [];
+ }
+
+ return specifiers.map(specifier => {
+ var _specifier$local;
+
+ return (_specifier$local = specifier.local) === null || _specifier$local === void 0 ? void 0 : _specifier$local.name;
+ });
+}
+
+function isComputedExpression(expression) {
+ return /^\[/m.test(expression);
+}
+
+function getMemberExpression(root) {
+ function _getMemberExpression(node, expr) {
+ if (t.isMemberExpression(node)) {
+ expr = [node.property.name].concat(expr);
+ return _getMemberExpression(node.object, expr);
+ }
+
+ if (t.isCallExpression(node)) {
+ return [];
+ }
+
+ if (t.isThisExpression(node)) {
+ return ["this"].concat(expr);
+ }
+
+ return [node.name].concat(expr);
+ }
+
+ const expr = _getMemberExpression(root, []);
+
+ return expr.join(".");
+}
+
+function getVariables(dec) {
+ if (!dec.id) {
+ return [];
+ }
+
+ if (t.isArrayPattern(dec.id)) {
+ if (!dec.id.elements) {
+ return [];
+ } // NOTE: it's possible that an element is empty or has several variables
+ // e.g. const [, a] = arr
+ // e.g. const [{a, b }] = 2
+
+
+ return dec.id.elements.filter(Boolean).map(element => {
+ var _element$argument;
+
+ return {
+ name: t.isAssignmentPattern(element) ? element.left.name : element.name || ((_element$argument = element.argument) === null || _element$argument === void 0 ? void 0 : _element$argument.name),
+ location: element.loc
+ };
+ }).filter(({
+ name
+ }) => name);
+ }
+
+ return [{
+ name: dec.id.name,
+ location: dec.loc
+ }];
+}
+
+function getPatternIdentifiers(pattern) {
+ let items = [];
+
+ if (t.isObjectPattern(pattern)) {
+ items = pattern.properties.map(({
+ value
+ }) => value);
+ }
+
+ if (t.isArrayPattern(pattern)) {
+ items = pattern.elements;
+ }
+
+ return getIdentifiers(items);
+}
+
+function getIdentifiers(items) {
+ let ids = [];
+ items.forEach(function (item) {
+ if (t.isObjectPattern(item) || t.isArrayPattern(item)) {
+ ids = ids.concat(getPatternIdentifiers(item));
+ } else if (t.isIdentifier(item)) {
+ const {
+ start,
+ end
+ } = item.loc;
+ ids.push({
+ name: item.name,
+ expression: item.name,
+ location: {
+ start,
+ end
+ }
+ });
+ }
+ });
+ return ids;
+} // Top Level checks the number of "body" nodes in the ancestor chain
+// if the node is top-level, then it shoul only have one body.
+
+
+function isTopLevel(ancestors) {
+ return ancestors.filter(ancestor => ancestor.key == "body").length == 1;
+}
+
+function nodeLocationKey(a) {
+ const {
+ start,
+ end
+ } = a.location;
+ return `${start.line}:${start.column}:${end.line}:${end.column}`;
+}
+
+function getFunctionParameterNames(path) {
+ if (path.node.params != null) {
+ return path.node.params.map(param => {
+ if (param.type !== "AssignmentPattern") {
+ return param.name;
+ } // Parameter with default value
+
+
+ if (param.left.type === "Identifier" && param.right.type === "Identifier") {
+ return `${param.left.name} = ${param.right.name}`;
+ } else if (param.left.type === "Identifier" && param.right.type === "StringLiteral") {
+ return `${param.left.name} = ${param.right.value}`;
+ } else if (param.left.type === "Identifier" && param.right.type === "ObjectExpression") {
+ return `${param.left.name} = {}`;
+ } else if (param.left.type === "Identifier" && param.right.type === "ArrayExpression") {
+ return `${param.left.name} = []`;
+ } else if (param.left.type === "Identifier" && param.right.type === "NullLiteral") {
+ return `${param.left.name} = null`;
+ }
+ });
+ }
+
+ return [];
+}
+
+/***/ }),
+/* 603 */
+/***/ (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__(841));
+
+var _printer = _interopRequireDefault(__webpack_require__(842));
+
+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),
+ recordAndTupleSyntaxType: opts.recordAndTupleSyntaxType
+ };
+
+ 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();
+}
+
+/***/ }),
+/* 604 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var toFinite = __webpack_require__(844);
+
+/**
+ * Converts `value` to an integer.
+ *
+ * **Note:** This method is loosely based on
+ * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).
+ *
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @category Lang
+ * @param {*} value The value to convert.
+ * @returns {number} Returns the converted integer.
+ * @example
+ *
+ * _.toInteger(3.2);
+ * // => 3
+ *
+ * _.toInteger(Number.MIN_VALUE);
+ * // => 0
+ *
+ * _.toInteger(Infinity);
+ * // => 1.7976931348623157e+308
+ *
+ * _.toInteger('3.2');
+ * // => 3
+ */
+function toInteger(value) {
+ var result = toFinite(value),
+ remainder = result % 1;
+
+ return result === result ? (remainder ? result - remainder : result) : 0;
+}
+
+module.exports = toInteger;
+
+
+/***/ }),
+/* 605 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var baseToString = __webpack_require__(639);
+
+/**
+ * Converts `value` to a string. An empty string is returned for `null`
+ * and `undefined` values. The sign of `-0` is preserved.
+ *
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @category Lang
+ * @param {*} value The value to convert.
+ * @returns {string} Returns the converted string.
+ * @example
+ *
+ * _.toString(null);
+ * // => ''
+ *
+ * _.toString(-0);
+ * // => '-0'
+ *
+ * _.toString([1, 2, 3]);
+ * // => '1,2,3'
+ */
+function toString(value) {
+ return value == null ? '' : baseToString(value);
+}
+
+module.exports = toString;
+
+
+/***/ }),
+/* 606 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var isSymbol = __webpack_require__(577);
+
+/** Used as references for various `Number` constants. */
+var INFINITY = 1 / 0;
+
+/**
+ * Converts `value` to a string key if it's not a string or symbol.
+ *
+ * @private
+ * @param {*} value The value to inspect.
+ * @returns {string|symbol} Returns the key.
+ */
+function toKey(value) {
+ if (typeof value == 'string' || isSymbol(value)) {
+ return value;
+ }
+ var result = (value + '');
+ return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
+}
+
+module.exports = toKey;
+
+
+/***/ }),
+/* 607 */,
+/* 608 */,
+/* 609 */,
+/* 610 */,
+/* 611 */,
+/* 612 */
+/***/ (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;
+}
+
+/***/ }),
+/* 613 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var ListCache = __webpack_require__(586),
+ stackClear = __webpack_require__(727),
+ stackDelete = __webpack_require__(728),
+ stackGet = __webpack_require__(729),
+ stackHas = __webpack_require__(730),
+ stackSet = __webpack_require__(731);
+
+/**
+ * Creates a stack cache object to store key-value pairs.
+ *
+ * @private
+ * @constructor
+ * @param {Array} [entries] The key-value pairs to cache.
+ */
+function Stack(entries) {
+ var data = this.__data__ = new ListCache(entries);
+ this.size = data.size;
+}
+
+// Add methods to `Stack`.
+Stack.prototype.clear = stackClear;
+Stack.prototype['delete'] = stackDelete;
+Stack.prototype.get = stackGet;
+Stack.prototype.has = stackHas;
+Stack.prototype.set = stackSet;
+
+module.exports = Stack;
+
+
+/***/ }),
+/* 614 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var getNative = __webpack_require__(574),
+ root = __webpack_require__(562);
+
+/* Built-in method references that are verified to be native. */
+var Map = getNative(root, 'Map');
+
+module.exports = Map;
+
+
+/***/ }),
+/* 615 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var Symbol = __webpack_require__(570);
+
+/** Used for built-in method references. */
+var objectProto = Object.prototype;
+
+/** Used to check objects for own properties. */
+var hasOwnProperty = objectProto.hasOwnProperty;
+
+/**
+ * Used to resolve the
+ * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
+ * of values.
+ */
+var nativeObjectToString = objectProto.toString;
+
+/** Built-in value references. */
+var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
+
+/**
+ * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
+ *
+ * @private
+ * @param {*} value The value to query.
+ * @returns {string} Returns the raw `toStringTag`.
+ */
+function getRawTag(value) {
+ var isOwn = hasOwnProperty.call(value, symToStringTag),
+ tag = value[symToStringTag];
+
+ try {
+ value[symToStringTag] = undefined;
+ var unmasked = true;
+ } catch (e) {}
+
+ var result = nativeObjectToString.call(value);
+ if (unmasked) {
+ if (isOwn) {
+ value[symToStringTag] = tag;
+ } else {
+ delete value[symToStringTag];
+ }
+ }
+ return result;
+}
+
+module.exports = getRawTag;
+
+
+/***/ }),
+/* 616 */
+/***/ (function(module, exports) {
+
+/** Used for built-in method references. */
+var objectProto = Object.prototype;
+
+/**
+ * Used to resolve the
+ * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
+ * of values.
+ */
+var nativeObjectToString = objectProto.toString;
+
+/**
+ * Converts `value` to a string using `Object.prototype.toString`.
+ *
+ * @private
+ * @param {*} value The value to convert.
+ * @returns {string} Returns the converted string.
+ */
+function objectToString(value) {
+ return nativeObjectToString.call(value);
+}
+
+module.exports = objectToString;
+
+
+/***/ }),
+/* 617 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var mapCacheClear = __webpack_require__(736),
+ mapCacheDelete = __webpack_require__(743),
+ mapCacheGet = __webpack_require__(745),
+ mapCacheHas = __webpack_require__(746),
+ mapCacheSet = __webpack_require__(747);
+
+/**
+ * Creates a map cache object to store key-value pairs.
+ *
+ * @private
+ * @constructor
+ * @param {Array} [entries] The key-value pairs to cache.
+ */
+function MapCache(entries) {
+ var index = -1,
+ length = entries == null ? 0 : entries.length;
+
+ this.clear();
+ while (++index < length) {
+ var entry = entries[index];
+ this.set(entry[0], entry[1]);
+ }
+}
+
+// Add methods to `MapCache`.
+MapCache.prototype.clear = mapCacheClear;
+MapCache.prototype['delete'] = mapCacheDelete;
+MapCache.prototype.get = mapCacheGet;
+MapCache.prototype.has = mapCacheHas;
+MapCache.prototype.set = mapCacheSet;
+
+module.exports = MapCache;
+
+
+/***/ }),
+/* 618 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var baseIsArguments = __webpack_require__(752),
+ isObjectLike = __webpack_require__(565);
+
+/** Used for built-in method references. */
+var objectProto = Object.prototype;
+
+/** Used to check objects for own properties. */
+var hasOwnProperty = objectProto.hasOwnProperty;
+
+/** Built-in value references. */
+var propertyIsEnumerable = objectProto.propertyIsEnumerable;
+
+/**
+ * Checks if `value` is likely an `arguments` object.
+ *
+ * @static
+ * @memberOf _
+ * @since 0.1.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is an `arguments` object,
+ * else `false`.
+ * @example
+ *
+ * _.isArguments(function() { return arguments; }());
+ * // => true
+ *
+ * _.isArguments([1, 2, 3]);
+ * // => false
+ */
+var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
+ return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&
+ !propertyIsEnumerable.call(value, 'callee');
+};
+
+module.exports = isArguments;
+
+
+/***/ }),
+/* 619 */
+/***/ (function(module, exports) {
+
+module.exports = function(module) {
+ if(!module.webpackPolyfill) {
+ module.deprecate = function() {};
+ module.paths = [];
+ // module.parent = undefined by default
+ if(!module.children) module.children = [];
+ Object.defineProperty(module, "loaded", {
+ enumerable: true,
+ get: function() {
+ return module.l;
+ }
+ });
+ Object.defineProperty(module, "id", {
+ enumerable: true,
+ get: function() {
+ return module.i;
+ }
+ });
+ module.webpackPolyfill = 1;
+ }
+ return module;
+};
+
+
+/***/ }),
+/* 620 */
+/***/ (function(module, exports) {
+
+/** Used as references for various `Number` constants. */
+var MAX_SAFE_INTEGER = 9007199254740991;
+
+/** Used to detect unsigned integer values. */
+var reIsUint = /^(?:0|[1-9]\d*)$/;
+
+/**
+ * Checks if `value` is a valid array-like index.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
+ * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
+ */
+function isIndex(value, length) {
+ var type = typeof value;
+ length = length == null ? MAX_SAFE_INTEGER : length;
+
+ return !!length &&
+ (type == 'number' ||
+ (type != 'symbol' && reIsUint.test(value))) &&
+ (value > -1 && value % 1 == 0 && value < length);
+}
+
+module.exports = isIndex;
+
+
+/***/ }),
+/* 621 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var baseIsTypedArray = __webpack_require__(754),
+ baseUnary = __webpack_require__(596),
+ nodeUtil = __webpack_require__(597);
+
+/* Node.js helper references. */
+var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
+
+/**
+ * Checks if `value` is classified as a typed array.
+ *
+ * @static
+ * @memberOf _
+ * @since 3.0.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
+ * @example
+ *
+ * _.isTypedArray(new Uint8Array);
+ * // => true
+ *
+ * _.isTypedArray([]);
+ * // => false
+ */
+var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
+
+module.exports = isTypedArray;
+
+
+/***/ }),
+/* 622 */
+/***/ (function(module, exports) {
+
+/** Used as references for various `Number` constants. */
+var MAX_SAFE_INTEGER = 9007199254740991;
+
+/**
+ * Checks if `value` is a valid array-like length.
+ *
+ * **Note:** This method is loosely based on
+ * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
+ *
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
+ * @example
+ *
+ * _.isLength(3);
+ * // => true
+ *
+ * _.isLength(Number.MIN_VALUE);
+ * // => false
+ *
+ * _.isLength(Infinity);
+ * // => false
+ *
+ * _.isLength('3');
+ * // => false
+ */
+function isLength(value) {
+ return typeof value == 'number' &&
+ value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
+}
+
+module.exports = isLength;
+
+
+/***/ }),
+/* 623 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var arrayFilter = __webpack_require__(762),
+ stubArray = __webpack_require__(659);
+
+/** Used for built-in method references. */
+var objectProto = Object.prototype;
+
+/** Built-in value references. */
+var propertyIsEnumerable = objectProto.propertyIsEnumerable;
+
+/* Built-in method references for those with the same name as other `lodash` methods. */
+var nativeGetSymbols = Object.getOwnPropertySymbols;
+
+/**
+ * Creates an array of the own enumerable symbols of `object`.
+ *
+ * @private
+ * @param {Object} object The object to query.
+ * @returns {Array} Returns the array of symbols.
+ */
+var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
+ if (object == null) {
+ return [];
+ }
+ object = Object(object);
+ return arrayFilter(nativeGetSymbols(object), function(symbol) {
+ return propertyIsEnumerable.call(object, symbol);
+ });
+};
+
+module.exports = getSymbols;
+
+
+/***/ }),
+/* 624 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var overArg = __webpack_require__(657);
+
+/** Built-in value references. */
+var getPrototype = overArg(Object.getPrototypeOf, Object);
+
+module.exports = getPrototype;
+
+
+/***/ }),
+/* 625 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var Uint8Array = __webpack_require__(665);
+
+/**
+ * Creates a clone of `arrayBuffer`.
+ *
+ * @private
+ * @param {ArrayBuffer} arrayBuffer The array buffer to clone.
+ * @returns {ArrayBuffer} Returns the cloned array buffer.
+ */
+function cloneArrayBuffer(arrayBuffer) {
+ var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
+ new Uint8Array(result).set(new Uint8Array(arrayBuffer));
+ return result;
+}
+
+module.exports = cloneArrayBuffer;
+
+
+/***/ }),
+/* 626 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = isType;
+
+var _definitions = __webpack_require__(564);
+
+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;
+}
+
+/***/ }),
+/* 627 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = validate;
+exports.validateField = validateField;
+exports.validateChild = validateChild;
+
+var _definitions = __webpack_require__(564);
+
+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);
+ validateChild(node, key, val);
+}
+
+function validateField(node, key, val, field) {
+ if (!(field == null ? void 0 : field.validate)) return;
+ if (field.optional && val == null) return;
+ field.validate(node, key, val);
+}
+
+function validateChild(node, key, val) {
+ if (val == null) return;
+ const validate = _definitions.NODE_PARENT_VALIDATIONS[val.type];
+ if (!validate) return;
+ validate(node, key, val);
+}
+
+/***/ }),
+/* 628 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.classMethodOrDeclareMethodCommon = exports.classMethodOrPropertyCommon = void 0;
+
+var _utils = _interopRequireWildcard(__webpack_require__(571));
+
+var _core = __webpack_require__(600);
+
+var _is = _interopRequireDefault(__webpack_require__(579));
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
+
+function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } 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"))),
+ optional: true
+ }
+ })
+});
+(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.assertNodeOrValueType)("null", "PatternLike")))
+ },
+ decorators: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Decorator"))),
+ optional: true
+ }
+ })
+});
+(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")))
+ }
+ }
+});
+(0, _utils.default)("ClassExpression", {
+ builder: ["id", "superClass", "body", "decorators"],
+ visitor: ["id", "body", "superClass", "mixins", "typeParameters", "superTypeParameters", "implements", "decorators"],
+ aliases: ["Scopable", "Class", "Expression"],
+ fields: {
+ id: {
+ validate: (0, _utils.assertNodeType)("Identifier"),
+ optional: true
+ },
+ 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
+ },
+ decorators: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Decorator"))),
+ optional: true
+ },
+ mixins: {
+ validate: (0, _utils.assertNodeType)("InterfaceExtends"),
+ optional: true
+ }
+ }
+});
+(0, _utils.default)("ClassDeclaration", {
+ inherits: "ClassExpression",
+ aliases: ["Scopable", "Class", "Statement", "Declaration"],
+ fields: {
+ id: {
+ validate: (0, _utils.assertNodeType)("Identifier")
+ },
+ 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
+ },
+ decorators: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Decorator"))),
+ optional: true
+ },
+ mixins: {
+ validate: (0, _utils.assertNodeType)("InterfaceExtends"),
+ optional: true
+ },
+ declare: {
+ validate: (0, _utils.assertValueType)("boolean"),
+ optional: true
+ },
+ abstract: {
+ validate: (0, _utils.assertValueType)("boolean"),
+ optional: true
+ }
+ },
+ validate: function () {
+ const identifier = (0, _utils.assertNodeType)("Identifier");
+ return function (parent, key, node) {
+ if (!Object({"NODE_ENV":"production"}).BABEL_TYPES_8_BREAKING) return;
+
+ if (!(0, _is.default)("ExportDefaultDeclaration", parent)) {
+ identifier(node, "id", node.id);
+ }
+ };
+ }()
+});
+(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: {
+ optional: true,
+ validate: (0, _utils.chain)((0, _utils.assertNodeType)("Declaration"), Object.assign(function (node, key, val) {
+ if (!Object({"NODE_ENV":"production"}).BABEL_TYPES_8_BREAKING) return;
+
+ if (val && node.specifiers.length) {
+ throw new TypeError("Only declaration or specifiers is allowed on ExportNamedDeclaration");
+ }
+ }, {
+ oneOfNodeTypes: ["Declaration"]
+ }), function (node, key, val) {
+ if (!Object({"NODE_ENV":"production"}).BABEL_TYPES_8_BREAKING) return;
+
+ if (val && node.source) {
+ throw new TypeError("Cannot export a declaration from a source");
+ }
+ })
+ },
+ specifiers: {
+ default: [],
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)(function () {
+ const sourced = (0, _utils.assertNodeType)("ExportSpecifier", "ExportDefaultSpecifier", "ExportNamespaceSpecifier");
+ const sourceless = (0, _utils.assertNodeType)("ExportSpecifier");
+ if (!Object({"NODE_ENV":"production"}).BABEL_TYPES_8_BREAKING) return sourced;
+ return function (node, key, val) {
+ const validator = node.source ? sourced : sourceless;
+ validator(node, key, val);
+ };
+ }()))
+ },
+ 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"],
+ builder: ["left", "right", "body", "await"],
+ aliases: ["Scopable", "Statement", "For", "BlockParent", "Loop", "ForXStatement"],
+ fields: {
+ left: {
+ validate: function () {
+ if (!Object({"NODE_ENV":"production"}).BABEL_TYPES_8_BREAKING) {
+ return (0, _utils.assertNodeType)("VariableDeclaration", "LVal");
+ }
+
+ const declaration = (0, _utils.assertNodeType)("VariableDeclaration");
+ const lval = (0, _utils.assertNodeType)("Identifier", "MemberExpression", "ArrayPattern", "ObjectPattern");
+ return function (node, key, val) {
+ if ((0, _is.default)("VariableDeclaration", val)) {
+ declaration(node, key, val);
+ } else {
+ lval(node, key, val);
+ }
+ };
+ }()
+ },
+ right: {
+ validate: (0, _utils.assertNodeType)("Expression")
+ },
+ body: {
+ validate: (0, _utils.assertNodeType)("Statement")
+ },
+ await: {
+ default: false
+ }
+ }
+});
+(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.chain)((0, _utils.assertNodeType)("Identifier"), Object.assign(function (node, key, val) {
+ if (!Object({"NODE_ENV":"production"}).BABEL_TYPES_8_BREAKING) return;
+ let property;
+
+ switch (val.name) {
+ case "function":
+ property = "sent";
+ break;
+
+ case "new":
+ property = "target";
+ break;
+
+ case "import":
+ property = "meta";
+ break;
+ }
+
+ if (!(0, _is.default)("Identifier", node.property, {
+ name: property
+ })) {
+ throw new TypeError("Unrecognised MetaProperty");
+ }
+ }, {
+ oneOfNodeTypes: ["Identifier"]
+ }))
+ },
+ property: {
+ validate: (0, _utils.assertNodeType)("Identifier")
+ }
+ }
+});
+const classMethodOrPropertyCommon = {
+ abstract: {
+ validate: (0, _utils.assertValueType)("boolean"),
+ optional: true
+ },
+ accessibility: {
+ validate: (0, _utils.assertOneOf)("public", "private", "protected"),
+ optional: true
+ },
+ static: {
+ default: false
+ },
+ computed: {
+ default: false
+ },
+ 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.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", "generator", "async"],
+ 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: {
+ 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")), function (node, key, val) {
+ if (node.quasis.length !== val.length + 1) {
+ throw new TypeError(`Number of ${node.type} quasis should be exactly one more than the number of expressions.\nExpected ${val.length + 1} quasis but got ${node.quasis.length}`);
+ }
+ })
+ }
+ }
+});
+(0, _utils.default)("YieldExpression", {
+ builder: ["argument", "delegate"],
+ visitor: ["argument"],
+ aliases: ["Expression", "Terminatorless"],
+ fields: {
+ delegate: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("boolean"), Object.assign(function (node, key, val) {
+ if (!Object({"NODE_ENV":"production"}).BABEL_TYPES_8_BREAKING) return;
+
+ if (val && !node.argument) {
+ throw new TypeError("Property delegate of YieldExpression cannot be true if there is no argument");
+ }
+ }, {
+ type: "boolean"
+ })),
+ default: false
+ },
+ argument: {
+ optional: true,
+ validate: (0, _utils.assertNodeType)("Expression")
+ }
+ }
+});
+
+/***/ }),
+/* 629 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = inherit;
+
+var _uniq = _interopRequireDefault(__webpack_require__(799));
+
+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));
+ }
+}
+
+/***/ }),
+/* 630 */
+/***/ (function(module, exports) {
+
+/**
+ * The base implementation of `_.findIndex` and `_.findLastIndex` without
+ * support for iteratee shorthands.
+ *
+ * @private
+ * @param {Array} array The array to inspect.
+ * @param {Function} predicate The function invoked per iteration.
+ * @param {number} fromIndex The index to search from.
+ * @param {boolean} [fromRight] Specify iterating from right to left.
+ * @returns {number} Returns the index of the matched value, else `-1`.
+ */
+function baseFindIndex(array, predicate, fromIndex, fromRight) {
+ var length = array.length,
+ index = fromIndex + (fromRight ? 1 : -1);
+
+ while ((fromRight ? index-- : ++index < length)) {
+ if (predicate(array[index], index, array)) {
+ return index;
+ }
+ }
+ return -1;
+}
+
+module.exports = baseFindIndex;
+
+
+/***/ }),
+/* 631 */
+/***/ (function(module, exports) {
+
+/**
+ * Converts `set` to an array of its values.
+ *
+ * @private
+ * @param {Object} set The set to convert.
+ * @returns {Array} Returns the values.
+ */
+function setToArray(set) {
+ var index = -1,
+ result = Array(set.size);
+
+ set.forEach(function(value) {
+ result[++index] = value;
+ });
+ return result;
+}
+
+module.exports = setToArray;
+
+
+/***/ }),
+/* 632 */
+/***/ (function(module, exports, __webpack_require__) {
+
+/*
+ * Copyright 2009-2011 Mozilla Foundation and contributors
+ * Licensed under the New BSD license. See LICENSE.txt or:
+ * http://opensource.org/licenses/BSD-3-Clause
+ */
+exports.SourceMapGenerator = __webpack_require__(581).SourceMapGenerator;
+exports.SourceMapConsumer = __webpack_require__(635).SourceMapConsumer;
+exports.SourceNode = __webpack_require__(638).SourceNode;
+
+
+/***/ }),
+/* 633 */
+/***/ (function(module, exports) {
+
+/* -*- Mode: js; js-indent-level: 2; -*- */
+/*
+ * Copyright 2011 Mozilla Foundation and contributors
+ * Licensed under the New BSD license. See LICENSE or:
+ * http://opensource.org/licenses/BSD-3-Clause
+ */
+
+var intToCharMap = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split('');
+
+/**
+ * Encode an integer in the range of 0 to 63 to a single base 64 digit.
+ */
+exports.encode = function (number) {
+ if (0 <= number && number < intToCharMap.length) {
+ return intToCharMap[number];
+ }
+ throw new TypeError("Must be between 0 and 63: " + number);
+};
+
+/**
+ * Decode a single base 64 character code digit to an integer. Returns -1 on
+ * failure.
+ */
+exports.decode = function (charCode) {
+ var bigA = 65; // 'A'
+ var bigZ = 90; // 'Z'
+
+ var littleA = 97; // 'a'
+ var littleZ = 122; // 'z'
+
+ var zero = 48; // '0'
+ var nine = 57; // '9'
+
+ var plus = 43; // '+'
+ var slash = 47; // '/'
+
+ var littleOffset = 26;
+ var numberOffset = 52;
+
+ // 0 - 25: ABCDEFGHIJKLMNOPQRSTUVWXYZ
+ if (bigA <= charCode && charCode <= bigZ) {
+ return (charCode - bigA);
+ }
+
+ // 26 - 51: abcdefghijklmnopqrstuvwxyz
+ if (littleA <= charCode && charCode <= littleZ) {
+ return (charCode - littleA + littleOffset);
+ }
+
+ // 52 - 61: 0123456789
+ if (zero <= charCode && charCode <= nine) {
+ return (charCode - zero + numberOffset);
+ }
+
+ // 62: +
+ if (charCode == plus) {
+ return 62;
+ }
+
+ // 63: /
+ if (charCode == slash) {
+ return 63;
+ }
+
+ // Invalid base64 digit.
+ return -1;
+};
+
+
+/***/ }),
+/* 634 */
+/***/ (function(module, exports, __webpack_require__) {
+
+/* -*- Mode: js; js-indent-level: 2; -*- */
+/*
+ * Copyright 2014 Mozilla Foundation and contributors
+ * Licensed under the New BSD license. See LICENSE or:
+ * http://opensource.org/licenses/BSD-3-Clause
+ */
+
+var util = __webpack_require__(566);
+
+/**
+ * Determine whether mappingB is after mappingA with respect to generated
+ * position.
+ */
+function generatedPositionAfter(mappingA, mappingB) {
+ // Optimized for most common case
+ var lineA = mappingA.generatedLine;
+ var lineB = mappingB.generatedLine;
+ var columnA = mappingA.generatedColumn;
+ var columnB = mappingB.generatedColumn;
+ return lineB > lineA || lineB == lineA && columnB >= columnA ||
+ util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0;
+}
+
+/**
+ * A data structure to provide a sorted view of accumulated mappings in a
+ * performance conscious manner. It trades a neglibable overhead in general
+ * case for a large speedup in case of mappings being added in order.
+ */
+function MappingList() {
+ this._array = [];
+ this._sorted = true;
+ // Serves as infimum
+ this._last = {generatedLine: -1, generatedColumn: 0};
+}
+
+/**
+ * Iterate through internal items. This method takes the same arguments that
+ * `Array.prototype.forEach` takes.
+ *
+ * NOTE: The order of the mappings is NOT guaranteed.
+ */
+MappingList.prototype.unsortedForEach =
+ function MappingList_forEach(aCallback, aThisArg) {
+ this._array.forEach(aCallback, aThisArg);
+ };
+
+/**
+ * Add the given source mapping.
+ *
+ * @param Object aMapping
+ */
+MappingList.prototype.add = function MappingList_add(aMapping) {
+ if (generatedPositionAfter(this._last, aMapping)) {
+ this._last = aMapping;
+ this._array.push(aMapping);
+ } else {
+ this._sorted = false;
+ this._array.push(aMapping);
+ }
+};
+
+/**
+ * Returns the flat, sorted array of mappings. The mappings are sorted by
+ * generated position.
+ *
+ * WARNING: This method returns internal data without copying, for
+ * performance. The return value must NOT be mutated, and should be treated as
+ * an immutable borrow. If you want to take ownership, you must make your own
+ * copy.
+ */
+MappingList.prototype.toArray = function MappingList_toArray() {
+ if (!this._sorted) {
+ this._array.sort(util.compareByGeneratedPositionsInflated);
+ this._sorted = true;
+ }
+ return this._array;
+};
+
+exports.MappingList = MappingList;
+
+
+/***/ }),
+/* 635 */
+/***/ (function(module, exports, __webpack_require__) {
+
+/* -*- Mode: js; js-indent-level: 2; -*- */
+/*
+ * Copyright 2011 Mozilla Foundation and contributors
+ * Licensed under the New BSD license. See LICENSE or:
+ * http://opensource.org/licenses/BSD-3-Clause
+ */
+
+var util = __webpack_require__(566);
+var binarySearch = __webpack_require__(636);
+var ArraySet = __webpack_require__(583).ArraySet;
+var base64VLQ = __webpack_require__(582);
+var quickSort = __webpack_require__(637).quickSort;
+
+function SourceMapConsumer(aSourceMap) {
+ var sourceMap = aSourceMap;
+ if (typeof aSourceMap === 'string') {
+ sourceMap = JSON.parse(aSourceMap.replace(/^\)\]\}'/, ''));
+ }
+
+ return sourceMap.sections != null
+ ? new IndexedSourceMapConsumer(sourceMap)
+ : new BasicSourceMapConsumer(sourceMap);
+}
+
+SourceMapConsumer.fromSourceMap = function(aSourceMap) {
+ return BasicSourceMapConsumer.fromSourceMap(aSourceMap);
+}
+
+/**
+ * The version of the source mapping spec that we are consuming.
+ */
+SourceMapConsumer.prototype._version = 3;
+
+// `__generatedMappings` and `__originalMappings` are arrays that hold the
+// parsed mapping coordinates from the source map's "mappings" attribute. They
+// are lazily instantiated, accessed via the `_generatedMappings` and
+// `_originalMappings` getters respectively, and we only parse the mappings
+// and create these arrays once queried for a source location. We jump through
+// these hoops because there can be many thousands of mappings, and parsing
+// them is expensive, so we only want to do it if we must.
+//
+// Each object in the arrays is of the form:
+//
+// {
+// generatedLine: The line number in the generated code,
+// generatedColumn: The column number in the generated code,
+// source: The path to the original source file that generated this
+// chunk of code,
+// originalLine: The line number in the original source that
+// corresponds to this chunk of generated code,
+// originalColumn: The column number in the original source that
+// corresponds to this chunk of generated code,
+// name: The name of the original symbol which generated this chunk of
+// code.
+// }
+//
+// All properties except for `generatedLine` and `generatedColumn` can be
+// `null`.
+//
+// `_generatedMappings` is ordered by the generated positions.
+//
+// `_originalMappings` is ordered by the original positions.
+
+SourceMapConsumer.prototype.__generatedMappings = null;
+Object.defineProperty(SourceMapConsumer.prototype, '_generatedMappings', {
+ get: function () {
+ if (!this.__generatedMappings) {
+ this._parseMappings(this._mappings, this.sourceRoot);
+ }
+
+ return this.__generatedMappings;
+ }
+});
+
+SourceMapConsumer.prototype.__originalMappings = null;
+Object.defineProperty(SourceMapConsumer.prototype, '_originalMappings', {
+ get: function () {
+ if (!this.__originalMappings) {
+ this._parseMappings(this._mappings, this.sourceRoot);
+ }
+
+ return this.__originalMappings;
+ }
+});
+
+SourceMapConsumer.prototype._charIsMappingSeparator =
+ function SourceMapConsumer_charIsMappingSeparator(aStr, index) {
+ var c = aStr.charAt(index);
+ return c === ";" || c === ",";
+ };
+
+/**
+ * Parse the mappings in a string in to a data structure which we can easily
+ * query (the ordered arrays in the `this.__generatedMappings` and
+ * `this.__originalMappings` properties).
+ */
+SourceMapConsumer.prototype._parseMappings =
+ function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {
+ throw new Error("Subclasses must implement _parseMappings");
+ };
+
+SourceMapConsumer.GENERATED_ORDER = 1;
+SourceMapConsumer.ORIGINAL_ORDER = 2;
+
+SourceMapConsumer.GREATEST_LOWER_BOUND = 1;
+SourceMapConsumer.LEAST_UPPER_BOUND = 2;
+
+/**
+ * Iterate over each mapping between an original source/line/column and a
+ * generated line/column in this source map.
+ *
+ * @param Function aCallback
+ * The function that is called with each mapping.
+ * @param Object aContext
+ * Optional. If specified, this object will be the value of `this` every
+ * time that `aCallback` is called.
+ * @param aOrder
+ * Either `SourceMapConsumer.GENERATED_ORDER` or
+ * `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to
+ * iterate over the mappings sorted by the generated file's line/column
+ * order or the original's source/line/column order, respectively. Defaults to
+ * `SourceMapConsumer.GENERATED_ORDER`.
+ */
+SourceMapConsumer.prototype.eachMapping =
+ function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) {
+ var context = aContext || null;
+ var order = aOrder || SourceMapConsumer.GENERATED_ORDER;
+
+ var mappings;
+ switch (order) {
+ case SourceMapConsumer.GENERATED_ORDER:
+ mappings = this._generatedMappings;
+ break;
+ case SourceMapConsumer.ORIGINAL_ORDER:
+ mappings = this._originalMappings;
+ break;
+ default:
+ throw new Error("Unknown order of iteration.");
+ }
+
+ var sourceRoot = this.sourceRoot;
+ mappings.map(function (mapping) {
+ var source = mapping.source === null ? null : this._sources.at(mapping.source);
+ if (source != null && sourceRoot != null) {
+ source = util.join(sourceRoot, source);
+ }
+ return {
+ source: source,
+ generatedLine: mapping.generatedLine,
+ generatedColumn: mapping.generatedColumn,
+ originalLine: mapping.originalLine,
+ originalColumn: mapping.originalColumn,
+ name: mapping.name === null ? null : this._names.at(mapping.name)
+ };
+ }, this).forEach(aCallback, context);
+ };
+
+/**
+ * Returns all generated line and column information for the original source,
+ * line, and column provided. If no column is provided, returns all mappings
+ * corresponding to a either the line we are searching for or the next
+ * closest line that has any mappings. Otherwise, returns all mappings
+ * corresponding to the given line and either the column we are searching for
+ * or the next closest column that has any offsets.
+ *
+ * The only argument is an object with the following properties:
+ *
+ * - source: The filename of the original source.
+ * - line: The line number in the original source.
+ * - column: Optional. the column number in the original source.
+ *
+ * and an array of objects is returned, each with the following properties:
+ *
+ * - line: The line number in the generated source, or null.
+ * - column: The column number in the generated source, or null.
+ */
+SourceMapConsumer.prototype.allGeneratedPositionsFor =
+ function SourceMapConsumer_allGeneratedPositionsFor(aArgs) {
+ var line = util.getArg(aArgs, 'line');
+
+ // When there is no exact match, BasicSourceMapConsumer.prototype._findMapping
+ // returns the index of the closest mapping less than the needle. By
+ // setting needle.originalColumn to 0, we thus find the last mapping for
+ // the given line, provided such a mapping exists.
+ var needle = {
+ source: util.getArg(aArgs, 'source'),
+ originalLine: line,
+ originalColumn: util.getArg(aArgs, 'column', 0)
+ };
+
+ if (this.sourceRoot != null) {
+ needle.source = util.relative(this.sourceRoot, needle.source);
+ }
+ if (!this._sources.has(needle.source)) {
+ return [];
+ }
+ needle.source = this._sources.indexOf(needle.source);
+
+ var mappings = [];
+
+ var index = this._findMapping(needle,
+ this._originalMappings,
+ "originalLine",
+ "originalColumn",
+ util.compareByOriginalPositions,
+ binarySearch.LEAST_UPPER_BOUND);
+ if (index >= 0) {
+ var mapping = this._originalMappings[index];
+
+ if (aArgs.column === undefined) {
+ var originalLine = mapping.originalLine;
+
+ // Iterate until either we run out of mappings, or we run into
+ // a mapping for a different line than the one we found. Since
+ // mappings are sorted, this is guaranteed to find all mappings for
+ // the line we found.
+ while (mapping && mapping.originalLine === originalLine) {
+ mappings.push({
+ line: util.getArg(mapping, 'generatedLine', null),
+ column: util.getArg(mapping, 'generatedColumn', null),
+ lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)
+ });
+
+ mapping = this._originalMappings[++index];
+ }
+ } else {
+ var originalColumn = mapping.originalColumn;
+
+ // Iterate until either we run out of mappings, or we run into
+ // a mapping for a different line than the one we were searching for.
+ // Since mappings are sorted, this is guaranteed to find all mappings for
+ // the line we are searching for.
+ while (mapping &&
+ mapping.originalLine === line &&
+ mapping.originalColumn == originalColumn) {
+ mappings.push({
+ line: util.getArg(mapping, 'generatedLine', null),
+ column: util.getArg(mapping, 'generatedColumn', null),
+ lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)
+ });
+
+ mapping = this._originalMappings[++index];
+ }
+ }
+ }
+
+ return mappings;
+ };
+
+exports.SourceMapConsumer = SourceMapConsumer;
+
+/**
+ * A BasicSourceMapConsumer instance represents a parsed source map which we can
+ * query for information about the original file positions by giving it a file
+ * position in the generated source.
+ *
+ * The only parameter is the raw source map (either as a JSON string, or
+ * already parsed to an object). According to the spec, source maps have the
+ * following attributes:
+ *
+ * - version: Which version of the source map spec this map is following.
+ * - sources: An array of URLs to the original source files.
+ * - names: An array of identifiers which can be referrenced by individual mappings.
+ * - sourceRoot: Optional. The URL root from which all sources are relative.
+ * - sourcesContent: Optional. An array of contents of the original source files.
+ * - mappings: A string of base64 VLQs which contain the actual mappings.
+ * - file: Optional. The generated file this source map is associated with.
+ *
+ * Here is an example source map, taken from the source map spec[0]:
+ *
+ * {
+ * version : 3,
+ * file: "out.js",
+ * sourceRoot : "",
+ * sources: ["foo.js", "bar.js"],
+ * names: ["src", "maps", "are", "fun"],
+ * mappings: "AA,AB;;ABCDE;"
+ * }
+ *
+ * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit?pli=1#
+ */
+function BasicSourceMapConsumer(aSourceMap) {
+ var sourceMap = aSourceMap;
+ if (typeof aSourceMap === 'string') {
+ sourceMap = JSON.parse(aSourceMap.replace(/^\)\]\}'/, ''));
+ }
+
+ var version = util.getArg(sourceMap, 'version');
+ var sources = util.getArg(sourceMap, 'sources');
+ // Sass 3.3 leaves out the 'names' array, so we deviate from the spec (which
+ // requires the array) to play nice here.
+ var names = util.getArg(sourceMap, 'names', []);
+ var sourceRoot = util.getArg(sourceMap, 'sourceRoot', null);
+ var sourcesContent = util.getArg(sourceMap, 'sourcesContent', null);
+ var mappings = util.getArg(sourceMap, 'mappings');
+ var file = util.getArg(sourceMap, 'file', null);
+
+ // Once again, Sass deviates from the spec and supplies the version as a
+ // string rather than a number, so we use loose equality checking here.
+ if (version != this._version) {
+ throw new Error('Unsupported version: ' + version);
+ }
+
+ sources = sources
+ .map(String)
+ // Some source maps produce relative source paths like "./foo.js" instead of
+ // "foo.js". Normalize these first so that future comparisons will succeed.
+ // See bugzil.la/1090768.
+ .map(util.normalize)
+ // Always ensure that absolute sources are internally stored relative to
+ // the source root, if the source root is absolute. Not doing this would
+ // be particularly problematic when the source root is a prefix of the
+ // source (valid, but why??). See github issue #199 and bugzil.la/1188982.
+ .map(function (source) {
+ return sourceRoot && util.isAbsolute(sourceRoot) && util.isAbsolute(source)
+ ? util.relative(sourceRoot, source)
+ : source;
+ });
+
+ // Pass `true` below to allow duplicate names and sources. While source maps
+ // are intended to be compressed and deduplicated, the TypeScript compiler
+ // sometimes generates source maps with duplicates in them. See Github issue
+ // #72 and bugzil.la/889492.
+ this._names = ArraySet.fromArray(names.map(String), true);
+ this._sources = ArraySet.fromArray(sources, true);
+
+ this.sourceRoot = sourceRoot;
+ this.sourcesContent = sourcesContent;
+ this._mappings = mappings;
+ this.file = file;
+}
+
+BasicSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);
+BasicSourceMapConsumer.prototype.consumer = SourceMapConsumer;
+
+/**
+ * Create a BasicSourceMapConsumer from a SourceMapGenerator.
+ *
+ * @param SourceMapGenerator aSourceMap
+ * The source map that will be consumed.
+ * @returns BasicSourceMapConsumer
+ */
+BasicSourceMapConsumer.fromSourceMap =
+ function SourceMapConsumer_fromSourceMap(aSourceMap) {
+ var smc = Object.create(BasicSourceMapConsumer.prototype);
+
+ var names = smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true);
+ var sources = smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true);
+ smc.sourceRoot = aSourceMap._sourceRoot;
+ smc.sourcesContent = aSourceMap._generateSourcesContent(smc._sources.toArray(),
+ smc.sourceRoot);
+ smc.file = aSourceMap._file;
+
+ // Because we are modifying the entries (by converting string sources and
+ // names to indices into the sources and names ArraySets), we have to make
+ // a copy of the entry or else bad things happen. Shared mutable state
+ // strikes again! See github issue #191.
+
+ var generatedMappings = aSourceMap._mappings.toArray().slice();
+ var destGeneratedMappings = smc.__generatedMappings = [];
+ var destOriginalMappings = smc.__originalMappings = [];
+
+ for (var i = 0, length = generatedMappings.length; i < length; i++) {
+ var srcMapping = generatedMappings[i];
+ var destMapping = new Mapping;
+ destMapping.generatedLine = srcMapping.generatedLine;
+ destMapping.generatedColumn = srcMapping.generatedColumn;
+
+ if (srcMapping.source) {
+ destMapping.source = sources.indexOf(srcMapping.source);
+ destMapping.originalLine = srcMapping.originalLine;
+ destMapping.originalColumn = srcMapping.originalColumn;
+
+ if (srcMapping.name) {
+ destMapping.name = names.indexOf(srcMapping.name);
+ }
+
+ destOriginalMappings.push(destMapping);
+ }
+
+ destGeneratedMappings.push(destMapping);
+ }
+
+ quickSort(smc.__originalMappings, util.compareByOriginalPositions);
+
+ return smc;
+ };
+
+/**
+ * The version of the source mapping spec that we are consuming.
+ */
+BasicSourceMapConsumer.prototype._version = 3;
+
+/**
+ * The list of original sources.
+ */
+Object.defineProperty(BasicSourceMapConsumer.prototype, 'sources', {
+ get: function () {
+ return this._sources.toArray().map(function (s) {
+ return this.sourceRoot != null ? util.join(this.sourceRoot, s) : s;
+ }, this);
+ }
+});
+
+/**
+ * Provide the JIT with a nice shape / hidden class.
+ */
+function Mapping() {
+ this.generatedLine = 0;
+ this.generatedColumn = 0;
+ this.source = null;
+ this.originalLine = null;
+ this.originalColumn = null;
+ this.name = null;
+}
+
+/**
+ * Parse the mappings in a string in to a data structure which we can easily
+ * query (the ordered arrays in the `this.__generatedMappings` and
+ * `this.__originalMappings` properties).
+ */
+BasicSourceMapConsumer.prototype._parseMappings =
+ function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {
+ var generatedLine = 1;
+ var previousGeneratedColumn = 0;
+ var previousOriginalLine = 0;
+ var previousOriginalColumn = 0;
+ var previousSource = 0;
+ var previousName = 0;
+ var length = aStr.length;
+ var index = 0;
+ var cachedSegments = {};
+ var temp = {};
+ var originalMappings = [];
+ var generatedMappings = [];
+ var mapping, str, segment, end, value;
+
+ while (index < length) {
+ if (aStr.charAt(index) === ';') {
+ generatedLine++;
+ index++;
+ previousGeneratedColumn = 0;
+ }
+ else if (aStr.charAt(index) === ',') {
+ index++;
+ }
+ else {
+ mapping = new Mapping();
+ mapping.generatedLine = generatedLine;
+
+ // Because each offset is encoded relative to the previous one,
+ // many segments often have the same encoding. We can exploit this
+ // fact by caching the parsed variable length fields of each segment,
+ // allowing us to avoid a second parse if we encounter the same
+ // segment again.
+ for (end = index; end < length; end++) {
+ if (this._charIsMappingSeparator(aStr, end)) {
+ break;
+ }
+ }
+ str = aStr.slice(index, end);
+
+ segment = cachedSegments[str];
+ if (segment) {
+ index += str.length;
+ } else {
+ segment = [];
+ while (index < end) {
+ base64VLQ.decode(aStr, index, temp);
+ value = temp.value;
+ index = temp.rest;
+ segment.push(value);
+ }
+
+ if (segment.length === 2) {
+ throw new Error('Found a source, but no line and column');
+ }
+
+ if (segment.length === 3) {
+ throw new Error('Found a source and line, but no column');
+ }
+
+ cachedSegments[str] = segment;
+ }
+
+ // Generated column.
+ mapping.generatedColumn = previousGeneratedColumn + segment[0];
+ previousGeneratedColumn = mapping.generatedColumn;
+
+ if (segment.length > 1) {
+ // Original source.
+ mapping.source = previousSource + segment[1];
+ previousSource += segment[1];
+
+ // Original line.
+ mapping.originalLine = previousOriginalLine + segment[2];
+ previousOriginalLine = mapping.originalLine;
+ // Lines are stored 0-based
+ mapping.originalLine += 1;
+
+ // Original column.
+ mapping.originalColumn = previousOriginalColumn + segment[3];
+ previousOriginalColumn = mapping.originalColumn;
+
+ if (segment.length > 4) {
+ // Original name.
+ mapping.name = previousName + segment[4];
+ previousName += segment[4];
+ }
+ }
+
+ generatedMappings.push(mapping);
+ if (typeof mapping.originalLine === 'number') {
+ originalMappings.push(mapping);
+ }
+ }
+ }
+
+ quickSort(generatedMappings, util.compareByGeneratedPositionsDeflated);
+ this.__generatedMappings = generatedMappings;
+
+ quickSort(originalMappings, util.compareByOriginalPositions);
+ this.__originalMappings = originalMappings;
+ };
+
+/**
+ * Find the mapping that best matches the hypothetical "needle" mapping that
+ * we are searching for in the given "haystack" of mappings.
+ */
+BasicSourceMapConsumer.prototype._findMapping =
+ function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName,
+ aColumnName, aComparator, aBias) {
+ // To return the position we are searching for, we must first find the
+ // mapping for the given position and then return the opposite position it
+ // points to. Because the mappings are sorted, we can use binary search to
+ // find the best mapping.
+
+ if (aNeedle[aLineName] <= 0) {
+ throw new TypeError('Line must be greater than or equal to 1, got '
+ + aNeedle[aLineName]);
+ }
+ if (aNeedle[aColumnName] < 0) {
+ throw new TypeError('Column must be greater than or equal to 0, got '
+ + aNeedle[aColumnName]);
+ }
+
+ return binarySearch.search(aNeedle, aMappings, aComparator, aBias);
+ };
+
+/**
+ * Compute the last column for each generated mapping. The last column is
+ * inclusive.
+ */
+BasicSourceMapConsumer.prototype.computeColumnSpans =
+ function SourceMapConsumer_computeColumnSpans() {
+ for (var index = 0; index < this._generatedMappings.length; ++index) {
+ var mapping = this._generatedMappings[index];
+
+ // Mappings do not contain a field for the last generated columnt. We
+ // can come up with an optimistic estimate, however, by assuming that
+ // mappings are contiguous (i.e. given two consecutive mappings, the
+ // first mapping ends where the second one starts).
+ if (index + 1 < this._generatedMappings.length) {
+ var nextMapping = this._generatedMappings[index + 1];
+
+ if (mapping.generatedLine === nextMapping.generatedLine) {
+ mapping.lastGeneratedColumn = nextMapping.generatedColumn - 1;
+ continue;
+ }
+ }
+
+ // The last mapping for each line spans the entire line.
+ mapping.lastGeneratedColumn = Infinity;
+ }
+ };
+
+/**
+ * Returns the original source, line, and column information for the generated
+ * source's line and column positions provided. The only argument is an object
+ * with the following properties:
+ *
+ * - line: The line number in the generated source.
+ * - column: The column number in the generated source.
+ * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or
+ * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the
+ * closest element that is smaller than or greater than the one we are
+ * searching for, respectively, if the exact element cannot be found.
+ * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'.
+ *
+ * and an object is returned with the following properties:
+ *
+ * - source: The original source file, or null.
+ * - line: The line number in the original source, or null.
+ * - column: The column number in the original source, or null.
+ * - name: The original identifier, or null.
+ */
+BasicSourceMapConsumer.prototype.originalPositionFor =
+ function SourceMapConsumer_originalPositionFor(aArgs) {
+ var needle = {
+ generatedLine: util.getArg(aArgs, 'line'),
+ generatedColumn: util.getArg(aArgs, 'column')
+ };
+
+ var index = this._findMapping(
+ needle,
+ this._generatedMappings,
+ "generatedLine",
+ "generatedColumn",
+ util.compareByGeneratedPositionsDeflated,
+ util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND)
+ );
+
+ if (index >= 0) {
+ var mapping = this._generatedMappings[index];
+
+ if (mapping.generatedLine === needle.generatedLine) {
+ var source = util.getArg(mapping, 'source', null);
+ if (source !== null) {
+ source = this._sources.at(source);
+ if (this.sourceRoot != null) {
+ source = util.join(this.sourceRoot, source);
+ }
+ }
+ var name = util.getArg(mapping, 'name', null);
+ if (name !== null) {
+ name = this._names.at(name);
+ }
+ return {
+ source: source,
+ line: util.getArg(mapping, 'originalLine', null),
+ column: util.getArg(mapping, 'originalColumn', null),
+ name: name
+ };
+ }
+ }
+
+ return {
+ source: null,
+ line: null,
+ column: null,
+ name: null
+ };
+ };
+
+/**
+ * Return true if we have the source content for every source in the source
+ * map, false otherwise.
+ */
+BasicSourceMapConsumer.prototype.hasContentsOfAllSources =
+ function BasicSourceMapConsumer_hasContentsOfAllSources() {
+ if (!this.sourcesContent) {
+ return false;
+ }
+ return this.sourcesContent.length >= this._sources.size() &&
+ !this.sourcesContent.some(function (sc) { return sc == null; });
+ };
+
+/**
+ * Returns the original source content. The only argument is the url of the
+ * original source file. Returns null if no original source content is
+ * available.
+ */
+BasicSourceMapConsumer.prototype.sourceContentFor =
+ function SourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {
+ if (!this.sourcesContent) {
+ return null;
+ }
+
+ if (this.sourceRoot != null) {
+ aSource = util.relative(this.sourceRoot, aSource);
+ }
+
+ if (this._sources.has(aSource)) {
+ return this.sourcesContent[this._sources.indexOf(aSource)];
+ }
+
+ var url;
+ if (this.sourceRoot != null
+ && (url = util.urlParse(this.sourceRoot))) {
+ // XXX: file:// URIs and absolute paths lead to unexpected behavior for
+ // many users. We can help them out when they expect file:// URIs to
+ // behave like it would if they were running a local HTTP server. See
+ // https://bugzilla.mozilla.org/show_bug.cgi?id=885597.
+ var fileUriAbsPath = aSource.replace(/^file:\/\//, "");
+ if (url.scheme == "file"
+ && this._sources.has(fileUriAbsPath)) {
+ return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)]
+ }
+
+ if ((!url.path || url.path == "/")
+ && this._sources.has("/" + aSource)) {
+ return this.sourcesContent[this._sources.indexOf("/" + aSource)];
+ }
+ }
+
+ // This function is used recursively from
+ // IndexedSourceMapConsumer.prototype.sourceContentFor. In that case, we
+ // don't want to throw if we can't find the source - we just want to
+ // return null, so we provide a flag to exit gracefully.
+ if (nullOnMissing) {
+ return null;
+ }
+ else {
+ throw new Error('"' + aSource + '" is not in the SourceMap.');
+ }
+ };
+
+/**
+ * Returns the generated line and column information for the original source,
+ * line, and column positions provided. The only argument is an object with
+ * the following properties:
+ *
+ * - source: The filename of the original source.
+ * - line: The line number in the original source.
+ * - column: The column number in the original source.
+ * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or
+ * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the
+ * closest element that is smaller than or greater than the one we are
+ * searching for, respectively, if the exact element cannot be found.
+ * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'.
+ *
+ * and an object is returned with the following properties:
+ *
+ * - line: The line number in the generated source, or null.
+ * - column: The column number in the generated source, or null.
+ */
+BasicSourceMapConsumer.prototype.generatedPositionFor =
+ function SourceMapConsumer_generatedPositionFor(aArgs) {
+ var source = util.getArg(aArgs, 'source');
+ if (this.sourceRoot != null) {
+ source = util.relative(this.sourceRoot, source);
+ }
+ if (!this._sources.has(source)) {
+ return {
+ line: null,
+ column: null,
+ lastColumn: null
+ };
+ }
+ source = this._sources.indexOf(source);
+
+ var needle = {
+ source: source,
+ originalLine: util.getArg(aArgs, 'line'),
+ originalColumn: util.getArg(aArgs, 'column')
+ };
+
+ var index = this._findMapping(
+ needle,
+ this._originalMappings,
+ "originalLine",
+ "originalColumn",
+ util.compareByOriginalPositions,
+ util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND)
+ );
+
+ if (index >= 0) {
+ var mapping = this._originalMappings[index];
+
+ if (mapping.source === needle.source) {
+ return {
+ line: util.getArg(mapping, 'generatedLine', null),
+ column: util.getArg(mapping, 'generatedColumn', null),
+ lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)
+ };
+ }
+ }
+
+ return {
+ line: null,
+ column: null,
+ lastColumn: null
+ };
+ };
+
+exports.BasicSourceMapConsumer = BasicSourceMapConsumer;
+
+/**
+ * An IndexedSourceMapConsumer instance represents a parsed source map which
+ * we can query for information. It differs from BasicSourceMapConsumer in
+ * that it takes "indexed" source maps (i.e. ones with a "sections" field) as
+ * input.
+ *
+ * The only parameter is a raw source map (either as a JSON string, or already
+ * parsed to an object). According to the spec for indexed source maps, they
+ * have the following attributes:
+ *
+ * - version: Which version of the source map spec this map is following.
+ * - file: Optional. The generated file this source map is associated with.
+ * - sections: A list of section definitions.
+ *
+ * Each value under the "sections" field has two fields:
+ * - offset: The offset into the original specified at which this section
+ * begins to apply, defined as an object with a "line" and "column"
+ * field.
+ * - map: A source map definition. This source map could also be indexed,
+ * but doesn't have to be.
+ *
+ * Instead of the "map" field, it's also possible to have a "url" field
+ * specifying a URL to retrieve a source map from, but that's currently
+ * unsupported.
+ *
+ * Here's an example source map, taken from the source map spec[0], but
+ * modified to omit a section which uses the "url" field.
+ *
+ * {
+ * version : 3,
+ * file: "app.js",
+ * sections: [{
+ * offset: {line:100, column:10},
+ * map: {
+ * version : 3,
+ * file: "section.js",
+ * sources: ["foo.js", "bar.js"],
+ * names: ["src", "maps", "are", "fun"],
+ * mappings: "AAAA,E;;ABCDE;"
+ * }
+ * }],
+ * }
+ *
+ * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit#heading=h.535es3xeprgt
+ */
+function IndexedSourceMapConsumer(aSourceMap) {
+ var sourceMap = aSourceMap;
+ if (typeof aSourceMap === 'string') {
+ sourceMap = JSON.parse(aSourceMap.replace(/^\)\]\}'/, ''));
+ }
+
+ var version = util.getArg(sourceMap, 'version');
+ var sections = util.getArg(sourceMap, 'sections');
+
+ if (version != this._version) {
+ throw new Error('Unsupported version: ' + version);
+ }
+
+ this._sources = new ArraySet();
+ this._names = new ArraySet();
+
+ var lastOffset = {
+ line: -1,
+ column: 0
+ };
+ this._sections = sections.map(function (s) {
+ if (s.url) {
+ // The url field will require support for asynchronicity.
+ // See https://github.com/mozilla/source-map/issues/16
+ throw new Error('Support for url field in sections not implemented.');
+ }
+ var offset = util.getArg(s, 'offset');
+ var offsetLine = util.getArg(offset, 'line');
+ var offsetColumn = util.getArg(offset, 'column');
+
+ if (offsetLine < lastOffset.line ||
+ (offsetLine === lastOffset.line && offsetColumn < lastOffset.column)) {
+ throw new Error('Section offsets must be ordered and non-overlapping.');
+ }
+ lastOffset = offset;
+
+ return {
+ generatedOffset: {
+ // The offset fields are 0-based, but we use 1-based indices when
+ // encoding/decoding from VLQ.
+ generatedLine: offsetLine + 1,
+ generatedColumn: offsetColumn + 1
+ },
+ consumer: new SourceMapConsumer(util.getArg(s, 'map'))
+ }
+ });
+}
+
+IndexedSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);
+IndexedSourceMapConsumer.prototype.constructor = SourceMapConsumer;
+
+/**
+ * The version of the source mapping spec that we are consuming.
+ */
+IndexedSourceMapConsumer.prototype._version = 3;
+
+/**
+ * The list of original sources.
+ */
+Object.defineProperty(IndexedSourceMapConsumer.prototype, 'sources', {
+ get: function () {
+ var sources = [];
+ for (var i = 0; i < this._sections.length; i++) {
+ for (var j = 0; j < this._sections[i].consumer.sources.length; j++) {
+ sources.push(this._sections[i].consumer.sources[j]);
+ }
+ }
+ return sources;
+ }
+});
+
+/**
+ * Returns the original source, line, and column information for the generated
+ * source's line and column positions provided. The only argument is an object
+ * with the following properties:
+ *
+ * - line: The line number in the generated source.
+ * - column: The column number in the generated source.
+ *
+ * and an object is returned with the following properties:
+ *
+ * - source: The original source file, or null.
+ * - line: The line number in the original source, or null.
+ * - column: The column number in the original source, or null.
+ * - name: The original identifier, or null.
+ */
+IndexedSourceMapConsumer.prototype.originalPositionFor =
+ function IndexedSourceMapConsumer_originalPositionFor(aArgs) {
+ var needle = {
+ generatedLine: util.getArg(aArgs, 'line'),
+ generatedColumn: util.getArg(aArgs, 'column')
+ };
+
+ // Find the section containing the generated position we're trying to map
+ // to an original position.
+ var sectionIndex = binarySearch.search(needle, this._sections,
+ function(needle, section) {
+ var cmp = needle.generatedLine - section.generatedOffset.generatedLine;
+ if (cmp) {
+ return cmp;
+ }
+
+ return (needle.generatedColumn -
+ section.generatedOffset.generatedColumn);
+ });
+ var section = this._sections[sectionIndex];
+
+ if (!section) {
+ return {
+ source: null,
+ line: null,
+ column: null,
+ name: null
+ };
+ }
+
+ return section.consumer.originalPositionFor({
+ line: needle.generatedLine -
+ (section.generatedOffset.generatedLine - 1),
+ column: needle.generatedColumn -
+ (section.generatedOffset.generatedLine === needle.generatedLine
+ ? section.generatedOffset.generatedColumn - 1
+ : 0),
+ bias: aArgs.bias
+ });
+ };
+
+/**
+ * Return true if we have the source content for every source in the source
+ * map, false otherwise.
+ */
+IndexedSourceMapConsumer.prototype.hasContentsOfAllSources =
+ function IndexedSourceMapConsumer_hasContentsOfAllSources() {
+ return this._sections.every(function (s) {
+ return s.consumer.hasContentsOfAllSources();
+ });
+ };
+
+/**
+ * Returns the original source content. The only argument is the url of the
+ * original source file. Returns null if no original source content is
+ * available.
+ */
+IndexedSourceMapConsumer.prototype.sourceContentFor =
+ function IndexedSourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {
+ for (var i = 0; i < this._sections.length; i++) {
+ var section = this._sections[i];
+
+ var content = section.consumer.sourceContentFor(aSource, true);
+ if (content) {
+ return content;
+ }
+ }
+ if (nullOnMissing) {
+ return null;
+ }
+ else {
+ throw new Error('"' + aSource + '" is not in the SourceMap.');
+ }
+ };
+
+/**
+ * Returns the generated line and column information for the original source,
+ * line, and column positions provided. The only argument is an object with
+ * the following properties:
+ *
+ * - source: The filename of the original source.
+ * - line: The line number in the original source.
+ * - column: The column number in the original source.
+ *
+ * and an object is returned with the following properties:
+ *
+ * - line: The line number in the generated source, or null.
+ * - column: The column number in the generated source, or null.
+ */
+IndexedSourceMapConsumer.prototype.generatedPositionFor =
+ function IndexedSourceMapConsumer_generatedPositionFor(aArgs) {
+ for (var i = 0; i < this._sections.length; i++) {
+ var section = this._sections[i];
+
+ // Only consider this section if the requested source is in the list of
+ // sources of the consumer.
+ if (section.consumer.sources.indexOf(util.getArg(aArgs, 'source')) === -1) {
+ continue;
+ }
+ var generatedPosition = section.consumer.generatedPositionFor(aArgs);
+ if (generatedPosition) {
+ var ret = {
+ line: generatedPosition.line +
+ (section.generatedOffset.generatedLine - 1),
+ column: generatedPosition.column +
+ (section.generatedOffset.generatedLine === generatedPosition.line
+ ? section.generatedOffset.generatedColumn - 1
+ : 0)
+ };
+ return ret;
+ }
+ }
+
+ return {
+ line: null,
+ column: null
+ };
+ };
+
+/**
+ * Parse the mappings in a string in to a data structure which we can easily
+ * query (the ordered arrays in the `this.__generatedMappings` and
+ * `this.__originalMappings` properties).
+ */
+IndexedSourceMapConsumer.prototype._parseMappings =
+ function IndexedSourceMapConsumer_parseMappings(aStr, aSourceRoot) {
+ this.__generatedMappings = [];
+ this.__originalMappings = [];
+ for (var i = 0; i < this._sections.length; i++) {
+ var section = this._sections[i];
+ var sectionMappings = section.consumer._generatedMappings;
+ for (var j = 0; j < sectionMappings.length; j++) {
+ var mapping = sectionMappings[j];
+
+ var source = section.consumer._sources.at(mapping.source);
+ if (section.consumer.sourceRoot !== null) {
+ source = util.join(section.consumer.sourceRoot, source);
+ }
+ this._sources.add(source);
+ source = this._sources.indexOf(source);
+
+ var name = section.consumer._names.at(mapping.name);
+ this._names.add(name);
+ name = this._names.indexOf(name);
+
+ // The mappings coming from the consumer for the section have
+ // generated positions relative to the start of the section, so we
+ // need to offset them to be relative to the start of the concatenated
+ // generated file.
+ var adjustedMapping = {
+ source: source,
+ generatedLine: mapping.generatedLine +
+ (section.generatedOffset.generatedLine - 1),
+ generatedColumn: mapping.generatedColumn +
+ (section.generatedOffset.generatedLine === mapping.generatedLine
+ ? section.generatedOffset.generatedColumn - 1
+ : 0),
+ originalLine: mapping.originalLine,
+ originalColumn: mapping.originalColumn,
+ name: name
+ };
+
+ this.__generatedMappings.push(adjustedMapping);
+ if (typeof adjustedMapping.originalLine === 'number') {
+ this.__originalMappings.push(adjustedMapping);
+ }
+ }
+ }
+
+ quickSort(this.__generatedMappings, util.compareByGeneratedPositionsDeflated);
+ quickSort(this.__originalMappings, util.compareByOriginalPositions);
+ };
+
+exports.IndexedSourceMapConsumer = IndexedSourceMapConsumer;
+
+
+/***/ }),
+/* 636 */
+/***/ (function(module, exports) {
+
+/* -*- Mode: js; js-indent-level: 2; -*- */
+/*
+ * Copyright 2011 Mozilla Foundation and contributors
+ * Licensed under the New BSD license. See LICENSE or:
+ * http://opensource.org/licenses/BSD-3-Clause
+ */
+
+exports.GREATEST_LOWER_BOUND = 1;
+exports.LEAST_UPPER_BOUND = 2;
+
+/**
+ * Recursive implementation of binary search.
+ *
+ * @param aLow Indices here and lower do not contain the needle.
+ * @param aHigh Indices here and higher do not contain the needle.
+ * @param aNeedle The element being searched for.
+ * @param aHaystack The non-empty array being searched.
+ * @param aCompare Function which takes two elements and returns -1, 0, or 1.
+ * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or
+ * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the
+ * closest element that is smaller than or greater than the one we are
+ * searching for, respectively, if the exact element cannot be found.
+ */
+function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) {
+ // This function terminates when one of the following is true:
+ //
+ // 1. We find the exact element we are looking for.
+ //
+ // 2. We did not find the exact element, but we can return the index of
+ // the next-closest element.
+ //
+ // 3. We did not find the exact element, and there is no next-closest
+ // element than the one we are searching for, so we return -1.
+ var mid = Math.floor((aHigh - aLow) / 2) + aLow;
+ var cmp = aCompare(aNeedle, aHaystack[mid], true);
+ if (cmp === 0) {
+ // Found the element we are looking for.
+ return mid;
+ }
+ else if (cmp > 0) {
+ // Our needle is greater than aHaystack[mid].
+ if (aHigh - mid > 1) {
+ // The element is in the upper half.
+ return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias);
+ }
+
+ // The exact needle element was not found in this haystack. Determine if
+ // we are in termination case (3) or (2) and return the appropriate thing.
+ if (aBias == exports.LEAST_UPPER_BOUND) {
+ return aHigh < aHaystack.length ? aHigh : -1;
+ } else {
+ return mid;
+ }
+ }
+ else {
+ // Our needle is less than aHaystack[mid].
+ if (mid - aLow > 1) {
+ // The element is in the lower half.
+ return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias);
+ }
+
+ // we are in termination case (3) or (2) and return the appropriate thing.
+ if (aBias == exports.LEAST_UPPER_BOUND) {
+ return mid;
+ } else {
+ return aLow < 0 ? -1 : aLow;
+ }
+ }
+}
+
+/**
+ * This is an implementation of binary search which will always try and return
+ * the index of the closest element if there is no exact hit. This is because
+ * mappings between original and generated line/col pairs are single points,
+ * and there is an implicit region between each of them, so a miss just means
+ * that you aren't on the very start of a region.
+ *
+ * @param aNeedle The element you are looking for.
+ * @param aHaystack The array that is being searched.
+ * @param aCompare A function which takes the needle and an element in the
+ * array and returns -1, 0, or 1 depending on whether the needle is less
+ * than, equal to, or greater than the element, respectively.
+ * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or
+ * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the
+ * closest element that is smaller than or greater than the one we are
+ * searching for, respectively, if the exact element cannot be found.
+ * Defaults to 'binarySearch.GREATEST_LOWER_BOUND'.
+ */
+exports.search = function search(aNeedle, aHaystack, aCompare, aBias) {
+ if (aHaystack.length === 0) {
+ return -1;
+ }
+
+ var index = recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack,
+ aCompare, aBias || exports.GREATEST_LOWER_BOUND);
+ if (index < 0) {
+ return -1;
+ }
+
+ // We have found either the exact element, or the next-closest element than
+ // the one we are searching for. However, there may be more than one such
+ // element. Make sure we always return the smallest of these.
+ while (index - 1 >= 0) {
+ if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) {
+ break;
+ }
+ --index;
+ }
+
+ return index;
+};
+
+
+/***/ }),
+/* 637 */
+/***/ (function(module, exports) {
+
+/* -*- Mode: js; js-indent-level: 2; -*- */
+/*
+ * Copyright 2011 Mozilla Foundation and contributors
+ * Licensed under the New BSD license. See LICENSE or:
+ * http://opensource.org/licenses/BSD-3-Clause
+ */
+
+// It turns out that some (most?) JavaScript engines don't self-host
+// `Array.prototype.sort`. This makes sense because C++ will likely remain
+// faster than JS when doing raw CPU-intensive sorting. However, when using a
+// custom comparator function, calling back and forth between the VM's C++ and
+// JIT'd JS is rather slow *and* loses JIT type information, resulting in
+// worse generated code for the comparator function than would be optimal. In
+// fact, when sorting with a comparator, these costs outweigh the benefits of
+// sorting in C++. By using our own JS-implemented Quick Sort (below), we get
+// a ~3500ms mean speed-up in `bench/bench.html`.
+
+/**
+ * Swap the elements indexed by `x` and `y` in the array `ary`.
+ *
+ * @param {Array} ary
+ * The array.
+ * @param {Number} x
+ * The index of the first item.
+ * @param {Number} y
+ * The index of the second item.
+ */
+function swap(ary, x, y) {
+ var temp = ary[x];
+ ary[x] = ary[y];
+ ary[y] = temp;
+}
+
+/**
+ * Returns a random integer within the range `low .. high` inclusive.
+ *
+ * @param {Number} low
+ * The lower bound on the range.
+ * @param {Number} high
+ * The upper bound on the range.
+ */
+function randomIntInRange(low, high) {
+ return Math.round(low + (Math.random() * (high - low)));
+}
+
+/**
+ * The Quick Sort algorithm.
+ *
+ * @param {Array} ary
+ * An array to sort.
+ * @param {function} comparator
+ * Function to use to compare two items.
+ * @param {Number} p
+ * Start index of the array
+ * @param {Number} r
+ * End index of the array
+ */
+function doQuickSort(ary, comparator, p, r) {
+ // If our lower bound is less than our upper bound, we (1) partition the
+ // array into two pieces and (2) recurse on each half. If it is not, this is
+ // the empty array and our base case.
+
+ if (p < r) {
+ // (1) Partitioning.
+ //
+ // The partitioning chooses a pivot between `p` and `r` and moves all
+ // elements that are less than or equal to the pivot to the before it, and
+ // all the elements that are greater than it after it. The effect is that
+ // once partition is done, the pivot is in the exact place it will be when
+ // the array is put in sorted order, and it will not need to be moved
+ // again. This runs in O(n) time.
+
+ // Always choose a random pivot so that an input array which is reverse
+ // sorted does not cause O(n^2) running time.
+ var pivotIndex = randomIntInRange(p, r);
+ var i = p - 1;
+
+ swap(ary, pivotIndex, r);
+ var pivot = ary[r];
+
+ // Immediately after `j` is incremented in this loop, the following hold
+ // true:
+ //
+ // * Every element in `ary[p .. i]` is less than or equal to the pivot.
+ //
+ // * Every element in `ary[i+1 .. j-1]` is greater than the pivot.
+ for (var j = p; j < r; j++) {
+ if (comparator(ary[j], pivot) <= 0) {
+ i += 1;
+ swap(ary, i, j);
+ }
+ }
+
+ swap(ary, i + 1, j);
+ var q = i + 1;
+
+ // (2) Recurse on each half.
+
+ doQuickSort(ary, comparator, p, q - 1);
+ doQuickSort(ary, comparator, q + 1, r);
+ }
+}
+
+/**
+ * Sort the given array in-place with the given comparator function.
+ *
+ * @param {Array} ary
+ * An array to sort.
+ * @param {function} comparator
+ * Function to use to compare two items.
+ */
+exports.quickSort = function (ary, comparator) {
+ doQuickSort(ary, comparator, 0, ary.length - 1);
+};
+
+
+/***/ }),
+/* 638 */
+/***/ (function(module, exports, __webpack_require__) {
+
+/* -*- Mode: js; js-indent-level: 2; -*- */
+/*
+ * Copyright 2011 Mozilla Foundation and contributors
+ * Licensed under the New BSD license. See LICENSE or:
+ * http://opensource.org/licenses/BSD-3-Clause
+ */
+
+var SourceMapGenerator = __webpack_require__(581).SourceMapGenerator;
+var util = __webpack_require__(566);
+
+// Matches a Windows-style `\r\n` newline or a `\n` newline used by all other
+// operating systems these days (capturing the result).
+var REGEX_NEWLINE = /(\r?\n)/;
+
+// Newline character code for charCodeAt() comparisons
+var NEWLINE_CODE = 10;
+
+// Private symbol for identifying `SourceNode`s when multiple versions of
+// the source-map library are loaded. This MUST NOT CHANGE across
+// versions!
+var isSourceNode = "$$$isSourceNode$$$";
+
+/**
+ * SourceNodes provide a way to abstract over interpolating/concatenating
+ * snippets of generated JavaScript source code while maintaining the line and
+ * column information associated with the original source code.
+ *
+ * @param aLine The original line number.
+ * @param aColumn The original column number.
+ * @param aSource The original source's filename.
+ * @param aChunks Optional. An array of strings which are snippets of
+ * generated JS, or other SourceNodes.
+ * @param aName The original identifier.
+ */
+function SourceNode(aLine, aColumn, aSource, aChunks, aName) {
+ this.children = [];
+ this.sourceContents = {};
+ this.line = aLine == null ? null : aLine;
+ this.column = aColumn == null ? null : aColumn;
+ this.source = aSource == null ? null : aSource;
+ this.name = aName == null ? null : aName;
+ this[isSourceNode] = true;
+ if (aChunks != null) this.add(aChunks);
+}
+
+/**
+ * Creates a SourceNode from generated code and a SourceMapConsumer.
+ *
+ * @param aGeneratedCode The generated code
+ * @param aSourceMapConsumer The SourceMap for the generated code
+ * @param aRelativePath Optional. The path that relative sources in the
+ * SourceMapConsumer should be relative to.
+ */
+SourceNode.fromStringWithSourceMap =
+ function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer, aRelativePath) {
+ // The SourceNode we want to fill with the generated code
+ // and the SourceMap
+ var node = new SourceNode();
+
+ // All even indices of this array are one line of the generated code,
+ // while all odd indices are the newlines between two adjacent lines
+ // (since `REGEX_NEWLINE` captures its match).
+ // Processed fragments are accessed by calling `shiftNextLine`.
+ var remainingLines = aGeneratedCode.split(REGEX_NEWLINE);
+ var remainingLinesIndex = 0;
+ var shiftNextLine = function() {
+ var lineContents = getNextLine();
+ // The last line of a file might not have a newline.
+ var newLine = getNextLine() || "";
+ return lineContents + newLine;
+
+ function getNextLine() {
+ return remainingLinesIndex < remainingLines.length ?
+ remainingLines[remainingLinesIndex++] : undefined;
+ }
+ };
+
+ // We need to remember the position of "remainingLines"
+ var lastGeneratedLine = 1, lastGeneratedColumn = 0;
+
+ // The generate SourceNodes we need a code range.
+ // To extract it current and last mapping is used.
+ // Here we store the last mapping.
+ var lastMapping = null;
+
+ aSourceMapConsumer.eachMapping(function (mapping) {
+ if (lastMapping !== null) {
+ // We add the code from "lastMapping" to "mapping":
+ // First check if there is a new line in between.
+ if (lastGeneratedLine < mapping.generatedLine) {
+ // Associate first line with "lastMapping"
+ addMappingWithCode(lastMapping, shiftNextLine());
+ lastGeneratedLine++;
+ lastGeneratedColumn = 0;
+ // The remaining code is added without mapping
+ } else {
+ // There is no new line in between.
+ // Associate the code between "lastGeneratedColumn" and
+ // "mapping.generatedColumn" with "lastMapping"
+ var nextLine = remainingLines[remainingLinesIndex];
+ var code = nextLine.substr(0, mapping.generatedColumn -
+ lastGeneratedColumn);
+ remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn -
+ lastGeneratedColumn);
+ lastGeneratedColumn = mapping.generatedColumn;
+ addMappingWithCode(lastMapping, code);
+ // No more remaining code, continue
+ lastMapping = mapping;
+ return;
+ }
+ }
+ // We add the generated code until the first mapping
+ // to the SourceNode without any mapping.
+ // Each line is added as separate string.
+ while (lastGeneratedLine < mapping.generatedLine) {
+ node.add(shiftNextLine());
+ lastGeneratedLine++;
+ }
+ if (lastGeneratedColumn < mapping.generatedColumn) {
+ var nextLine = remainingLines[remainingLinesIndex];
+ node.add(nextLine.substr(0, mapping.generatedColumn));
+ remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn);
+ lastGeneratedColumn = mapping.generatedColumn;
+ }
+ lastMapping = mapping;
+ }, this);
+ // We have processed all mappings.
+ if (remainingLinesIndex < remainingLines.length) {
+ if (lastMapping) {
+ // Associate the remaining code in the current line with "lastMapping"
+ addMappingWithCode(lastMapping, shiftNextLine());
+ }
+ // and add the remaining lines without any mapping
+ node.add(remainingLines.splice(remainingLinesIndex).join(""));
+ }
+
+ // Copy sourcesContent into SourceNode
+ aSourceMapConsumer.sources.forEach(function (sourceFile) {
+ var content = aSourceMapConsumer.sourceContentFor(sourceFile);
+ if (content != null) {
+ if (aRelativePath != null) {
+ sourceFile = util.join(aRelativePath, sourceFile);
+ }
+ node.setSourceContent(sourceFile, content);
+ }
+ });
+
+ return node;
+
+ function addMappingWithCode(mapping, code) {
+ if (mapping === null || mapping.source === undefined) {
+ node.add(code);
+ } else {
+ var source = aRelativePath
+ ? util.join(aRelativePath, mapping.source)
+ : mapping.source;
+ node.add(new SourceNode(mapping.originalLine,
+ mapping.originalColumn,
+ source,
+ code,
+ mapping.name));
+ }
+ }
+ };
+
+/**
+ * Add a chunk of generated JS to this source node.
+ *
+ * @param aChunk A string snippet of generated JS code, another instance of
+ * SourceNode, or an array where each member is one of those things.
+ */
+SourceNode.prototype.add = function SourceNode_add(aChunk) {
+ if (Array.isArray(aChunk)) {
+ aChunk.forEach(function (chunk) {
+ this.add(chunk);
+ }, this);
+ }
+ else if (aChunk[isSourceNode] || typeof aChunk === "string") {
+ if (aChunk) {
+ this.children.push(aChunk);
+ }
+ }
+ else {
+ throw new TypeError(
+ "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk
+ );
+ }
+ return this;
+};
+
+/**
+ * Add a chunk of generated JS to the beginning of this source node.
+ *
+ * @param aChunk A string snippet of generated JS code, another instance of
+ * SourceNode, or an array where each member is one of those things.
+ */
+SourceNode.prototype.prepend = function SourceNode_prepend(aChunk) {
+ if (Array.isArray(aChunk)) {
+ for (var i = aChunk.length-1; i >= 0; i--) {
+ this.prepend(aChunk[i]);
+ }
+ }
+ else if (aChunk[isSourceNode] || typeof aChunk === "string") {
+ this.children.unshift(aChunk);
+ }
+ else {
+ throw new TypeError(
+ "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk
+ );
+ }
+ return this;
+};
+
+/**
+ * Walk over the tree of JS snippets in this node and its children. The
+ * walking function is called once for each snippet of JS and is passed that
+ * snippet and the its original associated source's line/column location.
+ *
+ * @param aFn The traversal function.
+ */
+SourceNode.prototype.walk = function SourceNode_walk(aFn) {
+ var chunk;
+ for (var i = 0, len = this.children.length; i < len; i++) {
+ chunk = this.children[i];
+ if (chunk[isSourceNode]) {
+ chunk.walk(aFn);
+ }
+ else {
+ if (chunk !== '') {
+ aFn(chunk, { source: this.source,
+ line: this.line,
+ column: this.column,
+ name: this.name });
+ }
+ }
+ }
+};
+
+/**
+ * Like `String.prototype.join` except for SourceNodes. Inserts `aStr` between
+ * each of `this.children`.
+ *
+ * @param aSep The separator.
+ */
+SourceNode.prototype.join = function SourceNode_join(aSep) {
+ var newChildren;
+ var i;
+ var len = this.children.length;
+ if (len > 0) {
+ newChildren = [];
+ for (i = 0; i < len-1; i++) {
+ newChildren.push(this.children[i]);
+ newChildren.push(aSep);
+ }
+ newChildren.push(this.children[i]);
+ this.children = newChildren;
+ }
+ return this;
+};
+
+/**
+ * Call String.prototype.replace on the very right-most source snippet. Useful
+ * for trimming whitespace from the end of a source node, etc.
+ *
+ * @param aPattern The pattern to replace.
+ * @param aReplacement The thing to replace the pattern with.
+ */
+SourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) {
+ var lastChild = this.children[this.children.length - 1];
+ if (lastChild[isSourceNode]) {
+ lastChild.replaceRight(aPattern, aReplacement);
+ }
+ else if (typeof lastChild === 'string') {
+ this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement);
+ }
+ else {
+ this.children.push(''.replace(aPattern, aReplacement));
+ }
+ return this;
+};
+
+/**
+ * Set the source content for a source file. This will be added to the SourceMapGenerator
+ * in the sourcesContent field.
+ *
+ * @param aSourceFile The filename of the source file
+ * @param aSourceContent The content of the source file
+ */
+SourceNode.prototype.setSourceContent =
+ function SourceNode_setSourceContent(aSourceFile, aSourceContent) {
+ this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent;
+ };
+
+/**
+ * Walk over the tree of SourceNodes. The walking function is called for each
+ * source file content and is passed the filename and source content.
+ *
+ * @param aFn The traversal function.
+ */
+SourceNode.prototype.walkSourceContents =
+ function SourceNode_walkSourceContents(aFn) {
+ for (var i = 0, len = this.children.length; i < len; i++) {
+ if (this.children[i][isSourceNode]) {
+ this.children[i].walkSourceContents(aFn);
+ }
+ }
+
+ var sources = Object.keys(this.sourceContents);
+ for (var i = 0, len = sources.length; i < len; i++) {
+ aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]]);
+ }
+ };
+
+/**
+ * Return the string representation of this source node. Walks over the tree
+ * and concatenates all the various snippets together to one string.
+ */
+SourceNode.prototype.toString = function SourceNode_toString() {
+ var str = "";
+ this.walk(function (chunk) {
+ str += chunk;
+ });
+ return str;
+};
+
+/**
+ * Returns the string representation of this source node along with a source
+ * map.
+ */
+SourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) {
+ var generated = {
+ code: "",
+ line: 1,
+ column: 0
+ };
+ var map = new SourceMapGenerator(aArgs);
+ var sourceMappingActive = false;
+ var lastOriginalSource = null;
+ var lastOriginalLine = null;
+ var lastOriginalColumn = null;
+ var lastOriginalName = null;
+ this.walk(function (chunk, original) {
+ generated.code += chunk;
+ if (original.source !== null
+ && original.line !== null
+ && original.column !== null) {
+ if(lastOriginalSource !== original.source
+ || lastOriginalLine !== original.line
+ || lastOriginalColumn !== original.column
+ || lastOriginalName !== original.name) {
+ map.addMapping({
+ source: original.source,
+ original: {
+ line: original.line,
+ column: original.column
+ },
+ generated: {
+ line: generated.line,
+ column: generated.column
+ },
+ name: original.name
+ });
+ }
+ lastOriginalSource = original.source;
+ lastOriginalLine = original.line;
+ lastOriginalColumn = original.column;
+ lastOriginalName = original.name;
+ sourceMappingActive = true;
+ } else if (sourceMappingActive) {
+ map.addMapping({
+ generated: {
+ line: generated.line,
+ column: generated.column
+ }
+ });
+ lastOriginalSource = null;
+ sourceMappingActive = false;
+ }
+ for (var idx = 0, length = chunk.length; idx < length; idx++) {
+ if (chunk.charCodeAt(idx) === NEWLINE_CODE) {
+ generated.line++;
+ generated.column = 0;
+ // Mappings end at eol
+ if (idx + 1 === length) {
+ lastOriginalSource = null;
+ sourceMappingActive = false;
+ } else if (sourceMappingActive) {
+ map.addMapping({
+ source: original.source,
+ original: {
+ line: original.line,
+ column: original.column
+ },
+ generated: {
+ line: generated.line,
+ column: generated.column
+ },
+ name: original.name
+ });
+ }
+ } else {
+ generated.column++;
+ }
+ }
+ });
+ this.walkSourceContents(function (sourceFile, sourceContent) {
+ map.setSourceContent(sourceFile, sourceContent);
+ });
+
+ return { code: generated.code, map: map };
+};
+
+exports.SourceNode = SourceNode;
+
+
+/***/ }),
+/* 639 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var Symbol = __webpack_require__(570),
+ arrayMap = __webpack_require__(640),
+ isArray = __webpack_require__(563),
+ isSymbol = __webpack_require__(577);
+
+/** Used as references for various `Number` constants. */
+var INFINITY = 1 / 0;
+
+/** Used to convert symbols to primitives and strings. */
+var symbolProto = Symbol ? Symbol.prototype : undefined,
+ symbolToString = symbolProto ? symbolProto.toString : undefined;
+
+/**
+ * The base implementation of `_.toString` which doesn't convert nullish
+ * values to empty strings.
+ *
+ * @private
+ * @param {*} value The value to process.
+ * @returns {string} Returns the string.
+ */
+function baseToString(value) {
+ // Exit early for strings to avoid a performance hit in some environments.
+ if (typeof value == 'string') {
+ return value;
+ }
+ if (isArray(value)) {
+ // Recursively convert values (susceptible to call stack limits).
+ return arrayMap(value, baseToString) + '';
+ }
+ if (isSymbol(value)) {
+ return symbolToString ? symbolToString.call(value) : '';
+ }
+ var result = (value + '');
+ return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
+}
+
+module.exports = baseToString;
+
+
+/***/ }),
+/* 640 */
+/***/ (function(module, exports) {
+
+/**
+ * A specialized version of `_.map` for arrays without support for iteratee
+ * shorthands.
+ *
+ * @private
+ * @param {Array} [array] The array to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @returns {Array} Returns the new mapped array.
+ */
+function arrayMap(array, iteratee) {
+ var index = -1,
+ length = array == null ? 0 : array.length,
+ result = Array(length);
+
+ while (++index < length) {
+ result[index] = iteratee(array[index], index, array);
+ }
+ return result;
+}
+
+module.exports = arrayMap;
+
+
+/***/ }),
+/* 641 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var isArray = __webpack_require__(563),
+ isSymbol = __webpack_require__(577);
+
+/** Used to match property names within property paths. */
+var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
+ reIsPlainProp = /^\w*$/;
+
+/**
+ * Checks if `value` is a property name and not a property path.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @param {Object} [object] The object to query keys on.
+ * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
+ */
+function isKey(value, object) {
+ if (isArray(value)) {
+ return false;
+ }
+ var type = typeof value;
+ if (type == 'number' || type == 'symbol' || type == 'boolean' ||
+ value == null || isSymbol(value)) {
+ return true;
+ }
+ return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
+ (object != null && value in Object(object));
+}
+
+module.exports = isKey;
+
+
+/***/ }),
+/* 642 */,
+/* 643 */,
+/* 644 */,
+/* 645 */,
+/* 646 */,
+/* 647 */,
+/* 648 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.clearSymbols = clearSymbols;
+exports.getSymbols = getSymbols;
+
+var t = _interopRequireWildcard(__webpack_require__(2));
+
+var _simplePath = _interopRequireDefault(__webpack_require__(684));
+
+var _ast = __webpack_require__(572);
+
+var _helpers = __webpack_require__(602);
+
+var _inferClassName = __webpack_require__(867);
+
+var _getFunctionName = _interopRequireDefault(__webpack_require__(691));
+
+var _frameworks = __webpack_require__(868);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
+
+function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
+
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+let symbolDeclarations = new Map();
+
+function getUniqueIdentifiers(identifiers) {
+ const newIdentifiers = [];
+ const locationKeys = new Set();
+
+ for (const newId of identifiers) {
+ const key = (0, _helpers.nodeLocationKey)(newId);
+
+ if (!locationKeys.has(key)) {
+ locationKeys.add(key);
+ newIdentifiers.push(newId);
+ }
+ }
+
+ return newIdentifiers;
+} // eslint-disable-next-line complexity
+
+
+function extractSymbol(path, symbols, state) {
+ if ((0, _helpers.isFunction)(path)) {
+ const name = (0, _getFunctionName.default)(path.node, path.parent);
+
+ if (!state.fnCounts[name]) {
+ state.fnCounts[name] = 0;
+ }
+
+ const index = state.fnCounts[name]++;
+ symbols.functions.push({
+ name,
+ klass: (0, _inferClassName.inferClassName)(path),
+ location: path.node.loc,
+ parameterNames: (0, _helpers.getFunctionParameterNames)(path),
+ identifier: path.node.id,
+ // indicates the occurence of the function in a file
+ // e.g { name: foo, ... index: 4 } is the 4th foo function
+ // in the file
+ index
+ });
+ }
+
+ if (t.isJSXElement(path)) {
+ symbols.hasJsx = true;
+ }
+
+ if (t.isGenericTypeAnnotation(path)) {
+ symbols.hasTypes = true;
+ }
+
+ if (t.isClassDeclaration(path)) {
+ const {
+ loc,
+ superClass
+ } = path.node;
+ symbols.classes.push({
+ name: path.node.id.name,
+ parent: superClass ? {
+ name: t.isMemberExpression(superClass) ? (0, _helpers.getCode)(superClass) : superClass.name,
+ location: superClass.loc
+ } : null,
+ location: loc
+ });
+ }
+
+ if (t.isImportDeclaration(path)) {
+ symbols.imports.push({
+ source: path.node.source.value,
+ location: path.node.loc,
+ specifiers: (0, _helpers.getSpecifiers)(path.node.specifiers)
+ });
+ }
+
+ if (t.isObjectProperty(path)) {
+ const {
+ start,
+ end,
+ identifierName
+ } = path.node.key.loc;
+ symbols.objectProperties.push({
+ name: identifierName,
+ location: {
+ start,
+ end
+ },
+ expression: getSnippet(path)
+ });
+ }
+
+ if (t.isMemberExpression(path) || t.isOptionalMemberExpression(path)) {
+ const {
+ start,
+ end
+ } = path.node.property.loc;
+ symbols.memberExpressions.push({
+ name: path.node.property.name,
+ location: {
+ start,
+ end
+ },
+ expression: getSnippet(path),
+ computed: path.node.computed
+ });
+ }
+
+ if ((t.isStringLiteral(path) || t.isNumericLiteral(path)) && t.isMemberExpression(path.parentPath)) {
+ // We only need literals that are part of computed memeber expressions
+ const {
+ start,
+ end
+ } = path.node.loc;
+ symbols.literals.push({
+ name: path.node.value,
+ location: {
+ start,
+ end
+ },
+ expression: getSnippet(path.parentPath)
+ });
+ }
+
+ if (t.isCallExpression(path)) {
+ const {
+ callee
+ } = path.node;
+ const args = path.node.arguments;
+
+ if (t.isMemberExpression(callee)) {
+ const {
+ property: {
+ name,
+ loc
+ }
+ } = callee;
+ symbols.callExpressions.push({
+ name,
+ values: args.filter(arg => arg.value).map(arg => arg.value),
+ location: loc
+ });
+ } else {
+ const {
+ start,
+ end,
+ identifierName
+ } = callee.loc;
+ symbols.callExpressions.push({
+ name: identifierName,
+ values: args.filter(arg => arg.value).map(arg => arg.value),
+ location: {
+ start,
+ end
+ }
+ });
+ }
+ }
+
+ if (t.isStringLiteral(path) && t.isProperty(path.parentPath)) {
+ const {
+ start,
+ end
+ } = path.node.loc;
+ return symbols.identifiers.push({
+ name: path.node.value,
+ expression: (0, _helpers.getObjectExpressionValue)(path.parent),
+ location: {
+ start,
+ end
+ }
+ });
+ }
+
+ if (t.isIdentifier(path) && !t.isGenericTypeAnnotation(path.parent)) {
+ let {
+ start,
+ end
+ } = path.node.loc; // We want to include function params, but exclude the function name
+
+ if (t.isClassMethod(path.parent) && !path.inList) {
+ return;
+ }
+
+ if (t.isProperty(path.parentPath) && !(0, _helpers.isObjectShorthand)(path.parent)) {
+ return symbols.identifiers.push({
+ name: path.node.name,
+ expression: (0, _helpers.getObjectExpressionValue)(path.parent),
+ location: {
+ start,
+ end
+ }
+ });
+ }
+
+ if (path.node.typeAnnotation) {
+ const {
+ column
+ } = path.node.typeAnnotation.loc.start;
+ end = { ...end,
+ column
+ };
+ }
+
+ symbols.identifiers.push({
+ name: path.node.name,
+ expression: path.node.name,
+ location: {
+ start,
+ end
+ }
+ });
+ }
+
+ if (t.isThisExpression(path.node)) {
+ const {
+ start,
+ end
+ } = path.node.loc;
+ symbols.identifiers.push({
+ name: "this",
+ location: {
+ start,
+ end
+ },
+ expression: "this"
+ });
+ }
+
+ if (t.isVariableDeclarator(path)) {
+ const nodeId = path.node.id;
+ symbols.identifiers.push(...(0, _helpers.getPatternIdentifiers)(nodeId));
+ }
+}
+
+function extractSymbols(sourceId) {
+ const symbols = {
+ functions: [],
+ callExpressions: [],
+ memberExpressions: [],
+ objectProperties: [],
+ comments: [],
+ identifiers: [],
+ classes: [],
+ imports: [],
+ literals: [],
+ hasJsx: false,
+ hasTypes: false,
+ loading: false,
+ framework: undefined
+ };
+ const state = {
+ fnCounts: Object.create(null)
+ };
+ const ast = (0, _ast.traverseAst)(sourceId, {
+ enter(node, ancestors) {
+ try {
+ const path = (0, _simplePath.default)(ancestors);
+
+ if (path) {
+ extractSymbol(path, symbols, state);
+ }
+ } catch (e) {
+ console.error(e);
+ }
+ }
+
+ }); // comments are extracted separately from the AST
+
+ symbols.comments = (0, _helpers.getComments)(ast);
+ symbols.identifiers = getUniqueIdentifiers(symbols.identifiers);
+ symbols.framework = (0, _frameworks.getFramework)(symbols);
+ return symbols;
+}
+
+function extendSnippet(name, expression, path, prevPath) {
+ var _path$node$property, _path$node$property$e;
+
+ const computed = path === null || path === void 0 ? void 0 : path.node.computed;
+ const optional = path === null || path === void 0 ? void 0 : path.node.optional;
+ const prevComputed = prevPath === null || prevPath === void 0 ? void 0 : prevPath.node.computed;
+ const prevArray = t.isArrayExpression(prevPath);
+ const array = t.isArrayExpression(path);
+ const value = (path === null || path === void 0 ? void 0 : (_path$node$property = path.node.property) === null || _path$node$property === void 0 ? void 0 : (_path$node$property$e = _path$node$property.extra) === null || _path$node$property$e === void 0 ? void 0 : _path$node$property$e.raw) || "";
+
+ if (expression === "") {
+ if (computed) {
+ return name === undefined ? `[${value}]` : `[${name}]`;
+ }
+
+ return name;
+ }
+
+ if (computed || array) {
+ if (prevComputed || prevArray) {
+ return `[${name}]${expression}`;
+ }
+
+ return `[${name === undefined ? value : name}].${expression}`;
+ }
+
+ if (prevComputed || prevArray) {
+ return `${name}${expression}`;
+ }
+
+ if ((0, _helpers.isComputedExpression)(expression) && name !== undefined) {
+ return `${name}${expression}`;
+ }
+
+ if (optional) {
+ return `${name}?.${expression}`;
+ }
+
+ return `${name}.${expression}`;
+}
+
+function getMemberSnippet(node, expression = "", optional = false) {
+ if (t.isMemberExpression(node) || t.isOptionalMemberExpression(node)) {
+ const name = node.property.name;
+ const snippet = getMemberSnippet(node.object, extendSnippet(name, expression, {
+ node
+ }), node.optional);
+ return snippet;
+ }
+
+ if (t.isCallExpression(node)) {
+ return "";
+ }
+
+ if (t.isThisExpression(node)) {
+ return `this.${expression}`;
+ }
+
+ if (t.isIdentifier(node)) {
+ if ((0, _helpers.isComputedExpression)(expression)) {
+ return `${node.name}${expression}`;
+ }
+
+ if (optional) {
+ return `${node.name}?.${expression}`;
+ }
+
+ return `${node.name}.${expression}`;
+ }
+
+ return expression;
+}
+
+function getObjectSnippet(path, prevPath, expression = "") {
+ if (!path) {
+ return expression;
+ }
+
+ const {
+ name
+ } = path.node.key;
+ const extendedExpression = extendSnippet(name, expression, path, prevPath);
+ const nextPrevPath = path;
+ const nextPath = path.parentPath && path.parentPath.parentPath;
+ return getSnippet(nextPath, nextPrevPath, extendedExpression);
+}
+
+function getArraySnippet(path, prevPath, expression) {
+ if (!prevPath.parentPath) {
+ throw new Error("Assertion failure - path should exist");
+ }
+
+ const index = `${prevPath.parentPath.containerIndex}`;
+ const extendedExpression = extendSnippet(index, expression, path, prevPath);
+ const nextPrevPath = path;
+ const nextPath = path.parentPath && path.parentPath.parentPath;
+ return getSnippet(nextPath, nextPrevPath, extendedExpression);
+}
+
+function getSnippet(path, prevPath, expression = "") {
+ if (!path) {
+ return expression;
+ }
+
+ if (t.isVariableDeclaration(path)) {
+ const node = path.node.declarations[0];
+ const {
+ name
+ } = node.id;
+ return extendSnippet(name, expression, path, prevPath);
+ }
+
+ if (t.isVariableDeclarator(path)) {
+ const node = path.node.id;
+
+ if (t.isObjectPattern(node)) {
+ return expression;
+ }
+
+ const prop = extendSnippet(node.name, expression, path, prevPath);
+ return prop;
+ }
+
+ if (t.isAssignmentExpression(path)) {
+ const node = path.node.left;
+ const name = t.isMemberExpression(node) ? getMemberSnippet(node) : node.name;
+ const prop = extendSnippet(name, expression, path, prevPath);
+ return prop;
+ }
+
+ if ((0, _helpers.isFunction)(path)) {
+ return expression;
+ }
+
+ if (t.isIdentifier(path)) {
+ return `${path.node.name}.${expression}`;
+ }
+
+ if (t.isObjectProperty(path)) {
+ return getObjectSnippet(path, prevPath, expression);
+ }
+
+ if (t.isObjectExpression(path)) {
+ const parentPath = prevPath === null || prevPath === void 0 ? void 0 : prevPath.parentPath;
+ return getObjectSnippet(parentPath, prevPath, expression);
+ }
+
+ if (t.isMemberExpression(path) || t.isOptionalMemberExpression(path)) {
+ return getMemberSnippet(path.node, expression);
+ }
+
+ if (t.isArrayExpression(path)) {
+ if (!prevPath) {
+ throw new Error("Assertion failure - path should exist");
+ }
+
+ return getArraySnippet(path, prevPath, expression);
+ }
+
+ return "";
+}
+
+function clearSymbols() {
+ symbolDeclarations = new Map();
+}
+
+function getSymbols(sourceId) {
+ if (symbolDeclarations.has(sourceId)) {
+ const symbols = symbolDeclarations.get(sourceId);
+
+ if (symbols) {
+ return symbols;
+ }
+ }
+
+ const symbols = extractSymbols(sourceId);
+ symbolDeclarations.set(sourceId, symbols);
+ return symbols;
+}
+
+/***/ }),
+/* 649 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = buildMatchMemberExpression;
+
+var _matchesPattern = _interopRequireDefault(__webpack_require__(650));
+
+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);
+}
+
+/***/ }),
+/* 650 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = matchesPattern;
+
+var _generated = __webpack_require__(559);
+
+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;
+}
+
+/***/ }),
+/* 651 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var baseGetTag = __webpack_require__(569),
+ isObject = __webpack_require__(573);
+
+/** `Object#toString` result references. */
+var asyncTag = '[object AsyncFunction]',
+ funcTag = '[object Function]',
+ genTag = '[object GeneratorFunction]',
+ proxyTag = '[object Proxy]';
+
+/**
+ * Checks if `value` is classified as a `Function` object.
+ *
+ * @static
+ * @memberOf _
+ * @since 0.1.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a function, else `false`.
+ * @example
+ *
+ * _.isFunction(_);
+ * // => true
+ *
+ * _.isFunction(/abc/);
+ * // => false
+ */
+function isFunction(value) {
+ if (!isObject(value)) {
+ return false;
+ }
+ // The use of `Object#toString` avoids issues with the `typeof` operator
+ // in Safari 9 which returns 'object' for typed arrays and other constructors.
+ var tag = baseGetTag(value);
+ return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
+}
+
+module.exports = isFunction;
+
+
+/***/ }),
+/* 652 */
+/***/ (function(module, exports) {
+
+/** Used for built-in method references. */
+var funcProto = Function.prototype;
+
+/** Used to resolve the decompiled source of functions. */
+var funcToString = funcProto.toString;
+
+/**
+ * Converts `func` to its source code.
+ *
+ * @private
+ * @param {Function} func The function to convert.
+ * @returns {string} Returns the source code.
+ */
+function toSource(func) {
+ if (func != null) {
+ try {
+ return funcToString.call(func);
+ } catch (e) {}
+ try {
+ return (func + '');
+ } catch (e) {}
+ }
+ return '';
+}
+
+module.exports = toSource;
+
+
+/***/ }),
+/* 653 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var baseAssignValue = __webpack_require__(654),
+ eq = __webpack_require__(588);
+
+/** Used for built-in method references. */
+var objectProto = Object.prototype;
+
+/** Used to check objects for own properties. */
+var hasOwnProperty = objectProto.hasOwnProperty;
+
+/**
+ * Assigns `value` to `key` of `object` if the existing value is not equivalent
+ * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
+ * for equality comparisons.
+ *
+ * @private
+ * @param {Object} object The object to modify.
+ * @param {string} key The key of the property to assign.
+ * @param {*} value The value to assign.
+ */
+function assignValue(object, key, value) {
+ var objValue = object[key];
+ if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
+ (value === undefined && !(key in object))) {
+ baseAssignValue(object, key, value);
+ }
+}
+
+module.exports = assignValue;
+
+
+/***/ }),
+/* 654 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var defineProperty = __webpack_require__(749);
+
+/**
+ * The base implementation of `assignValue` and `assignMergeValue` without
+ * value checks.
+ *
+ * @private
+ * @param {Object} object The object to modify.
+ * @param {string} key The key of the property to assign.
+ * @param {*} value The value to assign.
+ */
+function baseAssignValue(object, key, value) {
+ if (key == '__proto__' && defineProperty) {
+ defineProperty(object, key, {
+ 'configurable': true,
+ 'enumerable': true,
+ 'value': value,
+ 'writable': true
+ });
+ } else {
+ object[key] = value;
+ }
+}
+
+module.exports = baseAssignValue;
+
+
+/***/ }),
+/* 655 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var baseTimes = __webpack_require__(751),
+ isArguments = __webpack_require__(618),
+ isArray = __webpack_require__(563),
+ isBuffer = __webpack_require__(595),
+ isIndex = __webpack_require__(620),
+ isTypedArray = __webpack_require__(621);
+
+/** Used for built-in method references. */
+var objectProto = Object.prototype;
+
+/** Used to check objects for own properties. */
+var hasOwnProperty = objectProto.hasOwnProperty;
+
+/**
+ * Creates an array of the enumerable property names of the array-like `value`.
+ *
+ * @private
+ * @param {*} value The value to query.
+ * @param {boolean} inherited Specify returning inherited property names.
+ * @returns {Array} Returns the array of property names.
+ */
+function arrayLikeKeys(value, inherited) {
+ var isArr = isArray(value),
+ isArg = !isArr && isArguments(value),
+ isBuff = !isArr && !isArg && isBuffer(value),
+ isType = !isArr && !isArg && !isBuff && isTypedArray(value),
+ skipIndexes = isArr || isArg || isBuff || isType,
+ result = skipIndexes ? baseTimes(value.length, String) : [],
+ length = result.length;
+
+ for (var key in value) {
+ if ((inherited || hasOwnProperty.call(value, key)) &&
+ !(skipIndexes && (
+ // Safari 9 has enumerable `arguments.length` in strict mode.
+ key == 'length' ||
+ // Node.js 0.10 has enumerable non-index properties on buffers.
+ (isBuff && (key == 'offset' || key == 'parent')) ||
+ // PhantomJS 2 has enumerable non-index properties on typed arrays.
+ (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
+ // Skip index properties.
+ isIndex(key, length)
+ ))) {
+ result.push(key);
+ }
+ }
+ return result;
+}
+
+module.exports = arrayLikeKeys;
+
+
+/***/ }),
+/* 656 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var isPrototype = __webpack_require__(598),
+ nativeKeys = __webpack_require__(755);
+
+/** Used for built-in method references. */
+var objectProto = Object.prototype;
+
+/** Used to check objects for own properties. */
+var hasOwnProperty = objectProto.hasOwnProperty;
+
+/**
+ * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
+ *
+ * @private
+ * @param {Object} object The object to query.
+ * @returns {Array} Returns the array of property names.
+ */
+function baseKeys(object) {
+ if (!isPrototype(object)) {
+ return nativeKeys(object);
+ }
+ var result = [];
+ for (var key in Object(object)) {
+ if (hasOwnProperty.call(object, key) && key != 'constructor') {
+ result.push(key);
+ }
+ }
+ return result;
+}
+
+module.exports = baseKeys;
+
+
+/***/ }),
+/* 657 */
+/***/ (function(module, exports) {
+
+/**
+ * Creates a unary function that invokes `func` with its argument transformed.
+ *
+ * @private
+ * @param {Function} func The function to wrap.
+ * @param {Function} transform The argument transform.
+ * @returns {Function} Returns the new function.
+ */
+function overArg(func, transform) {
+ return function(arg) {
+ return func(transform(arg));
+ };
+}
+
+module.exports = overArg;
+
+
+/***/ }),
+/* 658 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var arrayLikeKeys = __webpack_require__(655),
+ baseKeysIn = __webpack_require__(757),
+ isArrayLike = __webpack_require__(599);
+
+/**
+ * Creates an array of the own and inherited enumerable property names of `object`.
+ *
+ * **Note:** Non-object values are coerced to objects.
+ *
+ * @static
+ * @memberOf _
+ * @since 3.0.0
+ * @category Object
+ * @param {Object} object The object to query.
+ * @returns {Array} Returns the array of property names.
+ * @example
+ *
+ * function Foo() {
+ * this.a = 1;
+ * this.b = 2;
+ * }
+ *
+ * Foo.prototype.c = 3;
+ *
+ * _.keysIn(new Foo);
+ * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
+ */
+function keysIn(object) {
+ return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
+}
+
+module.exports = keysIn;
+
+
+/***/ }),
+/* 659 */
+/***/ (function(module, exports) {
+
+/**
+ * This method returns a new empty array.
+ *
+ * @static
+ * @memberOf _
+ * @since 4.13.0
+ * @category Util
+ * @returns {Array} Returns the new empty array.
+ * @example
+ *
+ * var arrays = _.times(2, _.stubArray);
+ *
+ * console.log(arrays);
+ * // => [[], []]
+ *
+ * console.log(arrays[0] === arrays[1]);
+ * // => false
+ */
+function stubArray() {
+ return [];
+}
+
+module.exports = stubArray;
+
+
+/***/ }),
+/* 660 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var arrayPush = __webpack_require__(661),
+ getPrototype = __webpack_require__(624),
+ getSymbols = __webpack_require__(623),
+ stubArray = __webpack_require__(659);
+
+/* Built-in method references for those with the same name as other `lodash` methods. */
+var nativeGetSymbols = Object.getOwnPropertySymbols;
+
+/**
+ * Creates an array of the own and inherited enumerable symbols of `object`.
+ *
+ * @private
+ * @param {Object} object The object to query.
+ * @returns {Array} Returns the array of symbols.
+ */
+var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {
+ var result = [];
+ while (object) {
+ arrayPush(result, getSymbols(object));
+ object = getPrototype(object);
+ }
+ return result;
+};
+
+module.exports = getSymbolsIn;
+
+
+/***/ }),
+/* 661 */
+/***/ (function(module, exports) {
+
+/**
+ * Appends the elements of `values` to `array`.
+ *
+ * @private
+ * @param {Array} array The array to modify.
+ * @param {Array} values The values to append.
+ * @returns {Array} Returns `array`.
+ */
+function arrayPush(array, values) {
+ var index = -1,
+ length = values.length,
+ offset = array.length;
+
+ while (++index < length) {
+ array[offset + index] = values[index];
+ }
+ return array;
+}
+
+module.exports = arrayPush;
+
+
+/***/ }),
+/* 662 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var baseGetAllKeys = __webpack_require__(663),
+ getSymbols = __webpack_require__(623),
+ keys = __webpack_require__(594);
+
+/**
+ * Creates an array of own enumerable property names and symbols of `object`.
+ *
+ * @private
+ * @param {Object} object The object to query.
+ * @returns {Array} Returns the array of property names and symbols.
+ */
+function getAllKeys(object) {
+ return baseGetAllKeys(object, keys, getSymbols);
+}
+
+module.exports = getAllKeys;
+
+
+/***/ }),
+/* 663 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var arrayPush = __webpack_require__(661),
+ isArray = __webpack_require__(563);
+
+/**
+ * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
+ * `keysFunc` and `symbolsFunc` to get the enumerable property names and
+ * symbols of `object`.
+ *
+ * @private
+ * @param {Object} object The object to query.
+ * @param {Function} keysFunc The function to get the keys of `object`.
+ * @param {Function} symbolsFunc The function to get the symbols of `object`.
+ * @returns {Array} Returns the array of property names and symbols.
+ */
+function baseGetAllKeys(object, keysFunc, symbolsFunc) {
+ var result = keysFunc(object);
+ return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
+}
+
+module.exports = baseGetAllKeys;
+
+
+/***/ }),
+/* 664 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var getNative = __webpack_require__(574),
+ root = __webpack_require__(562);
+
+/* Built-in method references that are verified to be native. */
+var Set = getNative(root, 'Set');
+
+module.exports = Set;
+
+
+/***/ }),
+/* 665 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var root = __webpack_require__(562);
+
+/** Built-in value references. */
+var Uint8Array = root.Uint8Array;
+
+module.exports = Uint8Array;
+
+
+/***/ }),
+/* 666 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = isPlaceholderType;
+
+var _definitions = __webpack_require__(564);
+
+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;
+}
+
+/***/ }),
+/* 667 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+Object.defineProperty(exports, "isIdentifierName", {
+ enumerable: true,
+ get: function () {
+ return _identifier.isIdentifierName;
+ }
+});
+Object.defineProperty(exports, "isIdentifierChar", {
+ enumerable: true,
+ get: function () {
+ return _identifier.isIdentifierChar;
+ }
+});
+Object.defineProperty(exports, "isIdentifierStart", {
+ enumerable: true,
+ get: function () {
+ return _identifier.isIdentifierStart;
+ }
+});
+Object.defineProperty(exports, "isReservedWord", {
+ enumerable: true,
+ get: function () {
+ return _keyword.isReservedWord;
+ }
+});
+Object.defineProperty(exports, "isStrictBindOnlyReservedWord", {
+ enumerable: true,
+ get: function () {
+ return _keyword.isStrictBindOnlyReservedWord;
+ }
+});
+Object.defineProperty(exports, "isStrictBindReservedWord", {
+ enumerable: true,
+ get: function () {
+ return _keyword.isStrictBindReservedWord;
+ }
+});
+Object.defineProperty(exports, "isStrictReservedWord", {
+ enumerable: true,
+ get: function () {
+ return _keyword.isStrictReservedWord;
+ }
+});
+Object.defineProperty(exports, "isKeyword", {
+ enumerable: true,
+ get: function () {
+ return _keyword.isKeyword;
+ }
+});
+
+var _identifier = __webpack_require__(781);
+
+var _keyword = __webpack_require__(782);
+
+/***/ }),
+/* 668 */
+/***/ (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__(571);
+
+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 == null ? void 0 : 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);
+ });
+});
+
+/***/ }),
+/* 669 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = isNode;
+
+var _definitions = __webpack_require__(564);
+
+function isNode(node) {
+ return !!(node && _definitions.VISITOR_KEYS[node.type]);
+}
+
+/***/ }),
+/* 670 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = removeTypeDuplicates;
+
+var _generated = __webpack_require__(559);
+
+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;
+}
+
+/***/ }),
+/* 671 */
+/***/ (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;
+}
+
+/***/ }),
+/* 672 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = inheritInnerComments;
+
+var _inherit = _interopRequireDefault(__webpack_require__(629));
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+function inheritInnerComments(child, parent) {
+ (0, _inherit.default)("innerComments", child, parent);
+}
+
+/***/ }),
+/* 673 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var MapCache = __webpack_require__(617),
+ setCacheAdd = __webpack_require__(801),
+ setCacheHas = __webpack_require__(802);
+
+/**
+ *
+ * Creates an array cache object to store unique values.
+ *
+ * @private
+ * @constructor
+ * @param {Array} [values] The values to cache.
+ */
+function SetCache(values) {
+ var index = -1,
+ length = values == null ? 0 : values.length;
+
+ this.__data__ = new MapCache;
+ while (++index < length) {
+ this.add(values[index]);
+ }
+}
+
+// Add methods to `SetCache`.
+SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
+SetCache.prototype.has = setCacheHas;
+
+module.exports = SetCache;
+
+
+/***/ }),
+/* 674 */
+/***/ (function(module, exports) {
+
+/**
+ * Checks if a `cache` value for `key` exists.
+ *
+ * @private
+ * @param {Object} cache The cache to query.
+ * @param {string} key The key of the entry to check.
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
+ */
+function cacheHas(cache, key) {
+ return cache.has(key);
+}
+
+module.exports = cacheHas;
+
+
+/***/ }),
+/* 675 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = inheritLeadingComments;
+
+var _inherit = _interopRequireDefault(__webpack_require__(629));
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+function inheritLeadingComments(child, parent) {
+ (0, _inherit.default)("leadingComments", child, parent);
+}
+
+/***/ }),
+/* 676 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = inheritsComments;
+
+var _inheritTrailingComments = _interopRequireDefault(__webpack_require__(677));
+
+var _inheritLeadingComments = _interopRequireDefault(__webpack_require__(675));
+
+var _inheritInnerComments = _interopRequireDefault(__webpack_require__(672));
+
+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;
+}
+
+/***/ }),
+/* 677 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = inheritTrailingComments;
+
+var _inherit = _interopRequireDefault(__webpack_require__(629));
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+function inheritTrailingComments(child, parent) {
+ (0, _inherit.default)("trailingComments", child, parent);
+}
+
+/***/ }),
+/* 678 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = toBlock;
+
+var _generated = __webpack_require__(559);
+
+var _generated2 = __webpack_require__(561);
+
+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);
+}
+
+/***/ }),
+/* 679 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = toIdentifier;
+
+var _isValidIdentifier = _interopRequireDefault(__webpack_require__(580));
+
+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 || "_";
+}
+
+/***/ }),
+/* 680 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = removePropertiesDeep;
+
+var _traverseFast = _interopRequireDefault(__webpack_require__(681));
+
+var _removeProperties = _interopRequireDefault(__webpack_require__(682));
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+function removePropertiesDeep(tree, opts) {
+ (0, _traverseFast.default)(tree, _removeProperties.default, opts);
+ return tree;
+}
+
+/***/ }),
+/* 681 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = traverseFast;
+
+var _definitions = __webpack_require__(564);
+
+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);
+ }
+ }
+}
+
+/***/ }),
+/* 682 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = removeProperties;
+
+var _constants = __webpack_require__(575);
+
+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;
+ }
+}
+
+/***/ }),
+/* 683 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = isLet;
+
+var _generated = __webpack_require__(559);
+
+var _constants = __webpack_require__(575);
+
+function isLet(node) {
+ return (0, _generated.isVariableDeclaration)(node) && (node.kind !== "var" || node[_constants.BLOCK_SCOPED_SYMBOL]);
+}
+
+/***/ }),
+/* 684 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = createSimplePath;
+
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+function createSimplePath(ancestors) {
+ if (ancestors.length === 0) {
+ return null;
+ } // Slice the array because babel-types traverse may continue mutating
+ // the ancestors array in later traversal logic.
+
+
+ return new SimplePath(ancestors.slice());
+}
+
+/**
+ * Mimics @babel/traverse's NodePath API in a simpler fashion that isn't as
+ * heavy, but still allows the ease of passing paths around to process nested
+ * AST structures.
+ */
+class SimplePath {
+ constructor(ancestors, index = ancestors.length - 1) {
+ if (index < 0 || index >= ancestors.length) {
+ console.error(ancestors);
+ throw new Error("Created invalid path");
+ }
+
+ this._ancestors = ancestors;
+ this._ancestor = ancestors[index];
+ this._index = index;
+ }
+
+ get parentPath() {
+ let path = this._parentPath;
+
+ if (path === undefined) {
+ if (this._index === 0) {
+ path = null;
+ } else {
+ path = new SimplePath(this._ancestors, this._index - 1);
+ }
+
+ this._parentPath = path;
+ }
+
+ return path;
+ }
+
+ get parent() {
+ return this._ancestor.node;
+ }
+
+ get node() {
+ const {
+ node,
+ key,
+ index
+ } = this._ancestor;
+
+ if (typeof index === "number") {
+ return node[key][index];
+ }
+
+ return node[key];
+ }
+
+ get key() {
+ return this._ancestor.key;
+ }
+
+ set node(replacement) {
+ if (this.type !== "Identifier") {
+ throw new Error("Replacing anything other than leaf nodes is undefined behavior " + "in t.traverse()");
+ }
+
+ const {
+ node,
+ key,
+ index
+ } = this._ancestor;
+
+ if (typeof index === "number") {
+ node[key][index] = replacement;
+ } else {
+ node[key] = replacement;
+ }
+ }
+
+ get type() {
+ return this.node.type;
+ }
+
+ get inList() {
+ return typeof this._ancestor.index === "number";
+ }
+
+ get containerIndex() {
+ const {
+ index
+ } = this._ancestor;
+
+ if (typeof index !== "number") {
+ throw new Error("Cannot get index of non-array node");
+ }
+
+ return index;
+ }
+
+ get depth() {
+ return this._index;
+ }
+
+ replace(node) {
+ this.node = node;
+ }
+
+ find(predicate) {
+ for (let path = this; path; path = path.parentPath) {
+ if (predicate(path)) {
+ return path;
+ }
+ }
+
+ return null;
+ }
+
+ findParent(predicate) {
+ if (!this.parentPath) {
+ throw new Error("Cannot use findParent on root path");
+ }
+
+ return this.parentPath.find(predicate);
+ }
+
+ getSibling(offset) {
+ const {
+ node,
+ key,
+ index
+ } = this._ancestor;
+
+ if (typeof index !== "number") {
+ throw new Error("Non-array nodes do not have siblings");
+ }
+
+ const container = node[key];
+ const siblingIndex = index + offset;
+
+ if (siblingIndex < 0 || siblingIndex >= container.length) {
+ return null;
+ }
+
+ return new SimplePath(this._ancestors.slice(0, -1).concat([{
+ node,
+ key,
+ index: siblingIndex
+ }]));
+ }
+
+}
+
+/***/ }),
+/* 685 */
+/***/ (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
+ }),
+ bracketHashL: new TokenType("#[", {
+ beforeExpr,
+ startsExpr
+ }),
+ bracketBarL: new TokenType("[|", {
+ beforeExpr,
+ startsExpr
+ }),
+ bracketR: new TokenType("]"),
+ bracketBarR: new TokenType("|]"),
+ braceL: new TokenType("{", {
+ beforeExpr,
+ startsExpr
+ }),
+ braceBarL: new TokenType("{|", {
+ beforeExpr,
+ startsExpr
+ }),
+ braceHashL: 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: new TokenType("%", {
+ beforeExpr,
+ binop: 10,
+ startsExpr
+ }),
+ 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 = 0b00000000,
+ SCOPE_PROGRAM = 0b00000001,
+ SCOPE_FUNCTION = 0b00000010,
+ SCOPE_ARROW = 0b00000100,
+ SCOPE_SIMPLE_CATCH = 0b00001000,
+ SCOPE_SUPER = 0b00010000,
+ SCOPE_DIRECT_SUPER = 0b00100000,
+ SCOPE_CLASS = 0b01000000,
+ SCOPE_TS_MODULE = 0b10000000,
+ SCOPE_VAR = SCOPE_PROGRAM | SCOPE_FUNCTION | SCOPE_TS_MODULE;
+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_AMBIENT = 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 = 0 | 0 | 0 | BIND_FLAGS_TS_EXPORT_ONLY;
+const CLASS_ELEMENT_FLAG_STATIC = 0b100,
+ CLASS_ELEMENT_KIND_GETTER = 0b010,
+ CLASS_ELEMENT_KIND_SETTER = 0b001,
+ CLASS_ELEMENT_KIND_ACCESSOR = CLASS_ELEMENT_KIND_GETTER | CLASS_ELEMENT_KIND_SETTER;
+const CLASS_ELEMENT_STATIC_GETTER = CLASS_ELEMENT_KIND_GETTER | CLASS_ELEMENT_FLAG_STATIC,
+ CLASS_ELEMENT_STATIC_SETTER = CLASS_ELEMENT_KIND_SETTER | CLASS_ELEMENT_FLAG_STATIC,
+ CLASS_ELEMENT_INSTANCE_GETTER = CLASS_ELEMENT_KIND_GETTER,
+ CLASS_ELEMENT_INSTANCE_SETTER = CLASS_ELEMENT_KIND_SETTER,
+ CLASS_ELEMENT_OTHER = 0;
+
+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 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;
+ this.ambiguousScriptDifferentAst = 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);
+ }
+
+ adjustCommentsAfterTrailingComma(node, elements, takeAllComments) {
+ if (this.state.leadingComments.length === 0) {
+ return;
+ }
+
+ let lastElement = null;
+ let i = elements.length;
+
+ while (lastElement === null && i > 0) {
+ lastElement = elements[--i];
+ }
+
+ if (lastElement === null) {
+ return;
+ }
+
+ for (let 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--;
+ }
+ }
+
+ const newTrailingComments = [];
+
+ for (let i = 0; i < this.state.leadingComments.length; i++) {
+ const leadingComment = this.state.leadingComments[i];
+
+ if (leadingComment.end < node.end) {
+ newTrailingComments.push(leadingComment);
+
+ if (!takeAllComments) {
+ this.state.leadingComments.splice(i, 1);
+ i--;
+ }
+ } else {
+ if (node.trailingComments === undefined) {
+ node.trailingComments = [];
+ }
+
+ node.trailingComments.push(leadingComment);
+ }
+ }
+
+ if (takeAllComments) this.state.leadingComments = [];
+
+ if (newTrailingComments.length > 0) {
+ lastElement.trailingComments = newTrailingComments;
+ } else if (lastElement.trailingComments !== undefined) {
+ lastElement.trailingComments = [];
+ }
+ }
+
+ 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) {
+ switch (node.type) {
+ case "ObjectExpression":
+ this.adjustCommentsAfterTrailingComma(node, node.properties);
+ break;
+
+ case "ObjectPattern":
+ this.adjustCommentsAfterTrailingComma(node, node.properties, true);
+ break;
+
+ case "CallExpression":
+ this.adjustCommentsAfterTrailingComma(node, node.arguments);
+ break;
+
+ case "ArrayExpression":
+ this.adjustCommentsAfterTrailingComma(node, node.elements);
+ break;
+
+ case "ArrayPattern":
+ this.adjustCommentsAfterTrailingComma(node, node.elements, true);
+ break;
+ }
+ } else if (this.state.commentPreviousNode && (this.state.commentPreviousNode.type === "ImportSpecifier" && node.type !== "ImportSpecifier" || this.state.commentPreviousNode.type === "ExportSpecifier" && node.type !== "ExportSpecifier")) {
+ this.adjustCommentsAfterTrailingComma(node, [this.state.commentPreviousNode]);
+ }
+
+ 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 {
+ const firstTrailingCommentIndex = trailingComments.findIndex(comment => comment.end >= node.end);
+
+ if (firstTrailingCommentIndex > 0) {
+ node.innerComments = trailingComments.slice(0, firstTrailingCommentIndex);
+ node.trailingComments = trailingComments.slice(firstTrailingCommentIndex);
+ } else {
+ node.trailingComments = trailingComments;
+ }
+ }
+ }
+
+ stack.push(node);
+ }
+
+}
+
+const ErrorMessages = Object.freeze({
+ ArgumentsDisallowedInInitializer: "'arguments' is not allowed in class field initializer",
+ AsyncFunctionInSingleStatementContext: "Async functions can only be declared at the top level or inside a block",
+ AwaitBindingIdentifier: "Can not use 'await' as identifier inside an async function",
+ AwaitExpressionFormalParameter: "await is not allowed in async function parameters",
+ AwaitNotInAsyncFunction: "Can not use keyword 'await' outside an async function",
+ BadGetterArity: "getter must not have any formal parameters",
+ BadSetterArity: "setter must have exactly one formal parameter",
+ BadSetterRestParameter: "setter function argument must not be a rest parameter",
+ ConstructorClassField: "Classes may not have a field named 'constructor'",
+ ConstructorClassPrivateField: "Classes may not have a private field named '#constructor'",
+ ConstructorIsAccessor: "Class constructor may not be an accessor",
+ ConstructorIsAsync: "Constructor can't be an async function",
+ ConstructorIsGenerator: "Constructor can't be a generator",
+ DeclarationMissingInitializer: "%0 require an initialization value",
+ DecoratorBeforeExport: "Decorators must be placed *before* the 'export' keyword. You can set the 'decoratorsBeforeExport' option to false to use the 'export @decorator class {}' syntax",
+ DecoratorConstructor: "Decorators can't be used with a constructor. Did you mean '@dec class { ... }'?",
+ DecoratorExportClass: "Using the export keyword between a decorator and a class is not allowed. Please use `export @dec class` instead.",
+ DecoratorSemicolon: "Decorators must not be followed by a semicolon",
+ DeletePrivateField: "Deleting a private field is not allowed",
+ DestructureNamedImport: "ES2015 named imports do not destructure. Use another statement for destructuring after the import.",
+ DuplicateConstructor: "Duplicate constructor in the same class",
+ DuplicateDefaultExport: "Only one default export allowed per module.",
+ DuplicateExport: "`%0` has already been exported. Exported identifiers must be unique.",
+ DuplicateProto: "Redefinition of __proto__ property",
+ DuplicateRegExpFlags: "Duplicate regular expression flag",
+ ElementAfterRest: "Rest element must be last element",
+ EscapedCharNotAnIdentifier: "Invalid Unicode escape",
+ ExportDefaultFromAsIdentifier: "'from' is not allowed as an identifier after 'export default'",
+ ForInOfLoopInitializer: "%0 loop variable declaration may not have an initializer",
+ GeneratorInSingleStatementContext: "Generators can only be declared at the top level or inside a block",
+ IllegalBreakContinue: "Unsyntactic %0",
+ IllegalLanguageModeDirective: "Illegal 'use strict' directive in function with non-simple parameter list",
+ IllegalReturn: "'return' outside of function",
+ ImportCallArgumentTrailingComma: "Trailing comma is disallowed inside import(...) arguments",
+ ImportCallArity: "import() requires exactly %0",
+ ImportCallNotNewExpression: "Cannot use new with import(...)",
+ ImportCallSpreadArgument: "... is not allowed in import()",
+ ImportMetaOutsideModule: `import.meta may appear only with 'sourceType: "module"'`,
+ ImportOutsideModule: `'import' and 'export' may appear only with 'sourceType: "module"'`,
+ InvalidBigIntLiteral: "Invalid BigIntLiteral",
+ InvalidCodePoint: "Code point out of bounds",
+ InvalidDigit: "Expected number in radix %0",
+ InvalidEscapeSequence: "Bad character escape sequence",
+ InvalidEscapeSequenceTemplate: "Invalid escape sequence in template",
+ InvalidEscapedReservedWord: "Escape sequence in keyword %0",
+ InvalidIdentifier: "Invalid identifier %0",
+ InvalidLhs: "Invalid left-hand side in %0",
+ InvalidLhsBinding: "Binding invalid left-hand side in %0",
+ InvalidNumber: "Invalid number",
+ InvalidOrUnexpectedToken: "Unexpected character '%0'",
+ InvalidParenthesizedAssignment: "Invalid parenthesized assignment pattern",
+ InvalidPrivateFieldResolution: "Private name #%0 is not defined",
+ InvalidPropertyBindingPattern: "Binding member expression",
+ InvalidRecordProperty: "Only properties and spread elements are allowed in record definitions",
+ InvalidRestAssignmentPattern: "Invalid rest operator's argument",
+ LabelRedeclaration: "Label '%0' is already declared",
+ LetInLexicalBinding: "'let' is not allowed to be used as a name in 'let' or 'const' declarations.",
+ MalformedRegExpFlags: "Invalid regular expression flag",
+ MissingClassName: "A class name is required",
+ MissingEqInAssignment: "Only '=' operator can be used for specifying default value.",
+ MissingUnicodeEscape: "Expecting Unicode escape sequence \\uXXXX",
+ MixingCoalesceWithLogical: "Nullish coalescing operator(??) requires parens when mixing with logical operators",
+ ModuleAttributeDifferentFromType: "The only accepted module attribute is `type`",
+ ModuleAttributeInvalidValue: "Only string literals are allowed as module attribute values",
+ ModuleAttributesWithDuplicateKeys: 'Duplicate key "%0" is not allowed in module attributes',
+ ModuleExportUndefined: "Export '%0' is not defined",
+ MultipleDefaultsInSwitch: "Multiple default clauses",
+ NewlineAfterThrow: "Illegal newline after throw",
+ NoCatchOrFinally: "Missing catch or finally clause",
+ NumberIdentifier: "Identifier directly after number",
+ NumericSeparatorInEscapeSequence: "Numeric separators are not allowed inside unicode escape sequences or hex escape sequences",
+ ObsoleteAwaitStar: "await* has been removed from the async functions proposal. Use Promise.all() instead.",
+ OptionalChainingNoNew: "constructors in/after an Optional Chain are not allowed",
+ OptionalChainingNoTemplate: "Tagged Template Literals are not allowed in optionalChain",
+ ParamDupe: "Argument name clash",
+ PatternHasAccessor: "Object pattern can't contain getter or setter",
+ PatternHasMethod: "Object pattern can't contain methods",
+ PipelineBodyNoArrow: 'Unexpected arrow "=>" after pipeline body; arrow function in pipeline body must be parenthesized',
+ PipelineBodySequenceExpression: "Pipeline body may not be a comma-separated sequence expression",
+ PipelineHeadSequenceExpression: "Pipeline head should not be a comma-separated sequence expression",
+ PipelineTopicUnused: "Pipeline is in topic style but does not use topic reference",
+ PrimaryTopicNotAllowed: "Topic reference was used in a lexical context without topic binding",
+ PrimaryTopicRequiresSmartPipeline: "Primary Topic Reference found but pipelineOperator not passed 'smart' for 'proposal' option.",
+ PrivateInExpectedIn: "Private names are only allowed in property accesses (`obj.#%0`) or in `in` expressions (`#%0 in obj`)",
+ PrivateNameRedeclaration: "Duplicate private name #%0",
+ RecordExpressionBarIncorrectEndSyntaxType: "Record expressions ending with '|}' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'",
+ RecordExpressionBarIncorrectStartSyntaxType: "Record expressions starting with '{|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'",
+ RecordExpressionHashIncorrectStartSyntaxType: "Record expressions starting with '#{' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'",
+ RecordNoProto: "'__proto__' is not allowed in Record expressions",
+ RestTrailingComma: "Unexpected trailing comma after rest element",
+ SloppyFunction: "In non-strict mode code, functions can only be declared at top level, inside a block, or as the body of an if statement",
+ StaticPrototype: "Classes may not have static property named prototype",
+ StrictDelete: "Deleting local variable in strict mode",
+ StrictEvalArguments: "Assigning to '%0' in strict mode",
+ StrictEvalArgumentsBinding: "Binding '%0' in strict mode",
+ StrictFunction: "In strict mode code, functions can only be declared at top level or inside a block",
+ StrictOctalLiteral: "Legacy octal literals are not allowed in strict mode",
+ StrictWith: "'with' in strict mode",
+ SuperNotAllowed: "super() is only valid inside a class constructor of a subclass. Maybe a typo in the method name ('constructor') or not extending another class?",
+ SuperPrivateField: "Private fields can't be accessed on super",
+ TrailingDecorator: "Decorators must be attached to a class element",
+ TupleExpressionBarIncorrectEndSyntaxType: "Tuple expressions ending with '|]' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'",
+ TupleExpressionBarIncorrectStartSyntaxType: "Tuple expressions starting with '[|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'",
+ TupleExpressionHashIncorrectStartSyntaxType: "Tuple expressions starting with '#[' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'",
+ UnexpectedArgumentPlaceholder: "Unexpected argument placeholder",
+ UnexpectedAwaitAfterPipelineBody: 'Unexpected "await" after pipeline body; await must have parentheses in minimal proposal',
+ UnexpectedDigitAfterHash: "Unexpected digit after hash token",
+ UnexpectedImportExport: "'import' and 'export' may only appear at the top level",
+ UnexpectedKeyword: "Unexpected keyword '%0'",
+ UnexpectedLeadingDecorator: "Leading decorators must be attached to a class declaration",
+ UnexpectedLexicalDeclaration: "Lexical declaration cannot appear in a single-statement context",
+ UnexpectedNewTarget: "new.target can only be used in functions",
+ UnexpectedNumericSeparator: "A numeric separator is only allowed between two digits",
+ UnexpectedPrivateField: "Private names can only be used as the name of a class element (i.e. class C { #p = 42; #m() {} } )\n or a property of member expression (i.e. this.#p).",
+ UnexpectedReservedWord: "Unexpected reserved word '%0'",
+ UnexpectedSuper: "super is only allowed in object methods and classes",
+ UnexpectedToken: "Unexpected token '%0'",
+ UnexpectedTokenUnaryExponentiation: "Illegal expression. Wrap left hand side or entire exponentiation in parentheses.",
+ UnsupportedBind: "Binding should be performed on object property.",
+ UnsupportedDecoratorExport: "A decorated export must export a class declaration",
+ UnsupportedDefaultExport: "Only expressions, functions or classes are allowed as the `default` export.",
+ UnsupportedImport: "import can only be used in import() or import.meta",
+ UnsupportedMetaProperty: "The only valid meta property for %0 is %0.%1",
+ UnsupportedParameterDecorator: "Decorators cannot be used to decorate parameters",
+ UnsupportedPropertyDecorator: "Decorators cannot be used to decorate object literal properties",
+ UnsupportedSuper: "super can only be used with function calls (i.e. super()) or in property accesses (i.e. super.prop or super[prop])",
+ UnterminatedComment: "Unterminated comment",
+ UnterminatedRegExp: "Unterminated regular expression",
+ UnterminatedString: "Unterminated string constant",
+ UnterminatedTemplate: "Unterminated template",
+ VarRedeclaration: "Identifier '%0' has already been declared",
+ YieldBindingIdentifier: "Can not use 'yield' as identifier inside a generator",
+ YieldInParameter: "yield is not allowed in generator parameters",
+ ZeroDigitNumericSeparator: "Numeric separator can not be used after leading 0"
+});
+
+class ParserError 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, errorTemplate, ...params) {
+ return this.raiseWithData(pos, undefined, errorTemplate, ...params);
+ }
+
+ raiseWithData(pos, data, errorTemplate, ...params) {
+ const loc = this.getLocationForPosition(pos);
+ const message = errorTemplate.replace(/%(\d+)/g, (_, i) => params[i]) + ` (${loc.line}:${loc.column})`;
+ return this._raise(Object.assign({
+ loc,
+ pos
+ }, data), message);
+ }
+
+ _raise(errorContext, message) {
+ const err = new SyntaxError(message);
+ Object.assign(err, errorContext);
+
+ if (this.options.errorRecovery) {
+ if (!this.isLookahead) this.state.errors.push(err);
+ return err;
+ } else {
+ throw err;
+ }
+ }
+
+}
+
+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;
+ }
+
+ estreeParseBigIntLiteral(value) {
+ const bigInt = typeof BigInt !== "undefined" ? BigInt(value) : null;
+ const node = this.estreeParseLiteral(bigInt);
+ node.bigint = String(node.value || value);
+ 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 (method.kind === "get") {
+ this.raise(start, ErrorMessages.BadGetterArity);
+ } else {
+ this.raise(start, ErrorMessages.BadSetterArity);
+ }
+ } else if (prop.kind === "set" && prop.value.params[0].type === "RestElement") {
+ this.raise(start, ErrorMessages.BadSetterRestParameter);
+ }
+ }
+
+ checkLVal(expr, bindingType = BIND_NONE, checkClashes, contextDescription, disallowLetBinding) {
+ switch (expr.type) {
+ case "ObjectPattern":
+ expr.properties.forEach(prop => {
+ this.checkLVal(prop.type === "Property" ? prop.value : prop, bindingType, checkClashes, "object destructuring pattern", disallowLetBinding);
+ });
+ break;
+
+ default:
+ super.checkLVal(expr, bindingType, checkClashes, contextDescription, disallowLetBinding);
+ }
+ }
+
+ checkProto(prop, isRecord, protoRef, refExpressionErrors) {
+ if (prop.method) {
+ return;
+ }
+
+ super.checkProto(prop, isRecord, protoRef, refExpressionErrors);
+ }
+
+ isValidDirective(stmt) {
+ var _stmt$expression$extr;
+
+ return stmt.type === "ExpressionStatement" && stmt.expression.type === "Literal" && typeof stmt.expression.value === "string" && !((_stmt$expression$extr = stmt.expression.extra) == null ? void 0 : _stmt$expression$extr.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(refExpressionErrors) {
+ switch (this.state.type) {
+ case types.num:
+ case types.string:
+ return this.estreeParseLiteral(this.state.value);
+
+ case types.regexp:
+ return this.estreeParseRegExpLiteral(this.state.value);
+
+ case types.bigint:
+ return this.estreeParseBigIntLiteral(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(refExpressionErrors);
+ }
+ }
+
+ 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, refExpressionErrors) {
+ const node = super.parseObjectProperty(prop, startPos, startLoc, isPattern, refExpressionErrors);
+
+ if (node) {
+ node.kind = "init";
+ node.type = "Property";
+ }
+
+ return node;
+ }
+
+ toAssignable(node) {
+ if (isSimpleProperty(node)) {
+ this.toAssignable(node.value);
+ return node;
+ }
+
+ return super.toAssignable(node);
+ }
+
+ toAssignableObjectExpressionProp(prop, isLast) {
+ if (prop.kind === "get" || prop.kind === "set") {
+ throw this.raise(prop.key.start, ErrorMessages.PatternHasAccessor);
+ } else if (prop.method) {
+ throw this.raise(prop.key.start, ErrorMessages.PatternHasMethod);
+ } else {
+ super.toAssignableObjectExpressionProp(prop, isLast);
+ }
+ }
+
+ finishCallExpression(node, optional) {
+ super.finishCallExpression(node, optional);
+
+ if (node.callee.type === "Import") {
+ node.type = "ImportExpression";
+ node.source = node.arguments[0];
+ delete node.arguments;
+ delete node.callee;
+ } else if (node.type === "CallExpression") {
+ node.optional = false;
+ }
+
+ return node;
+ }
+
+ toReferencedListDeep(exprList, isParenthesizedExpr) {
+ if (!exprList) {
+ return;
+ }
+
+ super.toReferencedListDeep(exprList, isParenthesizedExpr);
+ }
+
+ parseExport(node) {
+ super.parseExport(node);
+
+ switch (node.type) {
+ case "ExportAllDeclaration":
+ node.exported = null;
+ break;
+
+ case "ExportNamedDeclaration":
+ if (node.specifiers.length === 1 && node.specifiers[0].type === "ExportNamespaceSpecifier") {
+ node.type = "ExportAllDeclaration";
+ node.exported = node.specifiers[0].exported;
+ delete node.specifiers;
+ }
+
+ break;
+ }
+
+ return node;
+ }
+
+ parseSubscript(...args) {
+ const node = super.parseSubscript(...args);
+
+ if (node.type === "MemberExpression") {
+ node.optional = false;
+ }
+
+ return node;
+ }
+
+});
+
+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 && prevType !== types._function && prevType !== types._class || this.state.value === "yield" && this.prodParam.hasYield) {
+ 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 === types.dot || prevType === types.questionDot) ; else 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;
+};
+
+types.star.updateContext = function () {
+ this.state.exprAllowed = false;
+};
+
+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-\u08c7\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\u0d04-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d54-\u0d56\u0d5f-\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e86-\u0e8a\u0e8c-\u0ea3\u0ea5\u0ea7-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f5\u13f8-\u13fd\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f8\u1700-\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-\u31bf\u31f0-\u31ff\u3400-\u4dbf\u4e00-\u9ffc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua69d\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua7bf\ua7c2-\ua7ca\ua7f5-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua8fd\ua8fe\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\ua9e0-\ua9e4\ua9e6-\ua9ef\ua9fa-\ua9fe\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa7e-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uab30-\uab5a\uab5c-\uab69\uab70-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc";
+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\u0b55-\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\u0d81-\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0de6-\u0def\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0ebc\u0ec8-\u0ecd\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1369-\u1371\u1712-\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\u1abf\u1ac0\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\ua82c\ua880\ua881\ua8b4-\ua8c5\ua8d0-\ua8d9\ua8e0-\ua8f1\ua8ff-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\ua9e5\ua9f0-\ua9f9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b-\uaa7d\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f";
+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, 349, 41, 7, 1, 79, 28, 11, 0, 9, 21, 107, 20, 28, 22, 13, 52, 76, 44, 33, 24, 27, 35, 30, 0, 3, 0, 9, 34, 4, 0, 13, 47, 15, 3, 22, 0, 2, 0, 36, 17, 2, 24, 85, 6, 2, 0, 2, 3, 2, 14, 2, 9, 8, 46, 39, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 4, 0, 19, 0, 13, 4, 159, 52, 19, 3, 21, 2, 31, 47, 21, 1, 2, 0, 185, 46, 42, 3, 37, 47, 21, 0, 60, 42, 14, 0, 72, 26, 230, 43, 117, 63, 32, 7, 3, 0, 3, 7, 2, 1, 2, 23, 16, 0, 2, 0, 95, 7, 3, 38, 17, 0, 2, 0, 29, 0, 11, 39, 8, 0, 22, 0, 12, 45, 20, 0, 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, 190, 0, 80, 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, 1237, 43, 8, 8952, 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, 42717, 35, 4148, 12, 221, 3, 5761, 15, 7472, 3104, 541, 1507, 4938];
+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, 370, 1, 154, 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, 2, 11, 83, 11, 7, 0, 161, 11, 6, 9, 7, 3, 56, 1, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 193, 17, 10, 9, 5, 0, 82, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 84, 14, 5, 9, 243, 14, 166, 9, 71, 5, 2, 1, 3, 3, 2, 0, 2, 1, 13, 9, 120, 6, 3, 6, 4, 0, 29, 9, 41, 6, 2, 3, 9, 0, 10, 10, 47, 15, 406, 7, 2, 7, 17, 9, 57, 21, 2, 13, 123, 5, 4, 0, 2, 1, 2, 6, 2, 0, 9, 9, 49, 4, 2, 1, 2, 4, 9, 9, 330, 3, 19306, 9, 135, 4, 60, 6, 26, 9, 1014, 0, 2, 54, 8, 3, 82, 0, 12, 1, 19628, 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, 4759, 9, 787719, 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 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 reservedWords = {
+ keyword: ["break", "case", "catch", "continue", "debugger", "default", "do", "else", "finally", "for", "function", "if", "return", "switch", "throw", "try", "var", "const", "while", "with", "new", "this", "super", "class", "extends", "export", "import", "null", "true", "false", "in", "instanceof", "typeof", "void", "delete"],
+ strict: ["implements", "interface", "let", "package", "private", "protected", "public", "static", "yield"],
+ strictBind: ["eval", "arguments"]
+};
+const keywords$1 = new Set(reservedWords.keyword);
+const reservedWordsStrictSet = new Set(reservedWords.strict);
+const reservedWordsStrictBindSet = new Set(reservedWords.strictBind);
+function isReservedWord(word, inModule) {
+ return inModule && word === "await" || word === "enum";
+}
+function isStrictReservedWord(word, inModule) {
+ return isReservedWord(word, inModule) || reservedWordsStrictSet.has(word);
+}
+function isStrictBindOnlyReservedWord(word) {
+ return reservedWordsStrictBindSet.has(word);
+}
+function isStrictBindReservedWord(word, inModule) {
+ return isStrictReservedWord(word, inModule) || isStrictBindOnlyReservedWord(word);
+}
+function isKeyword(word) {
+ return keywords$1.has(word);
+}
+
+const keywordRelationalOperator = /^in(stanceof)?$/;
+function isIteratorStart(current, next) {
+ return current === 64 && next === 64;
+}
+
+const reservedTypes = new Set(["_", "any", "bool", "boolean", "empty", "extends", "false", "interface", "mixed", "null", "number", "static", "string", "true", "typeof", "void"]);
+const FlowErrors = Object.freeze({
+ AmbiguousConditionalArrow: "Ambiguous expression: wrap the arrow functions in parentheses to disambiguate.",
+ AmbiguousDeclareModuleKind: "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",
+ AssignReservedType: "Cannot overwrite reserved type %0",
+ DeclareClassElement: "The `declare` modifier can only appear on class fields.",
+ DeclareClassFieldInitializer: "Initializers are not allowed in fields with the `declare` modifier.",
+ DuplicateDeclareModuleExports: "Duplicate `declare module.exports` statement",
+ EnumBooleanMemberNotInitialized: "Boolean enum members need to be initialized. Use either `%0 = true,` or `%0 = false,` in enum `%1`.",
+ EnumDuplicateMemberName: "Enum member names need to be unique, but the name `%0` has already been used before in enum `%1`.",
+ EnumInconsistentMemberValues: "Enum `%0` has inconsistent member initializers. Either use no initializers, or consistently use literals (either booleans, numbers, or strings) for all member initializers.",
+ EnumInvalidExplicitType: "Enum type `%1` is not valid. Use one of `boolean`, `number`, `string`, or `symbol` in enum `%0`.",
+ EnumInvalidExplicitTypeUnknownSupplied: "Supplied enum type is not valid. Use one of `boolean`, `number`, `string`, or `symbol` in enum `%0`.",
+ EnumInvalidMemberInitializerPrimaryType: "Enum `%0` has type `%2`, so the initializer of `%1` needs to be a %2 literal.",
+ EnumInvalidMemberInitializerSymbolType: "Symbol enum members cannot be initialized. Use `%1,` in enum `%0`.",
+ EnumInvalidMemberInitializerUnknownType: "The enum member initializer for `%1` needs to be a literal (either a boolean, number, or string) in enum `%0`.",
+ EnumInvalidMemberName: "Enum member names cannot start with lowercase 'a' through 'z'. Instead of using `%0`, consider using `%1`, in enum `%2`.",
+ EnumNumberMemberNotInitialized: "Number enum members need to be initialized, e.g. `%1 = 1` in enum `%0`.",
+ EnumStringMemberInconsistentlyInitailized: "String enum members need to consistently either all use initializers, or use no initializers, in enum `%0`.",
+ ImportTypeShorthandOnlyInPureImport: "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",
+ InexactInsideExact: "Explicit inexact syntax cannot appear inside an explicit exact object type",
+ InexactInsideNonObject: "Explicit inexact syntax cannot appear in class or interface definitions",
+ InexactVariance: "Explicit inexact syntax cannot have variance",
+ InvalidNonTypeImportInDeclareModule: "Imports within a `declare module` body must always be `import type` or `import typeof`",
+ MissingTypeParamDefault: "Type parameter declaration needs a default, since a preceding type parameter declaration has a default.",
+ NestedDeclareModule: "`declare module` cannot be used inside another `declare module`",
+ NestedFlowComment: "Cannot have a flow comment inside another flow comment",
+ OptionalBindingPattern: "A binding pattern parameter cannot be optional in an implementation signature.",
+ SpreadVariance: "Spread properties cannot have variance",
+ TypeBeforeInitializer: "Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`",
+ TypeCastInPattern: "The type cast expression is expected to be wrapped with parenthesis",
+ UnexpectedExplicitInexactInObject: "Explicit inexact syntax must appear at the end of an inexact object",
+ UnexpectedReservedType: "Unexpected reserved type %0",
+ UnexpectedReservedUnderscore: "`_` is only allowed as a type argument to call or new",
+ UnexpectedSpaceBetweenModuloChecks: "Spaces between `%` and `checks` are not allowed here.",
+ UnexpectedSpreadType: "Spread operator cannot appear in class or interface definitions",
+ UnexpectedSubtractionOperand: 'Unexpected token, expected "number" or "bigint"',
+ UnexpectedTokenAfterTypeParameter: "Expected an arrow function after this type parameter declaration",
+ UnsupportedDeclareExportKind: "`declare export %0` is not supported. Use `%1` instead",
+ UnsupportedStatementInDeclareModule: "Only declares and type imports are allowed inside declare module",
+ UnterminatedFlowComment: "Unterminated flow-comment"
+});
+
+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";
+ }
+
+ shouldParseEnums() {
+ return !!this.getPluginOption("flow", "enums");
+ }
+
+ 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, FlowErrors.UnexpectedSpaceBetweenModuloChecks);
+ }
+
+ 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.raise(this.state.lastTokStart, FlowErrors.NestedDeclareModule);
+ }
+
+ 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.scope.declareName(node.id.name, BIND_VAR, node.id.start);
+ 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.raise(this.state.lastTokStart, FlowErrors.InvalidNonTypeImportInDeclareModule);
+ }
+
+ this.parseImport(bodyNode);
+ } else {
+ this.expectContextual("declare", FlowErrors.UnsupportedStatementInDeclareModule);
+ 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;
+ body.forEach(bodyElement => {
+ if (isEsModuleType(bodyElement)) {
+ if (kind === "CommonJS") {
+ this.raise(bodyElement.start, FlowErrors.AmbiguousDeclareModuleKind);
+ }
+
+ kind = "ES";
+ } else if (bodyElement.type === "DeclareModuleExports") {
+ if (hasModuleExport) {
+ this.raise(bodyElement.start, FlowErrors.DuplicateDeclareModuleExports);
+ }
+
+ if (kind === "ES") {
+ this.raise(bodyElement.start, FlowErrors.AmbiguousDeclareModuleKind);
+ }
+
+ 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];
+ throw this.raise(this.state.start, FlowErrors.UnsupportedDeclareExportKind, label, suggestion);
+ }
+
+ 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, true);
+ this.scope.declareName(node.id.name, isClass ? BIND_FUNCTION : BIND_LEXICAL, node.id.start);
+
+ 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 === "_") {
+ this.raise(this.state.start, FlowErrors.UnexpectedReservedUnderscore);
+ }
+ }
+
+ checkReservedType(word, startLoc, declaration) {
+ if (!reservedTypes.has(word)) return;
+ this.raise(startLoc, declaration ? FlowErrors.AssignReservedType : FlowErrors.UnexpectedReservedType, word);
+ }
+
+ flowParseRestrictedIdentifier(liberal, declaration) {
+ this.checkReservedType(this.state.value, this.state.start, declaration);
+ return this.parseIdentifier(liberal);
+ }
+
+ flowParseTypeAlias(node) {
+ node.id = this.flowParseRestrictedIdentifier(false, true);
+ 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, 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.raise(nodeStart, FlowErrors.MissingTypeParamDefault);
+ }
+ }
+
+ 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;
+ let inexactStart = 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 != null ? allowInexact : !exact);
+
+ if (propOrInexact === null) {
+ inexact = true;
+ inexactStart = this.state.lastTokStart;
+ } else {
+ nodeStart.properties.push(propOrInexact);
+ }
+ }
+
+ this.flowObjectTypeSemicolon();
+
+ if (inexactStart && !this.match(types.braceR) && !this.match(types.braceBarR)) {
+ this.raise(inexactStart, FlowErrors.UnexpectedExplicitInexactInObject);
+ }
+ }
+
+ 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.eat(types.ellipsis)) {
+ const isInexactToken = this.match(types.comma) || this.match(types.semi) || this.match(types.braceR) || this.match(types.braceBarR);
+
+ if (isInexactToken) {
+ if (!allowSpread) {
+ this.raise(this.state.lastTokStart, FlowErrors.InexactInsideNonObject);
+ } else if (!allowInexact) {
+ this.raise(this.state.lastTokStart, FlowErrors.InexactInsideExact);
+ }
+
+ if (variance) {
+ this.raise(variance.start, FlowErrors.InexactVariance);
+ }
+
+ return null;
+ }
+
+ if (!allowSpread) {
+ this.raise(this.state.lastTokStart, FlowErrors.UnexpectedSpreadType);
+ }
+
+ if (protoStart != null) {
+ this.unexpected(protoStart);
+ }
+
+ if (variance) {
+ this.raise(variance.start, FlowErrors.SpreadVariance);
+ }
+
+ 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, ErrorMessages.BadGetterArity);
+ } else {
+ this.raise(start, ErrorMessages.BadSetterArity);
+ }
+ }
+
+ if (property.kind === "set" && property.value.rest) {
+ this.raise(start, ErrorMessages.BadSetterRestParameter);
+ }
+ }
+
+ 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.flowParseRestrictedIdentifier(true);
+
+ while (this.eat(types.dot)) {
+ const node2 = this.startNodeAt(startPos, startLoc);
+ node2.qualification = node;
+ node2.id = this.flowParseRestrictedIdentifier(true);
+ 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");
+
+ case "symbol":
+ return this.finishNode(node, "SymbolTypeAnnotation");
+
+ 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);
+ }
+
+ throw this.raise(this.state.start, FlowErrors.UnexpectedSubtractionOperand);
+ }
+
+ throw 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 if (this.shouldParseEnums() && this.isContextual("enum")) {
+ const node = this.startNode();
+ this.next();
+ return this.flowParseEnumDeclaration(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") || this.shouldParseEnums() && this.isContextual("enum") || super.shouldParseExportDeclaration();
+ }
+
+ isExportDefaultSpecifier() {
+ if (this.match(types.name) && (this.state.value === "type" || this.state.value === "interface" || this.state.value === "opaque" || this.shouldParseEnums() && this.state.value === "enum")) {
+ return false;
+ }
+
+ return super.isExportDefaultSpecifier();
+ }
+
+ parseExportDefaultExpression() {
+ if (this.shouldParseEnums() && this.isContextual("enum")) {
+ const node = this.startNode();
+ this.next();
+ return this.flowParseEnumDeclaration(node);
+ }
+
+ return super.parseExportDefaultExpression();
+ }
+
+ parseConditional(expr, noIn, startPos, startLoc, refNeedsArrowPos) {
+ if (!this.match(types.question)) return expr;
+
+ if (refNeedsArrowPos) {
+ const result = this.tryParse(() => super.parseConditional(expr, noIn, startPos, startLoc));
+
+ if (!result.node) {
+ refNeedsArrowPos.start = result.error.pos || this.state.start;
+ return expr;
+ }
+
+ if (result.error) this.state = result.failState;
+ return result.node;
+ }
+
+ 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, FlowErrors.AmbiguousConditionalArrow);
+ }
+
+ 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.finishArrowValidation(node);
+ } else {
+ arrows.push(node);
+ }
+
+ stack.push(node.body);
+ } else if (node.type === "ConditionalExpression") {
+ stack.push(node.consequent);
+ stack.push(node.alternate);
+ }
+ }
+
+ if (disallowInvalid) {
+ arrows.forEach(node => this.finishArrowValidation(node));
+ return [arrows, []];
+ }
+
+ return partition(arrows, node => node.params.every(param => this.isAssignable(param, true)));
+ }
+
+ finishArrowValidation(node) {
+ var _node$extra;
+
+ this.toAssignableList(node.params, (_node$extra = node.extra) == null ? void 0 : _node$extra.trailingComma);
+ this.scope.enter(SCOPE_FUNCTION | SCOPE_ARROW);
+ super.checkParams(node, false, true);
+ this.scope.exit();
+ }
+
+ 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 if (this.shouldParseEnums() && this.isContextual("enum")) {
+ node.exportKind = "value";
+ const declarationNode = this.startNode();
+ this.next();
+ return this.flowParseEnumDeclaration(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();
+ }
+ }
+
+ parseClassMember(classBody, member, state, constructorAllowsSuper) {
+ const pos = this.state.start;
+
+ if (this.isContextual("declare")) {
+ if (this.parseClassMemberFromModifier(classBody, member)) {
+ return;
+ }
+
+ member.declare = true;
+ }
+
+ super.parseClassMember(classBody, member, state, constructorAllowsSuper);
+
+ if (member.declare) {
+ if (member.type !== "ClassProperty" && member.type !== "ClassPrivateProperty") {
+ this.raise(pos, FlowErrors.DeclareClassElement);
+ } else if (member.value) {
+ this.raise(member.value.start, FlowErrors.DeclareClassFieldInitializer);
+ }
+ }
+ }
+
+ 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);
+ }
+ }
+
+ isAssignable(node, isBinding) {
+ switch (node.type) {
+ case "Identifier":
+ case "ObjectPattern":
+ case "ArrayPattern":
+ case "AssignmentPattern":
+ return true;
+
+ case "ObjectExpression":
+ {
+ const last = node.properties.length - 1;
+ return node.properties.every((prop, i) => {
+ return prop.type !== "ObjectMethod" && (i === last || prop.type === "SpreadElement") && this.isAssignable(prop);
+ });
+ }
+
+ case "ObjectProperty":
+ return this.isAssignable(node.value);
+
+ case "SpreadElement":
+ return this.isAssignable(node.argument);
+
+ case "ArrayExpression":
+ return node.elements.every(element => this.isAssignable(element));
+
+ case "AssignmentExpression":
+ return node.operator === "=";
+
+ case "ParenthesizedExpression":
+ case "TypeCastExpression":
+ return this.isAssignable(node.expression);
+
+ case "MemberExpression":
+ case "OptionalMemberExpression":
+ return !isBinding;
+
+ default:
+ return false;
+ }
+ }
+
+ toAssignable(node) {
+ if (node.type === "TypeCastExpression") {
+ return super.toAssignable(this.typeCastToParameter(node));
+ } else {
+ return super.toAssignable(node);
+ }
+ }
+
+ toAssignableList(exprList, trailingCommaPos) {
+ for (let i = 0; i < exprList.length; i++) {
+ const expr = exprList[i];
+
+ if ((expr == null ? void 0 : expr.type) === "TypeCastExpression") {
+ exprList[i] = this.typeCastToParameter(expr);
+ }
+ }
+
+ return super.toAssignableList(exprList, trailingCommaPos);
+ }
+
+ toReferencedList(exprList, isParenthesizedExpr) {
+ for (let i = 0; i < exprList.length; i++) {
+ var _expr$extra;
+
+ const expr = exprList[i];
+
+ if (expr && expr.type === "TypeCastExpression" && !((_expr$extra = expr.extra) == null ? void 0 : _expr$extra.parenthesized) && (exprList.length > 1 || !isParenthesizedExpr)) {
+ this.raise(expr.typeAnnotation.start, FlowErrors.TypeCastInPattern);
+ }
+ }
+
+ 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, isPrivateNameAllowed) {
+ const variance = this.flowParseVariance();
+ const key = super.parsePropertyName(node, isPrivateNameAllowed);
+ node.variance = variance;
+ return key;
+ }
+
+ parseObjPropValue(prop, startPos, startLoc, isGenerator, isAsync, isPattern, refExpressionErrors, 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, refExpressionErrors, containsEsc);
+
+ if (typeParameters) {
+ (prop.value || prop).typeParameters = typeParameters;
+ }
+ }
+
+ parseAssignableListItemTypes(param) {
+ if (this.eat(types.question)) {
+ if (param.type !== "Identifier") {
+ this.raise(param.start, FlowErrors.OptionalBindingPattern);
+ }
+
+ 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, FlowErrors.TypeBeforeInitializer);
+ }
+
+ 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, 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, FlowErrors.ImportTypeShorthandOnlyInPureImport);
+ }
+
+ if (nodeIsTypeImport || specifierIsTypeImport) {
+ this.checkReservedType(specifier.local.name, specifier.local.start, true);
+ }
+
+ 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, refExpressionErrors, afterLeftParse, refNeedsArrowPos) {
+ var _jsx;
+
+ let state = null;
+ let jsx;
+
+ if (this.hasPlugin("jsx") && (this.match(types.jsxTagStart) || this.isRelational("<"))) {
+ state = this.state.clone();
+ jsx = this.tryParse(() => super.parseMaybeAssign(noIn, refExpressionErrors, afterLeftParse, refNeedsArrowPos), state);
+ if (!jsx.error) return jsx.node;
+ const {
+ context
+ } = this.state;
+
+ if (context[context.length - 1] === types$1.j_oTag) {
+ context.length -= 2;
+ } else if (context[context.length - 1] === types$1.j_expr) {
+ context.length -= 1;
+ }
+ }
+
+ if (((_jsx = jsx) == null ? void 0 : _jsx.error) || this.isRelational("<")) {
+ var _arrow$node, _jsx2, _jsx3;
+
+ state = state || this.state.clone();
+ let typeParameters;
+ const arrow = this.tryParse(() => {
+ typeParameters = this.flowParseTypeParameterDeclaration();
+ const arrowExpression = this.forwardNoArrowParamsConversionAt(typeParameters, () => super.parseMaybeAssign(noIn, refExpressionErrors, afterLeftParse, refNeedsArrowPos));
+ arrowExpression.typeParameters = typeParameters;
+ this.resetStartLocationFromNode(arrowExpression, typeParameters);
+ return arrowExpression;
+ }, state);
+ const arrowExpression = ((_arrow$node = arrow.node) == null ? void 0 : _arrow$node.type) === "ArrowFunctionExpression" ? arrow.node : null;
+ if (!arrow.error && arrowExpression) return arrowExpression;
+
+ if ((_jsx2 = jsx) == null ? void 0 : _jsx2.node) {
+ this.state = jsx.failState;
+ return jsx.node;
+ }
+
+ if (arrowExpression) {
+ this.state = arrow.failState;
+ return arrowExpression;
+ }
+
+ if ((_jsx3 = jsx) == null ? void 0 : _jsx3.thrown) throw jsx.error;
+ if (arrow.thrown) throw arrow.error;
+ throw this.raise(typeParameters.start, FlowErrors.UnexpectedTokenAfterTypeParameter);
+ }
+
+ return super.parseMaybeAssign(noIn, refExpressionErrors, afterLeftParse, refNeedsArrowPos);
+ }
+
+ parseArrow(node) {
+ if (this.match(types.colon)) {
+ const result = this.tryParse(() => {
+ 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();
+ return typeNode;
+ });
+ if (result.thrown) return null;
+ if (result.error) this.state = result.failState;
+ node.returnType = result.node.typeAnnotation ? this.finishNode(result.node, "TypeAnnotation") : null;
+ }
+
+ 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(...arguments);
+ }
+
+ 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();
+ const arrow = this.tryParse(abort => this.parseAsyncArrowWithTypeParameters(startPos, startLoc) || abort(), state);
+ if (!arrow.error && !arrow.aborted) return arrow.node;
+ const result = this.tryParse(() => super.parseSubscripts(base, startPos, startLoc, noCalls), state);
+ if (result.node && !result.error) return result.node;
+
+ if (arrow.node) {
+ this.state = arrow.failState;
+ return arrow.node;
+ }
+
+ if (result.node) {
+ this.state = result.failState;
+ return result.node;
+ }
+
+ throw arrow.error || result.error;
+ }
+
+ return super.parseSubscripts(base, startPos, startLoc, noCalls);
+ }
+
+ parseSubscript(base, startPos, startLoc, noCalls, subscriptState) {
+ if (this.match(types.questionDot) && this.isLookaheadRelational("<")) {
+ 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.finishCallExpression(node, true);
+ } else if (!noCalls && this.shouldParseTypes() && this.isRelational("<")) {
+ const node = this.startNodeAt(startPos, startLoc);
+ node.callee = base;
+ const result = this.tryParse(() => {
+ node.typeArguments = this.flowParseTypeParameterInstantiationCallOrNew();
+ this.expect(types.parenL);
+ node.arguments = this.parseCallExpressionArguments(types.parenR, false);
+ if (subscriptState.optionalChainMember) node.optional = false;
+ return this.finishCallExpression(node, subscriptState.optionalChainMember);
+ });
+
+ if (result.node) {
+ if (result.error) this.state = result.failState;
+ return result.node;
+ }
+ }
+
+ return super.parseSubscript(base, startPos, startLoc, noCalls, subscriptState);
+ }
+
+ parseNewArguments(node) {
+ let targs = null;
+
+ if (this.shouldParseTypes() && this.isRelational("<")) {
+ targs = this.tryParse(() => this.flowParseTypeParameterInstantiationCallOrNew()).node;
+ }
+
+ 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.raise(this.state.pos, FlowErrors.UnterminatedFlowComment);
+ }
+
+ return fileNode;
+ }
+
+ skipBlockComment() {
+ if (this.hasPlugin("flowComments") && this.skipFlowComment()) {
+ if (this.state.hasFlowComment) {
+ this.unexpected(null, FlowErrors.NestedFlowComment);
+ }
+
+ 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) {
+ throw this.raise(this.state.pos - 2, ErrorMessages.UnterminatedComment);
+ }
+
+ 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) {
+ throw this.raise(this.state.pos, ErrorMessages.UnterminatedComment);
+ }
+ }
+
+ flowEnumErrorBooleanMemberNotInitialized(pos, {
+ enumName,
+ memberName
+ }) {
+ this.raise(pos, FlowErrors.EnumBooleanMemberNotInitialized, memberName, enumName);
+ }
+
+ flowEnumErrorInvalidMemberName(pos, {
+ enumName,
+ memberName
+ }) {
+ const suggestion = memberName[0].toUpperCase() + memberName.slice(1);
+ this.raise(pos, FlowErrors.EnumInvalidMemberName, memberName, suggestion, enumName);
+ }
+
+ flowEnumErrorDuplicateMemberName(pos, {
+ enumName,
+ memberName
+ }) {
+ this.raise(pos, FlowErrors.EnumDuplicateMemberName, memberName, enumName);
+ }
+
+ flowEnumErrorInconsistentMemberValues(pos, {
+ enumName
+ }) {
+ this.raise(pos, FlowErrors.EnumInconsistentMemberValues, enumName);
+ }
+
+ flowEnumErrorInvalidExplicitType(pos, {
+ enumName,
+ suppliedType
+ }) {
+ return this.raise(pos, suppliedType === null ? FlowErrors.EnumInvalidExplicitTypeUnknownSupplied : FlowErrors.EnumInvalidExplicitType, enumName, suppliedType);
+ }
+
+ flowEnumErrorInvalidMemberInitializer(pos, {
+ enumName,
+ explicitType,
+ memberName
+ }) {
+ let message = null;
+
+ switch (explicitType) {
+ case "boolean":
+ case "number":
+ case "string":
+ message = FlowErrors.EnumInvalidMemberInitializerPrimaryType;
+ break;
+
+ case "symbol":
+ message = FlowErrors.EnumInvalidMemberInitializerSymbolType;
+ break;
+
+ default:
+ message = FlowErrors.EnumInvalidMemberInitializerUnknownType;
+ }
+
+ return this.raise(pos, message, enumName, memberName, explicitType);
+ }
+
+ flowEnumErrorNumberMemberNotInitialized(pos, {
+ enumName,
+ memberName
+ }) {
+ this.raise(pos, FlowErrors.EnumNumberMemberNotInitialized, enumName, memberName);
+ }
+
+ flowEnumErrorStringMemberInconsistentlyInitailized(pos, {
+ enumName
+ }) {
+ this.raise(pos, FlowErrors.EnumStringMemberInconsistentlyInitailized, enumName);
+ }
+
+ flowEnumMemberInit() {
+ const startPos = this.state.start;
+
+ const endOfInit = () => this.match(types.comma) || this.match(types.braceR);
+
+ switch (this.state.type) {
+ case types.num:
+ {
+ const literal = this.parseLiteral(this.state.value, "NumericLiteral");
+
+ if (endOfInit()) {
+ return {
+ type: "number",
+ pos: literal.start,
+ value: literal
+ };
+ }
+
+ return {
+ type: "invalid",
+ pos: startPos
+ };
+ }
+
+ case types.string:
+ {
+ const literal = this.parseLiteral(this.state.value, "StringLiteral");
+
+ if (endOfInit()) {
+ return {
+ type: "string",
+ pos: literal.start,
+ value: literal
+ };
+ }
+
+ return {
+ type: "invalid",
+ pos: startPos
+ };
+ }
+
+ case types._true:
+ case types._false:
+ {
+ const literal = this.parseBooleanLiteral();
+
+ if (endOfInit()) {
+ return {
+ type: "boolean",
+ pos: literal.start,
+ value: literal
+ };
+ }
+
+ return {
+ type: "invalid",
+ pos: startPos
+ };
+ }
+
+ default:
+ return {
+ type: "invalid",
+ pos: startPos
+ };
+ }
+ }
+
+ flowEnumMemberRaw() {
+ const pos = this.state.start;
+ const id = this.parseIdentifier(true);
+ const init = this.eat(types.eq) ? this.flowEnumMemberInit() : {
+ type: "none",
+ pos
+ };
+ return {
+ id,
+ init
+ };
+ }
+
+ flowEnumCheckExplicitTypeMismatch(pos, context, expectedType) {
+ const {
+ explicitType
+ } = context;
+
+ if (explicitType === null) {
+ return;
+ }
+
+ if (explicitType !== expectedType) {
+ this.flowEnumErrorInvalidMemberInitializer(pos, context);
+ }
+ }
+
+ flowEnumMembers({
+ enumName,
+ explicitType
+ }) {
+ const seenNames = new Set();
+ const members = {
+ booleanMembers: [],
+ numberMembers: [],
+ stringMembers: [],
+ defaultedMembers: []
+ };
+
+ while (!this.match(types.braceR)) {
+ const memberNode = this.startNode();
+ const {
+ id,
+ init
+ } = this.flowEnumMemberRaw();
+ const memberName = id.name;
+
+ if (memberName === "") {
+ continue;
+ }
+
+ if (/^[a-z]/.test(memberName)) {
+ this.flowEnumErrorInvalidMemberName(id.start, {
+ enumName,
+ memberName
+ });
+ }
+
+ if (seenNames.has(memberName)) {
+ this.flowEnumErrorDuplicateMemberName(id.start, {
+ enumName,
+ memberName
+ });
+ }
+
+ seenNames.add(memberName);
+ const context = {
+ enumName,
+ explicitType,
+ memberName
+ };
+ memberNode.id = id;
+
+ switch (init.type) {
+ case "boolean":
+ {
+ this.flowEnumCheckExplicitTypeMismatch(init.pos, context, "boolean");
+ memberNode.init = init.value;
+ members.booleanMembers.push(this.finishNode(memberNode, "EnumBooleanMember"));
+ break;
+ }
+
+ case "number":
+ {
+ this.flowEnumCheckExplicitTypeMismatch(init.pos, context, "number");
+ memberNode.init = init.value;
+ members.numberMembers.push(this.finishNode(memberNode, "EnumNumberMember"));
+ break;
+ }
+
+ case "string":
+ {
+ this.flowEnumCheckExplicitTypeMismatch(init.pos, context, "string");
+ memberNode.init = init.value;
+ members.stringMembers.push(this.finishNode(memberNode, "EnumStringMember"));
+ break;
+ }
+
+ case "invalid":
+ {
+ throw this.flowEnumErrorInvalidMemberInitializer(init.pos, context);
+ }
+
+ case "none":
+ {
+ switch (explicitType) {
+ case "boolean":
+ this.flowEnumErrorBooleanMemberNotInitialized(init.pos, context);
+ break;
+
+ case "number":
+ this.flowEnumErrorNumberMemberNotInitialized(init.pos, context);
+ break;
+
+ default:
+ members.defaultedMembers.push(this.finishNode(memberNode, "EnumDefaultedMember"));
+ }
+ }
+ }
+
+ if (!this.match(types.braceR)) {
+ this.expect(types.comma);
+ }
+ }
+
+ return members;
+ }
+
+ flowEnumStringMembers(initializedMembers, defaultedMembers, {
+ enumName
+ }) {
+ if (initializedMembers.length === 0) {
+ return defaultedMembers;
+ } else if (defaultedMembers.length === 0) {
+ return initializedMembers;
+ } else if (defaultedMembers.length > initializedMembers.length) {
+ for (let _i = 0; _i < initializedMembers.length; _i++) {
+ const member = initializedMembers[_i];
+ this.flowEnumErrorStringMemberInconsistentlyInitailized(member.start, {
+ enumName
+ });
+ }
+
+ return defaultedMembers;
+ } else {
+ for (let _i2 = 0; _i2 < defaultedMembers.length; _i2++) {
+ const member = defaultedMembers[_i2];
+ this.flowEnumErrorStringMemberInconsistentlyInitailized(member.start, {
+ enumName
+ });
+ }
+
+ return initializedMembers;
+ }
+ }
+
+ flowEnumParseExplicitType({
+ enumName
+ }) {
+ if (this.eatContextual("of")) {
+ if (!this.match(types.name)) {
+ throw this.flowEnumErrorInvalidExplicitType(this.state.start, {
+ enumName,
+ suppliedType: null
+ });
+ }
+
+ const {
+ value
+ } = this.state;
+ this.next();
+
+ if (value !== "boolean" && value !== "number" && value !== "string" && value !== "symbol") {
+ this.flowEnumErrorInvalidExplicitType(this.state.start, {
+ enumName,
+ suppliedType: value
+ });
+ }
+
+ return value;
+ }
+
+ return null;
+ }
+
+ flowEnumBody(node, {
+ enumName,
+ nameLoc
+ }) {
+ const explicitType = this.flowEnumParseExplicitType({
+ enumName
+ });
+ this.expect(types.braceL);
+ const members = this.flowEnumMembers({
+ enumName,
+ explicitType
+ });
+
+ switch (explicitType) {
+ case "boolean":
+ node.explicitType = true;
+ node.members = members.booleanMembers;
+ this.expect(types.braceR);
+ return this.finishNode(node, "EnumBooleanBody");
+
+ case "number":
+ node.explicitType = true;
+ node.members = members.numberMembers;
+ this.expect(types.braceR);
+ return this.finishNode(node, "EnumNumberBody");
+
+ case "string":
+ node.explicitType = true;
+ node.members = this.flowEnumStringMembers(members.stringMembers, members.defaultedMembers, {
+ enumName
+ });
+ this.expect(types.braceR);
+ return this.finishNode(node, "EnumStringBody");
+
+ case "symbol":
+ node.members = members.defaultedMembers;
+ this.expect(types.braceR);
+ return this.finishNode(node, "EnumSymbolBody");
+
+ default:
+ {
+ const empty = () => {
+ node.members = [];
+ this.expect(types.braceR);
+ return this.finishNode(node, "EnumStringBody");
+ };
+
+ node.explicitType = false;
+ const boolsLen = members.booleanMembers.length;
+ const numsLen = members.numberMembers.length;
+ const strsLen = members.stringMembers.length;
+ const defaultedLen = members.defaultedMembers.length;
+
+ if (!boolsLen && !numsLen && !strsLen && !defaultedLen) {
+ return empty();
+ } else if (!boolsLen && !numsLen) {
+ node.members = this.flowEnumStringMembers(members.stringMembers, members.defaultedMembers, {
+ enumName
+ });
+ this.expect(types.braceR);
+ return this.finishNode(node, "EnumStringBody");
+ } else if (!numsLen && !strsLen && boolsLen >= defaultedLen) {
+ for (let _i3 = 0, _members$defaultedMem = members.defaultedMembers; _i3 < _members$defaultedMem.length; _i3++) {
+ const member = _members$defaultedMem[_i3];
+ this.flowEnumErrorBooleanMemberNotInitialized(member.start, {
+ enumName,
+ memberName: member.id.name
+ });
+ }
+
+ node.members = members.booleanMembers;
+ this.expect(types.braceR);
+ return this.finishNode(node, "EnumBooleanBody");
+ } else if (!boolsLen && !strsLen && numsLen >= defaultedLen) {
+ for (let _i4 = 0, _members$defaultedMem2 = members.defaultedMembers; _i4 < _members$defaultedMem2.length; _i4++) {
+ const member = _members$defaultedMem2[_i4];
+ this.flowEnumErrorNumberMemberNotInitialized(member.start, {
+ enumName,
+ memberName: member.id.name
+ });
+ }
+
+ node.members = members.numberMembers;
+ this.expect(types.braceR);
+ return this.finishNode(node, "EnumNumberBody");
+ } else {
+ this.flowEnumErrorInconsistentMemberValues(nameLoc, {
+ enumName
+ });
+ return empty();
+ }
+ }
+ }
+ }
+
+ flowParseEnumDeclaration(node) {
+ const id = this.parseIdentifier();
+ node.id = id;
+ node.body = this.flowEnumBody(this.startNode(), {
+ enumName: id.name,
+ nameLoc: id.start
+ });
+ return this.finishNode(node, "EnumDeclaration");
+ }
+
+ updateContext(prevType) {
+ if (this.match(types.name) && this.state.value === "of" && prevType === types.name && this.input.slice(this.state.lastTokStart, this.state.lastTokEnd) === "interface") {
+ this.state.exprAllowed = false;
+ } else {
+ super.updateContext(prevType);
+ }
+ }
+
+});
+
+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+$/;
+const JsxErrors = Object.freeze({
+ AttributeIsEmpty: "JSX attributes must only be assigned a non-empty expression",
+ MissingClosingTagFragment: "Expected corresponding JSX closing tag for <>",
+ MissingClosingTagElement: "Expected corresponding JSX closing tag for <%0>",
+ UnsupportedJsxValue: "JSX value should be either an expression or a quoted JSX text",
+ UnterminatedJsxContent: "Unterminated JSX contents",
+ UnwrappedAdjacentJSXElements: "Adjacent JSX elements must be wrapped in an enclosing tag. Did you want a JSX fragment <>...</>?"
+});
+types$1.j_oTag = new TokContext("<tag", false);
+types$1.j_cTag = new TokContext("</tag", false);
+types$1.j_expr = new TokContext("<tag>...</tag>", 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) {
+ throw this.raise(this.state.start, JsxErrors.UnterminatedJsxContent);
+ }
+
+ 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) {
+ throw this.raise(this.state.start, ErrorMessages.UnterminatedString);
+ }
+
+ 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();
+
+ if (node.type === "JSXNamespacedName") {
+ return node;
+ }
+
+ 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") {
+ this.raise(node.start, JsxErrors.AttributeIsEmpty);
+ }
+
+ return node;
+
+ case types.jsxTagStart:
+ case types.string:
+ return this.parseExprAtom();
+
+ default:
+ throw this.raise(this.state.start, JsxErrors.UnsupportedJsxValue);
+ }
+ }
+
+ 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, JsxErrors.MissingClosingTagFragment);
+ } else if (!isFragment(openingElement) && isFragment(closingElement)) {
+ this.raise(closingElement.start, JsxErrors.MissingClosingTagElement, getQualifiedJSXName(openingElement.name));
+ } else if (!isFragment(openingElement) && !isFragment(closingElement)) {
+ if (getQualifiedJSXName(closingElement.name) !== getQualifiedJSXName(openingElement.name)) {
+ this.raise(closingElement.start, JsxErrors.MissingClosingTagElement, getQualifiedJSXName(openingElement.name));
+ }
+ }
+ }
+
+ if (isFragment(openingElement)) {
+ node.openingFragment = openingElement;
+ node.closingFragment = closingElement;
+ } else {
+ node.openingElement = openingElement;
+ node.closingElement = closingElement;
+ }
+
+ node.children = children;
+
+ if (this.isRelational("<")) {
+ throw this.raise(this.state.start, JsxErrors.UnwrappedAdjacentJSXElements);
+ }
+
+ 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(refExpressionErrors) {
+ 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(refExpressionErrors);
+ }
+ }
+
+ 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.undefinedPrivateNames = new Map();
+ this.raise = raise;
+ this.inModule = inModule;
+ }
+
+ get inFunction() {
+ return (this.currentVarScope().flags & SCOPE_FUNCTION) > 0;
+ }
+
+ get allowSuper() {
+ return (this.currentThisScope().flags & SCOPE_SUPER) > 0;
+ }
+
+ get allowDirectSuper() {
+ return (this.currentThisScope().flags & SCOPE_DIRECT_SUPER) > 0;
+ }
+
+ get inClass() {
+ return (this.currentThisScope().flags & SCOPE_CLASS) > 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, ErrorMessages.VarRedeclaration, name);
+ }
+ }
+
+ 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);
+ }
+ }
+
+}
+
+const PARAM = 0b000,
+ PARAM_YIELD = 0b001,
+ PARAM_AWAIT = 0b010,
+ PARAM_RETURN = 0b100;
+class ProductionParameterHandler {
+ constructor() {
+ this.stacks = [];
+ }
+
+ enter(flags) {
+ this.stacks.push(flags);
+ }
+
+ exit() {
+ this.stacks.pop();
+ }
+
+ currentFlags() {
+ return this.stacks[this.stacks.length - 1];
+ }
+
+ get hasAwait() {
+ return (this.currentFlags() & PARAM_AWAIT) > 0;
+ }
+
+ get hasYield() {
+ return (this.currentFlags() & PARAM_YIELD) > 0;
+ }
+
+ get hasReturn() {
+ return (this.currentFlags() & PARAM_RETURN) > 0;
+ }
+
+}
+function functionFlags(isAsync, isGenerator) {
+ return (isAsync ? PARAM_AWAIT : 0) | (isGenerator ? PARAM_YIELD : 0);
+}
+
+function nonNull(x) {
+ if (x == null) {
+ throw new Error(`Unexpected ${x} value.`);
+ }
+
+ return x;
+}
+
+function assert(x) {
+ if (!x) {
+ throw new Error("Assert fail");
+ }
+}
+
+const TSErrors = Object.freeze({
+ ClassMethodHasDeclare: "Class methods cannot have the 'declare' modifier",
+ ClassMethodHasReadonly: "Class methods cannot have the 'readonly' modifier",
+ DeclareClassFieldHasInitializer: "'declare' class fields cannot have an initializer",
+ DuplicateModifier: "Duplicate modifier: '%0'",
+ EmptyHeritageClauseType: "'%0' list cannot be empty.",
+ IndexSignatureHasAbstract: "Index signatures cannot have the 'abstract' modifier",
+ IndexSignatureHasAccessibility: "Index signatures cannot have an accessibility modifier ('%0')",
+ IndexSignatureHasStatic: "Index signatures cannot have the 'static' modifier",
+ OptionalTypeBeforeRequired: "A required element cannot follow an optional element.",
+ PatternIsOptional: "A binding pattern parameter cannot be optional in an implementation signature.",
+ PrivateElementHasAbstract: "Private elements cannot have the 'abstract' modifier.",
+ PrivateElementHasAccessibility: "Private elements cannot have an accessibility modifier ('%0')",
+ TemplateTypeHasSubstitution: "Template literal types cannot have any substitution",
+ TypeAnnotationAfterAssign: "Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`",
+ UnexpectedReadonly: "'readonly' type modifier is only permitted on array and tuple literal types.",
+ UnexpectedTypeAnnotation: "Did not expect a type annotation here.",
+ UnexpectedTypeCastInParameter: "Unexpected type cast in parameter position.",
+ UnsupportedImportTypeArgument: "Argument in a type import must be a string literal",
+ UnsupportedParameterPropertyKind: "A parameter property may not be declared using a binding pattern.",
+ UnsupportedSignatureParameterKind: "Name in a signature must be an Identifier, ObjectPattern or ArrayPattern, instead got %0"
+});
+
+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;
+ }
+
+ tsParseModifiers(modified, allowedModifiers) {
+ for (;;) {
+ const startPos = this.state.start;
+ const modifier = this.tsParseModifier(allowedModifiers);
+ if (!modifier) break;
+
+ if (Object.hasOwnProperty.call(modified, modifier)) {
+ this.raise(startPos, TSErrors.DuplicateModifier, modifier);
+ }
+
+ modified[modifier] = true;
+ }
+ }
+
+ 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 = [];
+
+ for (;;) {
+ 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)) {
+ this.raise(this.state.start, TSErrors.UnsupportedImportTypeArgument);
+ }
+
+ 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, 41).map(pattern => {
+ if (pattern.type !== "Identifier" && pattern.type !== "RestElement" && pattern.type !== "ObjectPattern" && pattern.type !== "ArrayPattern") {
+ this.raise(pattern.start, TSErrors.UnsupportedSignatureParameterKind, 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, false);
+ 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, TSErrors.OptionalTypeBeforeRequired);
+ }
+ });
+ return this.finishNode(node, "TSTupleType");
+ }
+
+ tsParseTupleElementType() {
+ if (this.match(types.ellipsis)) {
+ const restNode = this.startNode();
+ this.next();
+ restNode.typeAnnotation = this.tsParseType();
+
+ if (this.match(types.comma) && this.lookaheadCharCode() !== 93) {
+ this.raiseRestNotLast(this.state.start);
+ }
+
+ 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.bigint:
+ 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) {
+ this.raise(templateNode.expressions[0].start, TSErrors.TemplateTypeHasSubstitution);
+ }
+
+ node.literal = templateNode;
+ return this.finishNode(node, "TSLiteralType");
+ }
+
+ tsParseThisTypeOrThisTypePredicate() {
+ const thisKeyword = this.tsParseThisTypeNode();
+
+ if (this.isContextual("is") && !this.hasPrecedingLineBreak()) {
+ return this.tsParseThisTypePredicate(thisKeyword);
+ } else {
+ return thisKeyword;
+ }
+ }
+
+ 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.lookaheadCharCode() !== 46) {
+ const node = this.startNode();
+ this.next();
+ return this.finishNode(node, type);
+ }
+
+ return this.tsParseTypeReference();
+ }
+
+ case types.string:
+ case types.num:
+ case types.bigint:
+ case types._true:
+ case types._false:
+ return this.tsParseLiteralTypeNode();
+
+ case types.plusMin:
+ if (this.state.value === "-") {
+ const node = this.startNode();
+ const nextToken = this.lookahead();
+
+ if (nextToken.type !== types.num && nextToken.type !== types.bigint) {
+ throw this.unexpected();
+ }
+
+ node.literal = this.parseMaybeUnary();
+ return this.finishNode(node, "TSLiteralType");
+ }
+
+ break;
+
+ case types._this:
+ return this.tsParseThisTypeOrThisTypePredicate();
+
+ 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, TSErrors.UnexpectedReadonly);
+ }
+ }
+
+ 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 asserts = this.tsTryParse(this.tsParseTypePredicateAsserts.bind(this));
+
+ if (asserts && this.match(types._this)) {
+ let thisTypePredicate = this.tsParseThisTypeOrThisTypePredicate();
+
+ if (thisTypePredicate.type === "TSThisType") {
+ const node = this.startNodeAtNode(t);
+ node.parameterName = thisTypePredicate;
+ node.asserts = true;
+ thisTypePredicate = this.finishNode(node, "TSTypePredicate");
+ } else {
+ thisTypePredicate.asserts = true;
+ }
+
+ t.typeAnnotation = thisTypePredicate;
+ return this.finishNode(t, "TSTypeAnnotation");
+ }
+
+ const typePredicateVariable = this.tsIsIdentifier() && this.tsTryParse(this.tsParseTypePredicatePrefix.bind(this));
+
+ if (!typePredicateVariable) {
+ if (!asserts) {
+ return this.tsParseTypeAnnotation(false, t);
+ }
+
+ const node = this.startNodeAtNode(t);
+ node.parameterName = this.parseIdentifier();
+ node.asserts = asserts;
+ t.typeAnnotation = this.finishNode(node, "TSTypePredicate");
+ return this.finishNode(t, "TSTypeAnnotation");
+ }
+
+ const type = this.tsParseTypeAnnotation(false);
+ const node = this.startNodeAtNode(t);
+ node.parameterName = typePredicateVariable;
+ node.typeAnnotation = type;
+ node.asserts = asserts;
+ 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;
+ }
+ }
+
+ tsParseTypePredicateAsserts() {
+ if (!this.match(types.name) || this.state.value !== "asserts" || this.hasPrecedingLineBreak()) {
+ return false;
+ }
+
+ const containsEsc = this.state.containsEsc;
+ this.next();
+
+ if (!this.match(types.name) && !this.match(types._this)) {
+ return false;
+ }
+
+ if (containsEsc) {
+ this.raise(this.state.lastTokStart, ErrorMessages.InvalidEscapedReservedWord, "asserts");
+ }
+
+ return true;
+ }
+
+ 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, TSErrors.EmptyHeritageClauseType, descriptor);
+ }
+
+ 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 {
+ this.scope.enter(SCOPE_TS_MODULE);
+ this.prodParam.enter(PARAM);
+ node.body = this.tsParseModuleBlock();
+ this.prodParam.exit();
+ this.scope.exit();
+ }
+
+ 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)) {
+ this.scope.enter(SCOPE_TS_MODULE);
+ this.prodParam.enter(PARAM);
+ node.body = this.tsParseModuleBlock();
+ this.prodParam.exit();
+ this.scope.exit();
+ } else {
+ this.semicolon();
+ }
+
+ return this.finishNode(node, "TSModuleDeclaration");
+ }
+
+ tsParseImportEqualsDeclaration(node, isExport) {
+ node.isExport = isExport || false;
+ node.id = this.parseIdentifier();
+ this.checkLVal(node.id, BIND_LEXICAL, undefined, "import equals declaration");
+ this.expect(types.eq);
+ node.moduleReference = this.tsParseModuleReference();
+ this.semicolon();
+ return this.finishNode(node, "TSImportEqualsDeclaration");
+ }
+
+ tsIsExternalModuleReference() {
+ return this.isContextual("require") && this.lookaheadCharCode() === 40;
+ }
+
+ 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 result = this.tryParse(abort => f() || abort());
+ if (result.aborted || !result.node) return undefined;
+ if (result.error) this.state = result.failState;
+ return result.node;
+ }
+
+ 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:
+ nany.declare = true;
+ 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)) {
+ this.scope.enter(SCOPE_TS_MODULE);
+ this.prodParam.enter(PARAM);
+ const mod = node;
+ mod.global = true;
+ mod.id = expr;
+ mod.body = this.tsParseModuleBlock();
+ this.scope.exit();
+ this.prodParam.exit();
+ 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 oldMaybeInArrowParameters = this.state.maybeInArrowParameters;
+ const oldYieldPos = this.state.yieldPos;
+ const oldAwaitPos = this.state.awaitPos;
+ this.state.maybeInArrowParameters = true;
+ this.state.yieldPos = -1;
+ this.state.awaitPos = -1;
+ 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;
+ });
+ this.state.maybeInArrowParameters = oldMaybeInArrowParameters;
+ this.state.yieldPos = oldYieldPos;
+ this.state.awaitPos = oldAwaitPos;
+
+ 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") {
+ this.raise(pp.start, TSErrors.UnsupportedParameterPropertyKind);
+ }
+
+ 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);
+ }
+
+ registerFunctionStatementId(node) {
+ if (!node.body && node.id) {
+ this.checkLVal(node.id, BIND_TS_AMBIENT, null, "function name");
+ } else {
+ super.registerFunctionStatementId(...arguments);
+ }
+ }
+
+ parseSubscript(base, startPos, startLoc, noCalls, state) {
+ 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.atPossibleAsyncArrow(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, state.optionalChainMember);
+ } 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);
+ }
+
+ 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.match(types.star) || this.match(types.braceL)) {
+ const ahead = this.lookahead();
+
+ if (this.match(types.name) && ahead.type === types.eq) {
+ return this.tsParseImportEqualsDeclaration(node);
+ }
+
+ if (this.isContextual("type") && ahead.type !== types.comma && !(ahead.type === types.name && ahead.value === "from")) {
+ node.importKind = "type";
+ this.next();
+ } else {
+ node.importKind = "value";
+ }
+ }
+
+ const importNode = super.parseImport(node);
+
+ if (importNode.importKind === "type" && importNode.specifiers.length > 1 && importNode.specifiers[0].type === "ImportDefaultSpecifier") {
+ this.raise(importNode.start, "A type-only import can specify a default import or named bindings, but not both.");
+ }
+
+ return importNode;
+ }
+
+ 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 {
+ if (this.isContextual("type") && this.lookahead().type === types.braceL) {
+ this.next();
+ node.exportKind = "type";
+ } else {
+ node.exportKind = "value";
+ }
+
+ 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) {
+ this.tsParseModifiers(member, ["declare"]);
+ const accessibility = this.parseAccessModifier();
+ if (accessibility) member.accessibility = accessibility;
+ this.tsParseModifiers(member, ["declare"]);
+ super.parseClassMember(classBody, member, state, constructorAllowsSuper);
+ }
+
+ parseClassMemberWithIsStatic(classBody, member, state, isStatic, constructorAllowsSuper) {
+ this.tsParseModifiers(member, ["abstract", "readonly", "declare"]);
+ const idx = this.tsTryParseIndexSignature(member);
+
+ if (idx) {
+ classBody.body.push(idx);
+
+ if (member.abstract) {
+ this.raise(member.start, TSErrors.IndexSignatureHasAbstract);
+ }
+
+ if (isStatic) {
+ this.raise(member.start, TSErrors.IndexSignatureHasStatic);
+ }
+
+ if (member.accessibility) {
+ this.raise(member.start, TSErrors.IndexSignatureHasAccessibility, member.accessibility);
+ }
+
+ return;
+ }
+
+ super.parseClassMemberWithIsStatic(classBody, member, state, isStatic, constructorAllowsSuper);
+ }
+
+ parsePostMemberNameModifiers(methodOrProp) {
+ const optional = this.eat(types.question);
+ if (optional) methodOrProp.optional = true;
+
+ if (methodOrProp.readonly && this.match(types.parenL)) {
+ this.raise(methodOrProp.start, TSErrors.ClassMethodHasReadonly);
+ }
+
+ if (methodOrProp.declare && this.match(types.parenL)) {
+ this.raise(methodOrProp.start, TSErrors.ClassMethodHasDeclare);
+ }
+ }
+
+ 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 result = this.tryParse(() => super.parseConditional(expr, noIn, startPos, startLoc));
+
+ if (!result.node) {
+ refNeedsArrowPos.start = result.error.pos || this.state.start;
+ return expr;
+ }
+
+ if (result.error) this.state = result.failState;
+ return result.node;
+ }
+
+ 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 && (declaration.type === "TSInterfaceDeclaration" || declaration.type === "TSTypeAliasDeclaration" || isDeclare)) {
+ node.exportKind = "type";
+ }
+
+ 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(node, isStatement, optionalId, node.declare ? BIND_TS_AMBIENT : BIND_CLASS);
+ const typeParameters = this.tsTryParseTypeParameters();
+ if (typeParameters) node.typeParameters = typeParameters;
+ }
+
+ parseClassPropertyAnnotation(node) {
+ if (!node.optional && this.eat(types.bang)) {
+ node.definite = true;
+ }
+
+ const type = this.tsTryParseTypeAnnotation();
+ if (type) node.typeAnnotation = type;
+ }
+
+ parseClassProperty(node) {
+ this.parseClassPropertyAnnotation(node);
+
+ if (node.declare && this.match(types.equal)) {
+ this.raise(this.state.start, TSErrors.DeclareClassFieldHasInitializer);
+ }
+
+ return super.parseClassProperty(node);
+ }
+
+ parseClassPrivateProperty(node) {
+ if (node.abstract) {
+ this.raise(node.start, TSErrors.PrivateElementHasAbstract);
+ }
+
+ if (node.accessibility) {
+ this.raise(node.start, TSErrors.PrivateElementHasAccessibility, node.accessibility);
+ }
+
+ this.parseClassPropertyAnnotation(node);
+ return super.parseClassPrivateProperty(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) {
+ var _jsx, _jsx2, _typeCast, _jsx3, _typeCast2, _jsx4, _typeCast3;
+
+ let state;
+ let jsx;
+ let typeCast;
+
+ if (this.match(types.jsxTagStart)) {
+ state = this.state.clone();
+ jsx = this.tryParse(() => super.parseMaybeAssign(...args), state);
+ if (!jsx.error) return jsx.node;
+ const {
+ context
+ } = this.state;
+
+ if (context[context.length - 1] === types$1.j_oTag) {
+ context.length -= 2;
+ } else if (context[context.length - 1] === types$1.j_expr) {
+ context.length -= 1;
+ }
+ }
+
+ if (!((_jsx = jsx) == null ? void 0 : _jsx.error) && !this.isRelational("<")) {
+ return super.parseMaybeAssign(...args);
+ }
+
+ let typeParameters;
+ state = state || this.state.clone();
+ const arrow = this.tryParse(abort => {
+ var _typeParameters;
+
+ typeParameters = this.tsParseTypeParameters();
+ const expr = super.parseMaybeAssign(...args);
+
+ if (expr.type !== "ArrowFunctionExpression" || expr.extra && expr.extra.parenthesized) {
+ abort();
+ }
+
+ if (((_typeParameters = typeParameters) == null ? void 0 : _typeParameters.params.length) !== 0) {
+ this.resetStartLocationFromNode(expr, typeParameters);
+ }
+
+ expr.typeParameters = typeParameters;
+ return expr;
+ }, state);
+ if (!arrow.error && !arrow.aborted) return arrow.node;
+
+ if (!jsx) {
+ assert(!this.hasPlugin("jsx"));
+ typeCast = this.tryParse(() => super.parseMaybeAssign(...args), state);
+ if (!typeCast.error) return typeCast.node;
+ }
+
+ if ((_jsx2 = jsx) == null ? void 0 : _jsx2.node) {
+ this.state = jsx.failState;
+ return jsx.node;
+ }
+
+ if (arrow.node) {
+ this.state = arrow.failState;
+ return arrow.node;
+ }
+
+ if ((_typeCast = typeCast) == null ? void 0 : _typeCast.node) {
+ this.state = typeCast.failState;
+ return typeCast.node;
+ }
+
+ if ((_jsx3 = jsx) == null ? void 0 : _jsx3.thrown) throw jsx.error;
+ if (arrow.thrown) throw arrow.error;
+ if ((_typeCast2 = typeCast) == null ? void 0 : _typeCast2.thrown) throw typeCast.error;
+ throw ((_jsx4 = jsx) == null ? void 0 : _jsx4.error) || arrow.error || ((_typeCast3 = typeCast) == null ? void 0 : _typeCast3.error);
+ }
+
+ parseMaybeUnary(refExpressionErrors) {
+ if (!this.hasPlugin("jsx") && this.isRelational("<")) {
+ return this.tsParseTypeAssertion();
+ } else {
+ return super.parseMaybeUnary(refExpressionErrors);
+ }
+ }
+
+ parseArrow(node) {
+ if (this.match(types.colon)) {
+ const result = this.tryParse(abort => {
+ const returnType = this.tsParseTypeOrTypePredicateAnnotation(types.colon);
+ if (this.canInsertSemicolon() || !this.match(types.arrow)) abort();
+ return returnType;
+ });
+ if (result.aborted) return;
+
+ if (!result.thrown) {
+ if (result.error) this.state = result.failState;
+ node.returnType = result.node;
+ }
+ }
+
+ return super.parseArrow(node);
+ }
+
+ parseAssignableListItemTypes(param) {
+ if (this.eat(types.question)) {
+ if (param.type !== "Identifier") {
+ this.raise(param.start, TSErrors.PatternIsOptional);
+ }
+
+ param.optional = true;
+ }
+
+ const type = this.tsTryParseTypeAnnotation();
+ if (type) param.typeAnnotation = type;
+ this.resetEndLocation(param);
+ return param;
+ }
+
+ toAssignable(node) {
+ switch (node.type) {
+ case "TSTypeCastExpression":
+ return super.toAssignable(this.typeCastToParameter(node));
+
+ case "TSParameterProperty":
+ return super.toAssignable(node);
+
+ case "TSAsExpression":
+ case "TSNonNullExpression":
+ case "TSTypeAssertion":
+ node.expression = this.toAssignable(node.expression);
+ return node;
+
+ default:
+ return super.toAssignable(node);
+ }
+ }
+
+ 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, TSErrors.TypeAnnotationAfterAssign);
+ }
+
+ 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) {
+ 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":
+ if (!this.state.maybeInArrowParameters) {
+ exprList[i] = this.typeCastToParameter(expr);
+ } else {
+ this.raise(expr.start, TSErrors.UnexpectedTypeCastInParameter);
+ }
+
+ break;
+ }
+ }
+
+ return super.toAssignableList(...arguments);
+ }
+
+ 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 == null ? void 0 : expr.type) === "TSTypeCastExpression") {
+ this.raise(expr.start, TSErrors.UnexpectedTypeAnnotation);
+ }
+ }
+
+ 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);
+ }
+
+ isExportDefaultSpecifier() {
+ if (this.match(types._default)) {
+ const next = this.nextTokenStart();
+
+ if (this.isUnparsedContextual(next, "from")) {
+ if (this.input.startsWith(types.placeholder.label, this.nextTokenStartSince(next + 4))) {
+ return true;
+ }
+ }
+ }
+
+ return super.isExportDefaultSpecifier();
+ }
+
+ maybeParseExportDefaultSpecifier(node) {
+ if (node.specifiers && node.specifiers.length > 0) {
+ return true;
+ }
+
+ return super.maybeParseExportDefaultSpecifier(...arguments);
+ }
+
+ checkExport(node) {
+ const {
+ specifiers
+ } = node;
+
+ if (specifiers == null ? void 0 : 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);
+ }
+
+});
+
+var v8intrinsic = (superClass => class extends superClass {
+ parseV8Intrinsic() {
+ if (this.match(types.modulo)) {
+ const v8IntrinsicStart = this.state.start;
+ const node = this.startNode();
+ this.eat(types.modulo);
+
+ if (this.match(types.name)) {
+ const name = this.parseIdentifierName(this.state.start);
+ const identifier = this.createIdentifier(node, name);
+ identifier.type = "V8IntrinsicIdentifier";
+
+ if (this.match(types.parenL)) {
+ return identifier;
+ }
+ }
+
+ this.unexpected(v8IntrinsicStart);
+ }
+ }
+
+ parseExprAtom() {
+ return this.parseV8Intrinsic() || super.parseExprAtom(...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"];
+const RECORD_AND_TUPLE_SYNTAX_TYPES = ["hash", "bar"];
+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, "placeholders") && hasPlugin(plugins, "v8intrinsic")) {
+ throw new Error("Cannot combine placeholders and v8intrinsic 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(", "));
+ }
+
+ if (hasPlugin(plugins, "moduleAttributes")) {
+ const moduleAttributesVerionPluginOption = getPluginOption(plugins, "moduleAttributes", "version");
+
+ if (moduleAttributesVerionPluginOption !== "may-2020") {
+ throw new Error("The 'moduleAttributes' plugin requires a 'version' option," + " representing the last proposal update. Currently, the" + " only supported value is 'may-2020'.");
+ }
+ }
+
+ if (hasPlugin(plugins, "recordAndTuple") && !RECORD_AND_TUPLE_SYNTAX_TYPES.includes(getPluginOption(plugins, "recordAndTuple", "syntaxType"))) {
+ throw new Error("'recordAndTuple' requires 'syntaxType' option whose value should be one of: " + RECORD_AND_TUPLE_SYNTAX_TYPES.map(p => `'${p}'`).join(", "));
+ }
+}
+const mixinPlugins = {
+ estree,
+ jsx,
+ flow,
+ typescript,
+ v8intrinsic,
+ 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,
+ errorRecovery: 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 State {
+ constructor() {
+ this.errors = [];
+ this.potentialArrowAt = -1;
+ this.noArrowAt = [];
+ this.noArrowParamsConversionAt = [];
+ this.inParameters = false;
+ this.maybeInArrowParameters = false;
+ this.maybeInAsyncArrowHead = false;
+ this.inPipeline = false;
+ this.inType = false;
+ this.noAnonFunctionType = false;
+ this.inPropertyName = false;
+ this.hasFlowComment = false;
+ this.isIterator = false;
+ this.topicContext = {
+ maxNumOfResolvableTopics: 0,
+ maxTopicIndex: null
+ };
+ this.soloAwait = false;
+ this.inFSharpPipelineDirectBody = false;
+ this.labels = [];
+ this.decoratorStack = [[]];
+ this.yieldPos = -1;
+ this.awaitPos = -1;
+ 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.octalPositions = [];
+ this.exportedIdentifiers = [];
+ this.tokensLength = 0;
+ }
+
+ 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 ParserError {
+ constructor(options, input) {
+ super();
+ this.tokens = [];
+ this.state = new State();
+ this.state.init(options);
+ this.input = input;
+ this.length = input.length;
+ this.isLookahead = false;
+ }
+
+ pushToken(token) {
+ this.tokens.length = this.state.tokensLength;
+ this.tokens.push(token);
+ ++this.state.tokensLength;
+ }
+
+ next() {
+ if (!this.isLookahead) {
+ this.checkKeywordEscapes();
+
+ if (this.options.tokens) {
+ this.pushToken(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;
+ }
+
+ nextTokenStart() {
+ return this.nextTokenStartSince(this.state.pos);
+ }
+
+ nextTokenStartSince(pos) {
+ skipWhiteSpace.lastIndex = pos;
+ const skip = skipWhiteSpace.exec(this.input);
+ return pos + skip[0].length;
+ }
+
+ lookaheadCharCode() {
+ return this.input.charCodeAt(this.nextTokenStart());
+ }
+
+ 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 == null ? void 0 : curContext.preserveSpace)) this.skipSpace();
+ this.state.octalPositions = [];
+ this.state.start = this.state.pos;
+ this.state.startLoc = this.state.curPosition();
+
+ if (this.state.pos >= this.length) {
+ this.finishToken(types.eof);
+ return;
+ }
+
+ const override = curContext == null ? void 0 : curContext.override;
+
+ if (override) {
+ 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.pushToken(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) throw this.raise(start, ErrorMessages.UnterminatedComment);
+ 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 (!isNewLine(ch) && ++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) {
+ throw this.raise(this.state.pos, ErrorMessages.UnexpectedDigitAfterHash);
+ }
+
+ if (next === 123 || next === 91 && this.hasPlugin("recordAndTuple")) {
+ this.expectPlugin("recordAndTuple");
+
+ if (this.getPluginOption("recordAndTuple", "syntaxType") !== "hash") {
+ throw this.raise(this.state.pos, next === 123 ? ErrorMessages.RecordExpressionHashIncorrectStartSyntaxType : ErrorMessages.TupleExpressionHashIncorrectStartSyntaxType);
+ }
+
+ if (next === 123) {
+ this.finishToken(types.braceHashL);
+ } else {
+ this.finishToken(types.bracketHashL);
+ }
+
+ this.state.pos += 2;
+ } else {
+ this.finishOp(types.hash, 1);
+ }
+ }
+
+ readToken_dot() {
+ const next = this.input.charCodeAt(this.state.pos + 1);
+
+ if (next >= 48 && next <= 57) {
+ this.readNumber(true);
+ return;
+ }
+
+ if (next === 46 && this.input.charCodeAt(this.state.pos + 2) === 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;
+ let ch = this.input.charCodeAt(this.state.pos + 1);
+ if (ch !== 33) return false;
+ const start = this.state.pos;
+ this.state.pos += 1;
+
+ while (!isNewLine(ch) && ++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 (this.hasPlugin("recordAndTuple") && next === 125) {
+ if (this.getPluginOption("recordAndTuple", "syntaxType") !== "bar") {
+ throw this.raise(this.state.pos, ErrorMessages.RecordExpressionBarIncorrectEndSyntaxType);
+ }
+
+ this.finishOp(types.braceBarR, 2);
+ return;
+ }
+
+ if (this.hasPlugin("recordAndTuple") && next === 93) {
+ if (this.getPluginOption("recordAndTuple", "syntaxType") !== "bar") {
+ throw this.raise(this.state.pos, ErrorMessages.TupleExpressionBarIncorrectEndSyntaxType);
+ }
+
+ this.finishOp(types.bracketBarR, 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:
+ if (this.hasPlugin("recordAndTuple") && this.input.charCodeAt(this.state.pos + 1) === 124) {
+ if (this.getPluginOption("recordAndTuple", "syntaxType") !== "bar") {
+ throw this.raise(this.state.pos, ErrorMessages.TupleExpressionBarIncorrectStartSyntaxType);
+ }
+
+ this.finishToken(types.bracketBarL);
+ this.state.pos += 2;
+ } else {
+ ++this.state.pos;
+ this.finishToken(types.bracketL);
+ }
+
+ return;
+
+ case 93:
+ ++this.state.pos;
+ this.finishToken(types.bracketR);
+ return;
+
+ case 123:
+ if (this.hasPlugin("recordAndTuple") && this.input.charCodeAt(this.state.pos + 1) === 124) {
+ if (this.getPluginOption("recordAndTuple", "syntaxType") !== "bar") {
+ throw this.raise(this.state.pos, ErrorMessages.RecordExpressionBarIncorrectStartSyntaxType);
+ }
+
+ this.finishToken(types.braceBarL);
+ this.state.pos += 2;
+ } else {
+ ++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;
+ }
+
+ }
+
+ throw this.raise(this.state.pos, ErrorMessages.InvalidOrUnexpectedToken, 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) {
+ throw this.raise(start, ErrorMessages.UnterminatedRegExp);
+ }
+
+ const ch = this.input.charAt(this.state.pos);
+
+ if (lineBreak.test(ch)) {
+ throw this.raise(start, ErrorMessages.UnterminatedRegExp);
+ }
+
+ 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, ErrorMessages.DuplicateRegExpFlags);
+ }
+ } else if (isIdentifierChar(charCode) || charCode === 92) {
+ this.raise(this.state.pos + 1, ErrorMessages.MalformedRegExpFlags);
+ } else {
+ break;
+ }
+
+ ++this.state.pos;
+ mods += char;
+ }
+
+ this.finishToken(types.regexp, {
+ pattern: content,
+ flags: mods
+ });
+ }
+
+ readInt(radix, len, forceLen, allowNumSeparator = true) {
+ 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 invalid = false;
+ 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")) {
+ if (code === 95) {
+ const prev = this.input.charCodeAt(this.state.pos - 1);
+ const next = this.input.charCodeAt(this.state.pos + 1);
+
+ if (allowedSiblings.indexOf(next) === -1) {
+ this.raise(this.state.pos, ErrorMessages.UnexpectedNumericSeparator);
+ } else if (forbiddenSiblings.indexOf(prev) > -1 || forbiddenSiblings.indexOf(next) > -1 || Number.isNaN(next)) {
+ this.raise(this.state.pos, ErrorMessages.UnexpectedNumericSeparator);
+ }
+
+ if (!allowNumSeparator) {
+ this.raise(this.state.pos, ErrorMessages.NumericSeparatorInEscapeSequence);
+ }
+
+ ++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) {
+ if (this.options.errorRecovery && val <= 9) {
+ val = 0;
+ this.raise(this.state.start + i + 2, ErrorMessages.InvalidDigit, radix);
+ } else if (forceLen) {
+ val = 0;
+ invalid = true;
+ } else {
+ break;
+ }
+ }
+
+ ++this.state.pos;
+ total = total * radix + val;
+ }
+
+ if (this.state.pos === start || len != null && this.state.pos - start !== len || invalid) {
+ 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, ErrorMessages.InvalidDigit, radix);
+ }
+
+ const next = this.input.charCodeAt(this.state.pos);
+
+ if (next === 95) {
+ this.expectPlugin("numericSeparator", this.state.pos);
+ }
+
+ if (next === 110) {
+ ++this.state.pos;
+ isBigInt = true;
+ }
+
+ if (isIdentifierStart(this.input.codePointAt(this.state.pos))) {
+ throw this.raise(this.state.pos, ErrorMessages.NumberIdentifier);
+ }
+
+ 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;
+ let isNonOctalDecimalInt = false;
+
+ if (!startsWithDot && this.readInt(10) === null) {
+ this.raise(start, ErrorMessages.InvalidNumber);
+ }
+
+ let octal = this.state.pos - start >= 2 && this.input.charCodeAt(start) === 48;
+
+ if (octal) {
+ if (this.state.strict) {
+ this.raise(start, ErrorMessages.StrictOctalLiteral);
+ }
+
+ if (/[89]/.test(this.input.slice(start, this.state.pos))) {
+ octal = false;
+ isNonOctalDecimalInt = true;
+ }
+ }
+
+ 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, ErrorMessages.InvalidNumber);
+ isFloat = true;
+ next = this.input.charCodeAt(this.state.pos);
+ }
+
+ if (this.hasPlugin("numericSeparator") && (octal || isNonOctalDecimalInt)) {
+ const underscorePos = this.input.slice(start, this.state.pos).indexOf("_");
+
+ if (underscorePos > 0) {
+ this.raise(underscorePos + start, ErrorMessages.ZeroDigitNumericSeparator);
+ }
+ }
+
+ if (next === 95) {
+ this.expectPlugin("numericSeparator", this.state.pos);
+ }
+
+ if (next === 110) {
+ if (isFloat || octal || isNonOctalDecimalInt) {
+ this.raise(start, ErrorMessages.InvalidBigIntLiteral);
+ }
+
+ ++this.state.pos;
+ isBigInt = true;
+ }
+
+ if (isIdentifierStart(this.input.codePointAt(this.state.pos))) {
+ throw this.raise(this.state.pos, ErrorMessages.NumberIdentifier);
+ }
+
+ 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, true, throwOnInvalid);
+ ++this.state.pos;
+
+ if (code !== null && code > 0x10ffff) {
+ if (throwOnInvalid) {
+ this.raise(codePos, ErrorMessages.InvalidCodePoint);
+ } else {
+ return null;
+ }
+ }
+ } else {
+ code = this.readHexChar(4, false, throwOnInvalid);
+ }
+
+ return code;
+ }
+
+ readString(quote) {
+ let out = "",
+ chunkStart = ++this.state.pos;
+
+ for (;;) {
+ if (this.state.pos >= this.length) {
+ throw this.raise(this.state.start, ErrorMessages.UnterminatedString);
+ }
+
+ 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;
+ this.state.lineStart = this.state.pos;
+ } else if (isNewLine(ch)) {
+ throw this.raise(this.state.start, ErrorMessages.UnterminatedString);
+ } 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) {
+ throw this.raise(this.state.start, ErrorMessages.UnterminatedTemplate);
+ }
+
+ 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, false, 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 "";
+
+ case 56:
+ case 57:
+ if (inTemplate) {
+ return null;
+ }
+
+ default:
+ if (ch >= 48 && ch <= 55) {
+ const codePos = this.state.pos - 1;
+ const match = this.input.substr(this.state.pos - 1, 3).match(/^[0-7]+/);
+ let octalStr = match[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) {
+ return null;
+ } else if (this.state.strict) {
+ this.raise(codePos, ErrorMessages.StrictOctalLiteral);
+ } else {
+ this.state.octalPositions.push(codePos);
+ }
+ }
+
+ return String.fromCharCode(octal);
+ }
+
+ return String.fromCharCode(ch);
+ }
+ }
+
+ readHexChar(len, forceLen, throwOnInvalid) {
+ const codePos = this.state.pos;
+ const n = this.readInt(16, len, forceLen, false);
+
+ if (n === null) {
+ if (throwOnInvalid) {
+ this.raise(codePos, ErrorMessages.InvalidEscapeSequence);
+ } else {
+ this.state.pos = 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, ErrorMessages.MissingUnicodeEscape);
+ continue;
+ }
+
+ ++this.state.pos;
+ const esc = this.readCodePoint(true);
+
+ if (esc !== null) {
+ if (!identifierCheck(esc)) {
+ this.raise(escStart, ErrorMessages.EscapedCharNotAnIdentifier);
+ }
+
+ 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 (this.state.isIterator && (!this.isIterator(word) || !this.state.inType)) {
+ this.raise(this.state.pos, ErrorMessages.InvalidIdentifier, word);
+ }
+
+ this.finishToken(type, word);
+ }
+
+ checkKeywordEscapes() {
+ const kw = this.state.type.keyword;
+
+ if (kw && this.state.containsEsc) {
+ this.raise(this.state.start, ErrorMessages.InvalidEscapedReservedWord, kw);
+ }
+ }
+
+ 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;
+ }
+ }
+
+}
+
+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 next = this.nextTokenStart();
+
+ if (this.input.charAt(next) === op) {
+ if (next + 1 === this.input.length) {
+ return true;
+ }
+
+ const afterNext = this.input.charCodeAt(next + 1);
+ return afterNext !== op.charCodeAt(0) && afterNext !== 61;
+ }
+
+ return false;
+ }
+
+ expectRelational(op) {
+ if (this.isRelational(op)) {
+ this.next();
+ } else {
+ this.unexpected(null, types.relational);
+ }
+ }
+
+ isContextual(name) {
+ return this.match(types.name) && this.state.value === name && !this.state.containsEsc;
+ }
+
+ isUnparsedContextual(nameStart, name) {
+ const nameEnd = nameStart + name.length;
+ return this.input.slice(nameStart, nameEnd) === name && (nameEnd === this.input.length || !isIdentifierChar(this.input.charCodeAt(nameEnd)));
+ }
+
+ isLookaheadContextual(name) {
+ const next = this.nextTokenStart();
+ return this.isUnparsedContextual(next, 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.raiseWithData(pos != null ? pos : this.state.start, {
+ missingPlugin: [name]
+ }, `This experimental syntax requires enabling the parser plugin: '${name}'`);
+ }
+
+ return true;
+ }
+
+ expectOnePlugin(names, pos) {
+ if (!names.some(n => this.hasPlugin(n))) {
+ throw this.raiseWithData(pos != null ? pos : this.state.start, {
+ missingPlugin: names
+ }, `This experimental syntax requires enabling one of the following parser plugin(s): '${names.join(", ")}'`);
+ }
+ }
+
+ checkYieldAwaitInDefaultParams() {
+ if (this.state.yieldPos !== -1 && (this.state.awaitPos === -1 || this.state.yieldPos < this.state.awaitPos)) {
+ this.raise(this.state.yieldPos, ErrorMessages.YieldBindingIdentifier);
+ }
+
+ if (this.state.awaitPos !== -1) {
+ this.raise(this.state.awaitPos, ErrorMessages.AwaitBindingIdentifier);
+ }
+ }
+
+ tryParse(fn, oldState = this.state.clone()) {
+ const abortSignal = {
+ node: null
+ };
+
+ try {
+ const node = fn((node = null) => {
+ abortSignal.node = node;
+ throw abortSignal;
+ });
+
+ if (this.state.errors.length > oldState.errors.length) {
+ const failState = this.state;
+ this.state = oldState;
+ return {
+ node,
+ error: failState.errors[oldState.errors.length],
+ thrown: false,
+ aborted: false,
+ failState
+ };
+ }
+
+ return {
+ node,
+ error: null,
+ thrown: false,
+ aborted: false,
+ failState: null
+ };
+ } catch (error) {
+ const failState = this.state;
+ this.state = oldState;
+
+ if (error instanceof SyntaxError) {
+ return {
+ node: null,
+ error,
+ thrown: true,
+ aborted: false,
+ failState
+ };
+ }
+
+ if (error === abortSignal) {
+ return {
+ node: abortSignal.node,
+ error: null,
+ thrown: false,
+ aborted: true,
+ failState
+ };
+ }
+
+ throw error;
+ }
+ }
+
+ checkExpressionErrors(refExpressionErrors, andThrow) {
+ if (!refExpressionErrors) return false;
+ const {
+ shorthandAssign,
+ doubleProto
+ } = refExpressionErrors;
+ if (!andThrow) return shorthandAssign >= 0 || doubleProto >= 0;
+
+ if (shorthandAssign >= 0) {
+ this.unexpected(shorthandAssign);
+ }
+
+ if (doubleProto >= 0) {
+ this.raise(doubleProto, ErrorMessages.DuplicateProto);
+ }
+ }
+
+ isLiteralPropertyName() {
+ return this.match(types.name) || !!this.state.type.keyword || this.match(types.string) || this.match(types.num) || this.match(types.bigint);
+ }
+
+}
+class ExpressionErrors {
+ constructor() {
+ this.shorthandAssign = -1;
+ this.doubleProto = -1;
+ }
+
+}
+
+class Node {
+ constructor(parser, pos, loc) {
+ this.type = "";
+ this.start = pos;
+ this.end = 0;
+ this.loc = new SourceLocation(loc);
+ if (parser == null ? void 0 : parser.options.ranges) this.range = [pos, 0];
+ if (parser == null ? void 0 : 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);
+ }
+
+}
+
+const unwrapParenthesizedExpression = node => {
+ return node.type === "ParenthesizedExpression" ? unwrapParenthesizedExpression(node.expression) : node;
+};
+
+class LValParser extends NodeUtils {
+ toAssignable(node) {
+ var _node$extra, _node$extra3;
+
+ let parenthesized = undefined;
+
+ if (node.type === "ParenthesizedExpression" || ((_node$extra = node.extra) == null ? void 0 : _node$extra.parenthesized)) {
+ parenthesized = unwrapParenthesizedExpression(node);
+
+ if (parenthesized.type !== "Identifier" && parenthesized.type !== "MemberExpression") {
+ this.raise(node.start, ErrorMessages.InvalidParenthesizedAssignment);
+ }
+ }
+
+ 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++) {
+ var _node$extra2;
+
+ const prop = node.properties[i];
+ const isLast = i === last;
+ this.toAssignableObjectExpressionProp(prop, isLast);
+
+ if (isLast && prop.type === "RestElement" && ((_node$extra2 = node.extra) == null ? void 0 : _node$extra2.trailingComma)) {
+ this.raiseRestNotLast(node.extra.trailingComma);
+ }
+ }
+
+ break;
+
+ case "ObjectProperty":
+ this.toAssignable(node.value);
+ break;
+
+ case "SpreadElement":
+ {
+ this.checkToRestConversion(node);
+ node.type = "RestElement";
+ const arg = node.argument;
+ this.toAssignable(arg);
+ break;
+ }
+
+ case "ArrayExpression":
+ node.type = "ArrayPattern";
+ this.toAssignableList(node.elements, (_node$extra3 = node.extra) == null ? void 0 : _node$extra3.trailingComma);
+ break;
+
+ case "AssignmentExpression":
+ if (node.operator !== "=") {
+ this.raise(node.left.end, ErrorMessages.MissingEqInAssignment);
+ }
+
+ node.type = "AssignmentPattern";
+ delete node.operator;
+ this.toAssignable(node.left);
+ break;
+
+ case "ParenthesizedExpression":
+ this.toAssignable(parenthesized);
+ break;
+ }
+
+ return node;
+ }
+
+ toAssignableObjectExpressionProp(prop, isLast) {
+ if (prop.type === "ObjectMethod") {
+ const error = prop.kind === "get" || prop.kind === "set" ? ErrorMessages.PatternHasAccessor : ErrorMessages.PatternHasMethod;
+ this.raise(prop.key.start, error);
+ } else if (prop.type === "SpreadElement" && !isLast) {
+ this.raiseRestNotLast(prop.start);
+ } else {
+ this.toAssignable(prop);
+ }
+ }
+
+ toAssignableList(exprList, trailingCommaPos) {
+ let end = exprList.length;
+
+ if (end) {
+ const last = exprList[end - 1];
+
+ if ((last == null ? void 0 : last.type) === "RestElement") {
+ --end;
+ } else if ((last == null ? void 0 : last.type) === "SpreadElement") {
+ last.type = "RestElement";
+ const arg = last.argument;
+ this.toAssignable(arg);
+
+ if (arg.type !== "Identifier" && arg.type !== "MemberExpression" && arg.type !== "ArrayPattern" && arg.type !== "ObjectPattern") {
+ this.unexpected(arg.start);
+ }
+
+ if (trailingCommaPos) {
+ this.raiseTrailingCommaAfterRest(trailingCommaPos);
+ }
+
+ --end;
+ }
+ }
+
+ for (let i = 0; i < end; i++) {
+ const elt = exprList[i];
+
+ if (elt) {
+ this.toAssignable(elt);
+
+ 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 == null ? void 0 : expr.type) === "ArrayExpression") {
+ this.toReferencedListDeep(expr.elements);
+ }
+ }
+ }
+
+ parseSpread(refExpressionErrors, refNeedsArrowPos) {
+ const node = this.startNode();
+ this.next();
+ node.argument = this.parseMaybeAssign(false, refExpressionErrors, undefined, refNeedsArrowPos);
+ 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, 93, true);
+ return this.finishNode(node, "ArrayPattern");
+ }
+
+ case types.braceL:
+ return this.parseObj(types.braceR, true);
+ }
+
+ return this.parseIdentifier();
+ }
+
+ parseBindingList(close, closeCharCode, 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(closeCharCode);
+ this.expect(close);
+ break;
+ } else {
+ const decorators = [];
+
+ if (this.match(types.at) && this.hasPlugin("decorators")) {
+ this.raise(this.state.start, ErrorMessages.UnsupportedParameterDecorator);
+ }
+
+ 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, disallowLetBinding, strictModeChanged = false) {
+ switch (expr.type) {
+ case "Identifier":
+ if (this.state.strict && (strictModeChanged ? isStrictBindReservedWord(expr.name, this.inModule) : isStrictBindOnlyReservedWord(expr.name))) {
+ this.raise(expr.start, bindingType === BIND_NONE ? ErrorMessages.StrictEvalArguments : ErrorMessages.StrictEvalArgumentsBinding, expr.name);
+ }
+
+ if (checkClashes) {
+ const key = `_${expr.name}`;
+
+ if (checkClashes[key]) {
+ this.raise(expr.start, ErrorMessages.ParamDupe);
+ } else {
+ checkClashes[key] = true;
+ }
+ }
+
+ if (disallowLetBinding && expr.name === "let") {
+ this.raise(expr.start, ErrorMessages.LetInLexicalBinding);
+ }
+
+ if (!(bindingType & BIND_NONE)) {
+ this.scope.declareName(expr.name, bindingType, expr.start);
+ }
+
+ break;
+
+ case "MemberExpression":
+ if (bindingType !== BIND_NONE) {
+ this.raise(expr.start, ErrorMessages.InvalidPropertyBindingPattern);
+ }
+
+ 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;else if (prop.type === "ObjectMethod") continue;
+ this.checkLVal(prop, bindingType, checkClashes, "object destructuring pattern", disallowLetBinding);
+ }
+
+ 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", disallowLetBinding);
+ }
+ }
+
+ 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:
+ {
+ this.raise(expr.start, bindingType === BIND_NONE ? ErrorMessages.InvalidLhs : ErrorMessages.InvalidLhsBinding, contextDescription);
+ }
+ }
+ }
+
+ checkToRestConversion(node) {
+ if (node.argument.type !== "Identifier" && node.argument.type !== "MemberExpression") {
+ this.raise(node.argument.start, ErrorMessages.InvalidRestAssignmentPattern);
+ }
+ }
+
+ checkCommaAfterRest(close) {
+ if (this.match(types.comma)) {
+ if (this.lookaheadCharCode() === close) {
+ this.raiseTrailingCommaAfterRest(this.state.start);
+ } else {
+ this.raiseRestNotLast(this.state.start);
+ }
+ }
+ }
+
+ raiseRestNotLast(pos) {
+ throw this.raise(pos, ErrorMessages.ElementAfterRest);
+ }
+
+ raiseTrailingCommaAfterRest(pos) {
+ this.raise(pos, ErrorMessages.RestTrailingComma);
+ }
+
+}
+
+class ExpressionParser extends LValParser {
+ checkProto(prop, isRecord, protoRef, refExpressionErrors) {
+ if (prop.type === "SpreadElement" || prop.type === "ObjectMethod" || prop.computed || prop.shorthand) {
+ return;
+ }
+
+ const key = prop.key;
+ const name = key.type === "Identifier" ? key.name : key.value;
+
+ if (name === "__proto__") {
+ if (isRecord) {
+ this.raise(key.start, ErrorMessages.RecordNoProto);
+ return;
+ }
+
+ if (protoRef.used) {
+ if (refExpressionErrors) {
+ if (refExpressionErrors.doubleProto === -1) {
+ refExpressionErrors.doubleProto = key.start;
+ }
+ } else {
+ this.raise(key.start, ErrorMessages.DuplicateProto);
+ }
+ }
+
+ protoRef.used = true;
+ }
+ }
+
+ getExpression() {
+ let paramFlags = PARAM;
+
+ if (this.hasPlugin("topLevelAwait") && this.inModule) {
+ paramFlags |= PARAM_AWAIT;
+ }
+
+ this.scope.enter(SCOPE_PROGRAM);
+ this.prodParam.enter(paramFlags);
+ this.nextToken();
+ const expr = this.parseExpression();
+
+ if (!this.match(types.eof)) {
+ this.unexpected();
+ }
+
+ expr.comments = this.state.comments;
+ expr.errors = this.state.errors;
+ return expr;
+ }
+
+ parseExpression(noIn, refExpressionErrors) {
+ const startPos = this.state.start;
+ const startLoc = this.state.startLoc;
+ const expr = this.parseMaybeAssign(noIn, refExpressionErrors);
+
+ 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, refExpressionErrors));
+ }
+
+ this.toReferencedList(node.expressions);
+ return this.finishNode(node, "SequenceExpression");
+ }
+
+ return expr;
+ }
+
+ parseMaybeAssign(noIn, refExpressionErrors, afterLeftParse, refNeedsArrowPos) {
+ const startPos = this.state.start;
+ const startLoc = this.state.startLoc;
+
+ if (this.isContextual("yield")) {
+ if (this.prodParam.hasYield) {
+ let left = this.parseYield(noIn);
+
+ if (afterLeftParse) {
+ left = afterLeftParse.call(this, left, startPos, startLoc);
+ }
+
+ return left;
+ } else {
+ this.state.exprAllowed = false;
+ }
+ }
+
+ let ownExpressionErrors;
+
+ if (refExpressionErrors) {
+ ownExpressionErrors = false;
+ } else {
+ refExpressionErrors = new ExpressionErrors();
+ ownExpressionErrors = true;
+ }
+
+ if (this.match(types.parenL) || this.match(types.name)) {
+ this.state.potentialArrowAt = this.state.start;
+ }
+
+ let left = this.parseMaybeConditional(noIn, refExpressionErrors, 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("logicalAssignment");
+ }
+
+ if (operator === "||=" || operator === "&&=") {
+ this.expectPlugin("logicalAssignment");
+ }
+
+ if (this.match(types.eq)) {
+ node.left = this.toAssignable(left);
+ refExpressionErrors.doubleProto = -1;
+ } else {
+ node.left = left;
+ }
+
+ if (refExpressionErrors.shorthandAssign >= node.left.start) {
+ refExpressionErrors.shorthandAssign = -1;
+ }
+
+ this.checkLVal(left, undefined, undefined, "assignment expression");
+ this.next();
+ node.right = this.parseMaybeAssign(noIn);
+ return this.finishNode(node, "AssignmentExpression");
+ } else if (ownExpressionErrors) {
+ this.checkExpressionErrors(refExpressionErrors, true);
+ }
+
+ return left;
+ }
+
+ parseMaybeConditional(noIn, refExpressionErrors, refNeedsArrowPos) {
+ const startPos = this.state.start;
+ const startLoc = this.state.startLoc;
+ const potentialArrowAt = this.state.potentialArrowAt;
+ const expr = this.parseExprOps(noIn, refExpressionErrors);
+
+ if (expr.type === "ArrowFunctionExpression" && expr.start === potentialArrowAt) {
+ return expr;
+ }
+
+ if (this.checkExpressionErrors(refExpressionErrors, false)) 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, refExpressionErrors) {
+ const startPos = this.state.start;
+ const startLoc = this.state.startLoc;
+ const potentialArrowAt = this.state.potentialArrowAt;
+ const expr = this.parseMaybeUnary(refExpressionErrors);
+
+ if (expr.type === "ArrowFunctionExpression" && expr.start === potentialArrowAt) {
+ return expr;
+ }
+
+ if (this.checkExpressionErrors(refExpressionErrors, false)) {
+ return expr;
+ }
+
+ return this.parseExprOp(expr, startPos, startLoc, -1, noIn);
+ }
+
+ parseExprOp(left, leftStartPos, leftStartLoc, minPrec, noIn) {
+ let 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, ErrorMessages.UnexpectedTokenUnaryExponentiation);
+ }
+
+ const op = this.state.type;
+ const logical = op === types.logicalOR || op === types.logicalAND;
+ const coalesce = op === types.nullishCoalescing;
+
+ if (op === types.pipeline) {
+ this.expectPlugin("pipelineOperator");
+ this.state.inPipeline = true;
+ this.checkPipelineAtInfixOperator(left, leftStartPos);
+ } else if (coalesce) {
+ prec = types.logicalAND.binop;
+ }
+
+ this.next();
+
+ if (op === types.pipeline && this.getPluginOption("pipelineOperator", "proposal") === "minimal") {
+ if (this.match(types.name) && this.state.value === "await" && this.prodParam.hasAwait) {
+ throw this.raise(this.state.start, ErrorMessages.UnexpectedAwaitAfterPipelineBody);
+ }
+ }
+
+ node.right = this.parseExprOpRightExpr(op, prec, noIn);
+ this.finishNode(node, logical || coalesce ? "LogicalExpression" : "BinaryExpression");
+ const nextOp = this.state.type;
+
+ if (coalesce && (nextOp === types.logicalOR || nextOp === types.logicalAND) || logical && nextOp === types.nullishCoalescing) {
+ throw this.raise(this.state.start, ErrorMessages.MixingCoalesceWithLogical);
+ }
+
+ 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(refExpressionErrors) {
+ if (this.isContextual("await") && this.isAwaitAllowed()) {
+ 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();
+ this.checkExpressionErrors(refExpressionErrors, true);
+
+ 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, ErrorMessages.StrictDelete);
+ } else if ((arg.type === "MemberExpression" || arg.type === "OptionalMemberExpression") && arg.property.type === "PrivateName") {
+ this.raise(node.start, ErrorMessages.DeletePrivateField);
+ }
+ }
+
+ return this.finishNode(node, update ? "UpdateExpression" : "UnaryExpression");
+ }
+
+ const startPos = this.state.start;
+ const startLoc = this.state.startLoc;
+ let expr = this.parseExprSubscripts(refExpressionErrors);
+ if (this.checkExpressionErrors(refExpressionErrors, false)) 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(refExpressionErrors) {
+ const startPos = this.state.start;
+ const startLoc = this.state.startLoc;
+ const potentialArrowAt = this.state.potentialArrowAt;
+ const expr = this.parseExprAtom(refExpressionErrors);
+
+ if (expr.type === "ArrowFunctionExpression" && expr.start === potentialArrowAt) {
+ return expr;
+ }
+
+ return this.parseSubscripts(expr, startPos, startLoc);
+ }
+
+ parseSubscripts(base, startPos, startLoc, noCalls) {
+ const state = {
+ optionalChainMember: false,
+ maybeAsyncArrow: this.atPossibleAsyncArrow(base),
+ stop: false
+ };
+
+ do {
+ const oldMaybeInAsyncArrowHead = this.state.maybeInAsyncArrowHead;
+
+ if (state.maybeAsyncArrow) {
+ this.state.maybeInAsyncArrowHead = true;
+ }
+
+ base = this.parseSubscript(base, startPos, startLoc, noCalls, state);
+ state.maybeAsyncArrow = false;
+ this.state.maybeInAsyncArrowHead = oldMaybeInAsyncArrowHead;
+ } while (!state.stop);
+
+ return base;
+ }
+
+ parseSubscript(base, startPos, startLoc, noCalls, state) {
+ 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);
+ }
+
+ let optional = false;
+
+ if (this.match(types.questionDot)) {
+ state.optionalChainMember = optional = true;
+
+ if (noCalls && this.lookaheadCharCode() === 40) {
+ state.stop = true;
+ return base;
+ }
+
+ this.next();
+ }
+
+ const computed = this.eat(types.bracketL);
+
+ if (optional && !this.match(types.parenL) && !this.match(types.backQuote) || computed || this.eat(types.dot)) {
+ const node = this.startNodeAt(startPos, startLoc);
+ node.object = base;
+ node.property = computed ? this.parseExpression() : this.parseMaybePrivateName(true);
+ node.computed = computed;
+
+ if (node.property.type === "PrivateName") {
+ if (node.object.type === "Super") {
+ this.raise(startPos, ErrorMessages.SuperPrivateField);
+ }
+
+ this.classScope.usePrivateName(node.property.id.name, node.property.start);
+ }
+
+ if (computed) {
+ this.expect(types.bracketR);
+ }
+
+ if (state.optionalChainMember) {
+ node.optional = optional;
+ return this.finishNode(node, "OptionalMemberExpression");
+ } else {
+ 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 = -1;
+ this.state.awaitPos = -1;
+ this.next();
+ let node = this.startNodeAt(startPos, startLoc);
+ node.callee = base;
+
+ if (optional) {
+ node.optional = true;
+ node.arguments = this.parseCallExpressionArguments(types.parenR, false);
+ } else {
+ node.arguments = this.parseCallExpressionArguments(types.parenR, state.maybeAsyncArrow, base.type === "Import", base.type !== "Super", node);
+ }
+
+ this.finishCallExpression(node, state.optionalChainMember);
+
+ if (state.maybeAsyncArrow && this.shouldParseAsyncArrow() && !optional) {
+ state.stop = true;
+ node = this.parseAsyncArrowFromCallExpression(this.startNodeAt(startPos, startLoc), node);
+ this.checkYieldAwaitInDefaultParams();
+ this.state.yieldPos = oldYieldPos;
+ this.state.awaitPos = oldAwaitPos;
+ } else {
+ this.toReferencedListDeep(node.arguments);
+ if (oldYieldPos !== -1) this.state.yieldPos = oldYieldPos;
+
+ if (!this.isAwaitAllowed() && !oldMaybeInArrowParameters || oldAwaitPos !== -1) {
+ this.state.awaitPos = oldAwaitPos;
+ }
+ }
+
+ this.state.maybeInArrowParameters = oldMaybeInArrowParameters;
+ 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, ErrorMessages.OptionalChainingNoTemplate);
+ }
+
+ return this.finishNode(node, "TaggedTemplateExpression");
+ }
+
+ atPossibleAsyncArrow(base) {
+ return base.type === "Identifier" && base.name === "async" && this.state.lastTokEnd === base.end && !this.canInsertSemicolon() && base.end - base.start === 5 && base.start === this.state.potentialArrowAt;
+ }
+
+ finishCallExpression(node, optional) {
+ if (node.callee.type === "Import") {
+ if (node.arguments.length === 2) {
+ this.expectPlugin("moduleAttributes");
+ }
+
+ if (node.arguments.length === 0 || node.arguments.length > 2) {
+ this.raise(node.start, ErrorMessages.ImportCallArity, this.hasPlugin("moduleAttributes") ? "one or two arguments" : "one argument");
+ } else {
+ for (let _i = 0, _node$arguments = node.arguments; _i < _node$arguments.length; _i++) {
+ const arg = _node$arguments[_i];
+
+ if (arg.type === "SpreadElement") {
+ this.raise(arg.start, ErrorMessages.ImportCallSpreadArgument);
+ }
+ }
+ }
+ }
+
+ return this.finishNode(node, optional ? "OptionalCallExpression" : "CallExpression");
+ }
+
+ parseCallExpressionArguments(close, possibleAsyncArrow, dynamicImport, allowPlaceholder, nodeForExtra) {
+ 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.match(close)) {
+ if (dynamicImport && !this.hasPlugin("moduleAttributes")) {
+ this.raise(this.state.lastTokStart, ErrorMessages.ImportCallArgumentTrailingComma);
+ }
+
+ if (nodeForExtra) {
+ this.addExtra(nodeForExtra, "trailingComma", this.state.lastTokStart);
+ }
+
+ this.next();
+ break;
+ }
+ }
+
+ if (this.match(types.parenL) && !innerParenStart) {
+ innerParenStart = this.state.start;
+ }
+
+ elts.push(this.parseExprListItem(false, possibleAsyncArrow ? new ExpressionErrors() : 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) {
+ var _call$extra;
+
+ this.expect(types.arrow);
+ this.parseArrowExpression(node, call.arguments, true, (_call$extra = call.extra) == null ? void 0 : _call$extra.trailingComma);
+ return node;
+ }
+
+ parseNoCallExpr() {
+ const startPos = this.state.start;
+ const startLoc = this.state.startLoc;
+ return this.parseSubscripts(this.parseExprAtom(), startPos, startLoc, true);
+ }
+
+ parseExprAtom(refExpressionErrors) {
+ 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:
+ node = this.startNode();
+ this.next();
+
+ if (this.match(types.parenL) && !this.scope.allowDirectSuper && !this.options.allowSuperOutsideMethod) {
+ this.raise(node.start, ErrorMessages.SuperNotAllowed);
+ } else if (!this.scope.allowSuper && !this.options.allowSuperOutsideMethod) {
+ this.raise(node.start, ErrorMessages.UnexpectedSuper);
+ }
+
+ if (!this.match(types.parenL) && !this.match(types.bracketL) && !this.match(types.dot)) {
+ this.raise(node.start, ErrorMessages.UnsupportedSuper);
+ }
+
+ return this.finishNode(node, "Super");
+
+ case types._import:
+ node = this.startNode();
+ this.next();
+
+ if (this.match(types.dot)) {
+ return this.parseImportMetaProperty(node);
+ }
+
+ if (!this.match(types.parenL)) {
+ this.raise(this.state.lastTokStart, ErrorMessages.UnsupportedImport);
+ }
+
+ 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()) {
+ const last = this.state.context.length - 1;
+
+ if (this.state.context[last] !== types$1.functionStatement) {
+ throw new Error("Internal error");
+ }
+
+ this.state.context[last] = types$1.functionExpression;
+ this.next();
+ return this.parseFunction(node, undefined, true);
+ } else if (canBeArrow && !containsEsc && id.name === "async" && this.match(types.name) && !this.canInsertSemicolon()) {
+ const oldMaybeInArrowParameters = this.state.maybeInArrowParameters;
+ const oldMaybeInAsyncArrowHead = this.state.maybeInAsyncArrowHead;
+ const oldYieldPos = this.state.yieldPos;
+ const oldAwaitPos = this.state.awaitPos;
+ this.state.maybeInArrowParameters = true;
+ this.state.maybeInAsyncArrowHead = true;
+ this.state.yieldPos = -1;
+ this.state.awaitPos = -1;
+ const params = [this.parseIdentifier()];
+ this.expect(types.arrow);
+ this.checkYieldAwaitInDefaultParams();
+ this.state.maybeInArrowParameters = oldMaybeInArrowParameters;
+ this.state.maybeInAsyncArrowHead = oldMaybeInAsyncArrowHead;
+ this.state.yieldPos = oldYieldPos;
+ this.state.awaitPos = oldAwaitPos;
+ 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.bracketBarL:
+ case types.bracketHashL:
+ {
+ this.expectPlugin("recordAndTuple");
+ const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody;
+ const close = this.state.type === types.bracketBarL ? types.bracketBarR : types.bracketR;
+ this.state.inFSharpPipelineDirectBody = false;
+ node = this.startNode();
+ this.next();
+ node.elements = this.parseExprList(close, false, refExpressionErrors, node);
+ this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody;
+ return this.finishNode(node, "TupleExpression");
+ }
+
+ case types.bracketL:
+ {
+ const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody;
+ this.state.inFSharpPipelineDirectBody = false;
+ node = this.startNode();
+ this.next();
+ node.elements = this.parseExprList(types.bracketR, true, refExpressionErrors, node);
+
+ if (!this.state.maybeInArrowParameters) {
+ this.toReferencedList(node.elements);
+ }
+
+ this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody;
+ return this.finishNode(node, "ArrayExpression");
+ }
+
+ case types.braceBarL:
+ case types.braceHashL:
+ {
+ this.expectPlugin("recordAndTuple");
+ const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody;
+ const close = this.state.type === types.braceBarL ? types.braceBarR : types.braceR;
+ this.state.inFSharpPipelineDirectBody = false;
+ const ret = this.parseObj(close, false, true, refExpressionErrors);
+ this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody;
+ return ret;
+ }
+
+ case types.braceL:
+ {
+ const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody;
+ this.state.inFSharpPipelineDirectBody = false;
+ const ret = this.parseObj(types.braceR, false, false, refExpressionErrors);
+ 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, ErrorMessages.UnsupportedBind);
+ }
+ }
+
+ case types.hash:
+ {
+ if (this.state.inPipeline) {
+ node = this.startNode();
+
+ if (this.getPluginOption("pipelineOperator", "proposal") !== "smart") {
+ this.raise(node.start, ErrorMessages.PrimaryTopicRequiresSmartPipeline);
+ }
+
+ this.next();
+
+ if (!this.primaryTopicReferenceIsAllowedInCurrentTopicContext()) {
+ this.raise(node.start, ErrorMessages.PrimaryTopicNotAllowed);
+ }
+
+ this.registerTopicReference();
+ return this.finishNode(node, "PipelinePrimaryTopicReference");
+ }
+
+ const nextCh = this.input.codePointAt(this.state.end);
+
+ if (isIdentifierStart(nextCh) || nextCh === 92) {
+ const start = this.state.start;
+ node = this.parseMaybePrivateName(true);
+
+ if (this.match(types._in)) {
+ this.expectPlugin("privateIn");
+ this.classScope.usePrivateName(node.id.name, node.start);
+ } else if (this.hasPlugin("privateIn")) {
+ this.raise(this.state.start, ErrorMessages.PrivateInExpectedIn, node.id.name);
+ } else {
+ throw this.unexpected(start);
+ }
+
+ return node;
+ }
+ }
+
+ case types.relational:
+ {
+ if (this.state.value === "<") {
+ throw this.expectOnePlugin(["jsx", "flow", "typescript"]);
+ }
+ }
+
+ default:
+ throw this.unexpected();
+ }
+ }
+
+ parseBooleanLiteral() {
+ const node = this.startNode();
+ node.value = this.match(types._true);
+ this.next();
+ return this.finishNode(node, "BooleanLiteral");
+ }
+
+ parseMaybePrivateName(isPrivateNameAllowed) {
+ const isPrivate = this.match(types.hash);
+
+ if (isPrivate) {
+ this.expectOnePlugin(["classPrivateProperties", "classPrivateMethods"]);
+
+ if (!isPrivateNameAllowed) {
+ this.raise(this.state.pos, ErrorMessages.UnexpectedPrivateField);
+ }
+
+ 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.prodParam.hasYield && 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, ErrorMessages.UnsupportedMetaProperty, 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")) {
+ if (!this.inModule) {
+ this.raiseWithData(id.start, {
+ code: "BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED"
+ }, ErrorMessages.ImportMetaOutsideModule);
+ }
+
+ 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 = -1;
+ this.state.awaitPos = -1;
+ this.state.inFSharpPipelineDirectBody = false;
+ const innerStartPos = this.state.start;
+ const innerStartLoc = this.state.startLoc;
+ const exprList = [];
+ const refExpressionErrors = new ExpressionErrors();
+ 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(41);
+ break;
+ } else {
+ exprList.push(this.parseMaybeAssign(false, refExpressionErrors, 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))) {
+ if (!this.isAwaitAllowed() && !this.state.maybeInAsyncArrowHead) {
+ this.state.awaitPos = oldAwaitPos;
+ }
+
+ this.checkYieldAwaitInDefaultParams();
+ this.state.yieldPos = oldYieldPos;
+ this.state.awaitPos = oldAwaitPos;
+
+ for (let _i2 = 0; _i2 < exprList.length; _i2++) {
+ const param = exprList[_i2];
+
+ if (param.extra && param.extra.parenthesized) {
+ this.unexpected(param.extra.parenStart);
+ }
+ }
+
+ this.parseArrowExpression(arrowNode, exprList, false);
+ return arrowNode;
+ }
+
+ if (oldYieldPos !== -1) this.state.yieldPos = oldYieldPos;
+ if (oldAwaitPos !== -1) this.state.awaitPos = oldAwaitPos;
+
+ if (!exprList.length) {
+ this.unexpected(this.state.lastTokStart);
+ }
+
+ if (optionalCommaStart) this.unexpected(optionalCommaStart);
+ if (spreadStart) this.unexpected(spreadStart);
+ this.checkExpressionErrors(refExpressionErrors, true);
+ 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();
+ let meta = this.startNode();
+ this.next();
+ meta = this.createIdentifier(meta, "new");
+
+ if (this.eat(types.dot)) {
+ const metaProp = this.parseMetaProperty(node, meta, "target");
+
+ if (!this.scope.inNonArrowFunction && !this.scope.inClass) {
+ let error = ErrorMessages.UnexpectedNewTarget;
+
+ 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, ErrorMessages.ImportCallNotNewExpression);
+ } else if (node.callee.type === "OptionalMemberExpression" || node.callee.type === "OptionalCallExpression") {
+ this.raise(this.state.lastTokEnd, ErrorMessages.OptionalChainingNoNew);
+ } else if (this.eat(types.questionDot)) {
+ this.raise(this.state.start, ErrorMessages.OptionalChainingNoNew);
+ }
+
+ 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.start + 1, ErrorMessages.InvalidEscapeSequenceTemplate);
+ }
+ }
+
+ 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(close, isPattern, isRecord, refExpressionErrors) {
+ const propHash = Object.create(null);
+ let first = true;
+ const node = this.startNode();
+ node.properties = [];
+ this.next();
+
+ while (!this.eat(close)) {
+ if (first) {
+ first = false;
+ } else {
+ this.expect(types.comma);
+
+ if (this.match(close)) {
+ this.addExtra(node, "trailingComma", this.state.lastTokStart);
+ this.next();
+ break;
+ }
+ }
+
+ const prop = this.parseObjectMember(isPattern, refExpressionErrors);
+
+ if (!isPattern) {
+ this.checkProto(prop, isRecord, propHash, refExpressionErrors);
+ }
+
+ if (isRecord && prop.type !== "ObjectProperty" && prop.type !== "SpreadElement") {
+ this.raise(prop.start, ErrorMessages.InvalidRecordProperty);
+ }
+
+ if (prop.shorthand) {
+ this.addExtra(prop, "shorthand", true);
+ }
+
+ node.properties.push(prop);
+ }
+
+ let type = "ObjectExpression";
+
+ if (isPattern) {
+ type = "ObjectPattern";
+ } else if (isRecord) {
+ type = "RecordExpression";
+ }
+
+ return this.finishNode(node, type);
+ }
+
+ isAsyncProp(prop) {
+ return !prop.computed && prop.key.type === "Identifier" && prop.key.name === "async" && (this.isLiteralPropertyName() || this.match(types.bracketL) || this.match(types.star)) && !this.hasPrecedingLineBreak();
+ }
+
+ parseObjectMember(isPattern, refExpressionErrors) {
+ let decorators = [];
+
+ if (this.match(types.at)) {
+ if (this.hasPlugin("decorators")) {
+ this.raise(this.state.start, ErrorMessages.UnsupportedPropertyDecorator);
+ }
+
+ 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(125);
+ return this.finishNode(prop, "RestElement");
+ }
+
+ return this.parseSpread();
+ }
+
+ if (decorators.length) {
+ prop.decorators = decorators;
+ decorators = [];
+ }
+
+ prop.method = false;
+
+ if (isPattern || refExpressionErrors) {
+ startPos = this.state.start;
+ startLoc = this.state.startLoc;
+ }
+
+ if (!isPattern) {
+ isGenerator = this.eat(types.star);
+ }
+
+ const containsEsc = this.state.containsEsc;
+ this.parsePropertyName(prop, false);
+
+ if (!isPattern && !containsEsc && !isGenerator && this.isAsyncProp(prop)) {
+ isAsync = true;
+ isGenerator = this.eat(types.star);
+ this.parsePropertyName(prop, false);
+ } else {
+ isAsync = false;
+ }
+
+ this.parseObjPropValue(prop, startPos, startLoc, isGenerator, isAsync, isPattern, refExpressionErrors, containsEsc);
+ return prop;
+ }
+
+ isGetterOrSetterMethod(prop, isPattern) {
+ return !isPattern && !prop.computed && prop.key.type === "Identifier" && (prop.key.name === "get" || prop.key.name === "set") && (this.isLiteralPropertyName() || this.match(types.bracketL));
+ }
+
+ 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, ErrorMessages.BadGetterArity);
+ } else {
+ this.raise(start, ErrorMessages.BadSetterArity);
+ }
+ }
+
+ if (method.kind === "set" && method.params[method.params.length - 1].type === "RestElement") {
+ this.raise(start, ErrorMessages.BadSetterRestParameter);
+ }
+ }
+
+ 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, false);
+ this.parseMethod(prop, false, false, false, false, "ObjectMethod");
+ this.checkGetterSetterParams(prop);
+ return prop;
+ }
+ }
+
+ parseObjectProperty(prop, startPos, startLoc, isPattern, refExpressionErrors) {
+ prop.shorthand = false;
+
+ if (this.eat(types.colon)) {
+ prop.value = isPattern ? this.parseMaybeDefault(this.state.start, this.state.startLoc) : this.parseMaybeAssign(false, refExpressionErrors);
+ 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) && refExpressionErrors) {
+ if (refExpressionErrors.shorthandAssign === -1) {
+ refExpressionErrors.shorthandAssign = 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, refExpressionErrors, containsEsc) {
+ const node = this.parseObjectMethod(prop, isGenerator, isAsync, isPattern, containsEsc) || this.parseObjectProperty(prop, startPos, startLoc, isPattern, refExpressionErrors);
+ if (!node) this.unexpected();
+ return node;
+ }
+
+ parsePropertyName(prop, isPrivateNameAllowed) {
+ 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.match(types.bigint) ? this.parseExprAtom() : this.parseMaybePrivateName(isPrivateNameAllowed);
+
+ 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 = -1;
+ this.state.awaitPos = -1;
+ this.initFunction(node, isAsync);
+ node.generator = !!isGenerator;
+ const allowModifiers = isConstructor;
+ this.scope.enter(SCOPE_FUNCTION | SCOPE_SUPER | (inClassScope ? SCOPE_CLASS : 0) | (allowDirectSuper ? SCOPE_DIRECT_SUPER : 0));
+ this.prodParam.enter(functionFlags(isAsync, node.generator));
+ this.parseFunctionParams(node, allowModifiers);
+ this.parseFunctionBodyAndFinish(node, type, true);
+ this.prodParam.exit();
+ this.scope.exit();
+ this.state.yieldPos = oldYieldPos;
+ this.state.awaitPos = oldAwaitPos;
+ return node;
+ }
+
+ parseArrowExpression(node, params, isAsync, trailingCommaPos) {
+ this.scope.enter(SCOPE_FUNCTION | SCOPE_ARROW);
+ this.prodParam.enter(functionFlags(isAsync, false));
+ this.initFunction(node, isAsync);
+ const oldMaybeInArrowParameters = this.state.maybeInArrowParameters;
+ const oldYieldPos = this.state.yieldPos;
+ const oldAwaitPos = this.state.awaitPos;
+
+ if (params) {
+ this.state.maybeInArrowParameters = true;
+ this.setArrowFunctionParameters(node, params, trailingCommaPos);
+ }
+
+ this.state.maybeInArrowParameters = false;
+ this.state.yieldPos = -1;
+ this.state.awaitPos = -1;
+ this.parseFunctionBody(node, true);
+ this.prodParam.exit();
+ this.scope.exit();
+ this.state.maybeInArrowParameters = oldMaybeInArrowParameters;
+ this.state.yieldPos = oldYieldPos;
+ this.state.awaitPos = oldAwaitPos;
+ return this.finishNode(node, "ArrowFunctionExpression");
+ }
+
+ setArrowFunctionParameters(node, params, trailingCommaPos) {
+ node.params = this.toAssignableList(params, trailingCommaPos);
+ }
+
+ 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 oldInParameters = this.state.inParameters;
+ this.state.inParameters = false;
+
+ if (isExpression) {
+ node.body = this.parseMaybeAssign();
+ this.checkParams(node, false, allowExpression, false);
+ } else {
+ const oldStrict = this.state.strict;
+ const oldLabels = this.state.labels;
+ this.state.labels = [];
+ this.prodParam.enter(this.prodParam.currentFlags() | PARAM_RETURN);
+ node.body = this.parseBlock(true, false, hasStrictModeDirective => {
+ const nonSimple = !this.isSimpleParamList(node.params);
+
+ if (hasStrictModeDirective && nonSimple) {
+ const errorPos = (node.kind === "method" || node.kind === "constructor") && !!node.key ? node.key.end : node.start;
+ this.raise(errorPos, ErrorMessages.IllegalLanguageModeDirective);
+ }
+
+ const strictModeChanged = !oldStrict && this.state.strict;
+ this.checkParams(node, !this.state.strict && !allowExpression && !isMethod && !nonSimple, allowExpression, strictModeChanged);
+
+ if (this.state.strict && node.id) {
+ this.checkLVal(node.id, BIND_OUTSIDE, undefined, "function name", undefined, strictModeChanged);
+ }
+ });
+ this.prodParam.exit();
+ this.state.labels = oldLabels;
+ }
+
+ this.state.inParameters = oldInParameters;
+ }
+
+ 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, strictModeChanged = true) {
+ 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 parameter list", undefined, strictModeChanged);
+ }
+ }
+
+ parseExprList(close, allowEmpty, refExpressionErrors, nodeForExtra) {
+ const elts = [];
+ let first = true;
+
+ while (!this.eat(close)) {
+ if (first) {
+ first = false;
+ } else {
+ this.expect(types.comma);
+
+ if (this.match(close)) {
+ if (nodeForExtra) {
+ this.addExtra(nodeForExtra, "trailingComma", this.state.lastTokStart);
+ }
+
+ this.next();
+ break;
+ }
+ }
+
+ elts.push(this.parseExprListItem(allowEmpty, refExpressionErrors));
+ }
+
+ return elts;
+ }
+
+ parseExprListItem(allowEmpty, refExpressionErrors, refNeedsArrowPos, allowPlaceholder) {
+ let elt;
+
+ if (this.match(types.comma)) {
+ if (!allowEmpty) {
+ this.raise(this.state.pos, ErrorMessages.UnexpectedToken, ",");
+ }
+
+ elt = null;
+ } else if (this.match(types.ellipsis)) {
+ const spreadNodeStartPos = this.state.start;
+ const spreadNodeStartLoc = this.state.startLoc;
+ elt = this.parseParenItem(this.parseSpread(refExpressionErrors, refNeedsArrowPos), spreadNodeStartPos, spreadNodeStartLoc);
+ } else if (this.match(types.question)) {
+ this.expectPlugin("partialApplication");
+
+ if (!allowPlaceholder) {
+ this.raise(this.state.start, ErrorMessages.UnexpectedArgumentPlaceholder);
+ }
+
+ const node = this.startNode();
+ this.next();
+ elt = this.finishNode(node, "ArgumentPlaceholder");
+ } else {
+ elt = this.parseMaybeAssign(false, refExpressionErrors, 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;
+ const context = this.state.context;
+
+ if ((name === "class" || name === "function") && context[context.length - 1].token === "function") {
+ context.pop();
+ }
+ } else {
+ throw this.unexpected();
+ }
+
+ if (liberal) {
+ this.state.type = types.name;
+ } else {
+ this.checkReservedWord(name, this.state.start, !!this.state.type.keyword, false);
+ }
+
+ this.next();
+ return name;
+ }
+
+ checkReservedWord(word, startLoc, checkKeywords, isBinding) {
+ if (this.prodParam.hasYield && word === "yield") {
+ this.raise(startLoc, ErrorMessages.YieldBindingIdentifier);
+ return;
+ }
+
+ if (word === "await") {
+ if (this.prodParam.hasAwait) {
+ this.raise(startLoc, ErrorMessages.AwaitBindingIdentifier);
+ return;
+ }
+
+ if (this.state.awaitPos === -1 && (this.state.maybeInAsyncArrowHead || this.isAwaitAllowed())) {
+ this.state.awaitPos = this.state.start;
+ }
+ }
+
+ if (this.scope.inClass && !this.scope.inNonArrowFunction && word === "arguments") {
+ this.raise(startLoc, ErrorMessages.ArgumentsDisallowedInInitializer);
+ return;
+ }
+
+ if (checkKeywords && isKeyword(word)) {
+ this.raise(startLoc, ErrorMessages.UnexpectedKeyword, word);
+ return;
+ }
+
+ const reservedTest = !this.state.strict ? isReservedWord : isBinding ? isStrictBindReservedWord : isStrictReservedWord;
+
+ if (reservedTest(word, this.inModule)) {
+ if (!this.prodParam.hasAwait && word === "await") {
+ this.raise(startLoc, ErrorMessages.AwaitNotInAsyncFunction);
+ } else {
+ this.raise(startLoc, ErrorMessages.UnexpectedReservedWord, word);
+ }
+ }
+ }
+
+ isAwaitAllowed() {
+ if (this.scope.inFunction) return this.prodParam.hasAwait;
+ if (this.options.allowAwaitOutsideFunction) return true;
+
+ if (this.hasPlugin("topLevelAwait")) {
+ return this.inModule && this.prodParam.hasAwait;
+ }
+
+ return false;
+ }
+
+ parseAwait() {
+ const node = this.startNode();
+ this.next();
+
+ if (this.state.inParameters) {
+ this.raise(node.start, ErrorMessages.AwaitExpressionFormalParameter);
+ } else if (this.state.awaitPos === -1) {
+ this.state.awaitPos = node.start;
+ }
+
+ if (this.eat(types.star)) {
+ this.raise(node.start, ErrorMessages.ObsoleteAwaitStar);
+ }
+
+ if (!this.scope.inFunction && !this.options.allowAwaitOutsideFunction) {
+ if (this.hasPrecedingLineBreak() || this.match(types.plusMin) || this.match(types.parenL) || this.match(types.bracketL) || this.match(types.backQuote) || this.match(types.regexp) || this.match(types.slash) || this.hasPlugin("v8intrinsic") && this.match(types.modulo)) {
+ this.ambiguousScriptDifferentAst = true;
+ } else {
+ this.sawUnambiguousESM = true;
+ }
+ }
+
+ if (!this.state.soloAwait) {
+ node.argument = this.parseMaybeUnary();
+ }
+
+ return this.finishNode(node, "AwaitExpression");
+ }
+
+ parseYield(noIn) {
+ const node = this.startNode();
+
+ if (this.state.inParameters) {
+ this.raise(node.start, ErrorMessages.YieldInParameter);
+ } else if (this.state.yieldPos === -1) {
+ this.state.yieldPos = node.start;
+ }
+
+ this.next();
+
+ if (this.match(types.semi) || !this.match(types.star) && !this.state.type.startsExpr || this.hasPrecedingLineBreak()) {
+ 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") {
+ this.raise(leftStartPos, ErrorMessages.PipelineHeadSequenceExpression);
+ }
+ }
+ }
+
+ 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, ErrorMessages.PipelineBodyNoArrow);
+ } else if (pipelineStyle === "PipelineTopicExpression" && childExpression.type === "SequenceExpression") {
+ this.raise(startPos, ErrorMessages.PipelineBodySequenceExpression);
+ }
+ }
+
+ 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()) {
+ this.raise(startPos, ErrorMessages.PipelineTopicUnused);
+ }
+
+ bodyNode.expression = childExpression;
+ break;
+
+ default:
+ throw new Error(`Internal @babel/parser error: 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, ErrorMessages.ModuleExportUndefined, name);
+ }
+ }
+
+ file.program = this.finishNode(program, "Program");
+ file.comments = this.state.comments;
+ if (this.options.tokens) file.tokens = this.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;
+ }
+
+ const next = this.nextTokenStart();
+ 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.lookaheadCharCode() === 46) break;
+
+ if (context) {
+ if (this.state.strict) {
+ this.raise(this.state.start, ErrorMessages.StrictFunction);
+ } else if (context !== "if" && context !== "label") {
+ this.raise(this.state.start, ErrorMessages.SloppyFunction);
+ }
+ }
+
+ 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.raise(this.state.start, ErrorMessages.UnexpectedLexicalDeclaration);
+ }
+
+ 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 nextTokenCharCode = this.lookaheadCharCode();
+
+ if (nextTokenCharCode === 40 || nextTokenCharCode === 46) {
+ break;
+ }
+
+ if (!this.options.allowImportExportEverywhere && !topLevel) {
+ this.raise(this.state.start, ErrorMessages.UnexpectedImportExport);
+ }
+
+ 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.raise(this.state.start, ErrorMessages.AsyncFunctionInSingleStatementContext);
+ }
+
+ 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.raiseWithData(node.start, {
+ code: "BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED"
+ }, ErrorMessages.ImportOutsideModule);
+ }
+ }
+
+ 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, ErrorMessages.DecoratorExportClass);
+ }
+ } else if (!this.canHaveLeadingDecorator()) {
+ throw this.raise(this.state.start, ErrorMessages.UnexpectedLeadingDecorator);
+ }
+ }
+
+ 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, ErrorMessages.IllegalBreakContinue, 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.isAwaitAllowed() && 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 refExpressionErrors = new ExpressionErrors();
+ const init = this.parseExpression(true, refExpressionErrors);
+
+ if (this.match(types._in) || this.isContextual("of")) {
+ this.toAssignable(init);
+ const description = this.isContextual("of") ? "for-of statement" : "for-in statement";
+ this.checkLVal(init, undefined, undefined, description);
+ return this.parseForIn(node, init, awaitAt);
+ } else {
+ this.checkExpressionErrors(refExpressionErrors, true);
+ }
+
+ 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.prodParam.hasReturn && !this.options.allowReturnOutsideFunction) {
+ this.raise(this.state.start, ErrorMessages.IllegalReturn);
+ }
+
+ 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, ErrorMessages.MultipleDefaultsInSwitch);
+ }
+
+ 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, ErrorMessages.NewlineAfterThrow);
+ }
+
+ 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, ErrorMessages.NoCatchOrFinally);
+ }
+
+ 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, ErrorMessages.StrictWith);
+ }
+
+ 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, ErrorMessages.LabelRedeclaration, maybeName);
+ }
+ }
+
+ 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, afterBlockParse) {
+ const node = this.startNode();
+ this.expect(types.braceL);
+
+ if (createNewLexicalScope) {
+ this.scope.enter(SCOPE_OTHER);
+ }
+
+ this.parseBlockBody(node, allowDirectives, false, types.braceR, afterBlockParse);
+
+ 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, afterBlockParse) {
+ const body = node.body = [];
+ const directives = node.directives = [];
+ this.parseBlockOrModuleBlockBody(body, allowDirectives ? directives : undefined, topLevel, end, afterBlockParse);
+ }
+
+ parseBlockOrModuleBlockBody(body, directives, topLevel, end, afterBlockParse) {
+ const octalPositions = [];
+ const oldStrict = this.state.strict;
+ let hasStrictModeDirective = false;
+ let parsedNonDirective = false;
+
+ while (!this.match(end)) {
+ if (!parsedNonDirective && this.state.octalPositions.length) {
+ octalPositions.push(...this.state.octalPositions);
+ }
+
+ const stmt = this.parseStatement(null, topLevel);
+
+ if (directives && !parsedNonDirective && this.isValidDirective(stmt)) {
+ const directive = this.stmtToDirective(stmt);
+ directives.push(directive);
+
+ if (!hasStrictModeDirective && directive.value.value === "use strict") {
+ hasStrictModeDirective = true;
+ this.setStrict(true);
+ }
+
+ continue;
+ }
+
+ parsedNonDirective = true;
+ body.push(stmt);
+ }
+
+ if (this.state.strict && octalPositions.length) {
+ for (let _i3 = 0; _i3 < octalPositions.length; _i3++) {
+ const pos = octalPositions[_i3];
+ this.raise(pos, ErrorMessages.StrictOctalLiteral);
+ }
+ }
+
+ if (afterBlockParse) {
+ afterBlockParse.call(this, hasStrictModeDirective);
+ }
+
+ if (!oldStrict) {
+ this.setStrict(false);
+ }
+
+ this.next();
+ }
+
+ 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, ErrorMessages.ForInOfLoopInitializer, isForIn ? "for-in" : "for-of");
+ } else if (init.type === "AssignmentPattern") {
+ this.raise(init.start, ErrorMessages.InvalidLhs, "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, ErrorMessages.DeclarationMissingInitializer, "Complex binding patterns");
+ }
+
+ 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", kind !== "var");
+ }
+
+ 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.raise(this.state.start, ErrorMessages.GeneratorInSingleStatementContext);
+ }
+
+ node.generator = this.eat(types.star);
+
+ if (isStatement) {
+ node.id = this.parseFunctionId(requireId);
+ }
+
+ const oldMaybeInArrowParameters = this.state.maybeInArrowParameters;
+ const oldYieldPos = this.state.yieldPos;
+ const oldAwaitPos = this.state.awaitPos;
+ this.state.maybeInArrowParameters = false;
+ this.state.yieldPos = -1;
+ this.state.awaitPos = -1;
+ this.scope.enter(SCOPE_FUNCTION);
+ this.prodParam.enter(functionFlags(isAsync, node.generator));
+
+ if (!isStatement) {
+ node.id = this.parseFunctionId();
+ }
+
+ this.parseFunctionParams(node);
+ this.withTopicForbiddingContext(() => {
+ this.parseFunctionBodyAndFinish(node, isStatement ? "FunctionDeclaration" : "FunctionExpression");
+ });
+ this.prodParam.exit();
+ this.scope.exit();
+
+ if (isStatement && !isHangingStatement) {
+ this.registerFunctionStatementId(node);
+ }
+
+ this.state.maybeInArrowParameters = oldMaybeInArrowParameters;
+ 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, 41, false, allowModifiers);
+ this.state.inParameters = oldInParameters;
+ this.checkYieldAwaitInDefaultParams();
+ }
+
+ registerFunctionStatementId(node) {
+ if (!node.id) return;
+ this.scope.declareName(node.id.name, this.state.strict || node.generator || node.async ? this.scope.treatFunctionsAsVar ? BIND_VAR : BIND_LEXICAL : BIND_FUNCTION, node.id.start);
+ }
+
+ 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, oldStrict);
+ 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, oldStrict) {
+ this.classScope.enter();
+ const state = {
+ hadConstructor: false
+ };
+ let decorators = [];
+ const classBody = this.startNode();
+ classBody.body = [];
+ this.expect(types.braceL);
+ this.withTopicForbiddingContext(() => {
+ while (!this.match(types.braceR)) {
+ if (this.eat(types.semi)) {
+ if (decorators.length > 0) {
+ throw this.raise(this.state.lastTokEnd, ErrorMessages.DecoratorSemicolon);
+ }
+
+ 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, ErrorMessages.DecoratorConstructor);
+ }
+ }
+ });
+
+ if (!oldStrict) {
+ this.state.strict = false;
+ }
+
+ this.next();
+
+ if (decorators.length) {
+ throw this.raise(this.state.start, ErrorMessages.TrailingDecorator);
+ }
+
+ this.classScope.exit();
+ return this.finishNode(classBody, "ClassBody");
+ }
+
+ parseClassMemberFromModifier(classBody, member) {
+ const containsEsc = this.state.containsEsc;
+ 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 true;
+ } else if (this.isClassProperty()) {
+ const prop = member;
+ prop.computed = false;
+ prop.key = key;
+ prop.static = false;
+ classBody.body.push(this.parseClassProperty(prop));
+ return true;
+ } else if (containsEsc) {
+ throw this.unexpected();
+ }
+
+ return false;
+ }
+
+ parseClassMember(classBody, member, state, constructorAllowsSuper) {
+ const isStatic = this.isContextual("static");
+
+ if (isStatic && this.parseClassMemberFromModifier(classBody, member)) {
+ return;
+ }
+
+ 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, ErrorMessages.ConstructorIsGenerator);
+ }
+
+ 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";
+ const maybeQuestionTokenStart = this.state.start;
+ 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 (state.hadConstructor && !this.hasPlugin("typescript")) {
+ this.raise(key.start, ErrorMessages.DuplicateConstructor);
+ }
+
+ 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);
+
+ if (publicMember.optional) {
+ this.unexpected(maybeQuestionTokenStart);
+ }
+
+ method.kind = "method";
+ this.parseClassPropertyName(method);
+ this.parsePostMemberNameModifiers(publicMember);
+
+ if (method.key.type === "PrivateName") {
+ this.pushClassPrivateMethod(classBody, privateMethod, isGenerator, true);
+ } else {
+ if (this.isNonstaticConstructor(publicMethod)) {
+ this.raise(publicMethod.key.start, ErrorMessages.ConstructorIsAsync);
+ }
+
+ 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, ErrorMessages.ConstructorIsAccessor);
+ }
+
+ 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, true);
+
+ if (!member.computed && member.static && (key.name === "prototype" || key.value === "prototype")) {
+ this.raise(key.start, ErrorMessages.StaticPrototype);
+ }
+
+ if (key.type === "PrivateName" && key.id.name === "constructor") {
+ this.raise(key.start, ErrorMessages.ConstructorClassPrivateField);
+ }
+
+ return key;
+ }
+
+ pushClassProperty(classBody, prop) {
+ if (!prop.computed && (prop.key.name === "constructor" || prop.key.value === "constructor")) {
+ this.raise(prop.key.start, ErrorMessages.ConstructorClassField);
+ }
+
+ classBody.body.push(this.parseClassProperty(prop));
+ }
+
+ pushClassPrivateProperty(classBody, prop) {
+ this.expectPlugin("classPrivateProperties", prop.key.start);
+ const node = this.parseClassPrivateProperty(prop);
+ classBody.body.push(node);
+ this.classScope.declarePrivateName(node.key.id.name, CLASS_ELEMENT_OTHER, node.key.start);
+ }
+
+ 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);
+ const node = this.parseMethod(method, isGenerator, isAsync, false, false, "ClassPrivateMethod", true);
+ classBody.body.push(node);
+ const kind = node.kind === "get" ? node.static ? CLASS_ELEMENT_STATIC_GETTER : CLASS_ELEMENT_INSTANCE_GETTER : node.kind === "set" ? node.static ? CLASS_ELEMENT_STATIC_SETTER : CLASS_ELEMENT_INSTANCE_SETTER : CLASS_ELEMENT_OTHER;
+ this.classScope.declarePrivateName(node.key.id.name, kind, node.key.start);
+ }
+
+ parsePostMemberNameModifiers(methodOrProp) {}
+
+ parseAccessModifier() {
+ return undefined;
+ }
+
+ parseClassPrivateProperty(node) {
+ this.scope.enter(SCOPE_CLASS | SCOPE_SUPER);
+ this.prodParam.enter(PARAM);
+ node.value = this.eat(types.eq) ? this.parseMaybeAssign() : null;
+ this.semicolon();
+ this.prodParam.exit();
+ this.scope.exit();
+ return this.finishNode(node, "ClassPrivateProperty");
+ }
+
+ parseClassProperty(node) {
+ if (!node.typeAnnotation) {
+ this.expectPlugin("classProperties");
+ }
+
+ this.scope.enter(SCOPE_CLASS | SCOPE_SUPER);
+ this.prodParam.enter(PARAM);
+
+ if (this.match(types.eq)) {
+ this.expectPlugin("classProperties");
+ this.next();
+ node.value = this.parseMaybeAssign();
+ } else {
+ node.value = null;
+ }
+
+ this.semicolon();
+ this.prodParam.exit();
+ this.scope.exit();
+ return this.finishNode(node, "ClassProperty");
+ }
+
+ parseClassId(node, isStatement, optionalId, bindingType = BIND_CLASS) {
+ if (this.match(types.name)) {
+ node.id = this.parseIdentifier();
+
+ if (isStatement) {
+ this.checkLVal(node.id, bindingType, undefined, "class name");
+ }
+ } else {
+ if (optionalId || !isStatement) {
+ node.id = null;
+ } else {
+ this.unexpected(null, ErrorMessages.MissingClassName);
+ }
+ }
+ }
+
+ 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 = [];
+ 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.nextTokenStart();
+
+ if (!this.isUnparsedContextual(next, "function")) {
+ this.unexpected(next, types._function);
+ }
+ }
+
+ node.specifiers = [];
+ node.source = null;
+ node.declaration = this.parseExportDeclaration(node);
+ return true;
+ }
+
+ return false;
+ }
+
+ isAsyncFunction() {
+ if (!this.isContextual("async")) return false;
+ const next = this.nextTokenStart();
+ return !lineBreak.test(this.input.slice(this.state.pos, next)) && this.isUnparsedContextual(next, "function");
+ }
+
+ 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.raise(this.state.start, ErrorMessages.DecoratorBeforeExport);
+ }
+
+ this.parseDecorators(false);
+ return this.parseClass(expr, true, true);
+ } else if (this.match(types._const) || this.match(types._var) || this.isLet()) {
+ throw this.raise(this.state.start, ErrorMessages.UnsupportedDefaultExport);
+ } else {
+ const res = this.parseMaybeAssign();
+ this.semicolon();
+ return res;
+ }
+ }
+
+ parseExportDeclaration(node) {
+ return this.parseStatement(null);
+ }
+
+ isExportDefaultSpecifier() {
+ if (this.match(types.name)) {
+ const value = this.state.value;
+
+ if (value === "async" || value === "let") {
+ return false;
+ }
+
+ if ((value === "type" || value === "interface") && !this.state.containsEsc) {
+ const l = this.lookahead();
+
+ if (l.type === types.name && l.value !== "from" || l.type === types.braceL) {
+ this.expectOnePlugin(["flow", "typescript"]);
+ return false;
+ }
+ }
+ } else if (!this.match(types._default)) {
+ return false;
+ }
+
+ const next = this.nextTokenStart();
+ const hasFrom = this.isUnparsedContextual(next, "from");
+
+ if (this.input.charCodeAt(next) === 44 || this.match(types.name) && hasFrom) {
+ return true;
+ }
+
+ if (this.match(types._default) && hasFrom) {
+ const nextAfterFrom = this.input.charCodeAt(this.nextTokenStartSince(next + 4));
+ return nextAfterFrom === 34 || nextAfterFrom === 39;
+ }
+
+ return false;
+ }
+
+ 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, ErrorMessages.DecoratorBeforeExport);
+ } 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");
+
+ if (this.hasPlugin("exportDefaultFrom")) {
+ var _declaration$extra;
+
+ const declaration = node.declaration;
+
+ if (declaration.type === "Identifier" && declaration.name === "from" && declaration.end - declaration.start === 4 && !((_declaration$extra = declaration.extra) == null ? void 0 : _declaration$extra.parenthesized)) {
+ this.raise(declaration.start, ErrorMessages.ExportDefaultFromAsIdentifier);
+ }
+ }
+ } else if (node.specifiers && node.specifiers.length) {
+ for (let _i4 = 0, _node$specifiers = node.specifiers; _i4 < _node$specifiers.length; _i4++) {
+ const specifier = _node$specifiers[_i4];
+ 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 _i5 = 0, _node$declaration$dec = node.declaration.declarations; _i5 < _node$declaration$dec.length; _i5++) {
+ const declaration = _node$declaration$dec[_i5];
+ 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, ErrorMessages.UnsupportedDecoratorExport);
+ }
+
+ this.takeDecorators(node.declaration);
+ }
+ }
+
+ checkDeclaration(node) {
+ if (node.type === "Identifier") {
+ this.checkDuplicateExports(node, node.name);
+ } else if (node.type === "ObjectPattern") {
+ for (let _i6 = 0, _node$properties = node.properties; _i6 < _node$properties.length; _i6++) {
+ const prop = _node$properties[_i6];
+ this.checkDeclaration(prop);
+ }
+ } else if (node.type === "ArrayPattern") {
+ for (let _i7 = 0, _node$elements = node.elements; _i7 < _node$elements.length; _i7++) {
+ const elem = _node$elements[_i7];
+
+ 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) {
+ this.raise(node.start, name === "default" ? ErrorMessages.DuplicateDefaultExport : ErrorMessages.DuplicateExport, name);
+ }
+
+ 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();
+ const attributes = this.maybeParseModuleAttributes();
+
+ if (attributes) {
+ node.attributes = attributes;
+ }
+
+ 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));
+ }
+
+ maybeParseModuleAttributes() {
+ if (this.match(types._with) && !this.hasPrecedingLineBreak()) {
+ this.expectPlugin("moduleAttributes");
+ this.next();
+ } else {
+ if (this.hasPlugin("moduleAttributes")) return [];
+ return null;
+ }
+
+ const attrs = [];
+ const attributes = new Set();
+
+ do {
+ const node = this.startNode();
+ node.key = this.parseIdentifier(true);
+
+ if (node.key.name !== "type") {
+ this.raise(node.key.start, ErrorMessages.ModuleAttributeDifferentFromType, node.key.name);
+ }
+
+ if (attributes.has(node.key.name)) {
+ this.raise(node.key.start, ErrorMessages.ModuleAttributesWithDuplicateKeys, node.key.name);
+ }
+
+ attributes.add(node.key.name);
+ this.expect(types.colon);
+
+ if (!this.match(types.string)) {
+ throw this.unexpected(this.state.start, ErrorMessages.ModuleAttributeInvalidValue);
+ }
+
+ node.value = this.parseLiteral(this.state.value, "StringLiteral");
+ this.finishNode(node, "ImportAttribute");
+ attrs.push(node);
+ } while (this.eat(types.comma));
+
+ return attrs;
+ }
+
+ 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)) {
+ throw this.raise(this.state.start, ErrorMessages.DestructureNamedImport);
+ }
+
+ 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 ClassScope {
+ constructor() {
+ this.privateNames = new Set();
+ this.loneAccessors = new Map();
+ this.undefinedPrivateNames = new Map();
+ }
+
+}
+class ClassScopeHandler {
+ constructor(raise) {
+ this.stack = [];
+ this.undefinedPrivateNames = new Map();
+ this.raise = raise;
+ }
+
+ current() {
+ return this.stack[this.stack.length - 1];
+ }
+
+ enter() {
+ this.stack.push(new ClassScope());
+ }
+
+ exit() {
+ const oldClassScope = this.stack.pop();
+ const current = this.current();
+
+ for (let _i = 0, _Array$from = Array.from(oldClassScope.undefinedPrivateNames); _i < _Array$from.length; _i++) {
+ const [name, pos] = _Array$from[_i];
+
+ if (current) {
+ if (!current.undefinedPrivateNames.has(name)) {
+ current.undefinedPrivateNames.set(name, pos);
+ }
+ } else {
+ this.raise(pos, ErrorMessages.InvalidPrivateFieldResolution, name);
+ }
+ }
+ }
+
+ declarePrivateName(name, elementType, pos) {
+ const classScope = this.current();
+ let redefined = classScope.privateNames.has(name);
+
+ if (elementType & CLASS_ELEMENT_KIND_ACCESSOR) {
+ const accessor = redefined && classScope.loneAccessors.get(name);
+
+ if (accessor) {
+ const oldStatic = accessor & CLASS_ELEMENT_FLAG_STATIC;
+ const newStatic = elementType & CLASS_ELEMENT_FLAG_STATIC;
+ const oldKind = accessor & CLASS_ELEMENT_KIND_ACCESSOR;
+ const newKind = elementType & CLASS_ELEMENT_KIND_ACCESSOR;
+ redefined = oldKind === newKind || oldStatic !== newStatic;
+ if (!redefined) classScope.loneAccessors.delete(name);
+ } else if (!redefined) {
+ classScope.loneAccessors.set(name, elementType);
+ }
+ }
+
+ if (redefined) {
+ this.raise(pos, ErrorMessages.PrivateNameRedeclaration, name);
+ }
+
+ classScope.privateNames.add(name);
+ classScope.undefinedPrivateNames.delete(name);
+ }
+
+ usePrivateName(name, pos) {
+ let classScope;
+
+ for (let _i2 = 0, _this$stack = this.stack; _i2 < _this$stack.length; _i2++) {
+ classScope = _this$stack[_i2];
+ if (classScope.privateNames.has(name)) return;
+ }
+
+ if (classScope) {
+ classScope.undefinedPrivateNames.set(name, pos);
+ } else {
+ this.raise(pos, ErrorMessages.InvalidPrivateFieldResolution, name);
+ }
+ }
+
+}
+
+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.prodParam = new ProductionParameterHandler();
+ this.classScope = new ClassScopeHandler(this.raise.bind(this));
+ this.plugins = pluginsMap(this.options.plugins);
+ this.filename = options.sourceFilename;
+ }
+
+ getScopeHandler() {
+ return ScopeHandler;
+ }
+
+ parse() {
+ let paramFlags = PARAM;
+
+ if (this.hasPlugin("topLevelAwait") && this.inModule) {
+ paramFlags |= PARAM_AWAIT;
+ }
+
+ this.scope.enter(SCOPE_PROGRAM);
+ this.prodParam.enter(paramFlags);
+ const file = this.startNode();
+ const program = this.startNode();
+ this.nextToken();
+ file.errors = null;
+ this.parseTopLevel(file, program);
+ file.errors = this.state.errors;
+ return file;
+ }
+
+}
+
+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) {
+ var _options;
+
+ if (((_options = options) == null ? void 0 : _options.sourceType) === "unambiguous") {
+ options = Object.assign({}, options);
+
+ try {
+ options.sourceType = "module";
+ const parser = getParser(options, input);
+ const ast = parser.parse();
+
+ if (parser.sawUnambiguousESM) {
+ return ast;
+ }
+
+ if (parser.ambiguousScriptDifferentAst) {
+ try {
+ options.sourceType = "script";
+ return getParser(options, input).parse();
+ } catch (_unused) {}
+ } else {
+ ast.program.sourceType = "script";
+ }
+
+ return ast;
+ } catch (moduleError) {
+ try {
+ options.sourceType = "script";
+ return getParser(options, input).parse();
+ } catch (_unused2) {}
+
+ 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 == null ? void 0 : 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;
+//# sourceMappingURL=index.js.map
+
+
+/***/ }),
+/* 686 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var baseKeys = __webpack_require__(656),
+ getTag = __webpack_require__(578),
+ isArguments = __webpack_require__(618),
+ isArray = __webpack_require__(563),
+ isArrayLike = __webpack_require__(599),
+ isBuffer = __webpack_require__(595),
+ isPrototype = __webpack_require__(598),
+ isTypedArray = __webpack_require__(621);
+
+/** `Object#toString` result references. */
+var mapTag = '[object Map]',
+ setTag = '[object Set]';
+
+/** Used for built-in method references. */
+var objectProto = Object.prototype;
+
+/** Used to check objects for own properties. */
+var hasOwnProperty = objectProto.hasOwnProperty;
+
+/**
+ * Checks if `value` is an empty object, collection, map, or set.
+ *
+ * Objects are considered empty if they have no own enumerable string keyed
+ * properties.
+ *
+ * Array-like values such as `arguments` objects, arrays, buffers, strings, or
+ * jQuery-like collections are considered empty if they have a `length` of `0`.
+ * Similarly, maps and sets are considered empty if they have a `size` of `0`.
+ *
+ * @static
+ * @memberOf _
+ * @since 0.1.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is empty, else `false`.
+ * @example
+ *
+ * _.isEmpty(null);
+ * // => true
+ *
+ * _.isEmpty(true);
+ * // => true
+ *
+ * _.isEmpty(1);
+ * // => true
+ *
+ * _.isEmpty([1, 2, 3]);
+ * // => false
+ *
+ * _.isEmpty({ 'a': 1 });
+ * // => false
+ */
+function isEmpty(value) {
+ if (value == null) {
+ return true;
+ }
+ if (isArrayLike(value) &&
+ (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||
+ isBuffer(value) || isTypedArray(value) || isArguments(value))) {
+ return !value.length;
+ }
+ var tag = getTag(value);
+ if (tag == mapTag || tag == setTag) {
+ return !value.size;
+ }
+ if (isPrototype(value)) {
+ return !baseKeys(value).length;
+ }
+ for (var key in value) {
+ if (hasOwnProperty.call(value, key)) {
+ return false;
+ }
+ }
+ return true;
+}
+
+module.exports = isEmpty;
+
+
+/***/ }),
+/* 687 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.setSource = setSource;
+exports.getSource = getSource;
+exports.clearSources = clearSources;
+
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+const cachedSources = new Map();
+
+function setSource(source) {
+ cachedSources.set(source.id, source);
+}
+
+function getSource(sourceId) {
+ const source = cachedSources.get(sourceId);
+
+ if (!source) {
+ throw new Error(`Parser: source ${sourceId} was not provided.`);
+ }
+
+ return source;
+}
+
+function clearSources() {
+ cachedSources.clear();
+}
+
+/***/ }),
+/* 688 */
+/***/ (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__(850));
+
+var parens = _interopRequireWildcard(__webpack_require__(851));
+
+var t = _interopRequireWildcard(__webpack_require__(2));
+
+function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
+
+function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } 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;
+ }
+
+ return t.isMemberExpression(node) && isOrHasCallExpression(node.object);
+}
+
+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);
+}
+
+/***/ }),
+/* 689 */
+/***/ (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.ImportAttribute = ImportAttribute;
+exports.ImportNamespaceSpecifier = ImportNamespaceSpecifier;
+
+var t = _interopRequireWildcard(__webpack_require__(2));
+
+function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
+
+function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } 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;
+
+ for (;;) {
+ 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) {
+ var _node$attributes;
+
+ 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 == null ? void 0 : specifiers.length) {
+ for (;;) {
+ 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);
+
+ if ((_node$attributes = node.attributes) == null ? void 0 : _node$attributes.length) {
+ this.space();
+ this.word("with");
+ this.space();
+ this.printList(node.attributes, node);
+ }
+
+ this.semicolon();
+}
+
+function ImportAttribute(node) {
+ this.print(node.key);
+ this.token(":");
+ this.space();
+ this.print(node.value);
+}
+
+function ImportNamespaceSpecifier(node) {
+ this.token("*");
+ this.space();
+ this.word("as");
+ this.space();
+ this.print(node.local, node);
+}
+
+/***/ }),
+/* 690 */
+/***/ (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.RecordExpression = RecordExpression;
+exports.TupleExpression = TupleExpression;
+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;
+
+var t = _interopRequireWildcard(__webpack_require__(2));
+
+var _jsesc = _interopRequireDefault(__webpack_require__(858));
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
+
+function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } 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 RecordExpression(node) {
+ const props = node.properties;
+ let startToken;
+ let endToken;
+
+ if (this.format.recordAndTupleSyntaxType === "bar") {
+ startToken = "{|";
+ endToken = "|}";
+ } else if (this.format.recordAndTupleSyntaxType === "hash") {
+ startToken = "#{";
+ endToken = "}";
+ } else {
+ throw new Error(`The "recordAndTupleSyntaxType" generator option must be "bar" or "hash" (${JSON.stringify(this.format.recordAndTupleSyntaxType)} received).`);
+ }
+
+ this.token(startToken);
+ this.printInnerComments(node);
+
+ if (props.length) {
+ this.space();
+ this.printList(props, node, {
+ indent: true,
+ statement: true
+ });
+ this.space();
+ }
+
+ this.token(endToken);
+}
+
+function TupleExpression(node) {
+ const elems = node.elements;
+ const len = elems.length;
+ let startToken;
+ let endToken;
+
+ if (this.format.recordAndTupleSyntaxType === "bar") {
+ startToken = "[|";
+ endToken = "|]";
+ } else if (this.format.recordAndTupleSyntaxType === "hash") {
+ startToken = "#[";
+ endToken = "]";
+ } else {
+ throw new Error(`${this.format.recordAndTupleSyntaxType} is not a valid recordAndTuple syntax type`);
+ }
+
+ this.token(startToken);
+ 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(",");
+ }
+ }
+
+ this.token(endToken);
+}
+
+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 opts = this.format.jsescOption;
+ const value = node.value + "";
+
+ if (opts.numbers) {
+ this.number((0, _jsesc.default)(node.value, opts));
+ } else 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 + "n");
+}
+
+function PipelineTopicExpression(node) {
+ this.print(node.expression, node);
+}
+
+function PipelineBareFunction(node) {
+ this.print(node.callee, node);
+}
+
+function PipelinePrimaryTopicReference() {
+ this.token("#");
+}
+
+/***/ }),
+/* 691 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = getFunctionName;
+
+var t = _interopRequireWildcard(__webpack_require__(2));
+
+function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
+
+function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
+
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+// Perform ES6's anonymous function name inference for all
+// locations where static analysis is possible.
+// eslint-disable-next-line complexity
+function getFunctionName(node, parent) {
+ if (t.isIdentifier(node.id)) {
+ return node.id.name;
+ }
+
+ if (t.isObjectMethod(node, {
+ computed: false
+ }) || t.isClassMethod(node, {
+ computed: false
+ })) {
+ const {
+ key
+ } = node;
+
+ if (t.isIdentifier(key)) {
+ return key.name;
+ }
+
+ if (t.isStringLiteral(key)) {
+ return key.value;
+ }
+
+ if (t.isNumericLiteral(key)) {
+ return `${key.value}`;
+ }
+ }
+
+ if (t.isObjectProperty(parent, {
+ computed: false,
+ value: node
+ }) || // TODO: Babylon 6 doesn't support computed class props. It is included
+ // here so that it is most flexible. Once Babylon 7 is used, this
+ // can change to use computed: false like ObjectProperty.
+ t.isClassProperty(parent, {
+ value: node
+ }) && !parent.computed) {
+ const {
+ key
+ } = parent;
+
+ if (t.isIdentifier(key)) {
+ return key.name;
+ }
+
+ if (t.isStringLiteral(key)) {
+ return key.value;
+ }
+
+ if (t.isNumericLiteral(key)) {
+ return `${key.value}`;
+ }
+ }
+
+ if (t.isAssignmentExpression(parent, {
+ operator: "=",
+ right: node
+ })) {
+ if (t.isIdentifier(parent.left)) {
+ return parent.left.name;
+ } // This case is not supported in standard ES6 name inference, but it
+ // is included here since it is still a helpful case during debugging.
+
+
+ if (t.isMemberExpression(parent.left, {
+ computed: false
+ })) {
+ return parent.left.property.name;
+ }
+ }
+
+ if (t.isAssignmentPattern(parent, {
+ right: node
+ }) && t.isIdentifier(parent.left)) {
+ return parent.left.name;
+ }
+
+ if (t.isVariableDeclarator(parent, {
+ init: node
+ }) && t.isIdentifier(parent.id)) {
+ return parent.id.name;
+ }
+
+ if (t.isExportDefaultDeclaration(parent, {
+ declaration: node
+ }) && t.isFunctionDeclaration(node)) {
+ return "default";
+ }
+
+ return "anonymous";
+}
+
+/***/ }),
+/* 692 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = getScopes;
+exports.clearScopes = clearScopes;
+Object.defineProperty(exports, "buildScopeList", {
+ enumerable: true,
+ get: function () {
+ return _visitor.buildScopeList;
+ }
+});
+
+var _visitor = __webpack_require__(869);
+
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+let parsedScopesCache = new Map();
+
+function getScopes(location) {
+ const {
+ sourceId
+ } = location;
+ let parsedScopes = parsedScopesCache.get(sourceId);
+
+ if (!parsedScopes) {
+ parsedScopes = (0, _visitor.parseSourceScopes)(sourceId);
+ parsedScopesCache.set(sourceId, parsedScopes);
+ }
+
+ return parsedScopes ? findScopes(parsedScopes, location) : [];
+}
+
+function clearScopes() {
+ parsedScopesCache = new Map();
+}
+
+/**
+ * Searches all scopes and their bindings at the specific location.
+ */
+function findScopes(scopes, location) {
+ // Find inner most in the tree structure.
+ let searchInScopes = scopes;
+ const found = [];
+
+ while (searchInScopes) {
+ const foundOne = searchInScopes.some(s => {
+ if (compareLocations(s.start, location) <= 0 && compareLocations(location, s.end) < 0) {
+ // Found the next scope, trying to search recusevly in its children.
+ found.unshift(s);
+ searchInScopes = s.children;
+ return true;
+ }
+
+ return false;
+ });
+
+ if (!foundOne) {
+ break;
+ }
+ }
+
+ return found.map(i => ({
+ type: i.type,
+ scopeKind: i.scopeKind,
+ displayName: i.displayName,
+ start: i.start,
+ end: i.end,
+ bindings: i.bindings
+ }));
+}
+
+function compareLocations(a, b) {
+ // According to type of Location.column can be undefined, if will not be the
+ // case here, ignoring flow error.
+ // $FlowIgnore
+ return a.line == b.line ? a.column - b.column : a.line - b.line;
+}
+
+/***/ }),
+/* 693 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var baseMatches = __webpack_require__(872),
+ baseMatchesProperty = __webpack_require__(880),
+ identity = __webpack_require__(888),
+ isArray = __webpack_require__(563),
+ property = __webpack_require__(889);
+
+/**
+ * The base implementation of `_.iteratee`.
+ *
+ * @private
+ * @param {*} [value=_.identity] The value to convert to an iteratee.
+ * @returns {Function} Returns the iteratee.
+ */
+function baseIteratee(value) {
+ // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
+ // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
+ if (typeof value == 'function') {
+ return value;
+ }
+ if (value == null) {
+ return identity;
+ }
+ if (typeof value == 'object') {
+ return isArray(value)
+ ? baseMatchesProperty(value[0], value[1])
+ : baseMatches(value);
+ }
+ return property(value);
+}
+
+module.exports = baseIteratee;
+
+
+/***/ }),
+/* 694 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var baseIsEqualDeep = __webpack_require__(874),
+ isObjectLike = __webpack_require__(565);
+
+/**
+ * The base implementation of `_.isEqual` which supports partial comparisons
+ * and tracks traversed objects.
+ *
+ * @private
+ * @param {*} value The value to compare.
+ * @param {*} other The other value to compare.
+ * @param {boolean} bitmask The bitmask flags.
+ * 1 - Unordered comparison
+ * 2 - Partial comparison
+ * @param {Function} [customizer] The function to customize comparisons.
+ * @param {Object} [stack] Tracks traversed `value` and `other` objects.
+ * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
+ */
+function baseIsEqual(value, other, bitmask, customizer, stack) {
+ if (value === other) {
+ return true;
+ }
+ if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {
+ return value !== value && other !== other;
+ }
+ return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
+}
+
+module.exports = baseIsEqual;
+
+
+/***/ }),
+/* 695 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var SetCache = __webpack_require__(673),
+ arraySome = __webpack_require__(875),
+ cacheHas = __webpack_require__(674);
+
+/** Used to compose bitmasks for value comparisons. */
+var COMPARE_PARTIAL_FLAG = 1,
+ COMPARE_UNORDERED_FLAG = 2;
+
+/**
+ * A specialized version of `baseIsEqualDeep` for arrays with support for
+ * partial deep comparisons.
+ *
+ * @private
+ * @param {Array} array The array to compare.
+ * @param {Array} other The other array to compare.
+ * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
+ * @param {Function} customizer The function to customize comparisons.
+ * @param {Function} equalFunc The function to determine equivalents of values.
+ * @param {Object} stack Tracks traversed `array` and `other` objects.
+ * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
+ */
+function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
+ var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
+ arrLength = array.length,
+ othLength = other.length;
+
+ if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
+ return false;
+ }
+ // Assume cyclic values are equal.
+ var stacked = stack.get(array);
+ if (stacked && stack.get(other)) {
+ return stacked == other;
+ }
+ var index = -1,
+ result = true,
+ seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;
+
+ stack.set(array, other);
+ stack.set(other, array);
+
+ // Ignore non-index properties.
+ while (++index < arrLength) {
+ var arrValue = array[index],
+ othValue = other[index];
+
+ if (customizer) {
+ var compared = isPartial
+ ? customizer(othValue, arrValue, index, other, array, stack)
+ : customizer(arrValue, othValue, index, array, other, stack);
+ }
+ if (compared !== undefined) {
+ if (compared) {
+ continue;
+ }
+ result = false;
+ break;
+ }
+ // Recursively compare arrays (susceptible to call stack limits).
+ if (seen) {
+ if (!arraySome(other, function(othValue, othIndex) {
+ if (!cacheHas(seen, othIndex) &&
+ (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
+ return seen.push(othIndex);
+ }
+ })) {
+ result = false;
+ break;
+ }
+ } else if (!(
+ arrValue === othValue ||
+ equalFunc(arrValue, othValue, bitmask, customizer, stack)
+ )) {
+ result = false;
+ break;
+ }
+ }
+ stack['delete'](array);
+ stack['delete'](other);
+ return result;
+}
+
+module.exports = equalArrays;
+
+
+/***/ }),
+/* 696 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var isObject = __webpack_require__(573);
+
+/**
+ * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` if suitable for strict
+ * equality comparisons, else `false`.
+ */
+function isStrictComparable(value) {
+ return value === value && !isObject(value);
+}
+
+module.exports = isStrictComparable;
+
+
+/***/ }),
+/* 697 */
+/***/ (function(module, exports) {
+
+/**
+ * A specialized version of `matchesProperty` for source values suitable
+ * for strict equality comparisons, i.e. `===`.
+ *
+ * @private
+ * @param {string} key The key of the property to get.
+ * @param {*} srcValue The value to match.
+ * @returns {Function} Returns the new spec function.
+ */
+function matchesStrictComparable(key, srcValue) {
+ return function(object) {
+ if (object == null) {
+ return false;
+ }
+ return object[key] === srcValue &&
+ (srcValue !== undefined || (key in Object(object)));
+ };
+}
+
+module.exports = matchesStrictComparable;
+
+
+/***/ }),
+/* 698 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var castPath = __webpack_require__(699),
+ toKey = __webpack_require__(606);
+
+/**
+ * The base implementation of `_.get` without support for default values.
+ *
+ * @private
+ * @param {Object} object The object to query.
+ * @param {Array|string} path The path of the property to get.
+ * @returns {*} Returns the resolved value.
+ */
+function baseGet(object, path) {
+ path = castPath(path, object);
+
+ var index = 0,
+ length = path.length;
+
+ while (object != null && index < length) {
+ object = object[toKey(path[index++])];
+ }
+ return (index && index == length) ? object : undefined;
+}
+
+module.exports = baseGet;
+
+
+/***/ }),
+/* 699 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var isArray = __webpack_require__(563),
+ isKey = __webpack_require__(641),
+ stringToPath = __webpack_require__(882),
+ toString = __webpack_require__(605);
+
+/**
+ * Casts `value` to a path array if it's not one.
+ *
+ * @private
+ * @param {*} value The value to inspect.
+ * @param {Object} [object] The object to query keys on.
+ * @returns {Array} Returns the cast property path array.
+ */
+function castPath(value, object) {
+ if (isArray(value)) {
+ return value;
+ }
+ return isKey(value, object) ? [value] : stringToPath(toString(value));
+}
+
+module.exports = castPath;
+
+
+/***/ }),
+/* 700 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.containsPosition = containsPosition;
+exports.containsLocation = containsLocation;
+exports.nodeContainsPosition = nodeContainsPosition;
+
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+function startsBefore(a, b) {
+ let before = a.start.line < b.line;
+
+ if (a.start.line === b.line) {
+ before = a.start.column >= 0 && b.column >= 0 ? a.start.column <= b.column : true;
+ }
+
+ return before;
+}
+
+function endsAfter(a, b) {
+ let after = a.end.line > b.line;
+
+ if (a.end.line === b.line) {
+ after = a.end.column >= 0 && b.column >= 0 ? a.end.column >= b.column : true;
+ }
+
+ return after;
+}
+
+function containsPosition(a, b) {
+ return startsBefore(a, b) && endsAfter(a, b);
+}
+
+function containsLocation(a, b) {
+ return containsPosition(a, b.start) && containsPosition(a, b.end);
+}
+
+function nodeContainsPosition(node, position) {
+ return containsPosition(node.loc, position);
+}
+
+/***/ }),
+/* 701 */,
+/* 702 */,
+/* 703 */,
+/* 704 */,
+/* 705 */,
+/* 706 */,
+/* 707 */,
+/* 708 */,
+/* 709 */,
+/* 710 */,
+/* 711 */,
+/* 712 */,
+/* 713 */
+/***/ (function(module, exports, __webpack_require__) {
+
+module.exports = __webpack_require__(714);
+
+
+/***/ }),
+/* 714 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+var _getSymbols = __webpack_require__(648);
+
+var _ast = __webpack_require__(572);
+
+var _getScopes = _interopRequireWildcard(__webpack_require__(692));
+
+var _sources = __webpack_require__(687);
+
+var _findOutOfScopeLocations = _interopRequireDefault(__webpack_require__(870));
+
+var _steps = __webpack_require__(893);
+
+var _validate = __webpack_require__(895);
+
+var _mapExpression = _interopRequireDefault(__webpack_require__(896));
+
+var _devtoolsUtils = __webpack_require__(560);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
+
+function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
+
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+const {
+ workerHandler
+} = _devtoolsUtils.workerUtils;
+
+function clearState() {
+ (0, _ast.clearASTs)();
+ (0, _getScopes.clearScopes)();
+ (0, _sources.clearSources)();
+ (0, _getSymbols.clearSymbols)();
+}
+
+self.onmessage = workerHandler({
+ findOutOfScopeLocations: _findOutOfScopeLocations.default,
+ getSymbols: _getSymbols.getSymbols,
+ getScopes: _getScopes.default,
+ clearState,
+ getNextStep: _steps.getNextStep,
+ hasSyntaxError: _validate.hasSyntaxError,
+ mapExpression: _mapExpression.default,
+ setSource: _sources.setSource
+});
+
+/***/ }),
+/* 715 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = void 0;
+
+var _buildMatchMemberExpression = _interopRequireDefault(__webpack_require__(649));
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+const isReactComponent = (0, _buildMatchMemberExpression.default)("React.Component");
+var _default = isReactComponent;
+exports.default = _default;
+
+/***/ }),
+/* 716 */
+/***/ (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);
+}
+
+/***/ }),
+/* 717 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = buildChildren;
+
+var _generated = __webpack_require__(559);
+
+var _cleanJSXElementLiteralChild = _interopRequireDefault(__webpack_require__(718));
+
+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;
+}
+
+/***/ }),
+/* 718 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = cleanJSXElementLiteralChild;
+
+var _generated = __webpack_require__(561);
+
+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));
+}
+
+/***/ }),
+/* 719 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = builder;
+
+var _clone = _interopRequireDefault(__webpack_require__(720));
+
+var _definitions = __webpack_require__(564);
+
+var _validate = _interopRequireDefault(__webpack_require__(627));
+
+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;
+}
+
+/***/ }),
+/* 720 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var baseClone = __webpack_require__(721);
+
+/** Used to compose bitmasks for cloning. */
+var CLONE_SYMBOLS_FLAG = 4;
+
+/**
+ * Creates a shallow clone of `value`.
+ *
+ * **Note:** This method is loosely based on the
+ * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)
+ * and supports cloning arrays, array buffers, booleans, date objects, maps,
+ * numbers, `Object` objects, regexes, sets, strings, symbols, and typed
+ * arrays. The own enumerable properties of `arguments` objects are cloned
+ * as plain objects. An empty object is returned for uncloneable values such
+ * as error objects, functions, DOM nodes, and WeakMaps.
+ *
+ * @static
+ * @memberOf _
+ * @since 0.1.0
+ * @category Lang
+ * @param {*} value The value to clone.
+ * @returns {*} Returns the cloned value.
+ * @see _.cloneDeep
+ * @example
+ *
+ * var objects = [{ 'a': 1 }, { 'b': 2 }];
+ *
+ * var shallow = _.clone(objects);
+ * console.log(shallow[0] === objects[0]);
+ * // => true
+ */
+function clone(value) {
+ return baseClone(value, CLONE_SYMBOLS_FLAG);
+}
+
+module.exports = clone;
+
+
+/***/ }),
+/* 721 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var Stack = __webpack_require__(613),
+ arrayEach = __webpack_require__(748),
+ assignValue = __webpack_require__(653),
+ baseAssign = __webpack_require__(750),
+ baseAssignIn = __webpack_require__(756),
+ cloneBuffer = __webpack_require__(759),
+ copyArray = __webpack_require__(760),
+ copySymbols = __webpack_require__(761),
+ copySymbolsIn = __webpack_require__(763),
+ getAllKeys = __webpack_require__(662),
+ getAllKeysIn = __webpack_require__(764),
+ getTag = __webpack_require__(578),
+ initCloneArray = __webpack_require__(768),
+ initCloneByTag = __webpack_require__(769),
+ initCloneObject = __webpack_require__(774),
+ isArray = __webpack_require__(563),
+ isBuffer = __webpack_require__(595),
+ isMap = __webpack_require__(776),
+ isObject = __webpack_require__(573),
+ isSet = __webpack_require__(778),
+ keys = __webpack_require__(594);
+
+/** Used to compose bitmasks for cloning. */
+var CLONE_DEEP_FLAG = 1,
+ CLONE_FLAT_FLAG = 2,
+ CLONE_SYMBOLS_FLAG = 4;
+
+/** `Object#toString` result references. */
+var argsTag = '[object Arguments]',
+ arrayTag = '[object Array]',
+ boolTag = '[object Boolean]',
+ dateTag = '[object Date]',
+ errorTag = '[object Error]',
+ funcTag = '[object Function]',
+ genTag = '[object GeneratorFunction]',
+ mapTag = '[object Map]',
+ numberTag = '[object Number]',
+ objectTag = '[object Object]',
+ regexpTag = '[object RegExp]',
+ setTag = '[object Set]',
+ stringTag = '[object String]',
+ symbolTag = '[object Symbol]',
+ weakMapTag = '[object WeakMap]';
+
+var arrayBufferTag = '[object ArrayBuffer]',
+ dataViewTag = '[object DataView]',
+ float32Tag = '[object Float32Array]',
+ float64Tag = '[object Float64Array]',
+ int8Tag = '[object Int8Array]',
+ int16Tag = '[object Int16Array]',
+ int32Tag = '[object Int32Array]',
+ uint8Tag = '[object Uint8Array]',
+ uint8ClampedTag = '[object Uint8ClampedArray]',
+ uint16Tag = '[object Uint16Array]',
+ uint32Tag = '[object Uint32Array]';
+
+/** Used to identify `toStringTag` values supported by `_.clone`. */
+var cloneableTags = {};
+cloneableTags[argsTag] = cloneableTags[arrayTag] =
+cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =
+cloneableTags[boolTag] = cloneableTags[dateTag] =
+cloneableTags[float32Tag] = cloneableTags[float64Tag] =
+cloneableTags[int8Tag] = cloneableTags[int16Tag] =
+cloneableTags[int32Tag] = cloneableTags[mapTag] =
+cloneableTags[numberTag] = cloneableTags[objectTag] =
+cloneableTags[regexpTag] = cloneableTags[setTag] =
+cloneableTags[stringTag] = cloneableTags[symbolTag] =
+cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
+cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
+cloneableTags[errorTag] = cloneableTags[funcTag] =
+cloneableTags[weakMapTag] = false;
+
+/**
+ * The base implementation of `_.clone` and `_.cloneDeep` which tracks
+ * traversed objects.
+ *
+ * @private
+ * @param {*} value The value to clone.
+ * @param {boolean} bitmask The bitmask flags.
+ * 1 - Deep clone
+ * 2 - Flatten inherited properties
+ * 4 - Clone symbols
+ * @param {Function} [customizer] The function to customize cloning.
+ * @param {string} [key] The key of `value`.
+ * @param {Object} [object] The parent object of `value`.
+ * @param {Object} [stack] Tracks traversed objects and their clone counterparts.
+ * @returns {*} Returns the cloned value.
+ */
+function baseClone(value, bitmask, customizer, key, object, stack) {
+ var result,
+ isDeep = bitmask & CLONE_DEEP_FLAG,
+ isFlat = bitmask & CLONE_FLAT_FLAG,
+ isFull = bitmask & CLONE_SYMBOLS_FLAG;
+
+ if (customizer) {
+ result = object ? customizer(value, key, object, stack) : customizer(value);
+ }
+ if (result !== undefined) {
+ return result;
+ }
+ if (!isObject(value)) {
+ return value;
+ }
+ var isArr = isArray(value);
+ if (isArr) {
+ result = initCloneArray(value);
+ if (!isDeep) {
+ return copyArray(value, result);
+ }
+ } else {
+ var tag = getTag(value),
+ isFunc = tag == funcTag || tag == genTag;
+
+ if (isBuffer(value)) {
+ return cloneBuffer(value, isDeep);
+ }
+ if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
+ result = (isFlat || isFunc) ? {} : initCloneObject(value);
+ if (!isDeep) {
+ return isFlat
+ ? copySymbolsIn(value, baseAssignIn(result, value))
+ : copySymbols(value, baseAssign(result, value));
+ }
+ } else {
+ if (!cloneableTags[tag]) {
+ return object ? value : {};
+ }
+ result = initCloneByTag(value, tag, isDeep);
+ }
+ }
+ // Check for circular references and return its corresponding clone.
+ stack || (stack = new Stack);
+ var stacked = stack.get(value);
+ if (stacked) {
+ return stacked;
+ }
+ stack.set(value, result);
+
+ if (isSet(value)) {
+ value.forEach(function(subValue) {
+ result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
+ });
+ } else if (isMap(value)) {
+ value.forEach(function(subValue, key) {
+ result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));
+ });
+ }
+
+ var keysFunc = isFull
+ ? (isFlat ? getAllKeysIn : getAllKeys)
+ : (isFlat ? keysIn : keys);
+
+ var props = isArr ? undefined : keysFunc(value);
+ arrayEach(props || value, function(subValue, key) {
+ if (props) {
+ key = subValue;
+ subValue = value[key];
+ }
+ // Recursively populate clone (susceptible to call stack limits).
+ assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));
+ });
+ return result;
+}
+
+module.exports = baseClone;
+
+
+/***/ }),
+/* 722 */
+/***/ (function(module, exports) {
+
+/**
+ * Removes all key-value entries from the list cache.
+ *
+ * @private
+ * @name clear
+ * @memberOf ListCache
+ */
+function listCacheClear() {
+ this.__data__ = [];
+ this.size = 0;
+}
+
+module.exports = listCacheClear;
+
+
+/***/ }),
+/* 723 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var assocIndexOf = __webpack_require__(587);
+
+/** Used for built-in method references. */
+var arrayProto = Array.prototype;
+
+/** Built-in value references. */
+var splice = arrayProto.splice;
+
+/**
+ * Removes `key` and its value from the list cache.
+ *
+ * @private
+ * @name delete
+ * @memberOf ListCache
+ * @param {string} key The key of the value to remove.
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
+ */
+function listCacheDelete(key) {
+ var data = this.__data__,
+ index = assocIndexOf(data, key);
+
+ if (index < 0) {
+ return false;
+ }
+ var lastIndex = data.length - 1;
+ if (index == lastIndex) {
+ data.pop();
+ } else {
+ splice.call(data, index, 1);
+ }
+ --this.size;
+ return true;
+}
+
+module.exports = listCacheDelete;
+
+
+/***/ }),
+/* 724 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var assocIndexOf = __webpack_require__(587);
+
+/**
+ * Gets the list cache value for `key`.
+ *
+ * @private
+ * @name get
+ * @memberOf ListCache
+ * @param {string} key The key of the value to get.
+ * @returns {*} Returns the entry value.
+ */
+function listCacheGet(key) {
+ var data = this.__data__,
+ index = assocIndexOf(data, key);
+
+ return index < 0 ? undefined : data[index][1];
+}
+
+module.exports = listCacheGet;
+
+
+/***/ }),
+/* 725 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var assocIndexOf = __webpack_require__(587);
+
+/**
+ * Checks if a list cache value for `key` exists.
+ *
+ * @private
+ * @name has
+ * @memberOf ListCache
+ * @param {string} key The key of the entry to check.
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
+ */
+function listCacheHas(key) {
+ return assocIndexOf(this.__data__, key) > -1;
+}
+
+module.exports = listCacheHas;
+
+
+/***/ }),
+/* 726 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var assocIndexOf = __webpack_require__(587);
+
+/**
+ * Sets the list cache `key` to `value`.
+ *
+ * @private
+ * @name set
+ * @memberOf ListCache
+ * @param {string} key The key of the value to set.
+ * @param {*} value The value to set.
+ * @returns {Object} Returns the list cache instance.
+ */
+function listCacheSet(key, value) {
+ var data = this.__data__,
+ index = assocIndexOf(data, key);
+
+ if (index < 0) {
+ ++this.size;
+ data.push([key, value]);
+ } else {
+ data[index][1] = value;
+ }
+ return this;
+}
+
+module.exports = listCacheSet;
+
+
+/***/ }),
+/* 727 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var ListCache = __webpack_require__(586);
+
+/**
+ * Removes all key-value entries from the stack.
+ *
+ * @private
+ * @name clear
+ * @memberOf Stack
+ */
+function stackClear() {
+ this.__data__ = new ListCache;
+ this.size = 0;
+}
+
+module.exports = stackClear;
+
+
+/***/ }),
+/* 728 */
+/***/ (function(module, exports) {
+
+/**
+ * Removes `key` and its value from the stack.
+ *
+ * @private
+ * @name delete
+ * @memberOf Stack
+ * @param {string} key The key of the value to remove.
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
+ */
+function stackDelete(key) {
+ var data = this.__data__,
+ result = data['delete'](key);
+
+ this.size = data.size;
+ return result;
+}
+
+module.exports = stackDelete;
+
+
+/***/ }),
+/* 729 */
+/***/ (function(module, exports) {
+
+/**
+ * Gets the stack value for `key`.
+ *
+ * @private
+ * @name get
+ * @memberOf Stack
+ * @param {string} key The key of the value to get.
+ * @returns {*} Returns the entry value.
+ */
+function stackGet(key) {
+ return this.__data__.get(key);
+}
+
+module.exports = stackGet;
+
+
+/***/ }),
+/* 730 */
+/***/ (function(module, exports) {
+
+/**
+ * Checks if a stack value for `key` exists.
+ *
+ * @private
+ * @name has
+ * @memberOf Stack
+ * @param {string} key The key of the entry to check.
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
+ */
+function stackHas(key) {
+ return this.__data__.has(key);
+}
+
+module.exports = stackHas;
+
+
+/***/ }),
+/* 731 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var ListCache = __webpack_require__(586),
+ Map = __webpack_require__(614),
+ MapCache = __webpack_require__(617);
+
+/** Used as the size to enable large array optimizations. */
+var LARGE_ARRAY_SIZE = 200;
+
+/**
+ * Sets the stack `key` to `value`.
+ *
+ * @private
+ * @name set
+ * @memberOf Stack
+ * @param {string} key The key of the value to set.
+ * @param {*} value The value to set.
+ * @returns {Object} Returns the stack cache instance.
+ */
+function stackSet(key, value) {
+ var data = this.__data__;
+ if (data instanceof ListCache) {
+ var pairs = data.__data__;
+ if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
+ pairs.push([key, value]);
+ this.size = ++data.size;
+ return this;
+ }
+ data = this.__data__ = new MapCache(pairs);
+ }
+ data.set(key, value);
+ this.size = data.size;
+ return this;
+}
+
+module.exports = stackSet;
+
+
+/***/ }),
+/* 732 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var isFunction = __webpack_require__(651),
+ isMasked = __webpack_require__(733),
+ isObject = __webpack_require__(573),
+ toSource = __webpack_require__(652);
+
+/**
+ * Used to match `RegExp`
+ * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
+ */
+var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
+
+/** Used to detect host constructors (Safari). */
+var reIsHostCtor = /^\[object .+?Constructor\]$/;
+
+/** Used for built-in method references. */
+var funcProto = Function.prototype,
+ objectProto = Object.prototype;
+
+/** Used to resolve the decompiled source of functions. */
+var funcToString = funcProto.toString;
+
+/** Used to check objects for own properties. */
+var hasOwnProperty = objectProto.hasOwnProperty;
+
+/** Used to detect if a method is native. */
+var reIsNative = RegExp('^' +
+ funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
+ .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
+);
+
+/**
+ * The base implementation of `_.isNative` without bad shim checks.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a native function,
+ * else `false`.
+ */
+function baseIsNative(value) {
+ if (!isObject(value) || isMasked(value)) {
+ return false;
+ }
+ var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
+ return pattern.test(toSource(value));
+}
+
+module.exports = baseIsNative;
+
+
+/***/ }),
+/* 733 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var coreJsData = __webpack_require__(734);
+
+/** Used to detect methods masquerading as native. */
+var maskSrcKey = (function() {
+ var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
+ return uid ? ('Symbol(src)_1.' + uid) : '';
+}());
+
+/**
+ * Checks if `func` has its source masked.
+ *
+ * @private
+ * @param {Function} func The function to check.
+ * @returns {boolean} Returns `true` if `func` is masked, else `false`.
+ */
+function isMasked(func) {
+ return !!maskSrcKey && (maskSrcKey in func);
+}
+
+module.exports = isMasked;
+
+
+/***/ }),
+/* 734 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var root = __webpack_require__(562);
+
+/** Used to detect overreaching core-js shims. */
+var coreJsData = root['__core-js_shared__'];
+
+module.exports = coreJsData;
+
+
+/***/ }),
+/* 735 */
+/***/ (function(module, exports) {
+
+/**
+ * Gets the value at `key` of `object`.
+ *
+ * @private
+ * @param {Object} [object] The object to query.
+ * @param {string} key The key of the property to get.
+ * @returns {*} Returns the property value.
+ */
+function getValue(object, key) {
+ return object == null ? undefined : object[key];
+}
+
+module.exports = getValue;
+
+
+/***/ }),
+/* 736 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var Hash = __webpack_require__(737),
+ ListCache = __webpack_require__(586),
+ Map = __webpack_require__(614);
+
+/**
+ * Removes all key-value entries from the map.
+ *
+ * @private
+ * @name clear
+ * @memberOf MapCache
+ */
+function mapCacheClear() {
+ this.size = 0;
+ this.__data__ = {
+ 'hash': new Hash,
+ 'map': new (Map || ListCache),
+ 'string': new Hash
+ };
+}
+
+module.exports = mapCacheClear;
+
+
+/***/ }),
+/* 737 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var hashClear = __webpack_require__(738),
+ hashDelete = __webpack_require__(739),
+ hashGet = __webpack_require__(740),
+ hashHas = __webpack_require__(741),
+ hashSet = __webpack_require__(742);
+
+/**
+ * Creates a hash object.
+ *
+ * @private
+ * @constructor
+ * @param {Array} [entries] The key-value pairs to cache.
+ */
+function Hash(entries) {
+ var index = -1,
+ length = entries == null ? 0 : entries.length;
+
+ this.clear();
+ while (++index < length) {
+ var entry = entries[index];
+ this.set(entry[0], entry[1]);
+ }
+}
+
+// Add methods to `Hash`.
+Hash.prototype.clear = hashClear;
+Hash.prototype['delete'] = hashDelete;
+Hash.prototype.get = hashGet;
+Hash.prototype.has = hashHas;
+Hash.prototype.set = hashSet;
+
+module.exports = Hash;
+
+
+/***/ }),
+/* 738 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var nativeCreate = __webpack_require__(591);
+
+/**
+ * Removes all key-value entries from the hash.
+ *
+ * @private
+ * @name clear
+ * @memberOf Hash
+ */
+function hashClear() {
+ this.__data__ = nativeCreate ? nativeCreate(null) : {};
+ this.size = 0;
+}
+
+module.exports = hashClear;
+
+
+/***/ }),
+/* 739 */
+/***/ (function(module, exports) {
+
+/**
+ * Removes `key` and its value from the hash.
+ *
+ * @private
+ * @name delete
+ * @memberOf Hash
+ * @param {Object} hash The hash to modify.
+ * @param {string} key The key of the value to remove.
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
+ */
+function hashDelete(key) {
+ var result = this.has(key) && delete this.__data__[key];
+ this.size -= result ? 1 : 0;
+ return result;
+}
+
+module.exports = hashDelete;
+
+
+/***/ }),
+/* 740 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var nativeCreate = __webpack_require__(591);
+
+/** Used to stand-in for `undefined` hash values. */
+var HASH_UNDEFINED = '__lodash_hash_undefined__';
+
+/** Used for built-in method references. */
+var objectProto = Object.prototype;
+
+/** Used to check objects for own properties. */
+var hasOwnProperty = objectProto.hasOwnProperty;
+
+/**
+ * Gets the hash value for `key`.
+ *
+ * @private
+ * @name get
+ * @memberOf Hash
+ * @param {string} key The key of the value to get.
+ * @returns {*} Returns the entry value.
+ */
+function hashGet(key) {
+ var data = this.__data__;
+ if (nativeCreate) {
+ var result = data[key];
+ return result === HASH_UNDEFINED ? undefined : result;
+ }
+ return hasOwnProperty.call(data, key) ? data[key] : undefined;
+}
+
+module.exports = hashGet;
+
+
+/***/ }),
+/* 741 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var nativeCreate = __webpack_require__(591);
+
+/** Used for built-in method references. */
+var objectProto = Object.prototype;
+
+/** Used to check objects for own properties. */
+var hasOwnProperty = objectProto.hasOwnProperty;
+
+/**
+ * Checks if a hash value for `key` exists.
+ *
+ * @private
+ * @name has
+ * @memberOf Hash
+ * @param {string} key The key of the entry to check.
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
+ */
+function hashHas(key) {
+ var data = this.__data__;
+ return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
+}
+
+module.exports = hashHas;
+
+
+/***/ }),
+/* 742 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var nativeCreate = __webpack_require__(591);
+
+/** Used to stand-in for `undefined` hash values. */
+var HASH_UNDEFINED = '__lodash_hash_undefined__';
+
+/**
+ * Sets the hash `key` to `value`.
+ *
+ * @private
+ * @name set
+ * @memberOf Hash
+ * @param {string} key The key of the value to set.
+ * @param {*} value The value to set.
+ * @returns {Object} Returns the hash instance.
+ */
+function hashSet(key, value) {
+ var data = this.__data__;
+ this.size += this.has(key) ? 0 : 1;
+ data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
+ return this;
+}
+
+module.exports = hashSet;
+
+
+/***/ }),
+/* 743 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var getMapData = __webpack_require__(592);
+
+/**
+ * Removes `key` and its value from the map.
+ *
+ * @private
+ * @name delete
+ * @memberOf MapCache
+ * @param {string} key The key of the value to remove.
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
+ */
+function mapCacheDelete(key) {
+ var result = getMapData(this, key)['delete'](key);
+ this.size -= result ? 1 : 0;
+ return result;
+}
+
+module.exports = mapCacheDelete;
+
+
+/***/ }),
+/* 744 */
+/***/ (function(module, exports) {
+
+/**
+ * Checks if `value` is suitable for use as unique object key.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
+ */
+function isKeyable(value) {
+ var type = typeof value;
+ return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
+ ? (value !== '__proto__')
+ : (value === null);
+}
+
+module.exports = isKeyable;
+
+
+/***/ }),
+/* 745 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var getMapData = __webpack_require__(592);
+
+/**
+ * Gets the map value for `key`.
+ *
+ * @private
+ * @name get
+ * @memberOf MapCache
+ * @param {string} key The key of the value to get.
+ * @returns {*} Returns the entry value.
+ */
+function mapCacheGet(key) {
+ return getMapData(this, key).get(key);
+}
+
+module.exports = mapCacheGet;
+
+
+/***/ }),
+/* 746 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var getMapData = __webpack_require__(592);
+
+/**
+ * Checks if a map value for `key` exists.
+ *
+ * @private
+ * @name has
+ * @memberOf MapCache
+ * @param {string} key The key of the entry to check.
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
+ */
+function mapCacheHas(key) {
+ return getMapData(this, key).has(key);
+}
+
+module.exports = mapCacheHas;
+
+
+/***/ }),
+/* 747 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var getMapData = __webpack_require__(592);
+
+/**
+ * Sets the map `key` to `value`.
+ *
+ * @private
+ * @name set
+ * @memberOf MapCache
+ * @param {string} key The key of the value to set.
+ * @param {*} value The value to set.
+ * @returns {Object} Returns the map cache instance.
+ */
+function mapCacheSet(key, value) {
+ var data = getMapData(this, key),
+ size = data.size;
+
+ data.set(key, value);
+ this.size += data.size == size ? 0 : 1;
+ return this;
+}
+
+module.exports = mapCacheSet;
+
+
+/***/ }),
+/* 748 */
+/***/ (function(module, exports) {
+
+/**
+ * A specialized version of `_.forEach` for arrays without support for
+ * iteratee shorthands.
+ *
+ * @private
+ * @param {Array} [array] The array to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @returns {Array} Returns `array`.
+ */
+function arrayEach(array, iteratee) {
+ var index = -1,
+ length = array == null ? 0 : array.length;
+
+ while (++index < length) {
+ if (iteratee(array[index], index, array) === false) {
+ break;
+ }
+ }
+ return array;
+}
+
+module.exports = arrayEach;
+
+
+/***/ }),
+/* 749 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var getNative = __webpack_require__(574);
+
+var defineProperty = (function() {
+ try {
+ var func = getNative(Object, 'defineProperty');
+ func({}, '', {});
+ return func;
+ } catch (e) {}
+}());
+
+module.exports = defineProperty;
+
+
+/***/ }),
+/* 750 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var copyObject = __webpack_require__(593),
+ keys = __webpack_require__(594);
+
+/**
+ * The base implementation of `_.assign` without support for multiple sources
+ * or `customizer` functions.
+ *
+ * @private
+ * @param {Object} object The destination object.
+ * @param {Object} source The source object.
+ * @returns {Object} Returns `object`.
+ */
+function baseAssign(object, source) {
+ return object && copyObject(source, keys(source), object);
+}
+
+module.exports = baseAssign;
+
+
+/***/ }),
+/* 751 */
+/***/ (function(module, exports) {
+
+/**
+ * The base implementation of `_.times` without support for iteratee shorthands
+ * or max array length checks.
+ *
+ * @private
+ * @param {number} n The number of times to invoke `iteratee`.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @returns {Array} Returns the array of results.
+ */
+function baseTimes(n, iteratee) {
+ var index = -1,
+ result = Array(n);
+
+ while (++index < n) {
+ result[index] = iteratee(index);
+ }
+ return result;
+}
+
+module.exports = baseTimes;
+
+
+/***/ }),
+/* 752 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var baseGetTag = __webpack_require__(569),
+ isObjectLike = __webpack_require__(565);
+
+/** `Object#toString` result references. */
+var argsTag = '[object Arguments]';
+
+/**
+ * The base implementation of `_.isArguments`.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is an `arguments` object,
+ */
+function baseIsArguments(value) {
+ return isObjectLike(value) && baseGetTag(value) == argsTag;
+}
+
+module.exports = baseIsArguments;
+
+
+/***/ }),
+/* 753 */
+/***/ (function(module, exports) {
+
+/**
+ * This method returns `false`.
+ *
+ * @static
+ * @memberOf _
+ * @since 4.13.0
+ * @category Util
+ * @returns {boolean} Returns `false`.
+ * @example
+ *
+ * _.times(2, _.stubFalse);
+ * // => [false, false]
+ */
+function stubFalse() {
+ return false;
+}
+
+module.exports = stubFalse;
+
+
+/***/ }),
+/* 754 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var baseGetTag = __webpack_require__(569),
+ isLength = __webpack_require__(622),
+ isObjectLike = __webpack_require__(565);
+
+/** `Object#toString` result references. */
+var argsTag = '[object Arguments]',
+ arrayTag = '[object Array]',
+ boolTag = '[object Boolean]',
+ dateTag = '[object Date]',
+ errorTag = '[object Error]',
+ funcTag = '[object Function]',
+ mapTag = '[object Map]',
+ numberTag = '[object Number]',
+ objectTag = '[object Object]',
+ regexpTag = '[object RegExp]',
+ setTag = '[object Set]',
+ stringTag = '[object String]',
+ weakMapTag = '[object WeakMap]';
+
+var arrayBufferTag = '[object ArrayBuffer]',
+ dataViewTag = '[object DataView]',
+ float32Tag = '[object Float32Array]',
+ float64Tag = '[object Float64Array]',
+ int8Tag = '[object Int8Array]',
+ int16Tag = '[object Int16Array]',
+ int32Tag = '[object Int32Array]',
+ uint8Tag = '[object Uint8Array]',
+ uint8ClampedTag = '[object Uint8ClampedArray]',
+ uint16Tag = '[object Uint16Array]',
+ uint32Tag = '[object Uint32Array]';
+
+/** Used to identify `toStringTag` values of typed arrays. */
+var typedArrayTags = {};
+typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
+typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
+typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
+typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
+typedArrayTags[uint32Tag] = true;
+typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
+typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
+typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
+typedArrayTags[errorTag] = typedArrayTags[funcTag] =
+typedArrayTags[mapTag] = typedArrayTags[numberTag] =
+typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
+typedArrayTags[setTag] = typedArrayTags[stringTag] =
+typedArrayTags[weakMapTag] = false;
+
+/**
+ * The base implementation of `_.isTypedArray` without Node.js optimizations.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
+ */
+function baseIsTypedArray(value) {
+ return isObjectLike(value) &&
+ isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
+}
+
+module.exports = baseIsTypedArray;
+
+
+/***/ }),
+/* 755 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var overArg = __webpack_require__(657);
+
+/* Built-in method references for those with the same name as other `lodash` methods. */
+var nativeKeys = overArg(Object.keys, Object);
+
+module.exports = nativeKeys;
+
+
+/***/ }),
+/* 756 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var copyObject = __webpack_require__(593),
+ keysIn = __webpack_require__(658);
+
+/**
+ * The base implementation of `_.assignIn` without support for multiple sources
+ * or `customizer` functions.
+ *
+ * @private
+ * @param {Object} object The destination object.
+ * @param {Object} source The source object.
+ * @returns {Object} Returns `object`.
+ */
+function baseAssignIn(object, source) {
+ return object && copyObject(source, keysIn(source), object);
+}
+
+module.exports = baseAssignIn;
+
+
+/***/ }),
+/* 757 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var isObject = __webpack_require__(573),
+ isPrototype = __webpack_require__(598),
+ nativeKeysIn = __webpack_require__(758);
+
+/** Used for built-in method references. */
+var objectProto = Object.prototype;
+
+/** Used to check objects for own properties. */
+var hasOwnProperty = objectProto.hasOwnProperty;
+
+/**
+ * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
+ *
+ * @private
+ * @param {Object} object The object to query.
+ * @returns {Array} Returns the array of property names.
+ */
+function baseKeysIn(object) {
+ if (!isObject(object)) {
+ return nativeKeysIn(object);
+ }
+ var isProto = isPrototype(object),
+ result = [];
+
+ for (var key in object) {
+ if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
+ result.push(key);
+ }
+ }
+ return result;
+}
+
+module.exports = baseKeysIn;
+
+
+/***/ }),
+/* 758 */
+/***/ (function(module, exports) {
+
+/**
+ * This function is like
+ * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
+ * except that it includes inherited enumerable properties.
+ *
+ * @private
+ * @param {Object} object The object to query.
+ * @returns {Array} Returns the array of property names.
+ */
+function nativeKeysIn(object) {
+ var result = [];
+ if (object != null) {
+ for (var key in Object(object)) {
+ result.push(key);
+ }
+ }
+ return result;
+}
+
+module.exports = nativeKeysIn;
+
+
+/***/ }),
+/* 759 */
+/***/ (function(module, exports, __webpack_require__) {
+
+/* WEBPACK VAR INJECTION */(function(module) {var root = __webpack_require__(562);
+
+/** Detect free variable `exports`. */
+var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;
+
+/** Detect free variable `module`. */
+var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
+
+/** Detect the popular CommonJS extension `module.exports`. */
+var moduleExports = freeModule && freeModule.exports === freeExports;
+
+/** Built-in value references. */
+var Buffer = moduleExports ? root.Buffer : undefined,
+ allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined;
+
+/**
+ * Creates a clone of `buffer`.
+ *
+ * @private
+ * @param {Buffer} buffer The buffer to clone.
+ * @param {boolean} [isDeep] Specify a deep clone.
+ * @returns {Buffer} Returns the cloned buffer.
+ */
+function cloneBuffer(buffer, isDeep) {
+ if (isDeep) {
+ return buffer.slice();
+ }
+ var length = buffer.length,
+ result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
+
+ buffer.copy(result);
+ return result;
+}
+
+module.exports = cloneBuffer;
+
+/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(619)(module)))
+
+/***/ }),
+/* 760 */
+/***/ (function(module, exports) {
+
+/**
+ * Copies the values of `source` to `array`.
+ *
+ * @private
+ * @param {Array} source The array to copy values from.
+ * @param {Array} [array=[]] The array to copy values to.
+ * @returns {Array} Returns `array`.
+ */
+function copyArray(source, array) {
+ var index = -1,
+ length = source.length;
+
+ array || (array = Array(length));
+ while (++index < length) {
+ array[index] = source[index];
+ }
+ return array;
+}
+
+module.exports = copyArray;
+
+
+/***/ }),
+/* 761 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var copyObject = __webpack_require__(593),
+ getSymbols = __webpack_require__(623);
+
+/**
+ * Copies own symbols of `source` to `object`.
+ *
+ * @private
+ * @param {Object} source The object to copy symbols from.
+ * @param {Object} [object={}] The object to copy symbols to.
+ * @returns {Object} Returns `object`.
+ */
+function copySymbols(source, object) {
+ return copyObject(source, getSymbols(source), object);
+}
+
+module.exports = copySymbols;
+
+
+/***/ }),
+/* 762 */
+/***/ (function(module, exports) {
+
+/**
+ * A specialized version of `_.filter` for arrays without support for
+ * iteratee shorthands.
+ *
+ * @private
+ * @param {Array} [array] The array to iterate over.
+ * @param {Function} predicate The function invoked per iteration.
+ * @returns {Array} Returns the new filtered array.
+ */
+function arrayFilter(array, predicate) {
+ var index = -1,
+ length = array == null ? 0 : array.length,
+ resIndex = 0,
+ result = [];
+
+ while (++index < length) {
+ var value = array[index];
+ if (predicate(value, index, array)) {
+ result[resIndex++] = value;
+ }
+ }
+ return result;
+}
+
+module.exports = arrayFilter;
+
+
+/***/ }),
+/* 763 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var copyObject = __webpack_require__(593),
+ getSymbolsIn = __webpack_require__(660);
+
+/**
+ * Copies own and inherited symbols of `source` to `object`.
+ *
+ * @private
+ * @param {Object} source The object to copy symbols from.
+ * @param {Object} [object={}] The object to copy symbols to.
+ * @returns {Object} Returns `object`.
+ */
+function copySymbolsIn(source, object) {
+ return copyObject(source, getSymbolsIn(source), object);
+}
+
+module.exports = copySymbolsIn;
+
+
+/***/ }),
+/* 764 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var baseGetAllKeys = __webpack_require__(663),
+ getSymbolsIn = __webpack_require__(660),
+ keysIn = __webpack_require__(658);
+
+/**
+ * Creates an array of own and inherited enumerable property names and
+ * symbols of `object`.
+ *
+ * @private
+ * @param {Object} object The object to query.
+ * @returns {Array} Returns the array of property names and symbols.
+ */
+function getAllKeysIn(object) {
+ return baseGetAllKeys(object, keysIn, getSymbolsIn);
+}
+
+module.exports = getAllKeysIn;
+
+
+/***/ }),
+/* 765 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var getNative = __webpack_require__(574),
+ root = __webpack_require__(562);
+
+/* Built-in method references that are verified to be native. */
+var DataView = getNative(root, 'DataView');
+
+module.exports = DataView;
+
+
+/***/ }),
+/* 766 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var getNative = __webpack_require__(574),
+ root = __webpack_require__(562);
+
+/* Built-in method references that are verified to be native. */
+var Promise = getNative(root, 'Promise');
+
+module.exports = Promise;
+
+
+/***/ }),
+/* 767 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var getNative = __webpack_require__(574),
+ root = __webpack_require__(562);
+
+/* Built-in method references that are verified to be native. */
+var WeakMap = getNative(root, 'WeakMap');
+
+module.exports = WeakMap;
+
+
+/***/ }),
+/* 768 */
+/***/ (function(module, exports) {
+
+/** Used for built-in method references. */
+var objectProto = Object.prototype;
+
+/** Used to check objects for own properties. */
+var hasOwnProperty = objectProto.hasOwnProperty;
+
+/**
+ * Initializes an array clone.
+ *
+ * @private
+ * @param {Array} array The array to clone.
+ * @returns {Array} Returns the initialized clone.
+ */
+function initCloneArray(array) {
+ var length = array.length,
+ result = new array.constructor(length);
+
+ // Add properties assigned by `RegExp#exec`.
+ if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
+ result.index = array.index;
+ result.input = array.input;
+ }
+ return result;
+}
+
+module.exports = initCloneArray;
+
+
+/***/ }),
+/* 769 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var cloneArrayBuffer = __webpack_require__(625),
+ cloneDataView = __webpack_require__(770),
+ cloneRegExp = __webpack_require__(771),
+ cloneSymbol = __webpack_require__(772),
+ cloneTypedArray = __webpack_require__(773);
+
+/** `Object#toString` result references. */
+var boolTag = '[object Boolean]',
+ dateTag = '[object Date]',
+ mapTag = '[object Map]',
+ numberTag = '[object Number]',
+ regexpTag = '[object RegExp]',
+ setTag = '[object Set]',
+ stringTag = '[object String]',
+ symbolTag = '[object Symbol]';
+
+var arrayBufferTag = '[object ArrayBuffer]',
+ dataViewTag = '[object DataView]',
+ float32Tag = '[object Float32Array]',
+ float64Tag = '[object Float64Array]',
+ int8Tag = '[object Int8Array]',
+ int16Tag = '[object Int16Array]',
+ int32Tag = '[object Int32Array]',
+ uint8Tag = '[object Uint8Array]',
+ uint8ClampedTag = '[object Uint8ClampedArray]',
+ uint16Tag = '[object Uint16Array]',
+ uint32Tag = '[object Uint32Array]';
+
+/**
+ * Initializes an object clone based on its `toStringTag`.
+ *
+ * **Note:** This function only supports cloning values with tags of
+ * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.
+ *
+ * @private
+ * @param {Object} object The object to clone.
+ * @param {string} tag The `toStringTag` of the object to clone.
+ * @param {boolean} [isDeep] Specify a deep clone.
+ * @returns {Object} Returns the initialized clone.
+ */
+function initCloneByTag(object, tag, isDeep) {
+ var Ctor = object.constructor;
+ switch (tag) {
+ case arrayBufferTag:
+ return cloneArrayBuffer(object);
+
+ case boolTag:
+ case dateTag:
+ return new Ctor(+object);
+
+ case dataViewTag:
+ return cloneDataView(object, isDeep);
+
+ case float32Tag: case float64Tag:
+ case int8Tag: case int16Tag: case int32Tag:
+ case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:
+ return cloneTypedArray(object, isDeep);
+
+ case mapTag:
+ return new Ctor;
+
+ case numberTag:
+ case stringTag:
+ return new Ctor(object);
+
+ case regexpTag:
+ return cloneRegExp(object);
+
+ case setTag:
+ return new Ctor;
+
+ case symbolTag:
+ return cloneSymbol(object);
+ }
+}
+
+module.exports = initCloneByTag;
+
+
+/***/ }),
+/* 770 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var cloneArrayBuffer = __webpack_require__(625);
+
+/**
+ * Creates a clone of `dataView`.
+ *
+ * @private
+ * @param {Object} dataView The data view to clone.
+ * @param {boolean} [isDeep] Specify a deep clone.
+ * @returns {Object} Returns the cloned data view.
+ */
+function cloneDataView(dataView, isDeep) {
+ var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
+ return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
+}
+
+module.exports = cloneDataView;
+
+
+/***/ }),
+/* 771 */
+/***/ (function(module, exports) {
+
+/** Used to match `RegExp` flags from their coerced string values. */
+var reFlags = /\w*$/;
+
+/**
+ * Creates a clone of `regexp`.
+ *
+ * @private
+ * @param {Object} regexp The regexp to clone.
+ * @returns {Object} Returns the cloned regexp.
+ */
+function cloneRegExp(regexp) {
+ var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
+ result.lastIndex = regexp.lastIndex;
+ return result;
+}
+
+module.exports = cloneRegExp;
+
+
+/***/ }),
+/* 772 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var Symbol = __webpack_require__(570);
+
+/** Used to convert symbols to primitives and strings. */
+var symbolProto = Symbol ? Symbol.prototype : undefined,
+ symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;
+
+/**
+ * Creates a clone of the `symbol` object.
+ *
+ * @private
+ * @param {Object} symbol The symbol object to clone.
+ * @returns {Object} Returns the cloned symbol object.
+ */
+function cloneSymbol(symbol) {
+ return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
+}
+
+module.exports = cloneSymbol;
+
+
+/***/ }),
+/* 773 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var cloneArrayBuffer = __webpack_require__(625);
+
+/**
+ * Creates a clone of `typedArray`.
+ *
+ * @private
+ * @param {Object} typedArray The typed array to clone.
+ * @param {boolean} [isDeep] Specify a deep clone.
+ * @returns {Object} Returns the cloned typed array.
+ */
+function cloneTypedArray(typedArray, isDeep) {
+ var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
+ return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
+}
+
+module.exports = cloneTypedArray;
+
+
+/***/ }),
+/* 774 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var baseCreate = __webpack_require__(775),
+ getPrototype = __webpack_require__(624),
+ isPrototype = __webpack_require__(598);
+
+/**
+ * Initializes an object clone.
+ *
+ * @private
+ * @param {Object} object The object to clone.
+ * @returns {Object} Returns the initialized clone.
+ */
+function initCloneObject(object) {
+ return (typeof object.constructor == 'function' && !isPrototype(object))
+ ? baseCreate(getPrototype(object))
+ : {};
+}
+
+module.exports = initCloneObject;
+
+
+/***/ }),
+/* 775 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var isObject = __webpack_require__(573);
+
+/** Built-in value references. */
+var objectCreate = Object.create;
+
+/**
+ * The base implementation of `_.create` without support for assigning
+ * properties to the created object.
+ *
+ * @private
+ * @param {Object} proto The object to inherit from.
+ * @returns {Object} Returns the new object.
+ */
+var baseCreate = (function() {
+ function object() {}
+ return function(proto) {
+ if (!isObject(proto)) {
+ return {};
+ }
+ if (objectCreate) {
+ return objectCreate(proto);
+ }
+ object.prototype = proto;
+ var result = new object;
+ object.prototype = undefined;
+ return result;
+ };
+}());
+
+module.exports = baseCreate;
+
+
+/***/ }),
+/* 776 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var baseIsMap = __webpack_require__(777),
+ baseUnary = __webpack_require__(596),
+ nodeUtil = __webpack_require__(597);
+
+/* Node.js helper references. */
+var nodeIsMap = nodeUtil && nodeUtil.isMap;
+
+/**
+ * Checks if `value` is classified as a `Map` object.
+ *
+ * @static
+ * @memberOf _
+ * @since 4.3.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a map, else `false`.
+ * @example
+ *
+ * _.isMap(new Map);
+ * // => true
+ *
+ * _.isMap(new WeakMap);
+ * // => false
+ */
+var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;
+
+module.exports = isMap;
+
+
+/***/ }),
+/* 777 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var getTag = __webpack_require__(578),
+ isObjectLike = __webpack_require__(565);
+
+/** `Object#toString` result references. */
+var mapTag = '[object Map]';
+
+/**
+ * The base implementation of `_.isMap` without Node.js optimizations.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a map, else `false`.
+ */
+function baseIsMap(value) {
+ return isObjectLike(value) && getTag(value) == mapTag;
+}
+
+module.exports = baseIsMap;
+
+
+/***/ }),
+/* 778 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var baseIsSet = __webpack_require__(779),
+ baseUnary = __webpack_require__(596),
+ nodeUtil = __webpack_require__(597);
+
+/* Node.js helper references. */
+var nodeIsSet = nodeUtil && nodeUtil.isSet;
+
+/**
+ * Checks if `value` is classified as a `Set` object.
+ *
+ * @static
+ * @memberOf _
+ * @since 4.3.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a set, else `false`.
+ * @example
+ *
+ * _.isSet(new Set);
+ * // => true
+ *
+ * _.isSet(new WeakSet);
+ * // => false
+ */
+var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
+
+module.exports = isSet;
+
+
+/***/ }),
+/* 779 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var getTag = __webpack_require__(578),
+ isObjectLike = __webpack_require__(565);
+
+/** `Object#toString` result references. */
+var setTag = '[object Set]';
+
+/**
+ * The base implementation of `_.isSet` without Node.js optimizations.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a set, else `false`.
+ */
+function baseIsSet(value) {
+ return isObjectLike(value) && getTag(value) == setTag;
+}
+
+module.exports = baseIsSet;
+
+
+/***/ }),
+/* 780 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+let fastProto = null;
+
+// Creates an object with permanently fast properties in V8. See Toon Verwaest's
+// post https://medium.com/@tverwaes/setting-up-prototypes-in-v8-ec9c9491dfe2#5f62
+// for more details. Use %HasFastProperties(object) and the Node.js flag
+// --allow-natives-syntax to check whether an object has fast properties.
+function FastObject(o) {
+ // A prototype object will have "fast properties" enabled once it is checked
+ // against the inline property cache of a function, e.g. fastProto.property:
+ // https://github.com/v8/v8/blob/6.0.122/test/mjsunit/fast-prototype.js#L48-L63
+ if (fastProto !== null && typeof fastProto.property) {
+ const result = fastProto;
+ fastProto = FastObject.prototype = null;
+ return result;
+ }
+ fastProto = FastObject.prototype = o == null ? Object.create(null) : o;
+ return new FastObject;
+}
+
+// Initialize the inline property cache of FastObject
+FastObject();
+
+module.exports = function toFastproperties(o) {
+ return FastObject(o);
+};
+
+
+/***/ }),
+/* 781 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.isIdentifierStart = isIdentifierStart;
+exports.isIdentifierChar = isIdentifierChar;
+exports.isIdentifierName = isIdentifierName;
+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-\u08c7\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\u0d04-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d54-\u0d56\u0d5f-\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e86-\u0e8a\u0e8c-\u0ea3\u0ea5\u0ea7-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f5\u13f8-\u13fd\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f8\u1700-\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-\u31bf\u31f0-\u31ff\u3400-\u4dbf\u4e00-\u9ffc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua69d\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua7bf\ua7c2-\ua7ca\ua7f5-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua8fd\ua8fe\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\ua9e0-\ua9e4\ua9e6-\ua9ef\ua9fa-\ua9fe\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa7e-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uab30-\uab5a\uab5c-\uab69\uab70-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc";
+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\u0b55-\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\u0d81-\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0de6-\u0def\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0ebc\u0ec8-\u0ecd\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1369-\u1371\u1712-\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\u1abf\u1ac0\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\ua82c\ua880\ua881\ua8b4-\ua8c5\ua8d0-\ua8d9\ua8e0-\ua8f1\ua8ff-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\ua9e5\ua9f0-\ua9f9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b-\uaa7d\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f";
+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, 349, 41, 7, 1, 79, 28, 11, 0, 9, 21, 107, 20, 28, 22, 13, 52, 76, 44, 33, 24, 27, 35, 30, 0, 3, 0, 9, 34, 4, 0, 13, 47, 15, 3, 22, 0, 2, 0, 36, 17, 2, 24, 85, 6, 2, 0, 2, 3, 2, 14, 2, 9, 8, 46, 39, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 4, 0, 19, 0, 13, 4, 159, 52, 19, 3, 21, 2, 31, 47, 21, 1, 2, 0, 185, 46, 42, 3, 37, 47, 21, 0, 60, 42, 14, 0, 72, 26, 230, 43, 117, 63, 32, 7, 3, 0, 3, 7, 2, 1, 2, 23, 16, 0, 2, 0, 95, 7, 3, 38, 17, 0, 2, 0, 29, 0, 11, 39, 8, 0, 22, 0, 12, 45, 20, 0, 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, 190, 0, 80, 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, 1237, 43, 8, 8952, 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, 42717, 35, 4148, 12, 221, 3, 5761, 15, 7472, 3104, 541, 1507, 4938];
+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, 370, 1, 154, 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, 2, 11, 83, 11, 7, 0, 161, 11, 6, 9, 7, 3, 56, 1, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 193, 17, 10, 9, 5, 0, 82, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 84, 14, 5, 9, 243, 14, 166, 9, 71, 5, 2, 1, 3, 3, 2, 0, 2, 1, 13, 9, 120, 6, 3, 6, 4, 0, 29, 9, 41, 6, 2, 3, 9, 0, 10, 10, 47, 15, 406, 7, 2, 7, 17, 9, 57, 21, 2, 13, 123, 5, 4, 0, 2, 1, 2, 6, 2, 0, 9, 9, 49, 4, 2, 1, 2, 4, 9, 9, 330, 3, 19306, 9, 135, 4, 60, 6, 26, 9, 1014, 0, 2, 54, 8, 3, 82, 0, 12, 1, 19628, 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, 4759, 9, 787719, 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 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);
+}
+
+function isIdentifierName(name) {
+ let isFirst = true;
+
+ for (let _i = 0, _Array$from = Array.from(name); _i < _Array$from.length; _i++) {
+ const char = _Array$from[_i];
+ const cp = char.codePointAt(0);
+
+ if (isFirst) {
+ if (!isIdentifierStart(cp)) {
+ return false;
+ }
+
+ isFirst = false;
+ } else if (!isIdentifierChar(cp)) {
+ return false;
+ }
+ }
+
+ return !isFirst;
+}
+
+/***/ }),
+/* 782 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.isReservedWord = isReservedWord;
+exports.isStrictReservedWord = isStrictReservedWord;
+exports.isStrictBindOnlyReservedWord = isStrictBindOnlyReservedWord;
+exports.isStrictBindReservedWord = isStrictBindReservedWord;
+exports.isKeyword = isKeyword;
+const reservedWords = {
+ keyword: ["break", "case", "catch", "continue", "debugger", "default", "do", "else", "finally", "for", "function", "if", "return", "switch", "throw", "try", "var", "const", "while", "with", "new", "this", "super", "class", "extends", "export", "import", "null", "true", "false", "in", "instanceof", "typeof", "void", "delete"],
+ strict: ["implements", "interface", "let", "package", "private", "protected", "public", "static", "yield"],
+ strictBind: ["eval", "arguments"]
+};
+const keywords = new Set(reservedWords.keyword);
+const reservedWordsStrictSet = new Set(reservedWords.strict);
+const reservedWordsStrictBindSet = new Set(reservedWords.strictBind);
+
+function isReservedWord(word, inModule) {
+ return inModule && word === "await" || word === "enum";
+}
+
+function isStrictReservedWord(word, inModule) {
+ return isReservedWord(word, inModule) || reservedWordsStrictSet.has(word);
+}
+
+function isStrictBindOnlyReservedWord(word) {
+ return reservedWordsStrictBindSet.has(word);
+}
+
+function isStrictBindReservedWord(word, inModule) {
+ return isStrictReservedWord(word, inModule) || isStrictBindOnlyReservedWord(word);
+}
+
+function isKeyword(word) {
+ return keywords.has(word);
+}
+
+/***/ }),
+/* 783 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+var _utils = _interopRequireWildcard(__webpack_require__(571));
+
+function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
+
+function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } 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)("SymbolTypeAnnotation", {
+ 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"]
+});
+(0, _utils.default)("EnumDeclaration", {
+ aliases: ["Statement", "Declaration"],
+ visitor: ["id", "body"],
+ fields: {
+ id: (0, _utils.validateType)("Identifier"),
+ body: (0, _utils.validateType)(["EnumBooleanBody", "EnumNumberBody", "EnumStringBody", "EnumSymbolBody"])
+ }
+});
+(0, _utils.default)("EnumBooleanBody", {
+ aliases: ["EnumBody"],
+ visitor: ["members"],
+ fields: {
+ explicit: (0, _utils.validate)((0, _utils.assertValueType)("boolean")),
+ members: (0, _utils.validateArrayOfType)("EnumBooleanMember")
+ }
+});
+(0, _utils.default)("EnumNumberBody", {
+ aliases: ["EnumBody"],
+ visitor: ["members"],
+ fields: {
+ explicit: (0, _utils.validate)((0, _utils.assertValueType)("boolean")),
+ members: (0, _utils.validateArrayOfType)("EnumNumberMember")
+ }
+});
+(0, _utils.default)("EnumStringBody", {
+ aliases: ["EnumBody"],
+ visitor: ["members"],
+ fields: {
+ explicit: (0, _utils.validate)((0, _utils.assertValueType)("boolean")),
+ members: (0, _utils.validateArrayOfType)(["EnumStringMember", "EnumDefaultedMember"])
+ }
+});
+(0, _utils.default)("EnumSymbolBody", {
+ aliases: ["EnumBody"],
+ visitor: ["members"],
+ fields: {
+ members: (0, _utils.validateArrayOfType)("EnumDefaultedMember")
+ }
+});
+(0, _utils.default)("EnumBooleanMember", {
+ aliases: ["EnumMember"],
+ visitor: ["id"],
+ fields: {
+ id: (0, _utils.validateType)("Identifier"),
+ init: (0, _utils.validateType)("BooleanLiteral")
+ }
+});
+(0, _utils.default)("EnumNumberMember", {
+ aliases: ["EnumMember"],
+ visitor: ["id", "init"],
+ fields: {
+ id: (0, _utils.validateType)("Identifier"),
+ init: (0, _utils.validateType)("NumericLiteral")
+ }
+});
+(0, _utils.default)("EnumStringMember", {
+ aliases: ["EnumMember"],
+ visitor: ["id", "init"],
+ fields: {
+ id: (0, _utils.validateType)("Identifier"),
+ init: (0, _utils.validateType)("StringLiteral")
+ }
+});
+(0, _utils.default)("EnumDefaultedMember", {
+ aliases: ["EnumMember"],
+ visitor: ["id"],
+ fields: {
+ id: (0, _utils.validateType)("Identifier")
+ }
+});
+
+/***/ }),
+/* 784 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+var _utils = _interopRequireWildcard(__webpack_require__(571));
+
+function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
+
+function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } 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", "JSXNamespacedName")
+ }
+ }
+});
+(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")))
+ },
+ selfClosing: {
+ validate: (0, _utils.assertValueType)("boolean"),
+ optional: true
+ }
+ }
+});
+(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", "JSXNamespacedName")
+ },
+ selfClosing: {
+ default: false
+ },
+ 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"]
+});
+
+/***/ }),
+/* 785 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+var _utils = _interopRequireWildcard(__webpack_require__(571));
+
+var _placeholders = __webpack_require__(668);
+
+function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
+
+function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } 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)
+ }
+ }
+});
+(0, _utils.default)("V8IntrinsicIdentifier", {
+ builder: ["name"],
+ fields: {
+ name: {
+ validate: (0, _utils.assertValueType)("string")
+ }
+ }
+});
+
+/***/ }),
+/* 786 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+var _utils = _interopRequireWildcard(__webpack_require__(571));
+
+var _es = __webpack_require__(628);
+
+var _core = __webpack_require__(600);
+
+function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
+
+function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } 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: !Object({"NODE_ENV":"production"}).BABEL_TYPES_8_BREAKING ? {
+ object: {
+ validate: Object.assign(() => {}, {
+ oneOfNodeTypes: ["Expression"]
+ })
+ },
+ callee: {
+ validate: Object.assign(() => {}, {
+ oneOfNodeTypes: ["Expression"]
+ })
+ }
+ } : {
+ object: {
+ validate: (0, _utils.assertNodeType)("Expression")
+ },
+ callee: {
+ validate: (0, _utils.assertNodeType)("Expression")
+ }
+ }
+});
+(0, _utils.default)("ClassProperty", {
+ visitor: ["key", "value", "typeAnnotation", "decorators"],
+ builder: ["key", "value", "typeAnnotation", "decorators", "computed", "static"],
+ 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
+ },
+ declare: {
+ 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");
+
+ const validator = function (node, key, val) {
+ const validator = node.computed ? computed : normal;
+ validator(node, key, val);
+ };
+
+ validator.oneOfNodeTypes = ["Expression", "Identifier"];
+ return validator;
+ }()
+ },
+ computed: {
+ default: false
+ },
+ optional: {
+ validate: !Object({"NODE_ENV":"production"}).BABEL_TYPES_8_BREAKING ? (0, _utils.assertValueType)("boolean") : (0, _utils.chain)((0, _utils.assertValueType)("boolean"), (0, _utils.assertOptionalChainStart)())
+ }
+ }
+});
+(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: !Object({"NODE_ENV":"production"}).BABEL_TYPES_8_BREAKING ? (0, _utils.assertValueType)("boolean") : (0, _utils.chain)((0, _utils.assertValueType)("boolean"), (0, _utils.assertOptionalChainStart)())
+ },
+ typeArguments: {
+ validate: (0, _utils.assertNodeType)("TypeParameterInstantiation"),
+ optional: true
+ },
+ typeParameters: {
+ validate: (0, _utils.assertNodeType)("TSTypeParameterInstantiation"),
+ optional: true
+ }
+ }
+});
+(0, _utils.default)("ClassPrivateProperty", {
+ visitor: ["key", "value", "decorators"],
+ builder: ["key", "value", "decorators"],
+ aliases: ["Property", "Private"],
+ fields: {
+ key: {
+ validate: (0, _utils.assertNodeType)("PrivateName")
+ },
+ value: {
+ validate: (0, _utils.assertNodeType)("Expression"),
+ optional: true
+ },
+ decorators: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Decorator"))),
+ 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, _core.functionTypeAnnotationCommon, {
+ key: {
+ validate: (0, _utils.assertNodeType)("PrivateName")
+ },
+ body: {
+ validate: (0, _utils.assertNodeType)("BlockStatement")
+ }
+ })
+});
+(0, _utils.default)("Import", {
+ aliases: ["Expression"]
+});
+(0, _utils.default)("ImportAttribute", {
+ visitor: ["key", "value"],
+ fields: {
+ key: {
+ validate: (0, _utils.assertNodeType)("Identifier")
+ },
+ value: {
+ validate: (0, _utils.assertNodeType)("StringLiteral")
+ }
+ }
+});
+(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"]
+});
+(0, _utils.default)("RecordExpression", {
+ visitor: ["properties"],
+ aliases: ["Expression"],
+ fields: {
+ properties: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("ObjectProperty", "SpreadElement")))
+ }
+ }
+});
+(0, _utils.default)("TupleExpression", {
+ fields: {
+ elements: {
+ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Expression", "SpreadElement"))),
+ default: []
+ }
+ },
+ visitor: ["elements"],
+ aliases: ["Expression"]
+});
+
+/***/ }),
+/* 787 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+var _utils = _interopRequireWildcard(__webpack_require__(571));
+
+var _core = __webpack_require__(600);
+
+var _es = __webpack_require__(628);
+
+function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
+
+function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } 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", "TSBooleanKeyword", "TSBigIntKeyword", "TSNeverKeyword", "TSNullKeyword", "TSNumberKeyword", "TSObjectKeyword", "TSStringKeyword", "TSSymbolKeyword", "TSUndefinedKeyword", "TSUnknownKeyword", "TSVoidKeyword"];
+
+for (const type of tsKeywordTypes) {
+ (0, _utils.default)(type, {
+ aliases: ["TSType", "TSBaseType"],
+ visitor: [],
+ fields: {}
+ });
+}
+
+(0, _utils.default)("TSThisType", {
+ aliases: ["TSType", "TSBaseType"],
+ 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"],
+ builder: ["parameterName", "typeAnnotation", "asserts"],
+ fields: {
+ parameterName: (0, _utils.validateType)(["Identifier", "TSThisType"]),
+ typeAnnotation: (0, _utils.validateOptionalType)("TSTypeAnnotation"),
+ asserts: (0, _utils.validateOptional)(bool)
+ }
+});
+(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", "TSBaseType"],
+ visitor: ["literal"],
+ fields: {
+ literal: (0, _utils.validateType)(["NumericLiteral", "StringLiteral", "BooleanLiteral", "BigIntLiteral"])
+ }
+});
+(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", {
+ builder: ["constraint", "default", "name"],
+ 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
+ }
+ }
+});
+
+/***/ }),
+/* 788 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = assertNode;
+
+var _isNode = _interopRequireDefault(__webpack_require__(669));
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+function assertNode(node) {
+ if (!(0, _isNode.default)(node)) {
+ var _node$type;
+
+ const type = (_node$type = node == null ? void 0 : node.type) != null ? _node$type : JSON.stringify(node);
+ throw new TypeError(`Not a valid node of type "${type}"`);
+ }
+}
+
+/***/ }),
+/* 789 */
+/***/ (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.assertClassExpression = assertClassExpression;
+exports.assertClassDeclaration = assertClassDeclaration;
+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.assertSymbolTypeAnnotation = assertSymbolTypeAnnotation;
+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.assertEnumDeclaration = assertEnumDeclaration;
+exports.assertEnumBooleanBody = assertEnumBooleanBody;
+exports.assertEnumNumberBody = assertEnumNumberBody;
+exports.assertEnumStringBody = assertEnumStringBody;
+exports.assertEnumSymbolBody = assertEnumSymbolBody;
+exports.assertEnumBooleanMember = assertEnumBooleanMember;
+exports.assertEnumNumberMember = assertEnumNumberMember;
+exports.assertEnumStringMember = assertEnumStringMember;
+exports.assertEnumDefaultedMember = assertEnumDefaultedMember;
+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.assertV8IntrinsicIdentifier = assertV8IntrinsicIdentifier;
+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.assertImportAttribute = assertImportAttribute;
+exports.assertDecorator = assertDecorator;
+exports.assertDoExpression = assertDoExpression;
+exports.assertExportDefaultSpecifier = assertExportDefaultSpecifier;
+exports.assertExportNamespaceSpecifier = assertExportNamespaceSpecifier;
+exports.assertPrivateName = assertPrivateName;
+exports.assertBigIntLiteral = assertBigIntLiteral;
+exports.assertRecordExpression = assertRecordExpression;
+exports.assertTupleExpression = assertTupleExpression;
+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.assertTSBooleanKeyword = assertTSBooleanKeyword;
+exports.assertTSBigIntKeyword = assertTSBigIntKeyword;
+exports.assertTSNeverKeyword = assertTSNeverKeyword;
+exports.assertTSNullKeyword = assertTSNullKeyword;
+exports.assertTSNumberKeyword = assertTSNumberKeyword;
+exports.assertTSObjectKeyword = assertTSObjectKeyword;
+exports.assertTSStringKeyword = assertTSStringKeyword;
+exports.assertTSSymbolKeyword = assertTSSymbolKeyword;
+exports.assertTSUndefinedKeyword = assertTSUndefinedKeyword;
+exports.assertTSUnknownKeyword = assertTSUnknownKeyword;
+exports.assertTSVoidKeyword = assertTSVoidKeyword;
+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.assertEnumBody = assertEnumBody;
+exports.assertEnumMember = assertEnumMember;
+exports.assertJSX = assertJSX;
+exports.assertPrivate = assertPrivate;
+exports.assertTSTypeElement = assertTSTypeElement;
+exports.assertTSType = assertTSType;
+exports.assertTSBaseType = assertTSBaseType;
+exports.assertNumberLiteral = assertNumberLiteral;
+exports.assertRegexLiteral = assertRegexLiteral;
+exports.assertRestProperty = assertRestProperty;
+exports.assertSpreadProperty = assertSpreadProperty;
+
+var _is = _interopRequireDefault(__webpack_require__(579));
+
+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 assertClassExpression(node, opts = {}) {
+ assert("ClassExpression", node, opts);
+}
+
+function assertClassDeclaration(node, opts = {}) {
+ assert("ClassDeclaration", 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 assertSymbolTypeAnnotation(node, opts = {}) {
+ assert("SymbolTypeAnnotation", 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 assertEnumDeclaration(node, opts = {}) {
+ assert("EnumDeclaration", node, opts);
+}
+
+function assertEnumBooleanBody(node, opts = {}) {
+ assert("EnumBooleanBody", node, opts);
+}
+
+function assertEnumNumberBody(node, opts = {}) {
+ assert("EnumNumberBody", node, opts);
+}
+
+function assertEnumStringBody(node, opts = {}) {
+ assert("EnumStringBody", node, opts);
+}
+
+function assertEnumSymbolBody(node, opts = {}) {
+ assert("EnumSymbolBody", node, opts);
+}
+
+function assertEnumBooleanMember(node, opts = {}) {
+ assert("EnumBooleanMember", node, opts);
+}
+
+function assertEnumNumberMember(node, opts = {}) {
+ assert("EnumNumberMember", node, opts);
+}
+
+function assertEnumStringMember(node, opts = {}) {
+ assert("EnumStringMember", node, opts);
+}
+
+function assertEnumDefaultedMember(node, opts = {}) {
+ assert("EnumDefaultedMember", 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 assertV8IntrinsicIdentifier(node, opts = {}) {
+ assert("V8IntrinsicIdentifier", 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 assertImportAttribute(node, opts = {}) {
+ assert("ImportAttribute", 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 assertRecordExpression(node, opts = {}) {
+ assert("RecordExpression", node, opts);
+}
+
+function assertTupleExpression(node, opts = {}) {
+ assert("TupleExpression", 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 assertTSBooleanKeyword(node, opts = {}) {
+ assert("TSBooleanKeyword", node, opts);
+}
+
+function assertTSBigIntKeyword(node, opts = {}) {
+ assert("TSBigIntKeyword", node, opts);
+}
+
+function assertTSNeverKeyword(node, opts = {}) {
+ assert("TSNeverKeyword", node, opts);
+}
+
+function assertTSNullKeyword(node, opts = {}) {
+ assert("TSNullKeyword", node, opts);
+}
+
+function assertTSNumberKeyword(node, opts = {}) {
+ assert("TSNumberKeyword", node, opts);
+}
+
+function assertTSObjectKeyword(node, opts = {}) {
+ assert("TSObjectKeyword", node, opts);
+}
+
+function assertTSStringKeyword(node, opts = {}) {
+ assert("TSStringKeyword", node, opts);
+}
+
+function assertTSSymbolKeyword(node, opts = {}) {
+ assert("TSSymbolKeyword", node, opts);
+}
+
+function assertTSUndefinedKeyword(node, opts = {}) {
+ assert("TSUndefinedKeyword", node, opts);
+}
+
+function assertTSUnknownKeyword(node, opts = {}) {
+ assert("TSUnknownKeyword", node, opts);
+}
+
+function assertTSVoidKeyword(node, opts = {}) {
+ assert("TSVoidKeyword", 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 assertEnumBody(node, opts = {}) {
+ assert("EnumBody", node, opts);
+}
+
+function assertEnumMember(node, opts = {}) {
+ assert("EnumMember", 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 assertTSBaseType(node, opts = {}) {
+ assert("TSBaseType", 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);
+}
+
+/***/ }),
+/* 790 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = createTypeAnnotationBasedOnTypeof;
+
+var _generated = __webpack_require__(561);
+
+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");
+ }
+}
+
+/***/ }),
+/* 791 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = createFlowUnionType;
+
+var _generated = __webpack_require__(561);
+
+var _removeTypeDuplicates = _interopRequireDefault(__webpack_require__(670));
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+function createFlowUnionType(types) {
+ const flattened = (0, _removeTypeDuplicates.default)(types);
+
+ if (flattened.length === 1) {
+ return flattened[0];
+ } else {
+ return (0, _generated.unionTypeAnnotation)(flattened);
+ }
+}
+
+/***/ }),
+/* 792 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = createTSUnionType;
+
+var _generated = __webpack_require__(561);
+
+var _removeTypeDuplicates = _interopRequireDefault(__webpack_require__(793));
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+function createTSUnionType(typeAnnotations) {
+ const types = typeAnnotations.map(type => type.typeAnnotations);
+ const flattened = (0, _removeTypeDuplicates.default)(types);
+
+ if (flattened.length === 1) {
+ return flattened[0];
+ } else {
+ return (0, _generated.TSUnionType)(flattened);
+ }
+}
+
+/***/ }),
+/* 793 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = removeTypeDuplicates;
+
+var _generated = __webpack_require__(559);
+
+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.isTSAnyKeyword)(node.type)) {
+ return [node];
+ }
+
+ if ((0, _generated.isTSBaseType)(node)) {
+ bases[node.type] = node;
+ continue;
+ }
+
+ if ((0, _generated.isTSUnionType)(node)) {
+ if (typeGroups.indexOf(node.types) < 0) {
+ nodes = nodes.concat(node.types);
+ typeGroups.push(node.types);
+ }
+
+ 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;
+}
+
+/***/ }),
+/* 794 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = clone;
+
+var _cloneNode = _interopRequireDefault(__webpack_require__(576));
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+function clone(node) {
+ return (0, _cloneNode.default)(node, false);
+}
+
+/***/ }),
+/* 795 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = cloneDeep;
+
+var _cloneNode = _interopRequireDefault(__webpack_require__(576));
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+function cloneDeep(node) {
+ return (0, _cloneNode.default)(node);
+}
+
+/***/ }),
+/* 796 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = cloneDeepWithoutLoc;
+
+var _cloneNode = _interopRequireDefault(__webpack_require__(576));
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+function cloneDeepWithoutLoc(node) {
+ return (0, _cloneNode.default)(node, true, true);
+}
+
+/***/ }),
+/* 797 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = cloneWithoutLoc;
+
+var _cloneNode = _interopRequireDefault(__webpack_require__(576));
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+function cloneWithoutLoc(node) {
+ return (0, _cloneNode.default)(node, false, true);
+}
+
+/***/ }),
+/* 798 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = addComment;
+
+var _addComments = _interopRequireDefault(__webpack_require__(671));
+
+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
+ }]);
+}
+
+/***/ }),
+/* 799 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var baseUniq = __webpack_require__(800);
+
+/**
+ * Creates a duplicate-free version of an array, using
+ * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
+ * for equality comparisons, in which only the first occurrence of each element
+ * is kept. The order of result values is determined by the order they occur
+ * in the array.
+ *
+ * @static
+ * @memberOf _
+ * @since 0.1.0
+ * @category Array
+ * @param {Array} array The array to inspect.
+ * @returns {Array} Returns the new duplicate free array.
+ * @example
+ *
+ * _.uniq([2, 1, 2]);
+ * // => [2, 1]
+ */
+function uniq(array) {
+ return (array && array.length) ? baseUniq(array) : [];
+}
+
+module.exports = uniq;
+
+
+/***/ }),
+/* 800 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var SetCache = __webpack_require__(673),
+ arrayIncludes = __webpack_require__(803),
+ arrayIncludesWith = __webpack_require__(807),
+ cacheHas = __webpack_require__(674),
+ createSet = __webpack_require__(808),
+ setToArray = __webpack_require__(631);
+
+/** Used as the size to enable large array optimizations. */
+var LARGE_ARRAY_SIZE = 200;
+
+/**
+ * The base implementation of `_.uniqBy` without support for iteratee shorthands.
+ *
+ * @private
+ * @param {Array} array The array to inspect.
+ * @param {Function} [iteratee] The iteratee invoked per element.
+ * @param {Function} [comparator] The comparator invoked per element.
+ * @returns {Array} Returns the new duplicate free array.
+ */
+function baseUniq(array, iteratee, comparator) {
+ var index = -1,
+ includes = arrayIncludes,
+ length = array.length,
+ isCommon = true,
+ result = [],
+ seen = result;
+
+ if (comparator) {
+ isCommon = false;
+ includes = arrayIncludesWith;
+ }
+ else if (length >= LARGE_ARRAY_SIZE) {
+ var set = iteratee ? null : createSet(array);
+ if (set) {
+ return setToArray(set);
+ }
+ isCommon = false;
+ includes = cacheHas;
+ seen = new SetCache;
+ }
+ else {
+ seen = iteratee ? [] : result;
+ }
+ outer:
+ while (++index < length) {
+ var value = array[index],
+ computed = iteratee ? iteratee(value) : value;
+
+ value = (comparator || value !== 0) ? value : 0;
+ if (isCommon && computed === computed) {
+ var seenIndex = seen.length;
+ while (seenIndex--) {
+ if (seen[seenIndex] === computed) {
+ continue outer;
+ }
+ }
+ if (iteratee) {
+ seen.push(computed);
+ }
+ result.push(value);
+ }
+ else if (!includes(seen, computed, comparator)) {
+ if (seen !== result) {
+ seen.push(computed);
+ }
+ result.push(value);
+ }
+ }
+ return result;
+}
+
+module.exports = baseUniq;
+
+
+/***/ }),
+/* 801 */
+/***/ (function(module, exports) {
+
+/** Used to stand-in for `undefined` hash values. */
+var HASH_UNDEFINED = '__lodash_hash_undefined__';
+
+/**
+ * Adds `value` to the array cache.
+ *
+ * @private
+ * @name add
+ * @memberOf SetCache
+ * @alias push
+ * @param {*} value The value to cache.
+ * @returns {Object} Returns the cache instance.
+ */
+function setCacheAdd(value) {
+ this.__data__.set(value, HASH_UNDEFINED);
+ return this;
+}
+
+module.exports = setCacheAdd;
+
+
+/***/ }),
+/* 802 */
+/***/ (function(module, exports) {
+
+/**
+ * Checks if `value` is in the array cache.
+ *
+ * @private
+ * @name has
+ * @memberOf SetCache
+ * @param {*} value The value to search for.
+ * @returns {number} Returns `true` if `value` is found, else `false`.
+ */
+function setCacheHas(value) {
+ return this.__data__.has(value);
+}
+
+module.exports = setCacheHas;
+
+
+/***/ }),
+/* 803 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var baseIndexOf = __webpack_require__(804);
+
+/**
+ * A specialized version of `_.includes` for arrays without support for
+ * specifying an index to search from.
+ *
+ * @private
+ * @param {Array} [array] The array to inspect.
+ * @param {*} target The value to search for.
+ * @returns {boolean} Returns `true` if `target` is found, else `false`.
+ */
+function arrayIncludes(array, value) {
+ var length = array == null ? 0 : array.length;
+ return !!length && baseIndexOf(array, value, 0) > -1;
+}
+
+module.exports = arrayIncludes;
+
+
+/***/ }),
+/* 804 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var baseFindIndex = __webpack_require__(630),
+ baseIsNaN = __webpack_require__(805),
+ strictIndexOf = __webpack_require__(806);
+
+/**
+ * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
+ *
+ * @private
+ * @param {Array} array The array to inspect.
+ * @param {*} value The value to search for.
+ * @param {number} fromIndex The index to search from.
+ * @returns {number} Returns the index of the matched value, else `-1`.
+ */
+function baseIndexOf(array, value, fromIndex) {
+ return value === value
+ ? strictIndexOf(array, value, fromIndex)
+ : baseFindIndex(array, baseIsNaN, fromIndex);
+}
+
+module.exports = baseIndexOf;
+
+
+/***/ }),
+/* 805 */
+/***/ (function(module, exports) {
+
+/**
+ * The base implementation of `_.isNaN` without support for number objects.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
+ */
+function baseIsNaN(value) {
+ return value !== value;
+}
+
+module.exports = baseIsNaN;
+
+
+/***/ }),
+/* 806 */
+/***/ (function(module, exports) {
+
+/**
+ * A specialized version of `_.indexOf` which performs strict equality
+ * comparisons of values, i.e. `===`.
+ *
+ * @private
+ * @param {Array} array The array to inspect.
+ * @param {*} value The value to search for.
+ * @param {number} fromIndex The index to search from.
+ * @returns {number} Returns the index of the matched value, else `-1`.
+ */
+function strictIndexOf(array, value, fromIndex) {
+ var index = fromIndex - 1,
+ length = array.length;
+
+ while (++index < length) {
+ if (array[index] === value) {
+ return index;
+ }
+ }
+ return -1;
+}
+
+module.exports = strictIndexOf;
+
+
+/***/ }),
+/* 807 */
+/***/ (function(module, exports) {
+
+/**
+ * This function is like `arrayIncludes` except that it accepts a comparator.
+ *
+ * @private
+ * @param {Array} [array] The array to inspect.
+ * @param {*} target The value to search for.
+ * @param {Function} comparator The comparator invoked per element.
+ * @returns {boolean} Returns `true` if `target` is found, else `false`.
+ */
+function arrayIncludesWith(array, value, comparator) {
+ var index = -1,
+ length = array == null ? 0 : array.length;
+
+ while (++index < length) {
+ if (comparator(value, array[index])) {
+ return true;
+ }
+ }
+ return false;
+}
+
+module.exports = arrayIncludesWith;
+
+
+/***/ }),
+/* 808 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var Set = __webpack_require__(664),
+ noop = __webpack_require__(809),
+ setToArray = __webpack_require__(631);
+
+/** Used as references for various `Number` constants. */
+var INFINITY = 1 / 0;
+
+/**
+ * Creates a set object of `values`.
+ *
+ * @private
+ * @param {Array} values The values to add to the set.
+ * @returns {Object} Returns the new set.
+ */
+var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {
+ return new Set(values);
+};
+
+module.exports = createSet;
+
+
+/***/ }),
+/* 809 */
+/***/ (function(module, exports) {
+
+/**
+ * This method returns `undefined`.
+ *
+ * @static
+ * @memberOf _
+ * @since 2.3.0
+ * @category Util
+ * @example
+ *
+ * _.times(2, _.noop);
+ * // => [undefined, undefined]
+ */
+function noop() {
+ // No operation performed.
+}
+
+module.exports = noop;
+
+
+/***/ }),
+/* 810 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = removeComments;
+
+var _constants = __webpack_require__(575);
+
+function removeComments(node) {
+ _constants.COMMENT_KEYS.forEach(key => {
+ node[key] = null;
+ });
+
+ return node;
+}
+
+/***/ }),
+/* 811 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.TSBASETYPE_TYPES = exports.TSTYPE_TYPES = exports.TSTYPEELEMENT_TYPES = exports.PRIVATE_TYPES = exports.JSX_TYPES = exports.ENUMMEMBER_TYPES = exports.ENUMBODY_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__(564);
+
+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 ENUMBODY_TYPES = _definitions.FLIPPED_ALIAS_KEYS["EnumBody"];
+exports.ENUMBODY_TYPES = ENUMBODY_TYPES;
+const ENUMMEMBER_TYPES = _definitions.FLIPPED_ALIAS_KEYS["EnumMember"];
+exports.ENUMMEMBER_TYPES = ENUMMEMBER_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;
+const TSBASETYPE_TYPES = _definitions.FLIPPED_ALIAS_KEYS["TSBaseType"];
+exports.TSBASETYPE_TYPES = TSBASETYPE_TYPES;
+
+/***/ }),
+/* 812 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = ensureBlock;
+
+var _toBlock = _interopRequireDefault(__webpack_require__(678));
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+function ensureBlock(node, key = "body") {
+ return node[key] = (0, _toBlock.default)(node[key], node);
+}
+
+/***/ }),
+/* 813 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = toBindingIdentifierName;
+
+var _toIdentifier = _interopRequireDefault(__webpack_require__(679));
+
+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;
+}
+
+/***/ }),
+/* 814 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = toComputedKey;
+
+var _generated = __webpack_require__(559);
+
+var _generated2 = __webpack_require__(561);
+
+function toComputedKey(node, key = node.key || node.property) {
+ if (!node.computed && (0, _generated.isIdentifier)(key)) key = (0, _generated2.stringLiteral)(key.name);
+ return key;
+}
+
+/***/ }),
+/* 815 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = toExpression;
+
+var _generated = __webpack_require__(559);
+
+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;
+}
+
+/***/ }),
+/* 816 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = toKeyAlias;
+
+var _generated = __webpack_require__(559);
+
+var _cloneNode = _interopRequireDefault(__webpack_require__(576));
+
+var _removePropertiesDeep = _interopRequireDefault(__webpack_require__(680));
+
+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++;
+ }
+};
+
+/***/ }),
+/* 817 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = toSequenceExpression;
+
+var _gatherSequenceExpressions = _interopRequireDefault(__webpack_require__(818));
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+function toSequenceExpression(nodes, scope) {
+ if (!(nodes == null ? void 0 : 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;
+}
+
+/***/ }),
+/* 818 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = gatherSequenceExpressions;
+
+var _getBindingIdentifiers = _interopRequireDefault(__webpack_require__(601));
+
+var _generated = __webpack_require__(559);
+
+var _generated2 = __webpack_require__(561);
+
+var _cloneNode = _interopRequireDefault(__webpack_require__(576));
+
+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) {
+ if (!(0, _generated.isEmptyStatement)(node)) {
+ 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)) {
+ if (nodes.indexOf(node) === 0) {
+ ensureLastUndefined = true;
+ }
+ } else {
+ return;
+ }
+ }
+
+ if (ensureLastUndefined) {
+ exprs.push(scope.buildUndefinedNode());
+ }
+
+ if (exprs.length === 1) {
+ return exprs[0];
+ } else {
+ return (0, _generated2.sequenceExpression)(exprs);
+ }
+}
+
+/***/ }),
+/* 819 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = toStatement;
+
+var _generated = __webpack_require__(559);
+
+var _generated2 = __webpack_require__(561);
+
+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;
+}
+
+/***/ }),
+/* 820 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = valueToNode;
+
+var _isPlainObject = _interopRequireDefault(__webpack_require__(821));
+
+var _isRegExp = _interopRequireDefault(__webpack_require__(822));
+
+var _isValidIdentifier = _interopRequireDefault(__webpack_require__(580));
+
+var _generated = __webpack_require__(561);
+
+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");
+}
+
+/***/ }),
+/* 821 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var baseGetTag = __webpack_require__(569),
+ getPrototype = __webpack_require__(624),
+ isObjectLike = __webpack_require__(565);
+
+/** `Object#toString` result references. */
+var objectTag = '[object Object]';
+
+/** Used for built-in method references. */
+var funcProto = Function.prototype,
+ objectProto = Object.prototype;
+
+/** Used to resolve the decompiled source of functions. */
+var funcToString = funcProto.toString;
+
+/** Used to check objects for own properties. */
+var hasOwnProperty = objectProto.hasOwnProperty;
+
+/** Used to infer the `Object` constructor. */
+var objectCtorString = funcToString.call(Object);
+
+/**
+ * Checks if `value` is a plain object, that is, an object created by the
+ * `Object` constructor or one with a `[[Prototype]]` of `null`.
+ *
+ * @static
+ * @memberOf _
+ * @since 0.8.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
+ * @example
+ *
+ * function Foo() {
+ * this.a = 1;
+ * }
+ *
+ * _.isPlainObject(new Foo);
+ * // => false
+ *
+ * _.isPlainObject([1, 2, 3]);
+ * // => false
+ *
+ * _.isPlainObject({ 'x': 0, 'y': 0 });
+ * // => true
+ *
+ * _.isPlainObject(Object.create(null));
+ * // => true
+ */
+function isPlainObject(value) {
+ if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
+ return false;
+ }
+ var proto = getPrototype(value);
+ if (proto === null) {
+ return true;
+ }
+ var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
+ return typeof Ctor == 'function' && Ctor instanceof Ctor &&
+ funcToString.call(Ctor) == objectCtorString;
+}
+
+module.exports = isPlainObject;
+
+
+/***/ }),
+/* 822 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var baseIsRegExp = __webpack_require__(823),
+ baseUnary = __webpack_require__(596),
+ nodeUtil = __webpack_require__(597);
+
+/* Node.js helper references. */
+var nodeIsRegExp = nodeUtil && nodeUtil.isRegExp;
+
+/**
+ * Checks if `value` is classified as a `RegExp` object.
+ *
+ * @static
+ * @memberOf _
+ * @since 0.1.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
+ * @example
+ *
+ * _.isRegExp(/abc/);
+ * // => true
+ *
+ * _.isRegExp('/abc/');
+ * // => false
+ */
+var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;
+
+module.exports = isRegExp;
+
+
+/***/ }),
+/* 823 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var baseGetTag = __webpack_require__(569),
+ isObjectLike = __webpack_require__(565);
+
+/** `Object#toString` result references. */
+var regexpTag = '[object RegExp]';
+
+/**
+ * The base implementation of `_.isRegExp` without Node.js optimizations.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
+ */
+function baseIsRegExp(value) {
+ return isObjectLike(value) && baseGetTag(value) == regexpTag;
+}
+
+module.exports = baseIsRegExp;
+
+
+/***/ }),
+/* 824 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = appendToMemberExpression;
+
+var _generated = __webpack_require__(561);
+
+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;
+}
+
+/***/ }),
+/* 825 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = inherits;
+
+var _constants = __webpack_require__(575);
+
+var _inheritsComments = _interopRequireDefault(__webpack_require__(676));
+
+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;
+}
+
+/***/ }),
+/* 826 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = prependToMemberExpression;
+
+var _generated = __webpack_require__(561);
+
+function prependToMemberExpression(member, prepend) {
+ member.object = (0, _generated.memberExpression)(prepend, member.object);
+ return member;
+}
+
+/***/ }),
+/* 827 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = getOuterBindingIdentifiers;
+
+var _getBindingIdentifiers = _interopRequireDefault(__webpack_require__(601));
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+function getOuterBindingIdentifiers(node, duplicates) {
+ return (0, _getBindingIdentifiers.default)(node, duplicates, true);
+}
+
+/***/ }),
+/* 828 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = traverse;
+
+var _definitions = __webpack_require__(564);
+
+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);
+}
+
+/***/ }),
+/* 829 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = isBinding;
+
+var _getBindingIdentifiers = _interopRequireDefault(__webpack_require__(601));
+
+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;
+}
+
+/***/ }),
+/* 830 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = isBlockScoped;
+
+var _generated = __webpack_require__(559);
+
+var _isLet = _interopRequireDefault(__webpack_require__(683));
+
+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);
+}
+
+/***/ }),
+/* 831 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = isImmutable;
+
+var _isType = _interopRequireDefault(__webpack_require__(626));
+
+var _generated = __webpack_require__(559);
+
+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;
+}
+
+/***/ }),
+/* 832 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = isNodesEquivalent;
+
+var _definitions = __webpack_require__(564);
+
+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 == null ? void 0 : 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;
+}
+
+/***/ }),
+/* 833 */
+/***/ (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 "ClassMethod":
+ case "ClassPrivateMethod":
+ case "ObjectMethod":
+ if (parent.params.includes(node)) {
+ return false;
+ }
+
+ case "ObjectProperty":
+ case "ClassProperty":
+ case "ClassPrivateProperty":
+ 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;
+}
+
+/***/ }),
+/* 834 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = isScope;
+
+var _generated = __webpack_require__(559);
+
+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;
+ }
+
+ if ((0, _generated.isPattern)(node) && (0, _generated.isFunction)(parent)) {
+ return true;
+ }
+
+ return (0, _generated.isScopable)(node);
+}
+
+/***/ }),
+/* 835 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = isSpecifierDefault;
+
+var _generated = __webpack_require__(559);
+
+function isSpecifierDefault(specifier) {
+ return (0, _generated.isImportDefaultSpecifier)(specifier) || (0, _generated.isIdentifier)(specifier.imported || specifier.exported, {
+ name: "default"
+ });
+}
+
+/***/ }),
+/* 836 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = isValidES3Identifier;
+
+var _isValidIdentifier = _interopRequireDefault(__webpack_require__(580));
+
+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);
+}
+
+/***/ }),
+/* 837 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = isVar;
+
+var _generated = __webpack_require__(559);
+
+var _constants = __webpack_require__(575);
+
+function isVar(node) {
+ return (0, _generated.isVariableDeclaration)(node, {
+ kind: "var"
+ }) && !node[_constants.BLOCK_SCOPED_SYMBOL];
+}
+
+/***/ }),
+/* 838 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.parseScriptTags = exports.parseScripts = exports.parseScript = exports.getCandidateScriptLocations = exports.generateWhitespace = exports.extractScriptTags = undefined;
+
+var _types = __webpack_require__(2);
+
+var types = _interopRequireWildcard(_types);
+
+var _parser = __webpack_require__(685);
+
+var parser = _interopRequireWildcard(_parser);
+
+var _customParse = __webpack_require__(839);
+
+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)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
+
+function parseScript(_ref) {
+ var source = _ref.source,
+ line = _ref.line;
+
+ // remove empty or only whitespace scripts
+ if (source.length === 0 || /^\s+$/.test(source)) {
+ return null;
+ }
+
+ try {
+ return parser.parse(source, {
+ sourceType: "script",
+ startLine: line
+ });
+ } catch (e) {
+ return null;
+ }
+}
+
+function parseScripts(locations) {
+ var parser = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : parseScript;
+
+ return (0, _customParse.parseScripts)(locations, parser);
+}
+
+function extractScriptTags(source) {
+ return parseScripts((0, _customParse.getCandidateScriptLocations)(source), function (loc) {
+ var ast = parseScript(loc);
+
+ if (ast) {
+ return loc;
+ }
+
+ return null;
+ }).filter(types.isFile);
+}
+
+function parseScriptTags(source) {
+ var parser = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : parseScript;
+
+ return (0, _customParse.parseScriptTags)(source, parser);
+}
+
+exports.default = parseScriptTags;
+exports.extractScriptTags = extractScriptTags;
+exports.generateWhitespace = _customParse.generateWhitespace;
+exports.getCandidateScriptLocations = _customParse.getCandidateScriptLocations;
+exports.parseScript = parseScript;
+exports.parseScripts = parseScripts;
+exports.parseScriptTags = parseScriptTags;
+
+/***/ }),
+/* 839 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.parseScriptTags = exports.parseScripts = exports.getCandidateScriptLocations = exports.generateWhitespace = undefined;
+
+var _types = __webpack_require__(2);
+
+var types = _interopRequireWildcard(_types);
+
+var _parseScriptFragment = __webpack_require__(840);
+
+var _parseScriptFragment2 = _interopRequireDefault(_parseScriptFragment);
+
+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)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
+
+function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
+
+var startScript = /<script[^>]*>/im;
+var endScript = /<\/script\s*>/im;
+// https://stackoverflow.com/questions/5034781/js-regex-to-split-by-line#comment5633979_5035005
+var newLines = /\r\n|[\n\v\f\r\x85\u2028\u2029]/;
+
+function getType(tag) {
+ var fragment = (0, _parseScriptFragment2.default)(tag);
+
+ if (fragment) {
+ var type = fragment.attributes.type;
+
+ return type ? type.toLowerCase() : null;
+ }
+
+ return null;
+}
+
+function getCandidateScriptLocations(source, index) {
+ var i = index || 0;
+ var str = source.substring(i);
+
+ var startMatch = startScript.exec(str);
+ if (startMatch) {
+ var startsAt = startMatch.index + startMatch[0].length;
+ var afterStart = str.substring(startsAt);
+ var endMatch = endScript.exec(afterStart);
+ if (endMatch) {
+ var locLength = endMatch.index;
+ var locIndex = i + startsAt;
+ var endIndex = locIndex + locLength + endMatch[0].length;
+
+ // extract the complete tag (incl start and end tags and content). if the
+ // type is invalid (= not JS), skip this tag and continue
+ var tag = source.substring(i + startMatch.index, endIndex);
+ var type = getType(tag);
+ if (type && type !== "javascript" && type !== "text/javascript") {
+ return getCandidateScriptLocations(source, endIndex);
+ }
+
+ return [adjustForLineAndColumn(source, {
+ index: locIndex,
+ length: locLength,
+ source: source.substring(locIndex, locIndex + locLength)
+ })].concat(_toConsumableArray(getCandidateScriptLocations(source, endIndex)));
+ }
+ }
+
+ return [];
+}
+
+function parseScripts(locations, parser) {
+ return locations.map(parser);
+}
+
+function generateWhitespace(length) {
+ return Array.from(new Array(length + 1)).join(" ");
+}
+
+function calcLineAndColumn(source, index) {
+ var lines = source.substring(0, index).split(newLines);
+ var line = lines.length;
+ var column = lines.pop().length + 1;
+
+ return {
+ column: column,
+ line: line
+ };
+}
+
+function adjustForLineAndColumn(fullSource, location) {
+ var _calcLineAndColumn = calcLineAndColumn(fullSource, location.index),
+ column = _calcLineAndColumn.column,
+ line = _calcLineAndColumn.line;
+
+ return Object.assign({}, location, {
+ line: line,
+ column: column,
+ // prepend whitespace for scripts that do not start on the first column
+ source: generateWhitespace(column) + location.source
+ });
+}
+
+function parseScriptTags(source, parser) {
+ var scripts = parseScripts(getCandidateScriptLocations(source), parser).filter(types.isFile).reduce(function (main, script) {
+ return {
+ statements: main.statements.concat(script.program.body),
+ comments: main.comments.concat(script.comments),
+ tokens: main.tokens.concat(script.tokens)
+ };
+ }, {
+ statements: [],
+ comments: [],
+ tokens: []
+ });
+
+ var program = types.program(scripts.statements);
+ var file = types.file(program, scripts.comments, scripts.tokens);
+
+ var end = calcLineAndColumn(source, source.length);
+ file.start = program.start = 0;
+ file.end = program.end = source.length;
+ file.loc = program.loc = {
+ start: {
+ line: 1,
+ column: 0
+ },
+ end: end
+ };
+
+ return file;
+}
+
+exports.default = parseScriptTags;
+exports.generateWhitespace = generateWhitespace;
+exports.getCandidateScriptLocations = getCandidateScriptLocations;
+exports.parseScripts = parseScripts;
+exports.parseScriptTags = parseScriptTags;
+
+/***/ }),
+/* 840 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+
+var alphanum = /[a-z0-9\-]/i;
+
+function parseToken(str, start) {
+ var i = start;
+ while (i < str.length && alphanum.test(str.charAt(i++))) {
+ continue;
+ }
+
+ if (i !== start) {
+ return {
+ token: str.substring(start, i - 1),
+ index: i
+ };
+ }
+
+ return null;
+}
+
+function parseAttributes(str, start) {
+ var i = start;
+ var attributes = {};
+ var attribute = null;
+
+ while (i < str.length) {
+ var c = str.charAt(i);
+
+ if (attribute === null && c == ">") {
+ break;
+ } else if (attribute === null && alphanum.test(c)) {
+ attribute = {
+ name: null,
+ value: true,
+ bool: true,
+ terminator: null
+ };
+
+ var attributeNameNode = parseToken(str, i);
+ if (attributeNameNode) {
+ attribute.name = attributeNameNode.token;
+ i = attributeNameNode.index - 2;
+ }
+ } else if (attribute !== null) {
+ if (c === "=") {
+ // once we've started an attribute, look for = to indicate
+ // it's a non-boolean attribute
+ attribute.bool = false;
+ if (attribute.value === true) {
+ attribute.value = "";
+ }
+ } else if (!attribute.bool && attribute.terminator === null && (c === '"' || c === "'")) {
+ // once we've determined it's non-boolean, look for a
+ // value terminator (", ')
+ attribute.terminator = c;
+ } else if (attribute.terminator) {
+ if (c === attribute.terminator) {
+ // if we had a terminator and found another, we've
+ // reach the end of the attribute
+ attributes[attribute.name] = attribute.value;
+ attribute = null;
+ } else {
+ // otherwise, append the character to the attribute value
+ attribute.value += c;
+
+ // check for an escaped terminator and push it as well
+ // to avoid terminating prematurely
+ if (c === "\\") {
+ var next = str.charAt(i + 1);
+ if (next === attribute.terminator) {
+ attribute.value += next;
+ i += 1;
+ }
+ }
+ }
+ } else if (!/\s/.test(c)) {
+ // if we've hit a non-space character and aren't processing a value,
+ // we're starting a new attribute so push the attribute and clear the
+ // local variable
+ attributes[attribute.name] = attribute.value;
+ attribute = null;
+
+ // move the cursor back to re-find the start of the attribute
+ i -= 1;
+ }
+ }
+
+ i++;
+ }
+
+ if (i !== start) {
+ return {
+ attributes: attributes,
+ index: i
+ };
+ }
+
+ return null;
+}
+
+function parseFragment(str) {
+ var start = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
+
+ var tag = null;
+ var open = false;
+ var attributes = {};
+
+ var i = start;
+ while (i < str.length) {
+ var c = str.charAt(i++);
+
+ if (!open && !tag && c === "<") {
+ // Open Start Tag
+ open = true;
+
+ var tagNode = parseToken(str, i);
+ if (!tagNode) {
+ return null;
+ }
+
+ i = tagNode.index - 1;
+ tag = tagNode.token;
+ } else if (open && c === ">") {
+ // Close Start Tag
+ break;
+ } else if (open) {
+ // Attributes
+ var attributeNode = parseAttributes(str, i - 1);
+
+ if (attributeNode) {
+ i = attributeNode.index;
+ attributes = attributeNode.attributes || attributes;
+ }
+ }
+ }
+
+ if (tag) {
+ return {
+ tag: tag,
+ attributes: attributes
+ };
+ }
+
+ return null;
+}
+
+exports.default = parseFragment;
+exports.parseFragment = parseFragment;
+
+/***/ }),
+/* 841 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = void 0;
+
+var _sourceMap = _interopRequireDefault(__webpack_require__(632));
+
+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.replace(/\\/g, "/"), code);
+ } else if (typeof code === "object") {
+ Object.keys(code).forEach(sourceFileName => {
+ map.setSourceContent(sourceFileName.replace(/\\/g, "/"), code[sourceFileName]);
+ });
+ }
+
+ this._rawMappings.forEach(mapping => map.addMapping(mapping), 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).replace(/\\/g, "/"),
+ original: line == null ? undefined : {
+ line: line,
+ column: column
+ }
+ });
+ }
+
+}
+
+exports.default = SourceMap;
+
+/***/ }),
+/* 842 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = void 0;
+
+var _isInteger = _interopRequireDefault(__webpack_require__(843));
+
+var _repeat = _interopRequireDefault(__webpack_require__(846));
+
+var _buffer = _interopRequireDefault(__webpack_require__(849));
+
+var n = _interopRequireWildcard(__webpack_require__(688));
+
+var t = _interopRequireWildcard(__webpack_require__(2));
+
+var generatorFunctions = _interopRequireWildcard(__webpack_require__(852));
+
+function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
+
+function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } 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]/;
+const PURE_ANNOTATION_RE = /^\s*[@#]__PURE__\s*$/;
+
+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;
+ 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 !== "/" || i + 1 === str.length) {
+ this._parenPushNewlineState = null;
+ return;
+ }
+
+ const chaPost = str[i + 1];
+
+ if (chaPost === "*") {
+ if (PURE_ANNOTATION_RE.test(str.slice(i + 2, str.length - 2))) {
+ return;
+ }
+ } else if (chaPost !== "/") {
+ this._parenPushNewlineState = null;
+ return;
+ }
+ }
+
+ this.token("(");
+ this.indent();
+ parenPushNewlineState.printed = true;
+ }
+
+ _catchUp(prop, loc) {
+ if (!this.format.retainLines) return;
+ const pos = loc ? loc[prop] : null;
+
+ if ((pos == null ? void 0 : 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 == null ? void 0 : 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 == null ? void 0 : 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 == null ? void 0 : 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), true);
+ }
+
+ printInnerComments(node, indent = true) {
+ var _node$innerComments;
+
+ if (!((_node$innerComments = node.innerComments) == null ? void 0 : _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, skipNewLines) {
+ 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";
+ const printNewLines = isBlockComment && !skipNewLines && !this._noLineTerminator;
+ if (printNewLines && this._buf.hasContent()) this.newline(1);
+ if (!this.endsWith("[") && !this.endsWith("{")) this.space();
+ let val = !isBlockComment && !this._noLineTerminator ? `//${comment.value}\n` : `/*${comment.value}*/`;
+
+ if (isBlockComment && this.format.indent.adjustMultilineComment) {
+ var _comment$loc;
+
+ const offset = (_comment$loc = comment.loc) == null ? void 0 : _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);
+ });
+ if (printNewLines) this.newline(1);
+ }
+
+ _printComments(comments, inlinePureAnnotation) {
+ if (!(comments == null ? void 0 : comments.length)) return;
+
+ if (inlinePureAnnotation && comments.length === 1 && PURE_ANNOTATION_RE.test(comments[0].value)) {
+ this._printComment(comments[0], this._buf.hasContent() && !this.endsWith("\n"));
+ } else {
+ for (const comment of comments) {
+ this._printComment(comment);
+ }
+ }
+ }
+
+}
+
+exports.default = Printer;
+Object.assign(Printer.prototype, generatorFunctions);
+
+function commaSeparator() {
+ this.token(",");
+ this.space();
+}
+
+/***/ }),
+/* 843 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var toInteger = __webpack_require__(604);
+
+/**
+ * Checks if `value` is an integer.
+ *
+ * **Note:** This method is based on
+ * [`Number.isInteger`](https://mdn.io/Number/isInteger).
+ *
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is an integer, else `false`.
+ * @example
+ *
+ * _.isInteger(3);
+ * // => true
+ *
+ * _.isInteger(Number.MIN_VALUE);
+ * // => false
+ *
+ * _.isInteger(Infinity);
+ * // => false
+ *
+ * _.isInteger('3');
+ * // => false
+ */
+function isInteger(value) {
+ return typeof value == 'number' && value == toInteger(value);
+}
+
+module.exports = isInteger;
+
+
+/***/ }),
+/* 844 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var toNumber = __webpack_require__(845);
+
+/** Used as references for various `Number` constants. */
+var INFINITY = 1 / 0,
+ MAX_INTEGER = 1.7976931348623157e+308;
+
+/**
+ * Converts `value` to a finite number.
+ *
+ * @static
+ * @memberOf _
+ * @since 4.12.0
+ * @category Lang
+ * @param {*} value The value to convert.
+ * @returns {number} Returns the converted number.
+ * @example
+ *
+ * _.toFinite(3.2);
+ * // => 3.2
+ *
+ * _.toFinite(Number.MIN_VALUE);
+ * // => 5e-324
+ *
+ * _.toFinite(Infinity);
+ * // => 1.7976931348623157e+308
+ *
+ * _.toFinite('3.2');
+ * // => 3.2
+ */
+function toFinite(value) {
+ if (!value) {
+ return value === 0 ? value : 0;
+ }
+ value = toNumber(value);
+ if (value === INFINITY || value === -INFINITY) {
+ var sign = (value < 0 ? -1 : 1);
+ return sign * MAX_INTEGER;
+ }
+ return value === value ? value : 0;
+}
+
+module.exports = toFinite;
+
+
+/***/ }),
+/* 845 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var isObject = __webpack_require__(573),
+ isSymbol = __webpack_require__(577);
+
+/** Used as references for various `Number` constants. */
+var NAN = 0 / 0;
+
+/** Used to match leading and trailing whitespace. */
+var reTrim = /^\s+|\s+$/g;
+
+/** Used to detect bad signed hexadecimal string values. */
+var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
+
+/** Used to detect binary string values. */
+var reIsBinary = /^0b[01]+$/i;
+
+/** Used to detect octal string values. */
+var reIsOctal = /^0o[0-7]+$/i;
+
+/** Built-in method references without a dependency on `root`. */
+var freeParseInt = parseInt;
+
+/**
+ * Converts `value` to a number.
+ *
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @category Lang
+ * @param {*} value The value to process.
+ * @returns {number} Returns the number.
+ * @example
+ *
+ * _.toNumber(3.2);
+ * // => 3.2
+ *
+ * _.toNumber(Number.MIN_VALUE);
+ * // => 5e-324
+ *
+ * _.toNumber(Infinity);
+ * // => Infinity
+ *
+ * _.toNumber('3.2');
+ * // => 3.2
+ */
+function toNumber(value) {
+ if (typeof value == 'number') {
+ return value;
+ }
+ if (isSymbol(value)) {
+ return NAN;
+ }
+ if (isObject(value)) {
+ var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
+ value = isObject(other) ? (other + '') : other;
+ }
+ if (typeof value != 'string') {
+ return value === 0 ? value : +value;
+ }
+ value = value.replace(reTrim, '');
+ var isBinary = reIsBinary.test(value);
+ return (isBinary || reIsOctal.test(value))
+ ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
+ : (reIsBadHex.test(value) ? NAN : +value);
+}
+
+module.exports = toNumber;
+
+
+/***/ }),
+/* 846 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var baseRepeat = __webpack_require__(847),
+ isIterateeCall = __webpack_require__(848),
+ toInteger = __webpack_require__(604),
+ toString = __webpack_require__(605);
+
+/**
+ * Repeats the given string `n` times.
+ *
+ * @static
+ * @memberOf _
+ * @since 3.0.0
+ * @category String
+ * @param {string} [string=''] The string to repeat.
+ * @param {number} [n=1] The number of times to repeat the string.
+ * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
+ * @returns {string} Returns the repeated string.
+ * @example
+ *
+ * _.repeat('*', 3);
+ * // => '***'
+ *
+ * _.repeat('abc', 2);
+ * // => 'abcabc'
+ *
+ * _.repeat('abc', 0);
+ * // => ''
+ */
+function repeat(string, n, guard) {
+ if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) {
+ n = 1;
+ } else {
+ n = toInteger(n);
+ }
+ return baseRepeat(toString(string), n);
+}
+
+module.exports = repeat;
+
+
+/***/ }),
+/* 847 */
+/***/ (function(module, exports) {
+
+/** Used as references for various `Number` constants. */
+var MAX_SAFE_INTEGER = 9007199254740991;
+
+/* Built-in method references for those with the same name as other `lodash` methods. */
+var nativeFloor = Math.floor;
+
+/**
+ * The base implementation of `_.repeat` which doesn't coerce arguments.
+ *
+ * @private
+ * @param {string} string The string to repeat.
+ * @param {number} n The number of times to repeat the string.
+ * @returns {string} Returns the repeated string.
+ */
+function baseRepeat(string, n) {
+ var result = '';
+ if (!string || n < 1 || n > MAX_SAFE_INTEGER) {
+ return result;
+ }
+ // Leverage the exponentiation by squaring algorithm for a faster repeat.
+ // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.
+ do {
+ if (n % 2) {
+ result += string;
+ }
+ n = nativeFloor(n / 2);
+ if (n) {
+ string += string;
+ }
+ } while (n);
+
+ return result;
+}
+
+module.exports = baseRepeat;
+
+
+/***/ }),
+/* 848 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var eq = __webpack_require__(588),
+ isArrayLike = __webpack_require__(599),
+ isIndex = __webpack_require__(620),
+ isObject = __webpack_require__(573);
+
+/**
+ * Checks if the given arguments are from an iteratee call.
+ *
+ * @private
+ * @param {*} value The potential iteratee value argument.
+ * @param {*} index The potential iteratee index or key argument.
+ * @param {*} object The potential iteratee object argument.
+ * @returns {boolean} Returns `true` if the arguments are from an iteratee call,
+ * else `false`.
+ */
+function isIterateeCall(value, index, object) {
+ if (!isObject(object)) {
+ return false;
+ }
+ var type = typeof index;
+ if (type == 'number'
+ ? (isArrayLike(object) && isIndex(index, object.length))
+ : (type == 'string' && index in object)
+ ) {
+ return eq(object[index], value);
+ }
+ return false;
+}
+
+module.exports = isIterateeCall;
+
+
+/***/ }),
+/* 849 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = void 0;
+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: this._buf.join("").trimRight(),
+ map: null,
+ rawMappings: map == null ? void 0 : 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 == null ? void 0 : loc.identifierName) || null;
+ targetObj.line = pos == null ? void 0 : pos.line;
+ targetObj.column = pos == null ? void 0 : pos.column;
+ targetObj.filename = loc == null ? void 0 : loc.filename;
+
+ 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;
+
+/***/ }),
+/* 850 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.list = exports.nodes = void 0;
+
+var t = _interopRequireWildcard(__webpack_require__(2));
+
+function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
+
+function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
+
+function crawl(node, state = {}) {
+ if (t.isMemberExpression(node) || t.isOptionalMemberExpression(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) || t.isOptionalCallExpression(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
+ };
+ }
+ },
+
+ OptionalCallExpression(node) {
+ if (t.isFunction(node.callee)) {
+ 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) {
+ var _parent$properties;
+
+ if (parent.callProperties[0] === node && !((_parent$properties = parent.properties) == null ? void 0 : _parent$properties.length)) {
+ return {
+ before: true
+ };
+ }
+};
+
+nodes.ObjectTypeIndexer = function (node, parent) {
+ var _parent$properties2, _parent$callPropertie;
+
+ if (parent.indexers[0] === node && !((_parent$properties2 = parent.properties) == null ? void 0 : _parent$properties2.length) && !((_parent$callPropertie = parent.callProperties) == null ? void 0 : _parent$callPropertie.length)) {
+ return {
+ before: true
+ };
+ }
+};
+
+nodes.ObjectTypeInternalSlot = function (node, parent) {
+ var _parent$properties3, _parent$callPropertie2, _parent$indexers;
+
+ if (parent.internalSlots[0] === node && !((_parent$properties3 = parent.properties) == null ? void 0 : _parent$properties3.length) && !((_parent$callPropertie2 = parent.callProperties) == null ? void 0 : _parent$callPropertie2.length) && !((_parent$indexers = parent.indexers) == null ? void 0 : _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;
+ };
+ });
+});
+
+/***/ }),
+/* 851 */
+/***/ (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.TSInferType = TSInferType;
+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.OptionalCallExpression = exports.OptionalMemberExpression = OptionalMemberExpression;
+exports.AssignmentExpression = AssignmentExpression;
+exports.LogicalExpression = LogicalExpression;
+
+var t = _interopRequireWildcard(__webpack_require__(2));
+
+function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
+
+function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
+
+const PRECEDENCE = {
+ "||": 0,
+ "??": 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;
+
+const hasPostfixPart = (node, parent) => (t.isMemberExpression(parent) || t.isOptionalMemberExpression(parent)) && parent.object === node || (t.isCallExpression(parent) || t.isOptionalCallExpression(parent) || t.isNewExpression(parent)) && parent.callee === node || t.isTaggedTemplateExpression(parent) && parent.tag === node || t.isTSNonNullExpression(parent);
+
+function NullableTypeAnnotation(node, parent) {
+ return t.isArrayTypeAnnotation(parent);
+}
+
+function FunctionTypeAnnotation(node, parent, printStack) {
+ return t.isUnionTypeAnnotation(parent) || t.isIntersectionTypeAnnotation(parent) || t.isArrayTypeAnnotation(parent) || t.isTypeAnnotation(parent) && t.isArrowFunctionExpression(printStack[printStack.length - 3]);
+}
+
+function UpdateExpression(node, parent) {
+ return hasPostfixPart(node, parent) || 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 (hasPostfixPart(node, parent) || t.isUnaryLike(parent) || 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;
+ }
+ }
+}
+
+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 TSInferType(node, parent) {
+ return t.isTSArrayType(parent) || t.isTSOptionalType(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) || hasPostfixPart(node, 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 hasPostfixPart(node, parent) || 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.isTSTypeAssertion(parent) || t.isTSAsExpression(parent)) {
+ return true;
+ }
+
+ return UnaryLike(node, parent);
+}
+
+function OptionalMemberExpression(node, parent) {
+ return t.isCallExpression(parent, {
+ callee: node
+ }) || t.isMemberExpression(parent, {
+ object: node
+ });
+}
+
+function AssignmentExpression(node, parent, printStack) {
+ if (t.isObjectPattern(node.left)) {
+ return true;
+ } else {
+ return ConditionalExpression(node, parent, printStack);
+ }
+}
+
+function LogicalExpression(node, parent) {
+ switch (node.operator) {
+ case "||":
+ if (!t.isLogicalExpression(parent)) return false;
+ return parent.operator === "??" || parent.operator === "&&";
+
+ case "&&":
+ return t.isLogicalExpression(parent, {
+ operator: "??"
+ });
+
+ case "??":
+ return t.isLogicalExpression(parent) && parent.operator !== "??";
+ }
+}
+
+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
+ }) || considerDefaultExports && t.isExportDefaultDeclaration(parent, {
+ declaration: node
+ }) || considerArrow && t.isArrowFunctionExpression(parent, {
+ body: node
+ })) {
+ return true;
+ }
+
+ if (hasPostfixPart(node, parent) && !t.isNewExpression(parent) || t.isSequenceExpression(parent) && parent.expressions[0] === 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;
+}
+
+/***/ }),
+/* 852 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+
+var _templateLiterals = __webpack_require__(853);
+
+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__(854);
+
+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__(855);
+
+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__(856);
+
+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__(857);
+
+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__(689);
+
+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__(690);
+
+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__(863);
+
+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__(864);
+
+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__(865);
+
+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__(866);
+
+Object.keys(_typescript).forEach(function (key) {
+ if (key === "default" || key === "__esModule") return;
+ Object.defineProperty(exports, key, {
+ enumerable: true,
+ get: function () {
+ return _typescript[key];
+ }
+ });
+});
+
+/***/ }),
+/* 853 */
+/***/ (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);
+ }
+ }
+}
+
+/***/ }),
+/* 854 */
+/***/ (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.V8IntrinsicIdentifier = V8IntrinsicIdentifier;
+exports.AwaitExpression = exports.YieldExpression = void 0;
+
+var t = _interopRequireWildcard(__webpack_require__(2));
+
+var n = _interopRequireWildcard(__webpack_require__(688));
+
+function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
+
+function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } 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);
+}
+
+function V8IntrinsicIdentifier(node) {
+ this.token("%");
+ this.word(node.name);
+}
+
+/***/ }),
+/* 855 */
+/***/ (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;
+
+var t = _interopRequireWildcard(__webpack_require__(2));
+
+function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
+
+function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } 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);
+ }
+}
+
+/***/ }),
+/* 856 */
+/***/ (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;
+
+var t = _interopRequireWildcard(__webpack_require__(2));
+
+function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
+
+function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } 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);
+ this.tsPrintClassMemberModifiers(node, true);
+
+ 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);
+ this.tsPrintClassMemberModifiers(node, false);
+
+ this._methodHead(node);
+}
+
+/***/ }),
+/* 857 */
+/***/ (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;
+
+var t = _interopRequireWildcard(__webpack_require__(2));
+
+function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
+
+function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } 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;
+}
+
+/***/ }),
+/* 858 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+/* WEBPACK VAR INJECTION */(function(Buffer) {
+
+const object = {};
+const hasOwnProperty = object.hasOwnProperty;
+const forOwn = (object, callback) => {
+ for (const key in object) {
+ if (hasOwnProperty.call(object, key)) {
+ callback(key, object[key]);
+ }
+ }
+};
+
+const extend = (destination, source) => {
+ if (!source) {
+ return destination;
+ }
+ forOwn(source, (key, value) => {
+ destination[key] = value;
+ });
+ return destination;
+};
+
+const forEach = (array, callback) => {
+ const length = array.length;
+ let index = -1;
+ while (++index < length) {
+ callback(array[index]);
+ }
+};
+
+const toString = object.toString;
+const isArray = Array.isArray;
+const isBuffer = Buffer.isBuffer;
+const isObject = (value) => {
+ // This is a very simple check, but it’s good enough for what we need.
+ return toString.call(value) == '[object Object]';
+};
+const isString = (value) => {
+ return typeof value == 'string' ||
+ toString.call(value) == '[object String]';
+};
+const isNumber = (value) => {
+ return typeof value == 'number' ||
+ toString.call(value) == '[object Number]';
+};
+const isFunction = (value) => {
+ return typeof value == 'function';
+};
+const isMap = (value) => {
+ return toString.call(value) == '[object Map]';
+};
+const isSet = (value) => {
+ return toString.call(value) == '[object Set]';
+};
+
+/*--------------------------------------------------------------------------*/
+
+// https://mathiasbynens.be/notes/javascript-escapes#single
+const singleEscapes = {
+ '"': '\\"',
+ '\'': '\\\'',
+ '\\': '\\\\',
+ '\b': '\\b',
+ '\f': '\\f',
+ '\n': '\\n',
+ '\r': '\\r',
+ '\t': '\\t'
+ // `\v` is omitted intentionally, because in IE < 9, '\v' == 'v'.
+ // '\v': '\\x0B'
+};
+const regexSingleEscape = /["'\\\b\f\n\r\t]/;
+
+const regexDigit = /[0-9]/;
+const regexWhitelist = /[ !#-&\(-\[\]-_a-~]/;
+
+const jsesc = (argument, options) => {
+ const increaseIndentation = () => {
+ oldIndent = indent;
+ ++options.indentLevel;
+ indent = options.indent.repeat(options.indentLevel)
+ };
+ // Handle options
+ const defaults = {
+ 'escapeEverything': false,
+ 'minimal': false,
+ 'isScriptContext': false,
+ 'quotes': 'single',
+ 'wrap': false,
+ 'es6': false,
+ 'json': false,
+ 'compact': true,
+ 'lowercaseHex': false,
+ 'numbers': 'decimal',
+ 'indent': '\t',
+ 'indentLevel': 0,
+ '__inline1__': false,
+ '__inline2__': false
+ };
+ const json = options && options.json;
+ if (json) {
+ defaults.quotes = 'double';
+ defaults.wrap = true;
+ }
+ options = extend(defaults, options);
+ if (
+ options.quotes != 'single' &&
+ options.quotes != 'double' &&
+ options.quotes != 'backtick'
+ ) {
+ options.quotes = 'single';
+ }
+ const quote = options.quotes == 'double' ?
+ '"' :
+ (options.quotes == 'backtick' ?
+ '`' :
+ '\''
+ );
+ const compact = options.compact;
+ const lowercaseHex = options.lowercaseHex;
+ let indent = options.indent.repeat(options.indentLevel);
+ let oldIndent = '';
+ const inline1 = options.__inline1__;
+ const inline2 = options.__inline2__;
+ const newLine = compact ? '' : '\n';
+ let result;
+ let isEmpty = true;
+ const useBinNumbers = options.numbers == 'binary';
+ const useOctNumbers = options.numbers == 'octal';
+ const useDecNumbers = options.numbers == 'decimal';
+ const useHexNumbers = options.numbers == 'hexadecimal';
+
+ if (json && argument && isFunction(argument.toJSON)) {
+ argument = argument.toJSON();
+ }
+
+ if (!isString(argument)) {
+ if (isMap(argument)) {
+ if (argument.size == 0) {
+ return 'new Map()';
+ }
+ if (!compact) {
+ options.__inline1__ = true;
+ options.__inline2__ = false;
+ }
+ return 'new Map(' + jsesc(Array.from(argument), options) + ')';
+ }
+ if (isSet(argument)) {
+ if (argument.size == 0) {
+ return 'new Set()';
+ }
+ return 'new Set(' + jsesc(Array.from(argument), options) + ')';
+ }
+ if (isBuffer(argument)) {
+ if (argument.length == 0) {
+ return 'Buffer.from([])';
+ }
+ return 'Buffer.from(' + jsesc(Array.from(argument), options) + ')';
+ }
+ if (isArray(argument)) {
+ result = [];
+ options.wrap = true;
+ if (inline1) {
+ options.__inline1__ = false;
+ options.__inline2__ = true;
+ }
+ if (!inline2) {
+ increaseIndentation();
+ }
+ forEach(argument, (value) => {
+ isEmpty = false;
+ if (inline2) {
+ options.__inline2__ = false;
+ }
+ result.push(
+ (compact || inline2 ? '' : indent) +
+ jsesc(value, options)
+ );
+ });
+ if (isEmpty) {
+ return '[]';
+ }
+ if (inline2) {
+ return '[' + result.join(', ') + ']';
+ }
+ return '[' + newLine + result.join(',' + newLine) + newLine +
+ (compact ? '' : oldIndent) + ']';
+ } else if (isNumber(argument)) {
+ if (json) {
+ // Some number values (e.g. `Infinity`) cannot be represented in JSON.
+ return JSON.stringify(argument);
+ }
+ if (useDecNumbers) {
+ return String(argument);
+ }
+ if (useHexNumbers) {
+ let hexadecimal = argument.toString(16);
+ if (!lowercaseHex) {
+ hexadecimal = hexadecimal.toUpperCase();
+ }
+ return '0x' + hexadecimal;
+ }
+ if (useBinNumbers) {
+ return '0b' + argument.toString(2);
+ }
+ if (useOctNumbers) {
+ return '0o' + argument.toString(8);
+ }
+ } else if (!isObject(argument)) {
+ if (json) {
+ // For some values (e.g. `undefined`, `function` objects),
+ // `JSON.stringify(value)` returns `undefined` (which isn’t valid
+ // JSON) instead of `'null'`.
+ return JSON.stringify(argument) || 'null';
+ }
+ return String(argument);
+ } else { // it’s an object
+ result = [];
+ options.wrap = true;
+ increaseIndentation();
+ forOwn(argument, (key, value) => {
+ isEmpty = false;
+ result.push(
+ (compact ? '' : indent) +
+ jsesc(key, options) + ':' +
+ (compact ? '' : ' ') +
+ jsesc(value, options)
+ );
+ });
+ if (isEmpty) {
+ return '{}';
+ }
+ return '{' + newLine + result.join(',' + newLine) + newLine +
+ (compact ? '' : oldIndent) + '}';
+ }
+ }
+
+ const string = argument;
+ // Loop over each code unit in the string and escape it
+ let index = -1;
+ const length = string.length;
+ result = '';
+ while (++index < length) {
+ const character = string.charAt(index);
+ if (options.es6) {
+ const first = string.charCodeAt(index);
+ if ( // check if it’s the start of a surrogate pair
+ first >= 0xD800 && first <= 0xDBFF && // high surrogate
+ length > index + 1 // there is a next code unit
+ ) {
+ const second = string.charCodeAt(index + 1);
+ if (second >= 0xDC00 && second <= 0xDFFF) { // low surrogate
+ // https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae
+ const codePoint = (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000;
+ let hexadecimal = codePoint.toString(16);
+ if (!lowercaseHex) {
+ hexadecimal = hexadecimal.toUpperCase();
+ }
+ result += '\\u{' + hexadecimal + '}';
+ ++index;
+ continue;
+ }
+ }
+ }
+ if (!options.escapeEverything) {
+ if (regexWhitelist.test(character)) {
+ // It’s a printable ASCII character that is not `"`, `'` or `\`,
+ // so don’t escape it.
+ result += character;
+ continue;
+ }
+ if (character == '"') {
+ result += quote == character ? '\\"' : character;
+ continue;
+ }
+ if (character == '`') {
+ result += quote == character ? '\\`' : character;
+ continue;
+ }
+ if (character == '\'') {
+ result += quote == character ? '\\\'' : character;
+ continue;
+ }
+ }
+ if (
+ character == '\0' &&
+ !json &&
+ !regexDigit.test(string.charAt(index + 1))
+ ) {
+ result += '\\0';
+ continue;
+ }
+ if (regexSingleEscape.test(character)) {
+ // no need for a `hasOwnProperty` check here
+ result += singleEscapes[character];
+ continue;
+ }
+ const charCode = character.charCodeAt(0);
+ if (options.minimal && charCode != 0x2028 && charCode != 0x2029) {
+ result += character;
+ continue;
+ }
+ let hexadecimal = charCode.toString(16);
+ if (!lowercaseHex) {
+ hexadecimal = hexadecimal.toUpperCase();
+ }
+ const longhand = hexadecimal.length > 2 || json;
+ const escaped = '\\' + (longhand ? 'u' : 'x') +
+ ('0000' + hexadecimal).slice(longhand ? -4 : -2);
+ result += escaped;
+ continue;
+ }
+ if (options.wrap) {
+ result = quote + result + quote;
+ }
+ if (quote == '`') {
+ result = result.replace(/\$\{/g, '\\\$\{');
+ }
+ if (options.isScriptContext) {
+ // https://mathiasbynens.be/notes/etago
+ return result
+ .replace(/<\/(script|style)/gi, '<\\/$1')
+ .replace(/<!--/g, json ? '\\u003C!--' : '\\x3C!--');
+ }
+ return result;
+};
+
+jsesc.version = '2.5.2';
+
+module.exports = jsesc;
+
+/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(859).Buffer))
+
+/***/ }),
+/* 859 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+/* WEBPACK VAR INJECTION */(function(global) {/*!
+ * The buffer module from node.js, for the browser.
+ *
+ * @author Feross Aboukhadijeh <http://feross.org>
+ * @license MIT
+ */
+/* eslint-disable no-proto */
+
+
+
+var base64 = __webpack_require__(860)
+var ieee754 = __webpack_require__(861)
+var isArray = __webpack_require__(862)
+
+exports.Buffer = Buffer
+exports.SlowBuffer = SlowBuffer
+exports.INSPECT_MAX_BYTES = 50
+
+/**
+ * If `Buffer.TYPED_ARRAY_SUPPORT`:
+ * === true Use Uint8Array implementation (fastest)
+ * === false Use Object implementation (most compatible, even IE6)
+ *
+ * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,
+ * Opera 11.6+, iOS 4.2+.
+ *
+ * Due to various browser bugs, sometimes the Object implementation will be used even
+ * when the browser supports typed arrays.
+ *
+ * Note:
+ *
+ * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances,
+ * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438.
+ *
+ * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function.
+ *
+ * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of
+ * incorrect length in some situations.
+
+ * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they
+ * get the Object implementation, which is slower but behaves correctly.
+ */
+Buffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined
+ ? global.TYPED_ARRAY_SUPPORT
+ : typedArraySupport()
+
+/*
+ * Export kMaxLength after typed array support is determined.
+ */
+exports.kMaxLength = kMaxLength()
+
+function typedArraySupport () {
+ try {
+ var arr = new Uint8Array(1)
+ arr.__proto__ = {__proto__: Uint8Array.prototype, foo: function () { return 42 }}
+ return arr.foo() === 42 && // typed array instances can be augmented
+ typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray`
+ arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray`
+ } catch (e) {
+ return false
+ }
+}
+
+function kMaxLength () {
+ return Buffer.TYPED_ARRAY_SUPPORT
+ ? 0x7fffffff
+ : 0x3fffffff
+}
+
+function createBuffer (that, length) {
+ if (kMaxLength() < length) {
+ throw new RangeError('Invalid typed array length')
+ }
+ if (Buffer.TYPED_ARRAY_SUPPORT) {
+ // Return an augmented `Uint8Array` instance, for best performance
+ that = new Uint8Array(length)
+ that.__proto__ = Buffer.prototype
+ } else {
+ // Fallback: Return an object instance of the Buffer class
+ if (that === null) {
+ that = new Buffer(length)
+ }
+ that.length = length
+ }
+
+ return that
+}
+
+/**
+ * The Buffer constructor returns instances of `Uint8Array` that have their
+ * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of
+ * `Uint8Array`, so the returned instances will have all the node `Buffer` methods
+ * and the `Uint8Array` methods. Square bracket notation works as expected -- it
+ * returns a single octet.
+ *
+ * The `Uint8Array` prototype remains unmodified.
+ */
+
+function Buffer (arg, encodingOrOffset, length) {
+ if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {
+ return new Buffer(arg, encodingOrOffset, length)
+ }
+
+ // Common case.
+ if (typeof arg === 'number') {
+ if (typeof encodingOrOffset === 'string') {
+ throw new Error(
+ 'If encoding is specified then the first argument must be a string'
+ )
+ }
+ return allocUnsafe(this, arg)
+ }
+ return from(this, arg, encodingOrOffset, length)
+}
+
+Buffer.poolSize = 8192 // not used by this implementation
+
+// TODO: Legacy, not needed anymore. Remove in next major version.
+Buffer._augment = function (arr) {
+ arr.__proto__ = Buffer.prototype
+ return arr
+}
+
+function from (that, value, encodingOrOffset, length) {
+ if (typeof value === 'number') {
+ throw new TypeError('"value" argument must not be a number')
+ }
+
+ if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) {
+ return fromArrayBuffer(that, value, encodingOrOffset, length)
+ }
+
+ if (typeof value === 'string') {
+ return fromString(that, value, encodingOrOffset)
+ }
+
+ return fromObject(that, value)
+}
+
+/**
+ * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError
+ * if value is a number.
+ * Buffer.from(str[, encoding])
+ * Buffer.from(array)
+ * Buffer.from(buffer)
+ * Buffer.from(arrayBuffer[, byteOffset[, length]])
+ **/
+Buffer.from = function (value, encodingOrOffset, length) {
+ return from(null, value, encodingOrOffset, length)
+}
+
+if (Buffer.TYPED_ARRAY_SUPPORT) {
+ Buffer.prototype.__proto__ = Uint8Array.prototype
+ Buffer.__proto__ = Uint8Array
+ if (typeof Symbol !== 'undefined' && Symbol.species &&
+ Buffer[Symbol.species] === Buffer) {
+ // Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97
+ Object.defineProperty(Buffer, Symbol.species, {
+ value: null,
+ configurable: true
+ })
+ }
+}
+
+function assertSize (size) {
+ if (typeof size !== 'number') {
+ throw new TypeError('"size" argument must be a number')
+ } else if (size < 0) {
+ throw new RangeError('"size" argument must not be negative')
+ }
+}
+
+function alloc (that, size, fill, encoding) {
+ assertSize(size)
+ if (size <= 0) {
+ return createBuffer(that, size)
+ }
+ if (fill !== undefined) {
+ // Only pay attention to encoding if it's a string. This
+ // prevents accidentally sending in a number that would
+ // be interpretted as a start offset.
+ return typeof encoding === 'string'
+ ? createBuffer(that, size).fill(fill, encoding)
+ : createBuffer(that, size).fill(fill)
+ }
+ return createBuffer(that, size)
+}
+
+/**
+ * Creates a new filled Buffer instance.
+ * alloc(size[, fill[, encoding]])
+ **/
+Buffer.alloc = function (size, fill, encoding) {
+ return alloc(null, size, fill, encoding)
+}
+
+function allocUnsafe (that, size) {
+ assertSize(size)
+ that = createBuffer(that, size < 0 ? 0 : checked(size) | 0)
+ if (!Buffer.TYPED_ARRAY_SUPPORT) {
+ for (var i = 0; i < size; ++i) {
+ that[i] = 0
+ }
+ }
+ return that
+}
+
+/**
+ * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.
+ * */
+Buffer.allocUnsafe = function (size) {
+ return allocUnsafe(null, size)
+}
+/**
+ * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
+ */
+Buffer.allocUnsafeSlow = function (size) {
+ return allocUnsafe(null, size)
+}
+
+function fromString (that, string, encoding) {
+ if (typeof encoding !== 'string' || encoding === '') {
+ encoding = 'utf8'
+ }
+
+ if (!Buffer.isEncoding(encoding)) {
+ throw new TypeError('"encoding" must be a valid string encoding')
+ }
+
+ var length = byteLength(string, encoding) | 0
+ that = createBuffer(that, length)
+
+ var actual = that.write(string, encoding)
+
+ if (actual !== length) {
+ // Writing a hex string, for example, that contains invalid characters will
+ // cause everything after the first invalid character to be ignored. (e.g.
+ // 'abxxcd' will be treated as 'ab')
+ that = that.slice(0, actual)
+ }
+
+ return that
+}
+
+function fromArrayLike (that, array) {
+ var length = array.length < 0 ? 0 : checked(array.length) | 0
+ that = createBuffer(that, length)
+ for (var i = 0; i < length; i += 1) {
+ that[i] = array[i] & 255
+ }
+ return that
+}
+
+function fromArrayBuffer (that, array, byteOffset, length) {
+ array.byteLength // this throws if `array` is not a valid ArrayBuffer
+
+ if (byteOffset < 0 || array.byteLength < byteOffset) {
+ throw new RangeError('\'offset\' is out of bounds')
+ }
+
+ if (array.byteLength < byteOffset + (length || 0)) {
+ throw new RangeError('\'length\' is out of bounds')
+ }
+
+ if (byteOffset === undefined && length === undefined) {
+ array = new Uint8Array(array)
+ } else if (length === undefined) {
+ array = new Uint8Array(array, byteOffset)
+ } else {
+ array = new Uint8Array(array, byteOffset, length)
+ }
+
+ if (Buffer.TYPED_ARRAY_SUPPORT) {
+ // Return an augmented `Uint8Array` instance, for best performance
+ that = array
+ that.__proto__ = Buffer.prototype
+ } else {
+ // Fallback: Return an object instance of the Buffer class
+ that = fromArrayLike(that, array)
+ }
+ return that
+}
+
+function fromObject (that, obj) {
+ if (Buffer.isBuffer(obj)) {
+ var len = checked(obj.length) | 0
+ that = createBuffer(that, len)
+
+ if (that.length === 0) {
+ return that
+ }
+
+ obj.copy(that, 0, 0, len)
+ return that
+ }
+
+ if (obj) {
+ if ((typeof ArrayBuffer !== 'undefined' &&
+ obj.buffer instanceof ArrayBuffer) || 'length' in obj) {
+ if (typeof obj.length !== 'number' || isnan(obj.length)) {
+ return createBuffer(that, 0)
+ }
+ return fromArrayLike(that, obj)
+ }
+
+ if (obj.type === 'Buffer' && isArray(obj.data)) {
+ return fromArrayLike(that, obj.data)
+ }
+ }
+
+ throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.')
+}
+
+function checked (length) {
+ // Note: cannot use `length < kMaxLength()` here because that fails when
+ // length is NaN (which is otherwise coerced to zero.)
+ if (length >= kMaxLength()) {
+ throw new RangeError('Attempt to allocate Buffer larger than maximum ' +
+ 'size: 0x' + kMaxLength().toString(16) + ' bytes')
+ }
+ return length | 0
+}
+
+function SlowBuffer (length) {
+ if (+length != length) { // eslint-disable-line eqeqeq
+ length = 0
+ }
+ return Buffer.alloc(+length)
+}
+
+Buffer.isBuffer = function isBuffer (b) {
+ return !!(b != null && b._isBuffer)
+}
+
+Buffer.compare = function compare (a, b) {
+ if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {
+ throw new TypeError('Arguments must be Buffers')
+ }
+
+ if (a === b) return 0
+
+ var x = a.length
+ var y = b.length
+
+ for (var i = 0, len = Math.min(x, y); i < len; ++i) {
+ if (a[i] !== b[i]) {
+ x = a[i]
+ y = b[i]
+ break
+ }
+ }
+
+ if (x < y) return -1
+ if (y < x) return 1
+ return 0
+}
+
+Buffer.isEncoding = function isEncoding (encoding) {
+ switch (String(encoding).toLowerCase()) {
+ case 'hex':
+ case 'utf8':
+ case 'utf-8':
+ case 'ascii':
+ case 'latin1':
+ case 'binary':
+ case 'base64':
+ case 'ucs2':
+ case 'ucs-2':
+ case 'utf16le':
+ case 'utf-16le':
+ return true
+ default:
+ return false
+ }
+}
+
+Buffer.concat = function concat (list, length) {
+ if (!isArray(list)) {
+ throw new TypeError('"list" argument must be an Array of Buffers')
+ }
+
+ if (list.length === 0) {
+ return Buffer.alloc(0)
+ }
+
+ var i
+ if (length === undefined) {
+ length = 0
+ for (i = 0; i < list.length; ++i) {
+ length += list[i].length
+ }
+ }
+
+ var buffer = Buffer.allocUnsafe(length)
+ var pos = 0
+ for (i = 0; i < list.length; ++i) {
+ var buf = list[i]
+ if (!Buffer.isBuffer(buf)) {
+ throw new TypeError('"list" argument must be an Array of Buffers')
+ }
+ buf.copy(buffer, pos)
+ pos += buf.length
+ }
+ return buffer
+}
+
+function byteLength (string, encoding) {
+ if (Buffer.isBuffer(string)) {
+ return string.length
+ }
+ if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' &&
+ (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) {
+ return string.byteLength
+ }
+ if (typeof string !== 'string') {
+ string = '' + string
+ }
+
+ var len = string.length
+ if (len === 0) return 0
+
+ // Use a for loop to avoid recursion
+ var loweredCase = false
+ for (;;) {
+ switch (encoding) {
+ case 'ascii':
+ case 'latin1':
+ case 'binary':
+ return len
+ case 'utf8':
+ case 'utf-8':
+ case undefined:
+ return utf8ToBytes(string).length
+ case 'ucs2':
+ case 'ucs-2':
+ case 'utf16le':
+ case 'utf-16le':
+ return len * 2
+ case 'hex':
+ return len >>> 1
+ case 'base64':
+ return base64ToBytes(string).length
+ default:
+ if (loweredCase) return utf8ToBytes(string).length // assume utf8
+ encoding = ('' + encoding).toLowerCase()
+ loweredCase = true
+ }
+ }
+}
+Buffer.byteLength = byteLength
+
+function slowToString (encoding, start, end) {
+ var loweredCase = false
+
+ // No need to verify that "this.length <= MAX_UINT32" since it's a read-only
+ // property of a typed array.
+
+ // This behaves neither like String nor Uint8Array in that we set start/end
+ // to their upper/lower bounds if the value passed is out of range.
+ // undefined is handled specially as per ECMA-262 6th Edition,
+ // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.
+ if (start === undefined || start < 0) {
+ start = 0
+ }
+ // Return early if start > this.length. Done here to prevent potential uint32
+ // coercion fail below.
+ if (start > this.length) {
+ return ''
+ }
+
+ if (end === undefined || end > this.length) {
+ end = this.length
+ }
+
+ if (end <= 0) {
+ return ''
+ }
+
+ // Force coersion to uint32. This will also coerce falsey/NaN values to 0.
+ end >>>= 0
+ start >>>= 0
+
+ if (end <= start) {
+ return ''
+ }
+
+ if (!encoding) encoding = 'utf8'
+
+ while (true) {
+ switch (encoding) {
+ case 'hex':
+ return hexSlice(this, start, end)
+
+ case 'utf8':
+ case 'utf-8':
+ return utf8Slice(this, start, end)
+
+ case 'ascii':
+ return asciiSlice(this, start, end)
+
+ case 'latin1':
+ case 'binary':
+ return latin1Slice(this, start, end)
+
+ case 'base64':
+ return base64Slice(this, start, end)
+
+ case 'ucs2':
+ case 'ucs-2':
+ case 'utf16le':
+ case 'utf-16le':
+ return utf16leSlice(this, start, end)
+
+ default:
+ if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
+ encoding = (encoding + '').toLowerCase()
+ loweredCase = true
+ }
+ }
+}
+
+// The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect
+// Buffer instances.
+Buffer.prototype._isBuffer = true
+
+function swap (b, n, m) {
+ var i = b[n]
+ b[n] = b[m]
+ b[m] = i
+}
+
+Buffer.prototype.swap16 = function swap16 () {
+ var len = this.length
+ if (len % 2 !== 0) {
+ throw new RangeError('Buffer size must be a multiple of 16-bits')
+ }
+ for (var i = 0; i < len; i += 2) {
+ swap(this, i, i + 1)
+ }
+ return this
+}
+
+Buffer.prototype.swap32 = function swap32 () {
+ var len = this.length
+ if (len % 4 !== 0) {
+ throw new RangeError('Buffer size must be a multiple of 32-bits')
+ }
+ for (var i = 0; i < len; i += 4) {
+ swap(this, i, i + 3)
+ swap(this, i + 1, i + 2)
+ }
+ return this
+}
+
+Buffer.prototype.swap64 = function swap64 () {
+ var len = this.length
+ if (len % 8 !== 0) {
+ throw new RangeError('Buffer size must be a multiple of 64-bits')
+ }
+ for (var i = 0; i < len; i += 8) {
+ swap(this, i, i + 7)
+ swap(this, i + 1, i + 6)
+ swap(this, i + 2, i + 5)
+ swap(this, i + 3, i + 4)
+ }
+ return this
+}
+
+Buffer.prototype.toString = function toString () {
+ var length = this.length | 0
+ if (length === 0) return ''
+ if (arguments.length === 0) return utf8Slice(this, 0, length)
+ return slowToString.apply(this, arguments)
+}
+
+Buffer.prototype.equals = function equals (b) {
+ if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')
+ if (this === b) return true
+ return Buffer.compare(this, b) === 0
+}
+
+Buffer.prototype.inspect = function inspect () {
+ var str = ''
+ var max = exports.INSPECT_MAX_BYTES
+ if (this.length > 0) {
+ str = this.toString('hex', 0, max).match(/.{2}/g).join(' ')
+ if (this.length > max) str += ' ... '
+ }
+ return '<Buffer ' + str + '>'
+}
+
+Buffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {
+ if (!Buffer.isBuffer(target)) {
+ throw new TypeError('Argument must be a Buffer')
+ }
+
+ if (start === undefined) {
+ start = 0
+ }
+ if (end === undefined) {
+ end = target ? target.length : 0
+ }
+ if (thisStart === undefined) {
+ thisStart = 0
+ }
+ if (thisEnd === undefined) {
+ thisEnd = this.length
+ }
+
+ if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {
+ throw new RangeError('out of range index')
+ }
+
+ if (thisStart >= thisEnd && start >= end) {
+ return 0
+ }
+ if (thisStart >= thisEnd) {
+ return -1
+ }
+ if (start >= end) {
+ return 1
+ }
+
+ start >>>= 0
+ end >>>= 0
+ thisStart >>>= 0
+ thisEnd >>>= 0
+
+ if (this === target) return 0
+
+ var x = thisEnd - thisStart
+ var y = end - start
+ var len = Math.min(x, y)
+
+ var thisCopy = this.slice(thisStart, thisEnd)
+ var targetCopy = target.slice(start, end)
+
+ for (var i = 0; i < len; ++i) {
+ if (thisCopy[i] !== targetCopy[i]) {
+ x = thisCopy[i]
+ y = targetCopy[i]
+ break
+ }
+ }
+
+ if (x < y) return -1
+ if (y < x) return 1
+ return 0
+}
+
+// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,
+// OR the last index of `val` in `buffer` at offset <= `byteOffset`.
+//
+// Arguments:
+// - buffer - a Buffer to search
+// - val - a string, Buffer, or number
+// - byteOffset - an index into `buffer`; will be clamped to an int32
+// - encoding - an optional encoding, relevant is val is a string
+// - dir - true for indexOf, false for lastIndexOf
+function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {
+ // Empty buffer means no match
+ if (buffer.length === 0) return -1
+
+ // Normalize byteOffset
+ if (typeof byteOffset === 'string') {
+ encoding = byteOffset
+ byteOffset = 0
+ } else if (byteOffset > 0x7fffffff) {
+ byteOffset = 0x7fffffff
+ } else if (byteOffset < -0x80000000) {
+ byteOffset = -0x80000000
+ }
+ byteOffset = +byteOffset // Coerce to Number.
+ if (isNaN(byteOffset)) {
+ // byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer
+ byteOffset = dir ? 0 : (buffer.length - 1)
+ }
+
+ // Normalize byteOffset: negative offsets start from the end of the buffer
+ if (byteOffset < 0) byteOffset = buffer.length + byteOffset
+ if (byteOffset >= buffer.length) {
+ if (dir) return -1
+ else byteOffset = buffer.length - 1
+ } else if (byteOffset < 0) {
+ if (dir) byteOffset = 0
+ else return -1
+ }
+
+ // Normalize val
+ if (typeof val === 'string') {
+ val = Buffer.from(val, encoding)
+ }
+
+ // Finally, search either indexOf (if dir is true) or lastIndexOf
+ if (Buffer.isBuffer(val)) {
+ // Special case: looking for empty string/buffer always fails
+ if (val.length === 0) {
+ return -1
+ }
+ return arrayIndexOf(buffer, val, byteOffset, encoding, dir)
+ } else if (typeof val === 'number') {
+ val = val & 0xFF // Search for a byte value [0-255]
+ if (Buffer.TYPED_ARRAY_SUPPORT &&
+ typeof Uint8Array.prototype.indexOf === 'function') {
+ if (dir) {
+ return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)
+ } else {
+ return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)
+ }
+ }
+ return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)
+ }
+
+ throw new TypeError('val must be string, number or Buffer')
+}
+
+function arrayIndexOf (arr, val, byteOffset, encoding, dir) {
+ var indexSize = 1
+ var arrLength = arr.length
+ var valLength = val.length
+
+ if (encoding !== undefined) {
+ encoding = String(encoding).toLowerCase()
+ if (encoding === 'ucs2' || encoding === 'ucs-2' ||
+ encoding === 'utf16le' || encoding === 'utf-16le') {
+ if (arr.length < 2 || val.length < 2) {
+ return -1
+ }
+ indexSize = 2
+ arrLength /= 2
+ valLength /= 2
+ byteOffset /= 2
+ }
+ }
+
+ function read (buf, i) {
+ if (indexSize === 1) {
+ return buf[i]
+ } else {
+ return buf.readUInt16BE(i * indexSize)
+ }
+ }
+
+ var i
+ if (dir) {
+ var foundIndex = -1
+ for (i = byteOffset; i < arrLength; i++) {
+ if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {
+ if (foundIndex === -1) foundIndex = i
+ if (i - foundIndex + 1 === valLength) return foundIndex * indexSize
+ } else {
+ if (foundIndex !== -1) i -= i - foundIndex
+ foundIndex = -1
+ }
+ }
+ } else {
+ if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength
+ for (i = byteOffset; i >= 0; i--) {
+ var found = true
+ for (var j = 0; j < valLength; j++) {
+ if (read(arr, i + j) !== read(val, j)) {
+ found = false
+ break
+ }
+ }
+ if (found) return i
+ }
+ }
+
+ return -1
+}
+
+Buffer.prototype.includes = function includes (val, byteOffset, encoding) {
+ return this.indexOf(val, byteOffset, encoding) !== -1
+}
+
+Buffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {
+ return bidirectionalIndexOf(this, val, byteOffset, encoding, true)
+}
+
+Buffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {
+ return bidirectionalIndexOf(this, val, byteOffset, encoding, false)
+}
+
+function hexWrite (buf, string, offset, length) {
+ offset = Number(offset) || 0
+ var remaining = buf.length - offset
+ if (!length) {
+ length = remaining
+ } else {
+ length = Number(length)
+ if (length > remaining) {
+ length = remaining
+ }
+ }
+
+ // must be an even number of digits
+ var strLen = string.length
+ if (strLen % 2 !== 0) throw new TypeError('Invalid hex string')
+
+ if (length > strLen / 2) {
+ length = strLen / 2
+ }
+ for (var i = 0; i < length; ++i) {
+ var parsed = parseInt(string.substr(i * 2, 2), 16)
+ if (isNaN(parsed)) return i
+ buf[offset + i] = parsed
+ }
+ return i
+}
+
+function utf8Write (buf, string, offset, length) {
+ return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)
+}
+
+function asciiWrite (buf, string, offset, length) {
+ return blitBuffer(asciiToBytes(string), buf, offset, length)
+}
+
+function latin1Write (buf, string, offset, length) {
+ return asciiWrite(buf, string, offset, length)
+}
+
+function base64Write (buf, string, offset, length) {
+ return blitBuffer(base64ToBytes(string), buf, offset, length)
+}
+
+function ucs2Write (buf, string, offset, length) {
+ return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)
+}
+
+Buffer.prototype.write = function write (string, offset, length, encoding) {
+ // Buffer#write(string)
+ if (offset === undefined) {
+ encoding = 'utf8'
+ length = this.length
+ offset = 0
+ // Buffer#write(string, encoding)
+ } else if (length === undefined && typeof offset === 'string') {
+ encoding = offset
+ length = this.length
+ offset = 0
+ // Buffer#write(string, offset[, length][, encoding])
+ } else if (isFinite(offset)) {
+ offset = offset | 0
+ if (isFinite(length)) {
+ length = length | 0
+ if (encoding === undefined) encoding = 'utf8'
+ } else {
+ encoding = length
+ length = undefined
+ }
+ // legacy write(string, encoding, offset, length) - remove in v0.13
+ } else {
+ throw new Error(
+ 'Buffer.write(string, encoding, offset[, length]) is no longer supported'
+ )
+ }
+
+ var remaining = this.length - offset
+ if (length === undefined || length > remaining) length = remaining
+
+ if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {
+ throw new RangeError('Attempt to write outside buffer bounds')
+ }
+
+ if (!encoding) encoding = 'utf8'
+
+ var loweredCase = false
+ for (;;) {
+ switch (encoding) {
+ case 'hex':
+ return hexWrite(this, string, offset, length)
+
+ case 'utf8':
+ case 'utf-8':
+ return utf8Write(this, string, offset, length)
+
+ case 'ascii':
+ return asciiWrite(this, string, offset, length)
+
+ case 'latin1':
+ case 'binary':
+ return latin1Write(this, string, offset, length)
+
+ case 'base64':
+ // Warning: maxLength not taken into account in base64Write
+ return base64Write(this, string, offset, length)
+
+ case 'ucs2':
+ case 'ucs-2':
+ case 'utf16le':
+ case 'utf-16le':
+ return ucs2Write(this, string, offset, length)
+
+ default:
+ if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
+ encoding = ('' + encoding).toLowerCase()
+ loweredCase = true
+ }
+ }
+}
+
+Buffer.prototype.toJSON = function toJSON () {
+ return {
+ type: 'Buffer',
+ data: Array.prototype.slice.call(this._arr || this, 0)
+ }
+}
+
+function base64Slice (buf, start, end) {
+ if (start === 0 && end === buf.length) {
+ return base64.fromByteArray(buf)
+ } else {
+ return base64.fromByteArray(buf.slice(start, end))
+ }
+}
+
+function utf8Slice (buf, start, end) {
+ end = Math.min(buf.length, end)
+ var res = []
+
+ var i = start
+ while (i < end) {
+ var firstByte = buf[i]
+ var codePoint = null
+ var bytesPerSequence = (firstByte > 0xEF) ? 4
+ : (firstByte > 0xDF) ? 3
+ : (firstByte > 0xBF) ? 2
+ : 1
+
+ if (i + bytesPerSequence <= end) {
+ var secondByte, thirdByte, fourthByte, tempCodePoint
+
+ switch (bytesPerSequence) {
+ case 1:
+ if (firstByte < 0x80) {
+ codePoint = firstByte
+ }
+ break
+ case 2:
+ secondByte = buf[i + 1]
+ if ((secondByte & 0xC0) === 0x80) {
+ tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)
+ if (tempCodePoint > 0x7F) {
+ codePoint = tempCodePoint
+ }
+ }
+ break
+ case 3:
+ secondByte = buf[i + 1]
+ thirdByte = buf[i + 2]
+ if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {
+ tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)
+ if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {
+ codePoint = tempCodePoint
+ }
+ }
+ break
+ case 4:
+ secondByte = buf[i + 1]
+ thirdByte = buf[i + 2]
+ fourthByte = buf[i + 3]
+ if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {
+ tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)
+ if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {
+ codePoint = tempCodePoint
+ }
+ }
+ }
+ }
+
+ if (codePoint === null) {
+ // we did not generate a valid codePoint so insert a
+ // replacement char (U+FFFD) and advance only 1 byte
+ codePoint = 0xFFFD
+ bytesPerSequence = 1
+ } else if (codePoint > 0xFFFF) {
+ // encode to utf16 (surrogate pair dance)
+ codePoint -= 0x10000
+ res.push(codePoint >>> 10 & 0x3FF | 0xD800)
+ codePoint = 0xDC00 | codePoint & 0x3FF
+ }
+
+ res.push(codePoint)
+ i += bytesPerSequence
+ }
+
+ return decodeCodePointsArray(res)
+}
+
+// Based on http://stackoverflow.com/a/22747272/680742, the browser with
+// the lowest limit is Chrome, with 0x10000 args.
+// We go 1 magnitude less, for safety
+var MAX_ARGUMENTS_LENGTH = 0x1000
+
+function decodeCodePointsArray (codePoints) {
+ var len = codePoints.length
+ if (len <= MAX_ARGUMENTS_LENGTH) {
+ return String.fromCharCode.apply(String, codePoints) // avoid extra slice()
+ }
+
+ // Decode in chunks to avoid "call stack size exceeded".
+ var res = ''
+ var i = 0
+ while (i < len) {
+ res += String.fromCharCode.apply(
+ String,
+ codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)
+ )
+ }
+ return res
+}
+
+function asciiSlice (buf, start, end) {
+ var ret = ''
+ end = Math.min(buf.length, end)
+
+ for (var i = start; i < end; ++i) {
+ ret += String.fromCharCode(buf[i] & 0x7F)
+ }
+ return ret
+}
+
+function latin1Slice (buf, start, end) {
+ var ret = ''
+ end = Math.min(buf.length, end)
+
+ for (var i = start; i < end; ++i) {
+ ret += String.fromCharCode(buf[i])
+ }
+ return ret
+}
+
+function hexSlice (buf, start, end) {
+ var len = buf.length
+
+ if (!start || start < 0) start = 0
+ if (!end || end < 0 || end > len) end = len
+
+ var out = ''
+ for (var i = start; i < end; ++i) {
+ out += toHex(buf[i])
+ }
+ return out
+}
+
+function utf16leSlice (buf, start, end) {
+ var bytes = buf.slice(start, end)
+ var res = ''
+ for (var i = 0; i < bytes.length; i += 2) {
+ res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256)
+ }
+ return res
+}
+
+Buffer.prototype.slice = function slice (start, end) {
+ var len = this.length
+ start = ~~start
+ end = end === undefined ? len : ~~end
+
+ if (start < 0) {
+ start += len
+ if (start < 0) start = 0
+ } else if (start > len) {
+ start = len
+ }
+
+ if (end < 0) {
+ end += len
+ if (end < 0) end = 0
+ } else if (end > len) {
+ end = len
+ }
+
+ if (end < start) end = start
+
+ var newBuf
+ if (Buffer.TYPED_ARRAY_SUPPORT) {
+ newBuf = this.subarray(start, end)
+ newBuf.__proto__ = Buffer.prototype
+ } else {
+ var sliceLen = end - start
+ newBuf = new Buffer(sliceLen, undefined)
+ for (var i = 0; i < sliceLen; ++i) {
+ newBuf[i] = this[i + start]
+ }
+ }
+
+ return newBuf
+}
+
+/*
+ * Need to make sure that buffer isn't trying to write out of bounds.
+ */
+function checkOffset (offset, ext, length) {
+ if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')
+ if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')
+}
+
+Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {
+ offset = offset | 0
+ byteLength = byteLength | 0
+ if (!noAssert) checkOffset(offset, byteLength, this.length)
+
+ var val = this[offset]
+ var mul = 1
+ var i = 0
+ while (++i < byteLength && (mul *= 0x100)) {
+ val += this[offset + i] * mul
+ }
+
+ return val
+}
+
+Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {
+ offset = offset | 0
+ byteLength = byteLength | 0
+ if (!noAssert) {
+ checkOffset(offset, byteLength, this.length)
+ }
+
+ var val = this[offset + --byteLength]
+ var mul = 1
+ while (byteLength > 0 && (mul *= 0x100)) {
+ val += this[offset + --byteLength] * mul
+ }
+
+ return val
+}
+
+Buffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {
+ if (!noAssert) checkOffset(offset, 1, this.length)
+ return this[offset]
+}
+
+Buffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {
+ if (!noAssert) checkOffset(offset, 2, this.length)
+ return this[offset] | (this[offset + 1] << 8)
+}
+
+Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {
+ if (!noAssert) checkOffset(offset, 2, this.length)
+ return (this[offset] << 8) | this[offset + 1]
+}
+
+Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {
+ if (!noAssert) checkOffset(offset, 4, this.length)
+
+ return ((this[offset]) |
+ (this[offset + 1] << 8) |
+ (this[offset + 2] << 16)) +
+ (this[offset + 3] * 0x1000000)
+}
+
+Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {
+ if (!noAssert) checkOffset(offset, 4, this.length)
+
+ return (this[offset] * 0x1000000) +
+ ((this[offset + 1] << 16) |
+ (this[offset + 2] << 8) |
+ this[offset + 3])
+}
+
+Buffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {
+ offset = offset | 0
+ byteLength = byteLength | 0
+ if (!noAssert) checkOffset(offset, byteLength, this.length)
+
+ var val = this[offset]
+ var mul = 1
+ var i = 0
+ while (++i < byteLength && (mul *= 0x100)) {
+ val += this[offset + i] * mul
+ }
+ mul *= 0x80
+
+ if (val >= mul) val -= Math.pow(2, 8 * byteLength)
+
+ return val
+}
+
+Buffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {
+ offset = offset | 0
+ byteLength = byteLength | 0
+ if (!noAssert) checkOffset(offset, byteLength, this.length)
+
+ var i = byteLength
+ var mul = 1
+ var val = this[offset + --i]
+ while (i > 0 && (mul *= 0x100)) {
+ val += this[offset + --i] * mul
+ }
+ mul *= 0x80
+
+ if (val >= mul) val -= Math.pow(2, 8 * byteLength)
+
+ return val
+}
+
+Buffer.prototype.readInt8 = function readInt8 (offset, noAssert) {
+ if (!noAssert) checkOffset(offset, 1, this.length)
+ if (!(this[offset] & 0x80)) return (this[offset])
+ return ((0xff - this[offset] + 1) * -1)
+}
+
+Buffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {
+ if (!noAssert) checkOffset(offset, 2, this.length)
+ var val = this[offset] | (this[offset + 1] << 8)
+ return (val & 0x8000) ? val | 0xFFFF0000 : val
+}
+
+Buffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {
+ if (!noAssert) checkOffset(offset, 2, this.length)
+ var val = this[offset + 1] | (this[offset] << 8)
+ return (val & 0x8000) ? val | 0xFFFF0000 : val
+}
+
+Buffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {
+ if (!noAssert) checkOffset(offset, 4, this.length)
+
+ return (this[offset]) |
+ (this[offset + 1] << 8) |
+ (this[offset + 2] << 16) |
+ (this[offset + 3] << 24)
+}
+
+Buffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {
+ if (!noAssert) checkOffset(offset, 4, this.length)
+
+ return (this[offset] << 24) |
+ (this[offset + 1] << 16) |
+ (this[offset + 2] << 8) |
+ (this[offset + 3])
+}
+
+Buffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {
+ if (!noAssert) checkOffset(offset, 4, this.length)
+ return ieee754.read(this, offset, true, 23, 4)
+}
+
+Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {
+ if (!noAssert) checkOffset(offset, 4, this.length)
+ return ieee754.read(this, offset, false, 23, 4)
+}
+
+Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {
+ if (!noAssert) checkOffset(offset, 8, this.length)
+ return ieee754.read(this, offset, true, 52, 8)
+}
+
+Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {
+ if (!noAssert) checkOffset(offset, 8, this.length)
+ return ieee754.read(this, offset, false, 52, 8)
+}
+
+function checkInt (buf, value, offset, ext, max, min) {
+ if (!Buffer.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance')
+ if (value > max || value < min) throw new RangeError('"value" argument is out of bounds')
+ if (offset + ext > buf.length) throw new RangeError('Index out of range')
+}
+
+Buffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {
+ value = +value
+ offset = offset | 0
+ byteLength = byteLength | 0
+ if (!noAssert) {
+ var maxBytes = Math.pow(2, 8 * byteLength) - 1
+ checkInt(this, value, offset, byteLength, maxBytes, 0)
+ }
+
+ var mul = 1
+ var i = 0
+ this[offset] = value & 0xFF
+ while (++i < byteLength && (mul *= 0x100)) {
+ this[offset + i] = (value / mul) & 0xFF
+ }
+
+ return offset + byteLength
+}
+
+Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {
+ value = +value
+ offset = offset | 0
+ byteLength = byteLength | 0
+ if (!noAssert) {
+ var maxBytes = Math.pow(2, 8 * byteLength) - 1
+ checkInt(this, value, offset, byteLength, maxBytes, 0)
+ }
+
+ var i = byteLength - 1
+ var mul = 1
+ this[offset + i] = value & 0xFF
+ while (--i >= 0 && (mul *= 0x100)) {
+ this[offset + i] = (value / mul) & 0xFF
+ }
+
+ return offset + byteLength
+}
+
+Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {
+ value = +value
+ offset = offset | 0
+ if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)
+ if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)
+ this[offset] = (value & 0xff)
+ return offset + 1
+}
+
+function objectWriteUInt16 (buf, value, offset, littleEndian) {
+ if (value < 0) value = 0xffff + value + 1
+ for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) {
+ buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>>
+ (littleEndian ? i : 1 - i) * 8
+ }
+}
+
+Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {
+ value = +value
+ offset = offset | 0
+ if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
+ if (Buffer.TYPED_ARRAY_SUPPORT) {
+ this[offset] = (value & 0xff)
+ this[offset + 1] = (value >>> 8)
+ } else {
+ objectWriteUInt16(this, value, offset, true)
+ }
+ return offset + 2
+}
+
+Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {
+ value = +value
+ offset = offset | 0
+ if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
+ if (Buffer.TYPED_ARRAY_SUPPORT) {
+ this[offset] = (value >>> 8)
+ this[offset + 1] = (value & 0xff)
+ } else {
+ objectWriteUInt16(this, value, offset, false)
+ }
+ return offset + 2
+}
+
+function objectWriteUInt32 (buf, value, offset, littleEndian) {
+ if (value < 0) value = 0xffffffff + value + 1
+ for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) {
+ buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff
+ }
+}
+
+Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {
+ value = +value
+ offset = offset | 0
+ if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
+ if (Buffer.TYPED_ARRAY_SUPPORT) {
+ this[offset + 3] = (value >>> 24)
+ this[offset + 2] = (value >>> 16)
+ this[offset + 1] = (value >>> 8)
+ this[offset] = (value & 0xff)
+ } else {
+ objectWriteUInt32(this, value, offset, true)
+ }
+ return offset + 4
+}
+
+Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {
+ value = +value
+ offset = offset | 0
+ if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
+ if (Buffer.TYPED_ARRAY_SUPPORT) {
+ this[offset] = (value >>> 24)
+ this[offset + 1] = (value >>> 16)
+ this[offset + 2] = (value >>> 8)
+ this[offset + 3] = (value & 0xff)
+ } else {
+ objectWriteUInt32(this, value, offset, false)
+ }
+ return offset + 4
+}
+
+Buffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {
+ value = +value
+ offset = offset | 0
+ if (!noAssert) {
+ var limit = Math.pow(2, 8 * byteLength - 1)
+
+ checkInt(this, value, offset, byteLength, limit - 1, -limit)
+ }
+
+ var i = 0
+ var mul = 1
+ var sub = 0
+ this[offset] = value & 0xFF
+ while (++i < byteLength && (mul *= 0x100)) {
+ if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {
+ sub = 1
+ }
+ this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
+ }
+
+ return offset + byteLength
+}
+
+Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {
+ value = +value
+ offset = offset | 0
+ if (!noAssert) {
+ var limit = Math.pow(2, 8 * byteLength - 1)
+
+ checkInt(this, value, offset, byteLength, limit - 1, -limit)
+ }
+
+ var i = byteLength - 1
+ var mul = 1
+ var sub = 0
+ this[offset + i] = value & 0xFF
+ while (--i >= 0 && (mul *= 0x100)) {
+ if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {
+ sub = 1
+ }
+ this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
+ }
+
+ return offset + byteLength
+}
+
+Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {
+ value = +value
+ offset = offset | 0
+ if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)
+ if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)
+ if (value < 0) value = 0xff + value + 1
+ this[offset] = (value & 0xff)
+ return offset + 1
+}
+
+Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {
+ value = +value
+ offset = offset | 0
+ if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
+ if (Buffer.TYPED_ARRAY_SUPPORT) {
+ this[offset] = (value & 0xff)
+ this[offset + 1] = (value >>> 8)
+ } else {
+ objectWriteUInt16(this, value, offset, true)
+ }
+ return offset + 2
+}
+
+Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {
+ value = +value
+ offset = offset | 0
+ if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
+ if (Buffer.TYPED_ARRAY_SUPPORT) {
+ this[offset] = (value >>> 8)
+ this[offset + 1] = (value & 0xff)
+ } else {
+ objectWriteUInt16(this, value, offset, false)
+ }
+ return offset + 2
+}
+
+Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {
+ value = +value
+ offset = offset | 0
+ if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
+ if (Buffer.TYPED_ARRAY_SUPPORT) {
+ this[offset] = (value & 0xff)
+ this[offset + 1] = (value >>> 8)
+ this[offset + 2] = (value >>> 16)
+ this[offset + 3] = (value >>> 24)
+ } else {
+ objectWriteUInt32(this, value, offset, true)
+ }
+ return offset + 4
+}
+
+Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {
+ value = +value
+ offset = offset | 0
+ if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
+ if (value < 0) value = 0xffffffff + value + 1
+ if (Buffer.TYPED_ARRAY_SUPPORT) {
+ this[offset] = (value >>> 24)
+ this[offset + 1] = (value >>> 16)
+ this[offset + 2] = (value >>> 8)
+ this[offset + 3] = (value & 0xff)
+ } else {
+ objectWriteUInt32(this, value, offset, false)
+ }
+ return offset + 4
+}
+
+function checkIEEE754 (buf, value, offset, ext, max, min) {
+ if (offset + ext > buf.length) throw new RangeError('Index out of range')
+ if (offset < 0) throw new RangeError('Index out of range')
+}
+
+function writeFloat (buf, value, offset, littleEndian, noAssert) {
+ if (!noAssert) {
+ checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)
+ }
+ ieee754.write(buf, value, offset, littleEndian, 23, 4)
+ return offset + 4
+}
+
+Buffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {
+ return writeFloat(this, value, offset, true, noAssert)
+}
+
+Buffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {
+ return writeFloat(this, value, offset, false, noAssert)
+}
+
+function writeDouble (buf, value, offset, littleEndian, noAssert) {
+ if (!noAssert) {
+ checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)
+ }
+ ieee754.write(buf, value, offset, littleEndian, 52, 8)
+ return offset + 8
+}
+
+Buffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {
+ return writeDouble(this, value, offset, true, noAssert)
+}
+
+Buffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {
+ return writeDouble(this, value, offset, false, noAssert)
+}
+
+// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)
+Buffer.prototype.copy = function copy (target, targetStart, start, end) {
+ if (!start) start = 0
+ if (!end && end !== 0) end = this.length
+ if (targetStart >= target.length) targetStart = target.length
+ if (!targetStart) targetStart = 0
+ if (end > 0 && end < start) end = start
+
+ // Copy 0 bytes; we're done
+ if (end === start) return 0
+ if (target.length === 0 || this.length === 0) return 0
+
+ // Fatal error conditions
+ if (targetStart < 0) {
+ throw new RangeError('targetStart out of bounds')
+ }
+ if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds')
+ if (end < 0) throw new RangeError('sourceEnd out of bounds')
+
+ // Are we oob?
+ if (end > this.length) end = this.length
+ if (target.length - targetStart < end - start) {
+ end = target.length - targetStart + start
+ }
+
+ var len = end - start
+ var i
+
+ if (this === target && start < targetStart && targetStart < end) {
+ // descending copy from end
+ for (i = len - 1; i >= 0; --i) {
+ target[i + targetStart] = this[i + start]
+ }
+ } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) {
+ // ascending copy from start
+ for (i = 0; i < len; ++i) {
+ target[i + targetStart] = this[i + start]
+ }
+ } else {
+ Uint8Array.prototype.set.call(
+ target,
+ this.subarray(start, start + len),
+ targetStart
+ )
+ }
+
+ return len
+}
+
+// Usage:
+// buffer.fill(number[, offset[, end]])
+// buffer.fill(buffer[, offset[, end]])
+// buffer.fill(string[, offset[, end]][, encoding])
+Buffer.prototype.fill = function fill (val, start, end, encoding) {
+ // Handle string cases:
+ if (typeof val === 'string') {
+ if (typeof start === 'string') {
+ encoding = start
+ start = 0
+ end = this.length
+ } else if (typeof end === 'string') {
+ encoding = end
+ end = this.length
+ }
+ if (val.length === 1) {
+ var code = val.charCodeAt(0)
+ if (code < 256) {
+ val = code
+ }
+ }
+ if (encoding !== undefined && typeof encoding !== 'string') {
+ throw new TypeError('encoding must be a string')
+ }
+ if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {
+ throw new TypeError('Unknown encoding: ' + encoding)
+ }
+ } else if (typeof val === 'number') {
+ val = val & 255
+ }
+
+ // Invalid ranges are not set to a default, so can range check early.
+ if (start < 0 || this.length < start || this.length < end) {
+ throw new RangeError('Out of range index')
+ }
+
+ if (end <= start) {
+ return this
+ }
+
+ start = start >>> 0
+ end = end === undefined ? this.length : end >>> 0
+
+ if (!val) val = 0
+
+ var i
+ if (typeof val === 'number') {
+ for (i = start; i < end; ++i) {
+ this[i] = val
+ }
+ } else {
+ var bytes = Buffer.isBuffer(val)
+ ? val
+ : utf8ToBytes(new Buffer(val, encoding).toString())
+ var len = bytes.length
+ for (i = 0; i < end - start; ++i) {
+ this[i + start] = bytes[i % len]
+ }
+ }
+
+ return this
+}
+
+// HELPER FUNCTIONS
+// ================
+
+var INVALID_BASE64_RE = /[^+\/0-9A-Za-z-_]/g
+
+function base64clean (str) {
+ // Node strips out invalid characters like \n and \t from the string, base64-js does not
+ str = stringtrim(str).replace(INVALID_BASE64_RE, '')
+ // Node converts strings with length < 2 to ''
+ if (str.length < 2) return ''
+ // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not
+ while (str.length % 4 !== 0) {
+ str = str + '='
+ }
+ return str
+}
+
+function stringtrim (str) {
+ if (str.trim) return str.trim()
+ return str.replace(/^\s+|\s+$/g, '')
+}
+
+function toHex (n) {
+ if (n < 16) return '0' + n.toString(16)
+ return n.toString(16)
+}
+
+function utf8ToBytes (string, units) {
+ units = units || Infinity
+ var codePoint
+ var length = string.length
+ var leadSurrogate = null
+ var bytes = []
+
+ for (var i = 0; i < length; ++i) {
+ codePoint = string.charCodeAt(i)
+
+ // is surrogate component
+ if (codePoint > 0xD7FF && codePoint < 0xE000) {
+ // last char was a lead
+ if (!leadSurrogate) {
+ // no lead yet
+ if (codePoint > 0xDBFF) {
+ // unexpected trail
+ if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
+ continue
+ } else if (i + 1 === length) {
+ // unpaired lead
+ if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
+ continue
+ }
+
+ // valid lead
+ leadSurrogate = codePoint
+
+ continue
+ }
+
+ // 2 leads in a row
+ if (codePoint < 0xDC00) {
+ if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
+ leadSurrogate = codePoint
+ continue
+ }
+
+ // valid surrogate pair
+ codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000
+ } else if (leadSurrogate) {
+ // valid bmp char, but last char was a lead
+ if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
+ }
+
+ leadSurrogate = null
+
+ // encode utf8
+ if (codePoint < 0x80) {
+ if ((units -= 1) < 0) break
+ bytes.push(codePoint)
+ } else if (codePoint < 0x800) {
+ if ((units -= 2) < 0) break
+ bytes.push(
+ codePoint >> 0x6 | 0xC0,
+ codePoint & 0x3F | 0x80
+ )
+ } else if (codePoint < 0x10000) {
+ if ((units -= 3) < 0) break
+ bytes.push(
+ codePoint >> 0xC | 0xE0,
+ codePoint >> 0x6 & 0x3F | 0x80,
+ codePoint & 0x3F | 0x80
+ )
+ } else if (codePoint < 0x110000) {
+ if ((units -= 4) < 0) break
+ bytes.push(
+ codePoint >> 0x12 | 0xF0,
+ codePoint >> 0xC & 0x3F | 0x80,
+ codePoint >> 0x6 & 0x3F | 0x80,
+ codePoint & 0x3F | 0x80
+ )
+ } else {
+ throw new Error('Invalid code point')
+ }
+ }
+
+ return bytes
+}
+
+function asciiToBytes (str) {
+ var byteArray = []
+ for (var i = 0; i < str.length; ++i) {
+ // Node's code seems to be doing this and not & 0x7F..
+ byteArray.push(str.charCodeAt(i) & 0xFF)
+ }
+ return byteArray
+}
+
+function utf16leToBytes (str, units) {
+ var c, hi, lo
+ var byteArray = []
+ for (var i = 0; i < str.length; ++i) {
+ if ((units -= 2) < 0) break
+
+ c = str.charCodeAt(i)
+ hi = c >> 8
+ lo = c % 256
+ byteArray.push(lo)
+ byteArray.push(hi)
+ }
+
+ return byteArray
+}
+
+function base64ToBytes (str) {
+ return base64.toByteArray(base64clean(str))
+}
+
+function blitBuffer (src, dst, offset, length) {
+ for (var i = 0; i < length; ++i) {
+ if ((i + offset >= dst.length) || (i >= src.length)) break
+ dst[i + offset] = src[i]
+ }
+ return i
+}
+
+function isnan (val) {
+ return val !== val // eslint-disable-line no-self-compare
+}
+
+/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(590)))
+
+/***/ }),
+/* 860 */
+/***/ (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
+}
+
+// Support decoding URL-safe base64 strings, as Node.js does.
+// See: https://en.wikipedia.org/wiki/Base64#URL_applications
+revLookup['-'.charCodeAt(0)] = 62
+revLookup['_'.charCodeAt(0)] = 63
+
+function getLens (b64) {
+ var len = b64.length
+
+ if (len % 4 > 0) {
+ throw new Error('Invalid string. Length must be a multiple of 4')
+ }
+
+ // Trim off extra bytes after placeholder bytes are found
+ // See: https://github.com/beatgammit/base64-js/issues/42
+ var validLen = b64.indexOf('=')
+ if (validLen === -1) validLen = len
+
+ var placeHoldersLen = validLen === len
+ ? 0
+ : 4 - (validLen % 4)
+
+ return [validLen, placeHoldersLen]
+}
+
+// base64 is 4/3 + up to two characters of the original data
+function byteLength (b64) {
+ var lens = getLens(b64)
+ var validLen = lens[0]
+ var placeHoldersLen = lens[1]
+ return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen
+}
+
+function _byteLength (b64, validLen, placeHoldersLen) {
+ return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen
+}
+
+function toByteArray (b64) {
+ var tmp
+ var lens = getLens(b64)
+ var validLen = lens[0]
+ var placeHoldersLen = lens[1]
+
+ var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))
+
+ var curByte = 0
+
+ // if there are placeholders, only get up to the last complete 4 chars
+ var len = placeHoldersLen > 0
+ ? validLen - 4
+ : validLen
+
+ var i
+ for (i = 0; i < len; 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[curByte++] = (tmp >> 16) & 0xFF
+ arr[curByte++] = (tmp >> 8) & 0xFF
+ arr[curByte++] = tmp & 0xFF
+ }
+
+ if (placeHoldersLen === 2) {
+ tmp =
+ (revLookup[b64.charCodeAt(i)] << 2) |
+ (revLookup[b64.charCodeAt(i + 1)] >> 4)
+ arr[curByte++] = tmp & 0xFF
+ }
+
+ if (placeHoldersLen === 1) {
+ tmp =
+ (revLookup[b64.charCodeAt(i)] << 10) |
+ (revLookup[b64.charCodeAt(i + 1)] << 4) |
+ (revLookup[b64.charCodeAt(i + 2)] >> 2)
+ arr[curByte++] = (tmp >> 8) & 0xFF
+ arr[curByte++] = 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) & 0xFF0000) +
+ ((uint8[i + 1] << 8) & 0xFF00) +
+ (uint8[i + 2] & 0xFF)
+ 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 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]
+ parts.push(
+ lookup[tmp >> 2] +
+ lookup[(tmp << 4) & 0x3F] +
+ '=='
+ )
+ } else if (extraBytes === 2) {
+ tmp = (uint8[len - 2] << 8) + uint8[len - 1]
+ parts.push(
+ lookup[tmp >> 10] +
+ lookup[(tmp >> 4) & 0x3F] +
+ lookup[(tmp << 2) & 0x3F] +
+ '='
+ )
+ }
+
+ return parts.join('')
+}
+
+
+/***/ }),
+/* 861 */
+/***/ (function(module, exports) {
+
+exports.read = function (buffer, offset, isLE, mLen, nBytes) {
+ var e, m
+ var eLen = (nBytes * 8) - mLen - 1
+ var eMax = (1 << eLen) - 1
+ var eBias = eMax >> 1
+ var nBits = -7
+ var i = isLE ? (nBytes - 1) : 0
+ var d = isLE ? -1 : 1
+ var s = buffer[offset + i]
+
+ i += d
+
+ e = s & ((1 << (-nBits)) - 1)
+ s >>= (-nBits)
+ nBits += eLen
+ for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {}
+
+ m = e & ((1 << (-nBits)) - 1)
+ e >>= (-nBits)
+ nBits += mLen
+ for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {}
+
+ if (e === 0) {
+ e = 1 - eBias
+ } else if (e === eMax) {
+ return m ? NaN : ((s ? -1 : 1) * Infinity)
+ } else {
+ m = m + Math.pow(2, mLen)
+ e = e - eBias
+ }
+ return (s ? -1 : 1) * m * Math.pow(2, e - mLen)
+}
+
+exports.write = function (buffer, value, offset, isLE, mLen, nBytes) {
+ var e, m, c
+ var eLen = (nBytes * 8) - mLen - 1
+ var eMax = (1 << eLen) - 1
+ var eBias = eMax >> 1
+ var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)
+ var i = isLE ? 0 : (nBytes - 1)
+ var d = isLE ? 1 : -1
+ var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0
+
+ value = Math.abs(value)
+
+ if (isNaN(value) || value === Infinity) {
+ m = isNaN(value) ? 1 : 0
+ e = eMax
+ } else {
+ e = Math.floor(Math.log(value) / Math.LN2)
+ if (value * (c = Math.pow(2, -e)) < 1) {
+ e--
+ c *= 2
+ }
+ if (e + eBias >= 1) {
+ value += rt / c
+ } else {
+ value += rt * Math.pow(2, 1 - eBias)
+ }
+ if (value * c >= 2) {
+ e++
+ c /= 2
+ }
+
+ if (e + eBias >= eMax) {
+ m = 0
+ e = eMax
+ } else if (e + eBias >= 1) {
+ m = ((value * c) - 1) * Math.pow(2, mLen)
+ e = e + eBias
+ } else {
+ m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)
+ e = 0
+ }
+ }
+
+ for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}
+
+ e = (e << mLen) | m
+ eLen += mLen
+ for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}
+
+ buffer[offset + i - d] |= s * 128
+}
+
+
+/***/ }),
+/* 862 */
+/***/ (function(module, exports) {
+
+var toString = {}.toString;
+
+module.exports = Array.isArray || function (arr) {
+ return toString.call(arr) == '[object Array]';
+};
+
+
+/***/ }),
+/* 863 */
+/***/ (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.EnumDeclaration = EnumDeclaration;
+exports.EnumBooleanBody = EnumBooleanBody;
+exports.EnumNumberBody = EnumNumberBody;
+exports.EnumStringBody = EnumStringBody;
+exports.EnumSymbolBody = EnumSymbolBody;
+exports.EnumDefaultedMember = EnumDefaultedMember;
+exports.EnumBooleanMember = EnumBooleanMember;
+exports.EnumNumberMember = EnumNumberMember;
+exports.EnumStringMember = EnumStringMember;
+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.SymbolTypeAnnotation = SymbolTypeAnnotation;
+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;
+ }
+});
+
+var t = _interopRequireWildcard(__webpack_require__(2));
+
+var _modules = __webpack_require__(689);
+
+var _types2 = __webpack_require__(690);
+
+function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
+
+function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } 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 EnumDeclaration(node) {
+ const {
+ id,
+ body
+ } = node;
+ this.word("enum");
+ this.space();
+ this.print(id, node);
+ this.print(body, node);
+}
+
+function enumExplicitType(context, name, hasExplicitType) {
+ if (hasExplicitType) {
+ context.space();
+ context.word("of");
+ context.space();
+ context.word(name);
+ }
+
+ context.space();
+}
+
+function enumBody(context, node) {
+ const {
+ members
+ } = node;
+ context.token("{");
+ context.indent();
+ context.newline();
+
+ for (const member of members) {
+ context.print(member, node);
+ context.newline();
+ }
+
+ context.dedent();
+ context.token("}");
+}
+
+function EnumBooleanBody(node) {
+ const {
+ explicitType
+ } = node;
+ enumExplicitType(this, "boolean", explicitType);
+ enumBody(this, node);
+}
+
+function EnumNumberBody(node) {
+ const {
+ explicitType
+ } = node;
+ enumExplicitType(this, "number", explicitType);
+ enumBody(this, node);
+}
+
+function EnumStringBody(node) {
+ const {
+ explicitType
+ } = node;
+ enumExplicitType(this, "string", explicitType);
+ enumBody(this, node);
+}
+
+function EnumSymbolBody(node) {
+ enumExplicitType(this, "symbol", true);
+ enumBody(this, node);
+}
+
+function EnumDefaultedMember(node) {
+ const {
+ id
+ } = node;
+ this.print(id, node);
+ this.token(",");
+}
+
+function enumInitializedMember(context, node) {
+ const {
+ id,
+ init
+ } = node;
+ context.print(id, node);
+ context.space();
+ context.token("=");
+ context.space();
+ context.print(init, node);
+ context.token(",");
+}
+
+function EnumBooleanMember(node) {
+ enumInitializedMember(this, node);
+}
+
+function EnumNumberMember(node) {
+ enumInitializedMember(this, node);
+}
+
+function EnumStringMember(node) {
+ enumInitializedMember(this, node);
+}
+
+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();
+ }
+
+ if (node.kind === "get" || node.kind === "set") {
+ this.word(node.kind);
+ 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 SymbolTypeAnnotation() {
+ this.word("symbol");
+}
+
+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");
+}
+
+/***/ }),
+/* 864 */
+/***/ (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) {
+ var _node$directives;
+
+ this.token("{");
+ this.printInnerComments(node);
+ const hasDirectives = (_node$directives = node.directives) == null ? void 0 : _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();
+ }
+}
+
+/***/ }),
+/* 865 */
+/***/ (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("</");
+ this.print(node.name, 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("</");
+ this.token(">");
+}
+
+/***/ }),
+/* 866 */
+/***/ (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.TSBigIntKeyword = TSBigIntKeyword;
+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;
+exports.tsPrintClassMemberModifiers = tsPrintClassMemberModifiers;
+
+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);
+ this.token(";");
+}
+
+function TSConstructSignatureDeclaration(node) {
+ this.word("new");
+ this.space();
+ this.tsPrintSignatureDeclarationBase(node);
+ this.token(";");
+}
+
+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 TSBigIntKeyword() {
+ this.word("bigint");
+}
+
+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) {
+ if (node.asserts) {
+ this.word("asserts");
+ this.space();
+ }
+
+ this.print(node.parameterName);
+
+ if (node.typeAnnotation) {
+ 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);
+}
+
+function tsPrintClassMemberModifiers(node, isField) {
+ if (isField && node.declare) {
+ this.word("declare");
+ this.space();
+ }
+
+ 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 (isField && node.readonly) {
+ this.word("readonly");
+ this.space();
+ }
+}
+
+/***/ }),
+/* 867 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.inferClassName = inferClassName;
+
+var t = _interopRequireWildcard(__webpack_require__(2));
+
+function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
+
+function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
+
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+// the function class is inferred from a call like
+// createClass or extend
+function fromCallExpression(callExpression) {
+ const allowlist = ["extend", "createClass"];
+ const {
+ callee
+ } = callExpression.node;
+
+ if (!callee) {
+ return null;
+ }
+
+ const name = t.isMemberExpression(callee) ? callee.property.name : callee.name;
+
+ if (!allowlist.includes(name)) {
+ return null;
+ }
+
+ const variable = callExpression.findParent(p => t.isVariableDeclarator(p.node));
+
+ if (variable) {
+ return variable.node.id.name;
+ }
+
+ const assignment = callExpression.findParent(p => t.isAssignmentExpression(p.node));
+
+ if (!assignment) {
+ return null;
+ }
+
+ const {
+ left
+ } = assignment.node;
+
+ if (left.name) {
+ return name;
+ }
+
+ if (t.isMemberExpression(left)) {
+ return left.property.name;
+ }
+
+ return null;
+} // the function class is inferred from a prototype assignment
+// e.g. TodoClass.prototype.render = function() {}
+
+
+function fromPrototype(assignment) {
+ const {
+ left
+ } = assignment.node;
+
+ if (!left) {
+ return null;
+ }
+
+ if (t.isMemberExpression(left) && left.object && t.isMemberExpression(left.object) && left.object.property.identifier === "prototype") {
+ return left.object.object.name;
+ }
+
+ return null;
+} // infer class finds an appropriate class for functions
+// that are defined inside of a class like thing.
+// e.g. `class Foo`, `TodoClass.prototype.foo`,
+// `Todo = createClass({ foo: () => {}})`
+
+
+function inferClassName(path) {
+ const classDeclaration = path.findParent(p => t.isClassDeclaration(p.node));
+
+ if (classDeclaration) {
+ return classDeclaration.node.id.name;
+ }
+
+ const callExpression = path.findParent(p => t.isCallExpression(p.node));
+
+ if (callExpression) {
+ return fromCallExpression(callExpression);
+ }
+
+ const assignment = path.findParent(p => t.isAssignmentExpression(p.node));
+
+ if (assignment) {
+ return fromPrototype(assignment);
+ }
+
+ return null;
+}
+
+/***/ }),
+/* 868 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.getFramework = getFramework;
+
+var t = _interopRequireWildcard(__webpack_require__(2));
+
+function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
+
+function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
+
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+function getFramework(symbols) {
+ if (isReactComponent(symbols)) {
+ return "React";
+ }
+
+ if (isAngularComponent(symbols)) {
+ return "Angular";
+ }
+
+ if (isVueComponent(symbols)) {
+ return "Vue";
+ }
+}
+
+function isReactComponent({
+ imports,
+ classes,
+ callExpressions,
+ identifiers
+}) {
+ return importsReact(imports) || requiresReact(callExpressions) || extendsReactComponent(classes) || isReact(identifiers) || isRedux(identifiers);
+}
+
+function importsReact(imports) {
+ return imports.some(importObj => importObj.source === "react" && importObj.specifiers.some(specifier => specifier === "React"));
+}
+
+function requiresReact(callExpressions) {
+ return callExpressions.some(callExpression => callExpression.name === "require" && callExpression.values.some(value => value === "react"));
+}
+
+function extendsReactComponent(classes) {
+ return classes.some(classObj => t.isIdentifier(classObj.parent, {
+ name: "Component"
+ }) || t.isIdentifier(classObj.parent, {
+ name: "PureComponent"
+ }) || t.isMemberExpression(classObj.parent, {
+ computed: false
+ }) && t.isIdentifier(classObj.parent, {
+ name: "Component"
+ }));
+}
+
+function isAngularComponent({
+ memberExpressions
+}) {
+ return memberExpressions.some(item => item.expression == "angular.controller" || item.expression == "angular.module");
+}
+
+function isVueComponent({
+ identifiers
+}) {
+ return identifiers.some(identifier => identifier.name == "Vue");
+}
+/* This identifies the react lib file */
+
+
+function isReact(identifiers) {
+ return identifiers.some(identifier => identifier.name == "isReactComponent");
+}
+/* This identifies the redux lib file */
+
+
+function isRedux(identifiers) {
+ return identifiers.some(identifier => identifier.name == "Redux");
+}
+
+/***/ }),
+/* 869 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.parseSourceScopes = parseSourceScopes;
+exports.buildScopeList = buildScopeList;
+
+var _isEmpty = _interopRequireDefault(__webpack_require__(686));
+
+var t = _interopRequireWildcard(__webpack_require__(2));
+
+var _getFunctionName = _interopRequireDefault(__webpack_require__(691));
+
+var _ast = __webpack_require__(572);
+
+function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
+
+function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+function isGeneratedId(id) {
+ return !/\/originalSource/.test(id);
+}
+
+function parseSourceScopes(sourceId) {
+ const ast = (0, _ast.getAst)(sourceId);
+
+ if ((0, _isEmpty.default)(ast)) {
+ return null;
+ }
+
+ return buildScopeList(ast, sourceId);
+}
+
+function buildScopeList(ast, sourceId) {
+ const {
+ global,
+ lexical
+ } = createGlobalScope(ast, sourceId);
+ const state = {
+ sourceId,
+ freeVariables: new Map(),
+ freeVariableStack: [],
+ inType: null,
+ scope: lexical,
+ scopeStack: [],
+ declarationBindingIds: new Set()
+ };
+ t.traverse(ast, scopeCollectionVisitor, state);
+
+ for (const [key, freeVariables] of state.freeVariables) {
+ let binding = global.bindings[key];
+
+ if (!binding) {
+ binding = {
+ type: "global",
+ refs: []
+ };
+ global.bindings[key] = binding;
+ }
+
+ binding.refs = freeVariables.concat(binding.refs);
+ } // TODO: This should probably check for ".mjs" extension on the
+ // original file, and should also be skipped if the the generated
+ // code is an ES6 module rather than a script.
+
+
+ if (isGeneratedId(sourceId) || ast.program.sourceType === "script" && !looksLikeCommonJS(global)) {
+ stripModuleScope(global);
+ }
+
+ return toParsedScopes([global], sourceId) || [];
+}
+
+function toParsedScopes(children, sourceId) {
+ if (!children || children.length === 0) {
+ return undefined;
+ }
+
+ return children.map(scope => ({
+ // Removing unneed information from TempScope such as parent reference.
+ // We also need to convert BabelLocation to the Location type.
+ start: scope.loc.start,
+ end: scope.loc.end,
+ type: scope.type === "module" || scope.type === "function-body" ? "block" : scope.type,
+ scopeKind: "",
+ displayName: scope.displayName,
+ bindings: scope.bindings,
+ children: toParsedScopes(scope.children, sourceId)
+ }));
+}
+
+function createTempScope(type, displayName, parent, loc) {
+ const result = {
+ type,
+ displayName,
+ parent,
+ children: [],
+ loc,
+ bindings: Object.create(null)
+ };
+
+ if (parent) {
+ parent.children.push(result);
+ }
+
+ return result;
+}
+
+function pushTempScope(state, type, displayName, loc) {
+ const scope = createTempScope(type, displayName, state.scope, loc);
+ state.scope = scope;
+ state.freeVariableStack.push(state.freeVariables);
+ state.freeVariables = new Map();
+ return scope;
+}
+
+function isNode(node, type) {
+ return node ? node.type === type : false;
+}
+
+function getVarScope(scope) {
+ let s = scope;
+
+ while (s.type !== "function" && s.type !== "module") {
+ if (!s.parent) {
+ return s;
+ }
+
+ s = s.parent;
+ }
+
+ return s;
+}
+
+function fromBabelLocation(location, sourceId) {
+ return {
+ sourceId,
+ line: location.line,
+ column: location.column
+ };
+}
+
+function parseDeclarator(declaratorId, targetScope, type, locationType, declaration, state) {
+ if (isNode(declaratorId, "Identifier")) {
+ let existing = targetScope.bindings[declaratorId.name];
+
+ if (!existing) {
+ existing = {
+ type,
+ refs: []
+ };
+ targetScope.bindings[declaratorId.name] = existing;
+ }
+
+ state.declarationBindingIds.add(declaratorId);
+ existing.refs.push({
+ type: locationType,
+ start: fromBabelLocation(declaratorId.loc.start, state.sourceId),
+ end: fromBabelLocation(declaratorId.loc.end, state.sourceId),
+ declaration: {
+ start: fromBabelLocation(declaration.loc.start, state.sourceId),
+ end: fromBabelLocation(declaration.loc.end, state.sourceId)
+ }
+ });
+ } else if (isNode(declaratorId, "ObjectPattern")) {
+ declaratorId.properties.forEach(prop => {
+ parseDeclarator(prop.value, targetScope, type, locationType, declaration, state);
+ });
+ } else if (isNode(declaratorId, "ArrayPattern")) {
+ declaratorId.elements.forEach(item => {
+ parseDeclarator(item, targetScope, type, locationType, declaration, state);
+ });
+ } else if (isNode(declaratorId, "AssignmentPattern")) {
+ parseDeclarator(declaratorId.left, targetScope, type, locationType, declaration, state);
+ } else if (isNode(declaratorId, "RestElement")) {
+ parseDeclarator(declaratorId.argument, targetScope, type, locationType, declaration, state);
+ } else if (t.isTSParameterProperty(declaratorId)) {
+ parseDeclarator(declaratorId.parameter, targetScope, type, locationType, declaration, state);
+ }
+}
+
+function isLetOrConst(node) {
+ return node.kind === "let" || node.kind === "const";
+}
+
+function hasLexicalDeclaration(node, parent) {
+ const nodes = [];
+
+ if (t.isSwitchStatement(node)) {
+ for (const caseNode of node.cases) {
+ nodes.push(...caseNode.consequent);
+ }
+ } else {
+ nodes.push(...node.body);
+ }
+
+ const isFunctionBody = t.isFunction(parent, {
+ body: node
+ });
+ return nodes.some(child => isLexicalVariable(child) || t.isClassDeclaration(child) || !isFunctionBody && t.isFunctionDeclaration(child));
+}
+
+function isLexicalVariable(node) {
+ return isNode(node, "VariableDeclaration") && isLetOrConst(node);
+}
+
+function createGlobalScope(ast, sourceId) {
+ const global = createTempScope("object", "Global", null, {
+ start: fromBabelLocation(ast.loc.start, sourceId),
+ end: fromBabelLocation(ast.loc.end, sourceId)
+ });
+ const lexical = createTempScope("block", "Lexical Global", global, {
+ start: fromBabelLocation(ast.loc.start, sourceId),
+ end: fromBabelLocation(ast.loc.end, sourceId)
+ });
+ return {
+ global,
+ lexical
+ };
+}
+
+const scopeCollectionVisitor = {
+ // eslint-disable-next-line complexity
+ enter(node, ancestors, state) {
+ state.scopeStack.push(state.scope);
+ const parentNode = ancestors.length === 0 ? null : ancestors[ancestors.length - 1].node;
+
+ if (state.inType) {
+ return;
+ }
+
+ if (t.isProgram(node)) {
+ const scope = pushTempScope(state, "module", "Module", {
+ start: fromBabelLocation(node.loc.start, state.sourceId),
+ end: fromBabelLocation(node.loc.end, state.sourceId)
+ });
+ scope.bindings.this = {
+ type: "implicit",
+ refs: []
+ };
+ } else if (t.isFunction(node)) {
+ let {
+ scope
+ } = state;
+
+ if (t.isFunctionExpression(node) && isNode(node.id, "Identifier")) {
+ scope = pushTempScope(state, "block", "Function Expression", {
+ start: fromBabelLocation(node.loc.start, state.sourceId),
+ end: fromBabelLocation(node.loc.end, state.sourceId)
+ });
+ state.declarationBindingIds.add(node.id);
+ scope.bindings[node.id.name] = {
+ type: "const",
+ refs: [{
+ type: "fn-expr",
+ start: fromBabelLocation(node.id.loc.start, state.sourceId),
+ end: fromBabelLocation(node.id.loc.end, state.sourceId),
+ declaration: {
+ start: fromBabelLocation(node.loc.start, state.sourceId),
+ end: fromBabelLocation(node.loc.end, state.sourceId)
+ }
+ }]
+ };
+ }
+
+ if (t.isFunctionDeclaration(node) && isNode(node.id, "Identifier")) {
+ // This ignores Annex B function declaration hoisting, which
+ // is probably a fine assumption.
+ state.declarationBindingIds.add(node.id);
+ const refs = [{
+ type: "fn-decl",
+ start: fromBabelLocation(node.id.loc.start, state.sourceId),
+ end: fromBabelLocation(node.id.loc.end, state.sourceId),
+ declaration: {
+ start: fromBabelLocation(node.loc.start, state.sourceId),
+ end: fromBabelLocation(node.loc.end, state.sourceId)
+ }
+ }];
+
+ if (scope.type === "block") {
+ scope.bindings[node.id.name] = {
+ type: "let",
+ refs
+ };
+ } else {
+ getVarScope(scope).bindings[node.id.name] = {
+ type: "var",
+ refs
+ };
+ }
+ }
+
+ scope = pushTempScope(state, "function", (0, _getFunctionName.default)(node, parentNode), {
+ // Being at the start of a function doesn't count as
+ // being inside of it.
+ start: fromBabelLocation(node.params[0] ? node.params[0].loc.start : node.loc.start, state.sourceId),
+ end: fromBabelLocation(node.loc.end, state.sourceId)
+ });
+ node.params.forEach(param => parseDeclarator(param, scope, "var", "fn-param", node, state));
+
+ if (!t.isArrowFunctionExpression(node)) {
+ scope.bindings.this = {
+ type: "implicit",
+ refs: []
+ };
+ scope.bindings.arguments = {
+ type: "implicit",
+ refs: []
+ };
+ }
+
+ if (t.isBlockStatement(node.body) && hasLexicalDeclaration(node.body, node)) {
+ scope = pushTempScope(state, "function-body", "Function Body", {
+ start: fromBabelLocation(node.body.loc.start, state.sourceId),
+ end: fromBabelLocation(node.body.loc.end, state.sourceId)
+ });
+ }
+ } else if (t.isClass(node)) {
+ if (t.isIdentifier(node.id)) {
+ // For decorated classes, the AST considers the first the decorator
+ // to be the start of the class. For the purposes of mapping class
+ // declarations however, we really want to look for the "class Foo"
+ // piece. To achieve that, we estimate the location of the declaration
+ // instead.
+ let declStart = node.loc.start;
+
+ if (node.decorators && node.decorators.length > 0) {
+ // Estimate the location of the "class" keyword since it
+ // is unlikely to be a different line than the class name.
+ declStart = {
+ line: node.id.loc.start.line,
+ column: node.id.loc.start.column - "class ".length
+ };
+ }
+
+ const declaration = {
+ start: fromBabelLocation(declStart, state.sourceId),
+ end: fromBabelLocation(node.loc.end, state.sourceId)
+ };
+
+ if (t.isClassDeclaration(node)) {
+ state.declarationBindingIds.add(node.id);
+ state.scope.bindings[node.id.name] = {
+ type: "let",
+ refs: [{
+ type: "class-decl",
+ start: fromBabelLocation(node.id.loc.start, state.sourceId),
+ end: fromBabelLocation(node.id.loc.end, state.sourceId),
+ declaration
+ }]
+ };
+ }
+
+ const scope = pushTempScope(state, "block", "Class", {
+ start: fromBabelLocation(node.loc.start, state.sourceId),
+ end: fromBabelLocation(node.loc.end, state.sourceId)
+ });
+ state.declarationBindingIds.add(node.id);
+ scope.bindings[node.id.name] = {
+ type: "const",
+ refs: [{
+ type: "class-inner",
+ start: fromBabelLocation(node.id.loc.start, state.sourceId),
+ end: fromBabelLocation(node.id.loc.end, state.sourceId),
+ declaration
+ }]
+ };
+ }
+ } else if (t.isForXStatement(node) || t.isForStatement(node)) {
+ const init = node.init || node.left;
+
+ if (isNode(init, "VariableDeclaration") && isLetOrConst(init)) {
+ // Debugger will create new lexical environment for the for.
+ pushTempScope(state, "block", "For", {
+ // Being at the start of a for loop doesn't count as
+ // being inside it.
+ start: fromBabelLocation(init.loc.start, state.sourceId),
+ end: fromBabelLocation(node.loc.end, state.sourceId)
+ });
+ }
+ } else if (t.isCatchClause(node)) {
+ const scope = pushTempScope(state, "block", "Catch", {
+ start: fromBabelLocation(node.loc.start, state.sourceId),
+ end: fromBabelLocation(node.loc.end, state.sourceId)
+ });
+ parseDeclarator(node.param, scope, "var", "catch", node, state);
+ } else if (t.isBlockStatement(node) && // Function body's are handled in the function logic above.
+ !t.isFunction(parentNode) && hasLexicalDeclaration(node, parentNode)) {
+ // Debugger will create new lexical environment for the block.
+ pushTempScope(state, "block", "Block", {
+ start: fromBabelLocation(node.loc.start, state.sourceId),
+ end: fromBabelLocation(node.loc.end, state.sourceId)
+ });
+ } else if (t.isVariableDeclaration(node) && (node.kind === "var" || // Lexical declarations in for statements are handled above.
+ !t.isForStatement(parentNode, {
+ init: node
+ }) || !t.isForXStatement(parentNode, {
+ left: node
+ }))) {
+ // Finds right lexical environment
+ const hoistAt = !isLetOrConst(node) ? getVarScope(state.scope) : state.scope;
+ node.declarations.forEach(declarator => {
+ parseDeclarator(declarator.id, hoistAt, node.kind, node.kind, node, state);
+ });
+ } else if (t.isImportDeclaration(node) && (!node.importKind || node.importKind === "value")) {
+ node.specifiers.forEach(spec => {
+ if (spec.importKind && spec.importKind !== "value") {
+ return;
+ }
+
+ if (t.isImportNamespaceSpecifier(spec)) {
+ state.declarationBindingIds.add(spec.local);
+ state.scope.bindings[spec.local.name] = {
+ // Imported namespaces aren't live import bindings, they are
+ // just normal const bindings.
+ type: "const",
+ refs: [{
+ type: "import-ns-decl",
+ start: fromBabelLocation(spec.local.loc.start, state.sourceId),
+ end: fromBabelLocation(spec.local.loc.end, state.sourceId),
+ declaration: {
+ start: fromBabelLocation(node.loc.start, state.sourceId),
+ end: fromBabelLocation(node.loc.end, state.sourceId)
+ }
+ }]
+ };
+ } else {
+ state.declarationBindingIds.add(spec.local);
+ state.scope.bindings[spec.local.name] = {
+ type: "import",
+ refs: [{
+ type: "import-decl",
+ start: fromBabelLocation(spec.local.loc.start, state.sourceId),
+ end: fromBabelLocation(spec.local.loc.end, state.sourceId),
+ importName: t.isImportDefaultSpecifier(spec) ? "default" : spec.imported.name,
+ declaration: {
+ start: fromBabelLocation(node.loc.start, state.sourceId),
+ end: fromBabelLocation(node.loc.end, state.sourceId)
+ }
+ }]
+ };
+ }
+ });
+ } else if (t.isTSEnumDeclaration(node)) {
+ state.declarationBindingIds.add(node.id);
+ state.scope.bindings[node.id.name] = {
+ type: "const",
+ refs: [{
+ type: "ts-enum-decl",
+ start: fromBabelLocation(node.id.loc.start, state.sourceId),
+ end: fromBabelLocation(node.id.loc.end, state.sourceId),
+ declaration: {
+ start: fromBabelLocation(node.loc.start, state.sourceId),
+ end: fromBabelLocation(node.loc.end, state.sourceId)
+ }
+ }]
+ };
+ } else if (t.isTSModuleDeclaration(node)) {
+ state.declarationBindingIds.add(node.id);
+ state.scope.bindings[node.id.name] = {
+ type: "const",
+ refs: [{
+ type: "ts-namespace-decl",
+ start: fromBabelLocation(node.id.loc.start, state.sourceId),
+ end: fromBabelLocation(node.id.loc.end, state.sourceId),
+ declaration: {
+ start: fromBabelLocation(node.loc.start, state.sourceId),
+ end: fromBabelLocation(node.loc.end, state.sourceId)
+ }
+ }]
+ };
+ } else if (t.isTSModuleBlock(node)) {
+ pushTempScope(state, "block", "TypeScript Namespace", {
+ start: fromBabelLocation(node.loc.start, state.sourceId),
+ end: fromBabelLocation(node.loc.end, state.sourceId)
+ });
+ } else if (t.isIdentifier(node) && t.isReferenced(node, parentNode) && // Babel doesn't cover this in 'isReferenced' yet, but it should
+ // eventually.
+ !t.isTSEnumMember(parentNode, {
+ id: node
+ }) && !t.isTSModuleDeclaration(parentNode, {
+ id: node
+ }) && // isReferenced above fails to see `var { foo } = ...` as a non-reference
+ // because the direct parent is not enough to know that the pattern is
+ // used within a variable declaration.
+ !state.declarationBindingIds.has(node)) {
+ let freeVariables = state.freeVariables.get(node.name);
+
+ if (!freeVariables) {
+ freeVariables = [];
+ state.freeVariables.set(node.name, freeVariables);
+ }
+
+ freeVariables.push({
+ type: "ref",
+ start: fromBabelLocation(node.loc.start, state.sourceId),
+ end: fromBabelLocation(node.loc.end, state.sourceId),
+ meta: buildMetaBindings(state.sourceId, node, ancestors)
+ });
+ } else if (isOpeningJSXIdentifier(node, ancestors)) {
+ let freeVariables = state.freeVariables.get(node.name);
+
+ if (!freeVariables) {
+ freeVariables = [];
+ state.freeVariables.set(node.name, freeVariables);
+ }
+
+ freeVariables.push({
+ type: "ref",
+ start: fromBabelLocation(node.loc.start, state.sourceId),
+ end: fromBabelLocation(node.loc.end, state.sourceId),
+ meta: buildMetaBindings(state.sourceId, node, ancestors)
+ });
+ } else if (t.isThisExpression(node)) {
+ let freeVariables = state.freeVariables.get("this");
+
+ if (!freeVariables) {
+ freeVariables = [];
+ state.freeVariables.set("this", freeVariables);
+ }
+
+ freeVariables.push({
+ type: "ref",
+ start: fromBabelLocation(node.loc.start, state.sourceId),
+ end: fromBabelLocation(node.loc.end, state.sourceId),
+ meta: buildMetaBindings(state.sourceId, node, ancestors)
+ });
+ } else if (t.isClassProperty(parentNode, {
+ value: node
+ })) {
+ const scope = pushTempScope(state, "function", "Class Field", {
+ start: fromBabelLocation(node.loc.start, state.sourceId),
+ end: fromBabelLocation(node.loc.end, state.sourceId)
+ });
+ scope.bindings.this = {
+ type: "implicit",
+ refs: []
+ };
+ scope.bindings.arguments = {
+ type: "implicit",
+ refs: []
+ };
+ } else if (t.isSwitchStatement(node) && hasLexicalDeclaration(node, parentNode)) {
+ pushTempScope(state, "block", "Switch", {
+ start: fromBabelLocation(node.loc.start, state.sourceId),
+ end: fromBabelLocation(node.loc.end, state.sourceId)
+ });
+ }
+
+ if ( // In general Flow expressions are deleted, so they can't contain
+ // runtime bindings, but typecasts are the one exception there.
+ t.isFlow(node) && !t.isTypeCastExpression(node) || // In general TS items are deleted, but TS has a few wrapper node
+ // types that can contain general JS expressions.
+ node.type.startsWith("TS") && !t.isTSTypeAssertion(node) && !t.isTSAsExpression(node) && !t.isTSNonNullExpression(node) && !t.isTSModuleDeclaration(node) && !t.isTSModuleBlock(node) && !t.isTSParameterProperty(node) && !t.isTSExportAssignment(node)) {
+ // Flag this node as a root "type" node. All items inside of this
+ // will be skipped entirely.
+ state.inType = node;
+ }
+ },
+
+ exit(node, ancestors, state) {
+ const currentScope = state.scope;
+ const parentScope = state.scopeStack.pop();
+
+ if (!parentScope) {
+ throw new Error("Assertion failure - unsynchronized pop");
+ }
+
+ state.scope = parentScope; // It is possible, as in the case of function expressions, that a single
+ // node has added multiple scopes, so we need to traverse upward here
+ // rather than jumping stright to 'parentScope'.
+
+ for (let scope = currentScope; scope && scope !== parentScope; scope = scope.parent) {
+ const {
+ freeVariables
+ } = state;
+ state.freeVariables = state.freeVariableStack.pop();
+ const parentFreeVariables = state.freeVariables; // Match up any free variables that match this scope's bindings and
+ // merge then into the refs.
+
+ for (const key of Object.keys(scope.bindings)) {
+ const binding = scope.bindings[key];
+ const freeVars = freeVariables.get(key);
+
+ if (freeVars) {
+ binding.refs.push(...freeVars);
+ freeVariables.delete(key);
+ }
+ } // Move any undeclared references in this scope into the parent for
+ // processing in higher scopes.
+
+
+ for (const [key, value] of freeVariables) {
+ let refs = parentFreeVariables.get(key);
+
+ if (!refs) {
+ refs = [];
+ parentFreeVariables.set(key, refs);
+ }
+
+ refs.push(...value);
+ }
+ }
+
+ if (state.inType === node) {
+ state.inType = null;
+ }
+ }
+
+};
+
+function isOpeningJSXIdentifier(node, ancestors) {
+ if (!t.isJSXIdentifier(node)) {
+ return false;
+ }
+
+ for (let i = ancestors.length - 1; i >= 0; i--) {
+ const {
+ node: parent,
+ key
+ } = ancestors[i];
+
+ if (t.isJSXOpeningElement(parent) && key === "name") {
+ return true;
+ } else if (!t.isJSXMemberExpression(parent) || key !== "object") {
+ break;
+ }
+ }
+
+ return false;
+}
+
+function buildMetaBindings(sourceId, node, ancestors, parentIndex = ancestors.length - 1) {
+ if (parentIndex <= 1) {
+ return null;
+ }
+
+ const parent = ancestors[parentIndex].node;
+ const grandparent = ancestors[parentIndex - 1].node; // Consider "0, foo" to be equivalent to "foo".
+
+ if (t.isSequenceExpression(parent) && parent.expressions.length === 2 && t.isNumericLiteral(parent.expressions[0]) && parent.expressions[1] === node) {
+ let {
+ start,
+ end
+ } = parent.loc;
+
+ if (t.isCallExpression(grandparent, {
+ callee: parent
+ })) {
+ // Attempt to expand the range around parentheses, e.g.
+ // (0, foo.bar)()
+ start = grandparent.loc.start;
+ end = Object.assign({}, end);
+ end.column += 1;
+ }
+
+ return {
+ type: "inherit",
+ start: fromBabelLocation(start, sourceId),
+ end: fromBabelLocation(end, sourceId),
+ parent: buildMetaBindings(sourceId, parent, ancestors, parentIndex - 1)
+ };
+ } // Consider "Object(foo)", and "__webpack_require__.i(foo)" to be
+ // equivalent to "foo" since they are essentially identity functions.
+
+
+ if (t.isCallExpression(parent) && (t.isIdentifier(parent.callee, {
+ name: "Object"
+ }) || t.isMemberExpression(parent.callee, {
+ computed: false
+ }) && t.isIdentifier(parent.callee.object, {
+ name: "__webpack_require__"
+ }) && t.isIdentifier(parent.callee.property, {
+ name: "i"
+ })) && parent.arguments.length === 1 && parent.arguments[0] === node) {
+ return {
+ type: "inherit",
+ start: fromBabelLocation(parent.loc.start, sourceId),
+ end: fromBabelLocation(parent.loc.end, sourceId),
+ parent: buildMetaBindings(sourceId, parent, ancestors, parentIndex - 1)
+ };
+ }
+
+ if (t.isMemberExpression(parent, {
+ object: node
+ })) {
+ if (parent.computed) {
+ if (t.isStringLiteral(parent.property)) {
+ return {
+ type: "member",
+ start: fromBabelLocation(parent.loc.start, sourceId),
+ end: fromBabelLocation(parent.loc.end, sourceId),
+ property: parent.property.value,
+ parent: buildMetaBindings(sourceId, parent, ancestors, parentIndex - 1)
+ };
+ }
+ } else {
+ return {
+ type: "member",
+ start: fromBabelLocation(parent.loc.start, sourceId),
+ end: fromBabelLocation(parent.loc.end, sourceId),
+ property: parent.property.name,
+ parent: buildMetaBindings(sourceId, parent, ancestors, parentIndex - 1)
+ };
+ }
+ }
+
+ if (t.isCallExpression(parent, {
+ callee: node
+ }) && parent.arguments.length == 0) {
+ return {
+ type: "call",
+ start: fromBabelLocation(parent.loc.start, sourceId),
+ end: fromBabelLocation(parent.loc.end, sourceId),
+ parent: buildMetaBindings(sourceId, parent, ancestors, parentIndex - 1)
+ };
+ }
+
+ return null;
+}
+
+function looksLikeCommonJS(rootScope) {
+ const hasRefs = name => rootScope.bindings[name] && rootScope.bindings[name].refs.length > 0;
+
+ return hasRefs("__dirname") || hasRefs("__filename") || hasRefs("require") || hasRefs("exports") || hasRefs("module");
+}
+
+function stripModuleScope(rootScope) {
+ const rootLexicalScope = rootScope.children[0];
+ const moduleScope = rootLexicalScope.children[0];
+
+ if (moduleScope.type !== "module") {
+ throw new Error("Assertion failure - should be module");
+ }
+
+ Object.keys(moduleScope.bindings).forEach(name => {
+ const binding = moduleScope.bindings[name];
+
+ if (binding.type === "let" || binding.type === "const") {
+ rootLexicalScope.bindings[name] = binding;
+ } else {
+ rootScope.bindings[name] = binding;
+ }
+ });
+ rootLexicalScope.children = moduleScope.children;
+ rootLexicalScope.children.forEach(child => {
+ child.parent = rootLexicalScope;
+ });
+}
+
+/***/ }),
+/* 870 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = void 0;
+
+var _findIndex = _interopRequireDefault(__webpack_require__(871));
+
+var _findLastIndex = _interopRequireDefault(__webpack_require__(892));
+
+var _contains = __webpack_require__(700);
+
+var _getSymbols = __webpack_require__(648);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+function findSymbols(source) {
+ const {
+ functions,
+ comments
+ } = (0, _getSymbols.getSymbols)(source);
+ return {
+ functions,
+ comments
+ };
+}
+/**
+ * Returns the location for a given function path. If the path represents a
+ * function declaration, the location will begin after the function identifier
+ * but before the function parameters.
+ */
+
+
+function getLocation(func) {
+ var _func$identifier, _func$identifier$loc;
+
+ const location = { ...func.location
+ }; // if the function has an identifier, start the block after it so the
+ // identifier is included in the "scope" of its parent
+
+ const identifierEnd = func === null || func === void 0 ? void 0 : (_func$identifier = func.identifier) === null || _func$identifier === void 0 ? void 0 : (_func$identifier$loc = _func$identifier.loc) === null || _func$identifier$loc === void 0 ? void 0 : _func$identifier$loc.end;
+
+ if (identifierEnd) {
+ location.start = identifierEnd;
+ }
+
+ return location;
+}
+/**
+ * Find the nearest location containing the input position and
+ * return new locations without inner locations under that nearest location
+ *
+ * @param locations Notice! The locations MUST be sorted by `sortByStart`
+ * so that we can do linear time complexity operation.
+ */
+
+
+function removeInnerLocations(locations, position) {
+ // First, let's find the nearest position-enclosing function location,
+ // which is to find the last location enclosing the position.
+ const newLocs = locations.slice();
+ const parentIndex = (0, _findLastIndex.default)(newLocs, loc => (0, _contains.containsPosition)(loc, position));
+
+ if (parentIndex < 0) {
+ return newLocs;
+ } // Second, from the nearest location, loop locations again, stop looping
+ // once seeing the 1st location not enclosed by the nearest location
+ // to find the last inner locations inside the nearest location.
+
+
+ const innerStartIndex = parentIndex + 1;
+ const parentLoc = newLocs[parentIndex];
+ const outerBoundaryIndex = (0, _findIndex.default)(newLocs, loc => !(0, _contains.containsLocation)(parentLoc, loc), innerStartIndex);
+ const innerBoundaryIndex = outerBoundaryIndex < 0 ? newLocs.length - 1 : outerBoundaryIndex - 1; // Third, remove those inner functions
+
+ newLocs.splice(innerStartIndex, innerBoundaryIndex - parentIndex);
+ return newLocs;
+}
+/**
+ * Return an new locations array which excludes
+ * items that are completely enclosed by another location in the input locations
+ *
+ * @param locations Notice! The locations MUST be sorted by `sortByStart`
+ * so that we can do linear time complexity operation.
+ */
+
+
+function removeOverlaps(locations) {
+ if (locations.length == 0) {
+ return [];
+ }
+
+ const firstParent = locations[0];
+ return locations.reduce(deduplicateNode, [firstParent]);
+}
+
+function deduplicateNode(nodes, location) {
+ const parent = nodes[nodes.length - 1];
+
+ if (!(0, _contains.containsLocation)(parent, location)) {
+ nodes.push(location);
+ }
+
+ return nodes;
+}
+/**
+ * Sorts an array of locations by start position
+ */
+
+
+function sortByStart(a, b) {
+ if (a.start.line < b.start.line) {
+ return -1;
+ } else if (a.start.line === b.start.line) {
+ return a.start.column - b.start.column;
+ }
+
+ return 1;
+}
+/**
+ * Returns an array of locations that are considered out of scope for the given
+ * location.
+ */
+
+
+function findOutOfScopeLocations(sourceId, position) {
+ const {
+ functions,
+ comments
+ } = findSymbols(sourceId);
+ const commentLocations = comments.map(c => c.location);
+ let locations = functions.map(getLocation).concat(commentLocations).sort(sortByStart); // Must remove inner locations then filter, otherwise,
+ // we will mis-judge in-scope inner locations as out of scope.
+
+ locations = removeInnerLocations(locations, position).filter(loc => !(0, _contains.containsPosition)(loc, position));
+ return removeOverlaps(locations);
+}
+
+var _default = findOutOfScopeLocations;
+exports.default = _default;
+
+/***/ }),
+/* 871 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var baseFindIndex = __webpack_require__(630),
+ baseIteratee = __webpack_require__(693),
+ toInteger = __webpack_require__(604);
+
+/* Built-in method references for those with the same name as other `lodash` methods. */
+var nativeMax = Math.max;
+
+/**
+ * This method is like `_.find` except that it returns the index of the first
+ * element `predicate` returns truthy for instead of the element itself.
+ *
+ * @static
+ * @memberOf _
+ * @since 1.1.0
+ * @category Array
+ * @param {Array} array The array to inspect.
+ * @param {Function} [predicate=_.identity] The function invoked per iteration.
+ * @param {number} [fromIndex=0] The index to search from.
+ * @returns {number} Returns the index of the found element, else `-1`.
+ * @example
+ *
+ * var users = [
+ * { 'user': 'barney', 'active': false },
+ * { 'user': 'fred', 'active': false },
+ * { 'user': 'pebbles', 'active': true }
+ * ];
+ *
+ * _.findIndex(users, function(o) { return o.user == 'barney'; });
+ * // => 0
+ *
+ * // The `_.matches` iteratee shorthand.
+ * _.findIndex(users, { 'user': 'fred', 'active': false });
+ * // => 1
+ *
+ * // The `_.matchesProperty` iteratee shorthand.
+ * _.findIndex(users, ['active', false]);
+ * // => 0
+ *
+ * // The `_.property` iteratee shorthand.
+ * _.findIndex(users, 'active');
+ * // => 2
+ */
+function findIndex(array, predicate, fromIndex) {
+ var length = array == null ? 0 : array.length;
+ if (!length) {
+ return -1;
+ }
+ var index = fromIndex == null ? 0 : toInteger(fromIndex);
+ if (index < 0) {
+ index = nativeMax(length + index, 0);
+ }
+ return baseFindIndex(array, baseIteratee(predicate, 3), index);
+}
+
+module.exports = findIndex;
+
+
+/***/ }),
+/* 872 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var baseIsMatch = __webpack_require__(873),
+ getMatchData = __webpack_require__(879),
+ matchesStrictComparable = __webpack_require__(697);
+
+/**
+ * The base implementation of `_.matches` which doesn't clone `source`.
+ *
+ * @private
+ * @param {Object} source The object of property values to match.
+ * @returns {Function} Returns the new spec function.
+ */
+function baseMatches(source) {
+ var matchData = getMatchData(source);
+ if (matchData.length == 1 && matchData[0][2]) {
+ return matchesStrictComparable(matchData[0][0], matchData[0][1]);
+ }
+ return function(object) {
+ return object === source || baseIsMatch(object, source, matchData);
+ };
+}
+
+module.exports = baseMatches;
+
+
+/***/ }),
+/* 873 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var Stack = __webpack_require__(613),
+ baseIsEqual = __webpack_require__(694);
+
+/** Used to compose bitmasks for value comparisons. */
+var COMPARE_PARTIAL_FLAG = 1,
+ COMPARE_UNORDERED_FLAG = 2;
+
+/**
+ * The base implementation of `_.isMatch` without support for iteratee shorthands.
+ *
+ * @private
+ * @param {Object} object The object to inspect.
+ * @param {Object} source The object of property values to match.
+ * @param {Array} matchData The property names, values, and compare flags to match.
+ * @param {Function} [customizer] The function to customize comparisons.
+ * @returns {boolean} Returns `true` if `object` is a match, else `false`.
+ */
+function baseIsMatch(object, source, matchData, customizer) {
+ var index = matchData.length,
+ length = index,
+ noCustomizer = !customizer;
+
+ if (object == null) {
+ return !length;
+ }
+ object = Object(object);
+ while (index--) {
+ var data = matchData[index];
+ if ((noCustomizer && data[2])
+ ? data[1] !== object[data[0]]
+ : !(data[0] in object)
+ ) {
+ return false;
+ }
+ }
+ while (++index < length) {
+ data = matchData[index];
+ var key = data[0],
+ objValue = object[key],
+ srcValue = data[1];
+
+ if (noCustomizer && data[2]) {
+ if (objValue === undefined && !(key in object)) {
+ return false;
+ }
+ } else {
+ var stack = new Stack;
+ if (customizer) {
+ var result = customizer(objValue, srcValue, key, object, source, stack);
+ }
+ if (!(result === undefined
+ ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)
+ : result
+ )) {
+ return false;
+ }
+ }
+ }
+ return true;
+}
+
+module.exports = baseIsMatch;
+
+
+/***/ }),
+/* 874 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var Stack = __webpack_require__(613),
+ equalArrays = __webpack_require__(695),
+ equalByTag = __webpack_require__(876),
+ equalObjects = __webpack_require__(878),
+ getTag = __webpack_require__(578),
+ isArray = __webpack_require__(563),
+ isBuffer = __webpack_require__(595),
+ isTypedArray = __webpack_require__(621);
+
+/** Used to compose bitmasks for value comparisons. */
+var COMPARE_PARTIAL_FLAG = 1;
+
+/** `Object#toString` result references. */
+var argsTag = '[object Arguments]',
+ arrayTag = '[object Array]',
+ objectTag = '[object Object]';
+
+/** Used for built-in method references. */
+var objectProto = Object.prototype;
+
+/** Used to check objects for own properties. */
+var hasOwnProperty = objectProto.hasOwnProperty;
+
+/**
+ * A specialized version of `baseIsEqual` for arrays and objects which performs
+ * deep comparisons and tracks traversed objects enabling objects with circular
+ * references to be compared.
+ *
+ * @private
+ * @param {Object} object The object to compare.
+ * @param {Object} other The other object to compare.
+ * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
+ * @param {Function} customizer The function to customize comparisons.
+ * @param {Function} equalFunc The function to determine equivalents of values.
+ * @param {Object} [stack] Tracks traversed `object` and `other` objects.
+ * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
+ */
+function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
+ var objIsArr = isArray(object),
+ othIsArr = isArray(other),
+ objTag = objIsArr ? arrayTag : getTag(object),
+ othTag = othIsArr ? arrayTag : getTag(other);
+
+ objTag = objTag == argsTag ? objectTag : objTag;
+ othTag = othTag == argsTag ? objectTag : othTag;
+
+ var objIsObj = objTag == objectTag,
+ othIsObj = othTag == objectTag,
+ isSameTag = objTag == othTag;
+
+ if (isSameTag && isBuffer(object)) {
+ if (!isBuffer(other)) {
+ return false;
+ }
+ objIsArr = true;
+ objIsObj = false;
+ }
+ if (isSameTag && !objIsObj) {
+ stack || (stack = new Stack);
+ return (objIsArr || isTypedArray(object))
+ ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)
+ : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
+ }
+ if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
+ var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
+ othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
+
+ if (objIsWrapped || othIsWrapped) {
+ var objUnwrapped = objIsWrapped ? object.value() : object,
+ othUnwrapped = othIsWrapped ? other.value() : other;
+
+ stack || (stack = new Stack);
+ return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
+ }
+ }
+ if (!isSameTag) {
+ return false;
+ }
+ stack || (stack = new Stack);
+ return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
+}
+
+module.exports = baseIsEqualDeep;
+
+
+/***/ }),
+/* 875 */
+/***/ (function(module, exports) {
+
+/**
+ * A specialized version of `_.some` for arrays without support for iteratee
+ * shorthands.
+ *
+ * @private
+ * @param {Array} [array] The array to iterate over.
+ * @param {Function} predicate The function invoked per iteration.
+ * @returns {boolean} Returns `true` if any element passes the predicate check,
+ * else `false`.
+ */
+function arraySome(array, predicate) {
+ var index = -1,
+ length = array == null ? 0 : array.length;
+
+ while (++index < length) {
+ if (predicate(array[index], index, array)) {
+ return true;
+ }
+ }
+ return false;
+}
+
+module.exports = arraySome;
+
+
+/***/ }),
+/* 876 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var Symbol = __webpack_require__(570),
+ Uint8Array = __webpack_require__(665),
+ eq = __webpack_require__(588),
+ equalArrays = __webpack_require__(695),
+ mapToArray = __webpack_require__(877),
+ setToArray = __webpack_require__(631);
+
+/** Used to compose bitmasks for value comparisons. */
+var COMPARE_PARTIAL_FLAG = 1,
+ COMPARE_UNORDERED_FLAG = 2;
+
+/** `Object#toString` result references. */
+var boolTag = '[object Boolean]',
+ dateTag = '[object Date]',
+ errorTag = '[object Error]',
+ mapTag = '[object Map]',
+ numberTag = '[object Number]',
+ regexpTag = '[object RegExp]',
+ setTag = '[object Set]',
+ stringTag = '[object String]',
+ symbolTag = '[object Symbol]';
+
+var arrayBufferTag = '[object ArrayBuffer]',
+ dataViewTag = '[object DataView]';
+
+/** Used to convert symbols to primitives and strings. */
+var symbolProto = Symbol ? Symbol.prototype : undefined,
+ symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;
+
+/**
+ * A specialized version of `baseIsEqualDeep` for comparing objects of
+ * the same `toStringTag`.
+ *
+ * **Note:** This function only supports comparing values with tags of
+ * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
+ *
+ * @private
+ * @param {Object} object The object to compare.
+ * @param {Object} other The other object to compare.
+ * @param {string} tag The `toStringTag` of the objects to compare.
+ * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
+ * @param {Function} customizer The function to customize comparisons.
+ * @param {Function} equalFunc The function to determine equivalents of values.
+ * @param {Object} stack Tracks traversed `object` and `other` objects.
+ * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
+ */
+function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
+ switch (tag) {
+ case dataViewTag:
+ if ((object.byteLength != other.byteLength) ||
+ (object.byteOffset != other.byteOffset)) {
+ return false;
+ }
+ object = object.buffer;
+ other = other.buffer;
+
+ case arrayBufferTag:
+ if ((object.byteLength != other.byteLength) ||
+ !equalFunc(new Uint8Array(object), new Uint8Array(other))) {
+ return false;
+ }
+ return true;
+
+ case boolTag:
+ case dateTag:
+ case numberTag:
+ // Coerce booleans to `1` or `0` and dates to milliseconds.
+ // Invalid dates are coerced to `NaN`.
+ return eq(+object, +other);
+
+ case errorTag:
+ return object.name == other.name && object.message == other.message;
+
+ case regexpTag:
+ case stringTag:
+ // Coerce regexes to strings and treat strings, primitives and objects,
+ // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
+ // for more details.
+ return object == (other + '');
+
+ case mapTag:
+ var convert = mapToArray;
+
+ case setTag:
+ var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
+ convert || (convert = setToArray);
+
+ if (object.size != other.size && !isPartial) {
+ return false;
+ }
+ // Assume cyclic values are equal.
+ var stacked = stack.get(object);
+ if (stacked) {
+ return stacked == other;
+ }
+ bitmask |= COMPARE_UNORDERED_FLAG;
+
+ // Recursively compare objects (susceptible to call stack limits).
+ stack.set(object, other);
+ var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
+ stack['delete'](object);
+ return result;
+
+ case symbolTag:
+ if (symbolValueOf) {
+ return symbolValueOf.call(object) == symbolValueOf.call(other);
+ }
+ }
+ return false;
+}
+
+module.exports = equalByTag;
+
+
+/***/ }),
+/* 877 */
+/***/ (function(module, exports) {
+
+/**
+ * Converts `map` to its key-value pairs.
+ *
+ * @private
+ * @param {Object} map The map to convert.
+ * @returns {Array} Returns the key-value pairs.
+ */
+function mapToArray(map) {
+ var index = -1,
+ result = Array(map.size);
+
+ map.forEach(function(value, key) {
+ result[++index] = [key, value];
+ });
+ return result;
+}
+
+module.exports = mapToArray;
+
+
+/***/ }),
+/* 878 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var getAllKeys = __webpack_require__(662);
+
+/** Used to compose bitmasks for value comparisons. */
+var COMPARE_PARTIAL_FLAG = 1;
+
+/** Used for built-in method references. */
+var objectProto = Object.prototype;
+
+/** Used to check objects for own properties. */
+var hasOwnProperty = objectProto.hasOwnProperty;
+
+/**
+ * A specialized version of `baseIsEqualDeep` for objects with support for
+ * partial deep comparisons.
+ *
+ * @private
+ * @param {Object} object The object to compare.
+ * @param {Object} other The other object to compare.
+ * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
+ * @param {Function} customizer The function to customize comparisons.
+ * @param {Function} equalFunc The function to determine equivalents of values.
+ * @param {Object} stack Tracks traversed `object` and `other` objects.
+ * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
+ */
+function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
+ var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
+ objProps = getAllKeys(object),
+ objLength = objProps.length,
+ othProps = getAllKeys(other),
+ othLength = othProps.length;
+
+ if (objLength != othLength && !isPartial) {
+ return false;
+ }
+ var index = objLength;
+ while (index--) {
+ var key = objProps[index];
+ if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
+ return false;
+ }
+ }
+ // Assume cyclic values are equal.
+ var stacked = stack.get(object);
+ if (stacked && stack.get(other)) {
+ return stacked == other;
+ }
+ var result = true;
+ stack.set(object, other);
+ stack.set(other, object);
+
+ var skipCtor = isPartial;
+ while (++index < objLength) {
+ key = objProps[index];
+ var objValue = object[key],
+ othValue = other[key];
+
+ if (customizer) {
+ var compared = isPartial
+ ? customizer(othValue, objValue, key, other, object, stack)
+ : customizer(objValue, othValue, key, object, other, stack);
+ }
+ // Recursively compare objects (susceptible to call stack limits).
+ if (!(compared === undefined
+ ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))
+ : compared
+ )) {
+ result = false;
+ break;
+ }
+ skipCtor || (skipCtor = key == 'constructor');
+ }
+ if (result && !skipCtor) {
+ var objCtor = object.constructor,
+ othCtor = other.constructor;
+
+ // Non `Object` object instances with different constructors are not equal.
+ if (objCtor != othCtor &&
+ ('constructor' in object && 'constructor' in other) &&
+ !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
+ typeof othCtor == 'function' && othCtor instanceof othCtor)) {
+ result = false;
+ }
+ }
+ stack['delete'](object);
+ stack['delete'](other);
+ return result;
+}
+
+module.exports = equalObjects;
+
+
+/***/ }),
+/* 879 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var isStrictComparable = __webpack_require__(696),
+ keys = __webpack_require__(594);
+
+/**
+ * Gets the property names, values, and compare flags of `object`.
+ *
+ * @private
+ * @param {Object} object The object to query.
+ * @returns {Array} Returns the match data of `object`.
+ */
+function getMatchData(object) {
+ var result = keys(object),
+ length = result.length;
+
+ while (length--) {
+ var key = result[length],
+ value = object[key];
+
+ result[length] = [key, value, isStrictComparable(value)];
+ }
+ return result;
+}
+
+module.exports = getMatchData;
+
+
+/***/ }),
+/* 880 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var baseIsEqual = __webpack_require__(694),
+ get = __webpack_require__(881),
+ hasIn = __webpack_require__(885),
+ isKey = __webpack_require__(641),
+ isStrictComparable = __webpack_require__(696),
+ matchesStrictComparable = __webpack_require__(697),
+ toKey = __webpack_require__(606);
+
+/** Used to compose bitmasks for value comparisons. */
+var COMPARE_PARTIAL_FLAG = 1,
+ COMPARE_UNORDERED_FLAG = 2;
+
+/**
+ * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.
+ *
+ * @private
+ * @param {string} path The path of the property to get.
+ * @param {*} srcValue The value to match.
+ * @returns {Function} Returns the new spec function.
+ */
+function baseMatchesProperty(path, srcValue) {
+ if (isKey(path) && isStrictComparable(srcValue)) {
+ return matchesStrictComparable(toKey(path), srcValue);
+ }
+ return function(object) {
+ var objValue = get(object, path);
+ return (objValue === undefined && objValue === srcValue)
+ ? hasIn(object, path)
+ : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
+ };
+}
+
+module.exports = baseMatchesProperty;
+
+
+/***/ }),
+/* 881 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var baseGet = __webpack_require__(698);
+
+/**
+ * Gets the value at `path` of `object`. If the resolved value is
+ * `undefined`, the `defaultValue` is returned in its place.
+ *
+ * @static
+ * @memberOf _
+ * @since 3.7.0
+ * @category Object
+ * @param {Object} object The object to query.
+ * @param {Array|string} path The path of the property to get.
+ * @param {*} [defaultValue] The value returned for `undefined` resolved values.
+ * @returns {*} Returns the resolved value.
+ * @example
+ *
+ * var object = { 'a': [{ 'b': { 'c': 3 } }] };
+ *
+ * _.get(object, 'a[0].b.c');
+ * // => 3
+ *
+ * _.get(object, ['a', '0', 'b', 'c']);
+ * // => 3
+ *
+ * _.get(object, 'a.b.c', 'default');
+ * // => 'default'
+ */
+function get(object, path, defaultValue) {
+ var result = object == null ? undefined : baseGet(object, path);
+ return result === undefined ? defaultValue : result;
+}
+
+module.exports = get;
+
+
+/***/ }),
+/* 882 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var memoizeCapped = __webpack_require__(883);
+
+/** Used to match property names within property paths. */
+var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
+
+/** Used to match backslashes in property paths. */
+var reEscapeChar = /\\(\\)?/g;
+
+/**
+ * Converts `string` to a property path array.
+ *
+ * @private
+ * @param {string} string The string to convert.
+ * @returns {Array} Returns the property path array.
+ */
+var stringToPath = memoizeCapped(function(string) {
+ var result = [];
+ if (string.charCodeAt(0) === 46 /* . */) {
+ result.push('');
+ }
+ string.replace(rePropName, function(match, number, quote, subString) {
+ result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));
+ });
+ return result;
+});
+
+module.exports = stringToPath;
+
+
+/***/ }),
+/* 883 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var memoize = __webpack_require__(884);
+
+/** Used as the maximum memoize cache size. */
+var MAX_MEMOIZE_SIZE = 500;
+
+/**
+ * A specialized version of `_.memoize` which clears the memoized function's
+ * cache when it exceeds `MAX_MEMOIZE_SIZE`.
+ *
+ * @private
+ * @param {Function} func The function to have its output memoized.
+ * @returns {Function} Returns the new memoized function.
+ */
+function memoizeCapped(func) {
+ var result = memoize(func, function(key) {
+ if (cache.size === MAX_MEMOIZE_SIZE) {
+ cache.clear();
+ }
+ return key;
+ });
+
+ var cache = result.cache;
+ return result;
+}
+
+module.exports = memoizeCapped;
+
+
+/***/ }),
+/* 884 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var MapCache = __webpack_require__(617);
+
+/** Error message constants. */
+var FUNC_ERROR_TEXT = 'Expected a function';
+
+/**
+ * Creates a function that memoizes the result of `func`. If `resolver` is
+ * provided, it determines the cache key for storing the result based on the
+ * arguments provided to the memoized function. By default, the first argument
+ * provided to the memoized function is used as the map cache key. The `func`
+ * is invoked with the `this` binding of the memoized function.
+ *
+ * **Note:** The cache is exposed as the `cache` property on the memoized
+ * function. Its creation may be customized by replacing the `_.memoize.Cache`
+ * constructor with one whose instances implement the
+ * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
+ * method interface of `clear`, `delete`, `get`, `has`, and `set`.
+ *
+ * @static
+ * @memberOf _
+ * @since 0.1.0
+ * @category Function
+ * @param {Function} func The function to have its output memoized.
+ * @param {Function} [resolver] The function to resolve the cache key.
+ * @returns {Function} Returns the new memoized function.
+ * @example
+ *
+ * var object = { 'a': 1, 'b': 2 };
+ * var other = { 'c': 3, 'd': 4 };
+ *
+ * var values = _.memoize(_.values);
+ * values(object);
+ * // => [1, 2]
+ *
+ * values(other);
+ * // => [3, 4]
+ *
+ * object.a = 2;
+ * values(object);
+ * // => [1, 2]
+ *
+ * // Modify the result cache.
+ * values.cache.set(object, ['a', 'b']);
+ * values(object);
+ * // => ['a', 'b']
+ *
+ * // Replace `_.memoize.Cache`.
+ * _.memoize.Cache = WeakMap;
+ */
+function memoize(func, resolver) {
+ if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
+ throw new TypeError(FUNC_ERROR_TEXT);
+ }
+ var memoized = function() {
+ var args = arguments,
+ key = resolver ? resolver.apply(this, args) : args[0],
+ cache = memoized.cache;
+
+ if (cache.has(key)) {
+ return cache.get(key);
+ }
+ var result = func.apply(this, args);
+ memoized.cache = cache.set(key, result) || cache;
+ return result;
+ };
+ memoized.cache = new (memoize.Cache || MapCache);
+ return memoized;
+}
+
+// Expose `MapCache`.
+memoize.Cache = MapCache;
+
+module.exports = memoize;
+
+
+/***/ }),
+/* 885 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var baseHasIn = __webpack_require__(886),
+ hasPath = __webpack_require__(887);
+
+/**
+ * Checks if `path` is a direct or inherited property of `object`.
+ *
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @category Object
+ * @param {Object} object The object to query.
+ * @param {Array|string} path The path to check.
+ * @returns {boolean} Returns `true` if `path` exists, else `false`.
+ * @example
+ *
+ * var object = _.create({ 'a': _.create({ 'b': 2 }) });
+ *
+ * _.hasIn(object, 'a');
+ * // => true
+ *
+ * _.hasIn(object, 'a.b');
+ * // => true
+ *
+ * _.hasIn(object, ['a', 'b']);
+ * // => true
+ *
+ * _.hasIn(object, 'b');
+ * // => false
+ */
+function hasIn(object, path) {
+ return object != null && hasPath(object, path, baseHasIn);
+}
+
+module.exports = hasIn;
+
+
+/***/ }),
+/* 886 */
+/***/ (function(module, exports) {
+
+/**
+ * The base implementation of `_.hasIn` without support for deep paths.
+ *
+ * @private
+ * @param {Object} [object] The object to query.
+ * @param {Array|string} key The key to check.
+ * @returns {boolean} Returns `true` if `key` exists, else `false`.
+ */
+function baseHasIn(object, key) {
+ return object != null && key in Object(object);
+}
+
+module.exports = baseHasIn;
+
+
+/***/ }),
+/* 887 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var castPath = __webpack_require__(699),
+ isArguments = __webpack_require__(618),
+ isArray = __webpack_require__(563),
+ isIndex = __webpack_require__(620),
+ isLength = __webpack_require__(622),
+ toKey = __webpack_require__(606);
+
+/**
+ * Checks if `path` exists on `object`.
+ *
+ * @private
+ * @param {Object} object The object to query.
+ * @param {Array|string} path The path to check.
+ * @param {Function} hasFunc The function to check properties.
+ * @returns {boolean} Returns `true` if `path` exists, else `false`.
+ */
+function hasPath(object, path, hasFunc) {
+ path = castPath(path, object);
+
+ var index = -1,
+ length = path.length,
+ result = false;
+
+ while (++index < length) {
+ var key = toKey(path[index]);
+ if (!(result = object != null && hasFunc(object, key))) {
+ break;
+ }
+ object = object[key];
+ }
+ if (result || ++index != length) {
+ return result;
+ }
+ length = object == null ? 0 : object.length;
+ return !!length && isLength(length) && isIndex(key, length) &&
+ (isArray(object) || isArguments(object));
+}
+
+module.exports = hasPath;
+
+
+/***/ }),
+/* 888 */
+/***/ (function(module, exports) {
+
+/**
+ * This method returns the first argument it receives.
+ *
+ * @static
+ * @since 0.1.0
+ * @memberOf _
+ * @category Util
+ * @param {*} value Any value.
+ * @returns {*} Returns `value`.
+ * @example
+ *
+ * var object = { 'a': 1 };
+ *
+ * console.log(_.identity(object) === object);
+ * // => true
+ */
+function identity(value) {
+ return value;
+}
+
+module.exports = identity;
+
+
+/***/ }),
+/* 889 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var baseProperty = __webpack_require__(890),
+ basePropertyDeep = __webpack_require__(891),
+ isKey = __webpack_require__(641),
+ toKey = __webpack_require__(606);
+
+/**
+ * Creates a function that returns the value at `path` of a given object.
+ *
+ * @static
+ * @memberOf _
+ * @since 2.4.0
+ * @category Util
+ * @param {Array|string} path The path of the property to get.
+ * @returns {Function} Returns the new accessor function.
+ * @example
+ *
+ * var objects = [
+ * { 'a': { 'b': 2 } },
+ * { 'a': { 'b': 1 } }
+ * ];
+ *
+ * _.map(objects, _.property('a.b'));
+ * // => [2, 1]
+ *
+ * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');
+ * // => [1, 2]
+ */
+function property(path) {
+ return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
+}
+
+module.exports = property;
+
+
+/***/ }),
+/* 890 */
+/***/ (function(module, exports) {
+
+/**
+ * The base implementation of `_.property` without support for deep paths.
+ *
+ * @private
+ * @param {string} key The key of the property to get.
+ * @returns {Function} Returns the new accessor function.
+ */
+function baseProperty(key) {
+ return function(object) {
+ return object == null ? undefined : object[key];
+ };
+}
+
+module.exports = baseProperty;
+
+
+/***/ }),
+/* 891 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var baseGet = __webpack_require__(698);
+
+/**
+ * A specialized version of `baseProperty` which supports deep paths.
+ *
+ * @private
+ * @param {Array|string} path The path of the property to get.
+ * @returns {Function} Returns the new accessor function.
+ */
+function basePropertyDeep(path) {
+ return function(object) {
+ return baseGet(object, path);
+ };
+}
+
+module.exports = basePropertyDeep;
+
+
+/***/ }),
+/* 892 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var baseFindIndex = __webpack_require__(630),
+ baseIteratee = __webpack_require__(693),
+ toInteger = __webpack_require__(604);
+
+/* Built-in method references for those with the same name as other `lodash` methods. */
+var nativeMax = Math.max,
+ nativeMin = Math.min;
+
+/**
+ * This method is like `_.findIndex` except that it iterates over elements
+ * of `collection` from right to left.
+ *
+ * @static
+ * @memberOf _
+ * @since 2.0.0
+ * @category Array
+ * @param {Array} array The array to inspect.
+ * @param {Function} [predicate=_.identity] The function invoked per iteration.
+ * @param {number} [fromIndex=array.length-1] The index to search from.
+ * @returns {number} Returns the index of the found element, else `-1`.
+ * @example
+ *
+ * var users = [
+ * { 'user': 'barney', 'active': true },
+ * { 'user': 'fred', 'active': false },
+ * { 'user': 'pebbles', 'active': false }
+ * ];
+ *
+ * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; });
+ * // => 2
+ *
+ * // The `_.matches` iteratee shorthand.
+ * _.findLastIndex(users, { 'user': 'barney', 'active': true });
+ * // => 0
+ *
+ * // The `_.matchesProperty` iteratee shorthand.
+ * _.findLastIndex(users, ['active', false]);
+ * // => 2
+ *
+ * // The `_.property` iteratee shorthand.
+ * _.findLastIndex(users, 'active');
+ * // => 0
+ */
+function findLastIndex(array, predicate, fromIndex) {
+ var length = array == null ? 0 : array.length;
+ if (!length) {
+ return -1;
+ }
+ var index = length - 1;
+ if (fromIndex !== undefined) {
+ index = toInteger(fromIndex);
+ index = fromIndex < 0
+ ? nativeMax(length + index, 0)
+ : nativeMin(index, length - 1);
+ }
+ return baseFindIndex(array, baseIteratee(predicate, 3), index, true);
+}
+
+module.exports = findLastIndex;
+
+
+/***/ }),
+/* 893 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.getNextStep = getNextStep;
+
+var t = _interopRequireWildcard(__webpack_require__(2));
+
+var _closest = __webpack_require__(894);
+
+var _helpers = __webpack_require__(602);
+
+function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
+
+function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
+
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+function getNextStep(sourceId, pausedPosition) {
+ const currentExpression = getSteppableExpression(sourceId, pausedPosition);
+
+ if (!currentExpression) {
+ return null;
+ }
+
+ const currentStatement = currentExpression.find(p => {
+ return p.inList && t.isStatement(p.node);
+ });
+
+ if (!currentStatement) {
+ throw new Error("Assertion failure - this should always find at least Program");
+ }
+
+ return _getNextStep(currentStatement, sourceId, pausedPosition);
+}
+
+function getSteppableExpression(sourceId, pausedPosition) {
+ const closestPath = (0, _closest.getClosestPath)(sourceId, pausedPosition);
+
+ if (!closestPath) {
+ return null;
+ }
+
+ if ((0, _helpers.isAwaitExpression)(closestPath) || (0, _helpers.isYieldExpression)(closestPath)) {
+ return closestPath;
+ }
+
+ return closestPath.find(p => t.isAwaitExpression(p.node) || t.isYieldExpression(p.node));
+}
+
+function _getNextStep(statement, sourceId, position) {
+ const nextStatement = statement.getSibling(1);
+
+ if (nextStatement) {
+ return { ...nextStatement.node.loc.start,
+ sourceId
+ };
+ }
+
+ return null;
+}
+
+/***/ }),
+/* 894 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.getClosestPath = getClosestPath;
+
+var _simplePath = _interopRequireDefault(__webpack_require__(684));
+
+var _ast = __webpack_require__(572);
+
+var _contains = __webpack_require__(700);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+function getClosestPath(sourceId, location) {
+ let closestPath = null;
+ (0, _ast.traverseAst)(sourceId, {
+ enter(node, ancestors) {
+ if ((0, _contains.nodeContainsPosition)(node, location)) {
+ const path = (0, _simplePath.default)(ancestors);
+
+ if (path && (!closestPath || path.depth > closestPath.depth)) {
+ closestPath = path;
+ }
+ }
+ }
+
+ });
+
+ if (!closestPath) {
+ throw new Error("Assertion failure - This should always fine a path");
+ }
+
+ return closestPath;
+}
+
+/***/ }),
+/* 895 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.hasSyntaxError = hasSyntaxError;
+
+var _ast = __webpack_require__(572);
+
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+function hasSyntaxError(input) {
+ try {
+ (0, _ast.parseScript)(input);
+ return false;
+ } catch (e) {
+ return `${e.name} : ${e.message}`;
+ }
+}
+
+/***/ }),
+/* 896 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = mapExpression;
+
+var _ast = __webpack_require__(572);
+
+var _mapOriginalExpression = _interopRequireDefault(__webpack_require__(897));
+
+var _mapBindings = _interopRequireDefault(__webpack_require__(898));
+
+var _mapAwaitExpression = _interopRequireDefault(__webpack_require__(899));
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+function mapExpression(expression, mappings, bindings, shouldMapBindings = true, shouldMapAwait = true) {
+ const mapped = {
+ await: false,
+ bindings: false,
+ originalExpression: false
+ };
+ const ast = (0, _ast.parseConsoleScript)(expression);
+
+ try {
+ if (mappings && ast) {
+ const beforeOriginalExpression = expression;
+ expression = (0, _mapOriginalExpression.default)(expression, ast, mappings);
+ mapped.originalExpression = beforeOriginalExpression !== expression;
+ }
+
+ if (shouldMapBindings && ast) {
+ const beforeBindings = expression;
+ expression = (0, _mapBindings.default)(expression, ast, bindings);
+ mapped.bindings = beforeBindings !== expression;
+ }
+
+ if (shouldMapAwait) {
+ const beforeAwait = expression;
+ expression = (0, _mapAwaitExpression.default)(expression, ast);
+ mapped.await = beforeAwait !== expression;
+ }
+ } catch (e) {
+ console.warn(`Error when mapping ${expression} expression:`, e);
+ }
+
+ return {
+ expression,
+ mapped
+ };
+}
+
+/***/ }),
+/* 897 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = mapOriginalExpression;
+
+var _ast = __webpack_require__(572);
+
+var _getScopes = __webpack_require__(692);
+
+var _generator = _interopRequireDefault(__webpack_require__(603));
+
+var t = _interopRequireWildcard(__webpack_require__(2));
+
+function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
+
+function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+// NOTE: this will only work if we are replacing an original identifier
+function replaceNode(ancestors, node) {
+ const ancestor = ancestors[ancestors.length - 1];
+
+ if (typeof ancestor.index === "number") {
+ ancestor.node[ancestor.key][ancestor.index] = node;
+ } else {
+ ancestor.node[ancestor.key] = node;
+ }
+}
+
+function getFirstExpression(ast) {
+ const statements = ast.program.body;
+
+ if (statements.length == 0) {
+ return null;
+ }
+
+ return statements[0].expression;
+}
+
+function locationKey(start) {
+ return `${start.line}:${start.column}`;
+}
+
+function mapOriginalExpression(expression, ast, mappings) {
+ const scopes = (0, _getScopes.buildScopeList)(ast, "");
+ let shouldUpdate = false;
+ const nodes = new Map();
+ const replacements = new Map(); // The ref-only global bindings are the ones that are accessed, but not
+ // declared anywhere in the parsed code, meaning they are either global,
+ // or declared somewhere in a scope outside the parsed code, so we
+ // rewrite all of those specifically to avoid rewritting declarations that
+ // shadow outer mappings.
+
+ for (const name of Object.keys(scopes[0].bindings)) {
+ const {
+ refs
+ } = scopes[0].bindings[name];
+ const mapping = mappings[name];
+
+ if (!refs.every(ref => ref.type === "ref") || !mapping || mapping === name) {
+ continue;
+ }
+
+ let node = nodes.get(name);
+
+ if (!node) {
+ node = getFirstExpression((0, _ast.parseScript)(mapping));
+ nodes.set(name, node);
+ }
+
+ for (const ref of refs) {
+ let {
+ line,
+ column
+ } = ref.start; // This shouldn't happen, just keeping Flow happy.
+
+ if (typeof column !== "number") {
+ column = 0;
+ }
+
+ replacements.set(locationKey({
+ line,
+ column
+ }), node);
+ }
+ }
+
+ if (replacements.size === 0) {
+ // Avoid the extra code generation work and also avoid potentially
+ // reformatting the user's code unnecessarily.
+ return expression;
+ }
+
+ t.traverse(ast, (node, ancestors) => {
+ if (!t.isIdentifier(node) && !t.isThisExpression(node)) {
+ return;
+ }
+
+ const ancestor = ancestors[ancestors.length - 1]; // Shorthand properties can have a key and value with `node.loc.start` value
+ // and we only want to replace the value.
+
+ if (t.isObjectProperty(ancestor.node) && ancestor.key !== "value") {
+ return;
+ }
+
+ const replacement = replacements.get(locationKey(node.loc.start));
+
+ if (replacement) {
+ replaceNode(ancestors, t.cloneNode(replacement));
+ shouldUpdate = true;
+ }
+ });
+
+ if (shouldUpdate) {
+ return (0, _generator.default)(ast).code;
+ }
+
+ return expression;
+}
+
+/***/ }),
+/* 898 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = mapExpressionBindings;
+
+var _ast = __webpack_require__(572);
+
+var _helpers = __webpack_require__(602);
+
+var _generator = _interopRequireDefault(__webpack_require__(603));
+
+var t = _interopRequireWildcard(__webpack_require__(2));
+
+function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
+
+function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+function getAssignmentTarget(node, bindings) {
+ if (t.isObjectPattern(node)) {
+ for (const property of node.properties) {
+ if (t.isRestElement(property)) {
+ property.argument = getAssignmentTarget(property.argument, bindings);
+ } else {
+ property.value = getAssignmentTarget(property.value, bindings);
+ }
+ }
+
+ return node;
+ }
+
+ if (t.isArrayPattern(node)) {
+ for (const [i, element] of node.elements.entries()) {
+ node.elements[i] = getAssignmentTarget(element, bindings);
+ }
+
+ return node;
+ }
+
+ if (t.isAssignmentPattern(node)) {
+ node.left = getAssignmentTarget(node.left, bindings);
+ return node;
+ }
+
+ if (t.isRestElement(node)) {
+ node.argument = getAssignmentTarget(node.argument, bindings);
+ return node;
+ }
+
+ if (t.isIdentifier(node)) {
+ return bindings.includes(node.name) ? node : t.memberExpression(t.identifier("self"), node);
+ }
+
+ return node;
+} // translates new bindings `var a = 3` into `self.a = 3`
+// and existing bindings `var a = 3` into `a = 3` for re-assignments
+
+
+function globalizeDeclaration(node, bindings) {
+ return node.declarations.map(declaration => t.expressionStatement(t.assignmentExpression("=", getAssignmentTarget(declaration.id, bindings), declaration.init || t.unaryExpression("void", t.numericLiteral(0)))));
+} // translates new bindings `a = 3` into `self.a = 3`
+// and keeps assignments the same for existing bindings.
+
+
+function globalizeAssignment(node, bindings) {
+ return t.assignmentExpression(node.operator, getAssignmentTarget(node.left, bindings), node.right);
+}
+
+function mapExpressionBindings(expression, ast, bindings = []) {
+ let isMapped = false;
+ let shouldUpdate = true;
+ t.traverse(ast, (node, ancestors) => {
+ const parent = ancestors[ancestors.length - 1];
+
+ if (t.isWithStatement(node)) {
+ shouldUpdate = false;
+ return;
+ }
+
+ if (!(0, _helpers.isTopLevel)(ancestors)) {
+ return;
+ }
+
+ if (t.isAssignmentExpression(node)) {
+ if (t.isIdentifier(node.left) || t.isPattern(node.left)) {
+ const newNode = globalizeAssignment(node, bindings);
+ isMapped = true;
+ return (0, _ast.replaceNode)(ancestors, newNode);
+ }
+
+ return;
+ }
+
+ if (!t.isVariableDeclaration(node)) {
+ return;
+ }
+
+ if (!t.isForStatement(parent.node)) {
+ const newNodes = globalizeDeclaration(node, bindings);
+ isMapped = true;
+ (0, _ast.replaceNode)(ancestors, newNodes);
+ }
+ });
+
+ if (!shouldUpdate || !isMapped) {
+ return expression;
+ }
+
+ return (0, _generator.default)(ast).code;
+}
+
+/***/ }),
+/* 899 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = mapTopLevelAwait;
+
+var _generator = _interopRequireDefault(__webpack_require__(603));
+
+var t = _interopRequireWildcard(__webpack_require__(2));
+
+var _ast = __webpack_require__(572);
+
+var _helpers = __webpack_require__(602);
+
+function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
+
+function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+function hasTopLevelAwait(ast) {
+ const hasAwait = (0, _ast.hasNode)(ast, (node, ancestors, b) => t.isAwaitExpression(node) && (0, _helpers.isTopLevel)(ancestors));
+ return hasAwait;
+} // translates new bindings `var a = 3` into `a = 3`.
+
+
+function translateDeclarationIntoAssignment(node) {
+ return node.declarations.reduce((acc, declaration) => {
+ // Don't translate declaration without initial assignment (e.g. `var a;`)
+ if (!declaration.init) {
+ return acc;
+ }
+
+ acc.push(t.expressionStatement(t.assignmentExpression("=", declaration.id, declaration.init)));
+ return acc;
+ }, []);
+}
+/**
+ * Given an AST, compute its last statement and replace it with a
+ * return statement.
+ */
+
+
+function addReturnNode(ast) {
+ const statements = ast.program.body;
+ const lastStatement = statements[statements.length - 1];
+ return statements.slice(0, -1).concat(t.returnStatement(lastStatement.expression));
+}
+
+function getDeclarations(node) {
+ const {
+ kind,
+ declarations
+ } = node;
+ const declaratorNodes = declarations.reduce((acc, d) => {
+ const declarators = getVariableDeclarators(d.id);
+ return acc.concat(declarators);
+ }, []); // We can't declare const variables outside of the async iife because we
+ // wouldn't be able to re-assign them. As a workaround, we transform them
+ // to `let` which should be good enough for those case.
+
+ return t.variableDeclaration(kind === "const" ? "let" : kind, declaratorNodes);
+}
+
+function getVariableDeclarators(node) {
+ if (t.isIdentifier(node)) {
+ return t.variableDeclarator(t.identifier(node.name));
+ }
+
+ if (t.isObjectProperty(node)) {
+ return getVariableDeclarators(node.value);
+ }
+
+ if (t.isRestElement(node)) {
+ return getVariableDeclarators(node.argument);
+ }
+
+ if (t.isAssignmentPattern(node)) {
+ return getVariableDeclarators(node.left);
+ }
+
+ if (t.isArrayPattern(node)) {
+ return node.elements.reduce((acc, element) => acc.concat(getVariableDeclarators(element)), []);
+ }
+
+ if (t.isObjectPattern(node)) {
+ return node.properties.reduce((acc, property) => acc.concat(getVariableDeclarators(property)), []);
+ }
+
+ return [];
+}
+/**
+ * Given an AST and an array of variableDeclaration nodes, return a new AST with
+ * all the declarations at the top of the AST.
+ */
+
+
+function addTopDeclarationNodes(ast, declarationNodes) {
+ const statements = [];
+ declarationNodes.forEach(declarationNode => {
+ statements.push(getDeclarations(declarationNode));
+ });
+ statements.push(ast);
+ return t.program(statements);
+}
+/**
+ * Given an AST, return an object of the following shape:
+ * - newAst: {AST} the AST where variable declarations were transformed into
+ * variable assignments
+ * - declarations: {Array<Node>} An array of all the declaration nodes needed
+ * outside of the async iife.
+ */
+
+
+function translateDeclarationsIntoAssignment(ast) {
+ const declarations = [];
+ t.traverse(ast, (node, ancestors) => {
+ const parent = ancestors[ancestors.length - 1];
+
+ if (t.isWithStatement(node) || !(0, _helpers.isTopLevel)(ancestors) || t.isAssignmentExpression(node) || !t.isVariableDeclaration(node) || t.isForStatement(parent.node) || !Array.isArray(node.declarations) || node.declarations.length === 0) {
+ return;
+ }
+
+ const newNodes = translateDeclarationIntoAssignment(node);
+ (0, _ast.replaceNode)(ancestors, newNodes);
+ declarations.push(node);
+ });
+ return {
+ newAst: ast,
+ declarations
+ };
+}
+/**
+ * Given an AST, wrap its body in an async iife, transform variable declarations
+ * in assignments and move the variable declarations outside of the async iife.
+ * Example: With the AST for the following expression: `let a = await 123`, the
+ * function will return:
+ * let a;
+ * (async => {
+ * return a = await 123;
+ * })();
+ */
+
+
+function wrapExpressionFromAst(ast) {
+ // Transform let and var declarations into assignments, and get back an array
+ // of variable declarations.
+ let {
+ newAst,
+ declarations
+ } = translateDeclarationsIntoAssignment(ast);
+ const body = addReturnNode(newAst); // Create the async iife.
+
+ newAst = t.expressionStatement(t.callExpression(t.arrowFunctionExpression([], t.blockStatement(body), true), [])); // Now let's put all the variable declarations at the top of the async iife.
+
+ newAst = addTopDeclarationNodes(newAst, declarations);
+ return (0, _generator.default)(newAst).code;
+}
+
+function mapTopLevelAwait(expression, ast) {
+ if (!ast) {
+ // If there's no ast this means the expression is malformed. And if the
+ // expression contains the await keyword, we still want to wrap it in an
+ // async iife in order to get a meaningful message (without this, the
+ // engine will throw an Error stating that await keywords are only valid
+ // in async functions and generators).
+ if (expression.includes("await ")) {
+ return `(async () => { ${expression} })();`;
+ }
+
+ return expression;
+ }
+
+ if (!hasTopLevelAwait(ast)) {
+ return expression;
+ }
+
+ return wrapExpressionFromAst(ast);
+}
+
+/***/ })
+/******/ ]);
+}); \ No newline at end of file
diff --git a/devtools/client/debugger/dist/pretty-print-worker.js b/devtools/client/debugger/dist/pretty-print-worker.js
new file mode 100644
index 0000000000..a6fc68fd85
--- /dev/null
+++ b/devtools/client/debugger/dist/pretty-print-worker.js
@@ -0,0 +1,9637 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+(function webpackUniversalModuleDefinition(root, factory) {
+ if(typeof exports === 'object' && typeof module === 'object')
+ module.exports = factory();
+ else if(typeof define === 'function' && define.amd)
+ define([], factory);
+ else {
+ var a = factory();
+ for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
+ }
+})(typeof self !== 'undefined' ? self : 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, {
+/******/ configurable: false,
+/******/ enumerable: true,
+/******/ get: getter
+/******/ });
+/******/ }
+/******/ };
+/******/
+/******/ // 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 = "/assets/build";
+/******/
+/******/ // Load entry module and return exports
+/******/ return __webpack_require__(__webpack_require__.s = 900);
+/******/ })
+/************************************************************************/
+/******/ ({
+
+/***/ 560:
+/***/ (function(module, exports, __webpack_require__) {
+
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+const networkRequest = __webpack_require__(567);
+
+const workerUtils = __webpack_require__(568);
+
+module.exports = {
+ networkRequest,
+ workerUtils
+};
+
+/***/ }),
+
+/***/ 566:
+/***/ (function(module, exports) {
+
+/* -*- Mode: js; js-indent-level: 2; -*- */
+/*
+ * Copyright 2011 Mozilla Foundation and contributors
+ * Licensed under the New BSD license. See LICENSE or:
+ * http://opensource.org/licenses/BSD-3-Clause
+ */
+
+/**
+ * This is a helper function for getting values from parameter/options
+ * objects.
+ *
+ * @param args The object we are extracting values from
+ * @param name The name of the property we are getting.
+ * @param defaultValue An optional value to return if the property is missing
+ * from the object. If this is not specified and the property is missing, an
+ * error will be thrown.
+ */
+function getArg(aArgs, aName, aDefaultValue) {
+ if (aName in aArgs) {
+ return aArgs[aName];
+ } else if (arguments.length === 3) {
+ return aDefaultValue;
+ } else {
+ throw new Error('"' + aName + '" is a required argument.');
+ }
+}
+exports.getArg = getArg;
+
+var urlRegexp = /^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.]*)(?::(\d+))?(\S*)$/;
+var dataUrlRegexp = /^data:.+\,.+$/;
+
+function urlParse(aUrl) {
+ var match = aUrl.match(urlRegexp);
+ if (!match) {
+ return null;
+ }
+ return {
+ scheme: match[1],
+ auth: match[2],
+ host: match[3],
+ port: match[4],
+ path: match[5]
+ };
+}
+exports.urlParse = urlParse;
+
+function urlGenerate(aParsedUrl) {
+ var url = '';
+ if (aParsedUrl.scheme) {
+ url += aParsedUrl.scheme + ':';
+ }
+ url += '//';
+ if (aParsedUrl.auth) {
+ url += aParsedUrl.auth + '@';
+ }
+ if (aParsedUrl.host) {
+ url += aParsedUrl.host;
+ }
+ if (aParsedUrl.port) {
+ url += ":" + aParsedUrl.port
+ }
+ if (aParsedUrl.path) {
+ url += aParsedUrl.path;
+ }
+ return url;
+}
+exports.urlGenerate = urlGenerate;
+
+/**
+ * Normalizes a path, or the path portion of a URL:
+ *
+ * - Replaces consecutive slashes with one slash.
+ * - Removes unnecessary '.' parts.
+ * - Removes unnecessary '<dir>/..' parts.
+ *
+ * Based on code in the Node.js 'path' core module.
+ *
+ * @param aPath The path or url to normalize.
+ */
+function normalize(aPath) {
+ var path = aPath;
+ var url = urlParse(aPath);
+ if (url) {
+ if (!url.path) {
+ return aPath;
+ }
+ path = url.path;
+ }
+ var isAbsolute = exports.isAbsolute(path);
+
+ var parts = path.split(/\/+/);
+ for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {
+ part = parts[i];
+ if (part === '.') {
+ parts.splice(i, 1);
+ } else if (part === '..') {
+ up++;
+ } else if (up > 0) {
+ if (part === '') {
+ // The first part is blank if the path is absolute. Trying to go
+ // above the root is a no-op. Therefore we can remove all '..' parts
+ // directly after the root.
+ parts.splice(i + 1, up);
+ up = 0;
+ } else {
+ parts.splice(i, 2);
+ up--;
+ }
+ }
+ }
+ path = parts.join('/');
+
+ if (path === '') {
+ path = isAbsolute ? '/' : '.';
+ }
+
+ if (url) {
+ url.path = path;
+ return urlGenerate(url);
+ }
+ return path;
+}
+exports.normalize = normalize;
+
+/**
+ * Joins two paths/URLs.
+ *
+ * @param aRoot The root path or URL.
+ * @param aPath The path or URL to be joined with the root.
+ *
+ * - If aPath is a URL or a data URI, aPath is returned, unless aPath is a
+ * scheme-relative URL: Then the scheme of aRoot, if any, is prepended
+ * first.
+ * - Otherwise aPath is a path. If aRoot is a URL, then its path portion
+ * is updated with the result and aRoot is returned. Otherwise the result
+ * is returned.
+ * - If aPath is absolute, the result is aPath.
+ * - Otherwise the two paths are joined with a slash.
+ * - Joining for example 'http://' and 'www.example.com' is also supported.
+ */
+function join(aRoot, aPath) {
+ if (aRoot === "") {
+ aRoot = ".";
+ }
+ if (aPath === "") {
+ aPath = ".";
+ }
+ var aPathUrl = urlParse(aPath);
+ var aRootUrl = urlParse(aRoot);
+ if (aRootUrl) {
+ aRoot = aRootUrl.path || '/';
+ }
+
+ // `join(foo, '//www.example.org')`
+ if (aPathUrl && !aPathUrl.scheme) {
+ if (aRootUrl) {
+ aPathUrl.scheme = aRootUrl.scheme;
+ }
+ return urlGenerate(aPathUrl);
+ }
+
+ if (aPathUrl || aPath.match(dataUrlRegexp)) {
+ return aPath;
+ }
+
+ // `join('http://', 'www.example.com')`
+ if (aRootUrl && !aRootUrl.host && !aRootUrl.path) {
+ aRootUrl.host = aPath;
+ return urlGenerate(aRootUrl);
+ }
+
+ var joined = aPath.charAt(0) === '/'
+ ? aPath
+ : normalize(aRoot.replace(/\/+$/, '') + '/' + aPath);
+
+ if (aRootUrl) {
+ aRootUrl.path = joined;
+ return urlGenerate(aRootUrl);
+ }
+ return joined;
+}
+exports.join = join;
+
+exports.isAbsolute = function (aPath) {
+ return aPath.charAt(0) === '/' || !!aPath.match(urlRegexp);
+};
+
+/**
+ * Make a path relative to a URL or another path.
+ *
+ * @param aRoot The root path or URL.
+ * @param aPath The path or URL to be made relative to aRoot.
+ */
+function relative(aRoot, aPath) {
+ if (aRoot === "") {
+ aRoot = ".";
+ }
+
+ aRoot = aRoot.replace(/\/$/, '');
+
+ // It is possible for the path to be above the root. In this case, simply
+ // checking whether the root is a prefix of the path won't work. Instead, we
+ // need to remove components from the root one by one, until either we find
+ // a prefix that fits, or we run out of components to remove.
+ var level = 0;
+ while (aPath.indexOf(aRoot + '/') !== 0) {
+ var index = aRoot.lastIndexOf("/");
+ if (index < 0) {
+ return aPath;
+ }
+
+ // If the only part of the root that is left is the scheme (i.e. http://,
+ // file:///, etc.), one or more slashes (/), or simply nothing at all, we
+ // have exhausted all components, so the path is not relative to the root.
+ aRoot = aRoot.slice(0, index);
+ if (aRoot.match(/^([^\/]+:\/)?\/*$/)) {
+ return aPath;
+ }
+
+ ++level;
+ }
+
+ // Make sure we add a "../" for each component we removed from the root.
+ return Array(level + 1).join("../") + aPath.substr(aRoot.length + 1);
+}
+exports.relative = relative;
+
+var supportsNullProto = (function () {
+ var obj = Object.create(null);
+ return !('__proto__' in obj);
+}());
+
+function identity (s) {
+ return s;
+}
+
+/**
+ * Because behavior goes wacky when you set `__proto__` on objects, we
+ * have to prefix all the strings in our set with an arbitrary character.
+ *
+ * See https://github.com/mozilla/source-map/pull/31 and
+ * https://github.com/mozilla/source-map/issues/30
+ *
+ * @param String aStr
+ */
+function toSetString(aStr) {
+ if (isProtoString(aStr)) {
+ return '$' + aStr;
+ }
+
+ return aStr;
+}
+exports.toSetString = supportsNullProto ? identity : toSetString;
+
+function fromSetString(aStr) {
+ if (isProtoString(aStr)) {
+ return aStr.slice(1);
+ }
+
+ return aStr;
+}
+exports.fromSetString = supportsNullProto ? identity : fromSetString;
+
+function isProtoString(s) {
+ if (!s) {
+ return false;
+ }
+
+ var length = s.length;
+
+ if (length < 9 /* "__proto__".length */) {
+ return false;
+ }
+
+ if (s.charCodeAt(length - 1) !== 95 /* '_' */ ||
+ s.charCodeAt(length - 2) !== 95 /* '_' */ ||
+ s.charCodeAt(length - 3) !== 111 /* 'o' */ ||
+ s.charCodeAt(length - 4) !== 116 /* 't' */ ||
+ s.charCodeAt(length - 5) !== 111 /* 'o' */ ||
+ s.charCodeAt(length - 6) !== 114 /* 'r' */ ||
+ s.charCodeAt(length - 7) !== 112 /* 'p' */ ||
+ s.charCodeAt(length - 8) !== 95 /* '_' */ ||
+ s.charCodeAt(length - 9) !== 95 /* '_' */) {
+ return false;
+ }
+
+ for (var i = length - 10; i >= 0; i--) {
+ if (s.charCodeAt(i) !== 36 /* '$' */) {
+ return false;
+ }
+ }
+
+ return true;
+}
+
+/**
+ * Comparator between two mappings where the original positions are compared.
+ *
+ * Optionally pass in `true` as `onlyCompareGenerated` to consider two
+ * mappings with the same original source/line/column, but different generated
+ * line and column the same. Useful when searching for a mapping with a
+ * stubbed out mapping.
+ */
+function compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) {
+ var cmp = mappingA.source - mappingB.source;
+ if (cmp !== 0) {
+ return cmp;
+ }
+
+ cmp = mappingA.originalLine - mappingB.originalLine;
+ if (cmp !== 0) {
+ return cmp;
+ }
+
+ cmp = mappingA.originalColumn - mappingB.originalColumn;
+ if (cmp !== 0 || onlyCompareOriginal) {
+ return cmp;
+ }
+
+ cmp = mappingA.generatedColumn - mappingB.generatedColumn;
+ if (cmp !== 0) {
+ return cmp;
+ }
+
+ cmp = mappingA.generatedLine - mappingB.generatedLine;
+ if (cmp !== 0) {
+ return cmp;
+ }
+
+ return mappingA.name - mappingB.name;
+}
+exports.compareByOriginalPositions = compareByOriginalPositions;
+
+/**
+ * Comparator between two mappings with deflated source and name indices where
+ * the generated positions are compared.
+ *
+ * Optionally pass in `true` as `onlyCompareGenerated` to consider two
+ * mappings with the same generated line and column, but different
+ * source/name/original line and column the same. Useful when searching for a
+ * mapping with a stubbed out mapping.
+ */
+function compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) {
+ var cmp = mappingA.generatedLine - mappingB.generatedLine;
+ if (cmp !== 0) {
+ return cmp;
+ }
+
+ cmp = mappingA.generatedColumn - mappingB.generatedColumn;
+ if (cmp !== 0 || onlyCompareGenerated) {
+ return cmp;
+ }
+
+ cmp = mappingA.source - mappingB.source;
+ if (cmp !== 0) {
+ return cmp;
+ }
+
+ cmp = mappingA.originalLine - mappingB.originalLine;
+ if (cmp !== 0) {
+ return cmp;
+ }
+
+ cmp = mappingA.originalColumn - mappingB.originalColumn;
+ if (cmp !== 0) {
+ return cmp;
+ }
+
+ return mappingA.name - mappingB.name;
+}
+exports.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated;
+
+function strcmp(aStr1, aStr2) {
+ if (aStr1 === aStr2) {
+ return 0;
+ }
+
+ if (aStr1 > aStr2) {
+ return 1;
+ }
+
+ return -1;
+}
+
+/**
+ * Comparator between two mappings with inflated source and name strings where
+ * the generated positions are compared.
+ */
+function compareByGeneratedPositionsInflated(mappingA, mappingB) {
+ var cmp = mappingA.generatedLine - mappingB.generatedLine;
+ if (cmp !== 0) {
+ return cmp;
+ }
+
+ cmp = mappingA.generatedColumn - mappingB.generatedColumn;
+ if (cmp !== 0) {
+ return cmp;
+ }
+
+ cmp = strcmp(mappingA.source, mappingB.source);
+ if (cmp !== 0) {
+ return cmp;
+ }
+
+ cmp = mappingA.originalLine - mappingB.originalLine;
+ if (cmp !== 0) {
+ return cmp;
+ }
+
+ cmp = mappingA.originalColumn - mappingB.originalColumn;
+ if (cmp !== 0) {
+ return cmp;
+ }
+
+ return strcmp(mappingA.name, mappingB.name);
+}
+exports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated;
+
+
+/***/ }),
+
+/***/ 567:
+/***/ (function(module, exports) {
+
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+function networkRequest(url, opts) {
+ return fetch(url, {
+ cache: opts.loadFromCache ? "default" : "no-cache"
+ }).then(res => {
+ if (res.status >= 200 && res.status < 300) {
+ if (res.headers.get("Content-Type") === "application/wasm") {
+ return res.arrayBuffer().then(buffer => ({
+ content: buffer,
+ isDwarf: true
+ }));
+ }
+
+ return res.text().then(text => ({
+ content: text
+ }));
+ }
+
+ return Promise.reject(`request failed with status ${res.status}`);
+ });
+}
+
+module.exports = networkRequest;
+
+/***/ }),
+
+/***/ 568:
+/***/ (function(module, exports) {
+
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+function WorkerDispatcher() {
+ this.msgId = 1;
+ this.worker = null;
+}
+
+WorkerDispatcher.prototype = {
+ start(url, win = window) {
+ this.worker = new win.Worker(url);
+
+ this.worker.onerror = err => {
+ console.error(`Error in worker ${url}`, err.message);
+ };
+ },
+
+ stop() {
+ if (!this.worker) {
+ return;
+ }
+
+ this.worker.terminate();
+ this.worker = null;
+ },
+
+ task(method, {
+ queue = false
+ } = {}) {
+ const calls = [];
+
+ const push = args => {
+ return new Promise((resolve, reject) => {
+ if (queue && calls.length === 0) {
+ Promise.resolve().then(flush);
+ }
+
+ calls.push([args, resolve, reject]);
+
+ if (!queue) {
+ flush();
+ }
+ });
+ };
+
+ const flush = () => {
+ const items = calls.slice();
+ calls.length = 0;
+
+ if (!this.worker) {
+ return;
+ }
+
+ const id = this.msgId++;
+ this.worker.postMessage({
+ id,
+ method,
+ calls: items.map(item => item[0])
+ });
+
+ const listener = ({
+ data: result
+ }) => {
+ if (result.id !== id) {
+ return;
+ }
+
+ if (!this.worker) {
+ return;
+ }
+
+ this.worker.removeEventListener("message", listener);
+ result.results.forEach((resultData, i) => {
+ const [, resolve, reject] = items[i];
+
+ if (resultData.error) {
+ const err = new Error(resultData.message);
+ err.metadata = resultData.metadata;
+ reject(err);
+ } else {
+ resolve(resultData.response);
+ }
+ });
+ };
+
+ this.worker.addEventListener("message", listener);
+ };
+
+ return (...args) => push(args);
+ },
+
+ invoke(method, ...args) {
+ return this.task(method)(...args);
+ }
+
+};
+
+function workerHandler(publicInterface) {
+ return function (msg) {
+ const {
+ id,
+ method,
+ calls
+ } = msg.data;
+ Promise.all(calls.map(args => {
+ try {
+ const response = publicInterface[method].apply(undefined, args);
+
+ if (response instanceof Promise) {
+ return response.then(val => ({
+ response: val
+ }), err => asErrorMessage(err));
+ }
+
+ return {
+ response
+ };
+ } catch (error) {
+ return asErrorMessage(error);
+ }
+ })).then(results => {
+ self.postMessage({
+ id,
+ results
+ });
+ });
+ };
+}
+
+function asErrorMessage(error) {
+ if (typeof error === "object" && error && "message" in error) {
+ // Error can't be sent via postMessage, so be sure to convert to
+ // string.
+ return {
+ error: true,
+ message: error.message,
+ metadata: error.metadata
+ };
+ }
+
+ return {
+ error: true,
+ message: error == null ? error : error.toString(),
+ metadata: undefined
+ };
+}
+
+module.exports = {
+ WorkerDispatcher,
+ workerHandler
+};
+
+/***/ }),
+
+/***/ 581:
+/***/ (function(module, exports, __webpack_require__) {
+
+/* -*- Mode: js; js-indent-level: 2; -*- */
+/*
+ * Copyright 2011 Mozilla Foundation and contributors
+ * Licensed under the New BSD license. See LICENSE or:
+ * http://opensource.org/licenses/BSD-3-Clause
+ */
+
+var base64VLQ = __webpack_require__(582);
+var util = __webpack_require__(566);
+var ArraySet = __webpack_require__(583).ArraySet;
+var MappingList = __webpack_require__(634).MappingList;
+
+/**
+ * An instance of the SourceMapGenerator represents a source map which is
+ * being built incrementally. You may pass an object with the following
+ * properties:
+ *
+ * - file: The filename of the generated source.
+ * - sourceRoot: A root for all relative URLs in this source map.
+ */
+function SourceMapGenerator(aArgs) {
+ if (!aArgs) {
+ aArgs = {};
+ }
+ this._file = util.getArg(aArgs, 'file', null);
+ this._sourceRoot = util.getArg(aArgs, 'sourceRoot', null);
+ this._skipValidation = util.getArg(aArgs, 'skipValidation', false);
+ this._sources = new ArraySet();
+ this._names = new ArraySet();
+ this._mappings = new MappingList();
+ this._sourcesContents = null;
+}
+
+SourceMapGenerator.prototype._version = 3;
+
+/**
+ * Creates a new SourceMapGenerator based on a SourceMapConsumer
+ *
+ * @param aSourceMapConsumer The SourceMap.
+ */
+SourceMapGenerator.fromSourceMap =
+ function SourceMapGenerator_fromSourceMap(aSourceMapConsumer) {
+ var sourceRoot = aSourceMapConsumer.sourceRoot;
+ var generator = new SourceMapGenerator({
+ file: aSourceMapConsumer.file,
+ sourceRoot: sourceRoot
+ });
+ aSourceMapConsumer.eachMapping(function (mapping) {
+ var newMapping = {
+ generated: {
+ line: mapping.generatedLine,
+ column: mapping.generatedColumn
+ }
+ };
+
+ if (mapping.source != null) {
+ newMapping.source = mapping.source;
+ if (sourceRoot != null) {
+ newMapping.source = util.relative(sourceRoot, newMapping.source);
+ }
+
+ newMapping.original = {
+ line: mapping.originalLine,
+ column: mapping.originalColumn
+ };
+
+ if (mapping.name != null) {
+ newMapping.name = mapping.name;
+ }
+ }
+
+ generator.addMapping(newMapping);
+ });
+ aSourceMapConsumer.sources.forEach(function (sourceFile) {
+ var content = aSourceMapConsumer.sourceContentFor(sourceFile);
+ if (content != null) {
+ generator.setSourceContent(sourceFile, content);
+ }
+ });
+ return generator;
+ };
+
+/**
+ * Add a single mapping from original source line and column to the generated
+ * source's line and column for this source map being created. The mapping
+ * object should have the following properties:
+ *
+ * - generated: An object with the generated line and column positions.
+ * - original: An object with the original line and column positions.
+ * - source: The original source file (relative to the sourceRoot).
+ * - name: An optional original token name for this mapping.
+ */
+SourceMapGenerator.prototype.addMapping =
+ function SourceMapGenerator_addMapping(aArgs) {
+ var generated = util.getArg(aArgs, 'generated');
+ var original = util.getArg(aArgs, 'original', null);
+ var source = util.getArg(aArgs, 'source', null);
+ var name = util.getArg(aArgs, 'name', null);
+
+ if (!this._skipValidation) {
+ this._validateMapping(generated, original, source, name);
+ }
+
+ if (source != null) {
+ source = String(source);
+ if (!this._sources.has(source)) {
+ this._sources.add(source);
+ }
+ }
+
+ if (name != null) {
+ name = String(name);
+ if (!this._names.has(name)) {
+ this._names.add(name);
+ }
+ }
+
+ this._mappings.add({
+ generatedLine: generated.line,
+ generatedColumn: generated.column,
+ originalLine: original != null && original.line,
+ originalColumn: original != null && original.column,
+ source: source,
+ name: name
+ });
+ };
+
+/**
+ * Set the source content for a source file.
+ */
+SourceMapGenerator.prototype.setSourceContent =
+ function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) {
+ var source = aSourceFile;
+ if (this._sourceRoot != null) {
+ source = util.relative(this._sourceRoot, source);
+ }
+
+ if (aSourceContent != null) {
+ // Add the source content to the _sourcesContents map.
+ // Create a new _sourcesContents map if the property is null.
+ if (!this._sourcesContents) {
+ this._sourcesContents = Object.create(null);
+ }
+ this._sourcesContents[util.toSetString(source)] = aSourceContent;
+ } else if (this._sourcesContents) {
+ // Remove the source file from the _sourcesContents map.
+ // If the _sourcesContents map is empty, set the property to null.
+ delete this._sourcesContents[util.toSetString(source)];
+ if (Object.keys(this._sourcesContents).length === 0) {
+ this._sourcesContents = null;
+ }
+ }
+ };
+
+/**
+ * Applies the mappings of a sub-source-map for a specific source file to the
+ * source map being generated. Each mapping to the supplied source file is
+ * rewritten using the supplied source map. Note: The resolution for the
+ * resulting mappings is the minimium of this map and the supplied map.
+ *
+ * @param aSourceMapConsumer The source map to be applied.
+ * @param aSourceFile Optional. The filename of the source file.
+ * If omitted, SourceMapConsumer's file property will be used.
+ * @param aSourceMapPath Optional. The dirname of the path to the source map
+ * to be applied. If relative, it is relative to the SourceMapConsumer.
+ * This parameter is needed when the two source maps aren't in the same
+ * directory, and the source map to be applied contains relative source
+ * paths. If so, those relative source paths need to be rewritten
+ * relative to the SourceMapGenerator.
+ */
+SourceMapGenerator.prototype.applySourceMap =
+ function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) {
+ var sourceFile = aSourceFile;
+ // If aSourceFile is omitted, we will use the file property of the SourceMap
+ if (aSourceFile == null) {
+ if (aSourceMapConsumer.file == null) {
+ throw new Error(
+ 'SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, ' +
+ 'or the source map\'s "file" property. Both were omitted.'
+ );
+ }
+ sourceFile = aSourceMapConsumer.file;
+ }
+ var sourceRoot = this._sourceRoot;
+ // Make "sourceFile" relative if an absolute Url is passed.
+ if (sourceRoot != null) {
+ sourceFile = util.relative(sourceRoot, sourceFile);
+ }
+ // Applying the SourceMap can add and remove items from the sources and
+ // the names array.
+ var newSources = new ArraySet();
+ var newNames = new ArraySet();
+
+ // Find mappings for the "sourceFile"
+ this._mappings.unsortedForEach(function (mapping) {
+ if (mapping.source === sourceFile && mapping.originalLine != null) {
+ // Check if it can be mapped by the source map, then update the mapping.
+ var original = aSourceMapConsumer.originalPositionFor({
+ line: mapping.originalLine,
+ column: mapping.originalColumn
+ });
+ if (original.source != null) {
+ // Copy mapping
+ mapping.source = original.source;
+ if (aSourceMapPath != null) {
+ mapping.source = util.join(aSourceMapPath, mapping.source)
+ }
+ if (sourceRoot != null) {
+ mapping.source = util.relative(sourceRoot, mapping.source);
+ }
+ mapping.originalLine = original.line;
+ mapping.originalColumn = original.column;
+ if (original.name != null) {
+ mapping.name = original.name;
+ }
+ }
+ }
+
+ var source = mapping.source;
+ if (source != null && !newSources.has(source)) {
+ newSources.add(source);
+ }
+
+ var name = mapping.name;
+ if (name != null && !newNames.has(name)) {
+ newNames.add(name);
+ }
+
+ }, this);
+ this._sources = newSources;
+ this._names = newNames;
+
+ // Copy sourcesContents of applied map.
+ aSourceMapConsumer.sources.forEach(function (sourceFile) {
+ var content = aSourceMapConsumer.sourceContentFor(sourceFile);
+ if (content != null) {
+ if (aSourceMapPath != null) {
+ sourceFile = util.join(aSourceMapPath, sourceFile);
+ }
+ if (sourceRoot != null) {
+ sourceFile = util.relative(sourceRoot, sourceFile);
+ }
+ this.setSourceContent(sourceFile, content);
+ }
+ }, this);
+ };
+
+/**
+ * A mapping can have one of the three levels of data:
+ *
+ * 1. Just the generated position.
+ * 2. The Generated position, original position, and original source.
+ * 3. Generated and original position, original source, as well as a name
+ * token.
+ *
+ * To maintain consistency, we validate that any new mapping being added falls
+ * in to one of these categories.
+ */
+SourceMapGenerator.prototype._validateMapping =
+ function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource,
+ aName) {
+ // When aOriginal is truthy but has empty values for .line and .column,
+ // it is most likely a programmer error. In this case we throw a very
+ // specific error message to try to guide them the right way.
+ // For example: https://github.com/Polymer/polymer-bundler/pull/519
+ if (aOriginal && typeof aOriginal.line !== 'number' && typeof aOriginal.column !== 'number') {
+ throw new Error(
+ 'original.line and original.column are not numbers -- you probably meant to omit ' +
+ 'the original mapping entirely and only map the generated position. If so, pass ' +
+ 'null for the original mapping instead of an object with empty or null values.'
+ );
+ }
+
+ if (aGenerated && 'line' in aGenerated && 'column' in aGenerated
+ && aGenerated.line > 0 && aGenerated.column >= 0
+ && !aOriginal && !aSource && !aName) {
+ // Case 1.
+ return;
+ }
+ else if (aGenerated && 'line' in aGenerated && 'column' in aGenerated
+ && aOriginal && 'line' in aOriginal && 'column' in aOriginal
+ && aGenerated.line > 0 && aGenerated.column >= 0
+ && aOriginal.line > 0 && aOriginal.column >= 0
+ && aSource) {
+ // Cases 2 and 3.
+ return;
+ }
+ else {
+ throw new Error('Invalid mapping: ' + JSON.stringify({
+ generated: aGenerated,
+ source: aSource,
+ original: aOriginal,
+ name: aName
+ }));
+ }
+ };
+
+/**
+ * Serialize the accumulated mappings in to the stream of base 64 VLQs
+ * specified by the source map format.
+ */
+SourceMapGenerator.prototype._serializeMappings =
+ function SourceMapGenerator_serializeMappings() {
+ var previousGeneratedColumn = 0;
+ var previousGeneratedLine = 1;
+ var previousOriginalColumn = 0;
+ var previousOriginalLine = 0;
+ var previousName = 0;
+ var previousSource = 0;
+ var result = '';
+ var next;
+ var mapping;
+ var nameIdx;
+ var sourceIdx;
+
+ var mappings = this._mappings.toArray();
+ for (var i = 0, len = mappings.length; i < len; i++) {
+ mapping = mappings[i];
+ next = ''
+
+ if (mapping.generatedLine !== previousGeneratedLine) {
+ previousGeneratedColumn = 0;
+ while (mapping.generatedLine !== previousGeneratedLine) {
+ next += ';';
+ previousGeneratedLine++;
+ }
+ }
+ else {
+ if (i > 0) {
+ if (!util.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) {
+ continue;
+ }
+ next += ',';
+ }
+ }
+
+ next += base64VLQ.encode(mapping.generatedColumn
+ - previousGeneratedColumn);
+ previousGeneratedColumn = mapping.generatedColumn;
+
+ if (mapping.source != null) {
+ sourceIdx = this._sources.indexOf(mapping.source);
+ next += base64VLQ.encode(sourceIdx - previousSource);
+ previousSource = sourceIdx;
+
+ // lines are stored 0-based in SourceMap spec version 3
+ next += base64VLQ.encode(mapping.originalLine - 1
+ - previousOriginalLine);
+ previousOriginalLine = mapping.originalLine - 1;
+
+ next += base64VLQ.encode(mapping.originalColumn
+ - previousOriginalColumn);
+ previousOriginalColumn = mapping.originalColumn;
+
+ if (mapping.name != null) {
+ nameIdx = this._names.indexOf(mapping.name);
+ next += base64VLQ.encode(nameIdx - previousName);
+ previousName = nameIdx;
+ }
+ }
+
+ result += next;
+ }
+
+ return result;
+ };
+
+SourceMapGenerator.prototype._generateSourcesContent =
+ function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) {
+ return aSources.map(function (source) {
+ if (!this._sourcesContents) {
+ return null;
+ }
+ if (aSourceRoot != null) {
+ source = util.relative(aSourceRoot, source);
+ }
+ var key = util.toSetString(source);
+ return Object.prototype.hasOwnProperty.call(this._sourcesContents, key)
+ ? this._sourcesContents[key]
+ : null;
+ }, this);
+ };
+
+/**
+ * Externalize the source map.
+ */
+SourceMapGenerator.prototype.toJSON =
+ function SourceMapGenerator_toJSON() {
+ var map = {
+ version: this._version,
+ sources: this._sources.toArray(),
+ names: this._names.toArray(),
+ mappings: this._serializeMappings()
+ };
+ if (this._file != null) {
+ map.file = this._file;
+ }
+ if (this._sourceRoot != null) {
+ map.sourceRoot = this._sourceRoot;
+ }
+ if (this._sourcesContents) {
+ map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot);
+ }
+
+ return map;
+ };
+
+/**
+ * Render the source map being generated to a string.
+ */
+SourceMapGenerator.prototype.toString =
+ function SourceMapGenerator_toString() {
+ return JSON.stringify(this.toJSON());
+ };
+
+exports.SourceMapGenerator = SourceMapGenerator;
+
+
+/***/ }),
+
+/***/ 582:
+/***/ (function(module, exports, __webpack_require__) {
+
+/* -*- Mode: js; js-indent-level: 2; -*- */
+/*
+ * Copyright 2011 Mozilla Foundation and contributors
+ * Licensed under the New BSD license. See LICENSE or:
+ * http://opensource.org/licenses/BSD-3-Clause
+ *
+ * Based on the Base 64 VLQ implementation in Closure Compiler:
+ * https://code.google.com/p/closure-compiler/source/browse/trunk/src/com/google/debugging/sourcemap/Base64VLQ.java
+ *
+ * Copyright 2011 The Closure Compiler Authors. All rights reserved.
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+var base64 = __webpack_require__(633);
+
+// A single base 64 digit can contain 6 bits of data. For the base 64 variable
+// length quantities we use in the source map spec, the first bit is the sign,
+// the next four bits are the actual value, and the 6th bit is the
+// continuation bit. The continuation bit tells us whether there are more
+// digits in this value following this digit.
+//
+// Continuation
+// | Sign
+// | |
+// V V
+// 101011
+
+var VLQ_BASE_SHIFT = 5;
+
+// binary: 100000
+var VLQ_BASE = 1 << VLQ_BASE_SHIFT;
+
+// binary: 011111
+var VLQ_BASE_MASK = VLQ_BASE - 1;
+
+// binary: 100000
+var VLQ_CONTINUATION_BIT = VLQ_BASE;
+
+/**
+ * Converts from a two-complement value to a value where the sign bit is
+ * placed in the least significant bit. For example, as decimals:
+ * 1 becomes 2 (10 binary), -1 becomes 3 (11 binary)
+ * 2 becomes 4 (100 binary), -2 becomes 5 (101 binary)
+ */
+function toVLQSigned(aValue) {
+ return aValue < 0
+ ? ((-aValue) << 1) + 1
+ : (aValue << 1) + 0;
+}
+
+/**
+ * Converts to a two-complement value from a value where the sign bit is
+ * placed in the least significant bit. For example, as decimals:
+ * 2 (10 binary) becomes 1, 3 (11 binary) becomes -1
+ * 4 (100 binary) becomes 2, 5 (101 binary) becomes -2
+ */
+function fromVLQSigned(aValue) {
+ var isNegative = (aValue & 1) === 1;
+ var shifted = aValue >> 1;
+ return isNegative
+ ? -shifted
+ : shifted;
+}
+
+/**
+ * Returns the base 64 VLQ encoded value.
+ */
+exports.encode = function base64VLQ_encode(aValue) {
+ var encoded = "";
+ var digit;
+
+ var vlq = toVLQSigned(aValue);
+
+ do {
+ digit = vlq & VLQ_BASE_MASK;
+ vlq >>>= VLQ_BASE_SHIFT;
+ if (vlq > 0) {
+ // There are still more digits in this value, so we must make sure the
+ // continuation bit is marked.
+ digit |= VLQ_CONTINUATION_BIT;
+ }
+ encoded += base64.encode(digit);
+ } while (vlq > 0);
+
+ return encoded;
+};
+
+/**
+ * Decodes the next base 64 VLQ value from the given string and returns the
+ * value and the rest of the string via the out parameter.
+ */
+exports.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) {
+ var strLen = aStr.length;
+ var result = 0;
+ var shift = 0;
+ var continuation, digit;
+
+ do {
+ if (aIndex >= strLen) {
+ throw new Error("Expected more digits in base 64 VLQ value.");
+ }
+
+ digit = base64.decode(aStr.charCodeAt(aIndex++));
+ if (digit === -1) {
+ throw new Error("Invalid base64 digit: " + aStr.charAt(aIndex - 1));
+ }
+
+ continuation = !!(digit & VLQ_CONTINUATION_BIT);
+ digit &= VLQ_BASE_MASK;
+ result = result + (digit << shift);
+ shift += VLQ_BASE_SHIFT;
+ } while (continuation);
+
+ aOutParam.value = fromVLQSigned(result);
+ aOutParam.rest = aIndex;
+};
+
+
+/***/ }),
+
+/***/ 583:
+/***/ (function(module, exports, __webpack_require__) {
+
+/* -*- Mode: js; js-indent-level: 2; -*- */
+/*
+ * Copyright 2011 Mozilla Foundation and contributors
+ * Licensed under the New BSD license. See LICENSE or:
+ * http://opensource.org/licenses/BSD-3-Clause
+ */
+
+var util = __webpack_require__(566);
+var has = Object.prototype.hasOwnProperty;
+var hasNativeMap = typeof Map !== "undefined";
+
+/**
+ * A data structure which is a combination of an array and a set. Adding a new
+ * member is O(1), testing for membership is O(1), and finding the index of an
+ * element is O(1). Removing elements from the set is not supported. Only
+ * strings are supported for membership.
+ */
+function ArraySet() {
+ this._array = [];
+ this._set = hasNativeMap ? new Map() : Object.create(null);
+}
+
+/**
+ * Static method for creating ArraySet instances from an existing array.
+ */
+ArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) {
+ var set = new ArraySet();
+ for (var i = 0, len = aArray.length; i < len; i++) {
+ set.add(aArray[i], aAllowDuplicates);
+ }
+ return set;
+};
+
+/**
+ * Return how many unique items are in this ArraySet. If duplicates have been
+ * added, than those do not count towards the size.
+ *
+ * @returns Number
+ */
+ArraySet.prototype.size = function ArraySet_size() {
+ return hasNativeMap ? this._set.size : Object.getOwnPropertyNames(this._set).length;
+};
+
+/**
+ * Add the given string to this set.
+ *
+ * @param String aStr
+ */
+ArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) {
+ var sStr = hasNativeMap ? aStr : util.toSetString(aStr);
+ var isDuplicate = hasNativeMap ? this.has(aStr) : has.call(this._set, sStr);
+ var idx = this._array.length;
+ if (!isDuplicate || aAllowDuplicates) {
+ this._array.push(aStr);
+ }
+ if (!isDuplicate) {
+ if (hasNativeMap) {
+ this._set.set(aStr, idx);
+ } else {
+ this._set[sStr] = idx;
+ }
+ }
+};
+
+/**
+ * Is the given string a member of this set?
+ *
+ * @param String aStr
+ */
+ArraySet.prototype.has = function ArraySet_has(aStr) {
+ if (hasNativeMap) {
+ return this._set.has(aStr);
+ } else {
+ var sStr = util.toSetString(aStr);
+ return has.call(this._set, sStr);
+ }
+};
+
+/**
+ * What is the index of the given string in the array?
+ *
+ * @param String aStr
+ */
+ArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) {
+ if (hasNativeMap) {
+ var idx = this._set.get(aStr);
+ if (idx >= 0) {
+ return idx;
+ }
+ } else {
+ var sStr = util.toSetString(aStr);
+ if (has.call(this._set, sStr)) {
+ return this._set[sStr];
+ }
+ }
+
+ throw new Error('"' + aStr + '" is not in the set.');
+};
+
+/**
+ * What is the element at the given index?
+ *
+ * @param Number aIdx
+ */
+ArraySet.prototype.at = function ArraySet_at(aIdx) {
+ if (aIdx >= 0 && aIdx < this._array.length) {
+ return this._array[aIdx];
+ }
+ throw new Error('No element indexed by ' + aIdx);
+};
+
+/**
+ * Returns the array representation of this set (which has the proper indices
+ * indicated by indexOf). Note that this is a copy of the internal array used
+ * for storing the members so that no one can mess with internal state.
+ */
+ArraySet.prototype.toArray = function ArraySet_toArray() {
+ return this._array.slice();
+};
+
+exports.ArraySet = ArraySet;
+
+
+/***/ }),
+
+/***/ 632:
+/***/ (function(module, exports, __webpack_require__) {
+
+/*
+ * Copyright 2009-2011 Mozilla Foundation and contributors
+ * Licensed under the New BSD license. See LICENSE.txt or:
+ * http://opensource.org/licenses/BSD-3-Clause
+ */
+exports.SourceMapGenerator = __webpack_require__(581).SourceMapGenerator;
+exports.SourceMapConsumer = __webpack_require__(635).SourceMapConsumer;
+exports.SourceNode = __webpack_require__(638).SourceNode;
+
+
+/***/ }),
+
+/***/ 633:
+/***/ (function(module, exports) {
+
+/* -*- Mode: js; js-indent-level: 2; -*- */
+/*
+ * Copyright 2011 Mozilla Foundation and contributors
+ * Licensed under the New BSD license. See LICENSE or:
+ * http://opensource.org/licenses/BSD-3-Clause
+ */
+
+var intToCharMap = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split('');
+
+/**
+ * Encode an integer in the range of 0 to 63 to a single base 64 digit.
+ */
+exports.encode = function (number) {
+ if (0 <= number && number < intToCharMap.length) {
+ return intToCharMap[number];
+ }
+ throw new TypeError("Must be between 0 and 63: " + number);
+};
+
+/**
+ * Decode a single base 64 character code digit to an integer. Returns -1 on
+ * failure.
+ */
+exports.decode = function (charCode) {
+ var bigA = 65; // 'A'
+ var bigZ = 90; // 'Z'
+
+ var littleA = 97; // 'a'
+ var littleZ = 122; // 'z'
+
+ var zero = 48; // '0'
+ var nine = 57; // '9'
+
+ var plus = 43; // '+'
+ var slash = 47; // '/'
+
+ var littleOffset = 26;
+ var numberOffset = 52;
+
+ // 0 - 25: ABCDEFGHIJKLMNOPQRSTUVWXYZ
+ if (bigA <= charCode && charCode <= bigZ) {
+ return (charCode - bigA);
+ }
+
+ // 26 - 51: abcdefghijklmnopqrstuvwxyz
+ if (littleA <= charCode && charCode <= littleZ) {
+ return (charCode - littleA + littleOffset);
+ }
+
+ // 52 - 61: 0123456789
+ if (zero <= charCode && charCode <= nine) {
+ return (charCode - zero + numberOffset);
+ }
+
+ // 62: +
+ if (charCode == plus) {
+ return 62;
+ }
+
+ // 63: /
+ if (charCode == slash) {
+ return 63;
+ }
+
+ // Invalid base64 digit.
+ return -1;
+};
+
+
+/***/ }),
+
+/***/ 634:
+/***/ (function(module, exports, __webpack_require__) {
+
+/* -*- Mode: js; js-indent-level: 2; -*- */
+/*
+ * Copyright 2014 Mozilla Foundation and contributors
+ * Licensed under the New BSD license. See LICENSE or:
+ * http://opensource.org/licenses/BSD-3-Clause
+ */
+
+var util = __webpack_require__(566);
+
+/**
+ * Determine whether mappingB is after mappingA with respect to generated
+ * position.
+ */
+function generatedPositionAfter(mappingA, mappingB) {
+ // Optimized for most common case
+ var lineA = mappingA.generatedLine;
+ var lineB = mappingB.generatedLine;
+ var columnA = mappingA.generatedColumn;
+ var columnB = mappingB.generatedColumn;
+ return lineB > lineA || lineB == lineA && columnB >= columnA ||
+ util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0;
+}
+
+/**
+ * A data structure to provide a sorted view of accumulated mappings in a
+ * performance conscious manner. It trades a neglibable overhead in general
+ * case for a large speedup in case of mappings being added in order.
+ */
+function MappingList() {
+ this._array = [];
+ this._sorted = true;
+ // Serves as infimum
+ this._last = {generatedLine: -1, generatedColumn: 0};
+}
+
+/**
+ * Iterate through internal items. This method takes the same arguments that
+ * `Array.prototype.forEach` takes.
+ *
+ * NOTE: The order of the mappings is NOT guaranteed.
+ */
+MappingList.prototype.unsortedForEach =
+ function MappingList_forEach(aCallback, aThisArg) {
+ this._array.forEach(aCallback, aThisArg);
+ };
+
+/**
+ * Add the given source mapping.
+ *
+ * @param Object aMapping
+ */
+MappingList.prototype.add = function MappingList_add(aMapping) {
+ if (generatedPositionAfter(this._last, aMapping)) {
+ this._last = aMapping;
+ this._array.push(aMapping);
+ } else {
+ this._sorted = false;
+ this._array.push(aMapping);
+ }
+};
+
+/**
+ * Returns the flat, sorted array of mappings. The mappings are sorted by
+ * generated position.
+ *
+ * WARNING: This method returns internal data without copying, for
+ * performance. The return value must NOT be mutated, and should be treated as
+ * an immutable borrow. If you want to take ownership, you must make your own
+ * copy.
+ */
+MappingList.prototype.toArray = function MappingList_toArray() {
+ if (!this._sorted) {
+ this._array.sort(util.compareByGeneratedPositionsInflated);
+ this._sorted = true;
+ }
+ return this._array;
+};
+
+exports.MappingList = MappingList;
+
+
+/***/ }),
+
+/***/ 635:
+/***/ (function(module, exports, __webpack_require__) {
+
+/* -*- Mode: js; js-indent-level: 2; -*- */
+/*
+ * Copyright 2011 Mozilla Foundation and contributors
+ * Licensed under the New BSD license. See LICENSE or:
+ * http://opensource.org/licenses/BSD-3-Clause
+ */
+
+var util = __webpack_require__(566);
+var binarySearch = __webpack_require__(636);
+var ArraySet = __webpack_require__(583).ArraySet;
+var base64VLQ = __webpack_require__(582);
+var quickSort = __webpack_require__(637).quickSort;
+
+function SourceMapConsumer(aSourceMap) {
+ var sourceMap = aSourceMap;
+ if (typeof aSourceMap === 'string') {
+ sourceMap = JSON.parse(aSourceMap.replace(/^\)\]\}'/, ''));
+ }
+
+ return sourceMap.sections != null
+ ? new IndexedSourceMapConsumer(sourceMap)
+ : new BasicSourceMapConsumer(sourceMap);
+}
+
+SourceMapConsumer.fromSourceMap = function(aSourceMap) {
+ return BasicSourceMapConsumer.fromSourceMap(aSourceMap);
+}
+
+/**
+ * The version of the source mapping spec that we are consuming.
+ */
+SourceMapConsumer.prototype._version = 3;
+
+// `__generatedMappings` and `__originalMappings` are arrays that hold the
+// parsed mapping coordinates from the source map's "mappings" attribute. They
+// are lazily instantiated, accessed via the `_generatedMappings` and
+// `_originalMappings` getters respectively, and we only parse the mappings
+// and create these arrays once queried for a source location. We jump through
+// these hoops because there can be many thousands of mappings, and parsing
+// them is expensive, so we only want to do it if we must.
+//
+// Each object in the arrays is of the form:
+//
+// {
+// generatedLine: The line number in the generated code,
+// generatedColumn: The column number in the generated code,
+// source: The path to the original source file that generated this
+// chunk of code,
+// originalLine: The line number in the original source that
+// corresponds to this chunk of generated code,
+// originalColumn: The column number in the original source that
+// corresponds to this chunk of generated code,
+// name: The name of the original symbol which generated this chunk of
+// code.
+// }
+//
+// All properties except for `generatedLine` and `generatedColumn` can be
+// `null`.
+//
+// `_generatedMappings` is ordered by the generated positions.
+//
+// `_originalMappings` is ordered by the original positions.
+
+SourceMapConsumer.prototype.__generatedMappings = null;
+Object.defineProperty(SourceMapConsumer.prototype, '_generatedMappings', {
+ get: function () {
+ if (!this.__generatedMappings) {
+ this._parseMappings(this._mappings, this.sourceRoot);
+ }
+
+ return this.__generatedMappings;
+ }
+});
+
+SourceMapConsumer.prototype.__originalMappings = null;
+Object.defineProperty(SourceMapConsumer.prototype, '_originalMappings', {
+ get: function () {
+ if (!this.__originalMappings) {
+ this._parseMappings(this._mappings, this.sourceRoot);
+ }
+
+ return this.__originalMappings;
+ }
+});
+
+SourceMapConsumer.prototype._charIsMappingSeparator =
+ function SourceMapConsumer_charIsMappingSeparator(aStr, index) {
+ var c = aStr.charAt(index);
+ return c === ";" || c === ",";
+ };
+
+/**
+ * Parse the mappings in a string in to a data structure which we can easily
+ * query (the ordered arrays in the `this.__generatedMappings` and
+ * `this.__originalMappings` properties).
+ */
+SourceMapConsumer.prototype._parseMappings =
+ function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {
+ throw new Error("Subclasses must implement _parseMappings");
+ };
+
+SourceMapConsumer.GENERATED_ORDER = 1;
+SourceMapConsumer.ORIGINAL_ORDER = 2;
+
+SourceMapConsumer.GREATEST_LOWER_BOUND = 1;
+SourceMapConsumer.LEAST_UPPER_BOUND = 2;
+
+/**
+ * Iterate over each mapping between an original source/line/column and a
+ * generated line/column in this source map.
+ *
+ * @param Function aCallback
+ * The function that is called with each mapping.
+ * @param Object aContext
+ * Optional. If specified, this object will be the value of `this` every
+ * time that `aCallback` is called.
+ * @param aOrder
+ * Either `SourceMapConsumer.GENERATED_ORDER` or
+ * `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to
+ * iterate over the mappings sorted by the generated file's line/column
+ * order or the original's source/line/column order, respectively. Defaults to
+ * `SourceMapConsumer.GENERATED_ORDER`.
+ */
+SourceMapConsumer.prototype.eachMapping =
+ function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) {
+ var context = aContext || null;
+ var order = aOrder || SourceMapConsumer.GENERATED_ORDER;
+
+ var mappings;
+ switch (order) {
+ case SourceMapConsumer.GENERATED_ORDER:
+ mappings = this._generatedMappings;
+ break;
+ case SourceMapConsumer.ORIGINAL_ORDER:
+ mappings = this._originalMappings;
+ break;
+ default:
+ throw new Error("Unknown order of iteration.");
+ }
+
+ var sourceRoot = this.sourceRoot;
+ mappings.map(function (mapping) {
+ var source = mapping.source === null ? null : this._sources.at(mapping.source);
+ if (source != null && sourceRoot != null) {
+ source = util.join(sourceRoot, source);
+ }
+ return {
+ source: source,
+ generatedLine: mapping.generatedLine,
+ generatedColumn: mapping.generatedColumn,
+ originalLine: mapping.originalLine,
+ originalColumn: mapping.originalColumn,
+ name: mapping.name === null ? null : this._names.at(mapping.name)
+ };
+ }, this).forEach(aCallback, context);
+ };
+
+/**
+ * Returns all generated line and column information for the original source,
+ * line, and column provided. If no column is provided, returns all mappings
+ * corresponding to a either the line we are searching for or the next
+ * closest line that has any mappings. Otherwise, returns all mappings
+ * corresponding to the given line and either the column we are searching for
+ * or the next closest column that has any offsets.
+ *
+ * The only argument is an object with the following properties:
+ *
+ * - source: The filename of the original source.
+ * - line: The line number in the original source.
+ * - column: Optional. the column number in the original source.
+ *
+ * and an array of objects is returned, each with the following properties:
+ *
+ * - line: The line number in the generated source, or null.
+ * - column: The column number in the generated source, or null.
+ */
+SourceMapConsumer.prototype.allGeneratedPositionsFor =
+ function SourceMapConsumer_allGeneratedPositionsFor(aArgs) {
+ var line = util.getArg(aArgs, 'line');
+
+ // When there is no exact match, BasicSourceMapConsumer.prototype._findMapping
+ // returns the index of the closest mapping less than the needle. By
+ // setting needle.originalColumn to 0, we thus find the last mapping for
+ // the given line, provided such a mapping exists.
+ var needle = {
+ source: util.getArg(aArgs, 'source'),
+ originalLine: line,
+ originalColumn: util.getArg(aArgs, 'column', 0)
+ };
+
+ if (this.sourceRoot != null) {
+ needle.source = util.relative(this.sourceRoot, needle.source);
+ }
+ if (!this._sources.has(needle.source)) {
+ return [];
+ }
+ needle.source = this._sources.indexOf(needle.source);
+
+ var mappings = [];
+
+ var index = this._findMapping(needle,
+ this._originalMappings,
+ "originalLine",
+ "originalColumn",
+ util.compareByOriginalPositions,
+ binarySearch.LEAST_UPPER_BOUND);
+ if (index >= 0) {
+ var mapping = this._originalMappings[index];
+
+ if (aArgs.column === undefined) {
+ var originalLine = mapping.originalLine;
+
+ // Iterate until either we run out of mappings, or we run into
+ // a mapping for a different line than the one we found. Since
+ // mappings are sorted, this is guaranteed to find all mappings for
+ // the line we found.
+ while (mapping && mapping.originalLine === originalLine) {
+ mappings.push({
+ line: util.getArg(mapping, 'generatedLine', null),
+ column: util.getArg(mapping, 'generatedColumn', null),
+ lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)
+ });
+
+ mapping = this._originalMappings[++index];
+ }
+ } else {
+ var originalColumn = mapping.originalColumn;
+
+ // Iterate until either we run out of mappings, or we run into
+ // a mapping for a different line than the one we were searching for.
+ // Since mappings are sorted, this is guaranteed to find all mappings for
+ // the line we are searching for.
+ while (mapping &&
+ mapping.originalLine === line &&
+ mapping.originalColumn == originalColumn) {
+ mappings.push({
+ line: util.getArg(mapping, 'generatedLine', null),
+ column: util.getArg(mapping, 'generatedColumn', null),
+ lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)
+ });
+
+ mapping = this._originalMappings[++index];
+ }
+ }
+ }
+
+ return mappings;
+ };
+
+exports.SourceMapConsumer = SourceMapConsumer;
+
+/**
+ * A BasicSourceMapConsumer instance represents a parsed source map which we can
+ * query for information about the original file positions by giving it a file
+ * position in the generated source.
+ *
+ * The only parameter is the raw source map (either as a JSON string, or
+ * already parsed to an object). According to the spec, source maps have the
+ * following attributes:
+ *
+ * - version: Which version of the source map spec this map is following.
+ * - sources: An array of URLs to the original source files.
+ * - names: An array of identifiers which can be referrenced by individual mappings.
+ * - sourceRoot: Optional. The URL root from which all sources are relative.
+ * - sourcesContent: Optional. An array of contents of the original source files.
+ * - mappings: A string of base64 VLQs which contain the actual mappings.
+ * - file: Optional. The generated file this source map is associated with.
+ *
+ * Here is an example source map, taken from the source map spec[0]:
+ *
+ * {
+ * version : 3,
+ * file: "out.js",
+ * sourceRoot : "",
+ * sources: ["foo.js", "bar.js"],
+ * names: ["src", "maps", "are", "fun"],
+ * mappings: "AA,AB;;ABCDE;"
+ * }
+ *
+ * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit?pli=1#
+ */
+function BasicSourceMapConsumer(aSourceMap) {
+ var sourceMap = aSourceMap;
+ if (typeof aSourceMap === 'string') {
+ sourceMap = JSON.parse(aSourceMap.replace(/^\)\]\}'/, ''));
+ }
+
+ var version = util.getArg(sourceMap, 'version');
+ var sources = util.getArg(sourceMap, 'sources');
+ // Sass 3.3 leaves out the 'names' array, so we deviate from the spec (which
+ // requires the array) to play nice here.
+ var names = util.getArg(sourceMap, 'names', []);
+ var sourceRoot = util.getArg(sourceMap, 'sourceRoot', null);
+ var sourcesContent = util.getArg(sourceMap, 'sourcesContent', null);
+ var mappings = util.getArg(sourceMap, 'mappings');
+ var file = util.getArg(sourceMap, 'file', null);
+
+ // Once again, Sass deviates from the spec and supplies the version as a
+ // string rather than a number, so we use loose equality checking here.
+ if (version != this._version) {
+ throw new Error('Unsupported version: ' + version);
+ }
+
+ sources = sources
+ .map(String)
+ // Some source maps produce relative source paths like "./foo.js" instead of
+ // "foo.js". Normalize these first so that future comparisons will succeed.
+ // See bugzil.la/1090768.
+ .map(util.normalize)
+ // Always ensure that absolute sources are internally stored relative to
+ // the source root, if the source root is absolute. Not doing this would
+ // be particularly problematic when the source root is a prefix of the
+ // source (valid, but why??). See github issue #199 and bugzil.la/1188982.
+ .map(function (source) {
+ return sourceRoot && util.isAbsolute(sourceRoot) && util.isAbsolute(source)
+ ? util.relative(sourceRoot, source)
+ : source;
+ });
+
+ // Pass `true` below to allow duplicate names and sources. While source maps
+ // are intended to be compressed and deduplicated, the TypeScript compiler
+ // sometimes generates source maps with duplicates in them. See Github issue
+ // #72 and bugzil.la/889492.
+ this._names = ArraySet.fromArray(names.map(String), true);
+ this._sources = ArraySet.fromArray(sources, true);
+
+ this.sourceRoot = sourceRoot;
+ this.sourcesContent = sourcesContent;
+ this._mappings = mappings;
+ this.file = file;
+}
+
+BasicSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);
+BasicSourceMapConsumer.prototype.consumer = SourceMapConsumer;
+
+/**
+ * Create a BasicSourceMapConsumer from a SourceMapGenerator.
+ *
+ * @param SourceMapGenerator aSourceMap
+ * The source map that will be consumed.
+ * @returns BasicSourceMapConsumer
+ */
+BasicSourceMapConsumer.fromSourceMap =
+ function SourceMapConsumer_fromSourceMap(aSourceMap) {
+ var smc = Object.create(BasicSourceMapConsumer.prototype);
+
+ var names = smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true);
+ var sources = smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true);
+ smc.sourceRoot = aSourceMap._sourceRoot;
+ smc.sourcesContent = aSourceMap._generateSourcesContent(smc._sources.toArray(),
+ smc.sourceRoot);
+ smc.file = aSourceMap._file;
+
+ // Because we are modifying the entries (by converting string sources and
+ // names to indices into the sources and names ArraySets), we have to make
+ // a copy of the entry or else bad things happen. Shared mutable state
+ // strikes again! See github issue #191.
+
+ var generatedMappings = aSourceMap._mappings.toArray().slice();
+ var destGeneratedMappings = smc.__generatedMappings = [];
+ var destOriginalMappings = smc.__originalMappings = [];
+
+ for (var i = 0, length = generatedMappings.length; i < length; i++) {
+ var srcMapping = generatedMappings[i];
+ var destMapping = new Mapping;
+ destMapping.generatedLine = srcMapping.generatedLine;
+ destMapping.generatedColumn = srcMapping.generatedColumn;
+
+ if (srcMapping.source) {
+ destMapping.source = sources.indexOf(srcMapping.source);
+ destMapping.originalLine = srcMapping.originalLine;
+ destMapping.originalColumn = srcMapping.originalColumn;
+
+ if (srcMapping.name) {
+ destMapping.name = names.indexOf(srcMapping.name);
+ }
+
+ destOriginalMappings.push(destMapping);
+ }
+
+ destGeneratedMappings.push(destMapping);
+ }
+
+ quickSort(smc.__originalMappings, util.compareByOriginalPositions);
+
+ return smc;
+ };
+
+/**
+ * The version of the source mapping spec that we are consuming.
+ */
+BasicSourceMapConsumer.prototype._version = 3;
+
+/**
+ * The list of original sources.
+ */
+Object.defineProperty(BasicSourceMapConsumer.prototype, 'sources', {
+ get: function () {
+ return this._sources.toArray().map(function (s) {
+ return this.sourceRoot != null ? util.join(this.sourceRoot, s) : s;
+ }, this);
+ }
+});
+
+/**
+ * Provide the JIT with a nice shape / hidden class.
+ */
+function Mapping() {
+ this.generatedLine = 0;
+ this.generatedColumn = 0;
+ this.source = null;
+ this.originalLine = null;
+ this.originalColumn = null;
+ this.name = null;
+}
+
+/**
+ * Parse the mappings in a string in to a data structure which we can easily
+ * query (the ordered arrays in the `this.__generatedMappings` and
+ * `this.__originalMappings` properties).
+ */
+BasicSourceMapConsumer.prototype._parseMappings =
+ function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {
+ var generatedLine = 1;
+ var previousGeneratedColumn = 0;
+ var previousOriginalLine = 0;
+ var previousOriginalColumn = 0;
+ var previousSource = 0;
+ var previousName = 0;
+ var length = aStr.length;
+ var index = 0;
+ var cachedSegments = {};
+ var temp = {};
+ var originalMappings = [];
+ var generatedMappings = [];
+ var mapping, str, segment, end, value;
+
+ while (index < length) {
+ if (aStr.charAt(index) === ';') {
+ generatedLine++;
+ index++;
+ previousGeneratedColumn = 0;
+ }
+ else if (aStr.charAt(index) === ',') {
+ index++;
+ }
+ else {
+ mapping = new Mapping();
+ mapping.generatedLine = generatedLine;
+
+ // Because each offset is encoded relative to the previous one,
+ // many segments often have the same encoding. We can exploit this
+ // fact by caching the parsed variable length fields of each segment,
+ // allowing us to avoid a second parse if we encounter the same
+ // segment again.
+ for (end = index; end < length; end++) {
+ if (this._charIsMappingSeparator(aStr, end)) {
+ break;
+ }
+ }
+ str = aStr.slice(index, end);
+
+ segment = cachedSegments[str];
+ if (segment) {
+ index += str.length;
+ } else {
+ segment = [];
+ while (index < end) {
+ base64VLQ.decode(aStr, index, temp);
+ value = temp.value;
+ index = temp.rest;
+ segment.push(value);
+ }
+
+ if (segment.length === 2) {
+ throw new Error('Found a source, but no line and column');
+ }
+
+ if (segment.length === 3) {
+ throw new Error('Found a source and line, but no column');
+ }
+
+ cachedSegments[str] = segment;
+ }
+
+ // Generated column.
+ mapping.generatedColumn = previousGeneratedColumn + segment[0];
+ previousGeneratedColumn = mapping.generatedColumn;
+
+ if (segment.length > 1) {
+ // Original source.
+ mapping.source = previousSource + segment[1];
+ previousSource += segment[1];
+
+ // Original line.
+ mapping.originalLine = previousOriginalLine + segment[2];
+ previousOriginalLine = mapping.originalLine;
+ // Lines are stored 0-based
+ mapping.originalLine += 1;
+
+ // Original column.
+ mapping.originalColumn = previousOriginalColumn + segment[3];
+ previousOriginalColumn = mapping.originalColumn;
+
+ if (segment.length > 4) {
+ // Original name.
+ mapping.name = previousName + segment[4];
+ previousName += segment[4];
+ }
+ }
+
+ generatedMappings.push(mapping);
+ if (typeof mapping.originalLine === 'number') {
+ originalMappings.push(mapping);
+ }
+ }
+ }
+
+ quickSort(generatedMappings, util.compareByGeneratedPositionsDeflated);
+ this.__generatedMappings = generatedMappings;
+
+ quickSort(originalMappings, util.compareByOriginalPositions);
+ this.__originalMappings = originalMappings;
+ };
+
+/**
+ * Find the mapping that best matches the hypothetical "needle" mapping that
+ * we are searching for in the given "haystack" of mappings.
+ */
+BasicSourceMapConsumer.prototype._findMapping =
+ function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName,
+ aColumnName, aComparator, aBias) {
+ // To return the position we are searching for, we must first find the
+ // mapping for the given position and then return the opposite position it
+ // points to. Because the mappings are sorted, we can use binary search to
+ // find the best mapping.
+
+ if (aNeedle[aLineName] <= 0) {
+ throw new TypeError('Line must be greater than or equal to 1, got '
+ + aNeedle[aLineName]);
+ }
+ if (aNeedle[aColumnName] < 0) {
+ throw new TypeError('Column must be greater than or equal to 0, got '
+ + aNeedle[aColumnName]);
+ }
+
+ return binarySearch.search(aNeedle, aMappings, aComparator, aBias);
+ };
+
+/**
+ * Compute the last column for each generated mapping. The last column is
+ * inclusive.
+ */
+BasicSourceMapConsumer.prototype.computeColumnSpans =
+ function SourceMapConsumer_computeColumnSpans() {
+ for (var index = 0; index < this._generatedMappings.length; ++index) {
+ var mapping = this._generatedMappings[index];
+
+ // Mappings do not contain a field for the last generated columnt. We
+ // can come up with an optimistic estimate, however, by assuming that
+ // mappings are contiguous (i.e. given two consecutive mappings, the
+ // first mapping ends where the second one starts).
+ if (index + 1 < this._generatedMappings.length) {
+ var nextMapping = this._generatedMappings[index + 1];
+
+ if (mapping.generatedLine === nextMapping.generatedLine) {
+ mapping.lastGeneratedColumn = nextMapping.generatedColumn - 1;
+ continue;
+ }
+ }
+
+ // The last mapping for each line spans the entire line.
+ mapping.lastGeneratedColumn = Infinity;
+ }
+ };
+
+/**
+ * Returns the original source, line, and column information for the generated
+ * source's line and column positions provided. The only argument is an object
+ * with the following properties:
+ *
+ * - line: The line number in the generated source.
+ * - column: The column number in the generated source.
+ * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or
+ * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the
+ * closest element that is smaller than or greater than the one we are
+ * searching for, respectively, if the exact element cannot be found.
+ * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'.
+ *
+ * and an object is returned with the following properties:
+ *
+ * - source: The original source file, or null.
+ * - line: The line number in the original source, or null.
+ * - column: The column number in the original source, or null.
+ * - name: The original identifier, or null.
+ */
+BasicSourceMapConsumer.prototype.originalPositionFor =
+ function SourceMapConsumer_originalPositionFor(aArgs) {
+ var needle = {
+ generatedLine: util.getArg(aArgs, 'line'),
+ generatedColumn: util.getArg(aArgs, 'column')
+ };
+
+ var index = this._findMapping(
+ needle,
+ this._generatedMappings,
+ "generatedLine",
+ "generatedColumn",
+ util.compareByGeneratedPositionsDeflated,
+ util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND)
+ );
+
+ if (index >= 0) {
+ var mapping = this._generatedMappings[index];
+
+ if (mapping.generatedLine === needle.generatedLine) {
+ var source = util.getArg(mapping, 'source', null);
+ if (source !== null) {
+ source = this._sources.at(source);
+ if (this.sourceRoot != null) {
+ source = util.join(this.sourceRoot, source);
+ }
+ }
+ var name = util.getArg(mapping, 'name', null);
+ if (name !== null) {
+ name = this._names.at(name);
+ }
+ return {
+ source: source,
+ line: util.getArg(mapping, 'originalLine', null),
+ column: util.getArg(mapping, 'originalColumn', null),
+ name: name
+ };
+ }
+ }
+
+ return {
+ source: null,
+ line: null,
+ column: null,
+ name: null
+ };
+ };
+
+/**
+ * Return true if we have the source content for every source in the source
+ * map, false otherwise.
+ */
+BasicSourceMapConsumer.prototype.hasContentsOfAllSources =
+ function BasicSourceMapConsumer_hasContentsOfAllSources() {
+ if (!this.sourcesContent) {
+ return false;
+ }
+ return this.sourcesContent.length >= this._sources.size() &&
+ !this.sourcesContent.some(function (sc) { return sc == null; });
+ };
+
+/**
+ * Returns the original source content. The only argument is the url of the
+ * original source file. Returns null if no original source content is
+ * available.
+ */
+BasicSourceMapConsumer.prototype.sourceContentFor =
+ function SourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {
+ if (!this.sourcesContent) {
+ return null;
+ }
+
+ if (this.sourceRoot != null) {
+ aSource = util.relative(this.sourceRoot, aSource);
+ }
+
+ if (this._sources.has(aSource)) {
+ return this.sourcesContent[this._sources.indexOf(aSource)];
+ }
+
+ var url;
+ if (this.sourceRoot != null
+ && (url = util.urlParse(this.sourceRoot))) {
+ // XXX: file:// URIs and absolute paths lead to unexpected behavior for
+ // many users. We can help them out when they expect file:// URIs to
+ // behave like it would if they were running a local HTTP server. See
+ // https://bugzilla.mozilla.org/show_bug.cgi?id=885597.
+ var fileUriAbsPath = aSource.replace(/^file:\/\//, "");
+ if (url.scheme == "file"
+ && this._sources.has(fileUriAbsPath)) {
+ return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)]
+ }
+
+ if ((!url.path || url.path == "/")
+ && this._sources.has("/" + aSource)) {
+ return this.sourcesContent[this._sources.indexOf("/" + aSource)];
+ }
+ }
+
+ // This function is used recursively from
+ // IndexedSourceMapConsumer.prototype.sourceContentFor. In that case, we
+ // don't want to throw if we can't find the source - we just want to
+ // return null, so we provide a flag to exit gracefully.
+ if (nullOnMissing) {
+ return null;
+ }
+ else {
+ throw new Error('"' + aSource + '" is not in the SourceMap.');
+ }
+ };
+
+/**
+ * Returns the generated line and column information for the original source,
+ * line, and column positions provided. The only argument is an object with
+ * the following properties:
+ *
+ * - source: The filename of the original source.
+ * - line: The line number in the original source.
+ * - column: The column number in the original source.
+ * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or
+ * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the
+ * closest element that is smaller than or greater than the one we are
+ * searching for, respectively, if the exact element cannot be found.
+ * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'.
+ *
+ * and an object is returned with the following properties:
+ *
+ * - line: The line number in the generated source, or null.
+ * - column: The column number in the generated source, or null.
+ */
+BasicSourceMapConsumer.prototype.generatedPositionFor =
+ function SourceMapConsumer_generatedPositionFor(aArgs) {
+ var source = util.getArg(aArgs, 'source');
+ if (this.sourceRoot != null) {
+ source = util.relative(this.sourceRoot, source);
+ }
+ if (!this._sources.has(source)) {
+ return {
+ line: null,
+ column: null,
+ lastColumn: null
+ };
+ }
+ source = this._sources.indexOf(source);
+
+ var needle = {
+ source: source,
+ originalLine: util.getArg(aArgs, 'line'),
+ originalColumn: util.getArg(aArgs, 'column')
+ };
+
+ var index = this._findMapping(
+ needle,
+ this._originalMappings,
+ "originalLine",
+ "originalColumn",
+ util.compareByOriginalPositions,
+ util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND)
+ );
+
+ if (index >= 0) {
+ var mapping = this._originalMappings[index];
+
+ if (mapping.source === needle.source) {
+ return {
+ line: util.getArg(mapping, 'generatedLine', null),
+ column: util.getArg(mapping, 'generatedColumn', null),
+ lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)
+ };
+ }
+ }
+
+ return {
+ line: null,
+ column: null,
+ lastColumn: null
+ };
+ };
+
+exports.BasicSourceMapConsumer = BasicSourceMapConsumer;
+
+/**
+ * An IndexedSourceMapConsumer instance represents a parsed source map which
+ * we can query for information. It differs from BasicSourceMapConsumer in
+ * that it takes "indexed" source maps (i.e. ones with a "sections" field) as
+ * input.
+ *
+ * The only parameter is a raw source map (either as a JSON string, or already
+ * parsed to an object). According to the spec for indexed source maps, they
+ * have the following attributes:
+ *
+ * - version: Which version of the source map spec this map is following.
+ * - file: Optional. The generated file this source map is associated with.
+ * - sections: A list of section definitions.
+ *
+ * Each value under the "sections" field has two fields:
+ * - offset: The offset into the original specified at which this section
+ * begins to apply, defined as an object with a "line" and "column"
+ * field.
+ * - map: A source map definition. This source map could also be indexed,
+ * but doesn't have to be.
+ *
+ * Instead of the "map" field, it's also possible to have a "url" field
+ * specifying a URL to retrieve a source map from, but that's currently
+ * unsupported.
+ *
+ * Here's an example source map, taken from the source map spec[0], but
+ * modified to omit a section which uses the "url" field.
+ *
+ * {
+ * version : 3,
+ * file: "app.js",
+ * sections: [{
+ * offset: {line:100, column:10},
+ * map: {
+ * version : 3,
+ * file: "section.js",
+ * sources: ["foo.js", "bar.js"],
+ * names: ["src", "maps", "are", "fun"],
+ * mappings: "AAAA,E;;ABCDE;"
+ * }
+ * }],
+ * }
+ *
+ * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit#heading=h.535es3xeprgt
+ */
+function IndexedSourceMapConsumer(aSourceMap) {
+ var sourceMap = aSourceMap;
+ if (typeof aSourceMap === 'string') {
+ sourceMap = JSON.parse(aSourceMap.replace(/^\)\]\}'/, ''));
+ }
+
+ var version = util.getArg(sourceMap, 'version');
+ var sections = util.getArg(sourceMap, 'sections');
+
+ if (version != this._version) {
+ throw new Error('Unsupported version: ' + version);
+ }
+
+ this._sources = new ArraySet();
+ this._names = new ArraySet();
+
+ var lastOffset = {
+ line: -1,
+ column: 0
+ };
+ this._sections = sections.map(function (s) {
+ if (s.url) {
+ // The url field will require support for asynchronicity.
+ // See https://github.com/mozilla/source-map/issues/16
+ throw new Error('Support for url field in sections not implemented.');
+ }
+ var offset = util.getArg(s, 'offset');
+ var offsetLine = util.getArg(offset, 'line');
+ var offsetColumn = util.getArg(offset, 'column');
+
+ if (offsetLine < lastOffset.line ||
+ (offsetLine === lastOffset.line && offsetColumn < lastOffset.column)) {
+ throw new Error('Section offsets must be ordered and non-overlapping.');
+ }
+ lastOffset = offset;
+
+ return {
+ generatedOffset: {
+ // The offset fields are 0-based, but we use 1-based indices when
+ // encoding/decoding from VLQ.
+ generatedLine: offsetLine + 1,
+ generatedColumn: offsetColumn + 1
+ },
+ consumer: new SourceMapConsumer(util.getArg(s, 'map'))
+ }
+ });
+}
+
+IndexedSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);
+IndexedSourceMapConsumer.prototype.constructor = SourceMapConsumer;
+
+/**
+ * The version of the source mapping spec that we are consuming.
+ */
+IndexedSourceMapConsumer.prototype._version = 3;
+
+/**
+ * The list of original sources.
+ */
+Object.defineProperty(IndexedSourceMapConsumer.prototype, 'sources', {
+ get: function () {
+ var sources = [];
+ for (var i = 0; i < this._sections.length; i++) {
+ for (var j = 0; j < this._sections[i].consumer.sources.length; j++) {
+ sources.push(this._sections[i].consumer.sources[j]);
+ }
+ }
+ return sources;
+ }
+});
+
+/**
+ * Returns the original source, line, and column information for the generated
+ * source's line and column positions provided. The only argument is an object
+ * with the following properties:
+ *
+ * - line: The line number in the generated source.
+ * - column: The column number in the generated source.
+ *
+ * and an object is returned with the following properties:
+ *
+ * - source: The original source file, or null.
+ * - line: The line number in the original source, or null.
+ * - column: The column number in the original source, or null.
+ * - name: The original identifier, or null.
+ */
+IndexedSourceMapConsumer.prototype.originalPositionFor =
+ function IndexedSourceMapConsumer_originalPositionFor(aArgs) {
+ var needle = {
+ generatedLine: util.getArg(aArgs, 'line'),
+ generatedColumn: util.getArg(aArgs, 'column')
+ };
+
+ // Find the section containing the generated position we're trying to map
+ // to an original position.
+ var sectionIndex = binarySearch.search(needle, this._sections,
+ function(needle, section) {
+ var cmp = needle.generatedLine - section.generatedOffset.generatedLine;
+ if (cmp) {
+ return cmp;
+ }
+
+ return (needle.generatedColumn -
+ section.generatedOffset.generatedColumn);
+ });
+ var section = this._sections[sectionIndex];
+
+ if (!section) {
+ return {
+ source: null,
+ line: null,
+ column: null,
+ name: null
+ };
+ }
+
+ return section.consumer.originalPositionFor({
+ line: needle.generatedLine -
+ (section.generatedOffset.generatedLine - 1),
+ column: needle.generatedColumn -
+ (section.generatedOffset.generatedLine === needle.generatedLine
+ ? section.generatedOffset.generatedColumn - 1
+ : 0),
+ bias: aArgs.bias
+ });
+ };
+
+/**
+ * Return true if we have the source content for every source in the source
+ * map, false otherwise.
+ */
+IndexedSourceMapConsumer.prototype.hasContentsOfAllSources =
+ function IndexedSourceMapConsumer_hasContentsOfAllSources() {
+ return this._sections.every(function (s) {
+ return s.consumer.hasContentsOfAllSources();
+ });
+ };
+
+/**
+ * Returns the original source content. The only argument is the url of the
+ * original source file. Returns null if no original source content is
+ * available.
+ */
+IndexedSourceMapConsumer.prototype.sourceContentFor =
+ function IndexedSourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {
+ for (var i = 0; i < this._sections.length; i++) {
+ var section = this._sections[i];
+
+ var content = section.consumer.sourceContentFor(aSource, true);
+ if (content) {
+ return content;
+ }
+ }
+ if (nullOnMissing) {
+ return null;
+ }
+ else {
+ throw new Error('"' + aSource + '" is not in the SourceMap.');
+ }
+ };
+
+/**
+ * Returns the generated line and column information for the original source,
+ * line, and column positions provided. The only argument is an object with
+ * the following properties:
+ *
+ * - source: The filename of the original source.
+ * - line: The line number in the original source.
+ * - column: The column number in the original source.
+ *
+ * and an object is returned with the following properties:
+ *
+ * - line: The line number in the generated source, or null.
+ * - column: The column number in the generated source, or null.
+ */
+IndexedSourceMapConsumer.prototype.generatedPositionFor =
+ function IndexedSourceMapConsumer_generatedPositionFor(aArgs) {
+ for (var i = 0; i < this._sections.length; i++) {
+ var section = this._sections[i];
+
+ // Only consider this section if the requested source is in the list of
+ // sources of the consumer.
+ if (section.consumer.sources.indexOf(util.getArg(aArgs, 'source')) === -1) {
+ continue;
+ }
+ var generatedPosition = section.consumer.generatedPositionFor(aArgs);
+ if (generatedPosition) {
+ var ret = {
+ line: generatedPosition.line +
+ (section.generatedOffset.generatedLine - 1),
+ column: generatedPosition.column +
+ (section.generatedOffset.generatedLine === generatedPosition.line
+ ? section.generatedOffset.generatedColumn - 1
+ : 0)
+ };
+ return ret;
+ }
+ }
+
+ return {
+ line: null,
+ column: null
+ };
+ };
+
+/**
+ * Parse the mappings in a string in to a data structure which we can easily
+ * query (the ordered arrays in the `this.__generatedMappings` and
+ * `this.__originalMappings` properties).
+ */
+IndexedSourceMapConsumer.prototype._parseMappings =
+ function IndexedSourceMapConsumer_parseMappings(aStr, aSourceRoot) {
+ this.__generatedMappings = [];
+ this.__originalMappings = [];
+ for (var i = 0; i < this._sections.length; i++) {
+ var section = this._sections[i];
+ var sectionMappings = section.consumer._generatedMappings;
+ for (var j = 0; j < sectionMappings.length; j++) {
+ var mapping = sectionMappings[j];
+
+ var source = section.consumer._sources.at(mapping.source);
+ if (section.consumer.sourceRoot !== null) {
+ source = util.join(section.consumer.sourceRoot, source);
+ }
+ this._sources.add(source);
+ source = this._sources.indexOf(source);
+
+ var name = section.consumer._names.at(mapping.name);
+ this._names.add(name);
+ name = this._names.indexOf(name);
+
+ // The mappings coming from the consumer for the section have
+ // generated positions relative to the start of the section, so we
+ // need to offset them to be relative to the start of the concatenated
+ // generated file.
+ var adjustedMapping = {
+ source: source,
+ generatedLine: mapping.generatedLine +
+ (section.generatedOffset.generatedLine - 1),
+ generatedColumn: mapping.generatedColumn +
+ (section.generatedOffset.generatedLine === mapping.generatedLine
+ ? section.generatedOffset.generatedColumn - 1
+ : 0),
+ originalLine: mapping.originalLine,
+ originalColumn: mapping.originalColumn,
+ name: name
+ };
+
+ this.__generatedMappings.push(adjustedMapping);
+ if (typeof adjustedMapping.originalLine === 'number') {
+ this.__originalMappings.push(adjustedMapping);
+ }
+ }
+ }
+
+ quickSort(this.__generatedMappings, util.compareByGeneratedPositionsDeflated);
+ quickSort(this.__originalMappings, util.compareByOriginalPositions);
+ };
+
+exports.IndexedSourceMapConsumer = IndexedSourceMapConsumer;
+
+
+/***/ }),
+
+/***/ 636:
+/***/ (function(module, exports) {
+
+/* -*- Mode: js; js-indent-level: 2; -*- */
+/*
+ * Copyright 2011 Mozilla Foundation and contributors
+ * Licensed under the New BSD license. See LICENSE or:
+ * http://opensource.org/licenses/BSD-3-Clause
+ */
+
+exports.GREATEST_LOWER_BOUND = 1;
+exports.LEAST_UPPER_BOUND = 2;
+
+/**
+ * Recursive implementation of binary search.
+ *
+ * @param aLow Indices here and lower do not contain the needle.
+ * @param aHigh Indices here and higher do not contain the needle.
+ * @param aNeedle The element being searched for.
+ * @param aHaystack The non-empty array being searched.
+ * @param aCompare Function which takes two elements and returns -1, 0, or 1.
+ * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or
+ * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the
+ * closest element that is smaller than or greater than the one we are
+ * searching for, respectively, if the exact element cannot be found.
+ */
+function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) {
+ // This function terminates when one of the following is true:
+ //
+ // 1. We find the exact element we are looking for.
+ //
+ // 2. We did not find the exact element, but we can return the index of
+ // the next-closest element.
+ //
+ // 3. We did not find the exact element, and there is no next-closest
+ // element than the one we are searching for, so we return -1.
+ var mid = Math.floor((aHigh - aLow) / 2) + aLow;
+ var cmp = aCompare(aNeedle, aHaystack[mid], true);
+ if (cmp === 0) {
+ // Found the element we are looking for.
+ return mid;
+ }
+ else if (cmp > 0) {
+ // Our needle is greater than aHaystack[mid].
+ if (aHigh - mid > 1) {
+ // The element is in the upper half.
+ return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias);
+ }
+
+ // The exact needle element was not found in this haystack. Determine if
+ // we are in termination case (3) or (2) and return the appropriate thing.
+ if (aBias == exports.LEAST_UPPER_BOUND) {
+ return aHigh < aHaystack.length ? aHigh : -1;
+ } else {
+ return mid;
+ }
+ }
+ else {
+ // Our needle is less than aHaystack[mid].
+ if (mid - aLow > 1) {
+ // The element is in the lower half.
+ return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias);
+ }
+
+ // we are in termination case (3) or (2) and return the appropriate thing.
+ if (aBias == exports.LEAST_UPPER_BOUND) {
+ return mid;
+ } else {
+ return aLow < 0 ? -1 : aLow;
+ }
+ }
+}
+
+/**
+ * This is an implementation of binary search which will always try and return
+ * the index of the closest element if there is no exact hit. This is because
+ * mappings between original and generated line/col pairs are single points,
+ * and there is an implicit region between each of them, so a miss just means
+ * that you aren't on the very start of a region.
+ *
+ * @param aNeedle The element you are looking for.
+ * @param aHaystack The array that is being searched.
+ * @param aCompare A function which takes the needle and an element in the
+ * array and returns -1, 0, or 1 depending on whether the needle is less
+ * than, equal to, or greater than the element, respectively.
+ * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or
+ * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the
+ * closest element that is smaller than or greater than the one we are
+ * searching for, respectively, if the exact element cannot be found.
+ * Defaults to 'binarySearch.GREATEST_LOWER_BOUND'.
+ */
+exports.search = function search(aNeedle, aHaystack, aCompare, aBias) {
+ if (aHaystack.length === 0) {
+ return -1;
+ }
+
+ var index = recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack,
+ aCompare, aBias || exports.GREATEST_LOWER_BOUND);
+ if (index < 0) {
+ return -1;
+ }
+
+ // We have found either the exact element, or the next-closest element than
+ // the one we are searching for. However, there may be more than one such
+ // element. Make sure we always return the smallest of these.
+ while (index - 1 >= 0) {
+ if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) {
+ break;
+ }
+ --index;
+ }
+
+ return index;
+};
+
+
+/***/ }),
+
+/***/ 637:
+/***/ (function(module, exports) {
+
+/* -*- Mode: js; js-indent-level: 2; -*- */
+/*
+ * Copyright 2011 Mozilla Foundation and contributors
+ * Licensed under the New BSD license. See LICENSE or:
+ * http://opensource.org/licenses/BSD-3-Clause
+ */
+
+// It turns out that some (most?) JavaScript engines don't self-host
+// `Array.prototype.sort`. This makes sense because C++ will likely remain
+// faster than JS when doing raw CPU-intensive sorting. However, when using a
+// custom comparator function, calling back and forth between the VM's C++ and
+// JIT'd JS is rather slow *and* loses JIT type information, resulting in
+// worse generated code for the comparator function than would be optimal. In
+// fact, when sorting with a comparator, these costs outweigh the benefits of
+// sorting in C++. By using our own JS-implemented Quick Sort (below), we get
+// a ~3500ms mean speed-up in `bench/bench.html`.
+
+/**
+ * Swap the elements indexed by `x` and `y` in the array `ary`.
+ *
+ * @param {Array} ary
+ * The array.
+ * @param {Number} x
+ * The index of the first item.
+ * @param {Number} y
+ * The index of the second item.
+ */
+function swap(ary, x, y) {
+ var temp = ary[x];
+ ary[x] = ary[y];
+ ary[y] = temp;
+}
+
+/**
+ * Returns a random integer within the range `low .. high` inclusive.
+ *
+ * @param {Number} low
+ * The lower bound on the range.
+ * @param {Number} high
+ * The upper bound on the range.
+ */
+function randomIntInRange(low, high) {
+ return Math.round(low + (Math.random() * (high - low)));
+}
+
+/**
+ * The Quick Sort algorithm.
+ *
+ * @param {Array} ary
+ * An array to sort.
+ * @param {function} comparator
+ * Function to use to compare two items.
+ * @param {Number} p
+ * Start index of the array
+ * @param {Number} r
+ * End index of the array
+ */
+function doQuickSort(ary, comparator, p, r) {
+ // If our lower bound is less than our upper bound, we (1) partition the
+ // array into two pieces and (2) recurse on each half. If it is not, this is
+ // the empty array and our base case.
+
+ if (p < r) {
+ // (1) Partitioning.
+ //
+ // The partitioning chooses a pivot between `p` and `r` and moves all
+ // elements that are less than or equal to the pivot to the before it, and
+ // all the elements that are greater than it after it. The effect is that
+ // once partition is done, the pivot is in the exact place it will be when
+ // the array is put in sorted order, and it will not need to be moved
+ // again. This runs in O(n) time.
+
+ // Always choose a random pivot so that an input array which is reverse
+ // sorted does not cause O(n^2) running time.
+ var pivotIndex = randomIntInRange(p, r);
+ var i = p - 1;
+
+ swap(ary, pivotIndex, r);
+ var pivot = ary[r];
+
+ // Immediately after `j` is incremented in this loop, the following hold
+ // true:
+ //
+ // * Every element in `ary[p .. i]` is less than or equal to the pivot.
+ //
+ // * Every element in `ary[i+1 .. j-1]` is greater than the pivot.
+ for (var j = p; j < r; j++) {
+ if (comparator(ary[j], pivot) <= 0) {
+ i += 1;
+ swap(ary, i, j);
+ }
+ }
+
+ swap(ary, i + 1, j);
+ var q = i + 1;
+
+ // (2) Recurse on each half.
+
+ doQuickSort(ary, comparator, p, q - 1);
+ doQuickSort(ary, comparator, q + 1, r);
+ }
+}
+
+/**
+ * Sort the given array in-place with the given comparator function.
+ *
+ * @param {Array} ary
+ * An array to sort.
+ * @param {function} comparator
+ * Function to use to compare two items.
+ */
+exports.quickSort = function (ary, comparator) {
+ doQuickSort(ary, comparator, 0, ary.length - 1);
+};
+
+
+/***/ }),
+
+/***/ 638:
+/***/ (function(module, exports, __webpack_require__) {
+
+/* -*- Mode: js; js-indent-level: 2; -*- */
+/*
+ * Copyright 2011 Mozilla Foundation and contributors
+ * Licensed under the New BSD license. See LICENSE or:
+ * http://opensource.org/licenses/BSD-3-Clause
+ */
+
+var SourceMapGenerator = __webpack_require__(581).SourceMapGenerator;
+var util = __webpack_require__(566);
+
+// Matches a Windows-style `\r\n` newline or a `\n` newline used by all other
+// operating systems these days (capturing the result).
+var REGEX_NEWLINE = /(\r?\n)/;
+
+// Newline character code for charCodeAt() comparisons
+var NEWLINE_CODE = 10;
+
+// Private symbol for identifying `SourceNode`s when multiple versions of
+// the source-map library are loaded. This MUST NOT CHANGE across
+// versions!
+var isSourceNode = "$$$isSourceNode$$$";
+
+/**
+ * SourceNodes provide a way to abstract over interpolating/concatenating
+ * snippets of generated JavaScript source code while maintaining the line and
+ * column information associated with the original source code.
+ *
+ * @param aLine The original line number.
+ * @param aColumn The original column number.
+ * @param aSource The original source's filename.
+ * @param aChunks Optional. An array of strings which are snippets of
+ * generated JS, or other SourceNodes.
+ * @param aName The original identifier.
+ */
+function SourceNode(aLine, aColumn, aSource, aChunks, aName) {
+ this.children = [];
+ this.sourceContents = {};
+ this.line = aLine == null ? null : aLine;
+ this.column = aColumn == null ? null : aColumn;
+ this.source = aSource == null ? null : aSource;
+ this.name = aName == null ? null : aName;
+ this[isSourceNode] = true;
+ if (aChunks != null) this.add(aChunks);
+}
+
+/**
+ * Creates a SourceNode from generated code and a SourceMapConsumer.
+ *
+ * @param aGeneratedCode The generated code
+ * @param aSourceMapConsumer The SourceMap for the generated code
+ * @param aRelativePath Optional. The path that relative sources in the
+ * SourceMapConsumer should be relative to.
+ */
+SourceNode.fromStringWithSourceMap =
+ function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer, aRelativePath) {
+ // The SourceNode we want to fill with the generated code
+ // and the SourceMap
+ var node = new SourceNode();
+
+ // All even indices of this array are one line of the generated code,
+ // while all odd indices are the newlines between two adjacent lines
+ // (since `REGEX_NEWLINE` captures its match).
+ // Processed fragments are accessed by calling `shiftNextLine`.
+ var remainingLines = aGeneratedCode.split(REGEX_NEWLINE);
+ var remainingLinesIndex = 0;
+ var shiftNextLine = function() {
+ var lineContents = getNextLine();
+ // The last line of a file might not have a newline.
+ var newLine = getNextLine() || "";
+ return lineContents + newLine;
+
+ function getNextLine() {
+ return remainingLinesIndex < remainingLines.length ?
+ remainingLines[remainingLinesIndex++] : undefined;
+ }
+ };
+
+ // We need to remember the position of "remainingLines"
+ var lastGeneratedLine = 1, lastGeneratedColumn = 0;
+
+ // The generate SourceNodes we need a code range.
+ // To extract it current and last mapping is used.
+ // Here we store the last mapping.
+ var lastMapping = null;
+
+ aSourceMapConsumer.eachMapping(function (mapping) {
+ if (lastMapping !== null) {
+ // We add the code from "lastMapping" to "mapping":
+ // First check if there is a new line in between.
+ if (lastGeneratedLine < mapping.generatedLine) {
+ // Associate first line with "lastMapping"
+ addMappingWithCode(lastMapping, shiftNextLine());
+ lastGeneratedLine++;
+ lastGeneratedColumn = 0;
+ // The remaining code is added without mapping
+ } else {
+ // There is no new line in between.
+ // Associate the code between "lastGeneratedColumn" and
+ // "mapping.generatedColumn" with "lastMapping"
+ var nextLine = remainingLines[remainingLinesIndex];
+ var code = nextLine.substr(0, mapping.generatedColumn -
+ lastGeneratedColumn);
+ remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn -
+ lastGeneratedColumn);
+ lastGeneratedColumn = mapping.generatedColumn;
+ addMappingWithCode(lastMapping, code);
+ // No more remaining code, continue
+ lastMapping = mapping;
+ return;
+ }
+ }
+ // We add the generated code until the first mapping
+ // to the SourceNode without any mapping.
+ // Each line is added as separate string.
+ while (lastGeneratedLine < mapping.generatedLine) {
+ node.add(shiftNextLine());
+ lastGeneratedLine++;
+ }
+ if (lastGeneratedColumn < mapping.generatedColumn) {
+ var nextLine = remainingLines[remainingLinesIndex];
+ node.add(nextLine.substr(0, mapping.generatedColumn));
+ remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn);
+ lastGeneratedColumn = mapping.generatedColumn;
+ }
+ lastMapping = mapping;
+ }, this);
+ // We have processed all mappings.
+ if (remainingLinesIndex < remainingLines.length) {
+ if (lastMapping) {
+ // Associate the remaining code in the current line with "lastMapping"
+ addMappingWithCode(lastMapping, shiftNextLine());
+ }
+ // and add the remaining lines without any mapping
+ node.add(remainingLines.splice(remainingLinesIndex).join(""));
+ }
+
+ // Copy sourcesContent into SourceNode
+ aSourceMapConsumer.sources.forEach(function (sourceFile) {
+ var content = aSourceMapConsumer.sourceContentFor(sourceFile);
+ if (content != null) {
+ if (aRelativePath != null) {
+ sourceFile = util.join(aRelativePath, sourceFile);
+ }
+ node.setSourceContent(sourceFile, content);
+ }
+ });
+
+ return node;
+
+ function addMappingWithCode(mapping, code) {
+ if (mapping === null || mapping.source === undefined) {
+ node.add(code);
+ } else {
+ var source = aRelativePath
+ ? util.join(aRelativePath, mapping.source)
+ : mapping.source;
+ node.add(new SourceNode(mapping.originalLine,
+ mapping.originalColumn,
+ source,
+ code,
+ mapping.name));
+ }
+ }
+ };
+
+/**
+ * Add a chunk of generated JS to this source node.
+ *
+ * @param aChunk A string snippet of generated JS code, another instance of
+ * SourceNode, or an array where each member is one of those things.
+ */
+SourceNode.prototype.add = function SourceNode_add(aChunk) {
+ if (Array.isArray(aChunk)) {
+ aChunk.forEach(function (chunk) {
+ this.add(chunk);
+ }, this);
+ }
+ else if (aChunk[isSourceNode] || typeof aChunk === "string") {
+ if (aChunk) {
+ this.children.push(aChunk);
+ }
+ }
+ else {
+ throw new TypeError(
+ "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk
+ );
+ }
+ return this;
+};
+
+/**
+ * Add a chunk of generated JS to the beginning of this source node.
+ *
+ * @param aChunk A string snippet of generated JS code, another instance of
+ * SourceNode, or an array where each member is one of those things.
+ */
+SourceNode.prototype.prepend = function SourceNode_prepend(aChunk) {
+ if (Array.isArray(aChunk)) {
+ for (var i = aChunk.length-1; i >= 0; i--) {
+ this.prepend(aChunk[i]);
+ }
+ }
+ else if (aChunk[isSourceNode] || typeof aChunk === "string") {
+ this.children.unshift(aChunk);
+ }
+ else {
+ throw new TypeError(
+ "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk
+ );
+ }
+ return this;
+};
+
+/**
+ * Walk over the tree of JS snippets in this node and its children. The
+ * walking function is called once for each snippet of JS and is passed that
+ * snippet and the its original associated source's line/column location.
+ *
+ * @param aFn The traversal function.
+ */
+SourceNode.prototype.walk = function SourceNode_walk(aFn) {
+ var chunk;
+ for (var i = 0, len = this.children.length; i < len; i++) {
+ chunk = this.children[i];
+ if (chunk[isSourceNode]) {
+ chunk.walk(aFn);
+ }
+ else {
+ if (chunk !== '') {
+ aFn(chunk, { source: this.source,
+ line: this.line,
+ column: this.column,
+ name: this.name });
+ }
+ }
+ }
+};
+
+/**
+ * Like `String.prototype.join` except for SourceNodes. Inserts `aStr` between
+ * each of `this.children`.
+ *
+ * @param aSep The separator.
+ */
+SourceNode.prototype.join = function SourceNode_join(aSep) {
+ var newChildren;
+ var i;
+ var len = this.children.length;
+ if (len > 0) {
+ newChildren = [];
+ for (i = 0; i < len-1; i++) {
+ newChildren.push(this.children[i]);
+ newChildren.push(aSep);
+ }
+ newChildren.push(this.children[i]);
+ this.children = newChildren;
+ }
+ return this;
+};
+
+/**
+ * Call String.prototype.replace on the very right-most source snippet. Useful
+ * for trimming whitespace from the end of a source node, etc.
+ *
+ * @param aPattern The pattern to replace.
+ * @param aReplacement The thing to replace the pattern with.
+ */
+SourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) {
+ var lastChild = this.children[this.children.length - 1];
+ if (lastChild[isSourceNode]) {
+ lastChild.replaceRight(aPattern, aReplacement);
+ }
+ else if (typeof lastChild === 'string') {
+ this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement);
+ }
+ else {
+ this.children.push(''.replace(aPattern, aReplacement));
+ }
+ return this;
+};
+
+/**
+ * Set the source content for a source file. This will be added to the SourceMapGenerator
+ * in the sourcesContent field.
+ *
+ * @param aSourceFile The filename of the source file
+ * @param aSourceContent The content of the source file
+ */
+SourceNode.prototype.setSourceContent =
+ function SourceNode_setSourceContent(aSourceFile, aSourceContent) {
+ this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent;
+ };
+
+/**
+ * Walk over the tree of SourceNodes. The walking function is called for each
+ * source file content and is passed the filename and source content.
+ *
+ * @param aFn The traversal function.
+ */
+SourceNode.prototype.walkSourceContents =
+ function SourceNode_walkSourceContents(aFn) {
+ for (var i = 0, len = this.children.length; i < len; i++) {
+ if (this.children[i][isSourceNode]) {
+ this.children[i].walkSourceContents(aFn);
+ }
+ }
+
+ var sources = Object.keys(this.sourceContents);
+ for (var i = 0, len = sources.length; i < len; i++) {
+ aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]]);
+ }
+ };
+
+/**
+ * Return the string representation of this source node. Walks over the tree
+ * and concatenates all the various snippets together to one string.
+ */
+SourceNode.prototype.toString = function SourceNode_toString() {
+ var str = "";
+ this.walk(function (chunk) {
+ str += chunk;
+ });
+ return str;
+};
+
+/**
+ * Returns the string representation of this source node along with a source
+ * map.
+ */
+SourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) {
+ var generated = {
+ code: "",
+ line: 1,
+ column: 0
+ };
+ var map = new SourceMapGenerator(aArgs);
+ var sourceMappingActive = false;
+ var lastOriginalSource = null;
+ var lastOriginalLine = null;
+ var lastOriginalColumn = null;
+ var lastOriginalName = null;
+ this.walk(function (chunk, original) {
+ generated.code += chunk;
+ if (original.source !== null
+ && original.line !== null
+ && original.column !== null) {
+ if(lastOriginalSource !== original.source
+ || lastOriginalLine !== original.line
+ || lastOriginalColumn !== original.column
+ || lastOriginalName !== original.name) {
+ map.addMapping({
+ source: original.source,
+ original: {
+ line: original.line,
+ column: original.column
+ },
+ generated: {
+ line: generated.line,
+ column: generated.column
+ },
+ name: original.name
+ });
+ }
+ lastOriginalSource = original.source;
+ lastOriginalLine = original.line;
+ lastOriginalColumn = original.column;
+ lastOriginalName = original.name;
+ sourceMappingActive = true;
+ } else if (sourceMappingActive) {
+ map.addMapping({
+ generated: {
+ line: generated.line,
+ column: generated.column
+ }
+ });
+ lastOriginalSource = null;
+ sourceMappingActive = false;
+ }
+ for (var idx = 0, length = chunk.length; idx < length; idx++) {
+ if (chunk.charCodeAt(idx) === NEWLINE_CODE) {
+ generated.line++;
+ generated.column = 0;
+ // Mappings end at eol
+ if (idx + 1 === length) {
+ lastOriginalSource = null;
+ sourceMappingActive = false;
+ } else if (sourceMappingActive) {
+ map.addMapping({
+ source: original.source,
+ original: {
+ line: original.line,
+ column: original.column
+ },
+ generated: {
+ line: generated.line,
+ column: generated.column
+ },
+ name: original.name
+ });
+ }
+ } else {
+ generated.column++;
+ }
+ }
+ });
+ this.walkSourceContents(function (sourceFile, sourceContent) {
+ map.setSourceContent(sourceFile, sourceContent);
+ });
+
+ return { code: generated.code, map: map };
+};
+
+exports.SourceNode = SourceNode;
+
+
+/***/ }),
+
+/***/ 900:
+/***/ (function(module, exports, __webpack_require__) {
+
+module.exports = __webpack_require__(901);
+
+
+/***/ }),
+
+/***/ 901:
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+var _prettyFast = _interopRequireDefault(__webpack_require__(902));
+
+var _devtoolsUtils = __webpack_require__(560);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+const {
+ workerHandler
+} = _devtoolsUtils.workerUtils;
+
+function prettyPrint({
+ url,
+ indent,
+ sourceText
+}) {
+ const prettified = (0, _prettyFast.default)(sourceText, {
+ url,
+ indent: " ".repeat(indent)
+ });
+ return {
+ code: prettified.code,
+ mappings: invertMappings(prettified.map._mappings)
+ };
+}
+
+function invertMappings(mappings) {
+ return mappings._array.map(m => {
+ const mapping = {
+ generated: {
+ line: m.originalLine,
+ column: m.originalColumn
+ }
+ };
+
+ if (m.source) {
+ mapping.source = m.source;
+ mapping.original = {
+ line: m.generatedLine,
+ column: m.generatedColumn
+ };
+ mapping.name = m.name;
+ }
+
+ return mapping;
+ });
+}
+
+self.onmessage = workerHandler({
+ prettyPrint
+});
+
+/***/ }),
+
+/***/ 902:
+/***/ (function(module, exports, __webpack_require__) {
+
+var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/* -*- indent-tabs-mode: nil; js-indent-level: 2; fill-column: 80 -*- */
+/*
+ * Copyright 2013 Mozilla Foundation and contributors
+ * Licensed under the New BSD license. See LICENSE.md or:
+ * http://opensource.org/licenses/BSD-2-Clause
+ */
+(function (root, factory) {
+ "use strict";
+
+ if (true) {
+ !(__WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
+ __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
+ (__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) :
+ __WEBPACK_AMD_DEFINE_FACTORY__),
+ __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
+ } else if (typeof exports === "object") {
+ module.exports = factory();
+ } else {
+ root.prettyFast = factory();
+ }
+}(this, function () {
+ "use strict";
+
+ var acorn = this.acorn || __webpack_require__(903);
+ var sourceMap = this.sourceMap || __webpack_require__(632);
+ var SourceNode = sourceMap.SourceNode;
+
+ // If any of these tokens are seen before a "[" token, we know that "[" token
+ // is the start of an array literal, rather than a property access.
+ //
+ // The only exception is "}", which would need to be disambiguated by
+ // parsing. The majority of the time, an open bracket following a closing
+ // curly is going to be an array literal, so we brush the complication under
+ // the rug, and handle the ambiguity by always assuming that it will be an
+ // array literal.
+ var PRE_ARRAY_LITERAL_TOKENS = {
+ "typeof": true,
+ "void": true,
+ "delete": true,
+ "case": true,
+ "do": true,
+ "=": true,
+ "in": true,
+ "{": true,
+ "*": true,
+ "/": true,
+ "%": true,
+ "else": true,
+ ";": true,
+ "++": true,
+ "--": true,
+ "+": true,
+ "-": true,
+ "~": true,
+ "!": true,
+ ":": true,
+ "?": true,
+ ">>": true,
+ ">>>": true,
+ "<<": true,
+ "||": true,
+ "&&": true,
+ "<": true,
+ ">": true,
+ "<=": true,
+ ">=": true,
+ "instanceof": true,
+ "&": true,
+ "^": true,
+ "|": true,
+ "==": true,
+ "!=": true,
+ "===": true,
+ "!==": true,
+ ",": true,
+
+ "}": true
+ };
+
+ /**
+ * Determines if we think that the given token starts an array literal.
+ *
+ * @param Object token
+ * The token we want to determine if it is an array literal.
+ * @param Object lastToken
+ * The last token we added to the pretty printed results.
+ *
+ * @returns Boolean
+ * True if we believe it is an array literal, false otherwise.
+ */
+ function isArrayLiteral(token, lastToken) {
+ if (token.type.label != "[") {
+ return false;
+ }
+ if (!lastToken) {
+ return true;
+ }
+ if (lastToken.type.isAssign) {
+ return true;
+ }
+ return !!PRE_ARRAY_LITERAL_TOKENS[
+ lastToken.type.keyword || lastToken.type.label
+ ];
+ }
+
+ // If any of these tokens are followed by a token on a new line, we know that
+ // ASI cannot happen.
+ var PREVENT_ASI_AFTER_TOKENS = {
+ // Binary operators
+ "*": true,
+ "/": true,
+ "%": true,
+ "+": true,
+ "-": true,
+ "<<": true,
+ ">>": true,
+ ">>>": true,
+ "<": true,
+ ">": true,
+ "<=": true,
+ ">=": true,
+ "instanceof": true,
+ "in": true,
+ "==": true,
+ "!=": true,
+ "===": true,
+ "!==": true,
+ "&": true,
+ "^": true,
+ "|": true,
+ "&&": true,
+ "||": true,
+ ",": true,
+ ".": true,
+ "=": true,
+ "*=": true,
+ "/=": true,
+ "%=": true,
+ "+=": true,
+ "-=": true,
+ "<<=": true,
+ ">>=": true,
+ ">>>=": true,
+ "&=": true,
+ "^=": true,
+ "|=": true,
+ // Unary operators
+ "delete": true,
+ "void": true,
+ "typeof": true,
+ "~": true,
+ "!": true,
+ "new": true,
+ // Function calls and grouped expressions
+ "(": true
+ };
+
+ // If any of these tokens are on a line after the token before it, we know
+ // that ASI cannot happen.
+ var PREVENT_ASI_BEFORE_TOKENS = {
+ // Binary operators
+ "*": true,
+ "/": true,
+ "%": true,
+ "<<": true,
+ ">>": true,
+ ">>>": true,
+ "<": true,
+ ">": true,
+ "<=": true,
+ ">=": true,
+ "instanceof": true,
+ "in": true,
+ "==": true,
+ "!=": true,
+ "===": true,
+ "!==": true,
+ "&": true,
+ "^": true,
+ "|": true,
+ "&&": true,
+ "||": true,
+ ",": true,
+ ".": true,
+ "=": true,
+ "*=": true,
+ "/=": true,
+ "%=": true,
+ "+=": true,
+ "-=": true,
+ "<<=": true,
+ ">>=": true,
+ ">>>=": true,
+ "&=": true,
+ "^=": true,
+ "|=": true,
+ // Function calls
+ "(": true
+ };
+
+ /**
+ * Determine if a token can look like an identifier. More precisely,
+ * this determines if the token may end or start with a character from
+ * [A-Za-z0-9_].
+ *
+ * @param Object token
+ * The token we are looking at.
+ *
+ * @returns Boolean
+ * True if identifier-like.
+ */
+ function isIdentifierLike(token) {
+ var ttl = token.type.label;
+ return ttl == "name" || ttl == "num" || !!token.type.keyword;
+ }
+
+ /**
+ * Determines if Automatic Semicolon Insertion (ASI) occurs between these
+ * tokens.
+ *
+ * @param Object token
+ * The current token.
+ * @param Object lastToken
+ * The last token we added to the pretty printed results.
+ *
+ * @returns Boolean
+ * True if we believe ASI occurs.
+ */
+ function isASI(token, lastToken) {
+ if (!lastToken) {
+ return false;
+ }
+ if (token.loc.start.line === lastToken.loc.start.line) {
+ return false;
+ }
+ if (lastToken.type.keyword == "return"
+ || lastToken.type.keyword == "yield"
+ || (lastToken.type.label == "name" && lastToken.value == "yield")) {
+ return true;
+ }
+ if (PREVENT_ASI_AFTER_TOKENS[
+ lastToken.type.label || lastToken.type.keyword
+ ]) {
+ return false;
+ }
+ if (PREVENT_ASI_BEFORE_TOKENS[token.type.label || token.type.keyword]) {
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * Determine if we should add a newline after the given token.
+ *
+ * @param Object token
+ * The token we are looking at.
+ * @param Array stack
+ * The stack of open parens/curlies/brackets/etc.
+ *
+ * @returns Boolean
+ * True if we should add a newline.
+ */
+ function isLineDelimiter(token, stack) {
+ if (token.isArrayLiteral) {
+ return true;
+ }
+ var ttl = token.type.label;
+ var top = stack[stack.length - 1];
+ return ttl == ";" && top != "("
+ || ttl == "{"
+ || ttl == "," && top != "("
+ || ttl == ":" && (top == "case" || top == "default");
+ }
+
+ /**
+ * Append the necessary whitespace to the result after we have added the given
+ * token.
+ *
+ * @param Object token
+ * The token that was just added to the result.
+ * @param Function write
+ * The function to write to the pretty printed results.
+ * @param Array stack
+ * The stack of open parens/curlies/brackets/etc.
+ *
+ * @returns Boolean
+ * Returns true if we added a newline to result, false in all other
+ * cases.
+ */
+ function appendNewline(token, write, stack) {
+ if (isLineDelimiter(token, stack)) {
+ write("\n", token.loc.start.line, token.loc.start.column);
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Determines if we need to add a space between the last token we added and
+ * the token we are about to add.
+ *
+ * @param Object token
+ * The token we are about to add to the pretty printed code.
+ * @param Object lastToken
+ * The last token added to the pretty printed code.
+ */
+ function needsSpaceAfter(token, lastToken) {
+ if (lastToken) {
+ if (lastToken.type.isLoop) {
+ return true;
+ }
+ if (lastToken.type.isAssign) {
+ return true;
+ }
+ if (lastToken.type.binop != null) {
+ return true;
+ }
+
+ var ltt = lastToken.type.label;
+ if (ltt == "?") {
+ return true;
+ }
+ if (ltt == ":") {
+ return true;
+ }
+ if (ltt == ",") {
+ return true;
+ }
+ if (ltt == ";") {
+ return true;
+ }
+ if (ltt == "${") {
+ return true;
+ }
+ if (ltt == "num" && token.type.label == ".") {
+ return true;
+ }
+
+ var ltk = lastToken.type.keyword;
+ var ttl = token.type.label;
+ if (ltk != null && ttl != ".") {
+ if (ltk == "break" || ltk == "continue" || ltk == "return") {
+ return token.type.label != ";";
+ }
+ if (ltk != "debugger"
+ && ltk != "null"
+ && ltk != "true"
+ && ltk != "false"
+ && ltk != "this"
+ && ltk != "default") {
+ return true;
+ }
+ }
+
+ if (ltt == ")" && (token.type.label != ")"
+ && token.type.label != "]"
+ && token.type.label != ";"
+ && token.type.label != ","
+ && token.type.label != ".")) {
+ return true;
+ }
+
+ if (isIdentifierLike(token) && isIdentifierLike(lastToken)) {
+ // We must emit a space to avoid merging the tokens.
+ return true;
+ }
+
+ if (token.type.label == "{" && lastToken.type.label == "name") {
+ return true;
+ }
+ }
+
+ if (token.type.isAssign) {
+ return true;
+ }
+ if (token.type.binop != null && lastToken) {
+ return true;
+ }
+ if (token.type.label == "?") {
+ return true;
+ }
+
+ return false;
+ }
+
+ /**
+ * Add the required whitespace before this token, whether that is a single
+ * space, newline, and/or the indent on fresh lines.
+ *
+ * @param Object token
+ * The token we are about to add to the pretty printed code.
+ * @param Object lastToken
+ * The last token we added to the pretty printed code.
+ * @param Boolean addedNewline
+ * Whether we added a newline after adding the last token to the pretty
+ * printed code.
+ * @param Boolean addedSpace
+ * Whether we added a space after adding the last token to the pretty
+ * printed code. This only happens if an inline comment was printed
+ * since the last token.
+ * @param Function write
+ * The function to write pretty printed code to the result SourceNode.
+ * @param Object options
+ * The options object.
+ * @param Number indentLevel
+ * The number of indents deep we are.
+ * @param Array stack
+ * The stack of open curlies, brackets, etc.
+ */
+ function prependWhiteSpace(token, lastToken, addedNewline, addedSpace, write, options,
+ indentLevel, stack) {
+ var ttk = token.type.keyword;
+ var ttl = token.type.label;
+ var newlineAdded = addedNewline;
+ var spaceAdded = addedSpace;
+ var ltt = lastToken ? lastToken.type.label : null;
+
+ // Handle whitespace and newlines after "}" here instead of in
+ // `isLineDelimiter` because it is only a line delimiter some of the
+ // time. For example, we don't want to put "else if" on a new line after
+ // the first if's block.
+ if (lastToken && ltt == "}") {
+ if (ttk == "while" && stack[stack.length - 1] == "do") {
+ write(" ",
+ lastToken.loc.start.line,
+ lastToken.loc.start.column);
+ spaceAdded = true;
+ } else if (ttk == "else" ||
+ ttk == "catch" ||
+ ttk == "finally") {
+ write(" ",
+ lastToken.loc.start.line,
+ lastToken.loc.start.column);
+ spaceAdded = true;
+ } else if (ttl != "(" &&
+ ttl != ";" &&
+ ttl != "," &&
+ ttl != ")" &&
+ ttl != "." &&
+ ttl != "template" &&
+ ttl != "`") {
+ write("\n",
+ lastToken.loc.start.line,
+ lastToken.loc.start.column);
+ newlineAdded = true;
+ }
+ }
+
+ if ((ttl == ":" && stack[stack.length - 1] == "?") || (ttl == "}" && stack[stack.length - 1] == "${")) {
+ write(" ",
+ lastToken.loc.start.line,
+ lastToken.loc.start.column);
+ spaceAdded = true;
+ }
+
+ if (lastToken && ltt != "}" && ltt != "." && ttk == "else") {
+ write(" ",
+ lastToken.loc.start.line,
+ lastToken.loc.start.column);
+ spaceAdded = true;
+ }
+
+ function ensureNewline() {
+ if (!newlineAdded) {
+ write("\n",
+ lastToken.loc.start.line,
+ lastToken.loc.start.column);
+ newlineAdded = true;
+ }
+ }
+
+ if (isASI(token, lastToken)) {
+ ensureNewline();
+ }
+
+ if (decrementsIndent(ttl, stack)) {
+ ensureNewline();
+ }
+
+ if (newlineAdded) {
+ if (ttk == "case" || ttk == "default") {
+ write(repeat(options.indent, indentLevel - 1),
+ token.loc.start.line,
+ token.loc.start.column);
+ } else {
+ write(repeat(options.indent, indentLevel),
+ token.loc.start.line,
+ token.loc.start.column);
+ }
+ } else if (!spaceAdded && needsSpaceAfter(token, lastToken)) {
+ write(" ",
+ lastToken.loc.start.line,
+ lastToken.loc.start.column);
+ spaceAdded = true;
+ }
+ }
+
+ /**
+ * Repeat the `str` string `n` times.
+ *
+ * @param String str
+ * The string to be repeated.
+ * @param Number n
+ * The number of times to repeat the string.
+ *
+ * @returns String
+ * The repeated string.
+ */
+ function repeat(str, n) {
+ var result = "";
+ while (n > 0) {
+ if (n & 1) {
+ result += str;
+ }
+ n >>= 1;
+ str += str;
+ }
+ return result;
+ }
+
+ /**
+ * Make sure that we output the escaped character combination inside string
+ * literals instead of various problematic characters.
+ */
+ var sanitize = (function () {
+ var escapeCharacters = {
+ // Backslash
+ "\\": "\\\\",
+ // Newlines
+ "\n": "\\n",
+ // Carriage return
+ "\r": "\\r",
+ // Tab
+ "\t": "\\t",
+ // Vertical tab
+ "\v": "\\v",
+ // Form feed
+ "\f": "\\f",
+ // Null character
+ "\0": "\\x00",
+ // Line separator
+ "\u2028": "\\u2028",
+ // Paragraph separator
+ "\u2029": "\\u2029",
+ // Single quotes
+ "'": "\\'"
+ };
+
+ var regExpString = "("
+ + Object.keys(escapeCharacters)
+ .map(function (c) { return escapeCharacters[c]; })
+ .join("|")
+ + ")";
+ var escapeCharactersRegExp = new RegExp(regExpString, "g");
+
+ return function (str) {
+ return str.replace(escapeCharactersRegExp, function (_, c) {
+ return escapeCharacters[c];
+ });
+ };
+ }());
+ /**
+ * Add the given token to the pretty printed results.
+ *
+ * @param Object token
+ * The token to add.
+ * @param Function write
+ * The function to write pretty printed code to the result SourceNode.
+ */
+ function addToken(token, write) {
+ if (token.type.label == "string") {
+ write("'" + sanitize(token.value) + "'",
+ token.loc.start.line,
+ token.loc.start.column);
+ } else if (token.type.label == "regexp") {
+ write(String(token.value.value),
+ token.loc.start.line,
+ token.loc.start.column);
+ } else {
+ write(String(token.value != null ? token.value : token.type.label),
+ token.loc.start.line,
+ token.loc.start.column);
+ }
+ }
+
+ /**
+ * Returns true if the given token type belongs on the stack.
+ */
+ function belongsOnStack(token) {
+ var ttl = token.type.label;
+ var ttk = token.type.keyword;
+ return ttl == "{"
+ || ttl == "("
+ || ttl == "["
+ || ttl == "?"
+ || ttl == "${"
+ || ttk == "do"
+ || ttk == "switch"
+ || ttk == "case"
+ || ttk == "default";
+ }
+
+ /**
+ * Returns true if the given token should cause us to pop the stack.
+ */
+ function shouldStackPop(token, stack) {
+ var ttl = token.type.label;
+ var ttk = token.type.keyword;
+ var top = stack[stack.length - 1];
+ return ttl == "]"
+ || ttl == ")"
+ || ttl == "}"
+ || (ttl == ":" && (top == "case" || top == "default" || top == "?"))
+ || (ttk == "while" && top == "do");
+ }
+
+ /**
+ * Returns true if the given token type should cause us to decrement the
+ * indent level.
+ */
+ function decrementsIndent(tokenType, stack) {
+ return (tokenType == "}" && stack[stack.length - 1] != "${")
+ || (tokenType == "]" && stack[stack.length - 1] == "[\n");
+ }
+
+ /**
+ * Returns true if the given token should cause us to increment the indent
+ * level.
+ */
+ function incrementsIndent(token) {
+ return token.type.label == "{"
+ || token.isArrayLiteral
+ || token.type.keyword == "switch";
+ }
+
+ /**
+ * Add a comment to the pretty printed code.
+ *
+ * @param Function write
+ * The function to write pretty printed code to the result SourceNode.
+ * @param Number indentLevel
+ * The number of indents deep we are.
+ * @param Object options
+ * The options object.
+ * @param Boolean block
+ * True if the comment is a multiline block style comment.
+ * @param String text
+ * The text of the comment.
+ * @param Number line
+ * The line number to comment appeared on.
+ * @param Number column
+ * The column number the comment appeared on.
+ * @param Object nextToken
+ * The next token if any.
+ *
+ * @returns Boolean newlineAdded
+ * True if a newline was added.
+ */
+ function addComment(write, indentLevel, options, block, text, line, column, nextToken) {
+ var indentString = repeat(options.indent, indentLevel);
+ var needNewline = true;
+
+ write(indentString, line, column);
+ if (block) {
+ write("/*");
+ // We must pass ignoreNewline in case the comment happens to be "\n".
+ write(text
+ .split(new RegExp("/\n" + indentString + "/", "g"))
+ .join("\n" + indentString),
+ null, null, true);
+ write("*/");
+ needNewline = !(nextToken && nextToken.loc.start.line == line);
+ } else {
+ write("//");
+ write(text);
+ }
+ if (needNewline) {
+ write("\n");
+ } else {
+ write(" ");
+ }
+ return needNewline;
+ }
+
+ /**
+ * The main function.
+ *
+ * @param String input
+ * The ugly JS code we want to pretty print.
+ * @param Object options
+ * The options object. Provides configurability of the pretty
+ * printing. Properties:
+ * - url: The URL string of the ugly JS code.
+ * - indent: The string to indent code by.
+ *
+ * @returns Object
+ * An object with the following properties:
+ * - code: The pretty printed code string.
+ * - map: A SourceMapGenerator instance.
+ */
+ return function prettyFast(input, options) {
+ // The level of indents deep we are.
+ var indentLevel = 0;
+
+ // We will accumulate the pretty printed code in this SourceNode.
+ var result = new SourceNode();
+
+ /**
+ * Write a pretty printed string to the result SourceNode.
+ *
+ * We buffer our writes so that we only create one mapping for each line in
+ * the source map. This enhances performance by avoiding extraneous mapping
+ * serialization, and flattening the tree that
+ * `SourceNode#toStringWithSourceMap` will have to recursively walk. When
+ * timing how long it takes to pretty print jQuery, this optimization
+ * brought the time down from ~390 ms to ~190ms!
+ *
+ * @param String str
+ * The string to be added to the result.
+ * @param Number line
+ * The line number the string came from in the ugly source.
+ * @param Number column
+ * The column number the string came from in the ugly source.
+ * @param Boolean ignoreNewline
+ * If true, a single "\n" won't result in an additional mapping.
+ */
+ var write = (function () {
+ var buffer = [];
+ var bufferLine = -1;
+ var bufferColumn = -1;
+ return function write(str, line, column, ignoreNewline) {
+ if (line != null && bufferLine === -1) {
+ bufferLine = line;
+ }
+ if (column != null && bufferColumn === -1) {
+ bufferColumn = column;
+ }
+ buffer.push(str);
+
+ if (str == "\n" && !ignoreNewline) {
+ var lineStr = "";
+ for (var i = 0, len = buffer.length; i < len; i++) {
+ lineStr += buffer[i];
+ }
+ result.add(new SourceNode(bufferLine, bufferColumn, options.url,
+ lineStr));
+ buffer.splice(0, buffer.length);
+ bufferLine = -1;
+ bufferColumn = -1;
+ }
+ };
+ }());
+
+ // Whether or not we added a newline on after we added the last token.
+ var addedNewline = false;
+
+ // Whether or not we added a space after we added the last token.
+ var addedSpace = false;
+
+ // The current token we will be adding to the pretty printed code.
+ var token;
+
+ // Shorthand for token.type.label, so we don't have to repeatedly access
+ // properties.
+ var ttl;
+
+ // Shorthand for token.type.keyword, so we don't have to repeatedly access
+ // properties.
+ var ttk;
+
+ // The last token we added to the pretty printed code.
+ var lastToken;
+
+ // Stack of token types/keywords that can affect whether we want to add a
+ // newline or a space. We can make that decision based on what token type is
+ // on the top of the stack. For example, a comma in a parameter list should
+ // be followed by a space, while a comma in an object literal should be
+ // followed by a newline.
+ //
+ // Strings that go on the stack:
+ //
+ // - "{"
+ // - "("
+ // - "["
+ // - "[\n"
+ // - "do"
+ // - "?"
+ // - "switch"
+ // - "case"
+ // - "default"
+ //
+ // The difference between "[" and "[\n" is that "[\n" is used when we are
+ // treating "[" and "]" tokens as line delimiters and should increment and
+ // decrement the indent level when we find them.
+ var stack = [];
+
+ // Pass through acorn's tokenizer and append tokens and comments into a
+ // single queue to process. For example, the source file:
+ //
+ // foo
+ // // a
+ // // b
+ // bar
+ //
+ // After this process, tokenQueue has the following token stream:
+ //
+ // [ foo, '// a', '// b', bar]
+ var tokenQueue = [];
+
+ var tokens = acorn.tokenizer(input, {
+ locations: true,
+ sourceFile: options.url,
+ onComment: function (block, text, start, end, startLoc, endLoc) {
+ tokenQueue.push({
+ type: {},
+ comment: true,
+ block: block,
+ text: text,
+ loc: { start: startLoc, end: endLoc }
+ });
+ }
+ });
+
+ for (;;) {
+ token = tokens.getToken();
+ tokenQueue.push(token);
+ if (token.type.label == "eof") {
+ break;
+ }
+ }
+
+ for (var i = 0; i < tokenQueue.length; i++) {
+ token = tokenQueue[i];
+ var nextToken = tokenQueue[i + 1];
+
+ if (token.comment) {
+ var commentIndentLevel = indentLevel;
+ if (lastToken && (lastToken.loc.end.line == token.loc.start.line)) {
+ commentIndentLevel = 0;
+ write(" ");
+ }
+ addedNewline = addComment(write, commentIndentLevel, options,
+ token.block, token.text,
+ token.loc.start.line, token.loc.start.column,
+ nextToken);
+ addedSpace = !addedNewline;
+ continue;
+ }
+
+ ttk = token.type.keyword;
+
+ if (ttk && lastToken && lastToken.type.label == ".") {
+ token.type = acorn.tokTypes.name;
+ }
+
+ ttl = token.type.label;
+
+ if (ttl == "eof") {
+ if (!addedNewline) {
+ write("\n");
+ }
+ break;
+ }
+
+ token.isArrayLiteral = isArrayLiteral(token, lastToken);
+
+ if (belongsOnStack(token)) {
+ if (token.isArrayLiteral) {
+ stack.push("[\n");
+ } else {
+ stack.push(ttl || ttk);
+ }
+ }
+
+ if (decrementsIndent(ttl, stack)) {
+ indentLevel--;
+ if (ttl == "}"
+ && stack.length > 1
+ && stack[stack.length - 2] == "switch") {
+ indentLevel--;
+ }
+ }
+
+ prependWhiteSpace(token, lastToken, addedNewline, addedSpace, write, options,
+ indentLevel, stack);
+ addToken(token, write);
+ addedSpace = false;
+
+ // If the next token is going to be a comment starting on the same line,
+ // then no need to add one here
+ if (!nextToken || !nextToken.comment || token.loc.end.line != nextToken.loc.start.line) {
+ addedNewline = appendNewline(token, write, stack);
+ }
+
+ if (shouldStackPop(token, stack)) {
+ stack.pop();
+ if (ttl == "}" && stack.length
+ && stack[stack.length - 1] == "switch") {
+ stack.pop();
+ }
+ }
+
+ if (incrementsIndent(token)) {
+ indentLevel++;
+ }
+
+ // Acorn's tokenizer re-uses tokens, so we have to copy the last token on
+ // every iteration. We follow acorn's lead here, and reuse the lastToken
+ // object the same way that acorn reuses the token object. This allows us
+ // to avoid allocations and minimize GC pauses.
+ if (!lastToken) {
+ lastToken = { loc: { start: {}, end: {} } };
+ }
+ lastToken.start = token.start;
+ lastToken.end = token.end;
+ lastToken.loc.start.line = token.loc.start.line;
+ lastToken.loc.start.column = token.loc.start.column;
+ lastToken.loc.end.line = token.loc.end.line;
+ lastToken.loc.end.column = token.loc.end.column;
+ lastToken.type = token.type;
+ lastToken.value = token.value;
+ lastToken.isArrayLiteral = token.isArrayLiteral;
+ }
+
+ return result.toStringWithSourceMap({ file: options.url });
+ };
+
+}.bind(this)));
+
+
+/***/ }),
+
+/***/ 903:
+/***/ (function(module, exports, __webpack_require__) {
+
+(function (global, factory) {
+ true ? factory(exports) :
+ typeof define === 'function' && define.amd ? define(['exports'], factory) :
+ (global = global || self, factory(global.acorn = {}));
+}(this, (function (exports) { 'use strict';
+
+ // Reserved word lists for various dialects of the language
+
+ var reservedWords = {
+ 3: "abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",
+ 5: "class enum extends super const export import",
+ 6: "enum",
+ strict: "implements interface let package private protected public static yield",
+ strictBind: "eval arguments"
+ };
+
+ // And the keywords
+
+ var ecma5AndLessKeywords = "break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this";
+
+ var keywords = {
+ 5: ecma5AndLessKeywords,
+ "5module": ecma5AndLessKeywords + " export import",
+ 6: ecma5AndLessKeywords + " const class extends export import super"
+ };
+
+ var keywordRelationalOperator = /^in(stanceof)?$/;
+
+ // ## Character categories
+
+ // Big ugly regular expressions that match characters in the
+ // whitespace, identifier, and identifier-start categories. These
+ // are only applied when a character is found to actually have a
+ // code point above 128.
+ // Generated by `bin/generate-identifier-regex.js`.
+ var 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-\u08c7\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\u0d04-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d54-\u0d56\u0d5f-\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e86-\u0e8a\u0e8c-\u0ea3\u0ea5\u0ea7-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f5\u13f8-\u13fd\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f8\u1700-\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-\u31bf\u31f0-\u31ff\u3400-\u4dbf\u4e00-\u9ffc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua69d\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua7bf\ua7c2-\ua7ca\ua7f5-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua8fd\ua8fe\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\ua9e0-\ua9e4\ua9e6-\ua9ef\ua9fa-\ua9fe\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa7e-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uab30-\uab5a\uab5c-\uab69\uab70-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc";
+ var 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\u0b55-\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\u0d81-\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0de6-\u0def\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0ebc\u0ec8-\u0ecd\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1369-\u1371\u1712-\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\u1abf\u1ac0\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\ua82c\ua880\ua881\ua8b4-\ua8c5\ua8d0-\ua8d9\ua8e0-\ua8f1\ua8ff-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\ua9e5\ua9f0-\ua9f9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b-\uaa7d\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f";
+
+ var nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]");
+ var nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]");
+
+ nonASCIIidentifierStartChars = nonASCIIidentifierChars = null;
+
+ // These are a run-length and offset encoded representation of the
+ // >0xffff code points that are a valid part of identifiers. The
+ // offset starts at 0x10000, and each pair of numbers represents an
+ // offset to the next range, and then a size of the range. They were
+ // generated by bin/generate-identifier-regex.js
+
+ // eslint-disable-next-line comma-spacing
+ var 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,349,41,7,1,79,28,11,0,9,21,107,20,28,22,13,52,76,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,85,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,230,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,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,190,0,80,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,1237,43,8,8952,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,42717,35,4148,12,221,3,5761,15,7472,3104,541,1507,4938];
+
+ // eslint-disable-next-line comma-spacing
+ var astralIdentifierCodes = [509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,370,1,154,10,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,2,11,83,11,7,0,161,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,406,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,19306,9,135,4,60,6,26,9,1014,0,2,54,8,3,82,0,12,1,19628,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,4759,9,787719,239];
+
+ // This has a complexity linear to the value of the code. The
+ // assumption is that looking up astral identifier characters is
+ // rare.
+ function isInAstralSet(code, set) {
+ var pos = 0x10000;
+ for (var i = 0; i < set.length; i += 2) {
+ pos += set[i];
+ if (pos > code) { return false }
+ pos += set[i + 1];
+ if (pos >= code) { return true }
+ }
+ }
+
+ // Test whether a given character code starts an identifier.
+
+ function isIdentifierStart(code, astral) {
+ if (code < 65) { return code === 36 }
+ if (code < 91) { return true }
+ if (code < 97) { return code === 95 }
+ if (code < 123) { return true }
+ if (code <= 0xffff) { return code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code)) }
+ if (astral === false) { return false }
+ return isInAstralSet(code, astralIdentifierStartCodes)
+ }
+
+ // Test whether a given character is part of an identifier.
+
+ function isIdentifierChar(code, astral) {
+ if (code < 48) { return code === 36 }
+ if (code < 58) { return true }
+ if (code < 65) { return false }
+ if (code < 91) { return true }
+ if (code < 97) { return code === 95 }
+ if (code < 123) { return true }
+ if (code <= 0xffff) { return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code)) }
+ if (astral === false) { return false }
+ return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes)
+ }
+
+ // ## Token types
+
+ // The assignment of fine-grained, information-carrying type objects
+ // allows the tokenizer to store the information it has about a
+ // token in a way that is very cheap for the parser to look up.
+
+ // All token type variables start with an underscore, to make them
+ // easy to recognize.
+
+ // The `beforeExpr` property is used to disambiguate between regular
+ // expressions and divisions. It is set on all token types that can
+ // be followed by an expression (thus, a slash after them would be a
+ // regular expression).
+ //
+ // The `startsExpr` property is used to check if the token ends a
+ // `yield` expression. It is set on all token types that either can
+ // directly start an expression (like a quotation mark) or can
+ // continue an expression (like the body of a string).
+ //
+ // `isLoop` marks a keyword as starting a loop, which is important
+ // to know when parsing a label, in order to allow or disallow
+ // continue jumps to that label.
+
+ var TokenType = function TokenType(label, conf) {
+ if ( conf === void 0 ) conf = {};
+
+ this.label = label;
+ this.keyword = conf.keyword;
+ this.beforeExpr = !!conf.beforeExpr;
+ this.startsExpr = !!conf.startsExpr;
+ this.isLoop = !!conf.isLoop;
+ this.isAssign = !!conf.isAssign;
+ this.prefix = !!conf.prefix;
+ this.postfix = !!conf.postfix;
+ this.binop = conf.binop || null;
+ this.updateContext = null;
+ };
+
+ function binop(name, prec) {
+ return new TokenType(name, {beforeExpr: true, binop: prec})
+ }
+ var beforeExpr = {beforeExpr: true}, startsExpr = {startsExpr: true};
+
+ // Map keyword names to token types.
+
+ var keywords$1 = {};
+
+ // Succinct definitions of keyword token types
+ function kw(name, options) {
+ if ( options === void 0 ) options = {};
+
+ options.keyword = name;
+ return keywords$1[name] = new TokenType(name, options)
+ }
+
+ var types = {
+ num: new TokenType("num", startsExpr),
+ regexp: new TokenType("regexp", startsExpr),
+ string: new TokenType("string", startsExpr),
+ name: new TokenType("name", startsExpr),
+ eof: new TokenType("eof"),
+
+ // Punctuation token types.
+ bracketL: new TokenType("[", {beforeExpr: true, startsExpr: true}),
+ bracketR: new TokenType("]"),
+ braceL: new TokenType("{", {beforeExpr: true, startsExpr: true}),
+ braceR: new TokenType("}"),
+ parenL: new TokenType("(", {beforeExpr: true, startsExpr: true}),
+ parenR: new TokenType(")"),
+ comma: new TokenType(",", beforeExpr),
+ semi: new TokenType(";", beforeExpr),
+ colon: new TokenType(":", beforeExpr),
+ dot: new TokenType("."),
+ question: new TokenType("?", beforeExpr),
+ questionDot: new TokenType("?."),
+ arrow: new TokenType("=>", beforeExpr),
+ template: new TokenType("template"),
+ invalidTemplate: new TokenType("invalidTemplate"),
+ ellipsis: new TokenType("...", beforeExpr),
+ backQuote: new TokenType("`", startsExpr),
+ dollarBraceL: new TokenType("${", {beforeExpr: true, startsExpr: true}),
+
+ // Operators. These carry several kinds of properties to help the
+ // parser use them properly (the presence of these properties is
+ // what categorizes them as operators).
+ //
+ // `binop`, when present, specifies that this operator is a binary
+ // operator, and will refer to its precedence.
+ //
+ // `prefix` and `postfix` mark the operator as a prefix or postfix
+ // unary operator.
+ //
+ // `isAssign` marks all of `=`, `+=`, `-=` etcetera, which act as
+ // binary operators with a very low precedence, that should result
+ // in AssignmentExpression nodes.
+
+ eq: new TokenType("=", {beforeExpr: true, isAssign: true}),
+ assign: new TokenType("_=", {beforeExpr: true, isAssign: true}),
+ incDec: new TokenType("++/--", {prefix: true, postfix: true, startsExpr: true}),
+ prefix: new TokenType("!/~", {beforeExpr: true, prefix: true, startsExpr: true}),
+ logicalOR: binop("||", 1),
+ logicalAND: binop("&&", 2),
+ bitwiseOR: binop("|", 3),
+ bitwiseXOR: binop("^", 4),
+ bitwiseAND: binop("&", 5),
+ equality: binop("==/!=/===/!==", 6),
+ relational: binop("</>/<=/>=", 7),
+ bitShift: binop("<</>>/>>>", 8),
+ plusMin: new TokenType("+/-", {beforeExpr: true, binop: 9, prefix: true, startsExpr: true}),
+ modulo: binop("%", 10),
+ star: binop("*", 10),
+ slash: binop("/", 10),
+ starstar: new TokenType("**", {beforeExpr: true}),
+ coalesce: binop("??", 1),
+
+ // Keyword token types.
+ _break: kw("break"),
+ _case: kw("case", beforeExpr),
+ _catch: kw("catch"),
+ _continue: kw("continue"),
+ _debugger: kw("debugger"),
+ _default: kw("default", beforeExpr),
+ _do: kw("do", {isLoop: true, beforeExpr: true}),
+ _else: kw("else", beforeExpr),
+ _finally: kw("finally"),
+ _for: kw("for", {isLoop: true}),
+ _function: kw("function", startsExpr),
+ _if: kw("if"),
+ _return: kw("return", beforeExpr),
+ _switch: kw("switch"),
+ _throw: kw("throw", beforeExpr),
+ _try: kw("try"),
+ _var: kw("var"),
+ _const: kw("const"),
+ _while: kw("while", {isLoop: true}),
+ _with: kw("with"),
+ _new: kw("new", {beforeExpr: true, startsExpr: true}),
+ _this: kw("this", startsExpr),
+ _super: kw("super", startsExpr),
+ _class: kw("class", startsExpr),
+ _extends: kw("extends", beforeExpr),
+ _export: kw("export"),
+ _import: kw("import", startsExpr),
+ _null: kw("null", startsExpr),
+ _true: kw("true", startsExpr),
+ _false: kw("false", startsExpr),
+ _in: kw("in", {beforeExpr: true, binop: 7}),
+ _instanceof: kw("instanceof", {beforeExpr: true, binop: 7}),
+ _typeof: kw("typeof", {beforeExpr: true, prefix: true, startsExpr: true}),
+ _void: kw("void", {beforeExpr: true, prefix: true, startsExpr: true}),
+ _delete: kw("delete", {beforeExpr: true, prefix: true, startsExpr: true})
+ };
+
+ // Matches a whole line break (where CRLF is considered a single
+ // line break). Used to count lines.
+
+ var lineBreak = /\r\n?|\n|\u2028|\u2029/;
+ var lineBreakG = new RegExp(lineBreak.source, "g");
+
+ function isNewLine(code, ecma2019String) {
+ return code === 10 || code === 13 || (!ecma2019String && (code === 0x2028 || code === 0x2029))
+ }
+
+ var nonASCIIwhitespace = /[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/;
+
+ var skipWhiteSpace = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g;
+
+ var ref = Object.prototype;
+ var hasOwnProperty = ref.hasOwnProperty;
+ var toString = ref.toString;
+
+ // Checks if an object has a property.
+
+ function has(obj, propName) {
+ return hasOwnProperty.call(obj, propName)
+ }
+
+ var isArray = Array.isArray || (function (obj) { return (
+ toString.call(obj) === "[object Array]"
+ ); });
+
+ function wordsRegexp(words) {
+ return new RegExp("^(?:" + words.replace(/ /g, "|") + ")$")
+ }
+
+ // These are used when `options.locations` is on, for the
+ // `startLoc` and `endLoc` properties.
+
+ var Position = function Position(line, col) {
+ this.line = line;
+ this.column = col;
+ };
+
+ Position.prototype.offset = function offset (n) {
+ return new Position(this.line, this.column + n)
+ };
+
+ var SourceLocation = function SourceLocation(p, start, end) {
+ this.start = start;
+ this.end = end;
+ if (p.sourceFile !== null) { this.source = p.sourceFile; }
+ };
+
+ // The `getLineInfo` function is mostly useful when the
+ // `locations` option is off (for performance reasons) and you
+ // want to find the line/column position for a given character
+ // offset. `input` should be the code string that the offset refers
+ // into.
+
+ function getLineInfo(input, offset) {
+ for (var line = 1, cur = 0;;) {
+ lineBreakG.lastIndex = cur;
+ var match = lineBreakG.exec(input);
+ if (match && match.index < offset) {
+ ++line;
+ cur = match.index + match[0].length;
+ } else {
+ return new Position(line, offset - cur)
+ }
+ }
+ }
+
+ // A second argument must be given to configure the parser process.
+ // These options are recognized (only `ecmaVersion` is required):
+
+ var defaultOptions = {
+ // `ecmaVersion` indicates the ECMAScript version to parse. Must be
+ // either 3, 5, 6 (or 2015), 7 (2016), 8 (2017), 9 (2018), 10
+ // (2019), 11 (2020), 12 (2021), or `"latest"` (the latest version
+ // the library supports). This influences support for strict mode,
+ // the set of reserved words, and support for new syntax features.
+ ecmaVersion: null,
+ // `sourceType` indicates the mode the code should be parsed in.
+ // Can be either `"script"` or `"module"`. This influences global
+ // strict mode and parsing of `import` and `export` declarations.
+ sourceType: "script",
+ // `onInsertedSemicolon` can be a callback that will be called
+ // when a semicolon is automatically inserted. It will be passed
+ // the position of the comma as an offset, and if `locations` is
+ // enabled, it is given the location as a `{line, column}` object
+ // as second argument.
+ onInsertedSemicolon: null,
+ // `onTrailingComma` is similar to `onInsertedSemicolon`, but for
+ // trailing commas.
+ onTrailingComma: null,
+ // By default, reserved words are only enforced if ecmaVersion >= 5.
+ // Set `allowReserved` to a boolean value to explicitly turn this on
+ // an off. When this option has the value "never", reserved words
+ // and keywords can also not be used as property names.
+ allowReserved: null,
+ // When enabled, a return at the top level is not considered an
+ // error.
+ allowReturnOutsideFunction: false,
+ // When enabled, import/export statements are not constrained to
+ // appearing at the top of the program.
+ allowImportExportEverywhere: false,
+ // When enabled, await identifiers are allowed to appear at the top-level scope,
+ // but they are still not allowed in non-async functions.
+ allowAwaitOutsideFunction: false,
+ // When enabled, hashbang directive in the beginning of file
+ // is allowed and treated as a line comment.
+ allowHashBang: false,
+ // When `locations` is on, `loc` properties holding objects with
+ // `start` and `end` properties in `{line, column}` form (with
+ // line being 1-based and column 0-based) will be attached to the
+ // nodes.
+ locations: false,
+ // A function can be passed as `onToken` option, which will
+ // cause Acorn to call that function with object in the same
+ // format as tokens returned from `tokenizer().getToken()`. Note
+ // that you are not allowed to call the parser from the
+ // callback—that will corrupt its internal state.
+ onToken: null,
+ // A function can be passed as `onComment` option, which will
+ // cause Acorn to call that function with `(block, text, start,
+ // end)` parameters whenever a comment is skipped. `block` is a
+ // boolean indicating whether this is a block (`/* */`) comment,
+ // `text` is the content of the comment, and `start` and `end` are
+ // character offsets that denote the start and end of the comment.
+ // When the `locations` option is on, two more parameters are
+ // passed, the full `{line, column}` locations of the start and
+ // end of the comments. Note that you are not allowed to call the
+ // parser from the callback—that will corrupt its internal state.
+ onComment: null,
+ // Nodes have their start and end characters offsets recorded in
+ // `start` and `end` properties (directly on the node, rather than
+ // the `loc` object, which holds line/column data. To also add a
+ // [semi-standardized][range] `range` property holding a `[start,
+ // end]` array with the same numbers, set the `ranges` option to
+ // `true`.
+ //
+ // [range]: https://bugzilla.mozilla.org/show_bug.cgi?id=745678
+ ranges: false,
+ // It is possible to parse multiple files into a single AST by
+ // passing the tree produced by parsing the first file as
+ // `program` option in subsequent parses. This will add the
+ // toplevel forms of the parsed file to the `Program` (top) node
+ // of an existing parse tree.
+ program: null,
+ // When `locations` is on, you can pass this to record the source
+ // file in every node's `loc` object.
+ sourceFile: null,
+ // This value, if given, is stored in every node, whether
+ // `locations` is on or off.
+ directSourceFile: null,
+ // When enabled, parenthesized expressions are represented by
+ // (non-standard) ParenthesizedExpression nodes
+ preserveParens: false
+ };
+
+ // Interpret and default an options object
+
+ var warnedAboutEcmaVersion = false;
+
+ function getOptions(opts) {
+ var options = {};
+
+ for (var opt in defaultOptions)
+ { options[opt] = opts && has(opts, opt) ? opts[opt] : defaultOptions[opt]; }
+
+ if (options.ecmaVersion === "latest") {
+ options.ecmaVersion = 1e8;
+ } else if (options.ecmaVersion == null) {
+ if (!warnedAboutEcmaVersion && typeof console === "object" && console.warn) {
+ warnedAboutEcmaVersion = true;
+ console.warn("Since Acorn 8.0.0, options.ecmaVersion is required.\nDefaulting to 2020, but this will stop working in the future.");
+ }
+ options.ecmaVersion = 11;
+ } else if (options.ecmaVersion >= 2015) {
+ options.ecmaVersion -= 2009;
+ }
+
+ if (options.allowReserved == null)
+ { options.allowReserved = options.ecmaVersion < 5; }
+
+ if (isArray(options.onToken)) {
+ var tokens = options.onToken;
+ options.onToken = function (token) { return tokens.push(token); };
+ }
+ if (isArray(options.onComment))
+ { options.onComment = pushComment(options, options.onComment); }
+
+ return options
+ }
+
+ function pushComment(options, array) {
+ return function(block, text, start, end, startLoc, endLoc) {
+ var comment = {
+ type: block ? "Block" : "Line",
+ value: text,
+ start: start,
+ end: end
+ };
+ if (options.locations)
+ { comment.loc = new SourceLocation(this, startLoc, endLoc); }
+ if (options.ranges)
+ { comment.range = [start, end]; }
+ array.push(comment);
+ }
+ }
+
+ // Each scope gets a bitset that may contain these flags
+ var
+ SCOPE_TOP = 1,
+ SCOPE_FUNCTION = 2,
+ SCOPE_VAR = SCOPE_TOP | SCOPE_FUNCTION,
+ SCOPE_ASYNC = 4,
+ SCOPE_GENERATOR = 8,
+ SCOPE_ARROW = 16,
+ SCOPE_SIMPLE_CATCH = 32,
+ SCOPE_SUPER = 64,
+ SCOPE_DIRECT_SUPER = 128;
+
+ function functionFlags(async, generator) {
+ return SCOPE_FUNCTION | (async ? SCOPE_ASYNC : 0) | (generator ? SCOPE_GENERATOR : 0)
+ }
+
+ // Used in checkLVal* and declareName to determine the type of a binding
+ var
+ BIND_NONE = 0, // Not a binding
+ BIND_VAR = 1, // Var-style binding
+ BIND_LEXICAL = 2, // Let- or const-style binding
+ BIND_FUNCTION = 3, // Function declaration
+ BIND_SIMPLE_CATCH = 4, // Simple (identifier pattern) catch binding
+ BIND_OUTSIDE = 5; // Special case for function names as bound inside the function
+
+ var Parser = function Parser(options, input, startPos) {
+ this.options = options = getOptions(options);
+ this.sourceFile = options.sourceFile;
+ this.keywords = wordsRegexp(keywords[options.ecmaVersion >= 6 ? 6 : options.sourceType === "module" ? "5module" : 5]);
+ var reserved = "";
+ if (options.allowReserved !== true) {
+ reserved = reservedWords[options.ecmaVersion >= 6 ? 6 : options.ecmaVersion === 5 ? 5 : 3];
+ if (options.sourceType === "module") { reserved += " await"; }
+ }
+ this.reservedWords = wordsRegexp(reserved);
+ var reservedStrict = (reserved ? reserved + " " : "") + reservedWords.strict;
+ this.reservedWordsStrict = wordsRegexp(reservedStrict);
+ this.reservedWordsStrictBind = wordsRegexp(reservedStrict + " " + reservedWords.strictBind);
+ this.input = String(input);
+
+ // Used to signal to callers of `readWord1` whether the word
+ // contained any escape sequences. This is needed because words with
+ // escape sequences must not be interpreted as keywords.
+ this.containsEsc = false;
+
+ // Set up token state
+
+ // The current position of the tokenizer in the input.
+ if (startPos) {
+ this.pos = startPos;
+ this.lineStart = this.input.lastIndexOf("\n", startPos - 1) + 1;
+ this.curLine = this.input.slice(0, this.lineStart).split(lineBreak).length;
+ } else {
+ this.pos = this.lineStart = 0;
+ this.curLine = 1;
+ }
+
+ // Properties of the current token:
+ // Its type
+ this.type = types.eof;
+ // For tokens that include more information than their type, the value
+ this.value = null;
+ // Its start and end offset
+ this.start = this.end = this.pos;
+ // And, if locations are used, the {line, column} object
+ // corresponding to those offsets
+ this.startLoc = this.endLoc = this.curPosition();
+
+ // Position information for the previous token
+ this.lastTokEndLoc = this.lastTokStartLoc = null;
+ this.lastTokStart = this.lastTokEnd = this.pos;
+
+ // The context stack is used to superficially track syntactic
+ // context to predict whether a regular expression is allowed in a
+ // given position.
+ this.context = this.initialContext();
+ this.exprAllowed = true;
+
+ // Figure out if it's a module code.
+ this.inModule = options.sourceType === "module";
+ this.strict = this.inModule || this.strictDirective(this.pos);
+
+ // Used to signify the start of a potential arrow function
+ this.potentialArrowAt = -1;
+
+ // Positions to delayed-check that yield/await does not exist in default parameters.
+ this.yieldPos = this.awaitPos = this.awaitIdentPos = 0;
+ // Labels in scope.
+ this.labels = [];
+ // Thus-far undefined exports.
+ this.undefinedExports = {};
+
+ // If enabled, skip leading hashbang line.
+ if (this.pos === 0 && options.allowHashBang && this.input.slice(0, 2) === "#!")
+ { this.skipLineComment(2); }
+
+ // Scope tracking for duplicate variable names (see scope.js)
+ this.scopeStack = [];
+ this.enterScope(SCOPE_TOP);
+
+ // For RegExp validation
+ this.regexpState = null;
+ };
+
+ var prototypeAccessors = { inFunction: { configurable: true },inGenerator: { configurable: true },inAsync: { configurable: true },allowSuper: { configurable: true },allowDirectSuper: { configurable: true },treatFunctionsAsVar: { configurable: true },inNonArrowFunction: { configurable: true } };
+
+ Parser.prototype.parse = function parse () {
+ var node = this.options.program || this.startNode();
+ this.nextToken();
+ return this.parseTopLevel(node)
+ };
+
+ prototypeAccessors.inFunction.get = function () { return (this.currentVarScope().flags & SCOPE_FUNCTION) > 0 };
+ prototypeAccessors.inGenerator.get = function () { return (this.currentVarScope().flags & SCOPE_GENERATOR) > 0 };
+ prototypeAccessors.inAsync.get = function () { return (this.currentVarScope().flags & SCOPE_ASYNC) > 0 };
+ prototypeAccessors.allowSuper.get = function () { return (this.currentThisScope().flags & SCOPE_SUPER) > 0 };
+ prototypeAccessors.allowDirectSuper.get = function () { return (this.currentThisScope().flags & SCOPE_DIRECT_SUPER) > 0 };
+ prototypeAccessors.treatFunctionsAsVar.get = function () { return this.treatFunctionsAsVarInScope(this.currentScope()) };
+ prototypeAccessors.inNonArrowFunction.get = function () { return (this.currentThisScope().flags & SCOPE_FUNCTION) > 0 };
+
+ Parser.extend = function extend () {
+ var plugins = [], len = arguments.length;
+ while ( len-- ) plugins[ len ] = arguments[ len ];
+
+ var cls = this;
+ for (var i = 0; i < plugins.length; i++) { cls = plugins[i](cls); }
+ return cls
+ };
+
+ Parser.parse = function parse (input, options) {
+ return new this(options, input).parse()
+ };
+
+ Parser.parseExpressionAt = function parseExpressionAt (input, pos, options) {
+ var parser = new this(options, input, pos);
+ parser.nextToken();
+ return parser.parseExpression()
+ };
+
+ Parser.tokenizer = function tokenizer (input, options) {
+ return new this(options, input)
+ };
+
+ Object.defineProperties( Parser.prototype, prototypeAccessors );
+
+ var pp = Parser.prototype;
+
+ // ## Parser utilities
+
+ var literal = /^(?:'((?:\\.|[^'\\])*?)'|"((?:\\.|[^"\\])*?)")/;
+ pp.strictDirective = function(start) {
+ for (;;) {
+ // Try to find string literal.
+ skipWhiteSpace.lastIndex = start;
+ start += skipWhiteSpace.exec(this.input)[0].length;
+ var match = literal.exec(this.input.slice(start));
+ if (!match) { return false }
+ if ((match[1] || match[2]) === "use strict") {
+ skipWhiteSpace.lastIndex = start + match[0].length;
+ var spaceAfter = skipWhiteSpace.exec(this.input), end = spaceAfter.index + spaceAfter[0].length;
+ var next = this.input.charAt(end);
+ return next === ";" || next === "}" ||
+ (lineBreak.test(spaceAfter[0]) &&
+ !(/[(`.[+\-/*%<>=,?^&]/.test(next) || next === "!" && this.input.charAt(end + 1) === "="))
+ }
+ start += match[0].length;
+
+ // Skip semicolon, if any.
+ skipWhiteSpace.lastIndex = start;
+ start += skipWhiteSpace.exec(this.input)[0].length;
+ if (this.input[start] === ";")
+ { start++; }
+ }
+ };
+
+ // Predicate that tests whether the next token is of the given
+ // type, and if yes, consumes it as a side effect.
+
+ pp.eat = function(type) {
+ if (this.type === type) {
+ this.next();
+ return true
+ } else {
+ return false
+ }
+ };
+
+ // Tests whether parsed token is a contextual keyword.
+
+ pp.isContextual = function(name) {
+ return this.type === types.name && this.value === name && !this.containsEsc
+ };
+
+ // Consumes contextual keyword if possible.
+
+ pp.eatContextual = function(name) {
+ if (!this.isContextual(name)) { return false }
+ this.next();
+ return true
+ };
+
+ // Asserts that following token is given contextual keyword.
+
+ pp.expectContextual = function(name) {
+ if (!this.eatContextual(name)) { this.unexpected(); }
+ };
+
+ // Test whether a semicolon can be inserted at the current position.
+
+ pp.canInsertSemicolon = function() {
+ return this.type === types.eof ||
+ this.type === types.braceR ||
+ lineBreak.test(this.input.slice(this.lastTokEnd, this.start))
+ };
+
+ pp.insertSemicolon = function() {
+ if (this.canInsertSemicolon()) {
+ if (this.options.onInsertedSemicolon)
+ { this.options.onInsertedSemicolon(this.lastTokEnd, this.lastTokEndLoc); }
+ return true
+ }
+ };
+
+ // Consume a semicolon, or, failing that, see if we are allowed to
+ // pretend that there is a semicolon at this position.
+
+ pp.semicolon = function() {
+ if (!this.eat(types.semi) && !this.insertSemicolon()) { this.unexpected(); }
+ };
+
+ pp.afterTrailingComma = function(tokType, notNext) {
+ if (this.type === tokType) {
+ if (this.options.onTrailingComma)
+ { this.options.onTrailingComma(this.lastTokStart, this.lastTokStartLoc); }
+ if (!notNext)
+ { this.next(); }
+ return true
+ }
+ };
+
+ // Expect a token of a given type. If found, consume it, otherwise,
+ // raise an unexpected token error.
+
+ pp.expect = function(type) {
+ this.eat(type) || this.unexpected();
+ };
+
+ // Raise an unexpected token error.
+
+ pp.unexpected = function(pos) {
+ this.raise(pos != null ? pos : this.start, "Unexpected token");
+ };
+
+ function DestructuringErrors() {
+ this.shorthandAssign =
+ this.trailingComma =
+ this.parenthesizedAssign =
+ this.parenthesizedBind =
+ this.doubleProto =
+ -1;
+ }
+
+ pp.checkPatternErrors = function(refDestructuringErrors, isAssign) {
+ if (!refDestructuringErrors) { return }
+ if (refDestructuringErrors.trailingComma > -1)
+ { this.raiseRecoverable(refDestructuringErrors.trailingComma, "Comma is not permitted after the rest element"); }
+ var parens = isAssign ? refDestructuringErrors.parenthesizedAssign : refDestructuringErrors.parenthesizedBind;
+ if (parens > -1) { this.raiseRecoverable(parens, "Parenthesized pattern"); }
+ };
+
+ pp.checkExpressionErrors = function(refDestructuringErrors, andThrow) {
+ if (!refDestructuringErrors) { return false }
+ var shorthandAssign = refDestructuringErrors.shorthandAssign;
+ var doubleProto = refDestructuringErrors.doubleProto;
+ if (!andThrow) { return shorthandAssign >= 0 || doubleProto >= 0 }
+ if (shorthandAssign >= 0)
+ { this.raise(shorthandAssign, "Shorthand property assignments are valid only in destructuring patterns"); }
+ if (doubleProto >= 0)
+ { this.raiseRecoverable(doubleProto, "Redefinition of __proto__ property"); }
+ };
+
+ pp.checkYieldAwaitInDefaultParams = function() {
+ if (this.yieldPos && (!this.awaitPos || this.yieldPos < this.awaitPos))
+ { this.raise(this.yieldPos, "Yield expression cannot be a default value"); }
+ if (this.awaitPos)
+ { this.raise(this.awaitPos, "Await expression cannot be a default value"); }
+ };
+
+ pp.isSimpleAssignTarget = function(expr) {
+ if (expr.type === "ParenthesizedExpression")
+ { return this.isSimpleAssignTarget(expr.expression) }
+ return expr.type === "Identifier" || expr.type === "MemberExpression"
+ };
+
+ var pp$1 = Parser.prototype;
+
+ // ### Statement parsing
+
+ // Parse a program. Initializes the parser, reads any number of
+ // statements, and wraps them in a Program node. Optionally takes a
+ // `program` argument. If present, the statements will be appended
+ // to its body instead of creating a new node.
+
+ pp$1.parseTopLevel = function(node) {
+ var exports = {};
+ if (!node.body) { node.body = []; }
+ while (this.type !== types.eof) {
+ var stmt = this.parseStatement(null, true, exports);
+ node.body.push(stmt);
+ }
+ if (this.inModule)
+ { for (var i = 0, list = Object.keys(this.undefinedExports); i < list.length; i += 1)
+ {
+ var name = list[i];
+
+ this.raiseRecoverable(this.undefinedExports[name].start, ("Export '" + name + "' is not defined"));
+ } }
+ this.adaptDirectivePrologue(node.body);
+ this.next();
+ node.sourceType = this.options.sourceType;
+ return this.finishNode(node, "Program")
+ };
+
+ var loopLabel = {kind: "loop"}, switchLabel = {kind: "switch"};
+
+ pp$1.isLet = function(context) {
+ if (this.options.ecmaVersion < 6 || !this.isContextual("let")) { return false }
+ skipWhiteSpace.lastIndex = this.pos;
+ var skip = skipWhiteSpace.exec(this.input);
+ var next = this.pos + skip[0].length, nextCh = this.input.charCodeAt(next);
+ // For ambiguous cases, determine if a LexicalDeclaration (or only a
+ // Statement) is allowed here. If context is not empty then only a Statement
+ // is allowed. However, `let [` is an explicit negative lookahead for
+ // ExpressionStatement, so special-case it first.
+ if (nextCh === 91) { return true } // '['
+ if (context) { return false }
+
+ if (nextCh === 123) { return true } // '{'
+ if (isIdentifierStart(nextCh, true)) {
+ var pos = next + 1;
+ while (isIdentifierChar(this.input.charCodeAt(pos), true)) { ++pos; }
+ var ident = this.input.slice(next, pos);
+ if (!keywordRelationalOperator.test(ident)) { return true }
+ }
+ return false
+ };
+
+ // check 'async [no LineTerminator here] function'
+ // - 'async /*foo*/ function' is OK.
+ // - 'async /*\n*/ function' is invalid.
+ pp$1.isAsyncFunction = function() {
+ if (this.options.ecmaVersion < 8 || !this.isContextual("async"))
+ { return false }
+
+ skipWhiteSpace.lastIndex = this.pos;
+ var skip = skipWhiteSpace.exec(this.input);
+ var next = this.pos + skip[0].length;
+ return !lineBreak.test(this.input.slice(this.pos, next)) &&
+ this.input.slice(next, next + 8) === "function" &&
+ (next + 8 === this.input.length || !isIdentifierChar(this.input.charAt(next + 8)))
+ };
+
+ // Parse a single statement.
+ //
+ // If expecting a statement and finding a slash operator, parse a
+ // regular expression literal. This is to handle cases like
+ // `if (foo) /blah/.exec(foo)`, where looking at the previous token
+ // does not help.
+
+ pp$1.parseStatement = function(context, topLevel, exports) {
+ var starttype = this.type, node = this.startNode(), kind;
+
+ if (this.isLet(context)) {
+ starttype = types._var;
+ kind = "let";
+ }
+
+ // Most types of statements are recognized by the keyword they
+ // start with. Many are trivial to parse, some require a bit of
+ // complexity.
+
+ 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:
+ // Function as sole body of either an if statement or a labeled statement
+ // works, but not when it is part of a labeled statement that is the sole
+ // body of an if statement.
+ if ((context && (this.strict || context !== "if" && context !== "label")) && this.options.ecmaVersion >= 6) { this.unexpected(); }
+ 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.value;
+ if (context && kind !== "var") { this.unexpected(); }
+ 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(true, node)
+ case types.semi: return this.parseEmptyStatement(node)
+ case types._export:
+ case types._import:
+ if (this.options.ecmaVersion > 10 && starttype === types._import) {
+ skipWhiteSpace.lastIndex = this.pos;
+ var skip = skipWhiteSpace.exec(this.input);
+ var next = this.pos + skip[0].length, nextCh = this.input.charCodeAt(next);
+ if (nextCh === 40 || nextCh === 46) // '(' or '.'
+ { return this.parseExpressionStatement(node, this.parseExpression()) }
+ }
+
+ if (!this.options.allowImportExportEverywhere) {
+ if (!topLevel)
+ { this.raise(this.start, "'import' and 'export' may only appear at the top level"); }
+ if (!this.inModule)
+ { this.raise(this.start, "'import' and 'export' may appear only with 'sourceType: module'"); }
+ }
+ return starttype === types._import ? this.parseImport(node) : this.parseExport(node, exports)
+
+ // If the statement does not start with a statement keyword or a
+ // brace, it's an ExpressionStatement or LabeledStatement. We
+ // simply start parsing an expression, and afterwards, if the
+ // next token is a colon and the expression was a simple
+ // Identifier node, we switch to interpreting it as a label.
+ default:
+ if (this.isAsyncFunction()) {
+ if (context) { this.unexpected(); }
+ this.next();
+ return this.parseFunctionStatement(node, true, !context)
+ }
+
+ var maybeName = this.value, 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) }
+ }
+ };
+
+ pp$1.parseBreakContinueStatement = function(node, keyword) {
+ var isBreak = keyword === "break";
+ this.next();
+ if (this.eat(types.semi) || this.insertSemicolon()) { node.label = null; }
+ else if (this.type !== types.name) { this.unexpected(); }
+ else {
+ node.label = this.parseIdent();
+ this.semicolon();
+ }
+
+ // Verify that there is an actual destination to break or
+ // continue to.
+ var i = 0;
+ for (; i < this.labels.length; ++i) {
+ var lab = this.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.labels.length) { this.raise(node.start, "Unsyntactic " + keyword); }
+ return this.finishNode(node, isBreak ? "BreakStatement" : "ContinueStatement")
+ };
+
+ pp$1.parseDebuggerStatement = function(node) {
+ this.next();
+ this.semicolon();
+ return this.finishNode(node, "DebuggerStatement")
+ };
+
+ pp$1.parseDoStatement = function(node) {
+ this.next();
+ this.labels.push(loopLabel);
+ node.body = this.parseStatement("do");
+ this.labels.pop();
+ this.expect(types._while);
+ node.test = this.parseParenExpression();
+ if (this.options.ecmaVersion >= 6)
+ { this.eat(types.semi); }
+ else
+ { this.semicolon(); }
+ return this.finishNode(node, "DoWhileStatement")
+ };
+
+ // Disambiguating between a `for` and a `for`/`in` or `for`/`of`
+ // loop is non-trivial. Basically, we have to parse the init `var`
+ // statement or expression, disallowing the `in` operator (see
+ // the second parameter to `parseExpression`), and then check
+ // whether the next token is `in` or `of`. When there is no init
+ // part (semicolon immediately after the opening parenthesis), it
+ // is a regular `for` loop.
+
+ pp$1.parseForStatement = function(node) {
+ this.next();
+ var awaitAt = (this.options.ecmaVersion >= 9 && (this.inAsync || (!this.inFunction && this.options.allowAwaitOutsideFunction)) && this.eatContextual("await")) ? this.lastTokStart : -1;
+ this.labels.push(loopLabel);
+ this.enterScope(0);
+ this.expect(types.parenL);
+ if (this.type === types.semi) {
+ if (awaitAt > -1) { this.unexpected(awaitAt); }
+ return this.parseFor(node, null)
+ }
+ var isLet = this.isLet();
+ if (this.type === types._var || this.type === types._const || isLet) {
+ var init$1 = this.startNode(), kind = isLet ? "let" : this.value;
+ this.next();
+ this.parseVar(init$1, true, kind);
+ this.finishNode(init$1, "VariableDeclaration");
+ if ((this.type === types._in || (this.options.ecmaVersion >= 6 && this.isContextual("of"))) && init$1.declarations.length === 1) {
+ if (this.options.ecmaVersion >= 9) {
+ if (this.type === types._in) {
+ if (awaitAt > -1) { this.unexpected(awaitAt); }
+ } else { node.await = awaitAt > -1; }
+ }
+ return this.parseForIn(node, init$1)
+ }
+ if (awaitAt > -1) { this.unexpected(awaitAt); }
+ return this.parseFor(node, init$1)
+ }
+ var refDestructuringErrors = new DestructuringErrors;
+ var init = this.parseExpression(true, refDestructuringErrors);
+ if (this.type === types._in || (this.options.ecmaVersion >= 6 && this.isContextual("of"))) {
+ if (this.options.ecmaVersion >= 9) {
+ if (this.type === types._in) {
+ if (awaitAt > -1) { this.unexpected(awaitAt); }
+ } else { node.await = awaitAt > -1; }
+ }
+ this.toAssignable(init, false, refDestructuringErrors);
+ this.checkLValPattern(init);
+ return this.parseForIn(node, init)
+ } else {
+ this.checkExpressionErrors(refDestructuringErrors, true);
+ }
+ if (awaitAt > -1) { this.unexpected(awaitAt); }
+ return this.parseFor(node, init)
+ };
+
+ pp$1.parseFunctionStatement = function(node, isAsync, declarationPosition) {
+ this.next();
+ return this.parseFunction(node, FUNC_STATEMENT | (declarationPosition ? 0 : FUNC_HANGING_STATEMENT), false, isAsync)
+ };
+
+ pp$1.parseIfStatement = function(node) {
+ this.next();
+ node.test = this.parseParenExpression();
+ // allow function declarations in branches, but only in non-strict mode
+ node.consequent = this.parseStatement("if");
+ node.alternate = this.eat(types._else) ? this.parseStatement("if") : null;
+ return this.finishNode(node, "IfStatement")
+ };
+
+ pp$1.parseReturnStatement = function(node) {
+ if (!this.inFunction && !this.options.allowReturnOutsideFunction)
+ { this.raise(this.start, "'return' outside of function"); }
+ this.next();
+
+ // In `return` (and `break`/`continue`), the keywords with
+ // optional arguments, we eagerly look for a semicolon or the
+ // possibility to insert one.
+
+ if (this.eat(types.semi) || this.insertSemicolon()) { node.argument = null; }
+ else { node.argument = this.parseExpression(); this.semicolon(); }
+ return this.finishNode(node, "ReturnStatement")
+ };
+
+ pp$1.parseSwitchStatement = function(node) {
+ this.next();
+ node.discriminant = this.parseParenExpression();
+ node.cases = [];
+ this.expect(types.braceL);
+ this.labels.push(switchLabel);
+ this.enterScope(0);
+
+ // Statements under must be grouped (by label) in SwitchCase
+ // nodes. `cur` is used to keep the node that we are currently
+ // adding statements to.
+
+ var cur;
+ for (var sawDefault = false; this.type !== types.braceR;) {
+ if (this.type === types._case || this.type === types._default) {
+ var isCase = this.type === types._case;
+ if (cur) { this.finishNode(cur, "SwitchCase"); }
+ node.cases.push(cur = this.startNode());
+ cur.consequent = [];
+ this.next();
+ if (isCase) {
+ cur.test = this.parseExpression();
+ } else {
+ if (sawDefault) { this.raiseRecoverable(this.lastTokStart, "Multiple default clauses"); }
+ sawDefault = true;
+ cur.test = null;
+ }
+ this.expect(types.colon);
+ } else {
+ if (!cur) { this.unexpected(); }
+ cur.consequent.push(this.parseStatement(null));
+ }
+ }
+ this.exitScope();
+ if (cur) { this.finishNode(cur, "SwitchCase"); }
+ this.next(); // Closing brace
+ this.labels.pop();
+ return this.finishNode(node, "SwitchStatement")
+ };
+
+ pp$1.parseThrowStatement = function(node) {
+ this.next();
+ if (lineBreak.test(this.input.slice(this.lastTokEnd, this.start)))
+ { this.raise(this.lastTokEnd, "Illegal newline after throw"); }
+ node.argument = this.parseExpression();
+ this.semicolon();
+ return this.finishNode(node, "ThrowStatement")
+ };
+
+ // Reused empty array added for node fields that are always empty.
+
+ var empty = [];
+
+ pp$1.parseTryStatement = function(node) {
+ this.next();
+ node.block = this.parseBlock();
+ node.handler = null;
+ if (this.type === types._catch) {
+ var clause = this.startNode();
+ this.next();
+ if (this.eat(types.parenL)) {
+ clause.param = this.parseBindingAtom();
+ var simple = clause.param.type === "Identifier";
+ this.enterScope(simple ? SCOPE_SIMPLE_CATCH : 0);
+ this.checkLValPattern(clause.param, simple ? BIND_SIMPLE_CATCH : BIND_LEXICAL);
+ this.expect(types.parenR);
+ } else {
+ if (this.options.ecmaVersion < 10) { this.unexpected(); }
+ clause.param = null;
+ this.enterScope(0);
+ }
+ clause.body = this.parseBlock(false);
+ this.exitScope();
+ 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")
+ };
+
+ pp$1.parseVarStatement = function(node, kind) {
+ this.next();
+ this.parseVar(node, false, kind);
+ this.semicolon();
+ return this.finishNode(node, "VariableDeclaration")
+ };
+
+ pp$1.parseWhileStatement = function(node) {
+ this.next();
+ node.test = this.parseParenExpression();
+ this.labels.push(loopLabel);
+ node.body = this.parseStatement("while");
+ this.labels.pop();
+ return this.finishNode(node, "WhileStatement")
+ };
+
+ pp$1.parseWithStatement = function(node) {
+ if (this.strict) { this.raise(this.start, "'with' in strict mode"); }
+ this.next();
+ node.object = this.parseParenExpression();
+ node.body = this.parseStatement("with");
+ return this.finishNode(node, "WithStatement")
+ };
+
+ pp$1.parseEmptyStatement = function(node) {
+ this.next();
+ return this.finishNode(node, "EmptyStatement")
+ };
+
+ pp$1.parseLabeledStatement = function(node, maybeName, expr, context) {
+ for (var i$1 = 0, list = this.labels; i$1 < list.length; i$1 += 1)
+ {
+ var label = list[i$1];
+
+ if (label.name === maybeName)
+ { this.raise(expr.start, "Label '" + maybeName + "' is already declared");
+ } }
+ var kind = this.type.isLoop ? "loop" : this.type === types._switch ? "switch" : null;
+ for (var i = this.labels.length - 1; i >= 0; i--) {
+ var label$1 = this.labels[i];
+ if (label$1.statementStart === node.start) {
+ // Update information about previous labels on this node
+ label$1.statementStart = this.start;
+ label$1.kind = kind;
+ } else { break }
+ }
+ this.labels.push({name: maybeName, kind: kind, statementStart: this.start});
+ node.body = this.parseStatement(context ? context.indexOf("label") === -1 ? context + "label" : context : "label");
+ this.labels.pop();
+ node.label = expr;
+ return this.finishNode(node, "LabeledStatement")
+ };
+
+ pp$1.parseExpressionStatement = function(node, expr) {
+ node.expression = expr;
+ this.semicolon();
+ return this.finishNode(node, "ExpressionStatement")
+ };
+
+ // Parse a semicolon-enclosed block of statements, handling `"use
+ // strict"` declarations when `allowStrict` is true (used for
+ // function bodies).
+
+ pp$1.parseBlock = function(createNewLexicalScope, node, exitStrict) {
+ if ( createNewLexicalScope === void 0 ) createNewLexicalScope = true;
+ if ( node === void 0 ) node = this.startNode();
+
+ node.body = [];
+ this.expect(types.braceL);
+ if (createNewLexicalScope) { this.enterScope(0); }
+ while (this.type !== types.braceR) {
+ var stmt = this.parseStatement(null);
+ node.body.push(stmt);
+ }
+ if (exitStrict) { this.strict = false; }
+ this.next();
+ if (createNewLexicalScope) { this.exitScope(); }
+ return this.finishNode(node, "BlockStatement")
+ };
+
+ // Parse a regular `for` loop. The disambiguation code in
+ // `parseStatement` will already have parsed the init statement or
+ // expression.
+
+ pp$1.parseFor = function(node, init) {
+ node.init = init;
+ this.expect(types.semi);
+ node.test = this.type === types.semi ? null : this.parseExpression();
+ this.expect(types.semi);
+ node.update = this.type === types.parenR ? null : this.parseExpression();
+ this.expect(types.parenR);
+ node.body = this.parseStatement("for");
+ this.exitScope();
+ this.labels.pop();
+ return this.finishNode(node, "ForStatement")
+ };
+
+ // Parse a `for`/`in` and `for`/`of` loop, which are almost
+ // same from parser's perspective.
+
+ pp$1.parseForIn = function(node, init) {
+ var isForIn = this.type === types._in;
+ this.next();
+
+ if (
+ init.type === "VariableDeclaration" &&
+ init.declarations[0].init != null &&
+ (
+ !isForIn ||
+ this.options.ecmaVersion < 8 ||
+ this.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")
+ );
+ }
+ node.left = init;
+ node.right = isForIn ? this.parseExpression() : this.parseMaybeAssign();
+ this.expect(types.parenR);
+ node.body = this.parseStatement("for");
+ this.exitScope();
+ this.labels.pop();
+ return this.finishNode(node, isForIn ? "ForInStatement" : "ForOfStatement")
+ };
+
+ // Parse a list of variable declarations.
+
+ pp$1.parseVar = function(node, isFor, kind) {
+ node.declarations = [];
+ node.kind = kind;
+ for (;;) {
+ var decl = this.startNode();
+ this.parseVarId(decl, kind);
+ if (this.eat(types.eq)) {
+ decl.init = this.parseMaybeAssign(isFor);
+ } else if (kind === "const" && !(this.type === types._in || (this.options.ecmaVersion >= 6 && this.isContextual("of")))) {
+ this.unexpected();
+ } else if (decl.id.type !== "Identifier" && !(isFor && (this.type === types._in || this.isContextual("of")))) {
+ this.raise(this.lastTokEnd, "Complex binding patterns require an initialization value");
+ } else {
+ decl.init = null;
+ }
+ node.declarations.push(this.finishNode(decl, "VariableDeclarator"));
+ if (!this.eat(types.comma)) { break }
+ }
+ return node
+ };
+
+ pp$1.parseVarId = function(decl, kind) {
+ decl.id = this.parseBindingAtom();
+ this.checkLValPattern(decl.id, kind === "var" ? BIND_VAR : BIND_LEXICAL, false);
+ };
+
+ var FUNC_STATEMENT = 1, FUNC_HANGING_STATEMENT = 2, FUNC_NULLABLE_ID = 4;
+
+ // Parse a function declaration or literal (depending on the
+ // `statement & FUNC_STATEMENT`).
+
+ // Remove `allowExpressionBody` for 7.0.0, as it is only called with false
+ pp$1.parseFunction = function(node, statement, allowExpressionBody, isAsync) {
+ this.initFunction(node);
+ if (this.options.ecmaVersion >= 9 || this.options.ecmaVersion >= 6 && !isAsync) {
+ if (this.type === types.star && (statement & FUNC_HANGING_STATEMENT))
+ { this.unexpected(); }
+ node.generator = this.eat(types.star);
+ }
+ if (this.options.ecmaVersion >= 8)
+ { node.async = !!isAsync; }
+
+ if (statement & FUNC_STATEMENT) {
+ node.id = (statement & FUNC_NULLABLE_ID) && this.type !== types.name ? null : this.parseIdent();
+ if (node.id && !(statement & FUNC_HANGING_STATEMENT))
+ // If it is a regular function declaration in sloppy mode, then it is
+ // subject to Annex B semantics (BIND_FUNCTION). Otherwise, the binding
+ // mode depends on properties of the current scope (see
+ // treatFunctionsAsVar).
+ { this.checkLValSimple(node.id, (this.strict || node.generator || node.async) ? this.treatFunctionsAsVar ? BIND_VAR : BIND_LEXICAL : BIND_FUNCTION); }
+ }
+
+ var oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos;
+ this.yieldPos = 0;
+ this.awaitPos = 0;
+ this.awaitIdentPos = 0;
+ this.enterScope(functionFlags(node.async, node.generator));
+
+ if (!(statement & FUNC_STATEMENT))
+ { node.id = this.type === types.name ? this.parseIdent() : null; }
+
+ this.parseFunctionParams(node);
+ this.parseFunctionBody(node, allowExpressionBody, false);
+
+ this.yieldPos = oldYieldPos;
+ this.awaitPos = oldAwaitPos;
+ this.awaitIdentPos = oldAwaitIdentPos;
+ return this.finishNode(node, (statement & FUNC_STATEMENT) ? "FunctionDeclaration" : "FunctionExpression")
+ };
+
+ pp$1.parseFunctionParams = function(node) {
+ this.expect(types.parenL);
+ node.params = this.parseBindingList(types.parenR, false, this.options.ecmaVersion >= 8);
+ this.checkYieldAwaitInDefaultParams();
+ };
+
+ // Parse a class declaration or literal (depending on the
+ // `isStatement` parameter).
+
+ pp$1.parseClass = function(node, isStatement) {
+ this.next();
+
+ // ecma-262 14.6 Class Definitions
+ // A class definition is always strict mode code.
+ var oldStrict = this.strict;
+ this.strict = true;
+
+ this.parseClassId(node, isStatement);
+ this.parseClassSuper(node);
+ var classBody = this.startNode();
+ var hadConstructor = false;
+ classBody.body = [];
+ this.expect(types.braceL);
+ while (this.type !== types.braceR) {
+ var element = this.parseClassElement(node.superClass !== null);
+ if (element) {
+ classBody.body.push(element);
+ if (element.type === "MethodDefinition" && element.kind === "constructor") {
+ if (hadConstructor) { this.raise(element.start, "Duplicate constructor in the same class"); }
+ hadConstructor = true;
+ }
+ }
+ }
+ this.strict = oldStrict;
+ this.next();
+ node.body = this.finishNode(classBody, "ClassBody");
+ return this.finishNode(node, isStatement ? "ClassDeclaration" : "ClassExpression")
+ };
+
+ pp$1.parseClassElement = function(constructorAllowsSuper) {
+ var this$1 = this;
+
+ if (this.eat(types.semi)) { return null }
+
+ var method = this.startNode();
+ var tryContextual = function (k, noLineBreak) {
+ if ( noLineBreak === void 0 ) noLineBreak = false;
+
+ var start = this$1.start, startLoc = this$1.startLoc;
+ if (!this$1.eatContextual(k)) { return false }
+ if (this$1.type !== types.parenL && (!noLineBreak || !this$1.canInsertSemicolon())) { return true }
+ if (method.key) { this$1.unexpected(); }
+ method.computed = false;
+ method.key = this$1.startNodeAt(start, startLoc);
+ method.key.name = k;
+ this$1.finishNode(method.key, "Identifier");
+ return false
+ };
+
+ method.kind = "method";
+ method.static = tryContextual("static");
+ var isGenerator = this.eat(types.star);
+ var isAsync = false;
+ if (!isGenerator) {
+ if (this.options.ecmaVersion >= 8 && tryContextual("async", true)) {
+ isAsync = true;
+ isGenerator = this.options.ecmaVersion >= 9 && this.eat(types.star);
+ } else if (tryContextual("get")) {
+ method.kind = "get";
+ } else if (tryContextual("set")) {
+ method.kind = "set";
+ }
+ }
+ if (!method.key) { this.parsePropertyName(method); }
+ var key = method.key;
+ var allowsDirectSuper = false;
+ if (!method.computed && !method.static && (key.type === "Identifier" && key.name === "constructor" ||
+ key.type === "Literal" && key.value === "constructor")) {
+ if (method.kind !== "method") { this.raise(key.start, "Constructor can't have get/set modifier"); }
+ if (isGenerator) { this.raise(key.start, "Constructor can't be a generator"); }
+ if (isAsync) { this.raise(key.start, "Constructor can't be an async method"); }
+ method.kind = "constructor";
+ allowsDirectSuper = constructorAllowsSuper;
+ } else if (method.static && key.type === "Identifier" && key.name === "prototype") {
+ this.raise(key.start, "Classes may not have a static property named prototype");
+ }
+ this.parseClassMethod(method, isGenerator, isAsync, allowsDirectSuper);
+ if (method.kind === "get" && method.value.params.length !== 0)
+ { this.raiseRecoverable(method.value.start, "getter should have no params"); }
+ if (method.kind === "set" && method.value.params.length !== 1)
+ { this.raiseRecoverable(method.value.start, "setter should have exactly one param"); }
+ if (method.kind === "set" && method.value.params[0].type === "RestElement")
+ { this.raiseRecoverable(method.value.params[0].start, "Setter cannot use rest params"); }
+ return method
+ };
+
+ pp$1.parseClassMethod = function(method, isGenerator, isAsync, allowsDirectSuper) {
+ method.value = this.parseMethod(isGenerator, isAsync, allowsDirectSuper);
+ return this.finishNode(method, "MethodDefinition")
+ };
+
+ pp$1.parseClassId = function(node, isStatement) {
+ if (this.type === types.name) {
+ node.id = this.parseIdent();
+ if (isStatement)
+ { this.checkLValSimple(node.id, BIND_LEXICAL, false); }
+ } else {
+ if (isStatement === true)
+ { this.unexpected(); }
+ node.id = null;
+ }
+ };
+
+ pp$1.parseClassSuper = function(node) {
+ node.superClass = this.eat(types._extends) ? this.parseExprSubscripts() : null;
+ };
+
+ // Parses module export declaration.
+
+ pp$1.parseExport = function(node, exports) {
+ this.next();
+ // export * from '...'
+ if (this.eat(types.star)) {
+ if (this.options.ecmaVersion >= 11) {
+ if (this.eatContextual("as")) {
+ node.exported = this.parseIdent(true);
+ this.checkExport(exports, node.exported.name, this.lastTokStart);
+ } else {
+ node.exported = null;
+ }
+ }
+ this.expectContextual("from");
+ if (this.type !== types.string) { this.unexpected(); }
+ node.source = this.parseExprAtom();
+ this.semicolon();
+ return this.finishNode(node, "ExportAllDeclaration")
+ }
+ if (this.eat(types._default)) { // export default ...
+ this.checkExport(exports, "default", this.lastTokStart);
+ var isAsync;
+ if (this.type === types._function || (isAsync = this.isAsyncFunction())) {
+ var fNode = this.startNode();
+ this.next();
+ if (isAsync) { this.next(); }
+ node.declaration = this.parseFunction(fNode, FUNC_STATEMENT | FUNC_NULLABLE_ID, false, isAsync);
+ } else if (this.type === types._class) {
+ var cNode = this.startNode();
+ node.declaration = this.parseClass(cNode, "nullableID");
+ } else {
+ node.declaration = this.parseMaybeAssign();
+ this.semicolon();
+ }
+ return this.finishNode(node, "ExportDefaultDeclaration")
+ }
+ // export var|const|let|function|class ...
+ if (this.shouldParseExportStatement()) {
+ node.declaration = this.parseStatement(null);
+ if (node.declaration.type === "VariableDeclaration")
+ { this.checkVariableExport(exports, node.declaration.declarations); }
+ else
+ { this.checkExport(exports, node.declaration.id.name, node.declaration.id.start); }
+ node.specifiers = [];
+ node.source = null;
+ } else { // export { x, y as z } [from '...']
+ node.declaration = null;
+ node.specifiers = this.parseExportSpecifiers(exports);
+ if (this.eatContextual("from")) {
+ if (this.type !== types.string) { this.unexpected(); }
+ node.source = this.parseExprAtom();
+ } else {
+ for (var i = 0, list = node.specifiers; i < list.length; i += 1) {
+ // check for keywords used as local names
+ var spec = list[i];
+
+ this.checkUnreserved(spec.local);
+ // check if export is defined
+ this.checkLocalExport(spec.local);
+ }
+
+ node.source = null;
+ }
+ this.semicolon();
+ }
+ return this.finishNode(node, "ExportNamedDeclaration")
+ };
+
+ pp$1.checkExport = function(exports, name, pos) {
+ if (!exports) { return }
+ if (has(exports, name))
+ { this.raiseRecoverable(pos, "Duplicate export '" + name + "'"); }
+ exports[name] = true;
+ };
+
+ pp$1.checkPatternExport = function(exports, pat) {
+ var type = pat.type;
+ if (type === "Identifier")
+ { this.checkExport(exports, pat.name, pat.start); }
+ else if (type === "ObjectPattern")
+ { for (var i = 0, list = pat.properties; i < list.length; i += 1)
+ {
+ var prop = list[i];
+
+ this.checkPatternExport(exports, prop);
+ } }
+ else if (type === "ArrayPattern")
+ { for (var i$1 = 0, list$1 = pat.elements; i$1 < list$1.length; i$1 += 1) {
+ var elt = list$1[i$1];
+
+ if (elt) { this.checkPatternExport(exports, elt); }
+ } }
+ else if (type === "Property")
+ { this.checkPatternExport(exports, pat.value); }
+ else if (type === "AssignmentPattern")
+ { this.checkPatternExport(exports, pat.left); }
+ else if (type === "RestElement")
+ { this.checkPatternExport(exports, pat.argument); }
+ else if (type === "ParenthesizedExpression")
+ { this.checkPatternExport(exports, pat.expression); }
+ };
+
+ pp$1.checkVariableExport = function(exports, decls) {
+ if (!exports) { return }
+ for (var i = 0, list = decls; i < list.length; i += 1)
+ {
+ var decl = list[i];
+
+ this.checkPatternExport(exports, decl.id);
+ }
+ };
+
+ pp$1.shouldParseExportStatement = function() {
+ return this.type.keyword === "var" ||
+ this.type.keyword === "const" ||
+ this.type.keyword === "class" ||
+ this.type.keyword === "function" ||
+ this.isLet() ||
+ this.isAsyncFunction()
+ };
+
+ // Parses a comma-separated list of module exports.
+
+ pp$1.parseExportSpecifiers = function(exports) {
+ var nodes = [], first = true;
+ // export { x, y as z } [from '...']
+ this.expect(types.braceL);
+ while (!this.eat(types.braceR)) {
+ if (!first) {
+ this.expect(types.comma);
+ if (this.afterTrailingComma(types.braceR)) { break }
+ } else { first = false; }
+
+ var node = this.startNode();
+ node.local = this.parseIdent(true);
+ node.exported = this.eatContextual("as") ? this.parseIdent(true) : node.local;
+ this.checkExport(exports, node.exported.name, node.exported.start);
+ nodes.push(this.finishNode(node, "ExportSpecifier"));
+ }
+ return nodes
+ };
+
+ // Parses import declaration.
+
+ pp$1.parseImport = function(node) {
+ this.next();
+ // import '...'
+ if (this.type === types.string) {
+ node.specifiers = empty;
+ node.source = this.parseExprAtom();
+ } else {
+ node.specifiers = this.parseImportSpecifiers();
+ this.expectContextual("from");
+ node.source = this.type === types.string ? this.parseExprAtom() : this.unexpected();
+ }
+ this.semicolon();
+ return this.finishNode(node, "ImportDeclaration")
+ };
+
+ // Parses a comma-separated list of module imports.
+
+ pp$1.parseImportSpecifiers = function() {
+ var nodes = [], first = true;
+ if (this.type === types.name) {
+ // import defaultObj, { x, y as z } from '...'
+ var node = this.startNode();
+ node.local = this.parseIdent();
+ this.checkLValSimple(node.local, BIND_LEXICAL);
+ nodes.push(this.finishNode(node, "ImportDefaultSpecifier"));
+ if (!this.eat(types.comma)) { return nodes }
+ }
+ if (this.type === types.star) {
+ var node$1 = this.startNode();
+ this.next();
+ this.expectContextual("as");
+ node$1.local = this.parseIdent();
+ this.checkLValSimple(node$1.local, BIND_LEXICAL);
+ nodes.push(this.finishNode(node$1, "ImportNamespaceSpecifier"));
+ return nodes
+ }
+ this.expect(types.braceL);
+ while (!this.eat(types.braceR)) {
+ if (!first) {
+ this.expect(types.comma);
+ if (this.afterTrailingComma(types.braceR)) { break }
+ } else { first = false; }
+
+ var node$2 = this.startNode();
+ node$2.imported = this.parseIdent(true);
+ if (this.eatContextual("as")) {
+ node$2.local = this.parseIdent();
+ } else {
+ this.checkUnreserved(node$2.imported);
+ node$2.local = node$2.imported;
+ }
+ this.checkLValSimple(node$2.local, BIND_LEXICAL);
+ nodes.push(this.finishNode(node$2, "ImportSpecifier"));
+ }
+ return nodes
+ };
+
+ // Set `ExpressionStatement#directive` property for directive prologues.
+ pp$1.adaptDirectivePrologue = function(statements) {
+ for (var i = 0; i < statements.length && this.isDirectiveCandidate(statements[i]); ++i) {
+ statements[i].directive = statements[i].expression.raw.slice(1, -1);
+ }
+ };
+ pp$1.isDirectiveCandidate = function(statement) {
+ return (
+ statement.type === "ExpressionStatement" &&
+ statement.expression.type === "Literal" &&
+ typeof statement.expression.value === "string" &&
+ // Reject parenthesized strings.
+ (this.input[statement.start] === "\"" || this.input[statement.start] === "'")
+ )
+ };
+
+ var pp$2 = Parser.prototype;
+
+ // Convert existing expression atom to assignable pattern
+ // if possible.
+
+ pp$2.toAssignable = function(node, isBinding, refDestructuringErrors) {
+ if (this.options.ecmaVersion >= 6 && node) {
+ switch (node.type) {
+ case "Identifier":
+ if (this.inAsync && node.name === "await")
+ { this.raise(node.start, "Cannot use 'await' as identifier inside an async function"); }
+ break
+
+ case "ObjectPattern":
+ case "ArrayPattern":
+ case "AssignmentPattern":
+ case "RestElement":
+ break
+
+ case "ObjectExpression":
+ node.type = "ObjectPattern";
+ if (refDestructuringErrors) { this.checkPatternErrors(refDestructuringErrors, true); }
+ for (var i = 0, list = node.properties; i < list.length; i += 1) {
+ var prop = list[i];
+
+ this.toAssignable(prop, isBinding);
+ // Early error:
+ // AssignmentRestProperty[Yield, Await] :
+ // `...` DestructuringAssignmentTarget[Yield, Await]
+ //
+ // It is a Syntax Error if |DestructuringAssignmentTarget| is an |ArrayLiteral| or an |ObjectLiteral|.
+ if (
+ prop.type === "RestElement" &&
+ (prop.argument.type === "ArrayPattern" || prop.argument.type === "ObjectPattern")
+ ) {
+ this.raise(prop.argument.start, "Unexpected token");
+ }
+ }
+ break
+
+ case "Property":
+ // AssignmentProperty has type === "Property"
+ if (node.kind !== "init") { this.raise(node.key.start, "Object pattern can't contain getter or setter"); }
+ this.toAssignable(node.value, isBinding);
+ break
+
+ case "ArrayExpression":
+ node.type = "ArrayPattern";
+ if (refDestructuringErrors) { this.checkPatternErrors(refDestructuringErrors, true); }
+ this.toAssignableList(node.elements, isBinding);
+ break
+
+ case "SpreadElement":
+ node.type = "RestElement";
+ this.toAssignable(node.argument, isBinding);
+ if (node.argument.type === "AssignmentPattern")
+ { this.raise(node.argument.start, "Rest elements cannot have a default value"); }
+ break
+
+ case "AssignmentExpression":
+ if (node.operator !== "=") { this.raise(node.left.end, "Only '=' operator can be used for specifying default value."); }
+ node.type = "AssignmentPattern";
+ delete node.operator;
+ this.toAssignable(node.left, isBinding);
+ break
+
+ case "ParenthesizedExpression":
+ this.toAssignable(node.expression, isBinding, refDestructuringErrors);
+ break
+
+ case "ChainExpression":
+ this.raiseRecoverable(node.start, "Optional chaining cannot appear in left-hand side");
+ break
+
+ case "MemberExpression":
+ if (!isBinding) { break }
+
+ default:
+ this.raise(node.start, "Assigning to rvalue");
+ }
+ } else if (refDestructuringErrors) { this.checkPatternErrors(refDestructuringErrors, true); }
+ return node
+ };
+
+ // Convert list of expression atoms to binding list.
+
+ pp$2.toAssignableList = function(exprList, isBinding) {
+ var end = exprList.length;
+ for (var i = 0; i < end; i++) {
+ var elt = exprList[i];
+ if (elt) { this.toAssignable(elt, isBinding); }
+ }
+ if (end) {
+ var last = exprList[end - 1];
+ if (this.options.ecmaVersion === 6 && isBinding && last && last.type === "RestElement" && last.argument.type !== "Identifier")
+ { this.unexpected(last.argument.start); }
+ }
+ return exprList
+ };
+
+ // Parses spread element.
+
+ pp$2.parseSpread = function(refDestructuringErrors) {
+ var node = this.startNode();
+ this.next();
+ node.argument = this.parseMaybeAssign(false, refDestructuringErrors);
+ return this.finishNode(node, "SpreadElement")
+ };
+
+ pp$2.parseRestBinding = function() {
+ var node = this.startNode();
+ this.next();
+
+ // RestElement inside of a function parameter must be an identifier
+ if (this.options.ecmaVersion === 6 && this.type !== types.name)
+ { this.unexpected(); }
+
+ node.argument = this.parseBindingAtom();
+
+ return this.finishNode(node, "RestElement")
+ };
+
+ // Parses lvalue (assignable) atom.
+
+ pp$2.parseBindingAtom = function() {
+ if (this.options.ecmaVersion >= 6) {
+ switch (this.type) {
+ case types.bracketL:
+ var node = this.startNode();
+ this.next();
+ node.elements = this.parseBindingList(types.bracketR, true, true);
+ return this.finishNode(node, "ArrayPattern")
+
+ case types.braceL:
+ return this.parseObj(true)
+ }
+ }
+ return this.parseIdent()
+ };
+
+ pp$2.parseBindingList = function(close, allowEmpty, allowTrailingComma) {
+ var elts = [], first = true;
+ while (!this.eat(close)) {
+ if (first) { first = false; }
+ else { this.expect(types.comma); }
+ if (allowEmpty && this.type === types.comma) {
+ elts.push(null);
+ } else if (allowTrailingComma && this.afterTrailingComma(close)) {
+ break
+ } else if (this.type === types.ellipsis) {
+ var rest = this.parseRestBinding();
+ this.parseBindingListItem(rest);
+ elts.push(rest);
+ if (this.type === types.comma) { this.raise(this.start, "Comma is not permitted after the rest element"); }
+ this.expect(close);
+ break
+ } else {
+ var elem = this.parseMaybeDefault(this.start, this.startLoc);
+ this.parseBindingListItem(elem);
+ elts.push(elem);
+ }
+ }
+ return elts
+ };
+
+ pp$2.parseBindingListItem = function(param) {
+ return param
+ };
+
+ // Parses assignment pattern around given atom if possible.
+
+ pp$2.parseMaybeDefault = function(startPos, startLoc, left) {
+ left = left || this.parseBindingAtom();
+ if (this.options.ecmaVersion < 6 || !this.eat(types.eq)) { return left }
+ var node = this.startNodeAt(startPos, startLoc);
+ node.left = left;
+ node.right = this.parseMaybeAssign();
+ return this.finishNode(node, "AssignmentPattern")
+ };
+
+ // The following three functions all verify that a node is an lvalue —
+ // something that can be bound, or assigned to. In order to do so, they perform
+ // a variety of checks:
+ //
+ // - Check that none of the bound/assigned-to identifiers are reserved words.
+ // - Record name declarations for bindings in the appropriate scope.
+ // - Check duplicate argument names, if checkClashes is set.
+ //
+ // If a complex binding pattern is encountered (e.g., object and array
+ // destructuring), the entire pattern is recursively checked.
+ //
+ // There are three versions of checkLVal*() appropriate for different
+ // circumstances:
+ //
+ // - checkLValSimple() shall be used if the syntactic construct supports
+ // nothing other than identifiers and member expressions. Parenthesized
+ // expressions are also correctly handled. This is generally appropriate for
+ // constructs for which the spec says
+ //
+ // > It is a Syntax Error if AssignmentTargetType of [the production] is not
+ // > simple.
+ //
+ // It is also appropriate for checking if an identifier is valid and not
+ // defined elsewhere, like import declarations or function/class identifiers.
+ //
+ // Examples where this is used include:
+ // a += …;
+ // import a from '…';
+ // where a is the node to be checked.
+ //
+ // - checkLValPattern() shall be used if the syntactic construct supports
+ // anything checkLValSimple() supports, as well as object and array
+ // destructuring patterns. This is generally appropriate for constructs for
+ // which the spec says
+ //
+ // > It is a Syntax Error if [the production] is neither an ObjectLiteral nor
+ // > an ArrayLiteral and AssignmentTargetType of [the production] is not
+ // > simple.
+ //
+ // Examples where this is used include:
+ // (a = …);
+ // const a = …;
+ // try { … } catch (a) { … }
+ // where a is the node to be checked.
+ //
+ // - checkLValInnerPattern() shall be used if the syntactic construct supports
+ // anything checkLValPattern() supports, as well as default assignment
+ // patterns, rest elements, and other constructs that may appear within an
+ // object or array destructuring pattern.
+ //
+ // As a special case, function parameters also use checkLValInnerPattern(),
+ // as they also support defaults and rest constructs.
+ //
+ // These functions deliberately support both assignment and binding constructs,
+ // as the logic for both is exceedingly similar. If the node is the target of
+ // an assignment, then bindingType should be set to BIND_NONE. Otherwise, it
+ // should be set to the appropriate BIND_* constant, like BIND_VAR or
+ // BIND_LEXICAL.
+ //
+ // If the function is called with a non-BIND_NONE bindingType, then
+ // additionally a checkClashes object may be specified to allow checking for
+ // duplicate argument names. checkClashes is ignored if the provided construct
+ // is an assignment (i.e., bindingType is BIND_NONE).
+
+ pp$2.checkLValSimple = function(expr, bindingType, checkClashes) {
+ if ( bindingType === void 0 ) bindingType = BIND_NONE;
+
+ var isBind = bindingType !== BIND_NONE;
+
+ switch (expr.type) {
+ case "Identifier":
+ if (this.strict && this.reservedWordsStrictBind.test(expr.name))
+ { this.raiseRecoverable(expr.start, (isBind ? "Binding " : "Assigning to ") + expr.name + " in strict mode"); }
+ if (isBind) {
+ if (bindingType === BIND_LEXICAL && expr.name === "let")
+ { this.raiseRecoverable(expr.start, "let is disallowed as a lexically bound name"); }
+ if (checkClashes) {
+ if (has(checkClashes, expr.name))
+ { this.raiseRecoverable(expr.start, "Argument name clash"); }
+ checkClashes[expr.name] = true;
+ }
+ if (bindingType !== BIND_OUTSIDE) { this.declareName(expr.name, bindingType, expr.start); }
+ }
+ break
+
+ case "ChainExpression":
+ this.raiseRecoverable(expr.start, "Optional chaining cannot appear in left-hand side");
+ break
+
+ case "MemberExpression":
+ if (isBind) { this.raiseRecoverable(expr.start, "Binding member expression"); }
+ break
+
+ case "ParenthesizedExpression":
+ if (isBind) { this.raiseRecoverable(expr.start, "Binding parenthesized expression"); }
+ return this.checkLValSimple(expr.expression, bindingType, checkClashes)
+
+ default:
+ this.raise(expr.start, (isBind ? "Binding" : "Assigning to") + " rvalue");
+ }
+ };
+
+ pp$2.checkLValPattern = function(expr, bindingType, checkClashes) {
+ if ( bindingType === void 0 ) bindingType = BIND_NONE;
+
+ switch (expr.type) {
+ case "ObjectPattern":
+ for (var i = 0, list = expr.properties; i < list.length; i += 1) {
+ var prop = list[i];
+
+ this.checkLValInnerPattern(prop, bindingType, checkClashes);
+ }
+ break
+
+ case "ArrayPattern":
+ for (var i$1 = 0, list$1 = expr.elements; i$1 < list$1.length; i$1 += 1) {
+ var elem = list$1[i$1];
+
+ if (elem) { this.checkLValInnerPattern(elem, bindingType, checkClashes); }
+ }
+ break
+
+ default:
+ this.checkLValSimple(expr, bindingType, checkClashes);
+ }
+ };
+
+ pp$2.checkLValInnerPattern = function(expr, bindingType, checkClashes) {
+ if ( bindingType === void 0 ) bindingType = BIND_NONE;
+
+ switch (expr.type) {
+ case "Property":
+ // AssignmentProperty has type === "Property"
+ this.checkLValInnerPattern(expr.value, bindingType, checkClashes);
+ break
+
+ case "AssignmentPattern":
+ this.checkLValPattern(expr.left, bindingType, checkClashes);
+ break
+
+ case "RestElement":
+ this.checkLValPattern(expr.argument, bindingType, checkClashes);
+ break
+
+ default:
+ this.checkLValPattern(expr, bindingType, checkClashes);
+ }
+ };
+
+ // A recursive descent parser operates by defining functions for all
+
+ var pp$3 = Parser.prototype;
+
+ // Check if property name clashes with already added.
+ // Object/class getters and setters are not allowed to clash —
+ // either with each other or with an init property — and in
+ // strict mode, init properties are also not allowed to be repeated.
+
+ pp$3.checkPropClash = function(prop, propHash, refDestructuringErrors) {
+ if (this.options.ecmaVersion >= 9 && prop.type === "SpreadElement")
+ { return }
+ if (this.options.ecmaVersion >= 6 && (prop.computed || prop.method || prop.shorthand))
+ { return }
+ var key = prop.key;
+ var name;
+ switch (key.type) {
+ case "Identifier": name = key.name; break
+ case "Literal": name = String(key.value); break
+ default: return
+ }
+ var kind = prop.kind;
+ if (this.options.ecmaVersion >= 6) {
+ if (name === "__proto__" && kind === "init") {
+ if (propHash.proto) {
+ if (refDestructuringErrors) {
+ if (refDestructuringErrors.doubleProto < 0)
+ { refDestructuringErrors.doubleProto = key.start; }
+ // Backwards-compat kludge. Can be removed in version 6.0
+ } else { this.raiseRecoverable(key.start, "Redefinition of __proto__ property"); }
+ }
+ propHash.proto = true;
+ }
+ return
+ }
+ name = "$" + name;
+ var other = propHash[name];
+ if (other) {
+ var redefinition;
+ if (kind === "init") {
+ redefinition = this.strict && other.init || other.get || other.set;
+ } else {
+ redefinition = other.init || other[kind];
+ }
+ if (redefinition)
+ { this.raiseRecoverable(key.start, "Redefinition of property"); }
+ } else {
+ other = propHash[name] = {
+ init: false,
+ get: false,
+ set: false
+ };
+ }
+ other[kind] = true;
+ };
+
+ // ### Expression parsing
+
+ // These nest, from the most general expression type at the top to
+ // 'atomic', nondivisible expression types at the bottom. Most of
+ // the functions will simply let the function(s) below them parse,
+ // and, *if* the syntactic construct they handle is present, wrap
+ // the AST node that the inner parser gave them in another node.
+
+ // Parse a full expression. The optional arguments are used to
+ // forbid the `in` operator (in for loops initalization expressions)
+ // and provide reference for storing '=' operator inside shorthand
+ // property assignment in contexts where both object expression
+ // and object pattern might appear (so it's possible to raise
+ // delayed syntax error at correct position).
+
+ pp$3.parseExpression = function(noIn, refDestructuringErrors) {
+ var startPos = this.start, startLoc = this.startLoc;
+ var expr = this.parseMaybeAssign(noIn, refDestructuringErrors);
+ if (this.type === types.comma) {
+ var node = this.startNodeAt(startPos, startLoc);
+ node.expressions = [expr];
+ while (this.eat(types.comma)) { node.expressions.push(this.parseMaybeAssign(noIn, refDestructuringErrors)); }
+ return this.finishNode(node, "SequenceExpression")
+ }
+ return expr
+ };
+
+ // Parse an assignment expression. This includes applications of
+ // operators like `+=`.
+
+ pp$3.parseMaybeAssign = function(noIn, refDestructuringErrors, afterLeftParse) {
+ if (this.isContextual("yield")) {
+ if (this.inGenerator) { return this.parseYield(noIn) }
+ // The tokenizer will assume an expression is allowed after
+ // `yield`, but this isn't that kind of yield
+ else { this.exprAllowed = false; }
+ }
+
+ var ownDestructuringErrors = false, oldParenAssign = -1, oldTrailingComma = -1;
+ if (refDestructuringErrors) {
+ oldParenAssign = refDestructuringErrors.parenthesizedAssign;
+ oldTrailingComma = refDestructuringErrors.trailingComma;
+ refDestructuringErrors.parenthesizedAssign = refDestructuringErrors.trailingComma = -1;
+ } else {
+ refDestructuringErrors = new DestructuringErrors;
+ ownDestructuringErrors = true;
+ }
+
+ var startPos = this.start, startLoc = this.startLoc;
+ if (this.type === types.parenL || this.type === types.name)
+ { this.potentialArrowAt = this.start; }
+ var left = this.parseMaybeConditional(noIn, refDestructuringErrors);
+ if (afterLeftParse) { left = afterLeftParse.call(this, left, startPos, startLoc); }
+ if (this.type.isAssign) {
+ var node = this.startNodeAt(startPos, startLoc);
+ node.operator = this.value;
+ if (this.type === types.eq)
+ { left = this.toAssignable(left, false, refDestructuringErrors); }
+ if (!ownDestructuringErrors) {
+ refDestructuringErrors.parenthesizedAssign = refDestructuringErrors.trailingComma = refDestructuringErrors.doubleProto = -1;
+ }
+ if (refDestructuringErrors.shorthandAssign >= left.start)
+ { refDestructuringErrors.shorthandAssign = -1; } // reset because shorthand default was used correctly
+ if (this.type === types.eq)
+ { this.checkLValPattern(left); }
+ else
+ { this.checkLValSimple(left); }
+ node.left = left;
+ this.next();
+ node.right = this.parseMaybeAssign(noIn);
+ return this.finishNode(node, "AssignmentExpression")
+ } else {
+ if (ownDestructuringErrors) { this.checkExpressionErrors(refDestructuringErrors, true); }
+ }
+ if (oldParenAssign > -1) { refDestructuringErrors.parenthesizedAssign = oldParenAssign; }
+ if (oldTrailingComma > -1) { refDestructuringErrors.trailingComma = oldTrailingComma; }
+ return left
+ };
+
+ // Parse a ternary conditional (`?:`) operator.
+
+ pp$3.parseMaybeConditional = function(noIn, refDestructuringErrors) {
+ var startPos = this.start, startLoc = this.startLoc;
+ var expr = this.parseExprOps(noIn, refDestructuringErrors);
+ if (this.checkExpressionErrors(refDestructuringErrors)) { return expr }
+ if (this.eat(types.question)) {
+ var 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
+ };
+
+ // Start the precedence parser.
+
+ pp$3.parseExprOps = function(noIn, refDestructuringErrors) {
+ var startPos = this.start, startLoc = this.startLoc;
+ var expr = this.parseMaybeUnary(refDestructuringErrors, false);
+ if (this.checkExpressionErrors(refDestructuringErrors)) { return expr }
+ return expr.start === startPos && expr.type === "ArrowFunctionExpression" ? expr : this.parseExprOp(expr, startPos, startLoc, -1, noIn)
+ };
+
+ // Parse binary operators with the operator precedence parsing
+ // algorithm. `left` is the left-hand side of the operator.
+ // `minPrec` provides context that allows the function to stop and
+ // defer further parser to one of its callers when it encounters an
+ // operator that has a lower precedence than the set it is parsing.
+
+ pp$3.parseExprOp = function(left, leftStartPos, leftStartLoc, minPrec, noIn) {
+ var prec = this.type.binop;
+ if (prec != null && (!noIn || this.type !== types._in)) {
+ if (prec > minPrec) {
+ var logical = this.type === types.logicalOR || this.type === types.logicalAND;
+ var coalesce = this.type === types.coalesce;
+ if (coalesce) {
+ // Handle the precedence of `tt.coalesce` as equal to the range of logical expressions.
+ // In other words, `node.right` shouldn't contain logical expressions in order to check the mixed error.
+ prec = types.logicalAND.binop;
+ }
+ var op = this.value;
+ this.next();
+ var startPos = this.start, startLoc = this.startLoc;
+ var right = this.parseExprOp(this.parseMaybeUnary(null, false), startPos, startLoc, prec, noIn);
+ var node = this.buildBinary(leftStartPos, leftStartLoc, left, right, op, logical || coalesce);
+ if ((logical && this.type === types.coalesce) || (coalesce && (this.type === types.logicalOR || this.type === types.logicalAND))) {
+ this.raiseRecoverable(this.start, "Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses");
+ }
+ return this.parseExprOp(node, leftStartPos, leftStartLoc, minPrec, noIn)
+ }
+ }
+ return left
+ };
+
+ pp$3.buildBinary = function(startPos, startLoc, left, right, op, logical) {
+ var node = this.startNodeAt(startPos, startLoc);
+ node.left = left;
+ node.operator = op;
+ node.right = right;
+ return this.finishNode(node, logical ? "LogicalExpression" : "BinaryExpression")
+ };
+
+ // Parse unary operators, both prefix and postfix.
+
+ pp$3.parseMaybeUnary = function(refDestructuringErrors, sawUnary) {
+ var startPos = this.start, startLoc = this.startLoc, expr;
+ if (this.isContextual("await") && (this.inAsync || (!this.inFunction && this.options.allowAwaitOutsideFunction))) {
+ expr = this.parseAwait();
+ sawUnary = true;
+ } else if (this.type.prefix) {
+ var node = this.startNode(), update = this.type === types.incDec;
+ node.operator = this.value;
+ node.prefix = true;
+ this.next();
+ node.argument = this.parseMaybeUnary(null, true);
+ this.checkExpressionErrors(refDestructuringErrors, true);
+ if (update) { this.checkLValSimple(node.argument); }
+ else if (this.strict && node.operator === "delete" &&
+ node.argument.type === "Identifier")
+ { this.raiseRecoverable(node.start, "Deleting local variable in strict mode"); }
+ else { sawUnary = true; }
+ expr = this.finishNode(node, update ? "UpdateExpression" : "UnaryExpression");
+ } else {
+ expr = this.parseExprSubscripts(refDestructuringErrors);
+ if (this.checkExpressionErrors(refDestructuringErrors)) { return expr }
+ while (this.type.postfix && !this.canInsertSemicolon()) {
+ var node$1 = this.startNodeAt(startPos, startLoc);
+ node$1.operator = this.value;
+ node$1.prefix = false;
+ node$1.argument = expr;
+ this.checkLValSimple(expr);
+ this.next();
+ expr = this.finishNode(node$1, "UpdateExpression");
+ }
+ }
+
+ if (!sawUnary && this.eat(types.starstar))
+ { return this.buildBinary(startPos, startLoc, expr, this.parseMaybeUnary(null, false), "**", false) }
+ else
+ { return expr }
+ };
+
+ // Parse call, dot, and `[]`-subscript expressions.
+
+ pp$3.parseExprSubscripts = function(refDestructuringErrors) {
+ var startPos = this.start, startLoc = this.startLoc;
+ var expr = this.parseExprAtom(refDestructuringErrors);
+ if (expr.type === "ArrowFunctionExpression" && this.input.slice(this.lastTokStart, this.lastTokEnd) !== ")")
+ { return expr }
+ var result = this.parseSubscripts(expr, startPos, startLoc);
+ if (refDestructuringErrors && result.type === "MemberExpression") {
+ if (refDestructuringErrors.parenthesizedAssign >= result.start) { refDestructuringErrors.parenthesizedAssign = -1; }
+ if (refDestructuringErrors.parenthesizedBind >= result.start) { refDestructuringErrors.parenthesizedBind = -1; }
+ }
+ return result
+ };
+
+ pp$3.parseSubscripts = function(base, startPos, startLoc, noCalls) {
+ var maybeAsyncArrow = this.options.ecmaVersion >= 8 && base.type === "Identifier" && base.name === "async" &&
+ this.lastTokEnd === base.end && !this.canInsertSemicolon() && base.end - base.start === 5 &&
+ this.potentialArrowAt === base.start;
+ var optionalChained = false;
+
+ while (true) {
+ var element = this.parseSubscript(base, startPos, startLoc, noCalls, maybeAsyncArrow, optionalChained);
+
+ if (element.optional) { optionalChained = true; }
+ if (element === base || element.type === "ArrowFunctionExpression") {
+ if (optionalChained) {
+ var chainNode = this.startNodeAt(startPos, startLoc);
+ chainNode.expression = element;
+ element = this.finishNode(chainNode, "ChainExpression");
+ }
+ return element
+ }
+
+ base = element;
+ }
+ };
+
+ pp$3.parseSubscript = function(base, startPos, startLoc, noCalls, maybeAsyncArrow, optionalChained) {
+ var optionalSupported = this.options.ecmaVersion >= 11;
+ var optional = optionalSupported && this.eat(types.questionDot);
+ if (noCalls && optional) { this.raise(this.lastTokStart, "Optional chaining cannot appear in the callee of new expressions"); }
+
+ var computed = this.eat(types.bracketL);
+ if (computed || (optional && this.type !== types.parenL && this.type !== types.backQuote) || this.eat(types.dot)) {
+ var node = this.startNodeAt(startPos, startLoc);
+ node.object = base;
+ node.property = computed ? this.parseExpression() : this.parseIdent(this.options.allowReserved !== "never");
+ node.computed = !!computed;
+ if (computed) { this.expect(types.bracketR); }
+ if (optionalSupported) {
+ node.optional = optional;
+ }
+ base = this.finishNode(node, "MemberExpression");
+ } else if (!noCalls && this.eat(types.parenL)) {
+ var refDestructuringErrors = new DestructuringErrors, oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos;
+ this.yieldPos = 0;
+ this.awaitPos = 0;
+ this.awaitIdentPos = 0;
+ var exprList = this.parseExprList(types.parenR, this.options.ecmaVersion >= 8, false, refDestructuringErrors);
+ if (maybeAsyncArrow && !optional && !this.canInsertSemicolon() && this.eat(types.arrow)) {
+ this.checkPatternErrors(refDestructuringErrors, false);
+ this.checkYieldAwaitInDefaultParams();
+ if (this.awaitIdentPos > 0)
+ { this.raise(this.awaitIdentPos, "Cannot use 'await' as identifier inside an async function"); }
+ this.yieldPos = oldYieldPos;
+ this.awaitPos = oldAwaitPos;
+ this.awaitIdentPos = oldAwaitIdentPos;
+ return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), exprList, true)
+ }
+ this.checkExpressionErrors(refDestructuringErrors, true);
+ this.yieldPos = oldYieldPos || this.yieldPos;
+ this.awaitPos = oldAwaitPos || this.awaitPos;
+ this.awaitIdentPos = oldAwaitIdentPos || this.awaitIdentPos;
+ var node$1 = this.startNodeAt(startPos, startLoc);
+ node$1.callee = base;
+ node$1.arguments = exprList;
+ if (optionalSupported) {
+ node$1.optional = optional;
+ }
+ base = this.finishNode(node$1, "CallExpression");
+ } else if (this.type === types.backQuote) {
+ if (optional || optionalChained) {
+ this.raise(this.start, "Optional chaining cannot appear in the tag of tagged template expressions");
+ }
+ var node$2 = this.startNodeAt(startPos, startLoc);
+ node$2.tag = base;
+ node$2.quasi = this.parseTemplate({isTagged: true});
+ base = this.finishNode(node$2, "TaggedTemplateExpression");
+ }
+ return base
+ };
+
+ // Parse an atomic expression — either a single token that is an
+ // expression, an expression started by a keyword like `function` or
+ // `new`, or an expression wrapped in punctuation like `()`, `[]`,
+ // or `{}`.
+
+ pp$3.parseExprAtom = function(refDestructuringErrors) {
+ // If a division operator appears in an expression position, the
+ // tokenizer got confused, and we force it to read a regexp instead.
+ if (this.type === types.slash) { this.readRegexp(); }
+
+ var node, canBeArrow = this.potentialArrowAt === this.start;
+ switch (this.type) {
+ case types._super:
+ if (!this.allowSuper)
+ { this.raise(this.start, "'super' keyword outside a method"); }
+ node = this.startNode();
+ this.next();
+ if (this.type === types.parenL && !this.allowDirectSuper)
+ { this.raise(node.start, "super() call outside constructor of a subclass"); }
+ // The `super` keyword can appear at below:
+ // SuperProperty:
+ // super [ Expression ]
+ // super . IdentifierName
+ // SuperCall:
+ // super ( Arguments )
+ if (this.type !== types.dot && this.type !== types.bracketL && this.type !== types.parenL)
+ { this.unexpected(); }
+ return this.finishNode(node, "Super")
+
+ case types._this:
+ node = this.startNode();
+ this.next();
+ return this.finishNode(node, "ThisExpression")
+
+ case types.name:
+ var startPos = this.start, startLoc = this.startLoc, containsEsc = this.containsEsc;
+ var id = this.parseIdent(false);
+ if (this.options.ecmaVersion >= 8 && !containsEsc && id.name === "async" && !this.canInsertSemicolon() && this.eat(types._function))
+ { return this.parseFunction(this.startNodeAt(startPos, startLoc), 0, false, true) }
+ if (canBeArrow && !this.canInsertSemicolon()) {
+ if (this.eat(types.arrow))
+ { return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), [id], false) }
+ if (this.options.ecmaVersion >= 8 && id.name === "async" && this.type === types.name && !containsEsc) {
+ id = this.parseIdent(false);
+ if (this.canInsertSemicolon() || !this.eat(types.arrow))
+ { this.unexpected(); }
+ return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), [id], true)
+ }
+ }
+ return id
+
+ case types.regexp:
+ var value = this.value;
+ node = this.parseLiteral(value.value);
+ node.regex = {pattern: value.pattern, flags: value.flags};
+ return node
+
+ case types.num: case types.string:
+ return this.parseLiteral(this.value)
+
+ case types._null: case types._true: case types._false:
+ node = this.startNode();
+ node.value = this.type === types._null ? null : this.type === types._true;
+ node.raw = this.type.keyword;
+ this.next();
+ return this.finishNode(node, "Literal")
+
+ case types.parenL:
+ var start = this.start, expr = this.parseParenAndDistinguishExpression(canBeArrow);
+ if (refDestructuringErrors) {
+ if (refDestructuringErrors.parenthesizedAssign < 0 && !this.isSimpleAssignTarget(expr))
+ { refDestructuringErrors.parenthesizedAssign = start; }
+ if (refDestructuringErrors.parenthesizedBind < 0)
+ { refDestructuringErrors.parenthesizedBind = start; }
+ }
+ return expr
+
+ case types.bracketL:
+ node = this.startNode();
+ this.next();
+ node.elements = this.parseExprList(types.bracketR, true, true, refDestructuringErrors);
+ return this.finishNode(node, "ArrayExpression")
+
+ case types.braceL:
+ return this.parseObj(false, refDestructuringErrors)
+
+ case types._function:
+ node = this.startNode();
+ this.next();
+ return this.parseFunction(node, 0)
+
+ case types._class:
+ return this.parseClass(this.startNode(), false)
+
+ case types._new:
+ return this.parseNew()
+
+ case types.backQuote:
+ return this.parseTemplate()
+
+ case types._import:
+ if (this.options.ecmaVersion >= 11) {
+ return this.parseExprImport()
+ } else {
+ return this.unexpected()
+ }
+
+ default:
+ this.unexpected();
+ }
+ };
+
+ pp$3.parseExprImport = function() {
+ var node = this.startNode();
+
+ // Consume `import` as an identifier for `import.meta`.
+ // Because `this.parseIdent(true)` doesn't check escape sequences, it needs the check of `this.containsEsc`.
+ if (this.containsEsc) { this.raiseRecoverable(this.start, "Escape sequence in keyword import"); }
+ var meta = this.parseIdent(true);
+
+ switch (this.type) {
+ case types.parenL:
+ return this.parseDynamicImport(node)
+ case types.dot:
+ node.meta = meta;
+ return this.parseImportMeta(node)
+ default:
+ this.unexpected();
+ }
+ };
+
+ pp$3.parseDynamicImport = function(node) {
+ this.next(); // skip `(`
+
+ // Parse node.source.
+ node.source = this.parseMaybeAssign();
+
+ // Verify ending.
+ if (!this.eat(types.parenR)) {
+ var errorPos = this.start;
+ if (this.eat(types.comma) && this.eat(types.parenR)) {
+ this.raiseRecoverable(errorPos, "Trailing comma is not allowed in import()");
+ } else {
+ this.unexpected(errorPos);
+ }
+ }
+
+ return this.finishNode(node, "ImportExpression")
+ };
+
+ pp$3.parseImportMeta = function(node) {
+ this.next(); // skip `.`
+
+ var containsEsc = this.containsEsc;
+ node.property = this.parseIdent(true);
+
+ if (node.property.name !== "meta")
+ { this.raiseRecoverable(node.property.start, "The only valid meta property for import is 'import.meta'"); }
+ if (containsEsc)
+ { this.raiseRecoverable(node.start, "'import.meta' must not contain escaped characters"); }
+ if (this.options.sourceType !== "module")
+ { this.raiseRecoverable(node.start, "Cannot use 'import.meta' outside a module"); }
+
+ return this.finishNode(node, "MetaProperty")
+ };
+
+ pp$3.parseLiteral = function(value) {
+ var node = this.startNode();
+ node.value = value;
+ node.raw = this.input.slice(this.start, this.end);
+ if (node.raw.charCodeAt(node.raw.length - 1) === 110) { node.bigint = node.raw.slice(0, -1).replace(/_/g, ""); }
+ this.next();
+ return this.finishNode(node, "Literal")
+ };
+
+ pp$3.parseParenExpression = function() {
+ this.expect(types.parenL);
+ var val = this.parseExpression();
+ this.expect(types.parenR);
+ return val
+ };
+
+ pp$3.parseParenAndDistinguishExpression = function(canBeArrow) {
+ var startPos = this.start, startLoc = this.startLoc, val, allowTrailingComma = this.options.ecmaVersion >= 8;
+ if (this.options.ecmaVersion >= 6) {
+ this.next();
+
+ var innerStartPos = this.start, innerStartLoc = this.startLoc;
+ var exprList = [], first = true, lastIsComma = false;
+ var refDestructuringErrors = new DestructuringErrors, oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, spreadStart;
+ this.yieldPos = 0;
+ this.awaitPos = 0;
+ // Do not save awaitIdentPos to allow checking awaits nested in parameters
+ while (this.type !== types.parenR) {
+ first ? first = false : this.expect(types.comma);
+ if (allowTrailingComma && this.afterTrailingComma(types.parenR, true)) {
+ lastIsComma = true;
+ break
+ } else if (this.type === types.ellipsis) {
+ spreadStart = this.start;
+ exprList.push(this.parseParenItem(this.parseRestBinding()));
+ if (this.type === types.comma) { this.raise(this.start, "Comma is not permitted after the rest element"); }
+ break
+ } else {
+ exprList.push(this.parseMaybeAssign(false, refDestructuringErrors, this.parseParenItem));
+ }
+ }
+ var innerEndPos = this.start, innerEndLoc = this.startLoc;
+ this.expect(types.parenR);
+
+ if (canBeArrow && !this.canInsertSemicolon() && this.eat(types.arrow)) {
+ this.checkPatternErrors(refDestructuringErrors, false);
+ this.checkYieldAwaitInDefaultParams();
+ this.yieldPos = oldYieldPos;
+ this.awaitPos = oldAwaitPos;
+ return this.parseParenArrowList(startPos, startLoc, exprList)
+ }
+
+ if (!exprList.length || lastIsComma) { this.unexpected(this.lastTokStart); }
+ if (spreadStart) { this.unexpected(spreadStart); }
+ this.checkExpressionErrors(refDestructuringErrors, true);
+ this.yieldPos = oldYieldPos || this.yieldPos;
+ this.awaitPos = oldAwaitPos || this.awaitPos;
+
+ if (exprList.length > 1) {
+ val = this.startNodeAt(innerStartPos, innerStartLoc);
+ val.expressions = exprList;
+ this.finishNodeAt(val, "SequenceExpression", innerEndPos, innerEndLoc);
+ } else {
+ val = exprList[0];
+ }
+ } else {
+ val = this.parseParenExpression();
+ }
+
+ if (this.options.preserveParens) {
+ var par = this.startNodeAt(startPos, startLoc);
+ par.expression = val;
+ return this.finishNode(par, "ParenthesizedExpression")
+ } else {
+ return val
+ }
+ };
+
+ pp$3.parseParenItem = function(item) {
+ return item
+ };
+
+ pp$3.parseParenArrowList = function(startPos, startLoc, exprList) {
+ return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), exprList)
+ };
+
+ // New's precedence is slightly tricky. It must allow its argument to
+ // be a `[]` or dot subscript expression, but not a call — at least,
+ // not without wrapping it in parentheses. Thus, it uses the noCalls
+ // argument to parseSubscripts to prevent it from consuming the
+ // argument list.
+
+ var empty$1 = [];
+
+ pp$3.parseNew = function() {
+ if (this.containsEsc) { this.raiseRecoverable(this.start, "Escape sequence in keyword new"); }
+ var node = this.startNode();
+ var meta = this.parseIdent(true);
+ if (this.options.ecmaVersion >= 6 && this.eat(types.dot)) {
+ node.meta = meta;
+ var containsEsc = this.containsEsc;
+ node.property = this.parseIdent(true);
+ if (node.property.name !== "target")
+ { this.raiseRecoverable(node.property.start, "The only valid meta property for new is 'new.target'"); }
+ if (containsEsc)
+ { this.raiseRecoverable(node.start, "'new.target' must not contain escaped characters"); }
+ if (!this.inNonArrowFunction)
+ { this.raiseRecoverable(node.start, "'new.target' can only be used in functions"); }
+ return this.finishNode(node, "MetaProperty")
+ }
+ var startPos = this.start, startLoc = this.startLoc, isImport = this.type === types._import;
+ node.callee = this.parseSubscripts(this.parseExprAtom(), startPos, startLoc, true);
+ if (isImport && node.callee.type === "ImportExpression") {
+ this.raise(startPos, "Cannot use new with import()");
+ }
+ if (this.eat(types.parenL)) { node.arguments = this.parseExprList(types.parenR, this.options.ecmaVersion >= 8, false); }
+ else { node.arguments = empty$1; }
+ return this.finishNode(node, "NewExpression")
+ };
+
+ // Parse template expression.
+
+ pp$3.parseTemplateElement = function(ref) {
+ var isTagged = ref.isTagged;
+
+ var elem = this.startNode();
+ if (this.type === types.invalidTemplate) {
+ if (!isTagged) {
+ this.raiseRecoverable(this.start, "Bad escape sequence in untagged template literal");
+ }
+ elem.value = {
+ raw: this.value,
+ cooked: null
+ };
+ } else {
+ elem.value = {
+ raw: this.input.slice(this.start, this.end).replace(/\r\n?/g, "\n"),
+ cooked: this.value
+ };
+ }
+ this.next();
+ elem.tail = this.type === types.backQuote;
+ return this.finishNode(elem, "TemplateElement")
+ };
+
+ pp$3.parseTemplate = function(ref) {
+ if ( ref === void 0 ) ref = {};
+ var isTagged = ref.isTagged; if ( isTagged === void 0 ) isTagged = false;
+
+ var node = this.startNode();
+ this.next();
+ node.expressions = [];
+ var curElt = this.parseTemplateElement({isTagged: isTagged});
+ node.quasis = [curElt];
+ while (!curElt.tail) {
+ if (this.type === types.eof) { this.raise(this.pos, "Unterminated template literal"); }
+ this.expect(types.dollarBraceL);
+ node.expressions.push(this.parseExpression());
+ this.expect(types.braceR);
+ node.quasis.push(curElt = this.parseTemplateElement({isTagged: isTagged}));
+ }
+ this.next();
+ return this.finishNode(node, "TemplateLiteral")
+ };
+
+ pp$3.isAsyncProp = function(prop) {
+ return !prop.computed && prop.key.type === "Identifier" && prop.key.name === "async" &&
+ (this.type === types.name || this.type === types.num || this.type === types.string || this.type === types.bracketL || this.type.keyword || (this.options.ecmaVersion >= 9 && this.type === types.star)) &&
+ !lineBreak.test(this.input.slice(this.lastTokEnd, this.start))
+ };
+
+ // Parse an object literal or binding pattern.
+
+ pp$3.parseObj = function(isPattern, refDestructuringErrors) {
+ var node = this.startNode(), first = true, propHash = {};
+ node.properties = [];
+ this.next();
+ while (!this.eat(types.braceR)) {
+ if (!first) {
+ this.expect(types.comma);
+ if (this.options.ecmaVersion >= 5 && this.afterTrailingComma(types.braceR)) { break }
+ } else { first = false; }
+
+ var prop = this.parseProperty(isPattern, refDestructuringErrors);
+ if (!isPattern) { this.checkPropClash(prop, propHash, refDestructuringErrors); }
+ node.properties.push(prop);
+ }
+ return this.finishNode(node, isPattern ? "ObjectPattern" : "ObjectExpression")
+ };
+
+ pp$3.parseProperty = function(isPattern, refDestructuringErrors) {
+ var prop = this.startNode(), isGenerator, isAsync, startPos, startLoc;
+ if (this.options.ecmaVersion >= 9 && this.eat(types.ellipsis)) {
+ if (isPattern) {
+ prop.argument = this.parseIdent(false);
+ if (this.type === types.comma) {
+ this.raise(this.start, "Comma is not permitted after the rest element");
+ }
+ return this.finishNode(prop, "RestElement")
+ }
+ // To disallow parenthesized identifier via `this.toAssignable()`.
+ if (this.type === types.parenL && refDestructuringErrors) {
+ if (refDestructuringErrors.parenthesizedAssign < 0) {
+ refDestructuringErrors.parenthesizedAssign = this.start;
+ }
+ if (refDestructuringErrors.parenthesizedBind < 0) {
+ refDestructuringErrors.parenthesizedBind = this.start;
+ }
+ }
+ // Parse argument.
+ prop.argument = this.parseMaybeAssign(false, refDestructuringErrors);
+ // To disallow trailing comma via `this.toAssignable()`.
+ if (this.type === types.comma && refDestructuringErrors && refDestructuringErrors.trailingComma < 0) {
+ refDestructuringErrors.trailingComma = this.start;
+ }
+ // Finish
+ return this.finishNode(prop, "SpreadElement")
+ }
+ if (this.options.ecmaVersion >= 6) {
+ prop.method = false;
+ prop.shorthand = false;
+ if (isPattern || refDestructuringErrors) {
+ startPos = this.start;
+ startLoc = this.startLoc;
+ }
+ if (!isPattern)
+ { isGenerator = this.eat(types.star); }
+ }
+ var containsEsc = this.containsEsc;
+ this.parsePropertyName(prop);
+ if (!isPattern && !containsEsc && this.options.ecmaVersion >= 8 && !isGenerator && this.isAsyncProp(prop)) {
+ isAsync = true;
+ isGenerator = this.options.ecmaVersion >= 9 && this.eat(types.star);
+ this.parsePropertyName(prop, refDestructuringErrors);
+ } else {
+ isAsync = false;
+ }
+ this.parsePropertyValue(prop, isPattern, isGenerator, isAsync, startPos, startLoc, refDestructuringErrors, containsEsc);
+ return this.finishNode(prop, "Property")
+ };
+
+ pp$3.parsePropertyValue = function(prop, isPattern, isGenerator, isAsync, startPos, startLoc, refDestructuringErrors, containsEsc) {
+ if ((isGenerator || isAsync) && this.type === types.colon)
+ { this.unexpected(); }
+
+ if (this.eat(types.colon)) {
+ prop.value = isPattern ? this.parseMaybeDefault(this.start, this.startLoc) : this.parseMaybeAssign(false, refDestructuringErrors);
+ prop.kind = "init";
+ } else if (this.options.ecmaVersion >= 6 && this.type === types.parenL) {
+ if (isPattern) { this.unexpected(); }
+ prop.kind = "init";
+ prop.method = true;
+ prop.value = this.parseMethod(isGenerator, isAsync);
+ } else if (!isPattern && !containsEsc &&
+ this.options.ecmaVersion >= 5 && !prop.computed && prop.key.type === "Identifier" &&
+ (prop.key.name === "get" || prop.key.name === "set") &&
+ (this.type !== types.comma && this.type !== types.braceR && this.type !== types.eq)) {
+ if (isGenerator || isAsync) { this.unexpected(); }
+ prop.kind = prop.key.name;
+ this.parsePropertyName(prop);
+ prop.value = this.parseMethod(false);
+ var paramCount = prop.kind === "get" ? 0 : 1;
+ if (prop.value.params.length !== paramCount) {
+ var start = prop.value.start;
+ if (prop.kind === "get")
+ { this.raiseRecoverable(start, "getter should have no params"); }
+ else
+ { this.raiseRecoverable(start, "setter should have exactly one param"); }
+ } else {
+ if (prop.kind === "set" && prop.value.params[0].type === "RestElement")
+ { this.raiseRecoverable(prop.value.params[0].start, "Setter cannot use rest params"); }
+ }
+ } else if (this.options.ecmaVersion >= 6 && !prop.computed && prop.key.type === "Identifier") {
+ if (isGenerator || isAsync) { this.unexpected(); }
+ this.checkUnreserved(prop.key);
+ if (prop.key.name === "await" && !this.awaitIdentPos)
+ { this.awaitIdentPos = startPos; }
+ prop.kind = "init";
+ if (isPattern) {
+ prop.value = this.parseMaybeDefault(startPos, startLoc, this.copyNode(prop.key));
+ } else if (this.type === types.eq && refDestructuringErrors) {
+ if (refDestructuringErrors.shorthandAssign < 0)
+ { refDestructuringErrors.shorthandAssign = this.start; }
+ prop.value = this.parseMaybeDefault(startPos, startLoc, this.copyNode(prop.key));
+ } else {
+ prop.value = this.copyNode(prop.key);
+ }
+ prop.shorthand = true;
+ } else { this.unexpected(); }
+ };
+
+ pp$3.parsePropertyName = function(prop) {
+ if (this.options.ecmaVersion >= 6) {
+ if (this.eat(types.bracketL)) {
+ prop.computed = true;
+ prop.key = this.parseMaybeAssign();
+ this.expect(types.bracketR);
+ return prop.key
+ } else {
+ prop.computed = false;
+ }
+ }
+ return prop.key = this.type === types.num || this.type === types.string ? this.parseExprAtom() : this.parseIdent(this.options.allowReserved !== "never")
+ };
+
+ // Initialize empty function node.
+
+ pp$3.initFunction = function(node) {
+ node.id = null;
+ if (this.options.ecmaVersion >= 6) { node.generator = node.expression = false; }
+ if (this.options.ecmaVersion >= 8) { node.async = false; }
+ };
+
+ // Parse object or class method.
+
+ pp$3.parseMethod = function(isGenerator, isAsync, allowDirectSuper) {
+ var node = this.startNode(), oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos;
+
+ this.initFunction(node);
+ if (this.options.ecmaVersion >= 6)
+ { node.generator = isGenerator; }
+ if (this.options.ecmaVersion >= 8)
+ { node.async = !!isAsync; }
+
+ this.yieldPos = 0;
+ this.awaitPos = 0;
+ this.awaitIdentPos = 0;
+ this.enterScope(functionFlags(isAsync, node.generator) | SCOPE_SUPER | (allowDirectSuper ? SCOPE_DIRECT_SUPER : 0));
+
+ this.expect(types.parenL);
+ node.params = this.parseBindingList(types.parenR, false, this.options.ecmaVersion >= 8);
+ this.checkYieldAwaitInDefaultParams();
+ this.parseFunctionBody(node, false, true);
+
+ this.yieldPos = oldYieldPos;
+ this.awaitPos = oldAwaitPos;
+ this.awaitIdentPos = oldAwaitIdentPos;
+ return this.finishNode(node, "FunctionExpression")
+ };
+
+ // Parse arrow function expression with given parameters.
+
+ pp$3.parseArrowExpression = function(node, params, isAsync) {
+ var oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos;
+
+ this.enterScope(functionFlags(isAsync, false) | SCOPE_ARROW);
+ this.initFunction(node);
+ if (this.options.ecmaVersion >= 8) { node.async = !!isAsync; }
+
+ this.yieldPos = 0;
+ this.awaitPos = 0;
+ this.awaitIdentPos = 0;
+
+ node.params = this.toAssignableList(params, true);
+ this.parseFunctionBody(node, true, false);
+
+ this.yieldPos = oldYieldPos;
+ this.awaitPos = oldAwaitPos;
+ this.awaitIdentPos = oldAwaitIdentPos;
+ return this.finishNode(node, "ArrowFunctionExpression")
+ };
+
+ // Parse function body and check parameters.
+
+ pp$3.parseFunctionBody = function(node, isArrowFunction, isMethod) {
+ var isExpression = isArrowFunction && this.type !== types.braceL;
+ var oldStrict = this.strict, useStrict = false;
+
+ if (isExpression) {
+ node.body = this.parseMaybeAssign();
+ node.expression = true;
+ this.checkParams(node, false);
+ } else {
+ var nonSimple = this.options.ecmaVersion >= 7 && !this.isSimpleParamList(node.params);
+ if (!oldStrict || nonSimple) {
+ useStrict = this.strictDirective(this.end);
+ // If this is a strict mode function, verify that argument names
+ // are not repeated, and it does not try to bind the words `eval`
+ // or `arguments`.
+ if (useStrict && nonSimple)
+ { this.raiseRecoverable(node.start, "Illegal 'use strict' directive in function with non-simple parameter list"); }
+ }
+ // Start a new scope with regard to labels and the `inFunction`
+ // flag (restore them to their old value afterwards).
+ var oldLabels = this.labels;
+ this.labels = [];
+ if (useStrict) { this.strict = true; }
+
+ // Add the params to varDeclaredNames to ensure that an error is thrown
+ // if a let/const declaration in the function clashes with one of the params.
+ this.checkParams(node, !oldStrict && !useStrict && !isArrowFunction && !isMethod && this.isSimpleParamList(node.params));
+ // Ensure the function name isn't a forbidden identifier in strict mode, e.g. 'eval'
+ if (this.strict && node.id) { this.checkLValSimple(node.id, BIND_OUTSIDE); }
+ node.body = this.parseBlock(false, undefined, useStrict && !oldStrict);
+ node.expression = false;
+ this.adaptDirectivePrologue(node.body.body);
+ this.labels = oldLabels;
+ }
+ this.exitScope();
+ };
+
+ pp$3.isSimpleParamList = function(params) {
+ for (var i = 0, list = params; i < list.length; i += 1)
+ {
+ var param = list[i];
+
+ if (param.type !== "Identifier") { return false
+ } }
+ return true
+ };
+
+ // Checks function params for various disallowed patterns such as using "eval"
+ // or "arguments" and duplicate parameters.
+
+ pp$3.checkParams = function(node, allowDuplicates) {
+ var nameHash = {};
+ for (var i = 0, list = node.params; i < list.length; i += 1)
+ {
+ var param = list[i];
+
+ this.checkLValInnerPattern(param, BIND_VAR, allowDuplicates ? null : nameHash);
+ }
+ };
+
+ // Parses a comma-separated list of expressions, and returns them as
+ // an array. `close` is the token type that ends the list, and
+ // `allowEmpty` can be turned on to allow subsequent commas with
+ // nothing in between them to be parsed as `null` (which is needed
+ // for array literals).
+
+ pp$3.parseExprList = function(close, allowTrailingComma, allowEmpty, refDestructuringErrors) {
+ var elts = [], first = true;
+ while (!this.eat(close)) {
+ if (!first) {
+ this.expect(types.comma);
+ if (allowTrailingComma && this.afterTrailingComma(close)) { break }
+ } else { first = false; }
+
+ var elt = (void 0);
+ if (allowEmpty && this.type === types.comma)
+ { elt = null; }
+ else if (this.type === types.ellipsis) {
+ elt = this.parseSpread(refDestructuringErrors);
+ if (refDestructuringErrors && this.type === types.comma && refDestructuringErrors.trailingComma < 0)
+ { refDestructuringErrors.trailingComma = this.start; }
+ } else {
+ elt = this.parseMaybeAssign(false, refDestructuringErrors);
+ }
+ elts.push(elt);
+ }
+ return elts
+ };
+
+ pp$3.checkUnreserved = function(ref) {
+ var start = ref.start;
+ var end = ref.end;
+ var name = ref.name;
+
+ if (this.inGenerator && name === "yield")
+ { this.raiseRecoverable(start, "Cannot use 'yield' as identifier inside a generator"); }
+ if (this.inAsync && name === "await")
+ { this.raiseRecoverable(start, "Cannot use 'await' as identifier inside an async function"); }
+ if (this.keywords.test(name))
+ { this.raise(start, ("Unexpected keyword '" + name + "'")); }
+ if (this.options.ecmaVersion < 6 &&
+ this.input.slice(start, end).indexOf("\\") !== -1) { return }
+ var re = this.strict ? this.reservedWordsStrict : this.reservedWords;
+ if (re.test(name)) {
+ if (!this.inAsync && name === "await")
+ { this.raiseRecoverable(start, "Cannot use keyword 'await' outside an async function"); }
+ this.raiseRecoverable(start, ("The keyword '" + name + "' is reserved"));
+ }
+ };
+
+ // Parse the next token as an identifier. If `liberal` is true (used
+ // when parsing properties), it will also convert keywords into
+ // identifiers.
+
+ pp$3.parseIdent = function(liberal, isBinding) {
+ var node = this.startNode();
+ if (this.type === types.name) {
+ node.name = this.value;
+ } else if (this.type.keyword) {
+ node.name = this.type.keyword;
+
+ // To fix https://github.com/acornjs/acorn/issues/575
+ // `class` and `function` keywords push new context into this.context.
+ // But there is no chance to pop the context if the keyword is consumed as an identifier such as a property name.
+ // If the previous token is a dot, this does not apply because the context-managing code already ignored the keyword
+ if ((node.name === "class" || node.name === "function") &&
+ (this.lastTokEnd !== this.lastTokStart + 1 || this.input.charCodeAt(this.lastTokStart) !== 46)) {
+ this.context.pop();
+ }
+ } else {
+ this.unexpected();
+ }
+ this.next(!!liberal);
+ this.finishNode(node, "Identifier");
+ if (!liberal) {
+ this.checkUnreserved(node);
+ if (node.name === "await" && !this.awaitIdentPos)
+ { this.awaitIdentPos = node.start; }
+ }
+ return node
+ };
+
+ // Parses yield expression inside generator.
+
+ pp$3.parseYield = function(noIn) {
+ if (!this.yieldPos) { this.yieldPos = this.start; }
+
+ var node = this.startNode();
+ this.next();
+ if (this.type === types.semi || this.canInsertSemicolon() || (this.type !== types.star && !this.type.startsExpr)) {
+ node.delegate = false;
+ node.argument = null;
+ } else {
+ node.delegate = this.eat(types.star);
+ node.argument = this.parseMaybeAssign(noIn);
+ }
+ return this.finishNode(node, "YieldExpression")
+ };
+
+ pp$3.parseAwait = function() {
+ if (!this.awaitPos) { this.awaitPos = this.start; }
+
+ var node = this.startNode();
+ this.next();
+ node.argument = this.parseMaybeUnary(null, true);
+ return this.finishNode(node, "AwaitExpression")
+ };
+
+ var pp$4 = Parser.prototype;
+
+ // This function is used to raise exceptions on parse errors. It
+ // takes an offset integer (into the current `input`) to indicate
+ // the location of the error, attaches the position to the end
+ // of the error message, and then raises a `SyntaxError` with that
+ // message.
+
+ pp$4.raise = function(pos, message) {
+ var loc = getLineInfo(this.input, pos);
+ message += " (" + loc.line + ":" + loc.column + ")";
+ var err = new SyntaxError(message);
+ err.pos = pos; err.loc = loc; err.raisedAt = this.pos;
+ throw err
+ };
+
+ pp$4.raiseRecoverable = pp$4.raise;
+
+ pp$4.curPosition = function() {
+ if (this.options.locations) {
+ return new Position(this.curLine, this.pos - this.lineStart)
+ }
+ };
+
+ var pp$5 = Parser.prototype;
+
+ var Scope = function Scope(flags) {
+ this.flags = flags;
+ // A list of var-declared names in the current lexical scope
+ this.var = [];
+ // A list of lexically-declared names in the current lexical scope
+ this.lexical = [];
+ // A list of lexically-declared FunctionDeclaration names in the current lexical scope
+ this.functions = [];
+ };
+
+ // The functions in this module keep track of declared variables in the current scope in order to detect duplicate variable names.
+
+ pp$5.enterScope = function(flags) {
+ this.scopeStack.push(new Scope(flags));
+ };
+
+ pp$5.exitScope = function() {
+ this.scopeStack.pop();
+ };
+
+ // The spec says:
+ // > At the top level of a function, or script, function declarations are
+ // > treated like var declarations rather than like lexical declarations.
+ pp$5.treatFunctionsAsVarInScope = function(scope) {
+ return (scope.flags & SCOPE_FUNCTION) || !this.inModule && (scope.flags & SCOPE_TOP)
+ };
+
+ pp$5.declareName = function(name, bindingType, pos) {
+ var redeclared = false;
+ if (bindingType === BIND_LEXICAL) {
+ var scope = this.currentScope();
+ redeclared = scope.lexical.indexOf(name) > -1 || scope.functions.indexOf(name) > -1 || scope.var.indexOf(name) > -1;
+ scope.lexical.push(name);
+ if (this.inModule && (scope.flags & SCOPE_TOP))
+ { delete this.undefinedExports[name]; }
+ } else if (bindingType === BIND_SIMPLE_CATCH) {
+ var scope$1 = this.currentScope();
+ scope$1.lexical.push(name);
+ } else if (bindingType === BIND_FUNCTION) {
+ var scope$2 = this.currentScope();
+ if (this.treatFunctionsAsVar)
+ { redeclared = scope$2.lexical.indexOf(name) > -1; }
+ else
+ { redeclared = scope$2.lexical.indexOf(name) > -1 || scope$2.var.indexOf(name) > -1; }
+ scope$2.functions.push(name);
+ } else {
+ for (var i = this.scopeStack.length - 1; i >= 0; --i) {
+ var scope$3 = this.scopeStack[i];
+ if (scope$3.lexical.indexOf(name) > -1 && !((scope$3.flags & SCOPE_SIMPLE_CATCH) && scope$3.lexical[0] === name) ||
+ !this.treatFunctionsAsVarInScope(scope$3) && scope$3.functions.indexOf(name) > -1) {
+ redeclared = true;
+ break
+ }
+ scope$3.var.push(name);
+ if (this.inModule && (scope$3.flags & SCOPE_TOP))
+ { delete this.undefinedExports[name]; }
+ if (scope$3.flags & SCOPE_VAR) { break }
+ }
+ }
+ if (redeclared) { this.raiseRecoverable(pos, ("Identifier '" + name + "' has already been declared")); }
+ };
+
+ pp$5.checkLocalExport = function(id) {
+ // scope.functions must be empty as Module code is always strict.
+ if (this.scopeStack[0].lexical.indexOf(id.name) === -1 &&
+ this.scopeStack[0].var.indexOf(id.name) === -1) {
+ this.undefinedExports[id.name] = id;
+ }
+ };
+
+ pp$5.currentScope = function() {
+ return this.scopeStack[this.scopeStack.length - 1]
+ };
+
+ pp$5.currentVarScope = function() {
+ for (var i = this.scopeStack.length - 1;; i--) {
+ var scope = this.scopeStack[i];
+ if (scope.flags & SCOPE_VAR) { return scope }
+ }
+ };
+
+ // Could be useful for `this`, `new.target`, `super()`, `super.property`, and `super[property]`.
+ pp$5.currentThisScope = function() {
+ for (var i = this.scopeStack.length - 1;; i--) {
+ var scope = this.scopeStack[i];
+ if (scope.flags & SCOPE_VAR && !(scope.flags & SCOPE_ARROW)) { return scope }
+ }
+ };
+
+ var Node = function Node(parser, pos, loc) {
+ this.type = "";
+ this.start = pos;
+ this.end = 0;
+ if (parser.options.locations)
+ { this.loc = new SourceLocation(parser, loc); }
+ if (parser.options.directSourceFile)
+ { this.sourceFile = parser.options.directSourceFile; }
+ if (parser.options.ranges)
+ { this.range = [pos, 0]; }
+ };
+
+ // Start an AST node, attaching a start offset.
+
+ var pp$6 = Parser.prototype;
+
+ pp$6.startNode = function() {
+ return new Node(this, this.start, this.startLoc)
+ };
+
+ pp$6.startNodeAt = function(pos, loc) {
+ return new Node(this, pos, loc)
+ };
+
+ // Finish an AST node, adding `type` and `end` properties.
+
+ function finishNodeAt(node, type, pos, loc) {
+ node.type = type;
+ node.end = pos;
+ if (this.options.locations)
+ { node.loc.end = loc; }
+ if (this.options.ranges)
+ { node.range[1] = pos; }
+ return node
+ }
+
+ pp$6.finishNode = function(node, type) {
+ return finishNodeAt.call(this, node, type, this.lastTokEnd, this.lastTokEndLoc)
+ };
+
+ // Finish node at given position
+
+ pp$6.finishNodeAt = function(node, type, pos, loc) {
+ return finishNodeAt.call(this, node, type, pos, loc)
+ };
+
+ pp$6.copyNode = function(node) {
+ var newNode = new Node(this, node.start, this.startLoc);
+ for (var prop in node) { newNode[prop] = node[prop]; }
+ return newNode
+ };
+
+ // The algorithm used to determine whether a regexp can appear at a
+
+ var TokContext = function TokContext(token, isExpr, preserveSpace, override, generator) {
+ this.token = token;
+ this.isExpr = !!isExpr;
+ this.preserveSpace = !!preserveSpace;
+ this.override = override;
+ this.generator = !!generator;
+ };
+
+ var types$1 = {
+ b_stat: new TokContext("{", false),
+ b_expr: new TokContext("{", true),
+ b_tmpl: new TokContext("${", false),
+ p_stat: new TokContext("(", false),
+ p_expr: new TokContext("(", true),
+ q_tmpl: new TokContext("`", true, true, function (p) { return p.tryReadTemplateToken(); }),
+ f_stat: new TokContext("function", false),
+ f_expr: new TokContext("function", true),
+ f_expr_gen: new TokContext("function", true, false, null, true),
+ f_gen: new TokContext("function", false, false, null, true)
+ };
+
+ var pp$7 = Parser.prototype;
+
+ pp$7.initialContext = function() {
+ return [types$1.b_stat]
+ };
+
+ pp$7.braceIsBlock = function(prevType) {
+ var parent = this.curContext();
+ if (parent === types$1.f_expr || parent === types$1.f_stat)
+ { return true }
+ if (prevType === types.colon && (parent === types$1.b_stat || parent === types$1.b_expr))
+ { return !parent.isExpr }
+
+ // The check for `tt.name && exprAllowed` detects whether we are
+ // after a `yield` or `of` construct. See the `updateContext` for
+ // `tt.name`.
+ if (prevType === types._return || prevType === types.name && this.exprAllowed)
+ { return lineBreak.test(this.input.slice(this.lastTokEnd, this.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.b_stat }
+ if (prevType === types._var || prevType === types._const || prevType === types.name)
+ { return false }
+ return !this.exprAllowed
+ };
+
+ pp$7.inGeneratorContext = function() {
+ for (var i = this.context.length - 1; i >= 1; i--) {
+ var context = this.context[i];
+ if (context.token === "function")
+ { return context.generator }
+ }
+ return false
+ };
+
+ pp$7.updateContext = function(prevType) {
+ var update, type = this.type;
+ if (type.keyword && prevType === types.dot)
+ { this.exprAllowed = false; }
+ else if (update = type.updateContext)
+ { update.call(this, prevType); }
+ else
+ { this.exprAllowed = type.beforeExpr; }
+ };
+
+ // Token-specific context update code
+
+ types.parenR.updateContext = types.braceR.updateContext = function() {
+ if (this.context.length === 1) {
+ this.exprAllowed = true;
+ return
+ }
+ var out = this.context.pop();
+ if (out === types$1.b_stat && this.curContext().token === "function") {
+ out = this.context.pop();
+ }
+ this.exprAllowed = !out.isExpr;
+ };
+
+ types.braceL.updateContext = function(prevType) {
+ this.context.push(this.braceIsBlock(prevType) ? types$1.b_stat : types$1.b_expr);
+ this.exprAllowed = true;
+ };
+
+ types.dollarBraceL.updateContext = function() {
+ this.context.push(types$1.b_tmpl);
+ this.exprAllowed = true;
+ };
+
+ types.parenL.updateContext = function(prevType) {
+ var statementParens = prevType === types._if || prevType === types._for || prevType === types._with || prevType === types._while;
+ this.context.push(statementParens ? types$1.p_stat : types$1.p_expr);
+ this.exprAllowed = true;
+ };
+
+ types.incDec.updateContext = function() {
+ // tokExprAllowed stays unchanged
+ };
+
+ types._function.updateContext = types._class.updateContext = function(prevType) {
+ if (prevType.beforeExpr && prevType !== types._else &&
+ !(prevType === types.semi && this.curContext() !== types$1.p_stat) &&
+ !(prevType === types._return && lineBreak.test(this.input.slice(this.lastTokEnd, this.start))) &&
+ !((prevType === types.colon || prevType === types.braceL) && this.curContext() === types$1.b_stat))
+ { this.context.push(types$1.f_expr); }
+ else
+ { this.context.push(types$1.f_stat); }
+ this.exprAllowed = false;
+ };
+
+ types.backQuote.updateContext = function() {
+ if (this.curContext() === types$1.q_tmpl)
+ { this.context.pop(); }
+ else
+ { this.context.push(types$1.q_tmpl); }
+ this.exprAllowed = false;
+ };
+
+ types.star.updateContext = function(prevType) {
+ if (prevType === types._function) {
+ var index = this.context.length - 1;
+ if (this.context[index] === types$1.f_expr)
+ { this.context[index] = types$1.f_expr_gen; }
+ else
+ { this.context[index] = types$1.f_gen; }
+ }
+ this.exprAllowed = true;
+ };
+
+ types.name.updateContext = function(prevType) {
+ var allowed = false;
+ if (this.options.ecmaVersion >= 6 && prevType !== types.dot) {
+ if (this.value === "of" && !this.exprAllowed ||
+ this.value === "yield" && this.inGeneratorContext())
+ { allowed = true; }
+ }
+ this.exprAllowed = allowed;
+ };
+
+ // This file contains Unicode properties extracted from the ECMAScript
+ // specification. The lists are extracted like so:
+ // $$('#table-binary-unicode-properties > figure > table > tbody > tr > td:nth-child(1) code').map(el => el.innerText)
+
+ // #table-binary-unicode-properties
+ var ecma9BinaryProperties = "ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS";
+ var ecma10BinaryProperties = ecma9BinaryProperties + " Extended_Pictographic";
+ var ecma11BinaryProperties = ecma10BinaryProperties;
+ var ecma12BinaryProperties = ecma11BinaryProperties + " EBase EComp EMod EPres ExtPict";
+ var unicodeBinaryProperties = {
+ 9: ecma9BinaryProperties,
+ 10: ecma10BinaryProperties,
+ 11: ecma11BinaryProperties,
+ 12: ecma12BinaryProperties
+ };
+
+ // #table-unicode-general-category-values
+ var unicodeGeneralCategoryValues = "Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu";
+
+ // #table-unicode-script-values
+ var ecma9ScriptValues = "Adlam Adlm Ahom Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb";
+ var ecma10ScriptValues = ecma9ScriptValues + " Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd";
+ var ecma11ScriptValues = ecma10ScriptValues + " Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho";
+ var ecma12ScriptValues = ecma11ScriptValues + " Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi";
+ var unicodeScriptValues = {
+ 9: ecma9ScriptValues,
+ 10: ecma10ScriptValues,
+ 11: ecma11ScriptValues,
+ 12: ecma12ScriptValues
+ };
+
+ var data = {};
+ function buildUnicodeData(ecmaVersion) {
+ var d = data[ecmaVersion] = {
+ binary: wordsRegexp(unicodeBinaryProperties[ecmaVersion] + " " + unicodeGeneralCategoryValues),
+ nonBinary: {
+ General_Category: wordsRegexp(unicodeGeneralCategoryValues),
+ Script: wordsRegexp(unicodeScriptValues[ecmaVersion])
+ }
+ };
+ d.nonBinary.Script_Extensions = d.nonBinary.Script;
+
+ d.nonBinary.gc = d.nonBinary.General_Category;
+ d.nonBinary.sc = d.nonBinary.Script;
+ d.nonBinary.scx = d.nonBinary.Script_Extensions;
+ }
+ buildUnicodeData(9);
+ buildUnicodeData(10);
+ buildUnicodeData(11);
+ buildUnicodeData(12);
+
+ var pp$8 = Parser.prototype;
+
+ var RegExpValidationState = function RegExpValidationState(parser) {
+ this.parser = parser;
+ this.validFlags = "gim" + (parser.options.ecmaVersion >= 6 ? "uy" : "") + (parser.options.ecmaVersion >= 9 ? "s" : "");
+ this.unicodeProperties = data[parser.options.ecmaVersion >= 12 ? 12 : parser.options.ecmaVersion];
+ this.source = "";
+ this.flags = "";
+ this.start = 0;
+ this.switchU = false;
+ this.switchN = false;
+ this.pos = 0;
+ this.lastIntValue = 0;
+ this.lastStringValue = "";
+ this.lastAssertionIsQuantifiable = false;
+ this.numCapturingParens = 0;
+ this.maxBackReference = 0;
+ this.groupNames = [];
+ this.backReferenceNames = [];
+ };
+
+ RegExpValidationState.prototype.reset = function reset (start, pattern, flags) {
+ var unicode = flags.indexOf("u") !== -1;
+ this.start = start | 0;
+ this.source = pattern + "";
+ this.flags = flags;
+ this.switchU = unicode && this.parser.options.ecmaVersion >= 6;
+ this.switchN = unicode && this.parser.options.ecmaVersion >= 9;
+ };
+
+ RegExpValidationState.prototype.raise = function raise (message) {
+ this.parser.raiseRecoverable(this.start, ("Invalid regular expression: /" + (this.source) + "/: " + message));
+ };
+
+ // If u flag is given, this returns the code point at the index (it combines a surrogate pair).
+ // Otherwise, this returns the code unit of the index (can be a part of a surrogate pair).
+ RegExpValidationState.prototype.at = function at (i, forceU) {
+ if ( forceU === void 0 ) forceU = false;
+
+ var s = this.source;
+ var l = s.length;
+ if (i >= l) {
+ return -1
+ }
+ var c = s.charCodeAt(i);
+ if (!(forceU || this.switchU) || c <= 0xD7FF || c >= 0xE000 || i + 1 >= l) {
+ return c
+ }
+ var next = s.charCodeAt(i + 1);
+ return next >= 0xDC00 && next <= 0xDFFF ? (c << 10) + next - 0x35FDC00 : c
+ };
+
+ RegExpValidationState.prototype.nextIndex = function nextIndex (i, forceU) {
+ if ( forceU === void 0 ) forceU = false;
+
+ var s = this.source;
+ var l = s.length;
+ if (i >= l) {
+ return l
+ }
+ var c = s.charCodeAt(i), next;
+ if (!(forceU || this.switchU) || c <= 0xD7FF || c >= 0xE000 || i + 1 >= l ||
+ (next = s.charCodeAt(i + 1)) < 0xDC00 || next > 0xDFFF) {
+ return i + 1
+ }
+ return i + 2
+ };
+
+ RegExpValidationState.prototype.current = function current (forceU) {
+ if ( forceU === void 0 ) forceU = false;
+
+ return this.at(this.pos, forceU)
+ };
+
+ RegExpValidationState.prototype.lookahead = function lookahead (forceU) {
+ if ( forceU === void 0 ) forceU = false;
+
+ return this.at(this.nextIndex(this.pos, forceU), forceU)
+ };
+
+ RegExpValidationState.prototype.advance = function advance (forceU) {
+ if ( forceU === void 0 ) forceU = false;
+
+ this.pos = this.nextIndex(this.pos, forceU);
+ };
+
+ RegExpValidationState.prototype.eat = function eat (ch, forceU) {
+ if ( forceU === void 0 ) forceU = false;
+
+ if (this.current(forceU) === ch) {
+ this.advance(forceU);
+ return true
+ }
+ return false
+ };
+
+ function codePointToString(ch) {
+ if (ch <= 0xFFFF) { return String.fromCharCode(ch) }
+ ch -= 0x10000;
+ return String.fromCharCode((ch >> 10) + 0xD800, (ch & 0x03FF) + 0xDC00)
+ }
+
+ /**
+ * Validate the flags part of a given RegExpLiteral.
+ *
+ * @param {RegExpValidationState} state The state to validate RegExp.
+ * @returns {void}
+ */
+ pp$8.validateRegExpFlags = function(state) {
+ var validFlags = state.validFlags;
+ var flags = state.flags;
+
+ for (var i = 0; i < flags.length; i++) {
+ var flag = flags.charAt(i);
+ if (validFlags.indexOf(flag) === -1) {
+ this.raise(state.start, "Invalid regular expression flag");
+ }
+ if (flags.indexOf(flag, i + 1) > -1) {
+ this.raise(state.start, "Duplicate regular expression flag");
+ }
+ }
+ };
+
+ /**
+ * Validate the pattern part of a given RegExpLiteral.
+ *
+ * @param {RegExpValidationState} state The state to validate RegExp.
+ * @returns {void}
+ */
+ pp$8.validateRegExpPattern = function(state) {
+ this.regexp_pattern(state);
+
+ // The goal symbol for the parse is |Pattern[~U, ~N]|. If the result of
+ // parsing contains a |GroupName|, reparse with the goal symbol
+ // |Pattern[~U, +N]| and use this result instead. Throw a *SyntaxError*
+ // exception if _P_ did not conform to the grammar, if any elements of _P_
+ // were not matched by the parse, or if any Early Error conditions exist.
+ if (!state.switchN && this.options.ecmaVersion >= 9 && state.groupNames.length > 0) {
+ state.switchN = true;
+ this.regexp_pattern(state);
+ }
+ };
+
+ // https://www.ecma-international.org/ecma-262/8.0/#prod-Pattern
+ pp$8.regexp_pattern = function(state) {
+ state.pos = 0;
+ state.lastIntValue = 0;
+ state.lastStringValue = "";
+ state.lastAssertionIsQuantifiable = false;
+ state.numCapturingParens = 0;
+ state.maxBackReference = 0;
+ state.groupNames.length = 0;
+ state.backReferenceNames.length = 0;
+
+ this.regexp_disjunction(state);
+
+ if (state.pos !== state.source.length) {
+ // Make the same messages as V8.
+ if (state.eat(0x29 /* ) */)) {
+ state.raise("Unmatched ')'");
+ }
+ if (state.eat(0x5D /* ] */) || state.eat(0x7D /* } */)) {
+ state.raise("Lone quantifier brackets");
+ }
+ }
+ if (state.maxBackReference > state.numCapturingParens) {
+ state.raise("Invalid escape");
+ }
+ for (var i = 0, list = state.backReferenceNames; i < list.length; i += 1) {
+ var name = list[i];
+
+ if (state.groupNames.indexOf(name) === -1) {
+ state.raise("Invalid named capture referenced");
+ }
+ }
+ };
+
+ // https://www.ecma-international.org/ecma-262/8.0/#prod-Disjunction
+ pp$8.regexp_disjunction = function(state) {
+ this.regexp_alternative(state);
+ while (state.eat(0x7C /* | */)) {
+ this.regexp_alternative(state);
+ }
+
+ // Make the same message as V8.
+ if (this.regexp_eatQuantifier(state, true)) {
+ state.raise("Nothing to repeat");
+ }
+ if (state.eat(0x7B /* { */)) {
+ state.raise("Lone quantifier brackets");
+ }
+ };
+
+ // https://www.ecma-international.org/ecma-262/8.0/#prod-Alternative
+ pp$8.regexp_alternative = function(state) {
+ while (state.pos < state.source.length && this.regexp_eatTerm(state))
+ { }
+ };
+
+ // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-Term
+ pp$8.regexp_eatTerm = function(state) {
+ if (this.regexp_eatAssertion(state)) {
+ // Handle `QuantifiableAssertion Quantifier` alternative.
+ // `state.lastAssertionIsQuantifiable` is true if the last eaten Assertion
+ // is a QuantifiableAssertion.
+ if (state.lastAssertionIsQuantifiable && this.regexp_eatQuantifier(state)) {
+ // Make the same message as V8.
+ if (state.switchU) {
+ state.raise("Invalid quantifier");
+ }
+ }
+ return true
+ }
+
+ if (state.switchU ? this.regexp_eatAtom(state) : this.regexp_eatExtendedAtom(state)) {
+ this.regexp_eatQuantifier(state);
+ return true
+ }
+
+ return false
+ };
+
+ // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-Assertion
+ pp$8.regexp_eatAssertion = function(state) {
+ var start = state.pos;
+ state.lastAssertionIsQuantifiable = false;
+
+ // ^, $
+ if (state.eat(0x5E /* ^ */) || state.eat(0x24 /* $ */)) {
+ return true
+ }
+
+ // \b \B
+ if (state.eat(0x5C /* \ */)) {
+ if (state.eat(0x42 /* B */) || state.eat(0x62 /* b */)) {
+ return true
+ }
+ state.pos = start;
+ }
+
+ // Lookahead / Lookbehind
+ if (state.eat(0x28 /* ( */) && state.eat(0x3F /* ? */)) {
+ var lookbehind = false;
+ if (this.options.ecmaVersion >= 9) {
+ lookbehind = state.eat(0x3C /* < */);
+ }
+ if (state.eat(0x3D /* = */) || state.eat(0x21 /* ! */)) {
+ this.regexp_disjunction(state);
+ if (!state.eat(0x29 /* ) */)) {
+ state.raise("Unterminated group");
+ }
+ state.lastAssertionIsQuantifiable = !lookbehind;
+ return true
+ }
+ }
+
+ state.pos = start;
+ return false
+ };
+
+ // https://www.ecma-international.org/ecma-262/8.0/#prod-Quantifier
+ pp$8.regexp_eatQuantifier = function(state, noError) {
+ if ( noError === void 0 ) noError = false;
+
+ if (this.regexp_eatQuantifierPrefix(state, noError)) {
+ state.eat(0x3F /* ? */);
+ return true
+ }
+ return false
+ };
+
+ // https://www.ecma-international.org/ecma-262/8.0/#prod-QuantifierPrefix
+ pp$8.regexp_eatQuantifierPrefix = function(state, noError) {
+ return (
+ state.eat(0x2A /* * */) ||
+ state.eat(0x2B /* + */) ||
+ state.eat(0x3F /* ? */) ||
+ this.regexp_eatBracedQuantifier(state, noError)
+ )
+ };
+ pp$8.regexp_eatBracedQuantifier = function(state, noError) {
+ var start = state.pos;
+ if (state.eat(0x7B /* { */)) {
+ var min = 0, max = -1;
+ if (this.regexp_eatDecimalDigits(state)) {
+ min = state.lastIntValue;
+ if (state.eat(0x2C /* , */) && this.regexp_eatDecimalDigits(state)) {
+ max = state.lastIntValue;
+ }
+ if (state.eat(0x7D /* } */)) {
+ // SyntaxError in https://www.ecma-international.org/ecma-262/8.0/#sec-term
+ if (max !== -1 && max < min && !noError) {
+ state.raise("numbers out of order in {} quantifier");
+ }
+ return true
+ }
+ }
+ if (state.switchU && !noError) {
+ state.raise("Incomplete quantifier");
+ }
+ state.pos = start;
+ }
+ return false
+ };
+
+ // https://www.ecma-international.org/ecma-262/8.0/#prod-Atom
+ pp$8.regexp_eatAtom = function(state) {
+ return (
+ this.regexp_eatPatternCharacters(state) ||
+ state.eat(0x2E /* . */) ||
+ this.regexp_eatReverseSolidusAtomEscape(state) ||
+ this.regexp_eatCharacterClass(state) ||
+ this.regexp_eatUncapturingGroup(state) ||
+ this.regexp_eatCapturingGroup(state)
+ )
+ };
+ pp$8.regexp_eatReverseSolidusAtomEscape = function(state) {
+ var start = state.pos;
+ if (state.eat(0x5C /* \ */)) {
+ if (this.regexp_eatAtomEscape(state)) {
+ return true
+ }
+ state.pos = start;
+ }
+ return false
+ };
+ pp$8.regexp_eatUncapturingGroup = function(state) {
+ var start = state.pos;
+ if (state.eat(0x28 /* ( */)) {
+ if (state.eat(0x3F /* ? */) && state.eat(0x3A /* : */)) {
+ this.regexp_disjunction(state);
+ if (state.eat(0x29 /* ) */)) {
+ return true
+ }
+ state.raise("Unterminated group");
+ }
+ state.pos = start;
+ }
+ return false
+ };
+ pp$8.regexp_eatCapturingGroup = function(state) {
+ if (state.eat(0x28 /* ( */)) {
+ if (this.options.ecmaVersion >= 9) {
+ this.regexp_groupSpecifier(state);
+ } else if (state.current() === 0x3F /* ? */) {
+ state.raise("Invalid group");
+ }
+ this.regexp_disjunction(state);
+ if (state.eat(0x29 /* ) */)) {
+ state.numCapturingParens += 1;
+ return true
+ }
+ state.raise("Unterminated group");
+ }
+ return false
+ };
+
+ // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ExtendedAtom
+ pp$8.regexp_eatExtendedAtom = function(state) {
+ return (
+ state.eat(0x2E /* . */) ||
+ this.regexp_eatReverseSolidusAtomEscape(state) ||
+ this.regexp_eatCharacterClass(state) ||
+ this.regexp_eatUncapturingGroup(state) ||
+ this.regexp_eatCapturingGroup(state) ||
+ this.regexp_eatInvalidBracedQuantifier(state) ||
+ this.regexp_eatExtendedPatternCharacter(state)
+ )
+ };
+
+ // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-InvalidBracedQuantifier
+ pp$8.regexp_eatInvalidBracedQuantifier = function(state) {
+ if (this.regexp_eatBracedQuantifier(state, true)) {
+ state.raise("Nothing to repeat");
+ }
+ return false
+ };
+
+ // https://www.ecma-international.org/ecma-262/8.0/#prod-SyntaxCharacter
+ pp$8.regexp_eatSyntaxCharacter = function(state) {
+ var ch = state.current();
+ if (isSyntaxCharacter(ch)) {
+ state.lastIntValue = ch;
+ state.advance();
+ return true
+ }
+ return false
+ };
+ function isSyntaxCharacter(ch) {
+ return (
+ ch === 0x24 /* $ */ ||
+ ch >= 0x28 /* ( */ && ch <= 0x2B /* + */ ||
+ ch === 0x2E /* . */ ||
+ ch === 0x3F /* ? */ ||
+ ch >= 0x5B /* [ */ && ch <= 0x5E /* ^ */ ||
+ ch >= 0x7B /* { */ && ch <= 0x7D /* } */
+ )
+ }
+
+ // https://www.ecma-international.org/ecma-262/8.0/#prod-PatternCharacter
+ // But eat eager.
+ pp$8.regexp_eatPatternCharacters = function(state) {
+ var start = state.pos;
+ var ch = 0;
+ while ((ch = state.current()) !== -1 && !isSyntaxCharacter(ch)) {
+ state.advance();
+ }
+ return state.pos !== start
+ };
+
+ // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ExtendedPatternCharacter
+ pp$8.regexp_eatExtendedPatternCharacter = function(state) {
+ var ch = state.current();
+ if (
+ ch !== -1 &&
+ ch !== 0x24 /* $ */ &&
+ !(ch >= 0x28 /* ( */ && ch <= 0x2B /* + */) &&
+ ch !== 0x2E /* . */ &&
+ ch !== 0x3F /* ? */ &&
+ ch !== 0x5B /* [ */ &&
+ ch !== 0x5E /* ^ */ &&
+ ch !== 0x7C /* | */
+ ) {
+ state.advance();
+ return true
+ }
+ return false
+ };
+
+ // GroupSpecifier ::
+ // [empty]
+ // `?` GroupName
+ pp$8.regexp_groupSpecifier = function(state) {
+ if (state.eat(0x3F /* ? */)) {
+ if (this.regexp_eatGroupName(state)) {
+ if (state.groupNames.indexOf(state.lastStringValue) !== -1) {
+ state.raise("Duplicate capture group name");
+ }
+ state.groupNames.push(state.lastStringValue);
+ return
+ }
+ state.raise("Invalid group");
+ }
+ };
+
+ // GroupName ::
+ // `<` RegExpIdentifierName `>`
+ // Note: this updates `state.lastStringValue` property with the eaten name.
+ pp$8.regexp_eatGroupName = function(state) {
+ state.lastStringValue = "";
+ if (state.eat(0x3C /* < */)) {
+ if (this.regexp_eatRegExpIdentifierName(state) && state.eat(0x3E /* > */)) {
+ return true
+ }
+ state.raise("Invalid capture group name");
+ }
+ return false
+ };
+
+ // RegExpIdentifierName ::
+ // RegExpIdentifierStart
+ // RegExpIdentifierName RegExpIdentifierPart
+ // Note: this updates `state.lastStringValue` property with the eaten name.
+ pp$8.regexp_eatRegExpIdentifierName = function(state) {
+ state.lastStringValue = "";
+ if (this.regexp_eatRegExpIdentifierStart(state)) {
+ state.lastStringValue += codePointToString(state.lastIntValue);
+ while (this.regexp_eatRegExpIdentifierPart(state)) {
+ state.lastStringValue += codePointToString(state.lastIntValue);
+ }
+ return true
+ }
+ return false
+ };
+
+ // RegExpIdentifierStart ::
+ // UnicodeIDStart
+ // `$`
+ // `_`
+ // `\` RegExpUnicodeEscapeSequence[+U]
+ pp$8.regexp_eatRegExpIdentifierStart = function(state) {
+ var start = state.pos;
+ var forceU = this.options.ecmaVersion >= 11;
+ var ch = state.current(forceU);
+ state.advance(forceU);
+
+ if (ch === 0x5C /* \ */ && this.regexp_eatRegExpUnicodeEscapeSequence(state, forceU)) {
+ ch = state.lastIntValue;
+ }
+ if (isRegExpIdentifierStart(ch)) {
+ state.lastIntValue = ch;
+ return true
+ }
+
+ state.pos = start;
+ return false
+ };
+ function isRegExpIdentifierStart(ch) {
+ return isIdentifierStart(ch, true) || ch === 0x24 /* $ */ || ch === 0x5F /* _ */
+ }
+
+ // RegExpIdentifierPart ::
+ // UnicodeIDContinue
+ // `$`
+ // `_`
+ // `\` RegExpUnicodeEscapeSequence[+U]
+ // <ZWNJ>
+ // <ZWJ>
+ pp$8.regexp_eatRegExpIdentifierPart = function(state) {
+ var start = state.pos;
+ var forceU = this.options.ecmaVersion >= 11;
+ var ch = state.current(forceU);
+ state.advance(forceU);
+
+ if (ch === 0x5C /* \ */ && this.regexp_eatRegExpUnicodeEscapeSequence(state, forceU)) {
+ ch = state.lastIntValue;
+ }
+ if (isRegExpIdentifierPart(ch)) {
+ state.lastIntValue = ch;
+ return true
+ }
+
+ state.pos = start;
+ return false
+ };
+ function isRegExpIdentifierPart(ch) {
+ return isIdentifierChar(ch, true) || ch === 0x24 /* $ */ || ch === 0x5F /* _ */ || ch === 0x200C /* <ZWNJ> */ || ch === 0x200D /* <ZWJ> */
+ }
+
+ // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-AtomEscape
+ pp$8.regexp_eatAtomEscape = function(state) {
+ if (
+ this.regexp_eatBackReference(state) ||
+ this.regexp_eatCharacterClassEscape(state) ||
+ this.regexp_eatCharacterEscape(state) ||
+ (state.switchN && this.regexp_eatKGroupName(state))
+ ) {
+ return true
+ }
+ if (state.switchU) {
+ // Make the same message as V8.
+ if (state.current() === 0x63 /* c */) {
+ state.raise("Invalid unicode escape");
+ }
+ state.raise("Invalid escape");
+ }
+ return false
+ };
+ pp$8.regexp_eatBackReference = function(state) {
+ var start = state.pos;
+ if (this.regexp_eatDecimalEscape(state)) {
+ var n = state.lastIntValue;
+ if (state.switchU) {
+ // For SyntaxError in https://www.ecma-international.org/ecma-262/8.0/#sec-atomescape
+ if (n > state.maxBackReference) {
+ state.maxBackReference = n;
+ }
+ return true
+ }
+ if (n <= state.numCapturingParens) {
+ return true
+ }
+ state.pos = start;
+ }
+ return false
+ };
+ pp$8.regexp_eatKGroupName = function(state) {
+ if (state.eat(0x6B /* k */)) {
+ if (this.regexp_eatGroupName(state)) {
+ state.backReferenceNames.push(state.lastStringValue);
+ return true
+ }
+ state.raise("Invalid named reference");
+ }
+ return false
+ };
+
+ // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-CharacterEscape
+ pp$8.regexp_eatCharacterEscape = function(state) {
+ return (
+ this.regexp_eatControlEscape(state) ||
+ this.regexp_eatCControlLetter(state) ||
+ this.regexp_eatZero(state) ||
+ this.regexp_eatHexEscapeSequence(state) ||
+ this.regexp_eatRegExpUnicodeEscapeSequence(state, false) ||
+ (!state.switchU && this.regexp_eatLegacyOctalEscapeSequence(state)) ||
+ this.regexp_eatIdentityEscape(state)
+ )
+ };
+ pp$8.regexp_eatCControlLetter = function(state) {
+ var start = state.pos;
+ if (state.eat(0x63 /* c */)) {
+ if (this.regexp_eatControlLetter(state)) {
+ return true
+ }
+ state.pos = start;
+ }
+ return false
+ };
+ pp$8.regexp_eatZero = function(state) {
+ if (state.current() === 0x30 /* 0 */ && !isDecimalDigit(state.lookahead())) {
+ state.lastIntValue = 0;
+ state.advance();
+ return true
+ }
+ return false
+ };
+
+ // https://www.ecma-international.org/ecma-262/8.0/#prod-ControlEscape
+ pp$8.regexp_eatControlEscape = function(state) {
+ var ch = state.current();
+ if (ch === 0x74 /* t */) {
+ state.lastIntValue = 0x09; /* \t */
+ state.advance();
+ return true
+ }
+ if (ch === 0x6E /* n */) {
+ state.lastIntValue = 0x0A; /* \n */
+ state.advance();
+ return true
+ }
+ if (ch === 0x76 /* v */) {
+ state.lastIntValue = 0x0B; /* \v */
+ state.advance();
+ return true
+ }
+ if (ch === 0x66 /* f */) {
+ state.lastIntValue = 0x0C; /* \f */
+ state.advance();
+ return true
+ }
+ if (ch === 0x72 /* r */) {
+ state.lastIntValue = 0x0D; /* \r */
+ state.advance();
+ return true
+ }
+ return false
+ };
+
+ // https://www.ecma-international.org/ecma-262/8.0/#prod-ControlLetter
+ pp$8.regexp_eatControlLetter = function(state) {
+ var ch = state.current();
+ if (isControlLetter(ch)) {
+ state.lastIntValue = ch % 0x20;
+ state.advance();
+ return true
+ }
+ return false
+ };
+ function isControlLetter(ch) {
+ return (
+ (ch >= 0x41 /* A */ && ch <= 0x5A /* Z */) ||
+ (ch >= 0x61 /* a */ && ch <= 0x7A /* z */)
+ )
+ }
+
+ // https://www.ecma-international.org/ecma-262/8.0/#prod-RegExpUnicodeEscapeSequence
+ pp$8.regexp_eatRegExpUnicodeEscapeSequence = function(state, forceU) {
+ if ( forceU === void 0 ) forceU = false;
+
+ var start = state.pos;
+ var switchU = forceU || state.switchU;
+
+ if (state.eat(0x75 /* u */)) {
+ if (this.regexp_eatFixedHexDigits(state, 4)) {
+ var lead = state.lastIntValue;
+ if (switchU && lead >= 0xD800 && lead <= 0xDBFF) {
+ var leadSurrogateEnd = state.pos;
+ if (state.eat(0x5C /* \ */) && state.eat(0x75 /* u */) && this.regexp_eatFixedHexDigits(state, 4)) {
+ var trail = state.lastIntValue;
+ if (trail >= 0xDC00 && trail <= 0xDFFF) {
+ state.lastIntValue = (lead - 0xD800) * 0x400 + (trail - 0xDC00) + 0x10000;
+ return true
+ }
+ }
+ state.pos = leadSurrogateEnd;
+ state.lastIntValue = lead;
+ }
+ return true
+ }
+ if (
+ switchU &&
+ state.eat(0x7B /* { */) &&
+ this.regexp_eatHexDigits(state) &&
+ state.eat(0x7D /* } */) &&
+ isValidUnicode(state.lastIntValue)
+ ) {
+ return true
+ }
+ if (switchU) {
+ state.raise("Invalid unicode escape");
+ }
+ state.pos = start;
+ }
+
+ return false
+ };
+ function isValidUnicode(ch) {
+ return ch >= 0 && ch <= 0x10FFFF
+ }
+
+ // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-IdentityEscape
+ pp$8.regexp_eatIdentityEscape = function(state) {
+ if (state.switchU) {
+ if (this.regexp_eatSyntaxCharacter(state)) {
+ return true
+ }
+ if (state.eat(0x2F /* / */)) {
+ state.lastIntValue = 0x2F; /* / */
+ return true
+ }
+ return false
+ }
+
+ var ch = state.current();
+ if (ch !== 0x63 /* c */ && (!state.switchN || ch !== 0x6B /* k */)) {
+ state.lastIntValue = ch;
+ state.advance();
+ return true
+ }
+
+ return false
+ };
+
+ // https://www.ecma-international.org/ecma-262/8.0/#prod-DecimalEscape
+ pp$8.regexp_eatDecimalEscape = function(state) {
+ state.lastIntValue = 0;
+ var ch = state.current();
+ if (ch >= 0x31 /* 1 */ && ch <= 0x39 /* 9 */) {
+ do {
+ state.lastIntValue = 10 * state.lastIntValue + (ch - 0x30 /* 0 */);
+ state.advance();
+ } while ((ch = state.current()) >= 0x30 /* 0 */ && ch <= 0x39 /* 9 */)
+ return true
+ }
+ return false
+ };
+
+ // https://www.ecma-international.org/ecma-262/8.0/#prod-CharacterClassEscape
+ pp$8.regexp_eatCharacterClassEscape = function(state) {
+ var ch = state.current();
+
+ if (isCharacterClassEscape(ch)) {
+ state.lastIntValue = -1;
+ state.advance();
+ return true
+ }
+
+ if (
+ state.switchU &&
+ this.options.ecmaVersion >= 9 &&
+ (ch === 0x50 /* P */ || ch === 0x70 /* p */)
+ ) {
+ state.lastIntValue = -1;
+ state.advance();
+ if (
+ state.eat(0x7B /* { */) &&
+ this.regexp_eatUnicodePropertyValueExpression(state) &&
+ state.eat(0x7D /* } */)
+ ) {
+ return true
+ }
+ state.raise("Invalid property name");
+ }
+
+ return false
+ };
+ function isCharacterClassEscape(ch) {
+ return (
+ ch === 0x64 /* d */ ||
+ ch === 0x44 /* D */ ||
+ ch === 0x73 /* s */ ||
+ ch === 0x53 /* S */ ||
+ ch === 0x77 /* w */ ||
+ ch === 0x57 /* W */
+ )
+ }
+
+ // UnicodePropertyValueExpression ::
+ // UnicodePropertyName `=` UnicodePropertyValue
+ // LoneUnicodePropertyNameOrValue
+ pp$8.regexp_eatUnicodePropertyValueExpression = function(state) {
+ var start = state.pos;
+
+ // UnicodePropertyName `=` UnicodePropertyValue
+ if (this.regexp_eatUnicodePropertyName(state) && state.eat(0x3D /* = */)) {
+ var name = state.lastStringValue;
+ if (this.regexp_eatUnicodePropertyValue(state)) {
+ var value = state.lastStringValue;
+ this.regexp_validateUnicodePropertyNameAndValue(state, name, value);
+ return true
+ }
+ }
+ state.pos = start;
+
+ // LoneUnicodePropertyNameOrValue
+ if (this.regexp_eatLoneUnicodePropertyNameOrValue(state)) {
+ var nameOrValue = state.lastStringValue;
+ this.regexp_validateUnicodePropertyNameOrValue(state, nameOrValue);
+ return true
+ }
+ return false
+ };
+ pp$8.regexp_validateUnicodePropertyNameAndValue = function(state, name, value) {
+ if (!has(state.unicodeProperties.nonBinary, name))
+ { state.raise("Invalid property name"); }
+ if (!state.unicodeProperties.nonBinary[name].test(value))
+ { state.raise("Invalid property value"); }
+ };
+ pp$8.regexp_validateUnicodePropertyNameOrValue = function(state, nameOrValue) {
+ if (!state.unicodeProperties.binary.test(nameOrValue))
+ { state.raise("Invalid property name"); }
+ };
+
+ // UnicodePropertyName ::
+ // UnicodePropertyNameCharacters
+ pp$8.regexp_eatUnicodePropertyName = function(state) {
+ var ch = 0;
+ state.lastStringValue = "";
+ while (isUnicodePropertyNameCharacter(ch = state.current())) {
+ state.lastStringValue += codePointToString(ch);
+ state.advance();
+ }
+ return state.lastStringValue !== ""
+ };
+ function isUnicodePropertyNameCharacter(ch) {
+ return isControlLetter(ch) || ch === 0x5F /* _ */
+ }
+
+ // UnicodePropertyValue ::
+ // UnicodePropertyValueCharacters
+ pp$8.regexp_eatUnicodePropertyValue = function(state) {
+ var ch = 0;
+ state.lastStringValue = "";
+ while (isUnicodePropertyValueCharacter(ch = state.current())) {
+ state.lastStringValue += codePointToString(ch);
+ state.advance();
+ }
+ return state.lastStringValue !== ""
+ };
+ function isUnicodePropertyValueCharacter(ch) {
+ return isUnicodePropertyNameCharacter(ch) || isDecimalDigit(ch)
+ }
+
+ // LoneUnicodePropertyNameOrValue ::
+ // UnicodePropertyValueCharacters
+ pp$8.regexp_eatLoneUnicodePropertyNameOrValue = function(state) {
+ return this.regexp_eatUnicodePropertyValue(state)
+ };
+
+ // https://www.ecma-international.org/ecma-262/8.0/#prod-CharacterClass
+ pp$8.regexp_eatCharacterClass = function(state) {
+ if (state.eat(0x5B /* [ */)) {
+ state.eat(0x5E /* ^ */);
+ this.regexp_classRanges(state);
+ if (state.eat(0x5D /* ] */)) {
+ return true
+ }
+ // Unreachable since it threw "unterminated regular expression" error before.
+ state.raise("Unterminated character class");
+ }
+ return false
+ };
+
+ // https://www.ecma-international.org/ecma-262/8.0/#prod-ClassRanges
+ // https://www.ecma-international.org/ecma-262/8.0/#prod-NonemptyClassRanges
+ // https://www.ecma-international.org/ecma-262/8.0/#prod-NonemptyClassRangesNoDash
+ pp$8.regexp_classRanges = function(state) {
+ while (this.regexp_eatClassAtom(state)) {
+ var left = state.lastIntValue;
+ if (state.eat(0x2D /* - */) && this.regexp_eatClassAtom(state)) {
+ var right = state.lastIntValue;
+ if (state.switchU && (left === -1 || right === -1)) {
+ state.raise("Invalid character class");
+ }
+ if (left !== -1 && right !== -1 && left > right) {
+ state.raise("Range out of order in character class");
+ }
+ }
+ }
+ };
+
+ // https://www.ecma-international.org/ecma-262/8.0/#prod-ClassAtom
+ // https://www.ecma-international.org/ecma-262/8.0/#prod-ClassAtomNoDash
+ pp$8.regexp_eatClassAtom = function(state) {
+ var start = state.pos;
+
+ if (state.eat(0x5C /* \ */)) {
+ if (this.regexp_eatClassEscape(state)) {
+ return true
+ }
+ if (state.switchU) {
+ // Make the same message as V8.
+ var ch$1 = state.current();
+ if (ch$1 === 0x63 /* c */ || isOctalDigit(ch$1)) {
+ state.raise("Invalid class escape");
+ }
+ state.raise("Invalid escape");
+ }
+ state.pos = start;
+ }
+
+ var ch = state.current();
+ if (ch !== 0x5D /* ] */) {
+ state.lastIntValue = ch;
+ state.advance();
+ return true
+ }
+
+ return false
+ };
+
+ // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ClassEscape
+ pp$8.regexp_eatClassEscape = function(state) {
+ var start = state.pos;
+
+ if (state.eat(0x62 /* b */)) {
+ state.lastIntValue = 0x08; /* <BS> */
+ return true
+ }
+
+ if (state.switchU && state.eat(0x2D /* - */)) {
+ state.lastIntValue = 0x2D; /* - */
+ return true
+ }
+
+ if (!state.switchU && state.eat(0x63 /* c */)) {
+ if (this.regexp_eatClassControlLetter(state)) {
+ return true
+ }
+ state.pos = start;
+ }
+
+ return (
+ this.regexp_eatCharacterClassEscape(state) ||
+ this.regexp_eatCharacterEscape(state)
+ )
+ };
+
+ // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ClassControlLetter
+ pp$8.regexp_eatClassControlLetter = function(state) {
+ var ch = state.current();
+ if (isDecimalDigit(ch) || ch === 0x5F /* _ */) {
+ state.lastIntValue = ch % 0x20;
+ state.advance();
+ return true
+ }
+ return false
+ };
+
+ // https://www.ecma-international.org/ecma-262/8.0/#prod-HexEscapeSequence
+ pp$8.regexp_eatHexEscapeSequence = function(state) {
+ var start = state.pos;
+ if (state.eat(0x78 /* x */)) {
+ if (this.regexp_eatFixedHexDigits(state, 2)) {
+ return true
+ }
+ if (state.switchU) {
+ state.raise("Invalid escape");
+ }
+ state.pos = start;
+ }
+ return false
+ };
+
+ // https://www.ecma-international.org/ecma-262/8.0/#prod-DecimalDigits
+ pp$8.regexp_eatDecimalDigits = function(state) {
+ var start = state.pos;
+ var ch = 0;
+ state.lastIntValue = 0;
+ while (isDecimalDigit(ch = state.current())) {
+ state.lastIntValue = 10 * state.lastIntValue + (ch - 0x30 /* 0 */);
+ state.advance();
+ }
+ return state.pos !== start
+ };
+ function isDecimalDigit(ch) {
+ return ch >= 0x30 /* 0 */ && ch <= 0x39 /* 9 */
+ }
+
+ // https://www.ecma-international.org/ecma-262/8.0/#prod-HexDigits
+ pp$8.regexp_eatHexDigits = function(state) {
+ var start = state.pos;
+ var ch = 0;
+ state.lastIntValue = 0;
+ while (isHexDigit(ch = state.current())) {
+ state.lastIntValue = 16 * state.lastIntValue + hexToInt(ch);
+ state.advance();
+ }
+ return state.pos !== start
+ };
+ function isHexDigit(ch) {
+ return (
+ (ch >= 0x30 /* 0 */ && ch <= 0x39 /* 9 */) ||
+ (ch >= 0x41 /* A */ && ch <= 0x46 /* F */) ||
+ (ch >= 0x61 /* a */ && ch <= 0x66 /* f */)
+ )
+ }
+ function hexToInt(ch) {
+ if (ch >= 0x41 /* A */ && ch <= 0x46 /* F */) {
+ return 10 + (ch - 0x41 /* A */)
+ }
+ if (ch >= 0x61 /* a */ && ch <= 0x66 /* f */) {
+ return 10 + (ch - 0x61 /* a */)
+ }
+ return ch - 0x30 /* 0 */
+ }
+
+ // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-LegacyOctalEscapeSequence
+ // Allows only 0-377(octal) i.e. 0-255(decimal).
+ pp$8.regexp_eatLegacyOctalEscapeSequence = function(state) {
+ if (this.regexp_eatOctalDigit(state)) {
+ var n1 = state.lastIntValue;
+ if (this.regexp_eatOctalDigit(state)) {
+ var n2 = state.lastIntValue;
+ if (n1 <= 3 && this.regexp_eatOctalDigit(state)) {
+ state.lastIntValue = n1 * 64 + n2 * 8 + state.lastIntValue;
+ } else {
+ state.lastIntValue = n1 * 8 + n2;
+ }
+ } else {
+ state.lastIntValue = n1;
+ }
+ return true
+ }
+ return false
+ };
+
+ // https://www.ecma-international.org/ecma-262/8.0/#prod-OctalDigit
+ pp$8.regexp_eatOctalDigit = function(state) {
+ var ch = state.current();
+ if (isOctalDigit(ch)) {
+ state.lastIntValue = ch - 0x30; /* 0 */
+ state.advance();
+ return true
+ }
+ state.lastIntValue = 0;
+ return false
+ };
+ function isOctalDigit(ch) {
+ return ch >= 0x30 /* 0 */ && ch <= 0x37 /* 7 */
+ }
+
+ // https://www.ecma-international.org/ecma-262/8.0/#prod-Hex4Digits
+ // https://www.ecma-international.org/ecma-262/8.0/#prod-HexDigit
+ // And HexDigit HexDigit in https://www.ecma-international.org/ecma-262/8.0/#prod-HexEscapeSequence
+ pp$8.regexp_eatFixedHexDigits = function(state, length) {
+ var start = state.pos;
+ state.lastIntValue = 0;
+ for (var i = 0; i < length; ++i) {
+ var ch = state.current();
+ if (!isHexDigit(ch)) {
+ state.pos = start;
+ return false
+ }
+ state.lastIntValue = 16 * state.lastIntValue + hexToInt(ch);
+ state.advance();
+ }
+ return true
+ };
+
+ // Object type used to represent tokens. Note that normally, tokens
+ // simply exist as properties on the parser object. This is only
+ // used for the onToken callback and the external tokenizer.
+
+ var Token = function Token(p) {
+ this.type = p.type;
+ this.value = p.value;
+ this.start = p.start;
+ this.end = p.end;
+ if (p.options.locations)
+ { this.loc = new SourceLocation(p, p.startLoc, p.endLoc); }
+ if (p.options.ranges)
+ { this.range = [p.start, p.end]; }
+ };
+
+ // ## Tokenizer
+
+ var pp$9 = Parser.prototype;
+
+ // Move to the next token
+
+ pp$9.next = function(ignoreEscapeSequenceInKeyword) {
+ if (!ignoreEscapeSequenceInKeyword && this.type.keyword && this.containsEsc)
+ { this.raiseRecoverable(this.start, "Escape sequence in keyword " + this.type.keyword); }
+ if (this.options.onToken)
+ { this.options.onToken(new Token(this)); }
+
+ this.lastTokEnd = this.end;
+ this.lastTokStart = this.start;
+ this.lastTokEndLoc = this.endLoc;
+ this.lastTokStartLoc = this.startLoc;
+ this.nextToken();
+ };
+
+ pp$9.getToken = function() {
+ this.next();
+ return new Token(this)
+ };
+
+ // If we're in an ES6 environment, make parsers iterable
+ if (typeof Symbol !== "undefined")
+ { pp$9[Symbol.iterator] = function() {
+ var this$1 = this;
+
+ return {
+ next: function () {
+ var token = this$1.getToken();
+ return {
+ done: token.type === types.eof,
+ value: token
+ }
+ }
+ }
+ }; }
+
+ // Toggle strict mode. Re-reads the next number or string to please
+ // pedantic tests (`"use strict"; 010;` should fail).
+
+ pp$9.curContext = function() {
+ return this.context[this.context.length - 1]
+ };
+
+ // Read a single token, updating the parser object's token-related
+ // properties.
+
+ pp$9.nextToken = function() {
+ var curContext = this.curContext();
+ if (!curContext || !curContext.preserveSpace) { this.skipSpace(); }
+
+ this.start = this.pos;
+ if (this.options.locations) { this.startLoc = this.curPosition(); }
+ if (this.pos >= this.input.length) { return this.finishToken(types.eof) }
+
+ if (curContext.override) { return curContext.override(this) }
+ else { this.readToken(this.fullCharCodeAtPos()); }
+ };
+
+ pp$9.readToken = function(code) {
+ // Identifier or keyword. '\uXXXX' sequences are allowed in
+ // identifiers, so '\' also dispatches to that.
+ if (isIdentifierStart(code, this.options.ecmaVersion >= 6) || code === 92 /* '\' */)
+ { return this.readWord() }
+
+ return this.getTokenFromCode(code)
+ };
+
+ pp$9.fullCharCodeAtPos = function() {
+ var code = this.input.charCodeAt(this.pos);
+ if (code <= 0xd7ff || code >= 0xe000) { return code }
+ var next = this.input.charCodeAt(this.pos + 1);
+ return (code << 10) + next - 0x35fdc00
+ };
+
+ pp$9.skipBlockComment = function() {
+ var startLoc = this.options.onComment && this.curPosition();
+ var start = this.pos, end = this.input.indexOf("*/", this.pos += 2);
+ if (end === -1) { this.raise(this.pos - 2, "Unterminated comment"); }
+ this.pos = end + 2;
+ if (this.options.locations) {
+ lineBreakG.lastIndex = start;
+ var match;
+ while ((match = lineBreakG.exec(this.input)) && match.index < this.pos) {
+ ++this.curLine;
+ this.lineStart = match.index + match[0].length;
+ }
+ }
+ if (this.options.onComment)
+ { this.options.onComment(true, this.input.slice(start + 2, end), start, this.pos,
+ startLoc, this.curPosition()); }
+ };
+
+ pp$9.skipLineComment = function(startSkip) {
+ var start = this.pos;
+ var startLoc = this.options.onComment && this.curPosition();
+ var ch = this.input.charCodeAt(this.pos += startSkip);
+ while (this.pos < this.input.length && !isNewLine(ch)) {
+ ch = this.input.charCodeAt(++this.pos);
+ }
+ if (this.options.onComment)
+ { this.options.onComment(false, this.input.slice(start + startSkip, this.pos), start, this.pos,
+ startLoc, this.curPosition()); }
+ };
+
+ // Called at the start of the parse and after every token. Skips
+ // whitespace and comments, and.
+
+ pp$9.skipSpace = function() {
+ loop: while (this.pos < this.input.length) {
+ var ch = this.input.charCodeAt(this.pos);
+ switch (ch) {
+ case 32: case 160: // ' '
+ ++this.pos;
+ break
+ case 13:
+ if (this.input.charCodeAt(this.pos + 1) === 10) {
+ ++this.pos;
+ }
+ case 10: case 8232: case 8233:
+ ++this.pos;
+ if (this.options.locations) {
+ ++this.curLine;
+ this.lineStart = this.pos;
+ }
+ break
+ case 47: // '/'
+ switch (this.input.charCodeAt(this.pos + 1)) {
+ case 42: // '*'
+ this.skipBlockComment();
+ break
+ case 47:
+ this.skipLineComment(2);
+ break
+ default:
+ break loop
+ }
+ break
+ default:
+ if (ch > 8 && ch < 14 || ch >= 5760 && nonASCIIwhitespace.test(String.fromCharCode(ch))) {
+ ++this.pos;
+ } else {
+ break loop
+ }
+ }
+ }
+ };
+
+ // Called at the end of every token. Sets `end`, `val`, and
+ // maintains `context` and `exprAllowed`, and skips the space after
+ // the token, so that the next one's `start` will point at the
+ // right position.
+
+ pp$9.finishToken = function(type, val) {
+ this.end = this.pos;
+ if (this.options.locations) { this.endLoc = this.curPosition(); }
+ var prevType = this.type;
+ this.type = type;
+ this.value = val;
+
+ this.updateContext(prevType);
+ };
+
+ // ### Token reading
+
+ // This is the function that is called to fetch the next token. It
+ // is somewhat obscure, because it works in character codes rather
+ // than characters, and because operator parsing has been inlined
+ // into it.
+ //
+ // All in the name of speed.
+ //
+ pp$9.readToken_dot = function() {
+ var next = this.input.charCodeAt(this.pos + 1);
+ if (next >= 48 && next <= 57) { return this.readNumber(true) }
+ var next2 = this.input.charCodeAt(this.pos + 2);
+ if (this.options.ecmaVersion >= 6 && next === 46 && next2 === 46) { // 46 = dot '.'
+ this.pos += 3;
+ return this.finishToken(types.ellipsis)
+ } else {
+ ++this.pos;
+ return this.finishToken(types.dot)
+ }
+ };
+
+ pp$9.readToken_slash = function() { // '/'
+ var next = this.input.charCodeAt(this.pos + 1);
+ if (this.exprAllowed) { ++this.pos; return this.readRegexp() }
+ if (next === 61) { return this.finishOp(types.assign, 2) }
+ return this.finishOp(types.slash, 1)
+ };
+
+ pp$9.readToken_mult_modulo_exp = function(code) { // '%*'
+ var next = this.input.charCodeAt(this.pos + 1);
+ var size = 1;
+ var tokentype = code === 42 ? types.star : types.modulo;
+
+ // exponentiation operator ** and **=
+ if (this.options.ecmaVersion >= 7 && code === 42 && next === 42) {
+ ++size;
+ tokentype = types.starstar;
+ next = this.input.charCodeAt(this.pos + 2);
+ }
+
+ if (next === 61) { return this.finishOp(types.assign, size + 1) }
+ return this.finishOp(tokentype, size)
+ };
+
+ pp$9.readToken_pipe_amp = function(code) { // '|&'
+ var next = this.input.charCodeAt(this.pos + 1);
+ if (next === code) {
+ if (this.options.ecmaVersion >= 12) {
+ var next2 = this.input.charCodeAt(this.pos + 2);
+ if (next2 === 61) { return this.finishOp(types.assign, 3) }
+ }
+ return this.finishOp(code === 124 ? types.logicalOR : types.logicalAND, 2)
+ }
+ if (next === 61) { return this.finishOp(types.assign, 2) }
+ return this.finishOp(code === 124 ? types.bitwiseOR : types.bitwiseAND, 1)
+ };
+
+ pp$9.readToken_caret = function() { // '^'
+ var next = this.input.charCodeAt(this.pos + 1);
+ if (next === 61) { return this.finishOp(types.assign, 2) }
+ return this.finishOp(types.bitwiseXOR, 1)
+ };
+
+ pp$9.readToken_plus_min = function(code) { // '+-'
+ var next = this.input.charCodeAt(this.pos + 1);
+ if (next === code) {
+ if (next === 45 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 62 &&
+ (this.lastTokEnd === 0 || lineBreak.test(this.input.slice(this.lastTokEnd, this.pos)))) {
+ // A `-->` line comment
+ this.skipLineComment(3);
+ this.skipSpace();
+ return this.nextToken()
+ }
+ return this.finishOp(types.incDec, 2)
+ }
+ if (next === 61) { return this.finishOp(types.assign, 2) }
+ return this.finishOp(types.plusMin, 1)
+ };
+
+ pp$9.readToken_lt_gt = function(code) { // '<>'
+ var next = this.input.charCodeAt(this.pos + 1);
+ var size = 1;
+ if (next === code) {
+ size = code === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2;
+ if (this.input.charCodeAt(this.pos + size) === 61) { return this.finishOp(types.assign, size + 1) }
+ return this.finishOp(types.bitShift, size)
+ }
+ if (next === 33 && code === 60 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 45 &&
+ this.input.charCodeAt(this.pos + 3) === 45) {
+ // `<!--`, an XML-style comment that should be interpreted as a line comment
+ this.skipLineComment(4);
+ this.skipSpace();
+ return this.nextToken()
+ }
+ if (next === 61) { size = 2; }
+ return this.finishOp(types.relational, size)
+ };
+
+ pp$9.readToken_eq_excl = function(code) { // '=!'
+ var next = this.input.charCodeAt(this.pos + 1);
+ if (next === 61) { return this.finishOp(types.equality, this.input.charCodeAt(this.pos + 2) === 61 ? 3 : 2) }
+ if (code === 61 && next === 62 && this.options.ecmaVersion >= 6) { // '=>'
+ this.pos += 2;
+ return this.finishToken(types.arrow)
+ }
+ return this.finishOp(code === 61 ? types.eq : types.prefix, 1)
+ };
+
+ pp$9.readToken_question = function() { // '?'
+ var ecmaVersion = this.options.ecmaVersion;
+ if (ecmaVersion >= 11) {
+ var next = this.input.charCodeAt(this.pos + 1);
+ if (next === 46) {
+ var next2 = this.input.charCodeAt(this.pos + 2);
+ if (next2 < 48 || next2 > 57) { return this.finishOp(types.questionDot, 2) }
+ }
+ if (next === 63) {
+ if (ecmaVersion >= 12) {
+ var next2$1 = this.input.charCodeAt(this.pos + 2);
+ if (next2$1 === 61) { return this.finishOp(types.assign, 3) }
+ }
+ return this.finishOp(types.coalesce, 2)
+ }
+ }
+ return this.finishOp(types.question, 1)
+ };
+
+ pp$9.getTokenFromCode = function(code) {
+ switch (code) {
+ // The interpretation of a dot depends on whether it is followed
+ // by a digit or another two dots.
+ case 46: // '.'
+ return this.readToken_dot()
+
+ // Punctuation tokens.
+ case 40: ++this.pos; return this.finishToken(types.parenL)
+ case 41: ++this.pos; return this.finishToken(types.parenR)
+ case 59: ++this.pos; return this.finishToken(types.semi)
+ case 44: ++this.pos; return this.finishToken(types.comma)
+ case 91: ++this.pos; return this.finishToken(types.bracketL)
+ case 93: ++this.pos; return this.finishToken(types.bracketR)
+ case 123: ++this.pos; return this.finishToken(types.braceL)
+ case 125: ++this.pos; return this.finishToken(types.braceR)
+ case 58: ++this.pos; return this.finishToken(types.colon)
+
+ case 96: // '`'
+ if (this.options.ecmaVersion < 6) { break }
+ ++this.pos;
+ return this.finishToken(types.backQuote)
+
+ case 48: // '0'
+ var next = this.input.charCodeAt(this.pos + 1);
+ if (next === 120 || next === 88) { return this.readRadixNumber(16) } // '0x', '0X' - hex number
+ if (this.options.ecmaVersion >= 6) {
+ if (next === 111 || next === 79) { return this.readRadixNumber(8) } // '0o', '0O' - octal number
+ if (next === 98 || next === 66) { return this.readRadixNumber(2) } // '0b', '0B' - binary number
+ }
+
+ // Anything else beginning with a digit is an integer, octal
+ // number, or float.
+ case 49: case 50: case 51: case 52: case 53: case 54: case 55: case 56: case 57: // 1-9
+ return this.readNumber(false)
+
+ // Quotes produce strings.
+ case 34: case 39: // '"', "'"
+ return this.readString(code)
+
+ // Operators are parsed inline in tiny state machines. '=' (61) is
+ // often referred to. `finishOp` simply skips the amount of
+ // characters it is given as second argument, and returns a token
+ // of the type given by its first argument.
+
+ case 47: // '/'
+ return this.readToken_slash()
+
+ case 37: case 42: // '%*'
+ return this.readToken_mult_modulo_exp(code)
+
+ case 124: case 38: // '|&'
+ return this.readToken_pipe_amp(code)
+
+ case 94: // '^'
+ return this.readToken_caret()
+
+ case 43: case 45: // '+-'
+ return this.readToken_plus_min(code)
+
+ case 60: case 62: // '<>'
+ return this.readToken_lt_gt(code)
+
+ case 61: case 33: // '=!'
+ return this.readToken_eq_excl(code)
+
+ case 63: // '?'
+ return this.readToken_question()
+
+ case 126: // '~'
+ return this.finishOp(types.prefix, 1)
+ }
+
+ this.raise(this.pos, "Unexpected character '" + codePointToString$1(code) + "'");
+ };
+
+ pp$9.finishOp = function(type, size) {
+ var str = this.input.slice(this.pos, this.pos + size);
+ this.pos += size;
+ return this.finishToken(type, str)
+ };
+
+ pp$9.readRegexp = function() {
+ var escaped, inClass, start = this.pos;
+ for (;;) {
+ if (this.pos >= this.input.length) { this.raise(start, "Unterminated regular expression"); }
+ var ch = this.input.charAt(this.pos);
+ if (lineBreak.test(ch)) { this.raise(start, "Unterminated regular expression"); }
+ if (!escaped) {
+ if (ch === "[") { inClass = true; }
+ else if (ch === "]" && inClass) { inClass = false; }
+ else if (ch === "/" && !inClass) { break }
+ escaped = ch === "\\";
+ } else { escaped = false; }
+ ++this.pos;
+ }
+ var pattern = this.input.slice(start, this.pos);
+ ++this.pos;
+ var flagsStart = this.pos;
+ var flags = this.readWord1();
+ if (this.containsEsc) { this.unexpected(flagsStart); }
+
+ // Validate pattern
+ var state = this.regexpState || (this.regexpState = new RegExpValidationState(this));
+ state.reset(start, pattern, flags);
+ this.validateRegExpFlags(state);
+ this.validateRegExpPattern(state);
+
+ // Create Literal#value property value.
+ var value = null;
+ try {
+ value = new RegExp(pattern, flags);
+ } catch (e) {
+ // ESTree requires null if it failed to instantiate RegExp object.
+ // https://github.com/estree/estree/blob/a27003adf4fd7bfad44de9cef372a2eacd527b1c/es5.md#regexpliteral
+ }
+
+ return this.finishToken(types.regexp, {pattern: pattern, flags: flags, value: value})
+ };
+
+ // Read an integer in the given radix. Return null if zero digits
+ // were read, the integer value otherwise. When `len` is given, this
+ // will return `null` unless the integer has exactly `len` digits.
+
+ pp$9.readInt = function(radix, len, maybeLegacyOctalNumericLiteral) {
+ // `len` is used for character escape sequences. In that case, disallow separators.
+ var allowSeparators = this.options.ecmaVersion >= 12 && len === undefined;
+
+ // `maybeLegacyOctalNumericLiteral` is true if it doesn't have prefix (0x,0o,0b)
+ // and isn't fraction part nor exponent part. In that case, if the first digit
+ // is zero then disallow separators.
+ var isLegacyOctalNumericLiteral = maybeLegacyOctalNumericLiteral && this.input.charCodeAt(this.pos) === 48;
+
+ var start = this.pos, total = 0, lastCode = 0;
+ for (var i = 0, e = len == null ? Infinity : len; i < e; ++i, ++this.pos) {
+ var code = this.input.charCodeAt(this.pos), val = (void 0);
+
+ if (allowSeparators && code === 95) {
+ if (isLegacyOctalNumericLiteral) { this.raiseRecoverable(this.pos, "Numeric separator is not allowed in legacy octal numeric literals"); }
+ if (lastCode === 95) { this.raiseRecoverable(this.pos, "Numeric separator must be exactly one underscore"); }
+ if (i === 0) { this.raiseRecoverable(this.pos, "Numeric separator is not allowed at the first of digits"); }
+ lastCode = code;
+ continue
+ }
+
+ if (code >= 97) { val = code - 97 + 10; } // a
+ else if (code >= 65) { val = code - 65 + 10; } // A
+ else if (code >= 48 && code <= 57) { val = code - 48; } // 0-9
+ else { val = Infinity; }
+ if (val >= radix) { break }
+ lastCode = code;
+ total = total * radix + val;
+ }
+
+ if (allowSeparators && lastCode === 95) { this.raiseRecoverable(this.pos - 1, "Numeric separator is not allowed at the last of digits"); }
+ if (this.pos === start || len != null && this.pos - start !== len) { return null }
+
+ return total
+ };
+
+ function stringToNumber(str, isLegacyOctalNumericLiteral) {
+ if (isLegacyOctalNumericLiteral) {
+ return parseInt(str, 8)
+ }
+
+ // `parseFloat(value)` stops parsing at the first numeric separator then returns a wrong value.
+ return parseFloat(str.replace(/_/g, ""))
+ }
+
+ function stringToBigInt(str) {
+ if (typeof BigInt !== "function") {
+ return null
+ }
+
+ // `BigInt(value)` throws syntax error if the string contains numeric separators.
+ return BigInt(str.replace(/_/g, ""))
+ }
+
+ pp$9.readRadixNumber = function(radix) {
+ var start = this.pos;
+ this.pos += 2; // 0x
+ var val = this.readInt(radix);
+ if (val == null) { this.raise(this.start + 2, "Expected number in radix " + radix); }
+ if (this.options.ecmaVersion >= 11 && this.input.charCodeAt(this.pos) === 110) {
+ val = stringToBigInt(this.input.slice(start, this.pos));
+ ++this.pos;
+ } else if (isIdentifierStart(this.fullCharCodeAtPos())) { this.raise(this.pos, "Identifier directly after number"); }
+ return this.finishToken(types.num, val)
+ };
+
+ // Read an integer, octal integer, or floating-point number.
+
+ pp$9.readNumber = function(startsWithDot) {
+ var start = this.pos;
+ if (!startsWithDot && this.readInt(10, undefined, true) === null) { this.raise(start, "Invalid number"); }
+ var octal = this.pos - start >= 2 && this.input.charCodeAt(start) === 48;
+ if (octal && this.strict) { this.raise(start, "Invalid number"); }
+ var next = this.input.charCodeAt(this.pos);
+ if (!octal && !startsWithDot && this.options.ecmaVersion >= 11 && next === 110) {
+ var val$1 = stringToBigInt(this.input.slice(start, this.pos));
+ ++this.pos;
+ if (isIdentifierStart(this.fullCharCodeAtPos())) { this.raise(this.pos, "Identifier directly after number"); }
+ return this.finishToken(types.num, val$1)
+ }
+ if (octal && /[89]/.test(this.input.slice(start, this.pos))) { octal = false; }
+ if (next === 46 && !octal) { // '.'
+ ++this.pos;
+ this.readInt(10);
+ next = this.input.charCodeAt(this.pos);
+ }
+ if ((next === 69 || next === 101) && !octal) { // 'eE'
+ next = this.input.charCodeAt(++this.pos);
+ if (next === 43 || next === 45) { ++this.pos; } // '+-'
+ if (this.readInt(10) === null) { this.raise(start, "Invalid number"); }
+ }
+ if (isIdentifierStart(this.fullCharCodeAtPos())) { this.raise(this.pos, "Identifier directly after number"); }
+
+ var val = stringToNumber(this.input.slice(start, this.pos), octal);
+ return this.finishToken(types.num, val)
+ };
+
+ // Read a string value, interpreting backslash-escapes.
+
+ pp$9.readCodePoint = function() {
+ var ch = this.input.charCodeAt(this.pos), code;
+
+ if (ch === 123) { // '{'
+ if (this.options.ecmaVersion < 6) { this.unexpected(); }
+ var codePos = ++this.pos;
+ code = this.readHexChar(this.input.indexOf("}", this.pos) - this.pos);
+ ++this.pos;
+ if (code > 0x10FFFF) { this.invalidStringToken(codePos, "Code point out of bounds"); }
+ } else {
+ code = this.readHexChar(4);
+ }
+ return code
+ };
+
+ function codePointToString$1(code) {
+ // UTF-16 Decoding
+ if (code <= 0xFFFF) { return String.fromCharCode(code) }
+ code -= 0x10000;
+ return String.fromCharCode((code >> 10) + 0xD800, (code & 1023) + 0xDC00)
+ }
+
+ pp$9.readString = function(quote) {
+ var out = "", chunkStart = ++this.pos;
+ for (;;) {
+ if (this.pos >= this.input.length) { this.raise(this.start, "Unterminated string constant"); }
+ var ch = this.input.charCodeAt(this.pos);
+ if (ch === quote) { break }
+ if (ch === 92) { // '\'
+ out += this.input.slice(chunkStart, this.pos);
+ out += this.readEscapedChar(false);
+ chunkStart = this.pos;
+ } else {
+ if (isNewLine(ch, this.options.ecmaVersion >= 10)) { this.raise(this.start, "Unterminated string constant"); }
+ ++this.pos;
+ }
+ }
+ out += this.input.slice(chunkStart, this.pos++);
+ return this.finishToken(types.string, out)
+ };
+
+ // Reads template string tokens.
+
+ var INVALID_TEMPLATE_ESCAPE_ERROR = {};
+
+ pp$9.tryReadTemplateToken = function() {
+ this.inTemplateElement = true;
+ try {
+ this.readTmplToken();
+ } catch (err) {
+ if (err === INVALID_TEMPLATE_ESCAPE_ERROR) {
+ this.readInvalidTemplateToken();
+ } else {
+ throw err
+ }
+ }
+
+ this.inTemplateElement = false;
+ };
+
+ pp$9.invalidStringToken = function(position, message) {
+ if (this.inTemplateElement && this.options.ecmaVersion >= 9) {
+ throw INVALID_TEMPLATE_ESCAPE_ERROR
+ } else {
+ this.raise(position, message);
+ }
+ };
+
+ pp$9.readTmplToken = function() {
+ var out = "", chunkStart = this.pos;
+ for (;;) {
+ if (this.pos >= this.input.length) { this.raise(this.start, "Unterminated template"); }
+ var ch = this.input.charCodeAt(this.pos);
+ if (ch === 96 || ch === 36 && this.input.charCodeAt(this.pos + 1) === 123) { // '`', '${'
+ if (this.pos === this.start && (this.type === types.template || this.type === types.invalidTemplate)) {
+ if (ch === 36) {
+ this.pos += 2;
+ return this.finishToken(types.dollarBraceL)
+ } else {
+ ++this.pos;
+ return this.finishToken(types.backQuote)
+ }
+ }
+ out += this.input.slice(chunkStart, this.pos);
+ return this.finishToken(types.template, out)
+ }
+ if (ch === 92) { // '\'
+ out += this.input.slice(chunkStart, this.pos);
+ out += this.readEscapedChar(true);
+ chunkStart = this.pos;
+ } else if (isNewLine(ch)) {
+ out += this.input.slice(chunkStart, this.pos);
+ ++this.pos;
+ switch (ch) {
+ case 13:
+ if (this.input.charCodeAt(this.pos) === 10) { ++this.pos; }
+ case 10:
+ out += "\n";
+ break
+ default:
+ out += String.fromCharCode(ch);
+ break
+ }
+ if (this.options.locations) {
+ ++this.curLine;
+ this.lineStart = this.pos;
+ }
+ chunkStart = this.pos;
+ } else {
+ ++this.pos;
+ }
+ }
+ };
+
+ // Reads a template token to search for the end, without validating any escape sequences
+ pp$9.readInvalidTemplateToken = function() {
+ for (; this.pos < this.input.length; this.pos++) {
+ switch (this.input[this.pos]) {
+ case "\\":
+ ++this.pos;
+ break
+
+ case "$":
+ if (this.input[this.pos + 1] !== "{") {
+ break
+ }
+ // falls through
+
+ case "`":
+ return this.finishToken(types.invalidTemplate, this.input.slice(this.start, this.pos))
+
+ // no default
+ }
+ }
+ this.raise(this.start, "Unterminated template");
+ };
+
+ // Used to read escaped characters
+
+ pp$9.readEscapedChar = function(inTemplate) {
+ var ch = this.input.charCodeAt(++this.pos);
+ ++this.pos;
+ switch (ch) {
+ case 110: return "\n" // 'n' -> '\n'
+ case 114: return "\r" // 'r' -> '\r'
+ case 120: return String.fromCharCode(this.readHexChar(2)) // 'x'
+ case 117: return codePointToString$1(this.readCodePoint()) // 'u'
+ case 116: return "\t" // 't' -> '\t'
+ case 98: return "\b" // 'b' -> '\b'
+ case 118: return "\u000b" // 'v' -> '\u000b'
+ case 102: return "\f" // 'f' -> '\f'
+ case 13: if (this.input.charCodeAt(this.pos) === 10) { ++this.pos; } // '\r\n'
+ case 10: // ' \n'
+ if (this.options.locations) { this.lineStart = this.pos; ++this.curLine; }
+ return ""
+ case 56:
+ case 57:
+ if (this.strict) {
+ this.invalidStringToken(
+ this.pos - 1,
+ "Invalid escape sequence"
+ );
+ }
+ if (inTemplate) {
+ var codePos = this.pos - 1;
+
+ this.invalidStringToken(
+ codePos,
+ "Invalid escape sequence in template string"
+ );
+
+ return null
+ }
+ default:
+ if (ch >= 48 && ch <= 55) {
+ var octalStr = this.input.substr(this.pos - 1, 3).match(/^[0-7]+/)[0];
+ var octal = parseInt(octalStr, 8);
+ if (octal > 255) {
+ octalStr = octalStr.slice(0, -1);
+ octal = parseInt(octalStr, 8);
+ }
+ this.pos += octalStr.length - 1;
+ ch = this.input.charCodeAt(this.pos);
+ if ((octalStr !== "0" || ch === 56 || ch === 57) && (this.strict || inTemplate)) {
+ this.invalidStringToken(
+ this.pos - 1 - octalStr.length,
+ inTemplate
+ ? "Octal literal in template string"
+ : "Octal literal in strict mode"
+ );
+ }
+ return String.fromCharCode(octal)
+ }
+ if (isNewLine(ch)) {
+ // Unicode new line characters after \ get removed from output in both
+ // template literals and strings
+ return ""
+ }
+ return String.fromCharCode(ch)
+ }
+ };
+
+ // Used to read character escape sequences ('\x', '\u', '\U').
+
+ pp$9.readHexChar = function(len) {
+ var codePos = this.pos;
+ var n = this.readInt(16, len);
+ if (n === null) { this.invalidStringToken(codePos, "Bad character escape sequence"); }
+ return n
+ };
+
+ // Read an identifier, and return it as a string. Sets `this.containsEsc`
+ // to whether the word contained a '\u' escape.
+ //
+ // Incrementally adds only escaped chars, adding other chunks as-is
+ // as a micro-optimization.
+
+ pp$9.readWord1 = function() {
+ this.containsEsc = false;
+ var word = "", first = true, chunkStart = this.pos;
+ var astral = this.options.ecmaVersion >= 6;
+ while (this.pos < this.input.length) {
+ var ch = this.fullCharCodeAtPos();
+ if (isIdentifierChar(ch, astral)) {
+ this.pos += ch <= 0xffff ? 1 : 2;
+ } else if (ch === 92) { // "\"
+ this.containsEsc = true;
+ word += this.input.slice(chunkStart, this.pos);
+ var escStart = this.pos;
+ if (this.input.charCodeAt(++this.pos) !== 117) // "u"
+ { this.invalidStringToken(this.pos, "Expecting Unicode escape sequence \\uXXXX"); }
+ ++this.pos;
+ var esc = this.readCodePoint();
+ if (!(first ? isIdentifierStart : isIdentifierChar)(esc, astral))
+ { this.invalidStringToken(escStart, "Invalid Unicode escape"); }
+ word += codePointToString$1(esc);
+ chunkStart = this.pos;
+ } else {
+ break
+ }
+ first = false;
+ }
+ return word + this.input.slice(chunkStart, this.pos)
+ };
+
+ // Read an identifier or keyword token. Will check for reserved
+ // words when necessary.
+
+ pp$9.readWord = function() {
+ var word = this.readWord1();
+ var type = types.name;
+ if (this.keywords.test(word)) {
+ type = keywords$1[word];
+ }
+ return this.finishToken(type, word)
+ };
+
+ // Acorn is a tiny, fast JavaScript parser written in JavaScript.
+
+ var version = "8.0.4";
+
+ Parser.acorn = {
+ Parser: Parser,
+ version: version,
+ defaultOptions: defaultOptions,
+ Position: Position,
+ SourceLocation: SourceLocation,
+ getLineInfo: getLineInfo,
+ Node: Node,
+ TokenType: TokenType,
+ tokTypes: types,
+ keywordTypes: keywords$1,
+ TokContext: TokContext,
+ tokContexts: types$1,
+ isIdentifierChar: isIdentifierChar,
+ isIdentifierStart: isIdentifierStart,
+ Token: Token,
+ isNewLine: isNewLine,
+ lineBreak: lineBreak,
+ lineBreakG: lineBreakG,
+ nonASCIIwhitespace: nonASCIIwhitespace
+ };
+
+ // The main exported interface (under `self.acorn` when in the
+ // browser) is a `parse` function that takes a code string and
+ // returns an abstract syntax tree as specified by [Mozilla parser
+ // API][api].
+ //
+ // [api]: https://developer.mozilla.org/en-US/docs/SpiderMonkey/Parser_API
+
+ function parse(input, options) {
+ return Parser.parse(input, options)
+ }
+
+ // This function tries to parse a single expression at a given
+ // offset in a string. Useful for parsing mixed-language formats
+ // that embed JavaScript expressions.
+
+ function parseExpressionAt(input, pos, options) {
+ return Parser.parseExpressionAt(input, pos, options)
+ }
+
+ // Acorn is organized as a tokenizer and a recursive-descent parser.
+ // The `tokenizer` export provides an interface to the tokenizer.
+
+ function tokenizer(input, options) {
+ return Parser.tokenizer(input, options)
+ }
+
+ exports.Node = Node;
+ exports.Parser = Parser;
+ exports.Position = Position;
+ exports.SourceLocation = SourceLocation;
+ exports.TokContext = TokContext;
+ exports.Token = Token;
+ exports.TokenType = TokenType;
+ exports.defaultOptions = defaultOptions;
+ exports.getLineInfo = getLineInfo;
+ exports.isIdentifierChar = isIdentifierChar;
+ exports.isIdentifierStart = isIdentifierStart;
+ exports.isNewLine = isNewLine;
+ exports.keywordTypes = keywords$1;
+ exports.lineBreak = lineBreak;
+ exports.lineBreakG = lineBreakG;
+ exports.nonASCIIwhitespace = nonASCIIwhitespace;
+ exports.parse = parse;
+ exports.parseExpressionAt = parseExpressionAt;
+ exports.tokContexts = types$1;
+ exports.tokTypes = types;
+ exports.tokenizer = tokenizer;
+ exports.version = version;
+
+ Object.defineProperty(exports, '__esModule', { value: true });
+
+})));
+//# sourceMappingURL=acorn.js.map
+
+
+/***/ })
+
+/******/ });
+}); \ No newline at end of file
diff --git a/devtools/client/debugger/dist/search-worker.js b/devtools/client/debugger/dist/search-worker.js
new file mode 100644
index 0000000000..ac6beee3bb
--- /dev/null
+++ b/devtools/client/debugger/dist/search-worker.js
@@ -0,0 +1,1237 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+(function webpackUniversalModuleDefinition(root, factory) {
+ if(typeof exports === 'object' && typeof module === 'object')
+ module.exports = factory();
+ else if(typeof define === 'function' && define.amd)
+ define([], factory);
+ else {
+ var a = factory();
+ for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
+ }
+})(typeof self !== 'undefined' ? self : 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, {
+/******/ configurable: false,
+/******/ enumerable: true,
+/******/ get: getter
+/******/ });
+/******/ }
+/******/ };
+/******/
+/******/ // 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 = "/assets/build";
+/******/
+/******/ // Load entry module and return exports
+/******/ return __webpack_require__(__webpack_require__.s = 904);
+/******/ })
+/************************************************************************/
+/******/ ({
+
+/***/ 560:
+/***/ (function(module, exports, __webpack_require__) {
+
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+const networkRequest = __webpack_require__(567);
+
+const workerUtils = __webpack_require__(568);
+
+module.exports = {
+ networkRequest,
+ workerUtils
+};
+
+/***/ }),
+
+/***/ 562:
+/***/ (function(module, exports, __webpack_require__) {
+
+var freeGlobal = __webpack_require__(589);
+
+/** Detect free variable `self`. */
+var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
+
+/** Used as a reference to the global object. */
+var root = freeGlobal || freeSelf || Function('return this')();
+
+module.exports = root;
+
+
+/***/ }),
+
+/***/ 563:
+/***/ (function(module, exports) {
+
+/**
+ * Checks if `value` is classified as an `Array` object.
+ *
+ * @static
+ * @memberOf _
+ * @since 0.1.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is an array, else `false`.
+ * @example
+ *
+ * _.isArray([1, 2, 3]);
+ * // => true
+ *
+ * _.isArray(document.body.children);
+ * // => false
+ *
+ * _.isArray('abc');
+ * // => false
+ *
+ * _.isArray(_.noop);
+ * // => false
+ */
+var isArray = Array.isArray;
+
+module.exports = isArray;
+
+
+/***/ }),
+
+/***/ 565:
+/***/ (function(module, exports) {
+
+/**
+ * Checks if `value` is object-like. A value is object-like if it's not `null`
+ * and has a `typeof` result of "object".
+ *
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
+ * @example
+ *
+ * _.isObjectLike({});
+ * // => true
+ *
+ * _.isObjectLike([1, 2, 3]);
+ * // => true
+ *
+ * _.isObjectLike(_.noop);
+ * // => false
+ *
+ * _.isObjectLike(null);
+ * // => false
+ */
+function isObjectLike(value) {
+ return value != null && typeof value == 'object';
+}
+
+module.exports = isObjectLike;
+
+
+/***/ }),
+
+/***/ 567:
+/***/ (function(module, exports) {
+
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+function networkRequest(url, opts) {
+ return fetch(url, {
+ cache: opts.loadFromCache ? "default" : "no-cache"
+ }).then(res => {
+ if (res.status >= 200 && res.status < 300) {
+ if (res.headers.get("Content-Type") === "application/wasm") {
+ return res.arrayBuffer().then(buffer => ({
+ content: buffer,
+ isDwarf: true
+ }));
+ }
+
+ return res.text().then(text => ({
+ content: text
+ }));
+ }
+
+ return Promise.reject(`request failed with status ${res.status}`);
+ });
+}
+
+module.exports = networkRequest;
+
+/***/ }),
+
+/***/ 568:
+/***/ (function(module, exports) {
+
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+function WorkerDispatcher() {
+ this.msgId = 1;
+ this.worker = null;
+}
+
+WorkerDispatcher.prototype = {
+ start(url, win = window) {
+ this.worker = new win.Worker(url);
+
+ this.worker.onerror = err => {
+ console.error(`Error in worker ${url}`, err.message);
+ };
+ },
+
+ stop() {
+ if (!this.worker) {
+ return;
+ }
+
+ this.worker.terminate();
+ this.worker = null;
+ },
+
+ task(method, {
+ queue = false
+ } = {}) {
+ const calls = [];
+
+ const push = args => {
+ return new Promise((resolve, reject) => {
+ if (queue && calls.length === 0) {
+ Promise.resolve().then(flush);
+ }
+
+ calls.push([args, resolve, reject]);
+
+ if (!queue) {
+ flush();
+ }
+ });
+ };
+
+ const flush = () => {
+ const items = calls.slice();
+ calls.length = 0;
+
+ if (!this.worker) {
+ return;
+ }
+
+ const id = this.msgId++;
+ this.worker.postMessage({
+ id,
+ method,
+ calls: items.map(item => item[0])
+ });
+
+ const listener = ({
+ data: result
+ }) => {
+ if (result.id !== id) {
+ return;
+ }
+
+ if (!this.worker) {
+ return;
+ }
+
+ this.worker.removeEventListener("message", listener);
+ result.results.forEach((resultData, i) => {
+ const [, resolve, reject] = items[i];
+
+ if (resultData.error) {
+ const err = new Error(resultData.message);
+ err.metadata = resultData.metadata;
+ reject(err);
+ } else {
+ resolve(resultData.response);
+ }
+ });
+ };
+
+ this.worker.addEventListener("message", listener);
+ };
+
+ return (...args) => push(args);
+ },
+
+ invoke(method, ...args) {
+ return this.task(method)(...args);
+ }
+
+};
+
+function workerHandler(publicInterface) {
+ return function (msg) {
+ const {
+ id,
+ method,
+ calls
+ } = msg.data;
+ Promise.all(calls.map(args => {
+ try {
+ const response = publicInterface[method].apply(undefined, args);
+
+ if (response instanceof Promise) {
+ return response.then(val => ({
+ response: val
+ }), err => asErrorMessage(err));
+ }
+
+ return {
+ response
+ };
+ } catch (error) {
+ return asErrorMessage(error);
+ }
+ })).then(results => {
+ self.postMessage({
+ id,
+ results
+ });
+ });
+ };
+}
+
+function asErrorMessage(error) {
+ if (typeof error === "object" && error && "message" in error) {
+ // Error can't be sent via postMessage, so be sure to convert to
+ // string.
+ return {
+ error: true,
+ message: error.message,
+ metadata: error.metadata
+ };
+ }
+
+ return {
+ error: true,
+ message: error == null ? error : error.toString(),
+ metadata: undefined
+ };
+}
+
+module.exports = {
+ WorkerDispatcher,
+ workerHandler
+};
+
+/***/ }),
+
+/***/ 569:
+/***/ (function(module, exports, __webpack_require__) {
+
+var Symbol = __webpack_require__(570),
+ getRawTag = __webpack_require__(615),
+ objectToString = __webpack_require__(616);
+
+/** `Object#toString` result references. */
+var nullTag = '[object Null]',
+ undefinedTag = '[object Undefined]';
+
+/** Built-in value references. */
+var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
+
+/**
+ * The base implementation of `getTag` without fallbacks for buggy environments.
+ *
+ * @private
+ * @param {*} value The value to query.
+ * @returns {string} Returns the `toStringTag`.
+ */
+function baseGetTag(value) {
+ if (value == null) {
+ return value === undefined ? undefinedTag : nullTag;
+ }
+ return (symToStringTag && symToStringTag in Object(value))
+ ? getRawTag(value)
+ : objectToString(value);
+}
+
+module.exports = baseGetTag;
+
+
+/***/ }),
+
+/***/ 570:
+/***/ (function(module, exports, __webpack_require__) {
+
+var root = __webpack_require__(562);
+
+/** Built-in value references. */
+var Symbol = root.Symbol;
+
+module.exports = Symbol;
+
+
+/***/ }),
+
+/***/ 577:
+/***/ (function(module, exports, __webpack_require__) {
+
+var baseGetTag = __webpack_require__(569),
+ isObjectLike = __webpack_require__(565);
+
+/** `Object#toString` result references. */
+var symbolTag = '[object Symbol]';
+
+/**
+ * Checks if `value` is classified as a `Symbol` primitive or object.
+ *
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
+ * @example
+ *
+ * _.isSymbol(Symbol.iterator);
+ * // => true
+ *
+ * _.isSymbol('abc');
+ * // => false
+ */
+function isSymbol(value) {
+ return typeof value == 'symbol' ||
+ (isObjectLike(value) && baseGetTag(value) == symbolTag);
+}
+
+module.exports = isSymbol;
+
+
+/***/ }),
+
+/***/ 589:
+/***/ (function(module, exports, __webpack_require__) {
+
+/* WEBPACK VAR INJECTION */(function(global) {/** Detect free variable `global` from Node.js. */
+var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
+
+module.exports = freeGlobal;
+
+/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(590)))
+
+/***/ }),
+
+/***/ 590:
+/***/ (function(module, exports) {
+
+var g;
+
+// This works in non-strict mode
+g = (function() {
+ return this;
+})();
+
+try {
+ // This works if eval is allowed (see CSP)
+ g = g || Function("return this")() || (1,eval)("this");
+} catch(e) {
+ // This works if the window reference is available
+ if(typeof window === "object")
+ g = window;
+}
+
+// g can still be undefined, but nothing to do about it...
+// We return undefined, instead of nothing here, so it's
+// easier to handle this case. if(!global) { ...}
+
+module.exports = g;
+
+
+/***/ }),
+
+/***/ 605:
+/***/ (function(module, exports, __webpack_require__) {
+
+var baseToString = __webpack_require__(639);
+
+/**
+ * Converts `value` to a string. An empty string is returned for `null`
+ * and `undefined` values. The sign of `-0` is preserved.
+ *
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @category Lang
+ * @param {*} value The value to convert.
+ * @returns {string} Returns the converted string.
+ * @example
+ *
+ * _.toString(null);
+ * // => ''
+ *
+ * _.toString(-0);
+ * // => '-0'
+ *
+ * _.toString([1, 2, 3]);
+ * // => '1,2,3'
+ */
+function toString(value) {
+ return value == null ? '' : baseToString(value);
+}
+
+module.exports = toString;
+
+
+/***/ }),
+
+/***/ 607:
+/***/ (function(module, exports) {
+
+// shim for using process in browser
+var process = module.exports = {};
+
+// cached from whatever global is present so that test runners that stub it
+// don't break things. But we need to wrap it in a try catch in case it is
+// wrapped in strict mode code which doesn't define any globals. It's inside a
+// function because try/catches deoptimize in certain engines.
+
+var cachedSetTimeout;
+var cachedClearTimeout;
+
+function defaultSetTimout() {
+ throw new Error('setTimeout has not been defined');
+}
+function defaultClearTimeout () {
+ throw new Error('clearTimeout has not been defined');
+}
+(function () {
+ try {
+ if (typeof setTimeout === 'function') {
+ cachedSetTimeout = setTimeout;
+ } else {
+ cachedSetTimeout = defaultSetTimout;
+ }
+ } catch (e) {
+ cachedSetTimeout = defaultSetTimout;
+ }
+ try {
+ if (typeof clearTimeout === 'function') {
+ cachedClearTimeout = clearTimeout;
+ } else {
+ cachedClearTimeout = defaultClearTimeout;
+ }
+ } catch (e) {
+ cachedClearTimeout = defaultClearTimeout;
+ }
+} ())
+function runTimeout(fun) {
+ if (cachedSetTimeout === setTimeout) {
+ //normal enviroments in sane situations
+ return setTimeout(fun, 0);
+ }
+ // if setTimeout wasn't available but was latter defined
+ if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
+ cachedSetTimeout = setTimeout;
+ return setTimeout(fun, 0);
+ }
+ try {
+ // when when somebody has screwed with setTimeout but no I.E. maddness
+ return cachedSetTimeout(fun, 0);
+ } catch(e){
+ try {
+ // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
+ return cachedSetTimeout.call(null, fun, 0);
+ } catch(e){
+ // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
+ return cachedSetTimeout.call(this, fun, 0);
+ }
+ }
+
+
+}
+function runClearTimeout(marker) {
+ if (cachedClearTimeout === clearTimeout) {
+ //normal enviroments in sane situations
+ return clearTimeout(marker);
+ }
+ // if clearTimeout wasn't available but was latter defined
+ if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
+ cachedClearTimeout = clearTimeout;
+ return clearTimeout(marker);
+ }
+ try {
+ // when when somebody has screwed with setTimeout but no I.E. maddness
+ return cachedClearTimeout(marker);
+ } catch (e){
+ try {
+ // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
+ return cachedClearTimeout.call(null, marker);
+ } catch (e){
+ // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
+ // Some versions of I.E. have different rules for clearTimeout vs setTimeout
+ return cachedClearTimeout.call(this, marker);
+ }
+ }
+
+
+
+}
+var queue = [];
+var draining = false;
+var currentQueue;
+var queueIndex = -1;
+
+function cleanUpNextTick() {
+ if (!draining || !currentQueue) {
+ return;
+ }
+ draining = false;
+ if (currentQueue.length) {
+ queue = currentQueue.concat(queue);
+ } else {
+ queueIndex = -1;
+ }
+ if (queue.length) {
+ drainQueue();
+ }
+}
+
+function drainQueue() {
+ if (draining) {
+ return;
+ }
+ var timeout = runTimeout(cleanUpNextTick);
+ draining = true;
+
+ var len = queue.length;
+ while(len) {
+ currentQueue = queue;
+ queue = [];
+ while (++queueIndex < len) {
+ if (currentQueue) {
+ currentQueue[queueIndex].run();
+ }
+ }
+ queueIndex = -1;
+ len = queue.length;
+ }
+ currentQueue = null;
+ draining = false;
+ runClearTimeout(timeout);
+}
+
+process.nextTick = function (fun) {
+ var args = new Array(arguments.length - 1);
+ if (arguments.length > 1) {
+ for (var i = 1; i < arguments.length; i++) {
+ args[i - 1] = arguments[i];
+ }
+ }
+ queue.push(new Item(fun, args));
+ if (queue.length === 1 && !draining) {
+ runTimeout(drainQueue);
+ }
+};
+
+// v8 likes predictible objects
+function Item(fun, array) {
+ this.fun = fun;
+ this.array = array;
+}
+Item.prototype.run = function () {
+ this.fun.apply(null, this.array);
+};
+process.title = 'browser';
+process.browser = true;
+process.env = {};
+process.argv = [];
+process.version = ''; // empty string to avoid regexp issues
+process.versions = {};
+
+function noop() {}
+
+process.on = noop;
+process.addListener = noop;
+process.once = noop;
+process.off = noop;
+process.removeListener = noop;
+process.removeAllListeners = noop;
+process.emit = noop;
+process.prependListener = noop;
+process.prependOnceListener = noop;
+
+process.listeners = function (name) { return [] }
+
+process.binding = function (name) {
+ throw new Error('process.binding is not supported');
+};
+
+process.cwd = function () { return '/' };
+process.chdir = function (dir) {
+ throw new Error('process.chdir is not supported');
+};
+process.umask = function() { return 0; };
+
+
+/***/ }),
+
+/***/ 615:
+/***/ (function(module, exports, __webpack_require__) {
+
+var Symbol = __webpack_require__(570);
+
+/** Used for built-in method references. */
+var objectProto = Object.prototype;
+
+/** Used to check objects for own properties. */
+var hasOwnProperty = objectProto.hasOwnProperty;
+
+/**
+ * Used to resolve the
+ * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
+ * of values.
+ */
+var nativeObjectToString = objectProto.toString;
+
+/** Built-in value references. */
+var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
+
+/**
+ * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
+ *
+ * @private
+ * @param {*} value The value to query.
+ * @returns {string} Returns the raw `toStringTag`.
+ */
+function getRawTag(value) {
+ var isOwn = hasOwnProperty.call(value, symToStringTag),
+ tag = value[symToStringTag];
+
+ try {
+ value[symToStringTag] = undefined;
+ var unmasked = true;
+ } catch (e) {}
+
+ var result = nativeObjectToString.call(value);
+ if (unmasked) {
+ if (isOwn) {
+ value[symToStringTag] = tag;
+ } else {
+ delete value[symToStringTag];
+ }
+ }
+ return result;
+}
+
+module.exports = getRawTag;
+
+
+/***/ }),
+
+/***/ 616:
+/***/ (function(module, exports) {
+
+/** Used for built-in method references. */
+var objectProto = Object.prototype;
+
+/**
+ * Used to resolve the
+ * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
+ * of values.
+ */
+var nativeObjectToString = objectProto.toString;
+
+/**
+ * Converts `value` to a string using `Object.prototype.toString`.
+ *
+ * @private
+ * @param {*} value The value to convert.
+ * @returns {string} Returns the converted string.
+ */
+function objectToString(value) {
+ return nativeObjectToString.call(value);
+}
+
+module.exports = objectToString;
+
+
+/***/ }),
+
+/***/ 639:
+/***/ (function(module, exports, __webpack_require__) {
+
+var Symbol = __webpack_require__(570),
+ arrayMap = __webpack_require__(640),
+ isArray = __webpack_require__(563),
+ isSymbol = __webpack_require__(577);
+
+/** Used as references for various `Number` constants. */
+var INFINITY = 1 / 0;
+
+/** Used to convert symbols to primitives and strings. */
+var symbolProto = Symbol ? Symbol.prototype : undefined,
+ symbolToString = symbolProto ? symbolProto.toString : undefined;
+
+/**
+ * The base implementation of `_.toString` which doesn't convert nullish
+ * values to empty strings.
+ *
+ * @private
+ * @param {*} value The value to process.
+ * @returns {string} Returns the string.
+ */
+function baseToString(value) {
+ // Exit early for strings to avoid a performance hit in some environments.
+ if (typeof value == 'string') {
+ return value;
+ }
+ if (isArray(value)) {
+ // Recursively convert values (susceptible to call stack limits).
+ return arrayMap(value, baseToString) + '';
+ }
+ if (isSymbol(value)) {
+ return symbolToString ? symbolToString.call(value) : '';
+ }
+ var result = (value + '');
+ return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
+}
+
+module.exports = baseToString;
+
+
+/***/ }),
+
+/***/ 640:
+/***/ (function(module, exports) {
+
+/**
+ * A specialized version of `_.map` for arrays without support for iteratee
+ * shorthands.
+ *
+ * @private
+ * @param {Array} [array] The array to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @returns {Array} Returns the new mapped array.
+ */
+function arrayMap(array, iteratee) {
+ var index = -1,
+ length = array == null ? 0 : array.length,
+ result = Array(length);
+
+ while (++index < length) {
+ result[index] = iteratee(array[index], index, array);
+ }
+ return result;
+}
+
+module.exports = arrayMap;
+
+
+/***/ }),
+
+/***/ 701:
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = getMatches;
+
+var _assert = _interopRequireDefault(__webpack_require__(906));
+
+var _buildQuery = _interopRequireDefault(__webpack_require__(907));
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+function getMatches(query, text, modifiers) {
+ if (!query || !text || !modifiers) {
+ return [];
+ }
+
+ const regexQuery = (0, _buildQuery.default)(query, modifiers, {
+ isGlobal: true
+ });
+ const matchedLocations = [];
+ const lines = text.split("\n");
+
+ for (let i = 0; i < lines.length; i++) {
+ let singleMatch;
+ const line = lines[i];
+
+ while ((singleMatch = regexQuery.exec(line)) !== null) {
+ // Flow doesn't understand the test above.
+ if (!singleMatch) {
+ throw new Error("no singleMatch");
+ }
+
+ matchedLocations.push({
+ line: i,
+ ch: singleMatch.index
+ }); // When the match is an empty string the regexQuery.lastIndex will not
+ // change resulting in an infinite loop so we need to check for this and
+ // increment it manually in that case. See issue #7023
+
+ if (singleMatch[0] === "") {
+ (0, _assert.default)(!regexQuery.unicode, "lastIndex++ can cause issues in unicode mode");
+ regexQuery.lastIndex++;
+ }
+ }
+ }
+
+ return matchedLocations;
+}
+
+/***/ }),
+
+/***/ 904:
+/***/ (function(module, exports, __webpack_require__) {
+
+module.exports = __webpack_require__(905);
+
+
+/***/ }),
+
+/***/ 905:
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+var _getMatches = _interopRequireDefault(__webpack_require__(701));
+
+var _projectSearch = __webpack_require__(909);
+
+var _devtoolsUtils = __webpack_require__(560);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+const {
+ workerHandler
+} = _devtoolsUtils.workerUtils;
+self.onmessage = workerHandler({
+ getMatches: _getMatches.default,
+ findSourceMatches: _projectSearch.findSourceMatches
+});
+
+/***/ }),
+
+/***/ 906:
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = assert;
+
+var _environment = __webpack_require__(968);
+
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+function assert(condition, message) {
+ if ((0, _environment.isNodeTest)() && !condition) {
+ throw new Error(`Assertion failure: ${message}`);
+ }
+}
+
+/***/ }),
+
+/***/ 907:
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = buildQuery;
+
+var _escapeRegExp = _interopRequireDefault(__webpack_require__(908));
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+/**
+ * Ignore doing outline matches for less than 3 whitespaces
+ *
+ * @memberof utils/source-search
+ * @static
+ */
+function ignoreWhiteSpace(str) {
+ return /^\s{0,2}$/.test(str) ? "(?!\\s*.*)" : str;
+}
+
+function wholeMatch(query, wholeWord) {
+ if (query === "" || !wholeWord) {
+ return query;
+ }
+
+ return `\\b${query}\\b`;
+}
+
+function buildFlags(caseSensitive, isGlobal) {
+ if (caseSensitive && isGlobal) {
+ return "g";
+ }
+
+ if (!caseSensitive && isGlobal) {
+ return "gi";
+ }
+
+ if (!caseSensitive && !isGlobal) {
+ return "i";
+ }
+}
+
+function buildQuery(originalQuery, modifiers, {
+ isGlobal = false,
+ ignoreSpaces = false
+}) {
+ const {
+ caseSensitive,
+ regexMatch,
+ wholeWord
+ } = modifiers;
+
+ if (originalQuery === "") {
+ return new RegExp(originalQuery);
+ }
+
+ let query = originalQuery;
+
+ if (ignoreSpaces) {
+ query = ignoreWhiteSpace(query);
+ }
+
+ if (!regexMatch) {
+ query = (0, _escapeRegExp.default)(query);
+ }
+
+ query = wholeMatch(query, wholeWord);
+ const flags = buildFlags(caseSensitive, isGlobal);
+
+ if (flags) {
+ return new RegExp(query, flags);
+ }
+
+ return new RegExp(query);
+}
+
+/***/ }),
+
+/***/ 908:
+/***/ (function(module, exports, __webpack_require__) {
+
+var toString = __webpack_require__(605);
+
+/**
+ * Used to match `RegExp`
+ * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
+ */
+var reRegExpChar = /[\\^$.*+?()[\]{}|]/g,
+ reHasRegExpChar = RegExp(reRegExpChar.source);
+
+/**
+ * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+",
+ * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`.
+ *
+ * @static
+ * @memberOf _
+ * @since 3.0.0
+ * @category String
+ * @param {string} [string=''] The string to escape.
+ * @returns {string} Returns the escaped string.
+ * @example
+ *
+ * _.escapeRegExp('[lodash](https://lodash.com/)');
+ * // => '\[lodash\]\(https://lodash\.com/\)'
+ */
+function escapeRegExp(string) {
+ string = toString(string);
+ return (string && reHasRegExpChar.test(string))
+ ? string.replace(reRegExpChar, '\\$&')
+ : string;
+}
+
+module.exports = escapeRegExp;
+
+
+/***/ }),
+
+/***/ 909:
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.findSourceMatches = findSourceMatches;
+
+var _getMatches = _interopRequireDefault(__webpack_require__(701));
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+// Maybe reuse file search's functions?
+function findSourceMatches(sourceId, content, queryText) {
+ if (queryText == "") {
+ return [];
+ }
+
+ const modifiers = {
+ caseSensitive: false,
+ regexMatch: false,
+ wholeWord: false
+ };
+ const text = content.value;
+ const lines = text.split("\n");
+ return (0, _getMatches.default)(queryText, text, modifiers).map(({
+ line,
+ ch
+ }) => {
+ const {
+ value,
+ matchIndex
+ } = truncateLine(lines[line], ch);
+ return {
+ sourceId,
+ line: line + 1,
+ column: ch,
+ matchIndex,
+ match: queryText,
+ value
+ };
+ });
+} // This is used to find start of a word, so that cropped string look nice
+
+
+const startRegex = /([ !@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?])/g; // Similarly, find
+
+const endRegex = new RegExp(["([ !@#$%^&*()_+-=[]{};':\"\\|,.<>/?])", '[^ !@#$%^&*()_+-=[]{};\':"\\|,.<>/?]*$"/'].join(""));
+
+function truncateLine(text, column) {
+ if (text.length < 100) {
+ return {
+ matchIndex: column,
+ value: text
+ };
+ } // Initially take 40 chars left to the match
+
+
+ const offset = Math.max(column - 40, 0); // 400 characters should be enough to figure out the context of the match
+
+ const truncStr = text.slice(offset, column + 400);
+ let start = truncStr.search(startRegex);
+ let end = truncStr.search(endRegex);
+
+ if (start > column) {
+ // No word separator found before the match, so we take all characters
+ // before the match
+ start = -1;
+ }
+
+ if (end < column) {
+ end = truncStr.length;
+ }
+
+ const value = truncStr.slice(start + 1, end);
+ return {
+ matchIndex: column - start - offset - 1,
+ value
+ };
+}
+
+/***/ }),
+
+/***/ 968:
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+/* WEBPACK VAR INJECTION */(function(process) {
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.isNode = isNode;
+exports.isNodeTest = isNodeTest;
+
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+function isNode() {
+ return process && process.release && process.release.name == "node";
+}
+
+function isNodeTest() {
+ return isNode() && "production" != "production";
+}
+/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(607)))
+
+/***/ })
+
+/******/ });
+}); \ No newline at end of file
diff --git a/devtools/client/debugger/dist/vendors.css b/devtools/client/debugger/dist/vendors.css
new file mode 100644
index 0000000000..7627e1fbdb
--- /dev/null
+++ b/devtools/client/debugger/dist/vendors.css
@@ -0,0 +1,104 @@
+.container {
+ background-color: lightgrey;
+ border: 1px solid darkgrey;
+ cursor: pointer;
+ padding: 0 3px;
+}
+
+.container[aria-selected=true] {
+ background-color: white;
+}
+.container {
+ display: flex;
+ list-style: none;
+ margin: 0;
+ padding: 0;
+}
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+.split-box {
+ display: flex;
+ flex: 1;
+ min-width: 0;
+ height: 100%;
+ width: 100%;
+}
+
+.split-box.vert {
+ flex-direction: row;
+}
+
+.split-box.horz {
+ flex-direction: column;
+}
+
+.split-box > .uncontrolled {
+ display: flex;
+ flex: 1;
+ min-width: 0;
+ overflow: auto;
+}
+
+.split-box > .controlled {
+ display: flex;
+ overflow: auto;
+}
+
+.split-box > .splitter {
+ background-image: none;
+ border: 0;
+ border-style: solid;
+ border-color: transparent;
+ background-color: var(--theme-splitter-color);
+ background-clip: content-box;
+ position: relative;
+
+ box-sizing: border-box;
+
+ /* Positive z-index positions the splitter on top of its siblings and makes
+ it clickable on both sides. */
+ z-index: 1;
+}
+
+.split-box.vert > .splitter {
+ /* prettier-ignore */
+ min-width: calc(var(--devtools-splitter-inline-start-width) +
+ var(--devtools-splitter-inline-end-width) + 1px);
+
+ border-left-width: var(--devtools-splitter-inline-start-width);
+ border-right-width: var(--devtools-splitter-inline-end-width);
+
+ margin-left: calc(-1 * var(--devtools-splitter-inline-start-width) - 1px);
+ margin-right: calc(-1 * var(--devtools-splitter-inline-end-width));
+
+ cursor: ew-resize;
+}
+
+.split-box.horz > .splitter {
+ /* prettier-ignore */
+ min-height: calc(var(--devtools-splitter-top-width) +
+ var(--devtools-splitter-bottom-width) + 1px);
+ border-top-width: var(--devtools-splitter-top-width);
+ border-bottom-width: var(--devtools-splitter-bottom-width);
+
+ margin-top: calc(-1 * var(--devtools-splitter-top-width) - 1px);
+ margin-bottom: calc(-1 * var(--devtools-splitter-bottom-width));
+
+ cursor: ns-resize;
+}
+
+.split-box.disabled {
+ pointer-events: none;
+}
+
+/**
+ * Make sure splitter panels are not processing any mouse
+ * events. This is good for performance during splitter
+ * bar dragging.
+ */
+.split-box.dragging > .controlled,
+.split-box.dragging > .uncontrolled {
+ pointer-events: none;
+}
diff --git a/devtools/client/debugger/dist/vendors.js b/devtools/client/debugger/dist/vendors.js
new file mode 100644
index 0000000000..0f462a2f57
--- /dev/null
+++ b/devtools/client/debugger/dist/vendors.js
@@ -0,0 +1,3214 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+(function webpackUniversalModuleDefinition(root, factory) {
+ if(typeof exports === 'object' && typeof module === 'object')
+ module.exports = factory(require("devtools/client/shared/vendor/react-prop-types"), require("devtools/client/shared/vendor/react-dom-factories"), require("devtools/client/shared/vendor/react"), require("devtools/client/shared/vendor/react-dom"));
+ else if(typeof define === 'function' && define.amd)
+ define(["devtools/client/shared/vendor/react-prop-types", "devtools/client/shared/vendor/react-dom-factories", "devtools/client/shared/vendor/react", "devtools/client/shared/vendor/react-dom"], factory);
+ else {
+ var a = typeof exports === 'object' ? factory(require("devtools/client/shared/vendor/react-prop-types"), require("devtools/client/shared/vendor/react-dom-factories"), require("devtools/client/shared/vendor/react"), require("devtools/client/shared/vendor/react-dom")) : factory(root["devtools/client/shared/vendor/react-prop-types"], root["devtools/client/shared/vendor/react-dom-factories"], root["devtools/client/shared/vendor/react"], root["devtools/client/shared/vendor/react-dom"]);
+ for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
+ }
+})(typeof self !== 'undefined' ? self : this, function(__WEBPACK_EXTERNAL_MODULE_0__, __WEBPACK_EXTERNAL_MODULE_1__, __WEBPACK_EXTERNAL_MODULE_6__, __WEBPACK_EXTERNAL_MODULE_112__) {
+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, {
+/******/ configurable: false,
+/******/ enumerable: true,
+/******/ get: getter
+/******/ });
+/******/ }
+/******/ };
+/******/
+/******/ // 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 = "/assets/build";
+/******/
+/******/ // Load entry module and return exports
+/******/ return __webpack_require__(__webpack_require__.s = 929);
+/******/ })
+/************************************************************************/
+/******/ ({
+
+/***/ 0:
+/***/ (function(module, exports) {
+
+module.exports = __WEBPACK_EXTERNAL_MODULE_0__;
+
+/***/ }),
+
+/***/ 1:
+/***/ (function(module, exports) {
+
+module.exports = __WEBPACK_EXTERNAL_MODULE_1__;
+
+/***/ }),
+
+/***/ 112:
+/***/ (function(module, exports) {
+
+module.exports = __WEBPACK_EXTERNAL_MODULE_112__;
+
+/***/ }),
+
+/***/ 560:
+/***/ (function(module, exports, __webpack_require__) {
+
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+const networkRequest = __webpack_require__(567);
+
+const workerUtils = __webpack_require__(568);
+
+module.exports = {
+ networkRequest,
+ workerUtils
+};
+
+/***/ }),
+
+/***/ 567:
+/***/ (function(module, exports) {
+
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+function networkRequest(url, opts) {
+ return fetch(url, {
+ cache: opts.loadFromCache ? "default" : "no-cache"
+ }).then(res => {
+ if (res.status >= 200 && res.status < 300) {
+ if (res.headers.get("Content-Type") === "application/wasm") {
+ return res.arrayBuffer().then(buffer => ({
+ content: buffer,
+ isDwarf: true
+ }));
+ }
+
+ return res.text().then(text => ({
+ content: text
+ }));
+ }
+
+ return Promise.reject(`request failed with status ${res.status}`);
+ });
+}
+
+module.exports = networkRequest;
+
+/***/ }),
+
+/***/ 568:
+/***/ (function(module, exports) {
+
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+function WorkerDispatcher() {
+ this.msgId = 1;
+ this.worker = null;
+}
+
+WorkerDispatcher.prototype = {
+ start(url, win = window) {
+ this.worker = new win.Worker(url);
+
+ this.worker.onerror = err => {
+ console.error(`Error in worker ${url}`, err.message);
+ };
+ },
+
+ stop() {
+ if (!this.worker) {
+ return;
+ }
+
+ this.worker.terminate();
+ this.worker = null;
+ },
+
+ task(method, {
+ queue = false
+ } = {}) {
+ const calls = [];
+
+ const push = args => {
+ return new Promise((resolve, reject) => {
+ if (queue && calls.length === 0) {
+ Promise.resolve().then(flush);
+ }
+
+ calls.push([args, resolve, reject]);
+
+ if (!queue) {
+ flush();
+ }
+ });
+ };
+
+ const flush = () => {
+ const items = calls.slice();
+ calls.length = 0;
+
+ if (!this.worker) {
+ return;
+ }
+
+ const id = this.msgId++;
+ this.worker.postMessage({
+ id,
+ method,
+ calls: items.map(item => item[0])
+ });
+
+ const listener = ({
+ data: result
+ }) => {
+ if (result.id !== id) {
+ return;
+ }
+
+ if (!this.worker) {
+ return;
+ }
+
+ this.worker.removeEventListener("message", listener);
+ result.results.forEach((resultData, i) => {
+ const [, resolve, reject] = items[i];
+
+ if (resultData.error) {
+ const err = new Error(resultData.message);
+ err.metadata = resultData.metadata;
+ reject(err);
+ } else {
+ resolve(resultData.response);
+ }
+ });
+ };
+
+ this.worker.addEventListener("message", listener);
+ };
+
+ return (...args) => push(args);
+ },
+
+ invoke(method, ...args) {
+ return this.task(method)(...args);
+ }
+
+};
+
+function workerHandler(publicInterface) {
+ return function (msg) {
+ const {
+ id,
+ method,
+ calls
+ } = msg.data;
+ Promise.all(calls.map(args => {
+ try {
+ const response = publicInterface[method].apply(undefined, args);
+
+ if (response instanceof Promise) {
+ return response.then(val => ({
+ response: val
+ }), err => asErrorMessage(err));
+ }
+
+ return {
+ response
+ };
+ } catch (error) {
+ return asErrorMessage(error);
+ }
+ })).then(results => {
+ self.postMessage({
+ id,
+ results
+ });
+ });
+ };
+}
+
+function asErrorMessage(error) {
+ if (typeof error === "object" && error && "message" in error) {
+ // Error can't be sent via postMessage, so be sure to convert to
+ // string.
+ return {
+ error: true,
+ message: error.message,
+ metadata: error.metadata
+ };
+ }
+
+ return {
+ error: true,
+ message: error == null ? error : error.toString(),
+ metadata: undefined
+ };
+}
+
+module.exports = {
+ WorkerDispatcher,
+ workerHandler
+};
+
+/***/ }),
+
+/***/ 6:
+/***/ (function(module, exports) {
+
+module.exports = __WEBPACK_EXTERNAL_MODULE_6__;
+
+/***/ }),
+
+/***/ 607:
+/***/ (function(module, exports) {
+
+// shim for using process in browser
+var process = module.exports = {};
+
+// cached from whatever global is present so that test runners that stub it
+// don't break things. But we need to wrap it in a try catch in case it is
+// wrapped in strict mode code which doesn't define any globals. It's inside a
+// function because try/catches deoptimize in certain engines.
+
+var cachedSetTimeout;
+var cachedClearTimeout;
+
+function defaultSetTimout() {
+ throw new Error('setTimeout has not been defined');
+}
+function defaultClearTimeout () {
+ throw new Error('clearTimeout has not been defined');
+}
+(function () {
+ try {
+ if (typeof setTimeout === 'function') {
+ cachedSetTimeout = setTimeout;
+ } else {
+ cachedSetTimeout = defaultSetTimout;
+ }
+ } catch (e) {
+ cachedSetTimeout = defaultSetTimout;
+ }
+ try {
+ if (typeof clearTimeout === 'function') {
+ cachedClearTimeout = clearTimeout;
+ } else {
+ cachedClearTimeout = defaultClearTimeout;
+ }
+ } catch (e) {
+ cachedClearTimeout = defaultClearTimeout;
+ }
+} ())
+function runTimeout(fun) {
+ if (cachedSetTimeout === setTimeout) {
+ //normal enviroments in sane situations
+ return setTimeout(fun, 0);
+ }
+ // if setTimeout wasn't available but was latter defined
+ if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
+ cachedSetTimeout = setTimeout;
+ return setTimeout(fun, 0);
+ }
+ try {
+ // when when somebody has screwed with setTimeout but no I.E. maddness
+ return cachedSetTimeout(fun, 0);
+ } catch(e){
+ try {
+ // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
+ return cachedSetTimeout.call(null, fun, 0);
+ } catch(e){
+ // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
+ return cachedSetTimeout.call(this, fun, 0);
+ }
+ }
+
+
+}
+function runClearTimeout(marker) {
+ if (cachedClearTimeout === clearTimeout) {
+ //normal enviroments in sane situations
+ return clearTimeout(marker);
+ }
+ // if clearTimeout wasn't available but was latter defined
+ if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
+ cachedClearTimeout = clearTimeout;
+ return clearTimeout(marker);
+ }
+ try {
+ // when when somebody has screwed with setTimeout but no I.E. maddness
+ return cachedClearTimeout(marker);
+ } catch (e){
+ try {
+ // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
+ return cachedClearTimeout.call(null, marker);
+ } catch (e){
+ // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
+ // Some versions of I.E. have different rules for clearTimeout vs setTimeout
+ return cachedClearTimeout.call(this, marker);
+ }
+ }
+
+
+
+}
+var queue = [];
+var draining = false;
+var currentQueue;
+var queueIndex = -1;
+
+function cleanUpNextTick() {
+ if (!draining || !currentQueue) {
+ return;
+ }
+ draining = false;
+ if (currentQueue.length) {
+ queue = currentQueue.concat(queue);
+ } else {
+ queueIndex = -1;
+ }
+ if (queue.length) {
+ drainQueue();
+ }
+}
+
+function drainQueue() {
+ if (draining) {
+ return;
+ }
+ var timeout = runTimeout(cleanUpNextTick);
+ draining = true;
+
+ var len = queue.length;
+ while(len) {
+ currentQueue = queue;
+ queue = [];
+ while (++queueIndex < len) {
+ if (currentQueue) {
+ currentQueue[queueIndex].run();
+ }
+ }
+ queueIndex = -1;
+ len = queue.length;
+ }
+ currentQueue = null;
+ draining = false;
+ runClearTimeout(timeout);
+}
+
+process.nextTick = function (fun) {
+ var args = new Array(arguments.length - 1);
+ if (arguments.length > 1) {
+ for (var i = 1; i < arguments.length; i++) {
+ args[i - 1] = arguments[i];
+ }
+ }
+ queue.push(new Item(fun, args));
+ if (queue.length === 1 && !draining) {
+ runTimeout(drainQueue);
+ }
+};
+
+// v8 likes predictible objects
+function Item(fun, array) {
+ this.fun = fun;
+ this.array = array;
+}
+Item.prototype.run = function () {
+ this.fun.apply(null, this.array);
+};
+process.title = 'browser';
+process.browser = true;
+process.env = {};
+process.argv = [];
+process.version = ''; // empty string to avoid regexp issues
+process.versions = {};
+
+function noop() {}
+
+process.on = noop;
+process.addListener = noop;
+process.once = noop;
+process.off = noop;
+process.removeListener = noop;
+process.removeAllListeners = noop;
+process.emit = noop;
+process.prependListener = noop;
+process.prependOnceListener = noop;
+
+process.listeners = function (name) { return [] }
+
+process.binding = function (name) {
+ throw new Error('process.binding is not supported');
+};
+
+process.cwd = function () { return '/' };
+process.chdir = function (dir) {
+ throw new Error('process.chdir is not supported');
+};
+process.umask = function() { return 0; };
+
+
+/***/ }),
+
+/***/ 611:
+/***/ (function(module, exports) {
+
+(function() {
+ var AcronymResult, computeScore, emptyAcronymResult, isAcronymFullWord, isMatch, isSeparator, isWordEnd, isWordStart, miss_coeff, pos_bonus, scoreAcronyms, scoreCharacter, scoreConsecutives, scoreExact, scoreExactMatch, scorePattern, scorePosition, scoreSize, tau_size, wm;
+
+ wm = 150;
+
+ pos_bonus = 20;
+
+ tau_size = 150;
+
+ miss_coeff = 0.75;
+
+ exports.score = function(string, query, options) {
+ var allowErrors, preparedQuery, score, string_lw;
+ preparedQuery = options.preparedQuery, allowErrors = options.allowErrors;
+ if (!(allowErrors || isMatch(string, preparedQuery.core_lw, preparedQuery.core_up))) {
+ return 0;
+ }
+ string_lw = string.toLowerCase();
+ score = computeScore(string, string_lw, preparedQuery);
+ return Math.ceil(score);
+ };
+
+ exports.isMatch = isMatch = function(subject, query_lw, query_up) {
+ var i, j, m, n, qj_lw, qj_up, si;
+ m = subject.length;
+ n = query_lw.length;
+ if (!m || n > m) {
+ return false;
+ }
+ i = -1;
+ j = -1;
+ while (++j < n) {
+ qj_lw = query_lw.charCodeAt(j);
+ qj_up = query_up.charCodeAt(j);
+ while (++i < m) {
+ si = subject.charCodeAt(i);
+ if (si === qj_lw || si === qj_up) {
+ break;
+ }
+ }
+ if (i === m) {
+ return false;
+ }
+ }
+ return true;
+ };
+
+ exports.computeScore = computeScore = function(subject, subject_lw, preparedQuery) {
+ var acro, acro_score, align, csc_diag, csc_row, csc_score, csc_should_rebuild, i, j, m, miss_budget, miss_left, n, pos, query, query_lw, record_miss, score, score_diag, score_row, score_up, si_lw, start, sz;
+ query = preparedQuery.query;
+ query_lw = preparedQuery.query_lw;
+ m = subject.length;
+ n = query.length;
+ acro = scoreAcronyms(subject, subject_lw, query, query_lw);
+ acro_score = acro.score;
+ if (acro.count === n) {
+ return scoreExact(n, m, acro_score, acro.pos);
+ }
+ pos = subject_lw.indexOf(query_lw);
+ if (pos > -1) {
+ return scoreExactMatch(subject, subject_lw, query, query_lw, pos, n, m);
+ }
+ score_row = new Array(n);
+ csc_row = new Array(n);
+ sz = scoreSize(n, m);
+ miss_budget = Math.ceil(miss_coeff * n) + 5;
+ miss_left = miss_budget;
+ csc_should_rebuild = true;
+ j = -1;
+ while (++j < n) {
+ score_row[j] = 0;
+ csc_row[j] = 0;
+ }
+ i = -1;
+ while (++i < m) {
+ si_lw = subject_lw[i];
+ if (!si_lw.charCodeAt(0) in preparedQuery.charCodes) {
+ if (csc_should_rebuild) {
+ j = -1;
+ while (++j < n) {
+ csc_row[j] = 0;
+ }
+ csc_should_rebuild = false;
+ }
+ continue;
+ }
+ score = 0;
+ score_diag = 0;
+ csc_diag = 0;
+ record_miss = true;
+ csc_should_rebuild = true;
+ j = -1;
+ while (++j < n) {
+ score_up = score_row[j];
+ if (score_up > score) {
+ score = score_up;
+ }
+ csc_score = 0;
+ if (query_lw[j] === si_lw) {
+ start = isWordStart(i, subject, subject_lw);
+ csc_score = csc_diag > 0 ? csc_diag : scoreConsecutives(subject, subject_lw, query, query_lw, i, j, start);
+ align = score_diag + scoreCharacter(i, j, start, acro_score, csc_score);
+ if (align > score) {
+ score = align;
+ miss_left = miss_budget;
+ } else {
+ if (record_miss && --miss_left <= 0) {
+ return Math.max(score, score_row[n - 1]) * sz;
+ }
+ record_miss = false;
+ }
+ }
+ score_diag = score_up;
+ csc_diag = csc_row[j];
+ csc_row[j] = csc_score;
+ score_row[j] = score;
+ }
+ }
+ score = score_row[n - 1];
+ return score * sz;
+ };
+
+ exports.isWordStart = isWordStart = function(pos, subject, subject_lw) {
+ var curr_s, prev_s;
+ if (pos === 0) {
+ return true;
+ }
+ curr_s = subject[pos];
+ prev_s = subject[pos - 1];
+ return isSeparator(prev_s) || (curr_s !== subject_lw[pos] && prev_s === subject_lw[pos - 1]);
+ };
+
+ exports.isWordEnd = isWordEnd = function(pos, subject, subject_lw, len) {
+ var curr_s, next_s;
+ if (pos === len - 1) {
+ return true;
+ }
+ curr_s = subject[pos];
+ next_s = subject[pos + 1];
+ return isSeparator(next_s) || (curr_s === subject_lw[pos] && next_s !== subject_lw[pos + 1]);
+ };
+
+ isSeparator = function(c) {
+ return c === ' ' || c === '.' || c === '-' || c === '_' || c === '/' || c === '\\';
+ };
+
+ scorePosition = function(pos) {
+ var sc;
+ if (pos < pos_bonus) {
+ sc = pos_bonus - pos;
+ return 100 + sc * sc;
+ } else {
+ return Math.max(100 + pos_bonus - pos, 0);
+ }
+ };
+
+ exports.scoreSize = scoreSize = function(n, m) {
+ return tau_size / (tau_size + Math.abs(m - n));
+ };
+
+ scoreExact = function(n, m, quality, pos) {
+ return 2 * n * (wm * quality + scorePosition(pos)) * scoreSize(n, m);
+ };
+
+ exports.scorePattern = scorePattern = function(count, len, sameCase, start, end) {
+ var bonus, sz;
+ sz = count;
+ bonus = 6;
+ if (sameCase === count) {
+ bonus += 2;
+ }
+ if (start) {
+ bonus += 3;
+ }
+ if (end) {
+ bonus += 1;
+ }
+ if (count === len) {
+ if (start) {
+ if (sameCase === len) {
+ sz += 2;
+ } else {
+ sz += 1;
+ }
+ }
+ if (end) {
+ bonus += 1;
+ }
+ }
+ return sameCase + sz * (sz + bonus);
+ };
+
+ exports.scoreCharacter = scoreCharacter = function(i, j, start, acro_score, csc_score) {
+ var posBonus;
+ posBonus = scorePosition(i);
+ if (start) {
+ return posBonus + wm * ((acro_score > csc_score ? acro_score : csc_score) + 10);
+ }
+ return posBonus + wm * csc_score;
+ };
+
+ exports.scoreConsecutives = scoreConsecutives = function(subject, subject_lw, query, query_lw, i, j, startOfWord) {
+ var k, m, mi, n, nj, sameCase, sz;
+ m = subject.length;
+ n = query.length;
+ mi = m - i;
+ nj = n - j;
+ k = mi < nj ? mi : nj;
+ sameCase = 0;
+ sz = 0;
+ if (query[j] === subject[i]) {
+ sameCase++;
+ }
+ while (++sz < k && query_lw[++j] === subject_lw[++i]) {
+ if (query[j] === subject[i]) {
+ sameCase++;
+ }
+ }
+ if (sz < k) {
+ i--;
+ }
+ if (sz === 1) {
+ return 1 + 2 * sameCase;
+ }
+ return scorePattern(sz, n, sameCase, startOfWord, isWordEnd(i, subject, subject_lw, m));
+ };
+
+ exports.scoreExactMatch = scoreExactMatch = function(subject, subject_lw, query, query_lw, pos, n, m) {
+ var end, i, pos2, sameCase, start;
+ start = isWordStart(pos, subject, subject_lw);
+ if (!start) {
+ pos2 = subject_lw.indexOf(query_lw, pos + 1);
+ if (pos2 > -1) {
+ start = isWordStart(pos2, subject, subject_lw);
+ if (start) {
+ pos = pos2;
+ }
+ }
+ }
+ i = -1;
+ sameCase = 0;
+ while (++i < n) {
+ if (query[pos + i] === subject[i]) {
+ sameCase++;
+ }
+ }
+ end = isWordEnd(pos + n - 1, subject, subject_lw, m);
+ return scoreExact(n, m, scorePattern(n, n, sameCase, start, end), pos);
+ };
+
+ AcronymResult = (function() {
+ function AcronymResult(score, pos, count) {
+ this.score = score;
+ this.pos = pos;
+ this.count = count;
+ }
+
+ return AcronymResult;
+
+ })();
+
+ emptyAcronymResult = new AcronymResult(0, 0.1, 0);
+
+ exports.scoreAcronyms = scoreAcronyms = function(subject, subject_lw, query, query_lw) {
+ var count, fullWord, i, j, m, n, qj_lw, sameCase, score, sepCount, sumPos;
+ m = subject.length;
+ n = query.length;
+ if (!(m > 1 && n > 1)) {
+ return emptyAcronymResult;
+ }
+ count = 0;
+ sepCount = 0;
+ sumPos = 0;
+ sameCase = 0;
+ i = -1;
+ j = -1;
+ while (++j < n) {
+ qj_lw = query_lw[j];
+ if (isSeparator(qj_lw)) {
+ i = subject_lw.indexOf(qj_lw, i + 1);
+ if (i > -1) {
+ sepCount++;
+ continue;
+ } else {
+ break;
+ }
+ }
+ while (++i < m) {
+ if (qj_lw === subject_lw[i] && isWordStart(i, subject, subject_lw)) {
+ if (query[j] === subject[i]) {
+ sameCase++;
+ }
+ sumPos += i;
+ count++;
+ break;
+ }
+ }
+ if (i === m) {
+ break;
+ }
+ }
+ if (count < 2) {
+ return emptyAcronymResult;
+ }
+ fullWord = count === n ? isAcronymFullWord(subject, subject_lw, query, count) : false;
+ score = scorePattern(count, n, sameCase, true, fullWord);
+ return new AcronymResult(score, sumPos / count, count + sepCount);
+ };
+
+ isAcronymFullWord = function(subject, subject_lw, query, nbAcronymInQuery) {
+ var count, i, m, n;
+ m = subject.length;
+ n = query.length;
+ count = 0;
+ if (m > 12 * n) {
+ return false;
+ }
+ i = -1;
+ while (++i < m) {
+ if (isWordStart(i, subject, subject_lw) && ++count > nbAcronymInQuery) {
+ return false;
+ }
+ }
+ return true;
+ };
+
+}).call(this);
+
+
+/***/ }),
+
+/***/ 647:
+/***/ (function(module, exports, __webpack_require__) {
+
+(function() {
+ var computeScore, countDir, file_coeff, getExtension, getExtensionScore, isMatch, scorePath, scoreSize, tau_depth, _ref;
+
+ _ref = __webpack_require__(611), isMatch = _ref.isMatch, computeScore = _ref.computeScore, scoreSize = _ref.scoreSize;
+
+ tau_depth = 20;
+
+ file_coeff = 2.5;
+
+ exports.score = function(string, query, options) {
+ var allowErrors, preparedQuery, score, string_lw;
+ preparedQuery = options.preparedQuery, allowErrors = options.allowErrors;
+ if (!(allowErrors || isMatch(string, preparedQuery.core_lw, preparedQuery.core_up))) {
+ return 0;
+ }
+ string_lw = string.toLowerCase();
+ score = computeScore(string, string_lw, preparedQuery);
+ score = scorePath(string, string_lw, score, options);
+ return Math.ceil(score);
+ };
+
+ scorePath = function(subject, subject_lw, fullPathScore, options) {
+ var alpha, basePathScore, basePos, depth, end, extAdjust, fileLength, pathSeparator, preparedQuery, useExtensionBonus;
+ if (fullPathScore === 0) {
+ return 0;
+ }
+ preparedQuery = options.preparedQuery, useExtensionBonus = options.useExtensionBonus, pathSeparator = options.pathSeparator;
+ end = subject.length - 1;
+ while (subject[end] === pathSeparator) {
+ end--;
+ }
+ basePos = subject.lastIndexOf(pathSeparator, end);
+ fileLength = end - basePos;
+ extAdjust = 1.0;
+ if (useExtensionBonus) {
+ extAdjust += getExtensionScore(subject_lw, preparedQuery.ext, basePos, end, 2);
+ fullPathScore *= extAdjust;
+ }
+ if (basePos === -1) {
+ return fullPathScore;
+ }
+ depth = preparedQuery.depth;
+ while (basePos > -1 && depth-- > 0) {
+ basePos = subject.lastIndexOf(pathSeparator, basePos - 1);
+ }
+ basePathScore = basePos === -1 ? fullPathScore : extAdjust * computeScore(subject.slice(basePos + 1, end + 1), subject_lw.slice(basePos + 1, end + 1), preparedQuery);
+ alpha = 0.5 * tau_depth / (tau_depth + countDir(subject, end + 1, pathSeparator));
+ return alpha * basePathScore + (1 - alpha) * fullPathScore * scoreSize(0, file_coeff * fileLength);
+ };
+
+ exports.countDir = countDir = function(path, end, pathSeparator) {
+ var count, i;
+ if (end < 1) {
+ return 0;
+ }
+ count = 0;
+ i = -1;
+ while (++i < end && path[i] === pathSeparator) {
+ continue;
+ }
+ while (++i < end) {
+ if (path[i] === pathSeparator) {
+ count++;
+ while (++i < end && path[i] === pathSeparator) {
+ continue;
+ }
+ }
+ }
+ return count;
+ };
+
+ exports.getExtension = getExtension = function(str) {
+ var pos;
+ pos = str.lastIndexOf(".");
+ if (pos < 0) {
+ return "";
+ } else {
+ return str.substr(pos + 1);
+ }
+ };
+
+ getExtensionScore = function(candidate, ext, startPos, endPos, maxDepth) {
+ var m, matched, n, pos;
+ if (!ext.length) {
+ return 0;
+ }
+ pos = candidate.lastIndexOf(".", endPos);
+ if (!(pos > startPos)) {
+ return 0;
+ }
+ n = ext.length;
+ m = endPos - pos;
+ if (m < n) {
+ n = m;
+ m = ext.length;
+ }
+ pos++;
+ matched = -1;
+ while (++matched < n) {
+ if (candidate[pos + matched] !== ext[matched]) {
+ break;
+ }
+ }
+ if (matched === 0 && maxDepth > 0) {
+ return 0.9 * getExtensionScore(candidate, ext, startPos, pos - 2, maxDepth - 1);
+ }
+ return matched / m;
+ };
+
+}).call(this);
+
+
+/***/ }),
+
+/***/ 709:
+/***/ (function(module, exports, __webpack_require__) {
+
+(function() {
+ var Query, coreChars, countDir, getCharCodes, getExtension, opt_char_re, truncatedUpperCase, _ref;
+
+ _ref = __webpack_require__(647), countDir = _ref.countDir, getExtension = _ref.getExtension;
+
+ module.exports = Query = (function() {
+ function Query(query, _arg) {
+ var optCharRegEx, pathSeparator, _ref1;
+ _ref1 = _arg != null ? _arg : {}, optCharRegEx = _ref1.optCharRegEx, pathSeparator = _ref1.pathSeparator;
+ if (!(query && query.length)) {
+ return null;
+ }
+ this.query = query;
+ this.query_lw = query.toLowerCase();
+ this.core = coreChars(query, optCharRegEx);
+ this.core_lw = this.core.toLowerCase();
+ this.core_up = truncatedUpperCase(this.core);
+ this.depth = countDir(query, query.length, pathSeparator);
+ this.ext = getExtension(this.query_lw);
+ this.charCodes = getCharCodes(this.query_lw);
+ }
+
+ return Query;
+
+ })();
+
+ opt_char_re = /[ _\-:\/\\]/g;
+
+ coreChars = function(query, optCharRegEx) {
+ if (optCharRegEx == null) {
+ optCharRegEx = opt_char_re;
+ }
+ return query.replace(optCharRegEx, '');
+ };
+
+ truncatedUpperCase = function(str) {
+ var char, upper, _i, _len;
+ upper = "";
+ for (_i = 0, _len = str.length; _i < _len; _i++) {
+ char = str[_i];
+ upper += char.toUpperCase()[0];
+ }
+ return upper;
+ };
+
+ getCharCodes = function(str) {
+ var charCodes, i, len;
+ len = str.length;
+ i = -1;
+ charCodes = [];
+ while (++i < len) {
+ charCodes[str.charCodeAt(i)] = true;
+ }
+ return charCodes;
+ };
+
+}).call(this);
+
+
+/***/ }),
+
+/***/ 710:
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = void 0;
+
+var _propTypes = _interopRequireDefault(__webpack_require__(0));
+
+var _react = _interopRequireDefault(__webpack_require__(6));
+
+var _tab = _interopRequireDefault(__webpack_require__(711));
+
+var _tabList = _interopRequireDefault(__webpack_require__(958));
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+class TabList extends _react.default.Component {
+ constructor(props) {
+ super(props);
+
+ const childrenCount = _react.default.Children.count(props.children);
+
+ this.handleKeyPress = this.handleKeyPress.bind(this);
+ this.tabRefs = new Array(childrenCount).fill(0).map(() => /*#__PURE__*/_react.default.createRef());
+ this.handlers = this.getHandlers(props.vertical);
+ }
+
+ componentDidUpdate(prevProps) {
+ if (prevProps.activeIndex !== this.props.activeIndex) {
+ this.tabRefs[this.props.activeIndex].current.focus();
+ }
+ }
+
+ getHandlers(vertical) {
+ if (vertical) {
+ return {
+ ArrowDown: this.next.bind(this),
+ ArrowUp: this.previous.bind(this)
+ };
+ }
+
+ return {
+ ArrowLeft: this.previous.bind(this),
+ ArrowRight: this.next.bind(this)
+ };
+ }
+
+ wrapIndex(index) {
+ const count = _react.default.Children.count(this.props.children);
+
+ return (index + count) % count;
+ }
+
+ handleKeyPress(event) {
+ const handler = this.handlers[event.key];
+
+ if (handler) {
+ handler();
+ }
+ }
+
+ previous() {
+ const newIndex = this.wrapIndex(this.props.activeIndex - 1);
+ this.props.onActivateTab(newIndex);
+ }
+
+ next() {
+ const newIndex = this.wrapIndex(this.props.activeIndex + 1);
+ this.props.onActivateTab(newIndex);
+ }
+
+ render() {
+ const {
+ accessibleId,
+ activeIndex,
+ children,
+ className,
+ onActivateTab
+ } = this.props;
+ return /*#__PURE__*/_react.default.createElement("ul", {
+ className: className,
+ onKeyUp: this.handleKeyPress,
+ role: "tablist"
+ }, _react.default.Children.map(children, (child, index) => {
+ if (child.type !== _tab.default) {
+ throw new Error('Direct children of a <TabList> must be a <Tab>');
+ }
+
+ const active = index === activeIndex;
+ const tabRef = this.tabRefs[index];
+ return /*#__PURE__*/_react.default.cloneElement(child, {
+ accessibleId: active ? accessibleId : undefined,
+ active,
+ tabRef,
+ onActivate: () => onActivateTab(index)
+ });
+ }));
+ }
+
+}
+
+exports.default = TabList;
+TabList.propTypes = {
+ accessibleId: _propTypes.default.string,
+ activeIndex: _propTypes.default.number,
+ children: _propTypes.default.node,
+ className: _propTypes.default.string,
+ onActivateTab: _propTypes.default.func,
+ vertical: _propTypes.default.bool
+};
+TabList.defaultProps = {
+ accessibleId: undefined,
+ activeIndex: 0,
+ children: null,
+ className: _tabList.default.container,
+ onActivateTab: () => {},
+ vertical: false
+};
+
+/***/ }),
+
+/***/ 711:
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = Tab;
+
+var _propTypes = _interopRequireDefault(__webpack_require__(0));
+
+var _react = _interopRequireDefault(__webpack_require__(6));
+
+var _ref = _interopRequireDefault(__webpack_require__(938));
+
+var _tab = _interopRequireDefault(__webpack_require__(957));
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+function Tab({
+ accessibleId,
+ active,
+ children,
+ className,
+ onActivate,
+ tabRef
+}) {
+ return /*#__PURE__*/_react.default.createElement("li", {
+ "aria-selected": active,
+ className: className,
+ id: accessibleId,
+ onClick: onActivate,
+ onKeyDown: () => {},
+ ref: tabRef,
+ role: "tab",
+ tabIndex: active ? 0 : undefined
+ }, children);
+}
+
+Tab.propTypes = {
+ accessibleId: _propTypes.default.string,
+ active: _propTypes.default.bool,
+ children: _propTypes.default.node.isRequired,
+ className: _propTypes.default.string,
+ onActivate: _propTypes.default.func,
+ tabRef: _ref.default
+};
+Tab.defaultProps = {
+ accessibleId: undefined,
+ active: false,
+ className: _tab.default.container,
+ onActivate: undefined,
+ tabRef: undefined
+};
+
+/***/ }),
+
+/***/ 712:
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = TabPanels;
+
+var _propTypes = _interopRequireDefault(__webpack_require__(0));
+
+var _react = _interopRequireDefault(__webpack_require__(6));
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+function TabPanels({
+ accessibleId,
+ activeIndex,
+ children,
+ className,
+ hasFocusableContent
+}) {
+ return /*#__PURE__*/_react.default.createElement("div", {
+ "aria-labelledby": accessibleId,
+ role: "tabpanel",
+ className: className,
+ tabIndex: hasFocusableContent ? undefined : 0
+ }, _react.default.Children.toArray(children)[activeIndex]);
+}
+
+TabPanels.propTypes = {
+ accessibleId: _propTypes.default.string,
+ activeIndex: _propTypes.default.number,
+ children: _propTypes.default.node.isRequired,
+ className: _propTypes.default.string,
+ hasFocusableContent: _propTypes.default.bool.isRequired
+};
+TabPanels.defaultProps = {
+ accessibleId: undefined,
+ activeIndex: 0,
+ className: null
+};
+
+/***/ }),
+
+/***/ 929:
+/***/ (function(module, exports, __webpack_require__) {
+
+module.exports = __webpack_require__(930);
+
+
+/***/ }),
+
+/***/ 930:
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.vendored = void 0;
+
+var devtoolsUtils = _interopRequireWildcard(__webpack_require__(560));
+
+var fuzzaldrinPlus = _interopRequireWildcard(__webpack_require__(931));
+
+var transition = _interopRequireWildcard(__webpack_require__(934));
+
+var reactAriaComponentsTabs = _interopRequireWildcard(__webpack_require__(937));
+
+var _classnames = _interopRequireDefault(__webpack_require__(943));
+
+var _devtoolsSplitter = _interopRequireDefault(__webpack_require__(944));
+
+var _lodashMove = _interopRequireDefault(__webpack_require__(948));
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
+
+function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
+
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+/**
+ * Vendors.js is a file used to bundle and expose all dependencies needed to run
+ * the transpiled debugger modules when running in Firefox.
+ *
+ * To make transpilation easier, a vendored module should always be imported in
+ * same way:
+ * - always with destructuring (import { a } from "modA";)
+ * - always without destructuring (import modB from "modB")
+ *
+ * Both are fine, but cannot be mixed for the same module.
+ */
+// $FlowIgnore
+// Modules imported without destructuring
+// We cannot directly export literals containing special characters
+// (eg. "my-module/Test") which is why they are nested in "vendored".
+// The keys of the vendored object should match the module names
+// !!! Should remain synchronized with .babel/transform-mc.js !!!
+const vendored = {
+ classnames: _classnames.default,
+ "devtools-splitter": _devtoolsSplitter.default,
+ "devtools-utils": devtoolsUtils,
+ "fuzzaldrin-plus": fuzzaldrinPlus,
+ "lodash-move": _lodashMove.default,
+ "react-aria-components/src/tabs": reactAriaComponentsTabs,
+ "react-transition-group/Transition": transition
+};
+exports.vendored = vendored;
+
+/***/ }),
+
+/***/ 931:
+/***/ (function(module, exports, __webpack_require__) {
+
+/* WEBPACK VAR INJECTION */(function(process) {(function() {
+ var Query, defaultPathSeparator, filter, matcher, parseOptions, pathScorer, preparedQueryCache, scorer;
+
+ filter = __webpack_require__(932);
+
+ matcher = __webpack_require__(933);
+
+ scorer = __webpack_require__(611);
+
+ pathScorer = __webpack_require__(647);
+
+ Query = __webpack_require__(709);
+
+ preparedQueryCache = null;
+
+ defaultPathSeparator = (typeof process !== "undefined" && process !== null ? process.platform : void 0) === "win32" ? '\\' : '/';
+
+ module.exports = {
+ filter: function(candidates, query, options) {
+ if (options == null) {
+ options = {};
+ }
+ if (!((query != null ? query.length : void 0) && (candidates != null ? candidates.length : void 0))) {
+ return [];
+ }
+ options = parseOptions(options, query);
+ return filter(candidates, query, options);
+ },
+ score: function(string, query, options) {
+ if (options == null) {
+ options = {};
+ }
+ if (!((string != null ? string.length : void 0) && (query != null ? query.length : void 0))) {
+ return 0;
+ }
+ options = parseOptions(options, query);
+ if (options.usePathScoring) {
+ return pathScorer.score(string, query, options);
+ } else {
+ return scorer.score(string, query, options);
+ }
+ },
+ match: function(string, query, options) {
+ var _i, _ref, _results;
+ if (options == null) {
+ options = {};
+ }
+ if (!string) {
+ return [];
+ }
+ if (!query) {
+ return [];
+ }
+ if (string === query) {
+ return (function() {
+ _results = [];
+ for (var _i = 0, _ref = string.length; 0 <= _ref ? _i < _ref : _i > _ref; 0 <= _ref ? _i++ : _i--){ _results.push(_i); }
+ return _results;
+ }).apply(this);
+ }
+ options = parseOptions(options, query);
+ return matcher.match(string, query, options);
+ },
+ wrap: function(string, query, options) {
+ if (options == null) {
+ options = {};
+ }
+ if (!string) {
+ return [];
+ }
+ if (!query) {
+ return [];
+ }
+ options = parseOptions(options, query);
+ return matcher.wrap(string, query, options);
+ },
+ prepareQuery: function(query, options) {
+ if (options == null) {
+ options = {};
+ }
+ options = parseOptions(options, query);
+ return options.preparedQuery;
+ }
+ };
+
+ parseOptions = function(options, query) {
+ if (options.allowErrors == null) {
+ options.allowErrors = false;
+ }
+ if (options.usePathScoring == null) {
+ options.usePathScoring = true;
+ }
+ if (options.useExtensionBonus == null) {
+ options.useExtensionBonus = false;
+ }
+ if (options.pathSeparator == null) {
+ options.pathSeparator = defaultPathSeparator;
+ }
+ if (options.optCharRegEx == null) {
+ options.optCharRegEx = null;
+ }
+ if (options.wrap == null) {
+ options.wrap = null;
+ }
+ if (options.preparedQuery == null) {
+ options.preparedQuery = preparedQueryCache && preparedQueryCache.query === query ? preparedQueryCache : (preparedQueryCache = new Query(query, options));
+ }
+ return options;
+ };
+
+}).call(this);
+
+/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(607)))
+
+/***/ }),
+
+/***/ 932:
+/***/ (function(module, exports, __webpack_require__) {
+
+(function() {
+ var Query, pathScorer, pluckCandidates, scorer, sortCandidates;
+
+ scorer = __webpack_require__(611);
+
+ pathScorer = __webpack_require__(647);
+
+ Query = __webpack_require__(709);
+
+ pluckCandidates = function(a) {
+ return a.candidate;
+ };
+
+ sortCandidates = function(a, b) {
+ return b.score - a.score;
+ };
+
+ module.exports = function(candidates, query, options) {
+ var bKey, candidate, key, maxInners, maxResults, score, scoreProvider, scoredCandidates, spotLeft, string, usePathScoring, _i, _len;
+ scoredCandidates = [];
+ key = options.key, maxResults = options.maxResults, maxInners = options.maxInners, usePathScoring = options.usePathScoring;
+ spotLeft = (maxInners != null) && maxInners > 0 ? maxInners : candidates.length + 1;
+ bKey = key != null;
+ scoreProvider = usePathScoring ? pathScorer : scorer;
+ for (_i = 0, _len = candidates.length; _i < _len; _i++) {
+ candidate = candidates[_i];
+ string = bKey ? candidate[key] : candidate;
+ if (!string) {
+ continue;
+ }
+ score = scoreProvider.score(string, query, options);
+ if (score > 0) {
+ scoredCandidates.push({
+ candidate: candidate,
+ score: score
+ });
+ if (!--spotLeft) {
+ break;
+ }
+ }
+ }
+ scoredCandidates.sort(sortCandidates);
+ candidates = scoredCandidates.map(pluckCandidates);
+ if (maxResults != null) {
+ candidates = candidates.slice(0, maxResults);
+ }
+ return candidates;
+ };
+
+}).call(this);
+
+
+/***/ }),
+
+/***/ 933:
+/***/ (function(module, exports, __webpack_require__) {
+
+(function() {
+ var basenameMatch, computeMatch, isMatch, isWordStart, match, mergeMatches, scoreAcronyms, scoreCharacter, scoreConsecutives, _ref;
+
+ _ref = __webpack_require__(611), isMatch = _ref.isMatch, isWordStart = _ref.isWordStart, scoreConsecutives = _ref.scoreConsecutives, scoreCharacter = _ref.scoreCharacter, scoreAcronyms = _ref.scoreAcronyms;
+
+ exports.match = match = function(string, query, options) {
+ var allowErrors, baseMatches, matches, pathSeparator, preparedQuery, string_lw;
+ allowErrors = options.allowErrors, preparedQuery = options.preparedQuery, pathSeparator = options.pathSeparator;
+ if (!(allowErrors || isMatch(string, preparedQuery.core_lw, preparedQuery.core_up))) {
+ return [];
+ }
+ string_lw = string.toLowerCase();
+ matches = computeMatch(string, string_lw, preparedQuery);
+ if (matches.length === 0) {
+ return matches;
+ }
+ if (string.indexOf(pathSeparator) > -1) {
+ baseMatches = basenameMatch(string, string_lw, preparedQuery, pathSeparator);
+ matches = mergeMatches(matches, baseMatches);
+ }
+ return matches;
+ };
+
+ exports.wrap = function(string, query, options) {
+ var matchIndex, matchPos, matchPositions, output, strPos, tagClass, tagClose, tagOpen, _ref1;
+ if ((options.wrap != null)) {
+ _ref1 = options.wrap, tagClass = _ref1.tagClass, tagOpen = _ref1.tagOpen, tagClose = _ref1.tagClose;
+ }
+ if (tagClass == null) {
+ tagClass = 'highlight';
+ }
+ if (tagOpen == null) {
+ tagOpen = '<strong class="' + tagClass + '">';
+ }
+ if (tagClose == null) {
+ tagClose = '</strong>';
+ }
+ if (string === query) {
+ return tagOpen + string + tagClose;
+ }
+ matchPositions = match(string, query, options);
+ if (matchPositions.length === 0) {
+ return string;
+ }
+ output = '';
+ matchIndex = -1;
+ strPos = 0;
+ while (++matchIndex < matchPositions.length) {
+ matchPos = matchPositions[matchIndex];
+ if (matchPos > strPos) {
+ output += string.substring(strPos, matchPos);
+ strPos = matchPos;
+ }
+ while (++matchIndex < matchPositions.length) {
+ if (matchPositions[matchIndex] === matchPos + 1) {
+ matchPos++;
+ } else {
+ matchIndex--;
+ break;
+ }
+ }
+ matchPos++;
+ if (matchPos > strPos) {
+ output += tagOpen;
+ output += string.substring(strPos, matchPos);
+ output += tagClose;
+ strPos = matchPos;
+ }
+ }
+ if (strPos <= string.length - 1) {
+ output += string.substring(strPos);
+ }
+ return output;
+ };
+
+ basenameMatch = function(subject, subject_lw, preparedQuery, pathSeparator) {
+ var basePos, depth, end;
+ end = subject.length - 1;
+ while (subject[end] === pathSeparator) {
+ end--;
+ }
+ basePos = subject.lastIndexOf(pathSeparator, end);
+ if (basePos === -1) {
+ return [];
+ }
+ depth = preparedQuery.depth;
+ while (depth-- > 0) {
+ basePos = subject.lastIndexOf(pathSeparator, basePos - 1);
+ if (basePos === -1) {
+ return [];
+ }
+ }
+ basePos++;
+ end++;
+ return computeMatch(subject.slice(basePos, end), subject_lw.slice(basePos, end), preparedQuery, basePos);
+ };
+
+ mergeMatches = function(a, b) {
+ var ai, bj, i, j, m, n, out;
+ m = a.length;
+ n = b.length;
+ if (n === 0) {
+ return a.slice();
+ }
+ if (m === 0) {
+ return b.slice();
+ }
+ i = -1;
+ j = 0;
+ bj = b[j];
+ out = [];
+ while (++i < m) {
+ ai = a[i];
+ while (bj <= ai && ++j < n) {
+ if (bj < ai) {
+ out.push(bj);
+ }
+ bj = b[j];
+ }
+ out.push(ai);
+ }
+ while (j < n) {
+ out.push(b[j++]);
+ }
+ return out;
+ };
+
+ computeMatch = function(subject, subject_lw, preparedQuery, offset) {
+ var DIAGONAL, LEFT, STOP, UP, acro_score, align, backtrack, csc_diag, csc_row, csc_score, i, j, m, matches, move, n, pos, query, query_lw, score, score_diag, score_row, score_up, si_lw, start, trace;
+ if (offset == null) {
+ offset = 0;
+ }
+ query = preparedQuery.query;
+ query_lw = preparedQuery.query_lw;
+ m = subject.length;
+ n = query.length;
+ acro_score = scoreAcronyms(subject, subject_lw, query, query_lw).score;
+ score_row = new Array(n);
+ csc_row = new Array(n);
+ STOP = 0;
+ UP = 1;
+ LEFT = 2;
+ DIAGONAL = 3;
+ trace = new Array(m * n);
+ pos = -1;
+ j = -1;
+ while (++j < n) {
+ score_row[j] = 0;
+ csc_row[j] = 0;
+ }
+ i = -1;
+ while (++i < m) {
+ score = 0;
+ score_up = 0;
+ csc_diag = 0;
+ si_lw = subject_lw[i];
+ j = -1;
+ while (++j < n) {
+ csc_score = 0;
+ align = 0;
+ score_diag = score_up;
+ if (query_lw[j] === si_lw) {
+ start = isWordStart(i, subject, subject_lw);
+ csc_score = csc_diag > 0 ? csc_diag : scoreConsecutives(subject, subject_lw, query, query_lw, i, j, start);
+ align = score_diag + scoreCharacter(i, j, start, acro_score, csc_score);
+ }
+ score_up = score_row[j];
+ csc_diag = csc_row[j];
+ if (score > score_up) {
+ move = LEFT;
+ } else {
+ score = score_up;
+ move = UP;
+ }
+ if (align > score) {
+ score = align;
+ move = DIAGONAL;
+ } else {
+ csc_score = 0;
+ }
+ score_row[j] = score;
+ csc_row[j] = csc_score;
+ trace[++pos] = score > 0 ? move : STOP;
+ }
+ }
+ i = m - 1;
+ j = n - 1;
+ pos = i * n + j;
+ backtrack = true;
+ matches = [];
+ while (backtrack && i >= 0 && j >= 0) {
+ switch (trace[pos]) {
+ case UP:
+ i--;
+ pos -= n;
+ break;
+ case LEFT:
+ j--;
+ pos--;
+ break;
+ case DIAGONAL:
+ matches.push(i + offset);
+ j--;
+ i--;
+ pos -= n + 1;
+ break;
+ default:
+ backtrack = false;
+ }
+ }
+ matches.reverse();
+ return matches;
+ };
+
+}).call(this);
+
+
+/***/ }),
+
+/***/ 934:
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+exports.__esModule = true;
+exports.default = exports.EXITING = exports.ENTERED = exports.ENTERING = exports.EXITED = exports.UNMOUNTED = void 0;
+
+var PropTypes = _interopRequireWildcard(__webpack_require__(0));
+
+var _react = _interopRequireDefault(__webpack_require__(6));
+
+var _reactDom = _interopRequireDefault(__webpack_require__(112));
+
+var _reactLifecyclesCompat = __webpack_require__(935);
+
+var _PropTypes = __webpack_require__(936);
+
+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 _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 _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
+
+var UNMOUNTED = 'unmounted';
+exports.UNMOUNTED = UNMOUNTED;
+var EXITED = 'exited';
+exports.EXITED = EXITED;
+var ENTERING = 'entering';
+exports.ENTERING = ENTERING;
+var ENTERED = 'entered';
+exports.ENTERED = ENTERED;
+var EXITING = 'exiting';
+/**
+ * The Transition component lets you describe a transition from one component
+ * state to another _over time_ with a simple declarative API. Most commonly
+ * it's used to animate the mounting and unmounting of a component, but can also
+ * be used to describe in-place transition states as well.
+ *
+ * ---
+ *
+ * **Note**: `Transition` is a platform-agnostic base component. If you're using
+ * transitions in CSS, you'll probably want to use
+ * [`CSSTransition`](https://reactcommunity.org/react-transition-group/css-transition)
+ * instead. It inherits all the features of `Transition`, but contains
+ * additional features necessary to play nice with CSS transitions (hence the
+ * name of the component).
+ *
+ * ---
+ *
+ * By default the `Transition` component does not alter the behavior of the
+ * component it renders, it only tracks "enter" and "exit" states for the
+ * components. It's up to you to give meaning and effect to those states. For
+ * example we can add styles to a component when it enters or exits:
+ *
+ * ```jsx
+ * import { Transition } from 'react-transition-group';
+ *
+ * const duration = 300;
+ *
+ * const defaultStyle = {
+ * transition: `opacity ${duration}ms ease-in-out`,
+ * opacity: 0,
+ * }
+ *
+ * const transitionStyles = {
+ * entering: { opacity: 0 },
+ * entered: { opacity: 1 },
+ * };
+ *
+ * const Fade = ({ in: inProp }) => (
+ * <Transition in={inProp} timeout={duration}>
+ * {state => (
+ * <div style={{
+ * ...defaultStyle,
+ * ...transitionStyles[state]
+ * }}>
+ * I'm a fade Transition!
+ * </div>
+ * )}
+ * </Transition>
+ * );
+ * ```
+ *
+ * There are 4 main states a Transition can be in:
+ * - `'entering'`
+ * - `'entered'`
+ * - `'exiting'`
+ * - `'exited'`
+ *
+ * Transition state is toggled via the `in` prop. When `true` the component
+ * begins the "Enter" stage. During this stage, the component will shift from
+ * its current transition state, to `'entering'` for the duration of the
+ * transition and then to the `'entered'` stage once it's complete. Let's take
+ * the following example (we'll use the
+ * [useState](https://reactjs.org/docs/hooks-reference.html#usestate) hook):
+ *
+ * ```jsx
+ * function App() {
+ * const [inProp, setInProp] = useState(false);
+ * return (
+ * <div>
+ * <Transition in={inProp} timeout={500}>
+ * {state => (
+ * // ...
+ * )}
+ * </Transition>
+ * <button onClick={() => setInProp(true)}>
+ * Click to Enter
+ * </button>
+ * </div>
+ * );
+ * }
+ * ```
+ *
+ * When the button is clicked the component will shift to the `'entering'` state
+ * and stay there for 500ms (the value of `timeout`) before it finally switches
+ * to `'entered'`.
+ *
+ * When `in` is `false` the same thing happens except the state moves from
+ * `'exiting'` to `'exited'`.
+ */
+
+exports.EXITING = EXITING;
+
+var Transition =
+/*#__PURE__*/
+function (_React$Component) {
+ _inheritsLoose(Transition, _React$Component);
+
+ function Transition(props, context) {
+ var _this;
+
+ _this = _React$Component.call(this, props, context) || this;
+ var parentGroup = context.transitionGroup; // In the context of a TransitionGroup all enters are really appears
+
+ var appear = parentGroup && !parentGroup.isMounting ? props.enter : props.appear;
+ var initialStatus;
+ _this.appearStatus = null;
+
+ if (props.in) {
+ if (appear) {
+ initialStatus = EXITED;
+ _this.appearStatus = ENTERING;
+ } else {
+ initialStatus = ENTERED;
+ }
+ } else {
+ if (props.unmountOnExit || props.mountOnEnter) {
+ initialStatus = UNMOUNTED;
+ } else {
+ initialStatus = EXITED;
+ }
+ }
+
+ _this.state = {
+ status: initialStatus
+ };
+ _this.nextCallback = null;
+ return _this;
+ }
+
+ var _proto = Transition.prototype;
+
+ _proto.getChildContext = function getChildContext() {
+ return {
+ transitionGroup: null // allows for nested Transitions
+
+ };
+ };
+
+ Transition.getDerivedStateFromProps = function getDerivedStateFromProps(_ref, prevState) {
+ var nextIn = _ref.in;
+
+ if (nextIn && prevState.status === UNMOUNTED) {
+ return {
+ status: EXITED
+ };
+ }
+
+ return null;
+ }; // getSnapshotBeforeUpdate(prevProps) {
+ // let nextStatus = null
+ // if (prevProps !== this.props) {
+ // const { status } = this.state
+ // if (this.props.in) {
+ // if (status !== ENTERING && status !== ENTERED) {
+ // nextStatus = ENTERING
+ // }
+ // } else {
+ // if (status === ENTERING || status === ENTERED) {
+ // nextStatus = EXITING
+ // }
+ // }
+ // }
+ // return { nextStatus }
+ // }
+
+
+ _proto.componentDidMount = function componentDidMount() {
+ this.updateStatus(true, this.appearStatus);
+ };
+
+ _proto.componentDidUpdate = function componentDidUpdate(prevProps) {
+ var nextStatus = null;
+
+ if (prevProps !== this.props) {
+ var status = this.state.status;
+
+ if (this.props.in) {
+ if (status !== ENTERING && status !== ENTERED) {
+ nextStatus = ENTERING;
+ }
+ } else {
+ if (status === ENTERING || status === ENTERED) {
+ nextStatus = EXITING;
+ }
+ }
+ }
+
+ this.updateStatus(false, nextStatus);
+ };
+
+ _proto.componentWillUnmount = function componentWillUnmount() {
+ this.cancelNextCallback();
+ };
+
+ _proto.getTimeouts = function getTimeouts() {
+ var timeout = this.props.timeout;
+ var exit, enter, appear;
+ exit = enter = appear = timeout;
+
+ if (timeout != null && typeof timeout !== 'number') {
+ exit = timeout.exit;
+ enter = timeout.enter; // TODO: remove fallback for next major
+
+ appear = timeout.appear !== undefined ? timeout.appear : enter;
+ }
+
+ return {
+ exit: exit,
+ enter: enter,
+ appear: appear
+ };
+ };
+
+ _proto.updateStatus = function updateStatus(mounting, nextStatus) {
+ if (mounting === void 0) {
+ mounting = false;
+ }
+
+ if (nextStatus !== null) {
+ // nextStatus will always be ENTERING or EXITING.
+ this.cancelNextCallback();
+
+ var node = _reactDom.default.findDOMNode(this);
+
+ if (nextStatus === ENTERING) {
+ this.performEnter(node, mounting);
+ } else {
+ this.performExit(node);
+ }
+ } else if (this.props.unmountOnExit && this.state.status === EXITED) {
+ this.setState({
+ status: UNMOUNTED
+ });
+ }
+ };
+
+ _proto.performEnter = function performEnter(node, mounting) {
+ var _this2 = this;
+
+ var enter = this.props.enter;
+ var appearing = this.context.transitionGroup ? this.context.transitionGroup.isMounting : mounting;
+ var timeouts = this.getTimeouts();
+ var enterTimeout = appearing ? timeouts.appear : timeouts.enter; // no enter animation skip right to ENTERED
+ // if we are mounting and running this it means appear _must_ be set
+
+ if (!mounting && !enter) {
+ this.safeSetState({
+ status: ENTERED
+ }, function () {
+ _this2.props.onEntered(node);
+ });
+ return;
+ }
+
+ this.props.onEnter(node, appearing);
+ this.safeSetState({
+ status: ENTERING
+ }, function () {
+ _this2.props.onEntering(node, appearing);
+
+ _this2.onTransitionEnd(node, enterTimeout, function () {
+ _this2.safeSetState({
+ status: ENTERED
+ }, function () {
+ _this2.props.onEntered(node, appearing);
+ });
+ });
+ });
+ };
+
+ _proto.performExit = function performExit(node) {
+ var _this3 = this;
+
+ var exit = this.props.exit;
+ var timeouts = this.getTimeouts(); // no exit animation skip right to EXITED
+
+ if (!exit) {
+ this.safeSetState({
+ status: EXITED
+ }, function () {
+ _this3.props.onExited(node);
+ });
+ return;
+ }
+
+ this.props.onExit(node);
+ this.safeSetState({
+ status: EXITING
+ }, function () {
+ _this3.props.onExiting(node);
+
+ _this3.onTransitionEnd(node, timeouts.exit, function () {
+ _this3.safeSetState({
+ status: EXITED
+ }, function () {
+ _this3.props.onExited(node);
+ });
+ });
+ });
+ };
+
+ _proto.cancelNextCallback = function cancelNextCallback() {
+ if (this.nextCallback !== null) {
+ this.nextCallback.cancel();
+ this.nextCallback = null;
+ }
+ };
+
+ _proto.safeSetState = function safeSetState(nextState, callback) {
+ // This shouldn't be necessary, but there are weird race conditions with
+ // setState callbacks and unmounting in testing, so always make sure that
+ // we can cancel any pending setState callbacks after we unmount.
+ callback = this.setNextCallback(callback);
+ this.setState(nextState, callback);
+ };
+
+ _proto.setNextCallback = function setNextCallback(callback) {
+ var _this4 = this;
+
+ var active = true;
+
+ this.nextCallback = function (event) {
+ if (active) {
+ active = false;
+ _this4.nextCallback = null;
+ callback(event);
+ }
+ };
+
+ this.nextCallback.cancel = function () {
+ active = false;
+ };
+
+ return this.nextCallback;
+ };
+
+ _proto.onTransitionEnd = function onTransitionEnd(node, timeout, handler) {
+ this.setNextCallback(handler);
+ var doesNotHaveTimeoutOrListener = timeout == null && !this.props.addEndListener;
+
+ if (!node || doesNotHaveTimeoutOrListener) {
+ setTimeout(this.nextCallback, 0);
+ return;
+ }
+
+ if (this.props.addEndListener) {
+ this.props.addEndListener(node, this.nextCallback);
+ }
+
+ if (timeout != null) {
+ setTimeout(this.nextCallback, timeout);
+ }
+ };
+
+ _proto.render = function render() {
+ var status = this.state.status;
+
+ if (status === UNMOUNTED) {
+ return null;
+ }
+
+ var _this$props = this.props,
+ children = _this$props.children,
+ childProps = _objectWithoutPropertiesLoose(_this$props, ["children"]); // filter props for Transtition
+
+
+ delete childProps.in;
+ delete childProps.mountOnEnter;
+ delete childProps.unmountOnExit;
+ delete childProps.appear;
+ delete childProps.enter;
+ delete childProps.exit;
+ delete childProps.timeout;
+ delete childProps.addEndListener;
+ delete childProps.onEnter;
+ delete childProps.onEntering;
+ delete childProps.onEntered;
+ delete childProps.onExit;
+ delete childProps.onExiting;
+ delete childProps.onExited;
+
+ if (typeof children === 'function') {
+ return children(status, childProps);
+ }
+
+ var child = _react.default.Children.only(children);
+
+ return _react.default.cloneElement(child, childProps);
+ };
+
+ return Transition;
+}(_react.default.Component);
+
+Transition.contextTypes = {
+ transitionGroup: PropTypes.object
+};
+Transition.childContextTypes = {
+ transitionGroup: function transitionGroup() {}
+};
+Transition.propTypes = false ? {
+ /**
+ * A `function` child can be used instead of a React element. This function is
+ * called with the current transition status (`'entering'`, `'entered'`,
+ * `'exiting'`, `'exited'`, `'unmounted'`), which can be used to apply context
+ * specific props to a component.
+ *
+ * ```jsx
+ * <Transition in={this.state.in} timeout={150}>
+ * {state => (
+ * <MyComponent className={`fade fade-${state}`} />
+ * )}
+ * </Transition>
+ * ```
+ */
+ children: PropTypes.oneOfType([PropTypes.func.isRequired, PropTypes.element.isRequired]).isRequired,
+
+ /**
+ * Show the component; triggers the enter or exit states
+ */
+ in: PropTypes.bool,
+
+ /**
+ * By default the child component is mounted immediately along with
+ * the parent `Transition` component. If you want to "lazy mount" the component on the
+ * first `in={true}` you can set `mountOnEnter`. After the first enter transition the component will stay
+ * mounted, even on "exited", unless you also specify `unmountOnExit`.
+ */
+ mountOnEnter: PropTypes.bool,
+
+ /**
+ * By default the child component stays mounted after it reaches the `'exited'` state.
+ * Set `unmountOnExit` if you'd prefer to unmount the component after it finishes exiting.
+ */
+ unmountOnExit: PropTypes.bool,
+
+ /**
+ * Normally a component is not transitioned if it is shown when the `<Transition>` component mounts.
+ * If you want to transition on the first mount set `appear` to `true`, and the
+ * component will transition in as soon as the `<Transition>` mounts.
+ *
+ * > Note: there are no specific "appear" states. `appear` only adds an additional `enter` transition.
+ */
+ appear: PropTypes.bool,
+
+ /**
+ * Enable or disable enter transitions.
+ */
+ enter: PropTypes.bool,
+
+ /**
+ * Enable or disable exit transitions.
+ */
+ exit: PropTypes.bool,
+
+ /**
+ * The duration of the transition, in milliseconds.
+ * Required unless `addEndListener` is provided.
+ *
+ * You may specify a single timeout for all transitions:
+ *
+ * ```jsx
+ * timeout={500}
+ * ```
+ *
+ * or individually:
+ *
+ * ```jsx
+ * timeout={{
+ * appear: 500,
+ * enter: 300,
+ * exit: 500,
+ * }}
+ * ```
+ *
+ * - `appear` defaults to the value of `enter`
+ * - `enter` defaults to `0`
+ * - `exit` defaults to `0`
+ *
+ * @type {number | { enter?: number, exit?: number, appear?: number }}
+ */
+ timeout: function timeout(props) {
+ var pt = _PropTypes.timeoutsShape;
+ if (!props.addEndListener) pt = pt.isRequired;
+
+ for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
+ args[_key - 1] = arguments[_key];
+ }
+
+ return pt.apply(void 0, [props].concat(args));
+ },
+
+ /**
+ * Add a custom transition end trigger. Called with the transitioning
+ * DOM node and a `done` callback. Allows for more fine grained transition end
+ * logic. **Note:** Timeouts are still used as a fallback if provided.
+ *
+ * ```jsx
+ * addEndListener={(node, done) => {
+ * // use the css transitionend event to mark the finish of a transition
+ * node.addEventListener('transitionend', done, false);
+ * }}
+ * ```
+ */
+ addEndListener: PropTypes.func,
+
+ /**
+ * Callback fired before the "entering" status is applied. An extra parameter
+ * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount
+ *
+ * @type Function(node: HtmlElement, isAppearing: bool) -> void
+ */
+ onEnter: PropTypes.func,
+
+ /**
+ * Callback fired after the "entering" status is applied. An extra parameter
+ * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount
+ *
+ * @type Function(node: HtmlElement, isAppearing: bool)
+ */
+ onEntering: PropTypes.func,
+
+ /**
+ * Callback fired after the "entered" status is applied. An extra parameter
+ * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount
+ *
+ * @type Function(node: HtmlElement, isAppearing: bool) -> void
+ */
+ onEntered: PropTypes.func,
+
+ /**
+ * Callback fired before the "exiting" status is applied.
+ *
+ * @type Function(node: HtmlElement) -> void
+ */
+ onExit: PropTypes.func,
+
+ /**
+ * Callback fired after the "exiting" status is applied.
+ *
+ * @type Function(node: HtmlElement) -> void
+ */
+ onExiting: PropTypes.func,
+
+ /**
+ * Callback fired after the "exited" status is applied.
+ *
+ * @type Function(node: HtmlElement) -> void
+ */
+ onExited: PropTypes.func // Name the function so it is clearer in the documentation
+
+} : {};
+
+function noop() {}
+
+Transition.defaultProps = {
+ in: false,
+ mountOnEnter: false,
+ unmountOnExit: false,
+ appear: false,
+ enter: true,
+ exit: true,
+ onEnter: noop,
+ onEntering: noop,
+ onEntered: noop,
+ onExit: noop,
+ onExiting: noop,
+ onExited: noop
+};
+Transition.UNMOUNTED = 0;
+Transition.EXITED = 1;
+Transition.ENTERING = 2;
+Transition.ENTERED = 3;
+Transition.EXITING = 4;
+
+var _default = (0, _reactLifecyclesCompat.polyfill)(Transition);
+
+exports.default = _default;
+
+/***/ }),
+
+/***/ 935:
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
+
+"use strict";
+Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
+/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "polyfill", function() { return polyfill; });
+/**
+ * Copyright (c) 2013-present, Facebook, Inc.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ */
+
+function componentWillMount() {
+ // Call this.constructor.gDSFP to support sub-classes.
+ var state = this.constructor.getDerivedStateFromProps(this.props, this.state);
+ if (state !== null && state !== undefined) {
+ this.setState(state);
+ }
+}
+
+function componentWillReceiveProps(nextProps) {
+ // Call this.constructor.gDSFP to support sub-classes.
+ // Use the setState() updater to ensure state isn't stale in certain edge cases.
+ function updater(prevState) {
+ var state = this.constructor.getDerivedStateFromProps(nextProps, prevState);
+ return state !== null && state !== undefined ? state : null;
+ }
+ // Binding "this" is important for shallow renderer support.
+ this.setState(updater.bind(this));
+}
+
+function componentWillUpdate(nextProps, nextState) {
+ try {
+ var prevProps = this.props;
+ var prevState = this.state;
+ this.props = nextProps;
+ this.state = nextState;
+ this.__reactInternalSnapshotFlag = true;
+ this.__reactInternalSnapshot = this.getSnapshotBeforeUpdate(
+ prevProps,
+ prevState
+ );
+ } finally {
+ this.props = prevProps;
+ this.state = prevState;
+ }
+}
+
+// React may warn about cWM/cWRP/cWU methods being deprecated.
+// Add a flag to suppress these warnings for this special case.
+componentWillMount.__suppressDeprecationWarning = true;
+componentWillReceiveProps.__suppressDeprecationWarning = true;
+componentWillUpdate.__suppressDeprecationWarning = true;
+
+function polyfill(Component) {
+ var prototype = Component.prototype;
+
+ if (!prototype || !prototype.isReactComponent) {
+ throw new Error('Can only polyfill class components');
+ }
+
+ if (
+ typeof Component.getDerivedStateFromProps !== 'function' &&
+ typeof prototype.getSnapshotBeforeUpdate !== 'function'
+ ) {
+ return Component;
+ }
+
+ // If new component APIs are defined, "unsafe" lifecycles won't be called.
+ // Error if any of these lifecycles are present,
+ // Because they would work differently between older and newer (16.3+) versions of React.
+ var foundWillMountName = null;
+ var foundWillReceivePropsName = null;
+ var foundWillUpdateName = null;
+ if (typeof prototype.componentWillMount === 'function') {
+ foundWillMountName = 'componentWillMount';
+ } else if (typeof prototype.UNSAFE_componentWillMount === 'function') {
+ foundWillMountName = 'UNSAFE_componentWillMount';
+ }
+ if (typeof prototype.componentWillReceiveProps === 'function') {
+ foundWillReceivePropsName = 'componentWillReceiveProps';
+ } else if (typeof prototype.UNSAFE_componentWillReceiveProps === 'function') {
+ foundWillReceivePropsName = 'UNSAFE_componentWillReceiveProps';
+ }
+ if (typeof prototype.componentWillUpdate === 'function') {
+ foundWillUpdateName = 'componentWillUpdate';
+ } else if (typeof prototype.UNSAFE_componentWillUpdate === 'function') {
+ foundWillUpdateName = 'UNSAFE_componentWillUpdate';
+ }
+ if (
+ foundWillMountName !== null ||
+ foundWillReceivePropsName !== null ||
+ foundWillUpdateName !== null
+ ) {
+ var componentName = Component.displayName || Component.name;
+ var newApiName =
+ typeof Component.getDerivedStateFromProps === 'function'
+ ? 'getDerivedStateFromProps()'
+ : 'getSnapshotBeforeUpdate()';
+
+ throw Error(
+ 'Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n' +
+ componentName +
+ ' uses ' +
+ newApiName +
+ ' but also contains the following legacy lifecycles:' +
+ (foundWillMountName !== null ? '\n ' + foundWillMountName : '') +
+ (foundWillReceivePropsName !== null
+ ? '\n ' + foundWillReceivePropsName
+ : '') +
+ (foundWillUpdateName !== null ? '\n ' + foundWillUpdateName : '') +
+ '\n\nThe above lifecycles should be removed. Learn more about this warning here:\n' +
+ 'https://fb.me/react-async-component-lifecycle-hooks'
+ );
+ }
+
+ // React <= 16.2 does not support static getDerivedStateFromProps.
+ // As a workaround, use cWM and cWRP to invoke the new static lifecycle.
+ // Newer versions of React will ignore these lifecycles if gDSFP exists.
+ if (typeof Component.getDerivedStateFromProps === 'function') {
+ prototype.componentWillMount = componentWillMount;
+ prototype.componentWillReceiveProps = componentWillReceiveProps;
+ }
+
+ // React <= 16.2 does not support getSnapshotBeforeUpdate.
+ // As a workaround, use cWU to invoke the new lifecycle.
+ // Newer versions of React will ignore that lifecycle if gSBU exists.
+ if (typeof prototype.getSnapshotBeforeUpdate === 'function') {
+ if (typeof prototype.componentDidUpdate !== 'function') {
+ throw new Error(
+ 'Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype'
+ );
+ }
+
+ prototype.componentWillUpdate = componentWillUpdate;
+
+ var componentDidUpdate = prototype.componentDidUpdate;
+
+ prototype.componentDidUpdate = function componentDidUpdatePolyfill(
+ prevProps,
+ prevState,
+ maybeSnapshot
+ ) {
+ // 16.3+ will not execute our will-update method;
+ // It will pass a snapshot value to did-update though.
+ // Older versions will require our polyfilled will-update value.
+ // We need to handle both cases, but can't just check for the presence of "maybeSnapshot",
+ // Because for <= 15.x versions this might be a "prevContext" object.
+ // We also can't just check "__reactInternalSnapshot",
+ // Because get-snapshot might return a falsy value.
+ // So check for the explicit __reactInternalSnapshotFlag flag to determine behavior.
+ var snapshot = this.__reactInternalSnapshotFlag
+ ? this.__reactInternalSnapshot
+ : maybeSnapshot;
+
+ componentDidUpdate.call(this, prevProps, prevState, snapshot);
+ };
+ }
+
+ return Component;
+}
+
+
+
+
+/***/ }),
+
+/***/ 936:
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+exports.__esModule = true;
+exports.classNamesShape = exports.timeoutsShape = void 0;
+
+var _propTypes = _interopRequireDefault(__webpack_require__(0));
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+var timeoutsShape = false ? _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.shape({
+ enter: _propTypes.default.number,
+ exit: _propTypes.default.number,
+ appear: _propTypes.default.number
+}).isRequired]) : null;
+exports.timeoutsShape = timeoutsShape;
+var classNamesShape = false ? _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.shape({
+ enter: _propTypes.default.string,
+ exit: _propTypes.default.string,
+ active: _propTypes.default.string
+}), _propTypes.default.shape({
+ enter: _propTypes.default.string,
+ enterDone: _propTypes.default.string,
+ enterActive: _propTypes.default.string,
+ exit: _propTypes.default.string,
+ exitDone: _propTypes.default.string,
+ exitActive: _propTypes.default.string
+})]) : null;
+exports.classNamesShape = classNamesShape;
+
+/***/ }),
+
+/***/ 937:
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+Object.defineProperty(exports, "TabList", {
+ enumerable: true,
+ get: function () {
+ return _tabList.default;
+ }
+});
+Object.defineProperty(exports, "TabPanels", {
+ enumerable: true,
+ get: function () {
+ return _tabPanels.default;
+ }
+});
+Object.defineProperty(exports, "Tab", {
+ enumerable: true,
+ get: function () {
+ return _tab.default;
+ }
+});
+Object.defineProperty(exports, "Tabs", {
+ enumerable: true,
+ get: function () {
+ return _tabs.default;
+ }
+});
+
+var _tabList = _interopRequireDefault(__webpack_require__(710));
+
+var _tabPanels = _interopRequireDefault(__webpack_require__(712));
+
+var _tab = _interopRequireDefault(__webpack_require__(711));
+
+var _tabs = _interopRequireDefault(__webpack_require__(941));
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/***/ }),
+
+/***/ 938:
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = void 0;
+
+var _propTypes = _interopRequireDefault(__webpack_require__(0));
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+var _default = _propTypes.default.object;
+exports.default = _default;
+
+/***/ }),
+
+/***/ 941:
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = void 0;
+
+var _propTypes = _interopRequireDefault(__webpack_require__(0));
+
+var _react = _interopRequireDefault(__webpack_require__(6));
+
+var _uniqueId = _interopRequireDefault(__webpack_require__(942));
+
+var _tabList = _interopRequireDefault(__webpack_require__(710));
+
+var _tabPanels = _interopRequireDefault(__webpack_require__(712));
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+class Tabs extends _react.default.Component {
+ constructor() {
+ super();
+ this.accessibleId = (0, _uniqueId.default)();
+ }
+
+ render() {
+ const {
+ activeIndex,
+ children,
+ className,
+ onActivateTab
+ } = this.props;
+ const accessibleId = this.accessibleId;
+ return /*#__PURE__*/_react.default.createElement("div", {
+ className: className
+ }, _react.default.Children.map(children, child => {
+ if (!child) {
+ return child;
+ }
+
+ switch (child.type) {
+ case _tabList.default:
+ return /*#__PURE__*/_react.default.cloneElement(child, {
+ accessibleId,
+ activeIndex,
+ onActivateTab
+ });
+
+ case _tabPanels.default:
+ return /*#__PURE__*/_react.default.cloneElement(child, {
+ accessibleId,
+ activeIndex
+ });
+
+ default:
+ return child;
+ }
+ }));
+ }
+
+}
+
+exports.default = Tabs;
+Tabs.propTypes = {
+ activeIndex: _propTypes.default.number.isRequired,
+ children: _propTypes.default.node,
+ className: _propTypes.default.string,
+ onActivateTab: _propTypes.default.func
+};
+Tabs.defaultProps = {
+ children: null,
+ className: undefined,
+ onActivateTab: () => {}
+};
+
+/***/ }),
+
+/***/ 942:
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = uniqueId;
+let counter = 0;
+
+function uniqueId() {
+ counter += 1;
+ return `$rac$${counter}`;
+}
+
+/***/ }),
+
+/***/ 943:
+/***/ (function(module, exports, __webpack_require__) {
+
+var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
+ Copyright (c) 2017 Jed Watson.
+ Licensed under the MIT License (MIT), see
+ http://jedwatson.github.io/classnames
+*/
+/* global define */
+
+(function () {
+ 'use strict';
+
+ var hasOwn = {}.hasOwnProperty;
+
+ function classNames () {
+ var classes = [];
+
+ for (var i = 0; i < arguments.length; i++) {
+ var arg = arguments[i];
+ if (!arg) continue;
+
+ var argType = typeof arg;
+
+ if (argType === 'string' || argType === 'number') {
+ classes.push(arg);
+ } else if (Array.isArray(arg) && arg.length) {
+ var inner = classNames.apply(null, arg);
+ if (inner) {
+ classes.push(inner);
+ }
+ } else if (argType === 'object') {
+ for (var key in arg) {
+ if (hasOwn.call(arg, key) && arg[key]) {
+ classes.push(key);
+ }
+ }
+ }
+ }
+
+ return classes.join(' ');
+ }
+
+ if (typeof module !== 'undefined' && module.exports) {
+ classNames.default = classNames;
+ module.exports = classNames;
+ } else if (true) {
+ // register as 'classnames', consistent with npm package name
+ !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () {
+ return classNames;
+ }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),
+ __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
+ } else {
+ window.classNames = classNames;
+ }
+}());
+
+
+/***/ }),
+
+/***/ 944:
+/***/ (function(module, exports, __webpack_require__) {
+
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+const SplitBox = __webpack_require__(945);
+
+module.exports = SplitBox;
+
+/***/ }),
+
+/***/ 945:
+/***/ (function(module, exports, __webpack_require__) {
+
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+const React = __webpack_require__(6);
+
+const ReactDOM = __webpack_require__(112);
+
+const Draggable = React.createFactory(__webpack_require__(946));
+const {
+ Component
+} = React;
+
+const PropTypes = __webpack_require__(0);
+
+const dom = __webpack_require__(1);
+
+__webpack_require__(959);
+/**
+ * This component represents a Splitter. The splitter supports vertical
+ * as well as horizontal mode.
+ */
+
+
+class SplitBox extends Component {
+ static get propTypes() {
+ return {
+ // Custom class name. You can use more names separated by a space.
+ className: PropTypes.string,
+ // Initial size of controlled panel.
+ initialSize: PropTypes.any,
+ // Optional initial width of controlled panel.
+ initialWidth: PropTypes.number,
+ // Optional initial height of controlled panel.
+ initialHeight: PropTypes.number,
+ // Left/top panel
+ startPanel: PropTypes.any,
+ // Left/top panel collapse state.
+ startPanelCollapsed: PropTypes.bool,
+ // Min panel size.
+ minSize: PropTypes.any,
+ // Max panel size.
+ maxSize: PropTypes.any,
+ // Right/bottom panel
+ endPanel: PropTypes.any,
+ // Right/bottom panel collapse state.
+ endPanelCollapsed: PropTypes.bool,
+ // True if the right/bottom panel should be controlled.
+ endPanelControl: PropTypes.bool,
+ // Size of the splitter handle bar.
+ splitterSize: PropTypes.number,
+ // True if the splitter bar is vertical (default is vertical).
+ vert: PropTypes.bool,
+ // Optional style properties passed into the splitbox
+ style: PropTypes.object,
+ // Optional callback when splitbox resize stops
+ onResizeEnd: PropTypes.func
+ };
+ }
+
+ static get defaultProps() {
+ return {
+ splitterSize: 5,
+ vert: true,
+ endPanelControl: false,
+ endPanelCollapsed: false,
+ startPanelCollapsed: false
+ };
+ }
+
+ constructor(props) {
+ super(props);
+ this.state = {
+ vert: props.vert,
+ // We use integers for these properties
+ width: parseInt(props.initialWidth || props.initialSize, 10),
+ height: parseInt(props.initialHeight || props.initialSize, 10)
+ };
+ this.onStartMove = this.onStartMove.bind(this);
+ this.onStopMove = this.onStopMove.bind(this);
+ this.onMove = this.onMove.bind(this);
+ this.preparePanelStyles = this.preparePanelStyles.bind(this);
+ }
+
+ componentWillReceiveProps(nextProps) {
+ if (this.props.vert !== nextProps.vert) {
+ this.setState({
+ vert: nextProps.vert
+ });
+ }
+
+ if (this.props.initialSize !== nextProps.initialSize || this.props.initialWidth !== nextProps.initialWidth || this.props.initialHeight !== nextProps.initialHeight) {
+ this.setState({
+ width: parseInt(nextProps.initialWidth || nextProps.initialSize, 10),
+ height: parseInt(nextProps.initialHeight || nextProps.initialSize, 10)
+ });
+ }
+ } // Dragging Events
+
+ /**
+ * Set 'resizing' cursor on entire document during splitter dragging.
+ * This avoids cursor-flickering that happens when the mouse leaves
+ * the splitter bar area (happens frequently).
+ */
+
+
+ onStartMove() {
+ const splitBox = ReactDOM.findDOMNode(this);
+ const doc = splitBox.ownerDocument;
+ const defaultCursor = doc.documentElement.style.cursor;
+ doc.documentElement.style.cursor = this.state.vert ? "ew-resize" : "ns-resize";
+ splitBox.classList.add("dragging");
+ document.dispatchEvent(new CustomEvent("drag:start"));
+ this.setState({
+ defaultCursor: defaultCursor
+ });
+ }
+
+ onStopMove() {
+ const splitBox = ReactDOM.findDOMNode(this);
+ const doc = splitBox.ownerDocument;
+ doc.documentElement.style.cursor = this.state.defaultCursor;
+ splitBox.classList.remove("dragging");
+ document.dispatchEvent(new CustomEvent("drag:end"));
+
+ if (this.props.onResizeEnd) {
+ this.props.onResizeEnd(this.state.vert ? this.state.width : this.state.height);
+ }
+ }
+ /**
+ * Adjust size of the controlled panel. Depending on the current
+ * orientation we either remember the width or height of
+ * the splitter box.
+ */
+
+
+ onMove({
+ clientX,
+ movementY
+ }) {
+ const node = ReactDOM.findDOMNode(this);
+ const doc = node.ownerDocument;
+ let targetWidth;
+
+ if (this.props.endPanelControl) {
+ // For the end panel we need to increase the width/height when the
+ // movement is towards the left/top.
+ targetWidth = node.clientWidth - clientX;
+ movementY = -movementY;
+ } else {
+ targetWidth = this.calcStartPanelWidth({
+ node,
+ clientX,
+ doc
+ });
+ }
+
+ if (this.state.vert) {
+ const isRtl = doc.dir === "rtl";
+
+ if (isRtl && this.props.endPanelControl) {
+ // In RTL we need to reverse the movement again -- but only for vertical
+ // splitters
+ const fullWidth = node.clientWidth + node.offsetLeft;
+ targetWidth = fullWidth - targetWidth;
+ }
+
+ this.setState((state, props) => ({
+ width: targetWidth
+ }));
+ } else {
+ this.setState((state, props) => ({
+ height: state.height + movementY
+ }));
+ }
+ }
+
+ calcStartPanelWidth(options) {
+ const {
+ node,
+ clientX,
+ doc
+ } = options;
+ const availableWidth = node.clientWidth;
+ const maxSize = parseInt(this.props.maxSize, 10) / 100;
+ const maxPossibleWidth = Math.ceil(availableWidth * maxSize);
+
+ if (doc.dir === "rtl") {
+ const fullWidth = node.clientWidth + node.offsetLeft;
+ const targetWidth = fullWidth - clientX;
+ return targetWidth > maxPossibleWidth ? maxPossibleWidth : targetWidth;
+ }
+
+ return clientX > maxPossibleWidth ? maxPossibleWidth : clientX;
+ } // Rendering
+
+
+ preparePanelStyles() {
+ const vert = this.state.vert;
+ const {
+ minSize,
+ maxSize,
+ startPanelCollapsed,
+ endPanelControl,
+ endPanelCollapsed
+ } = this.props;
+ let leftPanelStyle, rightPanelStyle; // Set proper size for panels depending on the current state.
+
+ if (vert) {
+ const startWidth = endPanelControl ? null : this.state.width,
+ endWidth = endPanelControl ? this.state.width : null;
+ leftPanelStyle = {
+ maxWidth: endPanelControl ? null : maxSize,
+ minWidth: endPanelControl ? null : minSize,
+ width: startPanelCollapsed ? 0 : startWidth
+ };
+ rightPanelStyle = {
+ maxWidth: endPanelControl ? maxSize : null,
+ minWidth: endPanelControl ? minSize : null,
+ width: endPanelCollapsed ? 0 : endWidth
+ };
+ } else {
+ const startHeight = endPanelControl ? null : this.state.height,
+ endHeight = endPanelControl ? this.state.height : null;
+ leftPanelStyle = {
+ maxHeight: endPanelControl ? null : maxSize,
+ minHeight: endPanelControl ? null : minSize,
+ height: endPanelCollapsed ? maxSize : startHeight
+ };
+ rightPanelStyle = {
+ maxHeight: endPanelControl ? maxSize : null,
+ minHeight: endPanelControl ? minSize : null,
+ height: startPanelCollapsed ? maxSize : endHeight
+ };
+ }
+
+ return {
+ leftPanelStyle,
+ rightPanelStyle
+ };
+ }
+
+ render() {
+ const vert = this.state.vert;
+ const {
+ startPanelCollapsed,
+ startPanel,
+ endPanel,
+ endPanelControl,
+ splitterSize,
+ endPanelCollapsed
+ } = this.props;
+ const style = Object.assign({}, this.props.style); // Calculate class names list.
+
+ let classNames = ["split-box"];
+ classNames.push(vert ? "vert" : "horz");
+
+ if (this.props.className) {
+ classNames = classNames.concat(this.props.className.split(" "));
+ }
+
+ const {
+ leftPanelStyle,
+ rightPanelStyle
+ } = this.preparePanelStyles(); // Calculate splitter size
+
+ const splitterStyle = {
+ flex: `0 0 ${splitterSize}px`
+ };
+ return dom.div({
+ className: classNames.join(" "),
+ style: style
+ }, !startPanelCollapsed ? dom.div({
+ className: endPanelControl ? "uncontrolled" : "controlled",
+ style: leftPanelStyle
+ }, startPanel) : null, Draggable({
+ className: "splitter",
+ style: splitterStyle,
+ onStart: this.onStartMove,
+ onStop: this.onStopMove,
+ onMove: this.onMove
+ }), !endPanelCollapsed ? dom.div({
+ className: endPanelControl ? "controlled" : "uncontrolled",
+ style: rightPanelStyle
+ }, endPanel) : null);
+ }
+
+}
+
+module.exports = SplitBox;
+
+/***/ }),
+
+/***/ 946:
+/***/ (function(module, exports, __webpack_require__) {
+
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+const React = __webpack_require__(6);
+
+const ReactDOM = __webpack_require__(112);
+
+const {
+ Component
+} = React;
+
+const PropTypes = __webpack_require__(0);
+
+const dom = __webpack_require__(1);
+
+class Draggable extends Component {
+ static get propTypes() {
+ return {
+ onMove: PropTypes.func.isRequired,
+ onStart: PropTypes.func,
+ onStop: PropTypes.func,
+ style: PropTypes.object,
+ className: PropTypes.string
+ };
+ }
+
+ constructor(props) {
+ super(props);
+ this.startDragging = this.startDragging.bind(this);
+ this.onMove = this.onMove.bind(this);
+ this.onUp = this.onUp.bind(this);
+ }
+
+ startDragging(ev) {
+ ev.preventDefault();
+ const doc = ReactDOM.findDOMNode(this).ownerDocument;
+ doc.addEventListener("mousemove", this.onMove);
+ doc.addEventListener("mouseup", this.onUp);
+ this.props.onStart && this.props.onStart();
+ }
+
+ onMove(ev) {
+ ev.preventDefault(); // When the target is outside of the document, its tagName is undefined
+
+ if (!ev.target.tagName) {
+ return;
+ } // We pass the whole event because we don't know which properties
+ // the callee needs.
+
+
+ this.props.onMove(ev);
+ }
+
+ onUp(ev) {
+ ev.preventDefault();
+ const doc = ReactDOM.findDOMNode(this).ownerDocument;
+ doc.removeEventListener("mousemove", this.onMove);
+ doc.removeEventListener("mouseup", this.onUp);
+ this.props.onStop && this.props.onStop();
+ }
+
+ render() {
+ return dom.div({
+ style: this.props.style,
+ className: this.props.className,
+ onMouseDown: this.startDragging
+ });
+ }
+
+}
+
+module.exports = Draggable;
+
+/***/ }),
+
+/***/ 948:
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = move;
+
+function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
+
+function move(array, moveIndex, toIndex) {
+ /* #move - Moves an array item from one position in an array to another.
+ Note: This is a pure function so a new array will be returned, instead
+ of altering the array argument.
+ Arguments:
+ 1. array (String) : Array in which to move an item. (required)
+ 2. moveIndex (Object) : The index of the item to move. (required)
+ 3. toIndex (Object) : The index to move item at moveIndex to. (required)
+ */
+ var item = array[moveIndex];
+ var length = array.length;
+ var diff = moveIndex - toIndex;
+
+ if (diff > 0) {
+ // move left
+ return [].concat(_toConsumableArray(array.slice(0, toIndex)), [item], _toConsumableArray(array.slice(toIndex, moveIndex)), _toConsumableArray(array.slice(moveIndex + 1, length)));
+ } else if (diff < 0) {
+ // move right
+ return [].concat(_toConsumableArray(array.slice(0, moveIndex)), _toConsumableArray(array.slice(moveIndex + 1, toIndex + 1)), [item], _toConsumableArray(array.slice(toIndex + 1, length)));
+ }
+ return array;
+}
+
+/***/ }),
+
+/***/ 957:
+/***/ (function(module, exports) {
+
+// removed by extract-text-webpack-plugin
+
+/***/ }),
+
+/***/ 958:
+/***/ (function(module, exports) {
+
+// removed by extract-text-webpack-plugin
+
+/***/ }),
+
+/***/ 959:
+/***/ (function(module, exports) {
+
+// removed by extract-text-webpack-plugin
+
+/***/ })
+
+/******/ });
+}); \ No newline at end of file