1(function webpackUniversalModuleDefinition(root, factory) { 2 if(typeof exports === 'object' && typeof module === 'object') 3 module.exports = factory(); 4 else if(typeof define === 'function' && define.amd) 5 define([], factory); 6 else if(typeof exports === 'object') 7 exports["Babel"] = factory(); 8 else 9 root["Babel"] = factory(); 10})(this, function() { 11return /******/ (function(modules) { // webpackBootstrap 12/******/ // The module cache 13/******/ var installedModules = {}; 14 15/******/ // The require function 16/******/ function __webpack_require__(moduleId) { 17 18/******/ // Check if module is in cache 19/******/ if(installedModules[moduleId]) 20/******/ return installedModules[moduleId].exports; 21 22/******/ // Create a new module (and put it into the cache) 23/******/ var module = installedModules[moduleId] = { 24/******/ exports: {}, 25/******/ id: moduleId, 26/******/ loaded: false 27/******/ }; 28 29/******/ // Execute the module function 30/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); 31 32/******/ // Flag the module as loaded 33/******/ module.loaded = true; 34 35/******/ // Return the exports of the module 36/******/ return module.exports; 37/******/ } 38 39 40/******/ // expose the modules object (__webpack_modules__) 41/******/ __webpack_require__.m = modules; 42 43/******/ // expose the module cache 44/******/ __webpack_require__.c = installedModules; 45 46/******/ // __webpack_public_path__ 47/******/ __webpack_require__.p = ""; 48 49/******/ // Load entry module and return exports 50/******/ return __webpack_require__(0); 51/******/ }) 52/************************************************************************/ 53/******/ ((function(modules) { 54 // Check all modules for deduplicated modules 55 for(var i in modules) { 56 if(Object.prototype.hasOwnProperty.call(modules, i)) { 57 switch(typeof modules[i]) { 58 case "function": break; 59 case "object": 60 // Module can be created from a template 61 modules[i] = (function(_m) { 62 var args = _m.slice(1), fn = modules[_m[0]]; 63 return function (a,b,c) { 64 fn.apply(this, [a,b,c].concat(args)); 65 }; 66 }(modules[i])); 67 break; 68 default: 69 // Module is a copy of another module 70 modules[i] = modules[modules[i]]; 71 break; 72 } 73 } 74 } 75 return modules; 76}([ 77/* 0 */ 78/***/ function(module, exports, __webpack_require__) { 79 80 'use strict'; 81 82 Object.defineProperty(exports, "__esModule", { 83 value: true 84 }); 85 exports.version = exports.availablePresets = exports.availablePlugins = undefined; 86 87 var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; 88 89 var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; 90 91 exports.transform = transform; 92 exports.transformFromAst = transformFromAst; 93 exports.registerPlugin = registerPlugin; 94 exports.registerPlugins = registerPlugins; 95 exports.registerPreset = registerPreset; 96 exports.registerPresets = registerPresets; 97 exports.disableScriptTags = disableScriptTags; 98 99 var _babelCore = __webpack_require__(287); 100 101 var Babel = _interopRequireWildcard(_babelCore); 102 103 var _transformScriptTags = __webpack_require__(617); 104 105 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; } } 106 107 var isArray = Array.isArray || function (arg) { 108 return Object.prototype.toString.call(arg) === '[object Array]'; 109 }; 110 111 /** 112 * Loads the given name (or [name, options] pair) from the given table object 113 * holding the available presets or plugins. 114 * 115 * Returns undefined if the preset or plugin is not available; passes through 116 * name unmodified if it (or the first element of the pair) is not a string. 117 */ 118 function loadBuiltin(builtinTable, name) { 119 if (isArray(name) && typeof name[0] === 'string') { 120 if (builtinTable.hasOwnProperty(name[0])) { 121 return [builtinTable[name[0]]].concat(name.slice(1)); 122 } 123 return; 124 } else if (typeof name === 'string') { 125 return builtinTable[name]; 126 } 127 // Could be an actual preset/plugin module 128 return name; 129 } 130 131 /** 132 * Parses plugin names and presets from the specified options. 133 */ 134 function processOptions(options) { 135 // Parse preset names 136 var presets = (options.presets || []).map(function (presetName) { 137 var preset = loadBuiltin(availablePresets, presetName); 138 139 if (preset) { 140 // workaround for babel issue 141 // at some point, babel copies the preset, losing the non-enumerable 142 // buildPreset key; convert it into an enumerable key. 143 if (isArray(preset) && _typeof(preset[0]) === 'object' && preset[0].hasOwnProperty('buildPreset')) { 144 preset[0] = _extends({}, preset[0], { buildPreset: preset[0].buildPreset }); 145 } 146 } else { 147 throw new Error('Invalid preset specified in Babel options: "' + presetName + '"'); 148 } 149 return preset; 150 }); 151 152 // Parse plugin names 153 var plugins = (options.plugins || []).map(function (pluginName) { 154 var plugin = loadBuiltin(availablePlugins, pluginName); 155 156 if (!plugin) { 157 throw new Error('Invalid plugin specified in Babel options: "' + pluginName + '"'); 158 } 159 return plugin; 160 }); 161 162 return _extends({ 163 babelrc: false 164 }, options, { 165 presets: presets, 166 plugins: plugins 167 }); 168 } 169 170 function transform(code, options) { 171 return Babel.transform(code, processOptions(options)); 172 } 173 174 function transformFromAst(ast, code, options) { 175 return Babel.transformFromAst(ast, code, processOptions(options)); 176 } 177 var availablePlugins = exports.availablePlugins = {}; 178 var availablePresets = exports.availablePresets = {}; 179 180 /** 181 * Registers a named plugin for use with Babel. 182 */ 183 function registerPlugin(name, plugin) {
184 if (availablePlugins.hasOwnProperty(name)) { 185 console.warn('A plugin named "' + name + '" is already registered, it will be overridden'); 186 } 187 availablePlugins[name] = plugin; 188 } 189 /** 190 * Registers multiple plugins for use with Babel. `newPlugins` should be an object where the key 191 * is the name of the plugin, and the value is the plugin itself. 192 */ 193 function registerPlugins(newPlugins) { 194 Object.keys(newPlugins).forEach(function (name) { 195 return registerPlugin(name, newPlugins[name]); 196 }); 197 } 198 199 /** 200 * Registers a named preset for use with Babel. 201 */ 202 function registerPreset(name, preset) { 203 if (availablePresets.hasOwnProperty(name)) { 204 console.warn('A preset named "' + name + '" is already registered, it will be overridden'); 205 } 206 availablePresets[name] = preset; 207 } 208 /** 209 * Registers multiple presets for use with Babel. `newPresets` should be an object where the key 210 * is the name of the preset, and the value is the preset itself. 211 */ 212 function registerPresets(newPresets) { 213 Object.keys(newPresets).forEach(function (name) { 214 return registerPreset(name, newPresets[name]); 215 }); 216 } 217 218 // All the plugins we should bundle 219 registerPlugins({ 220 'check-es2015-constants': __webpack_require__(64), 221 'external-helpers': __webpack_require__(319), 222 'syntax-async-functions': __webpack_require__(65), 223 'syntax-async-generators': __webpack_require__(192), 224 'syntax-class-constructor-call': __webpack_require__(193), 225 'syntax-class-properties': __webpack_require__(194), 226 'syntax-decorators': __webpack_require__(122), 227 'syntax-do-expressions': __webpack_require__(195), 228 'syntax-exponentiation-operator': __webpack_require__(196), 229 'syntax-export-extensions': __webpack_require__(197), 230 'syntax-flow': __webpack_require__(123), 231 'syntax-function-bind': __webpack_require__(198), 232 'syntax-function-sent': __webpack_require__(321), 233 'syntax-jsx': __webpack_require__(124), 234 'syntax-object-rest-spread': __webpack_require__(199), 235 'syntax-trailing-function-commas': __webpack_require__(125), 236 'transform-async-functions': __webpack_require__(322), 237 'transform-async-to-generator': __webpack_require__(126), 238 'transform-async-to-module-method': __webpack_require__(324), 239 'transform-class-constructor-call': __webpack_require__(200), 240 'transform-class-properties': __webpack_require__(201), 241 'transform-decorators': __webpack_require__(202), 242 'transform-decorators-legacy': __webpack_require__(325).default, // <- No clue. Nope. 243 'transform-do-expressions': __webpack_require__(203), 244 'transform-es2015-arrow-functions': __webpack_require__(66), 245 'transform-es2015-block-scoped-functions': __webpack_require__(67), 246 'transform-es2015-block-scoping': __webpack_require__(68), 247 'transform-es2015-classes': __webpack_require__(69), 248 'transform-es2015-computed-properties': __webpack_require__(70), 249 'transform-es2015-destructuring': __webpack_require__(71), 250 'transform-es2015-duplicate-keys': __webpack_require__(127), 251 'transform-es2015-for-of': __webpack_require__(72), 252 'transform-es2015-function-name': __webpack_require__(73), 253 'transform-es2015-instanceof': __webpack_require__(328), 254 'transform-es2015-literals': __webpack_require__(74), 255 'transform-es2015-modules-amd': __webpack_require__(128), 256 'transform-es2015-modules-commonjs': __webpack_require__(75), 257 'transform-es2015-modules-systemjs': __webpack_require__(205), 258 'transform-es2015-modules-umd': __webpack_require__(206), 259 'transform-es2015-object-super': __webpack_require__(76), 260 'transform-es2015-parameters': __webpack_require__(77), 261 'transform-es2015-shorthand-properties': __webpack_require__(78), 262 'transform-es2015-spread': __webpack_require__(79), 263 'transform-es2015-sticky-regex': __webpack_require__(80), 264 'transform-es2015-template-literals': __webpack_require__(81), 265 'transform-es2015-typeof-symbol': __webpack_require__(82), 266 'transform-es2015-unicode-regex': __webpack_require__(83), 267 'transform-es3-member-expression-literals': __webpack_require__(332), 268 'transform-es3-property-literals': __webpack_require__(333),
269 'transform-es5-property-mutators': __webpack_require__(334), 270 'transform-eval': __webpack_require__(335), 271 'transform-exponentiation-operator': __webpack_require__(129), 272 'transform-export-extensions': __webpack_require__(207), 273 'transform-flow-comments': __webpack_require__(336), 274 'transform-flow-strip-types': __webpack_require__(208), 275 'transform-function-bind': __webpack_require__(209), 276 'transform-jscript': __webpack_require__(337), 277 'transform-object-assign': __webpack_require__(338), 278 'transform-object-rest-spread': __webpack_require__(210), 279 'transform-object-set-prototype-of-to-assign': __webpack_require__(339), 280 'transform-proto-to-assign': __webpack_require__(340), 281 'transform-react-constant-elements': __webpack_require__(341), 282 'transform-react-display-name': __webpack_require__(211), 283 'transform-react-inline-elements': __webpack_require__(342), 284 'transform-react-jsx': __webpack_require__(212), 285 'transform-react-jsx-compat': __webpack_require__(343), 286 'transform-react-jsx-self': __webpack_require__(344), 287 'transform-react-jsx-source': __webpack_require__(345), 288 'transform-regenerator': __webpack_require__(84), 289 'transform-runtime': __webpack_require__(347), 290 'transform-strict-mode': __webpack_require__(213), 291 'undeclared-variables-check': __webpack_require__(348) 292 }); 293 294 // All the presets we should bundle 295 registerPresets({ 296 es2015: __webpack_require__(214), 297 es2016: __webpack_require__(215), 298 es2017: __webpack_require__(216), 299 latest: __webpack_require__(350), 300 react: __webpack_require__(351), 301 'stage-0': __webpack_require__(352), 302 'stage-1': __webpack_require__(217), 303 'stage-2': __webpack_require__(218), 304 'stage-3': __webpack_require__(219), 305 306 // ES2015 preset with es2015-modules-commonjs removed 307 // Plugin list copied from babel-preset-es2015/index.js 308 'es2015-no-commonjs': { 309 plugins: [__webpack_require__(81), __webpack_require__(74), __webpack_require__(73), __webpack_require__(66), __webpack_require__(67), __webpack_require__(69), __webpack_require__(76), __webpack_require__(78), __webpack_require__(70), __webpack_require__(72), __webpack_require__(80), __webpack_require__(83), __webpack_require__(64), __webpack_require__(79), __webpack_require__(77), __webpack_require__(71), __webpack_require__(68), __webpack_require__(82), [__webpack_require__(84), { async: false, asyncGenerators: false }]] 310 }, 311 312 // ES2015 preset with plugins set to loose mode. 313 // Based off https://github.com/bkonkle/babel-preset-es2015-loose/blob/master/index.js 314 'es2015-loose': { 315 plugins: [[__webpack_require__(81), { loose: true }], __webpack_require__(74), __webpack_require__(73), __webpack_require__(66), __webpack_require__(67), [__webpack_require__(69), { loose: true }], __webpack_require__(76), __webpack_require__(78), __webpack_require__(127), [__webpack_require__(70), { loose: true }], [__webpack_require__(72), { loose: true }], __webpack_require__(80), __webpack_require__(83), __webpack_require__(64), [__webpack_require__(79), { loose: true }], __webpack_require__(77), [__webpack_require__(71), { loose: true }], __webpack_require__(68), __webpack_require__(82), [__webpack_require__(75), { loose: true }], [__webpack_require__(84), { async: false, asyncGenerators: false }]] 316 } 317 }); 318 319 var version = exports.version = ("6.24.0"); 320 321 // Listen for load event if we're in a browser and then kick off finding and 322 // running of scripts with "text/babel" type. 323 var transformScriptTags = function transformScriptTags() { 324 return (0, _transformScriptTags.runScripts)(transform); 325 }; 326 if (typeof window !== 'undefined' && window && window.addEventListener) { 327 window.addEventListener('DOMContentLoaded', transformScriptTags, false); 328 } 329 330 /** 331 * Disables automatic transformation of <script> tags with "text/babel" type. 332 */ 333 function disableScriptTags() { 334 window.removeEventListener('DOMContentLoaded', transformScriptTags); 335 } 336 337/***/ }, 338/* 1 */ 339/***/ function(module, exports, __webpack_require__) { 340 341 "use strict"; 342 343 exports.__esModule = true; 344 exports.createTypeAnnotationBasedOnTypeof = exports.removeTypeDuplicates = exp
344orts.createUnionTypeAnnotation = exports.valueToNode = exports.toBlock = exports.toExpression = exports.toStatement = exports.toBindingIdentifierName = exports.toIdentifier = exports.toKeyAlias = exports.toSequenceExpression = exports.toComputedKey = exports.isNodesEquivalent = exports.isImmutable = exports.isScope = exports.isSpecifierDefault = exports.isVar = exports.isBlockScoped = exports.isLet = exports.isValidIdentifier = exports.isReferenced = exports.isBinding = exports.getOuterBindingIdentifiers = exports.getBindingIdentifiers = exports.TYPES = exports.react = exports.DEPRECATED_KEYS = exports.BUILDER_KEYS = exports.NODE_FIELDS = exports.ALIAS_KEYS = exports.VISITOR_KEYS = exports.NOT_LOCAL_BINDING = exports.BLOCK_SCOPED_SYMBOL = exports.INHERIT_KEYS = exports.UNARY_OPERATORS = exports.STRING_UNARY_OPERATORS = exports.NUMBER_UNARY_OPERATORS = exports.BOOLEAN_UNARY_OPERATORS = exports.BINARY_OPERATORS = exports.NUMBER_BINARY_OPERATORS = exports.BOOLEAN_BINARY_OPERATORS = exports.COMPARISON_BINARY_OPERATORS = exports.EQUALITY_BINARY_OPERATORS = exports.BOOLEAN_NUMBER_BINARY_OPERATORS = exports.UPDATE_OPERATORS = exports.LOGICAL_OPERATORS = exports.COMMENT_KEYS = exports.FOR_INIT_KEYS = exports.FLATTENABLE_KEYS = exports.STATEMENT_OR_BLOCK_KEYS = undefined; 345 346 var _getOwnPropertySymbols = __webpack_require__(354); 347 348 var _getOwnPropertySymbols2 = _interopRequireDefault(_getOwnPropertySymbols); 349 350 var _getIterator2 = __webpack_require__(2); 351 352 var _getIterator3 = _interopRequireDefault(_getIterator2); 353 354 var _keys = __webpack_require__(13); 355 356 var _keys2 = _interopRequireDefault(_keys); 357 358 var _stringify = __webpack_require__(34); 359 360 var _stringify2 = _interopRequireDefault(_stringify); 361 362 var _constants = __webpack_require__(132); 363 364 Object.defineProperty(exports, "STATEMENT_OR_BLOCK_KEYS", { 365 enumerable: true, 366 get: function get() { 367 return _constants.STATEMENT_OR_BLOCK_KEYS; 368 } 369 }); 370 Object.defineProperty(exports, "FLATTENABLE_KEYS", { 371 enumerable: true, 372 get: function get() { 373 return _constants.FLATTENABLE_KEYS; 374 } 375 }); 376 Object.defineProperty(exports, "FOR_INIT_KEYS", { 377 enumerable: true, 378 get: function get() { 379 return _constants.FOR_INIT_KEYS; 380 } 381 }); 382 Object.defineProperty(exports, "COMMENT_KEYS", { 383 enumerable: true, 384 get: function get() { 385 return _constants.COMMENT_KEYS; 386 } 387 }); 388 Object.defineProperty(exports, "LOGICAL_OPERATORS", { 389 enumerable: true, 390 get: function get() { 391 return _constants.LOGICAL_OPERATORS; 392 } 393 }); 394 Object.defineProperty(exports, "UPDATE_OPERATORS", { 395 enumerable: true, 396 get: function get() { 397 return _constants.UPDATE_OPERATORS; 398 } 399 }); 400 Object.defineProperty(exports, "BOOLEAN_NUMBER_BINARY_OPERATORS", { 401 enumerable: true, 402 get: function get() { 403 return _constants.BOOLEAN_NUMBER_BINARY_OPERATORS; 404 } 405 }); 406 Object.defineProperty(exports, "EQUALITY_BINARY_OPERATORS", { 407 enumerable: true, 408 get: function get() { 409 return _constants.EQUALITY_BINARY_OPERATORS; 410 } 411 }); 412 Object.defineProperty(exports, "COMPARISON_BINARY_OPERATORS", { 413 enumerable: true, 414 get: function get() { 415 return _constants.COMPARISON_BINARY_OPERATORS; 416 } 417 }); 418 Object.defineProperty(exports, "BOOLEAN_BINARY_OPERATORS", { 419 enumerable: true, 420 get: function get() { 421 return _constants.BOOLEAN_BINARY_OPERATORS; 422 } 423 }); 424 Object.defineProperty(exports, "NUMBER_BINARY_OPERATORS", { 425 enumerable: true, 426 get: function get() { 427 return _constants.NUMBER_BINARY_OPERATORS; 428 } 429 }); 430 Object.defineProperty(exports, "BINARY_OPERATORS", { 431 enumerable: true, 432 get: function get() { 433 return _constants.BINARY_OPERATORS; 434 } 435 }); 436 Object.defineProperty(exports, "BOOLEAN_UNARY_OPERATORS", { 437 enumerable: true, 438 get: function get() { 439 return _constants.BOOLEAN_UNARY_OPERATORS; 440 } 441 }); 442 Object.defineProperty(exports, "NUMBER_UNARY_OPERATORS", { 443 enumerable: true, 444 get: function get() { 445 return _constants.NUMBER_UNARY_OPERATORS; 446 } 447 }); 448 Object.defineProperty(exports, "STRING_UNARY_OPERATORS", { 449 enumerable: true, 450 get: function get() { 451 return _constants.STRING_UNARY_OPERATORS; 452 } 453 }); 454 Object.defineProperty(exports, "UNARY_OPERATORS", { 455 enumerable: true, 456 get: function get() { 457 return _constants.UNARY_OPERATORS; 458 } 459 }); 460 Object.defineProperty(exports, "INHERIT_KEYS", { 461 enumerable: true, 462 get: function get() { 463 return _constants.INHERIT_KEYS; 464 } 465 }); 466 Object.defineProperty(exports, "BLOCK_SCOPED_SYMBOL", { 467 enumerable: true, 468 get: function get() { 469 return _constants.BLOCK_SCOPED_SYMBOL; 470 } 471 }); 472 Object.defineProperty(exports, "NOT_LOCAL_BINDING", { 473 enumerable: true, 474 get: function get() { 475 return _constants.NOT_LOCAL_BINDING; 476 } 477 }); 478 exports.is = is; 479 exports.isType = isType;
480 exports.validate = validate; 481 exports.shallowEqual = shallowEqual; 482 exports.appendToMemberExpression = appendToMemberExpression; 483 exports.prependToMemberExpression = prependToMemberExpression; 484 exports.ensureBlock = ensureBlock; 485 exports.clone = clone; 486 exports.cloneWithoutLoc = cloneWithoutLoc; 487 exports.cloneDeep = cloneDeep; 488 exports.buildMatchMemberExpression = buildMatchMemberExpression; 489 exports.removeComments = removeComments; 490 exports.inheritsComments = inheritsComments; 491 exports.inheritTrailingComments = inheritTrailingComments; 492 exports.inheritLeadingComments = inheritLeadingComments; 493 exports.inheritInnerComments = inheritInnerComments; 494 exports.inherits = inherits; 495 exports.assertNode = assertNode; 496 exports.isNode = isNode; 497 exports.traverseFast = traverseFast; 498 exports.removeProperties = removeProperties; 499 exports.removePropertiesDeep = removePropertiesDeep; 500 501 var _retrievers = __webpack_require__(223); 502 503 Object.defineProperty(exports, "getBindingIdentifiers", { 504 enumerable: true, 505 get: function get() { 506 return _retrievers.getBindingIdentifiers; 507 } 508 }); 509 Object.defineProperty(exports, "getOuterBindingIdentifiers", { 510 enumerable: true, 511 get: function get() { 512 return _retrievers.getOuterBindingIdentifiers; 513 } 514 }); 515 516 var _validators = __webpack_require__(389); 517 518 Object.defineProperty(exports, "isBinding", { 519 enumerable: true, 520 get: function get() { 521 return _validators.isBinding; 522 } 523 }); 524 Object.defineProperty(exports, "isReferenced", { 525 enumerable: true, 526 get: function get() { 527 return _validators.isReferenced; 528 } 529 }); 530 Object.defineProperty(exports, "isValidIdentifier", { 531 enumerable: true, 532 get: function get() { 533 return _validators.isValidIdentifier; 534 } 535 }); 536 Object.defineProperty(exports, "isLet", { 537 enumerable: true, 538 get: function get() { 539 return _validators.isLet; 540 } 541 }); 542 Object.defineProperty(exports, "isBlockScoped", { 543 enumerable: true, 544 get: function get() { 545 return _validators.isBlockScoped; 546 } 547 }); 548 Object.defineProperty(exports, "isVar", { 549 enumerable: true, 550 get: function get() { 551 return _validators.isVar; 552 } 553 }); 554 Object.defineProperty(exports, "isSpecifierDefault", { 555 enumerable: true, 556 get: function get() { 557 return _validators.isSpecifierDefault; 558 } 559 }); 560 Object.defineProperty(exports, "isScope", { 561 enumerable: true, 562 get: function get() { 563 return _validators.isScope; 564 } 565 }); 566 Object.defineProperty(exports, "isImmutable", { 567 enumerable: true, 568 get: function get() { 569 return _validators.isImmutable; 570 } 571 }); 572 Object.defineProperty(exports, "isNodesEquivalent", { 573 enumerable: true, 574 get: function get() { 575 return _validators.isNodesEquivalent; 576 } 577 }); 578 579 var _converters = __webpack_require__(379); 580 581 Object.defineProperty(exports, "toComputedKey", { 582 enumerable: true, 583 get: function get() { 584 return _converters.toComputedKey; 585 } 586 }); 587 Object.defineProperty(exports, "toSequenceExpression", { 588 enumerable: true, 589 get: function get() { 590 return _converters.toSequenceExpression; 591 } 592 }); 593 Object.defineProperty(exports, "toKeyAlias", { 594 enumerable: true, 595 get: function get() { 596 return _converters.toKeyAlias; 597 } 598 }); 599 Object.defineProperty(exports, "toIdentifier", { 600 enumerable: true, 601 get: function get() { 602 return _converters.toIdentifier; 603 } 604 }); 605 Object.defineProperty(exports, "toBindingIdentifierName", { 606 enumerable: true, 607 get: function get() { 608 return _converters.toBindingIdentifierName; 609 } 610 }); 611 Object.defineProperty(exports, "toStatement", { 612 enumerable: true, 613 get: function get() { 614 return _converters.toStatement; 615 } 616 }); 617 Object.defineProperty(exports, "toExpression", { 618 enumerable: true, 619 get: function get() { 620 return _converters.toExpression; 621 } 622 }); 623 Object.defineProperty(exports, "toBlock", { 624 enumerable: true, 625 get: function get() { 626 return _converters.toBlock; 627 } 628 }); 629 Object.defineProperty(exports, "valueToNode", { 630 enumerable: true, 631 get: function get() { 632 return _converters.valueToNode; 633 } 634 }); 635 636 var _flow = __webpack_require__(387); 637 638 Object.defineProperty(exports, "createUnionTypeAnnotation", { 639 enumerable: true, 640 get: function get() { 641 return _flow.createUnionTypeAnnotation; 642 } 643 }); 644 Object.defineProperty(exports, "removeTypeDuplicates", { 645 enumerable: true, 646 get: function get() { 647 return _flow.removeTypeDuplicates; 648 } 649 }); 650 Object.defineProperty(exports, "createTypeAnnotationBasedOnTypeof", { 651 enumerable: true, 652 get: function get() { 653 return _flow.createTypeAnnotationBasedOnTypeof; 654 } 655 }); 656 657 var _toFastProperties = __webpack_require__(612); 658 659 var _toFastProperties2 = _interopRequireDefault(_toFastProperties); 660 661 var _clone = __webpack_require__(107); 662 663 var _clone2 = _interopRequireDefault(_clone); 664 665 var _uniq = __webpack_require__(589); 666 667 var _uniq2 = _interopRequireDefault(_uniq); 668 669 __webpack_require__(384); 670 671 var _definitions = __webpack_require__(26); 672 673 var _react2 = __webpack_require__(388); 674 675 var _react = _interopRequireWildcard(_react2); 676 677 function _interopRequireWildcard(obj) { 678 if (obj && obj.__esModule) { 679 return obj; 680 } else { 681 var newObj = {};if (obj != null) { 682 for (var key in obj) { 683 if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; 684 } 685 }newObj.default = obj;return newObj; 686 } 687 } 688 689 function _interopRequireDefault(obj) { 690 return obj && obj.__esModule ? obj : { default: obj }; 691 } 692 693 var t = exports; 694 695 function registerType(type) { 696 var is = t["is" + type]; 697 if (!is) { 698 is = t["is" + type] = function (node, opts) { 699 return t.is(type, node, opts); 700 }; 701 } 702 703 t["assert" + type] = function (node, opts) { 704 opts = opts || {}; 705 if (!is(node, opts)) { 706 throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); 707 } 708 }; 709 } 710 711 exports.VISITOR_KEYS = _definitions.VISITOR_KEYS; 712 exports.ALIAS_KEYS = _definitions.ALIAS_KEYS; 713 exports.NODE_FIELDS = _definitions.NODE_FIELDS; 714 exports.BUILDER_KEYS = _definitions.BUILDER_KEYS; 715 exports.DEPRECATED_KEYS = _definitions.DEPRECATED_KEYS; 716 exports.react = _react; 717 718 for (var type in t.VISITOR_KEYS) { 719 registerType(type); 720 } 721 722 t.FLIPPED_ALIAS_KEYS = {}; 723
724 (0, _keys2.default)(t.ALIAS_KEYS).forEach(function (type) { 725 t.ALIAS_KEYS[type].forEach(function (alias) { 726 var types = t.FLIPPED_ALIAS_KEYS[alias] = t.FLIPPED_ALIAS_KEYS[alias] || []; 727 types.push(type); 728 }); 729 }); 730 731 (0, _keys2.default)(t.FLIPPED_ALIAS_KEYS).forEach(function (type) { 732 t[type.toUpperCase() + "_TYPES"] = t.FLIPPED_ALIAS_KEYS[type]; 733 registerType(type); 734 }); 735 736 var TYPES = exports.TYPES = (0, _keys2.default)(t.VISITOR_KEYS).concat((0, _keys2.default)(t.FLIPPED_ALIAS_KEYS)).concat((0, _keys2.default)(t.DEPRECATED_KEYS)); 737 738 function is(type, node, opts) { 739 if (!node) return false; 740 741 var matches = isType(node.type, type); 742 if (!matches) return false; 743 744 if (typeof opts === "undefined") { 745 return true; 746 } else { 747 return t.shallowEqual(node, opts); 748 } 749 } 750 751 function isType(nodeType, targetType) { 752 if (nodeType === targetType) return true; 753 754 if (t.ALIAS_KEYS[targetType]) return false; 755 756 var aliases = t.FLIPPED_ALIAS_KEYS[targetType]; 757 if (aliases) { 758 if (aliases[0] === nodeType) return true; 759 760 for (var _iterator = aliases, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) { 761 var _ref; 762 763 if (_isArray) { 764 if (_i >= _iterator.length) break; 765 _ref = _iterator[_i++]; 766 } else { 767 _i = _iterator.next(); 768 if (_i.done) break; 769 _ref = _i.value; 770 } 771 772 var alias = _ref; 773 774 if (nodeType === alias) return true; 775 } 776 } 777 778 return false; 779 } 780 781 (0, _keys2.default)(t.BUILDER_KEYS).forEach(function (type) { 782 var keys = t.BUILDER_KEYS[type]; 783 784 function builder() { 785 if (arguments.length > keys.length) { 786 throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); 787 } 788 789 var node = {}; 790 node.type = type; 791 792 var i = 0; 793 794 for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) { 795 var _ref2; 796 797 if (_isArray2) { 798 if (_i2 >= _iterator2.length) break; 799 _ref2 = _iterator2[_i2++]; 800 } else { 801 _i2 = _iterator2.next(); 802 if (_i2.done) break; 803 _ref2 = _i2.value; 804 } 805 806 var _key = _ref2; 807 808 var field = t.NODE_FIELDS[type][_key]; 809 810 var arg = arguments[i++]; 811 if (arg === undefined) arg = (0, _clone2.default)(field.default); 812 813 node[_key] = arg; 814 } 815 816 for (var key in node) { 817 validate(node, key, node[key]); 818 } 819 820 return node; 821 } 822 823 t[type] = builder; 824 t[type[0].toLowerCase() + type.slice(1)] = builder; 825 }); 826 827 var _loop = function _loop(_type) { 828 var newType = t.DEPRECATED_KEYS[_type]; 829 830 function proxy(fn) { 831 return function () { 832 console.trace("The node type " + _type + " has been renamed to " + newType); 833 return fn.apply(this, arguments); 834 }; 835 } 836 837 t[_type] = t[_type[0].toLowerCase() + _type.slice(1)] = proxy(t[newType]); 838 t["is" + _type] = proxy(t["is" + newType]); 839 t["assert" + _type] = proxy(t["assert" + newType]); 840 }; 841 842 for (var _type in t.DEPRECATED_KEYS) { 843 _loop(_type); 844 } 845 846 function validate(node, key, val) { 847 if (!node) return; 848 849 var fields = t.NODE_FIELDS[node.type]; 850 if (!fields) return; 851 852 var field = fields[key]; 853 if (!field || !field.validate) return; 854 if (field.optional && val == null) return; 855 856 field.validate(node, key, val); 857 } 858 859 function shallowEqual(actual, expected) { 860 var keys = (0, _keys2.default)(expected); 861 862 for (var _iterator3 = keys, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, _getIterator3.default)(_iterator3);;) { 863 var _ref3; 864 865 if (_isArray3) { 866 if (_i3 >= _iterator3.length) break; 867 _ref3 = _iterator3[_i3++]; 868 } else { 869 _i3 = _iterator3.next(); 870 if (_i3.done) break; 871 _ref3 = _i3.value; 872 } 873 874 var key = _ref3; 875 876 if (actual[key] !== expected[key]) { 877 return false;
878 } 879 } 880 881 return true; 882 } 883 884 function appendToMemberExpression(member, append, computed) { 885 member.object = t.memberExpression(member.object, member.property, member.computed); 886 member.property = append; 887 member.computed = !!computed; 888 return member; 889 } 890 891 function prependToMemberExpression(member, prepend) { 892 member.object = t.memberExpression(prepend, member.object); 893 return member; 894 } 895 896 function ensureBlock(node) { 897 var key = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "body"; 898 899 return node[key] = t.toBlock(node[key], node); 900 } 901 902 function clone(node) { 903 if (!node) return node; 904 var newNode = {}; 905 for (var key in node) { 906 if (key[0] === "_") continue; 907 newNode[key] = node[key]; 908 } 909 return newNode; 910 } 911 912 function cloneWithoutLoc(node) { 913 var newNode = clone(node); 914 delete newNode.loc; 915 return newNode; 916 } 917 918 function cloneDeep(node) { 919 if (!node) return node; 920 var newNode = {}; 921 922 for (var key in node) { 923 if (key[0] === "_") continue; 924 925 var val = node[key]; 926 927 if (val) { 928 if (val.type) { 929 val = t.cloneDeep(val); 930 } else if (Array.isArray(val)) { 931 val = val.map(t.cloneDeep); 932 } 933 } 934 935 newNode[key] = val; 936 } 937 938 return newNode; 939 } 940 941 function buildMatchMemberExpression(match, allowPartial) { 942 var parts = match.split("."); 943 944 return function (member) { 945 if (!t.isMemberExpression(member)) return false; 946 947 var search = [member]; 948 var i = 0; 949 950 while (search.length) { 951 var node = search.shift(); 952 953 if (allowPartial && i === parts.length) { 954 return true; 955 } 956 957 if (t.isIdentifier(node)) { 958 if (parts[i] !== node.name) return false; 959 } else if (t.isStringLiteral(node)) { 960 if (parts[i] !== node.value) return false; 961 } else if (t.isMemberExpression(node)) { 962 if (node.computed && !t.isStringLiteral(node.property)) { 963 return false; 964 } else { 965 search.push(node.object); 966 search.push(node.property); 967 continue; 968 } 969 } else { 970 return false; 971 } 972 973 if (++i > parts.length) { 974 return false; 975 } 976 } 977 978 return true; 979 }; 980 } 981 982 function removeComments(node) { 983 for (var _iterator4 = t.COMMENT_KEYS, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, _getIterator3.default)(_iterator4);;) { 984 var _ref4; 985 986 if (_isArray4) { 987 if (_i4 >= _iterator4.length) break; 988 _ref4 = _iterator4[_i4++]; 989 } else { 990 _i4 = _iterator4.next(); 991 if (_i4.done) break; 992 _ref4 = _i4.value; 993 } 994 995 var key = _ref4; 996 997 delete node[key]; 998 } 999 return node; 1000 } 1001 1002 function inheritsComments(child, parent) { 1003 inheritTrailingComments(child, parent); 1004 inheritLeadingComments(child, parent); 1005 inheritInnerComments(child, parent); 1006 return child; 1007 } 1008 1009 function inheritTrailingComments(child, parent) { 1010 _inheritComments("trailingComments", child, parent); 1011 } 1012 1013 function inheritLeadingComments(child, parent) { 1014 _inheritComments("leadingComments", child, parent); 1015 } 1016 1017 function inheritInnerComments(child, parent) { 1018 _inheritComments("innerComments", child, parent); 1019 } 1020 1021 function _inheritComments(key, child, parent) { 1022 if (child && parent) { 1023 child[key] = (0, _uniq2.default)([].concat(child[key], parent[key]).filter(Boolean)); 1024 } 1025 } 1026 1027 function inherits(child, parent) { 1028 if (!child || !parent) return child; 1029 1030 for (var _iterator5 = t.INHERIT_KEYS.optional, _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : (0, _getIterator3.default)(_iterator5);;) { 1031 var _ref5; 1032 1033 if (_isArray5) { 1034 if (_i5 >= _iterator5.length) break; 1035 _ref5 = _iterator5[_i5++]; 1036 } else { 1037 _i5 = _iterator5.next(); 1038 if (_i5.done) break; 1039 _ref5 = _i5.value; 1040 } 1041 1042 var _key2 = _ref5; 1043 1044 if (child[_key2] == null) { 1045 child[_key2] = parent[_key2]; 1046 } 1047 } 1048 1049 for (var key in parent) { 1050 if (key[0] === "_") child[key] = parent[key]; 1051 } 1052 1053 for (var _iterator6 = t.INHERIT_KEYS.force, _isArray6 = Array.isArray(_iterator6), _i6 = 0, _iterator6 = _isArray6 ? _iterator6 : (0, _getIterator3.default)(_iterator6);;) { 1054 var _ref6; 1055 1056 if (_isArray6) { 1057 if (_i6 >= _iterator6.length) break; 1058 _ref6 = _iterator6[_i6++]; 1059 } else { 1060 _i6 = _iterator6.next(); 1061 if (_i6.done) break; 1062 _ref6 = _i6.value; 1063 } 1064 1065 var _key3 = _ref6; 1066 1067 child[_key3] = parent[_key3]; 1068 } 1069 1070 t.inheritsComments(child, parent); 1071 1072 return child; 1073 } 1074 1075 function assertNode(node) { 1076 if (!isNode(node)) { 1077 throw new TypeError("Not a valid node " + (node && node.type)); 1078 } 1079 } 1080 1081 function isNode(node) { 1082 return !!(node && _definitions.VISITOR_KEYS[node.type]); 1083 } 1084 1085 (0, _toFastProperties2.default)(t); 1086 (0, _toFastProperties2.default)(t.VISITOR_KEYS); 1087 1088 function traverseFast(node, enter, opts) { 1089 if (!node) return; 1090 1091 var keys = t.VISITOR_KEYS[node.type]; 1092 if (!keys) return; 1093 1094 opts = opts || {}; 1095 enter(node, opts); 1096 1097 for (var _iterator7 = keys, _isArray7 = Array.isArray(_iterator7), _i7 = 0, _iterator7 = _isArray7 ? _iterator7 : (0, _getIterator3.default)(_iterator7);;) { 1098 var _ref7; 1099 1100 if (_isArray7) { 1101 if (_i7 >= _iterator7.length) break; 1102 _ref7 = _iterator7[_i7++]; 1103 } else { 1104 _i7 = _iterator7.next(); 1105 if (_i7.done) break; 1106 _ref7 = _i7.value; 1107 } 1108 1109 var key = _ref7; 1110 1111 var subNode = node[key]; 1112 1113 if (Array.isArray(subNode)) { 1114 for (var _iterator8 = subNode, _isArray8 = Array.isArray(_iterator8), _i8 = 0, _iterator8 = _isArray8 ? _iterator8 : (0, _getIterator3.default)(_iterator8);;) { 1115 var _ref8; 1116 1117 if (_isArray8) { 1118 if (_i8 >= _iterator8.length) break; 1119 _ref8 = _iterator8[_i8++]; 1120 } else { 1121 _i8 = _iterator8.next(); 1122 if (_i8.done) break; 1123 _ref8 = _i8.value; 1124 } 1125 1126 var _node = _ref8; 1127 1128 traverseFast(_node, enter, opts); 1129 } 1130 } else { 1131 traverseFast(subNode, enter, opts); 1132 } 1133 } 1134 } 1135 1136 var CLEAR_KEYS = ["tokens", "start", "end", "loc", "raw", "rawValue"]; 1137 1138 var CLEAR_KEYS_PLUS_COMMENTS = t.COMMENT_KEYS.concat(["comments"]).concat(CLEAR_KEYS); 1139 1140 function removeProperties(node, opts) { 1141 opts = opts || {}; 1142 var map = opts.preserveComments ? CLEAR_KEYS : CLEAR_KEYS_PLUS_COMMENTS; 1143 for (var _iterator9 = map, _isArray9 = Array.isArray(_iterator9), _i9 = 0, _iterator9 = _isArray9 ? _iterator9 : (0, _getIterator3.default)(_iterator9);;) { 1144 var _ref9; 1145 1146 if (_isArray9) { 1147 if (_i9 >= _iterator9.length) break; 1148 _ref9 = _iterator9[_i9++]; 1149 } else { 1150 _i9 = _iterator9.next(); 1151 if (_i9.done) break; 1152 _ref9 = _i9.value; 1153 } 1154 1155 var _key4 = _ref9; 1156 1157 if (node[_key4] != null) node[_key4] = undefined; 1158 } 1159 1160 for (var key in node) { 1161 if (key[0] === "_" && node[key] != null) node[key] = undefined; 1162 } 1163 1164 var syms = (0, _getOwnPropertySymbols2.default)(node); 1165 for (var _iterator10 = syms, _isArray10 = Array.isArray(_iterator10), _i10 = 0, _iterator10 = _isArray10 ? _iterator10
1165: (0, _getIterator3.default)(_iterator10);;) { 1166 var _ref10; 1167 1168 if (_isArray10) { 1169 if (_i10 >= _iterator10.length) break; 1170 _ref10 = _iterator10[_i10++]; 1171 } else { 1172 _i10 = _iterator10.next(); 1173 if (_i10.done) break; 1174 _ref10 = _i10.value; 1175 } 1176 1177 var sym = _ref10; 1178 1179 node[sym] = null; 1180 } 1181 } 1182 1183 function removePropertiesDeep(tree, opts) { 1184 traverseFast(tree, removeProperties, opts); 1185 return tree; 1186 } 1187 1188/***/ }, 1189/* 2 */ 1190/***/ function(module, exports, __webpack_require__) { 1191 1192 "use strict"; 1193 1194 module.exports = { "default": __webpack_require__(398), __esModule: true }; 1195 1196/***/ }, 1197/* 3 */ 1198/***/ function(module, exports) { 1199 1200 "use strict"; 1201 1202 exports.__esModule = true; 1203 1204 exports.default = function (instance, Constructor) { 1205 if (!(instance instanceof Constructor)) { 1206 throw new TypeError("Cannot call a class as a function"); 1207 } 1208 }; 1209 1210/***/ }, 1211/* 4 */ 1212/***/ function(module, exports, __webpack_require__) { 1213 1214 "use strict"; 1215 1216 exports.__esModule = true; 1217 1218 var _symbol = __webpack_require__(11); 1219 1220 var _symbol2 = _interopRequireDefault(_symbol); 1221 1222 exports.default = function (code, opts) { 1223 var stack = void 0; 1224 try { 1225 throw new Error(); 1226 } catch (error) { 1227 if (error.stack) { 1228 stack = error.stack.split("\n").slice(1).join("\n"); 1229 } 1230 } 1231 1232 opts = (0, _assign2.default)({ 1233 allowReturnOutsideFunction: true, 1234 allowSuperOutsideMethod: true, 1235 preserveComments: false 1236 }, opts); 1237 1238 var _getAst = function getAst() { 1239 var ast = void 0; 1240 1241 try { 1242 ast = babylon.parse(code, opts); 1243 1244 ast = _babelTraverse2.default.removeProperties(ast, { preserveComments: opts.preserveComments }); 1245 1246 _babelTraverse2.default.cheap(ast, function (node) { 1247 node[FROM_TEMPLATE] = true; 1248 }); 1249 } catch (err) { 1250 err.stack = err.stack + "from\n" + stack; 1251 throw err; 1252 } 1253 1254 _getAst = function getAst() { 1255 return ast; 1256 }; 1257 1258 return ast; 1259 }; 1260 1261 return function () { 1262 for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { 1263 args[_key] = arguments[_key]; 1264 } 1265 1266 return useTemplate(_getAst(), args); 1267 }; 1268 }; 1269 1270 var _cloneDeep = __webpack_require__(563); 1271 1272 var _cloneDeep2 = _interopRequireDefault(_cloneDeep); 1273 1274 var _assign = __webpack_require__(170); 1275 1276 var _assign2 = _interopRequireDefault(_assign); 1277 1278 var _has = __webpack_require__(270); 1279 1280 var _has2 = _interopRequireDefault(_has); 1281 1282 var _babelTraverse = __webpack_require__(8); 1283 1284 var _babelTraverse2 = _interopRequireDefault(_babelTraverse); 1285 1286 var _babylon = __webpack_require__(133); 1287 1288 var babylon = _interopRequireWildcard(_babylon); 1289 1290 var _babelTypes = __webpack_require__(1); 1291 1292 var t = _interopRequireWildcard(_babelTypes); 1293 1294 function _interopRequireWildcard(obj) { 1295 if (obj && obj.__esModule) { 1296 return obj; 1297 } else { 1298 var newObj = {};if (obj != null) { 1299 for (var key in obj) { 1300 if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; 1301 } 1302 }newObj.default = obj;return newObj; 1303 } 1304 } 1305 1306 function _interopRequireDefault(obj) { 1307 return obj && obj.__esModule ? obj : { default: obj }; 1308 } 1309 1310 var FROM_TEMPLATE = "_fromTemplate"; 1311 var TEMPLATE_SKIP = (0, _symbol2.default)(); 1312 1313 function useTemplate(ast, nodes) { 1314 ast = (0, _cloneDeep2.default)(ast); 1315 var _ast = ast, 1316 program = _ast.program; 1317 1318 if (nodes.length) { 1319 (0, _babelTraverse2.default)(ast, templateVisitor, null, nodes); 1320 } 1321 1322 if (program.body.length > 1) { 1323 return program.body; 1324 } else { 1325 return program.body[0]; 1326 } 1327 } 1328 1329 var templateVisitor = { 1330 noScope: true, 1331 1332 enter: function enter(path, args) { 1333 var node = path.node; 1334 1335 if (node[TEMPLATE_SKIP]) return path.skip(); 1336 1337 if (t.isExpressionStatement(node)) { 1338 node = node.expression; 1339 } 1340 1341 var replacement = void 0; 1342 1343 if (t.isIdentifier(node) && node[FROM_TEMPLATE]) { 1344 if ((0, _has2.default)(args[0], node.name)) { 1345 replacement = args[0][node.name]; 1346 } else if (node.name[0] === "$") { 1347 var i = +node.name.slice(1); 1348 if (args[i]) replacement = args[i]; 1349 } 1350 } 1351 1352 if (replacement === null) { 1353 path.remove(); 1354 } 1355 1356 if (replacement) { 1357 replacement[TEMPLATE_SKIP] = true; 1358 path.replaceInline(replacement); 1359 } 1360 }, 1361 exit: function exit(_ref) { 1362 var node = _ref.node; 1363 1364 if (!node.loc) _babelTraverse2.default.clearNode(node); 1365 } 1366 }; 1367 module.exports = exports["default"]; 1368 1369/***/ }, 1370/* 5 */
1371/***/ function(module, exports) { 1372 1373 'use strict'; 1374 1375 var core = module.exports = { version: '2.4.0' }; 1376 if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef 1377 1378/***/ }, 1379/* 6 */ 1380/***/ function(module, exports, __webpack_require__) { 1381 1382 "use strict"; 1383 1384 var _typeof2 = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; 1385 1386 exports.__esModule = true; 1387 1388 var _iterator = __webpack_require__(357); 1389 1390 var _iterator2 = _interopRequireDefault(_iterator); 1391 1392 var _symbol = __webpack_require__(11); 1393 1394 var _symbol2 = _interopRequireDefault(_symbol); 1395 1396 var _typeof = typeof _symbol2.default === "function" && _typeof2(_iterator2.default) === "symbol" ? function (obj) { 1397 return typeof obj === "undefined" ? "undefined" : _typeof2(obj); 1398 } : function (obj) { 1399 return obj && typeof _symbol2.default === "function" && obj.constructor === _symbol2.default && obj !== _symbol2.default.prototype ? "symbol" : typeof obj === "undefined" ? "undefined" : _typeof2(obj); 1400 }; 1401 1402 function _interopRequireDefault(obj) { 1403 return obj && obj.__esModule ? obj : { default: obj }; 1404 } 1405 1406 exports.default = typeof _symbol2.default === "function" && _typeof(_iterator2.default) === "symbol" ? function (obj) { 1407 return typeof obj === "undefined" ? "undefined" : _typeof(obj); 1408 } : function (obj) { 1409 return obj && typeof _symbol2.default === "function" && obj.constructor === _symbol2.default && obj !== _symbol2.default.prototype ? "symbol" : typeof obj === "undefined" ? "undefined" : _typeof(obj); 1410 }; 1411 1412/***/ }, 1413/* 7 */ 1414/***/ function(module, exports) { 1415 1416 "use strict"; 1417 1418 /** 1419 * Checks if `value` is classified as an `Array` object. 1420 * 1421 * @static 1422 * @memberOf _ 1423 * @since 0.1.0 1424 * @category Lang 1425 * @param {*} value The value to check. 1426 * @returns {boolean} Returns `true` if `value` is an array, else `false`. 1427 * @example 1428 * 1429 * _.isArray([1, 2, 3]); 1430 * // => true 1431 * 1432 * _.isArray(document.body.children); 1433 * // => false 1434 * 1435 * _.isArray('abc'); 1436 * // => false 1437 * 1438 * _.isArray(_.noop); 1439 * // => false 1440 */ 1441 var isArray = Array.isArray; 1442 1443 module.exports = isArray; 1444 1445/***/ }, 1446/* 8 */ 1447/***/ function(module, exports, __webpack_require__) { 1448 1449 "use strict"; 1450 1451 exports.__esModule = true; 1452 exports.visitors = exports.Hub = exports.Scope = exports.NodePath = undefined; 1453 1454 var _getIterator2 = __webpack_require__(2); 1455 1456 var _getIterator3 = _interopRequireDefault(_getIterator2); 1457 1458 var _path = __webpack_require__(35); 1459 1460 Object.defineProperty(exports, "NodePath", { 1461 enumerable: true, 1462 get: function get() { 1463 return _interopRequireDefault(_path).default; 1464 } 1465 }); 1466 1467 var _scope = __webpack_require__(131); 1468 1469 Object.defineProperty(exports, "Scope", { 1470 enumerable: true, 1471 get: function get() { 1472 return _interopRequireDefault(_scope).default; 1473 } 1474 }); 1475 1476 var _hub = __webpack_require__(220); 1477 1478 Object.defineProperty(exports, "Hub", { 1479 enumerable: true, 1480 get: function get() { 1481 return _interopRequireDefault(_hub).default; 1482 } 1483 }); 1484 exports.default = traverse; 1485 1486 var _context = __webpack_require__(361); 1487 1488 var _context2 = _interopRequireDefault(_context); 1489 1490 var _visitors = __webpack_require__(378); 1491 1492 var visitors = _interopRequireWildcard(_visitors); 1493 1494 var _babelMessages = __webpack_require__(18); 1495 1496 var messages = _interopRequireWildcard(_babelMessages); 1497 1498 var _includes = __webpack_require__(109); 1499 1500 var _includes2 = _interopRequireDefault(_includes); 1501 1502 var _babelTypes = __webpack_require__(1); 1503 1504 var t = _interopRequireWildcard(_babelTypes); 1505 1506 var _cache = __webpack_require__(86); 1507 1508 var cache = _interopRequireWildcard(_cache); 1509 1510 function _interopRequireWildcard(obj) { 1511 if (obj && obj.__esModule) { 1512 return obj; 1513 } else { 1514 var newObj = {};if (obj != null) { 1515 for (var key in obj) { 1516 if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; 1517 } 1518 }newObj.default = obj;return newObj; 1519 } 1520 } 1521 1522 function _interopRequireDefault(obj) { 1523 return obj && obj.__esModule ? obj : { default: obj }; 1524 } 1525 1526 exports.visitors = visitors; 1527 function traverse(parent, opts, scope, state, parentPath) { 1528 if (!parent) return; 1529 if (!opts) opts = {}; 1530 1531 if (!opts.noScope && !scope) { 1532 if (parent.type !== "Program" && parent.type !== "File") { 1533 throw new Error(messages.get("traverseNeedsParent", parent.type)); 1534 } 1535 } 1536 1537 visitors.explode(opts); 1538 1539 traverse.node(parent, opts, scope, state, parentPath); 1540 } 1541 1542 traverse.visitors = visitors; 1543 traverse.verify = visitors.verify; 1544 traverse.explode = visitors.explode; 1545
1546 traverse.NodePath = __webpack_require__(35); 1547 traverse.Scope = __webpack_require__(131); 1548 traverse.Hub = __webpack_require__(220); 1549 1550 traverse.cheap = function (node, enter) { 1551 return t.traverseFast(node, enter); 1552 }; 1553 1554 traverse.node = function (node, opts, scope, state, parentPath, skipKeys) { 1555 var keys = t.VISITOR_KEYS[node.type]; 1556 if (!keys) return; 1557 1558 var context = new _context2.default(scope, opts, state, parentPath); 1559 for (var _iterator = keys, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) { 1560 var _ref; 1561 1562 if (_isArray) { 1563 if (_i >= _iterator.length) break; 1564 _ref = _iterator[_i++]; 1565 } else { 1566 _i = _iterator.next(); 1567 if (_i.done) break; 1568 _ref = _i.value; 1569 } 1570 1571 var key = _ref; 1572 1573 if (skipKeys && skipKeys[key]) continue; 1574 if (context.visit(node, key)) return; 1575 } 1576 }; 1577 1578 traverse.clearNode = function (node, opts) { 1579 t.removeProperties(node, opts); 1580 1581 cache.path.delete(node); 1582 }; 1583 1584 traverse.removeProperties = function (tree, opts) { 1585 t.traverseFast(tree, traverse.clearNode, opts); 1586 return tree; 1587 }; 1588 1589 function hasBlacklistedType(path, state) { 1590 if (path.node.type === state.type) { 1591 state.has = true; 1592 path.stop(); 1593 } 1594 } 1595
1596 traverse.hasType = function (tree, scope, type, blacklistTypes) { 1597 if ((0, _includes2.default)(blacklistTypes, tree.type)) return false; 1598 1599 if (tree.type === type) return true; 1600 1601 var state = { 1602 has: false, 1603 type: type 1604 }; 1605 1606 traverse(tree, { 1607 blacklist: blacklistTypes, 1608 enter: hasBlacklistedType 1609 }, scope, state); 1610 1611 return state.has; 1612 }; 1613 1614 traverse.clearCache = function () { 1615 cache.clear(); 1616 }; 1617 1618 traverse.clearCache.clearPath = cache.clearPath; 1619 traverse.clearCache.clearScope = cache.clearScope; 1620 1621 traverse.copyCache = function (source, destination) { 1622 if (cache.path.has(source)) { 1623 cache.path.set(destination, cache.path.get(source)); 1624 } 1625 }; 1626 1627/***/ }, 1628/* 9 */ 1629/***/ function(module, exports) { 1630 1631 'use strict'; 1632 1633 // shim for using process in browser 1634 var process = module.exports = {}; 1635 1636 // cached from whatever global is present so that test runners that stub it 1637 // don't break things. But we need to wrap it in a try catch in case it is 1638 // wrapped in strict mode code which doesn't define any globals. It's inside a 1639 // function because try/catches deoptimize in certain engines. 1640 1641 var cachedSetTimeout; 1642 var cachedClearTimeout; 1643 1644 function defaultSetTimout() { 1645 throw new Error('setTimeout has not been defined'); 1646 } 1647 function defaultClearTimeout() { 1648 throw new Error('clearTimeout has not been defined'); 1649 } 1650 (function () { 1651 try { 1652 if (typeof setTimeout === 'function') { 1653 cachedSetTimeout = setTimeout; 1654 } else { 1655 cachedSetTimeout = defaultSetTimout; 1656 } 1657 } catch (e) { 1658 cachedSetTimeout = defaultSetTimout; 1659 } 1660 try { 1661 if (typeof clearTimeout === 'function') { 1662 cachedClearTimeout = clearTimeout; 1663 } else { 1664 cachedClearTimeout = defaultClearTimeout; 1665 } 1666 } catch (e) { 1667 cachedClearTimeout = defaultClearTimeout; 1668 } 1669 })(); 1670 function runTimeout(fun) { 1671 if (cachedSetTimeout === setTimeout) { 1672 //normal enviroments in sane situations 1673 return setTimeout(fun, 0); 1674 } 1675 // if setTimeout wasn't available but was latter defined 1676 if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { 1677 cachedSetTimeout = setTimeout; 1678 return setTimeout(fun, 0); 1679 } 1680 try { 1681 // when when somebody has screwed with setTimeout but no I.E. maddness 1682 return cachedSetTimeout(fun, 0); 1683 } catch (e) { 1684 try { 1685 // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally 1686 return cachedSetTimeout.call(null, fun, 0); 1687 } catch (e) { 1688 // 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 1689 return cachedSetTimeout.call(this, fun, 0); 1690 } 1691 } 1692 } 1693 function runClearTimeout(marker) { 1694 if (cachedClearTimeout === clearTimeout) { 1695 //normal enviroments in sane situations 1696 return clearTimeout(marker); 1697 } 1698 // if clearTimeout wasn't available but was latter defined 1699 if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { 1700 cachedClearTimeout = clearTimeout; 1701 return clearTimeout(marker); 1702 } 1703 try { 1704 // when when somebody has screwed with setTimeout but no I.E. maddness 1705 return cachedClearTimeout(marker); 1706 } catch (e) { 1707 try { 1708 // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally 1709 return cachedClearTimeout.call(null, marker); 1710 } catch (e) { 1711 // 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. 1712 // Some versions of I.E. have different rules for clearTimeout vs setTimeout 1713 return cachedClearTimeout.call(this, marker); 1714 } 1715 } 1716 } 1717 var queue = []; 1718 var draining = false;
1719 var currentQueue; 1720 var queueIndex = -1; 1721 1722 function cleanUpNextTick() { 1723 if (!draining || !currentQueue) { 1724 return; 1725 } 1726 draining = false; 1727 if (currentQueue.length) { 1728 queue = currentQueue.concat(queue); 1729 } else { 1730 queueIndex = -1; 1731 } 1732 if (queue.length) { 1733 drainQueue(); 1734 } 1735 } 1736 1737 function drainQueue() { 1738 if (draining) { 1739 return; 1740 } 1741 var timeout = runTimeout(cleanUpNextTick); 1742 draining = true; 1743 1744 var len = queue.length; 1745 while (len) { 1746 currentQueue = queue; 1747 queue = []; 1748 while (++queueIndex < len) { 1749 if (currentQueue) { 1750 currentQueue[queueIndex].run(); 1751 } 1752 } 1753 queueIndex = -1; 1754 len = queue.length; 1755 } 1756 currentQueue = null; 1757 draining = false; 1758 runClearTimeout(timeout); 1759 } 1760 1761 process.nextTick = function (fun) { 1762 var args = new Array(arguments.length - 1); 1763 if (arguments.length > 1) { 1764 for (var i = 1; i < arguments.length; i++) { 1765 args[i - 1] = arguments[i]; 1766 } 1767 } 1768 queue.push(new Item(fun, args)); 1769 if (queue.length === 1 && !draining) { 1770 runTimeout(drainQueue); 1771 } 1772 }; 1773 1774 // v8 likes predictible objects 1775 function Item(fun, array) { 1776 this.fun = fun; 1777 this.array = array; 1778 } 1779 Item.prototype.run = function () { 1780 this.fun.apply(null, this.array); 1781 }; 1782 process.title = 'browser'; 1783 process.browser = true; 1784 process.env = {}; 1785 process.argv = []; 1786 process.version = ''; // empty string to avoid regexp issues 1787 process.versions = {}; 1788 1789 function noop() {} 1790 1791 process.on = noop; 1792 process.addListener = noop; 1793 process.once = noop; 1794 process.off = noop; 1795 process.removeListener = noop; 1796 process.removeAllListeners = noop; 1797 process.emit = noop; 1798 1799 process.binding = function (name) { 1800 throw new Error('process.binding is not supported'); 1801 }; 1802 1803 process.cwd = function () { 1804 return '/'; 1805 }; 1806 process.chdir = function (dir) { 1807 throw new Error('process.chdir is not supported'); 1808 }; 1809 process.umask = function () { 1810 return 0; 1811 }; 1812 1813/***/ }, 1814/* 10 */ 1815/***/ function(module, exports, __webpack_require__) { 1816 1817 "use strict"; 1818 1819 module.exports = { "default": __webpack_require__(403), __esModule: true }; 1820 1821/***/ }, 1822/* 11 */ 1823/***/ function(module, exports, __webpack_require__) { 1824 1825 "use strict"; 1826 1827 module.exports = { "default": __webpack_require__(408), __esModule: true }; 1828 1829/***/ }, 1830/* 12 */ 1831/***/ function(module, exports, __webpack_require__) { 1832 1833 'use strict'; 1834 1835 var store = __webpack_require__(146)('wks'), 1836 uid = __webpack_require__(94), 1837 _Symbol = __webpack_require__(14).Symbol, 1838 USE_SYMBOL = typeof _Symbol == 'function'; 1839 1840 var $exports = module.exports = function (name) { 1841 return store[name] || (store[name] = USE_SYMBOL && _Symbol[name] || (USE_SYMBOL ? _Symbol : uid)('Symbol.' + name)); 1842 }; 1843 1844 $exports.store = store; 1845 1846/***/ }, 1847/* 13 */ 1848/***/ function(module, exports, __webpack_require__) { 1849 1850 "use strict"; 1851 1852 module.exports = { "default": __webpack_require__(405), __esModule: true }; 1853 1854/***/ }, 1855/* 14 */ 1856/***/ function(module, exports) { 1857 1858 'use strict'; 1859 1860 // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 1861 var global = module.exports = typeof window != 'undefined' && window.Math == Math ? window : typeof self != 'undefined' && self.Math == Math ? self : Function('return this')(); 1862 if (typeof __g == 'number') __g = global; // eslint-disable-line no-undef 1863 1864/***/ }, 1865/* 15 */ 1866/***/ function(module, exports, __webpack_require__) { 1867 1868 'use strict'; 1869 1870 var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; 1871 1872 var freeGlobal = __webpack_require__(257); 1873 1874 /** Detect free variable `self`. */ 1875 var freeSelf = (typeof self === 'undefined' ? 'undefined' : _typeof(self)) == 'object' && self && self.Object === Object && self; 1876 1877 /** Used as a reference to the global object. */ 1878 var root = freeGlobal || freeSelf || Function('return this')(); 1879 1880 module.exports = root; 1881 1882/***/ }, 1883/* 16 */
vendor: 5,842 bytes, lines 1884-2071
1884/***/ function(module, exports) { 1885 1886 'use strict'; 1887 1888 var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; 1889 1890 /** 1891 * Checks if `value` is the 1892 * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) 1893 * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) 1894 * 1895 * @static 1896 * @memberOf _ 1897 * @since 0.1.0 1898 * @category Lang 1899 * @param {*} value The value to check. 1900 * @returns {boolean} Returns `true` if `value` is an object, else `false`. 1901 * @example 1902 * 1903 * _.isObject({}); 1904 * // => true 1905 * 1906 * _.isObject([1, 2, 3]); 1907 * // => true 1908 * 1909 * _.isObject(_.noop); 1910 * // => true 1911 * 1912 * _.isObject(null); 1913 * // => false 1914 */ 1915 function isObject(value) { 1916 var type = typeof value === 'undefined' ? 'undefined' : _typeof(value); 1917 return value != null && (type == 'object' || type == 'function'); 1918 } 1919 1920 module.exports = isObject; 1921 1922/***/ }, 1923/* 17 */ 1924/***/ function(module, exports, __webpack_require__) { 1925 1926 /* WEBPACK VAR INJECTION */(function(process) {'use strict'; 1927 1928 // Copyright Joyent, Inc. and other Node contributors. 1929 // 1930 // Permission is hereby granted, free of charge, to any person obtaining a 1931 // copy of this software and associated documentation files (the 1932 // "Software"), to deal in the Software without restriction, including 1933 // without limitation the rights to use, copy, modify, merge, publish, 1934 // distribute, sublicense, and/or sell copies of the Software, and to permit 1935 // persons to whom the Software is furnished to do so, subject to the 1936 // following conditions: 1937 // 1938 // The above copyright notice and this permission notice shall be included 1939 // in all copies or substantial portions of the Software. 1940 // 1941 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 1942 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 1943 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN 1944 // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 1945 // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 1946 // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE 1947 // USE OR OTHER DEALINGS IN THE SOFTWARE. 1948 1949 // resolves . and .. elements in a path array with directory names there 1950 // must be no slashes, empty elements, or device names (c:\) in the array 1951 // (so also no leading and trailing slashes - it does not distinguish 1952 // relative and absolute paths) 1953 function normalizeArray(parts, allowAboveRoot) { 1954 // if the path tries to go above the root, `up` ends up > 0 1955 var up = 0; 1956 for (var i = parts.length - 1; i >= 0; i--) { 1957 var last = parts[i]; 1958 if (last === '.') { 1959 parts.splice(i, 1); 1960 } else if (last === '..') { 1961 parts.splice(i, 1); 1962 up++; 1963 } else if (up) { 1964 parts.splice(i, 1); 1965 up--; 1966 } 1967 } 1968 1969 // if the path is allowed to go above the root, restore leading ..s 1970 if (allowAboveRoot) { 1971 for (; up--; up) { 1972 parts.unshift('..'); 1973 } 1974 } 1975 1976 return parts; 1977 } 1978 1979 // Split a filename into [root, dir, basename, ext], unix version 1980 // 'root' is just a slash, or nothing. 1981 var splitPathRe = /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/; 1982 var splitPath = function splitPath(filename) { 1983 return splitPathRe.exec(filename).slice(1); 1984 }; 1985 1986 // path.resolve([from ...], to) 1987 // posix version 1988 exports.resolve = function () { 1989 var resolvedPath = '', 1990 resolvedAbsolute = false; 1991 1992 for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) { 1993 var path = i >= 0 ? arguments[i] : process.cwd(); 1994 1995 // Skip empty and invalid entries 1996 if (typeof path !== 'string') { 1997 throw new TypeError('Arguments to path.resolve must be strings'); 1998 } else if (!path) { 1999 continue; 2000 } 2001 2002 resolvedPath = path + '/' + resolvedPath; 2003 resolvedAbsolute = path.charAt(0) === '/'; 2004 } 2005 2006 // At this point the path should be resolved to a full absolute path, but 2007 // handle relative paths to be safe (might happen when process.cwd() fails) 2008 2009 // Normalize the path 2010 resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function (p) { 2011 return !!p; 2012 }), !resolvedAbsolute).join('/'); 2013 2014 return (resolvedAbsolute ? '/' : '') + resolvedPath || '.'; 2015 }; 2016 2017 // path.normalize(path) 2018 // posix version 2019 exports.normalize = function (path) { 2020 var isAbsolute = exports.isAbsolute(path), 2021 trailingSlash = substr(path, -1) === '/'; 2022 2023 // Normalize the path 2024 path = normalizeArray(filter(path.split('/'), function (p) { 2025 return !!p; 2026 }), !isAbsolute).join('/'); 2027 2028 if (!path && !isAbsolute) { 2029 path = '.'; 2030 } 2031 if (path && trailingSlash) { 2032 path += '/'; 2033 } 2034 2035 return (isAbsolute ? '/' : '') + path; 2036 }; 2037 2038 // posix version 2039 exports.isAbsolute = function (path) { 2040 return path.charAt(0) === '/'; 2041 }; 2042 2043 // posix version 2044 exports.join = function () { 2045 var paths = Array.prototype.slice.call(arguments, 0); 2046 return exports.normalize(filter(paths, function (p, index) { 2047 if (typeof p !== 'string') { 2048 throw new TypeError('Arguments to path.join must be strings'); 2049 } 2050 return p; 2051 }).join('/')); 2052 }; 2053 2054 // path.relative(from, to) 2055 // posix version 2056 exports.relative = function (from, to) { 2057 from = exports.resolve(from).substr(1); 2058 to = exports.resolve(to).substr(1); 2059 2060 function trim(arr) { 2061 var start = 0; 2062 for (; start < arr.length; start++) { 2063 if (arr[start] !== '') break; 2064 } 2065 2066 var end = arr.length - 1; 2067 for (; end >= 0; end--) { 2068 if (arr[end] !== '') break; 2069 } 2070 2071 if (start > end) return [];
2072 return arr.slice(start, end - start + 1); 2073 } 2074 2075 var fromParts = trim(from.split('/')); 2076 var toParts = trim(to.split('/')); 2077 2078 var length = Math.min(fromParts.length, toParts.length); 2079 var samePartsLength = length; 2080 for (var i = 0; i < length; i++) { 2081 if (fromParts[i] !== toParts[i]) { 2082 samePartsLength = i; 2083 break; 2084 } 2085 } 2086 2087 var outputParts = []; 2088 for (var i = samePartsLength; i < fromParts.length; i++) { 2089 outputParts.push('..'); 2090 } 2091 2092 outputParts = outputParts.concat(toParts.slice(samePartsLength)); 2093 2094 return outputParts.join('/'); 2095 }; 2096 2097 exports.sep = '/'; 2098 exports.delimiter = ':'; 2099 2100 exports.dirname = function (path) { 2101 var result = splitPath(path), 2102 root = result[0], 2103 dir = result[1]; 2104 2105 if (!root && !dir) { 2106 // No dirname whatsoever 2107 return '.'; 2108 } 2109 2110 if (dir) { 2111 // It has a dirname, strip trailing slash 2112 dir = dir.substr(0, dir.length - 1); 2113 } 2114 2115 return root + dir; 2116 }; 2117 2118 exports.basename = function (path, ext) { 2119 var f = splitPath(path)[2]; 2120 // TODO: make this comparison case-insensitive on windows? 2121 if (ext && f.substr(-1 * ext.length) === ext) { 2122 f = f.substr(0, f.length - ext.length); 2123 } 2124 return f; 2125 }; 2126 2127 exports.extname = function (path) { 2128 return splitPath(path)[3]; 2129 }; 2130 2131 function filter(xs, f) { 2132 if (xs.filter) return xs.filter(f); 2133 var res = []; 2134 for (var i = 0; i < xs.length; i++) { 2135 if (f(xs[i], i, xs)) res.push(xs[i]); 2136 } 2137 return res; 2138 } 2139 2140 // String.prototype.substr - negative index don't work in IE8 2141 var substr = 'ab'.substr(-1) === 'b' ? function (str, start, len) { 2142 return str.substr(start, len); 2143 } : function (str, start, len) { 2144 if (start < 0) start = str.length + start; 2145 return str.substr(start, len); 2146 }; 2147 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(9))) 2148 2149/***/ }, 2150/* 18 */ 2151/***/ function(module, exports, __webpack_require__) { 2152 2153 "use strict"; 2154 2155 exports.__esModule = true; 2156 exports.MESSAGES = undefined; 2157 2158 var _stringify = __webpack_require__(34); 2159 2160 var _stringify2 = _interopRequireDefault(_stringify); 2161 2162 exports.get = get; 2163 exports.parseArgs = parseArgs; 2164 2165 var _util = __webpack_require__(114); 2166 2167 var util = _interopRequireWildcard(_util); 2168 2169 function _interopRequireWildcard(obj) { 2170 if (obj && obj.__esModule) { 2171 return obj; 2172 } else { 2173 var newObj = {};if (obj != null) { 2174 for (var key in obj) { 2175 if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; 2176 } 2177 }newObj.default = obj;return newObj; 2178 } 2179 } 2180 2181 function _interopRequireDefault(obj) { 2182 return obj && obj.__esModule ? obj : { default: obj }; 2183 } 2184 2185 var MESSAGES = exports.MESSAGES = { 2186 tailCallReassignmentDeopt: "Function reference has been reassigned, so it will probably be dereferenced, therefore we can't optimise this with confidence", 2187 classesIllegalBareSuper: "Illegal use of bare super", 2188 classesIllegalSuperCall: "Direct super call is illegal in non-constructor, use super.$1() instead", 2189 scopeDuplicateDeclaration: "Duplicate declaration $1", 2190 settersNoRest: "Setters aren't allowed to have a rest", 2191 noAssignmentsInForHead: "No assignments allowed in for-in/of head", 2192 expectedMemberExpressionOrIdentifier: "Expected type MemberExpression or Identifier", 2193 invalidParentForThisNode: "We don't know how to handle this node within the current parent - please open an issue", 2194 readOnly: "$1 is read-only", 2195 unknownForHead: "Unknown node type $1 in ForStatement", 2196 didYouMean: "Did you mean $1?", 2197 codeGeneratorDeopt: "Note: The code generator has deoptimised the styling of $1 as it exceeds the max of $2.", 2198 missingTemplatesDirectory: "no templates directory - this is most likely the result of a broken `npm publish`. Please report to https://github.com/babel/babel/issues", 2199 unsupportedOutputType: "Unsupported output type $1", 2200 illegalMethodName: "Illegal method name $1", 2201 lostTrackNodePath: "We lost track of this node's position, likely because the AST was directly manipulated", 2202 2203 modulesIllegalExportName: "Illegal export $1", 2204 modulesDuplicateDeclarations: "Duplicate module declarations with the same source but in different scopes", 2205 2206 undeclaredVariable: "Reference to undeclared variable $1", 2207 undeclaredVariableType: "Referencing a type alias outside of a type annotation", 2208 undeclaredVariableSuggestion: "Reference to undeclared variable $1 - did you mean $2?", 2209 2210 traverseNeedsParent: "You must pass a scope and parentPath unless traversing a Program/File. Instead of that you tried to traverse a $1 node without passing scope and parentPath.", 2211 traverseVerifyRootFunction: "You passed `traverse()` a function when it expected a visitor object, are you sure you didn't mean `{ enter: Function }`?", 2212 traverseVerifyVisitorProperty: "You passed `traverse()` a visitor object with the property $1 that has the invalid property $2", 2213 traverseVerifyNodeType: "You gave us a visitor for the node type $1 but it's not a valid type", 2214 2215 pluginNotObject: "Plugin $2 specified in $1 was expected to return an object when invoked but returned $3", 2216 pluginNotFunction: "Plugin $2 specified in $1 was expected to return a function but returned $3", 2217 pluginUnknown: "Unknown plugin $1 specified in $2 at $3, attempted to resolve relative to $4", 2218 pluginInvalidProperty: "Plugin $2 specified in $1 provided an invali
2218d property of $3" 2219 }; 2220 2221 function get(key) { 2222 for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { 2223 args[_key - 1] = arguments[_key]; 2224 } 2225 2226 var msg = MESSAGES[key]; 2227 if (!msg) throw new ReferenceError("Unknown message " + (0, _stringify2.default)(key)); 2228 2229 args = parseArgs(args); 2230 2231 return msg.replace(/\$(\d+)/g, function (str, i) { 2232 return args[i - 1]; 2233 }); 2234 } 2235 2236 function parseArgs(args) { 2237 return args.map(function (val) { 2238 if (val != null && val.inspect) { 2239 return val.inspect(); 2240 } else { 2241 try { 2242 return (0, _stringify2.default)(val) || val + ""; 2243 } catch (e) { 2244 return util.inspect(val); 2245 } 2246 } 2247 }); 2248 } 2249 2250/***/ }, 2251/* 19 */ 2252/***/ function(module, exports, __webpack_require__) { 2253 2254 'use strict'; 2255 2256 var isObject = __webpack_require__(22); 2257 module.exports = function (it) { 2258 if (!isObject(it)) throw TypeError(it + ' is not an object!'); 2259 return it; 2260 }; 2261 2262/***/ }, 2263/* 20 */ 2264/***/ function(module, exports, __webpack_require__) { 2265 2266 'use strict'; 2267 2268 // Thank's IE8 for his funny defineProperty 2269 module.exports = !__webpack_require__(36)(function () { 2270 return Object.defineProperty({}, 'a', { get: function get() { 2271 return 7; 2272 } }).a != 7; 2273 }); 2274 2275/***/ }, 2276/* 21 */ 2277/***/ function(module, exports, __webpack_require__) { 2278 2279 'use strict'; 2280 2281 var global = __webpack_require__(14), 2282 core = __webpack_require__(5), 2283 ctx = __webpack_require__(54), 2284 hide = __webpack_require__(28), 2285 PROTOTYPE = 'prototype'; 2286 2287 var $export = function $export(type, name, source) { 2288 var IS_FORCED = type & $export.F, 2289 IS_GLOBAL = type & $export.G, 2290 IS_STATIC = type & $export.S, 2291 IS_PROTO = type & $export.P, 2292 IS_BIND = type & $export.B, 2293 IS_WRAP = type & $export.W, 2294 exports = IS_GLOBAL ? core : core[name] || (core[name] = {}), 2295 expProto = exports[PROTOTYPE], 2296 target = IS_GLOBAL ? global : IS_STATIC ? global[name] : (global[name] || {})[PROTOTYPE], 2297 key, 2298 own, 2299 out; 2300 if (IS_GLOBAL) source = name; 2301 for (key in source) { 2302 // contains in native 2303 own = !IS_FORCED && target && target[key] !== undefined; 2304 if (own && key in exports) continue; 2305 // export native or passed 2306 out = own ? target[key] : source[key]; 2307 // prevent global pollution for namespaces 2308 exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key] 2309 // bind timers to global for call from export context 2310 : IS_BIND && own ? ctx(out, global) 2311 // wrap global constructors for prevent change them in library 2312 : IS_WRAP && target[key] == out ? function (C) { 2313 var F = function F(a, b, c) { 2314 if (this instanceof C) { 2315 switch (arguments.length) { 2316 case 0: 2317 return new C(); 2318 case 1: 2319 return new C(a); 2320 case 2: 2321 return new C(a, b); 2322 }return new C(a, b, c); 2323 }return C.apply(this, arguments); 2324 }; 2325 F[PROTOTYPE] = C[PROTOTYPE]; 2326 return F; 2327 // make static versions for prototype methods 2328 }(out) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out; 2329 // export proto methods to core.%CONSTRUCTOR%.methods.%NAME% 2330 if (IS_PROTO) { 2331 (exports.virtual || (exports.virtual = {}))[key] = out; 2332 // export proto methods to core.%CONSTRUCTOR%.prototype.%NAME% 2333 if (type & $export.R && expProto && !expProto[key]) hide(expProto, key, out); 2334 } 2335 } 2336 }; 2337 // type bitmap 2338 $export.F = 1; // forced 2339 $export.G = 2; // global 2340 $export.S = 4; // static 2341 $export.P = 8; // proto 2342 $export.B = 16; // bind 2343 $export.W = 32; // wrap 2344 $export.U = 64; // safe 2345 $export.R = 128; // real proto method for `library` 2346 module.exports = $export; 2347 2348/***/ }, 2349/* 22 */ 2350/***/ function(module, exports) { 2351 2352 'use strict'; 2353 2354 var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; 2355 2356 module.exports = function (it) { 2357 return (typeof it === 'undefined' ? 'undefined' : _typeof(it)) === 'object' ? it !== null : typeof it === 'function'; 2358 }; 2359 2360/***/ }, 2361/* 23 */ 2362/***/ function(module, exports, __webpack_require__) { 2363 2364 'use strict'; 2365 2366 var anObject = __webpack_require__(19), 2367 IE8_DOM_DEFINE = __webpack_require__(227), 2368 toPrimitive = __webpack_require__(149), 2369 dP = Object.defineProperty; 2370 2371 exports.f = __webpack_require__(20) ? Object.defineProperty : function defineProperty(O, P, Attributes) { 2372 anObject(O); 2373 P = toPrimitive(P, true); 2374 anObject(Attributes); 2375 if (IE8_DOM_DEFINE) try { 2376 return dP(O, P, Attributes); 2377 } catch (e) {/* empty */} 2378 if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!'); 2379 if ('value' in Attributes) O[P] = Attributes.value; 2380 return O; 2381 }; 2382 2383/***/ }, 2384/* 24 */ 2385/***/ function(module, exports, __webpack_require__) { 2386 2387 'use strict'; 2388 2389 var isFunction = __webpack_require__(171), 2390 isLength = __webpack_require__(172); 2391 2392 /** 2393 * Checks if `value` is array-like. A value is considered array-like if it's 2394 * not a function and has a `value.length` that's an integer greater than or 2395 * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. 2396 * 2397 * @static 2398 * @memberOf _ 2399 * @since 4.0.0 2400 * @category Lang 2401 * @param {*} value The value to check. 2402 * @returns {boolean} Returns `true` if `value` is array-like, else `false`. 2403 * @example 2404 * 2405 * _.isArrayLike([1, 2, 3]); 2406 * // => true 2407 * 2408 * _.isArrayLike(document.body.children); 2409 * // => true 2410 * 2411 * _.isArrayLike('abc'); 2412 * // => true 2413 * 2414 * _.isArrayLike(_.noop); 2415 * // => false 2416 */ 2417 function isArrayLike(value) { 2418 return value != null && isLength(value.length) && !isFunction(value); 2419 } 2420 2421 module.exports = isArrayLike; 2422 2423/***/ }, 2424/* 25 */
2425/***/ function(module, exports) { 2426 2427 'use strict'; 2428 2429 var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; 2430 2431 /** 2432 * Checks if `value` is object-like. A value is object-like if it's not `null` 2433 * and has a `typeof` result of "object". 2434 * 2435 * @static 2436 * @memberOf _ 2437 * @since 4.0.0 2438 * @category Lang 2439 * @param {*} value The value to check. 2440 * @returns {boolean} Returns `true` if `value` is object-like, else `false`. 2441 * @example 2442 * 2443 * _.isObjectLike({}); 2444 * // => true 2445 * 2446 * _.isObjectLike([1, 2, 3]); 2447 * // => true 2448 * 2449 * _.isObjectLike(_.noop); 2450 * // => false 2451 * 2452 * _.isObjectLike(null); 2453 * // => false 2454 */ 2455 function isObjectLike(value) { 2456 return value != null && (typeof value === 'undefined' ? 'undefined' : _typeof(value)) == 'object'; 2457 } 2458 2459 module.exports = isObjectLike; 2460 2461/***/ }, 2462/* 26 */ 2463/***/ function(module, exports, __webpack_require__) { 2464 2465 "use strict"; 2466 2467 exports.__esModule = true; 2468 exports.DEPRECATED_KEYS = exports.BUILDER_KEYS = exports.NODE_FIELDS = exports.ALIAS_KEYS = exports.VISITOR_KEYS = undefined; 2469 2470 var _getIterator2 = __webpack_require__(2); 2471 2472 var _getIterator3 = _interopRequireDefault(_getIterator2); 2473 2474 var _stringify = __webpack_require__(34); 2475 2476 var _stringify2 = _interopRequireDefault(_stringify); 2477 2478 var _typeof2 = __webpack_require__(6); 2479 2480 var _typeof3 = _interopRequireDefault(_typeof2); 2481 2482 exports.assertEach = assertEach; 2483 exports.assertOneOf = assertOneOf; 2484 exports.assertNodeType = assertNodeType; 2485 exports.assertNodeOrValueType = assertNodeOrValueType; 2486 exports.assertValueType = assertValueType; 2487 exports.chain = chain; 2488 exports.default = defineType; 2489 2490 var _index = __webpack_require__(1); 2491 2492 var t = _interopRequireWildcard(_index); 2493 2494 function _interopRequireWildcard(obj) { 2495 if (obj && obj.__esModule) { 2496 return obj; 2497 } else { 2498 var newObj = {};if (obj != null) { 2499 for (var key in obj) { 2500 if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; 2501 } 2502 }newObj.default = obj;return newObj; 2503 } 2504 } 2505 2506 function _interopRequireDefault(obj) { 2507 return obj && obj.__esModule ? obj : { default: obj }; 2508 } 2509 2510 var VISITOR_KEYS = exports.VISITOR_KEYS = {}; 2511 var ALIAS_KEYS = exports.ALIAS_KEYS = {}; 2512 var NODE_FIELDS = exports.NODE_FIELDS = {}; 2513 var BUILDER_KEYS = exports.BUILDER_KEYS = {}; 2514 var DEPRECATED_KEYS = exports.DEPRECATED_KEYS = {}; 2515 2516 function getType(val) { 2517 if (Array.isArray(val)) { 2518 return "array"; 2519 } else if (val === null) { 2520 return "null"; 2521 } else if (val === undefined) { 2522 return "undefined"; 2523 } else { 2524 return typeof val === "undefined" ? "undefined" : (0, _typeof3.default)(val); 2525 } 2526 } 2527 2528 function assertEach(callback) { 2529 function validator(node, key, val) { 2530 if (!Array.isArray(val)) return; 2531 2532 for (var i = 0; i < val.length; i++) { 2533 callback(node, key + "[" + i + "]", val[i]); 2534 } 2535 } 2536 validator.each = callback; 2537 return validator; 2538 } 2539 2540 function assertOneOf() { 2541 for (var _len = arguments.length, vals = Array(_len), _key = 0; _key < _len; _key++) { 2542 vals[_key] = arguments[_key]; 2543 } 2544 2545 function validate(node, key, val) { 2546 if (vals.indexOf(val) < 0) { 2547 throw new TypeError("Property " + key + " expected value to be one of " + (0, _stringify2.default)(vals) + " but got " + (0, _stringify2.default)(val)); 2548 } 2549 } 2550 2551 validate.oneOf = vals; 2552 2553 return validate; 2554 } 2555 2556 function assertNodeType() { 2557 for (var _len2 = arguments.length, types = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { 2558 types[_key2] = arguments[_key2]; 2559 } 2560 2561 function validate(node, key, val) { 2562 var valid = false; 2563 2564 for (var _iterator = types, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) { 2565 var _ref; 2566 2567 if (_isArray) { 2568 if (_i >= _iterator.length) break; 2569 _ref = _iterator[_i++]; 2570 } else { 2571 _i = _iterator.next(); 2572 if (_i.done) break; 2573 _ref = _i.value; 2574 } 2575 2576 var type = _ref;
2577 2578 if (t.is(type, val)) { 2579 valid = true; 2580 break; 2581 } 2582 } 2583 2584 if (!valid) { 2585 throw new TypeError("Property " + key + " of " + node.type + " expected node to be of a type " + (0, _stringify2.default)(types) + " " + ("but instead got " + (0, _stringify2.default)(val && val.type))); 2586 } 2587 } 2588 2589 validate.oneOfNodeTypes = types; 2590 2591 return validate; 2592 } 2593 2594 function assertNodeOrValueType() { 2595 for (var _len3 = arguments.length, types = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { 2596 types[_key3] = arguments[_key3]; 2597 } 2598 2599 function validate(node, key, val) { 2600 var valid = false; 2601 2602 for (var _iterator2 = types, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) { 2603 var _ref2; 2604 2605 if (_isArray2) { 2606 if (_i2 >= _iterator2.length) break; 2607 _ref2 = _iterator2[_i2++]; 2608 } else { 2609 _i2 = _iterator2.next(); 2610 if (_i2.done) break; 2611 _ref2 = _i2.value; 2612 } 2613 2614 var type = _ref2; 2615 2616 if (getType(val) === type || t.is(type, val)) { 2617 valid = true; 2618 break; 2619 } 2620 } 2621 2622 if (!valid) { 2623 throw new TypeError("Property " + key + " of " + node.type + " expected node to be of a type " + (0, _stringify2.default)(types) + " " + ("but instead got " + (0, _stringify2.default)(val && val.type))); 2624 } 2625 } 2626 2627 validate.oneOfNodeOrValueTypes = types; 2628 2629 return validate; 2630 } 2631 2632 function assertValueType(type) { 2633 function validate(node, key, val) { 2634 var valid = getType(val) === type; 2635 2636 if (!valid) { 2637 throw new TypeError("Property " + key + " expected type of " + type + " but got " + getType(val)); 2638 } 2639 } 2640 2641 validate.type = type; 2642 2643 return validate; 2644 } 2645 2646 function chain() { 2647 for (var _len4 = arguments.length, fns = Array(_len4), _key4 = 0; _key4 < _len4; _key4++) { 2648 fns[_key4] = arguments[_key4]; 2649 } 2650 2651 function validate() { 2652 for (var _iterator3 = fns, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, _getIterator3.default)(_iterator3);;) { 2653 var _ref3; 2654 2655 if (_isArray3) { 2656 if (_i3 >= _iterator3.length) break; 2657 _ref3 = _iterator3[_i3++]; 2658 } else { 2659 _i3 = _iterator3.next(); 2660 if (_i3.done) break; 2661 _ref3 = _i3.value; 2662 } 2663 2664 var fn = _ref3; 2665 2666 fn.apply(undefined, arguments); 2667 } 2668 } 2669 validate.chainOf = fns; 2670 return validate; 2671 } 2672 2673 function defineType(type) { 2674 var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; 2675 2676 var inherits = opts.inherits && store[opts.inherits] || {}; 2677 2678 opts.fields = opts.fields || inherits.fields || {}; 2679 opts.visitor = opts.visitor || inherits.visitor || []; 2680 opts.aliases = opts.aliases || inherits.aliases || []; 2681 opts.builder = opts.builder || inherits.builder || opts.visitor || []; 2682 2683 if (opts.deprecatedAlias) { 2684 DEPRECATED_KEYS[opts.deprecatedAlias] = type; 2685 } 2686 2687 for (var _iterator4 = opts.visitor.concat(opts.builder), _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, _getIterator3.default)(_iterator4);;) { 2688 var _ref4; 2689 2690 if (_isArray4) { 2691 if (_i4 >= _iterator4.length) break; 2692 _ref4 = _iterator4[_i4++]; 2693 } else { 2694 _i4 = _iterator4.next(); 2695 if (_i4.done) break; 2696 _ref4 = _i4.value; 2697 } 2698 2699 var _key5 = _ref4; 2700 2701 opts.fields[_key5] = opts.fields[_key5] || {}; 2702 } 2703 2704 for (var key in opts.fields) { 2705 var field = opts.fields[key]; 2706 2707 if (opts.builder.indexOf(key) === -1) { 2708 field.optional = true; 2709 } 2710 if (field.default === undefined) { 2711 field.default = null; 2712 } else if (!field.validate) { 2713 field.validate = assertValueType(getType(field.default)); 2714 } 2715 } 2716 2717 VISITOR_KEYS[type] = opts.visitor; 2718 BUILDER_KEYS[type] = opts.builder; 2719 NODE_FIELDS[type] = opts.fields; 2720 ALIAS_KEYS[type] = opts.aliases; 2721 2722 store[type] = opts; 2723 } 2724 2725 var store = {}; 2726 2727/***/ }, 2728/* 27 */ 2729/***/ function(module, exports) { 2730 2731 "use strict"; 2732 2733 var hasOwnProperty = {}.hasOwnProperty; 2734 module.exports = function (it, key) { 2735 return hasOwnProperty.call(it, key); 2736 }; 2737 2738/***/ }, 2739/* 28 */ 2740/***/ function(module, exports, __webpack_require__) { 2741 2742 'use strict'; 2743 2744 var dP = __webpack_require__(23), 2745 createDesc = __webpack_require__(91); 2746 module.exports = __webpack_require__(20) ? function (object, key, value) { 2747 return dP.f(object, key, createDesc(1, value)); 2748 } : function (object, key, value) { 2749 object[key] = value; 2750 return object; 2751 }; 2752 2753/***/ }, 2754/* 29 */ 2755/***/ function(module, exports, __webpack_require__) { 2756 2757 'use strict'; 2758 2759 var _Symbol = __webpack_require__(44), 2760 getRawTag = __webpack_require__(523), 2761 objectToString = __webpack_require__(548); 2762 2763 /** `Object#toString` result references. */ 2764 var nullTag = '[object Null]',
2765 undefinedTag = '[object Undefined]'; 2766 2767 /** Built-in value references. */ 2768 var symToStringTag = _Symbol ? _Symbol.toStringTag : undefined; 2769 2770 /** 2771 * The base implementation of `getTag` without fallbacks for buggy environments. 2772 * 2773 * @private 2774 * @param {*} value The value to query. 2775 * @returns {string} Returns the `toStringTag`. 2776 */ 2777 function baseGetTag(value) { 2778 if (value == null) { 2779 return value === undefined ? undefinedTag : nullTag; 2780 } 2781 return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value); 2782 } 2783 2784 module.exports = baseGetTag; 2785 2786/***/ }, 2787/* 30 */ 2788/***/ function(module, exports, __webpack_require__) { 2789 2790 'use strict'; 2791 2792 var assignValue = __webpack_require__(158), 2793 baseAssignValue = __webpack_require__(159); 2794 2795 /** 2796 * Copies properties of `source` to `object`. 2797 * 2798 * @private 2799 * @param {Object} source The object to copy properties from. 2800 * @param {Array} props The property identifiers to copy. 2801 * @param {Object} [object={}] The object to copy properties to. 2802 * @param {Function} [customizer] The function to customize copied values. 2803 * @returns {Object} Returns `object`. 2804 */ 2805 function copyObject(source, props, object, customizer) { 2806 var isNew = !object; 2807 object || (object = {}); 2808 2809 var index = -1, 2810 length = props.length; 2811 2812 while (++index < length) { 2813 var key = props[index]; 2814 2815 var newValue = customizer ? customizer(object[key], source[key], key, object, source) : undefined; 2816 2817 if (newValue === undefined) { 2818 newValue = source[key]; 2819 } 2820 if (isNew) { 2821 baseAssignValue(object, key, newValue); 2822 } else { 2823 assignValue(object, key, newValue); 2824 } 2825 } 2826 return object; 2827 } 2828 2829 module.exports = copyObject; 2830 2831/***/ }, 2832/* 31 */ 2833/***/ function(module, exports, __webpack_require__) { 2834 2835 'use strict'; 2836 2837 var arrayLikeKeys = __webpack_require__(241), 2838 baseKeys = __webpack_require__(489), 2839 isArrayLike = __webpack_require__(24); 2840 2841 /** 2842 * Creates an array of the own enumerable property names of `object`. 2843 * 2844 * **Note:** Non-object values are coerced to objects. See the 2845 * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) 2846 * for more details. 2847 * 2848 * @static 2849 * @since 0.1.0 2850 * @memberOf _ 2851 * @category Object 2852 * @param {Object} object The object to query. 2853 * @returns {Array} Returns the array of property names. 2854 * @example 2855 * 2856 * function Foo() { 2857 * this.a = 1; 2858 * this.b = 2; 2859 * } 2860 * 2861 * Foo.prototype.c = 3; 2862 * 2863 * _.keys(new Foo); 2864 * // => ['a', 'b'] (iteration order is not guaranteed) 2865 * 2866 * _.keys('hi'); 2867 * // => ['0', '1'] 2868 */ 2869 function keys(object) { 2870 return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); 2871 } 2872 2873 module.exports = keys; 2874 2875/***/ }, 2876/* 32 */ 2877/***/ function(module, exports) { 2878 2879 "use strict"; 2880 2881 module.exports = { 2882 filename: { 2883 type: "filename", 2884 description: "filename to use when reading from stdin - this will be used in source-maps, errors etc", 2885 default: "unknown", 2886 shorthand: "f" 2887 }, 2888 2889 filenameRelative: { 2890 hidden: true, 2891 type: "string" 2892 }, 2893 2894 inputSourceMap: { 2895 hidden: true 2896 }, 2897 2898 env: { 2899 hidden: true, 2900 default: {} 2901 }, 2902 2903 mode: { 2904 description: "", 2905 hidden: true 2906 }, 2907 2908 retainLines: { 2909 type: "boolean", 2910 default: false, 2911 description: "retain line numbers - will result in really ugly code" 2912 }, 2913 2914 highlightCode: { 2915 description: "enable/disable ANSI syntax highlighting of code frames (on by default)", 2916 type: "boolean", 2917 default: true 2918 }, 2919 2920 suppressDeprecationMessages: { 2921 type: "boolean", 2922 default: false, 2923 hidden: true 2924 }, 2925 2926 presets: { 2927 type: "list", 2928 description: "", 2929 default: [] 2930 }, 2931 2932 plugins: { 2933 type: "list", 2934 default: [], 2935 description: "" 2936 }, 2937 2938 ignore: { 2939 type: "list", 2940 description: "list of glob paths to **not** compile", 2941 default: [] 2942 }, 2943 2944 only: { 2945 type: "list", 2946 description: "list of glob paths to **only** compile" 2947 }, 2948 2949 code: { 2950 hidden: true, 2951 default: true, 2952 type: "boolean" 2953 }, 2954 2955 metadata: { 2956 hidden: true, 2957 default: true, 2958 type: "boolean" 2959 }, 2960 2961 ast: { 2962 hidden: true, 2963 default: true, 2964 type: "boolean" 2965 }, 2966 2967 extends: { 2968 type: "string", 2969 hidden: true 2970 }, 2971 2972 comments: { 2973 type: "boolean", 2974 default: true,
2975 description: "write comments to generated output (true by default)" 2976 }, 2977 2978 shouldPrintComment: { 2979 hidden: true, 2980 description: "optional callback to control whether a comment should be inserted, when this is used the comments option is ignored" 2981 }, 2982 2983 wrapPluginVisitorMethod: { 2984 hidden: true, 2985 description: "optional callback to wrap all visitor methods" 2986 }, 2987 2988 compact: { 2989 type: "booleanString", 2990 default: "auto", 2991 description: "do not include superfluous whitespace characters and line terminators [true|false|auto]" 2992 }, 2993 2994 minified: { 2995 type: "boolean", 2996 default: false, 2997 description: "save as much bytes when printing [true|false]" 2998 }, 2999 3000 sourceMap: { 3001 alias: "sourceMaps", 3002 hidden: true 3003 }, 3004 3005 sourceMaps: { 3006 type: "booleanString", 3007 description: "[true|false|inline]", 3008 default: false, 3009 shorthand: "s" 3010 }, 3011 3012 sourceMapTarget: { 3013 type: "string", 3014 description: "set `file` on returned source map" 3015 }, 3016 3017 sourceFileName: { 3018 type: "string", 3019 description: "set `sources[0]` on returned source map" 3020 }, 3021 3022 sourceRoot: { 3023 type: "filename", 3024 description: "the root from which all sources are relative" 3025 }, 3026 3027 babelrc: { 3028 description: "Whether or not to look up .babelrc and .babelignore files", 3029 type: "boolean", 3030 default: true 3031 }, 3032 3033 sourceType: { 3034 description: "", 3035 default: "module" 3036 }, 3037 3038 auxiliaryCommentBefore: { 3039 type: "string", 3040 description: "print a comment before any injected non-user code" 3041 }, 3042 3043 auxiliaryCommentAfter: { 3044 type: "string", 3045 description: "print a comment after any injected non-user code" 3046 }, 3047 3048 resolveModuleSource: { 3049 hidden: true 3050 }, 3051 3052 getModuleId: { 3053 hidden: true 3054 }, 3055 3056 moduleRoot: { 3057 type: "filename", 3058 description: "optional prefix for the AMD module formatter that will be prepend to the filename on module definitions" 3059 }, 3060 3061 moduleIds: { 3062 type: "boolean", 3063 default: false, 3064 shorthand: "M", 3065 description: "insert an explicit id for modules" 3066 }, 3067 3068 moduleId: { 3069 description: "specify a custom name for module ids", 3070 type: "string" 3071 }, 3072 3073 passPerPreset: { 3074 description: "Whether to spawn a traversal pass per a preset. By default all presets are merged.", 3075 type: "boolean", 3076 default: false, 3077 hidden: true 3078 }, 3079 3080 parserOpts: { 3081 description: "Options to pass into the parser, or to change parsers (parserOpts.parser)", 3082 default: false 3083 }, 3084 3085 generatorOpts: { 3086 description: "Options to pass into the generator, or to change generators (generatorOpts.generator)", 3087 default: false 3088 } 3089 }; 3090 3091/***/ }, 3092/* 33 */ 3093/***/ function(module, exports, __webpack_require__) { 3094 3095 /* WEBPACK VAR INJECTION */(function(process) {"use strict"; 3096 3097 exports.__esModule = true; 3098 3099 var _objectWithoutProperties2 = __webpack_require__(360); 3100 3101 var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2); 3102 3103 var _stringify = __webpack_require__(34); 3104 3105 var _stringify2 = _interopRequireDefault(_stringify); 3106 3107 var _assign = __webpack_require__(85); 3108 3109 var _assign2 = _interopRequireDefault(_assign); 3110 3111 var _getIterator2 = __webpack_require__(2); 3112 3113 var _getIterator3 = _interopRequireDefault(_getIterator2); 3114 3115 var _typeof2 = __webpack_require__(6); 3116 3117 var _typeof3 = _interopRequireDefault(_typeof2); 3118 3119 var _classCallCheck2 = __webpack_require__(3); 3120 3121 var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); 3122 3123 var _node = __webpack_require__(178); 3124 3125 var context = _interopRequireWildcard(_node); 3126 3127 var _plugin2 = __webpack_require__(63); 3128 3129 var _plugin3 = _interopRequireDefault(_plugin2); 3130 3131 var _babelMessages = __webpack_require__(18); 3132 3133 var messages = _interopRequireWildcard(_babelMessages); 3134 3135 var _index = __webpack_require__(51); 3136 3137 var _resolvePlugin = __webpack_require__(180); 3138 3139 var _resolvePlugin2 = _interopRequireDefault(_resolvePlugin); 3140 3141 var _resolvePreset = __webpack_require__(181); 3142 3143 var _resolvePreset2 = _interopRequireDefault(_resolvePreset); 3144 3145 var _cloneDeepWith = __webpack_require__(564); 3146 3147 var _cloneDeepWith2 = _interopRequireDefault(_cloneDeepWith); 3148 3149 var _clone = __webpack_require__(107); 3150 3151 var _clone2 = _interopRequireDefault(_clone); 3152
3153 var _merge = __webpack_require__(290); 3154 3155 var _merge2 = _interopRequireDefault(_merge); 3156 3157 var _config2 = __webpack_require__(32); 3158 3159 var _config3 = _interopRequireDefault(_config2); 3160 3161 var _removed = __webpack_require__(53); 3162 3163 var _removed2 = _interopRequireDefault(_removed); 3164 3165 var _buildConfigChain = __webpack_require__(50); 3166 3167 var _buildConfigChain2 = _interopRequireDefault(_buildConfigChain); 3168 3169 var _path = __webpack_require__(17); 3170 3171 var _path2 = _interopRequireDefault(_path); 3172 3173 function _interopRequireWildcard(obj) { 3174 if (obj && obj.__esModule) { 3175 return obj; 3176 } else { 3177 var newObj = {};if (obj != null) { 3178 for (var key in obj) { 3179 if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; 3180 } 3181 }newObj.default = obj;return newObj; 3182 } 3183 } 3184 3185 function _interopRequireDefault(obj) { 3186 return obj && obj.__esModule ? obj : { default: obj }; 3187 } 3188 3189 var OptionManager = function () { 3190 function OptionManager(log) { 3191 (0, _classCallCheck3.default)(this, OptionManager); 3192 3193 this.resolvedConfigs = []; 3194 this.options = OptionManager.createBareOptions(); 3195 this.log = log; 3196 } 3197 3198 OptionManager.memoisePluginContainer = function memoisePluginContainer(fn, loc, i, alias) { 3199 for (var _iterator = OptionManager.memoisedPlugins, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) { 3200 var _ref; 3201 3202 if (_isArray) { 3203 if (_i >= _iterator.length) break; 3204 _ref = _iterator[_i++]; 3205 } else { 3206 _i = _iterator.next(); 3207 if (_i.done) break; 3208 _ref = _i.value; 3209 } 3210 3211 var cache = _ref; 3212 3213 if (cache.container === fn) return cache.plugin; 3214 } 3215 3216 var obj = void 0; 3217 3218 if (typeof fn === "function") { 3219 obj = fn(context); 3220 } else { 3221 obj = fn; 3222 } 3223 3224 if ((typeof obj === "undefined" ? "undefined" : (0, _typeof3.default)(obj)) === "object") { 3225 var _plugin = new _plugin3.default(obj, alias); 3226 OptionManager.memoisedPlugins.push({ 3227 container: fn, 3228 plugin: _plugin 3229 }); 3230 return _plugin; 3231 } else { 3232 throw new TypeError(messages.get("pluginNotObject", loc, i, typeof obj === "undefined" ? "undefined" : (0, _typeof3.default)(obj)) + loc + i); 3233 } 3234 }; 3235 3236 OptionManager.createBareOptions = function createBareOptions() { 3237 var opts = {}; 3238 3239 for (var _key in _config3.default) { 3240 var opt = _config3.default[_key]; 3241 opts[_key] = (0, _clone2.default)(opt.default); 3242 } 3243 3244 return opts; 3245 }; 3246 3247 OptionManager.normalisePlugin = function normalisePlugin(plugin, loc, i, alias) { 3248 plugin = plugin.__esModule ? plugin.default : plugin; 3249 3250 if (!(plugin instanceof _plugin3.default)) { 3251 if (typeof plugin === "function" || (typeof plugin === "undefined" ? "undefined" : (0, _typeof3.default)(plugin)) === "object") { 3252 plugin = OptionManager.memoisePluginContainer(plugin, loc, i, alias); 3253 } else { 3254 throw new TypeError(messages.get("pluginNotFunction", loc, i, typeof plugin === "undefined" ? "undefined" : (0, _typeof3.default)(plugin))); 3255 } 3256 } 3257 3258 plugin.init(loc, i); 3259 3260 return plugin; 3261 }; 3262 3263 OptionManager.normalisePlugins = function normalisePlugins(loc, dirname, plugins) { 3264 return plugins.map(function (val, i) { 3265 var plugin = void 0, 3266 options = void 0; 3267 3268 if (!val) { 3269 throw new TypeError("Falsy value found in plugins"); 3270 } 3271 3272 if (Array.isArray(val)) { 3273 plugin = val[0]; 3274 options = val[1]; 3275 } else { 3276 plugin = val; 3277 } 3278 3279 var alias = typeof plugin === "string" ? plugin : loc + "$" + i; 3280 3281 if (typeof plugin === "string") { 3282 var pluginLoc = (0, _resolvePlugin2.default)(plugin, dirname); 3283 if (pluginLoc) { 3284 plugin = __webpack_require__(175)(pluginLoc); 3285 } else { 3286 throw new ReferenceError(messages.get("pluginUnknown", plugin, loc, i, dirname)); 3287 } 3288 } 3289 3290 plugin = OptionManager.normalisePlugin(plugin, loc, i, alias); 3291 3292 return [plugin, options]; 3293 }); 3294 }; 3295 3296 OptionManager.prototype.mergeOptions = function mergeOptions(_ref2) { 3297 var _this = this; 3298 3299 var rawOpts = _ref2.options, 3300 extendingOpts = _ref2.extending, 3301 alias = _ref2.alias, 3302 loc = _ref2.loc, 3303 dirname = _ref2.dirname; 3304 3305 alias = alias || "foreign"; 3306 if (!rawOpts) return; 3307 3308 if ((typeof rawOpts === "undefined" ? "undefined" : (0, _typeof3.default)(rawOpts)) !== "object" || Array.isArray(rawOpts)) { 3309 this.log.error("Invalid options type for " + alias, TypeError); 3310 } 3311 3312 var opts = (0, _cloneDeepWith2.default)(rawOpts, function (val) { 3313 if (val instanceof _plugin3.default) { 3314 return val; 3315 } 3316 }); 3317 3318 dirname = dirname || process.cwd(); 3319 loc = loc || alias; 3320 3321 for (var _key2 in opts) { 3322 var option = _config3.default[_key2]; 3323 3324 if (!option && this.log) { 3325 if (_removed2.default[_key2]) { 3326 this.log.error("Using removed Babel 5 option: " + alias + "." + _key2 + " - " + _removed2.default[_key2].message, ReferenceError); 3327 } else { 3328 var unknownOptErr = "Unknown option: " + alias + "." + _key2 + ". Check out http://babeljs.io/docs/usage/options/ for more information about options."; 3329 var presetConfigErr = "A common cause of this error is the presence of a configuration options object without the corresponding preset name. Example:\n\nInvali
3329d:\n `{ presets: [{option: value}] }`\nValid:\n `{ presets: [['presetName', {option: value}]] }`\n\nFor more detailed information on preset configuration, please see http://babeljs.io/docs/plugins/#pluginpresets-options."; 3330 3331 this.log.error(unknownOptErr + "\n\n" + presetConfigErr, ReferenceError); 3332 } 3333 } 3334 } 3335 3336 (0, _index.normaliseOptions)(opts); 3337 3338 if (opts.plugins) { 3339 opts.plugins = OptionManager.normalisePlugins(loc, dirname, opts.plugins); 3340 } 3341 3342 if (opts.presets) { 3343 if (opts.passPerPreset) { 3344 opts.presets = this.resolvePresets(opts.presets, dirname, function (preset, presetLoc) { 3345 _this.mergeOptions({ 3346 options: preset, 3347 extending: preset, 3348 alias: presetLoc, 3349 loc: presetLoc, 3350 dirname: dirname 3351 }); 3352 }); 3353 } else { 3354 this.mergePresets(opts.presets, dirname); 3355 delete opts.presets; 3356 } 3357 } 3358 3359 if (rawOpts === extendingOpts) { 3360 (0, _assign2.default)(extendingOpts, opts); 3361 } else { 3362 (0, _merge2.default)(extendingOpts || this.options, opts); 3363 } 3364 }; 3365 3366 OptionManager.prototype.mergePresets = function mergePresets(presets, dirname) { 3367 var _this2 = this; 3368 3369 this.resolvePresets(presets, dirname, function (presetOpts, presetLoc) { 3370 _this2.mergeOptions({ 3371 options: presetOpts, 3372 alias: presetLoc, 3373 loc: presetLoc, 3374 dirname: _path2.default.dirname(presetLoc || "") 3375 }); 3376 }); 3377 }; 3378 3379 OptionManager.prototype.resolvePresets = function resolvePresets(presets, dirname, onResolve) { 3380 return presets.map(function (val) { 3381 var options = void 0; 3382 if (Array.isArray(val)) { 3383 if (val.length > 2) { 3384 throw new Error("Unexpected extra options " + (0, _stringify2.default)(val.slice(2)) + " passed to preset."); 3385 } 3386 3387 var _val = val; 3388 val = _val[0]; 3389 options = _val[1]; 3390 } 3391 3392 var presetLoc = void 0; 3393 try { 3394 if (typeof val === "string") { 3395 presetLoc = (0, _resolvePreset2.default)(val, dirname); 3396 3397 if (!presetLoc) { 3398 throw new Error("Couldn't find preset " + (0, _stringify2.default)(val) + " relative to directory " + (0, _stringify2.default)(dirname)); 3399 } 3400 3401 val = __webpack_require__(175)(presetLoc); 3402 } 3403 3404 if ((typeof val === "undefined" ? "undefined" : (0, _typeof3.default)(val)) === "object" && val.__esModule) { 3405 if (val.default) { 3406 val = val.default; 3407 } else { 3408 var _val2 = val, 3409 __esModule = _val2.__esModule, 3410 rest = (0, _objectWithoutProperties3.default)(_val2, ["__esModule"]); 3411 3412 val = rest; 3413 } 3414 } 3415 3416 if ((typeof val === "undefined" ? "undefined" : (0, _typeof3.default)(val)) === "object" && val.buildPreset) val = val.buildPreset; 3417 3418 if (typeof val !== "function" && options !== undefined) { 3419 throw new Error("Options " + (0, _stringify2.default)(options) + " passed to " + (presetLoc || "a preset") + " which does not accept options."); 3420 } 3421 3422 if (typeof val === "function") val = val(context, options, { dirname: dirname }); 3423 3424 if ((typeof val === "undefined" ? "undefined" : (0, _typeof3.default)(val)) !== "object") { 3425 throw new Error("Unsupported preset format: " + val + "."); 3426 } 3427 3428 onResolve && onResolve(val, presetLoc); 3429 } catch (e) { 3430 if (presetLoc) { 3431 e.message += " (While processing preset: " + (0, _stringify2.default)(presetLoc) + ")"; 3432 } 3433 throw e; 3434 } 3435 return val; 3436 }); 3437 }; 3438 3439 OptionManager.prototype.normaliseOptions = function normaliseOptions() { 3440 var opts = this.options; 3441 3442 for (var _key3 in _config3.default) { 3443 var option = _config3.default[_key3]; 3444 var val = opts[_key3]; 3445 3446 if (!val && option.optional) continue; 3447 3448 if (option.alias) { 3449 opts[option.alias] = opts[option.alias] || val; 3450 } else { 3451 opts[_key3] = val; 3452 } 3453 } 3454 }; 3455
3456 OptionManager.prototype.init = function init() { 3457 var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; 3458 3459 for (var _iterator2 = (0, _buildConfigChain2.default)(opts, this.log), _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) { 3460 var _ref3; 3461 3462 if (_isArray2) { 3463 if (_i2 >= _iterator2.length) break; 3464 _ref3 = _iterator2[_i2++]; 3465 } else { 3466 _i2 = _iterator2.next(); 3467 if (_i2.done) break; 3468 _ref3 = _i2.value; 3469 } 3470 3471 var _config = _ref3; 3472 3473 this.mergeOptions(_config); 3474 } 3475 3476 this.normaliseOptions(opts); 3477 3478 return this.options; 3479 }; 3480 3481 return OptionManager; 3482 }(); 3483 3484 exports.default = OptionManager; 3485 3486 OptionManager.memoisedPlugins = []; 3487 module.exports = exports["default"]; 3488 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(9))) 3489 3490/***/ }, 3491/* 34 */ 3492/***/ function(module, exports, __webpack_require__) { 3493 3494 "use strict"; 3495 3496 module.exports = { "default": __webpack_require__(399), __esModule: true }; 3497 3498/***/ }, 3499/* 35 */ 3500/***/ function(module, exports, __webpack_require__) { 3501 3502 "use strict"; 3503 3504 exports.__esModule = true; 3505 3506 var _getIterator2 = __webpack_require__(2); 3507 3508 var _getIterator3 = _interopRequireDefault(_getIterator2); 3509 3510 var _classCallCheck2 = __webpack_require__(3); 3511 3512 var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); 3513 3514 var _virtualTypes = __webpack_require__(221); 3515 3516 var virtualTypes = _interopRequireWildcard(_virtualTypes); 3517 3518 var _debug2 = __webpack_require__(235); 3519 3520 var _debug3 = _interopRequireDefault(_debug2); 3521 3522 var _invariant = __webpack_require__(455); 3523 3524 var _invariant2 = _interopRequireDefault(_invariant); 3525 3526 var _index = __webpack_require__(8); 3527 3528 var _index2 = _interopRequireDefault(_index); 3529 3530 var _assign = __webpack_require__(170); 3531 3532 var _assign2 = _interopRequireDefault(_assign); 3533 3534 var _scope = __webpack_require__(131); 3535 3536 var _scope2 = _interopRequireDefault(_scope); 3537 3538 var _babelTypes = __webpack_require__(1); 3539 3540 var t = _interopRequireWildcard(_babelTypes); 3541 3542 var _cache = __webpack_require__(86); 3543 3544 function _interopRequireWildcard(obj) { 3545 if (obj && obj.__esModule) { 3546 return obj; 3547 } else { 3548 var newObj = {};if (obj != null) { 3549 for (var key in obj) { 3550 if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; 3551 } 3552 }newObj.default = obj;return newObj; 3553 } 3554 } 3555 3556 function _interopRequireDefault(obj) { 3557 return obj && obj.__esModule ? obj : { default: obj }; 3558 } 3559 3560 var _debug = (0, _debug3.default)("babel"); 3561 3562 var NodePath = function () { 3563 function NodePath(hub, parent) { 3564 (0, _classCallCheck3.default)(this, NodePath); 3565 3566 this.parent = parent; 3567 this.hub = hub; 3568 this.contexts = []; 3569 this.data = {}; 3570 this.shouldSkip = false; 3571 this.shouldStop = false; 3572 this.removed = false; 3573 this.state = null; 3574 this.opts = null; 3575 this.skipKeys = null; 3576 this.parentPath = null; 3577 this.context = null; 3578 this.container = null; 3579 this.listKey = null; 3580 this.inList = false; 3581 this.parentKey = null; 3582 this.key = null; 3583 this.node = null; 3584 this.scope = null; 3585 this.type = null; 3586 this.typeAnnotation = null; 3587 } 3588 3589 NodePath.get = function get(_ref) { 3590 var hub = _ref.hub, 3591 parentPath = _ref.parentPath, 3592 parent = _ref.parent, 3593 container = _ref.container, 3594 listKey = _ref.listKey, 3595 key = _ref.key; 3596 3597 if (!hub && parentPath) { 3598 hub = parentPath.hub; 3599 } 3600 3601 (0, _invariant2.default)(parent, "To get a node path the parent needs to exist"); 3602 3603 var targetNode = container[key]; 3604 3605 var paths = _cache.path.get(parent) || []; 3606 if (!_cache.path.has(parent)) { 3607 _cache.path.set(parent, paths); 3608 } 3609 3610 var path = void 0; 3611 3612 for (var i = 0; i < paths.length; i++) { 3613 var pathCheck = paths[i]; 3614 if (pathCheck.node === targetNode) { 3615 path = pathCheck; 3616 break; 3617 } 3618 } 3619 3620 if (!path) { 3621 path = new NodePath(hub, parent); 3622 paths.push(path); 3623 } 3624
3625 path.setup(parentPath, container, listKey, key); 3626 3627 return path; 3628 }; 3629 3630 NodePath.prototype.getScope = function getScope(scope) { 3631 var ourScope = scope; 3632 3633 if (this.isScope()) { 3634 ourScope = new _scope2.default(this, scope); 3635 } 3636 3637 return ourScope; 3638 }; 3639 3640 NodePath.prototype.setData = function setData(key, val) { 3641 return this.data[key] = val; 3642 }; 3643 3644 NodePath.prototype.getData = function getData(key, def) { 3645 var val = this.data[key]; 3646 if (!val && def) val = this.data[key] = def; 3647 return val; 3648 }; 3649 3650 NodePath.prototype.buildCodeFrameError = function buildCodeFrameError(msg) { 3651 var Error = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : SyntaxError; 3652 3653 return this.hub.file.buildCodeFrameError(this.node, msg, Error); 3654 }; 3655 3656 NodePath.prototype.traverse = function traverse(visitor, state) { 3657 (0, _index2.default)(this.node, visitor, this.scope, state, this); 3658 }; 3659 3660 NodePath.prototype.mark = function mark(type, message) { 3661 this.hub.file.metadata.marked.push({ 3662 type: type, 3663 message: message, 3664 loc: this.node.loc 3665 }); 3666 }; 3667 3668 NodePath.prototype.set = function set(key, node) { 3669 t.validate(this.node, key, node); 3670 this.node[key] = node; 3671 }; 3672 3673 NodePath.prototype.getPathLocation = function getPathLocation() { 3674 var parts = []; 3675 var path = this; 3676 do { 3677 var key = path.key; 3678 if (path.inList) key = path.listKey + "[" + key + "]"; 3679 parts.unshift(key); 3680 } while (path = path.parentPath); 3681 return parts.join("."); 3682 }; 3683 3684 NodePath.prototype.debug = function debug(buildMessage) { 3685 if (!_debug.enabled) return; 3686 _debug(this.getPathLocation() + " " + this.type + ": " + buildMessage()); 3687 }; 3688 3689 return NodePath; 3690 }(); 3691 3692 exports.default = NodePath; 3693 3694 (0, _assign2.default)(NodePath.prototype, __webpack_require__(362)); 3695 (0, _assign2.default)(NodePath.prototype, __webpack_require__(368)); 3696 (0, _assign2.default)(NodePath.prototype, __webpack_require__(376)); 3697 (0, _assign2.default)(NodePath.prototype, __webpack_require__(366)); 3698 (0, _assign2.default)(NodePath.prototype, __webpack_require__(365)); 3699 (0, _assign2.default)(NodePath.prototype, __webpack_require__(371)); 3700 (0, _assign2.default)(NodePath.prototype, __webpack_require__(364)); 3701 (0, _assign2.default)(NodePath.prototype, __webpack_require__(375)); 3702 (0, _assign2.default)(NodePath.prototype, __webpack_require__(374)); 3703 (0, _assign2.default)(NodePath.prototype, __webpack_require__(367)); 3704 (0, _assign2.default)(NodePath.prototype, __webpack_require__(363)); 3705 3706 var _loop2 = function _loop2() { 3707 if (_isArray) { 3708 if (_i >= _iterator.length) return "break"; 3709 _ref2 = _iterator[_i++]; 3710 } else { 3711 _i = _iterator.next(); 3712 if (_i.done) return "break"; 3713 _ref2 = _i.value; 3714 } 3715 3716 var type = _ref2; 3717 3718 var typeKey = "is" + type; 3719 NodePath.prototype[typeKey] = function (opts) { 3720 return t[typeKey](this.node, opts); 3721 }; 3722 3723 NodePath.prototype["assert" + type] = function (opts) { 3724 if (!this[typeKey](opts)) { 3725 throw new TypeError("Expected node path of type " + type); 3726 } 3727 }; 3728 }; 3729 3730 for (var _iterator = t.TYPES, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) { 3731 var _ref2; 3732 3733 var _ret2 = _loop2(); 3734 3735 if (_ret2 === "break") break; 3736 } 3737 3738 var _loop = function _loop(type) { 3739 if (type[0] === "_") return "continue"; 3740 if (t.TYPES.indexOf(type) < 0) t.TYPES.push(type); 3741 3742 var virtualType = virtualTypes[type]; 3743 3744 NodePath.prototype["is" + type] = function (opts) { 3745 return virtualType.checkPath(this, opts); 3746 }; 3747 }; 3748 3749 for (var type in virtualTypes) { 3750 var _ret = _loop(type); 3751 3752 if (_ret === "continue") continue; 3753 } 3754 module.exports = exports["default"]; 3755 3756/***/ }, 3757/* 36 */ 3758/***/ function(module, exports) { 3759 3760 "use strict"; 3761 3762 module.exports = function (exec) { 3763 try { 3764 return !!exec(); 3765 } catch (e) { 3766 return true; 3767 } 3768 }; 3769 3770/***/ }, 3771/* 37 */ 3772/***/ function(module, exports, __webpack_require__) { 3773 3774 'use strict'; 3775 3776 // to indexed object, toObject with fallback for non-array-like ES3 strings 3777 var IObject = __webpack_require__(139), 3778 defined = __webpack_require__(87); 3779 module.exports = function (it) { 3780 return IObject(defined(it)); 3781 }; 3782 3783/***/ }, 3784/* 38 */ 3785/***/ function(module, exports, __webpack_require__) { 3786 3787 'use strict'; 3788 3789 var baseIsNative = __webpack_require__(486), 3790 getValue = __webpack_require__(524); 3791 3792 /** 3793 * Gets the native function at `key` of `object`. 3794 * 3795 * @private 3796 * @param {Object} object The object to query. 3797 * @param {string} key The key of the method to get. 3798 * @returns {*} Returns the function if it's native, else `undefined`. 3799 */ 3800 function getNative(object, key) { 3801 var value = getValue(object, key); 3802 return baseIsNative(value) ? value : undefined; 3803 } 3804 3805 module.exports = getNative; 3806 3807/***/ }, 3808/* 39 */
3809/***/ function(module, exports) { 3810 3811 "use strict"; 3812 3813 module.exports = function (module) { 3814 if (!module.webpackPolyfill) { 3815 module.deprecate = function () {}; 3816 module.paths = []; 3817 // module.parent = undefined by default 3818 module.children = []; 3819 module.webpackPolyfill = 1; 3820 } 3821 return module; 3822 }; 3823 3824/***/ }, 3825/* 40 */ 3826/***/ function(module, exports, __webpack_require__) { 3827 3828 "use strict"; 3829 3830 exports.__esModule = true; 3831 3832 exports.default = function (_ref) { 3833 var node = _ref.node, 3834 parent = _ref.parent, 3835 scope = _ref.scope, 3836 id = _ref.id; 3837 3838 if (node.id) return; 3839 3840 if ((t.isObjectProperty(parent) || t.isObjectMethod(parent, { kind: "method" })) && (!parent.computed || t.isLiteral(parent.key))) { 3841 id = parent.key; 3842 } else if (t.isVariableDeclarator(parent)) { 3843 id = parent.id; 3844 3845 if (t.isIdentifier(id)) { 3846 var binding = scope.parent.getBinding(id.name); 3847 if (binding && binding.constant && scope.getBinding(id.name) === binding) { 3848 node.id = id; 3849 node.id[t.NOT_LOCAL_BINDING] = true; 3850 return; 3851 } 3852 } 3853 } else if (t.isAssignmentExpression(parent)) { 3854 id = parent.left; 3855 } else if (!id) { 3856 return; 3857 } 3858 3859 var name = void 0; 3860 if (id && t.isLiteral(id)) { 3861 name = id.value; 3862 } else if (id && t.isIdentifier(id)) { 3863 name = id.name; 3864 } else { 3865 return; 3866 } 3867 3868 name = t.toBindingIdentifierName(name); 3869 id = t.identifier(name); 3870 3871 id[t.NOT_LOCAL_BINDING] = true; 3872 3873 var state = visit(node, name, scope); 3874 return wrap(state, node, id, scope) || node; 3875 }; 3876 3877 var _babelHelperGetFunctionArity = __webpack_require__(186); 3878 3879 var _babelHelperGetFunctionArity2 = _interopRequireDefault(_babelHelperGetFunctionArity); 3880 3881 var _babelTemplate = __webpack_require__(4); 3882 3883 var _babelTemplate2 = _interopRequireDefault(_babelTemplate); 3884 3885 var _babelTypes = __webpack_require__(1); 3886 3887 var t = _interopRequireWildcard(_babelTypes); 3888 3889 function _interopRequireWildcard(obj) { 3890 if (obj && obj.__esModule) { 3891 return obj; 3892 } else { 3893 var newObj = {};if (obj != null) { 3894 for (var key in obj) { 3895 if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; 3896 } 3897 }newObj.default = obj;return newObj; 3898 } 3899 } 3900 3901 function _interopRequireDefault(obj) { 3902 return obj && obj.__esModule ? obj : { default: obj }; 3903 } 3904 3905 var buildPropertyMethodAssignmentWrapper = (0, _babelTemplate2.default)("\n (function (FUNCTION_KEY) {\n function FUNCTION_ID() {\n return FUNCTION_KEY.apply(this, arguments);\n }\n\n FUNCTION_ID.toString = function () {\n return FUNCTION_KEY.toString();\n }\n\n return FUNCTION_ID;\n })(FUNCTION)\n"); 3906 3907 var buildGeneratorPropertyMethodAssignmentWrapper = (0, _babelTemplate2.default)("\n (function (FUNCTION_KEY) {\n function* FUNCTION_ID() {\n return yield* FUNCTION_KEY.apply(this, arguments);\n }\n\n FUNCTION_ID.toString = function () {\n return FUNCTION_KEY.toString();\n };\n\n return FUNCTION_ID;\n })(FUNCTION)\n"); 3908 3909 var visitor = { 3910 "ReferencedIdentifier|BindingIdentifier": function ReferencedIdentifierBindingIdentifier(path, state) { 3911 if (path.node.name !== state.name) return; 3912 3913 var localDeclar = path.scope.getBindingIdentifier(state.name); 3914 if (localDeclar !== state.outerDeclar) return; 3915 3916 state.selfReference = true; 3917 path.stop(); 3918 } 3919 }; 3920 3921 function wrap(state, method, id, scope) { 3922 if (state.selfReference) { 3923 if (scope.hasBinding(id.name) && !scope.hasGlobal(id.name)) { 3924 scope.rename(id.name); 3925 } else { 3926 if (!t.isFunction(method)) return; 3927 3928 var build = buildPropertyMethodAssignmentWrapper; 3929 if (method.generator) build = buildGeneratorPropertyMethodAssignmentWrapper; 3930 var _template = build({ 3931 FUNCTION: method, 3932 FUNCTION_ID: id, 3933 FUNCTION_KEY: scope.generateUidIdentifier(id.name) 3934 }).expression; 3935 _template.callee._skipModulesRemap = true; 3936 3937 var params = _template.callee.body.body[0].params; 3938 for (var i = 0, len = (0, _babelHelperGetFunctionArity2.default)(method); i < len; i++) { 3939 params.push(scope.generateUidIdentifier("x")); 3940 } 3941 3942 return _template; 3943 } 3944 } 3945 3946 method.id = id; 3947 scope.getProgramParent().references[id.name] = true; 3948 } 3949 3950 function visit(node, name, scope) { 3951 var state = { 3952 selfAssignment: false, 3953 selfReference: false, 3954 outerDeclar: scope.getBindingIdentifier(name), 3955 references: [], 3956 name: name 3957 }; 3958 3959 var binding = scope.getOwnBinding(name); 3960 3961 if (binding) { 3962 if (binding.kind === "param") { 3963 state.selfReference = true; 3964 } else {} 3965 } else if (state.outerDeclar || scope.hasGlobal(name)) { 3966 scope.traverse(node, visitor, state); 3967 } 3968 3969 return state; 3970 } 3971 3972 module.exports = exports["default"]; 3973 3974/***/ }, 3975/* 41 */ 3976/***/ function(module, exports, __webpack_require__) { 3977 3978 "use strict"; 3979 3980 exports.__esModule = true; 3981 3982 var _setPrototypeOf = __webpack_require__(355); 3983 3984 var _setPrototypeOf2 = _interopRequireDefault(_setPrototypeOf); 3985 3986 var _create = __webpack_require__(10); 3987 3988 var _create2 = _interopRequireDefault(_create); 3989 3990 var _typeof2 = __webpack_require__(6); 3991 3992 var _typeof3 = _interopRequireDefault(_typeof2); 3993 3994 function _interopRequireDefault(obj) { 3995 return obj && obj.__esModule ? obj : { default: obj }; 3996 } 3997 3998 exports.default = function (subClass, superClass) { 3999 if (typeof superClass !== "function" && superClass !== null) { 4000 throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === "undefined" ? "undefined" : (0, _typeof3.default)(superClass))); 4001 } 4002 4003 subClass.prototype = (0, _create2.default)(superClass && superClass.prototype, { 4004 constructor: { 4005 value: subClass, 4006 enumerable: false, 4007 writable: true, 4008 configurable: true 4009 } 4010 }); 4011 if (superClass) _setPrototypeOf2.default ? (0, _setPrototypeOf2.default)(subClass, superClass) : subClass.__proto__ = superClass; 4012 }; 4013 4014/***/ }, 4015/* 42 */ 4016/***/ function(module, exports, __webpack_require__) { 4017 4018 "use strict"; 4019 4020 exports.__esModule = true; 4021 4022 var _typeof2 = __webpack_require__(6); 4023 4024 var _typeof3 = _interopRequireDefault(_typeof2); 4025 4026 function _interopRequireDefault(obj) { 4027 return obj && obj.__esModule ? obj : { default: obj }; 4028 } 4029 4030 exports.default = function (self, call) { 4031 if (!self) { 4032 throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); 4033 } 4034 4035 return call && ((typeof call === "undefined" ? "undefined" : (0, _typeof3.default)(call)) === "object" || typeof call === "function") ? call : self; 4036 }; 4037 4038/***/ }, 4039/* 43 */ 4040/***/ function(module, exports, __webpack_require__) { 4041 4042 'use strict'; 4043 4044 // 19.1.2.14 / 15.2.3.14 Object.keys(O) 4045 var $keys = __webpack_require__(233), 4046 enumBugKeys = __webpack_require__(138); 4047 4048 module.exports = Object.keys || function keys(O) { 4049 return $keys(O, enumBugKeys); 4050 }; 4051 4052/***/ }, 4053/* 44 */ 4054/***/ function(module, exports, __webpack_require__) { 4055 4056 'use strict'; 4057 4058 var root = __webpack_require__(15); 4059 4060 /** Built-in value references. */ 4061 var _Symbol = root.Symbol; 4062 4063 module.exports = _Symbol; 4064 4065/***/ }, 4066/* 45 */
4067/***/ function(module, exports) { 4068 4069 "use strict"; 4070 4071 /** 4072 * Performs a 4073 * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) 4074 * comparison between two values to determine if they are equivalent. 4075 * 4076 * @static 4077 * @memberOf _ 4078 * @since 4.0.0 4079 * @category Lang 4080 * @param {*} value The value to compare. 4081 * @param {*} other The other value to compare. 4082 * @returns {boolean} Returns `true` if the values are equivalent, else `false`. 4083 * @example 4084 * 4085 * var object = { 'a': 1 }; 4086 * var other = { 'a': 1 }; 4087 * 4088 * _.eq(object, object); 4089 * // => true 4090 * 4091 * _.eq(object, other); 4092 * // => false 4093 * 4094 * _.eq('a', 'a'); 4095 * // => true 4096 * 4097 * _.eq('a', Object('a')); 4098 * // => false 4099 * 4100 * _.eq(NaN, NaN); 4101 * // => true 4102 */ 4103 function eq(value, other) { 4104 return value === other || value !== value && other !== other; 4105 } 4106 4107 module.exports = eq; 4108 4109/***/ }, 4110/* 46 */ 4111/***/ function(module, exports, __webpack_require__) { 4112 4113 'use strict'; 4114 4115 var arrayLikeKeys = __webpack_require__(241), 4116 baseKeysIn = __webpack_require__(490), 4117 isArrayLike = __webpack_require__(24); 4118 4119 /** 4120 * Creates an array of the own and inherited enumerable property names of `object`. 4121 * 4122 * **Note:** Non-object values are coerced to objects. 4123 * 4124 * @static 4125 * @memberOf _ 4126 * @since 3.0.0 4127 * @category Object 4128 * @param {Object} object The object to query. 4129 * @returns {Array} Returns the array of property names. 4130 * @example 4131 * 4132 * function Foo() { 4133 * this.a = 1; 4134 * this.b = 2; 4135 * } 4136 * 4137 * Foo.prototype.c = 3; 4138 * 4139 * _.keysIn(new Foo); 4140 * // => ['a', 'b', 'c'] (iteration order is not guaranteed) 4141 */ 4142 function keysIn(object) { 4143 return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object); 4144 } 4145 4146 module.exports = keysIn; 4147 4148/***/ }, 4149/* 47 */ 4150/***/ function(module, exports, __webpack_require__) { 4151 4152 'use strict'; 4153 4154 var toFinite = __webpack_require__(586); 4155 4156 /** 4157 * Converts `value` to an integer. 4158 * 4159 * **Note:** This method is loosely based on 4160 * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger). 4161 * 4162 * @static 4163 * @memberOf _ 4164 * @since 4.0.0 4165 * @category Lang 4166 * @param {*} value The value to convert. 4167 * @returns {number} Returns the converted integer. 4168 * @example 4169 * 4170 * _.toInteger(3.2); 4171 * // => 3 4172 * 4173 * _.toInteger(Number.MIN_VALUE); 4174 * // => 0 4175 * 4176 * _.toInteger(Infinity); 4177 * // => 1.7976931348623157e+308 4178 * 4179 * _.toInteger('3.2'); 4180 * // => 3 4181 */ 4182 function toInteger(value) { 4183 var result = toFinite(value), 4184 remainder = result % 1; 4185 4186 return result === result ? remainder ? result - remainder : result : 0; 4187 } 4188 4189 module.exports = toInteger; 4190 4191/***/ }, 4192/* 48 */ 4193/***/ function(module, exports) { 4194 4195 /* WEBPACK VAR INJECTION */(function(__webpack_amd_options__) {module.exports = __webpack_amd_options__; 4196 4197 /* WEBPACK VAR INJECTION */}.call(exports, {})) 4198 4199/***/ }, 4200/* 49 */ 4201/***/ function(module, exports, __webpack_require__) { 4202 4203 /* WEBPACK VAR INJECTION */(function(process) {"use strict"; 4204 4205 exports.__esModule = true; 4206 exports.File = undefined; 4207 4208 var _getIterator2 = __webpack_require__(2); 4209 4210 var _getIterator3 = _interopRequireDefault(_getIterator2); 4211 4212 var _create = __webpack_require__(10); 4213 4214 var _create2 = _interopRequireDefault(_create); 4215 4216 var _assign = __webpack_require__(85); 4217 4218 var _assign2 = _interopRequireDefault(_assign); 4219 4220 var _classCallCheck2 = __webpack_require__(3); 4221 4222 var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); 4223 4224 var _possibleConstructorReturn2 = __webpack_require__(42); 4225 4226 var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); 4227 4228 var _inherits2 = __webpack_require__(41); 4229 4230 var _inherits3 = _interopRequireDefault(_inherits2); 4231 4232 var _babelHelpers = __webpack_require__(191); 4233 4234 var _babelHelpers2 = _interopRequireDefault(_babelHelpers); 4235 4236 var _metadata = __webpack_require__(118); 4237 4238 var metadataVisitor = _interopRequireWildcard(_metadata); 4239 4240 var _convertSourceMap = __webpack_require__(397); 4241 4242 var _convertSourceMap2 = _interopRequireDefault(_convertSourceMap); 4243 4244 var _optionManager = __webpack_require__(33); 4245 4246 var _optionManager2 = _interopRequireDefault(_optionManager); 4247 4248 var _pluginPass = __webpack_require__(296); 4249 4250 var _pluginPass2 = _interopRequireDefault(_pluginPass); 4251 4252 var _babelTraverse = __webpack_require__(8); 4253 4254 var _babelTraverse2 = _interopRequireDefault(_babelTraverse); 4255 4256 var _sourceMap = __webpack_require__(285); 4257 4258 var _sourceMap2 = _interopRequireDefault(_sourceMap); 4259 4260 var _babelGenerator = __webpack_require__(182); 4261 4262 var _babelGenerator2 = _interopRequireDefault(_babelGenerator); 4263 4264 var _babelCodeFrame = __webpack_require__(177); 4265 4266 var _babelCodeFrame2 = _interopRequireDefault(_babelCodeFrame); 4267 4268 var _defaults = __webpack_require__(269); 4269 4270 var _defaults2 = _interopRequireDefault(_defaults); 4271 4272 var _logger = __webpack_require__(117); 4273 4274 var _logger2 = _interopRequireDefault(_logger); 4275 4276 var _store = __webpack_require__(116); 4277 4278 var _store2 = _interopRequireDefault(_store); 4279 4280 var _babylon = __webpack_require__(133); 4281 4282 var _util = __webpack_require__(119); 4283 4284 var util = _interopRequireWildcard(_util); 4285 4286 var _path = __webpack_require__(17); 4287 4288 var _path2 = _interopRequireDefault(_path); 4289 4290 var _babelTypes = __webpack_require__(1); 4291 4292 var t = _interopRequireWildcard(_babelTypes); 4293 4294 var _resolve = __webpack_require__(115); 4295 4296 var _resolve2 = _interopRequireDefault(_resolve); 4297 4298 var _blockHoist = __webpack_require__(293); 4299 4300 var _blockHoist2 = _interopRequireDefault(_blockHoist); 4301 4302 var _shadowFunctions = __webpack_require__(294); 4303 4304 var _shadowFunctions2 = _interopRequireDefault(_shadowFunctions); 4305 4306 function _interopRequireWildcard(obj) { 4307 if (obj && obj.__esModule) { 4308 return obj; 4309 } else { 4310 var newObj = {};if (obj != null) { 4311 for (var key in obj) { 4312 if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; 4313 } 4314 }newObj.default = obj;return newObj; 4315 } 4316 } 4317 4318 function _interopRequireDefault(obj) { 4319 return obj && obj.__esModule ? obj : { default: obj }; 4320 } 4321 4322 var shebangRegex = /^#!.*/; 4323 4324 var INTERNAL_PLUGINS = [[_blockHoist2.default], [_shadowFunctions2.default]]; 4325 4326 var errorVisitor = { 4327 enter: function enter(path, state) { 4328 var loc = path.node.loc; 4329 if (loc) { 4330 state.loc = loc; 4331 path.stop(); 4332 } 4333 } 4334 }; 4335
4336 var File = function (_Store) { 4337 (0, _inherits3.default)(File, _Store); 4338 4339 function File() { 4340 var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; 4341 var pipeline = arguments[1]; 4342 (0, _classCallCheck3.default)(this, File); 4343 4344 var _this = (0, _possibleConstructorReturn3.default)(this, _Store.call(this)); 4345 4346 _this.pipeline = pipeline; 4347 4348 _this.log = new _logger2.default(_this, opts.filename || "unknown"); 4349 _this.opts = _this.initOptions(opts); 4350 4351 _this.parserOpts = { 4352 sourceType: _this.opts.sourceType, 4353 sourceFileName: _this.opts.filename, 4354 plugins: [] 4355 }; 4356 4357 _this.pluginVisitors = []; 4358 _this.pluginPasses = []; 4359 4360 _this.buildPluginsForOptions(_this.opts); 4361 4362 if (_this.opts.passPerPreset) { 4363 _this.perPresetOpts = []; 4364 _this.opts.presets.forEach(function (presetOpts) { 4365 var perPresetOpts = (0, _assign2.default)((0, _create2.default)(_this.opts), presetOpts); 4366 _this.perPresetOpts.push(perPresetOpts); 4367 _this.buildPluginsForOptions(perPresetOpts); 4368 }); 4369 } 4370 4371 _this.metadata = { 4372 usedHelpers: [], 4373 marked: [], 4374 modules: { 4375 imports: [], 4376 exports: { 4377 exported: [], 4378 specifiers: [] 4379 } 4380 } 4381 }; 4382 4383 _this.dynamicImportTypes = {}; 4384 _this.dynamicImportIds = {}; 4385 _this.dynamicImports = []; 4386 _this.declarations = {}; 4387 _this.usedHelpers = {}; 4388 4389 _this.path = null; 4390 _this.ast = {}; 4391 4392 _this.code = ""; 4393 _this.shebang = ""; 4394 4395 _this.hub = new _babelTraverse.Hub(_this); 4396 return _this; 4397 } 4398 4399 File.prototype.getMetadata = function getMetadata() { 4400 var has = false; 4401 for (var _iterator = this.ast.program.body, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) { 4402 var _ref; 4403 4404 if (_isArray) { 4405 if (_i >= _iterator.length) break; 4406 _ref = _iterator[_i++]; 4407 } else { 4408 _i = _iterator.next(); 4409 if (_i.done) break; 4410 _ref = _i.value; 4411 } 4412 4413 var node = _ref; 4414 4415 if (t.isModuleDeclaration(node)) { 4416 has = true; 4417 break; 4418 } 4419 } 4420 if (has) { 4421 this.path.traverse(metadataVisitor, this); 4422 } 4423 }; 4424 4425 File.prototype.initOptions = function initOptions(opts) { 4426 opts = new _optionManager2.default(this.log, this.pipeline).init(opts); 4427 4428 if (opts.inputSourceMap) { 4429 opts.sourceMaps = true; 4430 } 4431 4432 if (opts.moduleId) { 4433 opts.moduleIds = true; 4434 } 4435 4436 opts.basename = _path2.default.basename(opts.filename, _path2.default.extname(opts.filename)); 4437 4438 opts.ignore = util.arrayify(opts.ignore, util.regexify); 4439 4440 if (opts.only) opts.only = util.arrayify(opts.only, util.regexify); 4441 4442 (0, _defaults2.default)(opts, { 4443 moduleRoot: opts.sourceRoot 4444 }); 4445 4446 (0, _defaults2.default)(opts, { 4447 sourceRoot: opts.moduleRoot 4448 }); 4449 4450 (0, _defaults2.default)(opts, { 4451 filenameRelative: opts.filename 4452 }); 4453 4454 var basenameRelative = _path2.default.basename(opts.filenameRelative); 4455 4456 (0, _defaults2.default)(opts, { 4457 sourceFileName: basenameRelative, 4458 sourceMapTarget: basenameRelative 4459 }); 4460 4461 return opts; 4462 }; 4463 4464 File.prototype.buildPluginsForOptions = function buildPluginsForOptions(opts) { 4465 if (!Array.isArray(opts.plugins)) { 4466 return; 4467 } 4468 4469 var plugins = opts.plugins.concat(INTERNAL_PLUGINS); 4470 var currentPluginVisitors = []; 4471 var currentPluginPasses = []; 4472 4473 for (var _iterator2 = plugins, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) { 4474 var _ref2; 4475 4476 if (_isArray2) { 4477 if (_i2 >= _iterator2.length) break; 4478 _ref2 = _iterator2[_i2++]; 4479 } else { 4480 _i2 = _iterator2.next(); 4481 if (_i2.done) break; 4482 _ref2 = _i2.value; 4483 } 4484 4485 var ref = _ref2; 4486 var plugin = ref[0], 4487 pluginOpts = ref[1]; 4488 4489 currentPluginVisitors.push(plugin.visitor); 4490 currentPluginPasses.push(new _pluginPass2.default(this, plugin, pluginOpts)); 4491
4492 if (plugin.manipulateOptions) { 4493 plugin.manipulateOptions(opts, this.parserOpts, this); 4494 } 4495 } 4496 4497 this.pluginVisitors.push(currentPluginVisitors); 4498 this.pluginPasses.push(currentPluginPasses); 4499 }; 4500 4501 File.prototype.getModuleName = function getModuleName() { 4502 var opts = this.opts; 4503 if (!opts.moduleIds) { 4504 return null; 4505 } 4506 4507 if (opts.moduleId != null && !opts.getModuleId) { 4508 return opts.moduleId; 4509 } 4510 4511 var filenameRelative = opts.filenameRelative; 4512 var moduleName = ""; 4513 4514 if (opts.moduleRoot != null) { 4515 moduleName = opts.moduleRoot + "/"; 4516 } 4517 4518 if (!opts.filenameRelative) { 4519 return moduleName + opts.filename.replace(/^\//, ""); 4520 } 4521 4522 if (opts.sourceRoot != null) { 4523 var sourceRootRegEx = new RegExp("^" + opts.sourceRoot + "\/?"); 4524 filenameRelative = filenameRelative.replace(sourceRootRegEx, ""); 4525 } 4526 4527 filenameRelative = filenameRelative.replace(/\.(\w*?)$/, ""); 4528 4529 moduleName += filenameRelative; 4530 4531 moduleName = moduleName.replace(/\\/g, "/"); 4532 4533 if (opts.getModuleId) { 4534 return opts.getModuleId(moduleName) || moduleName; 4535 } else { 4536 return moduleName; 4537 } 4538 }; 4539 4540 File.prototype.resolveModuleSource = function resolveModuleSource(source) { 4541 var resolveModuleSource = this.opts.resolveModuleSource; 4542 if (resolveModuleSource) source = resolveModuleSource(source, this.opts.filename); 4543 return source; 4544 }; 4545 4546 File.prototype.addImport = function addImport(source, imported) { 4547 var name = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : imported; 4548 4549 var alias = source + ":" + imported; 4550 var id = this.dynamicImportIds[alias]; 4551 4552 if (!id) { 4553 source = this.resolveModuleSource(source); 4554 id = this.dynamicImportIds[alias] = this.scope.generateUidIdentifier(name); 4555 4556 var specifiers = []; 4557 4558 if (imported === "*") { 4559 specifiers.push(t.importNamespaceSpecifier(id)); 4560 } else if (imported === "default") { 4561 specifiers.push(t.importDefaultSpecifier(id)); 4562 } else { 4563 specifiers.push(t.importSpecifier(id, t.identifier(imported))); 4564 } 4565 4566 var declar = t.importDeclaration(specifiers, t.stringLiteral(source)); 4567 declar._blockHoist = 3; 4568 4569 this.path.unshiftContainer("body", declar); 4570 } 4571 4572 return id; 4573 }; 4574 4575 File.prototype.addHelper = function addHelper(name) { 4576 var declar = this.declarations[name]; 4577 if (declar) return declar; 4578 4579 if (!this.usedHelpers[name]) { 4580 this.metadata.usedHelpers.push(name); 4581 this.usedHelpers[name] = true; 4582 } 4583 4584 var generator = this.get("helperGenerator"); 4585 var runtime = this.get("helpersNamespace"); 4586 if (generator) { 4587 var res = generator(name); 4588 if (res) return res; 4589 } else if (runtime) { 4590 return t.memberExpression(runtime, t.identifier(name)); 4591 } 4592 4593 var ref = (0, _babelHelpers2.default)(name); 4594 var uid = this.declarations[name] = this.scope.generateUidIdentifier(name); 4595 4596 if (t.isFunctionExpression(ref) && !ref.id) { 4597 ref.body._compact = true; 4598 ref._generated = true; 4599 ref.id = uid; 4600 ref.type = "FunctionDeclaration"; 4601 this.path.unshiftContainer("body", ref); 4602 } else { 4603 ref._compact = true; 4604 this.scope.push({ 4605 id: uid, 4606 init: ref, 4607 unique: true 4608 }); 4609 } 4610 4611 return uid; 4612 }; 4613 4614 File.prototype.addTemplateObject = function addTemplateObject(helperName, strings, raw) { 4615 var stringIds = raw.elements.map(function (string) { 4616 return string.value; 4617 }); 4618 var name = helperName + "_" + raw.elements.length + "_" + stringIds.join(","); 4619 4620 var declar = this.declarations[name]; 4621 if (declar) return declar; 4622 4623 var uid = this.declarations[name] = this.scope.generateUidIdentifier("templateObject"); 4624 4625 var helperId = this.addHelper(helperName); 4626 var init = t.callExpression(helperId, [strings, raw]); 4627 init._compact = true; 4628 this.scope.push({ 4629 id: uid, 4630 init: init, 4631 _blockHoist: 1.9 }); 4632 return uid; 4633 }; 4634 4635 File.prototype.buildCodeFrameError = function buildCodeFrameError(node, msg) { 4636 var Error = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : SyntaxError; 4637 4638 var loc = node && (node.loc || node._loc); 4639 4640 var err = new Error(msg); 4641 4642 if (loc) { 4643 err.loc = loc.start; 4644 } else { 4645 (0, _babelTraverse2.default)(node, errorVisitor, this.scope, err); 4646
4647 err.message += " (This is an error on an internal node. Probably an internal error"; 4648 4649 if (err.loc) { 4650 err.message += ". Location has been estimated."; 4651 } 4652 4653 err.message += ")"; 4654 } 4655 4656 return err; 4657 }; 4658 4659 File.prototype.mergeSourceMap = function mergeSourceMap(map) { 4660 var inputMap = this.opts.inputSourceMap; 4661 4662 if (inputMap) { 4663 var inputMapConsumer = new _sourceMap2.default.SourceMapConsumer(inputMap); 4664 var outputMapConsumer = new _sourceMap2.default.SourceMapConsumer(map); 4665 4666 var mergedGenerator = new _sourceMap2.default.SourceMapGenerator({ 4667 file: inputMapConsumer.file, 4668 sourceRoot: inputMapConsumer.sourceRoot 4669 }); 4670 4671 var source = outputMapConsumer.sources[0]; 4672 4673 inputMapConsumer.eachMapping(function (mapping) { 4674 var generatedPosition = outputMapConsumer.generatedPositionFor({ 4675 line: mapping.generatedLine, 4676 column: mapping.generatedColumn, 4677 source: source 4678 }); 4679 if (generatedPosition.column != null) { 4680 mergedGenerator.addMapping({ 4681 source: mapping.source, 4682 4683 original: mapping.source == null ? null : { 4684 line: mapping.originalLine, 4685 column: mapping.originalColumn 4686 }, 4687 4688 generated: generatedPosition 4689 }); 4690 } 4691 }); 4692 4693 var mergedMap = mergedGenerator.toJSON(); 4694 inputMap.mappings = mergedMap.mappings; 4695 return inputMap; 4696 } else { 4697 return map; 4698 } 4699 }; 4700 4701 File.prototype.parse = function parse(code) { 4702 var parseCode = _babylon.parse; 4703 var parserOpts = this.opts.parserOpts; 4704 4705 if (parserOpts) { 4706 parserOpts = (0, _assign2.default)({}, this.parserOpts, parserOpts); 4707 4708 if (parserOpts.parser) { 4709 if (typeof parserOpts.parser === "string") { 4710 var dirname = _path2.default.dirname(this.opts.filename) || process.cwd(); 4711 var parser = (0, _resolve2.default)(parserOpts.parser, dirname); 4712 if (parser) { 4713 parseCode = __webpack_require__(174)(parser).parse; 4714 } else { 4715 throw new Error("Couldn't find parser " + parserOpts.parser + " with \"parse\" method " + ("relative to directory " + dirname)); 4716 } 4717 } else { 4718 parseCode = parserOpts.parser; 4719 } 4720 4721 parserOpts.parser = { 4722 parse: function parse(source) { 4723 return (0, _babylon.parse)(source, parserOpts); 4724 } 4725 }; 4726 } 4727 } 4728 4729 this.log.debug("Parse start"); 4730 var ast = parseCode(code, parserOpts || this.parserOpts); 4731 this.log.debug("Parse stop"); 4732 return ast; 4733 }; 4734 4735 File.prototype._addAst = function _addAst(ast) { 4736 this.path = _babelTraverse.NodePath.get({ 4737 hub: this.hub, 4738 parentPath: null, 4739 parent: ast, 4740 container: ast, 4741 key: "program" 4742 }).setContext(); 4743 this.scope = this.path.scope; 4744 this.ast = ast; 4745 this.getMetadata(); 4746 }; 4747 4748 File.prototype.addAst = function addAst(ast) { 4749 this.log.debug("Start set AST"); 4750 this._addAst(ast); 4751 this.log.debug("End set AST"); 4752 }; 4753 4754 File.prototype.transform = function transform() { 4755 for (var i = 0; i < this.pluginPasses.length; i++) { 4756 var pluginPasses = this.pluginPasses[i]; 4757 this.call("pre", pluginPasses); 4758 this.log.debug("Start transform traverse"); 4759 4760 var visitor = _babelTraverse2.default.visitors.merge(this.pluginVisitors[i], pluginPasses, this.opts.wrapPluginVisitorMethod); 4761 (0, _babelTraverse2.default)(this.ast, visitor, this.scope); 4762 4763 this.log.debug("End transform traverse"); 4764 this.call("post", pluginPasses); 4765 } 4766 4767 return this.generate(); 4768 }; 4769 4770 File.prototype.wrap = function wrap(code, callback) { 4771 code = code + ""; 4772 4773 try { 4774 if (this.shouldIgnore()) { 4775 return this.makeResult({ code: code, ignored: true }); 4776 } else { 4777 return callback(); 4778 } 4779 } catch (err) { 4780 if (err._babel) { 4781 throw err; 4782 } else { 4783 err._babel = true; 4784 } 4785 4786 var message = err.message = this.opts.filename + ": " + err.message; 4787 4788 var loc = err.loc; 4789 if (loc) { 4790 err.codeFrame = (0, _babelCodeFrame2.default)(code, loc.line, loc.column + 1, this.opts); 4791 message += "\n" + err.codeFrame; 4792 } 4793 4794 if (process.browser) { 4795 err.message = message; 4796 } 4797 4798 if (err.stack) { 4799 var newStack = err.stack.replace(err.message, message); 4800 err.stack = newStack; 4801 } 4802 4803 throw err; 4804 } 4805 }; 4806 4807 File.prototype.addCode = function addCode(code) { 4808 code = (code || "") + ""; 4809 code = this.parseInputSourceMap(code); 4810 this.code = code; 4811 }; 4812 4813 File.prototype.parseCode = function parseCode() { 4814 this.parseShebang(); 4815 var ast = this.parse(this.code); 4816 this.addAst(ast); 4817 }; 4818 4819 File.prototype.shouldIgnore = function shouldIgnore() { 4820 var opts = this.opts; 4821 return util.shouldIgnore(opts.filename, opts.ignore, opts.only); 4822 }; 4823 4824 File.prototype.call = function call(key, pluginPasses) { 4825 for (var _iterator3 = pluginPasses, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, _getIterator3.default)(_iterator3);;) { 4826 var _ref3; 4827 4828 if (_isArray3) { 4829 if (_i3 >= _iterator3.length) break; 4830 _ref3 = _iterator3[_i3++]; 4831 } else { 4832 _i3 = _iterator3.next(); 4833 if (_i3.done) break; 4834 _ref3 = _i3.value; 4835 } 4836 4837 var pass = _ref3; 4838 4839 var plugin = pass.plugin; 4840 var fn = plugin[key]; 4841 if (fn) fn.call(pass, this); 4842 } 4843 }; 4844 4845 File.prototype.parseInputSourceMap = function parseInputSourceMap(code) { 4846 var opts = this.opts; 4847 4848 if (opts.inputSourceMap !== false) { 4849 var inputMap = _convertSourceMap2.default.fromSource(code); 4850 if (inputMap) { 4851 opts.inputSourceMap = inputMap.toObject(); 4852 code = _convertSourceMap2.default.removeComments(code); 4853 } 4854 } 4855 4856 return code; 4857 }; 4858 4859 File.prototype.parseShebang = function parseShebang() { 4860 var shebangMatch = shebangRegex.exec(this.code); 4861 if (shebangMatch) { 4862 this.shebang = shebangMatch[0];
4863 this.code = this.code.replace(shebangRegex, ""); 4864 } 4865 }; 4866 4867 File.prototype.makeResult = function makeResult(_ref4) { 4868 var code = _ref4.code, 4869 map = _ref4.map, 4870 ast = _ref4.ast, 4871 ignored = _ref4.ignored; 4872 4873 var result = { 4874 metadata: null, 4875 options: this.opts, 4876 ignored: !!ignored, 4877 code: null, 4878 ast: null, 4879 map: map || null 4880 }; 4881 4882 if (this.opts.code) { 4883 result.code = code; 4884 } 4885 4886 if (this.opts.ast) { 4887 result.ast = ast; 4888 } 4889 4890 if (this.opts.metadata) { 4891 result.metadata = this.metadata; 4892 } 4893 4894 return result; 4895 }; 4896 4897 File.prototype.generate = function generate() { 4898 var opts = this.opts; 4899 var ast = this.ast; 4900 4901 var result = { ast: ast }; 4902 if (!opts.code) return this.makeResult(result); 4903 4904 var gen = _babelGenerator2.default; 4905 if (opts.generatorOpts.generator) { 4906 gen = opts.generatorOpts.generator; 4907 4908 if (typeof gen === "string") { 4909 var dirname = _path2.default.dirname(this.opts.filename) || process.cwd(); 4910 var generator = (0, _resolve2.default)(gen, dirname); 4911 if (generator) { 4912 gen = __webpack_require__(174)(generator).print; 4913 } else { 4914 throw new Error("Couldn't find generator " + gen + " with \"print\" method relative " + ("to directory " + dirname)); 4915 } 4916 } 4917 } 4918 4919 this.log.debug("Generation start"); 4920 4921 var _result = gen(ast, opts.generatorOpts ? (0, _assign2.default)(opts, opts.generatorOpts) : opts, this.code); 4922 result.code = _result.code; 4923 result.map = _result.map; 4924 4925 this.log.debug("Generation end"); 4926 4927 if (this.shebang) { 4928 result.code = this.shebang + "\n" + result.code; 4929 } 4930 4931 if (result.map) { 4932 result.map = this.mergeSourceMap(result.map); 4933 } 4934 4935 if (opts.sourceMaps === "inline" || opts.sourceMaps === "both") { 4936 result.code += "\n" + _convertSourceMap2.default.fromObject(result.map).toComment(); 4937 } 4938 4939 if (opts.sourceMaps === "inline") { 4940 result.map = null; 4941 } 4942 4943 return this.makeResult(result); 4944 }; 4945 4946 return File; 4947 }(_store2.default); 4948 4949 exports.default = File; 4950 exports.File = File; 4951 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(9))) 4952 4953/***/ }, 4954/* 50 */ 4955/***/ function(module, exports, __webpack_require__) { 4956 4957 /* WEBPACK VAR INJECTION */(function(process) {"use strict"; 4958 4959 exports.__esModule = true; 4960 4961 var _assign = __webpack_require__(85); 4962 4963 var _assign2 = _interopRequireDefault(_assign); 4964 4965 var _classCallCheck2 = __webpack_require__(3); 4966 4967 var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); 4968 4969 exports.default = buildConfigChain; 4970 4971 var _resolve = __webpack_require__(115); 4972 4973 var _resolve2 = _interopRequireDefault(_resolve); 4974 4975 var _json = __webpack_require__(459); 4976 4977 var _json2 = _interopRequireDefault(_json); 4978 4979 var _pathIsAbsolute = __webpack_require__(593); 4980 4981 var _pathIsAbsolute2 = _interopRequireDefault(_pathIsAbsolute); 4982 4983 var _path = __webpack_require__(17); 4984 4985 var _path2 = _interopRequireDefault(_path); 4986 4987 var _fs = __webpack_require__(113); 4988 4989 var _fs2 = _interopRequireDefault(_fs); 4990 4991 function _interopRequireDefault(obj) { 4992 return obj && obj.__esModule ? obj : { default: obj }; 4993 } 4994 4995 var existsCache = {}; 4996 var jsonCache = {}; 4997 4998 var BABELIGNORE_FILENAME = ".babelignore"; 4999 var BABELRC_FILENAME = ".babelrc"; 5000 var PACKAGE_FILENAME = "package.json"; 5001 5002 function exists(filename) { 5003 var cached = existsCache[filename]; 5004 if (cached == null) { 5005 return existsCache[filename] = _fs2.default.existsSync(filename); 5006 } else { 5007 return cached; 5008 } 5009 } 5010 5011 function buildConfigChain() { 5012 var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; 5013 var log = arguments[1]; 5014 5015 var filename = opts.filename; 5016 var builder = new ConfigChainBuilder(log); 5017 5018 if (opts.babelrc !== false) { 5019 builder.findConfigs(filename); 5020 } 5021 5022 builder.mergeConfig({ 5023 options: opts, 5024 alias: "base", 5025 dirname: filename && _path2.default.dirname(filename) 5026 }); 5027 5028 return builder.configs; 5029 } 5030 5031 var ConfigChainBuilder = function () { 5032 function ConfigChainBuilder(log) { 5033 (0, _classCallCheck3.default)(this, ConfigChainBuilder); 5034 5035 this.resolvedConfigs = []; 5036 this.configs = []; 5037 this.log = log; 5038 } 5039 5040 ConfigChainBuilder.prototype.findConfigs = function findConfigs(loc) { 5041 if (!loc) return; 5042 5043 if (!(0, _pathIsAbsolute2.default)(loc)) { 5044 loc = _path2.default.join(process.cwd(), loc); 5045 } 5046 5047 var foundConfig = false;
5048 var foundIgnore = false; 5049 5050 while (loc !== (loc = _path2.default.dirname(loc))) { 5051 if (!foundConfig) { 5052 var configLoc = _path2.default.join(loc, BABELRC_FILENAME); 5053 if (exists(configLoc)) { 5054 this.addConfig(configLoc); 5055 foundConfig = true; 5056 } 5057 5058 var pkgLoc = _path2.default.join(loc, PACKAGE_FILENAME); 5059 if (!foundConfig && exists(pkgLoc)) { 5060 foundConfig = this.addConfig(pkgLoc, "babel", JSON); 5061 } 5062 } 5063 5064 if (!foundIgnore) { 5065 var ignoreLoc = _path2.default.join(loc, BABELIGNORE_FILENAME); 5066 if (exists(ignoreLoc)) { 5067 this.addIgnoreConfig(ignoreLoc); 5068 foundIgnore = true; 5069 } 5070 } 5071 5072 if (foundIgnore && foundConfig) return; 5073 } 5074 }; 5075 5076 ConfigChainBuilder.prototype.addIgnoreConfig = function addIgnoreConfig(loc) { 5077 var file = _fs2.default.readFileSync(loc, "utf8"); 5078 var lines = file.split("\n"); 5079 5080 lines = lines.map(function (line) { 5081 return line.replace(/#(.*?)$/, "").trim(); 5082 }).filter(function (line) { 5083 return !!line; 5084 }); 5085 5086 if (lines.length) { 5087 this.mergeConfig({ 5088 options: { ignore: lines }, 5089 alias: loc, 5090 dirname: _path2.default.dirname(loc) 5091 }); 5092 } 5093 }; 5094 5095 ConfigChainBuilder.prototype.addConfig = function addConfig(loc, key) { 5096 var json = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _json2.default; 5097 5098 if (this.resolvedConfigs.indexOf(loc) >= 0) { 5099 return false; 5100 } 5101 5102 this.resolvedConfigs.push(loc); 5103 5104 var content = _fs2.default.readFileSync(loc, "utf8"); 5105 var options = void 0; 5106 5107 try { 5108 options = jsonCache[content] = jsonCache[content] || json.parse(content); 5109 if (key) options = options[key]; 5110 } catch (err) { 5111 err.message = loc + ": Error while parsing JSON - " + err.message; 5112 throw err; 5113 } 5114 5115 this.mergeConfig({ 5116 options: options, 5117 alias: loc, 5118 dirname: _path2.default.dirname(loc) 5119 }); 5120 5121 return !!options; 5122 }; 5123 5124 ConfigChainBuilder.prototype.mergeConfig = function mergeConfig(_ref) { 5125 var options = _ref.options, 5126 alias = _ref.alias, 5127 loc = _ref.loc, 5128 dirname = _ref.dirname; 5129 5130 if (!options) { 5131 return false; 5132 } 5133 5134 options = (0, _assign2.default)({}, options); 5135 5136 dirname = dirname || process.cwd(); 5137 loc = loc || alias; 5138 5139 if (options.extends) { 5140 var extendsLoc = (0, _resolve2.default)(options.extends, dirname); 5141 if (extendsLoc) { 5142 this.addConfig(extendsLoc); 5143 } else { 5144 if (this.log) this.log.error("Couldn't resolve extends clause of " + options.extends + " in " + alias); 5145 } 5146 delete options.extends; 5147 } 5148 5149 this.configs.push({ 5150 options: options, 5151 alias: alias, 5152 loc: loc, 5153 dirname: dirname 5154 }); 5155 5156 var envOpts = void 0; 5157 var envKey = process.env.BABEL_ENV || ("production") || "development"; 5158 if (options.env) { 5159 envOpts = options.env[envKey]; 5160 delete options.env; 5161 } 5162 5163 this.mergeConfig({ 5164 options: envOpts, 5165 alias: alias + ".env." + envKey, 5166 dirname: dirname 5167 }); 5168 }; 5169 5170 return ConfigChainBuilder; 5171 }(); 5172 5173 module.exports = exports["default"]; 5174 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(9))) 5175 5176/***/ }, 5177/* 51 */ 5178/***/ function(module, exports, __webpack_require__) { 5179 5180 "use strict"; 5181 5182 exports.__esModule = true; 5183 exports.config = undefined; 5184 exports.normaliseOptions = normaliseOptions; 5185 5186 var _parsers = __webpack_require__(52); 5187 5188 var parsers = _interopRequireWildcard(_parsers); 5189 5190 var _config = __webpack_require__(32); 5191 5192 var _config2 = _interopRequireDefault(_config); 5193 5194 function _interopRequireDefault(obj) { 5195 return obj && obj.__esModule ? obj : { default: obj }; 5196 } 5197 5198 function _interopRequireWildcard(obj) { 5199 if (obj && obj.__esModule) { 5200 return obj; 5201 } else { 5202 var newObj = {};if (obj != null) { 5203 for (var key in obj) { 5204 if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; 5205 } 5206 }newObj.default = obj;return newObj; 5207 } 5208 } 5209 5210 exports.config = _config2.default; 5211 function normaliseOptions() { 5212 var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; 5213 5214 for (var key in options) { 5215 var val = options[key]; 5216 if (val == null) continue; 5217 5218 var opt = _config2.default[key]; 5219 if (opt && opt.alias) opt = _config2.default[opt.alias]; 5220 if (!opt) continue; 5221 5222 var parser = parsers[opt.type]; 5223 if (parser) val = parser(val); 5224 5225 options[key] = val; 5226 } 5227 5228 return options; 5229 } 5230 5231/***/ }, 5232/* 52 */ 5233/***/ function(module, exports, __webpack_require__) { 5234 5235 "use strict"; 5236 5237 exports.__esModule = true; 5238 exports.filename = undefined; 5239 exports.boolean = boolean; 5240 exports.booleanString = booleanString; 5241 exports.list = list; 5242 5243 var _slash = __webpack_require__(281); 5244 5245 var _slash2 = _interopRequireDefault(_slash); 5246 5247 var _util = __webpack_require__(119); 5248 5249 var util = _interopRequireWildcard(_util); 5250 5251 function _interopRequireWildcard(obj) { 5252 if (obj && obj.__esModule) { 5253 return obj; 5254 } else { 5255 var newObj = {};if (obj != null) { 5256 for (var key in obj) { 5257 if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; 5258 } 5259 }newObj.default = obj;return newObj; 5260 } 5261 } 5262 5263 function _interopRequireDefault(obj) { 5264 return obj && obj.__esModule ? obj : { default: obj }; 5265 } 5266 5267 var filename = exports.filename = _slash2.default; 5268 5269 function boolean(val) { 5270 return !!val; 5271 } 5272 5273 function booleanString(val) { 5274 return util.booleanify(val); 5275 } 5276 5277 function list(val) { 5278 return util.list(val); 5279 } 5280 5281/***/ }, 5282/* 53 */
5283/***/ function(module, exports) { 5284 5285 "use strict"; 5286 5287 module.exports = { 5288 "auxiliaryComment": { 5289 "message": "Use `auxiliaryCommentBefore` or `auxiliaryCommentAfter`" 5290 }, 5291 "blacklist": { 5292 "message": "Put the specific transforms you want in the `plugins` option" 5293 }, 5294 "breakConfig": { 5295 "message": "This is not a necessary option in Babel 6" 5296 }, 5297 "experimental": { 5298 "message": "Put the specific transforms you want in the `plugins` option" 5299 }, 5300 "externalHelpers": { 5301 "message": "Use the `external-helpers` plugin instead. Check out http://babeljs.io/docs/plugins/external-helpers/" 5302 }, 5303 "extra": { 5304 "message": "" 5305 }, 5306 "jsxPragma": { 5307 "message": "use the `pragma` option in the `react-jsx` plugin . Check out http://babeljs.io/docs/plugins/transform-react-jsx/" 5308 }, 5309 5310 "loose": { 5311 "message": "Specify the `loose` option for the relevant plugin you are using or use a preset that sets the option." 5312 }, 5313 "metadataUsedHelpers": { 5314 "message": "Not required anymore as this is enabled by default" 5315 }, 5316 "modules": { 5317 "message": "Use the corresponding module transform plugin in the `plugins` option. Check out http://babeljs.io/docs/plugins/#modules" 5318 }, 5319 "nonStandard": { 5320 "message": "Use the `react-jsx` and `flow-strip-types` plugins to support JSX and Flow. Also check out the react preset http://babeljs.io/docs/plugins/preset-react/" 5321 }, 5322 "optional": { 5323 "message": "Put the specific transforms you want in the `plugins` option" 5324 }, 5325 "sourceMapName": { 5326 "message": "Use the `sourceMapTarget` option" 5327 }, 5328 "stage": { 5329 "message": "Check out the corresponding stage-x presets http://babeljs.io/docs/plugins/#presets" 5330 }, 5331 "whitelist": { 5332 "message": "Put the specific transforms you want in the `plugins` option" 5333 } 5334 }; 5335 5336/***/ }, 5337/* 54 */ 5338/***/ function(module, exports, __webpack_require__) { 5339 5340 'use strict'; 5341 5342 // optional / simple context binding 5343 var aFunction = __webpack_require__(412); 5344 module.exports = function (fn, that, length) { 5345 aFunction(fn); 5346 if (that === undefined) return fn; 5347 switch (length) { 5348 case 1: 5349 return function (a) { 5350 return fn.call(that, a); 5351 }; 5352 case 2: 5353 return function (a, b) { 5354 return fn.call(that, a, b); 5355 }; 5356 case 3: 5357 return function (a, b, c) { 5358 return fn.call(that, a, b, c); 5359 }; 5360 } 5361 return function () /* ...args */{ 5362 return fn.apply(that, arguments); 5363 }; 5364 }; 5365 5366/***/ }, 5367/* 55 */ 5368/***/ function(module, exports) { 5369 5370 "use strict"; 5371 5372 module.exports = {}; 5373 5374/***/ }, 5375/* 56 */ 5376/***/ function(module, exports, __webpack_require__) { 5377 5378 'use strict'; 5379 5380 var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; 5381 5382 var META = __webpack_require__(94)('meta'), 5383 isObject = __webpack_require__(22), 5384 has = __webpack_require__(27), 5385 setDesc = __webpack_require__(23).f, 5386 id = 0; 5387 var isExtensible = Object.isExtensible || function () { 5388 return true; 5389 }; 5390 var FREEZE = !__webpack_require__(36)(function () { 5391 return isExtensible(Object.preventExtensions({})); 5392 }); 5393 var setMeta = function setMeta(it) { 5394 setDesc(it, META, { value: { 5395 i: 'O' + ++id, // object ID 5396 w: {} // weak collections IDs 5397 } }); 5398 }; 5399 var fastKey = function fastKey(it, create) { 5400 // return primitive with prefix 5401 if (!isObject(it)) return (typeof it === 'undefined' ? 'undefined' : _typeof(it)) == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it; 5402 if (!has(it, META)) { 5403 // can't set metadata to uncaught frozen object 5404 if (!isExtensible(it)) return 'F'; 5405 // not necessary to add metadata 5406 if (!create) return 'E'; 5407 // add missing metadata 5408 setMeta(it); 5409 // return object ID 5410 }return it[META].i; 5411 }; 5412 var getWeak = function getWeak(it, create) { 5413 if (!has(it, META)) { 5414 // can't set metadata to uncaught frozen object 5415 if (!isExtensible(it)) return true; 5416 // not necessary to add metadata 5417 if (!create) return false;
5418 // add missing metadata 5419 setMeta(it); 5420 // return hash weak collections IDs 5421 }return it[META].w; 5422 }; 5423 // add metadata on freeze-family methods calling 5424 var onFreeze = function onFreeze(it) { 5425 if (FREEZE && meta.NEED && isExtensible(it) && !has(it, META)) setMeta(it); 5426 return it; 5427 }; 5428 var meta = module.exports = { 5429 KEY: META, 5430 NEED: false, 5431 fastKey: fastKey, 5432 getWeak: getWeak, 5433 onFreeze: onFreeze 5434 }; 5435 5436/***/ }, 5437/* 57 */ 5438/***/ function(module, exports, __webpack_require__) { 5439 5440 'use strict'; 5441 5442 __webpack_require__(435); 5443 var global = __webpack_require__(14), 5444 hide = __webpack_require__(28), 5445 Iterators = __webpack_require__(55), 5446 TO_STRING_TAG = __webpack_require__(12)('toStringTag'); 5447 5448 for (var collections = ['NodeList', 'DOMTokenList', 'MediaList', 'StyleSheetList', 'CSSRuleList'], i = 0; i < 5; i++) { 5449 var NAME = collections[i], 5450 Collection = global[NAME], 5451 proto = Collection && Collection.prototype; 5452 if (proto && !proto[TO_STRING_TAG]) hide(proto, TO_STRING_TAG, NAME); 5453 Iterators[NAME] = Iterators.Array; 5454 } 5455 5456/***/ }, 5457/* 58 */ 5458/***/ function(module, exports) { 5459 5460 "use strict"; 5461 5462 /** 5463 * A specialized version of `_.map` for arrays without support for iteratee 5464 * shorthands. 5465 * 5466 * @private 5467 * @param {Array} [array] The array to iterate over. 5468 * @param {Function} iteratee The function invoked per iteration. 5469 * @returns {Array} Returns the new mapped array. 5470 */ 5471 function arrayMap(array, iteratee) { 5472 var index = -1, 5473 length = array == null ? 0 : array.length, 5474 result = Array(length); 5475 5476 while (++index < length) { 5477 result[index] = iteratee(array[index], index, array); 5478 } 5479 return result; 5480 } 5481 5482 module.exports = arrayMap; 5483 5484/***/ }, 5485/* 59 */ 5486/***/ function(module, exports, __webpack_require__) { 5487 5488 'use strict'; 5489 5490 var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; 5491 5492 var baseMatches = __webpack_require__(491), 5493 baseMatchesProperty = __webpack_require__(492), 5494 identity = __webpack_require__(108), 5495 isArray = __webpack_require__(7), 5496 property = __webpack_require__(581); 5497 5498 /** 5499 * The base implementation of `_.iteratee`. 5500 * 5501 * @private 5502 * @param {*} [value=_.identity] The value to convert to an iteratee. 5503 * @returns {Function} Returns the iteratee. 5504 */ 5505 function baseIteratee(value) { 5506 // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9. 5507 // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details. 5508 if (typeof value == 'function') { 5509 return value; 5510 } 5511 if (value == null) { 5512 return identity; 5513 } 5514 if ((typeof value === 'undefined' ? 'undefined' : _typeof(value)) == 'object') { 5515 return isArray(value) ? baseMatchesProperty(value[0], value[1]) : baseMatches(value); 5516 } 5517 return property(value); 5518 } 5519 5520 module.exports = baseIteratee; 5521 5522/***/ }, 5523/* 60 */ 5524/***/ function(module, exports, __webpack_require__) { 5525 5526 'use strict'; 5527 5528 var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; 5529 5530 var baseGetTag = __webpack_require__(29), 5531 isObjectLike = __webpack_require__(25); 5532 5533 /** `Object#toString` result references. */ 5534 var symbolTag = '[object Symbol]'; 5535 5536 /** 5537 * Checks if `value` is classified as a `Symbol` primitive or object. 5538 * 5539 * @static 5540 * @memberOf _ 5541 * @since 4.0.0 5542 * @category Lang 5543 * @param {*} value The value to check. 5544 * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. 5545 * @example 5546 * 5547 * _.isSymbol(Symbol.iterator); 5548 * // => true 5549 * 5550 * _.isSymbol('abc'); 5551 * // => false 5552 */ 5553 function isSymbol(value) { 5554 return (typeof value === 'undefined' ? 'undefined' : _typeof(value)) == 'symbol' || isObjectLike(value) && baseGetTag(value) == symbolTag; 5555 } 5556 5557 module.exports = isSymbol; 5558 5559/***/ }, 5560/* 61 */
vendor: 9,887 bytes, lines 5561-5927
5561/***/ function(module, exports) { 5562 5563 'use strict'; 5564 5565 /* -*- Mode: js; js-indent-level: 2; -*- */ 5566 /* 5567 * Copyright 2011 Mozilla Foundation and contributors 5568 * Licensed under the New BSD license. See LICENSE or: 5569 * http://opensource.org/licenses/BSD-3-Clause 5570 */ 5571 5572 /** 5573 * This is a helper function for getting values from parameter/options 5574 * objects. 5575 * 5576 * @param args The object we are extracting values from 5577 * @param name The name of the property we are getting. 5578 * @param defaultValue An optional value to return if the property is missing 5579 * from the object. If this is not specified and the property is missing, an 5580 * error will be thrown. 5581 */ 5582 function getArg(aArgs, aName, aDefaultValue) { 5583 if (aName in aArgs) { 5584 return aArgs[aName]; 5585 } else if (arguments.length === 3) { 5586 return aDefaultValue; 5587 } else { 5588 throw new Error('"' + aName + '" is a required argument.'); 5589 } 5590 } 5591 exports.getArg = getArg; 5592 5593 var urlRegexp = /^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.]*)(?::(\d+))?(\S*)$/; 5594 var dataUrlRegexp = /^data:.+\,.+$/; 5595 5596 function urlParse(aUrl) { 5597 var match = aUrl.match(urlRegexp); 5598 if (!match) { 5599 return null; 5600 } 5601 return { 5602 scheme: match[1], 5603 auth: match[2], 5604 host: match[3], 5605 port: match[4], 5606 path: match[5] 5607 }; 5608 } 5609 exports.urlParse = urlParse; 5610 5611 function urlGenerate(aParsedUrl) { 5612 var url = ''; 5613 if (aParsedUrl.scheme) { 5614 url += aParsedUrl.scheme + ':'; 5615 } 5616 url += '//'; 5617 if (aParsedUrl.auth) { 5618 url += aParsedUrl.auth + '@'; 5619 } 5620 if (aParsedUrl.host) { 5621 url += aParsedUrl.host; 5622 } 5623 if (aParsedUrl.port) { 5624 url += ":" + aParsedUrl.port; 5625 } 5626 if (aParsedUrl.path) { 5627 url += aParsedUrl.path; 5628 } 5629 return url; 5630 } 5631 exports.urlGenerate = urlGenerate; 5632 5633 /** 5634 * Normalizes a path, or the path portion of a URL: 5635 * 5636 * - Replaces consecutive slashes with one slash. 5637 * - Removes unnecessary '.' parts. 5638 * - Removes unnecessary '<dir>/..' parts. 5639 * 5640 * Based on code in the Node.js 'path' core module. 5641 * 5642 * @param aPath The path or url to normalize. 5643 */ 5644 function normalize(aPath) { 5645 var path = aPath; 5646 var url = urlParse(aPath); 5647 if (url) { 5648 if (!url.path) { 5649 return aPath; 5650 } 5651 path = url.path; 5652 } 5653 var isAbsolute = exports.isAbsolute(path); 5654 5655 var parts = path.split(/\/+/); 5656 for (var part, up = 0, i = parts.length - 1; i >= 0; i--) { 5657 part = parts[i]; 5658 if (part === '.') { 5659 parts.splice(i, 1); 5660 } else if (part === '..') { 5661 up++; 5662 } else if (up > 0) { 5663 if (part === '') { 5664 // The first part is blank if the path is absolute. Trying to go 5665 // above the root is a no-op. Therefore we can remove all '..' parts 5666 // directly after the root. 5667 parts.splice(i + 1, up); 5668 up = 0; 5669 } else { 5670 parts.splice(i, 2); 5671 up--; 5672 } 5673 } 5674 } 5675 path = parts.join('/'); 5676 5677 if (path === '') { 5678 path = isAbsolute ? '/' : '.'; 5679 } 5680 5681 if (url) { 5682 url.path = path; 5683 return urlGenerate(url); 5684 } 5685 return path; 5686 } 5687 exports.normalize = normalize; 5688 5689 /** 5690 * Joins two paths/URLs. 5691 * 5692 * @param aRoot The root path or URL. 5693 * @param aPath The path or URL to be joined with the root. 5694 * 5695 * - If aPath is a URL or a data URI, aPath is returned, unless aPath is a 5696 * scheme-relative URL: Then the scheme of aRoot, if any, is prepended 5697 * first. 5698 * - Otherwise aPath is a path. If aRoot is a URL, then its path portion 5699 * is updated with the result and aRoot is returned. Otherwise the result 5700 * is returned. 5701 * - If aPath is absolute, the result is aPath. 5702 * - Otherwise the two paths are joined with a slash. 5703 * - Joining for example 'http://' and 'www.example.com' is also supported. 5704 */ 5705 function join(aRoot, aPath) { 5706 if (aRoot === "") { 5707 aRoot = "."; 5708 } 5709 if (aPath === "") { 5710 aPath = "."; 5711 } 5712 var aPathUrl = urlParse(aPath); 5713 var aRootUrl = urlParse(aRoot); 5714 if (aRootUrl) { 5715 aRoot = aRootUrl.path || '/'; 5716 } 5717 5718 // `join(foo, '//www.example.org')` 5719 if (aPathUrl && !aPathUrl.scheme) { 5720 if (aRootUrl) { 5721 aPathUrl.scheme = aRootUrl.scheme; 5722 } 5723 return urlGenerate(aPathUrl); 5724 } 5725 5726 if (aPathUrl || aPath.match(dataUrlRegexp)) { 5727 return aPath; 5728 } 5729 5730 // `join('http://', 'www.example.com')` 5731 if (aRootUrl && !aRootUrl.host && !aRootUrl.path) { 5732 aRootUrl.host = aPath; 5733 return urlGenerate(aRootUrl); 5734 } 5735 5736 var joined = aPath.charAt(0) === '/' ? aPath : normalize(aRoot.replace(/\/+$/, '') + '/' + aPath); 5737 5738 if (aRootUrl) { 5739 aRootUrl.path = joined; 5740 return urlGenerate(aRootUrl); 5741 } 5742 return joined; 5743 } 5744 exports.join = join; 5745 5746 exports.isAbsolute = function (aPath) { 5747 return aPath.charAt(0) === '/' || !!aPath.match(urlRegexp); 5748 }; 5749 5750 /** 5751 * Make a path relative to a URL or another path. 5752 * 5753 * @param aRoot The root path or URL. 5754 * @param aPath The path or URL to be made relative to aRoot. 5755 */ 5756 function relative(aRoot, aPath) { 5757 if (aRoot === "") { 5758 aRoot = "."; 5759 } 5760 5761 aRoot = aRoot.replace(/\/$/, ''); 5762 5763 // It is possible for the path to be above the root. In this case, simply 5764 // checking whether the root is a prefix of the path won't work. Instead, we 5765 // need to remove components from the root one by one, until either we find 5766 // a prefix that fits, or we run out of components to remove. 5767 var level = 0; 5768 while (aPath.indexOf(aRoot + '/') !== 0) { 5769 var index = aRoot.lastIndexOf("/"); 5770 if (index < 0) { 5771 return aPath; 5772 } 5773 5774 // If the only part of the root that is left is the scheme (i.e. http://, 5775 // file:///, etc.), one or more slashes (/), or simply nothing at all, we 5776 // have exhausted all components, so the path is not relative to the root. 5777 aRoot = aRoot.slice(0, index); 5778 if (aRoot.match(/^([^\/]+:\/)?\/*$/)) { 5779 return aPath; 5780 } 5781 5782 ++level; 5783 } 5784 5785 // Make sure we add a "../" for each component we removed from the root. 5786 return Array(level + 1).join("../") + aPath.substr(aRoot.length + 1); 5787 } 5788 exports.relative = relative; 5789 5790 var supportsNullProto = function () { 5791 var obj = Object.create(null); 5792 return !('__proto__' in obj); 5793 }(); 5794 5795 function identity(s) { 5796 return s; 5797 } 5798 5799 /** 5800 * Because behavior goes wacky when you set `__proto__` on objects, we 5801 * have to prefix all the strings in our set with an arbitrary character. 5802 * 5803 * See https://github.com/mozilla/source-map/pull/31 and 5804 * https://github.com/mozilla/source-map/issues/30 5805 * 5806 * @param String aStr 5807 */ 5808 function toSetString(aStr) { 5809 if (isProtoString(aStr)) { 5810 return '$' + aStr; 5811 } 5812 5813 return aStr; 5814 } 5815 exports.toSetString = supportsNullProto ? identity : toSetString; 5816 5817 function fromSetString(aStr) { 5818 if (isProtoString(aStr)) { 5819 return aStr.slice(1); 5820 } 5821 5822 return aStr; 5823 } 5824 exports.fromSetString = supportsNullProto ? identity : fromSetString; 5825 5826 function isProtoString(s) { 5827 if (!s) { 5828 return false; 5829 } 5830 5831 var length = s.length; 5832 5833 if (length < 9 /* "__proto__".length */) { 5834 return false; 5835 } 5836 5837 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 /* '_' */) { 5838 return false; 5839 } 5840 5841 for (var i = length - 10; i >= 0; i--) { 5842 if (s.charCodeAt(i) !== 36 /* '$' */) { 5843 return false; 5844 } 5845 } 5846 5847 return true; 5848 } 5849 5850 /** 5851 * Comparator between two mappings where the original positions are compared. 5852 * 5853 * Optionally pass in `true` as `onlyCompareGenerated` to consider two 5854 * mappings with the same original source/line/column, but different generated 5855 * line and column the same. Useful when searching for a mapping with a 5856 * stubbed out mapping. 5857 */ 5858 function compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) { 5859 var cmp = mappingA.source - mappingB.source; 5860 if (cmp !== 0) { 5861 return cmp; 5862 } 5863 5864 cmp = mappingA.originalLine - mappingB.originalLine; 5865 if (cmp !== 0) { 5866 return cmp; 5867 } 5868 5869 cmp = mappingA.originalColumn - mappingB.originalColumn; 5870 if (cmp !== 0 || onlyCompareOriginal) { 5871 return cmp; 5872 } 5873 5874 cmp = mappingA.generatedColumn - mappingB.generatedColumn; 5875 if (cmp !== 0) { 5876 return cmp; 5877 } 5878 5879 cmp = mappingA.generatedLine - mappingB.generatedLine; 5880 if (cmp !== 0) { 5881 return cmp; 5882 } 5883 5884 return mappingA.name - mappingB.name; 5885 } 5886 exports.compareByOriginalPositions = compareByOriginalPositions; 5887 5888 /** 5889 * Comparator between two mappings with deflated source and name indices where 5890 * the generated positions are compared. 5891 * 5892 * Optionally pass in `true` as `onlyCompareGenerated` to consider two 5893 * mappings with the same generated line and column, but different 5894 * source/name/original line and column the same. Useful when searching for a 5895 * mapping with a stubbed out mapping. 5896 */ 5897 function compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) { 5898 var cmp = mappingA.generatedLine - mappingB.generatedLine; 5899 if (cmp !== 0) { 5900 return cmp; 5901 } 5902 5903 cmp = mappingA.generatedColumn - mappingB.generatedColumn; 5904 if (cmp !== 0 || onlyCompareGenerated) { 5905 return cmp; 5906 } 5907 5908 cmp = mappingA.source - mappingB.source; 5909 if (cmp !== 0) { 5910 return cmp; 5911 } 5912 5913 cmp = mappingA.originalLine - mappingB.originalLine; 5914 if (cmp !== 0) { 5915 return cmp; 5916 } 5917 5918 cmp = mappingA.originalColumn - mappingB.originalColumn; 5919 if (cmp !== 0) { 5920 return cmp; 5921 } 5922 5923 return mappingA.name - mappingB.name; 5924 } 5925 exports.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated; 5926 5927 function strcmp(aStr1, aStr2) {
5928 if (aStr1 === aStr2) { 5929 return 0; 5930 } 5931 5932 if (aStr1 > aStr2) { 5933 return 1; 5934 } 5935 5936 return -1; 5937 } 5938 5939 /** 5940 * Comparator between two mappings with inflated source and name strings where 5941 * the generated positions are compared. 5942 */ 5943 function compareByGeneratedPositionsInflated(mappingA, mappingB) { 5944 var cmp = mappingA.generatedLine - mappingB.generatedLine; 5945 if (cmp !== 0) { 5946 return cmp; 5947 } 5948 5949 cmp = mappingA.generatedColumn - mappingB.generatedColumn; 5950 if (cmp !== 0) { 5951 return cmp; 5952 } 5953 5954 cmp = strcmp(mappingA.source, mappingB.source); 5955 if (cmp !== 0) { 5956 return cmp; 5957 } 5958 5959 cmp = mappingA.originalLine - mappingB.originalLine; 5960 if (cmp !== 0) { 5961 return cmp; 5962 } 5963 5964 cmp = mappingA.originalColumn - mappingB.originalColumn; 5965 if (cmp !== 0) { 5966 return cmp; 5967 } 5968 5969 return strcmp(mappingA.name, mappingB.name); 5970 } 5971 exports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated; 5972 5973/***/ }, 5974/* 62 */ 5975/***/ function(module, exports, __webpack_require__) { 5976 5977 /* WEBPACK VAR INJECTION */(function(global) {'use strict'; 5978 5979 // compare and isBuffer taken from https://github.com/feross/buffer/blob/680e9e5e488f22aac27599a57dc844a6315928dd/index.js 5980 // original notice: 5981 5982 /*! 5983 * The buffer module from node.js, for the browser. 5984 * 5985 * @author Feross Aboukhadijeh <[email protected]> <http://feross.org> 5986 * @license MIT 5987 */ 5988 5989 var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; 5990 5991 function compare(a, b) { 5992 if (a === b) { 5993 return 0; 5994 } 5995 5996 var x = a.length; 5997 var y = b.length; 5998 5999 for (var i = 0, len = Math.min(x, y); i < len; ++i) { 6000 if (a[i] !== b[i]) { 6001 x = a[i]; 6002 y = b[i]; 6003 break; 6004 } 6005 } 6006 6007 if (x < y) { 6008 return -1; 6009 } 6010 if (y < x) { 6011 return 1; 6012 } 6013 return 0; 6014 } 6015 function isBuffer(b) { 6016 if (global.Buffer && typeof global.Buffer.isBuffer === 'function') { 6017 return global.Buffer.isBuffer(b); 6018 } 6019 return !!(b != null && b._isBuffer); 6020 } 6021 6022 // based on node assert, original notice: 6023 6024 // http://wiki.commonjs.org/wiki/Unit_Testing/1.0 6025 // 6026 // THIS IS NOT TESTED NOR LIKELY TO WORK OUTSIDE V8! 6027 // 6028 // Originally from narwhal.js (http://narwhaljs.org) 6029 // Copyright (c) 2009 Thomas Robinson <280north.com> 6030 // 6031 // Permission is hereby granted, free of charge, to any person obtaining a copy 6032 // of this software and associated documentation files (the 'Software'), to 6033 // deal in the Software without restriction, including without limitation the 6034 // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 6035 // sell copies of the Software, and to permit persons to whom the Software is 6036 // furnished to do so, subject to the following conditions: 6037 // 6038 // The above copyright notice and this permission notice shall be included in 6039 // all copies or substantial portions of the Software. 6040 // 6041 // THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 6042 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 6043 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 6044 // AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 6045 // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 6046 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 6047 6048 var util = __webpack_require__(114); 6049 var hasOwn = Object.prototype.hasOwnProperty; 6050 var pSlice = Array.prototype.slice; 6051 var functionsHaveNames = function () { 6052 return function foo() {}.name === 'foo'; 6053 }(); 6054 function pToString(obj) { 6055 return Object.prototype.toString.call(obj); 6056 } 6057 function isView(arrbuf) { 6058 if (isBuffer(arrbuf)) { 6059 return false; 6060 } 6061 if (typeof global.ArrayBuffer !== 'function') { 6062 return false; 6063 } 6064 if (typeof ArrayBuffer.isView === 'function') { 6065 return ArrayBuffer.isView(arrbuf); 6066 } 6067 if (!arrbuf) { 6068 return false;
vendor: 8,293 bytes, lines 6069-6289
6069 } 6070 if (arrbuf instanceof DataView) { 6071 return true; 6072 } 6073 if (arrbuf.buffer && arrbuf.buffer instanceof ArrayBuffer) { 6074 return true; 6075 } 6076 return false; 6077 } 6078 // 1. The assert module provides functions that throw 6079 // AssertionError's when particular conditions are not met. The 6080 // assert module must conform to the following interface. 6081 6082 var assert = module.exports = ok; 6083 6084 // 2. The AssertionError is defined in assert. 6085 // new assert.AssertionError({ message: message, 6086 // actual: actual, 6087 // expected: expected }) 6088 6089 var regex = /\s*function\s+([^\(\s]*)\s*/; 6090 // based on https://github.com/ljharb/function.prototype.name/blob/adeeeec8bfcc6068b187d7d9fb3d5bb1d3a30899/implementation.js 6091 function getName(func) { 6092 if (!util.isFunction(func)) { 6093 return; 6094 } 6095 if (functionsHaveNames) { 6096 return func.name; 6097 } 6098 var str = func.toString(); 6099 var match = str.match(regex); 6100 return match && match[1]; 6101 } 6102 assert.AssertionError = function AssertionError(options) { 6103 this.name = 'AssertionError'; 6104 this.actual = options.actual; 6105 this.expected = options.expected; 6106 this.operator = options.operator; 6107 if (options.message) { 6108 this.message = options.message; 6109 this.generatedMessage = false; 6110 } else { 6111 this.message = getMessage(this); 6112 this.generatedMessage = true; 6113 } 6114 var stackStartFunction = options.stackStartFunction || fail; 6115 if (Error.captureStackTrace) { 6116 Error.captureStackTrace(this, stackStartFunction); 6117 } else { 6118 // non v8 browsers so we can have a stacktrace 6119 var err = new Error(); 6120 if (err.stack) { 6121 var out = err.stack; 6122 6123 // try to strip useless frames 6124 var fn_name = getName(stackStartFunction); 6125 var idx = out.indexOf('\n' + fn_name); 6126 if (idx >= 0) { 6127 // once we have located the function frame 6128 // we need to strip out everything before it (and its line) 6129 var next_line = out.indexOf('\n', idx + 1); 6130 out = out.substring(next_line + 1); 6131 } 6132 6133 this.stack = out; 6134 } 6135 } 6136 }; 6137 6138 // assert.AssertionError instanceof Error 6139 util.inherits(assert.AssertionError, Error); 6140 6141 function truncate(s, n) { 6142 if (typeof s === 'string') { 6143 return s.length < n ? s : s.slice(0, n); 6144 } else { 6145 return s; 6146 } 6147 } 6148 function inspect(something) { 6149 if (functionsHaveNames || !util.isFunction(something)) { 6150 return util.inspect(something); 6151 } 6152 var rawname = getName(something); 6153 var name = rawname ? ': ' + rawname : ''; 6154 return '[Function' + name + ']'; 6155 } 6156 function getMessage(self) { 6157 return truncate(inspect(self.actual), 128) + ' ' + self.operator + ' ' + truncate(inspect(self.expected), 128); 6158 } 6159 6160 // At present only the three keys mentioned above are used and 6161 // understood by the spec. Implementations or sub modules can pass 6162 // other keys to the AssertionError's constructor - they will be 6163 // ignored. 6164 6165 // 3. All of the following functions must throw an AssertionError 6166 // when a corresponding condition is not met, with a message that 6167 // may be undefined if not provided. All assertion methods provide 6168 // both the actual and expected values to the assertion error for 6169 // display purposes. 6170 6171 function fail(actual, expected, message, operator, stackStartFunction) { 6172 throw new assert.AssertionError({ 6173 message: message, 6174 actual: actual, 6175 expected: expected, 6176 operator: operator, 6177 stackStartFunction: stackStartFunction 6178 }); 6179 } 6180 6181 // EXTENSION! allows for well behaved errors defined elsewhere. 6182 assert.fail = fail; 6183 6184 // 4. Pure assertion tests whether a value is truthy, as determined 6185 // by !!guard. 6186 // assert.ok(guard, message_opt); 6187 // This statement is equivalent to assert.equal(true, !!guard, 6188 // message_opt);. To test strictly for the value true, use 6189 // assert.strictEqual(true, guard, message_opt);. 6190 6191 function ok(value, message) { 6192 if (!value) fail(value, true, message, '==', assert.ok); 6193 } 6194 assert.ok = ok; 6195 6196 // 5. The equality assertion tests shallow, coercive equality with 6197 // ==. 6198 // assert.equal(actual, expected, message_opt); 6199 6200 assert.equal = function equal(actual, expected, message) { 6201 if (actual != expected) fail(actual, expected, message, '==', assert.equal); 6202 }; 6203 6204 // 6. The non-equality assertion tests for whether two objects are not equal 6205 // with != assert.notEqual(actual, expected, message_opt); 6206 6207 assert.notEqual = function notEqual(actual, expected, message) { 6208 if (actual == expected) { 6209 fail(actual, expected, message, '!=', assert.notEqual); 6210 } 6211 }; 6212 6213 // 7. The equivalence assertion tests a deep equality relation. 6214 // assert.deepEqual(actual, expected, message_opt); 6215 6216 assert.deepEqual = function deepEqual(actual, expected, message) { 6217 if (!_deepEqual(actual, expected, false)) { 6218 fail(actual, expected, message, 'deepEqual', assert.deepEqual); 6219 } 6220 }; 6221 6222 assert.deepStrictEqual = function deepStrictEqual(actual, expected, message) { 6223 if (!_deepEqual(actual, expected, true)) { 6224 fail(actual, expected, message, 'deepStrictEqual', assert.deepStrictEqual); 6225 } 6226 }; 6227 6228 function _deepEqual(actual, expected, strict, memos) { 6229 // 7.1. All identical values are equivalent, as determined by ===. 6230 if (actual === expected) { 6231 return true; 6232 } else if (isBuffer(actual) && isBuffer(expected)) { 6233 return compare(actual, expected) === 0; 6234 6235 // 7.2. If the expected value is a Date object, the actual value is 6236 // equivalent if it is also a Date object that refers to the same time. 6237 } else if (util.isDate(actual) && util.isDate(expected)) { 6238 return actual.getTime() === expected.getTime(); 6239 6240 // 7.3 If the expected value is a RegExp object, the actual value is 6241 // equivalent if it is also a RegExp object with the same source and 6242 // properties (`global`, `multiline`, `lastIndex`, `ignoreCase`). 6243 } else if (util.isRegExp(actual) && util.isRegExp(expected)) { 6244 return actual.source === expected.source && actual.global === expected.global && actual.multiline === expected.multiline && actual.lastIndex === expected.lastIndex && actual.ignoreCase === expected.ignoreCase; 6245 6246 // 7.4. Other pairs that do not both pass typeof value == 'object', 6247 // equivalence is determined by ==. 6248 } else if ((actual === null || (typeof actual === 'undefined' ? 'undefined' : _typeof(actual)) !== 'object') && (expected === null || (typeof expected === 'undefined' ? 'undefined' : _typeof(expected)) !== 'object')) { 6249 return strict ? actual === expected : actual == expected; 6250 6251 // If both values are instances of typed arrays, wrap their underlying 6252 // ArrayBuffers in a Buffer each to increase performance 6253 // This optimization requires the arrays to have the same type as checked by 6254 // Object.prototype.toString (aka pToString). Never perform binary 6255 // comparisons for Float*Arrays, though, since e.g. +0 === -0 but their 6256 // bit patterns are not identical. 6257 } else if (isView(actual) && isView(expected) && pToString(actual) === pToString(expected) && !(actual instanceof Float32Array || actual instanceof Float64Array)) { 6258 return compare(new Uint8Array(actual.buffer), new Uint8Array(expected.buffer)) === 0; 6259 6260 // 7.5 For all other Object pairs, including Array objects, equivalence is 6261 // determined by having the same number of owned properties (as verified 6262 // with Object.prototype.hasOwnProperty.call), the same set of keys 6263 // (although not necessarily the same order), equivalent values for every 6264 // corresponding key, and an identical 'prototype' property. Note: this 6265 // accounts for both named and indexed properties on Arrays. 6266 } else if (isBuffer(actual) !== isBuffer(expected)) { 6267 return false; 6268 } else { 6269 memos = memos || { actual: [], expected: [] }; 6270 6271 var actualIndex = memos.actual.indexOf(actual); 6272 if (actualIndex !== -1) { 6273 if (actualIndex === memos.expected.indexOf(expected)) { 6274 return true; 6275 } 6276 } 6277 6278 memos.actual.push(actual); 6279 memos.expected.push(expected); 6280 6281 return objEquiv(actual, expected, strict, memos); 6282 } 6283 } 6284 6285 function isArguments(object) { 6286 return Object.prototype.toString.call(object) == '[object Arguments]'; 6287 } 6288 6289 function objEquiv(a, b, strict, actualVisitedObjects) {
6290 if (a === null || a === undefined || b === null || b === undefined) return false; 6291 // if one is a primitive, the other must be same 6292 if (util.isPrimitive(a) || util.isPrimitive(b)) return a === b; 6293 if (strict && Object.getPrototypeOf(a) !== Object.getPrototypeOf(b)) return false; 6294 var aIsArgs = isArguments(a); 6295 var bIsArgs = isArguments(b); 6296 if (aIsArgs && !bIsArgs || !aIsArgs && bIsArgs) return false; 6297 if (aIsArgs) { 6298 a = pSlice.call(a); 6299 b = pSlice.call(b); 6300 return _deepEqual(a, b, strict); 6301 } 6302 var ka = objectKeys(a); 6303 var kb = objectKeys(b); 6304 var key, i; 6305 // having the same number of owned properties (keys incorporates 6306 // hasOwnProperty) 6307 if (ka.length !== kb.length) return false; 6308 //the same set of keys (although not necessarily the same order), 6309 ka.sort(); 6310 kb.sort(); 6311 //~~~cheap key test 6312 for (i = ka.length - 1; i >= 0; i--) { 6313 if (ka[i] !== kb[i]) return false; 6314 } 6315 //equivalent values for every corresponding key, and 6316 //~~~possibly expensive deep test 6317 for (i = ka.length - 1; i >= 0; i--) { 6318 key = ka[i]; 6319 if (!_deepEqual(a[key], b[key], strict, actualVisitedObjects)) return false; 6320 } 6321 return true; 6322 } 6323 6324 // 8. The non-equivalence assertion tests for any deep inequality. 6325 // assert.notDeepEqual(actual, expected, message_opt); 6326 6327 assert.notDeepEqual = function notDeepEqual(actual, expected, message) { 6328 if (_deepEqual(actual, expected, false)) { 6329 fail(actual, expected, message, 'notDeepEqual', assert.notDeepEqual); 6330 } 6331 }; 6332 6333 assert.notDeepStrictEqual = notDeepStrictEqual; 6334 function notDeepStrictEqual(actual, expected, message) { 6335 if (_deepEqual(actual, expected, true)) { 6336 fail(actual, expected, message, 'notDeepStrictEqual', notDeepStrictEqual); 6337 } 6338 } 6339 6340 // 9. The strict equality assertion tests strict equality, as determined by ===. 6341 // assert.strictEqual(actual, expected, message_opt); 6342 6343 assert.strictEqual = function strictEqual(actual, expected, message) { 6344 if (actual !== expected) { 6345 fail(actual, expected, message, '===', assert.strictEqual); 6346 } 6347 }; 6348 6349 // 10. The strict non-equality assertion tests for strict inequality, as 6350 // determined by !==. assert.notStrictEqual(actual, expected, message_opt); 6351 6352 assert.notStrictEqual = function notStrictEqual(actual, expected, message) { 6353 if (actual === expected) { 6354 fail(actual, expected, message, '!==', assert.notStrictEqual); 6355 } 6356 }; 6357 6358 function expectedException(actual, expected) { 6359 if (!actual || !expected) { 6360 return false; 6361 } 6362 6363 if (Object.prototype.toString.call(expected) == '[object RegExp]') { 6364 return expected.test(actual); 6365 } 6366 6367 try { 6368 if (actual instanceof expected) { 6369 return true; 6370 } 6371 } catch (e) { 6372 // Ignore. The instanceof check doesn't work for arrow functions. 6373 } 6374 6375 if (Error.isPrototypeOf(expected)) { 6376 return false; 6377 } 6378 6379 return expected.call({}, actual) === true; 6380 } 6381 6382 function _tryBlock(block) { 6383 var error; 6384 try { 6385 block(); 6386 } catch (e) { 6387 error = e; 6388 } 6389 return error; 6390 } 6391 6392 function _throws(shouldThrow, block, expected, message) { 6393 var actual; 6394 6395 if (typeof block !== 'function') { 6396 throw new TypeError('"block" argument must be a function'); 6397 } 6398 6399 if (typeof expected === 'string') { 6400 message = expected; 6401 expected = null; 6402 } 6403 6404 actual = _tryBlock(block); 6405 6406 message = (expected && expected.name ? ' (' + expected.name + ').' : '.') + (message ? ' ' + message : '.'); 6407 6408 if (shouldThrow && !actual) { 6409 fail(actual, expected, 'Missing expected exception' + message); 6410 } 6411 6412 var userProvidedMessage = typeof message === 'string'; 6413 var isUnwantedException = !shouldThrow && util.isError(actual); 6414 var isUnexpectedException = !shouldThrow && actual && !expected; 6415 6416 if (isUnwantedException && userProvidedMessage && expectedException(actual, expected) || isUnexpectedException) { 6417 fail(actual, expected, 'Got unwanted exception' + message); 6418 } 6419 6420 if (shouldThrow && actual && expected && !expectedException(actual, expected) || !shouldThrow && actual) { 6421 throw actual; 6422 } 6423 } 6424 6425 // 11. Expected to throw an error: 6426 // assert.throws(block, Error_opt, message_opt); 6427 6428 assert.throws = function (block, /*optional*/error, /*optional*/message) { 6429 _throws(true, block, error, message); 6430 }; 6431 6432 // EXTENSION! This is annoying to write outside this module. 6433 assert.doesNotThrow = function (block, /*optional*/error, /*optional*/message) { 6434 _throws(false, block, error, message); 6435 }; 6436 6437 assert.ifError = function (err) { 6438 if (err) throw err; 6439 }; 6440 6441 var objectKeys = Object.keys || function (obj) { 6442 var keys = []; 6443 for (var key in obj) { 6444 if (hasOwn.call(obj, key)) keys.push(key); 6445 } 6446 return keys; 6447 }; 6448 /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()))) 6449 6450/***/ }, 6451/* 63 */ 6452/***/ function(module, exports, __webpack_require__) { 6453 6454 "use strict"; 6455 6456 exports.__esModule = true; 6457 6458 var _getIterator2 = __webpack_require__(2); 6459 6460 var _getIterator3 = _interopRequireDefault(_getIterator2); 6461 6462 var _classCallCheck2 = __webpack_require__(3); 6463 6464 var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); 6465 6466 var _possibleConstructorReturn2 = __webpack_require__(42); 6467 6468 var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); 6469 6470 var _inherits2 = __webpack_require__(41); 6471 6472 var _inherits3 = _interopRequireDefault(_inherits2); 6473 6474 var _optionManager = __webpack_require__(33); 6475 6476 var _optionManager2 = _interopRequireDefault(_optionManager); 6477 6478 var _babelMessages = __webpack_require__(18); 6479 6480 var messages = _interopRequireWildcard(_babelMessages); 6481 6482 var _store = __webpack_require__(116); 6483 6484 var _store2 = _interopRequireDefault(_store); 6485 6486 var _babelTraverse = __webpack_require__(8); 6487 6488 var _babelTraverse2 = _interopRequireDefault(_babelTraverse); 6489 6490 var _assign = __webpack_require__(170); 6491 6492 var _assign2 = _interopRequireDefault(_assign); 6493 6494 var _clone = __webpack_require__(107); 6495 6496 var _clone2 = _interopRequireDefault(_clone); 6497 6498 function _interopRequireWildcard(obj) { 6499 if (obj && obj.__esModule) { 6500 return obj; 6501 } else { 6502 var newObj = {};if (obj != null) { 6503 for (var key in obj) { 6504 if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; 6505 } 6506 }newObj.default = obj;return newObj; 6507 } 6508 } 6509 6510 function _interopRequireDefault(obj) { 6511 return obj && obj.__esModule ? obj : { default: obj }; 6512 } 6513
6514 var GLOBAL_VISITOR_PROPS = ["enter", "exit"]; 6515 6516 var Plugin = function (_Store) { 6517 (0, _inherits3.default)(Plugin, _Store); 6518 6519 function Plugin(plugin, key) { 6520 (0, _classCallCheck3.default)(this, Plugin); 6521 6522 var _this = (0, _possibleConstructorReturn3.default)(this, _Store.call(this)); 6523 6524 _this.initialized = false; 6525 _this.raw = (0, _assign2.default)({}, plugin); 6526 _this.key = _this.take("name") || key; 6527 6528 _this.manipulateOptions = _this.take("manipulateOptions"); 6529 _this.post = _this.take("post"); 6530 _this.pre = _this.take("pre"); 6531 _this.visitor = _this.normaliseVisitor((0, _clone2.default)(_this.take("visitor")) || {}); 6532 return _this; 6533 } 6534 6535 Plugin.prototype.take = function take(key) { 6536 var val = this.raw[key]; 6537 delete this.raw[key]; 6538 return val; 6539 }; 6540 6541 Plugin.prototype.chain = function chain(target, key) { 6542 if (!target[key]) return this[key]; 6543 if (!this[key]) return target[key]; 6544 6545 var fns = [target[key], this[key]]; 6546 6547 return function () { 6548 var val = void 0; 6549 6550 for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { 6551 args[_key] = arguments[_key]; 6552 } 6553 6554 for (var _iterator = fns, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) { 6555 var _ref; 6556 6557 if (_isArray) { 6558 if (_i >= _iterator.length) break; 6559 _ref = _iterator[_i++]; 6560 } else { 6561 _i = _iterator.next(); 6562 if (_i.done) break; 6563 _ref = _i.value; 6564 } 6565 6566 var fn = _ref; 6567 6568 if (fn) { 6569 var ret = fn.apply(this, args); 6570 if (ret != null) val = ret; 6571 } 6572 } 6573 return val; 6574 }; 6575 }; 6576 6577 Plugin.prototype.maybeInherit = function maybeInherit(loc) { 6578 var inherits = this.take("inherits"); 6579 if (!inherits) return; 6580 6581 inherits = _optionManager2.default.normalisePlugin(inherits, loc, "inherits"); 6582 6583 this.manipulateOptions = this.chain(inherits, "manipulateOptions"); 6584 this.post = this.chain(inherits, "post"); 6585 this.pre = this.chain(inherits, "pre"); 6586 this.visitor = _babelTraverse2.default.visitors.merge([inherits.visitor, this.visitor]); 6587 }; 6588 6589 Plugin.prototype.init = function init(loc, i) { 6590 if (this.initialized) return; 6591 this.initialized = true; 6592 6593 this.maybeInherit(loc); 6594 6595 for (var key in this.raw) { 6596 throw new Error(messages.get("pluginInvalidProperty", loc, i, key)); 6597 } 6598 }; 6599 6600 Plugin.prototype.normaliseVisitor = function normaliseVisitor(visitor) { 6601 for (var _iterator2 = GLOBAL_VISITOR_PROPS, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) { 6602 var _ref2; 6603 6604 if (_isArray2) { 6605 if (_i2 >= _iterator2.length) break; 6606 _ref2 = _iterator2[_i2++]; 6607 } else { 6608 _i2 = _iterator2.next(); 6609 if (_i2.done) break; 6610 _ref2 = _i2.value; 6611 } 6612 6613 var key = _ref2; 6614 6615 if (visitor[key]) { 6616 throw new Error("Plugins aren't allowed to specify catch-all enter/exit handlers. " + "Please target individual nodes."); 6617 } 6618 } 6619 6620 _babelTraverse2.default.explode(visitor); 6621 return visitor; 6622 }; 6623 6624 return Plugin; 6625 }(_store2.default); 6626 6627 exports.default = Plugin; 6628 module.exports = exports["default"]; 6629 6630/***/ }, 6631/* 64 */ 6632/***/ function(module, exports, __webpack_require__) { 6633 6634 "use strict"; 6635 6636 exports.__esModule = true; 6637 6638 var _getIterator2 = __webpack_require__(2); 6639 6640 var _getIterator3 = _interopRequireDefault(_getIterator2); 6641 6642 exports.default = function (_ref) { 6643 var messages = _ref.messages; 6644 6645 return { 6646 visitor: { 6647 Scope: function Scope(_ref2) { 6648 var scope = _ref2.scope; 6649 6650 for (var name in scope.bindings) { 6651 var binding = scope.bindings[name]; 6652 if (binding.kind !== "const" && binding.kind !== "module") continue; 6653 6654 for (var _iterator = binding.constantViolations, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) { 6655 var _ref3; 6656 6657 if (_isArray) { 6658 if (_i >= _iterator.length) break; 6659 _ref3 = _iterator[_i++]; 6660 } else { 6661 _i = _iterator.next(); 6662 if (_i.done) break; 6663 _ref3 = _i.value; 6664 } 6665 6666 var violation = _ref3; 6667 6668 throw violation.buildCodeFrameError(messages.get("readOnly", name)); 6669 } 6670 } 6671 } 6672 } 6673 }; 6674 }; 6675 6676 function _interopRequireDefault(obj) { 6677 return obj && obj.__esModule ? obj : { default: obj }; 6678 } 6679 6680 module.exports = exports["default"]; 6681 6682/***/ }, 6683/* 65 */
6684/***/ function(module, exports) { 6685 6686 "use strict"; 6687 6688 exports.__esModule = true; 6689 6690 exports.default = function () { 6691 return { 6692 manipulateOptions: function manipulateOptions(opts, parserOpts) { 6693 parserOpts.plugins.push("asyncFunctions"); 6694 } 6695 }; 6696 }; 6697 6698 module.exports = exports["default"]; 6699 6700/***/ }, 6701/* 66 */ 6702/***/ function(module, exports) { 6703 6704 "use strict"; 6705 6706 exports.__esModule = true; 6707 6708 exports.default = function (_ref) { 6709 var t = _ref.types; 6710 6711 return { 6712 visitor: { 6713 ArrowFunctionExpression: function ArrowFunctionExpression(path, state) { 6714 if (state.opts.spec) { 6715 var node = path.node; 6716 6717 if (node.shadow) return; 6718 6719 node.shadow = { this: false }; 6720 node.type = "FunctionExpression"; 6721 6722 var boundThis = t.thisExpression(); 6723 boundThis._forceShadow = path; 6724 6725 path.ensureBlock(); 6726 path.get("body").unshiftContainer("body", t.expressionStatement(t.callExpression(state.addHelper("newArrowCheck"), [t.thisExpression(), boundThis]))); 6727 6728 path.replaceWith(t.callExpression(t.memberExpression(node, t.identifier("bind")), [t.thisExpression()])); 6729 } else { 6730 path.arrowFunctionToShadowed(); 6731 } 6732 } 6733 } 6734 }; 6735 }; 6736 6737 module.exports = exports["default"]; 6738 6739/***/ }, 6740/* 67 */ 6741/***/ function(module, exports, __webpack_require__) { 6742 6743 "use strict"; 6744 6745 exports.__esModule = true; 6746 6747 var _getIterator2 = __webpack_require__(2); 6748 6749 var _getIterator3 = _interopRequireDefault(_getIterator2); 6750 6751 exports.default = function (_ref) { 6752 var t = _ref.types; 6753 6754 function statementList(key, path) { 6755 var paths = path.get(key); 6756 6757 for (var _iterator = paths, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) { 6758 var _ref2; 6759 6760 if (_isArray) { 6761 if (_i >= _iterator.length) break; 6762 _ref2 = _iterator[_i++]; 6763 } else { 6764 _i = _iterator.next(); 6765 if (_i.done) break; 6766 _ref2 = _i.value; 6767 } 6768 6769 var _path = _ref2; 6770 6771 var func = _path.node; 6772 if (!_path.isFunctionDeclaration()) continue; 6773 6774 var declar = t.variableDeclaration("let", [t.variableDeclarator(func.id, t.toExpression(func))]); 6775 6776 declar._blockHoist = 2; 6777 6778 func.id = null; 6779 6780 _path.replaceWith(declar); 6781 } 6782 } 6783 6784 return { 6785 visitor: { 6786 BlockStatement: function BlockStatement(path) { 6787 var node = path.node, 6788 parent = path.parent; 6789 6790 if (t.isFunction(parent, { body: node }) || t.isExportDeclaration(parent)) { 6791 return; 6792 } 6793 6794 statementList("body", path); 6795 }, 6796 SwitchCase: function SwitchCase(path) { 6797 statementList("consequent", path); 6798 } 6799 } 6800 }; 6801 }; 6802 6803 function _interopRequireDefault(obj) { 6804 return obj && obj.__esModule ? obj : { default: obj }; 6805 } 6806 6807 module.exports = exports["default"]; 6808 6809/***/ }, 6810/* 68 */ 6811/***/ function(module, exports, __webpack_require__) { 6812 6813 "use strict"; 6814 6815 exports.__esModule = true; 6816 6817 var _symbol = __webpack_require__(11); 6818 6819 var _symbol2 = _interopRequireDefault(_symbol); 6820 6821 var _create = __webpack_require__(10); 6822 6823 var _create2 = _interopRequireDefault(_create); 6824 6825 var _classCallCheck2 = __webpack_require__(3); 6826 6827 var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); 6828 6829 exports.default = function () { 6830 return { 6831 visitor: { 6832 VariableDeclaration: function VariableDeclaration(path, file) { 6833 var node = path.node, 6834 parent = path.parent, 6835 scope = path.scope; 6836 6837 if (!isBlockScoped(node)) return; 6838 convertBlockScopedToVar(path, null, parent, scope, true); 6839 6840 if (node._tdzThis) { 6841 var nodes = [node]; 6842 6843 for (var i = 0; i < node.declarations.length; i++) { 6844 var decl = node.declarations[i]; 6845 if (decl.init) { 6846 var assign = t.assignmentExpression("=", decl.id, decl.init); 6847 assign._ignoreBlockScopingTDZ = true; 6848 nodes.push(t.expressionStatement(assign)); 6849 } 6850 decl.init = file.addHelper("temporalUndefined"); 6851 } 6852 6853 node._blockHoist = 2; 6854 6855 if (path.isCompletionRecord()) {
6856 nodes.push(t.expressionStatement(scope.buildUndefinedNode())); 6857 } 6858 6859 path.replaceWithMultiple(nodes); 6860 } 6861 }, 6862 Loop: function Loop(path, file) { 6863 var node = path.node, 6864 parent = path.parent, 6865 scope = path.scope; 6866 6867 t.ensureBlock(node); 6868 var blockScoping = new BlockScoping(path, path.get("body"), parent, scope, file); 6869 var replace = blockScoping.run(); 6870 if (replace) path.replaceWith(replace); 6871 }, 6872 CatchClause: function CatchClause(path, file) { 6873 var parent = path.parent, 6874 scope = path.scope; 6875 6876 var blockScoping = new BlockScoping(null, path.get("body"), parent, scope, file); 6877 blockScoping.run(); 6878 }, 6879 "BlockStatement|SwitchStatement|Program": function BlockStatementSwitchStatementProgram(path, file) { 6880 if (!ignoreBlock(path)) { 6881 var blockScoping = new BlockScoping(null, path, path.parent, path.scope, file); 6882 blockScoping.run(); 6883 } 6884 } 6885 } 6886 }; 6887 }; 6888 6889 var _babelTraverse = __webpack_require__(8); 6890 6891 var _babelTraverse2 = _interopRequireDefault(_babelTraverse); 6892 6893 var _tdz = __webpack_require__(326); 6894 6895 var _babelTypes = __webpack_require__(1); 6896 6897 var t = _interopRequireWildcard(_babelTypes); 6898 6899 var _values = __webpack_require__(276); 6900 6901 var _values2 = _interopRequireDefault(_values); 6902 6903 var _extend = __webpack_require__(567); 6904 6905 var _extend2 = _interopRequireDefault(_extend); 6906 6907 var _babelTemplate = __webpack_require__(4); 6908 6909 var _babelTemplate2 = _interopRequireDefault(_babelTemplate); 6910 6911 function _interopRequireWildcard(obj) { 6912 if (obj && obj.__esModule) { 6913 return obj; 6914 } else { 6915 var newObj = {};if (obj != null) { 6916 for (var key in obj) { 6917 if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; 6918 } 6919 }newObj.default = obj;return newObj; 6920 } 6921 } 6922 6923 function _interopRequireDefault(obj) { 6924 return obj && obj.__esModule ? obj : { default: obj }; 6925 } 6926 6927 function ignoreBlock(path) { 6928 return t.isLoop(path.parent) || t.isCatchClause(path.parent); 6929 } 6930 6931 var buildRetCheck = (0, _babelTemplate2.default)("\n if (typeof RETURN === \"object\") return RETURN.v;\n"); 6932 6933 function isBlockScoped(node) { 6934 if (!t.isVariableDeclaration(node)) return false; 6935 if (node[t.BLOCK_SCOPED_SYMBOL]) return true; 6936 if (node.kind !== "let" && node.kind !== "const") return false; 6937 return true; 6938 } 6939 6940 function convertBlockScopedToVar(path, node, parent, scope) { 6941 var moveBindingsToParent = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false; 6942 6943 if (!node) { 6944 node = path.node; 6945 } 6946 6947 if (!t.isFor(parent)) { 6948 for (var i = 0; i < node.declarations.length; i++) { 6949 var declar = node.declarations[i]; 6950 declar.init = declar.init || scope.buildUndefinedNode(); 6951 } 6952 } 6953 6954 node[t.BLOCK_SCOPED_SYMBOL] = true; 6955 node.kind = "var"; 6956 6957 if (moveBindingsToParent) { 6958 var parentScope = scope.getFunctionParent(); 6959 var ids = path.getBindingIdentifiers(); 6960 for (var name in ids) { 6961 var binding = scope.getOwnBinding(name); 6962 if (binding) binding.kind = "var"; 6963 scope.moveBindingTo(name, parentScope); 6964 } 6965 } 6966 } 6967 6968 function isVar(node) { 6969 return t.isVariableDeclaration(node, { kind: "var" }) && !isBlockScoped(node); 6970 } 6971 6972 var letReferenceBlockVisitor = _babelTraverse2.default.visitors.merge([{ 6973 Loop: { 6974 enter: function enter(path, state) { 6975 state.loopDepth++; 6976 }, 6977 exit: function exit(path, state) { 6978 state.loopDepth--; 6979 } 6980 }, 6981 Function: function Function(path, state) { 6982 if (state.loopDepth > 0) { 6983 path.traverse(letReferenceFunctionVisitor, state); 6984 } 6985 return path.skip(); 6986 } 6987 }, _tdz.visitor]); 6988 6989 var letReferenceFunctionVisitor = _babelTraverse2.default.visitors.merge([{ 6990 ReferencedIdentifier: function ReferencedIdentifier(path, state) { 6991 var ref = state.letReferences[path.node.name]; 6992 6993 if (!ref) return; 6994 6995 var localBinding = path.scope.getBindingIdentifier(path.node.name); 6996 if (localBinding && localBinding !== ref) return; 6997 6998 state.closurify = true; 6999 } 7000 }, _tdz.visitor]); 7001
7002 var hoistVarDeclarationsVisitor = { 7003 enter: function enter(path, self) { 7004 var node = path.node, 7005 parent = path.parent; 7006 7007 if (path.isForStatement()) { 7008 if (isVar(node.init, node)) { 7009 var nodes = self.pushDeclar(node.init); 7010 if (nodes.length === 1) { 7011 node.init = nodes[0]; 7012 } else { 7013 node.init = t.sequenceExpression(nodes); 7014 } 7015 } 7016 } else if (path.isFor()) { 7017 if (isVar(node.left, node)) { 7018 self.pushDeclar(node.left); 7019 node.left = node.left.declarations[0].id; 7020 } 7021 } else if (isVar(node, parent)) { 7022 path.replaceWithMultiple(self.pushDeclar(node).map(function (expr) { 7023 return t.expressionStatement(expr); 7024 })); 7025 } else if (path.isFunction()) { 7026 return path.skip(); 7027 } 7028 } 7029 }; 7030 7031 var loopLabelVisitor = { 7032 LabeledStatement: function LabeledStatement(_ref, state) { 7033 var node = _ref.node; 7034 7035 state.innerLabels.push(node.label.name); 7036 } 7037 }; 7038 7039 var continuationVisitor = { 7040 enter: function enter(path, state) { 7041 if (path.isAssignmentExpression() || path.isUpdateExpression()) { 7042 var bindings = path.getBindingIdentifiers(); 7043 for (var name in bindings) { 7044 if (state.outsideReferences[name] !== path.scope.getBindingIdentifier(name)) continue; 7045 state.reassignments[name] = true; 7046 } 7047 } 7048 } 7049 }; 7050 7051 function loopNodeTo(node) { 7052 if (t.isBreakStatement(node)) { 7053 return "break"; 7054 } else if (t.isContinueStatement(node)) { 7055 return "continue"; 7056 } 7057 } 7058 7059 var loopVisitor = { 7060 Loop: function Loop(path, state) { 7061 var oldIgnoreLabeless = state.ignoreLabeless; 7062 state.ignoreLabeless = true; 7063 path.traverse(loopVisitor, state); 7064 state.ignoreLabeless = oldIgnoreLabeless; 7065 path.skip(); 7066 }, 7067 Function: function Function(path) { 7068 path.skip(); 7069 }, 7070 SwitchCase: function SwitchCase(path, state) { 7071 var oldInSwitchCase = state.inSwitchCase; 7072 state.inSwitchCase = true; 7073 path.traverse(loopVisitor, state); 7074 state.inSwitchCase = oldInSwitchCase; 7075 path.skip(); 7076 }, 7077 "BreakStatement|ContinueStatement|ReturnStatement": function BreakStatementContinueStatementReturnStatement
7077(path, state) { 7078 var node = path.node, 7079 parent = path.parent, 7080 scope = path.scope; 7081 7082 if (node[this.LOOP_IGNORE]) return; 7083 7084 var replace = void 0; 7085 var loopText = loopNodeTo(node); 7086 7087 if (loopText) { 7088 if (node.label) { 7089 if (state.innerLabels.indexOf(node.label.name) >= 0) { 7090 return; 7091 } 7092 7093 loopText = loopText + "|" + node.label.name; 7094 } else { 7095 if (state.ignoreLabeless) return; 7096 7097 if (state.inSwitchCase) return; 7098 7099 if (t.isBreakStatement(node) && t.isSwitchCase(parent)) return; 7100 } 7101 7102 state.hasBreakContinue = true; 7103 state.map[loopText] = node; 7104 replace = t.stringLiteral(loopText); 7105 } 7106 7107 if (path.isReturnStatement()) { 7108 state.hasReturn = true; 7109 replace = t.objectExpression([t.objectProperty(t.identifier("v"), node.argument || scope.buildUndefinedNode())]); 7110 } 7111 7112 if (replace) { 7113 replace = t.returnStatement(replace); 7114 replace[this.LOOP_IGNORE] = true; 7115 path.skip(); 7116 path.replaceWith(t.inherits(replace, node)); 7117 } 7118 } 7119 }; 7120 7121 var BlockScoping = function () { 7122 function BlockScoping(loopPath, blockPath, parent, scope, file) { 7123 (0, _classCallCheck3.default)(this, BlockScoping); 7124 7125 this.parent = parent; 7126 this.scope = scope; 7127 this.file = file; 7128 7129 this.blockPath = blockPath; 7130 this.block = blockPath.node; 7131 7132 this.outsideLetReferences = (0, _create2.default)(null); 7133 this.hasLetReferences = false; 7134 this.letReferences = (0, _create2.default)(null); 7135 this.body = []; 7136 7137 if (loopPath) { 7138 this.loopParent = loopPath.parent; 7139 this.loopLabel = t.isLabeledStatement(this.loopParent) && this.loopParent.label; 7140 this.loopPath = loopPath; 7141 this.loop = loopPath.node; 7142 } 7143 } 7144 7145 BlockScoping.prototype.run = function run() { 7146 var block = this.block; 7147 if (block._letDone) return; 7148 block._letDone = true; 7149 7150 var needsClosure = this.getLetReferences(); 7151 7152 if (t.isFunction(this.parent) || t.isProgram(this.block)) { 7153 this.updateScopeInfo(); 7154 return; 7155 } 7156 7157 if (!this.hasLetReferences) return; 7158 7159 if (needsClosure) { 7160 this.wrapClosure(); 7161 } else { 7162 this.remap(); 7163 } 7164 7165 this.updateScopeInfo(needsClosure); 7166 7167 if (this.loopLabel && !t.isLabeledStatement(this.loopParent)) { 7168 return t.labeledStatement(this.loopLabel, this.loop); 7169 } 7170 }; 7171 7172 BlockScoping.prototype.updateScopeInfo = function updateScopeInfo(wrappedInClosure) { 7173 var scope = this.scope; 7174 var parentScope = scope.getFunctionParent(); 7175 var letRefs = this.letReferences; 7176 7177 for (var key in letRefs) { 7178 var ref = letRefs[key]; 7179 var binding = scope.getBinding(ref.name); 7180 if (!binding) continue; 7181 if (binding.kind === "let" || binding.kind === "const") { 7182 binding.kind = "var"; 7183 7184 if (wrappedInClosure) { 7185 scope.removeBinding(ref.name); 7186 } else { 7187 scope.moveBindingTo(ref.name, parentScope); 7188 } 7189 } 7190 } 7191 }; 7192 7193 BlockScoping.prototype.remap = function remap() { 7194 var letRefs = this.letReferences; 7195 var scope = this.scope; 7196 7197 for (var key in letRefs) { 7198 var ref = letRefs[key]; 7199
7200 if (scope.parentHasBinding(key) || scope.hasGlobal(key)) { 7201 if (scope.hasOwnBinding(key)) scope.rename(ref.name); 7202 7203 if (this.blockPath.scope.hasOwnBinding(key)) this.blockPath.scope.rename(ref.name); 7204 } 7205 } 7206 }; 7207 7208 BlockScoping.prototype.wrapClosure = function wrapClosure() { 7209 if (this.file.opts.throwIfClosureRequired) { 7210 throw this.blockPath.buildCodeFrameError("Compiling let/const in this block would add a closure " + "(throwIfClosureRequired)."); 7211 } 7212 var block = this.block; 7213 7214 var outsideRefs = this.outsideLetReferences; 7215 7216 if (this.loop) { 7217 for (var name in outsideRefs) { 7218 var id = outsideRefs[name]; 7219 7220 if (this.scope.hasGlobal(id.name) || this.scope.parentHasBinding(id.name)) { 7221 delete outsideRefs[id.name]; 7222 delete this.letReferences[id.name]; 7223 7224 this.scope.rename(id.name); 7225 7226 this.letReferences[id.name] = id; 7227 outsideRefs[id.name] = id; 7228 } 7229 } 7230 } 7231 7232 this.has = this.checkLoop(); 7233 7234 this.hoistVarDeclarations(); 7235 7236 var params = (0, _values2.default)(outsideRefs); 7237 var args = (0, _values2.default)(outsideRefs); 7238 7239 var isSwitch = this.blockPath.isSwitchStatement(); 7240 7241 var fn = t.functionExpression(null, params, t.blockStatement(isSwitch ? [block] : block.body)); 7242 fn.shadow = true; 7243 7244 this.addContinuations(fn); 7245 7246 var ref = fn; 7247 7248 if (this.loop) { 7249 ref = this.scope.generateUidIdentifier("loop"); 7250 this.loopPath.insertBefore(t.variableDeclaration("var", [t.variableDeclarator(ref, fn)])); 7251 } 7252 7253 var call = t.callExpression(ref, args); 7254 var ret = this.scope.generateUidIdentifier("ret"); 7255 7256 var hasYield = _babelTraverse2.default.hasType(fn.body, this.scope, "YieldExpression", t.FUNCTION_TYPES); 7257 if (hasYield) { 7258 fn.generator = true; 7259 call = t.yieldExpression(call, true); 7260 } 7261 7262 var hasAsync = _babelTraverse2.default.hasType(fn.body, this.scope, "AwaitExpression", t.FUNCTION_TYPES); 7263 if (hasAsync) { 7264 fn.async = true; 7265 call = t.awaitExpression(call); 7266 } 7267 7268 this.buildClosure(ret, call); 7269 7270 if (isSwitch) this.blockPath.replaceWithMultiple(this.body);else block.body = this.body; 7271 }; 7272 7273 BlockScoping.prototype.buildClosure = function buildClosure(ret, call) { 7274 var has = this.has; 7275 if (has.hasReturn || has.hasBreakContinue) { 7276 this.buildHas(ret, call); 7277 } else { 7278 this.body.push(t.expressionStatement(call)); 7279 } 7280 }; 7281 7282 BlockScoping.prototype.addContinuations = function addContinuations(fn) { 7283 var state = { 7284 reassignments: {}, 7285 outsideReferences: this.outsideLetReferences 7286 }; 7287 7288 this.scope.traverse(fn, continuationVisitor, state); 7289 7290 for (var i = 0; i < fn.params.length; i++) { 7291 var param = fn.params[i]; 7292 if (!state.reassignments[param.name]) continue; 7293 7294 var newParam = this.scope.generateUidIdentifier(param.name); 7295 fn.params[i] = newParam; 7296 7297 this.scope.rename(param.name, newParam.name, fn); 7298 7299 fn.body.body.push(t.expressionStatement(t.assignmentExpression("=", param, newParam))); 7300 } 7301 }; 7302 7303 BlockScoping.prototype.getLetReferences = function getLetReferences() { 7304 var _this = this; 7305 7306 var block = this.block; 7307 7308 var declarators = []; 7309 7310 if (this.loop) { 7311 var init = this.loop.left || this.loop.init; 7312 if (isBlockScoped(init)) { 7313 declarators.push(init); 7314 (0, _extend2.default)(this.outsideLetReferences, t.getBindingIdentifiers(init)); 7315 } 7316 } 7317 7318 var addDeclarationsFromChild = function addDeclarationsFromChild(path, node) { 7319 node = node || path.node; 7320 if (t.isClassDeclaration(node) || t.isFunctionDeclaration(node) || isBlockScoped(node)) { 7321 if (isBlockScoped(node)) { 7322 convertBlockScopedToVar(path, node, block, _this.scope); 7323 } 7324 declarators = declarators.concat(node.declarations || node); 7325 } 7326 if (t.isLabeledStatement(node)) { 7327 addDeclarationsFromChild(path.get("body"), node.body); 7328 } 7329 }; 7330 7331 if (block.body) { 7332 for (var i = 0; i < block.body.length; i++) { 7333 var declarPath = this.blockPath.get("body")[i]; 7334 addDeclarationsFromChild(declarPath); 7335 } 7336 } 7337 7338 if (block.cases) { 7339 for (var _i = 0; _i < block.cases.length; _i++) { 7340 var consequents = block.cases[_i].consequent; 7341 7342 for (var j = 0; j < consequents.length; j++) { 7343 var _declarPath = this.blockPath.get("cases")[_i]; 7344 var declar = consequents[j]; 7345 addDeclarationsFromChild(_declarPath, declar); 7346 } 7347 } 7348 } 7349 7350 for (var _i2 = 0; _i2 < declarators.length; _i2++) { 7351 var _declar = declarators[_i2]; 7352 7353 var keys = t.getBindingIdentifiers(_declar, false, true); 7354 (0, _extend2.default)(this.letReferences, keys); 7355 this.hasLetReferences = true; 7356 } 7357 7358 if (!this.hasLetReferences) return; 7359 7360 var state = { 7361 letReferences: this.letReferences, 7362 closurify: false, 7363 file: this.file, 7364 loopDepth: 0 7365 }; 7366 7367 var loopOrFunctionParent = this.blockPath.find(function (path) { 7368 return path.isLoop() || path.isFunction(); 7369 }); 7370 if (loopOrFunctionParent && loopOrFunctionParent.isLoop()) { 7371 state.loopDepth++; 7372 } 7373 7374 this.blockPath.traverse(letReferenceBlockVisitor, state); 7375 7376 return state.closurify; 7377 }; 7378 7379 BlockScoping.prototype.checkLoop = function checkLoop() { 7380 var state = { 7381 hasBreakContinue: false, 7382 ignoreLabeless: false, 7383 inSwitchCase: false,
7384 innerLabels: [], 7385 hasReturn: false, 7386 isLoop: !!this.loop, 7387 map: {}, 7388 LOOP_IGNORE: (0, _symbol2.default)() 7389 }; 7390 7391 this.blockPath.traverse(loopLabelVisitor, state); 7392 this.blockPath.traverse(loopVisitor, state); 7393 7394 return state; 7395 }; 7396 7397 BlockScoping.prototype.hoistVarDeclarations = function hoistVarDeclarations() { 7398 this.blockPath.traverse(hoistVarDeclarationsVisitor, this); 7399 }; 7400 7401 BlockScoping.prototype.pushDeclar = function pushDeclar(node) { 7402 var declars = []; 7403 var names = t.getBindingIdentifiers(node); 7404 for (var name in names) { 7405 declars.push(t.variableDeclarator(names[name])); 7406 } 7407 7408 this.body.push(t.variableDeclaration(node.kind, declars)); 7409 7410 var replace = []; 7411 7412 for (var i = 0; i < node.declarations.length; i++) { 7413 var declar = node.declarations[i]; 7414 if (!declar.init) continue; 7415 7416 var expr = t.assignmentExpression("=", declar.id, declar.init); 7417 replace.push(t.inherits(expr, declar)); 7418 } 7419 7420 return replace; 7421 }; 7422 7423 BlockScoping.prototype.buildHas = function buildHas(ret, call) { 7424 var body = this.body; 7425 7426 body.push(t.variableDeclaration("var", [t.variableDeclarator(ret, call)])); 7427 7428 var retCheck = void 0; 7429 var has = this.has; 7430 var cases = []; 7431 7432 if (has.hasReturn) { 7433 retCheck = buildRetCheck({ 7434 RETURN: ret 7435 }); 7436 } 7437 7438 if (has.hasBreakContinue) { 7439 for (var key in has.map) { 7440 cases.push(t.switchCase(t.stringLiteral(key), [has.map[key]])); 7441 } 7442 7443 if (has.hasReturn) { 7444 cases.push(t.switchCase(null, [retCheck])); 7445 } 7446 7447 if (cases.length === 1) { 7448 var single = cases[0]; 7449 body.push(t.ifStatement(t.binaryExpression("===", ret, single.test), single.consequent[0])); 7450 } else { 7451 if (this.loop) { 7452 for (var i = 0; i < cases.length; i++) { 7453 var caseConsequent = cases[i].consequent[0]; 7454 if (t.isBreakStatement(caseConsequent) && !caseConsequent.label) { 7455 caseConsequent.label = this.loopLabel = this.loopLabel || this.scope.generateUidIdentifier("loop"); 7456 } 7457 } 7458 } 7459 7460 body.push(t.switchStatement(ret, cases)); 7461 } 7462 } else { 7463 if (has.hasReturn) { 7464 body.push(retCheck); 7465 } 7466 } 7467 }; 7468 7469 return BlockScoping; 7470 }(); 7471 7472 module.exports = exports["default"]; 7473 7474/***/ }, 7475/* 69 */ 7476/***/ function(module, exports, __webpack_require__) { 7477 7478 "use strict"; 7479 7480 exports.__esModule = true; 7481 7482 var _symbol = __webpack_require__(11); 7483 7484 var _symbol2 = _interopRequireDefault(_symbol); 7485 7486 exports.default = function (_ref) { 7487 var t = _ref.types; 7488 7489 var VISITED = (0, _symbol2.default)(); 7490 7491 return { 7492 visitor: { 7493 ExportDefaultDeclaration: function ExportDefaultDeclaration(path) { 7494 if (!path.get("declaration").isClassDeclaration()) return; 7495 7496 var node = path.node; 7497 7498 var ref = node.declaration.id || path.scope.generateUidIdentifier("class"); 7499 node.declaration.id = ref; 7500 7501 path.replaceWith(node.declaration); 7502 path.insertAfter(t.exportDefaultDeclaration(ref)); 7503 }, 7504 ClassDeclaration: function ClassDeclaration(path) { 7505 var node = path.node; 7506 7507 var ref = node.id || path.scope.generateUidIdentifier("class"); 7508 7509 path.replaceWith(t.variableDeclaration("let", [t.variableDeclarator(ref, t.toExpression(node))])); 7510 }, 7511 ClassExpression: function ClassExpression(path, state) { 7512 var node = path.node; 7513 7514 if (node[VISITED]) return; 7515 7516 var inferred = (0, _babelHelperFunctionName2.default)(path); 7517 if (inferred && inferred !== node) return path.replaceWith(inferred); 7518 7519 node[VISITED] = true; 7520 7521 var Constructor = _vanilla2.default; 7522 if (state.opts.loose) Constructor = _loose2.default; 7523 7524 path.replaceWith(new Constructor(path, state.file).run()); 7525 } 7526 } 7527 }; 7528 }; 7529 7530 var _loose = __webpack_require__(327); 7531 7532 var _loose2 = _interopRequireDefault(_loose); 7533 7534 var _vanilla = __webpack_require__(204); 7535 7536 var _vanilla2 = _interopRequireDefault(_vanilla); 7537 7538 var _babelHelperFunctionName = __webpack_require__(40); 7539 7540 var _babelHelperFunctionName2 = _interopRequireDefault(_babelHelperFunctionName); 7541 7542 function _interopRequireDefault(obj) { 7543 return obj && obj.__esModule ? obj : { default: obj }; 7544 } 7545 7546 module.exports = exports["default"]; 7547 7548/***/ }, 7549/* 70 */ 7550/***/ function(module, exports, __webpack_require__) { 7551 7552 "use strict"; 7553 7554 exports.__esModule = true; 7555 7556 var _getIterator2 = __webpack_require__(2); 7557 7558 var _getIterator3 = _interopRequireDefault(_getIterator2); 7559 7560 exports.default = function (_ref) { 7561 var t = _ref.types, 7562 template = _ref.template; 7563 7564 var buildMutatorMapAssign = template("\n MUTATOR_MAP_REF[KEY] = MUTATOR_MAP_REF[KEY] || {};\n MUTATOR_MAP_REF[KEY].KIND = VALUE;\n "); 7565 7566 function getValue(prop) { 7567 if (t.isObjectProperty(prop)) { 7568 return prop.value; 7569 } else if (t.isObjectMethod(prop)) { 7570 return t.functionExpression(null, prop.params, prop.body, prop.generator, prop.async); 7571 } 7572 } 7573 7574 function pushAssign(objId, prop, body) {
7575 if (prop.kind === "get" && prop.kind === "set") { 7576 pushMutatorDefine(objId, prop, body); 7577 } else { 7578 body.push(t.expressionStatement(t.assignmentExpression("=", t.memberExpression(objId, prop.key, prop.computed || t.isLiteral(prop.key)), getValue(prop)))); 7579 } 7580 } 7581 7582 function pushMutatorDefine(_ref2, prop) { 7583 var objId = _ref2.objId, 7584 body = _ref2.body, 7585 getMutatorId = _ref2.getMutatorId, 7586 scope = _ref2.scope; 7587 7588 var key = !prop.computed && t.isIdentifier(prop.key) ? t.stringLiteral(prop.key.name) : prop.key; 7589 7590 var maybeMemoise = scope.maybeGenerateMemoised(key); 7591 if (maybeMemoise) { 7592 body.push(t.expressionStatement(t.assignmentExpression("=", maybeMemoise, key))); 7593 key = maybeMemoise; 7594 } 7595 7596 body.push.apply(body, buildMutatorMapAssign({ 7597 MUTATOR_MAP_REF: getMutatorId(), 7598 KEY: key, 7599 VALUE: getValue(prop), 7600 KIND: t.identifier(prop.kind) 7601 })); 7602 } 7603 7604 function loose(info) { 7605 for (var _iterator = info.computedProps, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) { 7606 var _ref3; 7607 7608 if (_isArray) { 7609 if (_i >= _iterator.length) break; 7610 _ref3 = _iterator[_i++]; 7611 } else { 7612 _i = _iterator.next(); 7613 if (_i.done) break; 7614 _ref3 = _i.value; 7615 } 7616 7617 var prop = _ref3; 7618 7619 if (prop.kind === "get" || prop.kind === "set") { 7620 pushMutatorDefine(info, prop); 7621 } else { 7622 pushAssign(info.objId, prop, info.body); 7623 } 7624 } 7625 } 7626 7627 function spec(info) { 7628 var objId = info.objId, 7629 body = info.body, 7630 computedProps = info.computedProps, 7631 state = info.state; 7632 7633 for (var _iterator2 = computedProps, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) { 7634 var _ref4; 7635 7636 if (_isArray2) { 7637 if (_i2 >= _iterator2.length) break; 7638 _ref4 = _iterator2[_i2++]; 7639 } else { 7640 _i2 = _iterator2.next(); 7641 if (_i2.done) break; 7642 _ref4 = _i2.value; 7643 } 7644 7645 var prop = _ref4; 7646 7647 var key = t.toComputedKey(prop); 7648 7649 if (prop.kind === "get" || prop.kind === "set") { 7650 pushMutatorDefine(info, prop); 7651 } else if (t.isStringLiteral(key, { value: "__proto__" })) { 7652 pushAssign(objId, prop, body); 7653 } else { 7654 if (computedProps.length === 1) { 7655 return t.callExpression(state.addHelper("defineProperty"), [info.initPropExpression, key, getValue(prop)]); 7656 } else { 7657 body.push(t.expressionStatement(t.callExpression(state.addHelper("defineProperty"), [objId, key, getValue(prop)]))); 7658 } 7659 } 7660 } 7661 } 7662 7663 return { 7664 visitor: { 7665 ObjectExpression: { 7666 exit: function exit(path, state) { 7667 var node = path.node, 7668 parent = path.parent, 7669 scope = path.scope; 7670 7671 var hasComputed = false; 7672 for (var _iterator3 = node.properties, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, _getIterator3.default)(_iterator3);;) { 7673 var _ref5; 7674 7675 if (_isArray3) { 7676 if (_i3 >= _iterator3.length) break; 7677 _ref5 = _iterator3[_i3++]; 7678 } else { 7679 _i3 = _iterator3.next(); 7680 if (_i3.done) break; 7681 _ref5 = _i3.value; 7682 } 7683 7684 var prop = _ref5; 7685 7686 hasComputed = prop.computed === true; 7687 if (hasComputed) break; 7688 } 7689 if (!hasComputed) return; 7690 7691 var initProps = []; 7692 var computedProps = []; 7693 var foundComputed = false; 7694 7695 for (var _iterator4 = node.properties, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, _getIterator3.default)(_iterator4);;) { 7696 var _ref6; 7697 7698 if (_isArray4) { 7699 if (_i4 >= _iterator4.length) break; 7700 _ref6 = _iterator4[_i4++]; 7701 } else { 7702 _i4 = _iterator4.next(); 7703 if (_i4.done) break; 7704 _ref6 = _i4.value; 7705 } 7706 7707 var _prop = _ref6; 7708 7709 if (_prop.computed) { 7710 foundComputed = true; 7711 } 7712 7713 if (foundComputed) { 7714 computedProps.push(_prop); 7715 } else { 7716 initProps.push(_prop); 7717 } 7718 } 7719 7720 var objId = scope.generateUidIdentifierBasedOnNode(parent); 7721 var initPropExpression = t.objectExpression(initProps); 7722 var body = []; 7723 7724 body.push(t.variableDeclaration("var", [t.variableDeclarator(objId, initPropExpression)])
7724); 7725 7726 var callback = spec; 7727 if (state.opts.loose) callback = loose; 7728 7729 var mutatorRef = void 0; 7730 7731 var getMutatorId = function getMutatorId() { 7732 if (!mutatorRef) { 7733 mutatorRef = scope.generateUidIdentifier("mutatorMap"); 7734 7735 body.push(t.variableDeclaration("var", [t.variableDeclarator(mutatorRef, t.objectExpression([]))])); 7736 } 7737 7738 return mutatorRef; 7739 }; 7740 7741 var single = callback({ 7742 scope: scope, 7743 objId: objId, 7744 body: body, 7745 computedProps: computedProps, 7746 initPropExpression: initPropExpression, 7747 getMutatorId: getMutatorId, 7748 state: state 7749 }); 7750 7751 if (mutatorRef) { 7752 body.push(t.expressionStatement(t.callExpression(state.addHelper("defineEnumerableProperties"), [objId, mutatorRef]))); 7753 } 7754 7755 if (single) { 7756 path.replaceWith(single); 7757 } else { 7758 body.push(t.expressionStatement(objId)); 7759 path.replaceWithMultiple(body); 7760 } 7761 } 7762 } 7763 } 7764 }; 7765 }; 7766 7767 function _interopRequireDefault(obj) { 7768 return obj && obj.__esModule ? obj : { default: obj }; 7769 } 7770 7771 module.exports = exports["default"]; 7772 7773/***/ }, 7774/* 71 */ 7775/***/ function(module, exports, __webpack_require__) { 7776 7777 "use strict"; 7778 7779 exports.__esModule = true; 7780 7781 var _classCallCheck2 = __webpack_require__(3); 7782 7783 var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); 7784 7785 var _getIterator2 = __webpack_require__(2); 7786 7787 var _getIterator3 = _interopRequireDefault(_getIterator2); 7788 7789 exports.default = function (_ref) { 7790 var t = _ref.types; 7791 7792 function variableDeclarationHasPattern(node) { 7793 for (var _iterator = node.declarations, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) { 7794 var _ref2; 7795 7796 if (_isArray) { 7797 if (_i >= _iterator.length) break; 7798 _ref2 = _iterator[_i++]; 7799 } else { 7800 _i = _iterator.next(); 7801 if (_i.done) break; 7802 _ref2 = _i.value; 7803 } 7804 7805 var declar = _ref2; 7806 7807 if (t.isPattern(declar.id)) { 7808 return true; 7809 } 7810 } 7811 return false; 7812 } 7813 7814 function hasRest(pattern) { 7815 for (var _iterator2 = pattern.elements, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) { 7816 var _ref3; 7817 7818 if (_isArray2) { 7819 if (_i2 >= _iterator2.length) break; 7820 _ref3 = _iterator2[_i2++]; 7821 } else { 7822 _i2 = _iterator2.next(); 7823 if (_i2.done) break; 7824 _ref3 = _i2.value; 7825 } 7826 7827 var elem = _ref3; 7828 7829 if (t.isRestElement(elem)) { 7830 return true; 7831 } 7832 } 7833 return false; 7834 } 7835 7836 var arrayUnpackVisitor = { 7837 ReferencedIdentifier: function ReferencedIdentifier(path, state) { 7838 if (state.bindings[path.node.name]) { 7839 state.deopt = true; 7840 path.stop(); 7841 } 7842 } 7843 }; 7844 7845 var DestructuringTransformer = function () { 7846 function DestructuringTransformer(opts) { 7847 (0, _classCallCheck3.default)(this, DestructuringTransformer); 7848 7849 this.blockHoist = opts.blockHoist; 7850 this.operator = opts.operator; 7851 this.arrays = {}; 7852 this.nodes = opts.nodes || []; 7853 this.scope = opts.scope; 7854 this.file = opts.file; 7855 this.kind = opts.kind; 7856 } 7857 7858 DestructuringTransformer.prototype.buildVariableAssignment = function buildVariableAssignment(id, init) { 7859 var op = this.operator; 7860 if (t.isMemberExpression(id)) op = "="; 7861 7862 var node = void 0; 7863 7864 if (op) { 7865 node = t.expressionStatement(t.assignmentExpression(op, id, init)); 7866 } else { 7867 node = t.variableDeclaration(this.kind, [t.variableDeclarator(id, init)]); 7868 } 7869 7870 node._blockHoist = this.blockHoist; 7871 7872 return node; 7873 }; 7874 7875 DestructuringTransformer.prototype.buildVariableDeclaration = function buildVariableDeclaration(id, init) { 7876 var declar = t.variableDeclaration("var", [t.variableDeclarator(id, init)]); 7877 declar._blockHoist = this.blockHoist; 7878 return declar; 7879 }; 7880 7881 DestructuringTransformer.prototype.push = function push(id, init) { 7882 if (t.isObjectPattern(id)) { 7883 this.pushObjectPattern(id, init); 7884 } else if (t.isArrayPattern(id)) { 7885 this.pushArrayPattern(id, init); 7886 } else if (t.isAssignmentPattern(id)) { 7887 this.pushAssignmentPattern(id, init); 7888 } else { 7889 this.nodes.push(this.buildVariableAssignment(id, init)); 7890 } 7891 }; 7892 7893 DestructuringTransformer.prototype.toArray = function toArray(node, count) { 7894 if (this.file.opts.loose || t.isIdentifier(node) && this.arrays[node.name]) { 7895 return node; 7896 } else { 7897 return this.scope.toArray(node, count); 7898 } 7899 }; 7900 7901 DestructuringTransformer.prototype.pushAssignmentPattern = function pushAssignmentPattern(pattern, valueRef) { 7902 7903 var tempValueRef = this.scope.generateUidIdentifierBasedOnNode(valueRef); 7904 7905 var declar = t.variableDeclaration("var", [t.variableDeclarator(tempValueRef, valueRef)]); 7906 declar._blockHoist = this.blockHoist; 7907 this.nodes.push(declar); 7908 7909 var tempConditional = t.conditionalExpression(t.binaryExpression("===", tempValueRef, t.identifier("undefined")), pattern.right, tempValueRef); 7910 7911 var left = pattern.left; 7912 if (t.isPattern(left)) {
7913 var tempValueDefault = t.expressionStatement(t.assignmentExpression("=", tempValueRef, tempConditional)); 7914 tempValueDefault._blockHoist = this.blockHoist; 7915 7916 this.nodes.push(tempValueDefault); 7917 this.push(left, tempValueRef); 7918 } else { 7919 this.nodes.push(this.buildVariableAssignment(left, tempConditional)); 7920 } 7921 }; 7922 7923 DestructuringTransformer.prototype.pushObjectRest = function pushObjectRest(pattern, objRef, spreadProp, spreadPropIndex) { 7924 7925 var keys = []; 7926 7927 for (var i = 0; i < pattern.properties.length; i++) { 7928 var prop = pattern.properties[i]; 7929 7930 if (i >= spreadPropIndex) break; 7931 7932 if (t.isRestProperty(prop)) continue; 7933 7934 var key = prop.key; 7935 if (t.isIdentifier(key) && !prop.computed) key = t.stringLiteral(prop.key.name); 7936 keys.push(key); 7937 } 7938 7939 keys = t.arrayExpression(keys); 7940 7941 var value = t.callExpression(this.file.addHelper("objectWithoutProperties"), [objRef, keys]); 7942 this.nodes.push(this.buildVariableAssignment(spreadProp.argument, value)); 7943 }; 7944 7945 DestructuringTransformer.prototype.pushObjectProperty = function pushObjectProperty(prop, propRef) { 7946 if (t.isLiteral(prop.key)) prop.computed = true; 7947 7948 var pattern = prop.value; 7949 var objRef = t.memberExpression(propRef, prop.key, prop.computed); 7950 7951 if (t.isPattern(pattern)) { 7952 this.push(pattern, objRef); 7953 } else { 7954 this.nodes.push(this.buildVariableAssignment(pattern, objRef)); 7955 } 7956 }; 7957 7958 DestructuringTransformer.prototype.pushObjectPattern = function pushObjectPattern(pattern, objRef) { 7959 7960 if (!pattern.properties.length) { 7961 this.nodes.push(t.expressionStatement(t.callExpression(this.file.addHelper("objectDestructuringEmpty"), [objRef]))); 7962 } 7963 7964 if (pattern.properties.length > 1 && !this.scope.isStatic(objRef)) { 7965 var temp = this.scope.generateUidIdentifierBasedOnNode(objRef); 7966 this.nodes.push(this.buildVariableDeclaration(temp, objRef)); 7967 objRef = temp; 7968 } 7969 7970 for (var i = 0; i < pattern.properties.length; i++) { 7971 var prop = pattern.properties[i]; 7972 if (t.isRestProperty(prop)) { 7973 this.pushObjectRest(pattern, objRef, prop, i); 7974 } else { 7975 this.pushObjectProperty(prop, objRef); 7976 } 7977 } 7978 }; 7979 7980 DestructuringTransformer.prototype.canUnpackArrayPattern = function canUnpackArrayPattern(pattern, arr) { 7981 if (!t.isArrayExpression(arr)) return false; 7982 7983 if (pattern.elements.length > arr.elements.length) return; 7984 if (pattern.elements.length < arr.elements.length && !hasRest(pattern)) return false; 7985 7986 for (var _iterator3 = pattern.elements, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, _getIterator3.default)(_iterator3);;) { 7987 var _ref4; 7988 7989 if (_isArray3) { 7990 if (_i3 >= _iterator3.length) break; 7991 _ref4 = _iterator3[_i3++]; 7992 } else { 7993 _i3 = _iterator3.next(); 7994 if (_i3.done) break; 7995 _ref4 = _i3.value; 7996 } 7997 7998 var elem = _ref4; 7999 8000 if (!elem) return false; 8001 8002 if (t.isMemberExpression(elem)) return false; 8003 } 8004 8005 for (var _iterator4 = arr.elements, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, _getIterator3.default)(_iterator4);;) { 8006 var _ref5; 8007 8008 if (_isArray4) { 8009 if (_i4 >= _iterator4.length) break; 8010 _ref5 = _iterator4[_i4++]; 8011 } else { 8012 _i4 = _iterator4.next(); 8013 if (_i4.done) break; 8014 _ref5 = _i4.value; 8015 } 8016 8017 var _elem = _ref5; 8018 8019 if (t.isSpreadElement(_elem)) return false; 8020 8021 if (t.isCallExpression(_elem)) return false; 8022 8023 if (t.isMemberExpression(_elem)) return false; 8024 } 8025 8026 var bindings = t.getBindingIdentifiers(pattern); 8027 var state = { deopt: false, bindings: bindings }; 8028 this.scope.traverse(arr, arrayUnpackVisitor, state); 8029 return !state.deopt; 8030 }; 8031 8032 DestructuringTransformer.prototype.pushUnpackedArrayPattern = function pushUnpackedArrayPattern(pattern, arr) { 8033 for (var i = 0; i < pattern.elements.length; i++) { 8034 var elem = pattern.elements[i]; 8035 if (t.isRestElement(elem)) { 8036 this.push(elem.argument, t.arrayExpression(arr.elements.slice(i))); 8037 } else { 8038 this.push(elem, arr.elements[i]); 8039 } 8040 } 8041 }; 8042 8043 DestructuringTransformer.prototype.pushArrayPattern = function pushArrayPattern(pattern, arrayRef) { 8044 if (!pattern.elements) return; 8045 8046 if (this.canUnpackArrayPattern(pattern, arrayRef)) { 8047 return this.pushUnpackedArrayPattern(pattern, arrayRef); 8048 } 8049 8050 var count = !hasRest(pattern) && pattern.elements.length; 8051 8052 var toArray = this.toArray(arrayRef, count); 8053 8054 if (t.isIdentifier(toArray)) { 8055 arrayRef = toArray; 8056 } else { 8057 arrayRef = this.scope.generateUidIdentifierBasedOnNode(arrayRef); 8058 this.arrays[arrayRef.name] = true; 8059 this.nodes.push(this.buildVariableDeclaration(arrayRef, toArray)); 8060 } 8061 8062 for (var i = 0; i < pattern.elements.length; i++) { 8063 var elem = pattern.elements[i]; 8064 8065 if (!elem) continue; 8066 8067 var elemRef = void 0; 8068 8069 if (t.isRestElement(elem)) { 8070 elemRef = this.toArray(arrayRef); 8071 elemRef = t.callExpression(t.memberExpression(elemRef, t.identifier("slice")), [t.numericLiteral(i)]); 8072 8073 elem = elem.argument; 8074 } else { 8075 elemRef = t.memberExpression(arrayRef, t.numericLiteral(i), true); 8076 } 8077 8078 this.push(elem, elemRef); 8079 } 8080 }; 8081 8082 DestructuringTransformer.prototype.init = function init(pattern, ref) { 8083 8084 if (!t.isArrayExpression(ref) && !t.isMemberExpression(ref)) { 8085 var memo = this.scope.maybeGenerateMemoised(ref, true); 8086 if (memo) { 8087 this.nodes.push(this.buildVariableDeclaration(memo, ref)); 8088 ref = memo; 8089 } 8090 } 8091 8092 this.push(pattern, ref); 8093 8094 return this.nodes; 8095 }; 8096 8097 return DestructuringTransformer; 8098 }(); 8099 8100 return { 8101 visitor: { 8102 ExportNamedDeclaration: function ExportNamedDeclaration(path) { 8103 var declaration = path.get("declaration"); 8104 if (!declaration.isVariableDeclaration()) return; 8105 if (!variableDeclarationHasPattern(declaration.node)) return; 8106 8107 var specifiers = []; 8108 8109 for (var name in path.getOuterBindingIdentifiers(path)) { 8110 var id = t.identifier(name); 8111 specifiers.push(t.exportSpecifier(id, id)); 8112 } 8113 8114 path.replaceWith(declaration.node); 8115 path.insertAfter(t.exportNamedDeclaration(null, specifiers)); 8116 },
8117 ForXStatement: function ForXStatement(path, file) { 8118 var node = path.node, 8119 scope = path.scope; 8120 8121 var left = node.left; 8122 8123 if (t.isPattern(left)) { 8124 8125 var temp = scope.generateUidIdentifier("ref"); 8126 8127 node.left = t.variableDeclaration("var", [t.variableDeclarator(temp)]); 8128 8129 path.ensureBlock(); 8130 8131 node.body.body.unshift(t.variableDeclaration("var", [t.variableDeclarator(left, temp)])); 8132 8133 return; 8134 } 8135 8136 if (!t.isVariableDeclaration(left)) return; 8137 8138 var pattern = left.declarations[0].id; 8139 if (!t.isPattern(pattern)) return; 8140 8141 var key = scope.generateUidIdentifier("ref"); 8142 node.left = t.variableDeclaration(left.kind, [t.variableDeclarator(key, null)]); 8143 8144 var nodes = []; 8145 8146 var destructuring = new DestructuringTransformer({ 8147 kind: left.kind, 8148 file: file, 8149 scope: scope, 8150 nodes: nodes 8151 }); 8152 8153 destructuring.init(pattern, key); 8154 8155 path.ensureBlock(); 8156 8157 var block = node.body; 8158 block.body = nodes.concat(block.body); 8159 }, 8160 CatchClause: function CatchClause(_ref6, file) { 8161 var node = _ref6.node, 8162 scope = _ref6.scope; 8163 8164 var pattern = node.param; 8165 if (!t.isPattern(pattern)) return; 8166 8167 var ref = scope.generateUidIdentifier("ref"); 8168 node.param = ref; 8169 8170 var nodes = []; 8171 8172 var destructuring = new DestructuringTransformer({ 8173 kind: "let", 8174 file: file, 8175 scope: scope, 8176 nodes: nodes 8177 }); 8178 destructuring.init(pattern, ref); 8179 8180 node.body.body = nodes.concat(node.body.body); 8181 }, 8182 AssignmentExpression: function AssignmentExpression(path, file) { 8183 var node = path.node, 8184 scope = path.scope; 8185 8186 if (!t.isPattern(node.left)) return; 8187 8188 var nodes = []; 8189 8190 var destructuring = new DestructuringTransformer({ 8191 operator: node.operator, 8192 file: file, 8193 scope: scope, 8194 nodes: nodes 8195 }); 8196 8197 var ref = void 0; 8198 if (path.isCompletionRecord() || !path.parentPath.isExpressionStatement()) { 8199 ref = scope.generateUidIdentifierBasedOnNode(node.right, "ref"); 8200 8201 nodes.push(t.variableDeclaration("var", [t.variableDeclarator(ref, node.right)])); 8202 8203 if (t.isArrayExpression(node.right)) { 8204 destructuring.arrays[ref.name] = true; 8205 } 8206 } 8207 8208 destructuring.init(node.left, ref || node.right); 8209 8210 if (ref) { 8211 nodes.push(t.expressionStatement(ref)); 8212 } 8213 8214 path.replaceWithMultiple(nodes); 8215 }, 8216 VariableDeclaration: function VariableDeclaration(path, file) { 8217 var node = path.node, 8218 scope = path.scope, 8219 parent = path.parent; 8220 8221 if (t.isForXStatement(parent)) return; 8222 if (!parent || !path.container) return; 8223 if (!variableDeclarationHasPattern(node)) return; 8224 8225 var nodes = []; 8226 var declar = void 0; 8227 8228 for (var i = 0; i < node.declarations.length; i++) { 8229 declar = node.declarations[i]; 8230 8231 var patternId = declar.init; 8232 var pattern = declar.id; 8233 8234 var destructuring = new DestructuringTransformer({ 8235 blockHoist: node._blockHoist, 8236 nodes: nodes, 8237 scope: scope, 8238 kind: node.kind, 8239 file: file 8240 }); 8241 8242 if (t.isPattern(pattern)) { 8243 destructuring.init(pattern, patternId); 8244 8245 if (+i !== node.declarations.length - 1) { 8246 t.inherits(nodes[nodes.length - 1], declar); 8247 } 8248 } else { 8249 nodes.push(t.inherits(destructuring.buildVariableAssignment(declar.id, declar.init), declar)); 8250 } 8251 } 8252 8253 var nodesOut = []; 8254 for (var _iterator5 = nodes, _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : (0, _getIterator3.default)(_iterator5);;) { 8255 var _ref7; 8256 8257 if (_isArray5) { 8258 if (_i5 >= _iterator5.length) break; 8259 _ref7 = _iterator5[_i5++]; 8260 } else { 8261 _i5 = _iterator5.next(); 8262 if (_i5.done) break; 8263 _ref7 = _i5.value; 8264 } 8265 8266 var _node = _ref7; 8267 8268 var tail = nodesOut[nodesOut.length - 1]; 8269 if (tail && t.isVariableDeclaration(tail) && t.isVariableDeclaration(_node) && tail.kind === _node.kind) { 8270 var _tail$declarations; 8271 8272 (_tail$declarations = tail.declarations).push.apply(_tail$declarations, _node.declarations); 8273 } else { 8274 nodesOut.push(_node); 8275 } 8276 } 8277 8278 for (var _iterator6 = nodesOut, _isArray6 = Array.isArray(_iterator6), _i6 = 0, _iterator6 = _isArray6 ? _iterator6 : (0, _getIterator3.default)(_iterator6);;) { 8279 var _ref8; 8280 8281 if (_isArray6) { 8282 if (_i6 >= _iterator6.length) break; 8283 _ref8 = _iterator6[_i6++]; 8284 } else { 8285 _i6 = _iterator6.next(); 8286 if (_i6.done) break; 8287 _ref8 = _i6.value; 8288 } 8289 8290 var nodeOut = _ref8; 8291 8292 if (!nodeOut.declarations) continue; 8293 for (var _iterator7 = nodeOut.declarations, _isArray7 = Array.isArray(_iterator7), _i7 = 0, _iterator7 = _isArray7 ? _iterator7 : (0, _getIterator3.default)(_iterator7);;) { 8294 var _ref9; 8295 8296 if (_isArray7) { 8297 if (_i7 >= _iterator7.length) break; 8298 _ref9 = _iterator7[_i7++]; 8299 } else { 8300 _i7 = _iterator7.next(); 8301 if (_i7.done) break; 8302 _ref9 = _i7.value; 8303 } 8304 8305 var declaration = _ref9; 8306 var name = declaration.id.name; 8307 8308 if (scope.bindings[name]) { 8309 scope.bindings[name].kind = nodeOut.kind; 8310 } 8311 } 8312 } 8313 8314 if (nodesOut.length === 1) { 8315 path.replaceWith(nodesOut[0]); 8316 } else { 8317 path.replaceWithMultiple(nodesOut); 8318 } 8319 } 8320 } 8321 }; 8322 }; 8323 8324 function _interopRequireDefault(obj) { 8325 return obj && obj.__esModule ? obj : { default: obj }; 8326 } 8327 8328 module.exports = exports["default"]; 8329 8330/***/ }, 8331/* 72 */
8332/***/ function(module, exports) { 8333 8334 "use strict"; 8335 8336 exports.__esModule = true; 8337 8338 exports.default = function (_ref) { 8339 var messages = _ref.messages, 8340 template = _ref.template, 8341 t = _ref.types; 8342 8343 var buildForOfArray = template("\n for (var KEY = 0; KEY < ARR.length; KEY++) BODY;\n "); 8344 8345 var buildForOfLoose = template("\n for (var LOOP_OBJECT = OBJECT,\n IS_ARRAY = Array.isArray(LOOP_OBJECT),\n INDEX = 0,\n LOOP_OBJECT = IS_ARRAY ? LOOP_OBJECT : LOOP_OBJECT[Symbol.iterator]();;) {\n var ID;\n if (IS_ARRAY) {\n if (INDEX >= LOOP_OBJECT.length) break;\n ID = LOOP_OBJECT[INDEX++];\n } else {\n INDEX = LOOP_OBJECT.next();\n if (INDEX.done) break;\n ID = INDEX.value;\n }\n }\n "); 8346 8347 var buildForOf = template("\n var ITERATOR_COMPLETION = true;\n var ITERATOR_HAD_ERROR_KEY = false;\n var ITERATOR_ERROR_KEY = undefined;\n try {\n for (var ITERATOR_KEY = OBJECT[Symbol.iterator](), STEP_KEY; !(ITERATOR_COMPLETION = (STEP_KEY = ITERATOR_KEY.next()).done); ITERATOR_COMPLETION = true) {\n }\n } catch (err) {\n ITERATOR_HAD_ERROR_KEY = true;\n ITERATOR_ERROR_KEY = err;\n } finally {\n try {\n if (!ITERATOR_COMPLETION && ITERATOR_KEY.return) {\n ITERATOR_KEY.return();\n }\n } finally {\n if (ITERATOR_HAD_ERROR_KEY) {\n throw ITERATOR_ERROR_KEY;\n }\n }\n }\n "); 8348 8349 function _ForOfStatementArray(path) { 8350 var node = path.node, 8351 scope = path.scope; 8352 8353 var nodes = []; 8354 var right = node.right; 8355 8356 if (!t.isIdentifier(right) || !scope.hasBinding(right.name)) { 8357 var uid = scope.generateUidIdentifier("arr"); 8358 nodes.push(t.variableDeclaration("var", [t.variableDeclarator(uid, right)])); 8359 right = uid; 8360 } 8361 8362 var iterationKey = scope.generateUidIdentifier("i"); 8363 8364 var loop = buildForOfArray({ 8365 BODY: node.body, 8366 KEY: iterationKey, 8367 ARR: right 8368 }); 8369 8370 t.inherits(loop, node); 8371 t.ensureBlock(loop); 8372 8373 var iterationValue = t.memberExpression(right, iterationKey, true); 8374 8375 var left = node.left; 8376 if (t.isVariableDeclaration(left)) { 8377 left.declarations[0].init = iterationValue; 8378 loop.body.body.unshift(left); 8379 } else { 8380 loop.body.body.unshift(t.expressionStatement(t.assignmentExpression("=", left, iterationValue))); 8381 } 8382 8383 if (path.parentPath.isLabeledStatement()) { 8384 loop = t.labeledStatement(path.parentPath.node.label, loop); 8385 } 8386 8387 nodes.push(loop); 8388 8389 return nodes; 8390 } 8391 8392 return { 8393 visitor: { 8394 ForOfStatement: function ForOfStatement(path, state) { 8395 if (path.get("right").isArrayExpression()) { 8396 if (path.parentPath.isLabeledStatement()) { 8397 return path.parentPath.replaceWithMultiple(_ForOfStatementArray(path)); 8398 } else { 8399 return path.replaceWithMultiple(_ForOfStatementArray(path)); 8400 } 8401 } 8402 8403 var callback = spec; 8404 if (state.opts.loose) callback = loose; 8405 8406 var node = path.node; 8407 8408 var build = callback(path, state); 8409 var declar = build.declar; 8410 var loop = build.loop; 8411 var block = loop.body; 8412 8413 path.ensureBlock(); 8414 8415 if (declar) { 8416 block.body.push(declar); 8417 } 8418 8419 block.body = block.body.concat(node.body.body); 8420 8421 t.inherits(loop, node); 8422 t.inherits(loop.body, node.body); 8423 8424 if (build.replaceParent) { 8425 path.parentPath.replaceWithMultiple(build.node); 8426 path.remove(); 8427 } else { 8428 path.replaceWithMultiple(build.node); 8429 } 8430 } 8431 } 8432 }; 8433 8434 function loose(path, file) { 8435 var node = path.node, 8436 scope = path.scope, 8437 parent = path.parent; 8438 var left = node.left; 8439 8440 var declar = void 0, 8441 id = void 0; 8442 8443 if (t.isIdentifier(left) || t.isPattern(left) || t.isMemberExpression(left)) { 8444 id = left; 8445 } else if (t.isVariableDeclaration(left)) { 8446 id = scope.generateUidIdentifier("ref"); 8447 declar = t.variableDeclaration(left.kind, [t.variableDeclarator(left.declarations[0].id, id)]); 8448 } else { 8449 throw file.buildCodeFrameError(left, messages.get("unknownForHead", left.type)); 8450 } 8451 8452 var iteratorKey = scope.generateUidIdentifier("iterator"); 8453 var isArrayKey = scope.generateUidIdentifier("isArray"); 8454 8455 var loop = buildForOfLoose({ 8456 LOOP_OBJECT: iteratorKey, 8457 IS_ARRAY: isArrayKey, 8458 OBJECT: node.right, 8459 INDEX: scope.generateUidIdentifier("i"), 8460 ID: id 8461 }); 8462 8463 if (!declar) { 8464 loop.body.body.shift(); 8465 } 8466
8467 var isLabeledParent = t.isLabeledStatement(parent); 8468 var labeled = void 0; 8469 8470 if (isLabeledParent) { 8471 labeled = t.labeledStatement(parent.label, loop); 8472 } 8473 8474 return { 8475 replaceParent: isLabeledParent, 8476 declar: declar, 8477 node: labeled || loop, 8478 loop: loop 8479 }; 8480 } 8481 8482 function spec(path, file) { 8483 var node = path.node, 8484 scope = path.scope, 8485 parent = path.parent; 8486 8487 var left = node.left; 8488 var declar = void 0; 8489 8490 var stepKey = scope.generateUidIdentifier("step"); 8491 var stepValue = t.memberExpression(stepKey, t.identifier("value")); 8492 8493 if (t.isIdentifier(left) || t.isPattern(left) || t.isMemberExpression(left)) { 8494 declar = t.expressionStatement(t.assignmentExpression("=", left, stepValue)); 8495 } else if (t.isVariableDeclaration(left)) { 8496 declar = t.variableDeclaration(left.kind, [t.variableDeclarator(left.declarations[0].id, stepValue)]); 8497 } else { 8498 throw file.buildCodeFrameError(left, messages.get("unknownForHead", left.type)); 8499 } 8500 8501 var iteratorKey = scope.generateUidIdentifier("iterator"); 8502 8503 var template = buildForOf({ 8504 ITERATOR_HAD_ERROR_KEY: scope.generateUidIdentifier("didIteratorError"), 8505 ITERATOR_COMPLETION: scope.generateUidIdentifier("iteratorNormalCompletion"), 8506 ITERATOR_ERROR_KEY: scope.generateUidIdentifier("iteratorError"), 8507 ITERATOR_KEY: iteratorKey, 8508 STEP_KEY: stepKey, 8509 OBJECT: node.right, 8510 BODY: null 8511 }); 8512 8513 var isLabeledParent = t.isLabeledStatement(parent); 8514 8515 var tryBody = template[3].block.body; 8516 var loop = tryBody[0]; 8517 8518 if (isLabeledParent) { 8519 tryBody[0] = t.labeledStatement(parent.label, loop); 8520 } 8521 8522 return { 8523 replaceParent: isLabeledParent, 8524 declar: declar, 8525 loop: loop, 8526 node: template 8527 }; 8528 } 8529 }; 8530 8531 module.exports = exports["default"]; 8532 8533/***/ }, 8534/* 73 */ 8535/***/ function(module, exports, __webpack_require__) { 8536 8537 "use strict"; 8538 8539 exports.__esModule = true; 8540 8541 exports.default = function () { 8542 return { 8543 visitor: { 8544 FunctionExpression: { 8545 exit: function exit(path) { 8546 if (path.key !== "value" && !path.parentPath.isObjectProperty()) { 8547 var replacement = (0, _babelHelperFunctionName2.default)(path); 8548 if (replacement) path.replaceWith(replacement); 8549 } 8550 } 8551 }, 8552 8553 ObjectProperty: function ObjectProperty(path) { 8554 var value = path.get("value"); 8555 if (value.isFunction()) { 8556 var newNode = (0, _babelHelperFunctionName2.default)(value); 8557 if (newNode) value.replaceWith(newNode); 8558 } 8559 } 8560 } 8561 }; 8562 }; 8563 8564 var _babelHelperFunctionName = __webpack_require__(40); 8565 8566 var _babelHelperFunctionName2 = _interopRequireDefault(_babelHelperFunctionName); 8567 8568 function _interopRequireDefault(obj) { 8569 return obj && obj.__esModule ? obj : { default: obj }; 8570 } 8571 8572 module.exports = exports["default"]; 8573 8574/***/ }, 8575/* 74 */ 8576/***/ function(module, exports) { 8577 8578 "use strict"; 8579 8580 exports.__esModule = true; 8581 8582 exports.default = function () { 8583 return { 8584 visitor: { 8585 NumericLiteral: function NumericLiteral(_ref) { 8586 var node = _ref.node; 8587 8588 if (node.extra && /^0[ob]/i.test(node.extra.raw)) { 8589 node.extra = undefined; 8590 } 8591 }, 8592 StringLiteral: function StringLiteral(_ref2) { 8593 var node = _ref2.node; 8594 8595 if (node.extra && /\\[u]/gi.test(node.extra.raw)) { 8596 node.extra = undefined; 8597 } 8598 } 8599 } 8600 }; 8601 }; 8602 8603 module.exports = exports["default"]; 8604 8605/***/ }, 8606/* 75 */ 8607/***/ function(module, exports, __webpack_require__) { 8608 8609 "use strict"; 8610 8611 exports.__esModule = true; 8612 8613 var _keys = __webpack_require__(13); 8614 8615 var _keys2 = _interopRequireDefault(_keys); 8616 8617 var _create = __webpack_require__(10); 8618 8619 var _create2 = _interopRequireDefault(_create); 8620 8621 var _getIterator2 = __webpack_require__(2); 8622 8623 var _getIterator3 = _interopRequireDefault(_getIterator2); 8624 8625 var _symbol = __webpack_require__(11); 8626 8627 var _symbol2 = _interopRequireDefault(_symbol); 8628 8629 exports.default = function () { 8630 var REASSIGN_REMAP_SKIP = (0, _symbol2.default)(); 8631 8632 var reassignmentVisitor = { 8633 ReferencedIdentifier: function ReferencedIdentifier(path) { 8634 var name = path.node.name; 8635 var remap = this.remaps[name]; 8636 if (!remap) return; 8637 8638 if (this.scope.getBinding(name) !== path.scope.getBinding(name)) return; 8639 8640 if (path.parentPath.isCallExpression({ callee: path.node })) { 8641 path.replaceWith(t.sequenceExpression([t.numericLiteral(0), remap])); 8642 } else if (path.isJSXIdentifier() && t.isMemberExpression(remap)) { 8643 var object = remap.object, 8644 property = remap.property; 8645 8646 path.replaceWith(t.JSXMemberExpression(t.JSXIdentifier(object.name), t.JSXIdentifier(property.name))); 8647 } else { 8648 path.replaceWith(remap); 8649 } 8650 this.requeueInParent(path); 8651 }, 8652 AssignmentExpression: function AssignmentExpression(path) { 8653 var node = path.node; 8654 if (node[REASSIGN_REMAP_SKIP]) return; 8655 8656 var left = path.get("left"); 8657 if (!left.isIdentifier()) return; 8658 8659 var name = left.node.name; 8660 var exports = this.exports[name]; 8661 if (!exports) return; 8662 8663 if (this.scope.getBinding(name) !== path.scope.getBinding(name)) return; 8664 8665 node[REASSIGN_REMAP_SKIP] = true; 8666 8667 for (var _iterator = exports, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) { 8668 var _ref; 8669 8670 if (_isArray) { 8671 if (_i >= _iterator.length) break; 8672 _ref = _iterator[_i++]; 8673 } else { 8674 _i = _iterator.next(); 8675 if (_i.done) break; 8676 _ref = _i.value; 8677 } 8678 8679 var reid = _ref; 8680 8681 node = buildExportsAssignment(reid, node).expression; 8682 } 8683 8684 path.replaceWith(node); 8685 this.requeueInParent(path); 8686 }, 8687 UpdateExpression: function UpdateExpression(path) { 8688 var arg = path.get("argument"); 8689 if (!arg.isIdentifier()) return; 8690 8691 var name = arg.node.name; 8692 var exports = this.exports[name]; 8693 if (!exports) return; 8694 8695 if (this.scope.getBinding(name) !== path.scope.getBinding(name)) return; 8696 8697 var node = t.assignmentExpression(path.node.operator[0] + "=", arg.node, t.numericLiteral(1)); 8698
8699 if (path.parentPath.isExpressionStatement() && !path.isCompletionRecord() || path.node.prefix) { 8700 path.replaceWith(node); 8701 this.requeueInParent(path); 8702 return; 8703 } 8704 8705 var nodes = []; 8706 nodes.push(node); 8707 8708 var operator = void 0; 8709 if (path.node.operator === "--") { 8710 operator = "+"; 8711 } else { 8712 operator = "-"; 8713 } 8714 nodes.push(t.binaryExpression(operator, arg.node, t.numericLiteral(1))); 8715 8716 path.replaceWithMultiple(t.sequenceExpression(nodes)); 8717 } 8718 }; 8719 8720 return { 8721 inherits: __webpack_require__(213), 8722 8723 visitor: { 8724 ThisExpression: function ThisExpression(path, state) { 8725 if (this.ranCommonJS) return; 8726 8727 if (state.opts.allowTopLevelThis !== true && !path.findParent(function (path) { 8728 return !path.is("shadow") && THIS_BREAK_KEYS.indexOf(path.type) >= 0; 8729 })) { 8730 path.replaceWith(t.identifier("undefined")); 8731 } 8732 }, 8733 8734 Program: { 8735 exit: function exit(path) { 8736 this.ranCommonJS = true; 8737 8738 var strict = !!this.opts.strict; 8739 var noInterop = !!this.opts.noInterop; 8740 8741 var scope = path.scope; 8742 8743 scope.rename("module"); 8744 scope.rename("exports"); 8745 scope.rename("require"); 8746 8747 var hasExports = false; 8748 var hasImports = false; 8749 8750 var body = path.get("body"); 8751 var imports = (0, _create2.default)(null); 8752 var exports = (0, _create2.default)(null); 8753 8754 var nonHoistedExportNames = (0, _create2.default)(null); 8755 8756 var topNodes = []; 8757 var remaps = (0, _create2.default)(null); 8758 8759 var requires = (0, _create2.default)(null); 8760 8761 function addRequire(source, blockHoist) { 8762 var cached = requires[source]; 8763 if (cached) return cached; 8764 8765 var ref = path.scope.generateUidIdentifier((0, _path2.basename)(source, (0, _path2.extname)(source))); 8766 8767 var varDecl = t.variableDeclaration("var", [t.variableDeclarator(ref, buildRequire(t.stringLiteral(source)).expression)]); 8768 8769 if (imports[source]) { 8770 varDecl.loc = imports[source].loc; 8771 } 8772 8773 if (typeof blockHoist === "number" && blockHoist > 0) { 8774 varDecl._blockHoist = blockHoist; 8775 } 8776 8777 topNodes.push(varDecl); 8778 8779 return requires[source] = ref; 8780 } 8781 8782 function addTo(obj, key, arr) { 8783 var existing = obj[key] || []; 8784 obj[key] = existing.concat(arr); 8785 } 8786 8787 for (var _iterator2 = body, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) { 8788 var _ref2; 8789 8790 if (_isArray2) { 8791 if (_i2 >= _iterator2.length) break; 8792 _ref2 = _iterator2[_i2++]; 8793 } else { 8794 _i2 = _iterator2.next(); 8795 if (_i2.done) break; 8796 _ref2 = _i2.value; 8797 } 8798 8799 var _path = _ref2; 8800 8801 if (_path.isExportDeclaration()) { 8802 hasExports = true; 8803 8804 var specifiers = [].concat(_path.get("declaration"), _path.get("specifiers")); 8805 for (var _iterator4 = specifiers, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, _getIterator3.default)(_iterator4);;) { 8806 var _ref4; 8807 8808 if (_isArray4) { 8809 if (_i4 >= _iterator4.length) break; 8810 _ref4 = _iterator4[_i4++]; 8811 } else { 8812 _i4 = _iterator4.next(); 8813 if (_i4.done) break; 8814 _ref4 = _i4.value; 8815 } 8816 8817 var _specifier2 = _ref4; 8818 8819 var ids = _specifier2.getBindingIdentifiers(); 8820 if (ids.__esModule) { 8821 throw _specifier2.buildCodeFrameError("Illegal export \"__esModule\""); 8822 } 8823 } 8824 } 8825 8826 if (_path.isImportDeclaration()) { 8827 var _importsEntry$specifi; 8828 8829 hasImports = true; 8830 8831 var key = _path.node.source.value; 8832 var importsEntry = imports[key] || { 8833 specifiers: [], 8834 maxBlockHoist: 0, 8835 loc: _path.node.loc 8836 }; 8837 8838 (_importsEntry$specifi = importsEntry.specifiers).push.apply(_importsEntry$specifi, _path.node.specifiers); 8839 8840 if (typeof _path.node._blockHoist === "number") { 8841 importsEntry.maxBlockHoist = Math.max(_path.node._blockHoist, importsEntry.maxBlockHoist); 8842 } 8843 8844 imports[key] = importsEntry; 8845 8846 _path.remove(); 8847 } else if (_path.isExportDefaultDeclaration()) { 8848 var declaration = _path.get("declaration"); 8849 if (declaration.isFunctionDeclaration()) { 8850 var id = declaration.node.id; 8851 var defNode = t.identifier("default"); 8852 if (id) { 8853 addTo(exports, id.name, defNode); 8854 topNodes.push(buildExportsAssignment(defNode, id
8854)); 8855 _path.replaceWith(declaration.node); 8856 } else { 8857 topNodes.push(buildExportsAssignment(defNode, t.toExpression(declaration.node))); 8858 _path.remove(); 8859 } 8860 } else if (declaration.isClassDeclaration()) { 8861 var _id = declaration.node.id; 8862 var _defNode = t.identifier("default"); 8863 if (_id) { 8864 addTo(exports, _id.name, _defNode); 8865 _path.replaceWithMultiple([declaration.node, buildExportsAssignment(_defNode, _id)]); 8866 } else { 8867 _path.replaceWith(buildExportsAssignment(_defNode, t.toExpression(declaration.node))); 8868 8869 _path.parentPath.requeue(_path.get("expression.left")); 8870 } 8871 } else { 8872 _path.replaceWith(buildExportsAssignment(t.identifier("default"), declaration.node)); 8873 8874 _path.parentPath.requeue(_path.get("expression.left")); 8875 } 8876 } else if (_path.isExportNamedDeclaration()) { 8877 var _declaration = _path.get("declaration"); 8878 if (_declaration.node) { 8879 if (_declaration.isFunctionDeclaration()) { 8880 var _id2 = _declaration.node.id; 8881 addTo(exports, _id2.name, _id2); 8882 topNodes.push(buildExportsAssignment(_id2, _id2)); 8883 _path.replaceWith(_declaration.node); 8884 } else if (_declaration.isClassDeclaration()) { 8885 var _id3 = _declaration.node.id; 8886 addTo(exports, _id3.name, _id3); 8887 _path.replaceWithMultiple([_declaration.node, buildExportsAssignment(_id3, _id3)]); 8888 nonHoistedExportNames[_id3.name] = true; 8889 } else if (_declaration.isVariableDeclaration()) { 8890 var declarators = _declaration.get("declarations"); 8891 for (var _iterator5 = declarators, _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : (0, _getIterator3.default)(_iterator5);;) { 8892 var _ref5; 8893 8894 if (_isArray5) { 8895 if (_i5 >= _iterator5.length) break; 8896 _ref5 = _iterator5[_i5++]; 8897 } else { 8898 _i5 = _iterator5.next(); 8899 if (_i5.done) break; 8900 _ref5 = _i5.value; 8901 } 8902 8903 var decl = _ref5; 8904 8905 var _id4 = decl.get("id"); 8906 8907 var init = decl.get("init"); 8908 if (!init.node) init.replaceWith(t.identifier("undefined")); 8909 8910 if (_id4.isIdentifier()) { 8911 addTo(exports, _id4.node.name, _id4.node); 8912 init.replaceWith(buildExportsAssignment(_id4.node, init.node).expression); 8913 nonHoistedExportNames[_id4.node.name] = true; 8914 } else {} 8915 } 8916 _path.replaceWith(_declaration.node); 8917 } 8918 continue; 8919 } 8920 8921 var _specifiers = _path.get("specifiers"); 8922 var nodes = []; 8923 var _source = _path.node.source; 8924 if (_source) { 8925 var ref = addRequire(_source.value, _path.node._blockHoist); 8926 8927 for (var _iterator6 = _specifiers, _isArray6 = Array.isArray(_iterator6), _i6 = 0, _iterator6 = _isArray6 ? _iterator6 : (0, _getIterator3.default)(_iterator6);;) { 8928 var _ref6; 8929 8930 if (_isArray6) { 8931 if (_i6 >= _iterator6.length) break; 8932 _ref6 = _iterator6[_i6++]; 8933 } else { 8934 _i6 = _iterator6.next(); 8935 if (_i6.done) break; 8936 _ref6 = _i6.value; 8937 } 8938 8939 var _specifier3 = _ref6; 8940 8941 if (_specifier3.isExportNamespaceSpecifier()) {} else if (_specifier3.isExportDefaultSpecifier()) {} else if (_specifier3.isExportSpecifier()) { 8942 if (!noInterop && _specifier3.node.local.name === "default") { 8943 topNodes.push(buildExportsFrom(t.stringLiteral(_specifier3.node.exported.name), t.memberExpression(t.callExpression(this.addHelper("interopRequireDefault"), [ref]), _specifier3.node.local))); 8944 } else { 8945 topNodes.push(buildExportsFrom(t.stringLiteral(_specifier3.node.exported.name), t.memberExpression(ref, _specifier3.node.local))); 8946 } 8947 nonHoistedExportNames[_specifier3.node.exported.name] = true; 8948 } 8949 } 8950 } else { 8951 for (var _iterator7 = _specifiers, _isArray7 = Array.isArray(_iterator7), _i7 = 0, _iterator7 = _isArray7 ? _iterator7 : (0, _getIterator3.default)(_iterator7);;) { 8952 var _ref7; 8953 8954 if (_isArray7) { 8955 if (_i7 >= _iterator7.length) break; 8956 _ref7 = _iterator7[_i7++]; 8957 } else { 8958 _i7 = _iterator7.next(); 8959 if (_i7.done) break; 8960 _ref7 = _i7.value; 8961 } 8962 8963 var _specifier4 = _ref7; 8964 8965 if (_specifier4.isExportSpecifier()) { 8966 addTo(exports, _specifier4.node.local.name, _specifier4.node.exported); 8967 nonHoistedExportNames[_specifier4.node.exported.name] = true; 8968 nodes.push(buildExportsAssignment(_specifier4.node.exported, _specifier4.node.local)); 8969 } 8970 } 8971 } 8972 _path.replaceWithMultiple(nodes); 8973 } else if (_path.isExportAllDeclaration()) { 8974 var exportNode = buildExportAll({ 8975 OBJECT: addRequire(_path.node.source.value, _path.node._blockHoist) 8976 }); 8977 exportNode.loc = _path.node.loc; 8978 topNodes.push(exportNode); 8979 _path.remove(); 8980 } 8981 } 8982 8983 for (var source in imports) { 8984 var _imports$source = imports[source], 8985 specifiers = _imports$source.specifiers,
8986 maxBlockHoist = _imports$source.maxBlockHoist; 8987 8988 if (specifiers.length) { 8989 var uid = addRequire(source, maxBlockHoist); 8990 8991 var wildcard = void 0; 8992 8993 for (var i = 0; i < specifiers.length; i++) { 8994 var specifier = specifiers[i]; 8995 if (t.isImportNamespaceSpecifier(specifier)) { 8996 if (strict || noInterop) { 8997 remaps[specifier.local.name] = uid; 8998 } else { 8999 var varDecl = t.variableDeclaration("var", [t.variableDeclarator(specifier.local, t.callExpression(this.addHelper("interopRequireWildcard"), [uid]))]); 9000 9001 if (maxBlockHoist > 0) { 9002 varDecl._blockHoist = maxBlockHoist; 9003 } 9004 9005 topNodes.push(varDecl); 9006 } 9007 wildcard = specifier.local; 9008 } else if (t.isImportDefaultSpecifier(specifier)) { 9009 specifiers[i] = t.importSpecifier(specifier.local, t.identifier("default")); 9010 } 9011 } 9012 9013 for (var _iterator3 = specifiers, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, _getIterator3.default)(_iterator3);;) { 9014 var _ref3; 9015 9016 if (_isArray3) { 9017 if (_i3 >= _iterator3.length) break; 9018 _ref3 = _iterator3[_i3++]; 9019 } else { 9020 _i3 = _iterator3.next(); 9021 if (_i3.done) break; 9022 _ref3 = _i3.value; 9023 } 9024 9025 var _specifier = _ref3; 9026 9027 if (t.isImportSpecifier(_specifier)) { 9028 var target = uid; 9029 if (_specifier.imported.name === "default") { 9030 if (wildcard) { 9031 target = wildcard; 9032 } else if (!noInterop) { 9033 target = wildcard = path.scope.generateUidIdentifier(uid.name); 9034 var _varDecl = t.variableDeclaration("var", [t.variableDeclarator(target, t.callExpression(this.addHelper("interopRequireDefault"), [uid]))]); 9035 9036 if (maxBlockHoist > 0) { 9037 _varDecl._blockHoist = maxBlockHoist; 9038 } 9039 9040 topNodes.push(_varDecl); 9041 } 9042 } 9043 remaps[_specifier.local.name] = t.memberExpression(target, t.cloneWithoutLoc(_specifier.imported)); 9044 } 9045 } 9046 } else { 9047 var requireNode = buildRequire(t.stringLiteral(source)); 9048 requireNode.loc = imports[source].loc; 9049 topNodes.push(requireNode); 9050 } 9051 } 9052 9053 if (hasImports && (0, _keys2.default)(nonHoistedExportNames).length) { 9054 var maxHoistedExportsNodeAssignmentLength = 100; 9055 var nonHoistedExportNamesArr = (0, _keys2.default)(nonHoistedExportNames); 9056 9057 var _loop = function _loop(currentExportsNodeAssignmentLength) { 9058 var nonHoistedExportNamesChunk = nonHoistedExportNamesArr.slice(currentExportsNodeAssignmentLength, currentExportsNodeAssignmentLength + maxHoistedExportsNodeAssignmentLength); 9059 9060 var hoistedExportsNode = t.identifier("undefined"); 9061 9062 nonHoistedExportNamesChunk.forEach(function (name) { 9063 hoistedExportsNode = buildExportsAssignment(t.identifier(name), hoistedExportsNode).expression; 9064 }); 9065 9066 var node = t.expressionStatement(hoistedExportsNode); 9067 node._blockHoist = 3; 9068 9069 topNodes.unshift(node); 9070 }; 9071 9072 for (var currentExportsNodeAssignmentLength = 0; currentExportsNodeAssignmentLength < nonHoistedExportNamesArr.length; currentExportsNodeAssignmentLength += maxHoistedExportsNodeAssignmentLength) { 9073 _loop(currentExportsNodeAssignmentLength); 9074 } 9075 } 9076 9077 if (hasExports && !strict) { 9078 var buildTemplate = buildExportsModuleDeclaration; 9079 if (this.opts.loose) buildTemplate = buildLooseExportsModuleDeclaration; 9080 9081 var declar = buildTemplate(); 9082 declar._blockHoist = 3; 9083 9084 topNodes.unshift(declar); 9085 } 9086 9087 path.unshiftContainer("body", topNodes); 9088 path.traverse(reassignmentVisitor, { 9089 remaps: remaps, 9090 scope: scope, 9091 exports: exports, 9092 requeueInParent: function requeueInParent(newPath) { 9093 return path.requeue(newPath); 9094 } 9095 }); 9096 } 9097 } 9098 } 9099 }; 9100 }; 9101 9102 var _path2 = __webpack_require__(17); 9103 9104 var _babelTemplate = __webpack_require__(4); 9105 9106 var _babelTemplate2 = _interopRequireDefault(_babelTemplate); 9107 9108 var _babelTypes = __webpack_require__(1); 9109 9110 var t = _interopRequireWildcard(_babelTypes); 9111 9112 function _interopRequireWildcard(obj) { 9113 if (obj && obj.__esModule) { 9114 return obj; 9115 } else { 9116 var newObj = {};if (obj != null) { 9117 for (var key in obj) { 9118 if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; 9119 } 9120 }newObj.default = obj;return newObj; 9121 } 9122 } 9123 9124 function _interopRequireDefault(obj) { 9125 return obj && obj.__esModule ? obj : { default: obj }; 9126 } 9127 9128 var buildRequire = (0, _babelTemplate2.default)("\n require($0);\n"); 9129 9130 var buildExportsModuleDeclaration = (0, _babelTemplate2.default)("\n Object.defineProperty(exports, \"__esMo
9130dule\", {\n value: true\n });\n"); 9131 9132 var buildExportsFrom = (0, _babelTemplate2.default)("\n Object.defineProperty(exports, $0, {\n enumerable: true,\n get: function () {\n return $1;\n }\n });\n"); 9133 9134 var buildLooseExportsModuleDeclaration = (0, _babelTemplate2.default)("\n exports.__esModule = true;\n"); 9135 9136 var buildExportsAssignment = (0, _babelTemplate2.default)("\n exports.$0 = $1;\n"); 9137 9138 var buildExportAll = (0, _babelTemplate2.default)("\n Object.keys(OBJECT).forEach(function (key) {\n if (key === \"default\" || key === \"__esModule\") return;\n Object.defineProperty(exports, key, {\n enumerable: true,\n get: function () {\n return OBJECT[key];\n }\n });\n });\n"); 9139 9140 var THIS_BREAK_KEYS = ["FunctionExpression", "FunctionDeclaration", "ClassProperty", "ClassMethod", "ObjectMethod"]; 9141 9142 module.exports = exports["default"]; 9143 9144/***/ }, 9145/* 76 */ 9146/***/ function(module, exports, __webpack_require__) { 9147 9148 "use strict"; 9149 9150 exports.__esModule = true; 9151 9152 var _getIterator2 = __webpack_require__(2); 9153 9154 var _getIterator3 = _interopRequireDefault(_getIterator2); 9155 9156 var _symbol = __webpack_require__(11); 9157 9158 var _symbol2 = _interopRequireDefault(_symbol); 9159 9160 exports.default = function (_ref) { 9161 var t = _ref.types; 9162 9163 function Property(path, node, scope, getObjectRef, file) { 9164 var replaceSupers = new _babelHelperReplaceSupers2.default({ 9165 getObjectRef: getObjectRef, 9166 methodNode: node, 9167 methodPath: path, 9168 isStatic: true, 9169 scope: scope, 9170 file: file 9171 }); 9172 9173 replaceSupers.replace(); 9174 } 9175 9176 var CONTAINS_SUPER = (0, _symbol2.default)(); 9177 9178 return { 9179 visitor: { 9180 Super: function Super(path) { 9181 var parentObj = path.findParent(function (path) { 9182 return path.isObjectExpression(); 9183 }); 9184 if (parentObj) parentObj.node[CONTAINS_SUPER] = true; 9185 }, 9186 9187 ObjectExpression: { 9188 exit: function exit(path, file) { 9189 if (!path.node[CONTAINS_SUPER]) return; 9190 9191 var objectRef = void 0; 9192 var getObjectRef = function getObjectRef() { 9193 return objectRef = objectRef || path.scope.generateUidIdentifier("obj"); 9194 }; 9195 9196 var propPaths = path.get("properties"); 9197 for (var _iterator = propPaths, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) { 9198 var _ref2; 9199 9200 if (_isArray) { 9201 if (_i >= _iterator.length) break; 9202 _ref2 = _iterator[_i++]; 9203 } else { 9204 _i = _iterator.next(); 9205 if (_i.done) break; 9206 _ref2 = _i.value; 9207 } 9208 9209 var propPath = _ref2; 9210 9211 if (propPath.isObjectProperty()) propPath = propPath.get("value"); 9212 Property(propPath, propPath.node, path.scope, getObjectRef, file); 9213 } 9214 9215 if (objectRef) { 9216 path.scope.push({ id: objectRef }); 9217 path.replaceWith(t.assignmentExpression("=", objectRef, path.node)); 9218 } 9219 } 9220 } 9221 } 9222 }; 9223 }; 9224 9225 var _babelHelperReplaceSupers = __webpack_require__(190); 9226 9227 var _babelHelperReplaceSupers2 = _interopRequireDefault(_babelHelperReplaceSupers); 9228 9229 function _interopRequireDefault(obj) { 9230 return obj && obj.__esModule ? obj : { default: obj }; 9231 } 9232 9233 module.exports = exports["default"]; 9234 9235/***/ }, 9236/* 77 */ 9237/***/ function(module, exports, __webpack_require__) { 9238 9239 "use strict"; 9240 9241 exports.__esModule = true; 9242 9243 var _getIterator2 = __webpack_require__(2); 9244 9245 var _getIterator3 = _interopRequireDefault(_getIterator2); 9246 9247 exports.default = function () { 9248 return { 9249 visitor: _babelTraverse.visitors.merge([{ 9250 ArrowFunctionExpression: function ArrowFunctionExpression(path) { 9251 var params = path.get("params"); 9252 for (var _iterator = params, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) { 9253 var _ref; 9254 9255 if (_isArray) { 9256 if (_i >= _iterator.length) break; 9257 _ref = _iterator[_i++]; 9258 } else { 9259 _i = _iterator.next(); 9260 if (_i.done) break; 9261 _ref = _i.value; 9262 } 9263 9264 var param = _ref;
9265 9266 if (param.isRestElement() || param.isAssignmentPattern()) { 9267 path.arrowFunctionToShadowed(); 9268 break; 9269 } 9270 } 9271 } 9272 }, destructuring.visitor, rest.visitor, def.visitor]) 9273 }; 9274 }; 9275 9276 var _babelTraverse = __webpack_require__(8); 9277 9278 var _destructuring = __webpack_require__(330); 9279 9280 var destructuring = _interopRequireWildcard(_destructuring); 9281 9282 var _default = __webpack_require__(329); 9283 9284 var def = _interopRequireWildcard(_default); 9285 9286 var _rest = __webpack_require__(331); 9287 9288 var rest = _interopRequireWildcard(_rest); 9289 9290 function _interopRequireWildcard(obj) { 9291 if (obj && obj.__esModule) { 9292 return obj; 9293 } else { 9294 var newObj = {};if (obj != null) { 9295 for (var key in obj) { 9296 if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; 9297 } 9298 }newObj.default = obj;return newObj; 9299 } 9300 } 9301 9302 function _interopRequireDefault(obj) { 9303 return obj && obj.__esModule ? obj : { default: obj }; 9304 } 9305 9306 module.exports = exports["default"]; 9307 9308/***/ }, 9309/* 78 */ 9310/***/ function(module, exports, __webpack_require__) { 9311 9312 "use strict"; 9313 9314 exports.__esModule = true; 9315 9316 exports.default = function () { 9317 return { 9318 visitor: { 9319 ObjectMethod: function ObjectMethod(path) { 9320 var node = path.node; 9321 9322 if (node.kind === "method") { 9323 var func = t.functionExpression(null, node.params, node.body, node.generator, node.async); 9324 func.returnType = node.returnType; 9325 9326 path.replaceWith(t.objectProperty(node.key, func, node.computed)); 9327 } 9328 }, 9329 ObjectProperty: function ObjectProperty(_ref) { 9330 var node = _ref.node; 9331 9332 if (node.shorthand) { 9333 node.shorthand = false; 9334 } 9335 } 9336 } 9337 }; 9338 }; 9339 9340 var _babelTypes = __webpack_require__(1); 9341 9342 var t = _interopRequireWildcard(_babelTypes); 9343 9344 function _interopRequireWildcard(obj) { 9345 if (obj && obj.__esModule) { 9346 return obj; 9347 } else { 9348 var newObj = {};if (obj != null) { 9349 for (var key in obj) { 9350 if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; 9351 } 9352 }newObj.default = obj;return newObj; 9353 } 9354 } 9355 9356 module.exports = exports["default"]; 9357 9358/***/ }, 9359/* 79 */ 9360/***/ function(module, exports, __webpack_require__) { 9361 9362 "use strict"; 9363 9364 exports.__esModule = true; 9365 9366 var _getIterator2 = __webpack_require__(2); 9367 9368 var _getIterator3 = _interopRequireDefault(_getIterator2); 9369 9370 exports.default = function (_ref) { 9371 var t = _ref.types; 9372 9373 function getSpreadLiteral(spread, scope, state) { 9374 if (state.opts.loose && !t.isIdentifier(spread.argument, { name: "arguments" })) { 9375 return spread.argument; 9376 } else { 9377 return scope.toArray(spread.argument, true); 9378 } 9379 } 9380 9381 function hasSpread(nodes) { 9382 for (var i = 0; i < nodes.length; i++) { 9383 if (t.isSpreadElement(nodes[i])) { 9384 return true; 9385 } 9386 } 9387 return false; 9388 } 9389 9390 function build(props, scope, state) { 9391 var nodes = []; 9392 9393 var _props = []; 9394 9395 function push() { 9396 if (!_props.length) return; 9397 nodes.push(t.arrayExpression(_props)); 9398 _props = []; 9399 } 9400 9401 for (var _iterator = props, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) { 9402 var _ref2; 9403 9404 if (_isArray) { 9405 if (_i >= _iterator.length) break; 9406 _ref2 = _iterator[_i++]; 9407 } else { 9408 _i = _iterator.next(); 9409 if (_i.done) break; 9410 _ref2 = _i.value; 9411 } 9412 9413 var prop = _ref2; 9414 9415 if (t.isSpreadElement(prop)) { 9416 push(); 9417 nodes.push(getSpreadLiteral(prop, scope, state)); 9418 } else { 9419 _props.push(prop); 9420 } 9421 } 9422 9423 push(); 9424 9425 return nodes; 9426 } 9427 9428 return { 9429 visitor: { 9430 ArrayExpression: function ArrayExpression(path, state) { 9431 var node = path.node, 9432 scope = path.scope; 9433 9434 var elements = node.elements; 9435 if (!hasSpread(elements)) return; 9436 9437 var nodes = build(elements, scope, state); 9438 var first = nodes.shift(); 9439 9440 if (!t.isArrayExpression(first)) { 9441 nodes.unshift(first); 9442 first = t.arrayExpression([]); 9443 } 9444 9445 path.replaceWith(t.callExpression(t.memberExpression(first, t.identifier("concat")), nodes)); 9446 }, 9447 CallExpression: function CallExpression(path, state) { 9448 var node = path.node, 9449 scope = path.scope; 9450 9451 var args = node.arguments; 9452 if (!hasSpread(args)) return; 9453 9454 var calleePath = path.get("callee"); 9455 if (calleePath.isSuper()) return; 9456 9457 var contextLiteral = t.identifier("undefined"); 9458 9459 node.arguments = []; 9460 9461 var nodes = void 0; 9462 if (args.length === 1 && args[0].argument.name === "arguments") { 9463 nodes = [args[0].argument]; 9464 } else { 9465 nodes = build(args, scope, state); 9466 } 9467 9468 var first = nodes.shift(); 9469 if (nodes.length) { 9470 node.arguments.push(t.callExpression(t.memberExpression(first, t.identifier("concat")), nodes)); 9471 } else { 9472 node.arguments.push(first); 9473 } 9474 9475 var callee = node.callee; 9476 9477 if (calleePath.isMemberExpression()) { 9478 var temp = scope.maybeGenerateMemoised(callee.object); 9479 if (temp) { 9480 callee.object = t.assignmentExpression("=", temp, callee.object); 9481 contextLiteral = temp; 9482 } else { 9483 contextLiteral = callee.object; 9484 } 9485 t.appendToMemberExpression(callee, t.identifier("apply")); 9486 } else { 9487 node.callee = t.memberExpression(node.callee, t.identifier("apply")); 9488 } 9489 9490 if (t.isSuper(contextLiteral)) { 9491 contextLiteral = t.thisExpression(); 9492 } 9493 9494 node.arguments.unshift(contextLiteral); 9495 }, 9496 NewExpression: function NewExpression(path, state) { 9497 var node = path.node, 9498 scope = path.scope; 9499 9500 var args = node.arguments; 9501 if (!hasSpread(args)) return; 9502 9503 var nodes = build(args, scope, state); 9504 9505 var context = t.arrayExpression([t.nullLiteral()]); 9506 9507 args = t.callExpression(t.memberExpression(context, t.identifier("concat")), nodes); 9508 9509 path.replaceWith(t.newExpression(t.callExpression(t.memberExpression(t.memberExpression(t.memberExpression(t.identifier("Function"), t.identifier("prototype")), t.identifier("bind")), t.identifier("apply")), [node.callee, args]), [])); 9510 } 9511 } 9512 }; 9513 }; 9514 9515 function _interopRequireDefault(obj) { 9516 return obj && obj.__esModule ? obj : { default: obj }; 9517 } 9518 9519 module.exports = exports["default"]; 9520 9521/***/ }, 9522/* 80 */ 9523/***/ function(module, exports, __webpack_require__) { 9524 9525 "use strict"; 9526 9527 exports.__esModule = true; 9528 9529 exports.default = function () { 9530 return { 9531 visitor: { 9532 RegExpLiteral: function RegExpLiteral(path) { 9533 var node = path.node; 9534 9535 if (!regex.is(node, "y")) return; 9536 9537 path.replaceWith(t.newExpression(t.identifier("RegExp"), [t.stringLiteral(node.pattern), t.stringLiteral(node.flags)])); 9538 } 9539 } 9540 }; 9541 }; 9542 9543 var _babelHelperRegex = __webpack_require__(189); 9544 9545 var regex = _interopRequireWildcard(_babelHelperRegex); 9546 9547 var _babelTypes = __webpack_require__(1); 9548 9549 var t = _interopRequireWildcard(_babelTypes); 9550 9551 function _interopRequireWildcard(obj) { 9552 if (obj && obj.__esModule) { 9553 return obj; 9554 } else { 9555 var newObj = {};if (obj != null) { 9556 for (var key in obj) { 9557 if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; 9558 } 9559 }newObj.default = obj;return newObj; 9560 } 9561 } 9562 9563 module.exports = exports["default"]; 9564 9565/***/ }, 9566/* 81 */ 9567/***/ function(module, exports, __webpack_require__) { 9568 9569 "use strict"; 9570 9571 exports.__esModule = true; 9572 9573 var _getIterator2 = __webpack_require__(2); 9574 9575 var _getIterator3 = _interopRequireDefault(_getIterator2); 9576 9577 exports.default = function (_ref) { 9578 var t = _ref.types; 9579 9580 function isString(node) { 9581 return t.isLiteral(node) && typeof node.value === "string"; 9582 } 9583 9584 function buildBinaryExpression(left, right) { 9585 return t.binaryExpression("+", left, right); 9586 } 9587 9588 return { 9589 visitor: { 9590 TaggedTemplateExpression: function TaggedTemplateExpression(path, state) { 9591 var node = path.node; 9592 9593 var quasi = node.quasi; 9594 var args = []; 9595 9596 var strings = []; 9597 var raw = []; 9598 9599 for (var _iterator = quasi.quasis, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) { 9600 var _ref2; 9601 9602 if (_isArray) { 9603 if (_i >= _iterator.length) break; 9604 _ref2 = _iterator[_i++]; 9605 } else { 9606 _i = _iterator.next(); 9607 if (_i.done) break; 9608 _ref2 = _i.value; 9609 } 9610 9611 var elem = _ref2; 9612
9613 strings.push(t.stringLiteral(elem.value.cooked)); 9614 raw.push(t.stringLiteral(elem.value.raw)); 9615 } 9616 9617 strings = t.arrayExpression(strings); 9618 raw = t.arrayExpression(raw); 9619 9620 var templateName = "taggedTemplateLiteral"; 9621 if (state.opts.loose) templateName += "Loose"; 9622 9623 var templateObject = state.file.addTemplateObject(templateName, strings, raw); 9624 args.push(templateObject); 9625 9626 args = args.concat(quasi.expressions); 9627 9628 path.replaceWith(t.callExpression(node.tag, args)); 9629 }, 9630 TemplateLiteral: function TemplateLiteral(path, state) { 9631 var nodes = []; 9632 9633 var expressions = path.get("expressions"); 9634 9635 for (var _iterator2 = path.node.quasis, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) { 9636 var _ref3; 9637 9638 if (_isArray2) { 9639 if (_i2 >= _iterator2.length) break; 9640 _ref3 = _iterator2[_i2++]; 9641 } else { 9642 _i2 = _iterator2.next(); 9643 if (_i2.done) break; 9644 _ref3 = _i2.value; 9645 } 9646 9647 var elem = _ref3; 9648 9649 nodes.push(t.stringLiteral(elem.value.cooked)); 9650 9651 var expr = expressions.shift(); 9652 if (expr) { 9653 if (state.opts.spec && !expr.isBaseType("string") && !expr.isBaseType("number")) { 9654 nodes.push(t.callExpression(t.identifier("String"), [expr.node])); 9655 } else { 9656 nodes.push(expr.node); 9657 } 9658 } 9659 } 9660 9661 nodes = nodes.filter(function (n) { 9662 return !t.isLiteral(n, { value: "" }); 9663 }); 9664 9665 if (!isString(nodes[0]) && !isString(nodes[1])) { 9666 nodes.unshift(t.stringLiteral("")); 9667 } 9668 9669 if (nodes.length > 1) { 9670 var root = buildBinaryExpression(nodes.shift(), nodes.shift()); 9671 9672 for (var _iterator3 = nodes, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, _getIterator3.default)(_iterator3);;) { 9673 var _ref4; 9674 9675 if (_isArray3) { 9676 if (_i3 >= _iterator3.length) break; 9677 _ref4 = _iterator3[_i3++]; 9678 } else { 9679 _i3 = _iterator3.next(); 9680 if (_i3.done) break; 9681 _ref4 = _i3.value; 9682 } 9683 9684 var node = _ref4; 9685 9686 root = buildBinaryExpression(root, node); 9687 } 9688 9689 path.replaceWith(root); 9690 } else { 9691 path.replaceWith(nodes[0]); 9692 } 9693 } 9694 } 9695 }; 9696 }; 9697 9698 function _interopRequireDefault(obj) { 9699 return obj && obj.__esModule ? obj : { default: obj }; 9700 } 9701 9702 module.exports = exports["default"]; 9703 9704/***/ }, 9705/* 82 */ 9706/***/ function(module, exports, __webpack_require__) { 9707 9708 "use strict"; 9709 9710 exports.__esModule = true; 9711 9712 var _symbol = __webpack_require__(11); 9713 9714 var _symbol2 = _interopRequireDefault(_symbol); 9715 9716 exports.default = function (_ref) { 9717 var t = _ref.types; 9718 9719 var IGNORE = (0, _symbol2.default)(); 9720 9721 return { 9722 visitor: { 9723 Scope: function Scope(_ref2) { 9724 var scope = _ref2.scope; 9725 9726 if (!scope.getBinding("Symbol")) { 9727 return; 9728 } 9729 9730 scope.rename("Symbol"); 9731 }, 9732 UnaryExpression: function UnaryExpression(path) { 9733 var node = path.node, 9734 parent = path.parent; 9735 9736 if (node[IGNORE]) return; 9737 if (path.find(function (path) { 9738 return path.node && !!path.node._generated; 9739 })) return; 9740 9741 if (path.parentPath.isBinaryExpression() && t.EQUALITY_BINARY_OPERATORS.indexOf(parent.operator) >= 0) { 9742 var opposite = path.getOpposite(); 9743 if (opposite.isLiteral() && opposite.node.value !== "symbol" && opposite.node.value !== "object") { 9744 return; 9745 } 9746 } 9747 9748 if (node.operator === "typeof") { 9749 var call = t.callExpression(this.addHelper("typeof"), [node.argument]); 9750 if (path.get("argument").isIdentifier()) { 9751 var undefLiteral = t.stringLiteral("undefined"); 9752 var unary = t.unaryExpression("typeof", node.argument); 9753 unary[IGNORE] = true; 9754 path.replaceWith(t.conditionalExpression(t.binaryExpression("===", unary, undefLiteral), undefLiteral, call)); 9755 } else { 9756 path.replaceWith(call); 9757 } 9758 } 9759 } 9760 } 9761 }; 9762 }; 9763 9764 function _interopRequireDefault(obj) { 9765 return obj && obj.__esModule ? obj : { default: obj }; 9766 } 9767 9768 module.exports = exports["default"]; 9769 9770/***/ }, 9771/* 83 */ 9772/***/ function(module, exports, __webpack_require__) { 9773 9774 "use strict"; 9775 9776 exports.__esModule = true; 9777 9778 exports.default = function () { 9779 return { 9780 visitor: { 9781 RegExpLiteral: function RegExpLiteral(_ref) { 9782 var node = _ref.node; 9783 9784 if (!regex.is(node, "u")) return; 9785 node.pattern = (0, _regexpuCore2.default)(node.pattern, node.flags); 9786 regex.pullFlag(node, "u"); 9787 } 9788 } 9789 }; 9790 }; 9791 9792 var _regexpuCore = __webpack_require__(600); 9793 9794 var _regexpuCore2 = _interopRequireDefault(_regexpuCore); 9795 9796 var _babelHelperRegex = __webpack_require__(189); 9797 9798 var regex = _interopRequireWildcard(_babelHelperRegex); 9799 9800 function _interopRequireWildcard(obj) { 9801 if (obj && obj.__esModule) { 9802 return obj; 9803 } else { 9804 var newObj = {};if (obj != null) { 9805 for (var key in obj) { 9806 if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; 9807 } 9808 }newObj.default = obj;return newObj; 9809 } 9810 } 9811 9812 function _interopRequireDefault(obj) { 9813 return obj && obj.__esModule ? obj : { default: obj }; 9814 } 9815 9816 module.exports = exports["default"]; 9817 9818/***/ }, 9819/* 84 */ 9820/***/ function(module, exports, __webpack_require__) { 9821 9822 "use strict"; 9823 9824 module.exports = __webpack_require__(595); 9825 9826/***/ }, 9827/* 85 */ 9828/***/ function(module, exports, __webpack_require__) { 9829 9830 "use strict"; 9831 9832 module.exports = { "default": __webpack_require__(402), __esModule: true }; 9833 9834/***/ }, 9835/* 86 */ 9836/***/ function(module, exports, __webpack_require__) { 9837 9838 "use strict"; 9839 9840 exports.__esModule = true; 9841 exports.scope = exports.path = undefined; 9842 9843 var _weakMap = __webpack_require__(358); 9844 9845 var _weakMap2 = _interopRequireDefault(_weakMap); 9846 9847 exports.clear = clear; 9848 exports.clearPath = clearPath; 9849 exports.clearScope = clearScope; 9850 9851 function _interopRequireDefault(obj) { 9852 return obj && obj.__esModule ? obj : { default: obj }; 9853 } 9854 9855 var path = exports.path = new _weakMap2.default(); 9856 var scope = exports.scope = new _weakMap2.default(); 9857 9858 function clear() { 9859 clearPath(); 9860 clearScope(); 9861 } 9862 9863 function clearPath() { 9864 exports.path = path = new _weakMap2.default(); 9865 } 9866 9867 function clearScope() { 9868 exports.scope = scope = new _weakMap2.default(); 9869 } 9870 9871/***/ }, 9872/* 87 */
9873/***/ function(module, exports) { 9874 9875 "use strict"; 9876 9877 // 7.2.1 RequireObjectCoercible(argument) 9878 module.exports = function (it) { 9879 if (it == undefined) throw TypeError("Can't call method on " + it); 9880 return it; 9881 }; 9882 9883/***/ }, 9884/* 88 */ 9885/***/ function(module, exports, __webpack_require__) { 9886 9887 'use strict'; 9888 9889 var ctx = __webpack_require__(54), 9890 call = __webpack_require__(423), 9891 isArrayIter = __webpack_require__(422), 9892 anObject = __webpack_require__(19), 9893 toLength = __webpack_require__(148), 9894 getIterFn = __webpack_require__(234), 9895 BREAK = {}, 9896 RETURN = {}; 9897 var _exports = module.exports = function (iterable, entries, fn, that, ITERATOR) { 9898 var iterFn = ITERATOR ? function () { 9899 return iterable; 9900 } : getIterFn(iterable), 9901 f = ctx(fn, that, entries ? 2 : 1), 9902 index = 0, 9903 length, 9904 step, 9905 iterator, 9906 result; 9907 if (typeof iterFn != 'function') throw TypeError(iterable + ' is not iterable!'); 9908 // fast case for arrays with default iterator 9909 if (isArrayIter(iterFn)) for (length = toLength(iterable.length); length > index; index++) { 9910 result = entries ? f(anObject(step = iterable[index])[0], step[1]) : f(iterable[index]); 9911 if (result === BREAK || result === RETURN) return result; 9912 } else for (iterator = iterFn.call(iterable); !(step = iterator.next()).done;) { 9913 result = call(iterator, f, step.value, entries); 9914 if (result === BREAK || result === RETURN) return result; 9915 } 9916 }; 9917 _exports.BREAK = BREAK; 9918 _exports.RETURN = RETURN; 9919 9920/***/ }, 9921/* 89 */ 9922/***/ function(module, exports, __webpack_require__) { 9923 9924 'use strict'; 9925 9926 // 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) 9927 var anObject = __webpack_require__(19), 9928 dPs = __webpack_require__(426), 9929 enumBugKeys = __webpack_require__(138), 9930 IE_PROTO = __webpack_require__(145)('IE_PROTO'), 9931 Empty = function Empty() {/* empty */}, 9932 PROTOTYPE = 'prototype'; 9933 9934 // Create object with fake `null` prototype: use iframe Object with cleared prototype 9935 var _createDict = function createDict() { 9936 // Thrash, waste and sodomy: IE GC bug 9937 var iframe = __webpack_require__(226)('iframe'), 9938 i = enumBugKeys.length, 9939 lt = '<', 9940 gt = '>', 9941 iframeDocument; 9942 iframe.style.display = 'none'; 9943 __webpack_require__(421).appendChild(iframe); 9944 iframe.src = 'javascript:'; // eslint-disable-line no-script-url 9945 // createDict = iframe.contentWindow.Object; 9946 // html.removeChild(iframe); 9947 iframeDocument = iframe.contentWindow.document; 9948 iframeDocument.open(); 9949 iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt); 9950 iframeDocument.close(); 9951 _createDict = iframeDocument.F; 9952 while (i--) { 9953 delete _createDict[PROTOTYPE][enumBugKeys[i]]; 9954 }return _createDict(); 9955 }; 9956 9957 module.exports = Object.create || function create(O, Properties) { 9958 var result; 9959 if (O !== null) { 9960 Empty[PROTOTYPE] = anObject(O); 9961 result = new Empty(); 9962 Empty[PROTOTYPE] = null; 9963 // add "__proto__" for Object.getPrototypeOf polyfill 9964 result[IE_PROTO] = O; 9965 } else result = _createDict(); 9966 return Properties === undefined ? result : dPs(result, Properties); 9967 }; 9968 9969/***/ }, 9970/* 90 */ 9971/***/ function(module, exports) { 9972 9973 "use strict"; 9974 9975 exports.f = {}.propertyIsEnumerable; 9976 9977/***/ }, 9978/* 91 */ 9979/***/ function(module, exports) { 9980 9981 "use strict"; 9982 9983 module.exports = function (bitmap, value) { 9984 return { 9985 enumerable: !(bitmap & 1), 9986 configurable: !(bitmap & 2), 9987 writable: !(bitmap & 4), 9988 value: value 9989 }; 9990 }; 9991 9992/***/ }, 9993/* 92 */ 9994/***/ function(module, exports, __webpack_require__) { 9995 9996 'use strict'; 9997 9998 var def = __webpack_require__(23).f, 9999 has = __webpack_require__(27), 10000 TAG = __webpack_require__(12)('toStringTag'); 10001 10002 module.exports = function (it, tag, stat) { 10003 if (it && !has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag }); 10004 }; 10005 10006/***/ }, 10007/* 93 */ 10008/***/ function(module, exports, __webpack_require__) { 10009 10010 'use strict'; 10011 10012 // 7.1.13 ToObject(argument) 10013 var defined = __webpack_require__(87); 10014 module.exports = function (it) { 10015 return Object(defined(it)); 10016 }; 10017 10018/***/ }, 10019/* 94 */
10020/***/ function(module, exports) { 10021 10022 'use strict'; 10023 10024 var id = 0, 10025 px = Math.random(); 10026 module.exports = function (key) { 10027 return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36)); 10028 }; 10029 10030/***/ }, 10031/* 95 */ 10032/***/ function(module, exports) { 10033 10034 "use strict"; 10035 10036/***/ }, 10037/* 96 */ 10038/***/ function(module, exports, __webpack_require__) { 10039 10040 'use strict'; 10041 10042 var listCacheClear = __webpack_require__(535), 10043 listCacheDelete = __webpack_require__(536), 10044 listCacheGet = __webpack_require__(537), 10045 listCacheHas = __webpack_require__(538), 10046 listCacheSet = __webpack_require__(539); 10047 10048 /** 10049 * Creates an list cache object. 10050 * 10051 * @private 10052 * @constructor 10053 * @param {Array} [entries] The key-value pairs to cache. 10054 */ 10055 function ListCache(entries) { 10056 var index = -1, 10057 length = entries == null ? 0 : entries.length; 10058 10059 this.clear(); 10060 while (++index < length) { 10061 var entry = entries[index]; 10062 this.set(entry[0], entry[1]); 10063 } 10064 } 10065 10066 // Add methods to `ListCache`. 10067 ListCache.prototype.clear = listCacheClear; 10068 ListCache.prototype['delete'] = listCacheDelete; 10069 ListCache.prototype.get = listCacheGet; 10070 ListCache.prototype.has = listCacheHas; 10071 ListCache.prototype.set = listCacheSet; 10072 10073 module.exports = ListCache; 10074 10075/***/ }, 10076/* 97 */ 10077/***/ function(module, exports, __webpack_require__) { 10078 10079 'use strict'; 10080 10081 var ListCache = __webpack_require__(96), 10082 stackClear = __webpack_require__(554), 10083 stackDelete = __webpack_require__(555), 10084 stackGet = __webpack_require__(556), 10085 stackHas = __webpack_require__(557), 10086 stackSet = __webpack_require__(558); 10087 10088 /** 10089 * Creates a stack cache object to store key-value pairs. 10090 * 10091 * @private 10092 * @constructor 10093 * @param {Array} [entries] The key-value pairs to cache. 10094 */ 10095 function Stack(entries) { 10096 var data = this.__data__ = new ListCache(entries); 10097 this.size = data.size; 10098 } 10099 10100 // Add methods to `Stack`. 10101 Stack.prototype.clear = stackClear; 10102 Stack.prototype['delete'] = stackDelete; 10103 Stack.prototype.get = stackGet; 10104 Stack.prototype.has = stackHas; 10105 Stack.prototype.set = stackSet; 10106 10107 module.exports = Stack; 10108 10109/***/ }, 10110/* 98 */ 10111/***/ function(module, exports, __webpack_require__) { 10112 10113 'use strict'; 10114 10115 var eq = __webpack_require__(45); 10116 10117 /** 10118 * Gets the index at which the `key` is found in `array` of key-value pairs. 10119 * 10120 * @private 10121 * @param {Array} array The array to inspect. 10122 * @param {*} key The key to search for. 10123 * @returns {number} Returns the index of the matched value, else `-1`. 10124 */ 10125 function assocIndexOf(array, key) { 10126 var length = array.length; 10127 while (length--) { 10128 if (eq(array[length][0], key)) { 10129 return length; 10130 } 10131 } 10132 return -1; 10133 } 10134 10135 module.exports = assocIndexOf; 10136 10137/***/ }, 10138/* 99 */ 10139/***/ function(module, exports, __webpack_require__) { 10140 10141 'use strict'; 10142 10143 var identity = __webpack_require__(108), 10144 overRest = __webpack_require__(549), 10145 setToString = __webpack_require__(552); 10146 10147 /** 10148 * The base implementation of `_.rest` which doesn't validate or coerce arguments. 10149 * 10150 * @private 10151 * @param {Function} func The function to apply a rest parameter to. 10152 * @param {number} [start=func.length-1] The start position of the rest parameter. 10153 * @returns {Function} Returns the new function. 10154 */ 10155 function baseRest(func, start) { 10156 return setToString(overRest(func, start, identity), func + ''); 10157 } 10158 10159 module.exports = baseRest; 10160 10161/***/ }, 10162/* 100 */ 10163/***/ function(module, exports) { 10164 10165 "use strict"; 10166 10167 /** 10168 * The base implementation of `_.unary` without support for storing metadata. 10169 * 10170 * @private 10171 * @param {Function} func The function to cap arguments for. 10172 * @returns {Function} Returns the new capped function. 10173 */ 10174 function baseUnary(func) { 10175 return function (value) { 10176 return func(value); 10177 }; 10178 } 10179 10180 module.exports = baseUnary; 10181 10182/***/ }, 10183/* 101 */ 10184/***/ function(module, exports, __webpack_require__) { 10185 10186 'use strict'; 10187 10188 var baseRest = __webpack_require__(99), 10189 isIterateeCall = __webpack_require__(168); 10190 10191 /** 10192 * Creates a function like `_.assign`. 10193 * 10194 * @private 10195 * @param {Function} assigner The function to assign values. 10196 * @returns {Function} Returns the new assigner function. 10197 */ 10198 function createAssigner(assigner) { 10199 return baseRest(function (object, sources) { 10200 var index = -1, 10201 length = sources.length, 10202 customizer = length > 1 ? sources[length - 1] : undefined, 10203 guard = length > 2 ? sources[2] : undefined; 10204 10205 customizer = assigner.length > 3 && typeof customizer == 'function' ? (length--, customizer) : undefined; 10206 10207 if (guard && isIterateeCall(sources[0], sources[1], guard)) { 10208 customizer = length < 3 ? undefined : customizer; 10209 length = 1; 10210 } 10211 object = Object(object); 10212 while (++index < length) { 10213 var source = sources[index]; 10214 if (source) { 10215 assigner(object, source, index, customizer); 10216 } 10217 } 10218 return object; 10219 }); 10220 } 10221 10222 module.exports = createAssigner; 10223 10224/***/ }, 10225/* 102 */ 10226/***/ function(module, exports, __webpack_require__) { 10227 10228 'use strict'; 10229 10230 var isKeyable = __webpack_require__(533); 10231 10232 /** 10233 * Gets the data for `map`. 10234 * 10235 * @private 10236 * @param {Object} map The map to query. 10237 * @param {string} key The reference key. 10238 * @returns {*} Returns the map data. 10239 */ 10240 function getMapData(map, key) { 10241 var data = map.__data__;
10242 return isKeyable(key) ? data[typeof key == 'string' ? 'string' : 'hash'] : data.map; 10243 } 10244 10245 module.exports = getMapData; 10246 10247/***/ }, 10248/* 103 */ 10249/***/ function(module, exports) { 10250 10251 'use strict'; 10252 10253 /** Used for built-in method references. */ 10254 var objectProto = Object.prototype; 10255 10256 /** 10257 * Checks if `value` is likely a prototype object. 10258 * 10259 * @private 10260 * @param {*} value The value to check. 10261 * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. 10262 */ 10263 function isPrototype(value) { 10264 var Ctor = value && value.constructor, 10265 proto = typeof Ctor == 'function' && Ctor.prototype || objectProto; 10266 10267 return value === proto; 10268 } 10269 10270 module.exports = isPrototype; 10271 10272/***/ }, 10273/* 104 */ 10274/***/ function(module, exports, __webpack_require__) { 10275 10276 'use strict'; 10277 10278 var getNative = __webpack_require__(38); 10279 10280 /* Built-in method references that are verified to be native. */ 10281 var nativeCreate = getNative(Object, 'create'); 10282 10283 module.exports = nativeCreate; 10284 10285/***/ }, 10286/* 105 */ 10287/***/ function(module, exports) { 10288 10289 "use strict"; 10290 10291 /** 10292 * Converts `set` to an array of its values. 10293 * 10294 * @private 10295 * @param {Object} set The set to convert. 10296 * @returns {Array} Returns the values. 10297 */ 10298 function setToArray(set) { 10299 var index = -1, 10300 result = Array(set.size); 10301 10302 set.forEach(function (value) { 10303 result[++index] = value; 10304 }); 10305 return result; 10306 } 10307 10308 module.exports = setToArray; 10309 10310/***/ }, 10311/* 106 */ 10312/***/ function(module, exports, __webpack_require__) { 10313 10314 'use strict'; 10315 10316 var isSymbol = __webpack_require__(60); 10317 10318 /** Used as references for various `Number` constants. */ 10319 var INFINITY = 1 / 0; 10320 10321 /** 10322 * Converts `value` to a string key if it's not a string or symbol. 10323 * 10324 * @private 10325 * @param {*} value The value to inspect. 10326 * @returns {string|symbol} Returns the key. 10327 */ 10328 function toKey(value) { 10329 if (typeof value == 'string' || isSymbol(value)) { 10330 return value; 10331 } 10332 var result = value + ''; 10333 return result == '0' && 1 / value == -INFINITY ? '-0' : result; 10334 } 10335 10336 module.exports = toKey; 10337 10338/***/ }, 10339/* 107 */ 10340/***/ function(module, exports, __webpack_require__) { 10341 10342 'use strict'; 10343 10344 var baseClone = __webpack_require__(160); 10345 10346 /** Used to compose bitmasks for cloning. */ 10347 var CLONE_SYMBOLS_FLAG = 4; 10348 10349 /** 10350 * Creates a shallow clone of `value`. 10351 * 10352 * **Note:** This method is loosely based on the 10353 * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm) 10354 * and supports cloning arrays, array buffers, booleans, date objects, maps, 10355 * numbers, `Object` objects, regexes, sets, strings, symbols, and typed 10356 * arrays. The own enumerable properties of `arguments` objects are cloned 10357 * as plain objects. An empty object is returned for uncloneable values such 10358 * as error objects, functions, DOM nodes, and WeakMaps. 10359 * 10360 * @static 10361 * @memberOf _ 10362 * @since 0.1.0 10363 * @category Lang 10364 * @param {*} value The value to clone. 10365 * @returns {*} Returns the cloned value. 10366 * @see _.cloneDeep 10367 * @example 10368 * 10369 * var objects = [{ 'a': 1 }, { 'b': 2 }]; 10370 * 10371 * var shallow = _.clone(objects); 10372 * console.log(shallow[0] === objects[0]); 10373 * // => true 10374 */ 10375 function clone(value) { 10376 return baseClone(value, CLONE_SYMBOLS_FLAG); 10377 } 10378 10379 module.exports = clone; 10380 10381/***/ }, 10382/* 108 */ 10383/***/ function(module, exports) { 10384 10385 "use strict"; 10386 10387 /** 10388 * This method returns the first argument it receives. 10389 * 10390 * @static 10391 * @since 0.1.0 10392 * @memberOf _ 10393 * @category Util 10394 * @param {*} value Any value. 10395 * @returns {*} Returns `value`. 10396 * @example 10397 * 10398 * var object = { 'a': 1 }; 10399 * 10400 * console.log(_.identity(object) === object); 10401 * // => true 10402 */ 10403 function identity(value) { 10404 return value; 10405 } 10406 10407 module.exports = identity; 10408 10409/***/ }, 10410/* 109 */ 10411/***/ function(module, exports, __webpack_require__) { 10412 10413 'use strict'; 10414 10415 var baseIndexOf = __webpack_require__(162), 10416 isArrayLike = __webpack_require__(24), 10417 isString = __webpack_require__(576), 10418 toInteger = __webpack_require__(47), 10419 values = __webpack_require__(276); 10420 10421 /* Built-in method references for those with the same name as other `lodash` methods. */ 10422 var nativeMax = Math.max; 10423 10424 /** 10425 * Checks if `value` is in `collection`. If `collection` is a string, it's 10426 * checked for a substring of `value`, otherwise 10427 * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) 10428 * is used for equality comparisons. If `fromIndex` is negative, it's used as 10429 * the offset from the end of `collection`. 10430 * 10431 * @static 10432 * @memberOf _ 10433 * @since 0.1.0 10434 * @category Collection 10435 * @param {Array|Object|string} collection The collection to inspect. 10436 * @param {*} value The value to search for. 10437 * @param {number} [fromIndex=0] The index to search from. 10438 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`. 10439 * @returns {boolean} Returns `true` if `value` is found, else `false`. 10440 * @example 10441 * 10442 * _.includes([1, 2, 3], 1); 10443 * // => true 10444 * 10445 * _.includes([1, 2, 3], 1, 2); 10446 * // => false 10447 * 10448 * _.includes({ 'a': 1, 'b': 2 }, 1); 10449 * // => true 10450 * 10451 * _.includes('abcd', 'bc'); 10452 * // => true 10453 */ 10454 function includes(collection, value, fromIndex, guard) { 10455 collection = isArrayLike(collection) ? collection : values(collection); 10456 fromIndex = fromIndex && !guard ? toInteger(fromIndex) : 0; 10457 10458 var length = collection.length; 10459 if (fromIndex < 0) { 10460 fromIndex = nativeMax(length + fromIndex, 0); 10461 } 10462 return isString(collection) ? fromIndex <= length && collection.indexOf(value, fromIndex) > -1 : !!length && baseIndexOf(collection, value, fromIndex) > -1; 10463 } 10464 10465 module.exports = includes; 10466 10467/***/ }, 10468/* 110 */ 10469/***/ function(module, exports, __webpack_require__) { 10470 10471 'use strict'; 10472 10473 var baseIsArguments = __webpack_require__(482), 10474 isObjectLike = __webpack_require__(25); 10475 10476 /** Used for built-in method references. */ 10477 var objectProto = Object.prototype; 10478 10479 /** Used to check objects for own properties. */ 10480 var hasOwnProperty = objectProto.hasOwnProperty; 10481 10482 /** Built-in value references. */ 10483 var propertyIsEnumerable = objectProto.propertyIsEnumerable; 10484 10485 /** 10486 * Checks if `value` is likely an `arguments` object. 10487 * 10488 * @static 10489 * @memberOf _ 10490 * @since 0.1.0 10491 * @category Lang 10492 * @param {*} value The value to check. 10493 * @returns {boolean} Returns `true` if `value` is an `arguments` object, 10494 * else `false`. 10495 * @example 10496 * 10497 * _.isArguments(function() { return arguments; }()); 10498 * // => true 10499 * 10500 * _.isArguments([1, 2, 3]); 10501 * // => false 10502 */ 10503 var isArguments = baseIsArguments(function () { 10504 return arguments; 10505 }()) ? baseIsArguments : function (value) { 10506 return isObjectLike(value) && hasOwnProperty.call(value, 'callee') && !propertyIsEnumerable.call(value, 'callee'); 10507 }; 10508 10509 module.exports = isArguments; 10510 10511/***/ }, 10512/* 111 */ 10513/***/ function(module, exports, __webpack_require__) { 10514 10515 /* WEBPACK VAR INJECTION */(function(module) {'use strict'; 10516 10517 var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; 10518 10519 var root = __webpack_require__(15), 10520 stubFalse = __webpack_require__(585); 10521 10522 /** Detect free variable `exports`. */ 10523 var freeExports = ( false ? 'undefined' : _typeof(exports)) == 'object' && exports && !exports.nodeType && exports; 10524 10525 /** Detect free variable `module`. */ 10526 var freeModule = freeExports && ( false ? 'undefined' : _typeof(module)) == 'object' && module && !module.nodeType && module; 10527 10528 /** Detect the popular CommonJS extension `module.exports`. */ 10529 var moduleExports = freeModule && freeModule.exports === freeExports; 10530 10531 /** Built-in value references. */ 10532 var Buffer = moduleExports ? root.Buffer : undefined; 10533 10534 /* Built-in method references for those with the same name as other `lodash` methods. */ 10535 var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined; 10536 10537 /** 10538 * Checks if `value` is a buffer. 10539 * 10540 * @static 10541 * @memberOf _ 10542 * @since 4.3.0 10543 * @category Lang 10544 * @param {*} value The value to check. 10545 * @returns {boolean} Returns `true` if `value` is a buffer, else `false`. 10546 * @example 10547 * 10548 * _.isBuffer(new Buffer(2)); 10549 * // => true 10550 * 10551 * _.isBuffer(new Uint8Array(2)); 10552 * // => false 10553 */ 10554 var isBuffer = nativeIsBuffer || stubFalse; 10555 10556 module.exports = isBuffer; 10557 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(39)(module))) 10558 10559/***/ }, 10560/* 112 */ 10561/***/ function(module, exports, __webpack_require__) { 10562 10563 'use strict'; 10564 10565 var baseToString = __webpack_require__(249); 10566 10567 /** 10568 * Converts `value` to a string. An empty string is returned for `null` 10569 * and `undefined` values. The sign of `-0` is preserved. 10570 * 10571 * @static 10572 * @memberOf _ 10573 * @since 4.0.0 10574 * @category Lang 10575 * @param {*} value The value to convert. 10576 * @returns {string} Returns the converted string. 10577 * @example 10578 * 10579 * _.toString(null); 10580 * // => '' 10581 * 10582 * _.toString(-0); 10583 * // => '-0' 10584 * 10585 * _.toString([1, 2, 3]); 10586 * // => '1,2,3' 10587 */ 10588 function toString(value) { 10589 return value == null ? '' : baseToString(value); 10590 } 10591 10592 module.exports = toString; 10593 10594/***/ }, 10595/* 113 */ 1059695, 10597/* 114 */ 10598/***/ function(module, exports, __webpack_require__) { 10599 10600 /* WEBPACK VAR INJECTION */(function(global, process) {'use strict'; 10601 10602 var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; 10603 10604 // Copyright Joyent, Inc. and other Node contributors. 10605 // 10606 // Permission is hereby granted, free of charge, to any person obtaining a 10607 // copy of this software and associated documentation files (the 10608 // "Software"), to deal in the Software without restriction, including 10609 // without limitation the rights to use, copy, modify, merge, publish, 10610 // distribute, sublicense, and/or sell copies of the Software, and to permit 10611 // persons to whom the Software is furnished to do so, subject to the 10612 // following conditions: 10613 // 10614 // The above copyright notice and this permission notice shall be included 10615 // in all copies or substantial portions of the Software. 10616 // 10617 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 10618 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 10619 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN 10620 // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 10621 // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 10622 // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE 10623 // USE OR OTHER DEALINGS IN THE SOFTWARE. 10624 10625 var formatRegExp = /%[sdj%]/g; 10626 exports.format = function (f) { 10627 if (!isString(f)) { 10628 var objects = []; 10629 for (var i = 0; i < arguments.length; i++) { 10630 objects.push(inspect(arguments[i])); 10631 } 10632 return objects.join(' '); 10633 } 10634 10635 var i = 1; 10636 var args = arguments; 10637 var len = args.length; 10638 var str = String(f).replace(formatRegExp, function (x) { 10639 if (x === '%%') return '%'; 10640 if (i >= len) return x; 10641 switch (x) { 10642 case '%s': 10643 return String(args[i++]); 10644 case '%d': 10645 return Number(args[i++]); 10646 case '%j': 10647 try { 10648 return JSON.stringify(args[i++]); 10649 } catch (_) { 10650 return '[Circular]'; 10651 } 10652 default: 10653 return x; 10654 } 10655 }); 10656 for (var x = args[i]; i < len; x = args[++i]) { 10657 if (isNull(x) || !isObject(x)) { 10658 str += ' ' + x; 10659 } else { 10660 str += ' ' + inspect(x); 10661 } 10662 } 10663 return str; 10664 }; 10665 10666 // Mark that a method should not be used. 10667 // Returns a modified function which warns once by default. 10668 // If --no-deprecation is set, then it is a no-op. 10669 exports.deprecate = function (fn, msg) { 10670 // Allow for deprecating things in the process of starting up. 10671 if (isUndefined(global.process)) { 10672 return function () { 10673 return exports.deprecate(fn, msg).apply(this, arguments); 10674 }; 10675 } 10676 10677 if (process.noDeprecation === true) { 10678 return fn; 10679 } 10680 10681 var warned = false;
vendor: 4,108 bytes, lines 10682-10835
10682 function deprecated() { 10683 if (!warned) { 10684 if (process.throwDeprecation) { 10685 throw new Error(msg); 10686 } else if (process.traceDeprecation) { 10687 console.trace(msg); 10688 } else { 10689 console.error(msg); 10690 } 10691 warned = true; 10692 } 10693 return fn.apply(this, arguments); 10694 } 10695 10696 return deprecated; 10697 }; 10698 10699 var debugs = {}; 10700 var debugEnviron; 10701 exports.debuglog = function (set) { 10702 if (isUndefined(debugEnviron)) debugEnviron = process.env.NODE_DEBUG || ''; 10703 set = set.toUpperCase(); 10704 if (!debugs[set]) { 10705 if (new RegExp('\\b' + set + '\\b', 'i').test(debugEnviron)) { 10706 var pid = process.pid; 10707 debugs[set] = function () { 10708 var msg = exports.format.apply(exports, arguments); 10709 console.error('%s %d: %s', set, pid, msg); 10710 }; 10711 } else { 10712 debugs[set] = function () {}; 10713 } 10714 } 10715 return debugs[set]; 10716 }; 10717 10718 /** 10719 * Echos the value of a value. Trys to print the value out 10720 * in the best way possible given the different types. 10721 * 10722 * @param {Object} obj The object to print out. 10723 * @param {Object} opts Optional options object that alters the output. 10724 */ 10725 /* legacy: obj, showHidden, depth, colors*/ 10726 function inspect(obj, opts) { 10727 // default options 10728 var ctx = { 10729 seen: [], 10730 stylize: stylizeNoColor 10731 }; 10732 // legacy... 10733 if (arguments.length >= 3) ctx.depth = arguments[2]; 10734 if (arguments.length >= 4) ctx.colors = arguments[3]; 10735 if (isBoolean(opts)) { 10736 // legacy... 10737 ctx.showHidden = opts; 10738 } else if (opts) { 10739 // got an "options" object 10740 exports._extend(ctx, opts); 10741 } 10742 // set default options 10743 if (isUndefined(ctx.showHidden)) ctx.showHidden = false; 10744 if (isUndefined(ctx.depth)) ctx.depth = 2; 10745 if (isUndefined(ctx.colors)) ctx.colors = false; 10746 if (isUndefined(ctx.customInspect)) ctx.customInspect = true; 10747 if (ctx.colors) ctx.stylize = stylizeWithColor; 10748 return formatValue(ctx, obj, ctx.depth); 10749 } 10750 exports.inspect = inspect; 10751 10752 // http://en.wikipedia.org/wiki/ANSI_escape_code#graphics 10753 inspect.colors = { 10754 'bold': [1, 22], 10755 'italic': [3, 23], 10756 'underline': [4, 24], 10757 'inverse': [7, 27], 10758 'white': [37, 39], 10759 'grey': [90, 39], 10760 'black': [30, 39], 10761 'blue': [34, 39], 10762 'cyan': [36, 39], 10763 'green': [32, 39], 10764 'magenta': [35, 39], 10765 'red': [31, 39], 10766 'yellow': [33, 39] 10767 }; 10768 10769 // Don't use 'blue' not visible on cmd.exe 10770 inspect.styles = { 10771 'special': 'cyan', 10772 'number': 'yellow', 10773 'boolean': 'yellow', 10774 'undefined': 'grey', 10775 'null': 'bold', 10776 'string': 'green', 10777 'date': 'magenta', 10778 // "name": intentionally not styling 10779 'regexp': 'red' 10780 }; 10781 10782 function stylizeWithColor(str, styleType) { 10783 var style = inspect.styles[styleType]; 10784 10785 if (style) { 10786 return '\x1B[' + inspect.colors[style][0] + 'm' + str + '\x1B[' + inspect.colors[style][1] + 'm'; 10787 } else { 10788 return str; 10789 } 10790 } 10791 10792 function stylizeNoColor(str, styleType) { 10793 return str; 10794 } 10795 10796 function arrayToHash(array) { 10797 var hash = {}; 10798 10799 array.forEach(function (val, idx) { 10800 hash[val] = true; 10801 }); 10802 10803 return hash; 10804 } 10805 10806 function formatValue(ctx, value, recurseTimes) { 10807 // Provide a hook for user-specified inspect functions. 10808 // Check that value is an object with an inspect function on it 10809 if (ctx.customInspect && value && isFunction(value.inspect) && 10810 // Filter out the util module, it's inspect function is special 10811 value.inspect !== exports.inspect && 10812 // Also filter out any prototype objects using the circular check. 10813 !(value.constructor && value.constructor.prototype === value)) { 10814 var ret = value.inspect(recurseTimes, ctx); 10815 if (!isString(ret)) { 10816 ret = formatValue(ctx, ret, recurseTimes); 10817 } 10818 return ret; 10819 } 10820 10821 // Primitive types cannot have properties 10822 var primitive = formatPrimitive(ctx, value); 10823 if (primitive) { 10824 return primitive; 10825 } 10826 10827 // Look up the keys of the object. 10828 var keys = Object.keys(value); 10829 var visibleKeys = arrayToHash(keys); 10830 10831 if (ctx.showHidden) { 10832 keys = Object.getOwnPropertyNames(value); 10833 } 10834 10835 // IE doesn't make error fields non-enumerable
vendor: 8,967 bytes, lines 10836-11139
10836 // http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx 10837 if (isError(value) && (keys.indexOf('message') >= 0 || keys.indexOf('description') >= 0)) { 10838 return formatError(value); 10839 } 10840 10841 // Some type of object without properties can be shortcutted. 10842 if (keys.length === 0) { 10843 if (isFunction(value)) { 10844 var name = value.name ? ': ' + value.name : ''; 10845 return ctx.stylize('[Function' + name + ']', 'special'); 10846 } 10847 if (isRegExp(value)) { 10848 return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp'); 10849 } 10850 if (isDate(value)) { 10851 return ctx.stylize(Date.prototype.toString.call(value), 'date'); 10852 } 10853 if (isError(value)) { 10854 return formatError(value); 10855 } 10856 } 10857 10858 var base = '', 10859 array = false, 10860 braces = ['{', '}']; 10861 10862 // Make Array say that they are Array 10863 if (isArray(value)) { 10864 array = true; 10865 braces = ['[', ']']; 10866 } 10867 10868 // Make functions say that they are functions 10869 if (isFunction(value)) { 10870 var n = value.name ? ': ' + value.name : ''; 10871 base = ' [Function' + n + ']'; 10872 } 10873 10874 // Make RegExps say that they are RegExps 10875 if (isRegExp(value)) { 10876 base = ' ' + RegExp.prototype.toString.call(value); 10877 } 10878 10879 // Make dates with properties first say the date 10880 if (isDate(value)) { 10881 base = ' ' + Date.prototype.toUTCString.call(value); 10882 } 10883 10884 // Make error with message first say the error 10885 if (isError(value)) { 10886 base = ' ' + formatError(value); 10887 } 10888 10889 if (keys.length === 0 && (!array || value.length == 0)) { 10890 return braces[0] + base + braces[1]; 10891 } 10892 10893 if (recurseTimes < 0) { 10894 if (isRegExp(value)) { 10895 return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp'); 10896 } else { 10897 return ctx.stylize('[Object]', 'special'); 10898 } 10899 } 10900 10901 ctx.seen.push(value); 10902 10903 var output; 10904 if (array) { 10905 output = formatArray(ctx, value, recurseTimes, visibleKeys, keys); 10906 } else { 10907 output = keys.map(function (key) { 10908 return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array); 10909 }); 10910 } 10911 10912 ctx.seen.pop(); 10913 10914 return reduceToSingleString(output, base, braces); 10915 } 10916 10917 function formatPrimitive(ctx, value) { 10918 if (isUndefined(value)) return ctx.stylize('undefined', 'undefined'); 10919 if (isString(value)) { 10920 var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '').replace(/'/g, "\\'").replace(/\\"/g, '"') + '\''; 10921 return ctx.stylize(simple, 'string'); 10922 } 10923 if (isNumber(value)) return ctx.stylize('' + value, 'number'); 10924 if (isBoolean(value)) return ctx.stylize('' + value, 'boolean'); 10925 // For some reason typeof null is "object", so special case here. 10926 if (isNull(value)) return ctx.stylize('null', 'null'); 10927 } 10928 10929 function formatError(value) { 10930 return '[' + Error.prototype.toString.call(value) + ']'; 10931 } 10932 10933 function formatArray(ctx, value, recurseTimes, visibleKeys, keys) { 10934 var output = []; 10935 for (var i = 0, l = value.length; i < l; ++i) { 10936 if (hasOwnProperty(value, String(i))) { 10937 output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, String(i), true)); 10938 } else { 10939 output.push(''); 10940 } 10941 } 10942 keys.forEach(function (key) { 10943 if (!key.match(/^\d+$/)) { 10944 output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, key, true)); 10945 } 10946 }); 10947 return output; 10948 } 10949 10950 function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) { 10951 var name, str, desc; 10952 desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] }; 10953 if (desc.get) { 10954 if (desc.set) { 10955 str = ctx.stylize('[Getter/Setter]', 'special'); 10956 } else { 10957 str = ctx.stylize('[Getter]', 'special'); 10958 } 10959 } else { 10960 if (desc.set) { 10961 str = ctx.stylize('[Setter]', 'special'); 10962 } 10963 } 10964 if (!hasOwnProperty(visibleKeys, key)) { 10965 name = '[' + key + ']'; 10966 } 10967 if (!str) { 10968 if (ctx.seen.indexOf(desc.value) < 0) { 10969 if (isNull(recurseTimes)) { 10970 str = formatValue(ctx, desc.value, null); 10971 } else { 10972 str = formatValue(ctx, desc.value, recurseTimes - 1); 10973 } 10974 if (str.indexOf('\n') > -1) { 10975 if (array) { 10976 str = str.split('\n').map(function (line) { 10977 return ' ' + line; 10978 }).join('\n').substr(2); 10979 } else { 10980 str = '\n' + str.split('\n').map(function (line) { 10981 return ' ' + line; 10982 }).join('\n'); 10983 } 10984 } 10985 } else { 10986 str = ctx.stylize('[Circular]', 'special'); 10987 } 10988 } 10989 if (isUndefined(name)) { 10990 if (array && key.match(/^\d+$/)) { 10991 return str; 10992 } 10993 name = JSON.stringify('' + key); 10994 if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) { 10995 name = name.substr(1, name.length - 2); 10996 name = ctx.stylize(name, 'name'); 10997 } else { 10998 name = name.replace(/'/g, "\\'").replace(/\\"/g, '"').replace(/(^"|"$)/g, "'"); 10999 name = ctx.stylize(name, 'string'); 11000 } 11001 } 11002 11003 return name + ': ' + str; 11004 } 11005 11006 function reduceToSingleString(output, base, braces) { 11007 var numLinesEst = 0; 11008 var length = output.reduce(function (prev, cur) { 11009 numLinesEst++; 11010 if (cur.indexOf('\n') >= 0) numLinesEst++; 11011 return prev + cur.replace(/\u001b\[\d\d?m/g, '').length + 1; 11012 }, 0); 11013 11014 if (length > 60) { 11015 return braces[0] + (base === '' ? '' : base + '\n ') + ' ' + output.join(',\n ') + ' ' + braces[1]; 11016 } 11017 11018 return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1]; 11019 } 11020 11021 // NOTE: These type checking functions intentionally don't use `instanceof` 11022 // because it is fragile and can be easily faked with `Object.create()`. 11023 function isArray(ar) { 11024 return Array.isArray(ar); 11025 } 11026 exports.isArray = isArray; 11027 11028 function isBoolean(arg) { 11029 return typeof arg === 'boolean'; 11030 } 11031 exports.isBoolean = isBoolean; 11032 11033 function isNull(arg) { 11034 return arg === null; 11035 } 11036 exports.isNull = isNull; 11037 11038 function isNullOrUndefined(arg) { 11039 return arg == null; 11040 } 11041 exports.isNullOrUndefined = isNullOrUndefined; 11042 11043 function isNumber(arg) { 11044 return typeof arg === 'number'; 11045 } 11046 exports.isNumber = isNumber; 11047 11048 function isString(arg) { 11049 return typeof arg === 'string'; 11050 } 11051 exports.isString = isString; 11052 11053 function isSymbol(arg) { 11054 return (typeof arg === 'undefined' ? 'undefined' : _typeof(arg)) === 'symbol'; 11055 } 11056 exports.isSymbol = isSymbol; 11057 11058 function isUndefined(arg) { 11059 return arg === void 0; 11060 } 11061 exports.isUndefined = isUndefined; 11062 11063 function isRegExp(re) { 11064 return isObject(re) && objectToString(re) === '[object RegExp]'; 11065 } 11066 exports.isRegExp = isRegExp; 11067 11068 function isObject(arg) { 11069 return (typeof arg === 'undefined' ? 'undefined' : _typeof(arg)) === 'object' && arg !== null; 11070 } 11071 exports.isObject = isObject; 11072 11073 function isDate(d) { 11074 return isObject(d) && objectToString(d) === '[object Date]'; 11075 } 11076 exports.isDate = isDate; 11077 11078 function isError(e) { 11079 return isObject(e) && (objectToString(e) === '[object Error]' || e instanceof Error); 11080 } 11081 exports.isError = isError; 11082 11083 function isFunction(arg) { 11084 return typeof arg === 'function'; 11085 } 11086 exports.isFunction = isFunction; 11087 11088 function isPrimitive(arg) { 11089 return arg === null || typeof arg === 'boolean' || typeof arg === 'number' || typeof arg === 'string' || (typeof arg === 'undefined' ? 'undefined' : _typeof(arg)) === 'symbol' || // ES6 symbol 11090 typeof arg === 'undefined'; 11091 } 11092 exports.isPrimitive = isPrimitive; 11093 11094 exports.isBuffer = __webpack_require__(615); 11095 11096 function objectToString(o) { 11097 return Object.prototype.toString.call(o); 11098 } 11099 11100 function pad(n) { 11101 return n < 10 ? '0' + n.toString(10) : n.toString(10); 11102 } 11103 11104 var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']; 11105 11106 // 26 Feb 16:19:34 11107 function timestamp() { 11108 var d = new Date(); 11109 var time = [pad(d.getHours()), pad(d.getMinutes()), pad(d.getSeconds())].join(':'); 11110 return [d.getDate(), months[d.getMonth()], time].join(' '); 11111 } 11112 11113 // log is just a thin wrapper to console.log that prepends a timestamp 11114 exports.log = function () { 11115 console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments)); 11116 }; 11117 11118 /** 11119 * Inherit the prototype methods from one constructor into another. 11120 * 11121 * The Function.prototype.inherits from lang.js rewritten as a standalone 11122 * function (not on Function.prototype). NOTE: If this file is to be loaded 11123 * during bootstrapping this function needs to be rewritten using some native 11124 * functions as prototype setup using normal JavaScript does not work as 11125 * expected during bootstrapping (see mirror.js in r114903). 11126 * 11127 * @param {function} ctor Constructor function which needs to inherit the 11128 * prototype. 11129 * @param {function} superCtor Constructor function to inherit prototype from. 11130 */ 11131 exports.inherits = __webpack_require__(614); 11132 11133 exports._extend = function (origin, add) { 11134 // Don't do anything if add isn't an object 11135 if (!add || !isObject(add)) return origin; 11136 11137 var keys = Object.keys(add); 11138 var i = keys.length; 11139 while (i--) {
11140 origin[keys[i]] = add[keys[i]]; 11141 } 11142 return origin; 11143 }; 11144 11145 function hasOwnProperty(obj, prop) { 11146 return Object.prototype.hasOwnProperty.call(obj, prop); 11147 } 11148 /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()), __webpack_require__(9))) 11149 11150/***/ }, 11151/* 115 */ 11152/***/ function(module, exports, __webpack_require__) { 11153 11154 /* WEBPACK VAR INJECTION */(function(process) {"use strict"; 11155 11156 exports.__esModule = true; 11157 11158 var _typeof2 = __webpack_require__(6); 11159 11160 var _typeof3 = _interopRequireDefault(_typeof2); 11161 11162 exports.default = function (loc) { 11163 var relative = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : process.cwd(); 11164 11165 if ((typeof _module2.default === "undefined" ? "undefined" : (0, _typeof3.default)(_module2.default)) === "object") return null; 11166 11167 var relativeMod = relativeModules[relative]; 11168 11169 if (!relativeMod) { 11170 relativeMod = new _module2.default(); 11171 11172 var filename = _path2.default.join(relative, ".babelrc"); 11173 relativeMod.id = filename; 11174 relativeMod.filename = filename; 11175 11176 relativeMod.paths = _module2.default._nodeModulePaths(relative); 11177 relativeModules[relative] = relativeMod; 11178 } 11179 11180 try { 11181 return _module2.default._resolveFilename(loc, relativeMod); 11182 } catch (err) { 11183 return null; 11184 } 11185 }; 11186 11187 var _module = __webpack_require__(113); 11188 11189 var _module2 = _interopRequireDefault(_module); 11190 11191 var _path = __webpack_require__(17); 11192 11193 var _path2 = _interopRequireDefault(_path); 11194 11195 function _interopRequireDefault(obj) { 11196 return obj && obj.__esModule ? obj : { default: obj }; 11197 } 11198 11199 var relativeModules = {}; 11200 11201 module.exports = exports["default"]; 11202 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(9))) 11203 11204/***/ }, 11205/* 116 */ 11206/***/ function(module, exports, __webpack_require__) { 11207 11208 "use strict"; 11209 11210 exports.__esModule = true; 11211 11212 var _map = __webpack_require__(130); 11213 11214 var _map2 = _interopRequireDefault(_map); 11215 11216 var _classCallCheck2 = __webpack_require__(3); 11217 11218 var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); 11219 11220 var _possibleConstructorReturn2 = __webpack_require__(42); 11221 11222 var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); 11223 11224 var _inherits2 = __webpack_require__(41); 11225 11226 var _inherits3 = _interopRequireDefault(_inherits2); 11227 11228 function _interopRequireDefault(obj) { 11229 return obj && obj.__esModule ? obj : { default: obj }; 11230 } 11231 11232 var Store = function (_Map) { 11233 (0, _inherits3.default)(Store, _Map); 11234 11235 function Store() { 11236 (0, _classCallCheck3.default)(this, Store); 11237 11238 var _this = (0, _possibleConstructorReturn3.default)(this, _Map.call(this)); 11239 11240 _this.dynamicData = {}; 11241 return _this; 11242 } 11243 11244 Store.prototype.setDynamic = function setDynamic(key, fn) { 11245 this.dynamicData[key] = fn; 11246 }; 11247 11248 Store.prototype.get = function get(key) { 11249 if (this.has(key)) { 11250 return _Map.prototype.get.call(this, key); 11251 } else { 11252 if (Object.prototype.hasOwnProperty.call(this.dynamicData, key)) { 11253 var val = this.dynamicData[key](); 11254 this.set(key, val); 11255 return val; 11256 } 11257 } 11258 }; 11259 11260 return Store; 11261 }(_map2.default); 11262 11263 exports.default = Store; 11264 module.exports = exports["default"]; 11265 11266/***/ }, 11267/* 117 */ 11268/***/ function(module, exports, __webpack_require__) { 11269 11270 "use strict"; 11271 11272 exports.__esModule = true; 11273 11274 var _classCallCheck2 = __webpack_require__(3); 11275 11276 var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); 11277 11278 var _node = __webpack_require__(235); 11279 11280 var _node2 = _interopRequireDefault(_node); 11281 11282 function _interopRequireDefault(obj) { 11283 return obj && obj.__esModule ? obj : { default: obj }; 11284 } 11285 11286 var verboseDebug = (0, _node2.default)("babel:verbose"); 11287 var generalDebug = (0, _node2.default)("babel"); 11288 11289 var seenDeprecatedMessages = []; 11290 11291 var Logger = function () { 11292 function Logger(file, filename) { 11293 (0, _classCallCheck3.default)(this, Logger); 11294 11295 this.filename = filename; 11296 this.file = file; 11297 } 11298 11299 Logger.prototype._buildMessage = function _buildMessage(msg) { 11300 var parts = "[BABEL] " + this.filename; 11301 if (msg) parts += ": " + msg; 11302 return parts; 11303 }; 11304 11305 Logger.prototype.warn = function warn(msg) { 11306 console.warn(this._buildMessage(msg)); 11307 }; 11308 11309 Logger.prototype.error = function error(msg) { 11310 var Constructor = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Error; 11311 11312 throw new Constructor(this._buildMessage(msg)); 11313 }; 11314 11315 Logger.prototype.deprecate = function deprecate(msg) { 11316 if (this.file.opts && this.file.opts.suppressDeprecationMessages) return; 11317 11318 msg = this._buildMessage(msg); 11319 11320 if (seenDeprecatedMessages.indexOf(msg) >= 0) return; 11321 11322 seenDeprecatedMessages.push(msg); 11323 11324 console.error(msg); 11325 }; 11326 11327 Logger.prototype.verbose = function verbose(msg) { 11328 if (verboseDebug.enabled) verboseDebug(this._buildMessage(msg)); 11329 }; 11330 11331 Logger.prototype.debug = function debug(msg) { 11332 if (generalDebug.enabled) generalDebug(this._buildMessage(msg)); 11333 }; 11334 11335 Logger.prototype.deopt = function deopt(node, msg) { 11336 this.debug(msg); 11337 }; 11338 11339 return Logger; 11340 }(); 11341 11342 exports.default = Logger; 11343 module.exports = exports["default"]; 11344 11345/***/ }, 11346/* 118 */ 11347/***/ function(module, exports, __webpack_require__) { 11348 11349 "use strict"; 11350 11351 exports.__esModule = true; 11352 exports.ImportDeclaration = exports.ModuleDeclaration = undefined; 11353 11354 var _getIterator2 = __webpack_require__(2); 11355 11356 var _getIterator3 = _interopRequireDefault(_getIterator2); 11357 11358 exports.ExportDeclaration = ExportDeclaration; 11359 exports.Scope = Scope; 11360 11361 var _babelTypes = __webpack_require__(1); 11362 11363 var t = _interopRequireWildcard(_babelTypes); 11364 11365 function _interopRequireWildcard(obj) { 11366 if (obj && obj.__esModule) { 11367 return obj; 11368 } else { 11369 var newObj = {};if (obj != null) { 11370 for (var key in obj) { 11371 if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; 11372 } 11373 }newObj.default = obj;return newObj; 11374 } 11375 } 11376 11377 function _interopRequireDefault(obj) { 11378 return obj && obj.__esModule ? obj : { default: obj }; 11379 } 11380 11381 var ModuleDeclaration = exports.ModuleDeclaration = { 11382 enter: function enter(path, file) { 11383 var node = path.node; 11384 11385 if (node.source) { 11386 node.source.value = file.resolveModuleSource(node.source.value); 11387 } 11388 } 11389 }; 11390 11391 var ImportDeclaration = exports.ImportDeclaration = { 11392 exit: function exit(path, file) { 11393 var node = path.node; 11394 11395 var specifiers = []; 11396 var imported = []; 11397 file.metadata.modules.imports.push({ 11398 source: node.source.value, 11399 imported: imported, 11400 specifiers: specifiers 11401 }); 11402 11403 for (var _iterator = path.get("specifiers"), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) { 11404 var _ref; 11405 11406 if (_isArray) { 11407 if (_i >= _iterator.length) break; 11408 _ref = _iterator[_i++]; 11409 } else { 11410 _i = _iterator.next(); 11411 if (_i.done) break; 11412 _ref = _i.value; 11413 } 11414 11415 var specifier = _ref;
11416 11417 var local = specifier.node.local.name; 11418 11419 if (specifier.isImportDefaultSpecifier()) { 11420 imported.push("default"); 11421 specifiers.push({ 11422 kind: "named", 11423 imported: "default", 11424 local: local 11425 }); 11426 } 11427 11428 if (specifier.isImportSpecifier()) { 11429 var importedName = specifier.node.imported.name; 11430 imported.push(importedName); 11431 specifiers.push({ 11432 kind: "named", 11433 imported: importedName, 11434 local: local 11435 }); 11436 } 11437 11438 if (specifier.isImportNamespaceSpecifier()) { 11439 imported.push("*"); 11440 specifiers.push({ 11441 kind: "namespace", 11442 local: local 11443 }); 11444 } 11445 } 11446 } 11447 }; 11448 11449 function ExportDeclaration(path, file) { 11450 var node = path.node; 11451 11452 var source = node.source ? node.source.value : null; 11453 var exports = file.metadata.modules.exports; 11454 11455 var declar = path.get("declaration"); 11456 if (declar.isStatement()) { 11457 var bindings = declar.getBindingIdentifiers(); 11458 11459 for (var name in bindings) { 11460 exports.exported.push(name); 11461 exports.specifiers.push({ 11462 kind: "local", 11463 local: name, 11464 exported: path.isExportDefaultDeclaration() ? "default" : name 11465 }); 11466 } 11467 } 11468 11469 if (path.isExportNamedDeclaration() && node.specifiers) { 11470 for (var _iterator2 = node.specifiers, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) { 11471 var _ref2; 11472 11473 if (_isArray2) { 11474 if (_i2 >= _iterator2.length) break; 11475 _ref2 = _iterator2[_i2++]; 11476 } else { 11477 _i2 = _iterator2.next(); 11478 if (_i2.done) break; 11479 _ref2 = _i2.value; 11480 } 11481 11482 var specifier = _ref2; 11483 11484 var exported = specifier.exported.name; 11485 exports.exported.push(exported); 11486 11487 if (t.isExportDefaultSpecifier(specifier)) { 11488 exports.specifiers.push({ 11489 kind: "external", 11490 local: exported, 11491 exported: exported, 11492 source: source 11493 }); 11494 } 11495 11496 if (t.isExportNamespaceSpecifier(specifier)) { 11497 exports.specifiers.push({ 11498 kind: "external-namespace", 11499 exported: exported, 11500 source: source 11501 }); 11502 } 11503 11504 var local = specifier.local; 11505 if (!local) continue; 11506 11507 if (source) { 11508 exports.specifiers.push({ 11509 kind: "external", 11510 local: local.name, 11511 exported: exported, 11512 source: source 11513 }); 11514 } 11515 11516 if (!source) { 11517 exports.specifiers.push({ 11518 kind: "local", 11519 local: local.name, 11520 exported: exported 11521 }); 11522 } 11523 } 11524 } 11525 11526 if (path.isExportAllDeclaration()) { 11527 exports.specifiers.push({ 11528 kind: "external-all", 11529 source: source 11530 }); 11531 } 11532 } 11533 11534 function Scope(path) { 11535 path.skip(); 11536 } 11537 11538/***/ }, 11539/* 119 */ 11540/***/ function(module, exports, __webpack_require__) { 11541 11542 "use strict"; 11543 11544 exports.__esModule = true; 11545 exports.inspect = exports.inherits = undefined; 11546 11547 var _getIterator2 = __webpack_require__(2); 11548 11549 var _getIterator3 = _interopRequireDefault(_getIterator2); 11550 11551 var _util = __webpack_require__(114); 11552 11553 Object.defineProperty(exports, "inherits", { 11554 enumerable: true, 11555 get: function get() { 11556 return _util.inherits; 11557 } 11558 }); 11559 Object.defineProperty(exports, "inspect", { 11560 enumerable: true, 11561 get: function get() { 11562 return _util.inspect; 11563 } 11564 }); 11565 exports.canCompile = canCompile; 11566 exports.list = list; 11567 exports.regexify = regexify; 11568 exports.arrayify = arrayify; 11569 exports.booleanify = booleanify; 11570 exports.shouldIgnore = shouldIgnore; 11571 11572 var _escapeRegExp = __webpack_require__(566); 11573 11574 var _escapeRegExp2 = _interopRequireDefault(_escapeRegExp); 11575 11576 var _startsWith = __webpack_require__(584); 11577 11578 var _startsWith2 = _interopRequireDefault(_startsWith); 11579 11580 var _minimatch = __webpack_require__(590); 11581 11582 var _minimatch2 = _interopRequireDefault(_minimatch); 11583 11584 var _includes = __webpack_require__(109); 11585 11586 var _includes2 = _interopRequireDefault(_includes); 11587 11588 var _isRegExp = __webpack_require__(272); 11589 11590 var _isRegExp2 = _interopRequireDefault(_isRegExp); 11591 11592 var _path = __webpack_require__(17); 11593 11594 var _path2 = _interopRequireDefault(_path); 11595 11596 var _slash = __webpack_require__(281); 11597 11598 var _slash2 = _interopRequireDefault(_slash); 11599 11600 function _interopRequireDefault(obj) { 11601 return obj && obj.__esModule ? obj : { default: obj }; 11602 } 11603 11604 function canCompile(filename, altExts) {
11605 var exts = altExts || canCompile.EXTENSIONS; 11606 var ext = _path2.default.extname(filename); 11607 return (0, _includes2.default)(exts, ext); 11608 } 11609 11610 canCompile.EXTENSIONS = [".js", ".jsx", ".es6", ".es"]; 11611 11612 function list(val) { 11613 if (!val) { 11614 return []; 11615 } else if (Array.isArray(val)) { 11616 return val; 11617 } else if (typeof val === "string") { 11618 return val.split(","); 11619 } else { 11620 return [val]; 11621 } 11622 } 11623 11624 function regexify(val) { 11625 if (!val) { 11626 return new RegExp(/.^/); 11627 } 11628 11629 if (Array.isArray(val)) { 11630 val = new RegExp(val.map(_escapeRegExp2.default).join("|"), "i"); 11631 } 11632 11633 if (typeof val === "string") { 11634 val = (0, _slash2.default)(val); 11635 11636 if ((0, _startsWith2.default)(val, "./") || (0, _startsWith2.default)(val, "*/")) val = val.slice(2); 11637 if ((0, _startsWith2.default)(val, "**/")) val = val.slice(3); 11638 11639 var regex = _minimatch2.default.makeRe(val, { nocase: true }); 11640 return new RegExp(regex.source.slice(1, -1), "i"); 11641 } 11642 11643 if ((0, _isRegExp2.default)(val)) { 11644 return val; 11645 } 11646 11647 throw new TypeError("illegal type for regexify"); 11648 } 11649 11650 function arrayify(val, mapFn) { 11651 if (!val) return []; 11652 if (typeof val === "boolean") return arrayify([val], mapFn); 11653 if (typeof val === "string") return arrayify(list(val), mapFn); 11654 11655 if (Array.isArray(val)) { 11656 if (mapFn) val = val.map(mapFn); 11657 return val; 11658 } 11659 11660 return [val]; 11661 } 11662 11663 function booleanify(val) { 11664 if (val === "true" || val == 1) { 11665 return true; 11666 } 11667 11668 if (val === "false" || val == 0 || !val) { 11669 return false; 11670 } 11671 11672 return val; 11673 } 11674 11675 function shouldIgnore(filename) { 11676 var ignore = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; 11677 var only = arguments[2]; 11678 11679 filename = filename.replace(/\\/g, "/"); 11680 11681 if (only) { 11682 for (var _iterator = only, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) { 11683 var _ref; 11684 11685 if (_isArray) { 11686 if (_i >= _iterator.length) break; 11687 _ref = _iterator[_i++]; 11688 } else { 11689 _i = _iterator.next(); 11690 if (_i.done) break; 11691 _ref = _i.value; 11692 } 11693 11694 var pattern = _ref; 11695 11696 if (_shouldIgnore(pattern, filename)) return false; 11697 } 11698 return true; 11699 } else if (ignore.length) { 11700 for (var _iterator2 = ignore, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) { 11701 var _ref2; 11702 11703 if (_isArray2) { 11704 if (_i2 >= _iterator2.length) break; 11705 _ref2 = _iterator2[_i2++]; 11706 } else { 11707 _i2 = _iterator2.next(); 11708 if (_i2.done) break; 11709 _ref2 = _i2.value; 11710 } 11711 11712 var _pattern = _ref2; 11713 11714 if (_shouldIgnore(_pattern, filename)) return true; 11715 } 11716 } 11717 11718 return false; 11719 } 11720 11721 function _shouldIgnore(pattern, filename) { 11722 if (typeof pattern === "function") { 11723 return pattern(filename); 11724 } else { 11725 return pattern.test(filename); 11726 } 11727 } 11728 11729/***/ }, 11730/* 120 */ 11731/***/ function(module, exports, __webpack_require__) { 11732 11733 "use strict"; 11734 11735 exports.__esModule = true; 11736 exports.ArrayPattern = exports.ObjectPattern = exports.RestProperty = exports.SpreadProperty = exports.SpreadElement = undefined; 11737 exports.Identifier = Identifier;
11738 exports.RestElement = RestElement; 11739 exports.ObjectExpression = ObjectExpression; 11740 exports.ObjectMethod = ObjectMethod; 11741 exports.ObjectProperty = ObjectProperty; 11742 exports.ArrayExpression = ArrayExpression; 11743 exports.RegExpLiteral = RegExpLiteral; 11744 exports.BooleanLiteral = BooleanLiteral; 11745 exports.NullLiteral = NullLiteral; 11746 exports.NumericLiteral = NumericLiteral; 11747 exports.StringLiteral = StringLiteral; 11748 11749 var _babelTypes = __webpack_require__(1); 11750 11751 var t = _interopRequireWildcard(_babelTypes); 11752 11753 var _jsesc = __webpack_require__(458); 11754 11755 var _jsesc2 = _interopRequireDefault(_jsesc); 11756 11757 function _interopRequireDefault(obj) { 11758 return obj && obj.__esModule ? obj : { default: obj }; 11759 } 11760 11761 function _interopRequireWildcard(obj) { 11762 if (obj && obj.__esModule) { 11763 return obj; 11764 } else { 11765 var newObj = {};if (obj != null) { 11766 for (var key in obj) { 11767 if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; 11768 } 11769 }newObj.default = obj;return newObj; 11770 } 11771 } 11772 11773 function Identifier(node) { 11774 if (node.variance) { 11775 if (node.variance === "plus") { 11776 this.token("+"); 11777 } else if (node.variance === "minus") { 11778 this.token("-"); 11779 } 11780 } 11781 11782 this.word(node.name); 11783 } 11784 11785 function RestElement(node) { 11786 this.token("..."); 11787 this.print(node.argument, node); 11788 } 11789 11790 exports.SpreadElement = RestElement; 11791 exports.SpreadProperty = RestElement; 11792 exports.RestProperty = RestElement; 11793 function ObjectExpression(node) { 11794 var props = node.properties; 11795 11796 this.token("{"); 11797 this.printInnerComments(node); 11798 11799 if (props.length) { 11800 this.space(); 11801 this.printList(props, node, { indent: true, statement: true }); 11802 this.space(); 11803 } 11804 11805 this.token("}"); 11806 } 11807 11808 exports.ObjectPattern = ObjectExpression; 11809 function ObjectMethod(node) { 11810 this.printJoin(node.decorators, node); 11811 this._method(node); 11812 } 11813 11814 function ObjectProperty(node) { 11815 this.printJoin(node.decorators, node); 11816 11817 if (node.computed) { 11818 this.token("["); 11819 this.print(node.key, node); 11820 this.token("]"); 11821 } else { 11822 if (t.isAssignmentPattern(node.value) && t.isIdentifier(node.key) && node.key.name === node.value.left.name) { 11823 this.print(node.value, node); 11824 return; 11825 } 11826 11827 this.print(node.key, node); 11828 11829 if (node.shorthand && t.isIdentifier(node.key) && t.isIdentifier(node.value) && node.key.name === node.value.name) { 11830 return; 11831 } 11832 } 11833 11834 this.token(":"); 11835 this.space(); 11836 this.print(node.value, node); 11837 } 11838 11839 function ArrayExpression(node) { 11840 var elems = node.elements; 11841 var len = elems.length; 11842 11843 this.token("["); 11844 this.printInnerComments(node); 11845 11846 for (var i = 0; i < elems.length; i++) { 11847 var elem = elems[i]; 11848 if (elem) { 11849 if (i > 0) this.space(); 11850 this.print(elem, node); 11851 if (i < len - 1) this.token(","); 11852 } else { 11853 this.token(","); 11854 } 11855 } 11856 11857 this.token("]"); 11858 } 11859 11860 exports.ArrayPattern = ArrayExpression; 11861 function RegExpLiteral(node) { 11862 this.word("/" + node.pattern + "/" + node.flags); 11863 } 11864 11865 function BooleanLiteral(node) { 11866 this.word(node.value ? "true" : "false"); 11867 } 11868 11869 function NullLiteral() { 11870 this.word("null"); 11871 } 11872 11873 function NumericLiteral(node) { 11874 var raw = this.getPossibleRaw(node); 11875 var value = node.value + ""; 11876 if (raw == null) { 11877 this.number(value); 11878 } else if (this.format.minified) { 11879 this.number(raw.length < value.length ? raw : value); 11880 } else { 11881 this.number(raw); 11882 } 11883 } 11884 11885 function StringLiteral(node, parent) { 11886 var raw = this.getPossibleRaw(node); 11887 if (!this.format.minified && raw != null) { 11888 this.token(raw); 11889 return; 11890 } 11891 11892 var opts = { 11893 quotes: t.isJSX(parent) ? "double" : this.format.quotes, 11894 wrap: true 11895 }; 11896 if (this.format.jsonCompatibleStrings) { 11897 opts.json = true; 11898 } 11899 var val = (0, _jsesc2.default)(node.value, opts); 11900 11901 return this.token(val); 11902 } 11903 11904/***/ }, 11905/* 121 */ 11906/***/ function(module, exports, __webpack_require__) { 11907 11908 "use strict"; 11909 11910 exports.__esModule = true; 11911 11912 exports.default = function (path, file, helpers) { 11913 if (!helpers) { 11914 helpers = { wrapAsync: file }; 11915 file = null; 11916 } 11917 path.traverse(awaitVisitor, { 11918 file: file, 11919 wrapAwait: helpers.wrapAwait 11920 }); 11921 11922 if (path.isClassMethod() || path.isObjectMethod()) { 11923 classOrObjectMethod(path, helpers.wrapAsync); 11924 } else { 11925 plainFunction(path, helpers.wrapAsync); 11926 } 11927 }; 11928 11929 var _babelHelperFunctionName = __webpack_require__(40); 11930 11931 var _babelHelperFunctionName2 = _interopRequireDefault(_babelHelperFunctionName); 11932 11933 var _babelTemplate = __webpack_require__(4); 11934 11935 var _babelTemplate2 = _interopRequireDefault(_babelTemplate); 11936 11937 var _babelTypes = __webpack_require__(1); 11938 11939 var t = _interopRequireWildcard(_babelTypes); 11940 11941 var _forAwait = __webpack_require__(317); 11942 11943 var _forAwait2 = _interopRequireDefault(_forAwait); 11944 11945 function _interopRequireWildcard(obj) { 11946 if (obj && obj.__esModule) { 11947 return obj; 11948 } else { 11949 var newObj = {};if (obj != null) { 11950 for (var key in obj) { 11951 if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; 11952 } 11953 }newObj.default = obj;return newObj; 11954 } 11955 } 11956 11957 function _interopRequireDefault(obj) { 11958 return obj && obj.__esModule ? obj : { default: obj }; 11959 } 11960 11961 var buildWrapper = (0, _babelTemplate2.default)("\n (() =>
11961 {\n var REF = FUNCTION;\n return function NAME(PARAMS) {\n return REF.apply(this, arguments);\n };\n })\n"); 11962 11963 var namedBuildWrapper = (0, _babelTemplate2.default)("\n (() => {\n var REF = FUNCTION;\n function NAME(PARAMS) {\n return REF.apply(this, arguments);\n }\n return NAME;\n })\n"); 11964 11965 var awaitVisitor = { 11966 Function: function Function(path) { 11967 if (path.isArrowFunctionExpression() && !path.node.async) { 11968 path.arrowFunctionToShadowed(); 11969 return; 11970 } 11971 path.skip(); 11972 }, 11973 AwaitExpression: function AwaitExpression(_ref, _ref2) { 11974 var node = _ref.node; 11975 var wrapAwait = _ref2.wrapAwait; 11976 11977 node.type = "YieldExpression"; 11978 if (wrapAwait) { 11979 node.argument = t.callExpression(wrapAwait, [node.argument]); 11980 } 11981 }, 11982 ForAwaitStatement: function ForAwaitStatement(path, _ref3) { 11983 var file = _ref3.file, 11984 wrapAwait = _ref3.wrapAwait; 11985 var node = path.node; 11986 11987 var build = (0, _forAwait2.default)(path, { 11988 getAsyncIterator: file.addHelper("asyncIterator"), 11989 wrapAwait: wrapAwait 11990 }); 11991 11992 var declar = build.declar, 11993 loop = build.loop; 11994 11995 var block = loop.body; 11996 11997 path.ensureBlock(); 11998 11999 if (declar) { 12000 block.body.push(declar); 12001 } 12002 12003 block.body = block.body.concat(node.body.body); 12004 12005 t.inherits(loop, node); 12006 t.inherits(loop.body, node.body); 12007 12008 if (build.replaceParent) { 12009 path.parentPath.replaceWithMultiple(build.node); 12010 path.remove(); 12011 } else { 12012 path.replaceWithMultiple(build.node); 12013 } 12014 } 12015 }; 12016 12017 function classOrObjectMethod(path, callId) { 12018 var node = path.node; 12019 var body = node.body; 12020 12021 node.async = false; 12022 12023 var container = t.functionExpression(null, [], t.blockStatement(body.body), true); 12024 container.shadow = true;
12025 body.body = [t.returnStatement(t.callExpression(t.callExpression(callId, [container]), []))]; 12026 12027 node.generator = false; 12028 } 12029 12030 function plainFunction(path, callId) { 12031 var node = path.node; 12032 var isDeclaration = path.isFunctionDeclaration(); 12033 var asyncFnId = node.id; 12034 var wrapper = buildWrapper; 12035 12036 if (path.isArrowFunctionExpression()) { 12037 path.arrowFunctionToShadowed(); 12038 } else if (!isDeclaration && asyncFnId) { 12039 wrapper = namedBuildWrapper; 12040 } 12041 12042 node.async = false; 12043 node.generator = true; 12044 12045 node.id = null; 12046 12047 if (isDeclaration) { 12048 node.type = "FunctionExpression"; 12049 } 12050 12051 var built = t.callExpression(callId, [node]); 12052 var container = wrapper({ 12053 NAME: asyncFnId, 12054 REF: path.scope.generateUidIdentifier("ref"), 12055 FUNCTION: built, 12056 PARAMS: node.params.reduce(function (acc, param) { 12057 acc.done = acc.done || t.isAssignmentPattern(param) || t.isRestElement(param); 12058 12059 if (!acc.done) { 12060 acc.params.push(path.scope.generateUidIdentifier("x")); 12061 } 12062 12063 return acc; 12064 }, { 12065 params: [], 12066 done: false 12067 }).params 12068 }).expression; 12069 12070 if (isDeclaration) { 12071 var declar = t.variableDeclaration("let", [t.variableDeclarator(t.identifier(asyncFnId.name), t.callExpression(container, []))]); 12072 declar._blockHoist = true; 12073 12074 path.replaceWith(declar); 12075 } else { 12076 var retFunction = container.body.body[1].argument; 12077 if (!asyncFnId) { 12078 (0, _babelHelperFunctionName2.default)({ 12079 node: retFunction, 12080 parent: path.parent, 12081 scope: path.scope 12082 }); 12083 } 12084 12085 if (!retFunction || retFunction.id || node.params.length) { 12086 path.replaceWith(t.callExpression(container, [])); 12087 } else { 12088 path.replaceWith(built); 12089 } 12090 } 12091 } 12092 12093 module.exports = exports["default"]; 12094 12095/***/ }, 12096/* 122 */ 12097/***/ function(module, exports) { 12098 12099 "use strict"; 12100 12101 exports.__esModule = true; 12102 12103 exports.default = function () { 12104 return { 12105 manipulateOptions: function manipulateOptions(opts, parserOpts) { 12106 parserOpts.plugins.push("decorators"); 12107 } 12108 }; 12109 }; 12110 12111 module.exports = exports["default"]; 12112 12113/***/ }, 12114/* 123 */ 12115/***/ function(module, exports) { 12116 12117 "use strict"; 12118 12119 exports.__esModule = true; 12120 12121 exports.default = function () { 12122 return { 12123 manipulateOptions: function manipulateOptions(opts, parserOpts) { 12124 parserOpts.plugins.push("flow"); 12125 } 12126 }; 12127 }; 12128 12129 module.exports = exports["default"]; 12130 12131/***/ }, 12132/* 124 */ 12133/***/ function(module, exports) { 12134 12135 "use strict"; 12136 12137 exports.__esModule = true; 12138 12139 exports.default = function () { 12140 return { 12141 manipulateOptions: function manipulateOptions(opts, parserOpts) { 12142 parserOpts.plugins.push("jsx"); 12143 } 12144 }; 12145 }; 12146 12147 module.exports = exports["default"]; 12148 12149/***/ }, 12150/* 125 */ 12151/***/ function(module, exports) { 12152 12153 "use strict"; 12154 12155 exports.__esModule = true; 12156 12157 exports.default = function () { 12158 return { 12159 manipulateOptions: function manipulateOptions(opts, parserOpts) { 12160 parserOpts.plugins.push("trailingFunctionCommas"); 12161 } 12162 }; 12163 }; 12164 12165 module.exports = exports["default"]; 12166 12167/***/ }, 12168/* 126 */ 12169/***/ function(module, exports, __webpack_require__) { 12170 12171 "use strict"; 12172 12173 exports.__esModule = true; 12174 12175 exports.default = function () { 12176 return { 12177 inherits: __webpack_require__(65), 12178 12179 visitor: { 12180 Function: function Function(path, state) { 12181 if (!path.node.async || path.node.generator) return; 12182 12183 (0, _babelHelperRemapAsyncToGenerator2.default)(path, state.file, { 12184 wrapAsync: state.addHelper("asyncToGenerator") 12185 }); 12186 } 12187 } 12188 }; 12189 }; 12190 12191 var _babelHelperRemapAsyncToGenerator = __webpack_require__(121); 12192 12193 var _babelHelperRemapAsyncToGenerator2 = _interopRequireDefault(_babelHelperRemapAsyncToGenerator); 12194 12195 function _interopRequireDefault(obj) { 12196 return obj && obj.__esModule ? obj : { default: obj }; 12197 } 12198 12199 module.exports = exports["default"]; 12200 12201/***/ }, 12202/* 127 */ 12203/***/ function(module, exports, __webpack_require__) { 12204 12205 "use strict"; 12206 12207 exports.__esModule = true; 12208 12209 var _getIterator2 = __webpack_require__(2); 12210 12211 var _getIterator3 = _interopRequireDefault(_getIterator2); 12212 12213 var _create = __webpack_require__(10); 12214 12215 var _create2 = _interopRequireDefault(_create); 12216 12217 exports.default = function () { 12218 return { 12219 visitor: { 12220 ObjectExpression: function ObjectExpression(path) { 12221 var node = path.node; 12222 12223 var plainProps = node.properties.filter(function (prop) { 12224 return !t.isSpreadProperty(prop) && !prop.computed; 12225 }); 12226 12227 var alreadySeenData = (0, _create2.default)(null); 12228 var alreadySeenGetters = (0, _create2.default)(null); 12229 var alreadySeenSetters = (0, _create2.default)(null); 12230 12231 for (var _iterator = plainProps, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) { 12232 var _ref; 12233 12234 if (_isArray) { 12235 if (_i >= _iterator.length) break; 12236 _ref = _iterator[_i++]; 12237 } else { 12238 _i = _iterator.next(); 12239 if (_i.done) break; 12240 _ref = _i.value; 12241 } 12242 12243 var prop = _ref; 12244 12245 var name = getName(prop.key); 12246 var isDuplicate = false;
12247 switch (prop.kind) { 12248 case "get": 12249 if (alreadySeenData[name] || alreadySeenGetters[name]) { 12250 isDuplicate = true; 12251 } 12252 alreadySeenGetters[name] = true; 12253 break; 12254 case "set": 12255 if (alreadySeenData[name] || alreadySeenSetters[name]) { 12256 isDuplicate = true; 12257 } 12258 alreadySeenSetters[name] = true; 12259 break; 12260 default: 12261 if (alreadySeenData[name] || alreadySeenGetters[name] || alreadySeenSetters[name]) { 12262 isDuplicate = true; 12263 } 12264 alreadySeenData[name] = true; 12265 } 12266 12267 if (isDuplicate) { 12268 prop.computed = true; 12269 prop.key = t.stringLiteral(name); 12270 } 12271 } 12272 } 12273 } 12274 }; 12275 }; 12276 12277 var _babelTypes = __webpack_require__(1); 12278 12279 var t = _interopRequireWildcard(_babelTypes); 12280 12281 function _interopRequireWildcard(obj) { 12282 if (obj && obj.__esModule) { 12283 return obj; 12284 } else { 12285 var newObj = {};if (obj != null) { 12286 for (var key in obj) { 12287 if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; 12288 } 12289 }newObj.default = obj;return newObj; 12290 } 12291 } 12292 12293 function _interopRequireDefault(obj) { 12294 return obj && obj.__esModule ? obj : { default: obj }; 12295 } 12296 12297 function getName(key) { 12298 if (t.isIdentifier(key)) { 12299 return key.name; 12300 } 12301 return key.value.toString(); 12302 } 12303 12304 module.exports = exports["default"]; 12305 12306/***/ }, 12307/* 128 */ 12308/***/ function(module, exports, __webpack_require__) { 12309 12310 "use strict"; 12311 12312 exports.__esModule = true; 12313 12314 var _create = __webpack_require__(10); 12315 12316 var _create2 = _interopRequireDefault(_create); 12317 12318 exports.default = function (_ref) { 12319 var t = _ref.types; 12320 12321 function isValidRequireCall(path) { 12322 if (!path.isCallExpression()) return false; 12323 if (!path.get("callee").isIdentifier({ name: "require" })) return false; 12324 if (path.scope.getBinding("require")) return false; 12325 12326 var args = path.get("arguments"); 12327 if (args.length !== 1) return false; 12328 12329 var arg = args[0]; 12330 if (!arg.isStringLiteral()) return false; 12331 12332 return true; 12333 } 12334 12335 var amdVisitor = { 12336 ReferencedIdentifier: function ReferencedIdentifier(_ref2) { 12337 var node = _ref2.node, 12338 scope = _ref2.scope; 12339 12340 if (node.name === "exports" && !scope.getBinding("exports")) { 12341 this.hasExports = true; 12342 } 12343 12344 if (node.name === "module" && !scope.getBinding("module")) { 12345 this.hasModule = true; 12346 } 12347 }, 12348 CallExpression: function CallExpression(path) { 12349 if (!isValidRequireCall(path)) return; 12350 this.bareSources.push(path.node.arguments[0]); 12351 path.remove(); 12352 }, 12353 VariableDeclarator: function VariableDeclarator(path) { 12354 var id = path.get("id"); 12355 if (!id.isIdentifier()) return; 12356 12357 var init = path.get("init"); 12358 if (!isValidRequireCall(init)) return; 12359 12360 var source = init.node.arguments[0]; 12361 this.sourceNames[source.value] = true; 12362 this.sources.push([id.node, source]); 12363 12364 path.remove(); 12365 } 12366 }; 12367 12368 return { 12369 inherits: __webpack_require__(75), 12370 12371 pre: function pre() { 12372 this.sources = []; 12373 this.sourceNames = (0, _create2.default)(null); 12374 12375 this.bareSources = []; 12376 12377 this.hasExports = false; 12378 this.hasModule = false; 12379 }, 12380 12381 visitor: { 12382 Program: { 12383 exit: function exit(path) { 12384 var _this = this; 12385 12386 if (this.ran) return; 12387 this.ran = true; 12388 12389 path.traverse(amdVisitor, this); 12390 12391 var params = this.sources.map(function (source) { 12392 return source[0]; 12393 }); 12394 var sources = this.sources.map(function (source) { 12395 return source[1]; 12396 }); 12397 12398 sources = sources.concat(this.bareSources.filter(function (str) { 12399 return !_this.sourceNames[str.value]; 12400 })); 12401 12402 var moduleName = this.getModuleName(); 12403 if (moduleName) moduleName = t.stringLiteral(moduleName); 12404 12405 if (this.hasExports) { 12406 sources.unshift(t.stringLiteral("exports")); 12407 params.unshift(t.identifier("exports")); 12408 } 12409 12410 if (this.hasModule) { 12411 sources.unshift(t.stringLiteral("module")); 12412 params.unshift(t.identifier("module")); 12413 } 12414 12415 var node = path.node; 12416
12417 var factory = buildFactory({ 12418 PARAMS: params, 12419 BODY: node.body 12420 }); 12421 factory.expression.body.directives = node.directives; 12422 node.directives = []; 12423 12424 node.body = [buildDefine({ 12425 MODULE_NAME: moduleName, 12426 SOURCES: sources, 12427 FACTORY: factory 12428 })]; 12429 } 12430 } 12431 } 12432 }; 12433 }; 12434 12435 var _babelTemplate = __webpack_require__(4); 12436 12437 var _babelTemplate2 = _interopRequireDefault(_babelTemplate); 12438 12439 function _interopRequireDefault(obj) { 12440 return obj && obj.__esModule ? obj : { default: obj }; 12441 } 12442 12443 var buildDefine = (0, _babelTemplate2.default)("\n define(MODULE_NAME, [SOURCES], FACTORY);\n"); 12444 12445 var buildFactory = (0, _babelTemplate2.default)("\n (function (PARAMS) {\n BODY;\n })\n"); 12446 12447 module.exports = exports["default"]; 12448 12449/***/ }, 12450/* 129 */ 12451/***/ function(module, exports, __webpack_require__) { 12452 12453 "use strict"; 12454 12455 exports.__esModule = true; 12456 12457 exports.default = function (_ref) { 12458 var t = _ref.types; 12459 12460 return { 12461 inherits: __webpack_require__(196), 12462 12463 visitor: (0, _babelHelperBuilderBinaryAssignmentOperatorVisitor2.default)({ 12464 operator: "**", 12465 12466 build: function build(left, right) { 12467 return t.callExpression(t.memberExpression(t.identifier("Math"), t.identifier("pow")), [left, right]); 12468 } 12469 }) 12470 }; 12471 }; 12472 12473 var _babelHelperBuilderBinaryAssignmentOperatorVisitor = __webpack_require__(313); 12474 12475 var _babelHelperBuilderBinaryAssignmentOperatorVisitor2 = _interopRequireDefault(_babelHelperBuilderBinaryAssignmentOperatorVisitor); 12476 12477 function _interopRequireDefault(obj) { 12478 return obj && obj.__esModule ? obj : { default: obj }; 12479 } 12480 12481 module.exports = exports["default"]; 12482 12483/***/ }, 12484/* 130 */ 12485/***/ function(module, exports, __webpack_require__) { 12486 12487 "use strict"; 12488 12489 module.exports = { "default": __webpack_require__(400), __esModule: true }; 12490 12491/***/ }, 12492/* 131 */ 12493/***/ function(module, exports, __webpack_require__) { 12494 12495 "use strict"; 12496 12497 exports.__esModule = true; 12498 12499 var _keys = __webpack_require__(13); 12500 12501 var _keys2 = _interopRequireDefault(_keys); 12502 12503 var _create = __webpack_require__(10); 12504 12505 var _create2 = _interopRequireDefault(_create); 12506 12507 var _map = __webpack_require__(130); 12508 12509 var _map2 = _interopRequireDefault(_map); 12510 12511 var _classCallCheck2 = __webpack_require__(3); 12512 12513 var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); 12514 12515 var _getIterator2 = __webpack_require__(2); 12516 12517 var _getIterator3 = _interopRequireDefault(_getIterator2); 12518 12519 var _includes = __webpack_require__(109); 12520 12521 var _includes2 = _interopRequireDefault(_includes); 12522 12523 var _repeat = __webpack_require__(274); 12524 12525 var _repeat2 = _interopRequireDefault(_repeat); 12526 12527 var _renamer = __webpack_require__(377); 12528 12529 var _renamer2 = _interopRequireDefault(_renamer); 12530 12531 var _index = __webpack_require__(8); 12532 12533 var _index2 = _interopRequireDefault(_index); 12534 12535 var _defaults = __webpack_require__(269); 12536 12537 var _defaults2 = _interopRequireDefault(_defaults); 12538 12539 var _babelMessages = __webpack_require__(18); 12540 12541 var messages = _interopRequireWildcard(_babelMessages); 12542 12543 var _binding2 = __webpack_require__(222); 12544 12545 var _binding3 = _interopRequireDefault(_binding2); 12546 12547 var _globals = __webpack_require__(452); 12548 12549 var _globals2 = _interopRequireDefault(_globals); 12550 12551 var _babelTypes = __webpack_require__(1); 12552 12553 var t = _interopRequireWildcard(_babelTypes); 12554 12555 var _cache = __webpack_require__(86); 12556 12557 function _interopRequireWildcard(obj) { 12558 if (obj && obj.__esModule) { 12559 return obj; 12560 } else { 12561 var newObj = {};if (obj != null) { 12562 for (var key in obj) { 12563 if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; 12564 } 12565 }newObj.default = obj;return newObj; 12566 } 12567 } 12568 12569 function _interopRequireDefault(obj) { 12570 return obj && obj.__esModule ? obj : { default: obj }; 12571 } 12572 12573 var _crawlCallsCount = 0; 12574 12575 function getCache(path, parentScope, self) { 12576 var scopes = _cache.scope.get(path.node) || []; 12577 12578 for (var _iterator = scopes, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) { 12579 var _ref; 12580 12581 if (_isArray) { 12582 if (_i >= _iterator.length) break; 12583 _ref = _iterator[_i++]; 12584 } else { 12585 _i = _iterator.next(); 12586 if (_i.done) break; 12587 _ref = _i.value; 12588 } 12589 12590 var scope = _ref;
12591 12592 if (scope.parent === parentScope && scope.path === path) return scope; 12593 } 12594 12595 scopes.push(self); 12596 12597 if (!_cache.scope.has(path.node)) { 12598 _cache.scope.set(path.node, scopes); 12599 } 12600 } 12601 12602 function gatherNodeParts(node, parts) { 12603 if (t.isModuleDeclaration(node)) { 12604 if (node.source) { 12605 gatherNodeParts(node.source, parts); 12606 } else if (node.specifiers && node.specifiers.length) { 12607 for (var _iterator2 = node.specifiers, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) { 12608 var _ref2; 12609 12610 if (_isArray2) { 12611 if (_i2 >= _iterator2.length) break; 12612 _ref2 = _iterator2[_i2++]; 12613 } else { 12614 _i2 = _iterator2.next(); 12615 if (_i2.done) break; 12616 _ref2 = _i2.value; 12617 } 12618 12619 var specifier = _ref2; 12620 12621 gatherNodeParts(specifier, parts); 12622 } 12623 } else if (node.declaration) { 12624 gatherNodeParts(node.declaration, parts); 12625 } 12626 } else if (t.isModuleSpecifier(node)) { 12627 gatherNodeParts(node.local, parts); 12628 } else if (t.isMemberExpression(node)) { 12629 gatherNodeParts(node.object, parts); 12630 gatherNodeParts(node.property, parts); 12631 } else if (t.isIdentifier(node)) { 12632 parts.push(node.name); 12633 } else if (t.isLiteral(node)) { 12634 parts.push(node.value); 12635 } else if (t.isCallExpression(node)) { 12636 gatherNodeParts(node.callee, parts); 12637 } else if (t.isObjectExpression(node) || t.isObjectPattern(node)) { 12638 for (var _iterator3 = node.properties, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, _getIterator3.default)(_iterator3);;) { 12639 var _ref3; 12640 12641 if (_isArray3) { 12642 if (_i3 >= _iterator3.length) break; 12643 _ref3 = _iterator3[_i3++]; 12644 } else { 12645 _i3 = _iterator3.next(); 12646 if (_i3.done) break; 12647 _ref3 = _i3.value; 12648 } 12649 12650 var prop = _ref3; 12651 12652 gatherNodeParts(prop.key || prop.argument, parts); 12653 } 12654 } 12655 } 12656 12657 var collectorVisitor = { 12658 For: function For(path) { 12659 for (var _iterator4 = t.FOR_INIT_KEYS, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, _getIterator3.default)(_iterator4);;) { 12660 var _ref4; 12661 12662 if (_isArray4) { 12663 if (_i4 >= _iterator4.length) break; 12664 _ref4 = _iterator4[_i4++]; 12665 } else { 12666 _i4 = _iterator4.next(); 12667 if (_i4.done) break; 12668 _ref4 = _i4.value; 12669 } 12670 12671 var key = _ref4; 12672 12673 var declar = path.get(key); 12674 if (declar.isVar()) path.scope.getFunctionParent().registerBinding("var", declar); 12675 } 12676 }, 12677 Declaration: function Declaration(path) { 12678 if (path.isBlockScoped()) return; 12679 12680 if (path.isExportDeclaration() && path.get("declaration").isDeclaration()) return; 12681 12682 path.scope.getFunctionParent().registerDeclaration(path); 12683 }, 12684 ReferencedIdentifier: function ReferencedIdentifier(path, state) { 12685 state.references.push(path); 12686 }, 12687 ForXStatement: function ForXStatement(path, state) { 12688 var left = path.get("left"); 12689 if (left.isPattern() || left.isIdentifier()) { 12690 state.constantViolations.push(left); 12691 } 12692 }, 12693 12694 ExportDeclaration: { 12695 exit: function exit(path) { 12696 var node = path.node, 12697 scope = path.scope; 12698 12699 var declar = node.declaration; 12700 if (t.isClassDeclaration(declar) || t.isFunctionDeclaration(declar)) { 12701 var _id = declar.id; 12702 if (!_id) return; 12703 12704 var binding = scope.getBinding(_id.name); 12705 if (binding) binding.reference(path); 12706 } else if (t.isVariableDeclaration(declar)) { 12707 for (var _iterator5 = declar.declarations, _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : (0, _getIterator3.default)(_iterator5);;) { 12708 var _ref5; 12709 12710 if (_isArray5) { 12711 if (_i5 >= _iterator5.length) break; 12712 _ref5 = _iterator5[_i5++]; 12713 } else { 12714 _i5 = _iterator5.next(); 12715 if (_i5.done) break; 12716 _ref5 = _i5.value; 12717 } 12718 12719 var decl = _ref5; 12720 12721 var ids = t.getBindingIdentifiers(decl); 12722 for (var name in ids) { 12723 var _binding = scope.getBinding(name); 12724 if (_binding) _binding.reference(path); 12725 } 12726 } 12727 } 12728 } 12729 }, 12730
12731 LabeledStatement: function LabeledStatement(path) { 12732 path.scope.getProgramParent().addGlobal(path.node); 12733 path.scope.getBlockParent().registerDeclaration(path); 12734 }, 12735 AssignmentExpression: function AssignmentExpression(path, state) { 12736 state.assignments.push(path); 12737 }, 12738 UpdateExpression: function UpdateExpression(path, state) { 12739 state.constantViolations.push(path.get("argument")); 12740 }, 12741 UnaryExpression: function UnaryExpression(path, state) { 12742 if (path.node.operator === "delete") { 12743 state.constantViolations.push(path.get("argument")); 12744 } 12745 }, 12746 BlockScoped: function BlockScoped(path) { 12747 var scope = path.scope; 12748 if (scope.path === path) scope = scope.parent; 12749 scope.getBlockParent().registerDeclaration(path); 12750 }, 12751 ClassDeclaration: function ClassDeclaration(path) { 12752 var id = path.node.id; 12753 if (!id) return; 12754 12755 var name = id.name; 12756 path.scope.bindings[name] = path.scope.getBinding(name); 12757 }, 12758 Block: function Block(path) { 12759 var paths = path.get("body"); 12760 for (var _iterator6 = paths, _isArray6 = Array.isArray(_iterator6), _i6 = 0, _iterator6 = _isArray6 ? _iterator6 : (0, _getIterator3.default)(_iterator6);;) { 12761 var _ref6; 12762 12763 if (_isArray6) { 12764 if (_i6 >= _iterator6.length) break; 12765 _ref6 = _iterator6[_i6++]; 12766 } else { 12767 _i6 = _iterator6.next(); 12768 if (_i6.done) break; 12769 _ref6 = _i6.value; 12770 } 12771 12772 var bodyPath = _ref6; 12773 12774 if (bodyPath.isFunctionDeclaration()) { 12775 path.scope.getBlockParent().registerDeclaration(bodyPath); 12776 } 12777 } 12778 } 12779 }; 12780 12781 var uid = 0; 12782 12783 var Scope = function () { 12784 function Scope(path, parentScope) { 12785 (0, _classCallCheck3.default)(this, Scope); 12786 12787 if (parentScope && parentScope.block === path.node) { 12788 return parentScope; 12789 } 12790 12791 var cached = getCache(path, parentScope, this); 12792 if (cached) return cached; 12793 12794 this.uid = uid++; 12795 this.parent = parentScope; 12796 this.hub = path.hub; 12797 12798 this.parentBlock = path.parent; 12799 this.block = path.node; 12800 this.path = path; 12801 12802 this.labels = new _map2.default(); 12803 } 12804 12805 Scope.prototype.traverse = function traverse(node, opts, state) { 12806 (0, _index2.default)(node, opts, this, state, this.path); 12807 }; 12808 12809 Scope.prototype.generateDeclaredUidIdentifier = function generateDeclaredUidIdentifier() { 12810 var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "temp"; 12811 12812 var id = this.generateUidIdentifier(name); 12813 this.push({ id: id }); 12814 return id; 12815 }; 12816 12817 Scope.prototype.generateUidIdentifier = function generateUidIdentifier() { 12818 var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "temp"; 12819 12820 return t.identifier(this.generateUid(name)); 12821 }; 12822 12823 Scope.prototype.generateUid = function generateUid() { 12824 var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "temp"; 12825 12826 name = t.toIdentifier(name).replace(/^_+/, "").replace(/[0-9]+$/g, ""); 12827 12828 var uid = void 0; 12829 var i = 0; 12830 do { 12831 uid = this._generateUid(name, i); 12832 i++; 12833 } while (this.hasLabel(uid) || this.hasBinding(uid) || this.hasGlobal(uid) || this.hasReference(uid)); 12834 12835 var program = this.getProgramParent(); 12836 program.references[uid] = true; 12837 program.uids[uid] = true; 12838 12839 return uid; 12840 }; 12841 12842 Scope.prototype._generateUid = function _generateUid(name, i) { 12843 var id = name; 12844 if (i > 1) id += i; 12845 return "_" + id; 12846 }; 12847 12848 Scope.prototype.generateUidIdentifierBasedOnNode = function generateUidIdentifierBasedOnNode(parent, defaultName) { 12849 var node = parent; 12850 12851 if (t.isAssignmentExpression(parent)) { 12852 node = parent.left; 12853 } else if (t.isVariableDeclarator(parent)) { 12854 node = parent.id; 12855 } else if (t.isObjectProperty(node) || t.isObjectMethod(node)) { 12856 node = node.key; 12857 } 12858 12859 var parts = []; 12860 gatherNodeParts(node, parts); 12861 12862 var id = parts.join("$"); 12863 id = id.replace(/^_/, "") || defaultName || "ref"; 12864 12865 return this.generateUidIdentifier(id.slice(0, 20)); 12866 }; 12867 12868 Scope.prototype.isStatic = function isStatic(node) { 12869 if (t.isThisExpression(node) || t.isSuper(node)) { 12870 return true; 12871 } 12872 12873 if (t.isIdentifier(node)) { 12874 var binding = this.getBinding(node.name); 12875 if (binding) { 12876 return binding.constant; 12877 } else { 12878 return this.hasBinding(node.name); 12879 } 12880 } 12881 12882 return false;
12883 }; 12884 12885 Scope.prototype.maybeGenerateMemoised = function maybeGenerateMemoised(node, dontPush) { 12886 if (this.isStatic(node)) { 12887 return null; 12888 } else { 12889 var _id2 = this.generateUidIdentifierBasedOnNode(node); 12890 if (!dontPush) this.push({ id: _id2 }); 12891 return _id2; 12892 } 12893 }; 12894 12895 Scope.prototype.checkBlockScopedCollisions = function checkBlockScopedCollisions(local, kind, name, id) { 12896 if (kind === "param") return; 12897 12898 if (kind === "hoisted" && local.kind === "let") return; 12899 12900 var duplicate = kind === "let" || local.kind === "let" || local.kind === "const" || local.kind === "module" || local.kind === "param" && (kind === "let" || kind === "const"); 12901 12902 if (duplicate) { 12903 throw this.hub.file.buildCodeFrameError(id, messages.get("scopeDuplicateDeclaration", name), TypeError); 12904 } 12905 }; 12906 12907 Scope.prototype.rename = function rename(oldName, newName, block) { 12908 var binding = this.getBinding(oldName); 12909 if (binding) { 12910 newName = newName || this.generateUidIdentifier(oldName).name; 12911 return new _renamer2.default(binding, oldName, newName).rename(block); 12912 } 12913 }; 12914 12915 Scope.prototype._renameFromMap = function _renameFromMap(map, oldName, newName, value) { 12916 if (map[oldName]) { 12917 map[newName] = value; 12918 map[oldName] = null; 12919 } 12920 }; 12921 12922 Scope.prototype.dump = function dump() { 12923 var sep = (0, _repeat2.default)("-", 60); 12924 console.log(sep); 12925 var scope = this; 12926 do { 12927 console.log("#", scope.block.type); 12928 for (var name in scope.bindings) { 12929 var binding = scope.bindings[name]; 12930 console.log(" -", name, { 12931 constant: binding.constant, 12932 references: binding.references, 12933 violations: binding.constantViolations.length, 12934 kind: binding.kind 12935 }); 12936 } 12937 } while (scope = scope.parent); 12938 console.log(sep); 12939 }; 12940 12941 Scope.prototype.toArray = function toArray(node, i) { 12942 var file = this.hub.file; 12943 12944 if (t.isIdentifier(node)) { 12945 var binding = this.getBinding(node.name); 12946 if (binding && binding.constant && binding.path.isGenericType("Array")) return node; 12947 } 12948 12949 if (t.isArrayExpression(node)) { 12950 return node; 12951 } 12952 12953 if (t.isIdentifier(node, { name: "arguments" })) { 12954 return t.callExpression(t.memberExpression(t.memberExpression(t.memberExpression(t.identifier("Array"), t.identifier("prototype")), t.identifier("slice")), t.identifier("call")), [node]); 12955 } 12956 12957 var helperName = "toArray"; 12958 var args = [node]; 12959 if (i === true) { 12960 helperName = "toConsumableArray"; 12961 } else if (i) { 12962 args.push(t.numericLiteral(i)); 12963 helperName = "slicedToArray"; 12964 } 12965 return t.callExpression(file.addHelper(helperName), args); 12966 }; 12967 12968 Scope.prototype.hasLabel = function hasLabel(name) { 12969 return !!this.getLabel(name); 12970 }; 12971 12972 Scope.prototype.getLabel = function getLabel(name) { 12973 return this.labels.get(name); 12974 }; 12975 12976 Scope.prototype.registerLabel = function registerLabel(path) { 12977 this.labels.set(path.node.label.name, path); 12978 }; 12979 12980 Scope.prototype.registerDeclaration = function registerDeclaration(path) { 12981 if (path.isLabeledStatement()) { 12982 this.registerLabel(path); 12983 } else if (path.isFunctionDeclaration()) { 12984 this.registerBinding("hoisted", path.get("id"), path); 12985 } else if (path.isVariableDeclaration()) { 12986 var declarations = path.get("declarations"); 12987 for (var _iterator7 = declarations, _isArray7 = Array.isArray(_iterator7), _i7 = 0, _iterator7 = _isArray7 ? _iterator7 : (0, _getIterator3.default)(_iterator7);;) { 12988 var _ref7; 12989 12990 if (_isArray7) { 12991 if (_i7 >= _iterator7.length) break; 12992 _ref7 = _iterator7[_i7++]; 12993 } else { 12994 _i7 = _iterator7.next(); 12995 if (_i7.done) break; 12996 _ref7 = _i7.value; 12997 } 12998 12999 var declar = _ref7; 13000 13001 this.registerBinding(path.node.kind, declar); 13002 } 13003 } else if (path.isClassDeclaration()) { 13004 this.registerBinding("let", path); 13005 } else if (path.isImportDeclaration()) { 13006 var specifiers = path.get("specifiers"); 13007 for (var _iterator8 = specifiers, _isArray8 = Array.isArray(_iterator8), _i8 = 0, _iterator8 = _isArray8 ? _iterator8 : (0, _getIterator3.default)(_iterator8);;) { 13008 var _ref8; 13009 13010 if (_isArray8) { 13011 if (_i8 >= _iterator8.length) break; 13012 _ref8 = _iterator8[_i8++]; 13013 } else { 13014 _i8 = _iterator8.next(); 13015 if (_i8.done) break; 13016 _ref8 = _i8.value; 13017 } 13018 13019 var specifier = _ref8; 13020 13021 this.registerBinding("module", specifier); 13022 } 13023 } else if (path.isExportDeclaration()) { 13024 var _declar = path.get("declaration");
13025 if (_declar.isClassDeclaration() || _declar.isFunctionDeclaration() || _declar.isVariableDeclaration()) { 13026 this.registerDeclaration(_declar); 13027 } 13028 } else { 13029 this.registerBinding("unknown", path); 13030 } 13031 }; 13032 13033 Scope.prototype.buildUndefinedNode = function buildUndefinedNode() { 13034 if (this.hasBinding("undefined")) { 13035 return t.unaryExpression("void", t.numericLiteral(0), true); 13036 } else { 13037 return t.identifier("undefined"); 13038 } 13039 }; 13040 13041 Scope.prototype.registerConstantViolation = function registerConstantViolation(path) { 13042 var ids = path.getBindingIdentifiers(); 13043 for (var name in ids) { 13044 var binding = this.getBinding(name); 13045 if (binding) binding.reassign(path); 13046 } 13047 }; 13048 13049 Scope.prototype.registerBinding = function registerBinding(kind, path) { 13050 var bindingPath = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : path; 13051 13052 if (!kind) throw new ReferenceError("no `kind`"); 13053 13054 if (path.isVariableDeclaration()) { 13055 var declarators = path.get("declarations"); 13056 for (var _iterator9 = declarators, _isArray9 = Array.isArray(_iterator9), _i9 = 0, _iterator9 = _isArray9 ? _iterator9 : (0, _getIterator3.default)(_iterator9);;) { 13057 var _ref9; 13058 13059 if (_isArray9) { 13060 if (_i9 >= _iterator9.length) break; 13061 _ref9 = _iterator9[_i9++]; 13062 } else { 13063 _i9 = _iterator9.next(); 13064 if (_i9.done) break; 13065 _ref9 = _i9.value; 13066 } 13067 13068 var declar = _ref9; 13069 13070 this.registerBinding(kind, declar); 13071 } 13072 return; 13073 } 13074 13075 var parent = this.getProgramParent(); 13076 var ids = path.getBindingIdentifiers(true); 13077 13078 for (var name in ids) { 13079 for (var _iterator10 = ids[name], _isArray10 = Array.isArray(_iterator10), _i10 = 0, _iterator10 = _isArray10 ? _iterator10 : (0, _getIterator3.default)(_iterator10);;) { 13080 var _ref10; 13081 13082 if (_isArray10) { 13083 if (_i10 >= _iterator10.length) break; 13084 _ref10 = _iterator10[_i10++]; 13085 } else { 13086 _i10 = _iterator10.next(); 13087 if (_i10.done) break; 13088 _ref10 = _i10.value; 13089 } 13090 13091 var _id3 = _ref10; 13092 13093 var local = this.getOwnBinding(name); 13094 if (local) { 13095 if (local.identifier === _id3) continue; 13096 13097 this.checkBlockScopedCollisions(local, kind, name, _id3); 13098 } 13099 13100 if (local && local.path.isFlow()) local = null; 13101 13102 parent.references[name] = true; 13103 13104 this.bindings[name] = new _binding3.default({ 13105 identifier: _id3, 13106 existing: local, 13107 scope: this, 13108 path: bindingPath, 13109 kind: kind 13110 }); 13111 } 13112 } 13113 }; 13114 13115 Scope.prototype.addGlobal = function addGlobal(node) { 13116 this.globals[node.name] = node; 13117 }; 13118 13119 Scope.prototype.hasUid = function hasUid(name) { 13120 var scope = this; 13121 13122 do { 13123 if (scope.uids[name]) return true; 13124 } while (scope = scope.parent); 13125 13126 return false; 13127 }; 13128 13129 Scope.prototype.hasGlobal = function hasGlobal(name) { 13130 var scope = this; 13131 13132 do { 13133 if (scope.globals[name]) return true; 13134 } while (scope = scope.parent); 13135 13136 return false; 13137 }; 13138 13139 Scope.prototype.hasReference = function hasReference(name) { 13140 var scope = this; 13141 13142 do { 13143 if (scope.references[name]) return true; 13144 } while (scope = scope.parent); 13145 13146 return false; 13147 }; 13148 13149 Scope.prototype.isPure = function isPure(node, constantsOnly) { 13150 if (t.isIdentifier(node)) { 13151 var binding = this.getBinding(node.name); 13152 if (!binding) return false; 13153 if (constantsOnly) return binding.constant; 13154 return true; 13155 } else if (t.isClass(node)) { 13156 if (node.superClass && !this.isPure(node.superClass, constantsOnly)) return false; 13157 return this.isPure(node.body, constantsOnly); 13158 } else if (t.isClassBody(node)) { 13159 for (var _iterator11 = node.body, _isArray11 = Array.isArray(_iterator11), _i11 = 0, _iterator11 = _isArray11 ? _iterator11 : (0, _getIterator3.default)(_iterator11);;) { 13160 var _ref11; 13161 13162 if (_isArray11) { 13163 if (_i11 >= _iterator11.length) break; 13164 _ref11 = _iterator11[_i11++]; 13165 } else { 13166 _i11 = _iterator11.next(); 13167 if (_i11.done) break; 13168 _ref11 = _i11.value; 13169 } 13170 13171 var method = _ref11; 13172 13173 if (!this.isPure(method, constantsOnly)) return false;
13174 } 13175 return true; 13176 } else if (t.isBinary(node)) { 13177 return this.isPure(node.left, constantsOnly) && this.isPure(node.right, constantsOnly); 13178 } else if (t.isArrayExpression(node)) { 13179 for (var _iterator12 = node.elements, _isArray12 = Array.isArray(_iterator12), _i12 = 0, _iterator12 = _isArray12 ? _iterator12 : (0, _getIterator3.default)(_iterator12);;) { 13180 var _ref12; 13181 13182 if (_isArray12) { 13183 if (_i12 >= _iterator12.length) break; 13184 _ref12 = _iterator12[_i12++]; 13185 } else { 13186 _i12 = _iterator12.next(); 13187 if (_i12.done) break; 13188 _ref12 = _i12.value; 13189 } 13190 13191 var elem = _ref12; 13192 13193 if (!this.isPure(elem, constantsOnly)) return false; 13194 } 13195 return true; 13196 } else if (t.isObjectExpression(node)) { 13197 for (var _iterator13 = node.properties, _isArray13 = Array.isArray(_iterator13), _i13 = 0, _iterator13 = _isArray13 ? _iterator13 : (0, _getIterator3.default)(_iterator13);;) { 13198 var _ref13; 13199 13200 if (_isArray13) { 13201 if (_i13 >= _iterator13.length) break; 13202 _ref13 = _iterator13[_i13++]; 13203 } else { 13204 _i13 = _iterator13.next(); 13205 if (_i13.done) break; 13206 _ref13 = _i13.value; 13207 } 13208 13209 var prop = _ref13; 13210 13211 if (!this.isPure(prop, constantsOnly)) return false; 13212 } 13213 return true; 13214 } else if (t.isClassMethod(node)) { 13215 if (node.computed && !this.isPure(node.key, constantsOnly)) return false; 13216 if (node.kind === "get" || node.kind === "set") return false; 13217 return true; 13218 } else if (t.isClassProperty(node) || t.isObjectProperty(node)) { 13219 if (node.computed && !this.isPure(node.key, constantsOnly)) return false; 13220 return this.isPure(node.value, constantsOnly); 13221 } else if (t.isUnaryExpression(node)) { 13222 return this.isPure(node.argument, constantsOnly); 13223 } else { 13224 return t.isPureish(node); 13225 } 13226 }; 13227 13228 Scope.prototype.setData = function setData(key, val) { 13229 return this.data[key] = val; 13230 }; 13231 13232 Scope.prototype.getData = function getData(key) { 13233 var scope = this; 13234 do { 13235 var data = scope.data[key]; 13236 if (data != null) return data; 13237 } while (scope = scope.parent); 13238 }; 13239 13240 Scope.prototype.removeData = function removeData(key) { 13241 var scope = this; 13242 do { 13243 var data = scope.data[key]; 13244 if (data != null) scope.data[key] = null; 13245 } while (scope = scope.parent); 13246 }; 13247 13248 Scope.prototype.init = function init() { 13249 if (!this.references) this.crawl(); 13250 }; 13251 13252 Scope.prototype.crawl = function crawl() { 13253 _crawlCallsCount++; 13254 this._crawl(); 13255 _crawlCallsCount--; 13256 }; 13257 13258 Scope.prototype._crawl = function _crawl() { 13259 var path = this.path; 13260 13261 this.references = (0, _create2.default)(null); 13262 this.bindings = (0, _create2.default)(null); 13263 this.globals = (0, _create2.default)(null); 13264 this.uids = (0, _create2.default)(null); 13265 this.data = (0, _create2.default)(null); 13266 13267 if (path.isLoop()) { 13268 for (var _iterator14 = t.FOR_INIT_KEYS, _isArray14 = Array.isArray(_iterator14), _i14 = 0, _iterator14 = _isArray14 ? _iterator14 : (0, _getIterator3.default)(_iterator14);;) { 13269 var _ref14; 13270 13271 if (_isArray14) { 13272 if (_i14 >= _iterator14.length) break; 13273 _ref14 = _iterator14[_i14++]; 13274 } else { 13275 _i14 = _iterator14.next(); 13276 if (_i14.done) break; 13277 _ref14 = _i14.value; 13278 } 13279 13280 var key = _ref14; 13281 13282 var node = path.get(key); 13283 if (node.isBlockScoped()) this.registerBinding(node.node.kind, node); 13284 } 13285 } 13286 13287 if (path.isFunctionExpression() && path.has("id")) { 13288 if (!path.get("id").node[t.NOT_LOCAL_BINDING]) { 13289 this.registerBinding("local", path.get("id"), path); 13290 } 13291 } 13292 13293 if (path.isClassExpression() && path.has("id")) { 13294 if (!path.get("id").node[t.NOT_LOCAL_BINDING]) { 13295 this.registerBinding("local", path); 13296 } 13297 } 13298 13299 if (path.isFunction()) { 13300 var params = path.get("params"); 13301 for (var _iterator15 = params, _isArray15 = Array.isArray(_iterator15), _i15 = 0, _iterator15 = _isArray15 ? _iterator15 : (0, _getIterator3.default)(_iterator15);;) { 13302 var _ref15; 13303 13304 if (_isArray15) { 13305 if (_i15 >= _iterator15.length) break; 13306 _ref15 = _iterator15[_i15++]; 13307 } else { 13308 _i15 = _iterator15.next(); 13309 if (_i15.done) break; 13310 _ref15 = _i15.value; 13311 } 13312 13313 var param = _ref15; 13314 13315 this.registerBinding("param", param); 13316 } 13317 } 13318 13319 if (path.isCatchClause()) { 13320 this.registerBinding("let", path); 13321 } 13322 13323 var parent = this.getProgramParent(); 13324 if (parent.crawling) return; 13325 13326 var state = { 13327 references: [], 13328 constantViolations: [], 13329 assignments: [] 13330 }; 13331 13332 this.crawling = true; 13333 path.traverse(collectorVisitor, state); 13334 this.crawling = false;
13335 13336 for (var _iterator16 = state.assignments, _isArray16 = Array.isArray(_iterator16), _i16 = 0, _iterator16 = _isArray16 ? _iterator16 : (0, _getIterator3.default)(_iterator16);;) { 13337 var _ref16; 13338 13339 if (_isArray16) { 13340 if (_i16 >= _iterator16.length) break; 13341 _ref16 = _iterator16[_i16++]; 13342 } else { 13343 _i16 = _iterator16.next(); 13344 if (_i16.done) break; 13345 _ref16 = _i16.value; 13346 } 13347 13348 var _path = _ref16; 13349 13350 var ids = _path.getBindingIdentifiers(); 13351 var programParent = void 0; 13352 for (var name in ids) { 13353 if (_path.scope.getBinding(name)) continue; 13354 13355 programParent = programParent || _path.scope.getProgramParent(); 13356 programParent.addGlobal(ids[name]); 13357 } 13358 13359 _path.scope.registerConstantViolation(_path); 13360 } 13361 13362 for (var _iterator17 = state.references, _isArray17 = Array.isArray(_iterator17), _i17 = 0, _iterator17 = _isArray17 ? _iterator17 : (0, _getIterator3.default)(_iterator17);;) { 13363 var _ref17; 13364 13365 if (_isArray17) { 13366 if (_i17 >= _iterator17.length) break; 13367 _ref17 = _iterator17[_i17++]; 13368 } else { 13369 _i17 = _iterator17.next(); 13370 if (_i17.done) break; 13371 _ref17 = _i17.value; 13372 } 13373 13374 var ref = _ref17; 13375 13376 var binding = ref.scope.getBinding(ref.node.name); 13377 if (binding) { 13378 binding.reference(ref); 13379 } else { 13380 ref.scope.getProgramParent().addGlobal(ref.node); 13381 } 13382 } 13383 13384 for (var _iterator18 = state.constantViolations, _isArray18 = Array.isArray(_iterator18), _i18 = 0, _iterator18 = _isArray18 ? _iterator18 : (0, _getIterator3.default)(_iterator18);;) { 13385 var _ref18; 13386 13387 if (_isArray18) { 13388 if (_i18 >= _iterator18.length) break; 13389 _ref18 = _iterator18[_i18++]; 13390 } else { 13391 _i18 = _iterator18.next(); 13392 if (_i18.done) break; 13393 _ref18 = _i18.value; 13394 } 13395 13396 var _path2 = _ref18; 13397 13398 _path2.scope.registerConstantViolation(_path2); 13399 } 13400 }; 13401 13402 Scope.prototype.push = function push(opts) { 13403 var path = this.path; 13404 13405 if (!path.isBlockStatement() && !path.isProgram()) { 13406 path = this.getBlockParent().path; 13407 } 13408 13409 if (path.isSwitchStatement()) { 13410 path = this.getFunctionParent().path; 13411 } 13412 13413 if (path.isLoop() || path.isCatchClause() || path.isFunction()) { 13414 t.ensureBlock(path.node); 13415 path = path.get("body"); 13416 } 13417 13418 var unique = opts.unique; 13419 var kind = opts.kind || "var"; 13420 var blockHoist = opts._blockHoist == null ? 2 : opts._blockHoist; 13421 13422 var dataKey = "declaration:" + kind + ":" + blockHoist; 13423 var declarPath = !unique && path.getData(dataKey); 13424 13425 if (!declarPath) { 13426 var declar = t.variableDeclaration(kind, []); 13427 declar._generated = true; 13428 declar._blockHoist = blockHoist; 13429 13430 var _path$unshiftContaine = path.unshiftContainer("body", [declar]); 13431 13432 declarPath = _path$unshiftContaine[0]; 13433 13434 if (!unique) path.setData(dataKey, declarPath); 13435 } 13436 13437 var declarator = t.variableDeclarator(opts.id, opts.init); 13438 declarPath.node.declarations.push(declarator); 13439 this.registerBinding(kind, declarPath.get("declarations").pop()); 13440 }; 13441 13442 Scope.prototype.getProgramParent = function getProgramParent() { 13443 var scope = this; 13444 do { 13445 if (scope.path.isProgram()) { 13446 return scope; 13447 } 13448 } while (scope = scope.parent); 13449 throw new Error("We couldn't find a Function or Program..."); 13450 }; 13451 13452 Scope.prototype.getFunctionParent = function getFunctionParent() { 13453 var scope = this; 13454 do { 13455 if (scope.path.isFunctionParent()) { 13456 return scope; 13457 } 13458 } while (scope = scope.parent); 13459 throw new Error("We couldn't find a Function or Program..."); 13460 }; 13461 13462 Scope.prototype.getBlockParent = function getBlockParent() { 13463 var scope = this; 13464 do { 13465 if (scope.path.isBlockParent()) { 13466 return scope; 13467 } 13468 } while (scope = scope.parent); 13469 throw new Error("We couldn't find a BlockStatement, For, Switch, Function, Loop or Program..."); 13470 }; 13471 13472 Scope.prototype.getAllBindings = function getAllBindings() { 13473 var ids = (0, _create2.default)(null); 13474 13475 var scope = this; 13476 do { 13477 (0, _defaults2.default)(ids, scope.bindings); 13478 scope = scope.parent; 13479 } while (scope); 13480 13481 return ids; 13482 }; 13483 13484 Scope.prototype.getAllBindingsOfKind = function getAllBindingsOfKind() { 13485 var ids = (0, _create2.default)(null); 13486 13487 for (var _iterator19 = arguments, _isArray19 = Array.isArray(_iterator19), _i19 = 0, _iterator19 = _isArray19 ? _iterator19 : (0, _getIterator3.default)(_iterator19);;) { 13488 var _ref19; 13489 13490 if (_isArray19) { 13491 if (_i19 >= _iterator19.length) break; 13492 _ref19 = _iterator19[_i19++]; 13493 } else { 13494 _i19 = _iterator19.next(); 13495 if (_i19.done) break; 13496 _ref19 = _i19.value; 13497 } 13498 13499 var kind = _ref19; 13500 13501 var scope = this; 13502 do { 13503 for (var name in scope.bindings) { 13504 var binding = scope.bindings[name]; 13505 if (binding.kind === kind) ids[name] = binding; 13506 } 13507 scope = scope.parent; 13508 } while (scope); 13509 } 13510 13511 return ids; 13512 }; 13513 13514 Scope.prototype.bindingIdentifierEquals = function bindingIdentifierEquals(name, node) {
13515 return this.getBindingIdentifier(name) === node; 13516 }; 13517 13518 Scope.prototype.warnOnFlowBinding = function warnOnFlowBinding(binding) { 13519 if (_crawlCallsCount === 0 && binding && binding.path.isFlow()) { 13520 console.warn("\n You or one of the Babel plugins you are using are using Flow declarations as bindings.\n Support for this will be removed in version 6.8. To find out the caller, grep for this\n message and change it to a `console.trace()`.\n "); 13521 } 13522 return binding; 13523 }; 13524 13525 Scope.prototype.getBinding = function getBinding(name) { 13526 var scope = this; 13527 13528 do { 13529 var binding = scope.getOwnBinding(name); 13530 if (binding) return this.warnOnFlowBinding(binding); 13531 } while (scope = scope.parent); 13532 }; 13533 13534 Scope.prototype.getOwnBinding = function getOwnBinding(name) { 13535 return this.warnOnFlowBinding(this.bindings[name]); 13536 }; 13537 13538 Scope.prototype.getBindingIdentifier = function getBindingIdentifier(name) { 13539 var info = this.getBinding(name); 13540 return info && info.identifier; 13541 }; 13542 13543 Scope.prototype.getOwnBindingIdentifier = function getOwnBindingIdentifier(name) { 13544 var binding = this.bindings[name]; 13545 return binding && binding.identifier; 13546 }; 13547 13548 Scope.prototype.hasOwnBinding = function hasOwnBinding(name) { 13549 return !!this.getOwnBinding(name); 13550 }; 13551 13552 Scope.prototype.hasBinding = function hasBinding(name, noGlobals) { 13553 if (!name) return false; 13554 if (this.hasOwnBinding(name)) return true; 13555 if (this.parentHasBinding(name, noGlobals)) return true; 13556 if (this.hasUid(name)) return true; 13557 if (!noGlobals && (0, _includes2.default)(Scope.globals, name)) return true; 13558 if (!noGlobals && (0, _includes2.default)(Scope.contextVariables, name)) return true; 13559 return false; 13560 }; 13561 13562 Scope.prototype.parentHasBinding = function parentHasBinding(name, noGlobals) { 13563 return this.parent && this.parent.hasBinding(name, noGlobals); 13564 }; 13565 13566 Scope.prototype.moveBindingTo = function moveBindingTo(name, scope) { 13567 var info = this.getBinding(name); 13568 if (info) { 13569 info.scope.removeOwnBinding(name); 13570 info.scope = scope; 13571 scope.bindings[name] = info; 13572 } 13573 }; 13574 13575 Scope.prototype.removeOwnBinding = function removeOwnBinding(name) { 13576 delete this.bindings[name]; 13577 }; 13578 13579 Scope.prototype.removeBinding = function removeBinding(name) { 13580 var info = this.getBinding(name); 13581 if (info) { 13582 info.scope.removeOwnBinding(name); 13583 } 13584 13585 var scope = this; 13586 do { 13587 if (scope.uids[name]) { 13588 scope.uids[name] = false; 13589 } 13590 } while (scope = scope.parent); 13591 }; 13592 13593 return Scope; 13594 }(); 13595 13596 Scope.globals = (0, _keys2.default)(_globals2.default.builtin); 13597 Scope.contextVariables = ["arguments", "undefined", "Infinity", "NaN"]; 13598 exports.default = Scope; 13599 module.exports = exports["default"]; 13600 13601/***/ }, 13602/* 132 */ 13603/***/ function(module, exports, __webpack_require__) { 13604 13605 "use strict"; 13606 13607 exports.__esModule = true; 13608 exports.NOT_LOCAL_BINDING = exports.BLOCK_SCOPED_SYMBOL = exports.INHERIT_KEYS = exports.UNARY_OPERATORS = exports.STRING_UNARY_OPERATORS = exports.NUMBER_UNARY_OPERATORS = exports.BOOLEAN_UNARY_OPERATORS = exports.BINARY_OPERATORS = exports.NUMBER_BINARY_OPERATORS = exports.BOOLEAN_BINARY_OPERATORS = exports.COMPARISON_BINARY_OPERATORS = exports.EQUALITY_BINARY_OPERATORS = exports.BOOLEAN_NUMBER_BINARY_OPERATORS = exports.UPDATE_OPERATORS = exports.LOGICAL_OPERATORS = exports.COMMENT_KEYS = exports.FOR_INIT_KEYS = exports.FLATTENABLE_KEYS = exports.STATEMENT_OR_BLOCK_KEYS = undefined; 13609 13610 var _for = __webpack_require__(356); 13611 13612 var _for2 = _interopRequireDefault(_for); 13613 13614 function _interopRequireDefault(obj) { 13615 return obj && obj.__esModule ? obj : { default: obj }; 13616 } 13617 13618 var STATEMENT_OR_BLOCK_KEYS = exports.STATEMENT_OR_BLOCK_KEYS = ["consequent", "body", "alternate"]; 13619 var FLATTENABLE_KEYS = exports.FLATTENABLE_KEYS = ["body", "expressions"]; 13620 var FOR_INIT_KEYS = exports.FOR_INIT_KEYS = ["left", "init"]; 13621 var COMMENT_KEYS = exports.COMMENT_KEYS = ["leadingComments", "trailingComments", "innerComments"]; 13622 13623 var LOGICAL_OPERATORS = exports.LOGICAL_OPERATORS = ["||", "&&"]; 13624 var UPDATE_OPERATORS = exports.UPDATE_OPERATORS = ["++", "--"]; 13625 13626 var BOOLEAN_NUMBER_BINARY_OPERATORS = exports.BOOLEAN_NUMBER_BINARY_OPERATORS = [">", "<", ">=", "<="]; 13627 var EQUALITY_BINARY_OPERATORS = exports.EQUALITY_BINARY_OPERATORS = ["
13627==", "===", "!=", "!=="]; 13628 var COMPARISON_BINARY_OPERATORS = exports.COMPARISON_BINARY_OPERATORS = [].concat(EQUALITY_BINARY_OPERATORS, ["in", "instanceof"]); 13629 var BOOLEAN_BINARY_OPERATORS = exports.BOOLEAN_BINARY_OPERATORS = [].concat(COMPARISON_BINARY_OPERATORS, BOOLEAN_NUMBER_BINARY_OPERATORS); 13630 var NUMBER_BINARY_OPERATORS = exports.NUMBER_BINARY_OPERATORS = ["-", "/", "%", "*", "**", "&", "|", ">>", ">>>", "<<", "^"]; 13631 var BINARY_OPERATORS = exports.BINARY_OPERATORS = ["+"].concat(NUMBER_BINARY_OPERATORS, BOOLEAN_BINARY_OPERATORS); 13632 13633 var BOOLEAN_UNARY_OPERATORS = exports.BOOLEAN_UNARY_OPERATORS = ["delete", "!"]; 13634 var NUMBER_UNARY_OPERATORS = exports.NUMBER_UNARY_OPERATORS = ["+", "-", "++", "--", "~"]; 13635 var STRING_UNARY_OPERATORS = exports.STRING_UNARY_OPERATORS = ["typeof"]; 13636 var UNARY_OPERATORS = exports.UNARY_OPERATORS = ["void"].concat(BOOLEAN_UNARY_OPERATORS, NUMBER_UNARY_OPERATORS, STRING_UNARY_OPERATORS); 13637 13638 var INHERIT_KEYS = exports.INHERIT_KEYS = { 13639 optional: ["typeAnnotation", "typeParameters", "returnType"], 13640 force: ["start", "loc", "end"] 13641 }; 13642 13643 var BLOCK_SCOPED_SYMBOL = exports.BLOCK_SCOPED_SYMBOL = (0, _for2.default)("var used to be block scoped"); 13644 var NOT_LOCAL_BINDING = exports.NOT_LOCAL_BINDING = (0, _for2.default)("should not be considered a local binding"); 13645 13646/***/ }, 13647/* 133 */ 13648/***/ function(module, exports) { 13649 13650 'use strict'; 13651 13652 var _typeof2 = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; 13653 13654 Object.defineProperty(exports, '__esModule', { value: true }); 13655 13656 /* eslint max-len: 0 */ 13657 13658 // This is a trick taken from Esprima. It turns out that, on 13659 // non-Chrome browsers, to check whether a string is in a set, a 13660 // predicate containing a big ugly `switch` statement is faster than 13661 // a regular expression, and on Chrome the two are about on par. 13662 // This function uses `eval` (non-lexical) to produce such a 13663 // predicate from a space-separated string of words. 13664 // 13665 // It starts by sorting the words by length. 13666 13667 function makePredicate(words) { 13668 words = words.split(" "); 13669 return function (str) { 13670 return words.indexOf(str) >= 0; 13671 }; 13672 } 13673 13674 // Reserved word lists for various dialects of the language 13675 13676 var reservedWords = { 13677 6: makePredicate("enum await"), 13678 strict: makePredicate("implements interface let package private protected public static yield"), 13679 strictBind: makePredicate("eval arguments") 13680 }; 13681 13682 // And the keywords 13683 13684 var isKeyword = makePredicate("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 let const class extends export import yield super"); 13685 13686 // ## Character categories 13687 13688 // Big ugly regular expressions that match characters in the 13689 // whitespace, identifier, and identifier-start categories. These 13690 // are only applied when a character is found to actually have a 13691 // code point above 128. 13692 // Generated by `bin/generate-identifier-regex.js`. 13693 13694 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\u0561-\u0587\u05D0-\u05EA\u05F0-\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\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u
136940EB3\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-\u1877\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\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\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-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\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-\uAB65\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'; 13695 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\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D4-\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\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\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B66-\u0B6F\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\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\u0D01-\u0D03\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D66-\u0D6F\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0E50-\u0E59\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0ED0-\u0ED9\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1040-\u1049\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109D\u135D-\u135F\u1369-\u1371\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u18A9\u1920-\u192B\u1930-\u193B\u1946-\u194F\u19D0-\u19DA\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AB0-\u1ABD\u1B00-\u1B04\u1B34-\u1B44\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BF3\u1C24-\u1C37\u1C40-\u1C49\u1C50-\u1C59\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF5\u1DFB-\u1DFF\u203F\u2040\u2054\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D
136957F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA620-\uA629\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F1\uA900-\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'; 13696 13697 var nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]"); 13698 var nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]"); 13699 13700 nonASCIIidentifierStartChars = nonASCIIidentifierChars = null; 13701 13702 // These are a run-length and offset encoded representation of the 13703 // >0xffff code points that are a valid part of identifiers. The 13704 // offset starts at 0x10000, and each pair of numbers represents an 13705 // offset to the next range, and then a size of the range. They were 13706 // generated by `bin/generate-identifier-regex.js`. 13707 // eslint-disable-next-line comma-spacing 13708 var astralIdentifierStartCodes = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 17, 26, 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, 26, 45, 28, 4, 28, 36, 7, 2, 27, 28, 53, 11, 21, 11, 18, 14, 17, 111, 72, 56, 50, 14, 50, 785, 52, 76, 44, 33, 24, 27, 35, 42, 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, 54, 47, 21, 1, 2, 0, 185, 46, 42, 3, 37, 47, 21, 0, 60, 42, 86, 25, 391, 63, 32, 0, 449, 56, 264, 8, 2, 36, 18, 0, 50, 29, 881, 921, 103, 110, 18, 195, 2749, 1070, 4050, 582, 8634, 568, 8, 30, 114, 29, 19, 47, 17, 3, 32, 20, 6, 18, 881, 68, 12, 0, 67, 12, 65, 0, 32, 6124, 20, 754, 9486, 1, 3071, 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, 4149, 196, 60, 67, 1213, 3, 2, 26, 2, 1, 2, 0, 3, 0, 2, 9, 2, 3, 2, 0, 2, 0, 7, 0, 5, 0, 2, 0, 2, 0, 2, 2, 2, 1, 2, 0, 3, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 1, 2, 0, 3, 3, 2, 6, 2, 3, 2, 3, 2, 0, 2, 9, 2, 16, 6, 2, 2, 4, 2, 16, 4421, 42710, 42, 4148, 12, 221, 3, 5761, 10591, 541]; 13709 // eslint-disable-next-line comma-spacing 13710 var astralIdentifierCodes = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 1306, 2, 54, 14, 32, 9, 16, 3, 46, 10, 54, 9, 7, 2, 37, 13, 2, 9, 52, 0, 13, 2, 49, 13, 10, 2, 4, 9, 83, 11, 7, 0, 161, 11, 6, 9, 7, 3, 57, 0, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 193, 17, 10, 9, 87, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 84, 14, 5, 9, 423, 9, 838, 7, 2, 7, 17, 9, 57, 21, 2, 13, 19882, 9, 135, 4, 60, 6, 26, 9, 1016, 45, 17, 3, 19723, 1, 5319, 4, 4, 5, 9, 7, 3, 6, 31, 3, 149, 2, 1418, 49, 513, 54, 5, 49, 9, 0, 15, 0, 23, 4, 2, 14, 1361, 6, 2, 16, 3, 6, 2, 1, 2, 4, 2214, 6, 110, 6, 6, 9, 792487, 239]; 13711 13712 // This has a complexity linear to the value of the code. The 13713 // assumption is that looking up astral identifier characters is 13714 // rare. 13715 function isInAstralSet(code, set) { 13716 var pos = 0x10000; 13717 for (var i = 0; i < set.length; i += 2) { 13718 pos += set[i]; 13719 if (pos > code) return false; 13720 13721 pos += set[i + 1]; 13722 if (pos >= code) return true; 13723 } 13724 } 13725 13726 // Test whether a given character code starts an identifier. 13727 13728 function isIdentifierStart(code) { 13729 if (code < 65) return code === 36; 13730 if (code < 91) return true; 13731 if (code < 97) return code === 95; 13732 if (code < 123) return true; 13733 if (code <= 0xffff) return code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code)); 13734 return isInAstralSet(code, astralIdentifierStartCodes); 13735 } 13736 13737 // Test whether a given character is part of an identifier. 13738 13739 function isIdentifierChar(code) { 13740 if (code < 48) return code === 36; 13741 if (code < 58) return true; 13742 if (code < 65) return false;
13743 if (code < 91) return true; 13744 if (code < 97) return code === 95; 13745 if (code < 123) return true; 13746 if (code <= 0xffff) return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code)); 13747 return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes); 13748 } 13749 13750 // A second optional argument can be given to further configure 13751 var defaultOptions = { 13752 // Source type ("script" or "module") for different semantics 13753 sourceType: "script", 13754 // Source filename. 13755 sourceFilename: undefined, 13756 // Line from which to start counting source. Useful for 13757 // integration with other tools. 13758 startLine: 1, 13759 // When enabled, a return at the top level is not considered an 13760 // error. 13761 allowReturnOutsideFunction: false, 13762 // When enabled, import/export statements are not constrained to 13763 // appearing at the top of the program. 13764 allowImportExportEverywhere: false, 13765 // TODO 13766 allowSuperOutsideMethod: false, 13767 // An array of plugins to enable 13768 plugins: [], 13769 // TODO 13770 strictMode: null 13771 }; 13772 13773 // Interpret and default an options object 13774 13775 function getOptions(opts) { 13776 var options = {}; 13777 for (var key in defaultOptions) { 13778 options[key] = opts && key in opts ? opts[key] : defaultOptions[key]; 13779 } 13780 return options; 13781 } 13782 13783 var _typeof = typeof Symbol === "function" && _typeof2(Symbol.iterator) === "symbol" ? function (obj) { 13784 return typeof obj === 'undefined' ? 'undefined' : _typeof2(obj); 13785 } : function (obj) { 13786 return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj === 'undefined' ? 'undefined' : _typeof2(obj); 13787 }; 13788 13789 var classCallCheck = function classCallCheck(instance, Constructor) { 13790 if (!(instance instanceof Constructor)) { 13791 throw new TypeError("Cannot call a class as a function"); 13792 } 13793 }; 13794 13795 var inherits = function inherits(subClass, superClass) { 13796 if (typeof superClass !== "function" && superClass !== null) { 13797 throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === 'undefined' ? 'undefined' : _typeof2(superClass))); 13798 } 13799 13800 subClass.prototype = Object.create(superClass && superClass.prototype, { 13801 constructor: { 13802 value: subClass, 13803 enumerable: false, 13804 writable: true, 13805 configurable: true 13806 } 13807 }); 13808 if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; 13809 }; 13810 13811 var possibleConstructorReturn = function possibleConstructorReturn(self, call) { 13812 if (!self) { 13813 throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); 13814 } 13815 13816 return call && ((typeof call === 'undefined' ? 'undefined' : _typeof2(call)) === "object" || typeof call === "function") ? call : self; 13817 }; 13818 13819 // ## Token types 13820 13821 // The assignment of fine-grained, information-carrying type objects 13822 // allows the tokenizer to store the information it has about a 13823 // token in a way that is very cheap for the parser to look up. 13824 13825 // All token type variables start with an underscore, to make them 13826 // easy to recognize. 13827 13828 // The `beforeExpr` property is used to disambiguate between regular
13829 // expressions and divisions. It is set on all token types that can 13830 // be followed by an expression (thus, a slash after them would be a 13831 // regular expression). 13832 // 13833 // `isLoop` marks a keyword as starting a loop, which is important 13834 // to know when parsing a label, in order to allow or disallow 13835 // continue jumps to that label. 13836 13837 var beforeExpr = true; 13838 var startsExpr = true; 13839 var isLoop = true; 13840 var isAssign = true; 13841 var prefix = true; 13842 var postfix = true; 13843 13844 var TokenType = function TokenType(label) { 13845 var conf = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; 13846 classCallCheck(this, TokenType); 13847 13848 this.label = label; 13849 this.keyword = conf.keyword; 13850 this.beforeExpr = !!conf.beforeExpr; 13851 this.startsExpr = !!conf.startsExpr; 13852 this.rightAssociative = !!conf.rightAssociative; 13853 this.isLoop = !!conf.isLoop; 13854 this.isAssign = !!conf.isAssign; 13855 this.prefix = !!conf.prefix; 13856 this.postfix = !!conf.postfix; 13857 this.binop = conf.binop || null; 13858 this.updateContext = null; 13859 }; 13860 13861 var KeywordTokenType = function (_TokenType) { 13862 inherits(KeywordTokenType, _TokenType); 13863 13864 function KeywordTokenType(name) { 13865 var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; 13866 classCallCheck(this, KeywordTokenType); 13867 13868 options.keyword = name; 13869 13870 return possibleConstructorReturn(this, _TokenType.call(this, name, options)); 13871 } 13872 13873 return KeywordTokenType; 13874 }(TokenType); 13875 13876 var BinopTokenType = function (_TokenType2) { 13877 inherits(BinopTokenType, _TokenType2); 13878 13879 function BinopTokenType(name, prec) { 13880 classCallCheck(this, BinopTokenType); 13881 return possibleConstructorReturn(this, _TokenType2.call(this, name, { beforeExpr: beforeExpr, binop: prec })); 13882 } 13883 13884 return BinopTokenType; 13885 }(TokenType); 13886 13887 var types = { 13888 num: new TokenType("num", { startsExpr: startsExpr }), 13889 regexp: new TokenType("regexp", { startsExpr: startsExpr }), 13890 string: new TokenType("string", { startsExpr: startsExpr }), 13891 name: new TokenType("name", { startsExpr: startsExpr }), 13892 eof: new TokenType("eof"), 13893 13894 // Punctuation token types. 13895 bracketL: new TokenType("[", { beforeExpr: beforeExpr, startsExpr: startsExpr }), 13896 bracketR: new TokenType("]"), 13897 braceL: new TokenType("{", { beforeExpr: beforeExpr, startsExpr: startsExpr }), 13898 braceBarL: new TokenType("{|", { beforeExpr: beforeExpr, startsExpr: startsExpr }), 13899 braceR: new TokenType("}"), 13900 braceBarR: new TokenType("|}"), 13901 parenL: new TokenType("(", { beforeExpr: beforeExpr, startsExpr: startsExpr }), 13902 parenR: new TokenType(")"), 13903 comma: new TokenType(",", { beforeExpr: beforeExpr }), 13904 semi: new TokenType(";", { beforeExpr: beforeExpr }), 13905 colon: new TokenType(":", { beforeExpr: beforeExpr }), 13906 doubleColon: new TokenType("::", { beforeExpr: beforeExpr }), 13907 dot: new TokenType("."), 13908 question: new TokenType("?", { beforeExpr: beforeExpr }), 13909 arrow: new TokenType("=>", { beforeExpr: beforeExpr }), 13910 template: new TokenType("template"), 13911 ellipsis: new TokenType("...", { beforeExpr: beforeExpr }), 13912 backQuote: new TokenType("`", { startsExpr: startsExpr }), 13913 dollarBraceL: new TokenType("${", { beforeExpr: beforeExpr, startsExpr: startsExpr }), 13914 at: new TokenType("@"), 13915 13916 // Operators. These carry several kinds of properties to help the 13917 // parser use them properly (the presence of these properties is 13918 // what categorizes them as operators). 13919 // 13920 // `binop`, when present, specifies that this operator is a binary 13921 // operator, and will refer to its precedence. 13922 // 13923 // `prefix` and `postfix` mark the operator as a prefix or postfix 13924 // unary operator. 13925 // 13926 // `isAssign` marks all of `=`, `+=`, `-=` etcetera, which act as
13927 // binary operators with a very low precedence, that should result 13928 // in AssignmentExpression nodes. 13929 13930 eq: new TokenType("=", { beforeExpr: beforeExpr, isAssign: isAssign }), 13931 assign: new TokenType("_=", { beforeExpr: beforeExpr, isAssign: isAssign }), 13932 incDec: new TokenType("++/--", { prefix: prefix, postfix: postfix, startsExpr: startsExpr }), 13933 prefix: new TokenType("prefix", { beforeExpr: beforeExpr, prefix: prefix, startsExpr: startsExpr }), 13934 logicalOR: new BinopTokenType("||", 1), 13935 logicalAND: new BinopTokenType("&&", 2), 13936 bitwiseOR: new BinopTokenType("|", 3), 13937 bitwiseXOR: new BinopTokenType("^", 4), 13938 bitwiseAND: new BinopTokenType("&", 5), 13939 equality: new BinopTokenType("==/!=", 6), 13940 relational: new BinopTokenType("</>", 7), 13941 bitShift: new BinopTokenType("<</>>", 8), 13942 plusMin: new TokenType("+/-", { beforeExpr: beforeExpr, binop: 9, prefix: prefix, startsExpr: startsExpr }), 13943 modulo: new BinopTokenType("%", 10), 13944 star: new BinopTokenType("*", 10), 13945 slash: new BinopTokenType("/", 10), 13946 exponent: new TokenType("**", { beforeExpr: beforeExpr, binop: 11, rightAssociative: true }) 13947 }; 13948 13949 var keywords = { 13950 "break": new KeywordTokenType("break"), 13951 "case": new KeywordTokenType("case", { beforeExpr: beforeExpr }), 13952 "catch": new KeywordTokenType("catch"), 13953 "continue": new KeywordTokenType("continue"), 13954 "debugger": new KeywordTokenType("debugger"), 13955 "default": new KeywordTokenType("default", { beforeExpr: beforeExpr }), 13956 "do": new KeywordTokenType("do", { isLoop: isLoop, beforeExpr: beforeExpr }), 13957 "else": new KeywordTokenType("else", { beforeExpr: beforeExpr }), 13958 "finally": new KeywordTokenType("finally"), 13959 "for": new KeywordTokenType("for", { isLoop: isLoop }), 13960 "function": new KeywordTokenType("function", { startsExpr: startsExpr }), 13961 "if": new KeywordTokenType("if"), 13962 "return": new KeywordTokenType("return", { beforeExpr: beforeExpr }), 13963 "switch": new KeywordTokenType("switch"), 13964 "throw": new KeywordTokenType("throw", { beforeExpr: beforeExpr }), 13965 "try": new KeywordTokenType("try"), 13966 "var": new KeywordTokenType("var"), 13967 "let": new KeywordTokenType("let"), 13968 "const": new KeywordTokenType("const"), 13969 "while": new KeywordTokenType("while", { isLoop: isLoop }), 13970 "with": new KeywordTokenType("with"), 13971 "new": new KeywordTokenType("new", { beforeExpr: beforeExpr, startsExpr: startsExpr }), 13972 "this": new KeywordTokenType("this", { startsExpr: startsExpr }), 13973 "super": new KeywordTokenType("super", { startsExpr: startsExpr }), 13974 "class": new KeywordTokenType("class"), 13975 "extends": new KeywordTokenType("extends", { beforeExpr: beforeExpr }), 13976 "export": new KeywordTokenType("export"), 13977 "import": new KeywordTokenType("import"), 13978 "yield": new KeywordTokenType("yield", { beforeExpr: beforeExpr, startsExpr: startsExpr }), 13979 "null": new KeywordTokenType("null", { startsExpr: startsExpr }), 13980 "true": new KeywordTokenType("true", { startsExpr: startsExpr }), 13981 "false": new KeywordTokenType("false", { startsExpr: startsExpr }), 13982 "in": new KeywordTokenType("in", { beforeExpr: beforeExpr, binop: 7 }), 13983 "instanceof": new KeywordTokenType("instanceof", { beforeExpr: beforeExpr, binop: 7 }), 13984 "typeof": new KeywordTokenType("typeof", { beforeExpr: beforeExpr, prefix: prefix, startsExpr: startsExpr }), 13985 "void": new KeywordTokenType("void", { beforeExpr: beforeExpr, prefix: prefix, startsExpr: startsExpr }), 13986 "delete": new KeywordTokenType("delete", { beforeExpr: beforeExpr, prefix: prefix, startsExpr: startsExpr }) 13987 }; 13988 13989 // Map keyword names to token types.
13990 Object.keys(keywords).forEach(function (name) { 13991 types["_" + name] = keywords[name]; 13992 }); 13993 13994 // Matches a whole line break (where CRLF is considered a single 13995 // line break). Used to count lines. 13996 13997 var lineBreak = /\r\n?|\n|\u2028|\u2029/; 13998 var lineBreakG = new RegExp(lineBreak.source, "g"); 13999 14000 function isNewLine(code) { 14001 return code === 10 || code === 13 || code === 0x2028 || code === 0x2029; 14002 } 14003 14004 var nonASCIIwhitespace = /[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/; 14005 14006 // The algorithm used to determine whether a regexp can appear at a 14007 // given point in the program is loosely based on sweet.js' approach. 14008 // See https://github.com/mozilla/sweet.js/wiki/design 14009 14010 var TokContext = function TokContext(token, isExpr, preserveSpace, override) { 14011 classCallCheck(this, TokContext); 14012 14013 this.token = token; 14014 this.isExpr = !!isExpr; 14015 this.preserveSpace = !!preserveSpace; 14016 this.override = override; 14017 }; 14018 14019 var types$1 = { 14020 braceStatement: new TokContext("{", false), 14021 braceExpression: new TokContext("{", true), 14022 templateQuasi: new TokContext("${", true), 14023 parenStatement: new TokContext("(", false), 14024 parenExpression: new TokContext("(", true), 14025 template: new TokContext("`", true, true, function (p) { 14026 return p.readTmplToken(); 14027 }), 14028 functionExpression: new TokContext("function", true) 14029 }; 14030 14031 // Token-specific context update code 14032 14033 types.parenR.updateContext = types.braceR.updateContext = function () { 14034 if (this.state.context.length === 1) { 14035 this.state.exprAllowed = true; 14036 return; 14037 } 14038 14039 var out = this.state.context.pop(); 14040 if (out === types$1.braceStatement && this.curContext() === types$1.functionExpression) { 14041 this.state.context.pop(); 14042 this.state.exprAllowed = false; 14043 } else if (out === types$1.templateQuasi) { 14044 this.state.exprAllowed = true; 14045 } else { 14046 this.state.exprAllowed = !out.isExpr; 14047 } 14048 }; 14049 14050 types.name.updateContext = function (prevType) { 14051 this.state.exprAllowed = false; 14052 14053 if (prevType === types._let || prevType === types._const || prevType === types._var) { 14054 if (lineBreak.test(this.input.slice(this.state.end))) { 14055 this.state.exprAllowed = true; 14056 } 14057 } 14058 }; 14059 14060 types.braceL.updateContext = function (prevType) { 14061 this.state.context.push(this.braceIsBlock(prevType) ? types$1.braceStatement : types$1.braceExpression); 14062 this.state.exprAllowed = true; 14063 }; 14064 14065 types.dollarBraceL.updateContext = function () { 14066 this.state.context.push(types$1.templateQuasi); 14067 this.state.exprAllowed = true; 14068 }; 14069 14070 types.parenL.updateContext = function (prevType) { 14071 var statementParens = prevType === types._if || prevType === types._for || prevType === types._with || prevType === types._while; 14072 this.state.context.push(statementParens ? types$1.parenStatement : types$1.parenExpression); 14073 this.state.exprAllowed = true; 14074 }; 14075 14076 types.incDec.updateContext = function () { 14077 // tokExprAllowed stays unchanged 14078 }; 14079 14080 types._function.updateContext = function () { 14081 if (this.curContext() !== types$1.braceStatement) { 14082 this.state.context.push(types$1.functionExpression); 14083 } 14084 14085 this.state.exprAllowed = false; 14086 }; 14087 14088 types.backQuote.updateContext = function () { 14089 if (this.curContext() === types$1.template) { 14090 this.state.context.pop(); 14091 } else { 14092 this.state.context.push(types$1.template); 14093 } 14094 this.state.exprAllowed = false; 14095 }; 14096 14097 // These are used when `options.locations` is on, for the 14098 // `startLoc` and `endLoc` properties. 14099 14100 var Position = function Position(line, col) { 14101 classCallCheck(this, Position); 14102 14103 this.line = line; 14104 this.column = col; 14105 }; 14106 14107 var SourceLocation = function SourceLocation(start, end) { 14108 classCallCheck(this, SourceLocation); 14109 14110 this.start = start; 14111 this.end = end; 14112 }; 14113 14114 // The `getLineInfo` function is mostly useful when the 14115 // `locations` option is off (for performance reasons) and you 14116 // want to find the line/column position for a given character 14117 // offset. `input` should be the code string that the offset refers 14118 // into. 14119 14120 function getLineInfo(input, offset) { 14121 for (var line = 1, cur = 0;;) { 14122 lineBreakG.lastIndex = cur; 14123 var match = lineBreakG.exec(input); 14124 if (match && match.index < offset) { 14125 ++line; 14126 cur = match.index + match[0].length; 14127 } else { 14128 return new Position(line, offset - cur); 14129 } 14130 } 14131 } 14132 14133 var State = function () { 14134 function State() { 14135 classCallCheck(this, State); 14136 } 14137 14138 State.prototype.init = function init(options, input) { 14139 this.strict = options.strictMode === false ? false : options.sourceType === "module"; 14140 14141 this.input = input; 14142 14143 this.potentialArrowAt = -1; 14144 14145 this.inMethod = this.inFunction = this.inGenerator = this.inAsync = this.inPropertyName = this.inType = this.noAnonFunctionType = false;
14146 14147 this.labels = []; 14148 14149 this.decorators = []; 14150 14151 this.tokens = []; 14152 14153 this.comments = []; 14154 14155 this.trailingComments = []; 14156 this.leadingComments = []; 14157 this.commentStack = []; 14158 14159 this.pos = this.lineStart = 0; 14160 this.curLine = options.startLine; 14161 14162 this.type = types.eof; 14163 this.value = null; 14164 this.start = this.end = this.pos; 14165 this.startLoc = this.endLoc = this.curPosition(); 14166 14167 this.lastTokEndLoc = this.lastTokStartLoc = null; 14168 this.lastTokStart = this.lastTokEnd = this.pos; 14169 14170 this.context = [types$1.braceStatement]; 14171 this.exprAllowed = true; 14172 14173 this.containsEsc = this.containsOctal = false; 14174 this.octalPosition = null; 14175 14176 this.exportedIdentifiers = []; 14177 14178 return this; 14179 }; 14180 14181 // TODO 14182 14183 14184 // TODO 14185 14186 14187 // Used to signify the start of a potential arrow function 14188 14189 14190 // Flags to track whether we are in a function, a generator. 14191 14192 14193 // Labels in scope. 14194 14195 14196 // Leading decorators. 14197 14198 14199 // Token store. 14200 14201 14202 // Comment store. 14203 14204 14205 // Comment attachment store 14206 14207 14208 // The current position of the tokenizer in the input. 14209 14210 14211 // Properties of the current token: 14212 // Its type 14213 14214 14215 // For tokens that include more information than their type, the value 14216 14217 14218 // Its start and end offset 14219 14220 14221 // And, if locations are used, the {line, column} object 14222 // corresponding to those offsets 14223 14224 14225 // Position information for the previous token 14226 14227 14228 // The context stack is used to superficially track syntactic 14229 // context to predict whether a regular expression is allowed in a 14230 // given position. 14231 14232 14233 // Used to signal to callers of `readWord1` whether the word 14234 // contained any escape sequences. This is needed because words with 14235 // escape sequences must not be interpreted as keywords. 14236 14237 14238 // TODO 14239 14240 14241 // Names of exports store. `default` is stored as a name for both 14242 // `export default foo;` and `export { foo as default };`. 14243 14244 14245 State.prototype.curPosition = function curPosition() { 14246 return new Position(this.curLine, this.pos - this.lineStart); 14247 }; 14248 14249 State.prototype.clone = function clone(skipArrays) { 14250 var state = new State(); 14251 for (var key in this) { 14252 var val = this[key]; 14253 14254 if ((!skipArrays || key === "context") && Array.isArray(val)) { 14255 val = val.slice(); 14256 } 14257 14258 state[key] = val; 14259 } 14260 return state; 14261 }; 14262 14263 return State; 14264 }(); 14265 14266 // Object type used to represent tokens. Note that normally, tokens 14267 // simply exist as properties on the parser object. This is only 14268 // used for the onToken callback and the external tokenizer. 14269 14270 var Token = function Token(state) { 14271 classCallCheck(this, Token); 14272 14273 this.type = state.type; 14274 this.value = state.value; 14275 this.start = state.start; 14276 this.end = state.end; 14277 this.loc = new SourceLocation(state.startLoc, state.endLoc); 14278 }; 14279 14280 // ## Tokenizer 14281 14282 function codePointToString(code) { 14283 // UTF-16 Decoding 14284 if (code <= 0xFFFF) { 14285 return String.fromCharCode(code); 14286 } else { 14287 return String.fromCharCode((code - 0x10000 >> 10) + 0xD800, (code - 0x10000 & 1023) + 0xDC00); 14288 } 14289 } 14290 14291 var Tokenizer = function () { 14292 function Tokenizer(options, input) { 14293 classCallCheck(this, Tokenizer); 14294 14295 this.state = new State(); 14296 this.state.init(options, input); 14297 } 14298 14299 // Move to the next token 14300 14301 Tokenizer.prototype.next = function next() { 14302 if (!this.isLookahead) { 14303 this.state.tokens.push(new Token(this.state)); 14304 } 14305 14306 this.state.lastTokEnd = this.state.end; 14307 this.state.lastTokStart = this.state.start; 14308 this.state.lastTokEndLoc = this.state.endLoc; 14309 this.state.lastTokStartLoc = this.state.startLoc; 14310 this.nextToken(); 14311 }; 14312 14313 // TODO 14314 14315 Tokenizer.prototype.eat = function eat(type) { 14316 if (this.match(type)) { 14317 this.next(); 14318 return true; 14319 } else { 14320 return false; 14321 } 14322 }; 14323 14324 // TODO 14325 14326 Tokenizer.prototype.match = function match(type) { 14327 return this.state.type === type; 14328 }; 14329 14330 // TODO 14331 14332 Tokenizer.prototype.isKeyword = function isKeyword$$1(word) { 14333 return isKeyword(word); 14334 }; 14335 14336 // TODO 14337 14338 Tokenizer.prototype.lookahead = function lookahead() { 14339 var old = this.state; 14340 this.state = old.clone(true); 14341 14342 this.isLookahead = true; 14343 this.next(); 14344 this.isLookahead = false;
14345 14346 var curr = this.state.clone(true); 14347 this.state = old; 14348 return curr; 14349 }; 14350 14351 // Toggle strict mode. Re-reads the next number or string to please 14352 // pedantic tests (`"use strict"; 010;` should fail). 14353 14354 Tokenizer.prototype.setStrict = function setStrict(strict) { 14355 this.state.strict = strict; 14356 if (!this.match(types.num) && !this.match(types.string)) return; 14357 this.state.pos = this.state.start; 14358 while (this.state.pos < this.state.lineStart) { 14359 this.state.lineStart = this.input.lastIndexOf("\n", this.state.lineStart - 2) + 1; 14360 --this.state.curLine; 14361 } 14362 this.nextToken(); 14363 }; 14364 14365 Tokenizer.prototype.curContext = function curContext() { 14366 return this.state.context[this.state.context.length - 1]; 14367 }; 14368 14369 // Read a single token, updating the parser object's token-related 14370 // properties. 14371 14372 Tokenizer.prototype.nextToken = function nextToken() { 14373 var curContext = this.curContext(); 14374 if (!curContext || !curContext.preserveSpace) this.skipSpace(); 14375 14376 this.state.containsOctal = false; 14377 this.state.octalPosition = null; 14378 this.state.start = this.state.pos; 14379 this.state.startLoc = this.state.curPosition(); 14380 if (this.state.pos >= this.input.length) return this.finishToken(types.eof); 14381 14382 if (curContext.override) { 14383 return curContext.override(this); 14384 } else { 14385 return this.readToken(this.fullCharCodeAtPos()); 14386 } 14387 }; 14388 14389 Tokenizer.prototype.readToken = function readToken(code) { 14390 // Identifier or keyword. '\uXXXX' sequences are allowed in
14391 // identifiers, so '\' also dispatches to that. 14392 if (isIdentifierStart(code) || code === 92 /* '\' */) { 14393 return this.readWord(); 14394 } else { 14395 return this.getTokenFromCode(code); 14396 } 14397 }; 14398 14399 Tokenizer.prototype.fullCharCodeAtPos = function fullCharCodeAtPos() { 14400 var code = this.input.charCodeAt(this.state.pos); 14401 if (code <= 0xd7ff || code >= 0xe000) return code; 14402 14403 var next = this.input.charCodeAt(this.state.pos + 1); 14404 return (code << 10) + next - 0x35fdc00; 14405 }; 14406 14407 Tokenizer.prototype.pushComment = function pushComment(block, text, start, end, startLoc, endLoc) { 14408 var comment = { 14409 type: block ? "CommentBlock" : "CommentLine", 14410 value: text, 14411 start: start, 14412 end: end, 14413 loc: new SourceLocation(startLoc, endLoc) 14414 }; 14415 14416 if (!this.isLookahead) { 14417 this.state.tokens.push(comment); 14418 this.state.comments.push(comment); 14419 this.addComment(comment); 14420 } 14421 }; 14422 14423 Tokenizer.prototype.skipBlockComment = function skipBlockComment() { 14424 var startLoc = this.state.curPosition(); 14425 var start = this.state.pos; 14426 var end = this.input.indexOf("*/", this.state.pos += 2); 14427 if (end === -1) this.raise(this.state.pos - 2, "Unterminated comment"); 14428 14429 this.state.pos = end + 2; 14430 lineBreakG.lastIndex = start; 14431 var match = void 0; 14432 while ((match = lineBreakG.exec(this.input)) && match.index < this.state.pos) { 14433 ++this.state.curLine; 14434 this.state.lineStart = match.index + match[0].length; 14435 } 14436 14437 this.pushComment(true, this.input.slice(start + 2, end), start, this.state.pos, startLoc, this.state.curPosition()); 14438 }; 14439 14440 Tokenizer.prototype.skipLineComment = function skipLineComment(startSkip) { 14441 var start = this.state.pos; 14442 var startLoc = this.state.curPosition(); 14443 var ch = this.input.charCodeAt(this.state.pos += startSkip); 14444 while (this.state.pos < this.input.length && ch !== 10 && ch !== 13 && ch !== 8232 && ch !== 8233) { 14445 ++this.state.pos; 14446 ch = this.input.charCodeAt(this.state.pos); 14447 } 14448 14449 this.pushComment(false, this.input.slice(start + startSkip, this.state.pos), start, this.state.pos, startLoc, this.state.curPosition()); 14450 }; 14451 14452 // Called at the start of the parse and after every token. Skips 14453 // whitespace and comments, and. 14454 14455 Tokenizer.prototype.skipSpace = function skipSpace() { 14456 loop: while (this.state.pos < this.input.length) { 14457 var ch = this.input.charCodeAt(this.state.pos); 14458 switch (ch) { 14459 case 32:case 160: 14460 // ' ' 14461 ++this.state.pos; 14462 break; 14463 14464 case 13: 14465 if (this.input.charCodeAt(this.state.pos + 1) === 10) { 14466 ++this.state.pos; 14467 } 14468 14469 case 10:case 8232:case 8233: 14470 ++this.state.pos; 14471 ++this.state.curLine; 14472 this.state.lineStart = this.state.pos; 14473 break; 14474 14475 case 47: 14476 // '/' 14477 switch (this.input.charCodeAt(this.state.pos + 1)) { 14478 case 42: 14479 // '*' 14480 this.skipBlockComment(); 14481 break; 14482 14483 case 47: 14484 this.skipLineComment(2); 14485 break; 14486 14487 default: 14488 break loop; 14489 } 14490 break; 14491 14492 default: 14493 if (ch > 8 && ch < 14 || ch >= 5760 && nonASCIIwhitespace.test(String.fromCharCode(ch))) { 14494 ++this.state.pos; 14495 } else { 14496 break loop; 14497 } 14498 } 14499 } 14500 }; 14501 14502 // Called at the end of every token. Sets `end`, `val`, and 14503 // maintains `context` and `exprAllowed`, and skips the space after 14504 // the token, so that the next one's `start` will point at the 14505 // right position. 14506 14507 Tokenizer.prototype.finishToken = function finishToken(type, val) { 14508 this.state.end = this.state.pos; 14509 this.state.endLoc = this.state.curPosition(); 14510 var prevType = this.state.type; 14511 this.state.type = type; 14512 this.state.value = val; 14513 14514 this.updateContext(prevType); 14515 }; 14516 14517 // ### Token reading 14518 14519 // This is the function that is called to fetch the next token. It 14520 // is somewhat obscure, because it works in character codes rather 14521 // than characters, and because operator parsing has been inlined 14522 // into it. 14523 // 14524 // All in the name of speed. 14525 // 14526 14527 14528 Tokenizer.prototype.readToken_dot = function readToken_dot() { 14529 var next = this.input.charCodeAt(this.state.pos + 1); 14530 if (next >= 48 && next <= 57) { 14531 return this.readNumber(true); 14532 } 14533 14534 var next2 = this.input.charCodeAt(this.state.pos + 2); 14535 if (next === 46 && next2 === 46) { 14536 // 46 = dot '.' 14537 this.state.pos += 3; 14538 return this.finishToken(types.ellipsis); 14539 } else { 14540 ++this.state.pos; 14541 return this.finishToken(types.dot); 14542 } 14543 }; 14544 14545 Tokenizer.prototype.readToken_slash = function readToken_slash() { 14546 // '/' 14547 if (this.state.exprAllowed) { 14548 ++this.state.pos; 14549 return this.readRegexp(); 14550 } 14551 14552 var next = this.input.charCodeAt(this.state.pos + 1); 14553 if (next === 61) { 14554 return this.finishOp(types.assign, 2); 14555 } else { 14556 return this.finishOp(types.slash, 1); 14557 } 14558 }; 14559 14560 Tokenizer.prototype.readToken_mult_modulo = function readToken_mult_modulo(code) { 14561 // '%*' 14562 var type = code === 42 ? types.star : types.modulo; 14563 var width = 1; 14564 var next = this.input.charCodeAt(this.state.pos + 1); 14565 14566 if (next === 42) { 14567 // '*' 14568 width++; 14569 next = this.input.charCodeAt(this.state.pos + 2); 14570 type = types.exponent; 14571 } 14572 14573 if (next === 61) { 14574 width++; 14575 type = types.assign; 14576 } 14577 14578 return this.finishOp(type, width); 14579 }; 14580 14581 Tokenizer.prototype.readToken_pipe_amp = function readToken_pipe_amp(code) { 14582 // '|&' 14583 var next = this.input.charCodeAt(this.state.pos + 1); 14584 if (next === code) return this.finishOp(code === 124 ? types.logicalOR : types.logicalAND, 2); 14585 if (next === 61) return this.finishOp(types.assign, 2); 14586 if (code === 124 && next === 125 && this.hasPlugin("flow")) return this.finishOp(types.braceBarR, 2); 14587 return this.finishOp(code === 124 ? types.bitwiseOR : types.bitwiseAND, 1); 14588 }; 14589 14590 Tokenizer.prototype.readToken_caret = function readToken_caret() { 14591 // '^' 14592 var next = this.input.charCodeAt(this.state.pos + 1); 14593 if (next === 61) { 14594 return this.finishOp(types.assign, 2); 14595 } else { 14596 return this.finishOp(types.bitwiseXOR, 1); 14597 } 14598 }; 14599 14600 Tokenizer.prototype.readToken_plus_min = function readToken_plus_min(code) { 14601 // '+-' 14602 var next = this.input.charCodeAt(this.state.pos + 1); 14603 14604 if (next === code) { 14605 if (next === 45 && this.input.charCodeAt(this.state.pos + 2) === 62 && lineBreak.test(this.input.slice(this.state.lastTokEnd, this.state.pos))) { 14606 // A `-->` line comment 14607 this.skipLineComment(3); 14608 this.skipSpace(); 14609 return this.nextToken(); 14610 } 14611 return this.finishOp(types.incDec, 2); 14612 } 14613 14614 if (next === 61) { 14615 return this.finishOp(types.assign, 2); 14616 } else { 14617 return this.finishOp(types.plusMin, 1); 14618 } 14619 }; 14620 14621 Tokenizer.prototype.readToken_lt_gt = function readToken_lt_gt(code) { 14622 // '<>' 14623 var next = this.input.charCodeAt(this.state.pos + 1); 14624 var size = 1; 14625 14626 if (next === code) { 14627 size = code === 62 && this.input.charCodeAt(this.state.pos + 2) === 62 ? 3 : 2; 14628 if (this.input.charCodeAt(this.state.pos + size) === 61) return this.finishOp(types.assign, size + 1); 14629 return this.finishOp(types.bitShift, size); 14630 } 14631 14632 if (next === 33 && code === 60 && this.input.charCodeAt(this.state.pos + 2) === 45 && this.input.charCodeAt(this.state.pos + 3) === 45) { 14633 if (this.inModule) this.unexpected(); 14634 // `<!--`, an XML-style comment that should be interpreted as a line comment 14635 this.skipLineComment(4); 14636 this.skipSpace(); 14637 return this.nextToken(); 14638 } 14639 14640 if (next === 61) { 14641 // <= | >= 14642 size = 2; 14643 } 14644 14645 return this.finishOp(types.relational, size); 14646 }; 14647 14648 Tokenizer.prototype.readToken_eq_excl = function readToken_eq_excl(code) { 14649 // '=!' 14650 var next = this.input.charCodeAt(this.state.pos + 1); 14651 if (next === 61) return this.finishOp(types.equality, this.input.charCodeAt(this.state.pos + 2) === 61 ? 3 : 2); 14652 if (code === 61 && next === 62) { 14653 // '=>' 14654 this.state.pos += 2; 14655 return this.finishToken(types.arrow); 14656 } 14657 return this.finishOp(code === 61 ? types.eq : types.prefix, 1); 14658 }; 14659 14660 Tokenizer.prototype.getTokenFromCode = function getTokenFromCode(code) { 14661 switch (code) { 14662 // The interpretation of a dot depends on whether it is followed 14663 // by a digit or another two dots. 14664 case 46: 14665 // '.' 14666 return this.readToken_dot(); 14667 14668 // Punctuation tokens. 14669 case 40: 14670 ++this.state.pos;return this.finishToken(types.parenL); 14671 case 41: 14672 ++this.state.pos;return this.finishToken(types.parenR); 14673 case 59: 14674 ++this.state.pos;return this.finishToken(types.semi); 14675 case 44: 14676 ++this.state.pos;return this.finishToken(types.comma); 14677 case 91: 14678 ++this.state.pos;return this.finishToken(types.bracketL); 14679 case 93: 14680 ++this.state.pos;return this.finishToken(types.bracketR); 14681 14682 case 123: 14683 if (this.hasPlugin("flow") && this.input.charCodeAt(this.state.pos + 1) === 124) { 14684 return this.finishOp(types.braceBarL, 2); 14685 } else { 14686 ++this.state.pos; 14687 return this.finishToken(types.braceL); 14688 } 14689 14690 case 125: 14691 ++this.state.pos;return this.finishToken(types.braceR); 14692 14693 case 58: 14694 if (this.hasPlugin("functionBind") && this.input.charCodeAt(this.state.pos + 1) === 58) { 14695 return this.finishOp(types.doubleColon, 2); 14696 } else { 14697 ++this.state.pos; 14698 return this.finishToken(types.colon); 14699 } 14700 14701 case 63: 14702 ++this.state.pos;return this.finishToken(types.question); 14703 case 64: 14704 ++this.state.pos;return this.finishToken(types.at); 14705 14706 case 96: 14707 // '`' 14708 ++this.state.pos; 14709 return this.finishToken(types.backQuote); 14710 14711 case 48: 14712 // '0' 14713 var next = this.input.charCodeAt(this.state.pos + 1); 14714 if (next === 120 || next === 88) return this.readRadixNumber(16); // '0x', '0X' - hex number 14715 if (next === 111 || next === 79) return this.readRadixNumber(8); // '0o', '0O' - octal number 14716 if (next === 98 || next === 66) return this.readRadixNumber(2); // '0b', '0B' - binary number 14717 // Anything else beginning with a digit is an integer, octal 14718 // number, or float. 14719 case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57: 14720 // 1-9 14721 return this.readNumber(false); 14722 14723 // Quotes produce strings. 14724 case 34:case 39: 14725 // '"', "'" 14726 return this.readString(code); 14727 14728 // Operators are parsed inline in tiny state machines. '=' (61) is 14729 // often referred to. `finishOp` simply skips the amount of 14730 // characters it is given as second argument, and returns a token 14731 // of the type given by its first argument. 14732 14733 case 47: 14734 // '/' 14735 return this.readToken_slash(); 14736 14737 case 37:case 42: 14738 // '%*' 14739 return this.readToken_mult_modulo(code); 14740 14741 case 124:case 38: 14742 // '|&' 14743 return this.readToken_pipe_amp(code); 14744 14745 case 94: 14746 // '^' 14747 return this.readToken_caret(); 14748 14749 case 43:case 45: 14750 // '+-' 14751 return this.readToken_plus_min(code); 14752
14753 case 60:case 62: 14754 // '<>' 14755 return this.readToken_lt_gt(code); 14756 14757 case 61:case 33: 14758 // '=!' 14759 return this.readToken_eq_excl(code); 14760 14761 case 126: 14762 // '~' 14763 return this.finishOp(types.prefix, 1); 14764 } 14765 14766 this.raise(this.state.pos, "Unexpected character '" + codePointToString(code) + "'"); 14767 }; 14768 14769 Tokenizer.prototype.finishOp = function finishOp(type, size) { 14770 var str = this.input.slice(this.state.pos, this.state.pos + size); 14771 this.state.pos += size; 14772 return this.finishToken(type, str); 14773 }; 14774 14775 Tokenizer.prototype.readRegexp = function readRegexp() { 14776 var start = this.state.pos; 14777 var escaped = void 0, 14778 inClass = void 0; 14779 for (;;) { 14780 if (this.state.pos >= this.input.length) this.raise(start, "Unterminated regular expression"); 14781 var ch = this.input.charAt(this.state.pos); 14782 if (lineBreak.test(ch)) { 14783 this.raise(start, "Unterminated regular expression"); 14784 } 14785 if (escaped) { 14786 escaped = false; 14787 } else { 14788 if (ch === "[") { 14789 inClass = true; 14790 } else if (ch === "]" && inClass) { 14791 inClass = false; 14792 } else if (ch === "/" && !inClass) { 14793 break; 14794 } 14795 escaped = ch === "\\"; 14796 } 14797 ++this.state.pos; 14798 } 14799 var content = this.input.slice(start, this.state.pos); 14800 ++this.state.pos; 14801 // Need to use `readWord1` because '\uXXXX' sequences are allowed 14802 // here (don't ask). 14803 var mods = this.readWord1(); 14804 if (mods) { 14805 var validFlags = /^[gmsiyu]*$/; 14806 if (!validFlags.test(mods)) this.raise(start, "Invalid regular expression flag"); 14807 } 14808 return this.finishToken(types.regexp, { 14809 pattern: content, 14810 flags: mods 14811 }); 14812 }; 14813 14814 // Read an integer in the given radix. Return null if zero digits 14815 // were read, the integer value otherwise. When `len` is given, this 14816 // will return `null` unless the integer has exactly `len` digits. 14817 14818 Tokenizer.prototype.readInt = function readInt(radix, len) { 14819 var start = this.state.pos; 14820 var total = 0; 14821 14822 for (var i = 0, e = len == null ? Infinity : len; i < e; ++i) { 14823 var code = this.input.charCodeAt(this.state.pos); 14824 var val = void 0; 14825 if (code >= 97) { 14826 val = code - 97 + 10; // a 14827 } else if (code >= 65) { 14828 val = code - 65 + 10; // A 14829 } else if (code >= 48 && code <= 57) { 14830 val = code - 48; // 0-9 14831 } else { 14832 val = Infinity; 14833 } 14834 if (val >= radix) break; 14835 ++this.state.pos; 14836 total = total * radix + val; 14837 } 14838 if (this.state.pos === start || len != null && this.state.pos - start !== len) return null; 14839 14840 return total; 14841 }; 14842 14843 Tokenizer.prototype.readRadixNumber = function readRadixNumber(radix) { 14844 this.state.pos += 2; // 0x 14845 var val = this.readInt(radix); 14846 if (val == null) this.raise(this.state.start + 2, "Expected number in radix " + radix); 14847 if (isIdentifierStart(this.fullCharCodeAtPos())) this.raise(this.state.pos, "Identifier directly after number"); 14848 return this.finishToken(types.num, val); 14849 }; 14850 14851 // Read an integer, octal integer, or floating-point number. 14852 14853 Tokenizer.prototype.readNumber = function readNumber(startsWithDot) { 14854 var start = this.state.pos; 14855 var octal = this.input.charCodeAt(this.state.pos) === 48; 14856 var isFloat = false; 14857 14858 if (!startsWithDot && this.readInt(10) === null) this.raise(start, "Invalid number"); 14859 var next = this.input.charCodeAt(this.state.pos); 14860 if (next === 46) { 14861 // '.' 14862 ++this.state.pos; 14863 this.readInt(10); 14864 isFloat = true; 14865 next = this.input.charCodeAt(this.state.pos); 14866 } 14867 if (next === 69 || next === 101) { 14868 // 'eE' 14869 next = this.input.charCodeAt(++this.state.pos); 14870 if (next === 43 || next === 45) ++this.state.pos; // '+-' 14871 if (this.readInt(10) === null) this.raise(start, "Invalid number"); 14872 isFloat = true; 14873 } 14874 if (isIdentifierStart(this.fullCharCodeAtPos())) this.raise(this.state.pos, "Identifier directly after number"); 14875 14876 var str = this.input.slice(start, this.state.pos); 14877 var val = void 0; 14878 if (isFloat) { 14879 val = parseFloat(str); 14880 } else if (!octal || str.length === 1) { 14881 val = parseInt(str, 10); 14882 } else if (/[89]/.test(str) || this.state.strict) { 14883 this.raise(start, "Invalid number"); 14884 } else { 14885 val = parseInt(str, 8); 14886 } 14887 return this.finishToken(types.num, val); 14888 }; 14889 14890 // Read a string value, interpreting backslash-escapes. 14891 14892 Tokenizer.prototype.readCodePoint = function readCodePoint() { 14893 var ch = this.input.charCodeAt(this.state.pos); 14894 var code = void 0; 14895 14896 if (ch === 123) { 14897 var codePos = ++this.state.pos; 14898 code = this.readHexChar(this.input.indexOf("}", this.state.pos) - this.state.pos); 14899 ++this.state.pos; 14900 if (code > 0x10FFFF) this.raise(codePos, "Code point out of bounds"); 14901 } else { 14902 code = this.readHexChar(4); 14903 } 14904 return code; 14905 }; 14906 14907 Tokenizer.prototype.readString = function readString(quote) { 14908 var out = "", 14909 chunkStart = ++this.state.pos; 14910 for (;;) { 14911 if (this.state.pos >= this.input.length) this.raise(this.state.start, "Unterminated string constant"); 14912 var ch = this.input.charCodeAt(this.state.pos); 14913 if (ch === quote) break; 14914 if (ch === 92) { 14915 // '\' 14916 out += this.input.slice(chunkStart, this.state.pos); 14917 out += this.readEscapedChar(false); 14918 chunkStart = this.state.pos; 14919 } else { 14920 if (isNewLine(ch)) this.raise(this.state.start, "Unterminated string constant"); 14921 ++this.state.pos; 14922 } 14923 } 14924 out += this.input.slice(chunkStart, this.state.pos++); 14925 return this.finishToken(types.string, out); 14926 }; 14927 14928 // Reads template string tokens. 14929 14930 Tokenizer.prototype.readTmplToken = function readTmplToken() { 14931 var out = "", 14932 chunkStart = this.state.pos; 14933 for (;;) { 14934 if (this.state.pos >= this.input.length) this.raise(this.state.start, "Unterminated template"); 14935 var ch = this.input.charCodeAt(this.state.pos); 14936 if (ch === 96 || ch === 36 && this.input.charCodeAt(this.state.pos + 1) === 123) { 14937 // '`', '${' 14938 if (this.state.pos === this.state.start && this.match(types.template)) { 14939 if (ch === 36) { 14940 this.state.pos += 2; 14941 return this.finishToken(types.dollarBraceL); 14942 } else { 14943 ++this.state.pos; 14944 return this.finishToken(types.backQuote); 14945 } 14946 } 14947 out += this.input.slice(chunkStart, this.state.pos); 14948 return this.finishToken(types.template, out); 14949 } 14950 if (ch === 92) { 14951 // '\' 14952 out += this.input.slice(chunkStart, this.state.pos); 14953 out += this.readEscapedChar(true); 14954 chunkStart = this.state.pos; 14955 } else if (isNewLine(ch)) { 14956 out += this.input.slice(chunkStart, this.state.pos); 14957 ++this.state.pos; 14958 switch (ch) { 14959 case 13: 14960 if (this.input.charCodeAt(this.state.pos) === 10) ++this.state.pos; 14961 case 10: 14962 out += "\n"; 14963 break; 14964 default: 14965 out += String.fromCharCode(ch); 14966 break; 14967 } 14968 ++this.state.curLine; 14969 this.state.lineStart = this.state.pos; 14970 chunkStart = this.state.pos; 14971 } else { 14972 ++this.state.pos; 14973 } 14974 } 14975 }; 14976 14977 // Used to read escaped characters 14978 14979 Tokenizer.prototype.readEscapedChar = function readEscapedChar(inTemplate) { 14980 var ch = this.input.charCodeAt(++this.state.pos); 14981 ++this.state.pos; 14982 switch (ch) { 14983 case 110: 14984 return "\n"; // 'n' -> '\n' 14985 case 114: 14986 return "\r"; // 'r' -> '\r' 14987 case 120: 14988 return String.fromCharCode(this.readHexChar(2)); // 'x' 14989 case 117: 14990 return codePointToString(this.readCodePoint()); // 'u' 14991 case 116: 14992 return "\t"; // 't' -> '\t' 14993 case 98: 14994 return "\b"; // 'b' -> '\b' 14995 case 118: 14996 return "\x0B"; // 'v' -> '\u000b' 14997 case 102: 14998 return "\f"; // 'f' -> '\f' 14999 case 13: 15000 if (this.input.charCodeAt(this.state.pos) === 10) ++this.state.pos; // '\r\n' 15001 case 10: 15002 // ' \n' 15003 this.state.lineStart = this.state.pos; 15004 ++this.state.curLine; 15005 return ""; 15006 default: 15007 if (ch >= 48 && ch <= 55) { 15008 var octalStr = this.input.substr(this.state.pos - 1, 3).match(/^[0-7]+/)[0]; 15009 var octal = parseInt(octalStr, 8); 15010 if (octal > 255) { 15011 octalStr = octalStr.slice(0, -1); 15012 octal = parseInt(octalStr, 8); 15013 } 15014 if (octal > 0) { 15015 if (!this.state.containsOctal) { 15016 this.state.containsOctal = true; 15017 this.state.octalPosition = this.state.pos - 2; 15018 } 15019 if (this.state.strict || inTemplate) { 15020 this.raise(this.state.pos - 2, "Octal literal in strict mode"); 15021 } 15022 } 15023 this.state.pos += octalStr.length - 1; 15024 return String.fromCharCode(octal); 15025 } 15026 return String.fromCharCode(ch); 15027 } 15028 }; 15029 15030 // Used to read character escape sequences ('\x', '\u', '\U'). 15031 15032 Tokenizer.prototype.readHexChar = function readHexChar(len) { 15033 var codePos = this.state.pos; 15034 var n = this.readInt(16, len); 15035 if (n === null) this.raise(codePos, "Bad character escape sequence"); 15036 return n; 15037 }; 15038 15039 // Read an identifier, and return it as a string. Sets `this.state.containsEsc` 15040 // to whether the word contained a '\u' escape. 15041 // 15042 // Incrementally adds only escaped chars, adding other chunks as-is 15043 // as a micro-optimization. 15044 15045 Tokenizer.prototype.readWord1 = function readWord1() { 15046 this.state.containsEsc = false;
15047 var word = "", 15048 first = true, 15049 chunkStart = this.state.pos; 15050 while (this.state.pos < this.input.length) { 15051 var ch = this.fullCharCodeAtPos(); 15052 if (isIdentifierChar(ch)) { 15053 this.state.pos += ch <= 0xffff ? 1 : 2; 15054 } else if (ch === 92) { 15055 // "\" 15056 this.state.containsEsc = true; 15057 15058 word += this.input.slice(chunkStart, this.state.pos); 15059 var escStart = this.state.pos; 15060 15061 if (this.input.charCodeAt(++this.state.pos) !== 117) { 15062 // "u" 15063 this.raise(this.state.pos, 'Expecting Unicode escape sequence \\uXXXX'); 15064 } 15065 15066 ++this.state.pos; 15067 var esc = this.readCodePoint(); 15068 if (!(first ? isIdentifierStart : isIdentifierChar)(esc, true)) { 15069 this.raise(escStart, "Invalid Unicode escape"); 15070 } 15071 15072 word += codePointToString(esc); 15073 chunkStart = this.state.pos; 15074 } else { 15075 break; 15076 } 15077 first = false; 15078 } 15079 return word + this.input.slice(chunkStart, this.state.pos); 15080 }; 15081 15082 // Read an identifier or keyword token. Will check for reserved 15083 // words when necessary. 15084 15085 Tokenizer.prototype.readWord = function readWord() { 15086 var word = this.readWord1(); 15087 var type = types.name; 15088 if (!this.state.containsEsc && this.isKeyword(word)) { 15089 type = keywords[word]; 15090 } 15091 return this.finishToken(type, word); 15092 }; 15093 15094 Tokenizer.prototype.braceIsBlock = function braceIsBlock(prevType) { 15095 if (prevType === types.colon) { 15096 var parent = this.curContext(); 15097 if (parent === types$1.braceStatement || parent === types$1.braceExpression) { 15098 return !parent.isExpr; 15099 } 15100 } 15101 15102 if (prevType === types._return) { 15103 return lineBreak.test(this.input.slice(this.state.lastTokEnd, this.state.start)); 15104 } 15105 15106 if (prevType === types._else || prevType === types.semi || prevType === types.eof || prevType === types.parenR) { 15107 return true; 15108 } 15109 15110 if (prevType === types.braceL) { 15111 return this.curContext() === types$1.braceStatement; 15112 } 15113 15114 return !this.state.exprAllowed; 15115 }; 15116 15117 Tokenizer.prototype.updateContext = function updateContext(prevType) { 15118 var type = this.state.type; 15119 var update = void 0; 15120 15121 if (type.keyword && prevType === types.dot) { 15122 this.state.exprAllowed = false; 15123 } else if (update = type.updateContext) { 15124 update.call(this, prevType); 15125 } else { 15126 this.state.exprAllowed = type.beforeExpr; 15127 } 15128 }; 15129 15130 return Tokenizer; 15131 }(); 15132 15133 var plugins = {}; 15134 var frozenDeprecatedWildcardPluginList = ["jsx", "doExpressions", "objectRestSpread", "decorators", "classProperties", "exportExtensions", "asyncGenerators", "functionBind", "functionSent", "dynamicImport", "flow"]; 15135 15136 var Parser = function (_Tokenizer) { 15137 inherits(Parser, _Tokenizer); 15138 15139 function Parser(options, input) { 15140 classCallCheck(this, Parser); 15141 15142 options = getOptions(options); 15143 15144 var _this = possibleConstructorReturn(this, _Tokenizer.call(this, options, input)); 15145 15146 _this.options = options; 15147 _this.inModule = _this.options.sourceType === "module"; 15148 _this.input = input; 15149 _this.plugins = _this.loadPlugins(_this.options.plugins); 15150 _this.filename = options.sourceFilename; 15151 15152 // If enabled, skip leading hashbang line. 15153 if (_this.state.pos === 0 && _this.input[0] === "#" && _this.input[1] === "!") { 15154 _this.skipLineComment(2); 15155 } 15156 return _this; 15157 } 15158 15159 Parser.prototype.isReservedWord = function isReservedWord(word) { 15160 if (word === "await") { 15161 return this.inModule; 15162 } else { 15163 return reservedWords[6](word); 15164 } 15165 }; 15166 15167 Parser.prototype.hasPlugin = function hasPlugin(name) { 15168 if (this.plugins["*"] && frozenDeprecatedWildcardPluginList.indexOf(name) > -1) { 15169 return true; 15170 } 15171 15172 return !!this.plugins[name]; 15173 }; 15174 15175 Parser.prototype.extend = function extend(name, f) { 15176 this[name] = f(this[name]); 15177 }; 15178 15179 Parser.prototype.loadAllPlugins = function loadAllPlugins() { 15180 var _this2 = this; 15181 15182 // ensure flow plugin loads last, also ensure estree is not loaded with * 15183 var pluginNames = Object.keys(plugins).filter(function (name) { 15184 return name !== "flow" && name !== "estree"; 15185 }); 15186 pluginNames.push("flow"); 15187
15188 pluginNames.forEach(function (name) { 15189 var plugin = plugins[name]; 15190 if (plugin) plugin(_this2); 15191 }); 15192 }; 15193 15194 Parser.prototype.loadPlugins = function loadPlugins(pluginList) { 15195 // TODO: Deprecate "*" option in next major version of Babylon 15196 if (pluginList.indexOf("*") >= 0) { 15197 this.loadAllPlugins(); 15198 15199 return { "*": true }; 15200 } 15201 15202 var pluginMap = {}; 15203 15204 if (pluginList.indexOf("flow") >= 0) { 15205 // ensure flow plugin loads last 15206 pluginList = pluginList.filter(function (plugin) { 15207 return plugin !== "flow"; 15208 }); 15209 pluginList.push("flow"); 15210 } 15211 15212 if (pluginList.indexOf("estree") >= 0) { 15213 // ensure estree plugin loads first 15214 pluginList = pluginList.filter(function (plugin) { 15215 return plugin !== "estree"; 15216 }); 15217 pluginList.unshift("estree"); 15218 } 15219 15220 for (var _iterator = pluginList, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { 15221 var _ref; 15222 15223 if (_isArray) { 15224 if (_i >= _iterator.length) break; 15225 _ref = _iterator[_i++]; 15226 } else { 15227 _i = _iterator.next(); 15228 if (_i.done) break; 15229 _ref = _i.value; 15230 } 15231 15232 var name = _ref; 15233 15234 if (!pluginMap[name]) { 15235 pluginMap[name] = true; 15236 15237 var plugin = plugins[name]; 15238 if (plugin) plugin(this); 15239 } 15240 } 15241 15242 return pluginMap; 15243 }; 15244 15245 Parser.prototype.parse = function parse() { 15246 var file = this.startNode(); 15247 var program = this.startNode(); 15248 this.nextToken(); 15249 return this.parseTopLevel(file, program); 15250 }; 15251 15252 return Parser; 15253 }(Tokenizer); 15254 15255 var pp = Parser.prototype; 15256 15257 // ## Parser utilities 15258 15259 // TODO 15260 15261 pp.addExtra = function (node, key, val) { 15262 if (!node) return; 15263 15264 var extra = node.extra = node.extra || {}; 15265 extra[key] = val; 15266 }; 15267 15268 // TODO 15269 15270 pp.isRelational = function (op) { 15271 return this.match(types.relational) && this.state.value === op; 15272 }; 15273 15274 // TODO 15275 15276 pp.expectRelational = function (op) { 15277 if (this.isRelational(op)) { 15278 this.next(); 15279 } else { 15280 this.unexpected(null, types.relational); 15281 } 15282 }; 15283 15284 // Tests whether parsed token is a contextual keyword. 15285 15286 pp.isContextual = function (name) { 15287 return this.match(types.name) && this.state.value === name; 15288 }; 15289 15290 // Consumes contextual keyword if possible. 15291 15292 pp.eatContextual = function (name) { 15293 return this.state.value === name && this.eat(types.name); 15294 }; 15295 15296 // Asserts that following token is given contextual keyword. 15297 15298 pp.expectContextual = function (name, message) { 15299 if (!this.eatContextual(name)) this.unexpected(null, message); 15300 }; 15301 15302 // Test whether a semicolon can be inserted at the current position. 15303 15304 pp.canInsertSemicolon = function () { 15305 return this.match(types.eof) || this.match(types.braceR) || lineBreak.test(this.input.slice(this.state.lastTokEnd, this.state.start)); 15306 }; 15307 15308 // TODO 15309 15310 pp.isLineTerminator = function () { 15311 return this.eat(types.semi) || this.canInsertSemicolon(); 15312 }; 15313 15314 // Consume a semicolon, or, failing that, see if we are allowed to 15315 // pretend that there is a semicolon at this position. 15316 15317 pp.semicolon = function () { 15318 if (!this.isLineTerminator()) this.unexpected(null, types.semi); 15319 }; 15320 15321 // Expect a token of a given type. If found, consume it, otherwise, 15322 // raise an unexpected token error at given pos. 15323 15324 pp.expect = function (type, pos) { 15325 return this.eat(type) || this.unexpected(pos, type); 15326 }; 15327 15328 // Raise an unexpected token error. Can take the expected token type 15329 // instead of a message string. 15330 15331 pp.unexpected = function (pos) { 15332 var messageOrType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "Unexpected token"; 15333 15334 if (messageOrType && (typeof messageOrType === "undefined" ? "undefined" : _typeof(messageOrType)) === "object" && messageOrType.label) { 15335 messageOrType = "Unexpected token, expected " + messageOrType.label; 15336 } 15337 this.raise(pos != null ? pos : this.state.start, messageOrType); 15338 }; 15339 15340 /* eslint max-len: 0 */ 15341 15342 var pp$1 = Parser.prototype; 15343 15344 // ### Statement parsing 15345 15346 // Parse a program. Initializes the parser, reads any number of 15347 // statements, and wraps them in a Program node. Optionally takes a 15348 // `program` argument. If present, the statements will be appended 15349 // to its body instead of creating a new node. 15350 15351 pp$1.parseTopLevel = function (file, program) { 15352 program.sourceType = this.options.sourceType; 15353 15354 this.parseBlockBody(program, true, true, types.eof); 15355 15356 file.program = this.finishNode(program, "Program"); 15357 file.comments = this.state.comments; 15358 file.tokens = this.state.tokens; 15359 15360 return this.finishNode(file, "File"); 15361 }; 15362 15363 var loopLabel = { kind: "loop" }; 15364 var switchLabel = { kind: "switch" }; 15365 15366 // TODO 15367 15368 pp$1.stmtToDirective = function (stmt) { 15369 var expr = stmt.expression; 15370 15371 var directiveLiteral = this.startNodeAt(expr.start, expr.loc.start); 15372 var directive = this.startNodeAt(stmt.start, stmt.loc.start); 15373 15374 var raw = this.input.slice(expr.start, expr.end); 15375 var val = directiveLiteral.value = raw.slice(1, -1); // remove quotes 15376 15377 this.addExtra(directiveLiteral, "raw", raw); 15378 this.addExtra(directiveLiteral, "rawValue", val); 15379 15380 directive.value = this.finishNodeAt(directiveLiteral, "DirectiveLiteral", expr.end, expr.loc.end); 15381 15382 return this.finishNodeAt(directive, "Directive", stmt.end, stmt.loc.end); 15383 }; 15384 15385 // Parse a single statement. 15386 // 15387 // If expecting a statement and finding a slash operator, parse a 15388 // regular expression literal. This is to handle cases like 15389 // `if (foo) /blah/.exec(foo)`, where looking at the previous token 15390 // does not help.
15391 15392 pp$1.parseStatement = function (declaration, topLevel) { 15393 if (this.match(types.at)) { 15394 this.parseDecorators(true); 15395 } 15396 15397 var starttype = this.state.type; 15398 var node = this.startNode(); 15399 15400 // Most types of statements are recognized by the keyword they 15401 // start with. Many are trivial to parse, some require a bit of 15402 // complexity. 15403 15404 switch (starttype) { 15405 case types._break:case types._continue: 15406 return this.parseBreakContinueStatement(node, starttype.keyword); 15407 case types._debugger: 15408 return this.parseDebuggerStatement(node); 15409 case types._do: 15410 return this.parseDoStatement(node); 15411 case types._for: 15412 return this.parseForStatement(node); 15413 case types._function: 15414 if (!declaration) this.unexpected(); 15415 return this.parseFunctionStatement(node); 15416 15417 case types._class: 15418 if (!declaration) this.unexpected(); 15419 return this.parseClass(node, true); 15420 15421 case types._if: 15422 return this.parseIfStatement(node); 15423 case types._return: 15424 return this.parseReturnStatement
15424(node); 15425 case types._switch: 15426 return this.parseSwitchStatement(node); 15427 case types._throw: 15428 return this.parseThrowStatement(node); 15429 case types._try: 15430 return this.parseTryStatement(node); 15431 15432 case types._let: 15433 case types._const: 15434 if (!declaration) this.unexpected(); // NOTE: falls through to _var 15435 15436 case types._var: 15437 return this.parseVarStatement(node, starttype); 15438 15439 case types._while: 15440 return this.parseWhileStatement(node); 15441 case types._with: 15442 return this.parseWithStatement(node); 15443 case types.braceL: 15444 return this.parseBlock(); 15445 case types.semi: 15446 return this.parseEmptyStatement(node); 15447 case types._export: 15448 case types._import: 15449 if (this.hasPlugin("dynamicImport") && this.lookahead().type === types.parenL) break; 15450 15451 if (!this.options.allowImportExportEverywhere) { 15452 if (!topLevel) { 15453 this.raise(this.state.start, "'import' and 'export' may only appear at the top level"); 15454 } 15455 15456 if (!this.inModule) { 15457 this.raise(this.state.start, "'import' and 'export' may appear only with 'sourceType: module'"); 15458 } 15459 } 15460 return starttype === types._import ? this.parseImport(node) : this.parseExport(node); 15461 15462 case types.name: 15463 if (this.state.value === "async") { 15464 // peek ahead and see if next token is a function 15465 var state = this.state.clone(); 15466 this.next(); 15467 if (this.match(types._function) && !this.canInsertSemicolon()) { 15468 this.expect(types._function); 15469 return this.parseFunction(node, true, false, true); 15470 } else { 15471 this.state = state; 15472 } 15473 } 15474 } 15475 15476 // If the statement does not start with a statement keyword or a 15477 // brace, it's an ExpressionStatement or LabeledStatement. We 15478 // simply start parsing an expression, and afterwards, if the 15479 // next token is a colon and the expression was a simple 15480 // Identifier node, we switch to interpreting it as a label. 15481 var maybeName = this.state.value; 15482 var expr = this.parseExpression(); 15483 15484 if (starttype === types.name && expr.type === "Identifier" && this.eat(types.colon)) { 15485 return this.parseLabeledStatement(node, maybeName, expr); 15486 } else { 15487 return this.parseExpressionStatement(node, expr); 15488 } 15489 }; 15490 15491 pp$1.takeDecorators = function (node) { 15492 if (this.state.decorators.length) { 15493 node.decorators = this.state.decorators; 15494 this.state.decorators = []; 15495 } 15496 }; 15497 15498 pp$1.parseDecorators = function (allowExport) { 15499 while (this.match(types.at)) { 15500 var decorator = this.parseDecorator(); 15501 this.state.decorators.push(decorator); 15502 } 15503 15504 if (allowExport && this.match(types._export)) { 15505 return; 15506 } 15507 15508 if (!this.match(types._class)) { 15509 this.raise(this.state.start, "Leading decorators must be attached to a class declaration"); 15510 } 15511 }; 15512 15513 pp$1.parseDecorator = function () { 15514 if (!this.hasPlugin("decorators")) { 15515 this.unexpected(); 15516 } 15517 var node = this.startNode(); 15518 this.next(); 15519 node.expression = this.parseMaybeAssign(); 15520 return this.finishNode(node, "Decorator"); 15521 }; 15522 15523 pp$1.parseBreakContinueStatement = function (node, keyword) { 15524 var isBreak = keyword === "break"; 15525 this.next(); 15526 15527 if (this.isLineTerminator()) { 15528 node.label = null; 15529 } else if (!this.match(types.name)) { 15530 this.unexpected(); 15531 } else { 15532 node.label = this.parseIdentifier(); 15533 this.semicolon(); 15534 } 15535 15536 // Verify that there is an actual destination to break or 15537 // continue to. 15538 var i = void 0; 15539 for (i = 0; i < this.state.labels.length; ++i) { 15540 var lab = this.state.labels[i]; 15541 if (node.label == null || lab.name === node.label.name) { 15542 if (lab.kind != null && (isBreak || lab.kind === "loop")) break; 15543 if (node.label && isBreak) break; 15544 } 15545 } 15546 if (i === this.state.labels.length) this.raise(node.start, "Unsyntactic " + keyword); 15547 return this.finishNode(node, isBreak ? "BreakStatement" : "ContinueStatement"); 15548 }; 15549 15550 pp$1.parseDebuggerStatement = function (node) { 15551 this.next(); 15552 this.semicolon(); 15553 return this.finishNode(node, "DebuggerStatement"); 15554 }; 15555 15556 pp$1.parseDoStatement = function (node) { 15557 this.next(); 15558 this.state.labels.push(loopLabel);
15559 node.body = this.parseStatement(false); 15560 this.state.labels.pop(); 15561 this.expect(types._while); 15562 node.test = this.parseParenExpression(); 15563 this.eat(types.semi); 15564 return this.finishNode(node, "DoWhileStatement"); 15565 }; 15566 15567 // Disambiguating between a `for` and a `for`/`in` or `for`/`of` 15568 // loop is non-trivial. Basically, we have to parse the init `var` 15569 // statement or expression, disallowing the `in` operator (see 15570 // the second parameter to `parseExpression`), and then check 15571 // whether the next token is `in` or `of`. When there is no init 15572 // part (semicolon immediately after the opening parenthesis), it 15573 // is a regular `for` loop. 15574 15575 pp$1.parseForStatement = function (node) { 15576 this.next(); 15577 this.state.labels.push(loopLabel); 15578 15579 var forAwait = false; 15580 if (this.hasPlugin("asyncGenerators") && this.state.inAsync && this.isContextual("await")) { 15581 forAwait = true; 15582 this.next(); 15583 } 15584 this.expect(types.parenL); 15585 15586 if (this.match(types.semi)) { 15587 if (forAwait) { 15588 this.unexpected(); 15589 } 15590 return this.parseFor(node, null); 15591 } 15592 15593 if (this.match(types._var) || this.match(types._let) || this.match(types._const)) { 15594 var _init = this.startNode(); 15595 var varKind = this.state.type; 15596 this.next(); 15597 this.parseVar(_init, true, varKind); 15598 this.finishNode(_init, "VariableDeclaration"); 15599 15600 if (this.match(types._in) || this.isContextual("of")) { 15601 if (_init.declarations.length === 1 && !_init.declarations[0].init) { 15602 return this.parseForIn(node, _init, forAwait); 15603 } 15604 } 15605 if (forAwait) { 15606 this.unexpected(); 15607 } 15608 return this.parseFor(node, _init); 15609 } 15610 15611 var refShorthandDefaultPos = { start: 0 }; 15612 var init = this.parseExpression(true, refShorthandDefaultPos); 15613 if (this.match(types._in) || this.isContextual("of")) { 15614 var description = this.isContextual("of") ? "for-of statement" : "for-in statement"; 15615 this.toAssignable(init, undefined, description); 15616 this.checkLVal(init, undefined, undefined, description); 15617 return this.parseForIn(node, init, forAwait); 15618 } else if (refShorthandDefaultPos.start) { 15619 this.unexpected(refShorthandDefaultPos.start); 15620 } 15621 if (forAwait) { 15622 this.unexpected(); 15623 } 15624 return this.parseFor(node, init); 15625 }; 15626 15627 pp$1.parseFunctionStatement = function (node) { 15628 this.next(); 15629 return this.parseFunction(node, true); 15630 }; 15631 15632 pp$1.parseIfStatement = function (node) { 15633 this.next(); 15634 node.test = this.parseParenExpression(); 15635 node.consequent = this.parseStatement(false); 15636 node.alternate = this.eat(types._else) ? this.parseStatement(false) : null; 15637 return this.finishNode(node, "IfStatement"); 15638 }; 15639 15640 pp$1.parseReturnStatement = function (node) { 15641 if (!this.state.inFunction && !this.options.allowReturnOutsideFunction) { 15642 this.raise(this.state.start, "'return' outside of function"); 15643 } 15644 15645 this.next(); 15646 15647 // In `return` (and `break`/`continue`), the keywords with 15648 // optional arguments, we eagerly look for a semicolon or the 15649 // possibility to insert one. 15650 15651 if (this.isLineTerminator()) { 15652 node.argument = null; 15653 } else { 15654 node.argument = this.parseExpression(); 15655 this.semicolon(); 15656 } 15657 15658 return this.finishNode(node, "ReturnStatement"); 15659 }; 15660 15661 pp$1.parseSwitchStatement = function (node) { 15662 this.next(); 15663 node.discriminant = this.parseParenExpression(); 15664 node.cases = []; 15665 this.expect(types.braceL); 15666 this.state.labels.push(switchLabel); 15667 15668 // Statements under must be grouped (by label) in SwitchCase 15669 // nodes. `cur` is used to keep the node that we are currently 15670 // adding statements to. 15671 15672 var cur = void 0; 15673 for (var sawDefault; !this.match(types.braceR);) { 15674 if (this.match(types._case) || this.match(types._default)) { 15675 var isCase = this.match(types._case); 15676 if (cur) this.finishNode(cur, "SwitchCase"); 15677 node.cases.push(cur = this.startNode()); 15678 cur.consequent = []; 15679 this.next(); 15680 if (isCase) { 15681 cur.test = this.parseExpression(); 15682 } else { 15683 if (sawDefault) this.raise(this.state.lastTokStart, "Multiple default clauses"); 15684 sawDefault = true; 15685 cur.test = null; 15686 } 15687 this.expect(types.colon); 15688 } else { 15689 if (cur) {
15690 cur.consequent.push(this.parseStatement(true)); 15691 } else { 15692 this.unexpected(); 15693 } 15694 } 15695 } 15696 if (cur) this.finishNode(cur, "SwitchCase"); 15697 this.next(); // Closing brace 15698 this.state.labels.pop(); 15699 return this.finishNode(node, "SwitchStatement"); 15700 }; 15701 15702 pp$1.parseThrowStatement = function (node) { 15703 this.next(); 15704 if (lineBreak.test(this.input.slice(this.state.lastTokEnd, this.state.start))) this.raise(this.state.lastTokEnd, "Illegal newline after throw"); 15705 node.argument = this.parseExpression(); 15706 this.semicolon(); 15707 return this.finishNode(node, "ThrowStatement"); 15708 }; 15709 15710 // Reused empty array added for node fields that are always empty. 15711 15712 var empty = []; 15713 15714 pp$1.parseTryStatement = function (node) { 15715 this.next(); 15716 15717 node.block = this.parseBlock(); 15718 node.handler = null; 15719 15720 if (this.match(types._catch)) { 15721 var clause = this.startNode(); 15722 this.next(); 15723 15724 this.expect(types.parenL); 15725 clause.param = this.parseBindingAtom(); 15726 this.checkLVal(clause.param, true, Object.create(null), "catch clause"); 15727 this.expect(types.parenR); 15728 15729 clause.body = this.parseBlock(); 15730 node.handler = this.finishNode(clause, "CatchClause"); 15731 } 15732 15733 node.guardedHandlers = empty; 15734 node.finalizer = this.eat(types._finally) ? this.parseBlock() : null; 15735 15736 if (!node.handler && !node.finalizer) { 15737 this.raise(node.start, "Missing catch or finally clause"); 15738 } 15739 15740 return this.finishNode(node, "TryStatement"); 15741 }; 15742 15743 pp$1.parseVarStatement = function (node, kind) { 15744 this.next(); 15745 this.parseVar(node, false, kind); 15746 this.semicolon(); 15747 return this.finishNode(node, "VariableDeclaration"); 15748 }; 15749 15750 pp$1.parseWhileStatement = function (node) { 15751 this.next(); 15752 node.test = this.parseParenExpression(); 15753 this.state.labels.push(loopLabel); 15754 node.body = this.parseStatement(false); 15755 this.state.labels.pop(); 15756 return this.finishNode(node, "WhileStatement"); 15757 }; 15758 15759 pp$1.parseWithStatement = function (node) { 15760 if (this.state.strict) this.raise(this.state.start, "'with' in strict mode"); 15761 this.next(); 15762 node.object = this.parseParenExpression(); 15763 node.body = this.parseStatement(false); 15764 return this.finishNode(node, "WithStatement"); 15765 }; 15766 15767 pp$1.parseEmptyStatement = function (node) { 15768 this.next(); 15769 return this.finishNode(node, "EmptyStatement"); 15770 }; 15771 15772 pp$1.parseLabeledStatement = function (node, maybeName, expr) { 15773 for (var _iterator = this.state.labels, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { 15774 var _ref; 15775 15776 if (_isArray) { 15777 if (_i >= _iterator.length) break; 15778 _ref = _iterator[_i++]; 15779 } else { 15780 _i = _iterator.next(); 15781 if (_i.done) break; 15782 _ref = _i.value; 15783 } 15784 15785 var _label = _ref; 15786 15787 if (_label.name === maybeName) { 15788 this.raise(expr.start, "Label '" + maybeName + "' is already declared"); 15789 } 15790 } 15791 15792 var kind = this.state.type.isLoop ? "loop" : this.match(types._switch) ? "switch" : null; 15793 for (var i = this.state.labels.length - 1; i >= 0; i--) { 15794 var label = this.state.labels[i]; 15795 if (label.statementStart === node.start) { 15796 label.statementStart = this.state.start; 15797 label.kind = kind; 15798 } else { 15799 break; 15800 } 15801 } 15802 15803 this.state.labels.push({ name: maybeName, kind: kind, statementStart: this.state.start }); 15804 node.body = this.parseStatement(true); 15805 this.state.labels.pop(); 15806 node.label = expr; 15807 return this.finishNode(node, "LabeledStatement"); 15808 }; 15809 15810 pp$1.parseExpressionStatement = function (node, expr) { 15811 node.expression = expr; 15812 this.semicolon(); 15813 return this.finishNode(node, "ExpressionStatement"); 15814 }; 15815 15816 // Parse a semicolon-enclosed block of statements, handling `"use 15817 // strict"` declarations when `allowStrict` is true (used for 15818 // function bodies). 15819 15820 pp$1.parseBlock = function (allowDirectives) { 15821 var node = this.startNode(); 15822 this.expect(types.braceL); 15823 this.parseBlockBody(node, allowDirectives, false, types.braceR); 15824 return this.finishNode(node, "BlockStatement"); 15825 }; 15826 15827 pp$1.isValidDirective = function (stmt) { 15828 return stmt.type === "ExpressionStatement" && stmt.expression.type === "StringLiteral" && !stmt.expression.extra.parenthesized; 15829 }; 15830 15831 pp$1.parseBlockBody = function (node, allowDirectives, topLevel, end) { 15832 node.body = []; 15833 node.directives = []; 15834 15835 var parsedNonDirective = false;
15836 var oldStrict = void 0; 15837 var octalPosition = void 0; 15838 15839 while (!this.eat(end)) { 15840 if (!parsedNonDirective && this.state.containsOctal && !octalPosition) { 15841 octalPosition = this.state.octalPosition; 15842 } 15843 15844 var stmt = this.parseStatement(true, topLevel); 15845 15846 if (allowDirectives && !parsedNonDirective && this.isValidDirective(stmt)) { 15847 var directive = this.stmtToDirective(stmt); 15848 node.directives.push(directive); 15849 15850 if (oldStrict === undefined && directive.value.value === "use strict") { 15851 oldStrict = this.state.strict; 15852 this.setStrict(true); 15853 15854 if (octalPosition) { 15855 this.raise(octalPosition, "Octal literal in strict mode"); 15856 } 15857 } 15858 15859 continue; 15860 } 15861 15862 parsedNonDirective = true; 15863 node.body.push(stmt); 15864 } 15865 15866 if (oldStrict === false) { 15867 this.setStrict(false); 15868 } 15869 }; 15870 15871 // Parse a regular `for` loop. The disambiguation code in 15872 // `parseStatement` will already have parsed the init statement or 15873 // expression. 15874 15875 pp$1.parseFor = function (node, init) { 15876 node.init = init; 15877 this.expect(types.semi); 15878 node.test = this.match(types.semi) ? null : this.parseExpression(); 15879 this.expect(types.semi); 15880 node.update = this.match(types.parenR) ? null : this.parseExpression(); 15881 this.expect(types.parenR); 15882 node.body = this.parseStatement(false); 15883 this.state.labels.pop(); 15884 return this.finishNode(node, "ForStatement"); 15885 }; 15886 15887 // Parse a `for`/`in` and `for`/`of` loop, which are almost 15888 // same from parser's perspective. 15889 15890 pp$1.parseForIn = function (node, init, forAwait) { 15891 var type = void 0; 15892 if (forAwait) { 15893 this.eatContextual("of"); 15894 type = "ForAwaitStatement"; 15895 } else { 15896 type = this.match(types._in) ? "ForInStatement" : "ForOfStatement"; 15897 this.next(); 15898 } 15899 node.left = init; 15900 node.right = this.parseExpression(); 15901 this.expect(types.parenR); 15902 node.body = this.parseStatement(false); 15903 this.state.labels.pop(); 15904 return this.finishNode(node, type); 15905 }; 15906 15907 // Parse a list of variable declarations. 15908 15909 pp$1.parseVar = function (node, isFor, kind) { 15910 node.declarations = []; 15911 node.kind = kind.keyword; 15912 for (;;) { 15913 var decl = this.startNode(); 15914 this.parseVarHead(decl); 15915 if (this.eat(types.eq)) { 15916 decl.init = this.parseMaybeAssign(isFor); 15917 } else if (kind === types._const && !(this.match(types._in) || this.isContextual("of"))) { 15918 this.unexpected(); 15919 } else if (decl.id.type !== "Identifier" && !(isFor && (this.match(types._in) || this.isContextual("of")))) { 15920 this.raise(this.state.lastTokEnd, "Complex binding patterns require an initialization value"); 15921 } else { 15922 decl.init = null; 15923 } 15924 node.declarations.push(this.finishNode(decl, "VariableDeclarator")); 15925 if (!this.eat(types.comma)) break; 15926 } 15927 return node; 15928 }; 15929 15930 pp$1.parseVarHead = function (decl) { 15931 decl.id = this.parseBindingAtom(); 15932 this.checkLVal(decl.id, true, undefined, "variable declaration"); 15933 }; 15934 15935 // Parse a function declaration or literal (depending on the 15936 // `isStatement` parameter). 15937 15938 pp$1.parseFunction = function (node, isStatement, allowExpressionBody, isAsync, optionalId) { 15939 var oldInMethod = this.state.inMethod; 15940 this.state.inMethod = false; 15941 15942 this.initFunction(node, isAsync); 15943 15944 if (this.match(types.star)) { 15945 if (node.async && !this.hasPlugin("asyncGenerators")) { 15946 this.unexpected(); 15947 } else { 15948 node.generator = true; 15949 this.next(); 15950 } 15951 } 15952 15953 if (isStatement && !optionalId && !this.match(types.name) && !this.match(types._yield)) { 15954 this.unexpected(); 15955 } 15956 15957 if (this.match(types.name) || this.match(types._yield)) { 15958 node.id = this.parseBindingIdentifier(); 15959 } 15960 15961 this.parseFunctionParams(node); 15962 this.parseFunctionBody(node, allowExpressionBody); 15963 15964 this.state.inMethod = oldInMethod; 15965 15966 return this.finishNode(node, isStatement ? "FunctionDeclaration" : "FunctionExpression"); 15967 }; 15968 15969 pp$1.parseFunctionParams = function (node) { 15970 this.expect(types.parenL); 15971 node.params = this.parseBindingList(types.parenR); 15972 }; 15973 15974 // Parse a class declaration or literal (depending on the 15975 // `isStatement` parameter). 15976 15977 pp$1.parseClass = function (node, isStatement, optionalId) { 15978 this.next(); 15979 this.takeDecorators(node); 15980 this.parseClassId(node, isStatement, optionalId); 15981 this.parseClassSuper(node); 15982 this.parseClassBody(node); 15983 return this.finishNode(node, isStatement ? "ClassDeclaration" : "ClassExpression"); 15984 }; 15985 15986 pp$1.isClassProperty = function () { 15987 return this.match(types.eq) || this.isLineTerminator(); 15988 }; 15989 15990 pp$1.isClassMutatorStarter = function () { 15991 return false;
15992 }; 15993 15994 pp$1.parseClassBody = function (node) { 15995 // class bodies are implicitly strict 15996 var oldStrict = this.state.strict; 15997 this.state.strict = true; 15998 15999 var hadConstructorCall = false; 16000 var hadConstructor = false; 16001 var decorators = []; 16002 var classBody = this.startNode(); 16003 16004 classBody.body = []; 16005 16006 this.expect(types.braceL); 16007 16008 while (!this.eat(types.braceR)) { 16009 if (this.eat(types.semi)) { 16010 if (decorators.length > 0) { 16011 this.raise(this.state.lastTokEnd, "Decorators must not be followed by a semicolon"); 16012 } 16013 continue; 16014 } 16015 16016 if (this.match(types.at)) { 16017 decorators.push(this.parseDecorator()); 16018 continue; 16019 } 16020 16021 var method = this.startNode(); 16022 16023 // steal the decorators if there are any 16024 if (decorators.length) { 16025 method.decorators = decorators; 16026 decorators = []; 16027 } 16028 16029 var isConstructorCall = false; 16030 var isMaybeStatic = this.match(types.name) && this.state.value === "static"; 16031 var isGenerator = this.eat(types.star); 16032 var isGetSet = false; 16033 var isAsync = false; 16034 16035 this.parsePropertyName(method); 16036 16037 method.static = isMaybeStatic && !this.match(types.parenL); 16038 if (method.static) { 16039 isGenerator = this.eat(types.star); 16040 this.parsePropertyName(method); 16041 } 16042 16043 if (!isGenerator) { 16044 if (this.isClassProperty()) { 16045 classBody.body.push(this.parseClassProperty(method)); 16046 continue; 16047 } 16048 16049 if (method.key.type === "Identifier" && !method.computed && this.hasPlugin("classConstructorCall") && method.key.name === "call" && this.match(types.name) && this.state.value === "constructor") { 16050 isConstructorCall = true; 16051 this.parsePropertyName(method); 16052 } 16053 } 16054 16055 var isAsyncMethod = !this.match(types.parenL) && !method.computed && method.key.type === "Identifier" && method.key.name === "async"; 16056 if (isAsyncMethod) { 16057 if (this.hasPlugin("asyncGenerators") && this.eat(types.star)) isGenerator = true; 16058 isAsync = true; 16059 this.parsePropertyName(method); 16060 } 16061 16062 method.kind = "method"; 16063 16064 if (!method.computed) { 16065 var key = method.key; 16066 16067 // handle get/set methods 16068 // eg. class Foo { get bar() {} set bar() {} } 16069 16070 if (!isAsync && !isGenerator && !this.isClassMutatorStarter() && key.type === "Identifier" && !this.match(types.parenL) && (key.name === "get" || key.name === "set")) { 16071 isGetSet = true; 16072 method.kind = key.name; 16073 key = this.parsePropertyName(method); 16074 } 16075 16076 // disallow invalid constructors 16077 var isConstructor = !isConstructorCall && !method.static && (key.name === "constructor" || // Identifier 16078 key.value === "constructor" // Literal 16079 ); 16080 if (isConstructor) { 16081 if (hadConstructor) this.raise(key.start, "Duplicate constructor in the same class"); 16082 if (isGetSet) this.raise(key.start, "Constructor can't have get/set modifier"); 16083 if (isGenerator) this.raise(key.start, "Constructor can't be a generator"); 16084 if (isAsync) this.raise(key.start, "Constructor can't be an async function"); 16085 method.kind = "constructor"; 16086 hadConstructor = true; 16087 } 16088 16089 // disallow static prototype method 16090 var isStaticPrototype = method.static && (key.name === "prototype" || // Identifier 16091 key.value === "prototype" // Literal 16092 ); 16093 if (isStaticPrototype) { 16094 this.raise(key.start, "Classes may not have static property named prototype"); 16095 } 16096 } 16097 16098 // convert constructor to a constructor call 16099 if (isConstructorCall) { 16100 if (hadConstructorCall) this.raise(method.start, "Duplicate constructor call in the same class"); 16101 method.kind = "constructorCall"; 16102 hadConstructorCall = true; 16103 } 16104 16105 // disallow decorators on class constructors 16106 if ((method.kind === "constructor" || method.kind === "constructorCall") && method.decorators) { 16107 this.raise(method.start, "You can't attach decorators to a class constructor"); 16108 } 16109 16110 this.parseClassMethod(classBody, method, isGenerator, isAsync); 16111 16112 if (isGetSet) { 16113 this.checkGetterSetterParamCount(method); 16114 } 16115 } 16116 16117 if (decorators.length) { 16118 this.raise(this.state.start, "You have trailing decorators with no method"); 16119 } 16120 16121 node.body = this.finishNode(classBody, "ClassBody"); 16122 16123 this.state.strict = oldStrict; 16124 }; 16125 16126 pp$1.parseClassProperty = function (node) { 16127 if (this.match(types.eq)) { 16128 if (!this.hasPlugin("classProperties")) this.unexpected(); 16129 this.next(); 16130 node.value = this.parseMaybeAssign(); 16131 } else { 16132 node.value = null; 16133 } 16134 this.semicolon(); 16135 return this.finishNode(node, "ClassProperty"); 16136 }; 16137 16138 pp$1.parseClassMethod = function (classBody, method, isGenerator, isAsync) { 16139 this.parseMethod(method, isGenerator, isAsync); 16140 classBody.body.push(this.finishNode(method, "ClassMethod")); 16141 }; 16142 16143 pp$1.parseClassId = function (node, isStatement, optionalId) { 16144 if (this.match(types.name)) { 16145 node.id = this.parseIdentifier(); 16146 } else { 16147 if (optionalId || !isStatement) { 16148 node.id = null; 16149 } else { 16150 this.unexpected(); 16151 } 16152 } 16153 }; 16154 16155 pp$1.parseClassSuper = function (node) { 16156 node.superClass = this.eat(types._extends) ? this.parseExprSubscripts() : null; 16157 }; 16158 16159 // Parses module export declaration. 16160 16161 pp$1.parseExport = function (node) { 16162 this.next(); 16163 // export * from '...' 16164 if (this.match(types.star)) { 16165 var specifier = this.startNode(); 16166 this.next(); 16167 if (this.hasPlugin("exportExtensions") && this.eatContextual("as")) { 16168 specifier.exported = this.parseIdentifier(); 16169 node.specifiers = [this.finishNode(specifier, "ExportNamespaceSpecifier")]; 16170 this.parseExportSpecifiersMaybe(node); 16171 this.parseExportFrom(node, true); 16172 } else { 16173 this.parseExportFrom(node, true); 16174 return this.finishNode(node, "ExportAllDeclaration"); 16175 } 16176 } else if (this.hasPlugin("exportExtensions") && this.isExportDefaultSpecifier()) { 16177 var _specifier = this.startNode(); 16178 _specifier.exported = this.parseIdentifier(true); 16179 node.specifiers = [this.finishNode(_specifier, "ExportDefaultSpecifier")]; 16180 if (this.match(types.comma) && this.lookahead().type === types.star) { 16181 this.expect(types.comma); 16182 var _specifier2 = this.startNode(); 16183 this.expect(types.star); 16184 this.expectContextual("as"); 16185 _specifier2.exported = this.parseIdentifier(); 16186 node.specifiers.push(this.finishNode(_specifier2, "ExportNamespaceSpecifier")); 16187 } else { 16188 this.parseExportSpecifiersMaybe(node); 16189 } 16190 this.parseExportFrom(node, true); 16191 } else if (this.eat(types._default)) { 16192 // export default ... 16193 var expr = this.startNode(); 16194 var needsSemi = false;
16195 if (this.eat(types._function)) { 16196 expr = this.parseFunction(expr, true, false, false, true); 16197 } else if (this.match(types._class)) { 16198 expr = this.parseClass(expr, true, true); 16199 } else { 16200 needsSemi = true; 16201 expr = this.parseMaybeAssign(); 16202 } 16203 node.declaration = expr; 16204 if (needsSemi) this.semicolon(); 16205 this.checkExport(node, true, true); 16206 return this.finishNode(node, "ExportDefaultDeclaration"); 16207 } else if (this.shouldParseExportDeclaration()) { 16208 node.specifiers = []; 16209 node.source = null; 16210 node.declaration = this.parseExportDeclaration(node); 16211 } else { 16212 // export { x, y as z } [from '...'] 16213 node.declaration = null; 16214 node.specifiers = this.parseExportSpecifiers(); 16215 this.parseExportFrom(node); 16216 } 16217 this.checkExport(node, true); 16218 return this.finishNode(node, "ExportNamedDeclaration"); 16219 }; 16220 16221 pp$1.parseExportDeclaration = function () { 16222 return this.parseStatement(true); 16223 }; 16224 16225 pp$1.isExportDefaultSpecifier = function () { 16226 if (this.match(types.name)) { 16227 return this.state.value !== "type" && this.state.value !== "async" && this.state.value !== "interface"; 16228 } 16229 16230 if (!this.match(types._default)) { 16231 return false; 16232 } 16233 16234 var lookahead = this.lookahead(); 16235 return lookahead.type === types.comma || lookahead.type === types.name && lookahead.value === "from"; 16236 }; 16237 16238 pp$1.parseExportSpecifiersMaybe = function (node) { 16239 if (this.eat(types.comma)) { 16240 node.specifiers = node.specifiers.concat(this.parseExportSpecifiers()); 16241 } 16242 }; 16243 16244 pp$1.parseExportFrom = function (node, expect) { 16245 if (this.eatContextual("from")) { 16246 node.source = this.match(types.string) ? this.parseExprAtom() : this.unexpected(); 16247 this.checkExport(node); 16248 } else { 16249 if (expect) { 16250 this.unexpected(); 16251 } else { 16252 node.source = null; 16253 } 16254 } 16255 16256 this.semicolon(); 16257 }; 16258 16259 pp$1.shouldParseExportDeclaration = function () { 16260 return this.state.type.keyword === "var" || this.state.type.keyword === "const" || this.state.type.keyword === "let" || this.state.type.keyword === "function" || this.state.type.keyword === "class" || this.isContextual("async"); 16261 }; 16262 16263 pp$1.checkExport = function (node, checkNames, isDefault) { 16264 if (checkNames) { 16265 // Check for duplicate exports 16266 if (isDefault) { 16267 // Default exports 16268 this.checkDuplicateExports(node, "default"); 16269 } else if (node.specifiers && node.specifiers.length) { 16270 // Named exports 16271 for (var _iterator2 = node.specifiers, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) { 16272 var _ref2; 16273 16274 if (_isArray2) { 16275 if (_i2 >= _iterator2.length) break; 16276 _ref2 = _iterator2[_i2++]; 16277 } else { 16278 _i2 = _iterator2.next(); 16279 if (_i2.done) break; 16280 _ref2 = _i2.value; 16281 } 16282 16283 var specifier = _ref2; 16284 16285 this.checkDuplicateExports(specifier, specifier.exported.name); 16286 } 16287 } else if (node.declaration) { 16288 // Exported declarations 16289 if (node.declaration.type === "FunctionDeclaration" || node.declaration.type === "ClassDeclaration") { 16290 this.checkDuplicateExports(node, node.declaration.id.name); 16291 } else if (node.declaration.type === "VariableDeclaration") { 16292 for (var _iterator3 = node.declaration.declarations, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator]();;) { 16293 var _ref3; 16294 16295 if (_isArray3) { 16296 if (_i3 >= _iterator3.length) break; 16297 _ref3 = _iterator3[_i3++]; 16298 } else { 16299 _i3 = _iterator3.next(); 16300 if (_i3.done) break; 16301 _ref3 = _i3.value; 16302 } 16303 16304 var declaration = _ref3; 16305 16306 this.checkDeclaration(declaration.id); 16307 } 16308 } 16309 } 16310 } 16311 16312 if (this.state.decorators.length) { 16313 var isClass = node.declaration && (node.declaration.type === "ClassDeclaration" || node.declaration.type === "ClassExpression"); 16314 if (!node.declaration || !isClass) { 16315 this.raise(node.start, "You can only use decorators on an export when exp
16315orting a class"); 16316 } 16317 this.takeDecorators(node.declaration); 16318 } 16319 }; 16320 16321 pp$1.checkDeclaration = function (node) { 16322 if (node.type === "ObjectPattern") { 16323 for (var _iterator4 = node.properties, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : _iterator4[Symbol.iterator]();;) { 16324 var _ref4; 16325 16326 if (_isArray4) { 16327 if (_i4 >= _iterator4.length) break; 16328 _ref4 = _iterator4[_i4++]; 16329 } else { 16330 _i4 = _iterator4.next(); 16331 if (_i4.done) break; 16332 _ref4 = _i4.value; 16333 } 16334 16335 var prop = _ref4; 16336 16337 this.checkDeclaration(prop); 16338 } 16339 } else if (node.type === "ArrayPattern") { 16340 for (var _iterator5 = node.elements, _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : _iterator5[Symbol.iterator]();;) { 16341 var _ref5; 16342 16343 if (_isArray5) { 16344 if (_i5 >= _iterator5.length) break; 16345 _ref5 = _iterator5[_i5++]; 16346 } else { 16347 _i5 = _iterator5.next(); 16348 if (_i5.done) break; 16349 _ref5 = _i5.value; 16350 } 16351 16352 var elem = _ref5; 16353 16354 if (elem) { 16355 this.checkDeclaration(elem); 16356 } 16357 } 16358 } else if (node.type === "ObjectProperty") { 16359 this.checkDeclaration(node.value); 16360 } else if (node.type === "RestElement" || node.type === "RestProperty") { 16361 this.checkDeclaration(node.argument); 16362 } else if (node.type === "Identifier") { 16363 this.checkDuplicateExports(node, node.name); 16364 } 16365 }; 16366 16367 pp$1.checkDuplicateExports = function (node, name) { 16368 if (this.state.exportedIdentifiers.indexOf(name) > -1) { 16369 this.raiseDuplicateExportError(node, name); 16370 } 16371 this.state.exportedIdentifiers.push(name); 16372 }; 16373 16374 pp$1.raiseDuplicateExportError = function (node, name) { 16375 this.raise(node.start, name === "default" ? "Only one default export allowed per module." : "`" + name + "` has already been exported. Exported identifiers must be unique."); 16376 }; 16377 16378 // Parses a comma-separated list of module exports. 16379 16380 pp$1.parseExportSpecifiers = function () { 16381 var nodes = []; 16382 var first = true; 16383 var needsFrom = void 0; 16384 16385 // export { x, y as z } [from '...'] 16386 this.expect(types.braceL); 16387 16388 while (!this.eat(types.braceR)) { 16389 if (first) { 16390 first = false; 16391 } else { 16392 this.expect(types.comma); 16393 if (this.eat(types.braceR)) break; 16394 } 16395 16396 var isDefault = this.match(types._default); 16397 if (isDefault && !needsFrom) needsFrom = true; 16398 16399 var node = this.startNode(); 16400 node.local = this.parseIdentifier(isDefault); 16401 node.exported = this.eatContextual("as") ? this.parseIdentifier(true) : node.local.__clone(); 16402 nodes.push(this.finishNode(node, "ExportSpecifier")); 16403 } 16404 16405 // https://github.com/ember-cli/ember-cli/pull/3739 16406 if (needsFrom && !this.isContextual("from")) { 16407 this.unexpected(); 16408 } 16409 16410 return nodes; 16411 }; 16412 16413 // Parses import declaration. 16414 16415 pp$1.parseImport = function (node) { 16416 this.eat(types._import); 16417 16418 // import '...' 16419 if (this.match(types.string)) { 16420 node.specifiers = []; 16421 node.source = this.parseExprAtom(); 16422 } else { 16423 node.specifiers = []; 16424 this.parseImportSpecifiers(node); 16425 this.expectContextual("from"); 16426 node.source = this.match(types.string) ? this.parseExprAtom() : this.unexpected(); 16427 } 16428 this.semicolon(); 16429 return this.finishNode(node, "ImportDeclaration"); 16430 }; 16431 16432 // Parses a comma-separated list of module imports. 16433 16434 pp$1.parseImportSpecifiers = function (node) { 16435 var first = true; 16436 if (this.match(types.name)) { 16437 // import defaultObj, { x, y as z } from '...' 16438 var startPos = this.state.start; 16439 var startLoc = this.state.startLoc; 16440 node.specifiers.push(this.parseImportSpecifierDefault(this.parseIdentifier(), startPos, startLoc)); 16441 if (!this.eat(types.comma)) return; 16442 } 16443 16444 if (this.match(types.star)) { 16445 var specifier = this.startNode(); 16446 this.next(); 16447 this.expectContextual("as"); 16448 specifier.local = this.parseIdentifier(); 16449 this.checkLVal(specifier.local, true, undefined, "import namespace specifier"); 16450 node.specifiers.push(this.finishNode(specifier, "ImportNamespaceSpecifier")); 16451 return; 16452 } 16453 16454 this.expect(types.braceL); 16455 while (!this.eat(types.braceR)) { 16456 if (first) { 16457 first = false;
16458 } else { 16459 // Detect an attempt to deep destructure 16460 if (this.eat(types.colon)) { 16461 this.unexpected(null, "ES2015 named imports do not destructure. Use another statement for destructuring after the import."); 16462 } 16463 16464 this.expect(types.comma); 16465 if (this.eat(types.braceR)) break; 16466 } 16467 16468 this.parseImportSpecifier(node); 16469 } 16470 }; 16471 16472 pp$1.parseImportSpecifier = function (node) { 16473 var specifier = this.startNode(); 16474 specifier.imported = this.parseIdentifier(true); 16475 if (this.eatContextual("as")) { 16476 specifier.local = this.parseIdentifier(); 16477 } else { 16478 this.checkReservedWord(specifier.imported.name, specifier.start, true, true); 16479 specifier.local = specifier.imported.__clone(); 16480 } 16481 this.checkLVal(specifier.local, true, undefined, "import specifier"); 16482 node.specifiers.push(this.finishNode(specifier, "ImportSpecifier")); 16483 }; 16484 16485 pp$1.parseImportSpecifierDefault = function (id, startPos, startLoc) { 16486 var node = this.startNodeAt(startPos, startLoc); 16487 node.local = id; 16488 this.checkLVal(node.local, true, undefined, "default import specifier"); 16489 return this.finishNode(node, "ImportDefaultSpecifier"); 16490 }; 16491 16492 var pp$2 = Parser.prototype; 16493 16494 // Convert existing expression atom to assignable pattern 16495 // if possible. 16496 16497 pp$2.toAssignable = function (node, isBinding, contextDescription) { 16498 if (node) { 16499 switch (node.type) { 16500 case "Identifier": 16501 case "ObjectPattern": 16502 case "ArrayPattern": 16503 case "AssignmentPattern": 16504 break; 16505 16506 case "ObjectExpression": 16507 node.type = "ObjectPattern"; 16508 for (var _iterator = node.properties, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { 16509 var _ref; 16510 16511 if (_isArray) { 16512 if (_i >= _iterator.length) break; 16513 _ref = _iterator[_i++]; 16514 } else { 16515 _i = _iterator.next(); 16516 if (_i.done) break; 16517 _ref = _i.value; 16518 } 16519 16520 var prop = _ref; 16521 16522 if (prop.type === "ObjectMethod") { 16523 if (prop.kind === "get" || prop.kind === "set") { 16524 this.raise(prop.key.start, "Object pattern can't contain getter or setter"); 16525 } else { 16526 this.raise(prop.key.start, "Object pattern can't contain methods"); 16527 } 16528 } else { 16529 this.toAssignable(prop, isBinding, "object destructuring pattern"); 16530 } 16531 } 16532 break; 16533 16534 case "ObjectProperty": 16535 this.toAssignable(node.value, isBinding, contextDescription); 16536 break; 16537 16538 case "SpreadProperty": 16539 node.type = "RestProperty"; 16540 break; 16541 16542 case "ArrayExpression": 16543 node.type = "ArrayPattern"; 16544 this.toAssignableList(node.elements, isBinding, contextDescription); 16545 break; 16546 16547 case "AssignmentExpression": 16548 if (node.operator === "=") { 16549 node.type = "AssignmentPattern"; 16550 delete node.operator; 16551 } else { 16552 this.raise(node.left.end, "Only '=' operator can be used for specifying default value."); 16553 } 16554 break; 16555 16556 case "MemberExpression": 16557 if (!isBinding) break; 16558 16559 default: 16560 { 16561 var message = "Invalid left-hand side" + (contextDescription ? " in " + contextDescription : /* istanbul ignore next */"expression"); 16562 this.raise(node.start, message); 16563 } 16564 } 16565 } 16566 return node; 16567 }; 16568 16569 // Convert list of expression atoms to binding list. 16570 16571 pp$2.toAssignableList = function (exprList, isBinding, contextDescription) { 16572 var end = exprList.length; 16573 if (end) { 16574 var last = exprList[end - 1]; 16575 if (last && last.type === "RestElement") { 16576 --end; 16577 } else if (last && last.type === "SpreadElement") { 16578 last.type = "RestElement"; 16579 var arg = last.argument; 16580 this.toAssignable(arg, isBinding, contextDescription); 16581 if (arg.type !== "Identifier" && arg.type !== "MemberExpression" && arg.type !== "ArrayPattern") { 16582 this.unexpected(arg.start); 16583 } 16584 --end; 16585 } 16586 } 16587 for (var i = 0; i < end; i++) { 16588 var elt = exprList[i]; 16589 if (elt) this.toAssignable(elt, isBinding, contextDescription); 16590 } 16591 return exprList; 16592 }; 16593 16594 // Convert list of expression atoms to a list of 16595 16596 pp$2.toReferencedList = function (exprList) { 16597 return exprList; 16598 }; 16599 16600 // Parses spread element. 16601 16602 pp$2.parseSpread = function (refShorthandDefaultPos) { 16603 var node = this.startNode(); 16604 this.next(); 16605 node.argument = this.parseMaybeAssign(false, refShorthandDefaultPos); 16606 return this.finishNode(node, "SpreadElement"); 16607 }; 16608 16609 pp$2.parseRest = function () { 16610 var node = this.startNode(); 16611 this.next(); 16612 node.argument = this.parseBindingIdentifier(); 16613 return this.finishNode(node, "RestElement"); 16614 }; 16615 16616 pp$2.shouldAllowYieldIdentifier = function () { 16617 return this.match(types._yield) && !this.state.strict && !this.state.inGenerator; 16618 }; 16619 16620 pp$2.parseBindingIdentifier = function () { 16621 return this.parseIdentifier(this.shouldAllowYieldIdentifier()); 16622 }; 16623 16624 // Parses lvalue (assignable) atom. 16625 16626 pp$2.parseBindingAtom = function () { 16627 switch (this.state.type) {
16628 case types._yield: 16629 if (this.state.strict || this.state.inGenerator) this.unexpected(); 16630 // fall-through 16631 case types.name: 16632 return this.parseIdentifier(true); 16633 16634 case types.bracketL: 16635 var node = this.startNode(); 16636 this.next(); 16637 node.elements = this.parseBindingList(types.bracketR, true); 16638 return this.finishNode(node, "ArrayPattern"); 16639 16640 case types.braceL: 16641 return this.parseObj(true); 16642 16643 default: 16644 this.unexpected(); 16645 } 16646 }; 16647 16648 pp$2.parseBindingList = function (close, allowEmpty) { 16649 var elts = []; 16650 var first = true; 16651 while (!this.eat(close)) { 16652 if (first) { 16653 first = false; 16654 } else { 16655 this.expect(types.comma); 16656 } 16657 if (allowEmpty && this.match(types.comma)) { 16658 elts.push(null); 16659 } else if (this.eat(close)) { 16660 break; 16661 } else if (this.match(types.ellipsis)) { 16662 elts.push(this.parseAssignableListItemTypes(this.parseRest())); 16663 this.expect(close); 16664 break; 16665 } else { 16666 var decorators = []; 16667 while (this.match(types.at)) { 16668 decorators.push(this.parseDecorator()); 16669 } 16670 var left = this.parseMaybeDefault(); 16671 if (decorators.length) { 16672 left.decorators = decorators; 16673 } 16674 this.parseAssignableListItemTypes(left); 16675 elts.push(this.parseMaybeDefault(left.start, left.loc.start, left)); 16676 } 16677 } 16678 return elts; 16679 }; 16680 16681 pp$2.parseAssignableListItemTypes = function (param) { 16682 return param; 16683 }; 16684 16685 // Parses assignment pattern around given atom if possible. 16686 16687 pp$2.parseMaybeDefault = function (startPos, startLoc, left) { 16688 startLoc = startLoc || this.state.startLoc; 16689 startPos = startPos || this.state.start; 16690 left = left || this.parseBindingAtom(); 16691 if (!this.eat(types.eq)) return left; 16692 16693 var node = this.startNodeAt(startPos, startLoc); 16694 node.left = left; 16695 node.right = this.parseMaybeAssign(); 16696 return this.finishNode(node, "AssignmentPattern"); 16697 }; 16698 16699 // Verify that a node is an lval — something that can be assigned 16700 // to. 16701 16702 pp$2.checkLVal = function (expr, isBinding, checkClashes, contextDescription) { 16703 switch (expr.type) { 16704 case "Identifier": 16705 this.checkReservedWord(expr.name, expr.start, false, true); 16706 16707 if (checkClashes) { 16708 // we need to prefix this with an underscore for the cases where we have a key of 16709 // `__proto__`. there's a bug in old V8 where the following wouldn't work: 16710 // 16711 // > var obj = Object.create(null); 16712 // undefined 16713 // > obj.__proto__ 16714 // null 16715 // > obj.__proto__ = true; 16716 // true 16717 // > obj.__proto__ 16718 // null 16719 var key = "_" + expr.name; 16720 16721 if (checkClashes[key]) { 16722 this.raise(expr.start, "Argument name clash in strict mode"); 16723 } else { 16724 checkClashes[key] = true; 16725 } 16726 } 16727 break; 16728 16729 case "MemberExpression": 16730 if (isBinding) this.raise(expr.start, (isBinding ? "Binding" : "Assigning to") + " member expression"); 16731 break; 16732 16733 case "ObjectPattern": 16734 for (var _iterator2 = expr.properties, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) { 16735 var _ref2; 16736 16737 if (_isArray2) { 16738 if (_i2 >= _iterator2.length) break; 16739 _ref2 = _iterator2[_i2++]; 16740 } else { 16741 _i2 = _iterator2.next(); 16742 if (_i2.done) break; 16743 _ref2 = _i2.value; 16744 } 16745 16746 var prop = _ref2; 16747 16748 if (prop.type === "ObjectProperty") prop = prop.value; 16749 this.checkLVal(prop, isBinding, checkClashes, "object destructuring pattern"); 16750 } 16751 break; 16752 16753 case "ArrayPattern": 16754 for (var _iterator3 = expr.elements, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator]();;) { 16755 var _ref3; 16756 16757 if (_isArray3) { 16758 if (_i3 >= _iterator3.length) break; 16759 _ref3 = _iterator3[_i3++]; 16760 } else { 16761 _i3 = _iterator3.next(); 16762 if (_i3.done) break; 16763 _ref3 = _i3.value; 16764 } 16765 16766 var elem = _ref3; 16767 16768 if (elem) this.checkLVal(elem, isBinding, checkClashes, "array destructuring pattern"); 16769 } 16770 break; 16771 16772 case "AssignmentPattern": 16773 this.checkLVal(expr.left, isBinding, checkClashes, "assignment pattern"); 16774 break; 16775 16776 case "RestProperty": 16777 this.checkLVal(expr.argument, isBinding, checkClashes, "rest property"); 16778 break; 16779 16780 case "RestElement": 16781 this.checkLVal(expr.argument, isBinding, checkClashes, "rest element"); 16782 break; 16783 16784 default: 16785 { 16786 var message = (isBinding ? /* istanbul ignore next */"Binding invalid" : "Invalid") + " left-hand side" + (contextDescription ? " in " + contextDescription : /* istanbul ignore next */"expression"); 16787 this.raise(expr.start, message); 16788 } 16789 } 16790 }; 16791 16792 /* eslint max-len: 0 */ 16793 16794 // A recursive descent parser operates by defining functions for all 16795 // syntactic elements, and recursively calling those, each function 16796 // advancing the input stream and returning an AST node. Precedence 16797 // of constructs (for example, the fact that `!x[1]` means `!(x[1])` 16798 // instead of `(!x)[1]` is handled by the fact that the parser 16799 // function that parses unary prefix operators is called first, and 16800 // in turn calls the function that parses `[]` subscripts — that 16801 // way, it'll receive the node for `x[1]` already parsed, and wraps 16802 // *that* in the unary operator node. 16803 // 16804 // Acorn uses an [operator precedence parser][opp] to handle binary 16805 // operator precedence, because it is much more compact than using 16806 // the technique outlined above, which uses different, nesting 16807 // functions to specify precedence, for all of the ten binary 16808 // precedence levels that JavaScript defines. 16809 // 16810 // [opp]: http://en.wikipedia.org/wiki/Operator-precedence_parser 16811 16812 var pp$3 = Parser.prototype; 16813 16814 // Check if property name clashes with already added. 16815 // Object/class getters and setters are not allowed to clash — 16816 // either with each other or with an init property — and in 16817 // strict mode, init properties are also not allowed to be repeated. 16818 16819 pp$3.checkPropClash = function (prop, propHash) { 16820 if (prop.computed || prop.kind) return; 16821 16822 var key = prop.key; 16823 // It is either an Identifier or a String/NumericLiteral 16824 var name = key.type === "Identifier" ? key.name : String(key.value); 16825 16826 if (name === "__proto__") { 16827 if (propHash.proto) this.raise(key.start, "Redefinition of __proto__ property"); 16828 propHash.proto = true; 16829 } 16830 }; 16831 16832 // Convenience method to parse an Expression only 16833 pp$3.getExpression = function () { 16834 this.nextToken(); 16835 var expr = this.parseExpression(); 16836 if (!this.match(types.eof)) { 16837 this.unexpected(); 16838 } 16839 return expr; 16840 }; 16841 16842 // ### Expression parsing 16843 16844 // These nest, from the most general expression type at the top to 16845 // 'atomic', nondivisible expression types at the bottom. Most of 16846 // the functions will simply let the function (s) below them parse, 16847 // and, *if* the syntactic construct they handle is present, wrap 16848 // the AST node that the inner parser gave them in another node. 16849 16850 // Parse a full expression. The optional arguments are used to 16851 // forbid the `in` operator (in for loops initalization expressions) 16852 // and provide reference for storing '=' operator inside shorthand 16853 // property assignment in contexts where both object expression 16854 // and object pattern might appear (so it's possible to raise 16855 // delayed syntax error at correct position). 16856 16857 pp$3.parseExpression = function (noIn, refShorthandDefaultPos) { 16858 var startPos = this.state.start; 16859 var startLoc = this.state.startLoc;
16860 var expr = this.parseMaybeAssign(noIn, refShorthandDefaultPos); 16861 if (this.match(types.comma)) { 16862 var node = this.startNodeAt(startPos, startLoc); 16863 node.expressions = [expr]; 16864 while (this.eat(types.comma)) { 16865 node.expressions.push(this.parseMaybeAssign(noIn, refShorthandDefaultPos)); 16866 } 16867 this.toReferencedList(node.expressions); 16868 return this.finishNode(node, "SequenceExpression"); 16869 } 16870 return expr; 16871 }; 16872 16873 // Parse an assignment expression. This includes applications of 16874 // operators like `+=`. 16875 16876 pp$3.parseMaybeAssign = function (noIn, refShorthandDefaultPos, afterLeftParse, refNeedsArrowPos) { 16877 var startPos = this.state.start; 16878 var startLoc = this.state.startLoc; 16879 16880 if (this.match(types._yield) && this.state.inGenerator) { 16881 var _left = this.parseYield(); 16882 if (afterLeftParse) _left = afterLeftParse.call(this, _left, startPos, startLoc); 16883 return _left; 16884 } 16885 16886 var failOnShorthandAssign = void 0; 16887 if (refShorthandDefaultPos) { 16888 failOnShorthandAssign = false; 16889 } else { 16890 refShorthandDefaultPos = { start: 0 }; 16891 failOnShorthandAssign = true; 16892 } 16893 16894 if (this.match(types.parenL) || this.match(types.name)) { 16895 this.state.potentialArrowAt = this.state.start; 16896 } 16897 16898 var left = this.parseMaybeConditional(noIn, refShorthandDefaultPos, refNeedsArrowPos); 16899 if (afterLeftParse) left = afterLeftParse.call(this, left, startPos, startLoc); 16900 if (this.state.type.isAssign) { 16901 var node = this.startNodeAt(startPos, startLoc); 16902 node.operator = this.state.value; 16903 node.left = this.match(types.eq) ? this.toAssignable(left, undefined, "assignment expression") : left; 16904 refShorthandDefaultPos.start = 0; // reset because shorthand default was used correctly 16905 16906 this.checkLVal(left, undefined, undefined, "assignment expression"); 16907 16908 if (left.extra && left.extra.parenthesized) { 16909 var errorMsg = void 0; 16910 if (left.type === "ObjectPattern") { 16911 errorMsg = "`({a}) = 0` use `({a} = 0)`"; 16912 } else if (left.type === "ArrayPattern") { 16913 errorMsg = "`([a]) = 0` use `([a] = 0)`"; 16914 } 16915 if (errorMsg) { 16916 this.raise(left.start, "You're trying to assign to a parenthesized expression, eg. instead of " + errorMsg); 16917 } 16918 } 16919 16920 this.next(); 16921 node.right = this.parseMaybeAssign(noIn); 16922 return this.finishNode(node, "AssignmentExpression"); 16923 } else if (failOnShorthandAssign && refShorthandDefaultPos.start) { 16924 this.unexpected(refShorthandDefaultPos.start); 16925 } 16926 16927 return left; 16928 }; 16929 16930 // Parse a ternary conditional (`?:`) operator. 16931 16932 pp$3.parseMaybeConditional = function (noIn, refShorthandDefaultPos, refNeedsArrowPos) { 16933 var startPos = this.state.start; 16934 var startLoc = this.state.startLoc; 16935 var expr = this.parseExprOps(noIn, refShorthandDefaultPos); 16936 if (refShorthandDefaultPos && refShorthandDefaultPos.start) return expr; 16937 16938 return this.parseConditional(expr, noIn, startPos, startLoc, refNeedsArrowPos); 16939 }; 16940 16941 pp$3.parseConditional = function (expr, noIn, startPos, startLoc) { 16942 if (this.eat(types.question)) { 16943 var node = this.startNodeAt(startPos, startLoc); 16944 node.test = expr; 16945 node.consequent = this.parseMaybeAssign(); 16946 this.expect(types.colon); 16947 node.alternate = this.parseMaybeAssign(noIn); 16948 return this.finishNode(node, "ConditionalExpression"); 16949 } 16950 return expr; 16951 }; 16952 16953 // Start the precedence parser. 16954 16955 pp$3.parseExprOps = function (noIn, refShorthandDefaultPos) { 16956 var startPos = this.state.start; 16957 var startLoc = this.state.startLoc; 16958 var expr = this.parseMaybeUnary(refShorthandDefaultPos); 16959 if (refShorthandDefaultPos && refShorthandDefaultPos.start) { 16960 return expr; 16961 } else { 16962 return this.parseExprOp(expr, startPos, startLoc, -1, noIn); 16963 } 16964 }; 16965 16966 // Parse binary operators with the operator precedence parsing 16967 // algorithm. `left` is the left-hand side of the operator. 16968 // `minPrec` provides context that allows the function to stop and 16969 // defer further parser to one of its callers when it encounters an 16970 // operator that has a lower precedence than the set it is parsing. 16971 16972 pp$3.parseExprOp = function (left, leftStartPos, leftStartLoc, minPrec, noIn) { 16973 var prec = this.state.type.binop; 16974 if (prec != null && (!noIn || !this.match(types._in))) { 16975 if (prec > minPrec) { 16976 var node = this.startNodeAt(leftStartPos, leftStartLoc); 16977 node.left = left; 16978 node.operator = this.state.value; 16979 16980 if (node.operator === "**" && left.type === "UnaryExpression" && left.extra && !left.extra.parenthesizedArgument && !left.extra.parenthesized) { 16981 this.raise(left.argument.start, "Illegal expression. Wrap left hand side or entire exponentiation in parentheses."); 16982 } 16983 16984 var op = this.state.type; 16985 this.next(); 16986 16987 var startPos = this.state.start; 16988 var startLoc = this.state.startLoc; 16989 node.right = this.parseExprOp(this.parseMaybeUnary(), startPos, startLoc, op.rightAssociative ? prec - 1 : prec, noIn); 16990 16991 this.finishNode(node, op === types.logicalOR || op === types.logicalAND ? "LogicalExpression" : "BinaryExpression"); 16992 return this.parseExprOp(node, leftStartPos, leftStartLoc, minPrec, noIn); 16993 } 16994 } 16995 return left; 16996 }; 16997 16998 // Parse unary operators, both prefix and postfix. 16999 17000 pp$3.parseMaybeUnary = function (refShorthandDefaultPos) { 17001 if (this.state.type.prefix) { 17002 var node = this.startNode(); 17003 var update = this.match(types.incDec); 17004 node.operator = this.state.value; 17005 node.prefix = true; 17006 this.next(); 17007 17008 var argType = this.state.type; 17009 node.argument = this.parseMaybeUnary(); 17010 17011 this.addExtra(node, "parenthesizedArgument", argType === types.parenL && (!node.argument.extra || !node.argument.extra.parenthesized)); 17012 17013 if (refShorthandDefaultPos && refShorthandDefaultPos.start) { 17014 this.unexpected(refShorthandDefaultPos.start); 17015 } 17016 17017 if (update) { 17018 this.checkLVal(node.argument, undefined, undefined, "prefix operation"); 17019 } else if (this.state.strict && node.operator === "delete" && node.argument.type === "Identifier") { 17020 this.raise(node.start, "Deleting local variable in strict mode"); 17021 } 17022
17023 return this.finishNode(node, update ? "UpdateExpression" : "UnaryExpression"); 17024 } 17025 17026 var startPos = this.state.start; 17027 var startLoc = this.state.startLoc; 17028 var expr = this.parseExprSubscripts(refShorthandDefaultPos); 17029 if (refShorthandDefaultPos && refShorthandDefaultPos.start) return expr; 17030 while (this.state.type.postfix && !this.canInsertSemicolon()) { 17031 var _node = this.startNodeAt(startPos, startLoc); 17032 _node.operator = this.state.value; 17033 _node.prefix = false; 17034 _node.argument = expr; 17035 this.checkLVal(expr, undefined, undefined, "postfix operation"); 17036 this.next(); 17037 expr = this.finishNode(_node, "UpdateExpression"); 17038 } 17039 return expr; 17040 }; 17041 17042 // Parse call, dot, and `[]`-subscript expressions. 17043 17044 pp$3.parseExprSubscripts = function (refShorthandDefaultPos) { 17045 var startPos = this.state.start; 17046 var startLoc = this.state.startLoc; 17047 var potentialArrowAt = this.state.potentialArrowAt; 17048 var expr = this.parseExprAtom(refShorthandDefaultPos); 17049 17050 if (expr.type === "ArrowFunctionExpression" && expr.start === potentialArrowAt) { 17051 return expr; 17052 } 17053 17054 if (refShorthandDefaultPos && refShorthandDefaultPos.start) { 17055 return expr; 17056 } 17057 17058 return this.parseSubscripts(expr, startPos, startLoc); 17059 }; 17060 17061 pp$3.parseSubscripts = function (base, startPos, startLoc, noCalls) { 17062 for (;;) { 17063 if (!noCalls && this.eat(types.doubleColon)) { 17064 var node = this.startNodeAt(startPos, startLoc); 17065 node.object = base; 17066 node.callee = this.parseNoCallExpr(); 17067 return this.parseSubscripts(this.finishNode(node, "BindExpression"), startPos, startLoc, noCalls); 17068 } else if (this.eat(types.dot)) { 17069 var _node2 = this.startNodeAt(startPos, startLoc); 17070 _node2.object = base; 17071 _node2.property = this.parseIdentifier(true); 17072 _node2.computed = false; 17073 base = this.finishNode(_node2, "MemberExpression"); 17074 } else if (this.eat(types.bracketL)) { 17075 var _node3 = this.startNodeAt(startPos, startLoc); 17076 _node3.object = base; 17077 _node3.property = this.parseExpression(); 17078 _node3.computed = true; 17079 this.expect(types.bracketR); 17080 base = this.finishNode(_node3, "MemberExpression"); 17081 } else if (!noCalls && this.match(types.parenL)) { 17082 var possibleAsync = this.state.potentialArrowAt === base.start && base.type === "Identifier" && base.name === "async" && !this.canInsertSemicolon(); 17083 this.next(); 17084 17085 var _node4 = this.startNodeAt(startPos, startLoc); 17086 _node4.callee = base; 17087 _node4.arguments = this.parseCallExpressionArguments(types.parenR, possibleAsync); 17088 if (_node4.callee.type === "Import" && _node4.arguments.length !== 1) { 17089 this.raise(_node4.start, "import() requires exactly one argument"); 17090 } 17091 base = this.finishNode(_node4, "CallExpression"); 17092 17093 if (possibleAsync && this.shouldParseAsyncArrow()) { 17094 return this.parseAsyncArrowFromCallExpression(this.startNodeAt(startPos, startLoc), _node4); 17095 } else { 17096 this.toReferencedList(_node4.arguments); 17097 } 17098 } else if (this.match(types.backQuote)) { 17099 var _node5 = this.startNodeAt(startPos, startLoc); 17100 _node5.tag = base; 17101 _node5.quasi = this.parseTemplate(); 17102 base = this.finishNode(_node5, "TaggedTemplateExpression"); 17103 } else { 17104 return base; 17105 } 17106 } 17107 }; 17108 17109 pp$3.parseCallExpressionArguments = function (close, possibleAsyncArrow) { 17110 var elts = []; 17111 var innerParenStart = void 0; 17112 var first = true; 17113 17114 while (!this.eat(close)) { 17115 if (first) { 17116 first = false; 17117 } else { 17118 this.expect(types.comma); 17119 if (this.eat(close)) break; 17120 } 17121 17122 // we need to make sure that if this is an async arrow functions, that we don't allow inner parens inside the params 17123 if (this.match(types.parenL) && !innerParenStart) { 17124 innerParenStart = this.state.start; 17125 } 17126 17127 elts.push(this.parseExprListItem(false, possibleAsyncArrow ? { start: 0 } : undefined, possibleAsyncArrow ? { start: 0 } : undefined)); 17128 } 17129 17130 // we found an async arrow function so let's not allow any inner parens 17131 if (possibleAsyncArrow && innerParenStart && this.shouldParseAsyncArrow()) { 17132 this.unexpected(); 17133 } 17134 17135 return elts; 17136 }; 17137 17138 pp$3.shouldParseAsyncArrow = function () { 17139 return this.match(types.arrow); 17140 }; 17141 17142 pp$3.parseAsyncArrowFromCallExpression = function (node, call) { 17143 this.expect(types.arrow); 17144 return this.parseArrowExpression(node, call.arguments, true); 17145 }; 17146 17147 // Parse a no-call expression (like argument of `new` or `::` operators). 17148 17149 pp$3.parseNoCallExpr = function () { 17150 var startPos = this.state.start; 17151 var startLoc = this.state.startLoc; 17152 return this.parseSubscripts(this.parseExprAtom(), startPos, startLoc, true); 17153 }; 17154 17155 // Parse an atomic expression — either a single token that is an 17156 // expression, an expression started by a keyword like `function` or 17157 // `new`, or an expression wrapped in punctuation like `()`, `[]`, 17158 // or `{}`. 17159 17160 pp$3.parseExprAtom = function (refShorthandDefaultPos) { 17161 var canBeArrow = this.state.potentialArrowAt === this.state.start; 17162 var node = void 0; 17163 17164 switch (this.state.type) {
17165 case types._super: 17166 if (!this.state.inMethod && !this.options.allowSuperOutsideMethod) { 17167 this.raise(this.state.start, "'super' outside of function or class"); 17168 } 17169 17170 node = this.startNode(); 17171 this.next(); 17172 if (!this.match(types.parenL) && !this.match(types.bracketL) && !this.match(types.dot)) { 17173 this.unexpected(); 17174 } 17175 if (this.match(types.parenL) && this.state.inMethod !== "constructor" && !this.options.allowSuperOutsideMethod) { 17176 this.raise(node.start, "super() outside of class constructor"); 17177 } 17178 return this.finishNode(node, "Super"); 17179 17180 case types._import: 17181 if (!this.hasPlugin("dynamicImport")) this.unexpected(); 17182 17183 node = this.startNode(); 17184 this.next(); 17185 if (!this.match(types.parenL)) { 17186 this.unexpected(null, types.parenL); 17187 } 17188 return this.finishNode(node, "Import"); 17189 17190 case types._this: 17191 node = this.startNode(); 17192 this.next(); 17193 return this.finishNode(node, "ThisExpression"); 17194 17195 case types._yield: 17196 if (this.state.inGenerator) this.unexpected(); 17197 17198 case types.name: 17199 node = this.startNode(); 17200 var allowAwait = this.state.value === "await" && this.state.inAsync; 17201 var allowYield = this.shouldAllowYieldIdentifier(); 17202 var id = this.parseIdentifier(allowAwait || allowYield); 17203 17204 if (id.name === "await") { 17205 if (this.state.inAsync || this.inModule) { 17206 return this.parseAwait(node); 17207 } 17208 } else if (id.name === "async" && this.match(types._function) && !this.canInsertSemicolon()) { 17209 this.next(); 17210 return this.parseFunction(node, false, false, true); 17211 } else if (canBeArrow && id.name === "async" && this.match(types.name)) { 17212 var params = [this.parseIdentifier()]; 17213 this.expect(types.arrow); 17214 // let foo = bar => {}; 17215 return this.parseArrowExpression(node, params, true); 17216 } 17217 17218 if (canBeArrow && !this.canInsertSemicolon() && this.eat(types.arrow)) { 17219 return this.parseArrowExpression(node, [id]); 17220 } 17221 17222 return id; 17223 17224 case types._do: 17225 if (this.hasPlugin("doExpressions")) { 17226 var _node6 = this.startNode(); 17227 this.next(); 17228 var oldInFunction = this.state.inFunction; 17229 var oldLabels = this.state.labels; 17230 this.state.labels = []; 17231 this.state.inFunction = false; 17232 _node6.body = this.parseBlock(false, true); 17233 this.state.inFunction = oldInFunction; 17234 this.state.labels = oldLabels; 17235 return this.finishNode(_node6, "DoExpression"); 17236 } 17237 17238 case types.regexp: 17239 var value = this.state.value; 17240 node = this.parseLiteral(value.value, "RegExpLiteral"); 17241 node.pattern = value.pattern; 17242 node.flags = value.flags; 17243 return node; 17244 17245 case types.num: 17246 return this.parseLiteral(this.state.value, "NumericLiteral"); 17247 17248 case types.string: 17249 return this.parseLiteral(this.state.value, "StringLiteral"); 17250 17251 case types._null: 17252 node = this.startNode(); 17253 this.next(); 17254 return this.finishNode(node, "NullLiteral"); 17255 17256 case types._true:case types._false: 17257 node = this.startNode(); 17258 node.value = this.match(types._true); 17259 this.next(); 17260 return this.finishNode(node, "BooleanLiteral"); 17261 17262 case types.parenL: 17263 return this.parseParenAndDistinguishExpression(null, null, canBeArrow); 17264 17265 case types.bracketL: 17266 node = this.startNode(); 17267 this.next(); 17268 node.elements = this.parseExprList(types.bracketR, true, refShorthandDefaultPos); 17269 this.toReferencedList(node.elements); 17270 return this.finishNode(node, "ArrayExpression"); 17271 17272 case types.braceL: 17273 return this.parseObj(false, refShorthandDefaultPos); 17274 17275 case types._function: 17276 return this.parseFunctionExpression(); 17277 17278 case types.at: 17279 this.parseDecorators(); 17280 17281 case types._class: 17282 node = this.startNode(); 17283 this.takeDecorators(node); 17284 return this.parseClass(node, false); 17285 17286 case types._new: 17287 return this.parseNew(); 17288 17289 case types.backQuote: 17290 return this.parseTemplate(); 17291 17292 case types.doubleColon: 17293 node = this.startNode(); 17294 this.next(); 17295 node.object = null; 17296 var callee = node.callee = this.parseNoCallExpr(); 17297 if (callee.type === "MemberExpression") { 17298 return this.finishNode(node, "BindExpression"); 17299 } else { 17300 this.raise(callee.start, "Binding should be performed on object property."); 17301 } 17302 17303 default: 17304 this.unexpected(); 17305 } 17306 }; 17307 17308 pp$3.parseFunctionExpression = function () { 17309 var node = this.startNode(); 17310 var meta = this.parseIdentifier(true); 17311 if (this.state.inGenerator && this.eat(types.dot) && this.hasPlugin("functionSent")) { 17312 return this.parseMetaProperty(node, meta, "sent"); 17313 } else { 17314 return this.parseFunction(node, false); 17315 } 17316 }; 17317 17318 pp$3.parseMetaProperty = function (node, meta, propertyName) { 17319 node.meta = meta; 17320 node.property = this.parseIdentifier(true); 17321 17322 if (node.property.name !== propertyName) { 17323 this.raise(node.property.start, "The only valid meta property for new is " + meta.name + "." + propertyName); 17324 } 17325 17326 return this.finishNode(node, "MetaProperty"); 17327 }; 17328 17329 pp$3.parseLiteral = function (value, type, startPos, startLoc) { 17330 startPos = startPos || this.state.start; 17331 startLoc = startLoc || this.state.startLoc; 17332 17333 var node = this.startNodeAt(startPos, startLoc); 17334 this.addExtra(node, "rawValue", value); 17335 this.addExtra(node, "raw", this.input.slice(startPos, this.state.end)); 17336 node.value = value; 17337 this.next(); 17338 return this.finishNode(node, type); 17339 }; 17340 17341 pp$3.parseParenExpression = function () { 17342 this.expect(types.parenL); 17343 var val = this.parseExpression(); 17344 this.expect(types.parenR); 17345 return val; 17346 }; 17347 17348 pp$3.parseParenAndDistinguishExpression = function (startPos, startLoc, canBeArrow) { 17349 startPos = startPos || this.state.start; 17350 startLoc = startLoc || this.state.startLoc; 17351 17352 var val = void 0; 17353 this.expect(types.parenL); 17354 17355 var innerStartPos = this.state.start; 17356 var innerStartLoc = this.state.startLoc; 17357 var exprList = []; 17358 var refShorthandDefaultPos = { start: 0 }; 17359 var refNeedsArrowPos = { start: 0 }; 17360 var first = true; 17361 var spreadStart = void 0; 17362 var optionalCommaStart = void 0; 17363 17364 while (!this.match(types.parenR)) { 17365 if (first) { 17366 first = false;
17367 } else { 17368 this.expect(types.comma, refNeedsArrowPos.start || null); 17369 if (this.match(types.parenR)) { 17370 optionalCommaStart = this.state.start; 17371 break; 17372 } 17373 } 17374 17375 if (this.match(types.ellipsis)) { 17376 var spreadNodeStartPos = this.state.start; 17377 var spreadNodeStartLoc = this.state.startLoc; 17378 spreadStart = this.state.start; 17379 exprList.push(this.parseParenItem(this.parseRest(), spreadNodeStartLoc, spreadNodeStartPos)); 17380 break; 17381 } else { 17382 exprList.push(this.parseMaybeAssign(false, refShorthandDefaultPos, this.parseParenItem, refNeedsArrowPos)); 17383 } 17384 } 17385 17386 var innerEndPos = this.state.start; 17387 var innerEndLoc = this.state.startLoc; 17388 this.expect(types.parenR); 17389 17390 var arrowNode = this.startNodeAt(startPos, startLoc); 17391 if (canBeArrow && this.shouldParseArrow() && (arrowNode = this.parseArrow(arrowNode))) { 17392 for (var _iterator = exprList, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { 17393 var _ref; 17394 17395 if (_isArray) { 17396 if (_i >= _iterator.length) break; 17397 _ref = _iterator[_i++]; 17398 } else { 17399 _i = _iterator.next(); 17400 if (_i.done) break; 17401 _ref = _i.value; 17402 } 17403 17404 var param = _ref;
17405 17406 if (param.extra && param.extra.parenthesized) this.unexpected(param.extra.parenStart); 17407 } 17408 17409 return this.parseArrowExpression(arrowNode, exprList); 17410 } 17411 17412 if (!exprList.length) { 17413 this.unexpected(this.state.lastTokStart); 17414 } 17415 if (optionalCommaStart) this.unexpected(optionalCommaStart); 17416 if (spreadStart) this.unexpected(spreadStart); 17417 if (refShorthandDefaultPos.start) this.unexpected(refShorthandDefaultPos.start); 17418 if (refNeedsArrowPos.start) this.unexpected(refNeedsArrowPos.start); 17419 17420 if (exprList.length > 1) { 17421 val = this.startNodeAt(innerStartPos, innerStartLoc); 17422 val.expressions = exprList; 17423 this.toReferencedList(val.expressions); 17424 this.finishNodeAt(val, "SequenceExpression", innerEndPos, innerEndLoc); 17425 } else { 17426 val = exprList[0]; 17427 } 17428 17429 this.addExtra(val, "parenthesized", true); 17430 this.addExtra(val, "parenStart", startPos); 17431 17432 return val; 17433 }; 17434 17435 pp$3.shouldParseArrow = function () { 17436 return !this.canInsertSemicolon(); 17437 }; 17438 17439 pp$3.parseArrow = function (node) { 17440 if (this.eat(types.arrow)) { 17441 return node; 17442 } 17443 }; 17444 17445 pp$3.parseParenItem = function (node) { 17446 return node; 17447 }; 17448 17449 // New's precedence is slightly tricky. It must allow its argument 17450 // to be a `[]` or dot subscript expression, but not a call — at 17451 // least, not without wrapping it in parentheses. Thus, it uses the 17452 17453 pp$3.parseNew = function () { 17454 var node = this.startNode(); 17455 var meta = this.parseIdentifier(true); 17456 17457 if (this.eat(types.dot)) { 17458 return this.parseMetaProperty(node, meta, "target"); 17459 } 17460 17461 node.callee = this.parseNoCallExpr(); 17462 17463 if (this.eat(types.parenL)) { 17464 node.arguments = this.parseExprList(types.parenR); 17465 this.toReferencedList(node.arguments); 17466 } else { 17467 node.arguments = []; 17468 } 17469 17470 return this.finishNode(node, "NewExpression"); 17471 }; 17472 17473 // Parse template expression. 17474 17475 pp$3.parseTemplateElement = function () { 17476 var elem = this.startNode(); 17477 elem.value = { 17478 raw: this.input.slice(this.state.start, this.state.end).replace(/\r\n?/g, "\n"), 17479 cooked: this.state.value 17480 }; 17481 this.next(); 17482 elem.tail = this.match(types.backQuote); 17483 return this.finishNode(elem, "TemplateElement"); 17484 }; 17485 17486 pp$3.parseTemplate = function () { 17487 var node = this.startNode(); 17488 this.next(); 17489 node.expressions = []; 17490 var curElt = this.parseTemplateElement(); 17491 node.quasis = [curElt]; 17492 while (!curElt.tail) { 17493 this.expect(types.dollarBraceL); 17494 node.expressions.push(this.parseExpression()); 17495 this.expect(types.braceR); 17496 node.quasis.push(curElt = this.parseTemplateElement()); 17497 } 17498 this.next(); 17499 return this.finishNode(node, "TemplateLiteral"); 17500 }; 17501 17502 // Parse an object literal or binding pattern. 17503 17504 pp$3.parseObj = function (isPattern, refShorthandDefaultPos) { 17505 var decorators = []; 17506 var propHash = Object.create(null); 17507 var first = true; 17508 var node = this.startNode(); 17509 17510 node.properties = []; 17511 this.next(); 17512 17513 var firstRestLocation = null; 17514 17515 while (!this.eat(types.braceR)) { 17516 if (first) { 17517 first = false; 17518 } else { 17519 this.expect(types.comma); 17520 if (this.eat(types.braceR)) break; 17521 } 17522 17523 while (this.match(types.at)) { 17524 decorators.push(this.parseDecorator()); 17525 } 17526 17527 var prop = this.startNode(), 17528 isGenerator = false, 17529 isAsync = false, 17530 startPos = void 0, 17531 startLoc = void 0; 17532 if (decorators.length) { 17533 prop.decorators = decorators; 17534 decorators = []; 17535 } 17536 17537 if (this.hasPlugin("objectRestSpread") && this.match(types.ellipsis)) { 17538 prop = this.parseSpread(isPattern ? { start: 0 } : undefined); 17539 prop.type = isPattern ? "RestProperty" : "SpreadProperty"; 17540 if (isPattern) this.toAssignable(prop.argument, true, "object pattern"); 17541 node.properties.push(prop); 17542 if (isPattern) { 17543 var position = this.state.start; 17544 if (firstRestLocation !== null) { 17545 this.unexpected(firstRestLocation, "Cannot have multiple rest elements when destructuring"); 17546 } else if (this.eat(types.braceR)) { 17547 break; 17548 } else if (this.match(types.comma) && this.lookahead().type === types.braceR) { 17549 // TODO: temporary rollback 17550 // this.unexpected(position, "A trailing comma is not permitted after the rest element"); 17551 continue; 17552 } else { 17553 firstRestLocation = position; 17554 continue; 17555 } 17556 } else { 17557 continue; 17558 } 17559 } 17560 17561 prop.method = false;
17562 prop.shorthand = false; 17563 17564 if (isPattern || refShorthandDefaultPos) { 17565 startPos = this.state.start; 17566 startLoc = this.state.startLoc; 17567 } 17568 17569 if (!isPattern) { 17570 isGenerator = this.eat(types.star); 17571 } 17572 17573 if (!isPattern && this.isContextual("async")) { 17574 if (isGenerator) this.unexpected(); 17575 17576 var asyncId = this.parseIdentifier(); 17577 if (this.match(types.colon) || this.match(types.parenL) || this.match(types.braceR) || this.match(types.eq) || this.match(types.comma)) { 17578 prop.key = asyncId; 17579 prop.computed = false; 17580 } else { 17581 isAsync = true; 17582 if (this.hasPlugin("asyncGenerators")) isGenerator = this.eat(types.star); 17583 this.parsePropertyName(prop); 17584 } 17585 } else { 17586 this.parsePropertyName(prop); 17587 } 17588 17589 this.parseObjPropValue(prop, startPos, startLoc, isGenerator, isAsync, isPattern, refShorthandDefaultPos); 17590 this.checkPropClash(prop, propHash); 17591 17592 if (prop.shorthand) { 17593 this.addExtra(prop, "shorthand", true); 17594 } 17595 17596 node.properties.push(prop); 17597 } 17598 17599 if (firstRestLocation !== null) { 17600 this.unexpected(firstRestLocation, "The rest element has to be the last element when destructuring"); 17601 } 17602 17603 if (decorators.length) { 17604 this.raise(this.state.start, "You have trailing decorators with no property"); 17605 } 17606 17607 return this.finishNode(node, isPattern ? "ObjectPattern" : "ObjectExpression"); 17608 }; 17609 17610 pp$3.isGetterOrSetterMethod = function (prop, isPattern) { 17611 return !isPattern && !prop.computed && prop.key.type === "Identifier" && (prop.key.name === "get" || prop.key.name === "set") && (this.match(types.string) || // get "string"() {} 17612 this.match(types.num) || // get 1() {} 17613 this.match(types.bracketL) || // get ["string"]() {} 17614 this.match(types.name) || // get foo() {} 17615 this.state.type.keyword // get debugger() {} 17616 ); 17617 }; 17618 17619 // get methods aren't allowed to have any parameters 17620 // set methods must have exactly 1 parameter 17621 pp$3.checkGetterSetterParamCount = function (method) { 17622 var paramCount = method.kind === "get" ? 0 : 1; 17623 if (method.params.length !== paramCount) { 17624 var start = method.start; 17625 if (method.kind === "get") { 17626 this.raise(start, "getter should have no params"); 17627 } else { 17628 this.raise(start, "setter should have exactly one param"); 17629 } 17630 } 17631 }; 17632 17633 pp$3.parseObjectMethod = function (prop, isGenerator, isAsync, isPattern) { 17634 if (isAsync || isGenerator || this.match(types.parenL)) { 17635 if (isPattern) this.unexpected(); 17636 prop.kind = "method"; 17637 prop.method = true; 17638 this.parseMethod(prop, isGenerator, isAsync); 17639 17640 return this.finishNode(prop, "ObjectMethod"); 17641 } 17642 17643 if (this.isGetterOrSetterMethod(prop, isPattern)) { 17644 if (isGenerator || isAsync) this.unexpected(); 17645 prop.kind = prop.key.name; 17646 this.parsePropertyName(prop); 17647 this.parseMethod(prop); 17648 this.checkGetterSetterParamCount(prop); 17649 17650 return this.finishNode(prop, "ObjectMethod"); 17651 } 17652 }; 17653 17654 pp$3.parseObjectProperty = function (prop, startPos, startLoc, isPattern, refShorthandDefaultPos) { 17655 if (this.eat(types.colon)) { 17656 prop.value = isPattern ? this.parseMaybeDefault(this.state.start, this.state.startLoc) : this.parseMaybeAssign(false, refShorthandDefaultPos); 17657 17658 return this.finishNode(prop, "ObjectProperty"); 17659 } 17660 17661 if (!prop.computed && prop.key.type === "Identifier") { 17662 if (isPattern) { 17663 this.checkReservedWord(prop.key.name, prop.key.start, true, true); 17664 prop.value = this.parseMaybeDefault(startPos, startLoc, prop.key.__clone()); 17665 } else if (this.match(types.eq) && refShorthandDefaultPos) { 17666 if (!refShorthandDefaultPos.start) { 17667 refShorthandDefaultPos.start = this.state.start; 17668 } 17669 prop.value = this.parseMaybeDefault(startPos, startLoc, prop.key.__clone()); 17670 } else { 17671 prop.value = prop.key.__clone(); 17672 } 17673 prop.shorthand = true; 17674 17675 return this.finishNode(prop, "ObjectProperty"); 17676 } 17677 }; 17678 17679 pp$3.parseObjPropValue = function (prop, startPos, startLoc, isGenerator, isAsync, isPattern, refShorthandDefaultPos) { 17680 var node = this.parseObjectMethod(prop, isGenerator, isAsync, isPattern) || this.parseObjectProperty(prop, startPos, startLoc, isPattern, refShorthandDefaultPos); 17681 17682 if (!node) this.unexpected(); 17683 17684 return node; 17685 }; 17686 17687 pp$3.parsePropertyName = function (prop) { 17688 if (this.eat(types.bracketL)) { 17689 prop.computed = true; 17690 prop.key = this.parseMaybeAssign(); 17691 this.expect(types.bracketR); 17692 } else { 17693 prop.computed = false;
17694 var oldInPropertyName = this.state.inPropertyName; 17695 this.state.inPropertyName = true; 17696 prop.key = this.match(types.num) || this.match(types.string) ? this.parseExprAtom() : this.parseIdentifier(true); 17697 this.state.inPropertyName = oldInPropertyName; 17698 } 17699 return prop.key; 17700 }; 17701 17702 // Initialize empty function node. 17703 17704 pp$3.initFunction = function (node, isAsync) { 17705 node.id = null; 17706 node.generator = false; 17707 node.expression = false; 17708 node.async = !!isAsync; 17709 }; 17710 17711 // Parse object or class method. 17712 17713 pp$3.parseMethod = function (node, isGenerator, isAsync) { 17714 var oldInMethod = this.state.inMethod; 17715 this.state.inMethod = node.kind || true; 17716 this.initFunction(node, isAsync); 17717 this.expect(types.parenL); 17718 node.params = this.parseBindingList(types.parenR); 17719 node.generator = !!isGenerator; 17720 this.parseFunctionBody(node); 17721 this.state.inMethod = oldInMethod; 17722 return node; 17723 }; 17724 17725 // Parse arrow function expression with given parameters. 17726 17727 pp$3.parseArrowExpression = function (node, params, isAsync) { 17728 this.initFunction(node, isAsync); 17729 node.params = this.toAssignableList(params, true, "arrow function parameters"); 17730 this.parseFunctionBody(node, true); 17731 return this.finishNode(node, "ArrowFunctionExpression"); 17732 }; 17733 17734 pp$3.isStrictBody = function (node, isExpression) { 17735 if (!isExpression && node.body.directives.length) { 17736 for (var _iterator2 = node.body.directives, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) { 17737 var _ref2; 17738 17739 if (_isArray2) { 17740 if (_i2 >= _iterator2.length) break; 17741 _ref2 = _iterator2[_i2++]; 17742 } else { 17743 _i2 = _iterator2.next(); 17744 if (_i2.done) break; 17745 _ref2 = _i2.value; 17746 } 17747 17748 var directive = _ref2; 17749 17750 if (directive.value.value === "use strict") { 17751 return true; 17752 } 17753 } 17754 } 17755 17756 return false; 17757 }; 17758 17759 // Parse function body and check parameters. 17760 pp$3.parseFunctionBody = function (node, allowExpression) { 17761 var isExpression = allowExpression && !this.match(types.braceL); 17762 17763 var oldInAsync = this.state.inAsync; 17764 this.state.inAsync = node.async; 17765 if (isExpression) { 17766 node.body = this.parseMaybeAssign(); 17767 node.expression = true; 17768 } else { 17769 // Start a new scope with regard to labels and the `inFunction` 17770 // flag (restore them to their old value afterwards). 17771 var oldInFunc = this.state.inFunction; 17772 var oldInGen = this.state.inGenerator; 17773 var oldLabels = this.state.labels; 17774 this.state.inFunction = true;this.state.inGenerator = node.generator;this.state.labels = []; 17775 node.body = this.parseBlock(true); 17776 node.expression = false; 17777 this.state.inFunction = oldInFunc;this.state.inGenerator = oldInGen;this.state.labels = oldLabels; 17778 } 17779 this.state.inAsync = oldInAsync; 17780 17781 // If this is a strict mode function, verify that argument names 17782 // are not repeated, and it does not try to bind the words `eval` 17783 // or `arguments`. 17784 var isStrict = this.isStrictBody(node, isExpression); 17785 // Also check when allowExpression === true for arrow functions 17786 var checkLVal = this.state.strict || allowExpression || isStrict; 17787 17788 if (isStrict && node.id && node.id.type === "Identifier" && node.id.name === "yield") { 17789 this.raise(node.id.start, "Binding yield in strict mode"); 17790 } 17791 17792 if (checkLVal) { 17793 var nameHash = Object.create(null); 17794 var oldStrict = this.state.strict; 17795 if (isStrict) this.state.strict = true; 17796 if (node.id) { 17797 this.checkLVal(node.id, true, undefined, "function name"); 17798 } 17799 for (var _iterator3 = node.params, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator]();;) { 17800 var _ref3; 17801 17802 if (_isArray3) { 17803 if (_i3 >= _iterator3.length) break; 17804 _ref3 = _iterator3[_i3++]; 17805 } else { 17806 _i3 = _iterator3.next(); 17807 if (_i3.done) break; 17808 _ref3 = _i3.value; 17809 } 17810 17811 var param = _ref3; 17812 17813 if (isStrict && param.type !== "Identifier") { 17814 this.raise(param.start, "Non-simple parameter in strict mode"); 17815 } 17816 this.checkLVal(param, true, nameHash, "function parameter list"); 17817 } 17818 this.state.strict = oldStrict; 17819 } 17820 }; 17821 17822 // Parses a comma-separated list of expressions, and returns them as 17823 // an array. `close` is the token type that ends the list, and 17824 // `allowEmpty` can be turned on to allow subsequent commas with 17825 // nothing in between them to be parsed as `null` (which is needed 17826 // for array literals). 17827 17828 pp$3.parseExprList = function (close, allowEmpty, refShorthandDefaultPos) { 17829 var elts = []; 17830 var first = true; 17831 17832 while (!this.eat(close)) { 17833 if (first) { 17834 first = false;
17835 } else { 17836 this.expect(types.comma); 17837 if (this.eat(close)) break; 17838 } 17839 17840 elts.push(this.parseExprListItem(allowEmpty, refShorthandDefaultPos)); 17841 } 17842 return elts; 17843 }; 17844 17845 pp$3.parseExprListItem = function (allowEmpty, refShorthandDefaultPos, refNeedsArrowPos) { 17846 var elt = void 0; 17847 if (allowEmpty && this.match(types.comma)) { 17848 elt = null; 17849 } else if (this.match(types.ellipsis)) { 17850 elt = this.parseSpread(refShorthandDefaultPos); 17851 } else { 17852 elt = this.parseMaybeAssign(false, refShorthandDefaultPos, this.parseParenItem, refNeedsArrowPos); 17853 } 17854 return elt; 17855 }; 17856 17857 // Parse the next token as an identifier. If `liberal` is true (used 17858 // when parsing properties), it will also convert keywords into 17859 // identifiers. 17860 17861 pp$3.parseIdentifier = function (liberal) { 17862 var node = this.startNode(); 17863 if (!liberal) { 17864 this.checkReservedWord(this.state.value, this.state.start, !!this.state.type.keyword, false); 17865 } 17866 17867 if (this.match(types.name)) { 17868 node.name = this.state.value; 17869 } else if (this.state.type.keyword) { 17870 node.name = this.state.type.keyword; 17871 } else { 17872 this.unexpected(); 17873 } 17874 17875 if (!liberal && node.name === "await" && this.state.inAsync) { 17876 this.raise(node.start, "invalid use of await inside of an async function"); 17877 } 17878 17879 node.loc.identifierName = node.name; 17880 17881 this.next(); 17882 return this.finishNode(node, "Identifier"); 17883 }; 17884 17885 pp$3.checkReservedWord = function (word, startLoc, checkKeywords, isBinding) { 17886 if (this.isReservedWord(word) || checkKeywords && this.isKeyword(word)) { 17887 this.raise(startLoc, word + " is a reserved word"); 17888 } 17889 17890 if (this.state.strict && (reservedWords.strict(word) || isBinding && reservedWords.strictBind(word))) { 17891 this.raise(startLoc, word + " is a reserved word in strict mode"); 17892 } 17893 }; 17894 17895 // Parses await expression inside async function. 17896 17897 pp$3.parseAwait = function (node) { 17898 // istanbul ignore next: this condition is checked at the call site so won't be hit here 17899 if (!this.state.inAsync) { 17900 this.unexpected(); 17901 } 17902 if (this.match(types.star)) { 17903 this.raise(node.start, "await* has been removed from the async functions proposal. Use Promise.all() instead."); 17904 } 17905 node.argument = this.parseMaybeUnary(); 17906 return this.finishNode(node, "AwaitExpression"); 17907 }; 17908 17909 // Parses yield expression inside generator. 17910 17911 pp$3.parseYield = function () { 17912 var node = this.startNode(); 17913 this.next(); 17914 if (this.match(types.semi) || this.canInsertSemicolon() || !this.match(types.star) && !this.state.type.startsExpr) { 17915 node.delegate = false; 17916 node.argument = null; 17917 } else { 17918 node.delegate = this.eat(types.star); 17919 node.argument = this.parseMaybeAssign(); 17920 } 17921 return this.finishNode(node, "YieldExpression"); 17922 }; 17923 17924 // Start an AST node, attaching a start offset. 17925 17926 var pp$4 = Parser.prototype; 17927 var commentKeys = ["leadingComments", "trailingComments", "innerComments"]; 17928 17929 var Node = function () { 17930 function Node(pos, loc, filename) { 17931 classCallCheck(this, Node); 17932 17933 this.type = ""; 17934 this.start = pos; 17935 this.end = 0; 17936 this.loc = new SourceLocation(loc); 17937 if (filename) this.loc.filename = filename; 17938 } 17939 17940 Node.prototype.__clone = function __clone() { 17941 var node2 = new Node(); 17942 for (var key in this) { 17943 // Do not clone comments that are already attached to the node 17944 if (commentKeys.indexOf(key) < 0) { 17945 node2[key] = this[key]; 17946 } 17947 } 17948 17949 return node2; 17950 }; 17951 17952 return Node; 17953 }(); 17954 17955 pp$4.startNode = function () { 17956 return new Node(this.state.start, this.state.startLoc, this.filename); 17957 }; 17958 17959 pp$4.startNodeAt = function (pos, loc) { 17960 return new Node(pos, loc, this.filename); 17961 }; 17962 17963 function finishNodeAt(node, type, pos, loc) { 17964 node.type = type; 17965 node.end = pos; 17966 node.loc.end = loc; 17967 this.processComment(node); 17968 return node; 17969 } 17970 17971 // Finish an AST node, adding `type` and `end` properties. 17972 17973 pp$4.finishNode = function (node, type) { 17974 return finishNodeAt.call(this, node, type, this.state.lastTokEnd, this.state.lastTokEndLoc); 17975 }; 17976
17977 // Finish node at given position 17978 17979 pp$4.finishNodeAt = function (node, type, pos, loc) { 17980 return finishNodeAt.call(this, node, type, pos, loc); 17981 }; 17982 17983 var pp$5 = Parser.prototype; 17984 17985 // This function is used to raise exceptions on parse errors. It 17986 // takes an offset integer (into the current `input`) to indicate 17987 // the location of the error, attaches the position to the end 17988 // of the error message, and then raises a `SyntaxError` with that 17989 // message. 17990 17991 pp$5.raise = function (pos, message) { 17992 var loc = getLineInfo(this.input, pos); 17993 message += " (" + loc.line + ":" + loc.column + ")"; 17994 var err = new SyntaxError(message); 17995 err.pos = pos; 17996 err.loc = loc; 17997 throw err; 17998 }; 17999 18000 /* eslint max-len: 0 */ 18001 18002 /** 18003 * Based on the comment attachment algorithm used in espree and estraverse. 18004 * 18005 * Redistribution and use in source and binary forms, with or without 18006 * modification, are permitted provided that the following conditions are met: 18007 * 18008 * * Redistributions of source code must retain the above copyright 18009 * notice, this list of conditions and the following disclaimer. 18010 * * Redistributions in binary form must reproduce the above copyright 18011 * notice, this list of conditions and the following disclaimer in the 18012 * documentation and/or other materials provided with the distribution. 18013 * 18014 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18015 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18016 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18017 * ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY 18018 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 18019 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 18020 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 18021 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 18022 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 18023 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 18024 */ 18025 18026 function last(stack) { 18027 return stack[stack.length - 1]; 18028 } 18029 18030 var pp$6 = Parser.prototype; 18031 18032 pp$6.addComment = function (comment) { 18033 if (this.filename) comment.loc.filename = this.filename; 18034 this.state.trailingComments.push(comment); 18035 this.state.leadingComments.push(comment); 18036 }; 18037 18038 pp$6.processComment = function (node) { 18039 if (node.type === "Program" && node.body.length > 0) return; 18040 18041 var stack = this.state.commentStack; 18042 18043 var lastChild = void 0, 18044 trailingComments = void 0, 18045 i = void 0, 18046 j = void 0; 18047 18048 if (this.state.trailingComments.length > 0) { 18049 // If the first comment in trailingComments comes after the 18050 // current node, then we're good - all comments in the array will 18051 // come after the node and so it's safe to add them as official 18052 // trailingComments. 18053 if (this.state.trailingComments[0].start >= node.end) { 18054 trailingComments = this.state.trailingComments; 18055 this.state.trailingComments = []; 18056 } else { 18057 // Otherwise, if the first comment doesn't come after the 18058 // current node, that means we have a mix of leading and trailing 18059 // comments in the array and that leadingComments contains the 18060 // same items as trailingComments. Reset trailingComments to 18061 // zero items and we'll handle this by evaluating leadingComments 18062 // later. 18063 this.state.trailingComments.length = 0; 18064 } 18065 } else { 18066 var lastInStack = last(stack); 18067 if (stack.length > 0 && lastInStack.trailingComments && lastInStack.trailingComments[0].start >= node.end) { 18068 trailingComments = lastInStack.trailingComments; 18069 lastInStack.trailingComments = null; 18070 } 18071 } 18072 18073 // Eating the stack. 18074 while (stack.length > 0 && last(stack).start >= node.start) { 18075 lastChild = stack.pop(); 18076 } 18077 18078 if (lastChild) { 18079 if (lastChild.leadingComments) { 18080 if (lastChild !== node && last(lastChild.leadingComments).end <= node.start) { 18081 node.leadingComments = lastChild.leadingComments; 18082 lastChild.leadingComments = null; 18083 } else { 18084 // A leading comment for an anonymous class had been stolen by its first ClassMethod, 18085 // so this takes back the leading comment. 18086 // See also: https://github.com/eslint/espree/issues/158 18087 for (i = lastChild.leadingComments.length - 2; i >= 0; --i) { 18088 if (lastChild.leadingComments[i].end <= node.start) { 18089 node.leadingComments = lastChild.leadingComments.splice(0, i + 1); 18090 break; 18091 } 18092 } 18093 } 18094 } 18095 } else if (this.state.leadingComments.length > 0) { 18096 if (last(this.state.leadingComments).end <= node.start) { 18097 if (this.state.commentPreviousNode) { 18098 for (j = 0; j < this.state.leadingComments.length; j++) { 18099 if (this.state.leadingComments[j].end < this.state.commentPreviousNode.end) { 18100 this.state.leadingComments.splice(j, 1); 18101 j--; 18102 } 18103 } 18104 } 18105 if (this.state.leadingComments.length > 0) { 18106 node.leadingComments = this.state.leadingComments; 18107 this.state.leadingComments = []; 18108 } 18109 } else { 18110 // https://github.com/eslint/espree/issues/2 18111 // 18112 // In special cases, such as return (without a value) and 18113 // debugger, all comments will end up as leadingComments and 18114 // will otherwise be eliminated. This step runs when the
18115 // commentStack is empty and there are comments left 18116 // in leadingComments. 18117 // 18118 // This loop figures out the stopping point between the actual 18119 // leading and trailing comments by finding the location of the 18120 // first comment that comes after the given node. 18121 for (i = 0; i < this.state.leadingComments.length; i++) { 18122 if (this.state.leadingComments[i].end > node.start) { 18123 break; 18124 } 18125 } 18126 18127 // Split the array based on the location of the first comment 18128 // that comes after the node. Keep in mind that this could 18129 // result in an empty array, and if so, the array must be 18130 // deleted. 18131 node.leadingComments = this.state.leadingComments.slice(0, i); 18132 if (node.leadingComments.length === 0) { 18133 node.leadingComments = null; 18134 } 18135 18136 // Similarly, trailing comments are attached later. The variable 18137 // must be reset to null if there are no trailing comments. 18138 trailingComments = this.state.leadingComments.slice(i); 18139 if (trailingComments.length === 0) { 18140 trailingComments = null; 18141 } 18142 } 18143 } 18144 18145 this.state.commentPreviousNode = node; 18146 18147 if (trailingComments) { 18148 if (trailingComments.length && trailingComments[0].start >= node.start && last(trailingComments).end <= node.end) { 18149 node.innerComments = trailingComments; 18150 } else { 18151 node.trailingComments = trailingComments; 18152 } 18153 } 18154 18155 stack.push(node); 18156 }; 18157 18158 var pp$7 = Parser.prototype; 18159 18160 pp$7.estreeParseRegExpLiteral = function (_ref) { 18161 var pattern = _ref.pattern, 18162 flags = _ref.flags; 18163 18164 var regex = null; 18165 try { 18166 regex = new RegExp(pattern, flags); 18167 } catch (e) { 18168 // In environments that don't support these flags value will 18169 // be null as the regex can't be represented natively. 18170 } 18171 var node = this.estreeParseLiteral(regex); 18172 node.regex = { pattern: pattern, flags: flags }; 18173 18174 return node; 18175 }; 18176 18177 pp$7.estreeParseLiteral = function (value) { 18178 return this.parseLiteral(value, "Literal"); 18179 }; 18180 18181 pp$7.directiveToStmt = function (directive) { 18182 var directiveLiteral = directive.value; 18183 18184 var stmt = this.startNodeAt(directive.start, directive.loc.start); 18185 var expression = this.startNodeAt(directiveLiteral.start, directiveLiteral.loc.start); 18186 18187 expression.value = directiveLiteral.value; 18188 expression.raw = directiveLiteral.extra.raw; 18189 18190 stmt.expression = this.finishNodeAt(expression, "Literal", directiveLiteral.end, directiveLiteral.loc.end); 18191 stmt.directive = directiveLiteral.extra.raw.slice(1, -1); 18192 18193 return this.finishNodeAt(stmt, "ExpressionStatement", directive.end, directive.loc.end); 18194 }; 18195 18196 function isSimpleProperty(node) { 18197 return node && node.type === "Property" && node.kind === "init" && node.method === false; 18198 } 18199 18200 var estreePlugin = function estreePlugin(instance) { 18201 instance.extend("checkDeclaration", function (inner) { 18202 return function (node) { 18203 if (isSimpleProperty(node)) { 18204 this.checkDeclaration(node.value); 18205 } else { 18206 inner.call(this, node); 18207 } 18208 }; 18209 }); 18210 18211 instance.extend("checkGetterSetterParamCount", function () { 18212 return function (prop) { 18213 var paramCount = prop.kind === "get" ? 0 : 1; 18214 if (prop.value.params.length !== paramCount) { 18215 var start = prop.start; 18216 if (prop.kind === "get") { 18217 this.raise(start, "getter should have no params"); 18218 } else { 18219 this.raise(start, "setter should have exactly one param"); 18220 } 18221 } 18222 }; 18223 }); 18224 18225 instance.extend("checkLVal", function (inner) { 18226 return function (expr, isBinding, checkClashes) { 18227 var _this = this; 18228 18229 switch (expr.type) { 18230 case "ObjectPattern": 18231 expr.properties.forEach(function (prop) { 18232 _this.checkLVal(prop.type === "Property" ? prop.value : prop, isBinding, checkClashes, "object destructuring pattern"); 18233 }); 18234 break; 18235 default: 18236 for (var _len = arguments.length, args = Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) { 18237 args[_key - 3] = arguments[_key]; 18238 } 18239 18240 inner.call.apply(inner, [this, expr, isBinding, checkClashes].concat(args)); 18241 } 18242 }; 18243 }); 18244 18245 instance.extend("checkPropClash", function () { 18246 return function (prop, propHash) { 18247 if (prop.computed || !isSimpleProperty(prop)) return; 18248 18249 var key = prop.key; 18250 // It is either an Identifier or a String/NumericLiteral 18251 var name = key.type === "Identifier" ? key.name : String(key.value); 18252 18253 if (name === "__proto__") { 18254 if (propHash.proto) this.raise(key.start, "Redefinition of __proto__ property"); 18255 propHash.proto = true; 18256 } 18257 }; 18258 }); 18259 18260 instance.extend("isStrictBody", function () { 18261 return function (node, isExpression) { 18262 if (!isExpression && node.body.body.length > 0) {
18263 for (var _iterator = node.body.body, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { 18264 var _ref2; 18265 18266 if (_isArray) { 18267 if (_i >= _iterator.length) break; 18268 _ref2 = _iterator[_i++]; 18269 } else { 18270 _i = _iterator.next(); 18271 if (_i.done) break; 18272 _ref2 = _i.value; 18273 } 18274 18275 var directive = _ref2; 18276 18277 if (directive.type === "ExpressionStatement" && directive.expression.type === "Literal") { 18278 if (directive.expression.value === "use strict") return true; 18279 } else { 18280 // Break for the first non literal expression 18281 break; 18282 } 18283 } 18284 } 18285 18286 return false; 18287 }; 18288 }); 18289 18290 instance.extend("isValidDirective", function () { 18291 return function (stmt) { 18292 return stmt.type === "ExpressionStatement" && stmt.expression.type === "Literal" && typeof stmt.expression.value === "string" && (!stmt.expression.extra || !stmt.expression.extra.parenthesized); 18293 }; 18294 }); 18295 18296 instance.extend("parseBlockBody", function (inner) { 18297 return function (node) { 18298 var _this2 = this; 18299 18300 for (var _len2 = arguments.length, args = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { 18301 args[_key2 - 1] = arguments[_key2]; 18302 } 18303 18304 inner.call.apply(inner, [this, node].concat(args)); 18305 18306 node.directives.reverse().forEach(function (directive) { 18307 node.body.unshift(_this2.directiveToStmt(directive)); 18308 }); 18309 delete node.directives; 18310 }; 18311 }); 18312 18313 instance.extend("parseClassMethod", function (inner) { 18314 return function (classBody) { 18315 for (var _len3 = arguments.length, args = Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) { 18316 args[_key3 - 1] = arguments[_key3]; 18317 } 18318 18319 inner.call.apply(inner, [this, classBody].concat(args)); 18320 18321 var body = classBody.body; 18322 body[body.length - 1].type = "MethodDefinition"; 18323 }; 18324 }); 18325 18326 instance.extend("parseExprAtom", function (inner) { 18327 return function () { 18328 switch (this.state.type) { 18329 case types.regexp: 18330 return this.estreeParseRegExpLiteral(this.state.value); 18331 18332 case types.num: 18333 case types.string: 18334 return this.estreeParseLiteral(this.state.value); 18335 18336 case types._null: 18337 return this.estreeParseLiteral(null); 18338 18339 case types._true: 18340 return this.estreeParseLiteral(true); 18341 18342 case types._false: 18343 return this.estreeParseLiteral(false); 18344 18345 default: 18346 for (var _len4 = arguments.length, args = Array(_len4), _key4 = 0; _key4 < _len4; _key4++) { 18347 args[_key4] = arguments[_key4]; 18348 } 18349 18350 return inner.call.apply(inner, [this].concat(args)); 18351 } 18352 }; 18353 }); 18354 18355 instance.extend("parseLiteral", function (inner) { 18356 return function () { 18357 for (var _len5 = arguments.length, args = Array(_len5), _key5 = 0; _key5 < _len5; _key5++) { 18358 args[_key5] = arguments[_key5]; 18359 } 18360 18361 var node = inner.call.apply(inner, [this].concat(args)); 18362 node.raw = node.extra.raw; 18363 delete node.extra; 18364 18365 return node; 18366 }; 18367 }); 18368 18369 instance.extend("parseMethod", function (inner) { 18370 return function (node) { 18371 var funcNode = this.startNode(); 18372 funcNode.kind = node.kind; // provide kind, so inner method correctly sets state 18373 18374 for (var _len6 = arguments.length, args = Array(_len6 > 1 ? _len6 - 1 : 0), _key6 = 1; _key6 < _len6; _key6++) { 18375 args[_key6 - 1] = arguments[_key6]; 18376 } 18377 18378 funcNode = inner.call.apply(inner, [this, funcNode].concat(args)); 18379 delete funcNode.kind; 18380 node.value = this.finishNode(funcNode, "FunctionExpression"); 18381 18382 return node; 18383 }; 18384 }); 18385 18386 instance.extend("parseObjectMethod", function (inner) { 18387 return function () { 18388 for (var _len7 = arguments.length, args = Array(_len7), _key7 = 0; _key7 < _len7; _key7++) { 18389 args[_key7] = arguments[_key7]; 18390 } 18391 18392 var node = inner.call.apply(inner, [this].concat(args)); 18393 18394 if (node) { 18395 if (node.kind === "method") node.kind = "init"; 18396 node.type = "Property"; 18397 } 18398 18399 return node; 18400 }; 18401 }); 18402 18403 instance.extend("parseObjectProperty", function (inner) { 18404 return function () { 18405 for (var _len8 = arguments.length, args = Array(_len8), _key8 = 0; _key8 < _len8; _key8++) { 18406 args[_key8] = arguments[_key8]; 18407 } 18408 18409 var node = inner.call.apply(inner, [this].concat(args)); 18410 18411 if (node) { 18412 node.kind = "init"; 18413 node.type = "Property"; 18414 } 18415 18416 return node; 18417 }; 18418 }); 18419 18420 instance.extend("toAssignable", function (inner) { 18421 return function (node, isBinding) { 18422 for (var _len9 = arguments.length, args = Array(_len9 > 2 ? _len9 - 2 : 0), _key9 = 2; _key9 < _len9; _key9++) { 18423 args[_key9 - 2] = arguments[_key9]; 18424 } 18425 18426 if (isSimpleProperty(node)) { 18427 this.toAssignable.apply(this, [node.value, isBinding].concat(args)); 18428 18429 return node; 18430 } else if (node.type === "ObjectExpression") { 18431 node.type = "ObjectPattern"; 18432 for (var _iterator2 = node.properties, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) { 18433 var _ref3; 18434 18435 if (_isArray2) { 18436 if (_i2 >= _iterator2.length) break; 18437 _ref3 = _iterator2[_i2++]; 18438 } else { 18439 _i2 = _iterator2.next(); 18440 if (_i2.done) break; 18441 _ref3 = _i2.value; 18442 } 18443 18444 var prop = _ref3; 18445
18446 if (prop.kind === "get" || prop.kind === "set") { 18447 this.raise(prop.key.start, "Object pattern can't contain getter or setter"); 18448 } else if (prop.method) { 18449 this.raise(prop.key.start, "Object pattern can't contain methods"); 18450 } else { 18451 this.toAssignable(prop, isBinding, "object destructuring pattern"); 18452 } 18453 } 18454 18455 return node; 18456 } 18457 18458 return inner.call.apply(inner, [this, node, isBinding].concat(args)); 18459 }; 18460 }); 18461 }; 18462 18463 /* eslint max-len: 0 */ 18464 18465 var primitiveTypes = ["any", "mixed", "empty", "bool", "boolean", "number", "string", "void", "null"]; 18466 18467 var pp$8 = Parser.prototype; 18468 18469 pp$8.flowParseTypeInitialiser = function (tok) { 18470 var oldInType = this.state.inType; 18471 this.state.inType = true; 18472 this.expect(tok || types.colon); 18473 18474 var type = this.flowParseType(); 18475 this.state.inType = oldInType; 18476 return type; 18477 }; 18478 18479 pp$8.flowParsePredicate = function () { 18480 var node = this.startNode(); 18481 var moduloLoc = this.state.startLoc; 18482 var moduloPos = this.state.start; 18483 this.expect(types.modulo); 18484 var checksLoc = this.state.startLoc; 18485 this.expectContextual("checks"); 18486 // Force '%' and 'checks' to be adjacent 18487 if (moduloLoc.line !== checksLoc.line || moduloLoc.column !== checksLoc.column - 1) { 18488 this.raise(moduloPos, "Spaces between ´%´ and ´checks´ are not allowed here."); 18489 } 18490 if (this.eat(types.parenL)) { 18491 node.expression = this.parseExpression(); 18492 this.expect(types.parenR); 18493 return this.finishNode(node, "DeclaredPredicate"); 18494 } else { 18495 return this.finishNode(node, "InferredPredicate"); 18496 } 18497 }; 18498 18499 pp$8.flowParseTypeAndPredicateInitialiser = function () { 18500 var oldInType = this.state.inType; 18501 this.state.inType = true; 18502 this.expect(types.colon); 18503 var type = null; 18504 var predicate = null; 18505 if (this.match(types.modulo)) { 18506 this.state.inType = oldInType; 18507 predicate = this.flowParsePredicate(); 18508 } else { 18509 type = this.flowParseType(); 18510 this.state.inType = oldInType; 18511 if (this.match(types.modulo)) { 18512 predicate = this.flowParsePredicate(); 18513 } 18514 } 18515 return [type, predicate]; 18516 }; 18517 18518 pp$8.flowParseDeclareClass = function (node) { 18519 this.next(); 18520 this.flowParseInterfaceish(node, true); 18521 return this.finishNode(node, "DeclareClass"); 18522 }; 18523 18524 pp$8.flowParseDeclareFunction = function (node) { 18525 this.next(); 18526 18527 var id = node.id = this.parseIdentifier(); 18528 18529 var typeNode = this.startNode(); 18530 var typeContainer = this.startNode(); 18531 18532 if (this.isRelational("<")) { 18533 typeNode.typeParameters = this.flowParseTypeParameterDeclaration(); 18534 } else { 18535 typeNode.typeParameters = null; 18536 } 18537 18538 this.expect(types.parenL); 18539 var tmp = this.flowParseFunctionTypeParams(); 18540 typeNode.params = tmp.params; 18541 typeNode.rest = tmp.rest; 18542 this.expect(types.parenR); 18543 var predicate = null; 18544 18545 var _flowParseTypeAndPred = this.flowParseTypeAndPredicateInitialiser(); 18546 18547 typeNode.returnType = _flowParseTypeAndPred[0]; 18548 predicate = _flowParseTypeAndPred[1]; 18549 18550 typeContainer.typeAnnotation = this.finishNode(typeNode, "FunctionTypeAnnotation"); 18551 typeContainer.predicate = predicate; 18552 id.typeAnnotation = this.finishNode(typeContainer, "TypeAnnotation"); 18553 18554 this.finishNode(id, id.type); 18555 18556 this.semicolon(); 18557 18558 return this.finishNode(node, "DeclareFunction"); 18559 }; 18560 18561 pp$8.flowParseDeclare = function (node) { 18562 if (this.match(types._class)) { 18563 return this.flowParseDeclareClass(node); 18564 } else if (this.match(types._function)) { 18565 return this.flowParseDeclareFunction(node); 18566 } else if (this.match(types._var)) { 18567 return this.flowParseDeclareVariable(node); 18568 } else if (this.isContextual("module")) { 18569 if (this.lookahead().type === types.dot) { 18570 return this.flowParseDeclareModuleExports(node); 18571 } else { 18572 return this.flowParseDeclareModule(node); 18573 } 18574 } else if (this.isContextual("type")) { 18575 return this.flowParseDeclareTypeAlias(node); 18576 } else if (this.isContextual("interface")) { 18577 return this.flowParseDeclareInterface(node); 18578 } else { 18579 this.unexpected(); 18580 } 18581 }; 18582 18583 pp$8.flowParseDeclareVariable = function (node) { 18584 this.next(); 18585 node.id = this.flowParseTypeAnnotatableIdentifier(); 18586 this.semicolon(); 18587 return this.finishNode(node, "DeclareVariable"); 18588 }; 18589 18590 pp$8.flowParseDeclareModule = function (node) { 18591 this.next(); 18592 18593 if (this.match(types.string)) { 18594 node.id = this.parseExprAtom(); 18595 } else { 18596 node.id = this.parseIdentifier(); 18597 } 18598 18599 var bodyNode = node.body = this.startNode(); 18600 var body = bodyNode.body = []; 18601 this.expect(types.braceL); 18602 while (!this.match(types.braceR)) { 18603 var _bodyNode = this.startNode(); 18604 18605 if (this.match(types._import)) { 18606 var lookahead = this.lookahead(); 18607 if (lookahead.value !== "type" && lookahead.value !== "typeof") { 18608 this.unexpected(null, "Imports within a `declare module` body must al
18608ways be `import type` or `import typeof`"); 18609 } 18610 18611 this.parseImport(_bodyNode); 18612 } else { 18613 this.expectContextual("declare", "Only declares and type imports are allowed inside declare module"); 18614 18615 _bodyNode = this.flowParseDeclare(_bodyNode, true); 18616 } 18617 18618 body.push(_bodyNode); 18619 } 18620 this.expect(types.braceR); 18621 18622 this.finishNode(bodyNode, "BlockStatement"); 18623 return this.finishNode(node, "DeclareModule"); 18624 }; 18625 18626 pp$8.flowParseDeclareModuleExports = function (node) { 18627 this.expectContextual("module"); 18628 this.expect(types.dot); 18629 this.expectContextual("exports"); 18630 node.typeAnnotation = this.flowParseTypeAnnotation(); 18631 this.semicolon(); 18632 18633 return this.finishNode(node, "DeclareModuleExports"); 18634 }; 18635 18636 pp$8.flowParseDeclareTypeAlias = function (node) { 18637 this.next(); 18638 this.flowParseTypeAlias(node); 18639 return this.finishNode(node, "DeclareTypeAlias"); 18640 }; 18641 18642 pp$8.flowParseDeclareInterface = function (node) { 18643 this.next(); 18644 this.flowParseInterfaceish(node); 18645 return this.finishNode(node, "DeclareInterface"); 18646 }; 18647 18648 // Interfaces 18649 18650 pp$8.flowParseInterfaceish = function (node, allowStatic) { 18651 node.id = this.parseIdentifier(); 18652 18653 if (this.isRelational("<")) { 18654 node.typeParameters = this.flowParseTypeParameterDeclaration(); 18655 } else { 18656 node.typeParameters = null; 18657 } 18658 18659 node.extends = []; 18660 node.mixins = []; 18661 18662 if (this.eat(types._extends)) { 18663 do { 18664 node.extends.push(this.flowParseInterfaceExtends()); 18665 } while (this.eat(types.comma)); 18666 } 18667 18668 if (this.isContextual("mixins")) { 18669 this.next(); 18670 do { 18671 node.mixins.push(this.flowParseInterfaceExtends()); 18672 } while (this.eat(types.comma)); 18673 } 18674 18675 node.body = this.flowParseObjectType(allowStatic); 18676 }; 18677 18678 pp$8.flowParseInterfaceExtends = function () { 18679 var node = this.startNode(); 18680 18681 node.id = this.flowParseQualifiedTypeIdentifier(); 18682 if (this.isRelational("<")) { 18683 node.typeParameters = this.flowParseTypeParameterInstantiation(); 18684 } else { 18685 node.typeParameters = null; 18686 } 18687 18688 return this.finishNode(node, "InterfaceExtends"); 18689 }; 18690 18691 pp$8.flowParseInterface = function (node) { 18692 this.flowParseInterfaceish(node, false); 18693 return this.finishNode(node, "InterfaceDeclaration"); 18694 }; 18695 18696 pp$8.flowParseRestrictedIdentifier = function (liberal) { 18697 if (primitiveTypes.indexOf(this.state.value) > -1) { 18698 this.raise(this.state.start, "Cannot overwrite primitive type " + this.state.value); 18699 } 18700 18701 return this.parseIdentifier(liberal); 18702 }; 18703 18704 // Type aliases 18705 18706 pp$8.flowParseTypeAlias = function (node) { 18707 node.id = this.flowParseRestrictedIdentifier(); 18708 18709 if (this.isRelational("<")) { 18710 node.typeParameters = this.flowParseTypeParameterDeclaration(); 18711 } else { 18712 node.typeParameters = null; 18713 } 18714 18715 node.right = this.flowParseTypeInitialiser(types.eq); 18716 this.semicolon(); 18717 18718 return this.finishNode(node, "TypeAlias"); 18719 }; 18720 18721 // Type annotations 18722 18723 pp$8.flowParseTypeParameter = function () { 18724 var node = this.startNode(); 18725 18726 var variance = this.flowParseVariance(); 18727 18728 var ident = this.flowParseTypeAnnotatableIdentifier(); 18729 node.name = ident.name; 18730 node.variance = variance; 18731 node.bound = ident.typeAnnotation; 18732 18733 if (this.match(types.eq)) { 18734 this.eat(types.eq); 18735 node.default = this.flowParseType(); 18736 } 18737 18738 return this.finishNode(node, "TypeParameter"); 18739 }; 18740 18741 pp$8.flowParseTypeParameterDeclaration = function () { 18742 var oldInType = this.state.inType; 18743 var node = this.startNode(); 18744 node.params = []; 18745 18746 this.state.inType = true; 18747 18748 // istanbul ignore else: this condition is already checked at all call sites 18749 if (this.isRelational("<") || this.match(types.jsxTagStart)) { 18750 this.next(); 18751 } else { 18752 this.unexpected(); 18753 } 18754 18755 do { 18756 node.params.push(this.flowParseTypeParameter()); 18757 if (!this.isRelational(">")) { 18758 this.expect(types.comma); 18759 } 18760 } while (!this.isRelational(">")); 18761 this.expectRelational(">"); 18762 18763 this.state.inType = oldInType; 18764 18765 return this.finishNode(node, "TypeParameterDeclaration"); 18766 }; 18767 18768 pp$8.flowParseTypeParameterInstantiation = function () { 18769 var node = this.startNode(); 18770 var oldInType = this.state.inType; 18771 node.params = []; 18772 18773 this.state.inType = true; 18774 18775 this.expectRelational("<"); 18776 while (!this.isRelational(">")) { 18777 node.params.push(this.flowParseType()); 18778 if (!this.isRelational(">")) { 18779 this.expect(types.comma); 18780 } 18781 } 18782 this.expectRelational(">"); 18783 18784 this.state.inType = oldInType; 18785 18786 return this.finishNode(node, "TypeParameterInstantiation"); 18787 }; 18788 18789 pp$8.flowParseObjectPropertyKey = function () { 18790 return this.match(types.num) || this.match(types.string) ? this.parseExprAtom() : this.parseIdentifier(true); 18791 }; 18792 18793 pp$8.flowParseObjectTypeIndexer = function (node, isStatic, variance) { 18794 node.static = isStatic; 18795 18796 this.expect(types.bracketL); 18797 if (this.lookahead().type === types.colon) { 18798 node.id = this.flowParseObjectPropertyKey(); 18799 node.key = this.flowParseTypeInitialiser(); 18800 } else { 18801 node.id = null; 18802 node.key = this.flowParseType(); 18803 } 18804 this.expect(types.bracketR); 18805 node.value = this.flowParseTypeInitialiser(); 18806 node.variance = variance; 18807 18808 this.flowObjectTypeSemicolon(); 18809 return this.finishNode(node, "ObjectTypeIndexer"); 18810 }; 18811 18812 pp$8.flowParseObjectTypeMethodish = function (node) { 18813 node.params = []; 18814 node.rest = null; 18815 node.typeParameters = null; 18816 18817 if (this.isRelational("<")) { 18818 node.typeParameters = this.flowParseTypeParameterDeclaration(); 18819 } 18820 18821 this.expect(types.parenL); 18822 while (this.match(types.name)) { 18823 node.params.push(this.flowParseFunctionTypeParam()); 18824 if (!this.match(types.parenR)) { 18825 this.expect(types.comma); 18826 } 18827 } 18828 18829 if (this.eat(types.ellipsis)) { 18830 node.rest = this.flowParseFunctionTypeParam(); 18831 } 18832 this.expect(types.parenR); 18833 node.returnType = this.flowParseTypeInitialiser(); 18834 18835 return this.finishNode(node, "FunctionTypeAnnotation"); 18836 }; 18837 18838 pp$8.flowParseObjectTypeMethod = function (startPos, startLoc, isStatic, key) { 18839 var node = this.startNodeAt(startPos, startLoc); 18840 node.value = this.flowParseObjectTypeMethodish(this.startNodeAt(startPos, startLoc)); 18841 node.static = isStatic; 18842 node.key = key; 18843 node.optional = false;
18844 this.flowObjectTypeSemicolon(); 18845 return this.finishNode(node, "ObjectTypeProperty"); 18846 }; 18847 18848 pp$8.flowParseObjectTypeCallProperty = function (node, isStatic) { 18849 var valueNode = this.startNode(); 18850 node.static = isStatic; 18851 node.value = this.flowParseObjectTypeMethodish(valueNode); 18852 this.flowObjectTypeSemicolon(); 18853 return this.finishNode(node, "ObjectTypeCallProperty"); 18854 }; 18855 18856 pp$8.flowParseObjectType = function (allowStatic, allowExact) { 18857 var oldInType = this.state.inType; 18858 this.state.inType = true; 18859 18860 var nodeStart = this.startNode(); 18861 var node = void 0; 18862 var propertyKey = void 0; 18863 var isStatic = false; 18864 18865 nodeStart.callProperties = []; 18866 nodeStart.properties = []; 18867 nodeStart.indexers = []; 18868 18869 var endDelim = void 0; 18870 var exact = void 0; 18871 if (allowExact && this.match(types.braceBarL)) { 18872 this.expect(types.braceBarL); 18873 endDelim = types.braceBarR; 18874 exact = true; 18875 } else { 18876 this.expect(types.braceL); 18877 endDelim = types.braceR; 18878 exact = false; 18879 } 18880 18881 nodeStart.exact = exact; 18882 18883 while (!this.match(endDelim)) { 18884 var optional = false;
18885 var startPos = this.state.start; 18886 var startLoc = this.state.startLoc; 18887 node = this.startNode(); 18888 if (allowStatic && this.isContextual("static") && this.lookahead().type !== types.colon) { 18889 this.next(); 18890 isStatic = true; 18891 } 18892 18893 var variancePos = this.state.start; 18894 var variance = this.flowParseVariance(); 18895 18896 if (this.match(types.bracketL)) { 18897 nodeStart.indexers.push(this.flowParseObjectTypeIndexer(node, isStatic, variance)); 18898 } else if (this.match(types.parenL) || this.isRelational("<")) { 18899 if (variance) { 18900 this.unexpected(variancePos); 18901 } 18902 nodeStart.callProperties.push(this.flowParseObjectTypeCallProperty(node, isStatic)); 18903 } else { 18904 propertyKey = this.flowParseObjectPropertyKey(); 18905 if (this.isRelational("<") || this.match(types.parenL)) { 18906 // This is a method property 18907 if (variance) { 18908 this.unexpected(variancePos); 18909 } 18910 nodeStart.properties.push(this.flowParseObjectTypeMethod(startPos, startLoc, isStatic, propertyKey)); 18911 } else { 18912 if (this.eat(types.question)) { 18913 optional = true; 18914 } 18915 node.key = propertyKey; 18916 node.value = this.flowParseTypeInitialiser(); 18917 node.optional = optional; 18918 node.static = isStatic; 18919 node.variance = variance; 18920 this.flowObjectTypeSemicolon(); 18921 nodeStart.properties.push(this.finishNode(node, "ObjectTypeProperty")); 18922 } 18923 } 18924 18925 isStatic = false; 18926 } 18927 18928 this.expect(endDelim); 18929 18930 var out = this.finishNode(nodeStart, "ObjectTypeAnnotation"); 18931 18932 this.state.inType = oldInType; 18933 18934 return out; 18935 }; 18936 18937 pp$8.flowObjectTypeSemicolon = function () { 18938 if (!this.eat(types.semi) && !this.eat(types.comma) && !this.match(types.braceR) && !this.match(types.braceBarR)) { 18939 this.unexpected(); 18940 } 18941 }; 18942 18943 pp$8.flowParseQualifiedTypeIdentifier = function (startPos, startLoc, id) { 18944 startPos = startPos || this.state.start; 18945 startLoc = startLoc || this.state.startLoc; 18946 var node = id || this.parseIdentifier(); 18947 18948 while (this.eat(types.dot)) { 18949 var node2 = this.startNodeAt(startPos, startLoc); 18950 node2.qualification = node; 18951 node2.id = this.parseIdentifier(); 18952 node = this.finishNode(node2, "QualifiedTypeIdentifier"); 18953 } 18954 18955 return node; 18956 }; 18957 18958 pp$8.flowParseGenericType = function (startPos, startLoc, id) { 18959 var node = this.startNodeAt(startPos, startLoc); 18960 18961 node.typeParameters = null; 18962 node.id = this.flowParseQualifiedTypeIdentifier(startPos, startLoc, id); 18963 18964 if (this.isRelational("<")) { 18965 node.typeParameters = this.flowParseTypeParameterInstantiation(); 18966 } 18967 18968 return this.finishNode(node, "GenericTypeAnnotation"); 18969 }; 18970 18971 pp$8.flowParseTypeofType = function () { 18972 var node = this.startNode(); 18973 this.expect(types._typeof); 18974 node.argument = this.flowParsePrimaryType(); 18975 return this.finishNode(node, "TypeofTypeAnnotation"); 18976 }; 18977 18978 pp$8.flowParseTupleType = function () { 18979 var node = this.startNode(); 18980 node.types = []; 18981 this.expect(types.bracketL); 18982 // We allow trailing commas 18983 while (this.state.pos < this.input.length && !this.match(types.bracketR)) { 18984 node.types.push(this.flowParseType()); 18985 if (this.match(types.bracketR)) break; 18986 this.expect(types.comma); 18987 } 18988 this.expect(types.bracketR); 18989 return this.finishNode(node, "TupleTypeAnnotation"); 18990 }; 18991 18992 pp$8.flowParseFunctionTypeParam = function () { 18993 var name = null; 18994 var optional = false;
18995 var typeAnnotation = null; 18996 var node = this.startNode(); 18997 var lh = this.lookahead(); 18998 if (lh.type === types.colon || lh.type === types.question) { 18999 name = this.parseIdentifier(); 19000 if (this.eat(types.question)) { 19001 optional = true; 19002 } 19003 typeAnnotation = this.flowParseTypeInitialiser(); 19004 } else { 19005 typeAnnotation = this.flowParseType(); 19006 } 19007 node.name = name; 19008 node.optional = optional; 19009 node.typeAnnotation = typeAnnotation; 19010 return this.finishNode(node, "FunctionTypeParam"); 19011 }; 19012 19013 pp$8.reinterpretTypeAsFunctionTypeParam = function (type) { 19014 var node = this.startNodeAt(type.start, type.loc); 19015 node.name = null; 19016 node.optional = false; 19017 node.typeAnnotation = type; 19018 return this.finishNode(node, "FunctionTypeParam"); 19019 }; 19020 19021 pp$8.flowParseFunctionTypeParams = function () { 19022 var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; 19023 19024 var ret = { params: params, rest: null }; 19025 while (!this.match(types.parenR) && !this.match(types.ellipsis)) { 19026 ret.params.push(this.flowParseFunctionTypeParam()); 19027 if (!this.match(types.parenR)) { 19028 this.expect(types.comma); 19029 } 19030 } 19031 if (this.eat(types.ellipsis)) { 19032 ret.rest = this.flowParseFunctionTypeParam(); 19033 } 19034 return ret; 19035 }; 19036 19037 pp$8.flowIdentToTypeAnnotation = function (startPos, startLoc, node, id) { 19038 switch (id.name) { 19039 case "any": 19040 return this.finishNode(node, "AnyTypeAnnotation"); 19041 19042 case "void": 19043 return this.finishNode(node, "VoidTypeAnnotation"); 19044 19045 case "bool": 19046 case "boolean": 19047 return this.finishNode(node, "BooleanTypeAnnotation"); 19048 19049 case "mixed": 19050 return this.finishNode(node, "MixedTypeAnnotation"); 19051 19052 case "empty": 19053 return this.finishNode(node, "EmptyTypeAnnotation"); 19054 19055 case "number": 19056 return this.finishNode(node, "NumberTypeAnnotation"); 19057 19058 case "string": 19059 return this.finishNode(node, "StringTypeAnnotation"); 19060 19061 default: 19062 return this.flowParseGenericType(startPos, startLoc, id); 19063 } 19064 }; 19065 19066 // The parsing of types roughly parallels the parsing of expressions, and 19067 // primary types are kind of like primary expressions...they're the 19068 // primitives with which other types are constructed. 19069 pp$8.flowParsePrimaryType = function () { 19070 var startPos = this.state.start; 19071 var startLoc = this.state.startLoc; 19072 var node = this.startNode(); 19073 var tmp = void 0; 19074 var type = void 0; 19075 var isGroupedType = false;
19076 var oldNoAnonFunctionType = this.state.noAnonFunctionType; 19077 19078 switch (this.state.type) { 19079 case types.name: 19080 return this.flowIdentToTypeAnnotation(startPos, startLoc, node, this.parseIdentifier()); 19081 19082 case types.braceL: 19083 return this.flowParseObjectType(false, false); 19084 19085 case types.braceBarL: 19086 return this.flowParseObjectType(false, true); 19087 19088 case types.bracketL: 19089 return this.flowParseTupleType(); 19090 19091 case types.relational: 19092 if (this.state.value === "<") { 19093 node.typeParameters = this.flowParseTypeParameterDeclaration(); 19094 this.expect(types.parenL); 19095 tmp = this.flowParseFunctionTypeParams(); 19096 node.params = tmp.params; 19097 node.rest = tmp.rest; 19098 this.expect(types.parenR); 19099 19100 this.expect(types.arrow); 19101 19102 node.returnType = this.flowParseType(); 19103 19104 return this.finishNode(node, "FunctionTypeAnnotation"); 19105 } 19106 break; 19107 19108 case types.parenL: 19109 this.next(); 19110 19111 // Check to see if this is actually a grouped type 19112 if (!this.match(types.parenR) && !this.match(types.ellipsis)) { 19113 if (this.match(types.name)) { 19114 var token = this.lookahead().type; 19115 isGroupedType = token !== types.question && token !== types.colon; 19116 } else { 19117 isGroupedType = true; 19118 } 19119 } 19120 19121 if (isGroupedType) { 19122 this.state.noAnonFunctionType = false;
19123 type = this.flowParseType(); 19124 this.state.noAnonFunctionType = oldNoAnonFunctionType; 19125 19126 // A `,` or a `) =>` means this is an anonymous function type 19127 if (this.state.noAnonFunctionType || !(this.match(types.comma) || this.match(types.parenR) && this.lookahead().type === types.arrow)) { 19128 this.expect(types.parenR); 19129 return type; 19130 } else { 19131 // Eat a comma if there is one 19132 this.eat(types.comma); 19133 } 19134 } 19135 19136 if (type) { 19137 tmp = this.flowParseFunctionTypeParams([this.reinterpretTypeAsFunctionTypeParam(type)]); 19138 } else { 19139 tmp = this.flowParseFunctionTypeParams(); 19140 } 19141 19142 node.params = tmp.params; 19143 node.rest = tmp.rest; 19144 19145 this.expect(types.parenR); 19146 19147 this.expect(types.arrow); 19148 19149 node.returnType = this.flowParseType(); 19150 19151 node.typeParameters = null; 19152 19153 return this.finishNode(node, "FunctionTypeAnnotation"); 19154 19155 case types.string: 19156 return this.parseLiteral(this.state.value, "StringLiteralTypeAnnotation"); 19157 19158 case types._true:case types._false: 19159 node.value = this.match(types._true); 19160 this.next(); 19161 return this.finishNode(node, "BooleanLiteralTypeAnnotation"); 19162 19163 case types.plusMin: 19164 if (this.state.value === "-") { 19165 this.next(); 19166 if (!this.match(types.num)) this.unexpected(null, "Unexpected token, expected number"); 19167 19168 return this.parseLiteral(-this.state.value, "NumericLiteralTypeAnnotation", node.start, node.loc.start); 19169 } 19170 19171 this.unexpected(); 19172 case types.num: 19173 return this.parseLiteral(this.state.value, "NumericLiteralTypeAnnotation"); 19174 19175 case types._null: 19176 node.value = this.match(types._null); 19177 this.next(); 19178 return this.finishNode(node, "NullLiteralTypeAnnotation"); 19179 19180 case types._this: 19181 node.value = this.match(types._this); 19182 this.next(); 19183 return this.finishNode(node, "ThisTypeAnnotation"); 19184 19185 case types.star: 19186 this.next(); 19187 return this.finishNode(node, "ExistentialTypeParam"); 19188 19189 default: 19190 if (this.state.type.keyword === "typeof") { 19191 return this.flowParseTypeofType(); 19192 } 19193 } 19194 19195 this.unexpected(); 19196 }; 19197 19198 pp$8.flowParsePostfixType = function () { 19199 var startPos = this.state.start, 19200 startLoc = this.state.startLoc; 19201 var type = this.flowParsePrimaryType(); 19202 while (!this.canInsertSemicolon() && this.match(types.bracketL)) { 19203 var node = this.startNodeAt(startPos, startLoc); 19204 node.elementType = type; 19205 this.expect(types.bracketL); 19206 this.expect(types.bracketR); 19207 type = this.finishNode(node, "ArrayTypeAnnotation"); 19208 } 19209 return type; 19210 }; 19211 19212 pp$8.flowParsePrefixType = function () { 19213 var node = this.startNode(); 19214 if (this.eat(types.question)) { 19215 node.typeAnnotation = this.flowParsePrefixType(); 19216 return this.finishNode(node, "NullableTypeAnnotation"); 19217 } else { 19218 return this.flowParsePostfixType(); 19219 } 19220 }; 19221 19222 pp$8.flowParseAnonFunctionWithoutParens = function () { 19223 var param = this.flowParsePrefixType(); 19224 if (!this.state.noAnonFunctionType && this.eat(types.arrow)) { 19225 var node = this.startNodeAt(param.start, param.loc); 19226 node.params = [this.reinterpretTypeAsFunctionTypeParam(param)]; 19227 node.rest = null; 19228 node.returnType = this.flowParseType(); 19229 node.typeParameters = null; 19230 return this.finishNode(node, "FunctionTypeAnnotation"); 19231 } 19232 return param; 19233 }; 19234 19235 pp$8.flowParseIntersectionType = function () { 19236 var node = this.startNode(); 19237 this.eat(types.bitwiseAND); 19238 var type = this.flowParseAnonFunctionWithoutParens(); 19239 node.types = [type]; 19240 while (this.eat(types.bitwiseAND)) { 19241 node.types.push(this.flowParseAnonFunctionWithoutParens()); 19242 } 19243 return node.types.length === 1 ? type : this.finishNode(node, "IntersectionTypeAnnotation"); 19244 }; 19245 19246 pp$8.flowParseUnionType = function () { 19247 var node = this.startNode(); 19248 this.eat(types.bitwiseOR); 19249 var type = this.flowParseIntersectionType(); 19250 node.types = [type]; 19251 while (this.eat(types.bitwiseOR)) { 19252 node.types.push(this.flowParseIntersectionType()); 19253 } 19254 return node.types.length === 1 ? type : this.finishNode(node, "UnionTypeAnnotation"); 19255 }; 19256 19257 pp$8.flowParseType = function () { 19258 var oldInType = this.state.inType; 19259 this.state.inType = true; 19260 var type = this.flowParseUnionType(); 19261 this.state.inType = oldInType; 19262 return type; 19263 }; 19264 19265 pp$8.flowParseTypeAnnotation = function () { 19266 var node = this.startNode(); 19267 node.typeAnnotation = this.flowParseTypeInitialiser(); 19268 return this.finishNode(node, "TypeAnnotation"); 19269 }; 19270 19271 pp$8.flowParseTypeAndPredicateAnnotation = function () { 19272 var node = this.startNode(); 19273 19274 var _flowParseTypeAndPred2 = this.flowParseTypeAndPredicateInitialiser(); 19275 19276 node.typeAnnotation = _flowParseTypeAndPred2[0]; 19277 node.predicate = _flowParseTypeAndPred2[1]; 19278 19279 return this.finishNode(node, "TypeAnnotation"); 19280 }; 19281 19282 pp$8.flowParseTypeAnnotatableIdentifier = function () { 19283 var ident = this.flowParseRestrictedIdentifier(); 19284 if (this.match(types.colon)) { 19285 ident.typeAnnotation = this.flowParseTypeAnnotation(); 19286 this.finishNode(ident, ident.type); 19287 } 19288 return ident; 19289 }; 19290 19291 pp$8.typeCastToParameter = function (node) { 19292 node.expression.typeAnnotation = node.typeAnnotation; 19293 19294 return this.finishNodeAt(node.expression, node.expression.type, node.typeAnnotation.end, node.typeAnnotation.loc.end); 19295 }; 19296 19297 pp$8.flowParseVariance = function () { 19298 var variance = null; 19299 if (this.match(types.plusMin)) { 19300 if (this.state.value === "+") { 19301 variance = "plus"; 19302 } else if (this.state.value === "-") { 19303 variance = "minus"; 19304 } 19305 this.next(); 19306 } 19307 return variance; 19308 }; 19309 19310 var flowPlugin = function flowPlugin(instance) { 19311 // plain function return types: function name(): string {} 19312 instance.extend("parseFunctionBody", function (inner) { 19313 return function (node, allowExpression) { 19314 if (this.match(types.colon) && !allowExpression) { 19315 // if allowExpression is true then we're parsing an arrow function and if 19316 // there's a return type then it's been handled elsewhere 19317 node.returnType = this.flowParseTypeAndPredicateAnnotation(); 19318 } 19319 19320 return inner.call(this, node, allowExpression); 19321 }; 19322 }); 19323 19324 // interfaces 19325 instance.extend("parseStatement", function (inner) { 19326 return function (declaration, topLevel) { 19327 // strict mode handling of `interface` since it's a reserved word 19328 if (this.state.strict && this.match(types.name) && this.state.value === "interface") { 19329 var node = this.startNode(); 19330 this.next(); 19331 return this.flowParseInterface(node); 19332 } else { 19333 return inner.call(this, declaration, topLevel); 19334 } 19335 }; 19336 }); 19337 19338 // declares, interfaces and type aliases 19339 instance.extend("parseExpressionStatement", function (inner) { 19340 return function (node, expr) { 19341 if (expr.type === "Identifier") { 19342 if (expr.name === "declare") { 19343 if (this.match(types._class) || this.match(types.name) || this.match(types._function) || this.match(types._var)) { 19344 return this.flowParseDeclare(node); 19345 } 19346 } else if (this.match(types.name)) { 19347 if (expr.name === "interface") { 19348 return this.flowParseInterface(node); 19349 } else if (expr.name === "type") { 19350 return this.flowParseTypeAlias(node); 19351 } 19352 } 19353 } 19354 19355 return inner.call(this, node, expr); 19356 }; 19357 }); 19358 19359 // export type 19360 instance.extend("shouldParseExportDeclaration", function (inner) { 19361 return function () { 19362 return this.isContextual("type") || this.isContextual("interface") || inner.call(this); 19363 }; 19364 }); 19365 19366 instance.extend("parseConditional", function (inner) { 19367 return function (expr, noIn, startPos, startLoc, refNeedsArrowPos) { 19368 // only do the expensive clone if there is a question mark 19369 // and if we come from inside parens 19370 if (refNeedsArrowPos && this.match(types.question)) { 19371 var state = this.state.clone(); 19372 try { 19373 return inner.call(this, expr, noIn, startPos, startLoc); 19374 } catch (err) { 19375 if (err instanceof SyntaxError) { 19376 this.state = state; 19377 refNeedsArrowPos.start = err.pos || this.state.start; 19378 return expr; 19379 } else { 19380 // istanbul ignore next: no such error is expected 19381 throw err; 19382 } 19383 } 19384 } 19385 19386 return inner.call(this, expr, noIn, startPos, startLoc); 19387 }; 19388 }); 19389 19390 instance.extend("parseParenItem", function (inner) { 19391 return function (node, startLoc, startPos) { 19392 node = inner.call(this, node, startLoc, startPos); 19393 if (this.eat(types.question)) { 19394 node.optional = true; 19395 } 19396 19397 if (this.match(types.colon)) {
19398 var typeCastNode = this.startNodeAt(startLoc, startPos); 19399 typeCastNode.expression = node; 19400 typeCastNode.typeAnnotation = this.flowParseTypeAnnotation(); 19401 19402 return this.finishNode(typeCastNode, "TypeCastExpression"); 19403 } 19404 19405 return node; 19406 }; 19407 }); 19408 19409 instance.extend("parseExport", function (inner) { 19410 return function (node) { 19411 node = inner.call(this, node); 19412 if (node.type === "ExportNamedDeclaration") { 19413 node.exportKind = node.exportKind || "value"; 19414 } 19415 return node; 19416 }; 19417 }); 19418 19419 instance.extend("parseExportDeclaration", function (inner) { 19420 return function (node) { 19421 if (this.isContextual("type")) { 19422 node.exportKind = "type"; 19423 19424 var declarationNode = this.startNode(); 19425 this.next(); 19426 19427 if (this.match(types.braceL)) { 19428 // export type { foo, bar }; 19429 node.specifiers = this.parseExportSpecifiers(); 19430 this.parseExportFrom(node); 19431 return null; 19432 } else { 19433 // export type Foo = Bar; 19434 return this.flowParseTypeAlias(declarationNode); 19435 } 19436 } else if (this.isContextual("interface")) { 19437 node.exportKind = "type"; 19438 var _declarationNode = this.startNode(); 19439 this.next(); 19440 return this.flowParseInterface(_declarationNode); 19441 } else { 19442 return inner.call(this, node); 19443 } 19444 }; 19445 }); 19446 19447 instance.extend("parseClassId", function (inner) { 19448 return function (node) { 19449 inner.apply(this, arguments); 19450 if (this.isRelational("<")) { 19451 node.typeParameters = this.flowParseTypeParameterDeclaration(); 19452 } 19453 }; 19454 }); 19455 19456 // don't consider `void` to be a keyword as then it'll use the void token type 19457 // and set startExpr 19458 instance.extend("isKeyword", function (inner) { 19459 return function (name) { 19460 if (this.state.inType && name === "void") { 19461 return false; 19462 } else { 19463 return inner.call(this, name); 19464 } 19465 }; 19466 }); 19467 19468 // ensure that inside flow types, we bypass the jsx parser plugin 19469 instance.extend("readToken", function (inner) { 19470 return function (code) { 19471 if (this.state.inType && (code === 62 || code === 60)) { 19472 return this.finishOp(types.relational, 1); 19473 } else { 19474 return inner.call(this, code); 19475 } 19476 }; 19477 }); 19478 19479 // don't lex any token as a jsx one inside a flow type 19480 instance.extend("jsx_readToken", function (inner) { 19481 return function () { 19482 if (!this.state.inType) return inner.call(this); 19483 }; 19484 }); 19485 19486 instance.extend("toAssignable", function (inner) { 19487 return function (node, isBinding, contextDescription) { 19488 if (node.type === "TypeCastExpression") { 19489 return inner.call(this, this.typeCastToParameter(node), isBinding, contextDescription); 19490 } else { 19491 return inner.call(this, node, isBinding, contextDescription); 19492 } 19493 }; 19494 }); 19495 19496 // turn type casts that we found in function parameter head into type annotated params 19497 instance.extend("toAssignableList", function (inner) { 19498 return function (exprList, isBinding, contextDescription) { 19499 for (var i = 0; i < exprList.length; i++) { 19500 var expr = exprList[i]; 19501 if (expr && expr.type === "TypeCastExpression") { 19502 exprList[i] = this.typeCastToParameter(expr); 19503 } 19504 } 19505 return inner.call(this, exprList, isBinding, contextDescription); 19506 }; 19507 }); 19508 19509 // this is a list of nodes, from something like a call expression, we need to filter the 19510 // type casts that we've found that are illegal in this context 19511 instance.extend("toReferencedList", function () { 19512 return function (exprList) { 19513 for (var i = 0; i < exprList.length; i++) { 19514 var expr = exprList[i]; 19515 if (expr && expr._exprListItem && expr.type === "TypeCastExpression") { 19516 this.raise(expr.start, "Unexpected type cast"); 19517 } 19518 } 19519 19520 return exprList; 19521 }; 19522 }); 19523 19524 // parse an item inside a expression list eg. `(NODE, NODE)` where NODE represents 19525 // the position where this function is called 19526 instance.extend("parseExprListItem", function (inner) { 19527 return function () { 19528 var container = this.startNode(); 19529 19530 for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { 19531 args[_key] = arguments[_key]; 19532 } 19533 19534 var node = inner.call.apply(inner, [this].concat(args)); 19535 if (this.match(types.colon)) { 19536 container._exprListItem = true; 19537 container.expression = node; 19538 container.typeAnnotation = this.flowParseTypeAnnotation(); 19539 return this.finishNode(container, "TypeCastExpression"); 19540 } else { 19541 return node; 19542 } 19543 }; 19544 }); 19545 19546 instance.extend("checkLVal", function (inner) { 19547 return function (node) { 19548 if (node.type !== "TypeCastExpression") { 19549 return inner.apply(this, arguments); 19550 } 19551 }; 19552 }); 19553 19554 // parse class property type annotations 19555 instance.extend("parseClassProperty", function (inner) { 19556 return function (node) { 19557 delete node.variancePos; 19558 if (this.match(types.colon)) { 19559 node.typeAnnotation = this.flowParseTypeAnnotation(); 19560 } 19561 return inner.call(this, node); 19562 }; 19563 }); 19564 19565 // determine whether or not we're currently in the position where a class property w
19565ould appear 19566 instance.extend("isClassProperty", function (inner) { 19567 return function () { 19568 return this.match(types.colon) || inner.call(this); 19569 }; 19570 }); 19571 19572 // parse type parameters for class methods 19573 instance.extend("parseClassMethod", function (inner) { 19574 return function (classBody, method) { 19575 if (method.variance) { 19576 this.unexpected(method.variancePos); 19577 } 19578 delete method.variance; 19579 delete method.variancePos; 19580 if (this.isRelational("<")) { 19581 method.typeParameters = this.flowParseTypeParameterDeclaration(); 19582 } 19583 19584 for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) { 19585 args[_key2 - 2] = arguments[_key2]; 19586 } 19587 19588 inner.call.apply(inner, [this, classBody, method].concat(args)); 19589 }; 19590 }); 19591 19592 // parse a the super class type parameters and implements 19593 instance.extend("parseClassSuper", function (inner) { 19594 return function (node, isStatement) { 19595 inner.call(this, node, isStatement); 19596 if (node.superClass && this.isRelational("<")) { 19597 node.superTypeParameters = this.flowParseTypeParameterInstantiation(); 19598 } 19599 if (this.isContextual("implements")) { 19600 this.next(); 19601 var implemented = node.implements = []; 19602 do { 19603 var _node = this.startNode(); 19604 _node.id = this.parseIdentifier(); 19605 if (this.isRelational("<")) { 19606 _node.typeParameters = this.flowParseTypeParameterInstantiation(); 19607 } else { 19608 _node.typeParameters = null; 19609 } 19610 implemented.push(this.finishNode(_node, "ClassImplements")); 19611 } while (this.eat(types.comma)); 19612 } 19613 }; 19614 }); 19615 19616 instance.extend("parsePropertyName", function (inner) { 19617 return function (node) { 19618 var variancePos = this.state.start; 19619 var variance = this.flowParseVariance(); 19620 var key = inner.call(this, node); 19621 node.variance = variance; 19622 node.variancePos = variancePos; 19623 return key; 19624 }; 19625 }); 19626 19627 // parse type parameters for object method shorthand 19628 instance.extend("parseObjPropValue", function (inner) { 19629 return function (prop) { 19630 if (prop.variance) { 19631 this.unexpected(prop.variancePos); 19632 } 19633 delete prop.variance; 19634 delete prop.variancePos; 19635 19636 var typeParameters = void 0; 19637 19638 // method shorthand 19639 if (this.isRelational("<")) { 19640 typeParameters = this.flowParseTypeParameterDeclaration(); 19641 if (!this.match(types.parenL)) this.unexpected(); 19642 } 19643 19644 inner.apply(this, arguments); 19645 19646 // add typeParameters if we found them 19647 if (typeParameters) { 19648 (prop.value || prop).typeParameters = typeParameters; 19649 } 19650 }; 19651 }); 19652 19653 instance.extend("parseAssignableListItemTypes", function () { 19654 return function (param) { 19655 if (this.eat(types.question)) { 19656 param.optional = true; 19657 } 19658 if (this.match(types.colon)) { 19659 param.typeAnnotation = this.flowParseTypeAnnotation(); 19660 } 19661 this.finishNode(param, param.type); 19662 return param; 19663 }; 19664 }); 19665 19666 instance.extend("parseMaybeDefault", function (inner) { 19667 return function () { 19668 for (var _len3 = arguments.length, args = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { 19669 args[_key3] = arguments[_key3]; 19670 } 19671 19672 var node = inner.apply(this, args); 19673 19674 if (node.type === "AssignmentPattern" && node.typeAnnotation && node.right.start < node.typeAnnotation.start) { 19675 this.raise(node.typeAnnotation.start, "Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`"); 19676 } 19677 19678 return node; 19679 }; 19680 }); 19681 19682 // parse typeof and type imports 19683 instance.extend("parseImportSpecifiers", function (inner) { 19684 return function (node) { 19685 node.importKind = "value"; 19686 19687 var kind = null; 19688 if (this.match(types._typeof)) { 19689 kind = "typeof"; 19690 } else if (this.isContextual("type")) { 19691 kind = "type"; 19692 } 19693 if (kind) { 19694 var lh = this.lookahead(); 19695 if (lh.type === types.name && lh.value !== "from" || lh.type === types.braceL || lh.t
19695ype === types.star) { 19696 this.next(); 19697 node.importKind = kind; 19698 } 19699 } 19700 19701 inner.call(this, node); 19702 }; 19703 }); 19704 19705 // parse import-type/typeof shorthand 19706 instance.extend("parseImportSpecifier", function () { 19707 return function (node) { 19708 var specifier = this.startNode(); 19709 var firstIdentLoc = this.state.start; 19710 var firstIdent = this.parseIdentifier(true); 19711 19712 var specifierTypeKind = null; 19713 if (firstIdent.name === "type") { 19714 specifierTypeKind = "type"; 19715 } else if (firstIdent.name === "typeof") { 19716 specifierTypeKind = "typeof"; 19717 } 19718 19719 var isBinding = false; 19720 if (this.isContextual("as")) { 19721 var as_ident = this.parseIdentifier(true); 19722 if (specifierTypeKind !== null && !this.match(types.name) && !this.state.type.keyword) { 19723 // `import {type as ,` or `import {type as }` 19724 specifier.imported = as_ident; 19725 specifier.importKind = specifierTypeKind; 19726 specifier.local = as_ident.__clone(); 19727 } else { 19728 // `import {type as foo` 19729 specifier.imported = firstIdent; 19730 specifier.importKind = null; 19731 specifier.local = this.parseIdentifier(); 19732 } 19733 } else if (specifierTypeKind !== null && (this.match(types.name) || this.state.type.keyword)) { 19734 // `import {type foo` 19735 specifier.imported = this.parseIdentifier(true); 19736 specifier.importKind = specifierTypeKind; 19737 if (this.eatContextual("as")) { 19738 specifier.local = this.parseIdentifier(); 19739 } else { 19740 isBinding = true; 19741 specifier.local = specifier.imported.__clone(); 19742 } 19743 } else { 19744 isBinding = true; 19745 specifier.imported = firstIdent; 19746 specifier.importKind = null; 19747 specifier.local = specifier.imported.__clone(); 19748 } 19749 19750 if ((node.importKind === "type" || node.importKind === "typeof") && (specifier.importKind === "type" || specifier.importKind === "typeof")) { 19751 this.raise(firstIdentLoc, "`The `type` and `typeof` keywords on named imports can only be used on regular `import` statements. It cannot be used with `import type` or `import typeof` statements`"); 19752 } 19753 19754 if (isBinding) this.checkReservedWord(specifier.local.name, specifier.start, true, true); 19755 19756 this.checkLVal(specifier.local, true, undefined, "import specifier"); 19757 node.specifiers.push(this.finishNode(specifier, "ImportSpecifier")); 19758 }; 19759 }); 19760 19761 // parse function type parameters - function foo<T>() {} 19762 instance.extend("parseFunctionParams", function (inner) { 19763 return function (node) { 19764 if (this.isRelational("<")) { 19765 node.typeParameters = this.flowParseTypeParameterDeclaration(); 19766 } 19767 inner.call(this, node); 19768 }; 19769 }); 19770 19771 // parse flow type annotations on variable declarator heads - let foo: string = bar 19772 instance.extend("parseVarHead", function (inner) { 19773 return function (decl) { 19774 inner.call(this, decl); 19775 if (this.match(types.colon)) { 19776 decl.id.typeAnnotation = this.flowParseTypeAnnotation(); 19777 this.finishNode(decl.id, decl.id.type); 19778 } 19779 }; 19780 }); 19781 19782 // parse the return type of an async arrow function - let foo = (async (): number => {}); 19783 instance.extend("parseAsyncArrowFromCallExpression", function (inner) { 19784 return function (node, call) { 19785 if (this.match(types.colon)) { 19786 var oldNoAnonFunctionType = this.state.noAnonFunctionType; 19787 this.state.noAnonFunctionType = true; 19788 node.returnType = this.flowParseTypeAnnotation(); 19789 this.state.noAnonFunctionType = oldNoAnonFunctionType; 19790 } 19791 19792 return inner.call(this, node, call); 19793 }; 19794 }); 19795 19796 // todo description 19797 instance.extend("shouldParseAsyncArrow", function (inner) { 19798 return function () { 19799 return this.match(types.colon) || inner.call(this); 19800 }; 19801 }); 19802 19803 // We need to support type parameter declarations for arrow functions. This 19804 // is tricky. There are three situations we need to handle 19805 // 19806 // 1. This is either JSX or an arrow function. We'll try JSX first. If that 19807 // fails, we'll try an arrow function. If that fails, we'll throw the JSX 19808 // error. 19809 // 2. This is an arrow function. We'll parse the type parameter declaration, 19810 // parse the rest, make sure the rest is an arrow function, and go from 19811 // there 19812 // 3. This is neither. Just call the inner function 19813 instance.extend("parseMaybeAssign", function (inner) { 19814 return function () { 19815 var jsxError = null; 19816 19817 for (var _len4 = arguments.length, args = Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
19818 args[_key4] = arguments[_key4]; 19819 } 19820 19821 if (types.jsxTagStart && this.match(types.jsxTagStart)) { 19822 var state = this.state.clone(); 19823 try { 19824 return inner.apply(this, args); 19825 } catch (err) { 19826 if (err instanceof SyntaxError) { 19827 this.state = state; 19828 jsxError = err; 19829 } else { 19830 // istanbul ignore next: no such error is expected 19831 throw err; 19832 } 19833 } 19834 } 19835 19836 // Need to push something onto the context to stop 19837 // the JSX plugin from messing with the tokens 19838 this.state.context.push(types$1.parenExpression); 19839 if (jsxError != null || this.isRelational("<")) { 19840 var arrowExpression = void 0; 19841 var typeParameters = void 0; 19842 try { 19843 typeParameters = this.flowParseTypeParameterDeclaration(); 19844 19845 arrowExpression = inner.apply(this, args); 19846 arrowExpression.typeParameters = typeParameters; 19847 arrowExpression.start = typeParameters.start; 19848 arrowExpression.loc.start = typeParameters.loc.start; 19849 } catch (err) { 19850 throw jsxError || err; 19851 } 19852 19853 if (arrowExpression.type === "ArrowFunctionExpression") { 19854 return arrowExpression; 19855 } else if (jsxError != null) { 19856 throw jsxError; 19857 } else { 19858 this.raise(typeParameters.start, "Expected an arrow function after this type parameter declaration"); 19859 } 19860 } 19861 this.state.context.pop(); 19862 19863 return inner.apply(this, args); 19864 }; 19865 }); 19866 19867 // handle return types for arrow functions 19868 instance.extend("parseArrow", function (inner) { 19869 return function (node) { 19870 if (this.match(types.colon)) { 19871 var state = this.state.clone(); 19872 try { 19873 var oldNoAnonFunctionType = this.state.noAnonFunctionType; 19874 this.state.noAnonFunctionType = true; 19875 var returnType = this.flowParseTypeAndPredicateAnnotation(); 19876 this.state.noAnonFunctionType = oldNoAnonFunctionType; 19877 19878 if (this.canInsertSemicolon()) this.unexpected(); 19879 if (!this.match(types.arrow)) this.unexpected(); 19880 // assign after it is clear it is an arrow 19881 node.returnType = returnType; 19882 } catch (err) { 19883 if (err instanceof SyntaxError) { 19884 this.state = state; 19885 } else { 19886 // istanbul ignore next: no such error is expected 19887 throw err; 19888 } 19889 } 19890 } 19891 19892 return inner.call(this, node); 19893 }; 19894 }); 19895 19896 instance.extend("shouldParseArrow", function (inner) { 19897 return function () { 19898 return this.match(types.colon) || inner.call(this); 19899 }; 19900 }); 19901 19902 instance.extend("isClassMutatorStarter", function (inner) { 19903 return function () { 19904 if (this.isRelational("<")) { 19905 return true; 19906 } else { 19907 return inner.call(this); 19908 } 19909 }; 19910 }); 19911 }; 19912 19913 // Adapted from String.fromcodepoint to export the function without modifying String 19914 /*! https://mths.be/fromcodepoint v0.2.1 by @mathias */ 19915 19916 // The MIT License (MIT) 19917 // Copyright (c) Mathias Bynens 19918 // 19919 // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 19920 // associated documentation files (the "Software"), to deal in the Software without restriction, 19921 // including without limitation the rights to use, copy, modify, merge, publish, distribute, 19922 // sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is 19923 // furnished to do so, subject to the following conditions: 19924 // 19925 // The above copyright notice and this permission notice shall be included in all copies or 19926 // substantial portions of the Software. 19927 // 19928 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT 19929 // NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19930 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 19931 // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19932 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 19933 19934 var fromCodePoint = String.fromCodePoint; 19935 19936 if (!fromCodePoint) { 19937 var stringFromCharCode = String.fromCharCode; 19938 var floor = Math.floor; 19939 fromCodePoint = function fromCodePoint() { 19940 var MAX_SIZE = 0x4000; 19941 var codeUnits = []; 19942 var highSurrogate = void 0; 19943 var lowSurrogate = void 0; 19944 var index = -1; 19945 var length = arguments.length; 19946 if (!length) { 19947 return ""; 19948 } 19949 var result = ""; 19950 while (++index < length) { 19951 var codePoint = Number(arguments[index]); 19952 if (!isFinite(codePoint) || // `NaN`, `+Infinity`, or `-Infinity` 19953 codePoint < 0 || // not a valid Unicode code point 19954 codePoint > 0x10FFFF || // not a valid Unicode code point 19955 floor(codePoint) != codePoint // not an integer 19956 ) { 19957 throw RangeError("Invalid code point: " + codePoint); 19958 } 19959 if (codePoint <= 0xFFFF) { 19960 // BMP code point 19961 codeUnits.push(codePoint); 19962 } else { 19963 // Astral code point; split in surrogate halves 19964 // https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae 19965 codePoint -= 0x10000; 19966 highSurrogate = (codePoint >> 10) + 0xD800; 19967 lowSurrogate = codePoint % 0x400 + 0xDC00; 19968 codeUnits.push(highSurrogate, lowSurrogate); 19969 } 19970 if (index + 1 == length || codeUnits.length > MAX_SIZE) { 19971 result += stringFromCharCode.apply(null, codeUnits); 19972 codeUnits.length = 0; 19973 } 19974 } 19975 return result; 19976 }; 19977 } 19978 19979 var fromCodePoint$1 = fromCodePoint; 19980 19981 var XHTMLEntities = { 19982 quot: "\"", 19983 amp: "&",
19984 apos: "'", 19985 lt: "<", 19986 gt: ">", 19987 nbsp: "\xA0", 19988 iexcl: "\xA1", 19989 cent: "\xA2", 19990 pound: "\xA3", 19991 curren: "\xA4", 19992 yen: "\xA5", 19993 brvbar: "\xA6", 19994 sect: "\xA7", 19995 uml: "\xA8", 19996 copy: "\xA9", 19997 ordf: "\xAA", 19998 laquo: "\xAB", 19999 not: "\xAC", 20000 shy: "\xAD", 20001 reg: "\xAE", 20002 macr: "\xAF", 20003 deg: "\xB0", 20004 plusmn: "\xB1", 20005 sup2: "\xB2", 20006 sup3: "\xB3", 20007 acute: "\xB4", 20008 micro: "\xB5", 20009 para: "\xB6", 20010 middot: "\xB7", 20011 cedil: "\xB8", 20012 sup1: "\xB9", 20013 ordm: "\xBA", 20014 raquo: "\xBB", 20015 frac14: "\xBC", 20016 frac12: "\xBD", 20017 frac34: "\xBE", 20018 iquest: "\xBF", 20019 Agrave: "\xC0", 20020 Aacute: "\xC1", 20021 Acirc: "\xC2", 20022 Atilde: "\xC3", 20023 Auml: "\xC4", 20024 Aring: "\xC5", 20025 AElig: "\xC6", 20026 Ccedil: "\xC7", 20027 Egrave: "\xC8", 20028 Eacute: "\xC9", 20029 Ecirc: "\xCA", 20030 Euml: "\xCB", 20031 Igrave: "\xCC", 20032 Iacute: "\xCD", 20033 Icirc: "\xCE", 20034 Iuml: "\xCF", 20035 ETH: "\xD0", 20036 Ntilde: "\xD1", 20037 Ograve: "\xD2", 20038 Oacute: "\xD3", 20039 Ocirc: "\xD4", 20040 Otilde: "\xD5", 20041 Ouml: "\xD6", 20042 times: "\xD7", 20043 Oslash: "\xD8", 20044 Ugrave: "\xD9", 20045 Uacute: "\xDA", 20046 Ucirc: "\xDB", 20047 Uuml: "\xDC", 20048 Yacute: "\xDD", 20049 THORN: "\xDE", 20050 szlig: "\xDF", 20051 agrave: "\xE0", 20052 aacute: "\xE1", 20053 acirc: "\xE2", 20054 atilde: "\xE3", 20055 auml: "\xE4", 20056 aring: "\xE5", 20057 aelig: "\xE6", 20058 ccedil: "\xE7", 20059 egrave: "\xE8", 20060 eacute: "\xE9", 20061 ecirc: "\xEA", 20062 euml: "\xEB", 20063 igrave: "\xEC", 20064 iacute: "\xED", 20065 icirc: "\xEE", 20066 iuml: "\xEF", 20067 eth: "\xF0", 20068 ntilde: "\xF1", 20069 ograve: "\xF2", 20070 oacute: "\xF3", 20071 ocirc: "\xF4", 20072 otilde: "\xF5", 20073 ouml: "\xF6", 20074 divide: "\xF7", 20075 oslash: "\xF8", 20076 ugrave: "\xF9", 20077 uacute: "\xFA", 20078 ucirc: "\xFB", 20079 uuml: "\xFC", 20080 yacute: "\xFD", 20081 thorn: "\xFE", 20082 yuml: "\xFF", 20083 OElig: '\u0152', 20084 oelig: '\u0153', 20085 Scaron: '\u0160', 20086 scaron: '\u0161', 20087 Yuml: '\u0178', 20088 fnof: '\u0192', 20089 circ: '\u02C6', 20090 tilde: '\u02DC', 20091 Alpha: '\u0391', 20092 Beta: '\u0392', 20093 Gamma: '\u0393', 20094 Delta: '\u0394', 20095 Epsilon: '\u0395', 20096 Zeta: '\u0396', 20097 Eta: '\u0397', 20098 Theta: '\u0398', 20099 Iota: '\u0399', 20100 Kappa: '\u039A', 20101 Lambda: '\u039B', 20102 Mu: '\u039C', 20103 Nu: '\u039D', 20104 Xi: '\u039E', 20105 Omicron: '\u039F', 20106 Pi: '\u03A0', 20107 Rho: '\u03A1', 20108 Sigma: '\u03A3', 20109 Tau: '\u03A4', 20110 Upsilon: '\u03A5', 20111 Phi: '\u03A6', 20112 Chi: '\u03A7', 20113 Psi: '\u03A8', 20114 Omega: '\u03A9', 20115 alpha: '\u03B1', 20116 beta: '\u03B2', 20117 gamma: '\u03B3', 20118 delta: '\u03B4', 20119 epsilon: '\u03B5', 20120 zeta: '\u03B6', 20121 eta: '\u03B7', 20122 theta: '\u03B8', 20123 iota: '\u03B9', 20124 kappa: '\u03BA', 20125 lambda: '\u03BB', 20126 mu: '\u03BC', 20127 nu: '\u03BD', 20128 xi: '\u03BE', 20129 omicron: '\u03BF', 20130 pi: '\u03C0', 20131 rho: '\u03C1', 20132 sigmaf: '\u03C2', 20133 sigma: '\u03C3', 20134 tau: '\u03C4', 20135 upsilon: '\u03C5', 20136 phi: '\u03C6', 20137 chi: '\u03C7', 20138 psi: '\u03C8', 20139 omega: '\u03C9', 20140 thetasym: '\u03D1', 20141 upsih: '\u03D2', 20142 piv: '\u03D6', 20143 ensp: '\u2002', 20144 emsp: '\u2003', 20145 thinsp: '\u2009', 20146 zwnj: '\u200C', 20147 zwj: '\u200D', 20148 lrm: '\u200E', 20149 rlm: '\u200F', 20150 ndash: '\u2013', 20151 mdash: '\u2014', 20152 lsquo: '\u2018', 20153 rsquo: '\u2019', 20154 sbquo: '\u201A', 20155 ldquo: '\u201C', 20156 rdquo: '\u201D', 20157 bdquo: '\u201E', 20158 dagger: '\u2020', 20159 Dagger: '\u2021', 20160 bull: '\u2022', 20161 hellip: '\u2026', 20162 permil: '\u2030', 20163 prime: '\u2032', 20164 Prime: '\u2033', 20165 lsaquo: '\u2039', 20166 rsaquo: '\u203A', 20167 oline: '\u203E', 20168 frasl: '\u2044', 20169 euro: '\u20AC', 20170 image: '\u2111', 20171 weierp: '\u2118', 20172 real: '\u211C', 20173 trade: '\u2122', 20174 alefsym: '\u2135', 20175 larr: '\u2190', 20176 uarr: '\u2191', 20177 rarr: '\u2192', 20178 darr: '\u2193', 20179 harr: '\u2194', 20180 crarr: '\u21B5', 20181 lArr: '\u21D0', 20182 uArr: '\u21D1', 20183 rArr: '\u21D2', 20184 dArr: '\u21D3', 20185 hArr: '\u21D4', 20186 forall: '\u2200', 20187 part: '\u2202', 20188 exist: '\u2203', 20189 empty: '\u2205', 20190 nabla: '\u2207', 20191 isin: '\u2208', 20192 notin: '\u2209', 20193 ni: '\u220B', 20194 prod: '\u220F', 20195 sum: '\u2211', 20196 minus: '\u2212', 20197 lowast: '\u2217', 20198 radic: '\u221A', 20199 prop: '\u221D', 20200 infin: '\u221E', 20201 ang: '\u2220', 20202 and: '\u2227', 20203 or: '\u2228', 20204 cap: '\u2229', 20205 cup: '\u222A', 20206 "int": '\u222B',
20207 there4: '\u2234', 20208 sim: '\u223C', 20209 cong: '\u2245', 20210 asymp: '\u2248', 20211 ne: '\u2260', 20212 equiv: '\u2261', 20213 le: '\u2264', 20214 ge: '\u2265', 20215 sub: '\u2282', 20216 sup: '\u2283', 20217 nsub: '\u2284', 20218 sube: '\u2286', 20219 supe: '\u2287', 20220 oplus: '\u2295', 20221 otimes: '\u2297', 20222 perp: '\u22A5', 20223 sdot: '\u22C5', 20224 lceil: '\u2308', 20225 rceil: '\u2309', 20226 lfloor: '\u230A', 20227 rfloor: '\u230B', 20228 lang: '\u2329', 20229 rang: '\u232A', 20230 loz: '\u25CA', 20231 spades: '\u2660', 20232 clubs: '\u2663', 20233 hearts: '\u2665', 20234 diams: '\u2666' 20235 }; 20236 20237 var HEX_NUMBER = /^[\da-fA-F]+$/; 20238 var DECIMAL_NUMBER = /^\d+$/; 20239 20240 types$1.j_oTag = new TokContext("<tag", false); 20241 types$1.j_cTag = new TokContext("</tag", false); 20242 types$1.j_expr = new TokContext("<tag>...</tag>", true, true); 20243 20244 types.jsxName = new TokenType("jsxName"); 20245 types.jsxText = new TokenType("jsxText", { beforeExpr: true }); 20246 types.jsxTagStart = new TokenType("jsxTagStart", { startsExpr: true }); 20247 types.jsxTagEnd = new TokenType("jsxTagEnd"); 20248 20249 types.jsxTagStart.updateContext = function () { 20250 this.state.context.push(types$1.j_expr); // treat as beginning of JSX expression 20251 this.state.context.push(types$1.j_oTag); // start opening tag context 20252 this.state.exprAllowed = false; 20253 }; 20254 20255 types.jsxTagEnd.updateContext = function (prevType) { 20256 var out = this.state.context.pop(); 20257 if (out === types$1.j_oTag && prevType === types.slash || out === types$1.j_cTag) { 20258 this.state.context.pop(); 20259 this.state.exprAllowed = this.curContext() === types$1.j_expr; 20260 } else { 20261 this.state.exprAllowed = true; 20262 } 20263 }; 20264 20265 var pp$9 = Parser.prototype; 20266 20267 // Reads inline JSX contents token. 20268 20269 pp$9.jsxReadToken = function () { 20270 var out = ""; 20271 var chunkStart = this.state.pos; 20272 for (;;) { 20273 if (this.state.pos >= this.input.length) { 20274 this.raise(this.state.start, "Unterminated JSX contents"); 20275 } 20276 20277 var ch = this.input.charCodeAt(this.state.pos); 20278 20279 switch (ch) { 20280 case 60: // "<" 20281 case 123: 20282 // "{" 20283 if (this.state.pos === this.state.start) { 20284 if (ch === 60 && this.state.exprAllowed) { 20285 ++this.state.pos; 20286 return this.finishToken(types.jsxTagStart); 20287 } 20288 return this.getTokenFromCode(ch); 20289 } 20290 out += this.input.slice(chunkStart, this.state.pos); 20291 return this.finishToken(types.jsxText, out); 20292 20293 case 38: 20294 // "&" 20295 out += this.input.slice(chunkStart, this.state.pos); 20296 out += this.jsxReadEntity(); 20297 chunkStart = this.state.pos; 20298 break; 20299 20300 default: 20301 if (isNewLine(ch)) { 20302 out += this.input.slice(chunkStart, this.state.pos); 20303 out += this.jsxReadNewLine(true); 20304 chunkStart = this.state.pos; 20305 } else { 20306 ++this.state.pos; 20307 } 20308 } 20309 } 20310 }; 20311 20312 pp$9.jsxReadNewLine = function (normalizeCRLF) { 20313 var ch = this.input.charCodeAt(this.state.pos); 20314 var out = void 0; 20315 ++this.state.pos; 20316 if (ch === 13 && this.input.charCodeAt(this.state.pos) === 10) { 20317 ++this.state.pos; 20318 out = normalizeCRLF ? "\n" : "\r\n"; 20319 } else { 20320 out = String.fromCharCode(ch); 20321 } 20322 ++this.state.curLine; 20323 this.state.lineStart = this.state.pos; 20324 20325 return out; 20326 }; 20327 20328 pp$9.jsxReadString = function (quote) { 20329 var out = ""; 20330 var chunkStart = ++this.state.pos; 20331 for (;;) { 20332 if (this.state.pos >= this.input.length) { 20333 this.raise(this.state.start, "Unterminated string constant"); 20334 } 20335 20336 var ch = this.input.charCodeAt(this.state.pos); 20337 if (ch === quote) break; 20338 if (ch === 38) { 20339 // "&" 20340 out += this.input.slice(chunkStart, this.state.pos); 20341 out += this.jsxReadEntity(); 20342 chunkStart = this.state.pos; 20343 } else if (isNewLine(ch)) { 20344 out += this.input.slice(chunkStart, this.state.pos); 20345 out += this.jsxReadNewLine(false); 20346 chunkStart = this.state.pos; 20347 } else { 20348 ++this.state.pos; 20349 } 20350 } 20351 out += this.input.slice(chunkStart, this.state.pos++); 20352 return this.finishToken(types.string, out); 20353 }; 20354 20355 pp$9.jsxReadEntity = function () { 20356 var str = ""; 20357 var count = 0; 20358 var entity = void 0; 20359 var ch = this.input[this.state.pos]; 20360 20361 var startPos = ++this.state.pos; 20362 while (this.state.pos < this.input.length && count++ < 10) { 20363 ch = this.input[this.state.pos++]; 20364 if (ch === ";") { 20365 if (str[0] === "#") { 20366 if (str[1] === "x") { 20367 str = str.substr(2); 20368 if (HEX_NUMBER.test(str)) entity = fromCodePoint$1(parseInt(str, 16)); 20369 } else { 20370 str = str.substr(1); 20371 if (DECIMAL_NUMBER.test(str)) entity = fromCodePoint$1(parseInt(str, 10)); 20372 } 20373 } else { 20374 entity = XHTMLEntities[str]; 20375 } 20376 break; 20377 } 20378 str += ch; 20379 } 20380 if (!entity) { 20381 this.state.pos = startPos; 20382 return "&"; 20383 } 20384 return entity; 20385 }; 20386 20387 // Read a JSX identifier (valid tag or attribute name). 20388 // 20389 // Optimized version since JSX identifiers can"t contain 20390 // escape characters and so can be read as single slice. 20391 // Also assumes that first character was already checked 20392 // by isIdentifierStart in readToken. 20393 20394 pp$9.jsxReadWord = function () { 20395 var ch = void 0; 20396 var start = this.state.pos; 20397 do { 20398 ch = this.input.charCodeAt(++this.state.pos); 20399 } while (isIdentifierChar(ch) || ch === 45); // "-" 20400 return this.finishToken(types.jsxName, this.input.slice(start, this.state.pos)); 20401 }; 20402 20403 // Transforms JSX element name to string. 20404 20405 function getQualifiedJSXName(object) { 20406 if (object.type === "JSXIdentifier") { 20407 return object.name; 20408 } 20409 20410 if (object.type === "JSXNamespacedName") { 20411 return object.namespace.name + ":" + object.name.name; 20412 } 20413 20414 if (object.type === "JSXMemberExpression") { 20415 return getQualifiedJSXName(object.object) + "." + getQualifiedJSXName(object.property); 20416 } 20417 } 20418 20419 // Parse next token as JSX identifier 20420 20421 pp$9.jsxParseIdentifier = function () { 20422 var node = this.startNode(); 20423 if (this.match(types.jsxName)) { 20424 node.name = this.state.value; 20425 } else if (this.state.type.keyword) { 20426 node.name = this.state.type.keyword; 20427 } else { 20428 this.unexpected(); 20429 } 20430 this.next(); 20431 return this.finishNode(node, "JSXIdentifier"); 20432 }; 20433 20434 // Parse namespaced identifier. 20435 20436 pp$9.jsxParseNamespacedName = function () { 20437 var startPos = this.state.start; 20438 var startLoc = this.state.startLoc; 20439 var name = this.jsxParseIdentifier(); 20440 if (!this.eat(types.colon)) return name; 20441 20442 var node = this.startNodeAt(startPos, startLoc); 20443 node.namespace = name; 20444 node.name = this.jsxParseIdentifier(); 20445 return this.finishNode(node, "JSXNamespacedName"); 20446 }; 20447 20448 // Parses element name in any form - namespaced, member 20449 // or single identifier. 20450 20451 pp$9.jsxParseElementName = function () { 20452 var startPos = this.state.start; 20453 var startLoc = this.state.startLoc; 20454 var node = this.jsxParseNamespacedName(); 20455 while (this.eat(types.dot)) { 20456 var newNode = this.startNodeAt(startPos, startLoc); 20457 newNode.object = node; 20458 newNode.property = this.jsxParseIdentifier(); 20459 node = this.finishNode(newNode, "JSXMemberExpression"); 20460 } 20461 return node; 20462 }; 20463 20464 // Parses any type of JSX attribute value. 20465 20466 pp$9.jsxParseAttributeValue = function () { 20467 var node = void 0; 20468 switch (this.state.type) {
20469 case types.braceL: 20470 node = this.jsxParseExpressionContainer(); 20471 if (node.expression.type === "JSXEmptyExpression") { 20472 this.raise(node.start, "JSX attributes must only be assigned a non-empty expression"); 20473 } else { 20474 return node; 20475 } 20476 20477 case types.jsxTagStart: 20478 case types.string: 20479 node = this.parseExprAtom(); 20480 node.extra = null; 20481 return node; 20482 20483 default: 20484 this.raise(this.state.start, "JSX value should be either an expression or a quoted JSX text"); 20485 } 20486 }; 20487 20488 // JSXEmptyExpression is unique type since it doesn't actually parse anything, 20489 // and so it should start at the end of last read token (left brace) and finish 20490 // at the beginning of the next one (right brace). 20491 20492 pp$9.jsxParseEmptyExpression = function () { 20493 var node = this.startNodeAt(this.state.lastTokEnd, this.state.lastTokEndLoc); 20494 return this.finishNodeAt(node, "JSXEmptyExpression", this.state.start, this.state.startLoc); 20495 }; 20496 20497 // Parse JSX spread child 20498 20499 pp$9.jsxParseSpreadChild = function () { 20500 var node = this.startNode(); 20501 this.expect(types.braceL); 20502 this.expect(types.ellipsis); 20503 node.expression = this.parseExpression(); 20504 this.expect(types.braceR); 20505 20506 return this.finishNode(node, "JSXSpreadChild"); 20507 }; 20508 20509 // Parses JSX expression enclosed into curly brackets. 20510 20511 20512 pp$9.jsxParseExpressionContainer = function () { 20513 var node = this.startNode(); 20514 this.next(); 20515 if (this.match(types.braceR)) { 20516 node.expression = this.jsxParseEmptyExpression(); 20517 } else { 20518 node.expression = this.parseExpression(); 20519 } 20520 this.expect(types.braceR); 20521 return this.finishNode(node, "JSXExpressionContainer"); 20522 }; 20523 20524 // Parses following JSX attribute name-value pair. 20525 20526 pp$9.jsxParseAttribute = function () { 20527 var node = this.startNode(); 20528 if (this.eat(types.braceL)) { 20529 this.expect(types.ellipsis); 20530 node.argument = this.parseMaybeAssign(); 20531 this.expect(types.braceR); 20532 return this.finishNode(node, "JSXSpreadAttribute"); 20533 } 20534 node.name = this.jsxParseNamespacedName(); 20535 node.value = this.eat(types.eq) ? this.jsxParseAttributeValue() : null; 20536 return this.finishNode(node, "JSXAttribute"); 20537 }; 20538 20539 // Parses JSX opening tag starting after "<". 20540 20541 pp$9.jsxParseOpeningElementAt = function (startPos, startLoc) { 20542 var node = this.startNodeAt(startPos, startLoc); 20543 node.attributes = []; 20544 node.name = this.jsxParseElementName(); 20545 while (!this.match(types.slash) && !this.match(types.jsxTagEnd)) { 20546 node.attributes.push(this.jsxParseAttribute()); 20547 } 20548 node.selfClosing = this.eat(types.slash); 20549 this.expect(types.jsxTagEnd); 20550 return this.finishNode(node, "JSXOpeningElement"); 20551 }; 20552 20553 // Parses JSX closing tag starting after "</". 20554 20555 pp$9.jsxParseClosingElementAt = function (startPos, startLoc) { 20556 var node = this.startNodeAt(startPos, startLoc); 20557 node.name = this.jsxParseElementName(); 20558 this.expect(types.jsxTagEnd); 20559 return this.finishNode(node, "JSXClosingElement"); 20560 }; 20561 20562 // Parses entire JSX element, including it"s opening tag 20563 // (starting after "<"), attributes, contents and closing tag. 20564 20565 pp$9.jsxParseElementAt = function (startPos, startLoc) { 20566 var node = this.startNodeAt(startPos, startLoc); 20567 var children = []; 20568 var openingElement = this.jsxParseOpeningElementAt(startPos, startLoc); 20569 var closingElement = null; 20570 20571 if (!openingElement.selfClosing) { 20572 contents: for (;;) { 20573 switch (this.state.type) { 20574 case types.jsxTagStart: 20575 startPos = this.state.start;startLoc = this.state.startLoc; 20576 this.next(); 20577 if (this.eat(types.slash)) { 20578 closingElement = this.jsxParseClosingElementAt(startPos, startLoc); 20579 break contents; 20580 } 20581 children.push(this.jsxParseElementAt(startPos, startLoc)); 20582 break; 20583 20584 case types.jsxText: 20585 children.push(this.parseExprAtom()); 20586 break; 20587 20588 case types.braceL: 20589 if (this.lookahead().type === types.ellipsis) { 20590 children.push(this.jsxParseSpreadChild()); 20591 } else { 20592 children.push(this.jsxParseExpressionContainer()); 20593 } 20594 20595 break; 20596 20597 // istanbul ignore next - should never happen 20598 default: 20599 this.unexpected(); 20600 } 20601 } 20602 20603 if (getQualifiedJSXName(closingElement.name) !== getQualifiedJSXName(openingElement.name)) { 20604 this.raise(closingElement.start, "Expected corresponding JSX closing tag for <" + getQualifiedJSXName(openingElement.name) + ">"); 20605 } 20606 } 20607 20608 node.openingElement = openingElement; 20609 node.closingElement = closingElement; 20610 node.children = children; 20611 if (this.match(types.relational) && this.state.value === "<") { 20612 this.raise(this.state.start, "Adjacent JSX elements must be wrapped in an enclosing tag"); 20613 } 20614 return this.finishNode(node, "JSXElement"); 20615 }; 20616 20617 // Parses entire JSX element from current position. 20618 20619 pp$9.jsxParseElement = function () { 20620 var startPos = this.state.start; 20621 var startLoc = this.state.startLoc; 20622 this.next(); 20623 return this.jsxParseElementAt(startPos, startLoc); 20624 }; 20625 20626 var jsxPlugin = function jsxPlugin(instance) { 20627 instance.extend("parseExprAtom", function (inner) { 20628 return function (refShortHandDefaultPos) { 20629 if (this.match(types.jsxText)) { 20630 var node = this.parseLiteral(this.state.value, "JSXText"); 20631 // https://github.com/babel/babel/issues/2078 20632 node.extra = null; 20633 return node; 20634 } else if (this.match(types.jsxTagStart)) { 20635 return this.jsxParseElement(); 20636 } else { 20637 return inner.call(this, refShortHandDefaultPos); 20638 } 20639 }; 20640 }); 20641 20642 instance.extend("readToken", function (inner) { 20643 return function (code) { 20644 if (this.state.inPropertyName) return inner.call(this, code); 20645 20646 var context = this.curContext(); 20647 20648 if (context === types$1.j_expr) { 20649 return this.jsxReadToken(); 20650 } 20651 20652 if (context === types$1.j_oTag || context === types$1.j_cTag) { 20653 if (isIdentifierStart(code)) { 20654 return this.jsxReadWord(); 20655 } 20656 20657 if (code === 62) { 20658 ++this.state.pos; 20659 return this.finishToken(types.jsxTagEnd); 20660 } 20661 20662 if ((code === 34 || code === 39) && context === types$1.j_oTag) { 20663 return this.jsxReadString(code); 20664 } 20665 } 20666 20667 if (code === 60 && this.state.exprAllowed) { 20668 ++this.state.pos; 20669 return this.finishToken(types.jsxTagStart); 20670 } 20671 20672 return inner.call(this, code); 20673 }; 20674 }); 20675 20676 instance.extend("updateContext", function (inner) { 20677 return function (prevType) { 20678 if (this.match(types.braceL)) { 20679 var curContext = this.curContext(); 20680 if (curContext === types$1.j_oTag) { 20681 this.state.context.push(types$1.braceExpression); 20682 } else if (curContext === types$1.j_expr) { 20683 this.state.context.push(types$1.templateQuasi); 20684 } else { 20685 inner.call(this, prevType); 20686 } 20687 this.state.exprAllowed = true; 20688 } else if (this.match(types.slash) && prevType === types.jsxTagStart) { 20689 this.state.context.length -= 2; // do not consider JSX expr -> JSX open tag -> ... anymore 20690 this.state.context.push(types$1.j_cTag); // reconsider as closing tag context 20691 this.state.exprAllowed = false;
20692 } else { 20693 return inner.call(this, prevType); 20694 } 20695 }; 20696 }); 20697 }; 20698 20699 plugins.estree = estreePlugin; 20700 plugins.flow = flowPlugin; 20701 plugins.jsx = jsxPlugin; 20702 20703 function parse(input, options) { 20704 return new Parser(options, input).parse(); 20705 } 20706 20707 function parseExpression(input, options) { 20708 var parser = new Parser(options, input); 20709 if (parser.options.strictMode) { 20710 parser.state.strict = true; 20711 } 20712 return parser.getExpression(); 20713 } 20714 20715 exports.parse = parse; 20716 exports.parseExpression = parseExpression; 20717 exports.tokTypes = types; 20718 20719/***/ }, 20720/* 134 */ 20721/***/ function(module, exports) { 20722 20723 'use strict'; 20724 20725 module.exports = function (it, Constructor, name, forbiddenField) { 20726 if (!(it instanceof Constructor) || forbiddenField !== undefined && forbiddenField in it) { 20727 throw TypeError(name + ': incorrect invocation!'); 20728 }return it; 20729 }; 20730 20731/***/ }, 20732/* 135 */ 20733/***/ function(module, exports, __webpack_require__) { 20734 20735 'use strict'; 20736 20737 // 0 -> Array#forEach 20738 // 1 -> Array#map 20739 // 2 -> Array#filter 20740 // 3 -> Array#some 20741 // 4 -> Array#every 20742 // 5 -> Array#find 20743 // 6 -> Array#findIndex 20744 var ctx = __webpack_require__(54), 20745 IObject = __webpack_require__(139), 20746 toObject = __webpack_require__(93), 20747 toLength = __webpack_require__(148), 20748 asc = __webpack_require__(417); 20749 module.exports = function (TYPE, $create) { 20750 var IS_MAP = TYPE == 1, 20751 IS_FILTER = TYPE == 2, 20752 IS_SOME = TYPE == 3, 20753 IS_EVERY = TYPE == 4, 20754 IS_FIND_INDEX = TYPE == 6, 20755 NO_HOLES = TYPE == 5 || IS_FIND_INDEX, 20756 create = $create || asc; 20757 return function ($this, callbackfn, that) { 20758 var O = toObject($this), 20759 self = IObject(O), 20760 f = ctx(callbackfn, that, 3), 20761 length = toLength(self.length), 20762 index = 0, 20763 result = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined, 20764 val, 20765 res; 20766 for (; length > index; index++) { 20767 if (NO_HOLES || index in self) { 20768 val = self[index]; 20769 res = f(val, index, O); 20770 if (TYPE) { 20771 if (IS_MAP) result[index] = res; // map 20772 else if (res) switch (TYPE) { 20773 case 3: 20774 return true; // some 20775 case 5: 20776 return val; // find 20777 case 6: 20778 return index; // findIndex 20779 case 2: 20780 result.push(val); // filter 20781 } else if (IS_EVERY) return false; // every 20782 } 20783 } 20784 }return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : result; 20785 }; 20786 }; 20787 20788/***/ }, 20789/* 136 */ 20790/***/ function(module, exports) { 20791 20792 "use strict"; 20793 20794 var toString = {}.toString; 20795 20796 module.exports = function (it) { 20797 return toString.call(it).slice(8, -1); 20798 }; 20799 20800/***/ }, 20801/* 137 */ 20802/***/ function(module, exports, __webpack_require__) { 20803 20804 'use strict'; 20805 20806 var global = __webpack_require__(14), 20807 $export = __webpack_require__(21), 20808 meta = __webpack_require__(56), 20809 fails = __webpack_require__(36), 20810 hide = __webpack_require__(28), 20811 redefineAll = __webpack_require__(143), 20812 forOf = __webpack_require__(88), 20813 anInstance = __webpack_require__(134), 20814 isObject = __webpack_require__(22), 20815 setToStringTag = __webpack_require__(92), 20816 dP = __webpack_require__(23).f, 20817 each = __webpack_require__(135)(0), 20818 DESCRIPTORS = __webpack_require__(20); 20819 20820 module.exports = function (NAME, wrapper, methods, common, IS_MAP, IS_WEAK) { 20821 var Base = global[NAME], 20822 C = Base, 20823 ADDER = IS_MAP ? 'set' : 'add', 20824 proto = C && C.prototype, 20825 O = {}; 20826 if (!DESCRIPTORS || typeof C != 'function' || !(IS_WEAK || proto.forEach && !fails(function () { 20827 new C().entries().next(); 20828 }))) { 20829 // create collection constructor 20830 C = common.getConstructor(wrapper, NAME, IS_MAP, ADDER); 20831 redefineAll(C.prototype, methods); 20832 meta.NEED = true; 20833 } else { 20834 C = wrapper(function (target, iterable) { 20835 anInstance(target, C, NAME, '_c'); 20836 target._c = new Base(); 20837 if (iterable != undefined) forOf(iterable, IS_MAP, target[ADDER], target); 20838 }); 20839 each('add,clear,delete,forEach,get,has,set,keys,values,entries,toJSON'.split(','), function (KEY) { 20840 var IS_ADDER = KEY == 'add' || KEY == 'set'; 20841 if (KEY in proto && !(IS_WEAK && KEY == 'clear')) hide(C.prototype, KEY, function (a, b) { 20842 anInstance(this, C, KEY); 20843 if (!IS_ADDER && IS_WEAK && !isObject(a)) return KEY == 'get' ? undefined : false;
20844 var result = this._c[KEY](a === 0 ? 0 : a, b); 20845 return IS_ADDER ? this : result; 20846 }); 20847 }); 20848 if ('size' in proto) dP(C.prototype, 'size', { 20849 get: function get() { 20850 return this._c.size; 20851 } 20852 }); 20853 } 20854 20855 setToStringTag(C, NAME); 20856 20857 O[NAME] = C; 20858 $export($export.G + $export.W + $export.F, O); 20859 20860 if (!IS_WEAK) common.setStrong(C, NAME, IS_MAP); 20861 20862 return C; 20863 }; 20864 20865/***/ }, 20866/* 138 */ 20867/***/ function(module, exports) { 20868 20869 'use strict'; 20870 20871 // IE 8- don't enum bug keys 20872 module.exports = 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'.split(','); 20873 20874/***/ }, 20875/* 139 */ 20876/***/ function(module, exports, __webpack_require__) { 20877 20878 'use strict'; 20879 20880 // fallback for non-array-like ES3 and non-enumerable old V8 strings 20881 var cof = __webpack_require__(136); 20882 module.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) { 20883 return cof(it) == 'String' ? it.split('') : Object(it); 20884 }; 20885 20886/***/ }, 20887/* 140 */ 20888/***/ function(module, exports, __webpack_require__) { 20889 20890 'use strict'; 20891 20892 var LIBRARY = __webpack_require__(141), 20893 $export = __webpack_require__(21), 20894 redefine = __webpack_require__(144), 20895 hide = __webpack_require__(28), 20896 has = __webpack_require__(27), 20897 Iterators = __webpack_require__(55), 20898 $iterCreate = __webpack_require__(424), 20899 setToStringTag = __webpack_require__(92), 20900 getPrototypeOf = __webpack_require__(428), 20901 ITERATOR = __webpack_require__(12)('iterator'), 20902 BUGGY = !([].keys && 'next' in [].keys()) // Safari has buggy iterators w/o `next` 20903 , 20904 FF_ITERATOR = '@@iterator', 20905 KEYS = 'keys', 20906 VALUES = 'values'; 20907 20908 var returnThis = function returnThis() { 20909 return this; 20910 }; 20911 20912 module.exports = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) { 20913 $iterCreate(Constructor, NAME, next); 20914 var getMethod = function getMethod(kind) { 20915 if (!BUGGY && kind in proto) return proto[kind]; 20916 switch (kind) { 20917 case KEYS: 20918 return function keys() { 20919 return new Constructor(this, kind); 20920 }; 20921 case VALUES: 20922 return function values() { 20923 return new Constructor(this, kind); 20924 }; 20925 }return function entries() { 20926 return new Constructor(this, kind); 20927 }; 20928 }; 20929 var TAG = NAME + ' Iterator', 20930 DEF_VALUES = DEFAULT == VALUES, 20931 VALUES_BUG = false, 20932 proto = Base.prototype, 20933 $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT], 20934 $default = $native || getMethod(DEFAULT), 20935 $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined, 20936 $anyNative = NAME == 'Array' ? proto.entries || $native : $native, 20937 methods, 20938 key, 20939 IteratorPrototype; 20940 // Fix native 20941 if ($anyNative) { 20942 IteratorPrototype = getPrototypeOf($anyNative.call(new Base())); 20943 if (IteratorPrototype !== Object.prototype) { 20944 // Set @@toStringTag to native iterators 20945 setToStringTag(IteratorPrototype, TAG, true); 20946 // fix for some old engines 20947 if (!LIBRARY && !has(IteratorPrototype, ITERATOR)) hide(IteratorPrototype, ITERATOR, returnThis); 20948 } 20949 } 20950 // fix Array#{values, @@iterator}.name in V8 / FF 20951 if (DEF_VALUES && $native && $native.name !== VALUES) { 20952 VALUES_BUG = true; 20953 $default = function values() { 20954 return $native.call(this); 20955 }; 20956 } 20957 // Define iterator 20958 if ((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])) { 20959 hide(proto, ITERATOR, $default); 20960 } 20961 // Plug for library 20962 Iterators[NAME] = $default; 20963 Iterators[TAG] = returnThis; 20964 if (DEFAULT) { 20965 methods = { 20966 values: DEF_VALUES ? $default : getMethod(VALUES), 20967 keys: IS_SET ? $default : getMethod(KEYS), 20968 entries: $entries 20969 }; 20970 if (FORCED) for (key in methods) { 20971 if (!(key in proto)) redefine(proto, key, methods[key]); 20972 } else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods); 20973 } 20974 return methods; 20975 }; 20976 20977/***/ }, 20978/* 141 */ 20979/***/ function(module, exports) { 20980 20981 "use strict"; 20982 20983 module.exports = true; 20984 20985/***/ }, 20986/* 142 */
20987/***/ function(module, exports) { 20988 20989 "use strict"; 20990 20991 exports.f = Object.getOwnPropertySymbols; 20992 20993/***/ }, 20994/* 143 */ 20995/***/ function(module, exports, __webpack_require__) { 20996 20997 'use strict'; 20998 20999 var hide = __webpack_require__(28); 21000 module.exports = function (target, src, safe) { 21001 for (var key in src) { 21002 if (safe && target[key]) target[key] = src[key];else hide(target, key, src[key]); 21003 }return target; 21004 }; 21005 21006/***/ }, 21007/* 144 */ 21008/***/ function(module, exports, __webpack_require__) { 21009 21010 'use strict'; 21011 21012 module.exports = __webpack_require__(28); 21013 21014/***/ }, 21015/* 145 */ 21016/***/ function(module, exports, __webpack_require__) { 21017 21018 'use strict'; 21019 21020 var shared = __webpack_require__(146)('keys'), 21021 uid = __webpack_require__(94); 21022 module.exports = function (key) { 21023 return shared[key] || (shared[key] = uid(key)); 21024 }; 21025 21026/***/ }, 21027/* 146 */ 21028/***/ function(module, exports, __webpack_require__) { 21029 21030 'use strict'; 21031 21032 var global = __webpack_require__(14), 21033 SHARED = '__core-js_shared__', 21034 store = global[SHARED] || (global[SHARED] = {}); 21035 module.exports = function (key) { 21036 return store[key] || (store[key] = {}); 21037 }; 21038 21039/***/ }, 21040/* 147 */ 21041/***/ function(module, exports) { 21042 21043 "use strict"; 21044 21045 // 7.1.4 ToInteger 21046 var ceil = Math.ceil, 21047 floor = Math.floor; 21048 module.exports = function (it) { 21049 return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it); 21050 }; 21051 21052/***/ }, 21053/* 148 */ 21054/***/ function(module, exports, __webpack_require__) { 21055 21056 'use strict'; 21057 21058 // 7.1.15 ToLength 21059 var toInteger = __webpack_require__(147), 21060 min = Math.min; 21061 module.exports = function (it) { 21062 return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991 21063 }; 21064 21065/***/ }, 21066/* 149 */ 21067/***/ function(module, exports, __webpack_require__) { 21068 21069 'use strict'; 21070 21071 // 7.1.1 ToPrimitive(input [, PreferredType]) 21072 var isObject = __webpack_require__(22); 21073 // instead of the ES6 spec version, we didn't implement @@toPrimitive case 21074 // and the second argument - flag - preferred type is a string 21075 module.exports = function (it, S) { 21076 if (!isObject(it)) return it; 21077 var fn, val; 21078 if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val; 21079 if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val; 21080 if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val; 21081 throw TypeError("Can't convert object to primitive value"); 21082 }; 21083 21084/***/ }, 21085/* 150 */ 21086/***/ function(module, exports, __webpack_require__) { 21087 21088 'use strict'; 21089 21090 var global = __webpack_require__(14), 21091 core = __webpack_require__(5), 21092 LIBRARY = __webpack_require__(141), 21093 wksExt = __webpack_require__(151), 21094 defineProperty = __webpack_require__(23).f; 21095 module.exports = function (name) { 21096 var $Symbol = core.Symbol || (core.Symbol = LIBRARY ? {} : global.Symbol || {}); 21097 if (name.charAt(0) != '_' && !(name in $Symbol)) defineProperty($Symbol, name, { value: wksExt.f(name) }); 21098 }; 21099 21100/***/ }, 21101/* 151 */ 21102/***/ function(module, exports, __webpack_require__) { 21103 21104 'use strict'; 21105 21106 exports.f = __webpack_require__(12); 21107 21108/***/ }, 21109/* 152 */ 21110/***/ function(module, exports, __webpack_require__) { 21111 21112 'use strict'; 21113 21114 var $at = __webpack_require__(432)(true); 21115 21116 // 21.1.3.27 String.prototype[@@iterator]() 21117 __webpack_require__(140)(String, 'String', function (iterated) { 21118 this._t = String(iterated); // target 21119 this._i = 0; // next index 21120 // 21.1.5.2.1 %StringIteratorPrototype%.next() 21121 }, function () { 21122 var O = this._t, 21123 index = this._i, 21124 point; 21125 if (index >= O.length) return { value: undefined, done: true }; 21126 point = $at(O, index); 21127 this._i += point.length; 21128 return { value: point, done: false }; 21129 }); 21130 21131/***/ }, 21132/* 153 */ 21133/***/ function(module, exports, __webpack_require__) { 21134 21135 'use strict'; 21136 // ECMAScript 6 symbols shim 21137 21138 var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; 21139 21140 var global = __webpack_require__(14), 21141 has = __webpack_require__(27), 21142 DESCRIPTORS = __webpack_require__(20), 21143 $export = __webpack_require__(21), 21144 redefine = __webpack_require__(144), 21145 META = __webpack_require__(56).KEY, 21146 $fails = __webpack_require__(36), 21147 shared = __webpack_require__(146), 21148 setToStringTag = __webpack_require__(92), 21149 uid = __webpack_require__(94), 21150 wks = __webpack_require__(12), 21151 wksExt = __webpack_require__(151), 21152 wksDefine = __webpack_require__(150), 21153 keyOf = __webpack_require__(425), 21154 enumKeys = __webpack_require__(420), 21155 isArray = __webpack_require__(228), 21156 anObject = __webpack_require__(19), 21157 toIObject = __webpack_require__(37), 21158 toPrimitive = __webpack_require__(149), 21159 createDesc = __webpack_require__(91), 21160 _create = __webpack_require__(89), 21161 gOPNExt = __webpack_require__(427), 21162 $GOPD = __webpack_require__(231), 21163 $DP = __webpack_require__(23), 21164 $keys = __webpack_require__(43), 21165 gOPD = $GOPD.f, 21166 dP = $DP.f, 21167 gOPN = gOPNExt.f, 21168 $Symbol = global.Symbol, 21169 $JSON = global.JSON, 21170 _stringify = $JSON && $JSON.stringify, 21171 PROTOTYPE = 'prototype', 21172 HIDDEN = wks('_hidden'), 21173 TO_PRIMITIVE = wks('toPrimitive'), 21174 isEnum = {}.propertyIsEnumerable, 21175 SymbolRegistry = shared('symbol-registry'), 21176 AllSymbols = shared('symbols'),
vendor: 4,989 bytes, lines 21177-21307
21177 OPSymbols = shared('op-symbols'), 21178 ObjectProto = Object[PROTOTYPE], 21179 USE_NATIVE = typeof $Symbol == 'function', 21180 QObject = global.QObject; 21181 // Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173 21182 var setter = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild; 21183 21184 // fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687 21185 var setSymbolDesc = DESCRIPTORS && $fails(function () { 21186 return _create(dP({}, 'a', { 21187 get: function get() { 21188 return dP(this, 'a', { value: 7 }).a; 21189 } 21190 })).a != 7; 21191 }) ? function (it, key, D) { 21192 var protoDesc = gOPD(ObjectProto, key); 21193 if (protoDesc) delete ObjectProto[key]; 21194 dP(it, key, D); 21195 if (protoDesc && it !== ObjectProto) dP(ObjectProto, key, protoDesc); 21196 } : dP; 21197 21198 var wrap = function wrap(tag) { 21199 var sym = AllSymbols[tag] = _create($Symbol[PROTOTYPE]); 21200 sym._k = tag; 21201 return sym; 21202 }; 21203 21204 var isSymbol = USE_NATIVE && _typeof($Symbol.iterator) == 'symbol' ? function (it) { 21205 return (typeof it === 'undefined' ? 'undefined' : _typeof(it)) == 'symbol'; 21206 } : function (it) { 21207 return it instanceof $Symbol; 21208 }; 21209 21210 var $defineProperty = function defineProperty(it, key, D) { 21211 if (it === ObjectProto) $defineProperty(OPSymbols, key, D); 21212 anObject(it); 21213 key = toPrimitive(key, true); 21214 anObject(D); 21215 if (has(AllSymbols, key)) { 21216 if (!D.enumerable) { 21217 if (!has(it, HIDDEN)) dP(it, HIDDEN, createDesc(1, {})); 21218 it[HIDDEN][key] = true; 21219 } else { 21220 if (has(it, HIDDEN) && it[HIDDEN][key]) it[HIDDEN][key] = false; 21221 D = _create(D, { enumerable: createDesc(0, false) }); 21222 }return setSymbolDesc(it, key, D); 21223 }return dP(it, key, D); 21224 }; 21225 var $defineProperties = function defineProperties(it, P) { 21226 anObject(it); 21227 var keys = enumKeys(P = toIObject(P)), 21228 i = 0, 21229 l = keys.length, 21230 key; 21231 while (l > i) { 21232 $defineProperty(it, key = keys[i++], P[key]); 21233 }return it; 21234 }; 21235 var $create = function create(it, P) { 21236 return P === undefined ? _create(it) : $defineProperties(_create(it), P); 21237 }; 21238 var $propertyIsEnumerable = function propertyIsEnumerable(key) { 21239 var E = isEnum.call(this, key = toPrimitive(key, true)); 21240 if (this === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return false; 21241 return E || !has(this, key) || !has(AllSymbols, key) || has(this, HIDDEN) && this[HIDDEN][key] ? E : true; 21242 }; 21243 var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key) { 21244 it = toIObject(it); 21245 key = toPrimitive(key, true); 21246 if (it === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return; 21247 var D = gOPD(it, key); 21248 if (D && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key])) D.enumerable = true; 21249 return D; 21250 }; 21251 var $getOwnPropertyNames = function getOwnPropertyNames(it) { 21252 var names = gOPN(toIObject(it)), 21253 result = [], 21254 i = 0, 21255 key; 21256 while (names.length > i) { 21257 if (!has(AllSymbols, key = names[i++]) && key != HIDDEN && key != META) result.push(key); 21258 }return result; 21259 }; 21260 var $getOwnPropertySymbols = function getOwnPropertySymbols(it) { 21261 var IS_OP = it === ObjectProto, 21262 names = gOPN(IS_OP ? OPSymbols : toIObject(it)), 21263 result = [], 21264 i = 0, 21265 key; 21266 while (names.length > i) { 21267 if (has(AllSymbols, key = names[i++]) && (IS_OP ? has(ObjectProto, key) : true)) result.push(AllSymbols[key]); 21268 }return result; 21269 }; 21270 21271 // 19.4.1.1 Symbol([description]) 21272 if (!USE_NATIVE) { 21273 $Symbol = function _Symbol() { 21274 if (this instanceof $Symbol) throw TypeError('Symbol is not a constructor!'); 21275 var tag = uid(arguments.length > 0 ? arguments[0] : undefined); 21276 var $set = function $set(value) { 21277 if (this === ObjectProto) $set.call(OPSymbols, value); 21278 if (has(this, HIDDEN) && has(this[HIDDEN], tag)) this[HIDDEN][tag] = false; 21279 setSymbolDesc(this, tag, createDesc(1, value)); 21280 }; 21281 if (DESCRIPTORS && setter) setSymbolDesc(ObjectProto, tag, { configurable: true, set: $set }); 21282 return wrap(tag); 21283 }; 21284 redefine($Symbol[PROTOTYPE], 'toString', function toString() { 21285 return this._k; 21286 }); 21287 21288 $GOPD.f = $getOwnPropertyDescriptor; 21289 $DP.f = $defineProperty; 21290 __webpack_require__(232).f = gOPNExt.f = $getOwnPropertyNames; 21291 __webpack_require__(90).f = $propertyIsEnumerable; 21292 __webpack_require__(142).f = $getOwnPropertySymbols; 21293 21294 if (DESCRIPTORS && !__webpack_require__(141)) { 21295 redefine(ObjectProto, 'propertyIsEnumerable', $propertyIsEnumerable, true); 21296 } 21297 21298 wksExt.f = function (name) { 21299 return wrap(wks(name)); 21300 }; 21301 } 21302 21303 $export($export.G + $export.W + $export.F * !USE_NATIVE, { Symbol: $Symbol }); 21304 21305 for (var symbols = 21306 // 19.4.2.2, 19.4.2.3, 19.4.2.4, 19.4.2.6, 19.4.2.8, 19.4.2.9, 19.4.2.10, 19.4.2.11, 19.4.2.12, 19.4.2.13, 19.4.2.14 21307 'hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables'.split(','), i = 0; symbols.length > i;) {
21308 wks(symbols[i++]); 21309 }for (var symbols = $keys(wks.store), i = 0; symbols.length > i;) { 21310 wksDefine(symbols[i++]); 21311 }$export($export.S + $export.F * !USE_NATIVE, 'Symbol', { 21312 // 19.4.2.1 Symbol.for(key) 21313 'for': function _for(key) { 21314 return has(SymbolRegistry, key += '') ? SymbolRegistry[key] : SymbolRegistry[key] = $Symbol(key); 21315 }, 21316 // 19.4.2.5 Symbol.keyFor(sym) 21317 keyFor: function keyFor(key) { 21318 if (isSymbol(key)) return keyOf(SymbolRegistry, key); 21319 throw TypeError(key + ' is not a symbol!'); 21320 }, 21321 useSetter: function useSetter() { 21322 setter = true; 21323 }, 21324 useSimple: function useSimple() { 21325 setter = false; 21326 } 21327 }); 21328 21329 $export($export.S + $export.F * !USE_NATIVE, 'Object', { 21330 // 19.1.2.2 Object.create(O [, Properties]) 21331 create: $create, 21332 // 19.1.2.4 Object.defineProperty(O, P, Attributes) 21333 defineProperty: $defineProperty, 21334 // 19.1.2.3 Object.defineProperties(O, Properties) 21335 defineProperties: $defineProperties, 21336 // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P) 21337 getOwnPropertyDescriptor: $getOwnPropertyDescriptor, 21338 // 19.1.2.7 Object.getOwnPropertyNames(O) 21339 getOwnPropertyNames: $getOwnPropertyNames, 21340 // 19.1.2.8 Object.getOwnPropertySymbols(O) 21341 getOwnPropertySymbols: $getOwnPropertySymbols 21342 }); 21343 21344 // 24.3.2 JSON.stringify(value [, replacer [, space]]) 21345 $JSON && $export($export.S + $export.F * (!USE_NATIVE || $fails(function () { 21346 var S = $Symbol(); 21347 // MS Edge converts symbol values to JSON as {} 21348 // WebKit converts symbol values to JSON as null 21349 // V8 throws on boxed symbols 21350 return _stringify([S]) != '[null]' || _stringify({ a: S }) != '{}' || _stringify(Object(S)) != '{}'; 21351 })), 'JSON', { 21352 stringify: function stringify(it) { 21353 if (it === undefined || isSymbol(it)) return; // IE8 returns string on undefined 21354 var args = [it], 21355 i = 1, 21356 replacer, 21357 $replacer; 21358 while (arguments.length > i) { 21359 args.push(arguments[i++]); 21360 }replacer = args[1]; 21361 if (typeof replacer == 'function') $replacer = replacer; 21362 if ($replacer || !isArray(replacer)) replacer = function replacer(key, value) { 21363 if ($replacer) value = $replacer.call(this, key, value); 21364 if (!isSymbol(value)) return value; 21365 }; 21366 args[1] = replacer; 21367 return _stringify.apply($JSON, args); 21368 } 21369 }); 21370 21371 // 19.4.3.4 Symbol.prototype[@@toPrimitive](hint) 21372 $Symbol[PROTOTYPE][TO_PRIMITIVE] || __webpack_require__(28)($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf); 21373 // 19.4.3.5 Symbol.prototype[@@toStringTag] 21374 setToStringTag($Symbol, 'Symbol'); 21375 // 20.2.1.9 Math[@@toStringTag] 21376 setToStringTag(Math, 'Math', true); 21377 // 24.3.3 JSON[@@toStringTag] 21378 setToStringTag(global.JSON, 'JSON', true); 21379 21380/***/ }, 21381/* 154 */ 21382/***/ function(module, exports, __webpack_require__) { 21383 21384 'use strict'; 21385 21386 /* 21387 Copyright (C) 2013 Yusuke Suzuki <[email protected]> 21388 21389 Redistribution and use in source and binary forms, with or without 21390 modification, are permitted provided that the following conditions are met: 21391 21392 * Redistributions of source code must retain the above copyright 21393 notice, this list of conditions and the following disclaimer. 21394 * Redistributions in binary form must reproduce the above copyright 21395 notice, this list of conditions and the following disclaimer in the 21396 documentation and/or other materials provided with the distribution. 21397 21398 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21399 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21400 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21401 ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY 21402 DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21403 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21404 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 21405 ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 21406 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 21407 THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 21408 */ 21409 21410 (function () { 21411 'use strict'; 21412 21413 exports.ast = __webpack_require__(450); 21414 exports.code = __webpack_require__(236); 21415 exports.keyword = __webpack_require__(451); 21416 })(); 21417 /* vim: set sw=4 ts=4 et tw=80 : */ 21418 21419/***/ }, 21420/* 155 */ 21421/***/ function(module, exports, __webpack_require__) { 21422 21423 'use strict'; 21424 21425 var getNative = __webpack_require__(38), 21426 root = __webpack_require__(15); 21427 21428 /* Built-in method references that are verified to be native. */ 21429 var Map = getNative(root, 'Map'); 21430 21431 module.exports = Map; 21432 21433/***/ }, 21434/* 156 */ 21435/***/ function(module, exports, __webpack_require__) { 21436 21437 'use strict'; 21438 21439 var mapCacheClear = __webpack_require__(540), 21440 mapCacheDelete = __webpack_require__(541), 21441 mapCacheGet = __webpack_require__(542), 21442 mapCacheHas = __webpack_require__(543), 21443 mapCacheSet = __webpack_require__(544); 21444 21445 /** 21446 * Creates a map cache object to store key-value pairs. 21447 * 21448 * @private 21449 * @constructor 21450 * @param {Array} [entries] The key-value pairs to cache. 21451 */ 21452 function MapCache(entries) { 21453 var index = -1, 21454 length = entries == null ? 0 : entries.length; 21455 21456 this.clear(); 21457 while (++index < length) { 21458 var entry = entries[index]; 21459 this.set(entry[0], entry[1]); 21460 } 21461 } 21462 21463 // Add methods to `MapCache`. 21464 MapCache.prototype.clear = mapCacheClear; 21465 MapCache.prototype['delete'] = mapCacheDelete; 21466 MapCache.prototype.get = mapCacheGet; 21467 MapCache.prototype.has = mapCacheHas; 21468 MapCache.prototype.set = mapCacheSet; 21469 21470 module.exports = MapCache; 21471 21472/***/ }, 21473/* 157 */
vendor: 4,546 bytes, lines 21474-21627
21474/***/ function(module, exports) { 21475 21476 "use strict"; 21477 21478 /** 21479 * Appends the elements of `values` to `array`. 21480 * 21481 * @private 21482 * @param {Array} array The array to modify. 21483 * @param {Array} values The values to append. 21484 * @returns {Array} Returns `array`. 21485 */ 21486 function arrayPush(array, values) { 21487 var index = -1, 21488 length = values.length, 21489 offset = array.length; 21490 21491 while (++index < length) { 21492 array[offset + index] = values[index]; 21493 } 21494 return array; 21495 } 21496 21497 module.exports = arrayPush; 21498 21499/***/ }, 21500/* 158 */ 21501/***/ function(module, exports, __webpack_require__) { 21502 21503 'use strict'; 21504 21505 var baseAssignValue = __webpack_require__(159), 21506 eq = __webpack_require__(45); 21507 21508 /** Used for built-in method references. */ 21509 var objectProto = Object.prototype; 21510 21511 /** Used to check objects for own properties. */ 21512 var hasOwnProperty = objectProto.hasOwnProperty; 21513 21514 /** 21515 * Assigns `value` to `key` of `object` if the existing value is not equivalent 21516 * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) 21517 * for equality comparisons. 21518 * 21519 * @private 21520 * @param {Object} object The object to modify. 21521 * @param {string} key The key of the property to assign. 21522 * @param {*} value The value to assign. 21523 */ 21524 function assignValue(object, key, value) { 21525 var objValue = object[key]; 21526 if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || value === undefined && !(key in object)) { 21527 baseAssignValue(object, key, value); 21528 } 21529 } 21530 21531 module.exports = assignValue; 21532 21533/***/ }, 21534/* 159 */ 21535/***/ function(module, exports, __webpack_require__) { 21536 21537 'use strict'; 21538 21539 var defineProperty = __webpack_require__(255); 21540 21541 /** 21542 * The base implementation of `assignValue` and `assignMergeValue` without 21543 * value checks. 21544 * 21545 * @private 21546 * @param {Object} object The object to modify. 21547 * @param {string} key The key of the property to assign. 21548 * @param {*} value The value to assign. 21549 */ 21550 function baseAssignValue(object, key, value) { 21551 if (key == '__proto__' && defineProperty) { 21552 defineProperty(object, key, { 21553 'configurable': true, 21554 'enumerable': true, 21555 'value': value, 21556 'writable': true 21557 }); 21558 } else { 21559 object[key] = value; 21560 } 21561 } 21562 21563 module.exports = baseAssignValue; 21564 21565/***/ }, 21566/* 160 */ 21567/***/ function(module, exports, __webpack_require__) { 21568 21569 'use strict'; 21570 21571 var Stack = __webpack_require__(97), 21572 arrayEach = __webpack_require__(467), 21573 assignValue = __webpack_require__(158), 21574 baseAssign = __webpack_require__(472), 21575 baseAssignIn = __webpack_require__(473), 21576 cloneBuffer = __webpack_require__(252), 21577 copyArray = __webpack_require__(164), 21578 copySymbols = __webpack_require__(512), 21579 copySymbolsIn = __webpack_require__(513), 21580 getAllKeys = __webpack_require__(258), 21581 getAllKeysIn = __webpack_require__(521), 21582 getTag = __webpack_require__(260), 21583 initCloneArray = __webpack_require__(530), 21584 initCloneByTag = __webpack_require__(531), 21585 initCloneObject = __webpack_require__(262), 21586 isArray = __webpack_require__(7), 21587 isBuffer = __webpack_require__(111), 21588 isObject = __webpack_require__(16), 21589 keys = __webpack_require__(31); 21590 21591 /** Used to compose bitmasks for cloning. */ 21592 var CLONE_DEEP_FLAG = 1, 21593 CLONE_FLAT_FLAG = 2, 21594 CLONE_SYMBOLS_FLAG = 4; 21595 21596 /** `Object#toString` result references. */ 21597 var argsTag = '[object Arguments]', 21598 arrayTag = '[object Array]', 21599 boolTag = '[object Boolean]', 21600 dateTag = '[object Date]', 21601 errorTag = '[object Error]', 21602 funcTag = '[object Function]', 21603 genTag = '[object GeneratorFunction]', 21604 mapTag = '[object Map]', 21605 numberTag = '[object Number]', 21606 objectTag = '[object Object]', 21607 regexpTag = '[object RegExp]', 21608 setTag = '[object Set]', 21609 stringTag = '[object String]', 21610 symbolTag = '[object Symbol]', 21611 weakMapTag = '[object WeakMap]'; 21612 21613 var arrayBufferTag = '[object ArrayBuffer]', 21614 dataViewTag = '[object DataView]', 21615 float32Tag = '[object Float32Array]', 21616 float64Tag = '[object Float64Array]', 21617 int8Tag = '[object Int8Array]', 21618 int16Tag = '[object Int16Array]', 21619 int32Tag = '[object Int32Array]', 21620 uint8Tag = '[object Uint8Array]', 21621 uint8ClampedTag = '[object Uint8ClampedArray]', 21622 uint16Tag = '[object Uint16Array]', 21623 uint32Tag = '[object Uint32Array]'; 21624 21625 /** Used to identify `toStringTag` values supported by `_.clone`. */ 21626 var cloneableTags = {}; 21627 cloneableTags[argsTag] = cloneableTags[arrayTag] = cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag]
vendor: 4,554 bytes, lines 21627-21760
21627= 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; 21628 cloneableTags[errorTag] = cloneableTags[funcTag] = cloneableTags[weakMapTag] = false; 21629 21630 /** 21631 * The base implementation of `_.clone` and `_.cloneDeep` which tracks 21632 * traversed objects. 21633 * 21634 * @private 21635 * @param {*} value The value to clone. 21636 * @param {boolean} bitmask The bitmask flags. 21637 * 1 - Deep clone 21638 * 2 - Flatten inherited properties 21639 * 4 - Clone symbols 21640 * @param {Function} [customizer] The function to customize cloning. 21641 * @param {string} [key] The key of `value`. 21642 * @param {Object} [object] The parent object of `value`. 21643 * @param {Object} [stack] Tracks traversed objects and their clone counterparts. 21644 * @returns {*} Returns the cloned value. 21645 */ 21646 function baseClone(value, bitmask, customizer, key, object, stack) { 21647 var result, 21648 isDeep = bitmask & CLONE_DEEP_FLAG, 21649 isFlat = bitmask & CLONE_FLAT_FLAG, 21650 isFull = bitmask & CLONE_SYMBOLS_FLAG; 21651 21652 if (customizer) { 21653 result = object ? customizer(value, key, object, stack) : customizer(value); 21654 } 21655 if (result !== undefined) { 21656 return result; 21657 } 21658 if (!isObject(value)) { 21659 return value; 21660 } 21661 var isArr = isArray(value); 21662 if (isArr) { 21663 result = initCloneArray(value); 21664 if (!isDeep) { 21665 return copyArray(value, result); 21666 } 21667 } else { 21668 var tag = getTag(value), 21669 isFunc = tag == funcTag || tag == genTag; 21670 21671 if (isBuffer(value)) { 21672 return cloneBuffer(value, isDeep); 21673 } 21674 if (tag == objectTag || tag == argsTag || isFunc && !object) { 21675 result = isFlat || isFunc ? {} : initCloneObject(value); 21676 if (!isDeep) { 21677 return isFlat ? copySymbolsIn(value, baseAssignIn(result, value)) : copySymbols(value, baseAssign(result, value)); 21678 } 21679 } else { 21680 if (!cloneableTags[tag]) { 21681 return object ? value : {}; 21682 } 21683 result = initCloneByTag(value, tag, baseClone, isDeep); 21684 } 21685 } 21686 // Check for circular references and return its corresponding clone. 21687 stack || (stack = new Stack()); 21688 var stacked = stack.get(value); 21689 if (stacked) { 21690 return stacked; 21691 } 21692 stack.set(value, result); 21693 21694 var keysFunc = isFull ? isFlat ? getAllKeysIn : getAllKeys : isFlat ? keysIn : keys; 21695 21696 var props = isArr ? undefined : keysFunc(value); 21697 arrayEach(props || value, function (subValue, key) { 21698 if (props) { 21699 key = subValue; 21700 subValue = value[key]; 21701 } 21702 // Recursively populate clone (susceptible to call stack limits). 21703 assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack)); 21704 }); 21705 return result; 21706 } 21707 21708 module.exports = baseClone; 21709 21710/***/ }, 21711/* 161 */ 21712/***/ function(module, exports) { 21713 21714 "use strict"; 21715 21716 /** 21717 * The base implementation of `_.findIndex` and `_.findLastIndex` without 21718 * support for iteratee shorthands. 21719 * 21720 * @private 21721 * @param {Array} array The array to inspect. 21722 * @param {Function} predicate The function invoked per iteration. 21723 * @param {number} fromIndex The index to search from. 21724 * @param {boolean} [fromRight] Specify iterating from right to left. 21725 * @returns {number} Returns the index of the matched value, else `-1`. 21726 */ 21727 function baseFindIndex(array, predicate, fromIndex, fromRight) { 21728 var length = array.length, 21729 index = fromIndex + (fromRight ? 1 : -1); 21730 21731 while (fromRight ? index-- : ++index < length) { 21732 if (predicate(array[index], index, array)) { 21733 return index; 21734 } 21735 } 21736 return -1; 21737 } 21738 21739 module.exports = baseFindIndex; 21740 21741/***/ }, 21742/* 162 */ 21743/***/ function(module, exports, __webpack_require__) { 21744 21745 'use strict'; 21746 21747 var baseFindIndex = __webpack_require__(161), 21748 baseIsNaN = __webpack_require__(485), 21749 strictIndexOf = __webpack_require__(559); 21750 21751 /** 21752 * The base implementation of `_.indexOf` without `fromIndex` bounds checks. 21753 * 21754 * @private 21755 * @param {Array} array The array to inspect. 21756 * @param {*} value The value to search for. 21757 * @param {number} fromIndex The index to search from. 21758 * @returns {number} Returns the index of the matched value, else `-1`. 21759 */ 21760 function baseIndexOf(array, value, fromIndex) {
21761 return value === value ? strictIndexOf(array, value, fromIndex) : baseFindIndex(array, baseIsNaN, fromIndex); 21762 } 21763 21764 module.exports = baseIndexOf; 21765 21766/***/ }, 21767/* 163 */ 21768/***/ function(module, exports, __webpack_require__) { 21769 21770 'use strict'; 21771 21772 var Uint8Array = __webpack_require__(239); 21773 21774 /** 21775 * Creates a clone of `arrayBuffer`. 21776 * 21777 * @private 21778 * @param {ArrayBuffer} arrayBuffer The array buffer to clone. 21779 * @returns {ArrayBuffer} Returns the cloned array buffer. 21780 */ 21781 function cloneArrayBuffer(arrayBuffer) { 21782 var result = new arrayBuffer.constructor(arrayBuffer.byteLength); 21783 new Uint8Array(result).set(new Uint8Array(arrayBuffer)); 21784 return result; 21785 } 21786 21787 module.exports = cloneArrayBuffer; 21788 21789/***/ }, 21790/* 164 */ 21791/***/ function(module, exports) { 21792 21793 "use strict"; 21794 21795 /** 21796 * Copies the values of `source` to `array`. 21797 * 21798 * @private 21799 * @param {Array} source The array to copy values from. 21800 * @param {Array} [array=[]] The array to copy values to. 21801 * @returns {Array} Returns `array`. 21802 */ 21803 function copyArray(source, array) { 21804 var index = -1, 21805 length = source.length; 21806 21807 array || (array = Array(length)); 21808 while (++index < length) { 21809 array[index] = source[index]; 21810 } 21811 return array; 21812 } 21813 21814 module.exports = copyArray; 21815 21816/***/ }, 21817/* 165 */ 21818/***/ function(module, exports, __webpack_require__) { 21819 21820 'use strict'; 21821 21822 var overArg = __webpack_require__(267); 21823 21824 /** Built-in value references. */ 21825 var getPrototype = overArg(Object.getPrototypeOf, Object); 21826 21827 module.exports = getPrototype; 21828 21829/***/ }, 21830/* 166 */ 21831/***/ function(module, exports, __webpack_require__) { 21832 21833 'use strict'; 21834 21835 var arrayFilter = __webpack_require__(468), 21836 stubArray = __webpack_require__(275); 21837 21838 /** Used for built-in method references. */ 21839 var objectProto = Object.prototype; 21840 21841 /** Built-in value references. */ 21842 var propertyIsEnumerable = objectProto.propertyIsEnumerable; 21843 21844 /* Built-in method references for those with the same name as other `lodash` methods. */ 21845 var nativeGetSymbols = Object.getOwnPropertySymbols; 21846 21847 /** 21848 * Creates an array of the own enumerable symbols of `object`. 21849 * 21850 * @private 21851 * @param {Object} object The object to query. 21852 * @returns {Array} Returns the array of symbols. 21853 */ 21854 var getSymbols = !nativeGetSymbols ? stubArray : function (object) { 21855 if (object == null) { 21856 return []; 21857 } 21858 object = Object(object); 21859 return arrayFilter(nativeGetSymbols(object), function (symbol) { 21860 return propertyIsEnumerable.call(object, symbol); 21861 }); 21862 }; 21863 21864 module.exports = getSymbols; 21865 21866/***/ }, 21867/* 167 */ 21868/***/ function(module, exports) { 21869 21870 'use strict'; 21871 21872 /** Used as references for various `Number` constants. */ 21873 var MAX_SAFE_INTEGER = 9007199254740991; 21874 21875 /** Used to detect unsigned integer values. */ 21876 var reIsUint = /^(?:0|[1-9]\d*)$/; 21877 21878 /** 21879 * Checks if `value` is a valid array-like index. 21880 * 21881 * @private 21882 * @param {*} value The value to check. 21883 * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. 21884 * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. 21885 */ 21886 function isIndex(value, length) { 21887 length = length == null ? MAX_SAFE_INTEGER : length; 21888 return !!length && (typeof value == 'number' || reIsUint.test(value)) && value > -1 && value % 1 == 0 && value < length; 21889 } 21890 21891 module.exports = isIndex; 21892 21893/***/ }, 21894/* 168 */ 21895/***/ function(module, exports, __webpack_require__) { 21896 21897 'use strict'; 21898 21899 var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; 21900 21901 var eq = __webpack_require__(45), 21902 isArrayLike = __webpack_require__(24), 21903 isIndex = __webpack_require__(167), 21904 isObject = __webpack_require__(16); 21905 21906 /** 21907 * Checks if the given arguments are from an iteratee call. 21908 * 21909 * @private 21910 * @param {*} value The potential iteratee value argument. 21911 * @param {*} index The potential iteratee index or key argument. 21912 * @param {*} object The potential iteratee object argument. 21913 * @returns {boolean} Returns `true` if the arguments are from an iteratee call, 21914 * else `false`. 21915 */ 21916 function isIterateeCall(value, index, object) { 21917 if (!isObject(object)) { 21918 return false;
21919 } 21920 var type = typeof index === 'undefined' ? 'undefined' : _typeof(index); 21921 if (type == 'number' ? isArrayLike(object) && isIndex(index, object.length) : type == 'string' && index in object) { 21922 return eq(object[index], value); 21923 } 21924 return false; 21925 } 21926 21927 module.exports = isIterateeCall; 21928 21929/***/ }, 21930/* 169 */ 21931/***/ function(module, exports, __webpack_require__) { 21932 21933 'use strict'; 21934 21935 var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; 21936 21937 var isArray = __webpack_require__(7), 21938 isSymbol = __webpack_require__(60); 21939 21940 /** Used to match property names within property paths. */ 21941 var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, 21942 reIsPlainProp = /^\w*$/; 21943 21944 /** 21945 * Checks if `value` is a property name and not a property path. 21946 * 21947 * @private 21948 * @param {*} value The value to check. 21949 * @param {Object} [object] The object to query keys on. 21950 * @returns {boolean} Returns `true` if `value` is a property name, else `false`. 21951 */ 21952 function isKey(value, object) { 21953 if (isArray(value)) { 21954 return false; 21955 } 21956 var type = typeof value === 'undefined' ? 'undefined' : _typeof(value); 21957 if (type == 'number' || type == 'symbol' || type == 'boolean' || value == null || isSymbol(value)) { 21958 return true; 21959 } 21960 return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || object != null && value in Object(object); 21961 } 21962 21963 module.exports = isKey; 21964 21965/***/ }, 21966/* 170 */ 21967/***/ function(module, exports, __webpack_require__) { 21968 21969 'use strict'; 21970 21971 var assignValue = __webpack_require__(158), 21972 copyObject = __webpack_require__(30), 21973 createAssigner = __webpack_require__(101), 21974 isArrayLike = __webpack_require__(24), 21975 isPrototype = __webpack_require__(103), 21976 keys = __webpack_require__(31); 21977 21978 /** Used for built-in method references. */ 21979 var objectProto = Object.prototype; 21980 21981 /** Used to check objects for own properties. */ 21982 var hasOwnProperty = objectProto.hasOwnProperty; 21983 21984 /** 21985 * Assigns own enumerable string keyed properties of source objects to the 21986 * destination object. Source objects are applied from left to right. 21987 * Subsequent sources overwrite property assignments of previous sources. 21988 * 21989 * **Note:** This method mutates `object` and is loosely based on 21990 * [`Object.assign`](https://mdn.io/Object/assign). 21991 * 21992 * @static 21993 * @memberOf _
21994 * @since 0.10.0 21995 * @category Object 21996 * @param {Object} object The destination object. 21997 * @param {...Object} [sources] The source objects. 21998 * @returns {Object} Returns `object`. 21999 * @see _.assignIn 22000 * @example 22001 * 22002 * function Foo() { 22003 * this.a = 1; 22004 * } 22005 * 22006 * function Bar() { 22007 * this.c = 3; 22008 * } 22009 * 22010 * Foo.prototype.b = 2; 22011 * Bar.prototype.d = 4; 22012 * 22013 * _.assign({ 'a': 0 }, new Foo, new Bar); 22014 * // => { 'a': 1, 'c': 3 } 22015 */ 22016 var assign = createAssigner(function (object, source) { 22017 if (isPrototype(source) || isArrayLike(source)) { 22018 copyObject(source, keys(source), object); 22019 return; 22020 } 22021 for (var key in source) { 22022 if (hasOwnProperty.call(source, key)) { 22023 assignValue(object, key, source[key]); 22024 } 22025 } 22026 }); 22027 22028 module.exports = assign; 22029 22030/***/ }, 22031/* 171 */ 22032/***/ function(module, exports, __webpack_require__) { 22033 22034 'use strict'; 22035 22036 var baseGetTag = __webpack_require__(29), 22037 isObject = __webpack_require__(16); 22038 22039 /** `Object#toString` result references. */ 22040 var asyncTag = '[object AsyncFunction]', 22041 funcTag = '[object Function]', 22042 genTag = '[object GeneratorFunction]', 22043 proxyTag = '[object Proxy]'; 22044 22045 /** 22046 * Checks if `value` is classified as a `Function` object. 22047 * 22048 * @static 22049 * @memberOf _ 22050 * @since 0.1.0 22051 * @category Lang 22052 * @param {*} value The value to check. 22053 * @returns {boolean} Returns `true` if `value` is a function, else `false`. 22054 * @example 22055 * 22056 * _.isFunction(_); 22057 * // => true 22058 * 22059 * _.isFunction(/abc/); 22060 * // => false 22061 */ 22062 function isFunction(value) { 22063 if (!isObject(value)) { 22064 return false; 22065 } 22066 // The use of `Object#toString` avoids issues with the `typeof` operator 22067 // in Safari 9 which returns 'object' for typed arrays and other constructors. 22068 var tag = baseGetTag(value); 22069 return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag; 22070 } 22071 22072 module.exports = isFunction; 22073 22074/***/ }, 22075/* 172 */ 22076/***/ function(module, exports) { 22077 22078 'use strict'; 22079 22080 /** Used as references for various `Number` constants. */ 22081 var MAX_SAFE_INTEGER = 9007199254740991; 22082 22083 /** 22084 * Checks if `value` is a valid array-like length. 22085 * 22086 * **Note:** This method is loosely based on 22087 * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). 22088 * 22089 * @static 22090 * @memberOf _ 22091 * @since 4.0.0 22092 * @category Lang 22093 * @param {*} value The value to check. 22094 * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. 22095 * @example 22096 * 22097 * _.isLength(3); 22098 * // => true 22099 * 22100 * _.isLength(Number.MIN_VALUE); 22101 * // => false 22102 * 22103 * _.isLength(Infinity); 22104 * // => false 22105 * 22106 * _.isLength('3'); 22107 * // => false 22108 */ 22109 function isLength(value) { 22110 return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; 22111 } 22112 22113 module.exports = isLength; 22114 22115/***/ }, 22116/* 173 */ 22117/***/ function(module, exports, __webpack_require__) { 22118 22119 'use strict'; 22120 22121 var baseIsTypedArray = __webpack_require__(488), 22122 baseUnary = __webpack_require__(100), 22123 nodeUtil = __webpack_require__(266); 22124 22125 /* Node.js helper references. */ 22126 var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; 22127 22128 /** 22129 * Checks if `value` is classified as a typed array. 22130 * 22131 * @static 22132 * @memberOf _ 22133 * @since 3.0.0 22134 * @category Lang 22135 * @param {*} value The value to check. 22136 * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. 22137 * @example 22138 * 22139 * _.isTypedArray(new Uint8Array); 22140 * // => true 22141 * 22142 * _.isTypedArray([]); 22143 * // => false 22144 */ 22145 var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; 22146 22147 module.exports = isTypedArray; 22148 22149/***/ }, 22150/* 174 */ 22151/***/ function(module, exports, __webpack_require__) { 22152 22153 var map = { 22154 "./index": 49, 22155 "./index.js": 49, 22156 "./logger": 117, 22157 "./logger.js": 117, 22158 "./metadata": 118, 22159 "./metadata.js": 118, 22160 "./options/build-config-chain": 50, 22161 "./options/build-config-chain.js": 50, 22162 "./options/config": 32, 22163 "./options/config.js": 32, 22164 "./options/index": 51, 22165 "./options/index.js": 51, 22166 "./options/option-manager": 33, 22167 "./options/option-manager.js": 33, 22168 "./options/parsers": 52, 22169 "./options/parsers.js": 52, 22170 "./options/removed": 53, 22171 "./options/removed.js": 53 22172 }; 22173 function webpackContext(req) { 22174 return __webpack_require__(webpackContextResolve(req)); 22175 }; 22176 function webpackContextResolve(req) { 22177 return map[req] || (function() { throw new Error("Cannot find module '" + req + "'.") }()); 22178 }; 22179 webpackContext.keys = function webpackContextKeys() { 22180 return Object.keys(map); 22181 }; 22182 webpackContext.resolve = webpackContextResolve; 22183 module.exports = webpackContext; 22184 webpackContext.id = 174; 22185 22186 22187/***/ }, 22188/* 175 */ 22189/***/ function(module, exports, __webpack_require__) { 22190 22191 var map = { 22192 "./build-config-chain": 50, 22193 "./build-config-chain.js": 50, 22194 "./config": 32, 22195 "./config.js": 32, 22196 "./index": 51, 22197 "./index.js": 51,
22198 "./option-manager": 33, 22199 "./option-manager.js": 33, 22200 "./parsers": 52, 22201 "./parsers.js": 52, 22202 "./removed": 53, 22203 "./removed.js": 53 22204 }; 22205 function webpackContext(req) { 22206 return __webpack_require__(webpackContextResolve(req)); 22207 }; 22208 function webpackContextResolve(req) { 22209 return map[req] || (function() { throw new Error("Cannot find module '" + req + "'.") }()); 22210 }; 22211 webpackContext.keys = function webpackContextKeys() { 22212 return Object.keys(map); 22213 }; 22214 webpackContext.resolve = webpackContextResolve; 22215 module.exports = webpackContext; 22216 webpackContext.id = 175; 22217 22218 22219/***/ }, 22220/* 176 */ 22221/***/ function(module, exports) { 22222 22223 'use strict'; 22224 22225 module.exports = function () { 22226 return (/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-PRZcf-nqry=><]/g 22227 ); 22228 }; 22229 22230/***/ }, 22231/* 177 */ 22232/***/ function(module, exports, __webpack_require__) { 22233 22234 "use strict"; 22235 22236 exports.__esModule = true; 22237 22238 exports.default = function (rawLines, lineNumber, colNumber) { 22239 var opts = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}; 22240 22241 colNumber = Math.max(colNumber, 0); 22242 22243 var highlighted = opts.highlightCode && _chalk2.default.supportsColor || opts.forceColor; 22244 var chalk = _chalk2.default; 22245 if (opts.forceColor) { 22246 chalk = new _chalk2.default.constructor({ enabled: true }); 22247 } 22248 var maybeHighlight = function maybeHighlight(chalkFn, string) { 22249 return highlighted ? chalkFn(string) : string; 22250 }; 22251 var defs = getDefs(chalk); 22252 if (highlighted) rawLines = highlight(defs, rawLines); 22253 22254 var linesAbove = opts.linesAbove || 2; 22255 var linesBelow = opts.linesBelow || 3; 22256 22257 var lines = rawLines.split(NEWLINE); 22258 var start = Math.max(lineNumber - (linesAbove + 1), 0); 22259 var end = Math.min(lines.length, lineNumber + linesBelow); 22260 22261 if (!lineNumber && !colNumber) { 22262 start = 0; 22263 end = lines.length; 22264 } 22265 22266 var numberMaxWidth = String(end).length; 22267 22268 var frame = lines.slice(start, end).map(function (line, index) { 22269 var number = start + 1 + index; 22270 var paddedNumber = (" " + number).slice(-numberMaxWidth); 22271 var gutter = " " + paddedNumber + " | "; 22272 if (number === lineNumber) { 22273 var markerLine = ""; 22274 if (colNumber) { 22275 var markerSpacing = line.slice(0, colNumber - 1).replace(/[^\t]/g, " "); 22276 markerLine = ["\n ", maybeHighlight(defs.gutter, gutter.replace(/\d/g, " ")), markerSpacing, maybeHighlight(defs.marker, "^")].join(""); 22277 } 22278 return [maybeHighlight(defs.marker, ">"), maybeHighlight(defs.gutter, gutter), line, markerLine].join(""); 22279 } else { 22280 return " " + maybeHighlight(defs.gutter, gutter) + line; 22281 } 22282 }).join("\n"); 22283 22284 if (highlighted) { 22285 return chalk.reset(frame); 22286 } else { 22287 return frame; 22288 } 22289 }; 22290 22291 var _jsTokens = __webpack_require__(457); 22292 22293 var _jsTokens2 = _interopRequireDefault(_jsTokens); 22294 22295 var _esutils = __webpack_require__(154); 22296 22297 var _esutils2 = _interopRequireDefault(_esutils); 22298 22299 var _chalk = __webpack_require__(395); 22300 22301 var _chalk2 = _interopRequireDefault(_chalk); 22302 22303 function _interopRequireDefault(obj) { 22304 return obj && obj.__esModule ? obj : { default: obj }; 22305 } 22306 22307 function getDefs(chalk) { 22308 return { 22309 keyword: chalk.cyan,
22310 capitalized: chalk.yellow, 22311 jsx_tag: chalk.yellow, 22312 punctuator: chalk.yellow, 22313 22314 number: chalk.magenta, 22315 string: chalk.green, 22316 regex: chalk.magenta, 22317 comment: chalk.grey, 22318 invalid: chalk.white.bgRed.bold, 22319 gutter: chalk.grey, 22320 marker: chalk.red.bold 22321 }; 22322 } 22323 22324 var NEWLINE = /\r\n|[\n\r\u2028\u2029]/; 22325 22326 var JSX_TAG = /^[a-z][\w-]*$/i; 22327 22328 var BRACKET = /^[()\[\]{}]$/; 22329 22330 function getTokenType(match) { 22331 var _match$slice = match.slice(-2), 22332 offset = _match$slice[0], 22333 text = _match$slice[1]; 22334 22335 var token = (0, _jsTokens.matchToToken)(match); 22336 22337 if (token.type === "name") { 22338 if (_esutils2.default.keyword.isReservedWordES6(token.value)) { 22339 return "keyword"; 22340 } 22341 22342 if (JSX_TAG.test(token.value) && (text[offset - 1] === "<" || text.substr(offset - 2, 2) == "</")) { 22343 return "jsx_tag"; 22344 } 22345 22346 if (token.value[0] !== token.value[0].toLowerCase()) { 22347 return "capitalized"; 22348 } 22349 } 22350 22351 if (token.type === "punctuator" && BRACKET.test(token.value)) { 22352 return "bracket"; 22353 } 22354 22355 return token.type; 22356 } 22357 22358 function highlight(defs, text) { 22359 return text.replace(_jsTokens2.default, function () { 22360 for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { 22361 args[_key] = arguments[_key]; 22362 } 22363 22364 var type = getTokenType(args); 22365 var colorize = defs[type]; 22366 if (colorize) { 22367 return args[0].split(NEWLINE).map(function (str) { 22368 return colorize(str); 22369 }).join("\n"); 22370 } else { 22371 return args[0]; 22372 } 22373 }); 22374 } 22375 22376 module.exports = exports["default"]; 22377 22378/***/ }, 22379/* 178 */ 22380/***/ function(module, exports, __webpack_require__) { 22381 22382 "use strict"; 22383 22384 exports.__esModule = true; 22385 exports.transformFromAst = exports.transform = exports.analyse = exports.Pipeline = exports.OptionManager = exports.traverse = exports.types = exports.messages = exports.util = exports.version = exports.resolvePreset = exports.resolvePlugin = exports.template = exports.buildExternalHelpers = exports.options = exports.File = undefined; 22386 22387 var _file = __webpack_require__(49); 22388 22389 Object.defineProperty(exports, "File", { 22390 enumerable: true, 22391 get: function get() { 22392 return _interopRequireDefault(_file).default; 22393 } 22394 }); 22395 22396 var _config = __webpack_require__(32); 22397 22398 Object.defineProperty(exports, "options", { 22399 enumerable: true, 22400 get: function get() { 22401 return _interopRequireDefault(_config).default; 22402 } 22403 }); 22404 22405 var _buildExternalHelpers = __webpack_require__(292); 22406 22407 Object.defineProperty(exports, "buildExternalHelpers", { 22408 enumerable: true, 22409 get: function get() { 22410 return _interopRequireDefault(_buildExternalHelpers).default; 22411 } 22412 }); 22413 22414 var _babelTemplate = __webpack_require__(4); 22415 22416 Object.defineProperty(exports, "template", { 22417 enumerable: true, 22418 get: function get() { 22419 return _interopRequireDefault(_babelTemplate).default; 22420 } 22421 }); 22422 22423 var _resolvePlugin = __webpack_require__(180); 22424 22425 Object.defineProperty(exports, "resolvePlugin", { 22426 enumerable: true, 22427 get: function get() { 22428 return _interopRequireDefault(_resolvePlugin).default; 22429 } 22430 }); 22431 22432 var _resolvePreset = __webpack_require__(181); 22433 22434 Object.defineProperty(exports, "resolvePreset", { 22435 enumerable: true, 22436 get: function get() { 22437 return _interopRequireDefault(_resolvePreset).default; 22438 } 22439 }); 22440 22441 var _package = __webpack_require__(616); 22442 22443 Object.defineProperty(exports, "version", { 22444 enumerable: true, 22445 get: function get() { 22446 return _package.version; 22447 } 22448 }); 22449 exports.Plugin = Plugin; 22450 exports.transformFile = transformFile; 22451 exports.transformFileSync = transformFileSync; 22452 22453 var _fs = __webpack_require__(113); 22454 22455 var _fs2 = _interopRequireDefault(_fs); 22456 22457 var _util = __webpack_require__(119); 22458 22459 var util = _interopRequireWildcard(_util); 22460 22461 var _babelMessages = __webpack_require__(18); 22462 22463 var messages = _interopRequireWildcard(_babelMessages); 22464 22465 var _babelTypes = __webpack_require__(1); 22466 22467 var t = _interopRequireWildcard(_babelTypes); 22468 22469 var _babelTraverse = __webpack_require__(8); 22470 22471 var _babelTraverse2 = _interopRequireDefault(_babelTraverse); 22472 22473 var _optionManager = __webpack_require__(33); 22474 22475 var _optionManager2 = _interopRequireDefault(_optionManager); 22476 22477 var _pipeline = __webpack_require__(295); 22478 22479 var _pipeline2 = _interopRequireDefault(_pipeline); 22480 22481 function _interopRequireWildcard(obj) { 22482 if (obj && obj.__esModule) { 22483 return obj; 22484 } else { 22485 var newObj = {};if (obj != null) { 22486 for (var key in obj) { 22487 if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; 22488 } 22489 }newObj.default = obj;return newObj; 22490 } 22491 } 22492 22493 function _interopRequireDefault(obj) { 22494 return obj && obj.__esModule ? obj : { default: obj }; 22495 } 22496 22497 exports.util = util;
22498 exports.messages = messages; 22499 exports.types = t; 22500 exports.traverse = _babelTraverse2.default; 22501 exports.OptionManager = _optionManager2.default; 22502 function Plugin(alias) { 22503 throw new Error("The (" + alias + ") Babel 5 plugin is being run with Babel 6."); 22504 } 22505 22506 exports.Pipeline = _pipeline2.default; 22507 22508 var pipeline = new _pipeline2.default(); 22509 var analyse = exports.analyse = pipeline.analyse.bind(pipeline); 22510 var transform = exports.transform = pipeline.transform.bind(pipeline); 22511 var transformFromAst = exports.transformFromAst = pipeline.transformFromAst.bind(pipeline); 22512 22513 function transformFile(filename, opts, callback) { 22514 if (typeof opts === "function") { 22515 callback = opts; 22516 opts = {}; 22517 } 22518 22519 opts.filename = filename; 22520 22521 _fs2.default.readFile(filename, function (err, code) { 22522 var result = void 0; 22523 22524 if (!err) { 22525 try { 22526 result = transform(code, opts); 22527 } catch (_err) { 22528 err = _err; 22529 } 22530 } 22531 22532 if (err) { 22533 callback(err); 22534 } else { 22535 callback(null, result); 22536 } 22537 }); 22538 } 22539 22540 function transformFileSync(filename) { 22541 var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; 22542 22543 opts.filename = filename; 22544 return transform(_fs2.default.readFileSync(filename, "utf8"), opts); 22545 } 22546 22547/***/ }, 22548/* 179 */ 22549/***/ function(module, exports, __webpack_require__) { 22550 22551 "use strict"; 22552 22553 exports.__esModule = true; 22554 exports.default = resolveFromPossibleNames; 22555 22556 var _resolve = __webpack_require__(115); 22557 22558 var _resolve2 = _interopRequireDefault(_resolve); 22559 22560 function _interopRequireDefault(obj) { 22561 return obj && obj.__esModule ? obj : { default: obj }; 22562 } 22563 22564 function resolveFromPossibleNames(possibleNames, dirname) { 22565 return possibleNames.reduce(function (accum, curr) { 22566 return accum || (0, _resolve2.default)(curr, dirname); 22567 }, null); 22568 } 22569 module.exports = exports["default"]; 22570 22571/***/ }, 22572/* 180 */ 22573/***/ function(module, exports, __webpack_require__) { 22574 22575 /* WEBPACK VAR INJECTION */(function(process) {"use strict"; 22576 22577 exports.__esModule = true; 22578 exports.default = resolvePlugin; 22579 22580 var _resolveFromPossibleNames = __webpack_require__(179); 22581 22582 var _resolveFromPossibleNames2 = _interopRequireDefault(_resolveFromPossibleNames); 22583 22584 var _getPossiblePluginNames = __webpack_require__(288); 22585 22586 var _getPossiblePluginNames2 = _interopRequireDefault(_getPossiblePluginNames); 22587 22588 function _interopRequireDefault(obj) { 22589 return obj && obj.__esModule ? obj : { default: obj }; 22590 } 22591 22592 function resolvePlugin(pluginName) { 22593 var dirname = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : process.cwd(); 22594 22595 return (0, _resolveFromPossibleNames2.default)((0, _getPossiblePluginNames2.default)(pluginName), dirname); 22596 } 22597 module.exports = exports["default"]; 22598 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(9))) 22599 22600/***/ }, 22601/* 181 */ 22602/***/ function(module, exports, __webpack_require__) { 22603 22604 /* WEBPACK VAR INJECTION */(function(process) {"use strict"; 22605 22606 exports.__esModule = true; 22607 exports.default = resolvePreset; 22608 22609 var _resolveFromPossibleNames = __webpack_require__(179); 22610 22611 var _resolveFromPossibleNames2 = _interopRequireDefault(_resolveFromPossibleNames); 22612 22613 var _getPossiblePresetNames = __webpack_require__(289); 22614 22615 var _getPossiblePresetNames2 = _interopRequireDefault(_getPossiblePresetNames); 22616 22617 function _interopRequireDefault(obj) { 22618 return obj && obj.__esModule ? obj : { default: obj }; 22619 } 22620 22621 function resolvePreset(presetName) { 22622 var dirname = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : process.cwd(); 22623 22624 return (0, _resolveFromPossibleNames2.default)((0, _getPossiblePresetNames2.default)(presetName), dirname); 22625 } 22626 module.exports = exports["default"]; 22627 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(9))) 22628 22629/***/ }, 22630/* 182 */ 22631/***/ function(module, exports, __webpack_require__) { 22632 22633 "use strict"; 22634 22635 exports.__esModule = true; 22636 exports.CodeGenerator = undefined; 22637 22638 var _classCallCheck2 = __webpack_require__(3); 22639 22640 var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); 22641 22642 var _possibleConstructorReturn2 = __webpack_require__(42); 22643 22644 var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); 22645 22646 var _inherits2 = __webpack_require__(41); 22647 22648 var _inherits3 = _interopRequireDefault(_inherits2); 22649 22650 exports.default = function (ast, opts, code) { 22651 var gen = new Generator(ast, opts, code); 22652 return gen.generate(); 22653 }; 22654 22655 var _detectIndent = __webpack_require__(448); 22656 22657 var _detectIndent2 = _interopRequireDefault(_detectIndent); 22658 22659 var _sourceMap = __webpack_require__(310); 22660 22661 var _sourceMap2 = _interopRequireDefault(_sourceMap); 22662 22663 var _babelMessages = __webpack_require__(18); 22664 22665 var messages = _interopRequireWildcard(_babelMessages); 22666 22667 var _printer = __webpack_require__(309); 22668 22669 var _printer2 = _interopRequireDefault(_printer); 22670 22671 function _interopRequireWildcard(obj) { 22672 if (obj && obj.__esModule) { 22673 return obj; 22674 } else { 22675 var newObj = {};if (obj != null) { 22676 for (var key in obj) { 22677 if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; 22678 } 22679 }newObj.default = obj;return newObj; 22680 } 22681 } 22682 22683 function _interopRequireDefault(obj) { 22684 return obj && obj.__esModule ? obj : { default: obj }; 22685 } 22686 22687 var Generator = function (_Printer) { 22688 (0, _inherits3.default)(Generator, _Printer); 22689 22690 function Generator(ast) { 22691 var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; 22692 var code = arguments[2]; 22693 (0, _classCallCheck3.default)(this, Generator); 22694 22695 var tokens = ast.tokens || []; 22696 var format = normalizeOptions(code, opts, tokens); 22697 var map = opts.sourceMaps ? new _sourceMap2.default(opts, code) : null; 22698 22699 var _this = (0, _possibleConstructorReturn3.default)(this, _Printer.call(this, format, map, tokens)); 22700 22701 _this.ast = ast; 22702 return _this; 22703 } 22704 22705 Generator.prototype.generate = function generate() { 22706 return _Printer.prototype.generate.call(this, this.ast); 22707 }; 22708 22709 return Generator; 22710 }(_printer2.default); 22711 22712 function normalizeOptions(code, opts, tokens) { 22713 var style = " "; 22714 if (code && typeof code === "string") { 22715 var indent = (0, _detectIndent2.default)(code).indent; 22716 if (indent && indent !== " ") style = indent; 22717 } 22718 22719 var format = { 22720 auxiliaryCommentBefore: opts.auxiliaryCommentBefore, 22721 auxiliaryCommentAfter: opts.auxiliaryCommentAfter, 22722 shouldPrintComment: opts.shouldPrintComment, 22723 retainLines: opts.retainLines, 22724 retainFunctionParens: opts.retainFunctionParens,
22725 comments: opts.comments == null || opts.comments, 22726 compact: opts.compact, 22727 minified: opts.minified, 22728 concise: opts.concise, 22729 quotes: opts.quotes || findCommonStringDelimiter(code, tokens), 22730 jsonCompatibleStrings: opts.jsonCompatibleStrings, 22731 indent: { 22732 adjustMultilineComment: true, 22733 style: style, 22734 base: 0 22735 }, 22736 flowCommaSeparator: opts.flowCommaSeparator 22737 }; 22738 22739 if (format.minified) { 22740 format.compact = true; 22741 22742 format.shouldPrintComment = format.shouldPrintComment || function () { 22743 return format.comments; 22744 }; 22745 } else { 22746 format.shouldPrintComment = format.shouldPrintComment || function (value) { 22747 return format.comments || value.indexOf("@license") >= 0 || value.indexOf("@preserve") >= 0; 22748 }; 22749 } 22750 22751 if (format.compact === "auto") { 22752 format.compact = code.length > 500000; 22753 22754 if (format.compact) { 22755 console.error("[BABEL] " + messages.get("codeGeneratorDeopt", opts.filename, "500KB")); 22756 } 22757 } 22758 22759 if (format.compact) { 22760 format.indent.adjustMultilineComment = false; 22761 } 22762 22763 return format; 22764 } 22765 22766 function findCommonStringDelimiter(code, tokens) { 22767 var DEFAULT_STRING_DELIMITER = "double"; 22768 if (!code) { 22769 return DEFAULT_STRING_DELIMITER; 22770 } 22771 22772 var occurences = { 22773 single: 0, 22774 double: 0 22775 }; 22776 22777 var checked = 0; 22778 22779 for (var i = 0; i < tokens.length; i++) { 22780 var token = tokens[i]; 22781 if (token.type.label !== "string") continue; 22782 22783 var raw = code.slice(token.start, token.end); 22784 if (raw[0] === "'") { 22785 occurences.single++; 22786 } else { 22787 occurences.double++; 22788 } 22789 22790 checked++; 22791 if (checked >= 3) break; 22792 } 22793 if (occurences.single > occurences.double) { 22794 return "single"; 22795 } else { 22796 return "double"; 22797 } 22798 } 22799 22800 var CodeGenerator = exports.CodeGenerator = function () { 22801 function CodeGenerator(ast, opts, code) { 22802 (0, _classCallCheck3.default)(this, CodeGenerator); 22803 22804 this._generator = new Generator(ast, opts, code); 22805 } 22806 22807 CodeGenerator.prototype.generate = function generate() { 22808 return this._generator.generate(); 22809 }; 22810 22811 return CodeGenerator; 22812 }(); 22813 22814/***/ }, 22815/* 183 */ 22816/***/ function(module, exports, __webpack_require__) { 22817 22818 "use strict"; 22819 22820 exports.__esModule = true; 22821 22822 var _getIterator2 = __webpack_require__(2); 22823 22824 var _getIterator3 = _interopRequireDefault(_getIterator2); 22825 22826 var _keys = __webpack_require__(13); 22827 22828 var _keys2 = _interopRequireDefault(_keys); 22829 22830 exports.needsWhitespace = needsWhitespace; 22831 exports.needsWhitespaceBefore = needsWhitespaceBefore; 22832 exports.needsWhitespaceAfter = needsWhitespaceAfter; 22833 exports.needsParens = needsParens; 22834 22835 var _whitespace = __webpack_require__(308); 22836 22837 var _whitespace2 = _interopRequireDefault(_whitespace); 22838 22839 var _parentheses = __webpack_require__(307); 22840 22841 var parens = _interopRequireWildcard(_parentheses); 22842 22843 var _babelTypes = __webpack_require__(1); 22844 22845 var t = _interopRequireWildcard(_babelTypes); 22846 22847 function _interopRequireWildcard(obj) { 22848 if (obj && obj.__esModule) { 22849 return obj; 22850 } else { 22851 var newObj = {};if (obj != null) { 22852 for (var key in obj) { 22853 if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; 22854 } 22855 }newObj.default = obj;return newObj; 22856 } 22857 } 22858 22859 function _interopRequireDefault(obj) { 22860 return obj && obj.__esModule ? obj : { default: obj }; 22861 } 22862 22863 function expandAliases(obj) { 22864 var newObj = {}; 22865 22866 function add(type, func) { 22867 var fn = newObj[type]; 22868 newObj[type] = fn ? function (node, parent, stack) { 22869 var result = fn(node, parent, stack); 22870 22871 return result == null ? func(node, parent, stack) : result; 22872 } : func; 22873 } 22874 22875 for (var _iterator = (0, _keys2.default)(obj), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) { 22876 var _ref; 22877 22878 if (_isArray) { 22879 if (_i >= _iterator.length) break; 22880 _ref = _iterator[_i++]; 22881 } else { 22882 _i = _iterator.next(); 22883 if (_i.done) break; 22884 _ref = _i.value; 22885 } 22886 22887 var type = _ref; 22888 22889 var aliases = t.FLIPPED_ALIAS_KEYS[type]; 22890 if (aliases) { 22891 for (var _iterator2 = aliases, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) { 22892 var _ref2; 22893 22894 if (_isArray2) { 22895 if (_i2 >= _iterator2.length) break; 22896 _ref2 = _iterator2[_i2++]; 22897 } else { 22898 _i2 = _iterator2.next(); 22899 if (_i2.done) break; 22900 _ref2 = _i2.value; 22901 } 22902 22903 var alias = _ref2; 22904 22905 add(alias, obj[type]); 22906 } 22907 } else { 22908 add(type, obj[type]); 22909 } 22910 } 22911 22912 return newObj; 22913 } 22914 22915 var expandedParens = expandAliases(parens); 22916 var expandedWhitespaceNodes = expandAliases(_whitespace2.default.nodes); 22917 var expandedWhitespaceList = expandAliases(_whitespace2.default.list); 22918 22919 function find(obj, node, parent, printStack) { 22920 var fn = obj[node.type]; 22921 return fn ? fn(node, parent, printStack) : null; 22922 } 22923 22924 function isOrHasCallExpression(node) { 22925 if (t.isCallExpression(node)) { 22926 return true; 22927 } 22928 22929 if (t.isMemberExpression(node)) { 22930 return isOrHasCallExpression(node.object) || !node.computed && isOrHasCallExpression(node.property); 22931 } else { 22932 return false;
22933 } 22934 } 22935 22936 function needsWhitespace(node, parent, type) { 22937 if (!node) return 0; 22938 22939 if (t.isExpressionStatement(node)) { 22940 node = node.expression; 22941 } 22942 22943 var linesInfo = find(expandedWhitespaceNodes, node, parent); 22944 22945 if (!linesInfo) { 22946 var items = find(expandedWhitespaceList, node, parent); 22947 if (items) { 22948 for (var i = 0; i < items.length; i++) { 22949 linesInfo = needsWhitespace(items[i], node, type); 22950 if (linesInfo) break; 22951 } 22952 } 22953 } 22954 22955 return linesInfo && linesInfo[type] || 0; 22956 } 22957 22958 function needsWhitespaceBefore(node, parent) { 22959 return needsWhitespace(node, parent, "before"); 22960 } 22961 22962 function needsWhitespaceAfter(node, parent) { 22963 return needsWhitespace(node, parent, "after"); 22964 } 22965 22966 function needsParens(node, parent, printStack) { 22967 if (!parent) return false; 22968 22969 if (t.isNewExpression(parent) && parent.callee === node) { 22970 if (isOrHasCallExpression(node)) return true; 22971 } 22972 22973 return find(expandedParens, node, parent, printStack); 22974 } 22975 22976/***/ }, 22977/* 184 */ 22978/***/ function(module, exports, __webpack_require__) { 22979 22980 "use strict"; 22981 22982 exports.__esModule = true; 22983 22984 exports.default = function (opts) { 22985 var visitor = {}; 22986 22987 visitor.JSXNamespacedName = function (path) { 22988 throw path.buildCodeFrameError("Namespace tags are not supported. ReactJSX is not XML."); 22989 }; 22990 22991 visitor.JSXElement = { 22992 exit: function exit(path, file) { 22993 var callExpr = buildElementCall(path.get("openingElement"), file); 22994 22995 callExpr.arguments = callExpr.arguments.concat(path.node.children); 22996 22997 if (callExpr.arguments.length >= 3) { 22998 callExpr._prettyCall = true; 22999 } 23000 23001 path.replaceWith(t.inherits(callExpr, path.node)); 23002 } 23003 }; 23004 23005 return visitor; 23006 23007 function convertJSXIdentifier(node, parent) { 23008 if (t.isJSXIdentifier(node)) { 23009 if (node.name === "this" && t.isReferenced(node, parent)) { 23010 return t.thisExpression(); 23011 } else if (_esutils2.default.keyword.isIdentifierNameES6(node.name)) { 23012 node.type = "Identifier"; 23013 } else { 23014 return t.stringLiteral(node.name); 23015 } 23016 } else if (t.isJSXMemberExpression(node)) { 23017 return t.memberExpression(convertJSXIdentifier(node.object, node), convertJSXIdentifier(node.property, node)); 23018 } 23019 23020 return node; 23021 } 23022 23023 function convertAttributeValue(node) { 23024 if (t.isJSXExpressionContainer(node)) { 23025 return node.expression; 23026 } else { 23027 return node; 23028 } 23029 } 23030 23031 function convertAttribute(node) { 23032 var value = convertAttributeValue(node.value || t.booleanLiteral(true)); 23033 23034 if (t.isStringLiteral(value) && !t.isJSXExpressionContainer(node.value)) { 23035 value.value = value.value.replace(/\n\s+/g, " "); 23036 } 23037 23038 if (t.isValidIdentifier(node.name.name)) { 23039 node.name.type = "Identifier"; 23040 } else { 23041 node.name = t.stringLiteral(node.name.name); 23042 } 23043 23044 return t.inherits(t.objectProperty(node.name, value), node); 23045 } 23046 23047 function buildElementCall(path, file) { 23048 path.parent.children = t.react.buildChildren(path.parent); 23049 23050 var tagExpr = convertJSXIdentifier(path.node.name, path.node); 23051 var args = []; 23052 23053 var tagName = void 0; 23054 if (t.isIdentifier(tagExpr)) { 23055 tagName = tagExpr.name; 23056 } else if (t.isLiteral(tagExpr)) { 23057 tagName = tagExpr.value; 23058 } 23059 23060 var state = { 23061 tagExpr: tagExpr, 23062 tagName: tagName, 23063 args: args 23064 }; 23065 23066 if (opts.pre) { 23067 opts.pre(state, file); 23068 } 23069 23070 var attribs = path.node.attributes; 23071 if (attribs.length) { 23072 attribs = buildOpeningElementAttributes(attribs, file); 23073 } else { 23074 attribs = t.nullLiteral(); 23075 } 23076 23077 args.push(attribs); 23078 23079 if (opts.post) { 23080 opts.post(state, file); 23081 } 23082 23083 return state.call || t.callExpression(state.callee, args); 23084 } 23085 23086 function buildOpeningElementAttributes(attribs, file) { 23087 var _props = []; 23088 var objs = []; 23089 23090 var useBuiltIns = file.opts.useBuiltIns || false; 23091 if (typeof useBuiltIns !== "boolean") { 23092 throw new Error("transform-react-jsx currently only accepts a boolean option for " + "useBuiltIns (defaults to false)"); 23093 } 23094 23095 function pushProps() { 23096 if (!_props.length) return; 23097 23098 objs.push(t.objectExpression(_props)); 23099 _props = []; 23100 } 23101 23102 while (attribs.length) { 23103 var prop = attribs.shift(); 23104 if (t.isJSXSpreadAttribute(prop)) { 23105 pushProps(); 23106 objs.push(prop.argument); 23107 } else { 23108 _props.push(convertAttribute(prop)); 23109 } 23110 } 23111 23112 pushProps(); 23113 23114 if (objs.length === 1) { 23115 attribs = objs[0]; 23116 } else { 23117 if (!t.isObjectExpression(objs[0])) { 23118 objs.unshift(t.objectExpression([])); 23119 } 23120 23121 var helper = useBuiltIns ? t.memberExpression(t.identifier("Object"), t.identifier("assign")) : file.addHelper("extends"); 23122 23123 attribs = t.callExpression(helper, objs); 23124 } 23125 23126 return attribs; 23127 } 23128 }; 23129 23130 var _esutils = __webpack_require__(154); 23131 23132 var _esutils2 = _interopRequireDefault(_esutils); 23133 23134 var _babelTypes = __webpack_require__(1); 23135 23136 var t = _interopRequireWildcard(_babelTypes); 23137 23138 function _interopRequireWildcard(obj) { 23139 if (obj && obj.__esModule) { 23140 return obj; 23141 } else { 23142 var newObj = {};if (obj != null) { 23143 for (var key in obj) { 23144 if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; 23145 } 23146 }newObj.default = obj;return newObj; 23147 } 23148 } 23149 23150 function _interopRequireDefault(obj) { 23151 return obj && obj.__esModule ? obj : { default: obj }; 23152 } 23153 23154 module.exports = exports["default"]; 23155 23156/***/ }, 23157/* 185 */ 23158/***/ function(module, exports, __webpack_require__) { 23159 23160 "use strict"; 23161 23162 exports.__esModule = true; 23163 23164 var _keys = __webpack_require__(13); 23165 23166 var _keys2 = _interopRequireDefault(_keys); 23167 23168 exports.push = push; 23169 exports.hasComputed = hasComputed; 23170 exports.toComputedObjectFromClass = toComputedObjectFromClass; 23171 exports.toClassObject = toClassObject;
23172 exports.toDefineObject = toDefineObject; 23173 23174 var _babelHelperFunctionName = __webpack_require__(40); 23175 23176 var _babelHelperFunctionName2 = _interopRequireDefault(_babelHelperFunctionName); 23177 23178 var _has = __webpack_require__(270); 23179 23180 var _has2 = _interopRequireDefault(_has); 23181 23182 var _babelTypes = __webpack_require__(1); 23183 23184 var t = _interopRequireWildcard(_babelTypes); 23185 23186 function _interopRequireWildcard(obj) { 23187 if (obj && obj.__esModule) { 23188 return obj; 23189 } else { 23190 var newObj = {};if (obj != null) { 23191 for (var key in obj) { 23192 if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; 23193 } 23194 }newObj.default = obj;return newObj; 23195 } 23196 } 23197 23198 function _interopRequireDefault(obj) { 23199 return obj && obj.__esModule ? obj : { default: obj }; 23200 } 23201 23202 function toKind(node) { 23203 if (t.isClassMethod(node) || t.isObjectMethod(node)) { 23204 if (node.kind === "get" || node.kind === "set") { 23205 return node.kind; 23206 } 23207 } 23208 23209 return "value"; 23210 } 23211 23212 function push(mutatorMap, node, kind, file, scope) { 23213 var alias = t.toKeyAlias(node); 23214 23215 var map = {}; 23216 if ((0, _has2.default)(mutatorMap, alias)) map = mutatorMap[alias]; 23217 mutatorMap[alias] = map; 23218 23219 map._inherits = map._inherits || []; 23220 map._inherits.push(node); 23221 23222 map._key = node.key; 23223 23224 if (node.computed) { 23225 map._computed = true; 23226 } 23227 23228 if (node.decorators) { 23229 var decorators = map.decorators = map.decorators || t.arrayExpression([]); 23230 decorators.elements = decorators.elements.concat(node.decorators.map(function (dec) { 23231 return dec.expression; 23232 }).reverse()); 23233 } 23234 23235 if (map.value || map.initializer) { 23236 throw file.buildCodeFrameError(node, "Key conflict with sibling node"); 23237 } 23238 23239 var key = void 0, 23240 value = void 0; 23241 23242 if (t.isObjectProperty(node) || t.isObjectMethod(node) || t.isClassMethod(node)) { 23243 key = t.toComputedKey(node, node.key); 23244 } 23245 23246 if (t.isObjectProperty(node) || t.isClassProperty(node)) { 23247 value = node.value; 23248 } else if (t.isObjectMethod(node) || t.isClassMethod(node)) { 23249 value = t.functionExpression(null, node.params, node.body, node.generator, node.async); 23250 value.returnType = node.returnType; 23251 } 23252 23253 var inheritedKind = toKind(node); 23254 if (!kind || inheritedKind !== "value") { 23255 kind = inheritedKind; 23256 } 23257 23258 if (scope && t.isStringLiteral(key) && (kind === "value" || kind === "initializer") && t.isFunctionExpression(value)) { 23259 value = (0, _babelHelperFunctionName2.default)({ id: key, node: value, scope: scope }); 23260 } 23261 23262 if (value) { 23263 t.inheritsComments(value, node); 23264 map[kind] = value; 23265 } 23266 23267 return map; 23268 } 23269 23270 function hasComputed(mutatorMap) { 23271 for (var key in mutatorMap) { 23272 if (mutatorMap[key]._computed) { 23273 return true; 23274 } 23275 } 23276 return false; 23277 } 23278 23279 function toComputedObjectFromClass(obj) { 23280 var objExpr = t.arrayExpression([]); 23281 23282 for (var i = 0; i < obj.properties.length; i++) { 23283 var prop = obj.properties[i]; 23284 var val = prop.value; 23285 val.properties.unshift(t.objectProperty(t.identifier("key"), t.toComputedKey(prop))); 23286 objExpr.elements.push(val); 23287 } 23288 23289 return objExpr; 23290 } 23291 23292 function toClassObject(mutatorMap) { 23293 var objExpr = t.objectExpression([]); 23294
23295 (0, _keys2.default)(mutatorMap).forEach(function (mutatorMapKey) { 23296 var map = mutatorMap[mutatorMapKey]; 23297 var mapNode = t.objectExpression([]); 23298 23299 var propNode = t.objectProperty(map._key, mapNode, map._computed); 23300 23301 (0, _keys2.default)(map).forEach(function (key) { 23302 var node = map[key]; 23303 if (key[0] === "_") return; 23304 23305 var inheritNode = node; 23306 if (t.isClassMethod(node) || t.isClassProperty(node)) node = node.value; 23307 23308 var prop = t.objectProperty(t.identifier(key), node); 23309 t.inheritsComments(prop, inheritNode); 23310 t.removeComments(inheritNode); 23311 23312 mapNode.properties.push(prop); 23313 }); 23314 23315 objExpr.properties.push(propNode); 23316 }); 23317 23318 return objExpr; 23319 } 23320 23321 function toDefineObject(mutatorMap) { 23322 (0, _keys2.default)(mutatorMap).forEach(function (key) { 23323 var map = mutatorMap[key]; 23324 if (map.value) map.writable = t.booleanLiteral(true); 23325 map.configurable = t.booleanLiteral(true); 23326 map.enumerable = t.booleanLiteral(true); 23327 }); 23328 23329 return toClassObject(mutatorMap); 23330 } 23331 23332/***/ }, 23333/* 186 */ 23334/***/ function(module, exports, __webpack_require__) { 23335 23336 "use strict"; 23337 23338 exports.__esModule = true; 23339 23340 exports.default = function (node) { 23341 var params = node.params; 23342 for (var i = 0; i < params.length; i++) { 23343 var param = params[i]; 23344 if (t.isAssignmentPattern(param) || t.isRestElement(param)) { 23345 return i; 23346 } 23347 } 23348 return params.length; 23349 }; 23350 23351 var _babelTypes = __webpack_require__(1); 23352 23353 var t = _interopRequireWildcard(_babelTypes); 23354 23355 function _interopRequireWildcard(obj) { 23356 if (obj && obj.__esModule) { 23357 return obj; 23358 } else { 23359 var newObj = {};if (obj != null) { 23360 for (var key in obj) { 23361 if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; 23362 } 23363 }newObj.default = obj;return newObj; 23364 } 23365 } 23366 23367 module.exports = exports["default"]; 23368 23369/***/ }, 23370/* 187 */ 23371/***/ function(module, exports, __webpack_require__) { 23372 23373 "use strict"; 23374 23375 exports.__esModule = true; 23376 23377 var _getIterator2 = __webpack_require__(2); 23378 23379 var _getIterator3 = _interopRequireDefault(_getIterator2); 23380 23381 exports.default = function (path, emit) { 23382 var kind = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "var"; 23383 23384 path.traverse(visitor, { kind: kind, emit: emit }); 23385 }; 23386 23387 var _babelTypes = __webpack_require__(1); 23388 23389 var t = _interopRequireWildcard(_babelTypes); 23390 23391 function _interopRequireWildcard(obj) { 23392 if (obj && obj.__esModule) { 23393 return obj; 23394 } else { 23395 var newObj = {};if (obj != null) { 23396 for (var key in obj) { 23397 if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; 23398 } 23399 }newObj.default = obj;return newObj; 23400 } 23401 } 23402 23403 function _interopRequireDefault(obj) { 23404 return obj && obj.__esModule ? obj : { default: obj }; 23405 } 23406 23407 var visitor = { 23408 Scope: function Scope(path, state) { 23409 if (state.kind === "let") path.skip(); 23410 }, 23411 Function: function Function(path) { 23412 path.skip(); 23413 }, 23414 VariableDeclaration: function VariableDeclaration(path, state) { 23415 if (state.kind && path.node.kind !== state.kind) return; 23416 23417 var nodes = []; 23418 23419 var declarations = path.get("declarations"); 23420 var firstId = void 0; 23421 23422 for (var _iterator = declarations, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) { 23423 var _ref; 23424 23425 if (_isArray) { 23426 if (_i >= _iterator.length) break; 23427 _ref = _iterator[_i++]; 23428 } else { 23429 _i = _iterator.next(); 23430 if (_i.done) break; 23431 _ref = _i.value; 23432 } 23433 23434 var declar = _ref; 23435 23436 firstId = declar.node.id; 23437 23438 if (declar.node.init) { 23439 nodes.push(t.expressionStatement(t.assignmentExpression("=", declar.node.id, declar.node.init))); 23440 } 23441 23442 for (var name in declar.getBindingIdentifiers()) { 23443 state.emit(t.identifier(name), name); 23444 } 23445 } 23446 23447 if (path.parentPath.isFor({ left: path.node })) { 23448 path.replaceWith(firstId); 23449 } else { 23450 path.replaceWithMultiple(nodes); 23451 } 23452 } 23453 }; 23454 23455 module.exports = exports["default"]; 23456 23457/***/ }, 23458/* 188 */ 23459/***/ function(module, exports, __webpack_require__) { 23460 23461 "use strict"; 23462 23463 exports.__esModule = true; 23464 23465 exports.default = function (callee, thisNode, args) {
23466 if (args.length === 1 && t.isSpreadElement(args[0]) && t.isIdentifier(args[0].argument, { name: "arguments" })) { 23467 return t.callExpression(t.memberExpression(callee, t.identifier("apply")), [thisNode, args[0].argument]); 23468 } else { 23469 return t.callExpression(t.memberExpression(callee, t.identifier("call")), [thisNode].concat(args)); 23470 } 23471 }; 23472 23473 var _babelTypes = __webpack_require__(1); 23474 23475 var t = _interopRequireWildcard(_babelTypes); 23476 23477 function _interopRequireWildcard(obj) { 23478 if (obj && obj.__esModule) { 23479 return obj; 23480 } else { 23481 var newObj = {};if (obj != null) { 23482 for (var key in obj) { 23483 if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; 23484 } 23485 }newObj.default = obj;return newObj; 23486 } 23487 } 23488 23489 module.exports = exports["default"]; 23490 23491/***/ }, 23492/* 189 */ 23493/***/ function(module, exports, __webpack_require__) { 23494 23495 "use strict"; 23496 23497 exports.__esModule = true; 23498 exports.is = is; 23499 exports.pullFlag = pullFlag; 23500 23501 var _pull = __webpack_require__(273); 23502 23503 var _pull2 = _interopRequireDefault(_pull); 23504 23505 var _babelTypes = __webpack_require__(1); 23506 23507 var t = _interopRequireWildcard(_babelTypes); 23508 23509 function _interopRequireWildcard(obj) { 23510 if (obj && obj.__esModule) { 23511 return obj; 23512 } else { 23513 var newObj = {};if (obj != null) { 23514 for (var key in obj) { 23515 if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; 23516 } 23517 }newObj.default = obj;return newObj; 23518 } 23519 } 23520 23521 function _interopRequireDefault(obj) { 23522 return obj && obj.__esModule ? obj : { default: obj }; 23523 } 23524 23525 function is(node, flag) { 23526 return t.isRegExpLiteral(node) && node.flags.indexOf(flag) >= 0; 23527 } 23528 23529 function pullFlag(node, flag) { 23530 var flags = node.flags.split(""); 23531 if (node.flags.indexOf(flag) < 0) return; 23532 (0, _pull2.default)(flags, flag); 23533 node.flags = flags.join(""); 23534 } 23535 23536/***/ }, 23537/* 190 */ 23538/***/ function(module, exports, __webpack_require__) { 23539 23540 "use strict"; 23541 23542 exports.__esModule = true; 23543 23544 var _classCallCheck2 = __webpack_require__(3); 23545 23546 var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); 23547 23548 var _symbol = __webpack_require__(11); 23549 23550 var _symbol2 = _interopRequireDefault(_symbol); 23551 23552 var _babelHelperOptimiseCallExpression = __webpack_require__(188); 23553 23554 var _babelHelperOptimiseCallExpression2 = _interopRequireDefault(_babelHelperOptimiseCallExpression); 23555 23556 var _babelMessages = __webpack_require__(18); 23557 23558 var messages = _interopRequireWildcard(_babelMessages); 23559 23560 var _babelTypes = __webpack_require__(1); 23561 23562 var t = _interopRequireWildcard(_babelTypes); 23563 23564 function _interopRequireWildcard(obj) { 23565 if (obj && obj.__esModule) { 23566 return obj; 23567 } else { 23568 var newObj = {};if (obj != null) { 23569 for (var key in obj) { 23570 if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; 23571 } 23572 }newObj.default = obj;return newObj; 23573 } 23574 } 23575 23576 function _interopRequireDefault(obj) { 23577 return obj && obj.__esModule ? obj : { default: obj }; 23578 } 23579 23580 var HARDCORE_THIS_REF = (0, _symbol2.default)(); 23581 23582 function isIllegalBareSuper(node, parent) { 23583 if (!t.isSuper(node)) return false; 23584 if (t.isMemberExpression(parent, { computed: false })) return false; 23585 if (t.isCallExpression(parent, { callee: node })) return false; 23586 return true; 23587 } 23588 23589 function isMemberExpressionSuper(node) { 23590 return t.isMemberExpression(node) && t.isSuper(node.object); 23591 } 23592 23593 function getPrototypeOfExpression(objectRef, isStatic) { 23594 var targetRef = isStatic ? objectRef : t.memberExpression(objectRef, t.identifier("prototype")); 23595 23596 return t.logicalExpression("||", t.memberExpression(targetRef, t.identifier("__proto__")), t.callExpression(t.memberExpression(t.identifier("Object"), t.identifier("getPrototypeOf")), [targetRef])); 23597 } 23598 23599 var visitor = { 23600 Function: function Function(path) { 23601 if (!path.inShadow("this")) { 23602 path.skip(); 23603 } 23604 },
23605 ReturnStatement: function ReturnStatement(path, state) { 23606 if (!path.inShadow("this")) { 23607 state.returns.push(path); 23608 } 23609 }, 23610 ThisExpression: function ThisExpression(path, state) { 23611 if (!path.node[HARDCORE_THIS_REF]) { 23612 state.thises.push(path); 23613 } 23614 }, 23615 enter: function enter(path, state) { 23616 var callback = state.specHandle; 23617 if (state.isLoose) callback = state.looseHandle; 23618 23619 var isBareSuper = path.isCallExpression() && path.get("callee").isSuper(); 23620 23621 var result = callback.call(state, path); 23622 23623 if (result) { 23624 state.hasSuper = true; 23625 } 23626 23627 if (isBareSuper) { 23628 state.bareSupers.push(path); 23629 } 23630 23631 if (result === true) { 23632 path.requeue(); 23633 } 23634 23635 if (result !== true && result) { 23636 if (Array.isArray(result)) { 23637 path.replaceWithMultiple(result); 23638 } else { 23639 path.replaceWith(result); 23640 } 23641 } 23642 } 23643 }; 23644 23645 var ReplaceSupers = function () { 23646 function ReplaceSupers(opts) { 23647 var inClass = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; 23648 (0, _classCallCheck3.default)(this, ReplaceSupers); 23649 23650 this.forceSuperMemoisation = opts.forceSuperMemoisation; 23651 this.methodPath = opts.methodPath; 23652 this.methodNode = opts.methodNode; 23653 this.superRef = opts.superRef; 23654 this.isStatic = opts.isStatic; 23655 this.hasSuper = false; 23656 this.inClass = inClass; 23657 this.isLoose = opts.isLoose; 23658 this.scope = this.methodPath.scope; 23659 this.file = opts.file; 23660 this.opts = opts; 23661 23662 this.bareSupers = []; 23663 this.returns = []; 23664 this.thises = []; 23665 } 23666 23667 ReplaceSupers.prototype.getObjectRef = function getObjectRef() { 23668 return this.opts.objectRef || this.opts.getObjectRef(); 23669 }; 23670 23671 ReplaceSupers.prototype.setSuperProperty = function setSuperProperty(property, value, isComputed) { 23672 return t.callExpression(this.file.addHelper("set"), [getPrototypeOfExpression(this.getObjectRef(), this.isStatic), isComputed ? property : t.stringLiteral(property.name), value, t.thisExpression()]); 23673 }; 23674 23675 ReplaceSupers.prototype.getSuperProperty = function getSuperProperty(property, isComputed) { 23676 return t.callExpression(this.file.addHelper("get"), [getPrototypeOfExpression(this.getObjectRef(), this.isStatic), isComputed ? property : t.stringLiteral(property.name), t.thisExpression()]); 23677 }; 23678 23679 ReplaceSupers.prototype.replace = function replace() { 23680 this.methodPath.traverse(visitor, this); 23681 }; 23682 23683 ReplaceSupers.prototype.getLooseSuperProperty = function getLooseSuperProperty(id, parent) { 23684 var methodNode = this.methodNode; 23685 var superRef = this.superRef || t.identifier("Function"); 23686 23687 if (parent.property === id) { 23688 return; 23689 } else if (t.isCallExpression(parent, { callee: id })) { 23690 return; 23691 } else if (t.isMemberExpression(parent) && !methodNode.static) { 23692 return t.memberExpression(superRef, t.identifier("prototype")); 23693 } else { 23694 return superRef; 23695 } 23696 }; 23697 23698 ReplaceSupers.prototype.looseHandle = function looseHandle(path) { 23699 var node = path.node; 23700 if (path.isSuper()) { 23701 return this.getLooseSuperProperty(node, path.parent); 23702 } else if (path.isCallExpression()) { 23703 var callee = node.callee; 23704 if (!t.isMemberExpression(callee)) return; 23705 if (!t.isSuper(callee.object)) return; 23706 23707 t.appendToMemberExpression(callee, t.identifier("call")); 23708 node.arguments.unshift(t.thisExpression()); 23709 return true; 23710 } 23711 }; 23712 23713 ReplaceSupers.prototype.specHandleAssignmentExpression = function specHandleAssignmentExpression(ref, path, node) { 23714 if (node.operator === "=") { 23715 return this.setSuperProperty(node.left.property, node.right, node.left.computed); 23716 } else { 23717 ref = ref || path.scope.generateUidIdentifier("ref"); 23718 return [t.variableDeclaration("var", [t.variableDeclarator(ref, node.left)]), t.expressionStatement(t.assignmentExpression("=", node.left, t.binaryExpression(node.operator[0], ref, node.right)))]; 23719 } 23720 }; 23721 23722 ReplaceSupers.prototype.specHandle = function specHandle(path) { 23723 var property = void 0; 23724 var computed = void 0; 23725 var args = void 0; 23726 23727 var parent = path.parent; 23728 var node = path.node; 23729 23730 if (isIllegalBareSuper(node, parent)) { 23731 throw path.buildCodeFrameError(messages.get("classesIllegalBareSuper")); 23732 } 23733 23734 if (t.isCallExpression(node)) { 23735 var callee = node.callee; 23736 if (t.isSuper(callee)) { 23737 return; 23738 } else if (isMemberExpressionSuper(callee)) { 23739 property = callee.property; 23740 computed = callee.computed; 23741 args = node.arguments; 23742 } 23743 } else if (t.isMemberExpression(node) && t.isSuper(node.object)) { 23744 property = node.property; 23745 computed = node.computed; 23746 } else if (t.isUpdateExpression(node) && isMemberExpressionSuper(node.argument)) { 23747 var binary = t.binaryExpression(node.operator[0], node.argument, t.numericLiteral(1)); 23748 if (node.prefix) { 23749 return this.specHandleAssignmentExpression(null, path, binary); 23750 } else { 23751 var ref = path.scope.generateUidIdentifier("ref"); 23752 return this.specHandleAssignmentExpression(ref, path, binary).concat(t.expressionStatement
23752(ref)); 23753 } 23754 } else if (t.isAssignmentExpression(node) && isMemberExpressionSuper(node.left)) { 23755 return this.specHandleAssignmentExpression(null, path, node); 23756 } 23757 23758 if (!property) return; 23759 23760 var superProperty = this.getSuperProperty(property, computed); 23761 23762 if (args) { 23763 return this.optimiseCall(superProperty, args); 23764 } else { 23765 return superProperty; 23766 } 23767 }; 23768 23769 ReplaceSupers.prototype.optimiseCall = function optimiseCall(callee, args) { 23770 var thisNode = t.thisExpression(); 23771 thisNode[HARDCORE_THIS_REF] = true; 23772 return (0, _babelHelperOptimiseCallExpression2.default)(callee, thisNode, args); 23773 }; 23774 23775 return ReplaceSupers; 23776 }(); 23777 23778 exports.default = ReplaceSupers; 23779 module.exports = exports["default"]; 23780 23781/***/ }, 23782/* 191 */ 23783/***/ function(module, exports, __webpack_require__) { 23784 23785 "use strict"; 23786 23787 exports.__esModule = true; 23788 exports.list = undefined; 23789 23790 var _keys = __webpack_require__(13); 23791 23792 var _keys2 = _interopRequireDefault(_keys); 23793 23794 exports.get = get; 23795 23796 var _helpers = __webpack_require__(318); 23797 23798 var _helpers2 = _interopRequireDefault(_helpers); 23799 23800 function _interopRequireDefault(obj) { 23801 return obj && obj.__esModule ? obj : { default: obj }; 23802 } 23803 23804 function get(name) { 23805 var fn = _helpers2.default[name]; 23806 if (!fn) throw new ReferenceError("Unknown helper " + name); 23807 23808 return fn().expression; 23809 } 23810 23811 var list = exports.list = (0, _keys2.default)(_helpers2.default).map(function (name) { 23812 return name.replace(/^_/, ""); 23813 }).filter(function (name) { 23814 return name !== "__esModule"; 23815 }); 23816 23817 exports.default = get; 23818 23819/***/ }, 23820/* 192 */ 23821/***/ function(module, exports) { 23822 23823 "use strict"; 23824 23825 exports.__esModule = true; 23826 23827 exports.default = function () { 23828 return { 23829 manipulateOptions: function manipulateOptions(opts, parserOpts) { 23830 parserOpts.plugins.push("asyncGenerators"); 23831 } 23832 }; 23833 }; 23834 23835 module.exports = exports["default"]; 23836 23837/***/ }, 23838/* 193 */ 23839/***/ function(module, exports) { 23840 23841 "use strict"; 23842 23843 exports.__esModule = true; 23844 23845 exports.default = function () { 23846 return { 23847 manipulateOptions: function manipulateOptions(opts, parserOpts) { 23848 parserOpts.plugins.push("classConstructorCall"); 23849 } 23850 }; 23851 }; 23852 23853 module.exports = exports["default"]; 23854 23855/***/ }, 23856/* 194 */ 23857/***/ function(module, exports) { 23858 23859 "use strict"; 23860 23861 exports.__esModule = true; 23862 23863 exports.default = function () { 23864 return { 23865 manipulateOptions: function manipulateOptions(opts, parserOpts) { 23866 parserOpts.plugins.push("classProperties"); 23867 } 23868 }; 23869 }; 23870 23871 module.exports = exports["default"]; 23872 23873/***/ }, 23874/* 195 */ 23875/***/ function(module, exports) { 23876 23877 "use strict"; 23878 23879 exports.__esModule = true; 23880 23881 exports.default = function () { 23882 return { 23883 manipulateOptions: function manipulateOptions(opts, parserOpts) { 23884 parserOpts.plugins.push("doExpressions"); 23885 } 23886 }; 23887 }; 23888 23889 module.exports = exports["default"]; 23890 23891/***/ }, 23892/* 196 */ 23893/***/ function(module, exports) { 23894 23895 "use strict"; 23896 23897 exports.__esModule = true; 23898 23899 exports.default = function () { 23900 return { 23901 manipulateOptions: function manipulateOptions(opts, parserOpts) { 23902 parserOpts.plugins.push("exponentiationOperator"); 23903 } 23904 }; 23905 }; 23906 23907 module.exports = exports["default"]; 23908 23909/***/ }, 23910/* 197 */ 23911/***/ function(module, exports) { 23912 23913 "use strict"; 23914 23915 exports.__esModule = true; 23916 23917 exports.default = function () { 23918 return { 23919 manipulateOptions: function manipulateOptions(opts, parserOpts) { 23920 parserOpts.plugins.push("exportExtensions"); 23921 } 23922 }; 23923 }; 23924 23925 module.exports = exports["default"]; 23926 23927/***/ }, 23928/* 198 */ 23929/***/ function(module, exports) { 23930 23931 "use strict"; 23932 23933 exports.__esModule = true; 23934 23935 exports.default = function () { 23936 return { 23937 manipulateOptions: function manipulateOptions(opts, parserOpts) { 23938 parserOpts.plugins.push("functionBind"); 23939 } 23940 }; 23941 }; 23942 23943 module.exports = exports["default"]; 23944 23945/***/ }, 23946/* 199 */ 23947/***/ function(module, exports) { 23948 23949 "use strict"; 23950 23951 exports.__esModule = true; 23952 23953 exports.default = function () { 23954 return { 23955 manipulateOptions: function manipulateOptions(opts, parserOpts) { 23956 parserOpts.plugins.push("objectRestSpread"); 23957 } 23958 }; 23959 }; 23960 23961 module.exports = exports["default"]; 23962 23963/***/ }, 23964/* 200 */ 23965/***/ function(module, exports, __webpack_require__) { 23966 23967 "use strict"; 23968 23969 exports.__esModule = true; 23970 23971 var _getIterator2 = __webpack_require__(2); 23972 23973 var _getIterator3 = _interopRequireDefault(_getIterator2); 23974 23975 var _symbol = __webpack_require__(11); 23976 23977 var _symbol2 = _interopRequireDefault(_symbol); 23978 23979 exports.default = function (_ref) { 23980 var t = _ref.types; 23981 23982 var ALREADY_VISITED = (0, _symbol2.default)(); 23983 23984 function findConstructorCall(path) { 23985 var methods = path.get("body.body"); 23986 23987 for (var _iterator = methods, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) { 23988 var _ref2; 23989 23990 if (_isArray) { 23991 if (_i >= _iterator.length) break; 23992 _ref2 = _iterator[_i++]; 23993 } else { 23994 _i = _iterator.next(); 23995 if (_i.done) break; 23996 _ref2 = _i.value; 23997 } 23998 23999 var method = _ref2; 24000 24001 if (method.node.kind === "constructorCall") { 24002 return method; 24003 } 24004 } 24005 24006 return null; 24007 } 24008 24009 function handleClassWithCall(constructorCall, classPath) { 24010 var _classPath = classPath, 24011 node = _classPath.node; 24012 24013 var ref = node.id || classPath.scope.generateUidIdentifier("class"); 24014 24015 if (classPath.parentPath.isExportDefaultDeclaration()) { 24016 classPath = classPath.parentPath; 24017 classPath.insertAfter(t.exportDefaultDeclaration(ref)); 24018 } 24019 24020 classPath.replaceWithMultiple(buildWrapper({ 24021 CLASS_REF: classPath.scope.generateUidIdentifier(ref.name), 24022 CALL_REF: classPath.scope.generateUidIdentifier(ref.name + "Call"), 24023 CALL: t.functionExpression(null, constructorCall.node.params, constructorCall.node.body), 24024 CLASS: t.toExpression(node), 24025 WRAPPER_REF: ref 24026 })); 24027 24028 constructorCall.remove(); 24029 } 24030 24031 return { 24032 inherits: __webpack_require__(193), 24033 24034 visitor: { 24035 Class: function Class(path) { 24036 if (path.node[ALREADY_VISITED]) return; 24037 path.node[ALREADY_VISITED] = true; 24038 24039 var constructorCall = findConstructorCall(path); 24040 24041 if (constructorCall) { 24042 handleClassWithCall(constructorCall, path); 24043 } else { 24044 return; 24045 } 24046 } 24047 } 24048 }; 24049 }; 24050 24051 var _babelTemplate = __webpack_require__(4); 24052 24053 var _babelTemplate2 = _interopRequireDefault(_babelTemplate); 24054 24055 function _interopRequireDefault(obj) { 24056 return obj && obj.__esModule ? obj : { default: obj }; 24057 } 24058 24059 var buildWrapper = (0, _babelTemplate2.default)("\n let CLASS_REF = CLASS;\n var CALL_REF = CALL;\n var WRAPPER_REF = function (...args) {\n if (this instanceof WRAPPER_REF) {\n return Reflect.construct(CLASS_REF, args);\n } else {\n return CALL_REF.apply(this, args);\n }\n };\n WRAPPER_REF.__proto__ = CLASS_REF;\n WRAPPER_REF;\n"); 24060 24061 module.exports = exports["default"]; 24062 24063/***/ }, 24064/* 201 */ 24065/***/ function(module, exports, __webpack_require__) { 24066 24067 "use strict"; 24068 24069 exports.__esModule = true; 24070 24071 var _getIterator2 = __webpack_require__(2); 24072 24073 var _getIterator3 = _interopRequireDefault(_getIterator2); 24074 24075 exports.default = function (_ref) { 24076 var t = _ref.types; 24077 24078 var findBareSupers = { 24079 Super: function Super(path) { 24080 if (path.parentPath.isCallExpression({ callee: path.node })) { 24081 this.push(path.parentPath); 24082 } 24083 } 24084 }; 24085 24086 var referenceVisitor = { 24087 ReferencedIdentifier: function ReferencedIdentifier(path) { 24088 if (this.scope.hasOwnBinding(path.node.name)) { 24089 this.collision = true; 24090 path.skip(); 24091 } 24092 } 24093 }; 24094 24095 var buildObjectDefineProperty = (0, _babelTemplate2.default)("\n Object.defineProperty(REF, KEY, {\n // configurable is false by default\n enumerable: true,\n writable: true,\n value: VALUE\n });\n "); 24096 24097 var buildClassPropertySpec = function buildClassPropertySpec(ref, _ref2) { 24098 var key = _ref2.key, 24099 value = _ref2.value, 24100 computed = _ref2.computed; 24101 return buildObjectDefineProperty({ 24102 REF: ref, 24103 KEY: t.isIdentifier(key) && !computed ? t.stringLiteral(key.name) : key, 24104 VALUE: value ? value : t.identifier("undefined") 24105 }); 24106 }; 24107 24108 var buildClassPropertyNonSpec = function buildClassPropertyNonSpec(ref, _ref3) { 24109 var key = _ref3.key, 24110 value = _ref3.value, 24111 computed = _ref3.computed;
24112 return t.expressionStatement(t.assignmentExpression("=", t.memberExpression(ref, key, computed || t.isLiteral(key)), value)); 24113 }; 24114 24115 return { 24116 inherits: __webpack_require__(194), 24117 24118 visitor: { 24119 Class: function Class(path, state) { 24120 var buildClassProperty = state.opts.spec ? buildClassPropertySpec : buildClassPropertyNonSpec; 24121 var isDerived = !!path.node.superClass; 24122 var constructor = void 0; 24123 var props = []; 24124 var body = path.get("body"); 24125 24126 for (var _iterator = body.get("body"), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) { 24127 var _ref4; 24128 24129 if (_isArray) { 24130 if (_i >= _iterator.length) break; 24131 _ref4 = _iterator[_i++]; 24132 } else { 24133 _i = _iterator.next(); 24134 if (_i.done) break; 24135 _ref4 = _i.value; 24136 } 24137 24138 var _path = _ref4; 24139 24140 if (_path.isClassProperty()) { 24141 props.push(_path); 24142 } else if (_path.isClassMethod({ kind: "constructor" })) { 24143 constructor = _path; 24144 } 24145 } 24146 24147 if (!props.length) return; 24148 24149 var nodes = []; 24150 var ref = void 0; 24151 24152 if (path.isClassExpression() || !path.node.id) { 24153 (0, _babelHelperFunctionName2.default)(path); 24154 ref = path.scope.generateUidIdentifier("class"); 24155 } else { 24156 ref = path.node.id; 24157 } 24158 24159 var instanceBody = []; 24160 24161 for (var _iterator2 = props, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) { 24162 var _ref5; 24163 24164 if (_isArray2) { 24165 if (_i2 >= _iterator2.length) break; 24166 _ref5 = _iterator2[_i2++]; 24167 } else { 24168 _i2 = _iterator2.next(); 24169 if (_i2.done) break; 24170 _ref5 = _i2.value; 24171 } 24172 24173 var _prop = _ref5; 24174 24175 var propNode = _prop.node; 24176 if (propNode.decorators && propNode.decorators.length > 0) continue; 24177 24178 if (!state.opts.spec && !propNode.value) continue; 24179 24180 var isStatic = propNode.static; 24181 24182 if (isStatic) { 24183 nodes.push(buildClassProperty(ref, propNode)); 24184 } else { 24185 if (!propNode.value) continue; 24186 instanceBody.push(buildClassProperty(t.thisExpression(), propNode)); 24187 } 24188 } 24189 24190 if (instanceBody.length) { 24191 if (!constructor) { 24192 var newConstructor = t.classMethod("constructor", t.identifier("constructor"), [], t.blockStatement([])); 24193 if (isDerived) { 24194 newConstructor.params = [t.restElement(t.identifier("args"))];
24195 newConstructor.body.body.push(t.returnStatement(t.callExpression(t.super(), [t.spreadElement(t.identifier("args"))]))); 24196 } 24197 24198 var _body$unshiftContaine = body.unshiftContainer("body", newConstructor); 24199 24200 constructor = _body$unshiftContaine[0]; 24201 } 24202 24203 var collisionState = { 24204 collision: false, 24205 scope: constructor.scope 24206 }; 24207 24208 for (var _iterator3 = props, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, _getIterator3.default)(_iterator3);;) { 24209 var _ref6; 24210 24211 if (_isArray3) { 24212 if (_i3 >= _iterator3.length) break; 24213 _ref6 = _iterator3[_i3++]; 24214 } else { 24215 _i3 = _iterator3.next(); 24216 if (_i3.done) break; 24217 _ref6 = _i3.value; 24218 } 24219 24220 var prop = _ref6; 24221 24222 prop.traverse(referenceVisitor, collisionState); 24223 if (collisionState.collision) break; 24224 } 24225 24226 if (collisionState.collision) { 24227 var initialisePropsRef = path.scope.generateUidIdentifier("initialiseProps"); 24228 24229 nodes.push(t.variableDeclaration("var", [t.variableDeclarator(initialisePropsRef, t.functionExpression(null, [], t.blockStatement(instanceBody)))])); 24230 24231 instanceBody = [t.expressionStatement(t.callExpression(t.memberExpression(initialisePropsRef, t.identifier("call")), [t.thisExpression()]))]; 24232 } 24233 24234 if (isDerived) { 24235 var bareSupers = []; 24236 constructor.traverse(findBareSupers, bareSupers); 24237 for (var _iterator4 = bareSupers, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, _getIterator3.default)(_iterator4);;) { 24238 var _ref7; 24239 24240 if (_isArray4) { 24241 if (_i4 >= _iterator4.length) break; 24242 _ref7 = _iterator4[_i4++]; 24243 } else { 24244 _i4 = _iterator4.next(); 24245 if (_i4.done) break; 24246 _ref7 = _i4.value; 24247 } 24248 24249 var bareSuper = _ref7; 24250 24251 bareSuper.insertAfter(instanceBody); 24252 } 24253 } else { 24254 constructor.get("body").unshiftContainer("body", instanceBody); 24255 } 24256 } 24257 24258 for (var _iterator5 = props, _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : (0, _getIterator3.default)(_iterator5);;) { 24259 var _ref8; 24260 24261 if (_isArray5) { 24262 if (_i5 >= _iterator5.length) break; 24263 _ref8 = _iterator5[_i5++]; 24264 } else { 24265 _i5 = _iterator5.next(); 24266 if (_i5.done) break; 24267 _ref8 = _i5.value; 24268 } 24269 24270 var _prop2 = _ref8; 24271 24272 _prop2.remove(); 24273 } 24274 24275 if (!nodes.length) return; 24276 24277 if (path.isClassExpression()) { 24278 path.scope.push({ id: ref }); 24279 path.replaceWith(t.assignmentExpression("=", ref, path.node)); 24280 } else { 24281 if (!path.node.id) { 24282 path.node.id = ref; 24283 } 24284 24285 if (path.parentPath.isExportDeclaration()) { 24286 path = path.parentPath; 24287 } 24288 } 24289 24290 path.insertAfter(nodes); 24291 }, 24292 ArrowFunctionExpression: function ArrowFunctionExpression(path) { 24293 var classExp = path.get("body"); 24294 if (!classExp.isClassExpression()) return; 24295 24296 var body = classExp.get("body"); 24297 var members = body.get("body"); 24298 if (members.some(function (member) { 24299 return member.isClassProperty(); 24300 })) { 24301 path.ensureBlock(); 24302 } 24303 } 24304 } 24305 }; 24306 }; 24307 24308 var _babelHelperFunctionName = __webpack_require__(40); 24309 24310 var _babelHelperFunctionName2 = _interopRequireDefault(_babelHelperFunctionName); 24311 24312 var _babelTemplate = __webpack_require__(4); 24313 24314 var _babelTemplate2 = _interopRequireDefault(_babelTemplate); 24315 24316 function _interopRequireDefault(obj) { 24317 return obj && obj.__esModule ? obj : { default: obj }; 24318 } 24319 24320 module.exports = exports["default"]; 24321 24322/***/ }, 24323/* 202 */ 24324/***/ function(module, exports, __webpack_require__) { 24325 24326 "use strict"; 24327 24328 exports.__esModule = true; 24329 24330 var _create = __webpack_require__(10); 24331 24332 var _create2 = _interopRequireDefault(_create); 24333 24334 var _getIterator2 = __webpack_require__(2); 24335 24336 var _getIterator3 = _interopRequireDefault(_getIterator2); 24337 24338 exports.default = function (_ref) { 24339 var t = _ref.types; 24340 24341 function cleanDecorators(decorators) { 24342 return decorators.reverse().map(function (dec) { 24343 return dec.expression; 24344 }); 24345 } 24346 24347 function transformClass(path, ref, state) { 24348 var nodes = []; 24349 24350 state; 24351 24352 var classDecorators = path.node.decorators; 24353 if (classDecorators) { 24354 path.node.decorators = null; 24355 classDecorators = cleanDecorators(classDecorators); 24356 24357 for (var _iterator = classDecorators, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) { 24358 var _ref2; 24359 24360 if (_isArray) { 24361 if (_i >= _iterator.length) break; 24362 _ref2 = _iterator[_i++]; 24363 } else { 24364 _i = _iterator.next(); 24365 if (_i.done) break; 24366 _ref2 = _i.value; 24367 } 24368 24369 var decorator = _ref2; 24370 24371 nodes.push(buildClassDecorator({ 24372 CLASS_REF: ref, 24373 DECORATOR: decorator 24374 })); 24375 } 24376 } 24377 24378 var map = (0, _create2.default)(null); 24379 24380 for (var _iterator2 = path.get("body.body"), _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) { 24381 var _ref3; 24382 24383 if (_isArray2) { 24384 if (_i2 >= _iterator2.length) break; 24385 _ref3 = _iterator2[_i2++]; 24386 } else { 24387 _i2 = _iterator2.next(); 24388 if (_i2.done) break; 24389 _ref3 = _i2.value; 24390 } 24391 24392 var method = _ref3; 24393 24394 var decorators = method.node.decorators; 24395 if (!decorators) continue; 24396 24397 var _alias = t.toKeyAlias(method.node); 24398 map[_alias] = map[_alias] || []; 24399 map[_alias].push(method.node); 24400 24401 method.remove(); 24402 } 24403 24404 for (var alias in map) { 24405 var items = map[alias]; 24406 24407 items; 24408 } 24409 24410 return nodes; 24411 } 24412 24413 function hasDecorators(path) { 24414 if (path.isClass()) { 24415 if (path.node.decorators) return true; 24416 24417 for (var _iterator3 = path.node.body.body, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, _getIterator3.default)(_iterator3);;) { 24418 var _ref4; 24419 24420 if (_isArray3) { 24421 if (_i3 >= _iterator3.length) break; 24422 _ref4 = _iterator3[_i3++]; 24423 } else { 24424 _i3 = _iterator3.next(); 24425 if (_i3.done) break; 24426 _ref4 = _i3.value; 24427 } 24428 24429 var method = _ref4; 24430 24431 if (method.decorators) { 24432 return true; 24433 } 24434 } 24435 } else if (path.isObjectExpression()) { 24436 for (var _iterator4 = path.node.properties, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, _getIterator3.default)(_iterator4);;) { 24437 var _ref5; 24438 24439 if (_isArray4) { 24440 if (_i4 >= _iterator4.length) break; 24441 _ref5 = _iterator4[_i4++]; 24442 } else { 24443 _i4 = _iterator4.next(); 24444 if (_i4.done) break; 24445 _ref5 = _i4.value; 24446 } 24447 24448 var prop = _ref5; 24449 24450 if (prop.decorators) { 24451 return true; 24452 } 24453 } 24454 } 24455 24456 return false;
24457 } 24458 24459 function doError(path) { 24460 throw path.buildCodeFrameError("Decorators are not officially supported yet in 6.x pending a proposal update.\nHowever, if you need to use them you can install the legacy decorators transform with:\n\nnpm install babel-plugin-transform-decorators-legacy --save-dev\n\nand add the following line to your .babelrc file:\n\n{\n \"plugins\": [\"transform-decorators-legacy\"]\n}\n\nThe repo url is: https://github.com/loganfsmyth/babel-plugin-transform-decorators-legacy.\n "); 24461 } 24462 24463 return { 24464 inherits: __webpack_require__(122), 24465 24466 visitor: { 24467 ClassExpression: function ClassExpression(path) { 24468 if (!hasDecorators(path)) return; 24469 doError(path); 24470 24471 (0, _babelHelperExplodeClass2.default)(path); 24472 24473 var ref = path.scope.generateDeclaredUidIdentifier("ref"); 24474 var nodes = []; 24475 24476 nodes.push(t.assignmentExpression("=", ref, path.node)); 24477 24478 nodes = nodes.concat(transformClass(path, ref, this)); 24479 24480 nodes.push(ref); 24481 24482 path.replaceWith(t.sequenceExpression(nodes)); 24483 }, 24484 ClassDeclaration: function ClassDeclaration(path) { 24485 if (!hasDecorators(path)) return; 24486 doError(path); 24487 (0, _babelHelperExplodeClass2.default)(path); 24488 24489 var ref = path.node.id; 24490 var nodes = []; 24491 24492 nodes = nodes.concat(transformClass(path, ref, this).map(function (expr) { 24493 return t.expressionStatement(expr); 24494 })); 24495 nodes.push(t.expressionStatement(ref)); 24496 24497 path.insertAfter(nodes); 24498 }, 24499 ObjectExpression: function ObjectExpression(path) { 24500 if (!hasDecorators(path)) return; 24501 doError(path); 24502 } 24503 } 24504 }; 24505 }; 24506 24507 var _babelTemplate = __webpack_require__(4); 24508 24509 var _babelTemplate2 = _interopRequireDefault(_babelTemplate); 24510 24511 var _babelHelperExplodeClass = __webpack_require__(316); 24512 24513 var _babelHelperExplodeClass2 = _interopRequireDefault(_babelHelperExplodeClass); 24514 24515 function _interopRequireDefault(obj) { 24516 return obj && obj.__esModule ? obj : { default: obj }; 24517 } 24518 24519 var buildClassDecorator = (0, _babelTemplate2.default)("\n CLASS_REF = DECORATOR(CLASS_REF) || CLASS_REF;\n"); 24520 24521 module.exports = exports["default"]; 24522 24523/***/ }, 24524/* 203 */ 24525/***/ function(module, exports, __webpack_require__) { 24526 24527 "use strict"; 24528 24529 exports.__esModule = true; 24530 24531 exports.default = function () { 24532 return { 24533 inherits: __webpack_require__(195), 24534 24535 visitor: { 24536 DoExpression: function DoExpression(path) { 24537 var body = path.node.body.body; 24538 if (body.length) { 24539 path.replaceWithMultiple(body); 24540 } else { 24541 path.replaceWith(path.scope.buildUndefinedNode()); 24542 } 24543 } 24544 } 24545 }; 24546 }; 24547 24548 module.exports = exports["default"]; 24549 24550/***/ }, 24551/* 204 */ 24552/***/ function(module, exports, __webpack_require__) { 24553 24554 "use strict"; 24555 24556 exports.__esModule = true; 24557 24558 var _getIterator2 = __webpack_require__(2); 24559 24560 var _getIterator3 = _interopRequireDefault(_getIterator2); 24561 24562 var _classCallCheck2 = __webpack_require__(3); 24563 24564 var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); 24565 24566 var _babelTraverse = __webpack_require__(8); 24567 24568 var _babelHelperReplaceSupers = __webpack_require__(190); 24569 24570 var _babelHelperReplaceSupers2 = _interopRequireDefault(_babelHelperReplaceSupers); 24571 24572 var _babelHelperOptimiseCallExpression = __webpack_require__(188); 24573 24574 var _babelHelperOptimiseCallExpression2 = _interopRequireDefault(_babelHelperOptimiseCallExpression); 24575 24576 var _babelHelperDefineMap = __webpack_require__(185); 24577 24578 var defineMap = _interopRequireWildcard(_babelHelperDefineMap); 24579 24580 var _babelTemplate = __webpack_require__(4); 24581 24582 var _babelTemplate2 = _interopRequireDefault(_babelTemplate); 24583 24584 var _babelTypes = __webpack_require__(1); 24585 24586 var t = _interopRequireWildcard(_babelTypes); 24587 24588 function _interopRequireWildcard(obj) { 24589 if (obj && obj.__esModule) { 24590 return obj; 24591 } else { 24592 var newObj = {};if (obj != null) { 24593 for (var key in obj) { 24594 if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; 24595 } 24596 }newObj.default = obj;return newObj; 24597 } 24598 } 24599 24600 function _interopRequireDefault(obj) { 24601 return obj && obj.__esModule ? obj : { default: obj }; 24602 } 24603 24604 var buildDerivedConstructor = (0, _babelTemplate2.default)("\n (function () {\n super(...arguments);\n })\n"); 24605 24606 var noMethodVisitor = { 24607 "FunctionExpression|FunctionDeclaration": function FunctionExpressionFunctionDeclaration(path) { 24608 if (!path.is("shadow")) { 24609 path.skip(); 24610 } 24611 }, 24612 Method: function Method(path) { 24613 path.skip(); 24614 } 24615 }; 24616 24617 var verifyConstructorVisitor = _babelTraverse.visitors.merge([noMethodVisitor, { 24618 Super: function Super(path) { 24619 if (this.isDerived && !this.hasBareSuper && !path.parentPath.isCallExpression({ callee: path.node })) { 24620 throw path.buildCodeFrameError("'super.*' is not allowed before super()"); 24621 } 24622 }, 24623 24624 CallExpression: { 24625 exit: function exit(path) { 24626 if (path.get("callee").isSuper()) { 24627 this.hasBareSuper = true; 24628 24629 if (!this.isDerived) { 24630 throw path.buildCodeFrameError("super() is only allowed in a derived constructor"); 24631 } 24632 } 24633 } 24634 }, 24635 24636 ThisExpression: function ThisExpression(path) { 24637 if (this.isDerived && !this.hasBareSuper) { 24638 if (!path.inShadow("this")) { 24639 throw path.buildCodeFrameError("'this' is not allowed before super()"); 24640 } 24641 } 24642 } 24643 }]); 24644 24645 var findThisesVisitor = _babelTraverse.visitors.merge([noMethodVisitor, { 24646 ThisExpression: function ThisExpression(path) { 24647 this.superThises.push(path); 24648 } 24649 }]); 24650 24651 var ClassTransformer = function () { 24652 function ClassTransformer(path, file) { 24653 (0, _classCallCheck3.default)(this, ClassTransformer); 24654 24655 this.parent = path.parent; 24656 this.scope = path.scope; 24657 this.node = path.node; 24658 this.path = path; 24659 this.file = file; 24660 24661 this.clearDescriptors(); 24662 24663 this.instancePropBody = []; 24664 this.instancePropRefs = {}; 24665 this.staticPropBody = []; 24666 this.body = []; 24667 24668 this.bareSuperAfter = []; 24669 this.bareSupers = []; 24670 24671 this.pushedConstructor = false;
24672 this.pushedInherits = false; 24673 this.isLoose = false; 24674 24675 this.superThises = []; 24676 24677 this.classId = this.node.id; 24678 24679 this.classRef = this.node.id ? t.identifier(this.node.id.name) : this.scope.generateUidIdentifier("class"); 24680 24681 this.superName = this.node.superClass || t.identifier("Function"); 24682 this.isDerived = !!this.node.superClass; 24683 } 24684 24685 ClassTransformer.prototype.run = function run() { 24686 var _this = this; 24687 24688 var superName = this.superName; 24689 var file = this.file; 24690 var body = this.body; 24691 24692 var constructorBody = this.constructorBody = t.blockStatement([]); 24693 this.constructor = this.buildConstructor(); 24694 24695 var closureParams = []; 24696 var closureArgs = []; 24697 24698 if (this.isDerived) { 24699 closureArgs.push(superName); 24700 24701 superName = this.scope.generateUidIdentifierBasedOnNode(superName); 24702 closureParams.push(superName); 24703 24704 this.superName = superName; 24705 } 24706 24707 this.buildBody(); 24708 24709 constructorBody.body.unshift(t.expressionStatement(t.callExpression(file.addHelper("classCallCheck"), [t.thisExpression(), this.classRef]))); 24710 24711 body = body.concat(this.staticPropBody.map(function (fn) { 24712 return fn(_this.classRef); 24713 })); 24714 24715 if (this.classId) { 24716 if (body.length === 1) return t.toExpression(body[0]); 24717 } 24718
24719 body.push(t.returnStatement(this.classRef)); 24720 24721 var container = t.functionExpression(null, closureParams, t.blockStatement(body)); 24722 container.shadow = true; 24723 return t.callExpression(container, closureArgs); 24724 }; 24725 24726 ClassTransformer.prototype.buildConstructor = function buildConstructor() { 24727 var func = t.functionDeclaration(this.classRef, [], this.constructorBody); 24728 t.inherits(func, this.node); 24729 return func; 24730 }; 24731 24732 ClassTransformer.prototype.pushToMap = function pushToMap(node, enumerable) { 24733 var kind = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "value"; 24734 var scope = arguments[3]; 24735 24736 var mutatorMap = void 0; 24737 if (node.static) { 24738 this.hasStaticDescriptors = true; 24739 mutatorMap = this.staticMutatorMap; 24740 } else { 24741 this.hasInstanceDescriptors = true; 24742 mutatorMap = this.instanceMutatorMap; 24743 } 24744 24745 var map = defineMap.push(mutatorMap, node, kind, this.file, scope); 24746 24747 if (enumerable) { 24748 map.enumerable = t.booleanLiteral(true); 24749 } 24750 24751 return map; 24752 }; 24753 24754 ClassTransformer.prototype.constructorMeMaybe = function constructorMeMaybe() { 24755 var hasConstructor = false; 24756 var paths = this.path.get("body.body"); 24757 for (var _iterator = paths, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) { 24758 var _ref; 24759 24760 if (_isArray) { 24761 if (_i >= _iterator.length) break; 24762 _ref = _iterator[_i++]; 24763 } else { 24764 _i = _iterator.next(); 24765 if (_i.done) break; 24766 _ref = _i.value; 24767 } 24768 24769 var path = _ref; 24770 24771 hasConstructor = path.equals("kind", "constructor"); 24772 if (hasConstructor) break; 24773 } 24774 if (hasConstructor) return; 24775 24776 var params = void 0, 24777 body = void 0; 24778 24779 if (this.isDerived) { 24780 var _constructor = buildDerivedConstructor().expression; 24781 params = _constructor.params; 24782 body = _constructor.body; 24783 } else { 24784 params = []; 24785 body = t.blockStatement([]); 24786 } 24787 24788 this.path.get("body").unshiftContainer("body", t.classMethod("constructor", t.identifier("constructor"), params, body)); 24789 }; 24790 24791 ClassTransformer.prototype.buildBody = function buildBody() { 24792 this.constructorMeMaybe(); 24793 this.pushBody(); 24794 this.verifyConstructor(); 24795 24796 if (this.userConstructor) { 24797 var constructorBody = this.constructorBody; 24798 constructorBody.body = constructorBody.body.concat(this.userConstructor.body.body); 24799 t.inherits(this.constructor, this.userConstructor); 24800 t.inherits(constructorBody, this.userConstructor.body); 24801 } 24802 24803 this.pushDescriptors(); 24804 }; 24805 24806 ClassTransformer.prototype.pushBody = function pushBody() { 24807 var classBodyPaths = this.path.get("body.body"); 24808 24809 for (var _iterator2 = classBodyPaths, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) { 24810 var _ref2; 24811 24812 if (_isArray2) { 24813 if (_i2 >= _iterator2.length) break; 24814 _ref2 = _iterator2[_i2++]; 24815 } else { 24816 _i2 = _iterator2.next(); 24817 if (_i2.done) break; 24818 _ref2 = _i2.value; 24819 } 24820 24821 var path = _ref2; 24822 24823 var node = path.node; 24824 24825 if (path.isClassProperty()) { 24826 throw path.buildCodeFrameError("Missing class properties transform."); 24827 } 24828 24829 if (node.decorators) { 24830 throw path.buildCodeFrameError("Method has decorators, put the decorator plugin before the classes one."); 24831 } 24832 24833 if (t.isClassMethod(node)) { 24834 var isConstructor = node.kind === "constructor"; 24835 24836 if (isConstructor) { 24837 path.traverse(verifyConstructorVisitor, this); 24838 24839 if (!this.hasBareSuper && this.isDerived) { 24840 throw path.buildCodeFrameError("missing super() call in constructor"); 24841 } 24842 } 24843 24844 var replaceSupers = new _babelHelperReplaceSupers2.default({ 24845 forceSuperMemoisation: isConstructor, 24846 methodPath: path, 24847 methodNode: node, 24848 objectRef: this.classRef, 24849 superRef: this.superName, 24850 isStatic: node.static, 24851 isLoose: this.isLoose, 24852 scope: this.scope, 24853 file: this.file
24854 }, true); 24855 24856 replaceSupers.replace(); 24857 24858 if (isConstructor) { 24859 this.pushConstructor(replaceSupers, node, path); 24860 } else { 24861 this.pushMethod(node, path); 24862 } 24863 } 24864 } 24865 }; 24866 24867 ClassTransformer.prototype.clearDescriptors = function clearDescriptors() { 24868 this.hasInstanceDescriptors = false; 24869 this.hasStaticDescriptors = false; 24870 24871 this.instanceMutatorMap = {}; 24872 this.staticMutatorMap = {}; 24873 }; 24874 24875 ClassTransformer.prototype.pushDescriptors = function pushDescriptors() { 24876 this.pushInherits(); 24877 24878 var body = this.body; 24879 24880 var instanceProps = void 0; 24881 var staticProps = void 0; 24882 24883 if (this.hasInstanceDescriptors) { 24884 instanceProps = defineMap.toClassObject(this.instanceMutatorMap); 24885 } 24886 24887 if (this.hasStaticDescriptors) { 24888 staticProps = defineMap.toClassObject(this.staticMutatorMap); 24889 } 24890 24891 if (instanceProps || staticProps) { 24892 if (instanceProps) instanceProps = defineMap.toComputedObjectFromClass(instanceProps); 24893 if (staticProps) staticProps = defineMap.toComputedObjectFromClass(staticProps); 24894 24895 var nullNode = t.nullLiteral(); 24896 24897 var args = [this.classRef, nullNode, nullNode, nullNode, nullNode]; 24898 24899 if (instanceProps) args[1] = instanceProps; 24900 if (staticProps) args[2] = staticProps; 24901 24902 if (this.instanceInitializersId) { 24903 args[3] = this.instanceInitializersId; 24904 body.unshift(this.buildObjectAssignment(this.instanceInitializersId)); 24905 } 24906 24907 if (this.staticInitializersId) { 24908 args[4] = this.staticInitializersId; 24909 body.unshift(this.buildObjectAssignment(this.staticInitializersId)); 24910 } 24911 24912 var lastNonNullIndex = 0; 24913 for (var i = 0; i < args.length; i++) { 24914 if (args[i] !== nullNode) lastNonNullIndex = i; 24915 } 24916 args = args.slice(0, lastNonNullIndex + 1); 24917 24918 body.push(t.expressionStatement(t.callExpression(this.file.addHelper("createClass"), args))); 24919 } 24920 24921 this.clearDescriptors(); 24922 }; 24923 24924 ClassTransformer.prototype.buildObjectAssignment = function buildObjectAssignment(id) { 24925 return t.variableDeclaration("var", [t.variableDeclarator(id, t.objectExpression([]))]); 24926 }; 24927 24928 ClassTransformer.prototype.wrapSuperCall = function wrapSuperCall(bareSuper, superRef, thisRef, body) { 24929 var bareSuperNode = bareSuper.node; 24930 24931 if (this.isLoose) { 24932 bareSuperNode.arguments.unshift(t.thisExpression()); 24933 if (bareSuperNode.arguments.length === 2 && t.isSpreadElement(bareSuperNode.arguments[1]) && t.isIdentifier(bareSuperNode.arguments[1].argument, { name: "arguments" })) { 24934 bareSuperNode.arguments[1] = bareSuperNode.arguments[1].argument; 24935 bareSuperNode.callee = t.memberExpression(superRef, t.identifier("apply")); 24936 } else { 24937 bareSuperNode.callee = t.memberExpression(superRef, t.identifier("call")); 24938 } 24939 } else { 24940 bareSuperNode = (0, _babelHelperOptimiseCallExpression2.default)(t.logicalExpression("||", t.memberExpression(this.classRef, t.identifier("__proto__")), t.callExpression(t.memberExpression(t.identifier("Object"), t.identifier("getPrototypeOf")), [this.classRef])), t.thisExpression(), bareSuperNode.arguments); 24941 } 24942 24943 var call = t.callExpression(this.file.addHelper("possibleConstructorReturn"), [t.thisExpression(), bareSuperNode]); 24944 24945 var bareSuperAfter = this.bareSuperAfter.map(function (fn) { 24946 return fn(thisRef); 24947 }); 24948 24949 if (bareSuper.parentPath.isExpressionStatement() && bareSuper.parentPath.container === body.node.body && body.node.body.length - 1 === bareSuper.parentPath.key) { 24950 24951 if (this.superThises.length || bareSuperAfter.length) { 24952 bareSuper.scope.push({ id: thisRef }); 24953 call = t.assignmentExpression("=", thisRef, call); 24954 } 24955 24956 if (bareSuperAfter.length) { 24957 call = t.toSequenceExpression([call].concat(bareSuperAfter, [thisRef])); 24958 } 24959
24960 bareSuper.parentPath.replaceWith(t.returnStatement(call)); 24961 } else { 24962 bareSuper.replaceWithMultiple([t.variableDeclaration("var", [t.variableDeclarator(thisRef, call)])].concat(bareSuperAfter, [t.expressionStatement(thisRef)])); 24963 } 24964 }; 24965 24966 ClassTransformer.prototype.verifyConstructor = function verifyConstructor() { 24967 var _this2 = this; 24968 24969 if (!this.isDerived) return; 24970 24971 var path = this.userConstructorPath; 24972 var body = path.get("body"); 24973 24974 path.traverse(findThisesVisitor, this); 24975 24976 var guaranteedSuperBeforeFinish = !!this.bareSupers.length; 24977 24978 var superRef = this.superName || t.identifier("Function"); 24979 var thisRef = path.scope.generateUidIdentifier("this"); 24980 24981 for (var _iterator3 = this.bareSupers, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, _getIterator3.default)(_iterator3);;) { 24982 var _ref3; 24983 24984 if (_isArray3) { 24985 if (_i3 >= _iterator3.length) break; 24986 _ref3 = _iterator3[_i3++]; 24987 } else { 24988 _i3 = _iterator3.next(); 24989 if (_i3.done) break; 24990 _ref3 = _i3.value; 24991 } 24992 24993 var bareSuper = _ref3; 24994 24995 this.wrapSuperCall(bareSuper, superRef, thisRef, body); 24996 24997 if (guaranteedSuperBeforeFinish) { 24998 bareSuper.find(function (parentPath) { 24999 if (parentPath === path) { 25000 return true; 25001 } 25002 25003 if (parentPath.isLoop() || parentPath.isConditional()) { 25004 guaranteedSuperBeforeFinish = false; 25005 return true; 25006 } 25007 }); 25008 } 25009 } 25010 25011 for (var _iterator4 = this.superThises, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, _getIterator3.default)(_iterator4);;) { 25012 var _ref4; 25013 25014 if (_isArray4) { 25015 if (_i4 >= _iterator4.length) break; 25016 _ref4 = _iterator4[_i4++]; 25017 } else { 25018 _i4 = _iterator4.next(); 25019 if (_i4.done) break; 25020 _ref4 = _i4.value; 25021 } 25022 25023 var thisPath = _ref4; 25024 25025 thisPath.replaceWith(thisRef); 25026 } 25027 25028 var wrapReturn = function wrapReturn(returnArg) { 25029 return t.callExpression(_this2.file.addHelper("possibleConstructorReturn"), [thisRef].concat(returnArg || [])); 25030 }; 25031 25032 var bodyPaths = body.get("body");
25033 if (bodyPaths.length && !bodyPaths.pop().isReturnStatement()) { 25034 body.pushContainer("body", t.returnStatement(guaranteedSuperBeforeFinish ? thisRef : wrapReturn())); 25035 } 25036 25037 for (var _iterator5 = this.superReturns, _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : (0, _getIterator3.default)(_iterator5);;) { 25038 var _ref5; 25039 25040 if (_isArray5) { 25041 if (_i5 >= _iterator5.length) break; 25042 _ref5 = _iterator5[_i5++]; 25043 } else { 25044 _i5 = _iterator5.next(); 25045 if (_i5.done) break; 25046 _ref5 = _i5.value; 25047 } 25048 25049 var returnPath = _ref5; 25050 25051 if (returnPath.node.argument) { 25052 var ref = returnPath.scope.generateDeclaredUidIdentifier("ret"); 25053 returnPath.get("argument").replaceWithMultiple([t.assignmentExpression("=", ref, returnPath.node.argument), wrapReturn(ref)]); 25054 } else { 25055 returnPath.get("argument").replaceWith(wrapReturn()); 25056 } 25057 } 25058 }; 25059 25060 ClassTransformer.prototype.pushMethod = function pushMethod(node, path) { 25061 var scope = path ? path.scope : this.scope; 25062 25063 if (node.kind === "method") { 25064 if (this._processMethod(node, scope)) return; 25065 } 25066 25067 this.pushToMap(node, false, null, scope); 25068 }; 25069 25070 ClassTransformer.prototype._processMethod = function _processMethod() { 25071 return false; 25072 }; 25073 25074 ClassTransformer.prototype.pushConstructor = function pushConstructor(replaceSupers, method, path) { 25075 this.bareSupers = replaceSupers.bareSupers; 25076 this.superReturns = replaceSupers.returns; 25077 25078 if (path.scope.hasOwnBinding(this.classRef.name)) { 25079 path.scope.rename(this.classRef.name); 25080 } 25081 25082 var construct = this.constructor; 25083 25084 this.userConstructorPath = path; 25085 this.userConstructor = method; 25086 this.hasConstructor = true; 25087 25088 t.inheritsComments(construct, method); 25089 25090 construct._ignoreUserWhitespace = true; 25091 construct.params = method.params; 25092 25093 t.inherits(construct.body, method.body); 25094 construct.body.directives = method.body.directives; 25095 25096 this._pushConstructor(); 25097 }; 25098 25099 ClassTransformer.prototype._pushConstructor = function _pushConstructor() { 25100 if (this.pushedConstructor) return; 25101 this.pushedConstructor = true; 25102 25103 if (this.hasInstanceDescriptors || this.hasStaticDescriptors) { 25104 this.pushDescriptors(); 25105 } 25106 25107 this.body.push(this.constructor); 25108 25109 this.pushInherits(); 25110 }; 25111 25112 ClassTransformer.prototype.pushInherits = function pushInherits() { 25113 if (!this.isDerived || this.pushedInherits) return; 25114 25115 this.pushedInherits = true; 25116 this.body.unshift(t.expressionStatement(t.callExpression(this.file.addHelper("inherits"), [this.classRef, this.superName]))); 25117 }; 25118 25119 return ClassTransformer; 25120 }(); 25121 25122 exports.default = ClassTransformer; 25123 module.exports = exports["default"]; 25124 25125/***/ }, 25126/* 205 */ 25127/***/ function(module, exports, __webpack_require__) { 25128 25129 "use strict"; 25130 25131 exports.__esModule = true; 25132 25133 var _create = __webpack_require__(10); 25134 25135 var _create2 = _interopRequireDefault(_create); 25136 25137 var _getIterator2 = __webpack_require__(2); 25138 25139 var _getIterator3 = _interopRequireDefault(_getIterator2); 25140 25141 var _symbol = __webpack_require__(11); 25142 25143 var _symbol2 = _interopRequireDefault(_symbol); 25144 25145 exports.default = function (_ref) { 25146 var t = _ref.types; 25147 25148 var IGNORE_REASSIGNMENT_SYMBOL = (0, _symbol2.default)(); 25149 25150 var reassignmentVisitor = { 25151 "AssignmentExpression|UpdateExpression": function AssignmentExpressionUpdateExpression(path) { 25152 if (path.node[IGNORE_REASSIGNMENT_SYMBOL]) return; 25153 path.node[IGNORE_REASSIGNMENT_SYMBOL] = true; 25154 25155 var arg = path.get(path.isAssignmentExpression() ? "left" : "argument"); 25156 if (!arg.isIdentifier()) return; 25157 25158 var name = arg.node.name; 25159 25160 if (this.scope.getBinding(name) !== path.scope.getBinding(name)) return; 25161 25162 var exportedNames = this.exports[name]; 25163 if (!exportedNames) return; 25164 25165 var node = path.node; 25166 25167 var isPostUpdateExpression = path.isUpdateExpression() && !node.prefix; 25168 if (isPostUpdateExpression) { 25169 if (node.operator === "++") node = t.binaryExpression("+", node.argument, t.numericLiteral(1));else if (node.operator === "--") node = t.binaryExpression("-", node.argument, t.numericLiteral(1));else isPostUpdateExpression = false;
25170 } 25171 25172 for (var _iterator = exportedNames, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) { 25173 var _ref2; 25174 25175 if (_isArray) { 25176 if (_i >= _iterator.length) break; 25177 _ref2 = _iterator[_i++]; 25178 } else { 25179 _i = _iterator.next(); 25180 if (_i.done) break; 25181 _ref2 = _i.value; 25182 } 25183 25184 var exportedName = _ref2; 25185 25186 node = this.buildCall(exportedName, node).expression; 25187 } 25188 25189 if (isPostUpdateExpression) node = t.sequenceExpression([node, path.node]); 25190 25191 path.replaceWith(node); 25192 } 25193 }; 25194 25195 return { 25196 visitor: { 25197 CallExpression: function CallExpression(path, state) { 25198 if (path.node.callee.type === TYPE_IMPORT) { 25199 var contextIdent = state.contextIdent; 25200 path.replaceWith(t.callExpression(t.memberExpression(contextIdent, t.identifier("import")), path.node.arguments)); 25201 } 25202 }, 25203 ReferencedIdentifier: function ReferencedIdentifier(path, state) { 25204 if (path.node.name == "__moduleName" && !path.scope.hasBinding("__moduleName")) { 25205 path.replaceWith(t.memberExpression(state.contextIdent, t.identifier("id"))); 25206 } 25207 }, 25208 25209 Program: { 25210 enter: function enter(path, state) { 25211 state.contextIdent = path.scope.generateUidIdentifier("context"); 25212 }, 25213 exit: function exit(path, state) { 25214 var exportIdent = path.scope.generateUidIdentifier("export"); 25215 var contextIdent = state.contextIdent; 25216 25217 var exportNames = (0, _create2.default)(null); 25218 var modules = []; 25219 25220 var beforeBody = []; 25221 var setters = []; 25222 var sources = []; 25223 var variableIds = []; 25224 var removedPaths = []; 25225 25226 function addExportName(key, val) { 25227 exportNames[key] = exportNames[key] || []; 25228 exportNames[key].push(val); 25229 } 25230 25231 function pushModule(source, key, specifiers) { 25232 var module = void 0; 25233 modules.forEach(function (m) { 25234 if (m.key === source) { 25235 module = m; 25236 } 25237 }); 25238 if (!module) { 25239 modules.push(module = { key: source, imports: [], exports: [] }); 25240 } 25241 module[key] = module[key].concat(specifiers); 25242 } 25243 25244 function buildExportCall(name, val) { 25245 return t.expressionStatement(t.callExpression(exportIdent, [t.stringLiteral(name), val])); 25246 } 25247 25248 var body = path.get("body"); 25249 25250 var canHoist = true; 25251 for (var _iterator2 = body, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) { 25252 var _ref3; 25253 25254 if (_isArray2) { 25255 if (_i2 >= _iterator2.length) break; 25256 _ref3 = _iterator2[_i2++]; 25257 } else { 25258 _i2 = _iterator2.next(); 25259 if (_i2.done) break; 25260 _ref3 = _i2.value; 25261 } 25262 25263 var _path = _ref3; 25264 25265 if (_path.isExportDeclaration()) _path = _path.get("declaration"); 25266 if (_path.isVariableDeclaration() && _path.node.kind !== "var") { 25267 canHoist = false; 25268 break; 25269 } 25270 } 25271 25272 for (var _iterator3 = body, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, _getIterator3.default)(_iterator3);;) { 25273 var _ref4; 25274 25275 if (_isArray3) { 25276 if (_i3 >= _iterator3.length) break; 25277 _ref4 = _iterator3[_i3++]; 25278 } else { 25279 _i3 = _iterator3.next(); 25280 if (_i3.done) break; 25281 _ref4 = _i3.value; 25282 } 25283 25284 var _path2 = _ref4; 25285 25286 if (canHoist && _path2.isFunctionDeclaration()) { 25287 beforeBody.push(_path2.node); 25288 removedPaths.push(_path2); 25289 } else if (_path2.isImportDeclaration()) { 25290 var source = _path2.node.source.value; 25291 pushModule(source, "imports", _path2.node.specifiers); 25292 for (var name in _path2.getBindingIdentifiers()) { 25293 _path2.scope.removeBinding(name); 25294 variableIds.push(t.identifier(name)); 25295 } 25296 _path2.remove(); 25297 } else if (_path2.isExportAllDeclaration()) { 25298 pushModule(_path2.node.source.value, "exports", _path2.node); 25299 _path2.remove(); 25300 } else if (_path2.isExportDefaultDeclaration()) { 25301 var declar = _path2.get("declaration");
25302 if (declar.isClassDeclaration() || declar.isFunctionDeclaration()) { 25303 var id = declar.node.id; 25304 var nodes = []; 25305 25306 if (id) { 25307 nodes.push(declar.node); 25308 nodes.push(buildExportCall("default", id)); 25309 addExportName(id.name, "default"); 25310 } else { 25311 nodes.push(buildExportCall("default", t.toExpression(declar.node))); 25312 } 25313 25314 if (!canHoist || declar.isClassDeclaration()) { 25315 _path2.replaceWithMultiple(nodes); 25316 } else { 25317 beforeBody = beforeBody.concat(nodes); 25318 removedPaths.push(_path2); 25319 } 25320 } else { 25321 _path2.replaceWith(buildExportCall("default", declar.node)); 25322 } 25323 } else if (_path2.isExportNamedDeclaration()) { 25324 var _declar = _path2.get("declaration"); 25325 25326 if (_declar.node) { 25327 _path2.replaceWith(_declar); 25328 25329 var _nodes = []; 25330 var bindingIdentifiers = void 0; 25331 if (_path2.isFunction()) { 25332 var node = _declar.node; 25333 var _name = node.id.name; 25334 if (canHoist) { 25335 addExportName(_name, _name); 25336 beforeBody.push(node); 25337 beforeBody.push(buildExportCall(_name, node.id)); 25338 removedPaths.push(_path2); 25339 } else { 25340 var _bindingIdentifiers; 25341 25342 bindingIdentifiers = (_bindingIdentifiers = {}, _bindingIdentifiers[_name] = node.id, _bindingIdentifiers); 25343 } 25344 } else { 25345 bindingIdentifiers = _declar.getBindingIdentifiers(); 25346 } 25347 for (var _name2 in bindingIdentifiers) { 25348 addExportName(_name2, _name2); 25349 _nodes.push(buildExportCall(_name2, t.identifier(_name2))); 25350 } 25351 _path2.insertAfter(_nodes); 25352 } else { 25353 var specifiers = _path2.node.specifiers; 25354 if (specifiers && specifiers.length) { 25355 if (_path2.node.source) { 25356 pushModule(_path2.node.source.value, "exports", specifiers); 25357 _path2.remove(); 25358 } else { 25359 var _nodes2 = []; 25360 25361 for (var _iterator7 = specifiers, _isArray7 = Array.isArray(_iterator7), _i7 = 0, _iterator7 = _isArray7 ? _iterator7 : (0, _getIterator3.default)(_iterator7);;) { 25362 var _ref8; 25363 25364 if (_isArray7) { 25365 if (_i7 >= _iterator7.length) break; 25366 _ref8 = _iterator7[_i7++]; 25367 } else { 25368 _i7 = _iterator7.next(); 25369 if (_i7.done) break; 25370 _ref8 = _i7.value; 25371 } 25372 25373 var specifier = _ref8; 25374 25375 _nodes2.push(buildExportCall(specifier.exported.name, specifier.local)); 25376 addExportName(specifier.local.name, specifier.exported.name); 25377 } 25378 25379 _path2.replaceWithMultiple(_nodes2); 25380 } 25381 } 25382 } 25383 } 25384 } 25385 25386 modules.forEach(function (specifiers) { 25387 var setterBody = []; 25388 var target = path.scope.generateUidIdentifier(specifiers.key); 25389 25390 for (var _iterator4 = specifiers.imports, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, _getIterator3.default)(_iterator4);;) { 25391 var _ref5; 25392 25393 if (_isArray4) { 25394 if (_i4 >= _iterator4.length) break; 25395 _ref5 = _iterator4[_i4++]; 25396 } else { 25397 _i4 = _iterator4.next(); 25398 if (_i4.done) break; 25399 _ref5 = _i4.value; 25400 } 25401 25402 var specifier = _ref5; 25403 25404 if (t.isImportNamespaceSpecifier(specifier)) {
25405 setterBody.push(t.expressionStatement(t.assignmentExpression("=", specifier.local, target))); 25406 } else if (t.isImportDefaultSpecifier(specifier)) { 25407 specifier = t.importSpecifier(specifier.local, t.identifier("default")); 25408 } 25409 25410 if (t.isImportSpecifier(specifier)) { 25411 setterBody.push(t.expressionStatement(t.assignmentExpression("=", specifier.local, t.memberExpression(target, specifier.imported)))); 25412 } 25413 } 25414 25415 if (specifiers.exports.length) { 25416 var exportObjRef = path.scope.generateUidIdentifier("exportObj"); 25417 25418 setterBody.push(t.variableDeclaration("var", [t.variableDeclarator(exportObjRef, t.objectExpression([]))])); 25419 25420 for (var _iterator5 = specifiers.exports, _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : (0, _getIterator3.default)(_iterator5);;) { 25421 var _ref6; 25422 25423 if (_isArray5) { 25424 if (_i5 >= _iterator5.length) break; 25425 _ref6 = _iterator5[_i5++]; 25426 } else { 25427 _i5 = _iterator5.next(); 25428 if (_i5.done) break; 25429 _ref6 = _i5.value; 25430 } 25431 25432 var node = _ref6; 25433 25434 if (t.isExportAllDeclaration(node)) { 25435 setterBody.push(buildExportAll({ 25436 KEY: path.scope.generateUidIdentifier("key"), 25437 EXPORT_OBJ: exportObjRef, 25438 TARGET: target 25439 })); 25440 } else if (t.isExportSpecifier(node)) { 25441 setterBody.push(t.expressionStatement(t.assignmentExpression("=", t.memberExpression(exportObjRef, node.exported), t.memberExpression(target, node.local)))); 25442 } else {} 25443 } 25444 25445 setterBody.push(t.expressionStatement(t.callExpression(exportIdent, [exportObjRef]))); 25446 } 25447 25448 sources.push(t.stringLiteral(specifiers.key)); 25449 setters.push(t.functionExpression(null, [target], t.blockStatement(setterBody))); 25450 }); 25451 25452 var moduleName = this.getModuleName(); 25453 if (moduleName) moduleName = t.stringLiteral(moduleName); 25454 25455 if (canHoist) { 25456 (0, _babelHelperHoistVariables2.default)(path, function (id) { 25457 return variableIds.push(id); 25458 }); 25459 } 25460 25461 if (variableIds.length) { 25462 beforeBody.unshift(t.variableDeclaration("var", variableIds.map(function (id) { 25463 return t.variableDeclarator(id); 25464 }))); 25465 } 25466 25467 path.traverse(reassignmentVisitor, { 25468 exports: exportNames, 25469 buildCall: buildExportCall, 25470 scope: path.scope 25471 }); 25472 25473 for (var _iterator6 = removedPaths, _isArray6 = Array.isArray(_iterator6), _i6 = 0, _iterator6 = _isArray6 ? _iterator6 : (0, _getIterator3.default)(_iterator6);;) { 25474 var _ref7; 25475 25476 if (_isArray6) { 25477 if (_i6 >= _iterator6.length) break; 25478 _ref7 = _iterator6[_i6++]; 25479 } else { 25480 _i6 = _iterator6.next(); 25481 if (_i6.done) break; 25482 _ref7 = _i6.value; 25483 } 25484 25485 var _path3 = _ref7; 25486 25487 _path3.remove(); 25488 } 25489 25490 path.node.body = [buildTemplate({ 25491 SYSTEM_REGISTER: t.memberExpression(t.identifier(state.opts.systemGlobal || "System"), t.identifier("register")), 25492 BEFORE_BODY: beforeBody, 25493 MODULE_NAME: moduleName, 25494 SETTERS: setters, 25495 SOURCES: sources, 25496 BODY: path.node.body, 25497 EXPORT_IDENTIFIER: exportIdent, 25498 CONTEXT_IDENTIFIER: contextIdent 25499 })]; 25500 } 25501 } 25502 } 25503 }; 25504 }; 25505 25506 var _babelHelperHoistVariables = __webpack_require__(187); 25507 25508 var _babelHelperHoistVariables2 = _interopRequireDefault(_babelHelperHoistVariables); 25509 25510 var _babelTemplate = __webpack_require__(4); 25511 25512 var _babelTemplate2 = _interopRequireDefault(_babelTemplate); 25513 25514 function _interopRequireDefault(obj) { 25515 return obj && obj.__esModule ? obj : { default: obj }; 25516 } 25517 25518 var buildTemplate = (0, _babelTemplate2.default)("\n SYSTEM_REGISTER(MODULE_NAME, [SOURCES], function (EXPORT_IDENTIFIER, CONTEXT_IDENTIFIER) {\n \"use strict\";\n BEFORE_BODY;\n return {\n setters: [SETTERS],\n execute: function () {\n BODY;\n }\n };\n });\n"); 25519 25520 var buildExportAll = (0, _babelTemplate2.default)("\n for (var KEY in TARGET) {\n if (KEY !== \"default\" && KEY !== \"__esMo
25520dule\") EXPORT_OBJ[KEY] = TARGET[KEY];\n }\n"); 25521 25522 var TYPE_IMPORT = "Import"; 25523 25524 module.exports = exports["default"]; 25525 25526/***/ }, 25527/* 206 */ 25528/***/ function(module, exports, __webpack_require__) { 25529 25530 "use strict"; 25531 25532 exports.__esModule = true; 25533 25534 exports.default = function (_ref) { 25535 var t = _ref.types; 25536 25537 function isValidDefine(path) { 25538 if (!path.isExpressionStatement()) return; 25539 25540 var expr = path.get("expression"); 25541 if (!expr.isCallExpression()) return false; 25542 if (!expr.get("callee").isIdentifier({ name: "define" })) return false; 25543 25544 var args = expr.get("arguments"); 25545 if (args.length === 3 && !args.shift().isStringLiteral()) return false; 25546 if (args.length !== 2) return false; 25547 if (!args.shift().isArrayExpression()) return false; 25548 if (!args.shift().isFunctionExpression()) return false; 25549 25550 return true; 25551 } 25552 25553 return { 25554 inherits: __webpack_require__(128), 25555 25556 visitor: { 25557 Program: { 25558 exit: function exit(path, state) { 25559 var last = path.get("body").pop(); 25560 if (!isValidDefine(last)) return; 25561 25562 var call = last.node.expression; 25563 var args = call.arguments; 25564 25565 var moduleName = args.length === 3 ? args.shift() : null; 25566 var amdArgs = call.arguments[0]; 25567 var func = call.arguments[1]; 25568 var browserGlobals = state.opts.globals || {}; 25569 25570 var commonArgs = amdArgs.elements.map(function (arg) { 25571 if (arg.value === "module" || arg.value === "exports") { 25572 return t.identifier(arg.value); 25573 } else { 25574 return t.callExpression(t.identifier("require"), [arg]); 25575 } 25576 }); 25577 25578 var browserArgs = amdArgs.elements.map(function (arg) { 25579 if (arg.value === "module") { 25580 return t.identifier("mod"); 25581 } else if (arg.value === "exports") { 25582 return t.memberExpression(t.identifier("mod"), t.identifier("exports")); 25583 } else { 25584 var memberExpression = void 0; 25585 25586 if (state.opts.exactGlobals) { 25587 var globalRef = browserGlobals[arg.value]; 25588 if (globalRef) { 25589 memberExpression = globalRef.split(".").reduce(function (accum, curr) { 25590 return t.memberExpression(accum, t.identifier(curr)); 25591 }, t.identifier("global")); 25592 } else { 25593 memberExpression = t.memberExpression(t.identifier("global"), t.identifier(t.toIdentifier(arg.value))); 25594 } 25595 } else { 25596 var requireName = (0, _path.basename)(arg.value, (0, _path.extname)(arg.value)); 25597 var globalName = browserGlobals[requireName] || requireName; 25598 memberExpression = t.memberExpression(t.identifier("global"), t.identifier(t.toIdentifier(globalName))); 25599 } 25600 25601 return memberExpression; 25602 } 25603 }); 25604 25605 var moduleNameOrBasename = moduleName ? moduleName.value : this.file.opts.basename; 25606 var globalToAssign = t.memberExpression(t.identifier("global"), t.identifier(t.toIdentifier(moduleNameOrBasename))); 25607 var prerequisiteAssignments = null; 25608 25609 if (state.opts.exactGlobals) { 25610 var globalName = browserGlobals[moduleNameOrBasename]; 25611 25612 if (globalName) { 25613 prerequisiteAssignments = []; 25614 25615 var members = globalName.split("."); 25616 globalToAssign = members.slice(1).reduce(function (accum, curr) { 25617 prerequisiteAssignments.push(buildPrerequisiteAssignment({ GLOBAL_REFERENCE: accum })); 25618 return t.memberExpression(accum, t.identifier(curr)); 25619 }, t.memberExpression(t.identifier("global"), t.identifier(members[0]))); 25620 } 25621 } 25622 25623 var globalExport = buildGlobalExport({ 25624 BROWSER_ARGUMENTS: browserArgs, 25625 PREREQUISITE_ASSIGNMENTS: prerequisiteAssignments, 25626 GLOBAL_TO_ASSIGN: globalToAssign 25627 }); 25628 25629 last.replaceWith(buildWrapper({ 25630 MODULE_NAME: moduleName, 25631 AMD_ARGUMENTS: amdArgs, 25632 COMMON_ARGUMENTS: commonArgs, 25633 GLOBAL_EXPORT: globalExport, 25634 FUNC: func 25635 })); 25636 } 25637 } 25638 } 25639 }; 25640 }; 25641 25642 var _path = __webpack_require__(17); 25643 25644 var _babelTemplate = __webpack_require__(4); 25645 25646 var _babelTemplate2 = _interopRequireDefault(_babelTemplate); 25647 25648 function _interopRequireDefault(obj) { 25649 return obj && obj.__esModule ? obj : { default: obj }; 25650 } 25651 25652 var buildPrerequisiteAssignment = (0, _babelTemplate2.default)("\n GLOBAL_REFERENCE = GLOBAL_REFERENCE || {}\n"); 25653 25654 var buildGlobalExport = (0, _babelTemplate2.default)("\n var mod = { exports: {} };\n factory(BROWSER_ARGUMENTS);\n PREREQUISITE_ASSIGNMENTS\n GLOBAL_TO_ASSIGN = mod.exports;\n"); 25655 25656 var buildWrapper = (0, _babelTemplate2.default)("\n (function (global, factory) {\n if (typeof define === \"function\" && define.amd) {\n define(MODULE_NAME, AMD_ARGUMENTS, factory);\n } else if (typeof exports !== \"undefined\") {\n factory(COMMON_ARGUMENTS);\n } else {\n GLOBAL_EXPORT\n }\n })(this, FUNC);\n"); 25657 25658 module.exports = exports["default"]; 25659 25660/***/ }, 25661/* 207 */ 25662/***/ function(module, exports, __webpack_require__) { 25663 25664 "use strict"; 25665 25666 exports.__esModule = true; 25667 25668 exports.default = function (_ref) { 25669 var t = _ref.types; 25670 25671 function build(node, nodes, scope) { 25672 var first = node.specifiers[0]; 25673 if (!t.isExportNamespaceSpecifier(first) && !t.isExportDefaultSpecifier(first)) return; 25674 25675 var specifier = node.specifiers.shift(); 25676 var uid = scope.generateUidIdentifier(specifier.exported.name); 25677 25678 var newSpecifier = void 0; 25679 if (t.isExportNamespaceSpecifier(specifier)) { 25680 newSpecifier = t.importNamespaceSpecifier(uid); 25681 } else { 25682 newSpecifier = t.importDefaultSpecifier(uid); 25683 } 25684 25685 nodes.push(t.importDeclaration([newSpecifier], node.source)); 25686 nodes.push(t.exportNamedDeclaration(null, [t.exportSpecifier(uid, specifier.exported)])); 25687 25688 build(node, nodes, scope); 25689 } 25690 25691 return { 25692 inherits: __webpack_require__(197), 25693 25694 visitor: { 25695 ExportNamedDeclaration: function ExportNamedDeclaration(path) { 25696 var node = path.node, 25697 scope = path.scope; 25698 25699 var nodes = []; 25700 build(node, nodes, scope); 25701 if (!nodes.length) return; 25702 25703 if (node.specifiers.length >= 1) { 25704 nodes.push(node); 25705 } 25706 path.replaceWithMultiple(nodes); 25707 } 25708 } 25709 }; 25710 }; 25711 25712 module.exports = exports["default"]; 25713 25714/***/ }, 25715/* 208 */ 25716/***/ function(module, exports, __webpack_require__) { 25717 25718 "use strict"; 25719 25720 exports.__esModule = true; 25721 25722 var _getIterator2 = __webpack_require__(2); 25723 25724 var _getIterator3 = _interopRequireDefault(_getIterator2); 25725 25726 exports.default = function (_ref) { 25727 var t = _ref.types; 25728 25729 var FLOW_DIRECTIVE = "@flow"; 25730 25731 return { 25732 inherits: __webpack_require__(123), 25733 25734 visitor: { 25735 Program: function Program(path, _ref2) { 25736 var comments = _ref2.file.ast.comments; 25737 25738 for (var _iterator = comments, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) { 25739 var _ref3; 25740 25741 if (_isArray) { 25742 if (_i >= _iterator.length) break; 25743 _ref3 = _iterator[_i++]; 25744 } else { 25745 _i = _iterator.next(); 25746 if (_i.done) break; 25747 _ref3 = _i.value; 25748 } 25749 25750 var comment = _ref3; 25751 25752 if (comment.value.indexOf(FLOW_DIRECTIVE) >= 0) { 25753 comment.value = comment.value.replace(FLOW_DIRECTIVE, ""); 25754 25755 if (!comment.value.replace(/\*/g, "").trim()) comment.ignore = true; 25756 } 25757 } 25758 }, 25759 Flow: function Flow(path) { 25760 path.remove(); 25761 }, 25762 ClassProperty: function ClassProperty(path) { 25763 path.node.variance = null; 25764 path.node.typeAnnotation = null; 25765 if (!path.node.value) path.remove(); 25766 }, 25767 Class: function Class(path) { 25768 path.node.implements = null; 25769 25770 path.get("body.body").forEach(function (child) { 25771 if (child.isClassProperty()) { 25772 child.node.typeAnnotation = null; 25773 if (!child.node.value) child.remove(); 25774 } 25775 }); 25776 }, 25777 AssignmentPattern: function AssignmentPattern(_ref4) { 25778 var node = _ref4.node; 25779 25780 node.left.optional = false;
25781 }, 25782 Function: function Function(_ref5) { 25783 var node = _ref5.node; 25784 25785 for (var i = 0; i < node.params.length; i++) { 25786 var param = node.params[i]; 25787 param.optional = false; 25788 } 25789 }, 25790 TypeCastExpression: function TypeCastExpression(path) { 25791 var node = path.node; 25792 25793 do { 25794 node = node.expression; 25795 } while (t.isTypeCastExpression(node)); 25796 path.replaceWith(node); 25797 } 25798 } 25799 }; 25800 }; 25801 25802 function _interopRequireDefault(obj) { 25803 return obj && obj.__esModule ? obj : { default: obj }; 25804 } 25805 25806 module.exports = exports["default"]; 25807 25808/***/ }, 25809/* 209 */ 25810/***/ function(module, exports, __webpack_require__) { 25811 25812 "use strict"; 25813 25814 exports.__esModule = true; 25815 25816 exports.default = function (_ref) { 25817 var t = _ref.types; 25818 25819 function getTempId(scope) { 25820 var id = scope.path.getData("functionBind"); 25821 if (id) return id; 25822 25823 id = scope.generateDeclaredUidIdentifier("context"); 25824 return scope.path.setData("functionBind", id); 25825 } 25826 25827 function getStaticContext(bind, scope) { 25828 var object = bind.object || bind.callee.object; 25829 return scope.isStatic(object) && object; 25830 } 25831 25832 function inferBindContext(bind, scope) { 25833 var staticContext = getStaticContext(bind, scope); 25834 if (staticContext) return staticContext; 25835 25836 var tempId = getTempId(scope); 25837 if (bind.object) { 25838 bind.callee = t.sequenceExpression([t.assignmentExpression("=", tempId, bind.object), bind.callee]); 25839 } else { 25840 bind.callee.object = t.assignmentExpression("=", tempId, bind.callee.object); 25841 } 25842 return tempId; 25843 } 25844 25845 return { 25846 inherits: __webpack_require__(198), 25847 25848 visitor: { 25849 CallExpression: function CallExpression(_ref2) { 25850 var node = _ref2.node, 25851 scope = _ref2.scope; 25852 25853 var bind = node.callee; 25854 if (!t.isBindExpression(bind)) return; 25855 25856 var context = inferBindContext(bind, scope); 25857 node.callee = t.memberExpression(bind.callee, t.identifier("call")); 25858 node.arguments.unshift(context); 25859 }, 25860 BindExpression: function BindExpression(path) { 25861 var node = path.node, 25862 scope = path.scope; 25863 25864 var context = inferBindContext(node, scope); 25865 path.replaceWith(t.callExpression(t.memberExpression(node.callee, t.identifier("bind")), [context])); 25866 } 25867 } 25868 }; 25869 }; 25870 25871 module.exports = exports["default"]; 25872 25873/***/ }, 25874/* 210 */ 25875/***/ function(module, exports, __webpack_require__) { 25876 25877 "use strict"; 25878 25879 exports.__esModule = true; 25880 25881 var _getIterator2 = __webpack_require__(2); 25882 25883 var _getIterator3 = _interopRequireDefault(_getIterator2); 25884 25885 exports.default = function (_ref) { 25886 var t = _ref.types; 25887 25888 function hasRestProperty(path) { 25889 var foundRestProperty = false; 25890 path.traverse({ 25891 RestProperty: function RestProperty() { 25892 foundRestProperty = true; 25893 path.stop(); 25894 } 25895 }); 25896 return foundRestProperty; 25897 } 25898 25899 function hasSpread(node) { 25900 for (var _iterator = node.properties, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) { 25901 var _ref2; 25902 25903 if (_isArray) { 25904 if (_i >= _iterator.length) break; 25905 _ref2 = _iterator[_i++]; 25906 } else { 25907 _i = _iterator.next(); 25908 if (_i.done) break; 25909 _ref2 = _i.value; 25910 } 25911 25912 var prop = _ref2; 25913 25914 if (t.isSpreadProperty(prop)) { 25915 return true; 25916 } 25917 } 25918 return false; 25919 } 25920 25921 function createObjectSpread(file, props, objRef) { 25922 var restProperty = props.pop(); 25923 25924 var keys = []; 25925 for (var _iterator2 = props, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) { 25926 var _ref3; 25927 25928 if (_isArray2) { 25929 if (_i2 >= _iterator2.length) break; 25930 _ref3 = _iterator2[_i2++]; 25931 } else { 25932 _i2 = _iterator2.next(); 25933 if (_i2.done) break; 25934 _ref3 = _i2.value; 25935 } 25936 25937 var prop = _ref3; 25938 25939 var key = prop.key; 25940 if (t.isIdentifier(key) && !prop.computed) { 25941 key = t.stringLiteral(prop.key.name); 25942 } 25943 keys.push(key); 25944 } 25945 25946 return [restProperty.argument, t.callExpression(file.addHelper("objectWithoutProperties"), [objRef, t.arrayExpression(keys)])]; 25947 } 25948 25949 function replaceRestProperty(parentPath, paramPath, i, numParam
25949s) { 25950 if (paramPath.isAssignmentPattern()) { 25951 replaceRestProperty(parentPath, paramPath.get("left"), i, numParams); 25952 return; 25953 } 25954 25955 if (paramPath.isObjectPattern() && hasRestProperty(paramPath)) { 25956 var uid = parentPath.scope.generateUidIdentifier("ref"); 25957 25958 var declar = t.variableDeclaration("let", [t.variableDeclarator(paramPath.node, uid)]); 25959 declar._blockHoist = i ? numParams - i : 1; 25960 25961 parentPath.ensureBlock(); 25962 parentPath.get("body").unshiftContainer("body", declar); 25963 paramPath.replaceWith(uid); 25964 } 25965 } 25966 25967 return { 25968 inherits: __webpack_require__(199), 25969 25970 visitor: { 25971 Function: function Function(path) { 25972 var params = path.get("params"); 25973 for (var i = 0; i < params.length; i++) { 25974 replaceRestProperty(params[i].parentPath, params[i], i, params.length); 25975 } 25976 }, 25977 VariableDeclarator: function VariableDeclarator(path, file) { 25978 if (!path.get("id").isObjectPattern()) { 25979 return; 25980 } 25981 25982 var insertionPath = path; 25983 25984 path.get("id").traverse({ 25985 RestProperty: function RestProperty(path) { 25986 if (this.originalPath.node.id.properties.length > 1 && !t.isIdentifier(this.originalPath.node.init)) { 25987 var initRef = path.scope.generateUidIdentifierBasedOnNode(this.originalPath.node.init, "ref"); 25988 25989 this.originalPath.insertBefore(t.variableDeclarator(initRef, this.originalPath.node.init)); 25990 25991 this.originalPath.replaceWith(t.variableDeclarator(this.originalPath.node.id, initRef)); 25992 25993 return; 25994 } 25995 25996 var ref = this.originalPath.node.init; 25997 25998 path.findParent(function (path) { 25999 if (path.isObjectProperty()) { 26000 ref = t.memberExpression(ref, t.identifier(path.node.key.name)); 26001 } else if (path.isVariableDeclarator()) { 26002 return true; 26003 } 26004 }); 26005 26006 var _createObjectSpread = createObjectSpread(file, path.parentPath.node.properties, ref), 26007 argument = _createObjectSpread[0], 26008 callExpression = _createObjectSpread[1]; 26009 26010 insertionPath.insertAfter(t.variableDeclarator(argument, callExpression)); 26011 26012 insertionPath = insertionPath.getSibling(insertionPath.key + 1); 26013 26014 if (path.parentPath.node.properties.length === 0) { 26015 path.findParent(function (path) { 26016 return path.isObjectProperty() || path.isVariableDeclarator(); 26017 }).remove(); 26018 } 26019 } 26020 }, { 26021 originalPath: path 26022 }); 26023 }, 26024 ExportNamedDeclaration: function ExportNamedDeclaration(path) { 26025 var declaration = path.get("declaration"); 26026 if (!declaration.isVariableDeclaration()) return; 26027 if (!hasRestProperty(declaration)) return; 26028 26029 var specifiers = []; 26030 26031 for (var name in path.getOuterBindingIdentifiers(path)) { 26032 var id = t.identifier(name); 26033 specifiers.push(t.exportSpecifier(id, id)); 26034 } 26035 26036 path.replaceWith(declaration.node); 26037 path.insertAfter(t.exportNamedDeclaration(null, specifiers)); 26038 }, 26039 CatchClause: function CatchClause(path) { 26040 var paramPath = path.get("param"); 26041 replaceRestProperty(paramPath.parentPath, paramPath); 26042 }, 26043 AssignmentExpression: function AssignmentExpression(path, file) { 26044 var leftPath = path.get("left"); 26045 if (leftPath.isObjectPattern() && hasRestProperty(leftPath)) { 26046 var nodes = []; 26047 26048 var ref = void 0; 26049 if (path.isCompletionRecord() || path.parentPath.isExpressionStatement()) { 26050 ref = path.scope.generateUidIdentifierBasedOnNode(path.node.right, "ref"); 26051 26052 nodes.push(t.variableDeclaration("var", [t.variableDeclarator(ref, path.node.right)])); 26053 } 26054 26055 var _createObjectSpread2 = createObjectSpread(file, path.node.left.properties, ref), 26056 argument = _createObjectSpread2[0], 26057 callExpression = _createObjectSpread2[1]; 26058 26059 var nodeWithoutSpread = t.clone(path.node); 26060 nodeWithoutSpread.right = ref;
26061 nodes.push(t.expressionStatement(nodeWithoutSpread)); 26062 nodes.push(t.toStatement(t.assignmentExpression("=", argument, callExpression))); 26063 26064 if (ref) { 26065 nodes.push(t.expressionStatement(ref)); 26066 } 26067 26068 path.replaceWithMultiple(nodes); 26069 } 26070 }, 26071 ForXStatement: function ForXStatement(path) { 26072 var node = path.node, 26073 scope = path.scope; 26074 26075 var leftPath = path.get("left"); 26076 var left = node.left; 26077 26078 if (t.isObjectPattern(left) && hasRestProperty(leftPath)) { 26079 var temp = scope.generateUidIdentifier("ref"); 26080 26081 node.left = t.variableDeclaration("var", [t.variableDeclarator(temp)]); 26082 26083 path.ensureBlock(); 26084 26085 node.body.body.unshift(t.variableDeclaration("var", [t.variableDeclarator(left, temp)])); 26086 26087 return; 26088 } 26089 26090 if (!t.isVariableDeclaration(left)) return; 26091 26092 var pattern = left.declarations[0].id; 26093 if (!t.isObjectPattern(pattern)) return; 26094 26095 var key = scope.generateUidIdentifier("ref"); 26096 node.left = t.variableDeclaration(left.kind, [t.variableDeclarator(key, null)]); 26097 26098 path.ensureBlock(); 26099 26100 node.body.body.unshift(t.variableDeclaration(node.left.kind, [t.variableDeclarator(pattern, key)])); 26101 }, 26102 ObjectExpression: function ObjectExpression(path, file) { 26103 if (!hasSpread(path.node)) return; 26104 26105 var useBuiltIns = file.opts.useBuiltIns || false; 26106 if (typeof useBuiltIns !== "boolean") { 26107 throw new Error("transform-object-rest-spread currently only accepts a boolean " + "option for useBuiltIns (defaults to false)"); 26108 } 26109 26110 var args = []; 26111 var props = []; 26112 26113 function push() { 26114 if (!props.length) return; 26115 args.push(t.objectExpression(props)); 26116 props = []; 26117 } 26118 26119 for (var _iterator3 = path.node.properties, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, _getIterator3.default)(_iterator3);;) { 26120 var _ref4; 26121 26122 if (_isArray3) { 26123 if (_i3 >= _iterator3.length) break; 26124 _ref4 = _iterator3[_i3++]; 26125 } else { 26126 _i3 = _iterator3.next(); 26127 if (_i3.done) break; 26128 _ref4 = _i3.value; 26129 } 26130 26131 var prop = _ref4; 26132 26133 if (t.isSpreadProperty(prop)) { 26134 push(); 26135 args.push(prop.argument); 26136 } else { 26137 props.push(prop); 26138 } 26139 } 26140 26141 push(); 26142 26143 if (!t.isObjectExpression(args[0])) { 26144 args.unshift(t.objectExpression([])); 26145 } 26146 26147 var helper = useBuiltIns ? t.memberExpression(t.identifier("Object"), t.identifier("assign")) : file.addHelper("extends"); 26148 26149 path.replaceWith(t.callExpression(helper, args)); 26150 } 26151 } 26152 }; 26153 }; 26154 26155 function _interopRequireDefault(obj) { 26156 return obj && obj.__esModule ? obj : { default: obj }; 26157 } 26158 26159 module.exports = exports["default"]; 26160 26161/***/ }, 26162/* 211 */ 26163/***/ function(module, exports, __webpack_require__) { 26164 26165 "use strict"; 26166 26167 exports.__esModule = true; 26168 26169 exports.default = function (_ref) { 26170 var t = _ref.types; 26171 26172 function addDisplayName(id, call) { 26173 var props = call.arguments[0].properties; 26174 var safe = true; 26175 26176 for (var i = 0; i < props.length; i++) { 26177 var prop = props[i]; 26178 var key = t.toComputedKey(prop); 26179 if (t.isLiteral(key, { value: "displayName" })) { 26180 safe = false; 26181 break; 26182 } 26183 } 26184 26185 if (safe) { 26186 props.unshift(t.objectProperty(t.identifier("displayName"), t.stringLiteral(id))); 26187 } 26188 } 26189 26190 var isCreateClassCallExpression = t.buildMatchMemberExpression("React.createClass"); 26191 26192 function isCreateClass(node) { 26193 if (!node || !t.isCallExpression(node)) return false; 26194 26195 if (!isCreateClassCallExpression(node.callee)) return false; 26196 26197 var args = node.arguments; 26198 if (args.length !== 1) return false; 26199 26200 var first = args[0]; 26201 if (!t.isObjectExpression(first)) return false;
26202 26203 return true; 26204 } 26205 26206 return { 26207 visitor: { 26208 ExportDefaultDeclaration: function ExportDefaultDeclaration(_ref2, state) { 26209 var node = _ref2.node; 26210 26211 if (isCreateClass(node.declaration)) { 26212 var displayName = state.file.opts.basename; 26213 26214 if (displayName === "index") { 26215 displayName = _path2.default.basename(_path2.default.dirname(state.file.opts.filename)); 26216 } 26217 26218 addDisplayName(displayName, node.declaration); 26219 } 26220 }, 26221 CallExpression: function CallExpression(path) { 26222 var node = path.node; 26223 26224 if (!isCreateClass(node)) return; 26225 26226 var id = void 0; 26227 26228 path.find(function (path) { 26229 if (path.isAssignmentExpression()) { 26230 id = path.node.left; 26231 } else if (path.isObjectProperty()) { 26232 id = path.node.key; 26233 } else if (path.isVariableDeclarator()) { 26234 id = path.node.id; 26235 } else if (path.isStatement()) { 26236 return true; 26237 } 26238 26239 if (id) return true; 26240 }); 26241 26242 if (!id) return; 26243 26244 if (t.isMemberExpression(id)) { 26245 id = id.property; 26246 } 26247 26248 if (t.isIdentifier(id)) { 26249 addDisplayName(id.name, node); 26250 } 26251 } 26252 } 26253 }; 26254 }; 26255 26256 var _path = __webpack_require__(17); 26257 26258 var _path2 = _interopRequireDefault(_path); 26259 26260 function _interopRequireDefault(obj) { 26261 return obj && obj.__esModule ? obj : { default: obj }; 26262 } 26263 26264 module.exports = exports["default"]; 26265 26266/***/ }, 26267/* 212 */ 26268/***/ function(module, exports, __webpack_require__) { 26269 26270 "use strict"; 26271 26272 exports.__esModule = true; 26273 26274 var _getIterator2 = __webpack_require__(2); 26275 26276 var _getIterator3 = _interopRequireDefault(_getIterator2); 26277 26278 exports.default = function (_ref) { 26279 var t = _ref.types; 26280 26281 var JSX_ANNOTATION_REGEX = /\*?\s*@jsx\s+([^\s]+)/; 26282 26283 var visitor = (0, _babelHelperBuilderReactJsx2.default)({ 26284 pre: function pre(state) { 26285 var tagName = state.tagName; 26286 var args = state.args; 26287 if (t.react.isCompatTag(tagName)) { 26288 args.push(t.stringLiteral(tagName)); 26289 } else { 26290 args.push(state.tagExpr); 26291 } 26292 }, 26293 post: function post(state, pass) { 26294 state.callee = pass.get("jsxIdentifier")(); 26295 } 26296 }); 26297 26298 visitor.Program = function (path, state) { 26299 var file = state.file; 26300 26301 var id = state.opts.pragma || "React.createElement"; 26302 26303 for (var _iterator = file.ast.comments, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) { 26304 var _ref2; 26305 26306 if (_isArray) { 26307 if (_i >= _iterator.length) break; 26308 _ref2 = _iterator[_i++]; 26309 } else { 26310 _i = _iterator.next(); 26311 if (_i.done) break; 26312 _ref2 = _i.value; 26313 } 26314 26315 var comment = _ref2; 26316 26317 var matches = JSX_ANNOTATION_REGEX.exec(comment.value); 26318 if (matches) { 26319 id = matches[1]; 26320 if (id === "React.DOM") { 26321 throw file.buildCodeFrameError(comment, "The @jsx React.DOM pragma has been deprecated as of React 0.12"); 26322 } else { 26323 break; 26324 } 26325 } 26326 } 26327 26328 state.set("jsxIdentifier", function () { 26329 return id.split(".").map(function (name) { 26330 return t.identifier(name); 26331 }).reduce(function (object, property) { 26332 return t.memberExpression(object, property); 26333 }); 26334 }); 26335 }; 26336 26337 return { 26338 inherits: _babelPluginSyntaxJsx2.default, 26339 visitor: visitor 26340 }; 26341 }; 26342 26343 var _babelPluginSyntaxJsx = __webpack_require__(124); 26344 26345 var _babelPluginSyntaxJsx2 = _interopRequireDefault(_babelPluginSyntaxJsx); 26346 26347 var _babelHelperBuilderReactJsx = __webpack_require__(184); 26348 26349 var _babelHelperBuilderReactJsx2 = _interopRequireDefault(_babelHelperBuilderReactJsx); 26350 26351 function _interopRequireDefault(obj) { 26352 return obj && obj.__esModule ? obj : { default: obj }; 26353 } 26354 26355 module.exports = exports["default"]; 26356 26357/***/ }, 26358/* 213 */ 26359/***/ function(module, exports, __webpack_require__) { 26360 26361 "use strict"; 26362 26363 exports.__esModule = true; 26364 26365 var _getIterator2 = __webpack_require__(2); 26366 26367 var _getIterator3 = _interopRequireDefault(_getIterator2); 26368 26369 exports.default = function () { 26370 return { 26371 visitor: { 26372 Program: function Program(path, state) { 26373 if (state.opts.strict === false || state.opts.strictMode === false) return; 26374 26375 var node = path.node; 26376
26377 for (var _iterator = node.directives, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) { 26378 var _ref; 26379 26380 if (_isArray) { 26381 if (_i >= _iterator.length) break; 26382 _ref = _iterator[_i++]; 26383 } else { 26384 _i = _iterator.next(); 26385 if (_i.done) break; 26386 _ref = _i.value; 26387 } 26388 26389 var directive = _ref; 26390 26391 if (directive.value.value === "use strict") return; 26392 } 26393 26394 path.unshiftContainer("directives", t.directive(t.directiveLiteral("use strict"))); 26395 } 26396 } 26397 }; 26398 }; 26399 26400 var _babelTypes = __webpack_require__(1); 26401 26402 var t = _interopRequireWildcard(_babelTypes); 26403 26404 function _interopRequireWildcard(obj) { 26405 if (obj && obj.__esModule) { 26406 return obj; 26407 } else { 26408 var newObj = {};if (obj != null) { 26409 for (var key in obj) { 26410 if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; 26411 } 26412 }newObj.default = obj;return newObj; 26413 } 26414 } 26415 26416 function _interopRequireDefault(obj) { 26417 return obj && obj.__esModule ? obj : { default: obj }; 26418 } 26419 26420 module.exports = exports["default"]; 26421 26422/***/ }, 26423/* 214 */ 26424/***/ function(module, exports, __webpack_require__) { 26425 26426 "use strict"; 26427 26428 exports.__esModule = true; 26429 26430 var _babelPluginTransformEs2015TemplateLiterals = __webpack_require__(81); 26431 26432 var _babelPluginTransformEs2015TemplateLiterals2 = _interopRequireDefault(_babelPluginTransformEs2015TemplateLiterals); 26433 26434 var _babelPluginTransformEs2015Literals = __webpack_require__(74); 26435 26436 var _babelPluginTransformEs2015Literals2 = _interopRequireDefault(_babelPluginTransformEs2015Literals); 26437 26438 var _babelPluginTransformEs2015FunctionName = __webpack_require__(73); 26439 26440 var _babelPluginTransformEs2015FunctionName2 = _interopRequireDefault(_babelPluginTransformEs2015FunctionName); 26441 26442 var _babelPluginTransformEs2015ArrowFunctions = __webpack_require__(66); 26443 26444 var _babelPluginTransformEs2015ArrowFunctions2 = _interopRequireDefault(_babelPluginTransformEs2015ArrowFunctions); 26445 26446 var _babelPluginTransformEs2015BlockScopedFunctions = __webpack_require__(67); 26447 26448 var _babelPluginTransformEs2015BlockScopedFunctions2 = _interopRequireDefault(_babelPluginTransformEs2015BlockScopedFunctions); 26449 26450 var _babelPluginTransformEs2015Classes = __webpack_require__(69); 26451 26452 var _babelPluginTransformEs2015Classes2 = _interopRequireDefault(_babelPluginTransformEs2015Classes); 26453 26454 var _babelPluginTransformEs2015ObjectSuper = __webpack_require__(76); 26455 26456 var _babelPluginTransformEs2015ObjectSuper2 = _interopRequireDefault(_babelPluginTransformEs2015ObjectSuper); 26457 26458 var _babelPluginTransformEs2015ShorthandProperties = __webpack_require__(78); 26459 26460 var _babelPluginTransformEs2015ShorthandProperties2 = _interopRequireDefault(_babelPluginTransformEs2015ShorthandProperties); 26461 26462 var _babelPluginTransformEs2015DuplicateKeys = __webpack_require__(127); 26463 26464 var _babelPluginTransformEs2015DuplicateKeys2 = _interopRequireDefault(_babelPluginTransformEs2015DuplicateKeys); 26465 26466 var _babelPluginTransformEs2015ComputedProperties = __webpack_require__(70); 26467 26468 var _babelPluginTransformEs2015ComputedProperties2 = _interopRequireDefault(_babelPluginTransformEs2015ComputedProperties); 26469 26470 var _babelPluginTransformEs2015ForOf = __webpack_require__(72); 26471 26472 var _babelPluginTransformEs2015ForOf2 = _interopRequireDefault(_babelPluginTransformEs2015ForOf); 26473 26474 var _babelPluginTransformEs2015StickyRegex = __webpack_require__(80); 26475 26476 var _babelPluginTransformEs2015StickyRegex2 = _interopRequireDefault(_babelPluginTransformEs2015StickyRegex); 26477 26478 var _babelPluginTransformEs2015UnicodeRegex = __webpack_require__(83); 26479 26480 var _babelPluginTransformEs2015UnicodeRegex2 = _interopRequireDefault(_babelPluginTransformEs2015UnicodeRegex); 26481 26482 var _babelPluginCheckEs2015Constants = __webpack_require__(64); 26483 26484 var _babelPluginCheckEs2015Constants2 = _interopRequireDefault(_babelPluginCheckEs2015Constants); 26485 26486 var _babelPluginTransformEs2015Spread = __webpack_require__(79); 26487 26488 var _babelPluginTransformEs2015Spread2 = _interopRequireDefault(_babelPluginTransformEs2015Spread); 26489 26490 var _babelPluginTransformEs2015Parameters = __webpack_require__(77); 26491 26492 var _babelPluginTransformEs2015Parameters2 = _interopRequireDefault(_babelPluginTransformEs2015Parameters); 26493 26494 var _babelPluginTransformEs2015Destructuring = __webpack_require__(71); 26495 26496 var _babelPluginTransformEs2015Destructuring2 = _interopRequireDefault(_babelPluginTransformEs2015Destructuring); 26497 26498 var _babelPluginTransformEs2015BlockScoping = __webpack_require__(68); 26499 26500 var _babelPluginTransformEs2015BlockScoping2 = _interopRequireDefault(_babelPluginTransformEs2015BlockScoping); 26501 26502 var _babelPluginTransformEs2015TypeofSymbol = __webpack_require__(82); 26503 26504 var _babelPluginTransformEs2015TypeofSymbol2 = _interopRequireDefault(_babelPluginTransformEs2015TypeofSymbol); 26505 26506 var _babelPluginTransformEs2015ModulesCommonjs = __webpack_require__(75); 26507 26508 var _babelPluginTransformEs2015ModulesCommonjs2 = _interopRequireDefault(_babelPluginTransformEs2015ModulesCommonjs); 26509 26510 var _babelPluginTransformEs2015ModulesSystemjs = __webpack_require__(205); 26511 26512 var _babelPluginTransformEs2015ModulesSystemjs2 = _interopRequireDefault(_babelPluginTransformEs2015ModulesSystemjs); 26513 26514 var _babelPluginTransformEs2015ModulesAmd = __webpack_require__(128); 26515 26516 var _babelPluginTransformEs2015ModulesAmd2 = _interopRequireDefault(_babelPluginTransformEs2015ModulesAmd); 26517 26518 var _babelPluginTransformEs2015ModulesUmd = __webpack_require__(206); 26519 26520 var _babelPluginTransformEs2015ModulesUmd2 = _interopRequireDefault(_babelPluginTransformEs2015ModulesUmd); 26521 26522 var _babelPluginTransformRegenerator = __webpack_require__(84); 26523 26524 var _babelPluginTransformRegenerator2 = _interopRequireDefault(_babelPluginTransformRegenerator); 26525 26526 function _interopRequireDefault(obj) { 26527 return obj && obj.__esModule ? obj : { default: obj }; 26528 } 26529 26530 function preset(context) { 26531 var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; 26532 26533 var moduleTypes = ["commonjs", "amd", "umd", "systemjs"]; 26534 var loose = false;
26535 var modules = "commonjs"; 26536 var spec = false; 26537 26538 if (opts !== undefined) { 26539 if (opts.loose !== undefined) loose = opts.loose; 26540 if (opts.modules !== undefined) modules = opts.modules; 26541 if (opts.spec !== undefined) spec = opts.spec; 26542 } 26543 26544 if (typeof loose !== "boolean") throw new Error("Preset es2015 'loose' option must be a boolean."); 26545 if (typeof spec !== "boolean") throw new Error("Preset es2015 'spec' option must be a boolean."); 26546 if (modules !== false && moduleTypes.indexOf(modules) === -1) { 26547 throw new Error("Preset es2015 'modules' option must be 'false' to indicate no modules\n" + "or a module type which be be one of: 'commonjs' (default), 'amd', 'umd', 'systemjs'"); 26548 } 26549 26550 var optsLoose = { loose: loose }; 26551 26552 return { 26553 plugins: [[_babelPluginTransformEs2015TemplateLiterals2.default, { loose: loose, spec: spec }], _babelPluginTransformEs2015Literals2.default, _babelPluginTransformEs2015FunctionName2.default, [_babelPluginTransformEs2015ArrowFunctions2.default, { spec: spec }], _babelPluginTransformEs2015BlockScopedFunctions2.default, [_babelPluginTransformEs2015Classes2.default, optsLoose], _babelPluginTransformEs2015ObjectSuper2.default, _babelPluginTransformEs2015ShorthandProperties2.default, _babelPluginTransformEs2015DuplicateKeys2.default, [_babelPluginTransformEs2015ComputedProperties2.default, optsLoose], [_babelPluginTransformEs2015ForOf2.default, optsLoose], _babelPluginTransformEs2015StickyRegex2.default, _babelPluginTransformEs2015UnicodeRegex2.default, _babelPluginCheckEs2015Constants2.default, [_babelPluginTransformEs2015Spread2.default, optsLoose], _babelPluginTransformEs2015Parameters2.default, [_babelPluginTransformEs2015Destructuring2.default, optsLoose], _babelPluginTransformEs2015BlockScoping2.default, _babelPluginTransformEs2015TypeofSymbol2.default, modules === "commonjs" && [_babelPluginTransformEs2015ModulesCommonjs2.default, optsLoose], modules === "systemjs" && [_babelPluginTransformEs2015ModulesSystemjs2.default, optsLoose], modules === "amd" && [_babelPluginTransformEs2015ModulesAmd2.default, optsLoose], modules === "umd" && [_babelPluginTransformEs2015ModulesUmd2.default, optsLoose], [_babelPluginTransformRegenerator2.default, { async: false, asyncGenerators: false }]].filter(Boolean) }; 26554 } 26555 26556 var oldConfig = preset({}); 26557 26558 exports.default = oldConfig; 26559 26560 Object.defineProperty(oldConfig, "buildPreset", { 26561 configurable: true, 26562 writable: true, 26563 26564 enumerable: false, 26565 value: preset 26566 }); 26567 module.exports = exports["default"]; 26568 26569/***/ }, 26570/* 215 */ 26571/***/ function(module, exports, __webpack_require__) { 26572 26573 "use strict"; 26574 26575 exports.__esModule = true; 26576 26577 var _babelPluginTransformExponentiationOperator = __webpack_require__(129); 26578 26579 var _babelPluginTransformExponentiationOperator2 = _interopRequireDefault(_babelPluginTransformExponentiationOperator); 26580 26581 function _interopRequireDefault(obj) { 26582 return obj && obj.__esModule ? obj : { default: obj }; 26583 } 26584 26585 exports.default = { 26586 plugins: [_babelPluginTransformExponentiationOperator2.default] 26587 }; 26588 module.exports = exports["default"]; 26589 26590/***/ }, 26591/* 216 */ 26592/***/ function(module, exports, __webpack_require__) { 26593 26594 "use strict"; 26595 26596 exports.__esModule = true; 26597 26598 var _babelPluginSyntaxTrailingFunctionCommas = __webpack_require__(125); 26599 26600 var _babelPluginSyntaxTrailingFunctionCommas2 = _interopRequireDefault(_babelPluginSyntaxTrailingFunctionCommas); 26601 26602 var _babelPluginTransformAsyncToGenerator = __webpack_require__(126); 26603 26604 var _babelPluginTransformAsyncToGenerator2 = _interopRequireDefault(_babelPluginTransformAsyncToGenerator); 26605 26606 function _interopRequireDefault(obj) { 26607 return obj && obj.__esModule ? obj : { default: obj }; 26608 } 26609 26610 exports.default = { 26611 plugins: [_babelPluginSyntaxTrailingFunctionCommas2.default, _babelPluginTransformAsyncToGenerator2.default] 26612 }; 26613 module.exports = exports["default"]; 26614 26615/***/ }, 26616/* 217 */ 26617/***/ function(module, exports, __webpack_require__) { 26618 26619 "use strict"; 26620 26621 exports.__esModule = true; 26622 26623 var _babelPresetStage = __webpack_require__(218); 26624 26625 var _babelPresetStage2 = _interopRequireDefault(_babelPresetStage); 26626 26627 var _babelPluginTransformClassConstructorCall = __webpack_require__(200); 26628 26629 var _babelPluginTransformClassConstructorCall2 = _interopRequireDefault(_babelPluginTransformClassConstructorCall); 26630 26631 var _babelPluginTransformExportExtensions = __webpack_require__(207); 26632 26633 var _babelPluginTransformExportExtensions2 = _interopRequireDefault(_babelPluginTransformExportExtensions); 26634 26635 function _interopRequireDefault(obj) { 26636 return obj && obj.__esModule ? obj : { default: obj }; 26637 } 26638 26639 exports.default = { 26640 presets: [_babelPresetStage2.default], 26641 plugins: [_babelPluginTransformClassConstructorCall2.default, _babelPluginTransformExportExtensions2.default] 26642 }; 26643 module.exports = exports["default"]; 26644 26645/***/ }, 26646/* 218 */ 26647/***/ function(module, exports, __webpack_require__) { 26648 26649 "use strict"; 26650 26651 exports.__esModule = true; 26652 26653 var _babelPresetStage = __webpack_require__(219); 26654 26655 var _babelPresetStage2 = _interopRequireDefault(_babelPresetStage); 26656 26657 var _babelPluginTransformClassProperties = __webpack_require__(201); 26658 26659 var _babelPluginTransformClassProperties2 = _interopRequireDefault(_babelPluginTransformClassProperties); 26660 26661 var _babelPluginTransformDecorators = __webpack_require__(202); 26662 26663 var _babelPluginTransformDecorators2 = _interopRequireDefault(_babelPluginTransformDecorators); 26664 26665 var _babelPluginSyntaxDynamicImport = __webpack_require__(320); 26666 26667 var _babelPluginSyntaxDynamicImport2 = _interopRequireDefault(_babelPluginSyntaxDynamicImport); 26668 26669 function _interopRequireDefault(obj) { 26670 return obj && obj.__esModule ? obj : { default: obj }; 26671 } 26672 26673 exports.default = { 26674 presets: [_babelPresetStage2.default], 26675 plugins: [_babelPluginSyntaxDynamicImport2.default, _babelPluginTransformClassProperties2.default, _babelPluginTransformDecorators2.default] 26676 }; 26677 module.exports = exports["default"]; 26678 26679/***/ }, 26680/* 219 */ 26681/***/ function(module, exports, __webpack_require__) { 26682 26683 "use strict"; 26684 26685 exports.__esModule = true; 26686 26687 var _babelPluginSyntaxTrailingFunctionCommas = __webpack_require__(125); 26688 26689 var _babelPluginSyntaxTrailingFunctionCommas2 = _interopRequireDefault(_babelPluginSyntaxTrailingFunctionCommas); 26690 26691 var _babelPluginTransformAsyncToGenerator = __webpack_require__(126); 26692 26693 var _babelPluginTransformAsyncToGenerator2 = _interopRequireDefault(_babelPluginTransformAsyncToGenerator); 26694 26695 var _babelPluginTransformExponentiationOperator = __webpack_require__(129); 26696 26697 var _babelPluginTransformExponentiationOperator2 = _interopRequireDefault(_babelPluginTransformExponentiationOperator); 26698 26699 var _babelPluginTransformObjectRestSpread = __webpack_require__(210); 26700 26701 var _babelPluginTransformObjectRestSpread2 = _interopRequireDefault(_babelPluginTransformObjectRestSpread); 26702 26703 var _babelPluginTransformAsyncGeneratorFunctions = __webpack_require__(323); 26704 26705 var _babelPluginTransformAsyncGeneratorFunctions2 = _interopRequireDefault(_babelPluginTransformAsyncGeneratorFunctions); 26706 26707 function _interopRequireDefault(obj) { 26708 return obj && obj.__esModule ? obj : { default: obj }; 26709 } 26710 26711 exports.default = { 26712 plugins: [_babelPluginSyntaxTrailingFunctionCommas2.default, _babelPluginTransformAsyncToGenerator2.default, _babelPluginTransformExponentiationOperator2.default, _babelPluginTransformAsyncGeneratorFunctions2.default, _babelPluginTransformObjectRestSpread2.default] 26713 }; 26714 module.exports = exports["default"]; 26715 26716/***/ }, 26717/* 220 */ 26718/***/ function(module, exports, __webpack_require__) { 26719 26720 "use strict"; 26721 26722 exports.__esModule = true; 26723 26724 var _classCallCheck2 = __webpack_require__(3); 26725 26726 var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); 26727 26728 function _interopRequireDefault(obj) { 26729 return obj && obj.__esModule ? obj : { default: obj }; 26730 } 26731 26732 var Hub = function Hub(file, options) { 26733 (0, _classCallCheck3.default)(this, Hub); 26734 26735 this.file = file; 26736 this.options = options; 26737 }; 26738 26739 exports.default = Hub; 26740 module.exports = exports["default"]; 26741 26742/***/ }, 26743/* 221 */ 26744/***/ function(module, exports, __webpack_require__) { 26745 26746 "use strict"; 26747 26748 exports.__esModule = true;
26749 exports.Flow = exports.Pure = exports.Generated = exports.User = exports.Var = exports.BlockScoped = exports.Referenced = exports.Scope = exports.Expression = exports.Statement = exports.BindingIdentifier = exports.ReferencedMemberExpression = exports.ReferencedIdentifier = undefined; 26750 26751 var _babelTypes = __webpack_require__(1); 26752 26753 var t = _interopRequireWildcard(_babelTypes); 26754 26755 function _interopRequireWildcard(obj) { 26756 if (obj && obj.__esModule) { 26757 return obj; 26758 } else { 26759 var newObj = {};if (obj != null) { 26760 for (var key in obj) { 26761 if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; 26762 } 26763 }newObj.default = obj;return newObj; 26764 } 26765 } 26766 26767 var ReferencedIdentifier = exports.ReferencedIdentifier = { 26768 types: ["Identifier", "JSXIdentifier"], 26769 checkPath: function checkPath(_ref, opts) { 26770 var node = _ref.node, 26771 parent = _ref.parent; 26772 26773 if (!t.isIdentifier(node, opts) && !t.isJSXMemberExpression(parent, opts)) { 26774 if (t.isJSXIdentifier(node, opts)) { 26775 if (_babelTypes.react.isCompatTag(node.name)) return false; 26776 } else { 26777 return false; 26778 } 26779 } 26780 26781 return t.isReferenced(node, parent); 26782 } 26783 }; 26784 26785 var ReferencedMemberExpression = exports.ReferencedMemberExpression = { 26786 types: ["MemberExpression"], 26787 checkPath: function checkPath(_ref2) { 26788 var node = _ref2.node, 26789 parent = _ref2.parent; 26790 26791 return t.isMemberExpression(node) && t.isReferenced(node, parent); 26792 } 26793 }; 26794 26795 var BindingIdentifier = exports.BindingIdentifier = { 26796 types: ["Identifier"], 26797 checkPath: function checkPath(_ref3) {
26798 var node = _ref3.node, 26799 parent = _ref3.parent; 26800 26801 return t.isIdentifier(node) && t.isBinding(node, parent); 26802 } 26803 }; 26804 26805 var Statement = exports.Statement = { 26806 types: ["Statement"], 26807 checkPath: function checkPath(_ref4) { 26808 var node = _ref4.node, 26809 parent = _ref4.parent; 26810 26811 if (t.isStatement(node)) { 26812 if (t.isVariableDeclaration(node)) { 26813 if (t.isForXStatement(parent, { left: node })) return false; 26814 if (t.isForStatement(parent, { init: node })) return false; 26815 } 26816 26817 return true; 26818 } else { 26819 return false; 26820 } 26821 } 26822 }; 26823 26824 var Expression = exports.Expression = { 26825 types: ["Expression"], 26826 checkPath: function checkPath(path) { 26827 if (path.isIdentifier()) { 26828 return path.isReferencedIdentifier(); 26829 } else { 26830 return t.isExpression(path.node); 26831 } 26832 } 26833 }; 26834 26835 var Scope = exports.Scope = { 26836 types: ["Scopable"], 26837 checkPath: function checkPath(path) { 26838 return t.isScope(path.node, path.parent); 26839 } 26840 }; 26841 26842 var Referenced = exports.Referenced = { 26843 checkPath: function checkPath(path) { 26844 return t.isReferenced(path.node, path.parent); 26845 } 26846 }; 26847 26848 var BlockScoped = exports.BlockScoped = { 26849 checkPath: function checkPath(path) { 26850 return t.isBlockScoped(path.node); 26851 } 26852 }; 26853 26854 var Var = exports.Var = { 26855 types: ["VariableDeclaration"], 26856 checkPath: function checkPath(path) { 26857 return t.isVar(path.node); 26858 } 26859 }; 26860 26861 var User = exports.User = { 26862 checkPath: function checkPath(path) { 26863 return path.node && !!path.node.loc; 26864 } 26865 }; 26866 26867 var Generated = exports.Generated = { 26868 checkPath: function checkPath(path) { 26869 return !path.isUser(); 26870 } 26871 }; 26872 26873 var Pure = exports.Pure = { 26874 checkPath: function checkPath(path, opts) { 26875 return path.scope.isPure(path.node, opts); 26876 } 26877 }; 26878 26879 var Flow = exports.Flow = { 26880 types: ["Flow", "ImportDeclaration", "ExportDeclaration", "ImportSpecifier"], 26881 checkPath: function checkPath(_ref5) { 26882 var node = _ref5.node; 26883 26884 if (t.isFlow(node)) { 26885 return true; 26886 } else if (t.isImportDeclaration(node)) { 26887 return node.importKind === "type" || node.importKind === "typeof"; 26888 } else if (t.isExportDeclaration(node)) { 26889 return node.exportKind === "type"; 26890 } else if (t.isImportSpecifier(node)) { 26891 return node.importKind === "type" || node.importKind === "typeof"; 26892 } else { 26893 return false; 26894 } 26895 } 26896 }; 26897 26898/***/ }, 26899/* 222 */ 26900/***/ function(module, exports, __webpack_require__) { 26901 26902 "use strict"; 26903 26904 exports.__esModule = true; 26905 26906 var _classCallCheck2 = __webpack_require__(3); 26907 26908 var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); 26909 26910 function _interopRequireDefault(obj) { 26911 return obj && obj.__esModule ? obj : { default: obj }; 26912 } 26913 26914 var Binding = function () { 26915 function Binding(_ref) { 26916 var existing = _ref.existing, 26917 identifier = _ref.identifier, 26918 scope = _ref.scope, 26919 path = _ref.path, 26920 kind = _ref.kind; 26921 (0, _classCallCheck3.default)(this, Binding); 26922 26923 this.identifier = identifier; 26924 this.scope = scope; 26925 this.path = path; 26926 this.kind = kind; 26927 26928 this.constantViolations = []; 26929 this.constant = true; 26930 26931 this.referencePaths = []; 26932 this.referenced = false; 26933 this.references = 0; 26934 26935 this.clearValue(); 26936 26937 if (existing) { 26938 this.constantViolations = [].concat(existing.path, existing.constantViolations, this.constantViolations); 26939 } 26940 } 26941 26942 Binding.prototype.deoptValue = function deoptValue() { 26943 this.clearValue(); 26944 this.hasDeoptedValue = true; 26945 }; 26946 26947 Binding.prototype.setValue = function setValue(value) { 26948 if (this.hasDeoptedValue) return; 26949 this.hasValue = true; 26950 this.value = value; 26951 }; 26952 26953 Binding.prototype.clearValue = function clearValue() { 26954 this.hasDeoptedValue = false; 26955 this.hasValue = false; 26956 this.value = null; 26957 }; 26958 26959 Binding.prototype.reassign = function reassign(path) { 26960 this.constant = false; 26961 if (this.constantViolations.indexOf(path) !== -1) { 26962 return; 26963 } 26964 this.constantViolations.push(path); 26965 }; 26966 26967 Binding.prototype.reference = function reference(path) { 26968 if (this.referencePaths.indexOf(path) !== -1) { 26969 return; 26970 } 26971 this.referenced = true; 26972 this.references++; 26973 this.referencePaths.push(path); 26974 }; 26975 26976 Binding.prototype.dereference = function dereference() { 26977 this.references--; 26978 this.referenced = !!this.references; 26979 }; 26980 26981 return Binding; 26982 }(); 26983 26984 exports.default = Binding; 26985 module.exports = exports["default"]; 26986 26987/***/ }, 26988/* 223 */ 26989/***/ function(module, exports, __webpack_require__) { 26990 26991 "use strict"; 26992 26993 exports.__esModule = true; 26994 26995 var _create = __webpack_require__(10); 26996 26997 var _create2 = _interopRequireDefault(_create); 26998 26999 exports.getBindingIdentifiers = getBindingIdentifiers; 27000 exports.getOuterBindingIdentifiers = getOuterBindingIdentifiers; 27001 27002 var _index = __webpack_require__(1); 27003 27004 var t = _interopRequireWildcard(_index); 27005 27006 function _interopRequireWildcard(obj) { 27007 if (obj && obj.__esModule) { 27008 return obj; 27009 } else { 27010 var newObj = {};if (obj != null) { 27011 for (var key in obj) { 27012 if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; 27013 } 27014 }newObj.default = obj;return newObj; 27015 } 27016 } 27017 27018 function _interopRequireDefault(obj) { 27019 return obj && obj.__esModule ? obj : { default: obj }; 27020 } 27021 27022 function getBindingIdentifiers(node, duplicates, outerOnly) { 27023 var search = [].concat(node); 27024 var ids = (0, _create2.default)(null); 27025 27026 while (search.length) { 27027 var id = search.shift(); 27028 if (!id) continue; 27029 27030 var keys = t.getBindingIdentifiers.keys[id.type]; 27031 27032 if (t.isIdentifier(id)) { 27033 if (duplicates) { 27034 var _ids = ids[id.name] = ids[id.name] || []; 27035 _ids.push(id); 27036 } else { 27037 ids[id.name] = id; 27038 } 27039 continue; 27040 } 27041 27042 if (t.isExportDeclaration(id)) { 27043 if (t.isDeclaration(id.declaration)) { 27044 search.push(id.declaration); 27045 } 27046 continue; 27047 } 27048 27049 if (outerOnly) { 27050 if (t.isFunctionDeclaration(id)) { 27051 search.push(id.id); 27052 continue; 27053 } 27054 27055 if (t.isFunctionExpression(id)) { 27056 continue; 27057 } 27058 } 27059 27060 if (keys) { 27061 for (var i = 0; i < keys.length; i++) { 27062 var key = keys[i]; 27063 if (id[key]) { 27064 search = search.concat(id[key]); 27065 } 27066 } 27067 } 27068 } 27069 27070 return ids; 27071 } 27072 27073 getBindingIdentifiers.keys = { 27074 DeclareClass: ["id"], 27075 DeclareFunction: ["id"], 27076 DeclareModule: ["id"], 27077 DeclareVariable: ["id"], 27078 InterfaceDeclaration: ["id"], 27079 TypeAlias: ["id"], 27080 27081 CatchClause: ["param"], 27082 LabeledStatement: ["label"], 27083 UnaryExpression: ["argument"], 27084 AssignmentExpression: ["left"], 27085 27086 ImportSpecifier: ["local"], 27087 ImportNamespaceSpecifier: ["local"], 27088 ImportDefaultSpecifier: ["local"], 27089 ImportDeclaration: ["specifiers"], 27090 27091 ExportSpecifier: ["exported"], 27092 ExportNamespaceSpecifier: ["exported"], 27093 ExportDefaultSpecifier: ["exported"], 27094 27095 FunctionDeclaration: ["id", "params"], 27096 FunctionExpression: ["id", "params"], 27097 27098 ClassDeclaration: ["id"], 27099 ClassExpression: ["id"], 27100 27101 RestElement: ["argument"], 27102 UpdateExpression: ["argument"], 27103 27104 RestProperty: ["argument"], 27105 ObjectProperty: ["value"], 27106 27107 AssignmentPattern: ["left"], 27108 ArrayPattern: ["elements"], 27109 ObjectPattern: ["properties"], 27110 27111 VariableDeclaration: ["declarations"],
27112 VariableDeclarator: ["id"] 27113 }; 27114 27115 function getOuterBindingIdentifiers(node, duplicates) { 27116 return getBindingIdentifiers(node, duplicates, true); 27117 } 27118 27119/***/ }, 27120/* 224 */ 27121/***/ function(module, exports, __webpack_require__) { 27122 27123 'use strict'; 27124 27125 // getting tag from 19.1.3.6 Object.prototype.toString() 27126 var cof = __webpack_require__(136), 27127 TAG = __webpack_require__(12)('toStringTag') 27128 // ES3 wrong here 27129 , 27130 ARG = cof(function () { 27131 return arguments; 27132 }()) == 'Arguments'; 27133 27134 // fallback for IE11 Script Access Denied error 27135 var tryGet = function tryGet(it, key) { 27136 try { 27137 return it[key]; 27138 } catch (e) {/* empty */} 27139 }; 27140 27141 module.exports = function (it) { 27142 var O, T, B; 27143 return it === undefined ? 'Undefined' : it === null ? 'Null' 27144 // @@toStringTag case 27145 : typeof (T = tryGet(O = Object(it), TAG)) == 'string' ? T 27146 // builtinTag case 27147 : ARG ? cof(O) 27148 // ES3 arguments fallback 27149 : (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B; 27150 }; 27151 27152/***/ }, 27153/* 225 */ 27154/***/ function(module, exports, __webpack_require__) { 27155 27156 'use strict'; 27157 27158 var redefineAll = __webpack_require__(143), 27159 getWeak = __webpack_require__(56).getWeak, 27160 anObject = __webpack_require__(19), 27161 isObject = __webpack_require__(22), 27162 anInstance = __webpack_require__(134), 27163 forOf = __webpack_require__(88), 27164 createArrayMethod = __webpack_require__(135), 27165 $has = __webpack_require__(27), 27166 arrayFind = createArrayMethod(5), 27167 arrayFindIndex = createArrayMethod(6), 27168 id = 0; 27169 27170 // fallback for uncaught frozen keys 27171 var uncaughtFrozenStore = function uncaughtFrozenStore(that) { 27172 return that._l || (that._l = new UncaughtFrozenStore()); 27173 }; 27174 var UncaughtFrozenStore = function UncaughtFrozenStore() { 27175 this.a = []; 27176 }; 27177 var findUncaughtFrozen = function findUncaughtFrozen(store, key) { 27178 return arrayFind(store.a, function (it) { 27179 return it[0] === key; 27180 }); 27181 }; 27182 UncaughtFrozenStore.prototype = { 27183 get: function get(key) { 27184 var entry = findUncaughtFrozen(this, key); 27185 if (entry) return entry[1]; 27186 }, 27187 has: function has(key) { 27188 return !!findUncaughtFrozen(this, key); 27189 }, 27190 set: function set(key, value) { 27191 var entry = findUncaughtFrozen(this, key); 27192 if (entry) entry[1] = value;else this.a.push([key, value]); 27193 }, 27194 'delete': function _delete(key) { 27195 var index = arrayFindIndex(this.a, function (it) { 27196 return it[0] === key; 27197 }); 27198 if (~index) this.a.splice(index, 1); 27199 return !!~index; 27200 } 27201 }; 27202 27203 module.exports = { 27204 getConstructor: function getConstructor(wrapper, NAME, IS_MAP, ADDER) { 27205 var C = wrapper(function (that, iterable) { 27206 anInstance(that, C, NAME, '_i'); 27207 that._i = id++; // collection id 27208 that._l = undefined; // leak store for uncaught frozen objects 27209 if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that); 27210 }); 27211 redefineAll(C.prototype, { 27212 // 23.3.3.2 WeakMap.prototype.delete(key) 27213 // 23.4.3.3 WeakSet.prototype.delete(value) 27214 'delete': function _delete(key) { 27215 if (!isObject(key)) return false; 27216 var data = getWeak(key); 27217 if (data === true) return uncaughtFrozenStore(this)['delete'](key); 27218 return data && $has(data, this._i) && delete data[this._i]; 27219 }, 27220 // 23.3.3.4 WeakMap.prototype.has(key) 27221 // 23.4.3.4 WeakSet.prototype.has(value) 27222 has: function has(key) { 27223 if (!isObject(key)) return false; 27224 var data = getWeak(key); 27225 if (data === true) return uncaughtFrozenStore(this).has(key); 27226 return data && $has(data, this._i); 27227 } 27228 }); 27229 return C; 27230 }, 27231 def: function def(that, key, value) { 27232 var data = getWeak(anObject(key), true); 27233 if (data === true) uncaughtFrozenStore(that).set(key, value);else data[that._i] = value; 27234 return that; 27235 }, 27236 ufstore: uncaughtFrozenStore 27237 }; 27238 27239/***/ }, 27240/* 226 */ 27241/***/ function(module, exports, __webpack_require__) { 27242 27243 'use strict'; 27244 27245 var isObject = __webpack_require__(22), 27246 document = __webpack_require__(14).document 27247 // in old IE typeof document.createElement is 'object' 27248 , 27249 is = isObject(document) && isObject(document.createElement); 27250 module.exports = function (it) { 27251 return is ? document.createElement(it) : {}; 27252 }; 27253 27254/***/ }, 27255/* 227 */ 27256/***/ function(module, exports, __webpack_require__) { 27257 27258 'use strict'; 27259 27260 module.exports = !__webpack_require__(20) && !__webpack_require__(36)(function () { 27261 return Object.defineProperty(__webpack_require__(226)('div'), 'a', { get: function get() { 27262 return 7; 27263 } }).a != 7; 27264 }); 27265 27266/***/ }, 27267/* 228 */ 27268/***/ function(module, exports, __webpack_require__) { 27269 27270 'use strict'; 27271 27272 // 7.2.2 IsArray(argument) 27273 var cof = __webpack_require__(136); 27274 module.exports = Array.isArray || function isArray(arg) { 27275 return cof(arg) == 'Array'; 27276 }; 27277 27278/***/ }, 27279/* 229 */
27280/***/ function(module, exports) { 27281 27282 "use strict"; 27283 27284 module.exports = function (done, value) { 27285 return { value: value, done: !!done }; 27286 }; 27287 27288/***/ }, 27289/* 230 */ 27290/***/ function(module, exports, __webpack_require__) { 27291 27292 'use strict'; 27293 // 19.1.2.1 Object.assign(target, source, ...) 27294 27295 var getKeys = __webpack_require__(43), 27296 gOPS = __webpack_require__(142), 27297 pIE = __webpack_require__(90), 27298 toObject = __webpack_require__(93), 27299 IObject = __webpack_require__(139), 27300 $assign = Object.assign; 27301 27302 // should work with symbols and should have deterministic property order (V8 bug) 27303 module.exports = !$assign || __webpack_require__(36)(function () { 27304 var A = {}, 27305 B = {}, 27306 S = Symbol(), 27307 K = 'abcdefghijklmnopqrst'; 27308 A[S] = 7; 27309 K.split('').forEach(function (k) { 27310 B[k] = k; 27311 }); 27312 return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K; 27313 }) ? function assign(target, source) { 27314 // eslint-disable-line no-unused-vars 27315 var T = toObject(target), 27316 aLen = arguments.length, 27317 index = 1, 27318 getSymbols = gOPS.f, 27319 isEnum = pIE.f; 27320 while (aLen > index) { 27321 var S = IObject(arguments[index++]), 27322 keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S), 27323 length = keys.length, 27324 j = 0, 27325 key; 27326 while (length > j) { 27327 if (isEnum.call(S, key = keys[j++])) T[key] = S[key]; 27328 } 27329 }return T; 27330 } : $assign; 27331 27332/***/ }, 27333/* 231 */ 27334/***/ function(module, exports, __webpack_require__) { 27335 27336 'use strict'; 27337 27338 var pIE = __webpack_require__(90), 27339 createDesc = __webpack_require__(91), 27340 toIObject = __webpack_require__(37), 27341 toPrimitive = __webpack_require__(149), 27342 has = __webpack_require__(27), 27343 IE8_DOM_DEFINE = __webpack_require__(227), 27344 gOPD = Object.getOwnPropertyDescriptor; 27345 27346 exports.f = __webpack_require__(20) ? gOPD : function getOwnPropertyDescriptor(O, P) { 27347 O = toIObject(O); 27348 P = toPrimitive(P, true); 27349 if (IE8_DOM_DEFINE) try { 27350 return gOPD(O, P); 27351 } catch (e) {/* empty */} 27352 if (has(O, P)) return createDesc(!pIE.f.call(O, P), O[P]); 27353 }; 27354 27355/***/ }, 27356/* 232 */ 27357/***/ function(module, exports, __webpack_require__) { 27358 27359 'use strict'; 27360 27361 // 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O) 27362 var $keys = __webpack_require__(233), 27363 hiddenKeys = __webpack_require__(138).concat('length', 'prototype'); 27364 27365 exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) { 27366 return $keys(O, hiddenKeys); 27367 }; 27368 27369/***/ }, 27370/* 233 */ 27371/***/ function(module, exports, __webpack_require__) { 27372 27373 'use strict'; 27374 27375 var has = __webpack_require__(27), 27376 toIObject = __webpack_require__(37), 27377 arrayIndexOf = __webpack_require__(415)(false), 27378 IE_PROTO = __webpack_require__(145)('IE_PROTO'); 27379 27380 module.exports = function (object, names) { 27381 var O = toIObject(object), 27382 i = 0, 27383 result = [], 27384 key; 27385 for (key in O) { 27386 if (key != IE_PROTO) has(O, key) && result.push(key); 27387 } // Don't enum bug & hidden keys 27388 while (names.length > i) { 27389 if (has(O, key = names[i++])) { 27390 ~arrayIndexOf(result, key) || result.push(key); 27391 } 27392 }return result; 27393 }; 27394 27395/***/ }, 27396/* 234 */ 27397/***/ function(module, exports, __webpack_require__) { 27398 27399 'use strict'; 27400 27401 var classof = __webpack_require__(224), 27402 ITERATOR = __webpack_require__(12)('iterator'), 27403 Iterators = __webpack_require__(55); 27404 module.exports = __webpack_require__(5).getIteratorMethod = function (it) { 27405 if (it != undefined) return it[ITERATOR] || it['@@iterator'] || Iterators[classof(it)]; 27406 }; 27407 27408/***/ }, 27409/* 235 */ 27410/***/ function(module, exports, __webpack_require__) { 27411 27412 /* WEBPACK VAR INJECTION */(function(process) {'use strict'; 27413 27414 var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; 27415 27416 /** 27417 * This is the web browser implementation of `debug()`. 27418 * 27419 * Expose `debug()` as the module. 27420 */ 27421 27422 exports = module.exports = __webpack_require__(447); 27423 exports.log = log; 27424 exports.formatArgs = formatArgs; 27425 exports.save = save; 27426 exports.load = load; 27427 exports.useColors = useColors; 27428 exports.storage = 'undefined' != typeof chrome && 'undefined' != typeof chrome.storage ? chrome.storage.local : localstorage(); 27429 27430 /** 27431 * Colors. 27432 */ 27433 27434 exports.colors = ['lightseagreen', 'forestgreen', 'goldenrod', 'dodgerblue', 'darkorchid', 'crimson']; 27435 27436 /** 27437 * Currently only WebKit-based Web Inspectors, Firefox >= v31, 27438 * and the Firebug extension (any Firefox version) are known 27439 * to support "%c" CSS customizations. 27440 * 27441 * TODO: add a `localStorage` variable to explicitly enable/disable colors 27442 */ 27443 27444 function useColors() { 27445 // NB: In an Electron preload script, document will be defined but not fully
vendor: 7,334 bytes, lines 27446-27624
27446 // initialized. Since we know we're in Chrome, we'll just detect this case 27447 // explicitly 27448 if (typeof window !== 'undefined' && window && typeof window.process !== 'undefined' && window.process.type === 'renderer') { 27449 return true; 27450 } 27451 27452 // is webkit? http://stackoverflow.com/a/16459606/376773 27453 // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632 27454 return typeof document !== 'undefined' && document && 'WebkitAppearance' in document.documentElement.style || 27455 // is firebug? http://stackoverflow.com/a/398120/376773 27456 typeof window !== 'undefined' && window && window.console && (console.firebug || console.exception && console.table) || 27457 // is firefox >= v31? 27458 // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages 27459 typeof navigator !== 'undefined' && navigator && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31 || 27460 // double check webkit in userAgent just in case we are in a worker 27461 typeof navigator !== 'undefined' && navigator && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/); 27462 } 27463 27464 /** 27465 * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default. 27466 */ 27467 27468 exports.formatters.j = function (v) { 27469 try { 27470 return JSON.stringify(v); 27471 } catch (err) { 27472 return '[UnexpectedJSONParseError]: ' + err.message; 27473 } 27474 }; 27475 27476 /** 27477 * Colorize log arguments if enabled. 27478 * 27479 * @api public 27480 */ 27481 27482 function formatArgs(args) { 27483 var useColors = this.useColors; 27484 27485 args[0] = (useColors ? '%c' : '') + this.namespace + (useColors ? ' %c' : ' ') + args[0] + (useColors ? '%c ' : ' ') + '+' + exports.humanize(this.diff); 27486 27487 if (!useColors) return; 27488 27489 var c = 'color: ' + this.color; 27490 args.splice(1, 0, c, 'color: inherit'); 27491 27492 // the final "%c" is somewhat tricky, because there could be other 27493 // arguments passed either before or after the %c, so we need to 27494 // figure out the correct index to insert the CSS into 27495 var index = 0; 27496 var lastC = 0; 27497 args[0].replace(/%[a-zA-Z%]/g, function (match) { 27498 if ('%%' === match) return; 27499 index++; 27500 if ('%c' === match) { 27501 // we only are interested in the *last* %c 27502 // (the user may have provided their own) 27503 lastC = index; 27504 } 27505 }); 27506 27507 args.splice(lastC, 0, c); 27508 } 27509 27510 /** 27511 * Invokes `console.log()` when available. 27512 * No-op when `console.log` is not a "function". 27513 * 27514 * @api public 27515 */ 27516 27517 function log() { 27518 // this hackery is required for IE8/9, where 27519 // the `console.log` function doesn't have 'apply' 27520 return 'object' === (typeof console === 'undefined' ? 'undefined' : _typeof(console)) && console.log && Function.prototype.apply.call(console.log, console, arguments); 27521 } 27522 27523 /** 27524 * Save `namespaces`. 27525 * 27526 * @param {String} namespaces 27527 * @api private 27528 */ 27529 27530 function save(namespaces) { 27531 try { 27532 if (null == namespaces) { 27533 exports.storage.removeItem('debug'); 27534 } else { 27535 exports.storage.debug = namespaces; 27536 } 27537 } catch (e) {} 27538 } 27539 27540 /** 27541 * Load `namespaces`. 27542 * 27543 * @return {String} returns the previously persisted debug modes 27544 * @api private 27545 */ 27546 27547 function load() { 27548 var r; 27549 try { 27550 r = exports.storage.debug; 27551 } catch (e) {} 27552 27553 // If debug isn't set in LS, and we're in Electron, try to load $DEBUG 27554 if (!r && typeof process !== 'undefined' && 'env' in process) { 27555 r = process.env.DEBUG; 27556 } 27557 27558 return r; 27559 } 27560 27561 /** 27562 * Enable namespaces listed in `localStorage.debug` initially. 27563 */ 27564 27565 exports.enable(load()); 27566 27567 /** 27568 * Localstorage attempts to return the localstorage. 27569 * 27570 * This is necessary because safari throws 27571 * when a user disables cookies/localstorage 27572 * and you attempt to access it. 27573 * 27574 * @return {LocalStorage} 27575 * @api private 27576 */ 27577 27578 function localstorage() { 27579 try { 27580 return window.localStorage; 27581 } catch (e) {} 27582 } 27583 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(9))) 27584 27585/***/ }, 27586/* 236 */ 27587/***/ function(module, exports) { 27588 27589 'use strict'; 27590 27591 /* 27592 Copyright (C) 2013-2014 Yusuke Suzuki <[email protected]> 27593 Copyright (C) 2014 Ivan Nikulin <[email protected]> 27594 27595 Redistribution and use in source and binary forms, with or without 27596 modification, are permitted provided that the following conditions are met: 27597 27598 * Redistributions of source code must retain the above copyright 27599 notice, this list of conditions and the following disclaimer. 27600 * Redistributions in binary form must reproduce the above copyright 27601 notice, this list of conditions and the following disclaimer in the 27602 documentation and/or other materials provided with the distribution. 27603 27604 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 27605 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 27606 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 27607 ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY 27608 DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 27609 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 27610 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 27611 ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27612 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 27613 THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27614 */ 27615 27616 (function () { 27617 'use strict'; 27618 27619 var ES6Regex, ES5Regex, NON_ASCII_WHITESPACES, IDENTIFIER_START, IDENTIFIER_PART, ch; 27620 27621 // See `tools/generate-identifier-regex.js`. 27622 ES5Regex = { 27623 // ECMAScript 5.1/Unicode v7.0.0 NonAsciiIdentifierStart: 27624 NonAsciiIdentifierStart: /[\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\u0561-\u0587\u05D0-\u05EA\u05F0-\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\u08A0-\u08B2\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\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\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\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u
276240EB3\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-\u13F4\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-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\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\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\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\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA7AD\uA7B0\uA7B1\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\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-\uAB5F\uAB64\uAB65\uABC0-\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]/, 27625 // ECMAScript 5.1/Unicode v7.0.0 NonAsciiIdentifierPart: 27626 NonAsciiIdentifierPart: /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B2\u08E4-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58\u0C59\u0C60-\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D60-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\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\u135D-\u135F\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\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\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA69D\uA69F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA7AD\uA7B0\uA7B1\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB5F\uAB64\uAB65\uABC0-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFB
27626D3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2D\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/ 27627 }; 27628 27629 ES6Regex = { 27630 // ECMAScript 6/Unicode v7.0.0 NonAsciiIdentifierStart: 27631 NonAsciiIdentifierStart: /[\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\u0561-\u0587\u05D0-\u05EA\u05F0-\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\u08A0-\u08B2\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\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\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\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\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-\u13F4\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-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\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-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA7AD\uA7B0\uA7B1\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\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-\uAB5F\uAB64\uAB65\uABC0-\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\uFB
27631D3-\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]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDE00-\uDE11\uDE13-\uDE2B\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF5D-\uDF61]|\uD805[\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDE00-\uDE2F\uDE44\uDE80-\uDEAA]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF98]|\uD809[\uDC00-\uDC6E]|[\uD80C\uD840-\uD868\uD86A-\uD86C][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D]|\uD87E[\uDC00-\uDE1D]/, 27632 // ECMAScript 6/Unicode v7.0.0 NonAsciiIdentifierPart: 27633 NonAsciiIdentifierPart: /[\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B2\u08E4-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58\u0C59\u0C60-\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D60-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\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\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\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\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\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-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA69D\uA69F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA7AD\uA7B0\uA7B1\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB5F\uAB64\uAB65\uABC0-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFB
27633D3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2D\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDD0-\uDDDA\uDE00-\uDE11\uDE13-\uDE37\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF01-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9]|\uD806[\uDCA0-\uDCE9\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF98]|\uD809[\uDC00-\uDC6E]|[\uD80C\uD840-\uD868\uD86A-\uD86C][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/ 27634 }; 27635 27636 function isDecimalDigit(ch) { 27637 return 0x30 <= ch && ch <= 0x39; // 0..9 27638 } 27639 27640 function isHexDigit(ch) { 27641 return 0x30 <= ch && ch <= 0x39 || // 0..9 27642 0x61 <= ch && ch <= 0x66 || // a..f 27643 0x41 <= ch && ch <= 0x46; // A..F 27644 } 27645 27646 function isOctalDigit(ch) { 27647 return ch >= 0x30 && ch <= 0x37; // 0..7 27648 } 27649 27650 // 7.2 White Space 27651 27652 NON_ASCII_WHITESPACES = [0x1680, 0x180E, 0x2000, 0x2001, 0x2002, 0x2003, 0x2004, 0x2005, 0x2006, 0x2007, 0x2008, 0x2009, 0x200A, 0x202F, 0x205F, 0x3000, 0xFEFF]; 27653 27654 function isWhiteSpace(ch) { 27655 return ch === 0x20 || ch === 0x09 || ch === 0x0B || ch === 0x0C || ch === 0xA0 || ch >= 0x1680 && NON_ASCII_WHITESPACES.indexOf(ch) >= 0; 27656 } 27657 27658 // 7.3 Line Terminators 27659 27660 function isLineTerminator(ch) { 27661 return ch === 0x0A || ch === 0x0D || ch === 0x2028 || ch === 0x2029; 27662 } 27663 27664 // 7.6 Identifier Names and Identifiers 27665 27666 function fromCodePoint(cp) { 27667 if (cp <= 0xFFFF) { 27668 return String.fromCharCode(cp); 27669 } 27670 var cu1 = String.fromCharCode(Math.floor((cp - 0x10000) / 0x400) + 0xD800); 27671 var cu2 = String.fromCharCode((cp - 0x10000) % 0x400 + 0xDC00); 27672 return cu1 + cu2; 27673 } 27674 27675 IDENTIFIER_START = new Array(0x80); 27676 for (ch = 0; ch < 0x80; ++ch) { 27677 IDENTIFIER_START[ch] = ch >= 0x61 && ch <= 0x7A || // a..z 27678 ch >= 0x41 && ch <= 0x5A || // A..Z 27679 ch === 0x24 || ch === 0x5F; // $ (dollar) and _ (underscore) 27680 } 27681 27682 IDENTIFIER_PART = new Array(0x80); 27683 for (ch = 0; ch < 0x80; ++ch) { 27684 IDENTIFIER_PART[ch] = ch >= 0x61 && ch <= 0x7A || // a..z 27685 ch >= 0x41 && ch <= 0x5A || // A..Z 27686 ch >= 0x30 && ch <= 0x39 || // 0..9 27687 ch === 0x24 || ch === 0x5F; // $ (dollar) and _ (underscore) 27688 } 27689 27690 function isIdentifierStartES5(ch) { 27691 return ch < 0x80 ? IDENTIFIER_START[ch] : ES5Regex.NonAsciiIdentifierStart.test(fromCodePoint(ch)); 27692 } 27693 27694 function isIdentifierPartES5(ch) { 27695 return ch < 0x80 ? IDENTIFIER_PART[ch] : ES5Regex.NonAsciiIdentifierPart.test(fromCodePoint(ch)); 27696 } 27697 27698 function isIdentifierStartES6(ch) { 27699 return ch < 0x80 ? IDENTIFIER_START[ch] : ES6Regex.NonAsciiIdentifierStart.test(fromCodePoint(ch)); 27700 } 27701 27702 function isIdentifierPartES6(ch) { 27703 return ch < 0x80 ? IDENTIFIER_PART[ch] : ES6Regex.NonAsciiIdentifierPart.test(fromCodePoint(ch)); 27704 } 27705 27706 module.exports = { 27707 isDecimalDigit: isDecimalDigit, 27708 isHexDigit: isHexDigit, 27709 isOctalDigit: isOctalDigit, 27710 isWhiteSpace: isWhiteSpace, 27711 isLineTerminator: isLineTerminator, 27712 isIdentifierStartES5: isIdentifierStartES5, 27713 isIdentifierPartES5: isIdentifierPartES5, 27714 isIdentifierStartES6: isIdentifierStartES6, 27715 isIdentifierPartES6: isIdentifierPartES6 27716 }; 27717 })(); 27718 /* vim: set sw=4 ts=4 et tw=80 : */ 27719 27720/***/ }, 27721/* 237 */ 27722/***/ function(module, exports, __webpack_require__) { 27723 27724 'use strict'; 27725 27726 var getNative = __webpack_require__(38), 27727 root = __webpack_require__(15); 27728 27729 /* Built-in method references that are verified to be native. */ 27730 var Set = getNative(root, 'Set'); 27731 27732 module.exports = Set; 27733 27734/***/ }, 27735/* 238 */ 27736/***/ function(module, exports, __webpack_require__) { 27737 27738 'use strict'; 27739 27740 var MapCache = __webpack_require__(156), 27741 setCacheAdd = __webpack_require__(550), 27742 setCacheHas = __webpack_require__(551); 27743 27744 /** 27745 * 27746 * Creates an array cache object to store unique values. 27747 * 27748 * @private 27749 * @constructor 27750 * @param {Array} [values] The values to cache. 27751 */ 27752 function SetCache(values) { 27753 var index = -1, 27754 length = values == null ? 0 : values.length; 27755 27756 this.__data__ = new MapCache(); 27757 while (++index < length) { 27758 this.add(values[index]); 27759 } 27760 } 27761 27762 // Add methods to `SetCache`.
27763 SetCache.prototype.add = SetCache.prototype.push = setCacheAdd; 27764 SetCache.prototype.has = setCacheHas; 27765 27766 module.exports = SetCache; 27767 27768/***/ }, 27769/* 239 */ 27770/***/ function(module, exports, __webpack_require__) { 27771 27772 'use strict'; 27773 27774 var root = __webpack_require__(15); 27775 27776 /** Built-in value references. */ 27777 var Uint8Array = root.Uint8Array; 27778 27779 module.exports = Uint8Array; 27780 27781/***/ }, 27782/* 240 */ 27783/***/ function(module, exports) { 27784 27785 "use strict"; 27786 27787 /** 27788 * A faster alternative to `Function#apply`, this function invokes `func` 27789 * with the `this` binding of `thisArg` and the arguments of `args`. 27790 * 27791 * @private 27792 * @param {Function} func The function to invoke. 27793 * @param {*} thisArg The `this` binding of `func`. 27794 * @param {Array} args The arguments to invoke `func` with. 27795 * @returns {*} Returns the result of `func`. 27796 */ 27797 function apply(func, thisArg, args) { 27798 switch (args.length) { 27799 case 0: 27800 return func.call(thisArg); 27801 case 1: 27802 return func.call(thisArg, args[0]); 27803 case 2: 27804 return func.call(thisArg, args[0], args[1]); 27805 case 3: 27806 return func.call(thisArg, args[0], args[1], args[2]); 27807 } 27808 return func.apply(thisArg, args); 27809 } 27810 27811 module.exports = apply; 27812 27813/***/ }, 27814/* 241 */ 27815/***/ function(module, exports, __webpack_require__) { 27816 27817 'use strict'; 27818 27819 var baseTimes = __webpack_require__(502), 27820 isArguments = __webpack_require__(110), 27821 isArray = __webpack_require__(7), 27822 isBuffer = __webpack_require__(111), 27823 isIndex = __webpack_require__(167), 27824 isTypedArray = __webpack_require__(173); 27825 27826 /** Used for built-in method references. */ 27827 var objectProto = Object.prototype; 27828 27829 /** Used to check objects for own properties. */ 27830 var hasOwnProperty = objectProto.hasOwnProperty; 27831 27832 /** 27833 * Creates an array of the enumerable property names of the array-like `value`. 27834 * 27835 * @private 27836 * @param {*} value The value to query. 27837 * @param {boolean} inherited Specify returning inherited property names. 27838 * @returns {Array} Returns the array of property names. 27839 */ 27840 function arrayLikeKeys(value, inherited) { 27841 var isArr = isArray(value), 27842 isArg = !isArr && isArguments(value),
27843 isBuff = !isArr && !isArg && isBuffer(value), 27844 isType = !isArr && !isArg && !isBuff && isTypedArray(value), 27845 skipIndexes = isArr || isArg || isBuff || isType, 27846 result = skipIndexes ? baseTimes(value.length, String) : [], 27847 length = result.length; 27848 27849 for (var key in value) { 27850 if ((inherited || hasOwnProperty.call(value, key)) && !(skipIndexes && ( 27851 // Safari 9 has enumerable `arguments.length` in strict mode. 27852 key == 'length' || 27853 // Node.js 0.10 has enumerable non-index properties on buffers. 27854 isBuff && (key == 'offset' || key == 'parent') || 27855 // PhantomJS 2 has enumerable non-index properties on typed arrays. 27856 isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset') || 27857 // Skip index properties. 27858 isIndex(key, length)))) { 27859 result.push(key); 27860 } 27861 } 27862 return result; 27863 } 27864 27865 module.exports = arrayLikeKeys; 27866 27867/***/ }, 27868/* 242 */ 27869/***/ function(module, exports) { 27870 27871 "use strict"; 27872 27873 /** 27874 * A specialized version of `_.reduce` for arrays without support for 27875 * iteratee shorthands. 27876 * 27877 * @private 27878 * @param {Array} [array] The array to iterate over. 27879 * @param {Function} iteratee The function invoked per iteration. 27880 * @param {*} [accumulator] The initial value. 27881 * @param {boolean} [initAccum] Specify using the first element of `array` as 27882 * the initial value. 27883 * @returns {*} Returns the accumulated value. 27884 */ 27885 function arrayReduce(array, iteratee, accumulator, initAccum) { 27886 var index = -1, 27887 length = array == null ? 0 : array.length; 27888 27889 if (initAccum && length) { 27890 accumulator = array[++index]; 27891 } 27892 while (++index < length) { 27893 accumulator = iteratee(accumulator, array[index], index, array); 27894 } 27895 return accumulator; 27896 } 27897 27898 module.exports = arrayReduce; 27899 27900/***/ }, 27901/* 243 */ 27902/***/ function(module, exports, __webpack_require__) { 27903 27904 'use strict'; 27905 27906 var baseAssignValue = __webpack_require__(159), 27907 eq = __webpack_require__(45); 27908 27909 /** 27910 * This function is like `assignValue` except that it doesn't assign 27911 * `undefined` values. 27912 * 27913 * @private 27914 * @param {Object} object The object to modify. 27915 * @param {string} key The key of the property to assign. 27916 * @param {*} value The value to assign. 27917 */ 27918 function assignMergeValue(object, key, value) { 27919 if (value !== undefined && !eq(object[key], value) || value === undefined && !(key in object)) { 27920 baseAssignValue(object, key, value); 27921 } 27922 } 27923 27924 module.exports = assignMergeValue; 27925 27926/***/ }, 27927/* 244 */ 27928/***/ function(module, exports, __webpack_require__) { 27929 27930 'use strict'; 27931 27932 var createBaseFor = __webpack_require__(516); 27933 27934 /** 27935 * The base implementation of `baseForOwn` which iterates over `object` 27936 * properties returned by `keysFunc` and invokes `iteratee` for each property. 27937 * Iteratee functions may exit iteration early by explicitly returning `false`. 27938 * 27939 * @private 27940 * @param {Object} object The object to iterate over. 27941 * @param {Function} iteratee The function invoked per iteration. 27942 * @param {Function} keysFunc The function to get the keys of `object`. 27943 * @returns {Object} Returns `object`. 27944 */ 27945 var baseFor = createBaseFor(); 27946 27947 module.exports = baseFor; 27948 27949/***/ }, 27950/* 245 */ 27951/***/ function(module, exports, __webpack_require__) { 27952 27953 'use strict'; 27954 27955 var castPath = __webpack_require__(251), 27956 toKey = __webpack_require__(106); 27957 27958 /** 27959 * The base implementation of `_.get` without support for default values. 27960 * 27961 * @private 27962 * @param {Object} object The object to query. 27963 * @param {Array|string} path The path of the property to get. 27964 * @returns {*} Returns the resolved value. 27965 */ 27966 function baseGet(object, path) { 27967 path = castPath(path, object); 27968 27969 var index = 0, 27970 length = path.length; 27971 27972 while (object != null && index < length) { 27973 object = object[toKey(path[index++])]; 27974 } 27975 return index && index == length ? object : undefined; 27976 } 27977 27978 module.exports = baseGet; 27979 27980/***/ }, 27981/* 246 */ 27982/***/ function(module, exports, __webpack_require__) { 27983 27984 'use strict'; 27985 27986 var arrayPush = __webpack_require__(157), 27987 isArray = __webpack_require__(7); 27988 27989 /** 27990 * The base implementation of `getAllKeys` and `getAllKeysIn` which uses 27991 * `keysFunc` and `symbolsFunc` to get the enumerable property names and 27992 * symbols of `object`. 27993 * 27994 * @private 27995 * @param {Object} object The object to query. 27996 * @param {Function} keysFunc The function to get the keys of `object`. 27997 * @param {Function} symbolsFunc The function to get the symbols of `object`. 27998 * @returns {Array} Returns the array of property names and symbols. 27999 */ 28000 function baseGetAllKeys(object, keysFunc, symbolsFunc) { 28001 var result = keysFunc(object); 28002 return isArray(object) ? result : arrayPush(result, symbolsFunc(object)); 28003 } 28004 28005 module.exports = baseGetAllKeys; 28006 28007/***/ }, 28008/* 247 */ 28009/***/ function(module, exports, __webpack_require__) { 28010 28011 'use strict'; 28012 28013 var baseIsEqualDeep = __webpack_require__(483), 28014 isObjectLike = __webpack_require__(25); 28015 28016 /** 28017 * The base implementation of `_.isEqual` which supports partial comparisons 28018 * and tracks traversed objects. 28019 * 28020 * @private 28021 * @param {*} value The value to compare. 28022 * @param {*} other The other value to compare. 28023 * @param {boolean} bitmask The bitmask flags. 28024 * 1 - Unordered comparison 28025 * 2 - Partial comparison 28026 * @param {Function} [customizer] The function to customize comparisons. 28027 * @param {Object} [stack] Tracks traversed `value` and `other` objects. 28028 * @returns {boolean} Returns `true` if the values are equivalent, else `false`. 28029 */ 28030 function baseIsEqual(value, other, bitmask, customizer, stack) { 28031 if (value === other) { 28032 return true; 28033 } 28034 if (value == null || other == null || !isObjectLike(value) && !isObjectLike(other)) { 28035 return value !== value && other !== other; 28036 } 28037 return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack); 28038 } 28039 28040 module.exports = baseIsEqual; 28041 28042/***/ }, 28043/* 248 */ 28044/***/ function(module, exports, __webpack_require__) { 28045 28046 'use strict'; 28047 28048 var baseEach = __webpack_require__(476), 28049 isArrayLike = __webpack_require__(24); 28050 28051 /** 28052 * The base implementation of `_.map` without support for iteratee shorthands. 28053 * 28054 * @private 28055 * @param {Array|Object} collection The collection to iterate over. 28056 * @param {Function} iteratee The function invoked per iteration. 28057 * @returns {Array} Returns the new mapped array.
28058 */ 28059 function baseMap(collection, iteratee) { 28060 var index = -1, 28061 result = isArrayLike(collection) ? Array(collection.length) : []; 28062 28063 baseEach(collection, function (value, key, collection) { 28064 result[++index] = iteratee(value, key, collection); 28065 }); 28066 return result; 28067 } 28068 28069 module.exports = baseMap; 28070 28071/***/ }, 28072/* 249 */ 28073/***/ function(module, exports, __webpack_require__) { 28074 28075 'use strict'; 28076 28077 var _Symbol = __webpack_require__(44), 28078 arrayMap = __webpack_require__(58), 28079 isArray = __webpack_require__(7), 28080 isSymbol = __webpack_require__(60); 28081 28082 /** Used as references for various `Number` constants. */ 28083 var INFINITY = 1 / 0; 28084 28085 /** Used to convert symbols to primitives and strings. */ 28086 var symbolProto = _Symbol ? _Symbol.prototype : undefined, 28087 symbolToString = symbolProto ? symbolProto.toString : undefined; 28088 28089 /** 28090 * The base implementation of `_.toString` which doesn't convert nullish 28091 * values to empty strings. 28092 * 28093 * @private 28094 * @param {*} value The value to process. 28095 * @returns {string} Returns the string. 28096 */ 28097 function baseToString(value) { 28098 // Exit early for strings to avoid a performance hit in some environments. 28099 if (typeof value == 'string') { 28100 return value; 28101 } 28102 if (isArray(value)) { 28103 // Recursively convert values (susceptible to call stack limits). 28104 return arrayMap(value, baseToString) + ''; 28105 } 28106 if (isSymbol(value)) { 28107 return symbolToString ? symbolToString.call(value) : ''; 28108 } 28109 var result = value + ''; 28110 return result == '0' && 1 / value == -INFINITY ? '-0' : result; 28111 } 28112 28113 module.exports = baseToString; 28114 28115/***/ }, 28116/* 250 */ 28117/***/ function(module, exports) { 28118 28119 "use strict"; 28120 28121 /** 28122 * Checks if a `cache` value for `key` exists. 28123 * 28124 * @private 28125 * @param {Object} cache The cache to query. 28126 * @param {string} key The key of the entry to check. 28127 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. 28128 */ 28129 function cacheHas(cache, key) { 28130 return cache.has(key); 28131 } 28132 28133 module.exports = cacheHas; 28134 28135/***/ }, 28136/* 251 */ 28137/***/ function(module, exports, __webpack_require__) { 28138 28139 'use strict'; 28140 28141 var isArray = __webpack_require__(7), 28142 isKey = __webpack_require__(169), 28143 stringToPath = __webpack_require__(560), 28144 toString = __webpack_require__(112); 28145 28146 /** 28147 * Casts `value` to a path array if it's not one. 28148 * 28149 * @private 28150 * @param {*} value The value to inspect. 28151 * @param {Object} [object] The object to query keys on. 28152 * @returns {Array} Returns the cast property path array. 28153 */ 28154 function castPath(value, object) { 28155 if (isArray(value)) { 28156 return value; 28157 } 28158 return isKey(value, object) ? [value] : stringToPath(toString(value)); 28159 } 28160 28161 module.exports = castPath; 28162 28163/***/ }, 28164/* 252 */ 28165/***/ function(module, exports, __webpack_require__) { 28166 28167 /* WEBPACK VAR INJECTION */(function(module) {'use strict'; 28168 28169 var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; 28170 28171 var root = __webpack_require__(15); 28172 28173 /** Detect free variable `exports`. */ 28174 var freeExports = ( false ? 'undefined' : _typeof(exports)) == 'object' && exports && !exports.nodeType && exports; 28175 28176 /** Detect free variable `module`. */ 28177 var freeModule = freeExports && ( false ? 'undefined' : _typeof(module)) == 'object' && module && !module.nodeType && module; 28178 28179 /** Detect the popular CommonJS extension `module.exports`. */ 28180 var moduleExports = freeModule && freeModule.exports === freeExports; 28181 28182 /** Built-in value references. */ 28183 var Buffer = moduleExports ? root.Buffer : undefined, 28184 allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined; 28185 28186 /** 28187 * Creates a clone of `buffer`. 28188 * 28189 * @private 28190 * @param {Buffer} buffer The buffer to clone. 28191 * @param {boolean} [isDeep] Specify a deep clone. 28192 * @returns {Buffer} Returns the cloned buffer. 28193 */ 28194 function cloneBuffer(buffer, isDeep) { 28195 if (isDeep) { 28196 return buffer.slice(); 28197 } 28198 var length = buffer.length, 28199 result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length); 28200 28201 buffer.copy(result); 28202 return result; 28203 } 28204 28205 module.exports = cloneBuffer; 28206 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(39)(module))) 28207 28208/***/ }, 28209/* 253 */ 28210/***/ function(module, exports, __webpack_require__) { 28211 28212 'use strict'; 28213 28214 var cloneArrayBuffer = __webpack_require__(163); 28215 28216 /** 28217 * Creates a clone of `typedArray`. 28218 * 28219 * @private 28220 * @param {Object} typedArray The typed array to clone. 28221 * @param {boolean} [isDeep] Specify a deep clone. 28222 * @returns {Object} Returns the cloned typed array.
28223 */ 28224 function cloneTypedArray(typedArray, isDeep) { 28225 var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer; 28226 return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length); 28227 } 28228 28229 module.exports = cloneTypedArray; 28230 28231/***/ }, 28232/* 254 */ 28233/***/ function(module, exports, __webpack_require__) { 28234 28235 'use strict'; 28236 28237 var baseIteratee = __webpack_require__(59), 28238 isArrayLike = __webpack_require__(24), 28239 keys = __webpack_require__(31); 28240 28241 /** 28242 * Creates a `_.find` or `_.findLast` function. 28243 * 28244 * @private 28245 * @param {Function} findIndexFunc The function to find the collection index. 28246 * @returns {Function} Returns the new find function. 28247 */ 28248 function createFind(findIndexFunc) { 28249 return function (collection, predicate, fromIndex) { 28250 var iterable = Object(collection); 28251 if (!isArrayLike(collection)) { 28252 var iteratee = baseIteratee(predicate, 3); 28253 collection = keys(collection); 28254 predicate = function predicate(key) { 28255 return iteratee(iterable[key], key, iterable); 28256 }; 28257 } 28258 var index = findIndexFunc(collection, predicate, fromIndex); 28259 return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined; 28260 }; 28261 } 28262 28263 module.exports = createFind; 28264 28265/***/ }, 28266/* 255 */ 28267/***/ function(module, exports, __webpack_require__) { 28268 28269 'use strict'; 28270 28271 var getNative = __webpack_require__(38); 28272 28273 var defineProperty = function () { 28274 try { 28275 var func = getNative(Object, 'defineProperty'); 28276 func({}, '', {}); 28277 return func; 28278 } catch (e) {} 28279 }(); 28280 28281 module.exports = defineProperty; 28282 28283/***/ }, 28284/* 256 */ 28285/***/ function(module, exports, __webpack_require__) { 28286 28287 'use strict'; 28288 28289 var SetCache = __webpack_require__(238), 28290 arraySome = __webpack_require__(471), 28291 cacheHas = __webpack_require__(250); 28292 28293 /** Used to compose bitmasks for value comparisons. */ 28294 var COMPARE_PARTIAL_FLAG = 1, 28295 COMPARE_UNORDERED_FLAG = 2; 28296 28297 /** 28298 * A specialized version of `baseIsEqualDeep` for arrays with support for 28299 * partial deep comparisons. 28300 * 28301 * @private 28302 * @param {Array} array The array to compare. 28303 * @param {Array} other The other array to compare. 28304 * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. 28305 * @param {Function} customizer The function to customize comparisons. 28306 * @param {Function} equalFunc The function to determine equivalents of values. 28307 * @param {Object} stack Tracks traversed `array` and `other` objects. 28308 * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`. 28309 */ 28310 function equalArrays(array, other, bitmask, customizer, equalFunc, stack) { 28311 var isPartial = bitmask & COMPARE_PARTIAL_FLAG, 28312 arrLength = array.length, 28313 othLength = other.length; 28314 28315 if (arrLength != othLength && !(isPartial && othLength > arrLength)) { 28316 return false; 28317 } 28318 // Assume cyclic values are equal. 28319 var stacked = stack.get(array); 28320 if (stacked && stack.get(other)) { 28321 return stacked == other; 28322 } 28323 var index = -1, 28324 result = true, 28325 seen = bitmask & COMPARE_UNORDERED_FLAG ? new SetCache() : undefined; 28326 28327 stack.set(array, other); 28328 stack.set(other, array); 28329 28330 // Ignore non-index properties. 28331 while (++index < arrLength) { 28332 var arrValue = array[index], 28333 othValue = other[index]; 28334 28335 if (customizer) { 28336 var compared = isPartial ? customizer(othValue, arrValue, index, other, array, stack) : customizer(arrValue, othValue, index, array, other, stack); 28337 } 28338 if (compared !== undefined) { 28339 if (compared) { 28340 continue; 28341 } 28342 result = false;
28343 break; 28344 } 28345 // Recursively compare arrays (susceptible to call stack limits). 28346 if (seen) { 28347 if (!arraySome(other, function (othValue, othIndex) { 28348 if (!cacheHas(seen, othIndex) && (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) { 28349 return seen.push(othIndex); 28350 } 28351 })) { 28352 result = false; 28353 break; 28354 } 28355 } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) { 28356 result = false; 28357 break; 28358 } 28359 } 28360 stack['delete'](array); 28361 stack['delete'](other); 28362 return result; 28363 } 28364 28365 module.exports = equalArrays; 28366 28367/***/ }, 28368/* 257 */ 28369/***/ function(module, exports) { 28370 28371 /* WEBPACK VAR INJECTION */(function(global) {'use strict'; 28372 28373 var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; 28374 28375 /** Detect free variable `global` from Node.js. */ 28376 var freeGlobal = (typeof global === 'undefined' ? 'undefined' : _typeof(global)) == 'object' && global && global.Object === Object && global; 28377 28378 module.exports = freeGlobal; 28379 /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()))) 28380 28381/***/ }, 28382/* 258 */ 28383/***/ function(module, exports, __webpack_require__) { 28384 28385 'use strict'; 28386 28387 var baseGetAllKeys = __webpack_require__(246), 28388 getSymbols = __webpack_require__(166), 28389 keys = __webpack_require__(31); 28390 28391 /** 28392 * Creates an array of own enumerable property names and symbols of `object`. 28393 * 28394 * @private 28395 * @param {Object} object The object to query. 28396 * @returns {Array} Returns the array of property names and symbols. 28397 */ 28398 function getAllKeys(object) { 28399 return baseGetAllKeys(object, keys, getSymbols); 28400 } 28401 28402 module.exports = getAllKeys; 28403 28404/***/ }, 28405/* 259 */ 28406/***/ function(module, exports, __webpack_require__) { 28407 28408 'use strict'; 28409 28410 var arrayPush = __webpack_require__(157), 28411 getPrototype = __webpack_require__(165), 28412 getSymbols = __webpack_require__(166), 28413 stubArray = __webpack_require__(275); 28414 28415 /* Built-in method references for those with the same name as other `lodash` methods. */ 28416 var nativeGetSymbols = Object.getOwnPropertySymbols; 28417 28418 /** 28419 * Creates an array of the own and inherited enumerable symbols of `object`. 28420 * 28421 * @private 28422 * @param {Object} object The object to query. 28423 * @returns {Array} Returns the array of symbols. 28424 */ 28425 var getSymbolsIn = !nativeGetSymbols ? stubArray : function (object) { 28426 var result = []; 28427 while (object) { 28428 arrayPush(result, getSymbols(object)); 28429 object = getPrototype(object); 28430 } 28431 return result; 28432 }; 28433 28434 module.exports = getSymbolsIn; 28435 28436/***/ }, 28437/* 260 */ 28438/***/ function(module, exports, __webpack_require__) { 28439 28440 'use strict'; 28441 28442 var DataView = __webpack_require__(461), 28443 Map = __webpack_require__(155), 28444 Promise = __webpack_require__(463), 28445 Set = __webpack_require__(237), 28446 WeakMap = __webpack_require__(464), 28447 baseGetTag = __webpack_require__(29), 28448 toSource = __webpack_require__(268); 28449 28450 /** `Object#toString` result references. */ 28451 var mapTag = '[object Map]', 28452 objectTag = '[object Object]', 28453 promiseTag = '[object Promise]', 28454 setTag = '[object Set]', 28455 weakMapTag = '[object WeakMap]'; 28456 28457 var dataViewTag = '[object DataView]'; 28458 28459 /** Used to detect maps, sets, and weakmaps. */ 28460 var dataViewCtorString = toSource(DataView), 28461 mapCtorString = toSource(Map), 28462 promiseCtorString = toSource(Promise), 28463 setCtorString = toSource(Set), 28464 weakMapCtorString = toSource(WeakMap); 28465 28466 /** 28467 * Gets the `toStringTag` of `value`. 28468 * 28469 * @private 28470 * @param {*} value The value to query. 28471 * @returns {string} Returns the `toStringTag`. 28472 */ 28473 var getTag = baseGetTag; 28474 28475 // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6. 28476 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) { 28477 getTag = function getTag(value) { 28478 var result = baseGetTag(value), 28479 Ctor = result == objectTag ? value.constructor : undefined,
28480 ctorString = Ctor ? toSource(Ctor) : ''; 28481 28482 if (ctorString) { 28483 switch (ctorString) { 28484 case dataViewCtorString: 28485 return dataViewTag; 28486 case mapCtorString: 28487 return mapTag; 28488 case promiseCtorString: 28489 return promiseTag; 28490 case setCtorString: 28491 return setTag; 28492 case weakMapCtorString: 28493 return weakMapTag; 28494 } 28495 } 28496 return result; 28497 }; 28498 } 28499 28500 module.exports = getTag; 28501 28502/***/ }, 28503/* 261 */ 28504/***/ function(module, exports, __webpack_require__) { 28505 28506 'use strict'; 28507 28508 var castPath = __webpack_require__(251), 28509 isArguments = __webpack_require__(110), 28510 isArray = __webpack_require__(7), 28511 isIndex = __webpack_require__(167), 28512 isLength = __webpack_require__(172), 28513 toKey = __webpack_require__(106); 28514 28515 /** 28516 * Checks if `path` exists on `object`. 28517 * 28518 * @private 28519 * @param {Object} object The object to query. 28520 * @param {Array|string} path The path to check. 28521 * @param {Function} hasFunc The function to check properties. 28522 * @returns {boolean} Returns `true` if `path` exists, else `false`. 28523 */ 28524 function hasPath(object, path, hasFunc) { 28525 path = castPath(path, object); 28526 28527 var index = -1, 28528 length = path.length, 28529 result = false;
28530 28531 while (++index < length) { 28532 var key = toKey(path[index]); 28533 if (!(result = object != null && hasFunc(object, key))) { 28534 break; 28535 } 28536 object = object[key]; 28537 } 28538 if (result || ++index != length) { 28539 return result; 28540 } 28541 length = object == null ? 0 : object.length; 28542 return !!length && isLength(length) && isIndex(key, length) && (isArray(object) || isArguments(object)); 28543 } 28544 28545 module.exports = hasPath; 28546 28547/***/ }, 28548/* 262 */ 28549/***/ function(module, exports, __webpack_require__) { 28550 28551 'use strict'; 28552 28553 var baseCreate = __webpack_require__(475), 28554 getPrototype = __webpack_require__(165), 28555 isPrototype = __webpack_require__(103); 28556 28557 /** 28558 * Initializes an object clone. 28559 * 28560 * @private 28561 * @param {Object} object The object to clone. 28562 * @returns {Object} Returns the initialized clone. 28563 */ 28564 function initCloneObject(object) { 28565 return typeof object.constructor == 'function' && !isPrototype(object) ? baseCreate(getPrototype(object)) : {}; 28566 } 28567 28568 module.exports = initCloneObject; 28569 28570/***/ }, 28571/* 263 */ 28572/***/ function(module, exports, __webpack_require__) { 28573 28574 'use strict'; 28575 28576 var isObject = __webpack_require__(16); 28577 28578 /** 28579 * Checks if `value` is suitable for strict equality comparisons, i.e. `===`. 28580 * 28581 * @private 28582 * @param {*} value The value to check. 28583 * @returns {boolean} Returns `true` if `value` if suitable for strict 28584 * equality comparisons, else `false`. 28585 */ 28586 function isStrictComparable(value) { 28587 return value === value && !isObject(value); 28588 } 28589 28590 module.exports = isStrictComparable; 28591 28592/***/ }, 28593/* 264 */ 28594/***/ function(module, exports) { 28595 28596 "use strict"; 28597 28598 /** 28599 * Converts `map` to its key-value pairs. 28600 * 28601 * @private 28602 * @param {Object} map The map to convert. 28603 * @returns {Array} Returns the key-value pairs. 28604 */ 28605 function mapToArray(map) { 28606 var index = -1, 28607 result = Array(map.size); 28608 28609 map.forEach(function (value, key) { 28610 result[++index] = [key, value]; 28611 }); 28612 return result; 28613 } 28614 28615 module.exports = mapToArray; 28616 28617/***/ }, 28618/* 265 */ 28619/***/ function(module, exports) { 28620 28621 "use strict"; 28622 28623 /** 28624 * A specialized version of `matchesProperty` for source values suitable 28625 * for strict equality comparisons, i.e. `===`. 28626 * 28627 * @private 28628 * @param {string} key The key of the property to get. 28629 * @param {*} srcValue The value to match. 28630 * @returns {Function} Returns the new spec function. 28631 */ 28632 function matchesStrictComparable(key, srcValue) { 28633 return function (object) { 28634 if (object == null) { 28635 return false; 28636 } 28637 return object[key] === srcValue && (srcValue !== undefined || key in Object(object)); 28638 }; 28639 } 28640 28641 module.exports = matchesStrictComparable; 28642 28643/***/ }, 28644/* 266 */ 28645/***/ function(module, exports, __webpack_require__) { 28646 28647 /* WEBPACK VAR INJECTION */(function(module) {'use strict'; 28648 28649 var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; 28650 28651 var freeGlobal = __webpack_require__(257); 28652 28653 /** Detect free variable `exports`. */ 28654 var freeExports = ( false ? 'undefined' : _typeof(exports)) == 'object' && exports && !exports.nodeType && exports; 28655 28656 /** Detect free variable `module`. */ 28657 var freeModule = freeExports && ( false ? 'undefined' : _typeof(module)) == 'object' && module && !module.nodeType && module; 28658 28659 /** Detect the popular CommonJS extension `module.exports`. */ 28660 var moduleExports = freeModule && freeModule.exports === freeExports; 28661 28662 /** Detect free variable `process` from Node.js. */ 28663 var freeProcess = moduleExports && freeGlobal.process; 28664 28665 /** Used to access faster Node.js helpers. */ 28666 var nodeUtil = function () { 28667 try { 28668 return freeProcess && freeProcess.binding && freeProcess.binding('util'); 28669 } catch (e) {} 28670 }(); 28671 28672 module.exports = nodeUtil; 28673 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(39)(module))) 28674 28675/***/ }, 28676/* 267 */ 28677/***/ function(module, exports) { 28678 28679 "use strict"; 28680 28681 /** 28682 * Creates a unary function that invokes `func` with its argument transformed. 28683 * 28684 * @private 28685 * @param {Function} func The function to wrap. 28686 * @param {Function} transform The argument transform. 28687 * @returns {Function} Returns the new function. 28688 */ 28689 function overArg(func, transform) { 28690 return function (arg) { 28691 return func(transform(arg)); 28692 }; 28693 } 28694 28695 module.exports = overArg; 28696 28697/***/ }, 28698/* 268 */
28699/***/ function(module, exports) { 28700 28701 'use strict'; 28702 28703 /** Used for built-in method references. */ 28704 var funcProto = Function.prototype; 28705 28706 /** Used to resolve the decompiled source of functions. */ 28707 var funcToString = funcProto.toString; 28708 28709 /** 28710 * Converts `func` to its source code. 28711 * 28712 * @private 28713 * @param {Function} func The function to convert. 28714 * @returns {string} Returns the source code. 28715 */ 28716 function toSource(func) { 28717 if (func != null) { 28718 try { 28719 return funcToString.call(func); 28720 } catch (e) {} 28721 try { 28722 return func + ''; 28723 } catch (e) {} 28724 } 28725 return ''; 28726 } 28727 28728 module.exports = toSource; 28729 28730/***/ }, 28731/* 269 */ 28732/***/ function(module, exports, __webpack_require__) { 28733 28734 'use strict'; 28735 28736 var apply = __webpack_require__(240), 28737 assignInWith = __webpack_require__(562), 28738 baseRest = __webpack_require__(99), 28739 customDefaultsAssignIn = __webpack_require__(518); 28740 28741 /** 28742 * Assigns own and inherited enumerable string keyed properties of source 28743 * objects to the destination object for all destination properties that 28744 * resolve to `undefined`. Source objects are applied from left to right. 28745 * Once a property is set, additional values of the same property are ignored. 28746 * 28747 * **Note:** This method mutates `object`. 28748 * 28749 * @static 28750 * @since 0.1.0 28751 * @memberOf _ 28752 * @category Object 28753 * @param {Object} object The destination object. 28754 * @param {...Object} [sources] The source objects. 28755 * @returns {Object} Returns `object`. 28756 * @see _.defaultsDeep 28757 * @example 28758 * 28759 * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); 28760 * // => { 'a': 1, 'b': 2 } 28761 */ 28762 var defaults = baseRest(function (args) { 28763 args.push(undefined, customDefaultsAssignIn); 28764 return apply(assignInWith, undefined, args); 28765 }); 28766 28767 module.exports = defaults; 28768 28769/***/ }, 28770/* 270 */ 28771/***/ function(module, exports, __webpack_require__) { 28772 28773 'use strict'; 28774 28775 var baseHas = __webpack_require__(479), 28776 hasPath = __webpack_require__(261); 28777 28778 /** 28779 * Checks if `path` is a direct property of `object`. 28780 * 28781 * @static 28782 * @since 0.1.0 28783 * @memberOf _ 28784 * @category Object 28785 * @param {Object} object The object to query. 28786 * @param {Array|string} path The path to check. 28787 * @returns {boolean} Returns `true` if `path` exists, else `false`. 28788 * @example 28789 * 28790 * var object = { 'a': { 'b': 2 } }; 28791 * var other = _.create({ 'a': _.create({ 'b': 2 }) }); 28792 * 28793 * _.has(object, 'a'); 28794 * // => true 28795 * 28796 * _.has(object, 'a.b'); 28797 * // => true 28798 * 28799 * _.has(object, ['a', 'b']); 28800 * // => true 28801 * 28802 * _.has(other, 'a'); 28803 * // => false 28804 */ 28805 function has(object, path) { 28806 return object != null && hasPath(object, path, baseHas); 28807 } 28808 28809 module.exports = has; 28810 28811/***/ }, 28812/* 271 */ 28813/***/ function(module, exports, __webpack_require__) { 28814 28815 'use strict'; 28816 28817 var baseGetTag = __webpack_require__(29), 28818 getPrototype = __webpack_require__(165), 28819 isObjectLike = __webpack_require__(25); 28820 28821 /** `Object#toString` result references. */ 28822 var objectTag = '[object Object]'; 28823 28824 /** Used for built-in method references. */ 28825 var funcProto = Function.prototype, 28826 objectProto = Object.prototype; 28827 28828 /** Used to resolve the decompiled source of functions. */ 28829 var funcToString = funcProto.toString; 28830 28831 /** Used to check objects for own properties. */ 28832 var hasOwnProperty = objectProto.hasOwnProperty; 28833 28834 /** Used to infer the `Object` constructor. */ 28835 var objectCtorString = funcToString.call(Object); 28836 28837 /** 28838 * Checks if `value` is a plain object, that is, an object created by the 28839 * `Object` constructor or one with a `[[Prototype]]` of `null`. 28840 * 28841 * @static 28842 * @memberOf _ 28843 * @since 0.8.0 28844 * @category Lang 28845 * @param {*} value The value to check. 28846 * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. 28847 * @example 28848 * 28849 * function Foo() { 28850 * this.a = 1; 28851 * } 28852 * 28853 * _.isPlainObject(new Foo); 28854 * // => false 28855 * 28856 * _.isPlainObject([1, 2, 3]); 28857 * // => false 28858 * 28859 * _.isPlainObject({ 'x': 0, 'y': 0 }); 28860 * // => true 28861 * 28862 * _.isPlainObject(Object.create(null)); 28863 * // => true 28864 */ 28865 function isPlainObject(value) { 28866 if (!isObjectLike(value) || baseGetTag(value) != objectTag) { 28867 return false;
28868 } 28869 var proto = getPrototype(value); 28870 if (proto === null) { 28871 return true; 28872 } 28873 var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor; 28874 return typeof Ctor == 'function' && Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString; 28875 } 28876 28877 module.exports = isPlainObject; 28878 28879/***/ }, 28880/* 272 */ 28881/***/ function(module, exports, __webpack_require__) { 28882 28883 'use strict'; 28884 28885 var baseIsRegExp = __webpack_require__(487), 28886 baseUnary = __webpack_require__(100), 28887 nodeUtil = __webpack_require__(266); 28888 28889 /* Node.js helper references. */ 28890 var nodeIsRegExp = nodeUtil && nodeUtil.isRegExp; 28891 28892 /** 28893 * Checks if `value` is classified as a `RegExp` object. 28894 * 28895 * @static 28896 * @memberOf _ 28897 * @since 0.1.0 28898 * @category Lang 28899 * @param {*} value The value to check. 28900 * @returns {boolean} Returns `true` if `value` is a regexp, else `false`. 28901 * @example 28902 * 28903 * _.isRegExp(/abc/); 28904 * // => true 28905 * 28906 * _.isRegExp('/abc/'); 28907 * // => false 28908 */ 28909 var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp; 28910 28911 module.exports = isRegExp; 28912 28913/***/ }, 28914/* 273 */ 28915/***/ function(module, exports, __webpack_require__) { 28916 28917 'use strict'; 28918 28919 var baseRest = __webpack_require__(99), 28920 pullAll = __webpack_require__(582); 28921 28922 /** 28923 * Removes all given values from `array` using 28924 * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) 28925 * for equality comparisons. 28926 * 28927 * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove` 28928 * to remove elements from an array by predicate. 28929 * 28930 * @static 28931 * @memberOf _ 28932 * @since 2.0.0 28933 * @category Array 28934 * @param {Array} array The array to modify. 28935 * @param {...*} [values] The values to remove. 28936 * @returns {Array} Returns `array`. 28937 * @example 28938 * 28939 * var array = ['a', 'b', 'c', 'a', 'b', 'c']; 28940 * 28941 * _.pull(array, 'a', 'c'); 28942 * console.log(array); 28943 * // => ['b', 'b'] 28944 */ 28945 var pull = baseRest(pullAll); 28946 28947 module.exports = pull; 28948 28949/***/ }, 28950/* 274 */ 28951/***/ function(module, exports, __webpack_require__) { 28952 28953 'use strict'; 28954 28955 var baseRepeat = __webpack_require__(499), 28956 isIterateeCall = __webpack_require__(168), 28957 toInteger = __webpack_require__(47), 28958 toString = __webpack_require__(112); 28959 28960 /** 28961 * Repeats the given string `n` times. 28962 * 28963 * @static 28964 * @memberOf _ 28965 * @since 3.0.0 28966 * @category String 28967 * @param {string} [string=''] The string to repeat. 28968 * @param {number} [n=1] The number of times to repeat the string. 28969 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. 28970 * @returns {string} Returns the repeated string. 28971 * @example 28972 * 28973 * _.repeat('*', 3); 28974 * // => '***' 28975 * 28976 * _.repeat('abc', 2); 28977 * // => 'abcabc' 28978 * 28979 * _.repeat('abc', 0); 28980 * // => '' 28981 */ 28982 function repeat(string, n, guard) { 28983 if (guard ? isIterateeCall(string, n, guard) : n === undefined) { 28984 n = 1; 28985 } else { 28986 n = toInteger(n); 28987 } 28988 return baseRepeat(toString(string), n); 28989 } 28990 28991 module.exports = repeat; 28992 28993/***/ }, 28994/* 275 */ 28995/***/ function(module, exports) { 28996 28997 "use strict"; 28998 28999 /** 29000 * This method returns a new empty array. 29001 * 29002 * @static 29003 * @memberOf _ 29004 * @since 4.13.0 29005 * @category Util 29006 * @returns {Array} Returns the new empty array. 29007 * @example 29008 * 29009 * var arrays = _.times(2, _.stubArray); 29010 * 29011 * console.log(arrays); 29012 * // => [[], []] 29013 * 29014 * console.log(arrays[0] === arrays[1]); 29015 * // => false 29016 */ 29017 function stubArray() { 29018 return []; 29019 } 29020 29021 module.exports = stubArray; 29022 29023/***/ }, 29024/* 276 */ 29025/***/ function(module, exports, __webpack_require__) { 29026 29027 'use strict'; 29028 29029 var baseValues = __webpack_require__(504), 29030 keys = __webpack_require__(31); 29031 29032 /** 29033 * Creates an array of the own enumerable string keyed property values of `object`. 29034 * 29035 * **Note:** Non-object values are coerced to objects. 29036 * 29037 * @static 29038 * @since 0.1.0 29039 * @memberOf _ 29040 * @category Object 29041 * @param {Object} object The object to query. 29042 * @returns {Array} Returns the array of property values. 29043 * @example 29044 * 29045 * function Foo() { 29046 * this.a = 1; 29047 * this.b = 2; 29048 * } 29049 * 29050 * Foo.prototype.c = 3; 29051 * 29052 * _.values(new Foo); 29053 * // => [1, 2] (iteration order is not guaranteed) 29054 * 29055 * _.values('hi'); 29056 * // => ['h', 'i'] 29057 */ 29058 function values(object) { 29059 return object == null ? [] : baseValues(object, keys(object)); 29060 } 29061 29062 module.exports = values; 29063 29064/***/ }, 29065/* 277 */
29066/***/ function(module, exports) { 29067 29068 "use strict"; 29069 29070 var originalObject = Object; 29071 var originalDefProp = Object.defineProperty; 29072 var originalCreate = Object.create; 29073 29074 function defProp(obj, name, value) { 29075 if (originalDefProp) try { 29076 originalDefProp.call(originalObject, obj, name, { value: value }); 29077 } catch (definePropertyIsBrokenInIE8) { 29078 obj[name] = value; 29079 } else { 29080 obj[name] = value; 29081 } 29082 } 29083 29084 // For functions that will be invoked using .call or .apply, we need to 29085 // define those methods on the function objects themselves, rather than 29086 // inheriting them from Function.prototype, so that a malicious or clumsy 29087 // third party cannot interfere with the functionality of this module by 29088 // redefining Function.prototype.call or .apply. 29089 function makeSafeToCall(fun) { 29090 if (fun) { 29091 defProp(fun, "call", fun.call); 29092 defProp(fun, "apply", fun.apply); 29093 } 29094 return fun; 29095 } 29096 29097 makeSafeToCall(originalDefProp); 29098 makeSafeToCall(originalCreate); 29099 29100 var hasOwn = makeSafeToCall(Object.prototype.hasOwnProperty); 29101 var numToStr = makeSafeToCall(Number.prototype.toString); 29102 var strSlice = makeSafeToCall(String.prototype.slice); 29103 29104 var cloner = function cloner() {}; 29105 function create(prototype) { 29106 if (originalCreate) { 29107 return originalCreate.call(originalObject, prototype); 29108 } 29109 cloner.prototype = prototype || null; 29110 return new cloner(); 29111 } 29112 29113 var rand = Math.random; 29114 var uniqueKeys = create(null); 29115 29116 function makeUniqueKey() { 29117 // Collisions are highly unlikely, but this module is in the business of 29118 // making guarantees rather than safe bets. 29119 do { 29120 var uniqueKey = internString(strSlice.call(numToStr.call(rand(), 36), 2)); 29121 } while (hasOwn.call(uniqueKeys, uniqueKey)); 29122 return uniqueKeys[uniqueKey] = uniqueKey; 29123 } 29124 29125 function internString(str) { 29126 var obj = {}; 29127 obj[str] = true; 29128 return Object.keys(obj)[0]; 29129 } 29130 29131 // External users might find this function useful, but it is not necessary 29132 // for the typical use of this module. 29133 exports.makeUniqueKey = makeUniqueKey; 29134 29135 // Object.getOwnPropertyNames is the only way to enumerate non-enumerable 29136 // properties, so if we wrap it to ignore our secret keys, there should be 29137 // no way (except guessing) to access those properties. 29138 var originalGetOPNs = Object.getOwnPropertyNames; 29139 Object.getOwnPropertyNames = function getOwnPropertyNames(object) { 29140 for (var names = originalGetOPNs(object), src = 0, dst = 0, len = names.length; src < len; ++src) { 29141 if (!hasOwn.call(uniqueKeys, names[src])) { 29142 if (src > dst) { 29143 names[dst] = names[src]; 29144 } 29145 ++dst; 29146 } 29147 } 29148 names.length = dst; 29149 return names; 29150 }; 29151 29152 function defaultCreatorFn(object) { 29153 return create(null); 29154 } 29155 29156 function makeAccessor(secretCreatorFn) { 29157 var brand = makeUniqueKey(); 29158 var passkey = create(null); 29159 29160 secretCreatorFn = secretCreatorFn || defaultCreatorFn; 29161 29162 function register(object) { 29163 var secret; // Created lazily. 29164 29165 function vault(key, forget) { 29166 // Only code that has access to the passkey can retrieve (or forget) 29167 // the secret object. 29168 if (key === passkey) { 29169 return forget ? secret = null : secret || (secret = secretCreatorFn(object)); 29170 } 29171 } 29172 29173 defProp(object, brand, vault); 29174 } 29175 29176 function accessor(object) { 29177 if (!hasOwn.call(object, brand)) register(object); 29178 return object[brand](passkey); 29179 } 29180 29181 accessor.forget = function (object) { 29182 if (hasOwn.call(object, brand)) object[brand](passkey, true); 29183 }; 29184 29185 return accessor; 29186 } 29187 29188 exports.makeAccessor = makeAccessor; 29189 29190/***/ }, 29191/* 278 */ 29192/***/ function(module, exports, __webpack_require__) { 29193 29194 var __WEBPACK_AMD_DEFINE_RESULT__;/* WEBPACK VAR INJECTION */(function(module, global) {'use strict'; 29195 29196 var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; 29197 29198 /*! https://mths.be/regenerate v1.3.2 by @mathias | MIT license */ 29199 ;(function (root) { 29200 29201 // Detect free variables `exports`. 29202 var freeExports = ( false ? 'undefined' : _typeof(exports)) == 'object' && exports; 29203 29204 // Detect free variable `module`. 29205 var freeModule = ( false ? 'undefined' : _typeof(module)) == 'object' && module && module.exports == freeExports && module; 29206 29207 // Detect free variable `global`, from Node.js/io.js or Browserified code, 29208 // and use it as `root`. 29209 var freeGlobal = (typeof global === 'undefined' ? 'undefined' : _typeof(global)) == 'object' && global; 29210 if (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal) { 29211 root = freeGlobal; 29212 } 29213 29214 /*--------------------------------------------------------------------------*/ 29215 29216 var ERRORS = { 29217 'rangeOrder': 'A range\u2019s `stop` value must be greater than or equal ' + 'to the `start` value.', 29218 'codePointRange': 'Invalid code point value. Code points range from ' + 'U+000000 to U+10FFFF.' 29219 }; 29220 29221 // https://mathiasbynens.be/notes/javascript-encoding#surrogate-pairs 29222 var HIGH_SURROGATE_MIN = 0xD800; 29223 var HIGH_SURROGATE_MAX = 0xDBFF; 29224 var LOW_SURROGATE_MIN = 0xDC00; 29225 var LOW_SURROGATE_MAX = 0xDFFF; 29226 29227 // In Regenerate output, `\0` is never preceded by `\` because we sort by 29228 // code point value, so let’s keep this regular expression simple. 29229 var regexNull = /\\x00([^0123456789]|$)/g; 29230 29231 var object = {}; 29232 var hasOwnProperty = object.hasOwnProperty; 29233 var extend = function extend(destination, source) { 29234 var key; 29235 for (key in source) { 29236 if (hasOwnProperty.call(source, key)) { 29237 destination[key] = source[key]; 29238 } 29239 } 29240 return destination; 29241 }; 29242
29243 var forEach = function forEach(array, callback) { 29244 var index = -1; 29245 var length = array.length; 29246 while (++index < length) { 29247 callback(array[index], index); 29248 } 29249 }; 29250 29251 var toString = object.toString; 29252 var isArray = function isArray(value) { 29253 return toString.call(value) == '[object Array]'; 29254 }; 29255 var isNumber = function isNumber(value) { 29256 return typeof value == 'number' || toString.call(value) == '[object Number]'; 29257 }; 29258 29259 // This assumes that `number` is a positive integer that `toString()`s nicely 29260 // (which is the case for all code point values). 29261 var zeroes = '0000'; 29262 var pad = function pad(number, totalCharacters) { 29263 var string = String(number); 29264 return string.length < totalCharacters ? (zeroes + string).slice(-totalCharacters) : string; 29265 }; 29266 29267 var hex = function hex(number) { 29268 return Number(number).toString(16).toUpperCase(); 29269 }; 29270 29271 var slice = [].slice; 29272 29273 /*--------------------------------------------------------------------------*/ 29274 29275 var dataFromCodePoints = function dataFromCodePoints(codePoints) { 29276 var index = -1; 29277 var length = codePoints.length; 29278 var max = length - 1; 29279 var result = []; 29280 var isStart = true; 29281 var tmp; 29282 var previous = 0; 29283 while (++index < length) { 29284 tmp = codePoints[index]; 29285 if (isStart) { 29286 result.push(tmp); 29287 previous = tmp; 29288 isStart = false;
29289 } else { 29290 if (tmp == previous + 1) { 29291 if (index != max) { 29292 previous = tmp; 29293 continue; 29294 } else { 29295 isStart = true; 29296 result.push(tmp + 1); 29297 } 29298 } else { 29299 // End the previous range and start a new one. 29300 result.push(previous + 1, tmp); 29301 previous = tmp; 29302 } 29303 } 29304 } 29305 if (!isStart) { 29306 result.push(tmp + 1); 29307 } 29308 return result; 29309 }; 29310 29311 var dataRemove = function dataRemove(data, codePoint) { 29312 // Iterate over the data per `(start, end)` pair. 29313 var index = 0; 29314 var start; 29315 var end; 29316 var length = data.length; 29317 while (index < length) { 29318 start = data[index]; 29319 end = data[index + 1]; 29320 if (codePoint >= start && codePoint < end) { 29321 // Modify this pair. 29322 if (codePoint == start) { 29323 if (end == start + 1) { 29324 // Just remove `start` and `end`. 29325 data.splice(index, 2); 29326 return data; 29327 } else { 29328 // Just replace `start` with a new value. 29329 data[index] = codePoint + 1; 29330 return data; 29331 } 29332 } else if (codePoint == end - 1) { 29333 // Just replace `end` with a new value. 29334 data[index + 1] = codePoint; 29335 return data; 29336 } else { 29337 // Replace `[start, end]` with `[startA, endA, startB, endB]`. 29338 data.splice(index, 2, start, codePoint, codePoint + 1, end); 29339 return data; 29340 } 29341 } 29342 index += 2; 29343 } 29344 return data; 29345 }; 29346 29347 var dataRemoveRange = function dataRemoveRange(data, rangeStart, rangeEnd) { 29348 if (rangeEnd < rangeStart) { 29349 throw Error(ERRORS.rangeOrder); 29350 } 29351 // Iterate over the data per `(start, end)` pair. 29352 var index = 0; 29353 var start; 29354 var end; 29355 while (index < data.length) { 29356 start = data[index]; 29357 end = data[index + 1] - 1; // Note: the `- 1` makes `end` inclusive. 29358 29359 // Exit as soon as no more matching pairs can be found. 29360 if (start > rangeEnd) { 29361 return data; 29362 } 29363 29364 // Check if this range pair is equal to, or forms a subset of, the range 29365 // to be removed. 29366 // E.g. we have `[0, 11, 40, 51]` and want to remove 0-10 → `[40, 51]`. 29367 // E.g. we have `[40, 51]` and want to remove 0-100 → `[]`. 29368 if (rangeStart <= start && rangeEnd >= end) { 29369 // Remove this pair. 29370 data.splice(index, 2); 29371 continue; 29372 } 29373 29374 // Check if both `rangeStart` and `rangeEnd` are within the bounds of 29375 // this pair. 29376 // E.g. we have `[0, 11]` and want to remove 4-6 → `[0, 4, 7, 11]`. 29377 if (rangeStart >= start && rangeEnd < end) { 29378 if (rangeStart == start) { 29379 // Replace `[start, end]` with `[startB, endB]`. 29380 data[index] = rangeEnd + 1; 29381 data[index + 1] = end + 1; 29382 return data; 29383 } 29384 // Replace `[start, end]` with `[startA, endA, startB, endB]`. 29385 data.splice(index, 2, start, rangeStart, rangeEnd + 1, end + 1); 29386 return data; 29387 } 29388 29389 // Check if only `rangeStart` is within the bounds of this pair. 29390 // E.g. we have `[0, 11]` and want to remove 4-20 → `[0, 4]`. 29391 if (rangeStart >= start && rangeStart <= end) { 29392 // Replace `end` with `rangeStart`. 29393 data[index + 1] = rangeStart; 29394 // Note: we cannot `return` just yet, in case any following pairs still 29395 // contain matching code points. 29396 // E.g. we have `[0, 11, 14, 31]` and want to remove 4-20 29397 // → `[0, 4, 21, 31]`. 29398 } 29399 29400 // Check if only `rangeEnd` is within the bounds of this pair. 29401 // E.g. we have `[14, 31]` and want to remove 4-20 → `[21, 31]`. 29402 else if (rangeEnd >= start && rangeEnd <= end) { 29403 // Just replace `start`. 29404 data[index] = rangeEnd + 1; 29405 return data; 29406 } 29407 29408 index += 2; 29409 } 29410 return data; 29411 }; 29412 29413 var dataAdd = function dataAdd(data, codePoint) { 29414 // Iterate over the data per `(start, end)` pair. 29415 var index = 0; 29416 var start; 29417 var end; 29418 var lastIndex = null; 29419 var length = data.length; 29420 if (codePoint < 0x0 || codePoint > 0x10FFFF) { 29421 throw RangeError(ERRORS.codePointRange); 29422 } 29423 while (index < length) { 29424 start = data[index]; 29425 end = data[index + 1]; 29426 29427 // Check if the code point is already in the set. 29428 if (codePoint >= start && codePoint < end) { 29429 return data; 29430 } 29431 29432 if (codePoint == start - 1) { 29433 // Just replace `start` with a new value. 29434 data[index] = codePoint; 29435 return data; 29436 } 29437 29438 // At this point, if `start` is `greater` than `codePoint`, insert a new 29439 // `[start, end]` pair before the current pair, or after the current pair 29440 // if there is a known `lastIndex`. 29441 if (start > codePoint) { 29442 data.splice(lastIndex != null ? lastIndex + 2 : 0, 0, codePoint, codePoint + 1); 29443 return data; 29444 } 29445 29446 if (codePoint == end) { 29447 // Check if adding this code point causes two separate ranges to become 29448 // a single range, e.g. `dataAdd([0, 4, 5, 10], 4)` → `[0, 10]`. 29449 if (codePoint + 1 == data[index + 2]) { 29450 data.splice(index, 4, start, data[index + 3]); 29451 return data; 29452 } 29453 // Else, just replace `end` with a new value. 29454 data[index + 1] = codePoint + 1; 29455 return data; 29456 } 29457 lastIndex = index; 29458 index += 2; 29459 } 29460 // The loop has finished; add the new pair to the end of the data set. 29461 data.push(codePoint, codePoint + 1); 29462 return data; 29463 }; 29464 29465 var dataAddData = function dataAddData(dataA, dataB) { 29466 // Iterate over the data per `(start, end)` pair. 29467 var index = 0; 29468 var start; 29469 var end; 29470 var data = dataA.slice(); 29471 var length = dataB.length; 29472 while (index < length) { 29473 start = dataB[index]; 29474 end = dataB[index + 1] - 1; 29475 if (start == end) { 29476 data = dataAdd(data, start); 29477 } else { 29478 data = dataAddRange(data, start, end); 29479 } 29480 index += 2; 29481 } 29482 return data; 29483 }; 29484 29485 var dataRemoveData = function dataRemoveData(dataA, dataB) { 29486 // Iterate over the data per `(start, end)` pair. 29487 var index = 0; 29488 var start; 29489 var end; 29490 var data = dataA.slice(); 29491 var length = dataB.length; 29492 while (index < length) { 29493 start = dataB[index]; 29494 end = dataB[index + 1] - 1; 29495 if (start == end) { 29496 data = dataRemove(data, start); 29497 } else { 29498 data = dataRemoveRange(data, start, end); 29499 } 29500 index += 2; 29501 } 29502 return data; 29503 }; 29504 29505 var dataAddRange = function dataAddRange(data, rangeStart, rangeEnd) { 29506 if (rangeEnd < rangeStart) { 29507 throw Error(ERRORS.rangeOrder); 29508 } 29509 if (rangeStart < 0x0 || rangeStart > 0x10FFFF || rangeEnd < 0x0 || rangeEnd > 0x10FFFF) { 29510 throw RangeError(ERRORS.codePointRange); 29511 } 29512 // Iterate over the data per `(start, end)` pair. 29513 var index = 0; 29514 var start; 29515 var end; 29516 var added = false;
29517 var length = data.length; 29518 while (index < length) { 29519 start = data[index]; 29520 end = data[index + 1]; 29521 29522 if (added) { 29523 // The range has already been added to the set; at this point, we just 29524 // need to get rid of the following ranges in case they overlap. 29525 29526 // Check if this range can be combined with the previous range. 29527 if (start == rangeEnd + 1) { 29528 data.splice(index - 1, 2); 29529 return data; 29530 } 29531 29532 // Exit as soon as no more possibly overlapping pairs can be found. 29533 if (start > rangeEnd) { 29534 return data; 29535 } 29536 29537 // E.g. `[0, 11, 12, 16]` and we’ve added 5-15, so we now have 29538 // `[0, 16, 12, 16]`. Remove the `12,16` part, as it lies within the 29539 // `0,16` range that was previously added. 29540 if (start >= rangeStart && start <= rangeEnd) { 29541 // `start` lies within the range that was previously added. 29542 29543 if (end > rangeStart && end - 1 <= rangeEnd) { 29544 // `end` lies within the range that was previously added as well, 29545 // so remove this pair. 29546 data.splice(index, 2); 29547 index -= 2; 29548 // Note: we cannot `return` just yet, as there may still be other 29549 // overlapping pairs. 29550 } else { 29551 // `start` lies within the range that was previously added, but 29552 // `end` doesn’t. E.g. `[0, 11, 12, 31]` and we’ve added 5-15, so 29553 // now we have `[0, 16, 12, 31]`. This must be written as `[0, 31]`. 29554 // Remove the previously added `end` and the current `start`. 29555 data.splice(index - 1, 2); 29556 index -= 2; 29557 } 29558 29559 // Note: we cannot return yet. 29560 } 29561 } else if (start == rangeEnd + 1) { 29562 data[index] = rangeStart; 29563 return data; 29564 } 29565 29566 // Check if a new pair must be inserted *before* the current one. 29567 else if (start > rangeEnd) { 29568 data.splice(index, 0, rangeStart, rangeEnd + 1); 29569 return data; 29570 } else if (rangeStart >= start && rangeStart < end && rangeEnd + 1 <= end) { 29571 // The new range lies entirely within an existing range pair. No action 29572 // needed. 29573 return data; 29574 } else if ( 29575 // E.g. `[0, 11]` and you add 5-15 → `[0, 16]`. 29576 rangeStart >= start && rangeStart < end || 29577 // E.g. `[0, 3]` and you add 3-6 → `[0, 7]`. 29578 end == rangeStart) { 29579 // Replace `end` with the new value. 29580 data[index + 1] = rangeEnd + 1; 29581 // Make sure the next range pair doesn’t overlap, e.g. `[0, 11, 12, 14]` 29582 // and you add 5-15 → `[0, 16]`, i.e. remove the `12,14` part. 29583 added = true; 29584 // Note: we cannot `return` just yet. 29585 } else if (rangeStart <= start && rangeEnd + 1 >= end) { 29586 // The new range is a superset of the old range. 29587 data[index] = rangeStart; 29588 data[index + 1] = rangeEnd + 1; 29589 added = true; 29590 } 29591 29592 index += 2; 29593 } 29594 // The loop has finished without doing anything; add the new pair to the end 29595 // of the data set. 29596 if (!added) { 29597 data.push(rangeStart, rangeEnd + 1); 29598 } 29599 return data; 29600 }; 29601 29602 var dataContains = function dataContains(data, codePoint) { 29603 var index = 0; 29604 var length = data.length; 29605 // Exit early if `codePoint` is not within `data`’s overall range. 29606 var start = data[index]; 29607 var end = data[length - 1]; 29608 if (length >= 2) { 29609 if (codePoint < start || codePoint >
29609 end) { 29610 return false; 29611 } 29612 } 29613 // Iterate over the data per `(start, end)` pair. 29614 while (index < length) { 29615 start = data[index]; 29616 end = data[index + 1]; 29617 if (codePoint >= start && codePoint < end) { 29618 return true; 29619 } 29620 index += 2; 29621 } 29622 return false; 29623 }; 29624 29625 var dataIntersection = function dataIntersection(data, codePoints) { 29626 var index = 0; 29627 var length = codePoints.length; 29628 var codePoint; 29629 var result = []; 29630 while (index < length) { 29631 codePoint = codePoints[index]; 29632 if (dataContains(data, codePoint)) { 29633 result.push(codePoint); 29634 } 29635 ++index; 29636 } 29637 return dataFromCodePoints(result); 29638 }; 29639 29640 var dataIsEmpty = function dataIsEmpty(data) { 29641 return !data.length; 29642 }; 29643 29644 var dataIsSingleton = function dataIsSingleton(data) { 29645 // Check if the set only represents a single code point. 29646 return data.length == 2 && data[0] + 1 == data[1]; 29647 }; 29648 29649 var dataToArray = function dataToArray(data) { 29650 // Iterate over the data per `(start, end)` pair. 29651 var index = 0; 29652 var start; 29653 var end; 29654 var result = []; 29655 var length = data.length; 29656 while (index < length) { 29657 start = data[index]; 29658 end = data[index + 1]; 29659 while (start < end) { 29660 result.push(start); 29661 ++start; 29662 } 29663 index += 2; 29664 } 29665 return result; 29666 }; 29667 29668 /*--------------------------------------------------------------------------*/ 29669 29670 // https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae 29671 var floor = Math.floor; 29672 var highSurrogate = function highSurrogate(codePoint) { 29673 return parseInt(floor((codePoint - 0x10000) / 0x400) + HIGH_SURROGATE_MIN, 10); 29674 }; 29675 29676 var lowSurrogate = function lowSurrogate(codePoint) { 29677 return parseInt((codePoint - 0x10000) % 0x400 + LOW_SURROGATE_MIN, 10); 29678 }; 29679 29680 var stringFromCharCode = String.fromCharCode; 29681 var codePointToString = function codePointToString(codePoint) { 29682 var string; 29683 // https://mathiasbynens.be/notes/javascript-escapes#single 29684 // Note: the `\b` escape sequence for U+0008 BACKSPACE in strings has a 29685 // different meaning in regular expressions (word boundary), so it cannot 29686 // be used here. 29687 if (codePoint == 0x09) { 29688 string = '\\t'; 29689 } 29690 // Note: IE < 9 treats `'\v'` as `'v'`, so avoid using it. 29691 // else if (codePoint == 0x0B) { 29692 // string = '\\v'; 29693 // } 29694 else if (codePoint == 0x0A) { 29695 string = '\\n'; 29696 } else if (codePoint == 0x0C) { 29697 string = '\\f'; 29698 } else if (codePoint == 0x0D) { 29699 string = '\\r'; 29700 } else if (codePoint == 0x5C) { 29701 string = '\\\\'; 29702 } else if (codePoint == 0x24 || codePoint >= 0x28 && codePoint <= 0x2B || codePoint == 0x2D || codePoint == 0x2E || codePoint == 0x3F || codePoint >= 0x5B && codePoint <= 0x5E || codePoint >= 0x7B && codePoint <= 0x7D) { 29703 // The code point maps to an unsafe printable ASCII character; 29704 // backslash-escape it. Here’s the list of those symbols: 29705 // 29706 // $()*+-.?[\]^{|} 29707 // 29708 // See #7 for more info. 29709 string = '\\' + stringFromCharCode(codePoint); 29710 } else if (codePoint >= 0x20 && codePoint <= 0x7E) { 29711 // The code point maps to one of these printable ASCII symbols 29712 // (including the space character): 29713 // 29714 // !"#%&',/0123456789:;<=>@ABCDEFGHIJKLMNO 29715 // PQRSTUVWXYZ_`abcdefghijklmnopqrstuvwxyz~ 29716 // 29717 // These can safely be used directly. 29718 string = stringFromCharCode(codePoint); 29719 } else if (codePoint <= 0xFF) { 29720 // https://mathiasbynens.be/notes/javascript-escapes#hexadecimal 29721 string = '\\x' + pad(hex(codePoint), 2); 29722 } else { 29723 // `codePoint <= 0xFFFF` holds true. 29724 // https://mathiasbynens.be/notes/javascript-escapes#unicode 29725 string = '\\u' + pad(hex(codePoint), 4); 29726 } 29727 29728 // There’s no need to account for astral symbols / surrogate pairs here, 29729 // since `codePointToString` is private and only used for BMP code points. 29730 // But if that’s what you need, just add an `else` block with this code: 29731 // 29732 // string = '\\u' + pad(hex(highSurrogate(codePoint)), 4) 29733 // + '\\u' + pad(hex(lowSurrogate(codePoint)), 4); 29734 29735 return string; 29736 }; 29737 29738 var codePointToStringUnicode = function codePointToStringUnicode(codePoint) { 29739 if (codePoint <= 0xFFFF) { 29740 return codePointToString(codePoint); 29741 } 29742 return '\\u{' + codePoint.toString(16).toUpperCase() + '}'; 29743 }; 29744 29745 var symbolToCodePoint = function symbolToCodePoint(symbol) { 29746 var length = symbol.length; 29747 var first = symbol.charCodeAt(0); 29748 var second; 29749 if (first >= HIGH_SURROGATE_MIN && first <= HIGH_SURROGATE_MAX && length > 1 // There is a next code unit. 29750 ) { 29751 // `first` is a high surrogate, and there is a next character. Assume
29752 // it’s a low surrogate (else it’s invalid usage of Regenerate anyway). 29753 second = symbol.charCodeAt(1); 29754 // https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae 29755 return (first - HIGH_SURROGATE_MIN) * 0x400 + second - LOW_SURROGATE_MIN + 0x10000; 29756 } 29757 return first; 29758 }; 29759 29760 var createBMPCharacterClasses = function createBMPCharacterClasses(data) { 29761 // Iterate over the data per `(start, end)` pair. 29762 var result = ''; 29763 var index = 0; 29764 var start; 29765 var end; 29766 var length = data.length; 29767 if (dataIsSingleton(data)) { 29768 return codePointToString(data[0]); 29769 } 29770 while (index < length) { 29771 start = data[index]; 29772 end = data[index + 1] - 1; // Note: the `- 1` makes `end` inclusive. 29773 if (start == end) { 29774 result += codePointToString(start); 29775 } else if (start + 1 == end) { 29776 result += codePointToString(start) + codePointToString(end); 29777 } else { 29778 result += codePointToString(start) + '-' + codePointToString(end); 29779 } 29780 index += 2; 29781 } 29782 return '[' + result + ']'; 29783 }; 29784 29785 var createUnicodeCharacterClasses = function createUnicodeCharacterClasses(data) { 29786 // Iterate over the data per `(start, end)` pair. 29787 var result = ''; 29788 var index = 0; 29789 var start; 29790 var end; 29791 var length = data.length; 29792 if (dataIsSingleton(data)) { 29793 return codePointToStringUnicode(data[0]); 29794 } 29795 while (index < length) { 29796 start = data[index]; 29797 end = data[index + 1] - 1; // Note: the `- 1` makes `end` inclusive. 29798 if (start == end) { 29799 result += codePointToStringUnicode(start); 29800 } else if (start + 1 == end) { 29801 result += codePointToStringUnicode(start) + codePointToStringUnicode(end); 29802 } else { 29803 result += codePointToStringUnicode(start) + '-' + codePointToStringUnicode(end); 29804 } 29805 index += 2; 29806 } 29807 return '[' + result + ']'; 29808 }; 29809 29810 var splitAtBMP = function splitAtBMP(data) { 29811 // Iterate over the data per `(start, end)` pair. 29812 var loneHighSurrogates = []; 29813 var loneLowSurrogates = []; 29814 var bmp = []; 29815 var astral = []; 29816 var index = 0; 29817 var start; 29818 var end; 29819 var length = data.length; 29820 while (index < length) { 29821 start = data[index]; 29822 end = data[index + 1] - 1; // Note: the `- 1` makes `end` inclusive. 29823 29824 if (start < HIGH_SURROGATE_MIN) { 29825 29826 // The range starts and ends before the high surrogate range. 29827 // E.g. (0, 0x10). 29828 if (end < HIGH_SURROGATE_MIN) { 29829 bmp.push(start, end + 1); 29830 } 29831 29832 // The range starts before the high surrogate range and ends within it. 29833 // E.g. (0, 0xD855). 29834 if (end >= HIGH_SURROGATE_MIN && end <= HIGH_SURROGATE_MAX) { 29835 bmp.push(start, HIGH_SURROGATE_MIN); 29836 loneHighSurrogates.push(HIGH_SURROGATE_MIN, end + 1); 29837 } 29838 29839 // The range starts before the high surrogate range and ends in the low 29840 // surrogate range. E.g. (0, 0xDCFF). 29841 if (end >= LOW_SURROGATE_MIN && end <= LOW_SURROGATE_MAX) { 29842 bmp.push(start, HIGH_SURROGATE_MIN); 29843 loneHighSurrogates.push(HIGH_SURROGATE_MIN, HIGH_SURROGATE_MAX + 1); 29844 loneLowSurrogates.push(LOW_SURROGATE_MIN, end + 1); 29845 } 29846 29847 // The range starts before the high surrogate range and ends after the 29848 // low surrogate range. E.g. (0, 0x10FFFF). 29849 if (end > LOW_SURROGATE_MAX) { 29850 bmp.push(start, HIGH_SURROGATE_MIN); 29851 loneHighSurrogates.push(HIGH_SURROGATE_MIN, HIGH_SURROGATE_MAX + 1); 29852 loneLowSurrogates.push(LOW_SURROGATE_MIN, LOW_SURROGATE_MAX + 1); 29853 if (end <= 0xFFFF) { 29854 bmp.push(LOW_SURROGATE_MAX + 1, end + 1); 29855 } else { 29856 bmp.push(LOW_SURROGATE_MAX + 1, 0xFFFF + 1); 29857 astral.push(0xFFFF + 1, end + 1); 29858 } 29859 } 29860 } else if (start >= HIGH_SURROGATE_MIN && start <= HIGH_SURROGATE_MAX) { 29861 29862 // The range starts and ends in the high surrogate range. 29863 // E.g. (0xD855, 0xD866). 29864 if (end >= HIGH_SURROGATE_MIN && end <= HIGH_SURROGATE_MAX) { 29865 loneHighSurrogates.push(start, end + 1); 29866 } 29867 29868 // The range starts in the high surrogate range and ends in the low 29869 // surrogate range. E.g. (0xD855, 0xDCFF). 29870 if (end >= LOW_SURROGATE_MIN && end <= LOW_SURROGATE_MAX) { 29871 loneHighSurrogates.push(start, HIGH_SURROGATE_MAX + 1); 29872 loneLowSurrogates.push(LOW_SURROGATE_MIN, end + 1); 29873 } 29874 29875 // The range starts in the high surrogate range and ends after the low 29876 // surrogate range. E.g. (0xD855, 0x10FFFF). 29877 if (end > LOW_SURROGATE_MAX) { 29878 loneHighSurrogates.push(start, HIGH_SURROGATE_MAX + 1); 29879 loneLowSurrogates.push(LOW_SURROGATE_MIN, LOW_SURROGATE_MAX + 1); 29880 if (end <= 0xFFFF) { 29881 bmp.push(LOW_SURROGATE_MAX + 1, end + 1); 29882 } else { 29883 bmp.push(LOW_SURROGATE_MAX + 1, 0xFFFF + 1); 29884 astral.push(0xFFFF + 1, end + 1); 29885 } 29886 } 29887 } else if (start >
29887= LOW_SURROGATE_MIN && start <= LOW_SURROGATE_MAX) { 29888 29889 // The range starts and ends in the low surrogate range. 29890 // E.g. (0xDCFF, 0xDDFF). 29891 if (end >= LOW_SURROGATE_MIN && end <= LOW_SURROGATE_MAX) { 29892 loneLowSurrogates.push(start, end + 1); 29893 } 29894 29895 // The range starts in the low surrogate range and ends after the low 29896 // surrogate range. E.g. (0xDCFF, 0x10FFFF). 29897 if (end > LOW_SURROGATE_MAX) { 29898 loneLowSurrogates.push(start, LOW_SURROGATE_MAX + 1); 29899 if (end <= 0xFFFF) { 29900 bmp.push(LOW_SURROGATE_MAX + 1, end + 1); 29901 } else { 29902 bmp.push(LOW_SURROGATE_MAX + 1, 0xFFFF + 1); 29903 astral.push(0xFFFF + 1, end + 1); 29904 } 29905 } 29906 } else if (start > LOW_SURROGATE_MAX && start <= 0xFFFF) { 29907 29908 // The range starts and ends after the low surrogate range. 29909 // E.g. (0xFFAA, 0x10FFFF). 29910 if (end <= 0xFFFF) { 29911 bmp.push(start, end + 1); 29912 } else { 29913 bmp.push(start, 0xFFFF + 1); 29914 astral.push(0xFFFF + 1, end + 1); 29915 } 29916 } else { 29917 29918 // The range starts and ends in the astral range. 29919 astral.push(start, end + 1); 29920 } 29921 29922 index += 2; 29923 } 29924 return { 29925 'loneHighSurrogates': loneHighSurrogates, 29926 'loneLowSurrogates': loneLowSurrogates, 29927 'bmp': bmp, 29928 'astral': astral 29929 }; 29930 }; 29931 29932 var optimizeSurrogateMappings = function optimizeSurrogateMappings(surrogateMappings) { 29933 var result = []; 29934 var tmpLow = []; 29935 var addLow = false; 29936 var mapping; 29937 var nextMapping; 29938 var highSurrogates; 29939 var lowSurrogates; 29940 var nextHighSurrogates; 29941 var nextLowSurrogates; 29942 var index = -1; 29943 var length = surrogateMappings.length; 29944 while (++index < length) { 29945 mapping = surrogateMappings[index]; 29946 nextMapping = surrogateMappings[index + 1]; 29947 if (!nextMapping) { 29948 result.push(mapping); 29949 continue; 29950 } 29951 highSurrogates = mapping[0]; 29952 lowSurrogates = mapping[1]; 29953 nextHighSurrogates = nextMapping[0]; 29954 nextLowSurrogates = nextMapping[1]; 29955 29956 // Check for identical high surrogate ranges. 29957 tmpLow = lowSurrogates; 29958 while (nextHighSurrogates && highSurrogates[0] == nextHighSurrogates[0] && highSurrogates[1] == nextHighSurrogates[1]) { 29959 // Merge with the next item. 29960 if (dataIsSingleton(nextLowSurrogates)) { 29961 tmpLow = dataAdd(tmpLow, nextLowSurrogates[0]); 29962 } else { 29963 tmpLow = dataAddRange(tmpLow, nextLowSurrogates[0], nextLowSurrogates[1] - 1); 29964 } 29965 ++index; 29966 mapping = surrogateMappings[index]; 29967 highSurrogates = mapping[0]; 29968 lowSurrogates = mapping[1]; 29969 nextMapping = surrogateMappings[index + 1]; 29970 nextHighSurrogates = nextMapping && nextMapping[0]; 29971 nextLowSurrogates = nextMapping && nextMapping[1]; 29972 addLow = true; 29973 } 29974 result.push([highSurrogates, addLow ? tmpLow : lowSurrogates]); 29975 addLow = false; 29976 } 29977 return optimizeByLowSurrogates(result); 29978 }; 29979 29980 var optimizeByLowSurrogates = function optimizeByLowSurrogates(surrogateMappings) { 29981 if (surrogateMappings.length == 1) { 29982 return surrogateMappings; 29983 } 29984 var index = -1; 29985 var innerIndex = -1; 29986 while (++index < surrogateMappings.length) { 29987 var mapping = surrogateMappings[index]; 29988 var lowSurrogates = mapping[1]; 29989 var lowSurrogateStart = lowSurrogates[0]; 29990 var lowSurrogateEnd = lowSurrogates[1]; 29991 innerIndex = index; // Note: the loop starts at the next index. 29992 while (++innerIndex < surrogateMappings.length) { 29993 var otherMapping = surrogateMappings[innerIndex]; 29994 var otherLowSurrogates = otherMapping[1]; 29995 var otherLowSurrogateStart = otherLowSurrogates[0]; 29996 var otherLowSurrogateEnd = otherLowSurrogates[1]; 29997 if (lowSurrogateStart == otherLowSurrogateStart && lowSurrogateEnd == otherLowSurrogateEnd) { 29998 // Add the code points in the other item to this one. 29999 if (dataIsSingleton(otherMapping[0])) { 30000 mapping[0] = dataAdd(mapping[0], otherMapping[0][0]); 30001 } else { 30002 mapping[0] = dataAddRange(mapping[0], otherMapping[0][0], otherMapping[0][1] - 1); 30003 } 30004 // Remove the other, now redundant, item. 30005 surrogateMappings.splice(innerIndex, 1); 30006 --innerIndex; 30007 } 30008 } 30009 } 30010 return surrogateMappings; 30011 }; 30012 30013 var surrogateSet = function surrogateSet(data) { 30014 // Exit early if `data` is an empty set. 30015 if (!data.length) { 30016 return []; 30017 } 30018 30019 // Iterate over the data per `(start, end)` pair. 30020 var index = 0; 30021 var start; 30022 var end; 30023 var startHigh; 30024 var startLow; 30025 var endHigh; 30026 var endLow; 30027 var surrogateMappings = []; 30028 var length = data.length; 30029 while (index < length) { 30030 start = data[index]; 30031 end = data[index + 1] - 1; 30032 30033 startHigh = highSurrogate(start); 30034 startLow = lowSurrogate(start);
30035 endHigh = highSurrogate(end); 30036 endLow = lowSurrogate(end); 30037 30038 var startsWithLowestLowSurrogate = startLow == LOW_SURROGATE_MIN; 30039 var endsWithHighestLowSurrogate = endLow == LOW_SURROGATE_MAX; 30040 var complete = false; 30041 30042 // Append the previous high-surrogate-to-low-surrogate mappings. 30043 // Step 1: `(startHigh, startLow)` to `(startHigh, LOW_SURROGATE_MAX)`. 30044 if (startHigh == endHigh || startsWithLowestLowSurrogate && endsWithHighestLowSurrogate) { 30045 surrogateMappings.push([[startHigh, endHigh + 1], [startLow, endLow + 1]]); 30046 complete = true; 30047 } else { 30048 surrogateMappings.push([[startHigh, startHigh + 1], [startLow, LOW_SURROGATE_MAX + 1]]); 30049 } 30050 30051 // Step 2: `(startHigh + 1, LOW_SURROGATE_MIN)` to 30052 // `(endHigh - 1, LOW_SURROGATE_MAX)`. 30053 if (!complete && startHigh + 1 < endHigh) { 30054 if (endsWithHighestLowSurrogate) { 30055 // Combine step 2 and step 3. 30056 surrogateMappings.push([[startHigh + 1, endHigh + 1], [LOW_SURROGATE_MIN, endLow + 1]]); 30057 complete = true; 30058 } else { 30059 surrogateMappings.push([[startHigh + 1, endHigh], [LOW_SURROGATE_MIN, LOW_SURROGATE_MAX + 1]]); 30060 } 30061 } 30062 30063 // Step 3. `(endHigh, LOW_SURROGATE_MIN)` to `(endHigh, endLow)`. 30064 if (!complete) { 30065 surrogateMappings.push([[endHigh, endHigh + 1], [LOW_SURROGATE_MIN, endLow + 1]]); 30066 } 30067 30068 index += 2; 30069 } 30070 30071 // The format of `surrogateMappings` is as follows: 30072 // 30073 // [ surrogateMapping1, surrogateMapping2 ] 30074 // 30075 // i.e.: 30076 // 30077 // [ 30078 // [ highSurrogates1, lowSurrogates1 ], 30079 // [ highSurrogates2, lowSurrogates2 ] 30080 // ] 30081 return optimizeSurrogateMappings(surrogateMappings); 30082 }; 30083 30084 var createSurrogateCharacterClasses = function createSurrogateCharacterClasses(surrogateMappings) { 30085 var result = []; 30086 forEach(surrogateMappings, function (surrogateMapping) { 30087 var highSurrogates = surrogateMapping[0]; 30088 var lowSurrogates = surrogateMapping[1]; 30089 result.push(createBMPCharacterClasses(highSurrogates) + createBMPCharacterClasses(lowSurrogates)); 30090 }); 30091 return result.join('|'); 30092 }; 30093 30094 var createCharacterClassesFromData = function createCharacterClassesFromData(data, bmpOnly, hasUnicodeFlag) { 30095 if (hasUnicodeFlag) { 30096 return createUnicodeCharacterClasses(data); 30097 } 30098 var result = []; 30099 30100 var parts = splitAtBMP(data); 30101 var loneHighSurrogates = parts.loneHighSurrogates; 30102 var loneLowSurrogates = parts.loneLowSurrogates; 30103 var bmp = parts.bmp; 30104 var astral = parts.astral; 30105 var hasLoneHighSurrogates = !dataIsEmpty(loneHighSurrogates); 30106 var hasLoneLowSurrogates = !dataIsEmpty(loneLowSurrogates); 30107 30108 var surrogateMappings = surrogateSet(astral); 30109 30110 if (bmpOnly) { 30111 bmp = dataAddData(bmp, loneHighSurrogates); 30112 hasLoneHighSurrogates = false; 30113 bmp = dataAddData(bmp, loneLowSurrogates); 30114 hasLoneLowSurrogates = false; 30115 } 30116 30117 if (!dataIsEmpty(bmp)) { 30118 // The data set contains BMP code points that are not high surrogates 30119 // needed for astral code points in the set. 30120 result.push(createBMPCharacterClasses(bmp)); 30121 } 30122 if (surrogateMappings.length) { 30123 // The data set contains astral code points; append character classes 30124 // based on their surrogate pairs. 30125 result.push(createSurrogateCharacterClasses(surrogateMappings)); 30126 } 30127 // https://gist.github.com/mathiasbynens/bbe7f870208abcfec860 30128 if (hasLoneHighSurrogates) { 30129 result.push(createBMPCharacterClasses(loneHighSurrogates) + 30130 // Make sure the high surrogates aren’t part of a surrogate pair. 30131 '(?![\\uDC00-\\uDFFF])'); 30132 } 30133 if (hasLoneLowSurrogates) { 30134 result.push( 30135 // It is not possible to accurately assert the low surrogates aren’t 30136 // part of a surrogate pair, since JavaScript regular expressions do 30137 // not support lookbehind. 30138 '(?:[^\\uD800-\\uDBFF]|^)' + createBMPCharacterClasses(loneLowSurrogates)); 30139 } 30140 return result.join('|'); 30141 }; 30142 30143 /*--------------------------------------------------------------------------*/ 30144 30145 // `regenerate` can be used as a constructor (and new methods can be added to 30146 // its prototype) but also as a regular function, the latter of which is the 30147 // documented and most common usage. For that reason, it’s not capitalized. 30148 var regenerate = function regenerate(value) { 30149 if (arguments.length > 1) { 30150 value = slice.call(arguments); 30151 } 30152 if (this instanceof regenerate) { 30153 this.data = []; 30154 return value ? this.add(value) : this; 30155 } 30156 return new regenerate().add(value); 30157 }; 30158 30159 regenerate.version = '1.3.2'; 30160 30161 var proto = regenerate.prototype; 30162 extend(proto, { 30163 'add': function add(value) { 30164 var $this = this; 30165 if (value == null) { 30166 return $this; 30167 } 30168 if (value instanceof regenerate) { 30169 // Allow passing other Regenerate instances. 30170 $this.data = dataAddData($this.data, value.data); 30171 return $this; 30172 } 30173 if (arguments.length > 1) { 30174 value = slice.call(arguments); 30175 } 30176 if (isArray(value)) {
30177 forEach(value, function (item) { 30178 $this.add(item); 30179 }); 30180 return $this; 30181 } 30182 $this.data = dataAdd($this.data, isNumber(value) ? value : symbolToCodePoint(value)); 30183 return $this; 30184 }, 30185 'remove': function remove(value) { 30186 var $this = this; 30187 if (value == null) { 30188 return $this; 30189 } 30190 if (value instanceof regenerate) { 30191 // Allow passing other Regenerate instances. 30192 $this.data = dataRemoveData($this.data, value.data); 30193 return $this; 30194 } 30195 if (arguments.length > 1) { 30196 value = slice.call(arguments); 30197 } 30198 if (isArray(value)) { 30199 forEach(value, function (item) { 30200 $this.remove(item); 30201 }); 30202 return $this; 30203 } 30204 $this.data = dataRemove($this.data, isNumber(value) ? value : symbolToCodePoint(value)); 30205 return $this; 30206 }, 30207 'addRange': function addRange(start, end) { 30208 var $this = this; 30209 $this.data = dataAddRange($this.data, isNumber(start) ? start : symbolToCodePoint(start), isNumber(end) ? end : symbolToCodePoint(end)); 30210 return $this; 30211 }, 30212 'removeRange': function removeRange(start, end) { 30213 var $this = this; 30214 var startCodePoint = isNumber(start) ? start : symbolToCodePoint(start); 30215 var endCodePoint = isNumber(end) ? end : symbolToCodePoint(end); 30216 $this.data = dataRemoveRange($this.data, startCodePoint, endCodePoint); 30217 return $this; 30218 }, 30219 'intersection': function intersection(argument) { 30220 var $this = this; 30221 // Allow passing other Regenerate instances. 30222 // TODO: Optimize this by writing and using `dataIntersectionData()`. 30223 var array = argument instanceof regenerate ? dataToArray(argument.data) : argument; 30224 $this.data = dataIntersection($this.data, array); 30225 return $this; 30226 }, 30227 'contains': function contains(codePoint) { 30228 return dataContains(this.data, isNumber(codePoint) ? codePoint : symbolToCodePoint(codePoint)); 30229 }, 30230 'clone': function clone() { 30231 var set = new regenerate(); 30232 set.data = this.data.slice(0); 30233 return set; 30234 }, 30235 'toString': function toString(options) { 30236 var result = createCharacterClassesFromData(this.data, options ? options.bmpOnly : false, options ? options.hasUnicodeFlag : false); 30237 if (!result) { 30238 // For an empty set, return something that can be inserted `/here/` to 30239 // form a valid regular expression. Avoid `(?:)` since that matches the 30240 // empty string. 30241 return '[]'; 30242 } 30243 // Use `\0` instead of `\x00` where possible. 30244 return result.replace(regexNull, '\\0$1'); 30245 }, 30246 'toRegExp': function toRegExp(flags) { 30247 var pattern = this.toString(flags && flags.indexOf('u') != -1 ? { 'hasUnicodeFlag': true } : null); 30248 return RegExp(pattern, flags || ''); 30249 }, 30250 'valueOf': function valueOf() { 30251 // Note: `valueOf` is aliased as `toArray`. 30252 return dataToArray(this.data); 30253 } 30254 }); 30255 30256 proto.toArray = proto.valueOf; 30257 30258 // Some AMD build optimizers, like r.js, check for specific condition patterns 30259 // like the following: 30260 if ("function" == 'function' && _typeof(__webpack_require__(48)) == 'object' && __webpack_require__(48)) { 30261 !(__WEBPACK_AMD_DEFINE_RESULT__ = function () { 30262 return regenerate; 30263 }.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); 30264 } else if (freeExports && !freeExports.nodeType) { 30265 if (freeModule) { 30266 // in Node.js, io.js, or RingoJS v0.8.0+ 30267 freeModule.exports = regenerate; 30268 } else { 30269 // in Narwhal or RingoJS v0.7.0- 30270 freeExports.regenerate = regenerate; 30271 } 30272 } else { 30273 // in Rhino or a web browser 30274 root.regenerate = regenerate; 30275 } 30276 })(undefined); 30277 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(39)(module), (function() { return this; }()))) 30278 30279/***/ }, 30280/* 279 */ 30281/***/ function(module, exports, __webpack_require__) { 30282 30283 "use strict"; 30284 30285 var _typeof2 = __webpack_require__(6); 30286 30287 var _typeof3 = _interopRequireDefault(_typeof2); 30288 30289 var _stringify = __webpack_require__(34); 30290 30291 var _stringify2 = _interopRequireDefault(_stringify); 30292 30293 var _assert = __webpack_require__(62); 30294 30295 var _assert2 = _interopRequireDefault(_assert); 30296 30297 var _babelTypes = __webpack_require__(1); 30298 30299 var t = _interopRequireWildcard(_babelTypes); 30300 30301 var _leap = __webpack_require__(596); 30302 30303 var leap = _interopRequireWildcard(_leap); 30304 30305 var _meta = __webpack_require__(597); 30306 30307 var meta = _interopRequireWildcard(_meta); 30308 30309 var _util = __webpack_require__(280); 30310 30311 var util = _interopRequireWildcard(_util); 30312 30313 function _interopRequireWildcard(obj) { 30314 if (obj && obj.__esModule) { 30315 return obj; 30316 } else { 30317 var newObj = {};if (obj != null) { 30318 for (var key in obj) { 30319 if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; 30320 } 30321 }newObj.default = obj;return newObj; 30322 } 30323 } 30324 30325 function _interopRequireDefault(obj) { 30326 return obj && obj.__esModule ? obj : { default: obj }; 30327 } 30328 30329 var hasOwn = Object.prototype.hasOwnProperty; /** 30330 * Copyright (c) 2014, Facebook, Inc. 30331 * All rights reserved. 30332 * 30333 * This source code is licensed under the BSD-style license found in the 30334 * https://raw.github.com/facebook/regenerator/master/LICENSE file. An 30335 * additional grant of patent rights can be found in the PATENTS file in 30336 * the same directory. 30337 */ 30338 30339 function Emitter(contextId) { 30340 _assert2.default.ok(this instanceof Emitter); 30341 t.assertIdentifier(contextId); 30342 30343 // Used to generate unique temporary names. 30344 this.nextTempId = 0; 30345 30346 // In order to make sure the context object does not collide with 30347 // anything in the local scope, we might have to rename it, so we 30348 // refer to it symbolically instead of just assuming that it will be 30349 // called "context". 30350 this.contextId = contextId; 30351 30352 // An append-only list of Statements that grows each time this.emit is 30353 // called. 30354 this.listing = []; 30355 30356 // A sparse array whose keys correspond to locations in this.listing 30357 // that have been marked as branch/jump targets. 30358 this.marked = [true]; 30359 30360 // The last location will be marked when this.getDispatchLoop is 30361 // called.
30362 this.finalLoc = loc(); 30363 30364 // A list of all leap.TryEntry statements emitted. 30365 this.tryEntries = []; 30366 30367 // Each time we evaluate the body of a loop, we tell this.leapManager 30368 // to enter a nested loop context that determines the meaning of break 30369 // and continue statements therein. 30370 this.leapManager = new leap.LeapManager(this); 30371 } 30372 30373 var Ep = Emitter.prototype; 30374 exports.Emitter = Emitter; 30375 30376 // Offsets into this.listing that could be used as targets for branches or 30377 // jumps are represented as numeric Literal nodes. This representation has 30378 // the amazingly convenient benefit of allowing the exact value of the 30379 // location to be determined at any time, even after generating code that 30380 // refers to the location. 30381 function loc() { 30382 return t.numericLiteral(-1); 30383 } 30384 30385 // Sets the exact value of the given location to the offset of the next 30386 // Statement emitted. 30387 Ep.mark = function (loc) { 30388 t.assertLiteral(loc); 30389 var index = this.listing.length; 30390 if (loc.value === -1) { 30391 loc.value = index; 30392 } else { 30393 // Locations can be marked redundantly, but their values cannot change 30394 // once set the first time. 30395 _assert2.default.strictEqual(loc.value, index); 30396 } 30397 this.marked[index] = true; 30398 return loc; 30399 }; 30400 30401 Ep.emit = function (node) { 30402 if (t.isExpression(node)) { 30403 node = t.expressionStatement(node); 30404 } 30405 30406 t.assertStatement(node); 30407 this.listing.push(node); 30408 }; 30409 30410 // Shorthand for emitting assignment statements. This will come in handy 30411 // for assignments to temporary variables. 30412 Ep.emitAssign = function (lhs, rhs) { 30413 this.emit(this.assign(lhs, rhs)); 30414 return lhs; 30415 }; 30416 30417 // Shorthand for an assignment statement. 30418 Ep.assign = function (lhs, rhs) { 30419 return t.expressionStatement(t.assignmentExpression("=", lhs, rhs)); 30420 }; 30421 30422 // Convenience function for generating expressions like context.next, 30423 // context.sent, and context.rval. 30424 Ep.contextProperty = function (name, computed) { 30425 return t.memberExpression(this.contextId, computed ? t.stringLiteral(name) : t.identifier(name), !!computed); 30426 }; 30427 30428 // Shorthand for setting context.rval and jumping to `context.stop()`. 30429 Ep.stop = function (rval) { 30430 if (rval) { 30431 this.setReturnValue(rval); 30432 } 30433 30434 this.jump(this.finalLoc); 30435 }; 30436 30437 Ep.setReturnValue = function (valuePath) { 30438 t.assertExpression(valuePath.value); 30439 30440 this.emitAssign(this.contextProperty("rval"), this.explodeExpression(valuePath)); 30441 }; 30442 30443 Ep.clearPendingException = function (tryLoc, assignee) { 30444 t.assertLiteral(tryLoc); 30445 30446 var catchCall = t.callExpression(this.contextProperty("catch", true), [tryLoc]); 30447 30448 if (assignee) { 30449 this.emitAssign(assignee, catchCall); 30450 } else { 30451 this.emit(catchCall); 30452 } 30453 }; 30454 30455 // Emits code for an unconditional jump to the given location, even if the 30456 // exact value of the location is not yet known. 30457 Ep.jump = function (toLoc) { 30458 this.emitAssign(this.contextProperty("next"), toLoc); 30459 this.emit(t.breakStatement()); 30460 }; 30461 30462 // Conditional jump. 30463 Ep.jumpIf = function (test, toLoc) { 30464 t.assertExpression(test); 30465 t.assertLiteral(toLoc); 30466 30467 this.emit(t.ifStatement(test, t.blockStatement([this.assign(this.contextProperty("next"), toLoc), t.breakStatement()]))); 30468 }; 30469 30470 // Conditional jump, with the condition negated. 30471 Ep.jumpIfNot = function (test, toLoc) { 30472 t.assertExpression(test); 30473 t.assertLiteral(toLoc); 30474 30475 var negatedTest = void 0; 30476 if (t.isUnaryExpression(test) && test.operator === "!") { 30477 // Avoid double negation. 30478 negatedTest = test.argument; 30479 } else { 30480 negatedTest = t.unaryExpression("!", test); 30481 } 30482 30483 this.emit(t.ifStatement(negatedTest, t.blockStatement([this.assign(this.contextProperty("next"), toLoc), t.breakStatement()]))); 30484 }; 30485 30486 // Returns a unique MemberExpression that can be used to store and 30487 // retrieve temporary values. Since the object of the member expression is 30488 // the context object, which is presumed to coexist peacefully with all 30489 // other local variables, and since we just increment `nextTempId` 30490 // monotonically, uniqueness is assured. 30491 Ep.makeTempVar = function () { 30492 return this.contextProperty("t" + this.nextTempId++); 30493 }; 30494 30495 Ep.getContextFunction = function (id) { 30496 return t.functionExpression(id || null /*Anonymous*/
30497 , [this.contextId], t.blockStatement([this.getDispatchLoop()]), false, // Not a generator anymore! 30498 false // Nor an expression. 30499 ); 30500 }; 30501 30502 // Turns this.listing into a loop of the form 30503 // 30504 // while (1) switch (context.next) { 30505 // case 0: 30506 // ... 30507 // case n: 30508 // return context.stop(); 30509 // } 30510 // 30511 // Each marked location in this.listing will correspond to one generated 30512 // case statement. 30513 Ep.getDispatchLoop = function () { 30514 var self = this; 30515 var cases = []; 30516 var current = void 0; 30517 30518 // If we encounter a break, continue, or return statement in a switch 30519 // case, we can skip the rest of the statements until the next case. 30520 var alreadyEnded = false; 30521 30522 self.listing.forEach(function (stmt, i) { 30523 if (self.marked.hasOwnProperty(i)) { 30524 cases.push(t.switchCase(t.numericLiteral(i), current = [])); 30525 alreadyEnded = false; 30526 } 30527 30528 if (!alreadyEnded) { 30529 current.push(stmt); 30530 if (t.isCompletionStatement(stmt)) alreadyEnded = true; 30531 } 30532 }); 30533 30534 // Now that we know how many statements there will be in this.listing, 30535 // we can finally resolve this.finalLoc.value. 30536 this.finalLoc.value = this.listing.length; 30537 30538 cases.push(t.switchCase(this.finalLoc, [ 30539 // Intentionally fall through to the "end" case... 30540 ]), 30541 30542 // So that the runtime can jump to the final location without having 30543 // to know its offset, we provide the "end" case as a synonym. 30544 t.switchCase(t.stringLiteral("end"), [ 30545 // This will check/clear both context.thrown and context.rval.
30546 t.returnStatement(t.callExpression(this.contextProperty("stop"), []))])); 30547 30548 return t.whileStatement(t.numericLiteral(1), t.switchStatement(t.assignmentExpression("=", this.contextProperty("prev"), this.contextProperty("next")), cases)); 30549 }; 30550 30551 Ep.getTryLocsList = function () { 30552 if (this.tryEntries.length === 0) { 30553 // To avoid adding a needless [] to the majority of runtime.wrap 30554 // argument lists, force the caller to handle this case specially. 30555 return null; 30556 } 30557 30558 var lastLocValue = 0; 30559 30560 return t.arrayExpression(this.tryEntries.map(function (tryEntry) { 30561 var thisLocValue = tryEntry.firstLoc.value; 30562 _assert2.default.ok(thisLocValue >= lastLocValue, "try entries out of order"); 30563 lastLocValue = thisLocValue; 30564 30565 var ce = tryEntry.catchEntry; 30566 var fe = tryEntry.finallyEntry; 30567 30568 var locs = [tryEntry.firstLoc, 30569 // The null here makes a hole in the array. 30570 ce ? ce.firstLoc : null]; 30571 30572 if (fe) { 30573 locs[2] = fe.firstLoc; 30574 locs[3] = fe.afterLoc; 30575 } 30576 30577 return t.arrayExpression(locs); 30578 })); 30579 }; 30580 30581 // All side effects must be realized in order. 30582 30583 // If any subexpression harbors a leap, all subexpressions must be 30584 // neutered of side effects. 30585 30586 // No destructive modification of AST nodes. 30587 30588 Ep.explode = function (path, ignoreResult) { 30589 var node = path.node; 30590 var self = this; 30591 30592 t.assertNode(node); 30593 30594 if (t.isDeclaration(node)) throw getDeclError(node); 30595 30596 if (t.isStatement(node)) return self.explodeStatement(path); 30597 30598 if (t.isExpression(node)) return self.explodeExpression(path, ignoreResult); 30599 30600 switch (node.type) { 30601 case "Program": 30602 return path.get("body").map(self.explodeStatement, self); 30603 30604 case "VariableDeclarator": 30605 throw getDeclError(node); 30606 30607 // These node types should be handled by their parent nodes 30608 // (ObjectExpression, SwitchStatement, and TryStatement, respectively). 30609 case "Property": 30610 case "SwitchCase": 30611 case "CatchClause": 30612 throw new Error(node.type + " nodes should be handled by their parents"); 30613 30614 default: 30615 throw new Error("unknown Node of type " + (0, _stringify2.default)(node.type)); 30616 } 30617 }; 30618 30619 function getDeclError(node) { 30620 return new Error("all declarations should have been transformed into " + "assignments before the Exploder began its work: " + (0, _stringify2.default)(node)); 30621 } 30622 30623 Ep.explodeStatement = function (path, labelId) { 30624 var stmt = path.node; 30625 var self = this; 30626 var before = void 0, 30627 after = void 0, 30628 head = void 0; 30629 30630 t.assertStatement(stmt); 30631 30632 if (labelId) { 30633 t.assertIdentifier(labelId); 30634 } else { 30635 labelId = null; 30636 } 30637 30638 // Explode BlockStatement nodes even if they do not contain a yield, 30639 // because we don't want or need the curly braces. 30640 if (t.isBlockStatement(stmt)) { 30641 path.get("body").forEach(function (path) { 30642 self.explodeStatement(path); 30643 }); 30644 return; 30645 } 30646 30647 if (!meta.containsLeap(stmt)) { 30648 // Technically we should be able to avoid emitting the statement 30649 // altogether if !meta.hasSideEffects(stmt), but that leads to 30650 // confusing generated code (for instance, `while (true) {}` just 30651 // disappears) and is probably a more appropriate job for a dedicated 30652 // dead code elimination pass. 30653 self.emit(stmt); 30654 return; 30655 } 30656 30657 var _ret = function () { 30658 switch (stmt.type) { 30659 case "ExpressionStatement": 30660 self.explodeExpression(path.get("expression"), true); 30661 break; 30662 30663 case "LabeledStatement": 30664 after = loc(); 30665 30666 // Did you know you can break from any labeled block statement or 30667 // control structure? Well, you can! Note: when a labeled loop is 30668 // encountered, the leap.LabeledEntry created here will immediately 30669 // enclose a leap.LoopEntry on the leap manager's stack, and both 30670 // entries will have the same label. Though this works just fine, it 30671 // may seem a bit redundant. In theory, we could check here to 30672 // determine if stmt knows how to handle its own label; for example, 30673 // stmt happens to be a WhileStatement and so we know it's going to 30674 // establish its own LoopEntry when we explode it (below). Then this
30675 // LabeledEntry would be unnecessary. Alternatively, we might be 30676 // tempted not to pass stmt.label down into self.explodeStatement, 30677 // because we've handled the label here, but that's a mistake because 30678 // labeled loops may contain labeled continue statements, which is not 30679 // something we can handle in this generic case. All in all, I think a 30680 // little redundancy greatly simplifies the logic of this case, since 30681 // it's clear that we handle all possible LabeledStatements correctly 30682 // here, regardless of whether they interact with the leap manager 30683 // themselves. Also remember that labels and break/continue-to-label 30684 // statements are rare, and all of this logic happens at transform 30685 // time, so it has no additional runtime cost. 30686 self.leapManager.withEntry(new leap.LabeledEntry(after, stmt.label), function () { 30687 self.explodeStatement(path.get("body"), stmt.label); 30688 }); 30689 30690 self.mark(after); 30691 30692 break; 30693 30694 case "WhileStatement": 30695 before = loc(); 30696 after = loc(); 30697 30698 self.mark(before); 30699 self.jumpIfNot(self.explodeExpression(path.get("test")), after); 30700 self.leapManager.withEntry(new leap.LoopEntry(after, before, labelId), function () { 30701 self.explodeStatement(path.get("body")); 30702 }); 30703 self.jump(before); 30704 self.mark(after); 30705 30706 break; 30707 30708 case "DoWhileStatement": 30709 var first = loc(); 30710 var test = loc(); 30711 after = loc(); 30712 30713 self.mark(first); 30714 self.leapManager.withEntry(new leap.LoopEntry(after, test, labelId), function () { 30715 self.explode(path.get("body")); 30716 }); 30717 self.mark(test); 30718 self.jumpIf(self.explodeExpression(path.get("test")), first); 30719 self.mark(after); 30720 30721 break; 30722 30723 case "ForStatement": 30724 head = loc(); 30725 var update = loc(); 30726 after = loc(); 30727 30728 if (stmt.init) { 30729 // We pass true here to indicate that if stmt.init is an expression 30730 // then we do not care about its result. 30731 self.explode(path.get("init"), true); 30732 } 30733 30734 self.mark(head); 30735 30736 if (stmt.test) { 30737 self.jumpIfNot(self.explodeExpression(path.get("test")), after); 30738 } else { 30739 // No test means continue unconditionally. 30740 } 30741 30742 self.leapManager.withEntry(new leap.LoopEntry(after, update, labelId), function () { 30743 self.explodeStatement(path.get("body")); 30744 }); 30745 30746 self.mark(update); 30747 30748 if (stmt.update) { 30749 // We pass true here to indicate that if stmt.update is an 30750 // expression then we do not care about its result. 30751 self.explode(path.get("update"), true); 30752 } 30753 30754 self.jump(head); 30755 30756 self.mark(after); 30757 30758 break; 30759 30760 case "TypeCastExpression": 30761 return { 30762 v: self.explodeExpression(path.get("expression")) 30763 }; 30764 30765 case "ForInStatement": 30766 head = loc(); 30767 after = loc(); 30768 30769 var keyIterNextFn = self.makeTempVar(); 30770 self.emitAssign(keyIterNextFn, t.callExpression(util.runtimeProperty("keys"), [self.explodeExpression(path.get("right"))])); 30771 30772 self.mark(head); 30773 30774 var keyInfoTmpVar = self.makeTempVar(); 30775 self.jumpIf(t.memberExpression(t.assignmentExpression("=", keyInfoTmpVar, t.callExpression(keyIterNextFn, [])), t.identifier("done"), false), after); 30776 30777 self.emitAssign(stmt.left, t.memberExpression(keyInfoTmpVar, t.identifier("value"), false)); 30778 30779 self.leapManager.withEntry(new leap.LoopEntry(after, head, labelId), function () { 30780 self.explodeStatement(path.get("body")); 30781 }); 30782 30783 self.jump(head); 30784 30785 self.mark(after); 30786 30787 break; 30788 30789 case "BreakStatement": 30790 self.emitAbruptCompletion({ 30791 type: "break", 30792 target: self.leapManager.getBreakLoc(stmt.label) 30793 }); 30794 30795 break; 30796 30797 case "ContinueStatement": 30798 self.emitAbruptCompletion({ 30799 type: "continue", 30800 target: self.leapManager.getContinueLoc(stmt.label) 30801 }); 30802 30803 break; 30804 30805 case "SwitchStatement": 30806 // Always save the discriminant into a temporary variable in case the 30807 // test expressions overwrite values like context.sent. 30808 var disc = self.emitAssign(self.makeTempVar(), self.explodeExpression(path.get("discriminant"))); 30809 30810 after = loc();
30811 var defaultLoc = loc(); 30812 var condition = defaultLoc; 30813 var caseLocs = []; 30814 30815 // If there are no cases, .cases might be undefined. 30816 var cases = stmt.cases || []; 30817 30818 for (var i = cases.length - 1; i >= 0; --i) { 30819 var c = cases[i]; 30820 t.assertSwitchCase(c); 30821 30822 if (c.test) { 30823 condition = t.conditionalExpression(t.binaryExpression("===", disc, c.test), caseLocs[i] = loc(), condition); 30824 } else { 30825 caseLocs[i] = defaultLoc; 30826 } 30827 } 30828 30829 var discriminant = path.get("discriminant"); 30830 discriminant.replaceWith(condition); 30831 self.jump(self.explodeExpression(discriminant)); 30832 30833 self.leapManager.withEntry(new leap.SwitchEntry(after), function () { 30834 path.get("cases").forEach(function (casePath) { 30835 var i = casePath.key; 30836 self.mark(caseLocs[i]); 30837 30838 casePath.get("consequent").forEach(function (path) { 30839 self.explodeStatement(path); 30840 }); 30841 }); 30842 }); 30843 30844 self.mark(after); 30845 if (defaultLoc.value === -1) { 30846 self.mark(defaultLoc); 30847 _assert2.default.strictEqual(after.value, defaultLoc.value); 30848 } 30849 30850 break; 30851 30852 case "IfStatement": 30853 var elseLoc = stmt.alternate && loc(); 30854 after = loc(); 30855 30856 self.jumpIfNot(self.explodeExpression(path.get("test")), elseLoc || after); 30857 30858 self.explodeStatement(path.get("consequent")); 30859 30860 if (elseLoc) { 30861 self.jump(after); 30862 self.mark(elseLoc); 30863 self.explodeStatement(path.get("alternate")); 30864 } 30865 30866 self.mark(after); 30867 30868 break; 30869 30870 case "ReturnStatement": 30871 self.emitAbruptCompletion({ 30872 type: "return", 30873 value: self.explodeExpression(path.get("argument")) 30874 }); 30875 30876 break; 30877 30878 case "WithStatement": 30879 throw new Error("WithStatement not supported in generator functions."); 30880 30881 case "TryStatement": 30882 after = loc(); 30883 30884 var handler = stmt.handler; 30885 30886 var catchLoc = handler && loc(); 30887 var catchEntry = catchLoc && new leap.CatchEntry(catchLoc, handler.param); 30888 30889 var finallyLoc = stmt.finalizer && loc(); 30890 var finallyEntry = finallyLoc && new leap.FinallyEntry(finallyLoc, after); 30891 30892 var tryEntry = new leap.TryEntry(self.getUnmarkedCurrentLoc(), catchEntry, finallyEntry); 30893 30894 self.tryEntries.push(tryEntry); 30895 self.updateContextPrevLoc(tryEntry.firstLoc); 30896 30897 self.leapManager.withEntry(tryEntry, function () { 30898 self.explodeStatement(path.get("block")); 30899 30900 if (catchLoc) { 30901 (function () { 30902 if (finallyLoc) { 30903 // If we have both a catch block and a finally block, then 30904 // because we emit the catch block first, we need to jump over 30905 // it to the finally block. 30906 self.jump(finallyLoc); 30907 } else { 30908 // If there is no finally block, then we need to jump over the 30909 // catch block to the fall-through location. 30910 self.jump(after); 30911 } 30912 30913 self.updateContextPrevLoc(self.mark(catchLoc)); 30914 30915 var bodyPath = path.get("handler.body"); 30916 var safeParam = self.makeTempVar(); 30917 self.clearPendingException(tryEntry.firstLoc, safeParam); 30918 30919 bodyPath.traverse(catchParamVisitor, { 30920 safeParam: safeParam, 30921 catchParamName: handler.param.name 30922 }); 30923 30924 self.leapManager.withEntry(catchEntry, function () { 30925 self.explodeStatement(bodyPath); 30926 }); 30927 })(); 30928 } 30929 30930 if (finallyLoc) { 30931 self.updateContextPrevLoc(self.mark(finallyLoc)); 30932 30933 self.leapManager.withEntry(finallyEntry, function () { 30934 self.explodeStatement(path.get("finalizer")); 30935 }); 30936
30937 self.emit(t.returnStatement(t.callExpression(self.contextProperty("finish"), [finallyEntry.firstLoc]))); 30938 } 30939 }); 30940 30941 self.mark(after); 30942 30943 break; 30944 30945 case "ThrowStatement": 30946 self.emit(t.throwStatement(self.explodeExpression(path.get("argument")))); 30947 30948 break; 30949 30950 default: 30951 throw new Error("unknown Statement of type " + (0, _stringify2.default)(stmt.type)); 30952 } 30953 }(); 30954 30955 if ((typeof _ret === "undefined" ? "undefined" : (0, _typeof3.default)(_ret)) === "object") return _ret.v; 30956 }; 30957 30958 var catchParamVisitor = { 30959 Identifier: function Identifier(path, state) { 30960 if (path.node.name === state.catchParamName && util.isReference(path)) { 30961 path.replaceWith(state.safeParam); 30962 } 30963 }, 30964 30965 Scope: function Scope(path, state) { 30966 if (path.scope.hasOwnBinding(state.catchParamName)) { 30967 // Don't descend into nested scopes that shadow the catch 30968 // parameter with their own declarations. 30969 path.skip(); 30970 } 30971 } 30972 }; 30973 30974 Ep.emitAbruptCompletion = function (record) { 30975 if (!isValidCompletion(record)) { 30976 _assert2.default.ok(false, "invalid completion record: " + (0, _stringify2.default)(record)); 30977 } 30978 30979 _assert2.default.notStrictEqual(record.type, "normal", "normal completions are not abrupt"); 30980 30981 var abruptArgs = [t.stringLiteral(record.type)]; 30982 30983 if (record.type === "break" || record.type === "continue") { 30984 t.assertLiteral(record.target); 30985 abruptArgs[1] = record.target; 30986 } else if (record.type === "return" || record.type === "throw") { 30987 if (record.value) { 30988 t.assertExpression(record.value); 30989 abruptArgs[1] = record.value; 30990 } 30991 } 30992
30993 this.emit(t.returnStatement(t.callExpression(this.contextProperty("abrupt"), abruptArgs))); 30994 }; 30995 30996 function isValidCompletion(record) { 30997 var type = record.type; 30998 30999 if (type === "normal") { 31000 return !hasOwn.call(record, "target"); 31001 } 31002 31003 if (type === "break" || type === "continue") { 31004 return !hasOwn.call(record, "value") && t.isLiteral(record.target); 31005 } 31006 31007 if (type === "return" || type === "throw") { 31008 return hasOwn.call(record, "value") && !hasOwn.call(record, "target"); 31009 } 31010 31011 return false; 31012 } 31013 31014 // Not all offsets into emitter.listing are potential jump targets. For 31015 // example, execution typically falls into the beginning of a try block 31016 // without jumping directly there. This method returns the current offset 31017 // without marking it, so that a switch case will not necessarily be 31018 // generated for this offset (I say "not necessarily" because the same 31019 // location might end up being marked in the process of emitting other 31020 // statements). There's no logical harm in marking such locations as jump 31021 // targets, but minimizing the number of switch cases keeps the generated 31022 // code shorter. 31023 Ep.getUnmarkedCurrentLoc = function () { 31024 return t.numericLiteral(this.listing.length); 31025 }; 31026 31027 // The context.prev property takes the value of context.next whenever we 31028 // evaluate the switch statement discriminant, which is generally good 31029 // enough for tracking the last location we jumped to, but sometimes 31030 // context.prev needs to be more precise, such as when we fall 31031 // successfully out of a try block and into a finally block without 31032 // jumping. This method exists to update context.prev to the freshest 31033 // available location. If we were implementing a full interpreter, we 31034 // would know the location of the current instruction with complete 31035 // precision at all times, but we don't have that luxury here, as it would 31036 // be costly and verbose to set context.prev before every statement. 31037 Ep.updateContextPrevLoc = function (loc) { 31038 if (loc) { 31039 t.assertLiteral(loc); 31040 31041 if (loc.value === -1) { 31042 // If an uninitialized location literal was passed in, set its value 31043 // to the current this.listing.length. 31044 loc.value = this.listing.length; 31045 } else { 31046 // Otherwise assert that the location matches the current offset. 31047 _assert2.default.strictEqual(loc.value, this.listing.length); 31048 } 31049 } else { 31050 loc = this.getUnmarkedCurrentLoc(); 31051 } 31052 31053 // Make sure context.prev is up to date in case we fell into this try 31054 // statement without jumping to it. TODO Consider avoiding this 31055 // assignment when we know control must have jumped here. 31056 this.emitAssign(this.contextProperty("prev"), loc); 31057 }; 31058 31059 Ep.explodeExpression = function (path, ignoreResult) { 31060 var expr = path.node; 31061 if (expr) { 31062 t.assertExpression(expr); 31063 } else { 31064 return expr; 31065 } 31066 31067 var self = this; 31068 var result = void 0; // Used optionally by several cases below. 31069 var after = void 0; 31070 31071 function finish(expr) { 31072 t.assertExpression(expr); 31073 if (ignoreResult) { 31074 self.emit(expr); 31075 } else { 31076 return expr; 31077 } 31078 } 31079 31080 // If the expression does not contain a leap, then we either emit the 31081 // expression as a standalone statement or return it whole. 31082 if (!meta.containsLeap(expr)) { 31083 return finish(expr); 31084 } 31085 31086 // If any child contains a leap (such as a yield or labeled continue or 31087 // break statement), then any sibling subexpressions will almost 31088 // certainly have to be exploded in order to maintain the order of their 31089 // side effects relative to the leaping child(ren). 31090 var hasLeapingChildren = meta.containsLeap.onlyChildren(expr); 31091 31092 // In order to save the rest of explodeExpression from a combinatorial 31093 // trainwreck of special cases, explodeViaTempVar is responsible for 31094 // deciding when a subexpression needs to be "exploded," which is my 31095 // very technical term for emitting the subexpression as an assignment 31096 // to a temporary variable and the substituting the temporary variable 31097 // for the original subexpression. Think of exploded view diagrams, not 31098 // Michael Bay movies. The point of exploding subexpressions is to 31099 // control the precise order in which the generated code realizes the 31100 // side effects of those subexpressions. 31101 function explodeViaTempVar(tempVar, childPath, ignoreChildResult) { 31102 _assert2.default.ok(!ignoreChildResult || !tempVar, "Ignoring the result of a child expression but forcing it to " + "be assigned to a temporary variable?"); 31103 31104 var result = self.explodeExpression(childPath, ignoreChildResult); 31105 31106 if (ignoreChildResult) { 31107 // Side effects already emitted above. 31108 31109 } else if (tempVar || hasLeapingChildren && !t.isLiteral(result)) { 31110 // If tempVar was provided, then the result will always be assigned 31111 // to it, even if the result does not otherwise need to be assigned 31112 // to a temporary variable. When no tempVar is provided, we have 31113 // the flexibility to decide whether a temporary variable is really 31114 // necessary. Unfortunately, in general, a temporary variable is 31115 // required whenever any child contains a yield expression, since it 31116 // is difficult to prove (at all, let alone efficiently) whether 31117 // this result would evaluate to the same value before and after the 31118 // yield (see #206). One narrow case where we can prove it doesn't 31119 // matter (and thus we do not need a temporary variable) is when the 31120 // result in question is a Literal value. 31121 result = self.emitAssign(tempVar || self.makeTempVar(), result); 31122 } 31123 return result; 31124 } 31125 31126 // If ignoreResult is true, then we must take full responsibility for 31127 // emitting the expression with all its side effects, and we should not 31128 // return a result. 31129 31130 var _ret3 = function () { 31131 switch (expr.type) {
31132 case "MemberExpression": 31133 return { 31134 v: finish(t.memberExpression(self.explodeExpression(path.get("object")), expr.computed ? explodeViaTempVar(null, path.get("property")) : expr.property, expr.computed)) 31135 }; 31136 31137 case "CallExpression": 31138 var calleePath = path.get("callee"); 31139 var argsPath = path.get("arguments"); 31140 31141 var newCallee = void 0; 31142 var newArgs = []; 31143 31144 var hasLeapingArgs = false; 31145 argsPath.forEach(function (argPath) { 31146 hasLeapingArgs = hasLeapingArgs || meta.containsLeap(argPath.node); 31147 }); 31148 31149 if (t.isMemberExpression(calleePath.node)) { 31150 if (hasLeapingArgs) { 31151 // If the arguments of the CallExpression contained any yield 31152 // expressions, then we need to be sure to evaluate the callee 31153 // before evaluating the arguments, but if the callee was a member 31154 // expression, then we must be careful that the object of the 31155 // member expression still gets bound to `this` for the call. 31156 31157 var newObject = explodeViaTempVar( 31158 // Assign the exploded callee.object expression to a temporary 31159 // variable so that we can use it twice without reevaluating it. 31160 self.makeTempVar(), calleePath.get("object")); 31161 31162 var newProperty = calleePath.node.computed ? explodeViaTempVar(null, calleePath.get("property")) : calleePath.node.property; 31163 31164 newArgs.unshift(newObject); 31165 31166 newCallee = t.memberExpression(t.memberExpression(newObject, newProperty, calleePath.node.computed), t.identifier("call"), false); 31167 } else { 31168 newCallee = self.explodeExpression(calleePath); 31169 } 31170 } else { 31171 newCallee = explodeViaTempVar(null, calleePath); 31172 31173 if (t.isMemberExpression(newCallee)) { 31174 // If the callee was not previously a MemberExpression, then the 31175 // CallExpression was "unqualified," meaning its `this` object 31176 // should be the global object. If the exploded expression has 31177 // become a MemberExpression (e.g. a context property, probably a 31178 // temporary variable), then we need to force it to be unqualified 31179 // by using the (0, object.property)(...) trick; otherwise, it 31180 // will receive the object of the MemberExpression as its `this` 31181 // object. 31182 newCallee = t.sequenceExpression([t.numericLiteral(0), newCallee]); 31183 } 31184 } 31185 31186 argsPath.forEach(function (argPath) { 31187 newArgs.push(explodeViaTempVar(null, argPath)); 31188 }); 31189 31190 return { 31191 v: finish(t.callExpression(newCallee, newArgs)) 31192 }; 31193 31194 case "NewExpression": 31195 return { 31196 v: finish(t.newExpression(explodeViaTempVar(null, path.get("callee")), path.get("arguments").map(function (argPath) { 31197 return explodeViaTempVar(null, argPath); 31198 }))) 31199 }; 31200 31201 case "ObjectExpression": 31202 return { 31203 v: finish(t.objectExpression(path.get("properties").map(function (propPath) { 31204 if (propPath.isObjectProperty()) { 31205 return t.objectProperty(propPath.node.key, explodeViaTempVar(null, propPath.get("value")), propPath.node.computed); 31206 } else { 31207 return propPath.node; 31208 } 31209 }))) 31210 }; 31211 31212 case "ArrayExpression": 31213 return { 31214 v: finish(t.arrayExpression(path.get("elements").map(function (elemPath) { 31215 return explodeViaTempVar(null, elemPath); 31216 }))) 31217 }; 31218 31219 case "SequenceExpression": 31220 var lastIndex = expr.expressions.length - 1; 31221 31222 path.get("expressions").forEach(function (exprPath) { 31223 if (exprPath.key === lastIndex) { 31224 result = self.explodeExpression(exprPath, ignoreResult); 31225 } else { 31226 self.explodeExpression(exprPath, true); 31227 } 31228 }); 31229 31230 return { 31231 v: result 31232 }; 31233 31234 case "LogicalExpression": 31235 after = loc(); 31236 31237 if (!ignoreResult) { 31238 result = self.makeTempVar(); 31239 } 31240 31241 var left = explodeViaTempVar(result, path.get("left")); 31242 31243 if (expr.operator === "&&") { 31244 self.jumpIfNot(left, after); 31245 } else { 31246 _assert2.default.strictEqual(expr.operator, "||"); 31247 self.jumpIf(left, after); 31248 } 31249 31250 explodeViaTempVar(result, path.get("right"), ignoreResult); 31251 31252 self.mark(after); 31253 31254 return { 31255 v: result 31256 }; 31257 31258 case "ConditionalExpression": 31259 var elseLoc = loc(); 31260 after = loc(); 31261 var test = self.explodeExpression(path.get("test")); 31262 31263 self.jumpIfNot(test, elseLoc); 31264 31265 if (!ignoreResult) { 31266 result = self.makeTempVar(); 31267 } 31268 31269 explodeViaTempVar(result, path.get("consequent"), ignoreResult); 31270 self.jump(after); 31271 31272 self.mark(elseLoc); 31273 explodeViaTempVar(result, path.get("alternate"), ignoreResult); 31274 31275 self.mark(after); 31276 31277 return { 31278 v: result 31279 }; 31280 31281 case "UnaryExpression": 31282 return { 31283 v: finish(t.unaryExpression(expr.operator, 31284 // Can't (and don't need to) break up the syntax of the argument. 31285 // Think about delete a[b]. 31286 self.explodeExpression(path.get("argument")), !!expr.prefix)) 31287 }; 31288 31289 case "BinaryExpression": 31290 return { 31291 v: finish(t.binaryExpression(expr.operator, explodeViaTempVar(null, path.get("left")), explodeViaTempVar(null, path.get("right")))) 31292 }; 31293 31294 case "AssignmentExpression": 31295 return { 31296 v: finish(t.assignmentExpression(expr.operator, self.explodeExpression(path.get("left")), self.explodeExpression(path.get("right")))) 31297 }; 31298 31299 case "UpdateExpression": 31300 return { 31301 v: finish(t.updateExpression(expr.operator, self.explodeExpression(path.get("argument")), expr.prefix)) 31302 }; 31303 31304 case "YieldExpression": 31305 after = loc(); 31306 var arg = expr.argument && self.explodeExpression(path.get("argument")); 31307 31308 if (arg && expr.delegate) { 31309 var _result = self.makeTempVar(); 31310
31311 self.emit(t.returnStatement(t.callExpression(self.contextProperty("delegateYield"), [arg, t.stringLiteral(_result.property.name), after]))); 31312 31313 self.mark(after); 31314 31315 return { 31316 v: _result 31317 }; 31318 } 31319 31320 self.emitAssign(self.contextProperty("next"), after); 31321 self.emit(t.returnStatement(arg || null)); 31322 self.mark(after); 31323 31324 return { 31325 v: self.contextProperty("sent") 31326 }; 31327 31328 default: 31329 throw new Error("unknown Expression of type " + (0, _stringify2.default)(expr.type)); 31330 } 31331 }(); 31332 31333 if ((typeof _ret3 === "undefined" ? "undefined" : (0, _typeof3.default)(_ret3)) === "object") return _ret3.v; 31334 }; 31335 31336/***/ }, 31337/* 280 */ 31338/***/ function(module, exports, __webpack_require__) { 31339 31340 "use strict"; 31341 31342 exports.__esModule = true; 31343 exports.runtimeProperty = runtimeProperty; 31344 exports.isReference = isReference; 31345 31346 var _babelTypes = __webpack_require__(1); 31347 31348 var t = _interopRequireWildcard(_babelTypes); 31349 31350 function _interopRequireWildcard(obj) { 31351 if (obj && obj.__esModule) { 31352 return obj; 31353 } else { 31354 var newObj = {};if (obj != null) { 31355 for (var key in obj) { 31356 if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; 31357 } 31358 }newObj.default = obj;return newObj; 31359 } 31360 } 31361 31362 function runtimeProperty(name) { 31363 return t.memberExpression(t.identifier("regeneratorRuntime"), t.identifier(name), false); 31364 } /** 31365 * Copyright (c) 2014, Facebook, Inc. 31366 * All rights reserved. 31367 * 31368 * This source code is licensed under the BSD-style license found in the 31369 * https://raw.github.com/facebook/regenerator/master/LICENSE file. An 31370 * additional grant of patent rights can be found in the PATENTS file in 31371 * the same directory. 31372 */ 31373 31374 function isReference(path) { 31375 return path.isReferenced() || path.parentPath.isAssignmentExpression({ left: path.node }); 31376 } 31377 31378/***/ }, 31379/* 281 */ 31380/***/ function(module, exports) { 31381 31382 'use strict'; 31383 31384 module.exports = function (str) { 31385 var isExtendedLengthPath = /^\\\\\?\\/.test(str); 31386 var hasNonAscii = /[^\x00-\x80]+/.test(str); 31387 31388 if (isExtendedLengthPath || hasNonAscii) { 31389 return str; 31390 } 31391 31392 return str.replace(/\\/g, '/'); 31393 }; 31394 31395/***/ }, 31396/* 282 */ 31397/***/ function(module, exports, __webpack_require__) { 31398 31399 'use strict'; 31400 31401 /* -*- Mode: js; js-indent-level: 2; -*- */ 31402 /* 31403 * Copyright 2011 Mozilla Foundation and contributors 31404 * Licensed under the New BSD license. See LICENSE or: 31405 * http://opensource.org/licenses/BSD-3-Clause 31406 */ 31407 31408 var util = __webpack_require__(61); 31409 var has = Object.prototype.hasOwnProperty; 31410 31411 /** 31412 * A data structure which is a combination of an array and a set. Adding a new 31413 * member is O(1), testing for membership is O(1), and finding the index of an 31414 * element is O(1). Removing elements from the set is not supported. Only 31415 * strings are supported for membership. 31416 */ 31417 function ArraySet() { 31418 this._array = []; 31419 this._set = Object.create(null); 31420 } 31421 31422 /** 31423 * Static method for creating ArraySet instances from an existing array. 31424 */ 31425 ArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) { 31426 var set = new ArraySet(); 31427 for (var i = 0, len = aArray.length; i < len; i++) { 31428 set.add(aArray[i], aAllowDuplicates); 31429 } 31430 return set; 31431 }; 31432 31433 /** 31434 * Return how many unique items are in this ArraySet. If duplicates have been 31435 * added, than those do not count towards the size. 31436 * 31437 * @returns Number 31438 */ 31439 ArraySet.prototype.size = function ArraySet_size() { 31440 return Object.getOwnPropertyNames(this._set).length; 31441 }; 31442 31443 /** 31444 * Add the given string to this set. 31445 * 31446 * @param String aStr 31447 */ 31448 ArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) { 31449 var sStr = util.toSetString(aStr); 31450 var isDuplicate = has.call(this._set, sStr); 31451 var idx = this._array.length; 31452 if (!isDuplicate || aAllowDuplicates) { 31453 this._array.push(aStr); 31454 } 31455 if (!isDuplicate) { 31456 this._set[sStr] = idx; 31457 } 31458 }; 31459 31460 /** 31461 * Is the given string a member of this set? 31462 * 31463 * @param String aStr 31464 */ 31465 ArraySet.prototype.has = function ArraySet_has(aStr) { 31466 var sStr = util.toSetString(aStr); 31467 return has.call(this._set, sStr); 31468 }; 31469 31470 /** 31471 * What is the index of the given string in the array? 31472 * 31473 * @param String aStr 31474 */ 31475 ArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) { 31476 var sStr = util.toSetString(aStr); 31477 if (has.call(this._set, sStr)) { 31478 return this._set[sStr]; 31479 } 31480 throw new Error('"' + aStr + '" is not in the set.'); 31481 }; 31482 31483 /** 31484 * What is the element at the given index? 31485 * 31486 * @param Number aIdx 31487 */ 31488 ArraySet.prototype.at = function ArraySet_at(aIdx) {
vendor: 13,083 bytes, lines 31489-31859
31489 if (aIdx >= 0 && aIdx < this._array.length) { 31490 return this._array[aIdx]; 31491 } 31492 throw new Error('No element indexed by ' + aIdx); 31493 }; 31494 31495 /** 31496 * Returns the array representation of this set (which has the proper indices 31497 * indicated by indexOf). Note that this is a copy of the internal array used 31498 * for storing the members so that no one can mess with internal state. 31499 */ 31500 ArraySet.prototype.toArray = function ArraySet_toArray() { 31501 return this._array.slice(); 31502 }; 31503 31504 exports.ArraySet = ArraySet; 31505 31506/***/ }, 31507/* 283 */ 31508/***/ function(module, exports, __webpack_require__) { 31509 31510 "use strict"; 31511 31512 /* -*- Mode: js; js-indent-level: 2; -*- */ 31513 /* 31514 * Copyright 2011 Mozilla Foundation and contributors 31515 * Licensed under the New BSD license. See LICENSE or: 31516 * http://opensource.org/licenses/BSD-3-Clause 31517 * 31518 * Based on the Base 64 VLQ implementation in Closure Compiler: 31519 * https://code.google.com/p/closure-compiler/source/browse/trunk/src/com/google/debugging/sourcemap/Base64VLQ.java 31520 * 31521 * Copyright 2011 The Closure Compiler Authors. All rights reserved. 31522 * Redistribution and use in source and binary forms, with or without 31523 * modification, are permitted provided that the following conditions are 31524 * met: 31525 * 31526 * * Redistributions of source code must retain the above copyright 31527 * notice, this list of conditions and the following disclaimer. 31528 * * Redistributions in binary form must reproduce the above 31529 * copyright notice, this list of conditions and the following 31530 * disclaimer in the documentation and/or other materials provided 31531 * with the distribution. 31532 * * Neither the name of Google Inc. nor the names of its 31533 * contributors may be used to endorse or promote products derived 31534 * from this software without specific prior written permission. 31535 * 31536 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 31537 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 31538 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 31539 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 31540 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 31541 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 31542 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 31543 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 31544 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 31545 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 31546 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31547 */ 31548 31549 var base64 = __webpack_require__(604); 31550 31551 // A single base 64 digit can contain 6 bits of data. For the base 64 variable 31552 // length quantities we use in the source map spec, the first bit is the sign, 31553 // the next four bits are the actual value, and the 6th bit is the 31554 // continuation bit. The continuation bit tells us whether there are more 31555 // digits in this value following this digit. 31556 // 31557 // Continuation 31558 // | Sign 31559 // | | 31560 // V V 31561 // 101011 31562 31563 var VLQ_BASE_SHIFT = 5; 31564 31565 // binary: 100000 31566 var VLQ_BASE = 1 << VLQ_BASE_SHIFT; 31567 31568 // binary: 011111 31569 var VLQ_BASE_MASK = VLQ_BASE - 1; 31570 31571 // binary: 100000 31572 var VLQ_CONTINUATION_BIT = VLQ_BASE; 31573 31574 /** 31575 * Converts from a two-complement value to a value where the sign bit is 31576 * placed in the least significant bit. For example, as decimals: 31577 * 1 becomes 2 (10 binary), -1 becomes 3 (11 binary) 31578 * 2 becomes 4 (100 binary), -2 becomes 5 (101 binary) 31579 */ 31580 function toVLQSigned(aValue) { 31581 return aValue < 0 ? (-aValue << 1) + 1 : (aValue << 1) + 0; 31582 } 31583 31584 /** 31585 * Converts to a two-complement value from a value where the sign bit is 31586 * placed in the least significant bit. For example, as decimals: 31587 * 2 (10 binary) becomes 1, 3 (11 binary) becomes -1 31588 * 4 (100 binary) becomes 2, 5 (101 binary) becomes -2 31589 */ 31590 function fromVLQSigned(aValue) { 31591 var isNegative = (aValue & 1) === 1; 31592 var shifted = aValue >> 1; 31593 return isNegative ? -shifted : shifted; 31594 } 31595 31596 /** 31597 * Returns the base 64 VLQ encoded value. 31598 */ 31599 exports.encode = function base64VLQ_encode(aValue) { 31600 var encoded = ""; 31601 var digit; 31602 31603 var vlq = toVLQSigned(aValue); 31604 31605 do { 31606 digit = vlq & VLQ_BASE_MASK; 31607 vlq >>>= VLQ_BASE_SHIFT; 31608 if (vlq > 0) { 31609 // There are still more digits in this value, so we must make sure the 31610 // continuation bit is marked. 31611 digit |= VLQ_CONTINUATION_BIT; 31612 } 31613 encoded += base64.encode(digit); 31614 } while (vlq > 0); 31615 31616 return encoded; 31617 }; 31618 31619 /** 31620 * Decodes the next base 64 VLQ value from the given string and returns the 31621 * value and the rest of the string via the out parameter. 31622 */ 31623 exports.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) { 31624 var strLen = aStr.length; 31625 var result = 0; 31626 var shift = 0; 31627 var continuation, digit; 31628 31629 do { 31630 if (aIndex >= strLen) { 31631 throw new Error("Expected more digits in base 64 VLQ value."); 31632 } 31633 31634 digit = base64.decode(aStr.charCodeAt(aIndex++)); 31635 if (digit === -1) { 31636 throw new Error("Invalid base64 digit: " + aStr.charAt(aIndex - 1)); 31637 } 31638 31639 continuation = !!(digit & VLQ_CONTINUATION_BIT); 31640 digit &= VLQ_BASE_MASK; 31641 result = result + (digit << shift); 31642 shift += VLQ_BASE_SHIFT; 31643 } while (continuation); 31644 31645 aOutParam.value = fromVLQSigned(result); 31646 aOutParam.rest = aIndex; 31647 }; 31648 31649/***/ }, 31650/* 284 */ 31651/***/ function(module, exports, __webpack_require__) { 31652 31653 'use strict'; 31654 31655 /* -*- Mode: js; js-indent-level: 2; -*- */ 31656 /* 31657 * Copyright 2011 Mozilla Foundation and contributors 31658 * Licensed under the New BSD license. See LICENSE or: 31659 * http://opensource.org/licenses/BSD-3-Clause 31660 */ 31661 31662 var base64VLQ = __webpack_require__(283); 31663 var util = __webpack_require__(61); 31664 var ArraySet = __webpack_require__(282).ArraySet; 31665 var MappingList = __webpack_require__(606).MappingList; 31666 31667 /** 31668 * An instance of the SourceMapGenerator represents a source map which is 31669 * being built incrementally. You may pass an object with the following 31670 * properties: 31671 * 31672 * - file: The filename of the generated source. 31673 * - sourceRoot: A root for all relative URLs in this source map. 31674 */ 31675 function SourceMapGenerator(aArgs) { 31676 if (!aArgs) { 31677 aArgs = {}; 31678 } 31679 this._file = util.getArg(aArgs, 'file', null); 31680 this._sourceRoot = util.getArg(aArgs, 'sourceRoot', null); 31681 this._skipValidation = util.getArg(aArgs, 'skipValidation', false); 31682 this._sources = new ArraySet(); 31683 this._names = new ArraySet(); 31684 this._mappings = new MappingList(); 31685 this._sourcesContents = null; 31686 } 31687 31688 SourceMapGenerator.prototype._version = 3; 31689 31690 /** 31691 * Creates a new SourceMapGenerator based on a SourceMapConsumer 31692 * 31693 * @param aSourceMapConsumer The SourceMap. 31694 */ 31695 SourceMapGenerator.fromSourceMap = function SourceMapGenerator_fromSourceMap(aSourceMapConsumer) { 31696 var sourceRoot = aSourceMapConsumer.sourceRoot; 31697 var generator = new SourceMapGenerator({ 31698 file: aSourceMapConsumer.file, 31699 sourceRoot: sourceRoot 31700 }); 31701 aSourceMapConsumer.eachMapping(function (mapping) { 31702 var newMapping = { 31703 generated: { 31704 line: mapping.generatedLine, 31705 column: mapping.generatedColumn 31706 } 31707 }; 31708 31709 if (mapping.source != null) { 31710 newMapping.source = mapping.source; 31711 if (sourceRoot != null) { 31712 newMapping.source = util.relative(sourceRoot, newMapping.source); 31713 } 31714 31715 newMapping.original = { 31716 line: mapping.originalLine, 31717 column: mapping.originalColumn 31718 }; 31719 31720 if (mapping.name != null) { 31721 newMapping.name = mapping.name; 31722 } 31723 } 31724 31725 generator.addMapping(newMapping); 31726 }); 31727 aSourceMapConsumer.sources.forEach(function (sourceFile) { 31728 var content = aSourceMapConsumer.sourceContentFor(sourceFile); 31729 if (content != null) { 31730 generator.setSourceContent(sourceFile, content); 31731 } 31732 }); 31733 return generator; 31734 }; 31735 31736 /** 31737 * Add a single mapping from original source line and column to the generated 31738 * source's line and column for this source map being created. The mapping 31739 * object should have the following properties: 31740 * 31741 * - generated: An object with the generated line and column positions. 31742 * - original: An object with the original line and column positions. 31743 * - source: The original source file (relative to the sourceRoot). 31744 * - name: An optional original token name for this mapping. 31745 */ 31746 SourceMapGenerator.prototype.addMapping = function SourceMapGenerator_addMapping(aArgs) { 31747 var generated = util.getArg(aArgs, 'generated'); 31748 var original = util.getArg(aArgs, 'original', null); 31749 var source = util.getArg(aArgs, 'source', null); 31750 var name = util.getArg(aArgs, 'name', null); 31751 31752 if (!this._skipValidation) { 31753 this._validateMapping(generated, original, source, name); 31754 } 31755 31756 if (source != null) { 31757 source = String(source); 31758 if (!this._sources.has(source)) { 31759 this._sources.add(source); 31760 } 31761 } 31762 31763 if (name != null) { 31764 name = String(name); 31765 if (!this._names.has(name)) { 31766 this._names.add(name); 31767 } 31768 } 31769 31770 this._mappings.add({ 31771 generatedLine: generated.line, 31772 generatedColumn: generated.column, 31773 originalLine: original != null && original.line, 31774 originalColumn: original != null && original.column, 31775 source: source, 31776 name: name 31777 }); 31778 }; 31779 31780 /** 31781 * Set the source content for a source file. 31782 */ 31783 SourceMapGenerator.prototype.setSourceContent = function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) { 31784 var source = aSourceFile; 31785 if (this._sourceRoot != null) { 31786 source = util.relative(this._sourceRoot, source); 31787 } 31788 31789 if (aSourceContent != null) { 31790 // Add the source content to the _sourcesContents map. 31791 // Create a new _sourcesContents map if the property is null. 31792 if (!this._sourcesContents) { 31793 this._sourcesContents = Object.create(null); 31794 } 31795 this._sourcesContents[util.toSetString(source)] = aSourceContent; 31796 } else if (this._sourcesContents) { 31797 // Remove the source file from the _sourcesContents map. 31798 // If the _sourcesContents map is empty, set the property to null. 31799 delete this._sourcesContents[util.toSetString(source)]; 31800 if (Object.keys(this._sourcesContents).length === 0) { 31801 this._sourcesContents = null; 31802 } 31803 } 31804 }; 31805 31806 /** 31807 * Applies the mappings of a sub-source-map for a specific source file to the 31808 * source map being generated. Each mapping to the supplied source file is 31809 * rewritten using the supplied source map. Note: The resolution for the 31810 * resulting mappings is the minimium of this map and the supplied map. 31811 * 31812 * @param aSourceMapConsumer The source map to be applied. 31813 * @param aSourceFile Optional. The filename of the source file. 31814 * If omitted, SourceMapConsumer's file property will be used. 31815 * @param aSourceMapPath Optional. The dirname of the path to the source map 31816 * to be applied. If relative, it is relative to the SourceMapConsumer. 31817 * This parameter is needed when the two source maps aren't in the same 31818 * directory, and the source map to be applied contains relative source 31819 * paths. If so, those relative source paths need to be rewritten 31820 * relative to the SourceMapGenerator. 31821 */ 31822 SourceMapGenerator.prototype.applySourceMap = function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) { 31823 var sourceFile = aSourceFile; 31824 // If aSourceFile is omitted, we will use the file property of the SourceMap 31825 if (aSourceFile == null) { 31826 if (aSourceMapConsumer.file == null) { 31827 throw new Error('SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, ' + 'or the source map\'s "file" property. Both were omitted.'); 31828 } 31829 sourceFile = aSourceMapConsumer.file; 31830 } 31831 var sourceRoot = this._sourceRoot; 31832 // Make "sourceFile" relative if an absolute Url is passed. 31833 if (sourceRoot != null) { 31834 sourceFile = util.relative(sourceRoot, sourceFile); 31835 } 31836 // Applying the SourceMap can add and remove items from the sources and 31837 // the names array. 31838 var newSources = new ArraySet(); 31839 var newNames = new ArraySet(); 31840 31841 // Find mappings for the "sourceFile" 31842 this._mappings.unsortedForEach(function (mapping) { 31843 if (mapping.source === sourceFile && mapping.originalLine != null) { 31844 // Check if it can be mapped by the source map, then update the mapping. 31845 var original = aSourceMapConsumer.originalPositionFor({ 31846 line: mapping.originalLine, 31847 column: mapping.originalColumn 31848 }); 31849 if (original.source != null) { 31850 // Copy mapping 31851 mapping.source = original.source; 31852 if (aSourceMapPath != null) { 31853 mapping.source = util.join(aSourceMapPath, mapping.source); 31854 } 31855 if (sourceRoot != null) { 31856 mapping.source = util.relative(sourceRoot, mapping.source); 31857 } 31858 mapping.originalLine = original.line; 31859 mapping.originalColumn = original.column;
vendor: 5,859 bytes, lines 31860-32045
31860 if (original.name != null) { 31861 mapping.name = original.name; 31862 } 31863 } 31864 } 31865 31866 var source = mapping.source; 31867 if (source != null && !newSources.has(source)) { 31868 newSources.add(source); 31869 } 31870 31871 var name = mapping.name; 31872 if (name != null && !newNames.has(name)) { 31873 newNames.add(name); 31874 } 31875 }, this); 31876 this._sources = newSources; 31877 this._names = newNames; 31878 31879 // Copy sourcesContents of applied map. 31880 aSourceMapConsumer.sources.forEach(function (sourceFile) { 31881 var content = aSourceMapConsumer.sourceContentFor(sourceFile); 31882 if (content != null) { 31883 if (aSourceMapPath != null) { 31884 sourceFile = util.join(aSourceMapPath, sourceFile); 31885 } 31886 if (sourceRoot != null) { 31887 sourceFile = util.relative(sourceRoot, sourceFile); 31888 } 31889 this.setSourceContent(sourceFile, content); 31890 } 31891 }, this); 31892 }; 31893 31894 /** 31895 * A mapping can have one of the three levels of data: 31896 * 31897 * 1. Just the generated position. 31898 * 2. The Generated position, original position, and original source. 31899 * 3. Generated and original position, original source, as well as a name 31900 * token. 31901 * 31902 * To maintain consistency, we validate that any new mapping being added falls 31903 * in to one of these categories. 31904 */ 31905 SourceMapGenerator.prototype._validateMapping = function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource, aName) { 31906 if (aGenerated && 'line' in aGenerated && 'column' in aGenerated && aGenerated.line > 0 && aGenerated.column >= 0 && !aOriginal && !aSource && !aName) { 31907 // Case 1. 31908 return; 31909 } 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) { 31910 // Cases 2 and 3. 31911 return; 31912 } else { 31913 throw new Error('Invalid mapping: ' + JSON.stringify({ 31914 generated: aGenerated, 31915 source: aSource, 31916 original: aOriginal, 31917 name: aName 31918 })); 31919 } 31920 }; 31921 31922 /** 31923 * Serialize the accumulated mappings in to the stream of base 64 VLQs 31924 * specified by the source map format. 31925 */ 31926 SourceMapGenerator.prototype._serializeMappings = function SourceMapGenerator_serializeMappings() { 31927 var previousGeneratedColumn = 0; 31928 var previousGeneratedLine = 1; 31929 var previousOriginalColumn = 0; 31930 var previousOriginalLine = 0; 31931 var previousName = 0; 31932 var previousSource = 0; 31933 var result = ''; 31934 var next; 31935 var mapping; 31936 var nameIdx; 31937 var sourceIdx; 31938 31939 var mappings = this._mappings.toArray(); 31940 for (var i = 0, len = mappings.length; i < len; i++) { 31941 mapping = mappings[i]; 31942 next = ''; 31943 31944 if (mapping.generatedLine !== previousGeneratedLine) { 31945 previousGeneratedColumn = 0; 31946 while (mapping.generatedLine !== previousGeneratedLine) { 31947 next += ';'; 31948 previousGeneratedLine++; 31949 } 31950 } else { 31951 if (i > 0) { 31952 if (!util.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) { 31953 continue; 31954 } 31955 next += ','; 31956 } 31957 } 31958 31959 next += base64VLQ.encode(mapping.generatedColumn - previousGeneratedColumn); 31960 previousGeneratedColumn = mapping.generatedColumn; 31961 31962 if (mapping.source != null) { 31963 sourceIdx = this._sources.indexOf(mapping.source); 31964 next += base64VLQ.encode(sourceIdx - previousSource); 31965 previousSource = sourceIdx; 31966 31967 // lines are stored 0-based in SourceMap spec version 3 31968 next += base64VLQ.encode(mapping.originalLine - 1 - previousOriginalLine); 31969 previousOriginalLine = mapping.originalLine - 1; 31970 31971 next += base64VLQ.encode(mapping.originalColumn - previousOriginalColumn); 31972 previousOriginalColumn = mapping.originalColumn; 31973 31974 if (mapping.name != null) { 31975 nameIdx = this._names.indexOf(mapping.name); 31976 next += base64VLQ.encode(nameIdx - previousName); 31977 previousName = nameIdx; 31978 } 31979 } 31980 31981 result += next; 31982 } 31983 31984 return result; 31985 }; 31986 31987 SourceMapGenerator.prototype._generateSourcesContent = function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) { 31988 return aSources.map(function (source) { 31989 if (!this._sourcesContents) { 31990 return null; 31991 } 31992 if (aSourceRoot != null) { 31993 source = util.relative(aSourceRoot, source); 31994 } 31995 var key = util.toSetString(source); 31996 return Object.prototype.hasOwnProperty.call(this._sourcesContents, key) ? this._sourcesContents[key] : null; 31997 }, this); 31998 }; 31999 32000 /** 32001 * Externalize the source map. 32002 */ 32003 SourceMapGenerator.prototype.toJSON = function SourceMapGenerator_toJSON() { 32004 var map = { 32005 version: this._version, 32006 sources: this._sources.toArray(), 32007 names: this._names.toArray(), 32008 mappings: this._serializeMappings() 32009 }; 32010 if (this._file != null) { 32011 map.file = this._file; 32012 } 32013 if (this._sourceRoot != null) { 32014 map.sourceRoot = this._sourceRoot; 32015 } 32016 if (this._sourcesContents) { 32017 map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot); 32018 } 32019 32020 return map; 32021 }; 32022 32023 /** 32024 * Render the source map being generated to a string. 32025 */ 32026 SourceMapGenerator.prototype.toString = function SourceMapGenerator_toString() { 32027 return JSON.stringify(this.toJSON()); 32028 }; 32029 32030 exports.SourceMapGenerator = SourceMapGenerator; 32031 32032/***/ }, 32033/* 285 */ 32034/***/ function(module, exports, __webpack_require__) { 32035 32036 'use strict'; 32037 32038 /* 32039 * Copyright 2009-2011 Mozilla Foundation and contributors 32040 * Licensed under the New BSD license. See LICENSE.txt or: 32041 * http://opensource.org/licenses/BSD-3-Clause 32042 */ 32043 exports.SourceMapGenerator = __webpack_require__(284).SourceMapGenerator; 32044 exports.SourceMapConsumer = __webpack_require__(608).SourceMapConsumer; 32045 exports.SourceNode = __webpack_require__(609).SourceNode;
32046 32047/***/ }, 32048/* 286 */ 32049/***/ function(module, exports, __webpack_require__) { 32050 32051 /* WEBPACK VAR INJECTION */(function(module) {'use strict'; 32052 32053 function assembleStyles() { 32054 var styles = { 32055 modifiers: { 32056 reset: [0, 0], 32057 bold: [1, 22], // 21 isn't widely supported and 22 does the same thing 32058 dim: [2, 22], 32059 italic: [3, 23], 32060 underline: [4, 24], 32061 inverse: [7, 27], 32062 hidden: [8, 28], 32063 strikethrough: [9, 29] 32064 }, 32065 colors: { 32066 black: [30, 39], 32067 red: [31, 39], 32068 green: [32, 39], 32069 yellow: [33, 39], 32070 blue: [34, 39], 32071 magenta: [35, 39], 32072 cyan: [36, 39], 32073 white: [37, 39], 32074 gray: [90, 39] 32075 }, 32076 bgColors: { 32077 bgBlack: [40, 49], 32078 bgRed: [41, 49], 32079 bgGreen: [42, 49], 32080 bgYellow: [43, 49], 32081 bgBlue: [44, 49], 32082 bgMagenta: [45, 49], 32083 bgCyan: [46, 49], 32084 bgWhite: [47, 49] 32085 } 32086 }; 32087 32088 // fix humans 32089 styles.colors.grey = styles.colors.gray; 32090 32091 Object.keys(styles).forEach(function (groupName) { 32092 var group = styles[groupName]; 32093 32094 Object.keys(group).forEach(function (styleName) { 32095 var style = group[styleName]; 32096 32097 styles[styleName] = group[styleName] = { 32098 open: '\x1B[' + style[0] + 'm', 32099 close: '\x1B[' + style[1] + 'm' 32100 }; 32101 }); 32102 32103 Object.defineProperty(styles, groupName, { 32104 value: group, 32105 enumerable: false 32106 }); 32107 }); 32108 32109 return styles; 32110 } 32111 32112 Object.defineProperty(module, 'exports', { 32113 enumerable: true, 32114 get: assembleStyles 32115 }); 32116 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(39)(module))) 32117 32118/***/ }, 32119/* 287 */ 32120/***/ function(module, exports, __webpack_require__) { 32121 32122 "use strict"; 32123 32124 module.exports = __webpack_require__(178); 32125 32126/***/ }, 32127/* 288 */ 32128/***/ function(module, exports) { 32129 32130 "use strict"; 32131 32132 exports.__esModule = true; 32133 exports.default = getPossiblePluginNames; 32134 function getPossiblePluginNames(pluginName) { 32135 return ["babel-plugin-" + pluginName, pluginName]; 32136 } 32137 module.exports = exports["default"]; 32138 32139/***/ }, 32140/* 289 */ 32141/***/ function(module, exports) { 32142 32143 "use strict"; 32144 32145 exports.__esModule = true; 32146 exports.default = getPossiblePresetNames; 32147 function getPossiblePresetNames(presetName) { 32148 var possibleNames = ["babel-preset-" + presetName, presetName]; 32149 32150 var matches = presetName.match(/^(@[^/]+)\/(.+)$/); 32151 if (matches) { 32152 var orgName = matches[1], 32153 presetPath = matches[2]; 32154 32155 possibleNames.push(orgName + "/babel-preset-" + presetPath); 32156 } 32157 32158 return possibleNames; 32159 } 32160 module.exports = exports["default"]; 32161 32162/***/ }, 32163/* 290 */ 32164/***/ function(module, exports, __webpack_require__) { 32165 32166 "use strict"; 32167 32168 exports.__esModule = true; 32169 32170 var _getIterator2 = __webpack_require__(2); 32171 32172 var _getIterator3 = _interopRequireDefault(_getIterator2); 32173 32174 exports.default = function (dest, src) { 32175 if (!dest || !src) return; 32176 32177 return (0, _mergeWith2.default)(dest, src, function (a, b) { 32178 if (b && Array.isArray(a)) { 32179 var newArray = b.slice(0); 32180 32181 for (var _iterator = a, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) { 32182 var _ref; 32183 32184 if (_isArray) { 32185 if (_i >= _iterator.length) break; 32186 _ref = _iterator[_i++]; 32187 } else { 32188 _i = _iterator.next(); 32189 if (_i.done) break; 32190 _ref = _i.value; 32191 } 32192 32193 var item = _ref; 32194 32195 if (newArray.indexOf(item) < 0) { 32196 newArray.push(item); 32197 } 32198 } 32199 32200 return newArray; 32201 } 32202 }); 32203 }; 32204 32205 var _mergeWith = __webpack_require__(579); 32206 32207 var _mergeWith2 = _interopRequireDefault(_mergeWith); 32208 32209 function _interopRequireDefault(obj) { 32210 return obj && obj.__esModule ? obj : { default: obj }; 32211 } 32212 32213 module.exports = exports["default"]; 32214 32215/***/ }, 32216/* 291 */ 32217/***/ function(module, exports, __webpack_require__) { 32218 32219 "use strict"; 32220 32221 exports.__esModule = true; 32222 32223 exports.default = function (ast, comments, tokens) { 32224 if (ast) { 32225 if (ast.type === "Program") { 32226 return t.file(ast, comments || [], tokens || []); 32227 } else if (ast.type === "File") { 32228 return ast; 32229 } 32230 } 32231 32232 throw new Error("Not a valid ast?"); 32233 }; 32234 32235 var _babelTypes = __webpack_require__(1); 32236 32237 var t = _interopRequireWildcard(_babelTypes); 32238 32239 function _interopRequireWildcard(obj) { 32240 if (obj && obj.__esModule) { 32241 return obj; 32242 } else { 32243 var newObj = {};if (obj != null) { 32244 for (var key in obj) { 32245 if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; 32246 } 32247 }newObj.default = obj;return newObj; 32248 } 32249 } 32250 32251 module.exports = exports["default"]; 32252 32253/***/ }, 32254/* 292 */ 32255/***/ function(module, exports, __webpack_require__) { 32256 32257 "use strict"; 32258 32259 exports.__esModule = true; 32260 32261 exports.default = function (whitelist) { 32262 var outputType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "global"; 32263 32264 var namespace = t.identifier("babelHelpers"); 32265 32266 var builder = function builder(body) { 32267 return buildHelpers(body, namespace, whitelist); 32268 }; 32269 32270 var tree = void 0; 32271 32272 var build = { 32273 global: buildGlobal, 32274 umd: buildUmd, 32275 var: buildVar 32276 }[outputType]; 32277 32278 if (build) { 32279 tree = build(namespace, builder); 32280 } else { 32281 throw new Error(messages.get("unsupportedOutputType", outputType)); 32282 } 32283 32284 return (0, _babelGenerator2.default)(tree).code;
32285 }; 32286 32287 var _babelHelpers = __webpack_require__(191); 32288 32289 var helpers = _interopRequireWildcard(_babelHelpers); 32290 32291 var _babelGenerator = __webpack_require__(182); 32292 32293 var _babelGenerator2 = _interopRequireDefault(_babelGenerator); 32294 32295 var _babelMessages = __webpack_require__(18); 32296 32297 var messages = _interopRequireWildcard(_babelMessages); 32298 32299 var _babelTemplate = __webpack_require__(4); 32300 32301 var _babelTemplate2 = _interopRequireDefault(_babelTemplate); 32302 32303 var _babelTypes = __webpack_require__(1); 32304 32305 var t = _interopRequireWildcard(_babelTypes); 32306 32307 function _interopRequireDefault(obj) { 32308 return obj && obj.__esModule ? obj : { default: obj }; 32309 } 32310 32311 function _interopRequireWildcard(obj) { 32312 if (obj && obj.__esModule) { 32313 return obj; 32314 } else { 32315 var newObj = {};if (obj != null) { 32316 for (var key in obj) { 32317 if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; 32318 } 32319 }newObj.default = obj;return newObj; 32320 } 32321 } 32322 32323 var buildUmdWrapper = (0, _babelTemplate2.default)("\n (function (root, factory) {\n if (typeof define === \"function\" && define.amd) {\n define(AMD_ARGUMENTS, factory);\n } else if (typeof exports === \"object\") {\n factory(COMMON_ARGUMENTS);\n } else {\n factory(BROWSER_ARGUMENTS);\n }\n })(UMD_ROOT, function (FACTORY_PARAMETERS) {\n FACTORY_BODY\n });\n"); 32324 32325 function buildGlobal(namespace, builder) { 32326 var body = []; 32327 var container = t.functionExpression(null, [t.identifier("global")], t.blockStatement(body)); 32328 var tree = t.program([t.expressionStatement(t.callExpression(container, [helpers.get("selfGlobal")]))]); 32329 32330 body.push(t.variableDeclaration("var", [t.variableDeclarator(namespace, t.assignmentExpression("=", t.memberExpression(t.identifier("global"), namespace), t.objectExpression([])))])); 32331 32332 builder(body); 32333 32334 return tree; 32335 } 32336 32337 function buildUmd(namespace, builder) { 32338 var body = []; 32339 body.push(t.variableDeclaration("var", [t.variableDeclarator(namespace, t.identifier("global"))])); 32340 32341 builder(body); 32342 32343 return t.program([buildUmdWrapper({ 32344 FACTORY_PARAMETERS: t.identifier("global"), 32345 BROWSER_ARGUMENTS: t.assignmentExpression("=", t.memberExpression(t.identifier("root"), namespace), t.objectExpression([])), 32346 COMMON_ARGUMENTS: t.identifier("exports"), 32347 AMD_ARGUMENTS: t.arrayExpression([t.stringLiteral("exports")]), 32348 FACTORY_BODY: body, 32349 UMD_ROOT: t.identifier("this") 32350 })]); 32351 } 32352 32353 function buildVar(namespace, builder) { 32354 var body = []; 32355 body.push(t.variableDeclaration("var", [t.variableDeclarator(namespace, t.objectExpression([]))])); 32356 builder(body); 32357 body.push(t.expressionStatement(namespace)); 32358 return t.program(body); 32359 } 32360 32361 function buildHelpers(body, namespace, whitelist) { 32362 helpers.list.forEach(function (name) { 32363 if (whitelist && whitelist.indexOf(name) < 0) return; 32364 32365 var key = t.identifier(name); 32366 body.push(t.expressionStatement(t.assignmentExpression("=", t.memberExpression(namespace, key), helpers.get(name)))); 32367 }); 32368 } 32369 module.exports = exports["default"]; 32370 32371/***/ }, 32372/* 293 */ 32373/***/ function(module, exports, __webpack_require__) { 32374 32375 "use strict"; 32376 32377 exports.__esModule = true; 32378 32379 var _plugin = __webpack_require__(63); 32380 32381 var _plugin2 = _interopRequireDefault(_plugin); 32382 32383 var _sortBy = __webpack_require__(583); 32384 32385 var _sortBy2 = _interopRequireDefault(_sortBy); 32386 32387 function _interopRequireDefault(obj) { 32388 return obj && obj.__esModule ? obj : { default: obj }; 32389 } 32390 32391 exports.default = new _plugin2.default({ 32392 32393 name: "internal.blockHoist", 32394 32395 visitor: { 32396 Block: { 32397 exit: function exit(_ref) { 32398 var node = _ref.node; 32399 32400 var hasChange = false; 32401 for (var i = 0; i < node.body.length; i++) { 32402 var bodyNode = node.body[i]; 32403 if (bodyNode && bodyNode._blockHoist != null) { 32404 hasChange = true; 32405 break; 32406 } 32407 } 32408 if (!hasChange) return; 32409 32410 node.body = (0, _sortBy2.default)(node.body, function (bodyNode) { 32411 var priority = bodyNode && bodyNode._blockHoist; 32412 if (priority == null) priority = 1; 32413 if (priority === true) priority = 2; 32414 32415 return -1 * priority; 32416 }); 32417 } 32418 } 32419 } 32420 }); 32421 module.exports = exports["default"]; 32422 32423/***/ }, 32424/* 294 */ 32425/***/ function(module, exports, __webpack_require__) { 32426 32427 "use strict"; 32428 32429 exports.__esModule = true; 32430 32431 var _symbol = __webpack_require__(11); 32432 32433 var _symbol2 = _interopRequireDefault(_symbol); 32434 32435 var _plugin = __webpack_require__(63); 32436 32437 var _plugin2 = _interopRequireDefault(_plugin); 32438 32439 var _babelTypes = __webpack_require__(1); 32440 32441 var t = _interopRequireWildcard(_babelTypes); 32442 32443 function _interopRequireWildcard(obj) { 32444 if (obj && obj.__esModule) { 32445 return obj; 32446 } else { 32447 var newObj = {};if (obj != null) { 32448 for (var key in obj) { 32449 if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; 32450 } 32451 }newObj.default = obj;return newObj; 32452 } 32453 } 32454 32455 function _interopRequireDefault(obj) { 32456 return obj && obj.__esModule ? obj : { default: obj }; 32457 } 32458 32459 var SUPER_THIS_BOUND = (0, _symbol2.default)("super this bound"); 32460 32461 var superVisitor = { 32462 CallExpression: function CallExpression(path) { 32463 if (!path.get("callee").isSuper()) return; 32464 32465 var node = path.node; 32466 32467 if (node[SUPER_THIS_BOUND]) return; 32468 node[SUPER_THIS_BOUND] = true; 32469 32470 path.replaceWith(t.assignmentExpression("=", this.id, node)); 32471 } 32472 }; 32473 32474 exports.default = new _plugin2.default({ 32475 name: "internal.shadowFunctions", 32476 32477 visitor: { 32478 ThisExpression: function ThisExpression(path) { 32479 remap(path, "this"); 32480 }, 32481 ReferencedIdentifier: function ReferencedIdentifier(path) { 32482 if (path.node.name === "arguments") { 32483 remap(path, "arguments"); 32484 } 32485 } 32486 } 32487 }); 32488 32489 function shouldShadow(path, shadowPath) { 32490 if (path.is("_forceShadow")) { 32491 return true; 32492 } else { 32493 return shadowPath; 32494 } 32495 } 32496 32497 function remap(path, key) { 32498 var shadowPath = path.inShadow(key); 32499 if (!shouldShadow(path, shadowPath)) return; 32500 32501 var shadowFunction = path.node._shadowedFunctionLiteral; 32502 32503 var currentFunction = void 0; 32504 var passedShadowFunction = false;
32505 32506 var fnPath = path.find(function (innerPath) { 32507 if (innerPath.parentPath && innerPath.parentPath.isClassProperty() && innerPath.key === "value") { 32508 return true; 32509 } 32510 if (path === innerPath) return false; 32511 if (innerPath.isProgram() || innerPath.isFunction()) { 32512 currentFunction = currentFunction || innerPath; 32513 } 32514 32515 if (innerPath.isProgram()) { 32516 passedShadowFunction = true; 32517 32518 return true; 32519 } else if (innerPath.isFunction() && !innerPath.isArrowFunctionExpression()) { 32520 if (shadowFunction) { 32521 if (innerPath === shadowFunction || innerPath.node === shadowFunction.node) return true; 32522 } else { 32523 if (!innerPath.is("shadow")) return true; 32524 } 32525 32526 passedShadowFunction = true; 32527 return false; 32528 } 32529 32530 return false; 32531 }); 32532 32533 if (shadowFunction && fnPath.isProgram() && !shadowFunction.isProgram()) { 32534 fnPath = path.findParent(function (p) { 32535 return p.isProgram() || p.isFunction(); 32536 }); 32537 } 32538 32539 if (fnPath === currentFunction) return; 32540 32541 if (!passedShadowFunction) return; 32542 32543 var cached = fnPath.getData(key); 32544 if (cached) return path.replaceWith(cached); 32545 32546 var id = path.scope.generateUidIdentifier(key); 32547 32548 fnPath.setData(key, id); 32549 32550 var classPath = fnPath.findParent(function (p) { 32551 return p.isClass(); 32552 }); 32553 var hasSuperClass = !!(classPath && classPath.node && classPath.node.superClass); 32554 32555 if (key === "this" && fnPath.isMethod({ kind: "constructor" }) && hasSuperClass) { 32556 fnPath.scope.push({ id: id }); 32557 32558 fnPath.traverse(superVisitor, { id: id }); 32559 } else { 32560 var init = key === "this" ? t.thisExpression() : t.identifier(key); 32561 32562 if (shadowFunction) init._shadowedFunctionLiteral = shadowFunction; 32563 32564 fnPath.scope.push({ id: id, init: init }); 32565 } 32566 32567 return path.replaceWith(id); 32568 } 32569 module.exports = exports["default"]; 32570 32571/***/ }, 32572/* 295 */ 32573/***/ function(module, exports, __webpack_require__) { 32574 32575 "use strict"; 32576 32577 exports.__esModule = true; 32578 32579 var _classCallCheck2 = __webpack_require__(3); 32580 32581 var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); 32582 32583 var _normalizeAst = __webpack_require__(291); 32584 32585 var _normalizeAst2 = _interopRequireDefault(_normalizeAst); 32586 32587 var _plugin = __webpack_require__(63); 32588 32589 var _plugin2 = _interopRequireDefault(_plugin); 32590 32591 var _file = __webpack_require__(49); 32592 32593 var _file2 = _interopRequireDefault(_file); 32594 32595 function _interopRequireDefault(obj) { 32596 return obj && obj.__esModule ? obj : { default: obj }; 32597 } 32598 32599 var Pipeline = function () { 32600 function Pipeline() { 32601 (0, _classCallCheck3.default)(this, Pipeline); 32602 } 32603 32604 Pipeline.prototype.lint = function lint(code) { 32605 var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; 32606 32607 opts.code = false; 32608 opts.mode = "lint"; 32609 return this.transform(code, opts); 32610 }; 32611 32612 Pipeline.prototype.pretransform = function pretransform(code, opts) { 32613 var file = new _file2.default(opts, this); 32614 return file.wrap(code, function () { 32615 file.addCode(code); 32616 file.parseCode(code); 32617 return file; 32618 }); 32619 }; 32620 32621 Pipeline.prototype.transform = function transform(code, opts) { 32622 var file = new _file2.default(opts, this); 32623 return file.wrap(code, function () { 32624 file.addCode(code); 32625 file.parseCode(code); 32626 return file.transform(); 32627 }); 32628 }; 32629 32630 Pipeline.prototype.analyse = function analyse(code) { 32631 var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; 32632 var visitor = arguments[2]; 32633 32634 opts.code = false; 32635 if (visitor) { 32636 opts.plugins = opts.plugins || []; 32637 opts.plugins.push(new _plugin2.default({ visitor: visitor })); 32638 } 32639 return this.transform(code, opts).metadata; 32640 }; 32641 32642 Pipeline.prototype.transformFromAst = function transformFromAst(ast, code, opts) { 32643 ast = (0, _normalizeAst2.default)(ast); 32644 32645 var file = new _file2.default(opts, this); 32646 return file.wrap(code, function () { 32647 file.addCode(code); 32648 file.addAst(ast); 32649 return file.transform(); 32650 }); 32651 }; 32652 32653 return Pipeline; 32654 }(); 32655 32656 exports.default = Pipeline; 32657 module.exports = exports["default"]; 32658 32659/***/ }, 32660/* 296 */ 32661/***/ function(module, exports, __webpack_require__) { 32662 32663 "use strict"; 32664 32665 exports.__esModule = true; 32666 32667 var _classCallCheck2 = __webpack_require__(3); 32668 32669 var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); 32670 32671 var _possibleConstructorReturn2 = __webpack_require__(42); 32672 32673 var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); 32674 32675 var _inherits2 = __webpack_require__(41); 32676 32677 var _inherits3 = _interopRequireDefault(_inherits2); 32678 32679 var _store = __webpack_require__(116); 32680 32681 var _store2 = _interopRequireDefault(_store); 32682 32683 var _file5 = __webpack_require__(49); 32684 32685 var _file6 = _interopRequireDefault(_file5); 32686 32687 function _interopRequireDefault(obj) { 32688 return obj && obj.__esModule ? obj : { default: obj }; 32689 } 32690
32691 var PluginPass = function (_Store) { 32692 (0, _inherits3.default)(PluginPass, _Store); 32693 32694 function PluginPass(file, plugin) { 32695 var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; 32696 (0, _classCallCheck3.default)(this, PluginPass); 32697 32698 var _this = (0, _possibleConstructorReturn3.default)(this, _Store.call(this)); 32699 32700 _this.plugin = plugin; 32701 _this.key = plugin.key; 32702 _this.file = file; 32703 _this.opts = options; 32704 return _this; 32705 } 32706 32707 PluginPass.prototype.addHelper = function addHelper() { 32708 var _file; 32709 32710 return (_file = this.file).addHelper.apply(_file, arguments); 32711 }; 32712 32713 PluginPass.prototype.addImport = function addImport() { 32714 var _file2; 32715 32716 return (_file2 = this.file).addImport.apply(_file2, arguments); 32717 }; 32718 32719 PluginPass.prototype.getModuleName = function getModuleName() { 32720 var _file3; 32721 32722 return (_file3 = this.file).getModuleName.apply(_file3, arguments); 32723 }; 32724 32725 PluginPass.prototype.buildCodeFrameError = function buildCodeFrameError() { 32726 var _file4; 32727 32728 return (_file4 = this.file).buildCodeFrameError.apply(_file4, arguments); 32729 }; 32730 32731 return PluginPass; 32732 }(_store2.default); 32733 32734 exports.default = PluginPass; 32735 module.exports = exports["default"]; 32736 32737/***/ }, 32738/* 297 */ 32739/***/ function(module, exports, __webpack_require__) { 32740 32741 "use strict"; 32742 32743 exports.__esModule = true; 32744 32745 var _classCallCheck2 = __webpack_require__(3); 32746 32747 var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); 32748 32749 var _trimRight = __webpack_require__(613); 32750 32751 var _trimRight2 = _interopRequireDefault(_trimRight); 32752 32753 function _interopRequireDefault(obj) { 32754 return obj && obj.__esModule ? obj : { default: obj }; 32755 } 32756 32757 var SPACES_RE = /^[ \t]+$/; 32758 32759 var Buffer = function () { 32760 function Buffer(map) { 32761 (0, _classCallCheck3.default)(this, Buffer); 32762 this._map = null; 32763 this._buf = []; 32764 this._last = ""; 32765 this._queue = []; 32766 this._position = { 32767 line: 1, 32768 column: 0 32769 }; 32770 this._sourcePosition = { 32771 identifierName: null, 32772 line: null, 32773 column: null, 32774 filename: null 32775 }; 32776 32777 this._map = map; 32778 } 32779 32780 Buffer.prototype.get = function get() { 32781 this._flush(); 32782 32783 var map = this._map; 32784 var result = { 32785 code: (0, _trimRight2.default)(this._buf.join("")), 32786 map: null, 32787 rawMappings: map && map.getRawMappings() 32788 }; 32789 32790 if (map) { 32791 Object.defineProperty(result, "map", { 32792 configurable: true, 32793 enumerable: true, 32794 get: function get() { 32795 return this.map = map.get(); 32796 }, 32797 set: function set(value) { 32798 Object.defineProperty(this, "map", { value: value, writable: true }); 32799 } 32800 }); 32801 } 32802 32803 return result; 32804 }; 32805 32806 Buffer.prototype.append = function append(str) { 32807 this._flush(); 32808 var _sourcePosition = this._sourcePosition, 32809 line = _sourcePosition.line, 32810 column = _sourcePosition.column, 32811 filename = _sourcePosition.filename, 32812 identifierName = _sourcePosition.identifierName; 32813 32814 this._append(str, line, column, identifierName, filename); 32815 }; 32816 32817 Buffer.prototype.queue = function queue(str) { 32818 if (str === "\n") while (this._queue.length > 0 && SPACES_RE.test(this._queue[0][0])) { 32819 this._queue.shift(); 32820 }var _sourcePosition2 = this._sourcePosition, 32821 line = _sourcePosition2.line, 32822 column = _sourcePosition2.column, 32823 filename = _sourcePosition2.filename, 32824 identifierName = _sourcePosition2.identifierName; 32825 32826 this._queue.unshift([str, line, column, identifierName, filename]); 32827 }; 32828 32829 Buffer.prototype._flush = function _flush() { 32830 var item = void 0; 32831 while (item = this._queue.pop()) { 32832 this._append.apply(this, item); 32833 } 32834 }; 32835 32836 Buffer.prototype._append = function _append(str, line, column, identifierName, filename) { 32837 if (this._map && str[0] !== "\n") { 32838 this._map.mark(this._position.line, this._position.column, line, column, identifierName, filename); 32839 } 32840 32841 this._buf.push(str); 32842 this._last = str[str.length - 1]; 32843 32844 for (var i = 0; i < str.length; i++) { 32845 if (str[i] === "\n") { 32846 this._position.line++; 32847 this._position.column = 0; 32848 } else { 32849 this._position.column++; 32850 } 32851 } 32852 }; 32853 32854 Buffer.prototype.removeTrailingNewline = function removeTrailingNewline() { 32855 if (this._queue.length > 0 && this._queue[0][0] === "\n") this._queue.shift(); 32856 }; 32857 32858 Buffer.prototype.removeLastSemicolon = function removeLastSemicolon() { 32859 if (this._queue.length > 0 && this._queue[0][0] === ";") this._queue.shift(); 32860 }; 32861 32862 Buffer.prototype.endsWith = function endsWith(suffix) { 32863 if (suffix.length === 1) { 32864 var last = void 0; 32865 if (this._queue.length > 0) { 32866 var str = this._queue[0][0]; 32867 last = str[str.length - 1]; 32868 } else { 32869 last = this._last; 32870 } 32871 32872 return last === suffix; 32873 } 32874 32875 var end = this._last + this._queue.reduce(function (acc, item) { 32876 return item[0] + acc; 32877 }, ""); 32878 if (suffix.length <= end.length) { 32879 return end.slice(-suffix.length) === suffix; 32880 } 32881 32882 return false;
32883 }; 32884 32885 Buffer.prototype.hasContent = function hasContent() { 32886 return this._queue.length > 0 || !!this._last; 32887 }; 32888 32889 Buffer.prototype.source = function source(prop, loc) { 32890 if (prop && !loc) return; 32891 32892 var pos = loc ? loc[prop] : null; 32893 32894 this._sourcePosition.identifierName = loc && loc.identifierName || null; 32895 this._sourcePosition.line = pos ? pos.line : null; 32896 this._sourcePosition.column = pos ? pos.column : null; 32897 this._sourcePosition.filename = loc && loc.filename || null; 32898 }; 32899 32900 Buffer.prototype.withSource = function withSource(prop, loc, cb) { 32901 if (!this._map) return cb(); 32902 32903 var originalLine = this._sourcePosition.line; 32904 var originalColumn = this._sourcePosition.column; 32905 var originalFilename = this._sourcePosition.filename; 32906 var originalIdentifierName = this._sourcePosition.identifierName; 32907 32908 this.source(prop, loc); 32909 32910 cb(); 32911 32912 this._sourcePosition.line = originalLine; 32913 this._sourcePosition.column = originalColumn; 32914 this._sourcePosition.filename = originalFilename; 32915 this._sourcePosition.identifierName = originalIdentifierName; 32916 }; 32917 32918 Buffer.prototype.getCurrentColumn = function getCurrentColumn() { 32919 var extra = this._queue.reduce(function (acc, item) { 32920 return item[0] + acc; 32921 }, ""); 32922 var lastIndex = extra.lastIndexOf("\n"); 32923 32924 return lastIndex === -1 ? this._position.column + extra.length : extra.length - 1 - lastIndex; 32925 }; 32926 32927 Buffer.prototype.getCurrentLine = function getCurrentLine() { 32928 var extra = this._queue.reduce(function (acc, item) { 32929 return item[0] + acc; 32930 }, ""); 32931 32932 var count = 0; 32933 for (var i = 0; i < extra.length; i++) { 32934 if (extra[i] === "\n") count++; 32935 } 32936 32937 return this._position.line + count; 32938 }; 32939 32940 return Buffer; 32941 }(); 32942 32943 exports.default = Buffer; 32944 module.exports = exports["default"]; 32945 32946/***/ }, 32947/* 298 */ 32948/***/ function(module, exports, __webpack_require__) { 32949 32950 "use strict"; 32951 32952 exports.__esModule = true; 32953 exports.File = File; 32954 exports.Program = Program; 32955 exports.BlockStatement = BlockStatement; 32956 exports.Noop = Noop; 32957 exports.Directive = Directive; 32958 32959 var _types = __webpack_require__(120); 32960 32961 Object.defineProperty(exports, "DirectiveLiteral", { 32962 enumerable: true, 32963 get: function get() { 32964 return _types.StringLiteral; 32965 } 32966 }); 32967 function File(node) { 32968 this.print(node.program, node); 32969 } 32970 32971 function Program(node) { 32972 this.printInnerComments(node, false); 32973 32974 this.printSequence(node.directives, node); 32975 if (node.directives && node.directives.length) this.newline(); 32976 32977 this.printSequence(node.body, node); 32978 } 32979 32980 function BlockStatement(node) { 32981 this.token("{"); 32982 this.printInnerComments(node); 32983 32984 var hasDirectives = node.directives && node.directives.length; 32985 32986 if (node.body.length || hasDirectives) { 32987 this.newline(); 32988 32989 this.printSequence(node.directives, node, { indent: true }); 32990 if (hasDirectives) this.newline(); 32991 32992 this.printSequence(node.body, node, { indent: true }); 32993 this.removeTrailingNewline(); 32994 32995 this.source("end", node.loc); 32996 32997 if (!this.endsWith("\n")) this.newline(); 32998 32999 this.rightBrace(); 33000 } else { 33001 this.source("end", node.loc); 33002 this.token("}"); 33003 } 33004 } 33005 33006 function Noop() {} 33007 33008 function Directive(node) { 33009 this.print(node.value, node); 33010 this.semicolon(); 33011 } 33012 33013/***/ }, 33014/* 299 */ 33015/***/ function(module, exports) { 33016 33017 "use strict"; 33018 33019 exports.__esModule = true; 33020 exports.ClassDeclaration = ClassDeclaration; 33021 exports.ClassBody = ClassBody; 33022 exports.ClassProperty = ClassProperty; 33023 exports.ClassMethod = ClassMethod; 33024 function ClassDeclaration(node) { 33025 this.printJoin(node.decorators, node); 33026 this.word("class"); 33027 33028 if (node.id) { 33029 this.space(); 33030 this.print(node.id, node); 33031 } 33032 33033 this.print(node.typeParameters, node); 33034 33035 if (node.superClass) { 33036 this.space(); 33037 this.word("extends"); 33038 this.space(); 33039 this.print(node.superClass, node); 33040 this.print(node.superTypeParameters, node); 33041 } 33042 33043 if (node.implements) { 33044 this.space(); 33045 this.word("implements"); 33046 this.space(); 33047 this.printList(node.implements, node); 33048 } 33049 33050 this.space(); 33051 this.print(node.body, node); 33052 } 33053 33054 exports.ClassExpression = ClassDeclaration; 33055 function ClassBody(node) { 33056 this.token("{"); 33057 this.printInnerComments(node); 33058 if (node.body.length === 0) { 33059 this.token("}"); 33060 } else { 33061 this.newline(); 33062 33063 this.indent(); 33064 this.printSequence(node.body, node); 33065 this.dedent(); 33066 33067 if (!this.endsWith("\n")) this.newline(); 33068 33069 this.rightBrace(); 33070 } 33071 } 33072 33073 function ClassProperty(node) { 33074 this.printJoin(node.decorators, node); 33075 33076 if (node.static) { 33077 this.word("static"); 33078 this.space(); 33079 } 33080 if (node.computed) { 33081 this.token("["); 33082 this.print(node.key, node); 33083 this.token("]"); 33084 } else { 33085 this._variance(node); 33086 this.print(node.key, node); 33087 } 33088 this.print(node.typeAnnotation, node); 33089 if (node.value) { 33090 this.space(); 33091 this.token("="); 33092 this.space(); 33093 this.print(node.value, node); 33094 } 33095 this.semicolon(); 33096 } 33097 33098 function ClassMethod(node) { 33099 this.printJoin(node.decorators, node); 33100 33101 if (node.static) { 33102 this.word("static"); 33103 this.space(); 33104 } 33105 33106 if (node.kind === "constructorCall") { 33107 this.word("call"); 33108 this.space(); 33109 } 33110 33111 this._method(node); 33112 } 33113 33114/***/ }, 33115/* 300 */ 33116/***/ function(module, exports, __webpack_require__) { 33117 33118 "use strict"; 33119 33120 exports.__esModule = true; 33121 exports.LogicalExpression = exports.BinaryExpression = exports.AwaitExpression = exports.YieldExpression = undefined; 33122 exports.UnaryExpression = UnaryExpression; 33123 exports.DoExpression = DoExpression; 33124 exports.ParenthesizedExpression = ParenthesizedExpression; 33125 exports.UpdateExpression = UpdateExpression; 33126 exports.ConditionalExpression = ConditionalExpression; 33127 exports.NewExpression = NewExpression; 33128 exports.SequenceExpression = SequenceExpression; 33129 exports.ThisExpression = ThisExpression; 33130 exports.Super = Super;
33131 exports.Decorator = Decorator; 33132 exports.CallExpression = CallExpression; 33133 exports.Import = Import; 33134 exports.EmptyStatement = EmptyStatement; 33135 exports.ExpressionStatement = ExpressionStatement; 33136 exports.AssignmentPattern = AssignmentPattern; 33137 exports.AssignmentExpression = AssignmentExpression; 33138 exports.BindExpression = BindExpression; 33139 exports.MemberExpression = MemberExpression; 33140 exports.MetaProperty = MetaProperty; 33141 33142 var _babelTypes = __webpack_require__(1); 33143 33144 var t = _interopRequireWildcard(_babelTypes); 33145 33146 var _node = __webpack_require__(183); 33147 33148 var n = _interopRequireWildcard(_node); 33149 33150 function _interopRequireWildcard(obj) { 33151 if (obj && obj.__esModule) { 33152 return obj; 33153 } else { 33154 var newObj = {};if (obj != null) { 33155 for (var key in obj) { 33156 if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; 33157 } 33158 }newObj.default = obj;return newObj; 33159 } 33160 } 33161 33162 function UnaryExpression(node) { 33163 if (node.operator === "void" || node.operator === "delete" || node.operator === "typeof") { 33164 this.word(node.operator); 33165 this.space(); 33166 } else { 33167 this.token(node.operator); 33168 } 33169 33170 this.print(node.argument, node); 33171 } 33172 33173 function DoExpression(node) { 33174 this.word("do"); 33175 this.space(); 33176 this.print(node.body, node); 33177 } 33178 33179 function ParenthesizedExpression(node) { 33180 this.token("("); 33181 this.print(node.expression, node); 33182 this.token(")"); 33183 } 33184 33185 function UpdateExpression(node) { 33186 if (node.prefix) { 33187 this.token(node.operator); 33188 this.print(node.argument, node); 33189 } else { 33190 this.print(node.argument, node); 33191 this.token(node.operator); 33192 } 33193 } 33194 33195 function ConditionalExpression(node) { 33196 this.print(node.test, node); 33197 this.space(); 33198 this.token("?"); 33199 this.space(); 33200 this.print(node.consequent, node); 33201 this.space(); 33202 this.token(":"); 33203 this.space(); 33204 this.print(node.alternate, node); 33205 } 33206 33207 function NewExpression(node, parent) { 33208 this.word("new"); 33209 this.space(); 33210 this.print(node.callee, node); 33211 if (node.arguments.length === 0 && this.format.minified && !t.isCallExpression(parent, { callee: node }) && !t.isMemberExpression(parent) && !t.isNewExpression(parent)) return; 33212 33213 this.token("("); 33214 this.printList(node.arguments, node); 33215 this.token(")"); 33216 } 33217 33218 function SequenceExpression(node) { 33219 this.printList(node.expressions, node); 33220 } 33221 33222 function ThisExpression() { 33223 this.word("this"); 33224 } 33225 33226 function Super() { 33227 this.word("super"); 33228 } 33229 33230 function Decorator(node) { 33231 this.token("@"); 33232 this.print(node.expression, node); 33233 this.newline(); 33234 } 33235 33236 function commaSeparatorNewline() { 33237 this.token(","); 33238 this.newline(); 33239 33240 if (!this.endsWith("\n")) this.space(); 33241 } 33242 33243 function CallExpression(node) { 33244 this.print(node.callee, node); 33245 33246 this.token("("); 33247 33248 var isPrettyCall = node._prettyCall; 33249 33250 var separator = void 0; 33251 if (isPrettyCall) { 33252 separator = commaSeparatorNewline; 33253 this.newline(); 33254 this.indent(); 33255 } 33256 33257 this.printList(node.arguments, node, { separator: separator }); 33258 33259 if (isPrettyCall) { 33260 this.newline(); 33261 this.dedent(); 33262 } 33263 33264 this.token(")"); 33265 } 33266 33267 function Import() { 33268 this.word("import"); 33269 } 33270 33271 function buildYieldAwait(keyword) { 33272 return function (node) { 33273 this.word(keyword); 33274 33275 if (node.delegate) { 33276 this.token("*"); 33277 } 33278 33279 if (node.argument) { 33280 this.space(); 33281 var terminatorState = this.startTerminatorless(); 33282 this.print(node.argument, node); 33283 this.endTerminatorless(terminatorState); 33284 } 33285 }; 33286 } 33287 33288 var YieldExpression = exports.YieldExpression = buildYieldAwait("yield"); 33289 var AwaitExpression = exports.AwaitExpression = buildYieldAwait("await"); 33290 33291 function EmptyStatement() { 33292 this.semicolon(true); 33293 } 33294 33295 function ExpressionStatement(node) { 33296 this.print(node.expression, node); 33297 this.semicolon(); 33298 } 33299 33300 function AssignmentPattern(node) { 33301 this.print(node.left, node); 33302 if (node.left.optional) this.token("?"); 33303 this.print(node.left.typeAnnotation, node); 33304 this.space(); 33305 this.token("="); 33306 this.space(); 33307 this.print(node.right, node); 33308 } 33309 33310 function AssignmentExpression(node, parent) { 33311 var parens = this.inForStatementInitCounter && node.operator === "in" && !n.needsParens(node, parent); 33312 33313 if (parens) { 33314 this.token("("); 33315 } 33316 33317 this.print(node.left, node); 33318 33319 this.space(); 33320 if (node.operator === "in" || node.operator === "instanceof") { 33321 this.word(node.operator); 33322 } else { 33323 this.token(node.operator); 33324 } 33325 this.space(); 33326 33327 this.print(node.right, node); 33328 33329 if (parens) { 33330 this.token(")"); 33331 } 33332 } 33333 33334 function BindExpression(node) { 33335 this.print(node.object, node); 33336 this.token("::"); 33337 this.print(node.callee, node); 33338 } 33339 33340 exports.BinaryExpression = AssignmentExpression; 33341 exports.LogicalExpression = AssignmentExpression; 33342 function MemberExpression(node) { 33343 this.print(node.object, node); 33344 33345 if (!node.computed && t.isMemberExpression(node.property)) { 33346 throw new TypeError("Got a MemberExpression for MemberExpression property"); 33347 } 33348 33349 var computed = node.computed; 33350 if (t.isLiteral(node.property) && typeof node.property.value === "number") { 33351 computed = true; 33352 } 33353 33354 if (computed) { 33355 this.token("["); 33356 this.print(node.property, node); 33357 this.token("]"); 33358 } else { 33359 this.token("."); 33360 this.print(node.property, node); 33361 } 33362 } 33363 33364 function MetaProperty(node) { 33365 this.print(node.meta, node); 33366 this.token("."); 33367 this.print(node.property, node); 33368 } 33369 33370/***/ }, 33371/* 301 */ 33372/***/ function(module, exports, __webpack_require__) { 33373 33374 "use strict"; 33375 33376 exports.__esModule = true; 33377 exports.AnyTypeAnnotation = AnyTypeAnnotation; 33378 exports.ArrayTypeAnnotation = ArrayTypeAnnotation; 33379 exports.BooleanTypeAnnotation = BooleanTypeAnnotation; 33380 exports.BooleanLiteralTypeAnnotation = BooleanLiteralTypeAnnotation; 33381 exports.NullLiteralTypeAnnotation = NullLiteralTypeAnnotation; 33382 exports.DeclareClass = DeclareClass; 33383 exports.DeclareFunction = DeclareFunction; 33384 exports.DeclareInterface = DeclareInterface; 33385 exports.DeclareModule = DeclareModule; 33386 exports.DeclareModuleExports = DeclareModuleExports; 33387 exports.DeclareTypeAlias = DeclareTypeAlias; 33388 exports.DeclareVariable = DeclareVariable; 33389 exports.ExistentialTypeParam = ExistentialTypeParam; 33390 exports.FunctionTypeAnnotation = FunctionTypeAnnotation; 33391 exports.FunctionTypeParam = FunctionTypeParam; 33392 exports.InterfaceExtends = InterfaceExtends; 33393 exports._interfaceish = _interfaceish; 33394 exports._variance = _variance; 33395 exports.InterfaceDeclaration = InterfaceDeclaration; 33396 exports.IntersectionTypeAnnotation = IntersectionTypeAnnotation; 33397 exports.MixedTypeAnnotation = MixedTypeAnnotation; 33398 exports.EmptyTypeAnnotation = EmptyTypeAnnotation; 33399 exports.NullableTypeAnnotation = NullableTypeAnnotation; 33400 33401 var _types = __webpack_require__(120); 33402 33403 Object.defineProperty(exports, "NumericLiteralTypeAnnotation", { 33404 enumerable: true, 33405 get: function get() { 33406 return _types.NumericLiteral; 33407 } 33408 }); 33409 Object.defineProperty(exports, "StringLiteralTypeAnnotation", { 33410 enumerable: true, 33411 get: function get() { 33412 return _types.StringLiteral; 33413 } 33414 }); 33415 exports.NumberTypeAnnotation = NumberTypeAnnotation; 33416 exports.StringTypeAnnotation = StringTypeAnnotation; 33417 exports.ThisTypeAnnotation = ThisTypeAnnotation; 33418 exports.TupleTypeAnnotation = TupleTypeAnnotation; 33419 exports.TypeofTypeAnnotation = TypeofTypeAnnotation; 33420 exports.TypeAlias = TypeAlias; 33421 exports.TypeAnnotation = TypeAnnotation; 33422 exports.TypeParameter = TypeParameter; 33423 exports.TypeParameterInstantiation = TypeParameterInstantiation; 33424 exports.ObjectTypeAnnotation = ObjectTypeAnnotation; 33425 exports.ObjectTypeCallProperty = ObjectTypeCallProperty; 33426 exports.ObjectTypeIndexer = ObjectTypeIndexer;
33427 exports.ObjectTypeProperty = ObjectTypeProperty; 33428 exports.QualifiedTypeIdentifier = QualifiedTypeIdentifier; 33429 exports.UnionTypeAnnotation = UnionTypeAnnotation; 33430 exports.TypeCastExpression = TypeCastExpression; 33431 exports.VoidTypeAnnotation = VoidTypeAnnotation; 33432 function AnyTypeAnnotation() { 33433 this.word("any"); 33434 } 33435 33436 function ArrayTypeAnnotation(node) { 33437 this.print(node.elementType, node); 33438 this.token("["); 33439 this.token("]"); 33440 } 33441 33442 function BooleanTypeAnnotation() { 33443 this.word("boolean"); 33444 } 33445 33446 function BooleanLiteralTypeAnnotation(node) { 33447 this.word(node.value ? "true" : "false"); 33448 } 33449 33450 function NullLiteralTypeAnnotation() { 33451 this.word("null"); 33452 } 33453 33454 function DeclareClass(node) { 33455 this.word("declare"); 33456 this.space(); 33457 this.word("class"); 33458 this.space(); 33459 this._interfaceish(node); 33460 } 33461 33462 function DeclareFunction(node) { 33463 this.word("declare"); 33464 this.space(); 33465 this.word("function"); 33466 this.space(); 33467 this.print(node.id, node); 33468 this.print(node.id.typeAnnotation.typeAnnotation, node); 33469 this.semicolon(); 33470 } 33471 33472 function DeclareInterface(node) { 33473 this.word("declare"); 33474 this.space(); 33475 this.InterfaceDeclaration(node); 33476 } 33477 33478 function DeclareModule(node) { 33479 this.word("declare"); 33480 this.space(); 33481 this.word("module"); 33482 this.space(); 33483 this.print(node.id, node); 33484 this.space(); 33485 this.print(node.body, node); 33486 } 33487 33488 function DeclareModuleExports(node) { 33489 this.word("declare"); 33490 this.space(); 33491 this.word("module"); 33492 this.token("."); 33493 this.word("exports"); 33494 this.print(node.typeAnnotation, node); 33495 } 33496 33497 function DeclareTypeAlias(node) { 33498 this.word("declare"); 33499 this.space(); 33500 this.TypeAlias(node); 33501 } 33502 33503 function DeclareVariable(node) { 33504 this.word("declare"); 33505 this.space(); 33506 this.word("var"); 33507 this.space(); 33508 this.print(node.id, node); 33509 this.print(node.id.typeAnnotation, node); 33510 this.semicolon(); 33511 } 33512 33513 function ExistentialTypeParam() { 33514 this.token("*"); 33515 } 33516 33517 function FunctionTypeAnnotation(node, parent) { 33518 this.print(node.typeParameters, node); 33519 this.token("("); 33520 this.printList(node.params, node); 33521 33522 if (node.rest) { 33523 if (node.params.length) { 33524 this.token(","); 33525 this.space(); 33526 } 33527 this.token("..."); 33528 this.print(node.rest, node); 33529 } 33530 33531 this.token(")"); 33532 33533 if (parent.type === "ObjectTypeCallProperty" || parent.type === "DeclareFunction") { 33534 this.token(":"); 33535 } else { 33536 this.space(); 33537 this.token("=>"); 33538 } 33539 33540 this.space(); 33541 this.print(node.returnType, node); 33542 } 33543 33544 function FunctionTypeParam(node) { 33545 this.print(node.name, node); 33546 if (node.optional) this.token("?"); 33547 this.token(":"); 33548 this.space(); 33549 this.print(node.typeAnnotation, node); 33550 } 33551 33552 function InterfaceExtends(node) { 33553 this.print(node.id, node); 33554 this.print(node.typeParameters, node); 33555 } 33556 33557 exports.ClassImplements = InterfaceExtends; 33558 exports.GenericTypeAnnotation = InterfaceExtends; 33559 function _interfaceish(node) { 33560 this.print(node.id, node); 33561 this.print(node.typeParameters, node); 33562 if (node.extends.length) { 33563 this.space(); 33564 this.word("extends"); 33565 this.space(); 33566 this.printList(node.extends, node); 33567 } 33568 if (node.mixins && node.mixins.length) { 33569 this.space(); 33570 this.word("mixins"); 33571 this.space(); 33572 this.printList(node.mixins, node); 33573 } 33574 this.space(); 33575 this.print(node.body, node); 33576 } 33577 33578 function _variance(node) { 33579 if (node.variance === "plus") { 33580 this.token("+"); 33581 } else if (node.variance === "minus") { 33582 this.token("-"); 33583 } 33584 } 33585 33586 function InterfaceDeclaration(node) { 33587 this.word("interface"); 33588 this.space(); 33589 this._interfaceish(node); 33590 } 33591 33592 function andSeparator() { 33593 this.space(); 33594 this.token("&"); 33595 this.space(); 33596 } 33597 33598 function IntersectionTypeAnnotation(node) { 33599 this.printJoin(node.types, node, { separator: andSeparator }); 33600 } 33601 33602 function MixedTypeAnnotation() { 33603 this.word("mixed"); 33604 } 33605 33606 function EmptyTypeAnnotation() { 33607 this.word("empty"); 33608 } 33609 33610 function NullableTypeAnnotation(node) { 33611 this.token("?"); 33612 this.print(node.typeAnnotation, node); 33613 } 33614 33615 function NumberTypeAnnotation() { 33616 this.word("number"); 33617 } 33618 33619 function StringTypeAnnotation() { 33620 this.word("string"); 33621 } 33622 33623 function ThisTypeAnnotation() { 33624 this.word("this"); 33625 } 33626 33627 function TupleTypeAnnotation(node) { 33628 this.token("["); 33629 this.printList(node.types, node); 33630 this.token("]"); 33631 } 33632 33633 function TypeofTypeAnnotation(node) { 33634 this.word("typeof"); 33635 this.space(); 33636 this.print(node.argument, node); 33637 } 33638 33639 function TypeAlias(node) { 33640 this.word("type"); 33641 this.space(); 33642 this.print(node.id, node); 33643 this.print(node.typeParameters, node); 33644 this.space(); 33645 this.token("="); 33646 this.space(); 33647 this.print(node.right, node); 33648 this.semicolon(); 33649 } 33650 33651 function TypeAnnotation(node) { 33652 this.token(":"); 33653 this.space(); 33654 if (node.optional) this.token("?"); 33655 this.print(node.typeAnnotation, node); 33656 } 33657 33658 function TypeParameter(node) { 33659 this._variance(node); 33660 33661 this.word(node.name); 33662 33663 if (node.bound) { 33664 this.print(node.bound, node); 33665 } 33666 33667 if (node.default) { 33668 this.space(); 33669 this.token("="); 33670 this.space(); 33671 this.print(node.default, node); 33672 } 33673 } 33674 33675 function TypeParameterInstantiation(node) { 33676 this.token("<"); 33677 this.printList(node.params, node, {}); 33678 this.token(">"); 33679 } 33680 33681 exports.TypeParameterDeclaration = TypeParameterInstantiation; 33682 function ObjectTypeAnnotation(node) { 33683 var _this = this; 33684 33685 if (node.exact) { 33686 this.token("{|"); 33687 } else { 33688 this.token("{"); 33689 } 33690 33691 var props = node.properties.concat(node.callProperties, node.indexers); 33692 33693 if (props.length) { 33694 this.space(); 33695 33696 this.printJoin(props, node, {
33697 addNewlines: function addNewlines(leading) { 33698 if (leading && !props[0]) return 1; 33699 }, 33700 33701 indent: true, 33702 statement: true, 33703 iterator: function iterator() { 33704 if (props.length !== 1) { 33705 if (_this.format.flowCommaSeparator) { 33706 _this.token(","); 33707 } else { 33708 _this.semicolon(); 33709 } 33710 _this.space(); 33711 } 33712 } 33713 }); 33714 33715 this.space(); 33716 } 33717 33718 if (node.exact) { 33719 this.token("|}"); 33720 } else { 33721 this.token("}"); 33722 } 33723 } 33724 33725 function ObjectTypeCallProperty(node) { 33726 if (node.static) { 33727 this.word("static"); 33728 this.space(); 33729 } 33730 this.print(node.value, node); 33731 } 33732 33733 function ObjectTypeIndexer(node) { 33734 if (node.static) { 33735 this.word("static"); 33736 this.space(); 33737 } 33738 this._variance(node); 33739 this.token("["); 33740 this.print(node.id, node); 33741 this.token(":"); 33742 this.space(); 33743 this.print(node.key, node); 33744 this.token("]"); 33745 this.token(":"); 33746 this.space(); 33747 this.print(node.value, node); 33748 } 33749 33750 function ObjectTypeProperty(node) { 33751 if (node.static) { 33752 this.word("static"); 33753 this.space(); 33754 } 33755 this._variance(node); 33756 this.print(node.key, node); 33757 if (node.optional) this.token("?"); 33758 this.token(":"); 33759 this.space(); 33760 this.print(node.value, node); 33761 } 33762 33763 function QualifiedTypeIdentifier(node) { 33764 this.print(node.qualification, node); 33765 this.token("."); 33766 this.print(node.id, node); 33767 } 33768 33769 function orSeparator() { 33770 this.space(); 33771 this.token("|"); 33772 this.space(); 33773 } 33774 33775 function UnionTypeAnnotation(node) { 33776 this.printJoin(node.types, node, { separator: orSeparator }); 33777 } 33778 33779 function TypeCastExpression(node) { 33780 this.token("("); 33781 this.print(node.expression, node); 33782 this.print(node.typeAnnotation, node); 33783 this.token(")"); 33784 } 33785 33786 function VoidTypeAnnotation() { 33787 this.word("void"); 33788 } 33789 33790/***/ }, 33791/* 302 */ 33792/***/ function(module, exports, __webpack_require__) { 33793 33794 "use strict"; 33795 33796 exports.__esModule = true; 33797 33798 var _getIterator2 = __webpack_require__(2); 33799 33800 var _getIterator3 = _interopRequireDefault(_getIterator2); 33801 33802 exports.JSXAttribute = JSXAttribute; 33803 exports.JSXIdentifier = JSXIdentifier;
33804 exports.JSXNamespacedName = JSXNamespacedName; 33805 exports.JSXMemberExpression = JSXMemberExpression; 33806 exports.JSXSpreadAttribute = JSXSpreadAttribute; 33807 exports.JSXExpressionContainer = JSXExpressionContainer; 33808 exports.JSXSpreadChild = JSXSpreadChild; 33809 exports.JSXText = JSXText; 33810 exports.JSXElement = JSXElement; 33811 exports.JSXOpeningElement = JSXOpeningElement; 33812 exports.JSXClosingElement = JSXClosingElement; 33813 exports.JSXEmptyExpression = JSXEmptyExpression; 33814 33815 function _interopRequireDefault(obj) { 33816 return obj && obj.__esModule ? obj : { default: obj }; 33817 } 33818 33819 function JSXAttribute(node) { 33820 this.print(node.name, node); 33821 if (node.value) { 33822 this.token("="); 33823 this.print(node.value, node); 33824 } 33825 } 33826 33827 function JSXIdentifier(node) { 33828 this.word(node.name); 33829 } 33830 33831 function JSXNamespacedName(node) { 33832 this.print(node.namespace, node); 33833 this.token(":"); 33834 this.print(node.name, node); 33835 } 33836 33837 function JSXMemberExpression(node) { 33838 this.print(node.object, node); 33839 this.token("."); 33840 this.print(node.property, node); 33841 } 33842 33843 function JSXSpreadAttribute(node) { 33844 this.token("{"); 33845 this.token("..."); 33846 this.print(node.argument, node); 33847 this.token("}"); 33848 } 33849 33850 function JSXExpressionContainer(node) { 33851 this.token("{"); 33852 this.print(node.expression, node); 33853 this.token("}"); 33854 } 33855 33856 function JSXSpreadChild(node) { 33857 this.token("{"); 33858 this.token("..."); 33859 this.print(node.expression, node); 33860 this.token("}"); 33861 } 33862 33863 function JSXText(node) { 33864 this.token(node.value); 33865 } 33866 33867 function JSXElement(node) { 33868 var open = node.openingElement; 33869 this.print(open, node); 33870 if (open.selfClosing) return; 33871 33872 this.indent(); 33873 for (var _iterator = node.children, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) { 33874 var _ref; 33875 33876 if (_isArray) { 33877 if (_i >= _iterator.length) break; 33878 _ref = _iterator[_i++]; 33879 } else { 33880 _i = _iterator.next(); 33881 if (_i.done) break; 33882 _ref = _i.value; 33883 } 33884 33885 var child = _ref; 33886 33887 this.print(child, node); 33888 } 33889 this.dedent(); 33890 33891 this.print(node.closingElement, node); 33892 } 33893 33894 function spaceSeparator() { 33895 this.space(); 33896 } 33897 33898 function JSXOpeningElement(node) { 33899 this.token("<"); 33900 this.print(node.name, node); 33901 if (node.attributes.length > 0) { 33902 this.space(); 33903 this.printJoin(node.attributes, node, { separator: spaceSeparator }); 33904 } 33905 if (node.selfClosing) { 33906 this.space(); 33907 this.token("/>"); 33908 } else { 33909 this.token(">"); 33910 } 33911 } 33912 33913 function JSXClosingElement(node) { 33914 this.token("</"); 33915 this.print(node.name, node); 33916 this.token(">"); 33917 } 33918 33919 function JSXEmptyExpression() {} 33920 33921/***/ }, 33922/* 303 */ 33923/***/ function(module, exports, __webpack_require__) { 33924 33925 "use strict"; 33926 33927 exports.__esModule = true; 33928 exports.FunctionDeclaration = undefined; 33929 exports._params = _params; 33930 exports._method = _method; 33931 exports.FunctionExpression = FunctionExpression; 33932 exports.ArrowFunctionExpression = ArrowFunctionExpression; 33933 33934 var _babelTypes = __webpack_require__(1); 33935 33936 var t = _interopRequireWildcard(_babelTypes); 33937 33938 function _interopRequireWildcard(obj) { 33939 if (obj && obj.__esModule) { 33940 return obj; 33941 } else { 33942 var newObj = {};if (obj != null) { 33943 for (var key in obj) { 33944 if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; 33945 } 33946 }newObj.default = obj;return newObj; 33947 } 33948 } 33949 33950 function _params(node) { 33951 var _this = this; 33952 33953 this.print(node.typeParameters, node); 33954 this.token("("); 33955 this.printList(node.params, node, { 33956 iterator: function iterator(node) { 33957 if (node.optional) _this.token("?"); 33958 _this.print(node.typeAnnotation, node); 33959 } 33960 }); 33961 this.token(")"); 33962 33963 if (node.returnType) { 33964 this.print(node.returnType, node); 33965 } 33966 } 33967 33968 function _method(node) { 33969 var kind = node.kind; 33970 var key = node.key; 33971 33972 if (kind === "method" || kind === "init") { 33973 if (node.generator) { 33974 this.token("*"); 33975 } 33976 } 33977 33978 if (kind === "get" || kind === "set") { 33979 this.word(kind); 33980 this.space(); 33981 } 33982 33983 if (node.async) { 33984 this.word("async"); 33985 this.space(); 33986 } 33987 33988 if (node.computed) { 33989 this.token("["); 33990 this.print(key, node); 33991 this.token("]"); 33992 } else { 33993 this.print(key, node); 33994 } 33995 33996 this._params(node); 33997 this.space(); 33998 this.print(node.body, node); 33999 } 34000 34001 function FunctionExpression(node) { 34002 if (node.async) { 34003 this.word("async"); 34004 this.space(); 34005 } 34006 this.word("function"); 34007 if (node.generator) this.token("*"); 34008 34009 if (node.id) { 34010 this.space(); 34011 this.print(node.id, node); 34012 } else { 34013 this.space(); 34014 } 34015 34016 this._params(node); 34017 this.space(); 34018 this.print(node.body, node); 34019 } 34020 34021 exports.FunctionDeclaration = FunctionExpression; 34022 function ArrowFunctionExpression(node) { 34023 if (node.async) { 34024 this.word("async"); 34025 this.space(); 34026 } 34027 34028 var firstParam = node.params[0]; 34029 34030 if (node.params.length === 1 && t.isIdentifier(firstParam) && !hasTypes(node, firstParam)) { 34031 this.print(firstParam, node); 34032 } else { 34033 this._params(node); 34034 } 34035 34036 this.space(); 34037 this.token("=>"); 34038 this.space(); 34039 34040 this.print(node.body, node); 34041 } 34042 34043 function hasTypes(node, param) { 34044 return node.typeParameters || node.returnType || param.typeAnnotation || param.optional || param.trailingComments; 34045 } 34046 34047/***/ }, 34048/* 304 */ 34049/***/ function(module, exports, __webpack_require__) { 34050 34051 "use strict"; 34052 34053 exports.__esModule = true; 34054 exports.ImportSpecifier = ImportSpecifier;
34055 exports.ImportDefaultSpecifier = ImportDefaultSpecifier; 34056 exports.ExportDefaultSpecifier = ExportDefaultSpecifier; 34057 exports.ExportSpecifier = ExportSpecifier; 34058 exports.ExportNamespaceSpecifier = ExportNamespaceSpecifier; 34059 exports.ExportAllDeclaration = ExportAllDeclaration; 34060 exports.ExportNamedDeclaration = ExportNamedDeclaration; 34061 exports.ExportDefaultDeclaration = ExportDefaultDeclaration; 34062 exports.ImportDeclaration = ImportDeclaration; 34063 exports.ImportNamespaceSpecifier = ImportNamespaceSpecifier; 34064 34065 var _babelTypes = __webpack_require__(1); 34066 34067 var t = _interopRequireWildcard(_babelTypes); 34068 34069 function _interopRequireWildcard(obj) { 34070 if (obj && obj.__esModule) { 34071 return obj; 34072 } else { 34073 var newObj = {};if (obj != null) { 34074 for (var key in obj) { 34075 if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; 34076 } 34077 }newObj.default = obj;return newObj; 34078 } 34079 } 34080 34081 function ImportSpecifier(node) { 34082 if (node.importKind === "type" || node.importKind === "typeof") { 34083 this.word(node.importKind); 34084 this.space(); 34085 } 34086 34087 this.print(node.imported, node); 34088 if (node.local && node.local.name !== node.imported.name) { 34089 this.space(); 34090 this.word("as"); 34091 this.space(); 34092 this.print(node.local, node); 34093 } 34094 } 34095 34096 function ImportDefaultSpecifier(node) { 34097 this.print(node.local, node); 34098 } 34099 34100 function ExportDefaultSpecifier(node) { 34101 this.print(node.exported, node); 34102 } 34103 34104 function ExportSpecifier(node) { 34105 this.print(node.local, node); 34106 if (node.exported && node.local.name !== node.exported.name) { 34107 this.space(); 34108 this.word("as"); 34109 this.space(); 34110 this.print(node.exported, node); 34111 } 34112 } 34113 34114 function ExportNamespaceSpecifier(node) { 34115 this.token("*"); 34116 this.space(); 34117 this.word("as"); 34118 this.space(); 34119 this.print(node.exported, node); 34120 } 34121 34122 function ExportAllDeclaration(node) { 34123 this.word("export"); 34124 this.space(); 34125 this.token("*"); 34126 this.space(); 34127 this.word("from"); 34128 this.space(); 34129 this.print(node.source, node); 34130 this.semicolon(); 34131 } 34132 34133 function ExportNamedDeclaration() { 34134 this.word("export"); 34135 this.space(); 34136 ExportDeclaration.apply(this, arguments); 34137 } 34138 34139 function ExportDefaultDeclaration() { 34140 this.word("export"); 34141 this.space(); 34142 this.word("default"); 34143 this.space(); 34144 ExportDeclaration.apply(this, arguments); 34145 } 34146 34147 function ExportDeclaration(node) { 34148 if (node.declaration) { 34149 var declar = node.declaration; 34150 this.print(declar, node); 34151 if (!t.isStatement(declar)) this.semicolon(); 34152 } else { 34153 if (node.exportKind === "type") { 34154 this.word("type"); 34155 this.space(); 34156 } 34157 34158 var specifiers = node.specifiers.slice(0); 34159 34160 var hasSpecial = false;
34161 while (true) { 34162 var first = specifiers[0]; 34163 if (t.isExportDefaultSpecifier(first) || t.isExportNamespaceSpecifier(first)) { 34164 hasSpecial = true; 34165 this.print(specifiers.shift(), node); 34166 if (specifiers.length) { 34167 this.token(","); 34168 this.space(); 34169 } 34170 } else { 34171 break; 34172 } 34173 } 34174 34175 if (specifiers.length || !specifiers.length && !hasSpecial) { 34176 this.token("{"); 34177 if (specifiers.length) { 34178 this.space(); 34179 this.printList(specifiers, node); 34180 this.space(); 34181 } 34182 this.token("}"); 34183 } 34184 34185 if (node.source) { 34186 this.space(); 34187 this.word("from"); 34188 this.space(); 34189 this.print(node.source, node); 34190 } 34191 34192 this.semicolon(); 34193 } 34194 } 34195 34196 function ImportDeclaration(node) { 34197 this.word("import"); 34198 this.space(); 34199 34200 if (node.importKind === "type" || node.importKind === "typeof") { 34201 this.word(node.importKind); 34202 this.space(); 34203 } 34204 34205 var specifiers = node.specifiers.slice(0); 34206 if (specifiers && specifiers.length) { 34207 while (true) { 34208 var first = specifiers[0]; 34209 if (t.isImportDefaultSpecifier(first) || t.isImportNamespaceSpecifier(first)) { 34210 this.print(specifiers.shift(), node); 34211 if (specifiers.length) { 34212 this.token(","); 34213 this.space(); 34214 } 34215 } else { 34216 break; 34217 } 34218 } 34219 34220 if (specifiers.length) { 34221 this.token("{"); 34222 this.space(); 34223 this.printList(specifiers, node); 34224 this.space(); 34225 this.token("}"); 34226 } 34227 34228 this.space(); 34229 this.word("from"); 34230 this.space(); 34231 } 34232 34233 this.print(node.source, node); 34234 this.semicolon(); 34235 } 34236 34237 function ImportNamespaceSpecifier(node) { 34238 this.token("*"); 34239 this.space(); 34240 this.word("as"); 34241 this.space(); 34242 this.print(node.local, node); 34243 } 34244 34245/***/ }, 34246/* 305 */ 34247/***/ function(module, exports, __webpack_require__) { 34248 34249 "use strict"; 34250 34251 exports.__esModule = true; 34252 exports.ThrowStatement = exports.BreakStatement = exports.ReturnStatement = exports.ContinueStatement = exports.ForAwaitStatement = exports.ForOfStatement = exports.ForInStatement = undefined; 34253 34254 var _getIterator2 = __webpack_require__(2); 34255 34256 var _getIterator3 = _interopRequireDefault(_getIterator2); 34257 34258 exports.WithStatement = WithStatement; 34259 exports.IfStatement = IfStatement; 34260 exports.ForStatement = ForStatement; 34261 exports.WhileStatement = WhileStatement; 34262 exports.DoWhileStatement = DoWhileStatement; 34263 exports.LabeledStatement = LabeledStatement; 34264 exports.TryStatement = TryStatement; 34265 exports.CatchClause = CatchClause; 34266 exports.SwitchStatement = SwitchStatement; 34267 exports.SwitchCase = SwitchCase; 34268 exports.DebuggerStatement = DebuggerStatement; 34269 exports.VariableDeclaration = VariableDeclaration; 34270 exports.VariableDeclarator = VariableDeclarator; 34271 34272 var _babelTypes = __webpack_require__(1); 34273 34274 var t = _interopRequireWildcard(_babelTypes); 34275 34276 function _interopRequireWildcard(obj) { 34277 if (obj && obj.__esModule) { 34278 return obj; 34279 } else { 34280 var newObj = {};if (obj != null) { 34281 for (var key in obj) { 34282 if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; 34283 } 34284 }newObj.default = obj;return newObj; 34285 } 34286 } 34287 34288 function _interopRequireDefault(obj) { 34289 return obj && obj.__esModule ? obj : { default: obj }; 34290 } 34291 34292 function WithStatement(node) { 34293 this.word("with"); 34294 this.space(); 34295 this.token("("); 34296 this.print(node.object, node); 34297 this.token(")"); 34298 this.printBlock(node); 34299 } 34300 34301 function IfStatement(node) { 34302 this.word("if"); 34303 this.space(); 34304 this.token("("); 34305 this.print(node.test, node); 34306 this.token(")"); 34307 this.space(); 34308 34309 var needsBlock = node.alternate && t.isIfStatement(getLastStatement(node.consequent)); 34310 if (needsBlock) { 34311 this.token("{"); 34312 this.newline(); 34313 this.indent(); 34314 } 34315 34316 this.printAndIndentOnComments(node.consequent, node); 34317 34318 if (needsBlock) { 34319 this.dedent(); 34320 this.newline(); 34321 this.token("}"); 34322 } 34323 34324 if (node.alternate) { 34325 if (this.endsWith("}")) this.space(); 34326 this.word("else"); 34327 this.space(); 34328 this.printAndIndentOnComments(node.alternate, node); 34329 } 34330 } 34331
34332 function getLastStatement(statement) { 34333 if (!t.isStatement(statement.body)) return statement; 34334 return getLastStatement(statement.body); 34335 } 34336 34337 function ForStatement(node) { 34338 this.word("for"); 34339 this.space(); 34340 this.token("("); 34341 34342 this.inForStatementInitCounter++; 34343 this.print(node.init, node); 34344 this.inForStatementInitCounter--; 34345 this.token(";"); 34346 34347 if (node.test) { 34348 this.space(); 34349 this.print(node.test, node); 34350 } 34351 this.token(";"); 34352 34353 if (node.update) { 34354 this.space(); 34355 this.print(node.update, node); 34356 } 34357 34358 this.token(")"); 34359 this.printBlock(node); 34360 } 34361 34362 function WhileStatement(node) { 34363 this.word("while"); 34364 this.space(); 34365 this.token("("); 34366 this.print(node.test, node); 34367 this.token(")"); 34368 this.printBlock(node); 34369 } 34370 34371 var buildForXStatement = function buildForXStatement(op) { 34372 return function (node) { 34373 this.word("for"); 34374 this.space(); 34375 if (op === "await") { 34376 this.word("await"); 34377 this.space(); 34378 } 34379 this.token("("); 34380 34381 this.print(node.left, node); 34382 this.space(); 34383 this.word(op === "await" ? "of" : op); 34384 this.space(); 34385 this.print(node.right, node); 34386 this.token(")"); 34387 this.printBlock(node); 34388 }; 34389 }; 34390 34391 var ForInStatement = exports.ForInStatement = buildForXStatement("in"); 34392 var ForOfStatement = exports.ForOfStatement = buildForXStatement("of"); 34393 var ForAwaitStatement = exports.ForAwaitStatement = buildForXStatement("await"); 34394 34395 function DoWhileStatement(node) { 34396 this.word("do"); 34397 this.space(); 34398 this.print(node.body, node); 34399 this.space(); 34400 this.word("while"); 34401 this.space(); 34402 this.token("("); 34403 this.print(node.test, node); 34404 this.token(")"); 34405 this.semicolon(); 34406 } 34407 34408 function buildLabelStatement(prefix) { 34409 var key = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "label"; 34410 34411 return function (node) { 34412 this.word(prefix); 34413 34414 var label = node[key]; 34415 if (label) { 34416 this.space(); 34417 34418 var terminatorState = this.startTerminatorless(); 34419 this.print(label, node); 34420 this.endTerminatorless(terminatorState); 34421 } 34422 34423 this.semicolon(); 34424 }; 34425 } 34426 34427 var ContinueStatement = exports.ContinueStatement = buildLabelStatement("continue"); 34428 var ReturnStatement = exports.ReturnStatement = buildLabelStatement("return", "argument"); 34429 var BreakStatement = exports.BreakStatement = buildLabelStatement("break"); 34430 var ThrowStatement = exports.ThrowStatement = buildLabelStatement("throw", "argument"); 34431 34432 function LabeledStatement(node) { 34433 this.print(node.label, node); 34434 this.token(":"); 34435 this.space(); 34436 this.print(node.body, node); 34437 } 34438 34439 function TryStatement(node) { 34440 this.word("try"); 34441 this.space(); 34442 this.print(node.block, node); 34443 this.space(); 34444 34445 if (node.handlers) { 34446 this.print(node.handlers[0], node); 34447 } else { 34448 this.print(node.handler, node); 34449 } 34450 34451 if (node.finalizer) { 34452 this.space(); 34453 this.word("finally"); 34454 this.space(); 34455 this.print(node.finalizer, node); 34456 } 34457 } 34458 34459 function CatchClause(node) { 34460 this.word("catch"); 34461 this.space(); 34462 this.token("("); 34463 this.print(node.param, node); 34464 this.token(")"); 34465 this.space(); 34466 this.print(node.body, node); 34467 } 34468 34469 function SwitchStatement(node) { 34470 this.word("switch"); 34471 this.space(); 34472 this.token("("); 34473 this.print(node.discriminant, node); 34474 this.token(")"); 34475 this.space(); 34476 this.token("{"); 34477 34478 this.printSequence(node.cases, node, { 34479 indent: true, 34480 addNewlines: function addNewlines(leading, cas) { 34481 if (!leading && node.cases[node.cases.length - 1] === cas) return -1; 34482 } 34483 }); 34484 34485 this.token("}"); 34486 } 34487 34488 function SwitchCase(node) { 34489 if (node.test) { 34490 this.word("case"); 34491 this.space(); 34492 this.print(node.test, node); 34493 this.token(":"); 34494 } else { 34495 this.word("default"); 34496 this.token(":"); 34497 } 34498 34499 if (node.consequent.length) { 34500 this.newline(); 34501 this.printSequence(node.consequent, node, { indent: true }); 34502 } 34503 } 34504 34505 function DebuggerStatement() { 34506 this.word("debugger"); 34507 this.semicolon(); 34508 } 34509 34510 function variableDeclarationIdent() { 34511 this.token(","); 34512 this.newline(); 34513 if (this.endsWith("\n")) for (var i = 0; i < 4; i++) { 34514 this.space(true); 34515 } 34516 } 34517 34518 function constDeclarationIdent() { 34519 this.token(","); 34520 this.newline(); 34521 if (this.endsWith("\n")) for (var i = 0; i < 6; i++) { 34522 this.space(true); 34523 } 34524 } 34525 34526 function VariableDeclaration(node, parent) { 34527 this.word(node.kind); 34528 this.space(); 34529 34530 var hasInits = false;
34531 34532 if (!t.isFor(parent)) { 34533 for (var _iterator = node.declarations, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) { 34534 var _ref; 34535 34536 if (_isArray) { 34537 if (_i >= _iterator.length) break; 34538 _ref = _iterator[_i++]; 34539 } else { 34540 _i = _iterator.next(); 34541 if (_i.done) break; 34542 _ref = _i.value; 34543 } 34544 34545 var declar = _ref; 34546 34547 if (declar.init) { 34548 hasInits = true; 34549 } 34550 } 34551 } 34552 34553 var separator = void 0; 34554 if (hasInits) { 34555 separator = node.kind === "const" ? constDeclarationIdent : variableDeclarationIdent; 34556 } 34557 34558 this.printList(node.declarations, node, { separator: separator }); 34559 34560 if (t.isFor(parent)) { 34561 if (parent.left === node || parent.init === node) return; 34562 } 34563 34564 this.semicolon(); 34565 } 34566 34567 function VariableDeclarator(node) { 34568 this.print(node.id, node); 34569 this.print(node.id.typeAnnotation, node); 34570 if (node.init) { 34571 this.space(); 34572 this.token("="); 34573 this.space(); 34574 this.print(node.init, node); 34575 } 34576 } 34577 34578/***/ }, 34579/* 306 */ 34580/***/ function(module, exports) { 34581 34582 "use strict"; 34583 34584 exports.__esModule = true; 34585 exports.TaggedTemplateExpression = TaggedTemplateExpression; 34586 exports.TemplateElement = TemplateElement; 34587 exports.TemplateLiteral = TemplateLiteral; 34588 function TaggedTemplateExpression(node) { 34589 this.print(node.tag, node); 34590 this.print(node.quasi, node); 34591 } 34592 34593 function TemplateElement(node, parent) { 34594 var isFirst = parent.quasis[0] === node; 34595 var isLast = parent.quasis[parent.quasis.length - 1] === node; 34596 34597 var value = (isFirst ? "`" : "}") + node.value.raw + (isLast ? "`" : "${"); 34598 34599 this.token(value); 34600 } 34601 34602 function TemplateLiteral(node) { 34603 var quasis = node.quasis; 34604 34605 for (var i = 0; i < quasis.length; i++) { 34606 this.print(quasis[i], node); 34607 34608 if (i + 1 < quasis.length) { 34609 this.print(node.expressions[i], node); 34610 } 34611 } 34612 } 34613 34614/***/ }, 34615/* 307 */ 34616/***/ function(module, exports, __webpack_require__) { 34617 34618 "use strict"; 34619 34620 exports.__esModule = true; 34621 exports.AwaitExpression = exports.FunctionTypeAnnotation = undefined; 34622 exports.NullableTypeAnnotation = NullableTypeAnnotation; 34623 exports.UpdateExpression = UpdateExpression; 34624 exports.ObjectExpression = ObjectExpression; 34625 exports.DoExpression = DoExpression; 34626 exports.Binary = Binary; 34627 exports.BinaryExpression = BinaryExpression; 34628 exports.SequenceExpression = SequenceExpression; 34629 exports.YieldExpression = YieldExpression; 34630 exports.ClassExpression = ClassExpression; 34631 exports.UnaryLike = UnaryLike; 34632 exports.FunctionExpression = FunctionExpression; 34633 exports.ArrowFunctionExpression = ArrowFunctionExpression; 34634 exports.ConditionalExpression = ConditionalExpression; 34635 exports.AssignmentExpression = AssignmentExpression; 34636 34637 var _babelTypes = __webpack_require__(1); 34638 34639 var t = _interopRequireWildcard(_babelTypes); 34640 34641 function _interopRequireWildcard(obj) { 34642 if (obj && obj.__esModule) { 34643 return obj; 34644 } else { 34645 var newObj = {};if (obj != null) { 34646 for (var key in obj) { 34647 if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; 34648 } 34649 }newObj.default = obj;return newObj; 34650 } 34651 } 34652 34653 var PRECEDENCE = { 34654 "||": 0, 34655 "&&": 1, 34656 "|": 2, 34657 "^": 3, 34658 "&": 4, 34659 "==": 5, 34660 "===": 5, 34661 "!=": 5, 34662 "!==": 5, 34663 "<": 6, 34664 ">": 6, 34665 "<=": 6, 34666 ">=": 6, 34667 in: 6, 34668 instanceof: 6, 34669 ">>": 7, 34670 "<<": 7, 34671 ">>>": 7, 34672 "+": 8, 34673 "-": 8, 34674 "*": 9, 34675 "/": 9, 34676 "%": 9, 34677 "**": 10 34678 }; 34679 34680 function NullableTypeAnnotation(node, parent) { 34681 return t.isArrayTypeAnnotation(parent); 34682 } 34683 34684 exports.FunctionTypeAnnotation = NullableTypeAnnotation; 34685 function UpdateExpression(node, parent) { 34686 return t.isMemberExpression(parent) && parent.object === node; 34687 } 34688 34689 function ObjectExpression(node, parent, printStack) { 34690 return isFirstInStatement(printStack, { considerArrow: true }); 34691 } 34692 34693 function DoExpression(node, parent, printStack) { 34694 return isFirstInStatement(printStack); 34695 } 34696 34697 function Binary(node, parent) { 34698 if ((t.isCallExpression(parent) || t.isNewExpression(parent)) && parent.callee === node || t.isUnaryLike(parent) || t.isMemberExpression(parent) && parent.object === node || t.isAwaitExpression(parent)) { 34699 return true; 34700 } 34701 34702 if (t.isBinary(parent)) { 34703 var parentOp = parent.operator; 34704 var parentPos = PRECEDENCE[parentOp]; 34705 34706 var nodeOp = node.operator; 34707 var nodePos = PRECEDENCE[nodeOp]; 34708
34709 if (parentPos === nodePos && parent.right === node && !t.isLogicalExpression(parent) || parentPos > nodePos) { 34710 return true; 34711 } 34712 } 34713 34714 return false; 34715 } 34716 34717 function BinaryExpression(node, parent) { 34718 return node.operator === "in" && (t.isVariableDeclarator(parent) || t.isFor(parent)); 34719 } 34720 34721 function SequenceExpression(node, parent) { 34722 34723 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) { 34724 return false; 34725 } 34726 34727 return true; 34728 } 34729 34730 function YieldExpression(node, parent) { 34731 return t.isBinary(parent) || t.isUnaryLike(parent) || t.isCallExpression(parent) || t.isMemberExpression(parent) || t.isNewExpression(parent) || t.isConditionalExpression(parent) && node === parent.test; 34732 } 34733 34734 exports.AwaitExpression = YieldExpression; 34735 function ClassExpression(node, parent, printStack) { 34736 return isFirstInStatement(printStack, { considerDefaultExports: true }); 34737 } 34738 34739 function UnaryLike(node, parent) { 34740 return t.isMemberExpression(parent, { object: node }) || t.isCallExpression(parent, { callee: node }) || t.isNewExpression(parent, { callee: node }); 34741 } 34742 34743 function FunctionExpression(node, parent, printStack) { 34744 return isFirstInStatement(printStack, { considerDefaultExports: true }); 34745 } 34746 34747 function ArrowFunctionExpression(node, parent) { 34748 if (t.isExportDeclaration(parent) || t.isBinaryExpression(parent) || t.isLogicalExpression(parent) || t.isUnaryExpression(parent) || t.isTaggedTemplateExpression(parent)) { 34749 return true; 34750 } 34751 34752 return UnaryLike(node, parent); 34753 } 34754 34755 function ConditionalExpression(node, parent) { 34756 if (t.isUnaryLike(parent) || t.isBinary(parent) || t.isConditionalExpression(parent, { test: node }) || t.isAwaitExpression(parent)) { 34757 return true; 34758 } 34759 34760 return UnaryLike(node, parent); 34761 } 34762 34763 function AssignmentExpression(node) { 34764 if (t.isObjectPattern(node.left)) { 34765 return true; 34766 } else { 34767 return ConditionalExpression.apply(undefined, arguments); 34768 } 34769 } 34770 34771 function isFirstInStatement(printStack) { 34772 var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, 34773 _ref$considerArrow = _ref.considerArrow, 34774 considerArrow = _ref$considerArrow === undefined ? false : _ref$considerArrow, 34775 _ref$considerDefaultE = _ref.considerDefaultExports, 34776 considerDefaultExports = _ref$considerDefaultE === undefined ? false : _ref$considerDefaultE; 34777 34778 var i = printStack.length - 1; 34779 var node = printStack[i]; 34780 i--; 34781 var parent = printStack[i]; 34782 while (i > 0) { 34783 if (t.isExpressionStatement(parent, { expression: node }) || t.isTaggedTemplateExpression(parent) || considerDefaultExports && t.isExportDefaultDeclaration(parent, { declaration: node }) || considerArrow && t.isArrowFunctionExpression(parent, { body: node })) { 34784 return true; 34785 } 34786 34787 if (t.isCallExpression(parent, { callee: node }) || t.isSequenceExpression(parent) && parent.expressions[0] === node || t.isMemberExpression(parent, { object: node }) || t.isConditional(parent, { test: node }) || t.isBinary(parent, { left: node }) || t.isAssignmentExpression(parent, { left: node })) { 34788 node = parent; 34789 i--; 34790 parent = printStack[i]; 34791 } else { 34792 return false; 34793 } 34794 } 34795 34796 return false; 34797 } 34798 34799/***/ }, 34800/* 308 */ 34801/***/ function(module, exports, __webpack_require__) { 34802 34803 "use strict"; 34804 34805 var _map = __webpack_require__(577); 34806 34807 var _map2 = _interopRequireDefault(_map); 34808 34809 var _babelTypes = __webpack_require__(1); 34810 34811 var t = _interopRequireWildcard(_babelTypes); 34812 34813 function _interopRequireWildcard(obj) { 34814 if (obj && obj.__esModule) { 34815 return obj; 34816 } else { 34817 var newObj = {};if (obj != null) { 34818 for (var key in obj) { 34819 if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; 34820 } 34821 }newObj.default = obj;return newObj; 34822 } 34823 } 34824 34825 function _interopRequireDefault(obj) { 34826 return obj && obj.__esModule ? obj : { default: obj }; 34827 } 34828 34829 function crawl(node) { 34830 var state = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; 34831 34832 if (t.isMemberExpression(node)) { 34833 crawl(node.object, state); 34834 if (node.computed) crawl(node.property, state); 34835 } else if (t.isBinary(node) || t.isAssignmentExpression(node)) { 34836 crawl(node.left, state); 34837 crawl(node.right, state); 34838 } else if (t.isCallExpression(node)) { 34839 state.hasCall = true; 34840 crawl(node.callee, state); 34841 } else if (t.isFunction(node)) { 34842 state.hasFunction = true; 34843 } else if (t.isIdentifier(node)) { 34844 state.hasHelper = state.hasHelper || isHelper(node.callee); 34845 } 34846 34847 return state; 34848 } 34849 34850 function isHelper(node) { 34851 if (t.isMemberExpression(node)) { 34852 return isHelper(node.object) || isHelper(node.property); 34853 } else if (t.isIdentifier(node)) { 34854 return node.name === "require" || node.name[0] === "_"; 34855 } else if (t.isCallExpression(node)) { 34856 return isHelper(node.callee); 34857 } else if (t.isBinary(node) || t.isAssignmentExpression(node)) { 34858 return t.isIdentifier(node.left) && isHelper(node.left) || isHelper(node.right); 34859 } else { 34860 return false;
34861 } 34862 } 34863 34864 function isType(node) { 34865 return t.isLiteral(node) || t.isObjectExpression(node) || t.isArrayExpression(node) || t.isIdentifier(node) || t.isMemberExpression(node); 34866 } 34867 34868 exports.nodes = { 34869 AssignmentExpression: function AssignmentExpression(node) { 34870 var state = crawl(node.right); 34871 if (state.hasCall && state.hasHelper || state.hasFunction) { 34872 return { 34873 before: state.hasFunction, 34874 after: true 34875 }; 34876 } 34877 }, 34878 SwitchCase: function SwitchCase(node, parent) { 34879 return { 34880 before: node.consequent.length || parent.cases[0] === node 34881 }; 34882 }, 34883 LogicalExpression: function LogicalExpression(node) { 34884 if (t.isFunction(node.left) || t.isFunction(node.right)) { 34885 return { 34886 after: true 34887 }; 34888 } 34889 }, 34890 Literal: function Literal(node) { 34891 if (node.value === "use strict") { 34892 return { 34893 after: true 34894 }; 34895 } 34896 }, 34897 CallExpression: function CallExpression(node) { 34898 if (t.isFunction(node.callee) || isHelper(node)) { 34899 return { 34900 before: true, 34901 after: true 34902 }; 34903 } 34904 }, 34905 VariableDeclaration: function VariableDeclaration(node) { 34906 for (var i = 0; i < node.declarations.length; i++) { 34907 var declar = node.declarations[i]; 34908 34909 var enabled = isHelper(declar.id) && !isType(declar.init); 34910 if (!enabled) { 34911 var state = crawl(declar.init); 34912 enabled = isHelper(declar.init) && state.hasCall || state.hasFunction; 34913 } 34914 34915 if (enabled) { 34916 return { 34917 before: true, 34918 after: true 34919 }; 34920 } 34921 } 34922 }, 34923 IfStatement: function IfStatement(node) { 34924 if (t.isBlockStatement(node.consequent)) { 34925 return { 34926 before: true, 34927 after: true 34928 }; 34929 } 34930 } 34931 }; 34932 34933 exports.nodes.ObjectProperty = exports.nodes.ObjectTypeProperty = exports.nodes.ObjectMethod = exports.nodes.SpreadProperty = function (node, parent) { 34934 if (parent.properties[0] === node) { 34935 return { 34936 before: true 34937 }; 34938 } 34939 }; 34940 34941 exports.list = { 34942 VariableDeclaration: function VariableDeclaration(node) { 34943 return (0, _map2.default)(node.declarations, "init"); 34944 }, 34945 ArrayExpression: function ArrayExpression(node) { 34946 return node.elements; 34947 }, 34948 ObjectExpression: function ObjectExpression(node) { 34949 return node.properties; 34950 } 34951 }; 34952 34953 [["Function", true], ["Class", true], ["Loop", true], ["LabeledStatement", true], ["SwitchStatement", true], ["TryStatement", true]].forEach(function (_ref) { 34954 var type = _ref[0], 34955 amounts = _ref[1]; 34956 34957 if (typeof amounts === "boolean") { 34958 amounts = { after: amounts, before: amounts }; 34959 } 34960 [type].concat(t.FLIPPED_ALIAS_KEYS[type] || []).forEach(function (type) { 34961 exports.nodes[type] = function () { 34962 return amounts; 34963 }; 34964 }); 34965 }); 34966 34967/***/ }, 34968/* 309 */ 34969/***/ function(module, exports, __webpack_require__) { 34970 34971 "use strict"; 34972 34973 exports.__esModule = true; 34974 34975 var _assign = __webpack_require__(85); 34976 34977 var _assign2 = _interopRequireDefault(_assign); 34978 34979 var _getIterator2 = __webpack_require__(2); 34980 34981 var _getIterator3 = _interopRequireDefault(_getIterator2); 34982 34983 var _stringify = __webpack_require__(34); 34984 34985 var _stringify2 = _interopRequireDefault(_stringify); 34986 34987 var _weakSet = __webpack_require__(359); 34988 34989 var _weakSet2 = _interopRequireDefault(_weakSet); 34990 34991 var _classCallCheck2 = __webpack_require__(3); 34992 34993 var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); 34994 34995 var _find = __webpack_require__(568); 34996 34997 var _find2 = _interopRequireDefault(_find); 34998 34999 var _findLast = __webpack_require__(570); 35000 35001 var _findLast2 = _interopRequireDefault(_findLast); 35002 35003 var _isInteger = __webpack_require__(575); 35004 35005 var _isInteger2 = _interopRequireDefault(_isInteger); 35006 35007 var _repeat = __webpack_require__(274); 35008 35009 var _repeat2 = _interopRequireDefault(_repeat); 35010 35011 var _buffer = __webpack_require__(297); 35012 35013 var _buffer2 = _interopRequireDefault(_buffer); 35014 35015 var _node = __webpack_require__(183); 35016 35017 var n = _interopRequireWildcard(_node); 35018 35019 var _whitespace = __webpack_require__(311); 35020 35021 var _whitespace2 = _interopRequireDefault(_whitespace); 35022 35023 var _babelTypes = __webpack_require__(1); 35024 35025 var t = _interopRequireWildcard(_babelTypes); 35026 35027 function _interopRequireWildcard(obj) { 35028 if (obj && obj.__esModule) { 35029 return obj; 35030 } else { 35031 var newObj = {};if (obj != null) { 35032 for (var key in obj) { 35033 if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; 35034 } 35035 }newObj.default = obj;return newObj; 35036 } 35037 } 35038 35039 function _interopRequireDefault(obj) { 35040 return obj && obj.__esModule ? obj : { default: obj }; 35041 } 35042 35043 var SCIENTIFIC_NOTATION = /e/i; 35044 var ZERO_DECIMAL_INTEGER = /\.0+$/; 35045 var NON_DECIMAL_LITERAL = /^0[box]/; 35046 35047 var Printer = function () { 35048 function Printer(format, map, tokens) { 35049 (0, _classCallCheck3.default)(this, Printer); 35050 this.inForStatementInitCounter = 0; 35051 this._printStack = []; 35052 this._indent = 0; 35053 this._insideAux = false;
35054 this._printedCommentStarts = {}; 35055 this._parenPushNewlineState = null; 35056 this._printAuxAfterOnNextUserNode = false; 35057 this._printedComments = new _weakSet2.default(); 35058 this._endsWithInteger = false; 35059 this._endsWithWord = false; 35060 35061 this.format = format || {}; 35062 this._buf = new _buffer2.default(map); 35063 this._whitespace = tokens.length > 0 ? new _whitespace2.default(tokens) : null; 35064 } 35065 35066 Printer.prototype.generate = function generate(ast) { 35067 this.print(ast); 35068 this._maybeAddAuxComment(); 35069 35070 return this._buf.get(); 35071 }; 35072 35073 Printer.prototype.indent = function indent() { 35074 if (this.format.compact || this.format.concise) return; 35075 35076 this._indent++; 35077 }; 35078 35079 Printer.prototype.dedent = function dedent() { 35080 if (this.format.compact || this.format.concise) return; 35081 35082 this._indent--; 35083 }; 35084 35085 Printer.prototype.semicolon = function semicolon() { 35086 var force = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; 35087 35088 this._maybeAddAuxComment(); 35089 this._append(";", !force); 35090 }; 35091 35092 Printer.prototype.rightBrace = function rightBrace() { 35093 if (this.format.minified) { 35094 this._buf.removeLastSemicolon(); 35095 } 35096 this.token("}"); 35097 }; 35098 35099 Printer.prototype.space = function space() { 35100 var force = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; 35101 35102 if (this.format.compact) return; 35103 35104 if (this._buf.hasContent() && !this.endsWith(" ") && !this.endsWith("\n") || force) { 35105 this._space(); 35106 } 35107 }; 35108 35109 Printer.prototype.word = function word(str) { 35110 if (this._endsWithWord) this._space(); 35111 35112 this._maybeAddAuxComment(); 35113 this._append(str); 35114 35115 this._endsWithWord = true; 35116 }; 35117 35118 Printer.prototype.number = function number(str) { 35119 this.word(str); 35120 35121 this._endsWithInteger = (0, _isInteger2.default)(+str) && !NON_DECIMAL_LITERAL.test(str) && !SCIENTIFIC_NOTATION.test(str) && !ZERO_DECIMAL_INTEGER.test(str) && str[str.length - 1] !== "."; 35122 }; 35123 35124 Printer.prototype.token = function token(str) { 35125 if (str === "--" && this.endsWith("!") || str[0] === "+" && this.endsWith("+") || str[0] === "-" && this.endsWith("-") || str[0] === "." && this._endsWithInteger) { 35126 this._space(); 35127 } 35128 35129 this._maybeAddAuxComment(); 35130 this._append(str); 35131 }; 35132 35133 Printer.prototype.newline = function newline(i) { 35134 if (this.format.retainLines || this.format.compact) return; 35135 35136 if (this.format.concise) { 35137 this.space(); 35138 return; 35139 } 35140 35141 if (this.endsWith("\n\n")) return; 35142 35143 if (typeof i !== "number") i = 1; 35144 35145 i = Math.min(2, i); 35146 if (this.endsWith("{\n") || this.endsWith(":\n")) i--; 35147 if (i <= 0) return; 35148 35149 for (var j = 0; j < i; j++) { 35150 this._newline(); 35151 } 35152 }; 35153 35154 Printer.prototype.endsWith = function endsWith(str) { 35155 return this._buf.endsWith(str); 35156 }; 35157 35158 Printer.prototype.removeTrailingNewline = function removeTrailingNewline() { 35159 this._buf.removeTrailingNewline(); 35160 }; 35161 35162 Printer.prototype.source = function source(prop, loc) { 35163 this._catchUp(prop, loc); 35164 35165 this._buf.source(prop, loc); 35166 }; 35167 35168 Printer.prototype.withSource = function withSource(prop, loc, cb) { 35169 this._catchUp(prop, loc); 35170 35171 this._buf.withSource(prop, loc, cb); 35172 }; 35173 35174 Printer.prototype._space = function _space() { 35175 this._append(" ", true); 35176 }; 35177 35178 Printer.prototype._newline = function _newline() { 35179 this._append("\n", true); 35180 }; 35181 35182 Printer.prototype._append = function _append(str) { 35183 var queue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; 35184 35185 this._maybeAddParen(str); 35186 this._maybeIndent(str); 35187 35188 if (queue) this._buf.queue(str);else this._buf.append(str); 35189 35190 this._endsWithWord = false; 35191 this._endsWithInteger = false; 35192 }; 35193 35194 Printer.prototype._maybeIndent = function _maybeIndent(str) { 35195 if (this._indent && this.endsWith("\n") && str[0] !== "\n") { 35196 this._buf.queue(this._getIndent()); 35197 } 35198 }; 35199 35200 Printer.prototype._maybeAddParen = function _maybeAddParen(str) { 35201 var parenPushNewlineState = this._parenPushNewlineState; 35202 if (!parenPushNewlineState) return; 35203 this._parenPushNewlineState = null; 35204 35205 var i = void 0; 35206 for (i = 0; i < str.length && str[i] === " "; i++) { 35207 continue; 35208 }if (i === str.length) return; 35209 35210 var cha = str[i]; 35211 if (cha === "\n" || cha === "/") { 35212 this.token("("); 35213 this.indent(); 35214 parenPushNewlineState.printed = true; 35215 } 35216 }; 35217
35218 Printer.prototype._catchUp = function _catchUp(prop, loc) { 35219 if (!this.format.retainLines) return; 35220 35221 var pos = loc ? loc[prop] : null; 35222 if (pos && pos.line !== null) { 35223 var count = pos.line - this._buf.getCurrentLine(); 35224 35225 for (var i = 0; i < count; i++) { 35226 this._newline(); 35227 } 35228 } 35229 }; 35230 35231 Printer.prototype._getIndent = function _getIndent() { 35232 return (0, _repeat2.default)(this.format.indent.style, this._indent); 35233 }; 35234 35235 Printer.prototype.startTerminatorless = function startTerminatorless() { 35236 return this._parenPushNewlineState = { 35237 printed: false 35238 }; 35239 }; 35240 35241 Printer.prototype.endTerminatorless = function endTerminatorless(state) { 35242 if (state.printed) { 35243 this.dedent(); 35244 this.newline(); 35245 this.token(")"); 35246 } 35247 }; 35248 35249 Printer.prototype.print = function print(node, parent) { 35250 var _this = this; 35251 35252 if (!node) return; 35253 35254 var oldConcise = this.format.concise; 35255 if (node._compact) { 35256 this.format.concise = true; 35257 } 35258 35259 var printMethod = this[node.type]; 35260 if (!printMethod) { 35261 throw new ReferenceError("unknown node of type " + (0, _stringify2.default)(node.type) + " with constructor " + (0, _stringify2.default)(node && node.constructor.name)); 35262 } 35263 35264 this._printStack.push(node); 35265 35266 var oldInAux = this._insideAux; 35267 this._insideAux = !node.loc; 35268 this._maybeAddAuxComment(this._insideAux && !oldInAux); 35269 35270 var needsParens = n.needsParens(node, parent, this._printStack); 35271 if (this.format.retainFunctionParens && node.type === "FunctionExpression" && node.extra && node.extra.parenthesized) { 35272 needsParens = true; 35273 } 35274 if (needsParens) this.token("("); 35275 35276 this._printLeadingComments(node, parent); 35277 35278 var loc = t.isProgram(node) || t.isFile(node) ? null : node.loc; 35279 this.withSource("start", loc, function () { 35280 _this[node.type](node, parent); 35281 }); 35282 35283 this._printTrailingComments(node, parent); 35284 35285 if (needsParens) this.token(")"); 35286 35287 this._printStack.pop(); 35288 35289 this.format.concise = oldConcise; 35290 this._insideAux = oldInAux; 35291 }; 35292 35293 Printer.prototype._maybeAddAuxComment = function _maybeAddAuxComment(enteredPositionlessNode) { 35294 if (enteredPositionlessNode) this._printAuxBeforeComment(); 35295 if (!this._insideAux) this._printAuxAfterComment(); 35296 }; 35297 35298 Printer.prototype._printAuxBeforeComment = function _printAuxBeforeComment() { 35299 if (this._printAuxAfterOnNextUserNode) return; 35300 this._printAuxAfterOnNextUserNode = true; 35301 35302 var comment = this.format.auxiliaryCommentBefore; 35303 if (comment) { 35304 this._printComment({ 35305 type: "CommentBlock", 35306 value: comment 35307 }); 35308 } 35309 }; 35310 35311 Printer.prototype._printAuxAfterComment = function _printAuxAfterComment() { 35312 if (!this._printAuxAfterOnNextUserNode) return; 35313 this._printAuxAfterOnNextUserNode = false; 35314 35315 var comment = this.format.auxiliaryCommentAfter; 35316 if (comment) { 35317 this._printComment({ 35318 type: "CommentBlock", 35319 value: comment 35320 }); 35321 } 35322 }; 35323 35324 Printer.prototype.getPossibleRaw = function getPossibleRaw(node) { 35325 var extra = node.extra; 35326 if (extra && extra.raw != null && extra.rawValue != null && node.value === extra.rawValue) { 35327 return extra.raw; 35328 } 35329 }; 35330 35331 Printer.prototype.printJoin = function printJoin(nodes, parent) { 35332 var opts = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; 35333 35334 if (!nodes || !nodes.length) return; 35335 35336 if (opts.indent) this.indent(); 35337 35338 var newlineOpts = { 35339 addNewlines: opts.addNewlines 35340 }; 35341 35342 for (var i = 0; i < nodes.length; i++) { 35343 var node = nodes[i]; 35344 if (!node) continue; 35345 35346 if (opts.statement) this._printNewline(true, node, parent, newlineOpts); 35347 35348 this.print(node, parent); 35349 35350 if (opts.iterator) { 35351 opts.iterator(node, i); 35352 } 35353 35354 if (opts.separator && i < nodes.length - 1) { 35355 opts.separator.call(this); 35356 } 35357 35358 if (opts.statement) this._printNewline(false, node, parent, newlineOpts); 35359 } 35360 35361 if (opts.indent) this.dedent(); 35362 }; 35363 35364 Printer.prototype.printAndIndentOnComments = function printAndIndentOnComments(node, parent) { 35365 var indent = !!node.leadingComments; 35366 if (indent) this.indent(); 35367 this.print(node, parent); 35368 if (indent) this.dedent(); 35369 }; 35370 35371 Printer.prototype.printBlock = function printBlock(parent) { 35372 var node = parent.body; 35373
35374 if (!t.isEmptyStatement(node)) { 35375 this.space(); 35376 } 35377 35378 this.print(node, parent); 35379 }; 35380 35381 Printer.prototype._printTrailingComments = function _printTrailingComments(node, parent) { 35382 this._printComments(this._getComments(false, node, parent)); 35383 }; 35384 35385 Printer.prototype._printLeadingComments = function _printLeadingComments(node, parent) { 35386 this._printComments(this._getComments(true, node, parent)); 35387 }; 35388 35389 Printer.prototype.printInnerComments = function printInnerComments(node) { 35390 var indent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; 35391 35392 if (!node.innerComments) return; 35393 if (indent) this.indent(); 35394 this._printComments(node.innerComments); 35395 if (indent) this.dedent(); 35396 }; 35397 35398 Printer.prototype.printSequence = function printSequence(nodes, parent) { 35399 var opts = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; 35400 35401 opts.statement = true; 35402 return this.printJoin(nodes, parent, opts); 35403 }; 35404 35405 Printer.prototype.printList = function printList(items, parent) { 35406 var opts = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; 35407 35408 if (opts.separator == null) { 35409 opts.separator = commaSeparator; 35410 } 35411 35412 return this.printJoin(items, parent, opts); 35413 }; 35414 35415 Printer.prototype._printNewline = function _printNewline(leading, node, parent, opts) { 35416 var _this2 = this; 35417 35418 if (this.format.retainLines || this.format.compact) return; 35419 35420 if (this.format.concise) { 35421 this.space(); 35422 return; 35423 } 35424 35425 var lines = 0; 35426 35427 if (node.start != null && !node._ignoreUserWhitespace && this._whitespace) { 35428 if (leading) { 35429 var _comments = node.leadingComments; 35430 var _comment = _comments && (0, _find2.default)(_comments, function (comment) { 35431 return !!comment.loc && _this2.format.shouldPrintComment(comment.value); 35432 }); 35433 35434 lines = this._whitespace.getNewlinesBefore(_comment || node); 35435 } else { 35436 var _comments2 = node.trailingComments; 35437 var _comment2 = _comments2 && (0, _findLast2.default)(_comments2, function (comment) { 35438 return !!comment.loc && _this2.format.shouldPrintComment(comment.value); 35439 }); 35440 35441 lines = this._whitespace.getNewlinesAfter(_comment2 || node); 35442 } 35443 } else { 35444 if (!leading) lines++; 35445 if (opts.addNewlines) lines += opts.addNewlines(leading, node) || 0; 35446 35447 var needs = n.needsWhitespaceAfter; 35448 if (leading) needs = n.needsWhitespaceBefore; 35449 if (needs(node, parent)) lines++; 35450 35451 if (!this._buf.hasContent()) lines = 0; 35452 } 35453 35454 this.newline(lines); 35455 }; 35456 35457 Printer.prototype._getComments = function _getComments(leading, node) { 35458 return node && (leading ? node.leadingComments : node.trailingComments) || []; 35459 }; 35460 35461 Printer.prototype._printComment = function _printComment(comment) { 35462 var _this3 = this; 35463 35464 if (!this.format.shouldPrintComment(comment.value)) return; 35465 35466 if (comment.ignore) return; 35467 35468 if (this._printedComments.has(comment)) return; 35469 this._printedComments.add(comment); 35470 35471 if (comment.start != null) { 35472 if (this._printedCommentStarts[comment.start]) return; 35473 this._printedCommentStarts[comment.start] = true; 35474 } 35475 35476 this.newline(this._whitespace ? this._whitespace.getNewlinesBefore(comment) : 0); 35477 35478 if (!this.endsWith("[") && !this.endsWith("{")) this.space(); 35479 35480 var val = comment.type === "CommentLine" ? "//" + comment.value + "\n" : "/*" + comment.value + "*/"; 35481 35482 if (comment.type === "CommentBlock" && this.format.indent.adjustMultilineComment) { 35483 var offset = comment.loc && comment.loc.start.column; 35484 if (offset) { 35485 var newlineRegex = new RegExp("\\n\\s{1," + offset + "}", "g"); 35486 val = val.replace(newlineRegex, "\n"); 35487 } 35488 35489 var indentSize = Math.max(this._getIndent().length, this._buf.getCurrentColumn()); 35490 val = val.replace(/\n(?!$)/g, "\n" + (0, _repeat2.default)(" ", indentSize)); 35491 } 35492 35493 this.withSource("start", comment.loc, function () { 35494 _this3._append(val); 35495 }); 35496 35497 this.newline((this._whitespace ? this._whitespace.getNewlinesAfter(comment) : 0) + (comment.type === "CommentLine" ? -1 : 0)); 35498 }; 35499 35500 Printer.prototype._printComments = function _printComments(comments) { 35501 if (!comments || !comments.length) return; 35502 35503 for (var _iterator = comments, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) { 35504 var _ref; 35505 35506 if (_isArray) { 35507 if (_i >= _iterator.length) break; 35508 _ref = _iterator[_i++]; 35509 } else { 35510 _i = _iterator.next(); 35511 if (_i.done) break; 35512 _ref = _i.value; 35513 } 35514 35515 var _comment3 = _ref;
35516 35517 this._printComment(_comment3); 35518 } 35519 }; 35520 35521 return Printer; 35522 }(); 35523 35524 exports.default = Printer; 35525 35526 function commaSeparator() { 35527 this.token(","); 35528 this.space(); 35529 } 35530 35531 var _arr = [__webpack_require__(306), __webpack_require__(300), __webpack_require__(305), __webpack_require__(299), __webpack_require__(303), __webpack_require__(304), __webpack_require__(120), __webpack_require__(301), __webpack_require__(298), __webpack_require__(302)]; 35532 for (var _i2 = 0; _i2 < _arr.length; _i2++) { 35533 var generator = _arr[_i2]; 35534 (0, _assign2.default)(Printer.prototype, generator); 35535 } 35536 module.exports = exports["default"]; 35537 35538/***/ }, 35539/* 310 */ 35540/***/ function(module, exports, __webpack_require__) { 35541 35542 "use strict"; 35543 35544 exports.__esModule = true; 35545 35546 var _keys = __webpack_require__(13); 35547 35548 var _keys2 = _interopRequireDefault(_keys); 35549 35550 var _typeof2 = __webpack_require__(6); 35551 35552 var _typeof3 = _interopRequireDefault(_typeof2); 35553 35554 var _classCallCheck2 = __webpack_require__(3); 35555 35556 var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); 35557 35558 var _sourceMap = __webpack_require__(285); 35559 35560 var _sourceMap2 = _interopRequireDefault(_sourceMap); 35561 35562 function _interopRequireDefault(obj) { 35563 return obj && obj.__esModule ? obj : { default: obj }; 35564 } 35565 35566 var SourceMap = function () { 35567 function SourceMap(opts, code) { 35568 (0, _classCallCheck3.default)(this, SourceMap); 35569 35570 this._cachedMap = null; 35571 this._code = code; 35572 this._opts = opts; 35573 this._rawMappings = []; 35574 } 35575 35576 SourceMap.prototype.get = function get() { 35577 if (!this._cachedMap) { 35578 var map = this._cachedMap = new _sourceMap2.default.SourceMapGenerator({ 35579 file: this._opts.sourceMapTarget, 35580 sourceRoot: this._opts.sourceRoot 35581 }); 35582 35583 var code = this._code; 35584 if (typeof code === "string") { 35585 map.setSourceContent(this._opts.sourceFileName, code); 35586 } else if ((typeof code === "undefined" ? "undefined" : (0, _typeof3.default)(code)) === "object") { 35587 (0, _keys2.default)(code).forEach(function (sourceFileName) { 35588 map.setSourceContent(sourceFileName, code[sourceFileName]); 35589 }); 35590 } 35591
35592 this._rawMappings.forEach(map.addMapping, map); 35593 } 35594 35595 return this._cachedMap.toJSON(); 35596 }; 35597 35598 SourceMap.prototype.getRawMappings = function getRawMappings() { 35599 return this._rawMappings.slice(); 35600 }; 35601 35602 SourceMap.prototype.mark = function mark(generatedLine, generatedColumn, line, column, identifierName, filename) { 35603 if (this._lastGenLine !== generatedLine && line === null) return; 35604 35605 if (this._lastGenLine === generatedLine && this._lastSourceLine === line && this._lastSourceColumn === column) { 35606 return; 35607 } 35608 35609 this._cachedMap = null; 35610 this._lastGenLine = generatedLine; 35611 this._lastSourceLine = line; 35612 this._lastSourceColumn = column; 35613 35614 this._rawMappings.push({ 35615 name: identifierName || undefined, 35616 generated: { 35617 line: generatedLine, 35618 column: generatedColumn 35619 }, 35620 source: line == null ? undefined : filename || this._opts.sourceFileName, 35621 original: line == null ? undefined : { 35622 line: line, 35623 column: column 35624 } 35625 }); 35626 }; 35627 35628 return SourceMap; 35629 }(); 35630 35631 exports.default = SourceMap; 35632 module.exports = exports["default"]; 35633 35634/***/ }, 35635/* 311 */ 35636/***/ function(module, exports, __webpack_require__) { 35637 35638 "use strict"; 35639 35640 exports.__esModule = true; 35641 35642 var _classCallCheck2 = __webpack_require__(3); 35643 35644 var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); 35645 35646 function _interopRequireDefault(obj) { 35647 return obj && obj.__esModule ? obj : { default: obj }; 35648 } 35649 35650 var Whitespace = function () { 35651 function Whitespace(tokens) { 35652 (0, _classCallCheck3.default)(this, Whitespace); 35653 35654 this.tokens = tokens; 35655 this.used = {}; 35656 } 35657 35658 Whitespace.prototype.getNewlinesBefore = function getNewlinesBefore(node) { 35659 var startToken = void 0; 35660 var endToken = void 0; 35661 var tokens = this.tokens; 35662 35663 var index = this._findToken(function (token) { 35664 return token.start - node.start; 35665 }, 0, tokens.length); 35666 if (index >= 0) { 35667 while (index && node.start === tokens[index - 1].start) { 35668 --index; 35669 }startToken = tokens[index - 1]; 35670 endToken = tokens[index]; 35671 } 35672 35673 return this._getNewlinesBetween(startToken, endToken); 35674 }; 35675 35676 Whitespace.prototype.getNewlinesAfter = function getNewlinesAfter(node) { 35677 var startToken = void 0; 35678 var endToken = void 0; 35679 var tokens = this.tokens; 35680 35681 var index = this._findToken(function (token) { 35682 return token.end - node.end; 35683 }, 0, tokens.length); 35684 if (index >= 0) { 35685 while (index && node.end === tokens[index - 1].end) { 35686 --index; 35687 }startToken = tokens[index]; 35688 endToken = tokens[index + 1]; 35689 if (endToken.type.label === ",") endToken = tokens[index + 2]; 35690 } 35691 35692 if (endToken && endToken.type.label === "eof") { 35693 return 1; 35694 } else { 35695 return this._getNewlinesBetween(startToken, endToken); 35696 } 35697 }; 35698 35699 Whitespace.prototype._getNewlinesBetween = function _getNewlinesBetween(startToken, endToken) { 35700 if (!endToken || !endToken.loc) return 0; 35701 35702 var start = startToken ? startToken.loc.end.line : 1; 35703 var end = endToken.loc.start.line; 35704 var lines = 0; 35705 35706 for (var line = start; line < end; line++) { 35707 if (typeof this.used[line] === "undefined") { 35708 this.used[line] = true; 35709 lines++; 35710 } 35711 } 35712 35713 return lines; 35714 }; 35715 35716 Whitespace.prototype._findToken = function _findToken(test, start, end) { 35717 if (start >= end) return -1; 35718 var middle = start + end >>> 1; 35719 var match = test(this.tokens[middle]); 35720 if (match < 0) { 35721 return this._findToken(test, middle + 1, end); 35722 } else if (match > 0) { 35723 return this._findToken(test, start, middle); 35724 } else if (match === 0) { 35725 return middle; 35726 } 35727 return -1; 35728 }; 35729 35730 return Whitespace; 35731 }(); 35732 35733 exports.default = Whitespace; 35734 module.exports = exports["default"]; 35735 35736/***/ }, 35737/* 312 */ 35738/***/ function(module, exports, __webpack_require__) { 35739 35740 "use strict"; 35741 35742 exports.__esModule = true; 35743 35744 var _getIterator2 = __webpack_require__(2); 35745 35746 var _getIterator3 = _interopRequireDefault(_getIterator2); 35747 35748 exports.default = bindifyDecorators; 35749 35750 var _babelTypes = __webpack_require__(1); 35751 35752 var t = _interopRequireWildcard(_babelTypes); 35753 35754 function _interopRequireWildcard(obj) { 35755 if (obj && obj.__esModule) { 35756 return obj; 35757 } else { 35758 var newObj = {};if (obj != null) { 35759 for (var key in obj) { 35760 if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; 35761 } 35762 }newObj.default = obj;return newObj; 35763 } 35764 } 35765 35766 function _interopRequireDefault(obj) { 35767 return obj && obj.__esModule ? obj : { default: obj }; 35768 } 35769 35770 function bindifyDecorators(decorators) { 35771 for (var _iterator = decorators, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) { 35772 var _ref; 35773 35774 if (_isArray) { 35775 if (_i >= _iterator.length) break; 35776 _ref = _iterator[_i++]; 35777 } else { 35778 _i = _iterator.next(); 35779 if (_i.done) break; 35780 _ref = _i.value; 35781 } 35782 35783 var decoratorPath = _ref; 35784 35785 var decorator = decoratorPath.node; 35786 var expression = decorator.expression; 35787 if (!t.isMemberExpression(expression)) continue; 35788 35789 var temp = decoratorPath.scope.maybeGenerateMemoised(expression.object); 35790 var ref = void 0; 35791 35792 var nodes = []; 35793 35794 if (temp) { 35795 ref = temp; 35796 nodes.push(t.assignmentExpression("=", temp, expression.object)); 35797 } else { 35798 ref = expression.object; 35799 } 35800 35801 nodes.push(t.callExpression(t.memberExpression(t.memberExpression(ref, expression.property, expression.computed), t.identifier("bind")), [ref])); 35802 35803 if (nodes.length === 1) { 35804 decorator.expression = nodes[0]; 35805 } else { 35806 decorator.expression = t.sequenceExpression(nodes); 35807 } 35808 } 35809 } 35810 module.exports = exports["default"]; 35811 35812/***/ }, 35813/* 313 */ 35814/***/ function(module, exports, __webpack_require__) { 35815 35816 "use strict"; 35817 35818 exports.__esModule = true; 35819 35820 exports.default = function (opts) { 35821 var visitor = {}; 35822 35823 function isAssignment(node) { 35824 return node && node.operator === opts.operator + "="; 35825 } 35826 35827 function buildAssignment(left, right) { 35828 return t.assignmentExpression("=", left, right); 35829 } 35830 35831 visitor.ExpressionStatement = function (path, file) { 35832 if (path.isCompletionRecord()) return; 35833 35834 var expr = path.node.expression; 35835 if (!isAssignment(expr)) return; 35836 35837 var nodes = []; 35838 var exploded = (0, _babelHelperExplodeAssignableExpression2.default)(expr.left, nodes, file, path.scope, true); 35839
35840 nodes.push(t.expressionStatement(buildAssignment(exploded.ref, opts.build(exploded.uid, expr.right)))); 35841 35842 path.replaceWithMultiple(nodes); 35843 }; 35844 35845 visitor.AssignmentExpression = function (path, file) { 35846 var node = path.node, 35847 scope = path.scope; 35848 35849 if (!isAssignment(node)) return; 35850 35851 var nodes = []; 35852 var exploded = (0, _babelHelperExplodeAssignableExpression2.default)(node.left, nodes, file, scope); 35853 nodes.push(buildAssignment(exploded.ref, opts.build(exploded.uid, node.right))); 35854 path.replaceWithMultiple(nodes); 35855 }; 35856 35857 visitor.BinaryExpression = function (path) { 35858 var node = path.node; 35859 35860 if (node.operator === opts.operator) { 35861 path.replaceWith(opts.build(node.left, node.right)); 35862 } 35863 }; 35864 35865 return visitor; 35866 }; 35867 35868 var _babelHelperExplodeAssignableExpression = __webpack_require__(315); 35869 35870 var _babelHelperExplodeAssignableExpression2 = _interopRequireDefault(_babelHelperExplodeAssignableExpression); 35871 35872 var _babelTypes = __webpack_require__(1); 35873 35874 var t = _interopRequireWildcard(_babelTypes); 35875 35876 function _interopRequireWildcard(obj) { 35877 if (obj && obj.__esModule) { 35878 return obj; 35879 } else { 35880 var newObj = {};if (obj != null) { 35881 for (var key in obj) { 35882 if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; 35883 } 35884 }newObj.default = obj;return newObj; 35885 } 35886 } 35887 35888 function _interopRequireDefault(obj) { 35889 return obj && obj.__esModule ? obj : { default: obj }; 35890 } 35891 35892 module.exports = exports["default"]; 35893 35894/***/ }, 35895/* 314 */ 35896/***/ function(module, exports, __webpack_require__) { 35897 35898 "use strict"; 35899 35900 exports.__esModule = true; 35901 35902 exports.default = function (path) { 35903 var scope = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : path.scope; 35904 var node = path.node; 35905 35906 var container = t.functionExpression(null, [], node.body, node.generator, node.async); 35907 35908 var callee = container; 35909 var args = []; 35910 35911 (0, _babelHelperHoistVariables2.default)(path, function (id) { 35912 return scope.push({ id: id }); 35913 }); 35914 35915 var state = { 35916 foundThis: false, 35917 foundArguments: false 35918 }; 35919 35920 path.traverse(visitor, state); 35921 35922 if (state.foundArguments) { 35923 callee = t.memberExpression(container, t.identifier("apply")); 35924 args = []; 35925 35926 if (state.foundThis) { 35927 args.push(t.thisExpression()); 35928 } 35929 35930 if (state.foundArguments) { 35931 if (!state.foundThis) args.push(t.nullLiteral()); 35932 args.push(t.identifier("arguments")); 35933 } 35934 } 35935 35936 var call = t.callExpression(callee, args); 35937 if (node.generator) call = t.yieldExpression(call, true); 35938
35939 return t.returnStatement(call); 35940 }; 35941 35942 var _babelHelperHoistVariables = __webpack_require__(187); 35943 35944 var _babelHelperHoistVariables2 = _interopRequireDefault(_babelHelperHoistVariables); 35945 35946 var _babelTypes = __webpack_require__(1); 35947 35948 var t = _interopRequireWildcard(_babelTypes); 35949 35950 function _interopRequireWildcard(obj) { 35951 if (obj && obj.__esModule) { 35952 return obj; 35953 } else { 35954 var newObj = {};if (obj != null) { 35955 for (var key in obj) { 35956 if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; 35957 } 35958 }newObj.default = obj;return newObj; 35959 } 35960 } 35961 35962 function _interopRequireDefault(obj) { 35963 return obj && obj.__esModule ? obj : { default: obj }; 35964 } 35965 35966 var visitor = { 35967 enter: function enter(path, state) { 35968 if (path.isThisExpression()) { 35969 state.foundThis = true; 35970 } 35971 35972 if (path.isReferencedIdentifier({ name: "arguments" })) { 35973 state.foundArguments = true; 35974 } 35975 }, 35976 Function: function Function(path) { 35977 path.skip(); 35978 } 35979 }; 35980 35981 module.exports = exports["default"]; 35982 35983/***/ }, 35984/* 315 */ 35985/***/ function(module, exports, __webpack_require__) { 35986 35987 "use strict"; 35988 35989 exports.__esModule = true; 35990 35991 exports.default = function (node, nodes, file, scope, allowedSingleIdent) { 35992 var obj = void 0; 35993 if (t.isIdentifier(node) && allowedSingleIdent) { 35994 obj = node; 35995 } else { 35996 obj = getObjRef(node, nodes, file, scope); 35997 } 35998 35999 var ref = void 0, 36000 uid = void 0; 36001 36002 if (t.isIdentifier(node)) { 36003 ref = node; 36004 uid = obj; 36005 } else { 36006 var prop = getPropRef(node, nodes, file, scope); 36007 var computed = node.computed || t.isLiteral(prop); 36008 uid = ref = t.memberExpression(obj, prop, computed); 36009 } 36010 36011 return { 36012 uid: uid, 36013 ref: ref 36014 }; 36015 }; 36016 36017 var _babelTypes = __webpack_require__(1); 36018 36019 var t = _interopRequireWildcard(_babelTypes); 36020 36021 function _interopRequireWildcard(obj) { 36022 if (obj && obj.__esModule) { 36023 return obj; 36024 } else { 36025 var newObj = {};if (obj != null) { 36026 for (var key in obj) { 36027 if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; 36028 } 36029 }newObj.default = obj;return newObj; 36030 } 36031 } 36032 36033 function getObjRef(node, nodes, file, scope) { 36034 var ref = void 0; 36035 if (t.isSuper(node)) { 36036 return node; 36037 } else if (t.isIdentifier(node)) { 36038 if (scope.hasBinding(node.name)) { 36039 return node; 36040 } else { 36041 ref = node; 36042 } 36043 } else if (t.isMemberExpression(node)) { 36044 ref = node.object; 36045 36046 if (t.isSuper(ref) || t.isIdentifier(ref) && scope.hasBinding(ref.name)) { 36047 return ref; 36048 } 36049 } else { 36050 throw new Error("We can't explode this node type " + node.type); 36051 } 36052 36053 var temp = scope.generateUidIdentifierBasedOnNode(ref); 36054 nodes.push(t.variableDeclaration("var", [t.variableDeclarator(temp, ref)])); 36055 return temp; 36056 } 36057 36058 function getPropRef(node, nodes, file, scope) { 36059 var prop = node.property; 36060 var key = t.toComputedKey(node, prop); 36061 if (t.isLiteral(key) && t.isPureish(key)) return key; 36062 36063 var temp = scope.generateUidIdentifierBasedOnNode(prop); 36064 nodes.push(t.variableDeclaration("var", [t.variableDeclarator(temp, prop)])); 36065 return temp; 36066 } 36067 36068 module.exports = exports["default"]; 36069 36070/***/ }, 36071/* 316 */ 36072/***/ function(module, exports, __webpack_require__) { 36073 36074 "use strict"; 36075 36076 exports.__esModule = true; 36077 36078 var _getIterator2 = __webpack_require__(2); 36079 36080 var _getIterator3 = _interopRequireDefault(_getIterator2); 36081 36082 exports.default = function (classPath) { 36083 classPath.assertClass(); 36084 36085 var memoisedExpressions = []; 36086 36087 function maybeMemoise(path) { 36088 if (!path.node || path.isPure()) return; 36089 36090 var uid = classPath.scope.generateDeclaredUidIdentifier(); 36091 memoisedExpressions.push(t.assignmentExpression("=", uid, path.node)); 36092 path.replaceWith(uid); 36093 } 36094 36095 function memoiseDecorators(paths) { 36096 if (!Array.isArray(paths) || !paths.length) return; 36097 36098 paths = paths.reverse(); 36099 36100 (0, _babelHelperBindifyDecorators2.default)(paths); 36101 36102 for (var _iterator = paths, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) { 36103 var _ref; 36104 36105 if (_isArray) { 36106 if (_i >= _iterator.length) break; 36107 _ref = _iterator[_i++]; 36108 } else { 36109 _i = _iterator.next(); 36110 if (_i.done) break; 36111 _ref = _i.value; 36112 } 36113 36114 var path = _ref; 36115 36116 maybeMemoise(path); 36117 } 36118 } 36119 36120 maybeMemoise(classPath.get("superClass")); 36121 memoiseDecorators(classPath.get("decorators"), true); 36122 36123 var methods = classPath.get("body.body"); 36124 for (var _iterator2 = methods, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) { 36125 var _ref2; 36126 36127 if (_isArray2) { 36128 if (_i2 >= _iterator2.length) break; 36129 _ref2 = _iterator2[_i2++]; 36130 } else { 36131 _i2 = _iterator2.next(); 36132 if (_i2.done) break; 36133 _ref2 = _i2.value; 36134 } 36135 36136 var methodPath = _ref2; 36137 36138 if (methodPath.is("computed")) { 36139 maybeMemoise(methodPath.get("key")); 36140 } 36141 36142 if (methodPath.has("decorators")) { 36143 memoiseDecorators(classPath.get("decorators")); 36144 } 36145 } 36146 36147 if (memoisedExpressions) { 36148 classPath.insertBefore(memoisedExpressions.map(function (expr) {
36149 return t.expressionStatement(expr); 36150 })); 36151 } 36152 }; 36153 36154 var _babelHelperBindifyDecorators = __webpack_require__(312); 36155 36156 var _babelHelperBindifyDecorators2 = _interopRequireDefault(_babelHelperBindifyDecorators); 36157 36158 var _babelTypes = __webpack_require__(1); 36159 36160 var t = _interopRequireWildcard(_babelTypes); 36161 36162 function _interopRequireWildcard(obj) { 36163 if (obj && obj.__esModule) { 36164 return obj; 36165 } else { 36166 var newObj = {};if (obj != null) { 36167 for (var key in obj) { 36168 if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; 36169 } 36170 }newObj.default = obj;return newObj; 36171 } 36172 } 36173 36174 function _interopRequireDefault(obj) { 36175 return obj && obj.__esModule ? obj : { default: obj }; 36176 } 36177 36178 module.exports = exports["default"]; 36179 36180/***/ }, 36181/* 317 */ 36182/***/ function(module, exports, __webpack_require__) { 36183 36184 "use strict"; 36185 36186 exports.__esModule = true; 36187 36188 exports.default = function (path, helpers) { 36189 var node = path.node, 36190 scope = path.scope, 36191 parent = path.parent; 36192 36193 var stepKey = scope.generateUidIdentifier("step"); 36194 var stepValue = scope.generateUidIdentifier("value"); 36195 var left = node.left; 36196 var declar = void 0; 36197 36198 if (t.isIdentifier(left) || t.isPattern(left) || t.isMemberExpression(left)) { 36199 declar = t.expressionStatement(t.assignmentExpression("=", left, stepValue)); 36200 } else if (t.isVariableDeclaration(left)) { 36201 declar = t.variableDeclaration(left.kind, [t.variableDeclarator(left.declarations[0].id, stepValue)]); 36202 } 36203 36204 var template = buildForAwait(); 36205 36206 (0, _babelTraverse2.default)(template, forAwaitVisitor, null, { 36207 ITERATOR_HAD_ERROR_KEY: scope.generateUidIdentifier("didIteratorError"), 36208 ITERATOR_COMPLETION: scope.generateUidIdentifier("iteratorNormalCompletion"), 36209 ITERATOR_ERROR_KEY: scope.generateUidIdentifier("iteratorError"), 36210 ITERATOR_KEY: scope.generateUidIdentifier("iterator"), 36211 GET_ITERATOR: helpers.getAsyncIterator, 36212 OBJECT: node.right, 36213 STEP_VALUE: stepValue, 36214 STEP_KEY: stepKey, 36215 AWAIT: helpers.wrapAwait 36216 }); 36217 36218 template = template.body.body; 36219 36220 var isLabeledParent = t.isLabeledStatement(parent); 36221 var tryBody = template[3].block.body; 36222 var loop = tryBody[0]; 36223 36224 if (isLabeledParent) { 36225 tryBody[0] = t.labeledStatement(parent.label, loop); 36226 } 36227 36228 return { 36229 replaceParent: isLabeledParent, 36230 node: template, 36231 declar: declar, 36232 loop: loop 36233 }; 36234 }; 36235 36236 var _babelTypes = __webpack_require__(1); 36237 36238 var t = _interopRequireWildcard(_babelTypes); 36239 36240 var _babelTemplate = __webpack_require__(4); 36241 36242 var _babelTemplate2 = _interopRequireDefault(_babelTemplate); 36243 36244 var _babelTraverse = __webpack_require__(8); 36245 36246 var _babelTraverse2 = _interopRequireDefault(_babelTraverse); 36247 36248 function _interopRequireDefault(obj) { 36249 return obj && obj.__esModule ? obj : { default: obj }; 36250 } 36251 36252 function _interopRequireWildcard(obj) { 36253 if (obj && obj.__esModule) { 36254 return obj; 36255 } else { 36256 var newObj = {};if (obj != null) { 36257 for (var key in obj) { 36258 if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; 36259 } 36260 }newObj.default = obj;return newObj; 36261 } 36262 } 36263 36264 var buildForAwait = (0, _babelTemplate2.default)("\n function* wrapper() {\n var ITERATOR_COMPLETION = true;\n var ITERATOR_HAD_ERROR_KEY = false;\n var ITERATOR_ERROR_KEY = undefined;\n try {\n for (\n var ITERATOR_KEY = GET_ITERATOR(OBJECT), STEP_KEY, STEP_VALUE;\n (\n STEP_KEY = yield AWAIT(ITERATOR_KEY.next()),\n ITERATOR_COMPLETION = STEP_KEY.done,\n STEP_VALUE = yield AWAIT(STEP_KEY.value),\n !ITERATOR_COMPLETION\n );\n ITERATOR_COMPLETION = true) {\n }\n } catch (err) {\n ITERATOR_HAD_ERROR_KEY = true;\n ITERATOR_ERROR_KEY = err;\n } finally {\n try {\n if (!ITERATOR_COMPLETION && ITERATOR_KEY.return) {\n yield AWAIT(ITERATOR_KEY.return());\n }\n } finally {\n if (ITERATOR_HAD_ERROR_KEY) {\n throw ITERATOR_ERROR_KEY;\n }\n }\n }\n }\n"); 36265 36266 var forAwaitVisitor = { 36267 noScope: true, 36268 36269 Identifier: function Identifier(path, replacements) { 36270 if (path.node.name in replacements) { 36271 path.replaceInline(replacements[path.node.name]); 36272 } 36273 }, 36274 CallExpression: function CallExpression(path, replacements) { 36275 var callee = path.node.callee; 36276 36277 if (t.isIdentifier(callee) && callee.name === "AWAIT" && !replacements.AWAIT) { 36278 path.replaceWith(path.node.arguments[0]); 36279 } 36280 } 36281 }; 36282 36283 module.exports = exports["default"]; 36284 36285/***/ }, 36286/* 318 */ 36287/***/ function(module, exports, __webpack_require__) { 36288 36289 "use strict"; 36290 36291 exports.__esModule = true; 36292 36293 var _babelTemplate = __webpack_require__(4); 36294 36295 var _babelTemplate2 = _interopRequireDefault(_babelTemplate); 36296 36297 function _interopRequireDefault(obj) { 36298 return obj && obj.__esModule ? obj : { default: obj }; 36299 } 36300 36301 var helpers = {}; 36302 exports.default = helpers; 36303 36304 helpers.typeof = (0, _babelTemplate2.default)("\n (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\")\n ? function (obj) { return typeof obj; }\n : function (obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype\n ? \"symbol\"\n : typeof obj;\n };\n"); 36305 36306 helpers.jsx = (0, _babelTemplate2.default)("\n (function () {\n var REACT_ELEMENT_TYPE = (typeof Symbol === \"function\" && Symbol.for && Symbol.for(\"react.element\")) || 0xeac7;\n\n return function createRawReactElement (type, props, key, children) {\n var defaultProps = type && type.defaultProps;\n var childrenLength = arguments.length - 3;\n\n if (!props && childrenLength !== 0) {\n // If we're going to assign props.children, we create a new object now\n // to avoid mutating defaultProps.\n props = {};\n }
36306\n if (props && defaultProps) {\n for (var propName in defaultProps) {\n if (props[propName] === void 0) {\n props[propName] = defaultProps[propName];\n }\n }\n } else if (!props) {\n props = defaultProps || {};\n }\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 3];\n }\n props.children = childArray;\n }\n\n return {\n $$typeof: REACT_ELEMENT_TYPE,\n type: type,\n key: key === undefined ? null : '' + key,\n ref: null,\n props: props,\n _owner: null,\n };\n };\n\n })()\n"); 36307 36308 helpers.asyncIterator = (0, _babelTemplate2.default)("\n (function (iterable) {\n if (typeof Symbol === \"function\") {\n if (Symbol.asyncIterator) {\n var method = iterable[Symbol.asyncIterator];\n if (method != null) return method.call(iterable);\n }\n if (Symbol.iterator) {\n return iterable[Symbol.iterator]();\n }\n }\n throw new TypeError(\"Object is not async iterable\");\n })\n"); 36309 36310 helpers.asyncGenerator = (0, _babelTemplate2.default)("\n (function () {\n function AwaitValue(value) {\n this.value = value;\n }\n\n function AsyncGenerator(gen) {\n var front, back;\n\n function send(key, arg) {\n return new Promise(function (resolve, reject) {\n var request = {\n key: key,\n arg: arg,\n resolve: resolve,\n reject: reject,\n next: null\n };\n\n if (back) {\n back = back.next = request;\n } else {\n front = back = request;\n resume(key, arg);\n }\n });\n }\n\n function resume(key, arg) {\n try {\n var result = gen[key](arg)\n var value = result.value;\n if (value instanceof AwaitValue) {\n Promise.resolve(value.value).then(\n function (arg) { resume(\"next\", arg); },\n function (arg) { resume(\"throw\", arg); });\n } else {\n settle(result.done ? \"return\" : \"normal\", result.value);\n }\n } catch (err) {\n settle(\"throw\", err);\n }\n }\n\n function settle(type, value) {\n switch (type) {\n case \"return\":\n front.resolve({ value: value, done: true });\n break;\n case \"throw\":\n front.reject(value);\n break;\n default:\n front.resolve({ value: value, done: false });\n break;\n }\n\n front = front.next;\n if (front) {\n resume(front.key, front.arg);\n } else {\n back = null;\n }\n }\n\n this._invoke = send;\n\n // Hide \"return\" method if generator return is not supported\n if (typeof gen.return !== \"function\") {\n this.return = undefined;\n }\n }\n\n if (typeof Symbol === \"function\" && Symbol.asyncIterator) {\n AsyncGenerator.prototype[Symbol.asyncIterator] = function () { return this; };\n }\n\n AsyncGenerator.prototype.next = function (arg) { return this._invoke(\"next\", arg); };\n AsyncGenerator.prototype.throw = function (arg) { return this._invoke(\"throw\", arg); };\n AsyncGenerator.prototype.return = function (arg) { return this._invoke(\"return\", arg); };\n\n return {\n wrap: function (fn) {\n return function () {\n return new AsyncGenerator(fn.apply(this, arguments));\n };\n },\n await: function (value) {\n return new AwaitValue(value);\n }\n };\n\n })()\n"); 36311 36312 helpers.asyncGeneratorDelegate = (0, _babelTemplate2.default)("\n (function (inner, awaitWrap) {\n var iter = {}, waiting = false;\n\n function pump(key, value) {\n waiting = true;\n value = new Promise(function (resolve) { resolve(inner[key](value)); });\n return { done: false, value: awaitWrap(value) };\n };\n\n if (typeof Symbol === \"function\" && Symbol.iterator) {\n iter[Symbol.iterator] = function () { return this; };\n }\n\n iter.next = function (value) {\n if (waiting) {\n waiting = false;\n return value;\n }\n return pump(\"next\", value);\n };\n\n if (typeof inner.throw === \"function\") {\n iter.throw = function (value) {\n if (waiting) {\n waiting = false;\n throw value;\n }\n return pump(\"throw\", value);\n };\n }\n\n if (typeof inner.return === \"function\") {\n iter.return = function (value) {\n return pump(\"return\", value);\n };\n }\n\n return iter;\n })\n"); 36313 36314 helpers.asyncToGenerator = (0, _babelTemplate2.default)("\n (function (fn) {\n return function () {\n var gen = fn.apply(this, arguments);\n return new Promise(function (resolve, reject) {\n function step(key, arg) {\n try {\n var info = gen[key](arg);\n var value = info.value;\n } catch (error) {\n reject(error);\n return;\n }\n\n if (info.done) {\n resolve(value);\n } else {\n return Promise.resolve(value).then(function (value) {\n step(\"next\", value);\n }, function (err) {\n step(\"throw\", err);\n });\n }\n }\n\n return step(\"next\");\n });\n };\n })\n"); 36315 36316 helpers.classCallCheck = (0, _babelTemplate2.default)("\n (function (instance, Constructor) {\n if (!(instance instanceof Constructor)) {\
36316n throw new TypeError(\"Cannot call a class as a function\");\n }\n });\n"); 36317 36318 helpers.createClass = (0, _babelTemplate2.default)("\n (function() {\n function defineProperties(target, props) {\n for (var i = 0; i < props.length; i ++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n\n return function (Constructor, protoProps, staticProps) {\n if (protoProps) defineProperties(Constructor.prototype, protoProps);\n if (staticProps) defineProperties(Constructor, staticProps);\n return Constructor;\n };\n })()\n"); 36319 36320 helpers.defineEnumerableProperties = (0, _babelTemplate2.default)("\n (function (obj, descs) {\n for (var key in descs) {\n var desc = descs[key];\n desc.configurable = desc.enumerable = true;\n if (\"value\" in desc) desc.writable = true;\n Object.defineProperty(obj, key, desc);\n }\n return obj;\n })\n"); 36321 36322 helpers.defaults = (0, _babelTemplate2.default)("\n (function (obj, defaults) {\n var keys = Object.getOwnPropertyNames(defaults);\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n var value = Object.getOwnPropertyDescriptor(defaults, key);\n if (value && value.configurable && obj[key] === undefined) {\n Object.defineProperty(obj, key, value);\n }\n }\n return obj;\n })\n"); 36323 36324 helpers.defineProperty = (0, _babelTemplate2.default)("\n (function (obj, key, value) {\n // Shortcircuit the slow defineProperty path when possible.\n // We are trying to avoid issues where setters defined on the\n // prototype cause side effects under the fast path of simple\n // assignment. By checking for existence of the property with\n // the in operator, we can optimize most of this overhead away.\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n return obj;\n });\n"); 36325 36326 helpers.extends = (0, _babelTemplate2.default)("\n Object.assign || (function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n return target;\n })\n"); 36327 36328 helpers.get = (0, _babelTemplate2.default)("\n (function get(object, property, receiver) {\n if (object === null) object = Function.prototype;\n\n var desc = Object.getOwnPropertyDescriptor(object, property);\n\n if (desc === undefined) {\n var parent = Object.getPrototypeOf(object);\n\n if (parent === null) {\n return undefined;\n } else {\n return get(parent, property, receiver);\n }\n } else if (\"value\" in desc) {\n return desc.value;\n } else {\n var getter = desc.get;\n\n if (getter === undefined) {\n return undefined;\n }\n\n return getter.call(receiver);\n }\n });\n"); 36329 36330 helpers.inherits = (0, _babelTemplate2.default)("\n (function (subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass);\n }\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;\n })\n"); 36331 36332 helpers.instanceof = (0, _babelTemplate2.default)("\n (function (left, right) {\n if (right != null && typeof Symbol !== \"undefined\" && right[Symbol.hasInstance]) {\
36332n return right[Symbol.hasInstance](left);\n } else {\n return left instanceof right;\n }\n });\n"); 36333 36334 helpers.interopRequireDefault = (0, _babelTemplate2.default)("\n (function (obj) {\n return obj && obj.__esModule ? obj : { default: obj };\n })\n"); 36335 36336 helpers.interopRequireWildcard = (0, _babelTemplate2.default)("\n (function (obj) {\n if (obj && obj.__esModule) {\n return obj;\n } else {\n var newObj = {};\n if (obj != null) {\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];\n }\n }\n newObj.default = obj;\n return newObj;\n }\n })\n"); 36337 36338 helpers.newArrowCheck = (0, _babelTemplate2.default)("\n (function (innerThis, boundThis) {\n if (innerThis !== boundThis) {\n throw new TypeError(\"Cannot instantiate an arrow function\");\n }\n });\n"); 36339 36340 helpers.objectDestructuringEmpty = (0, _babelTemplate2.default)("\n (function (obj) {\n if (obj == null) throw new TypeError(\"Cannot destructure undefined\");\n });\n"); 36341 36342 helpers.objectWithoutProperties = (0, _babelTemplate2.default)("\n (function (obj, keys) {\n var target = {};\n for (var i in obj) {\n if (keys.indexOf(i) >= 0) continue;\n if (!Object.prototype.hasOwnProperty.call(obj, i)) continue;\n target[i] = obj[i];\n }\n return target;\n })\n"); 36343 36344 helpers.possibleConstructorReturn = (0, _babelTemplate2.default)("\n (function (self, call) {\n if (!self) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self;\n });\n"); 36345 36346 helpers.selfGlobal = (0, _babelTemplate2.default)("\n typeof global === \"undefined\" ? self : global\n"); 36347 36348 helpers.set = (0, _babelTemplate2.default)("\n (function set(object, property, value, receiver) {\n var desc = Object.getOwnPropertyDescriptor(object, property);\n\n if (desc === undefined) {\n var parent = Object.getPrototypeOf(object);\n\n if (parent !== null) {\n set(parent, property, value, receiver);\n }\n } else if (\"value\" in desc && desc.writable) {\n desc.value = value;\n } else {\n var setter = desc.set;\n\n if (setter !== undefined) {\n setter.call(receiver, value);\n }\n }\n\n return value;\n });\n"); 36349 36350 helpers.slicedToArray = (0, _babelTemplate2.default)("\n (function () {\n // Broken out into a separate function to avoid deoptimizations due to the try/catch for the\n // array iterator case.\n function sliceIterator(arr, i) {\n // this is an expanded form of `for...of` that properly supports abrupt completions of\n // iterators etc. variable names have been minimised to reduce the size of this massive\n // helper. sometimes spec compliancy is annoying :(\n //\n // _n = _iteratorNormalCompletion\n // _d = _didIteratorError\n // _e = _iteratorError\n // _i = _iterator\n // _s = _step\n\n var _arr = [];\n var _n = true;\n var _d = false;\n var _e = undefined;\n try {\n for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {\n _arr.push(_s.value);\n if (i && _arr.length === i) break;\n }\n } catch (err) {\n _d = true;\n _e = err;\n } finally {\n try {\n if (!_n && _i[\"return\"]) _i[\"return\"]();\n } finally {\n if (_d) throw _e;\n }\n }\n return _arr;\n }\n\n return function (arr, i) {\n if (Array.isArray(arr)) {\n return arr;\n } else if (Symbol.iterator in Object(arr)) {\n return sliceIterator(arr, i);\n } else {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance\");\n }\n };\n })();\n"); 36351 36352 helpers.slicedToArrayLoose = (0, _babelTemplate2.default)("\n (function (arr, i) {\n if (Array.isArray(arr)) {\n return arr;\n } else if (Symbol.iterator in Object(arr)) {\n var _arr = [];\n for (var _iterator = arr[Symbol.iterator](), _step; !(_step = _iterator.next()).done;) {\n _arr.push(_step.value);\n if (i && _arr.length === i) break;\n }\n return _arr;\n }
36352 else {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance\");\n }\n });\n"); 36353 36354 helpers.taggedTemplateLiteral = (0, _babelTemplate2.default)("\n (function (strings, raw) {\n return Object.freeze(Object.defineProperties(strings, {\n raw: { value: Object.freeze(raw) }\n }));\n });\n"); 36355 36356 helpers.taggedTemplateLiteralLoose = (0, _babelTemplate2.default)("\n (function (strings, raw) {\n strings.raw = raw;\n return strings;\n });\n"); 36357 36358 helpers.temporalRef = (0, _babelTemplate2.default)("\n (function (val, name, undef) {\n if (val === undef) {\n throw new ReferenceError(name + \" is not defined - temporal dead zone\");\n } else {\n return val;\n }\n })\n"); 36359 36360 helpers.temporalUndefined = (0, _babelTemplate2.default)("\n ({})\n"); 36361 36362 helpers.toArray = (0, _babelTemplate2.default)("\n (function (arr) {\n return Array.isArray(arr) ? arr : Array.from(arr);\n });\n"); 36363 36364 helpers.toConsumableArray = (0, _babelTemplate2.default)("\n (function (arr) {\n if (Array.isArray(arr)) {\n for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i];\n return arr2;\n } else {\n return Array.from(arr);\n }\n });\n"); 36365 module.exports = exports["default"]; 36366 36367/***/ }, 36368/* 319 */ 36369/***/ function(module, exports) { 36370 36371 "use strict"; 36372 36373 exports.__esModule = true; 36374 36375 exports.default = function (_ref) { 36376 var t = _ref.types; 36377 36378 return { 36379 pre: function pre(file) { 36380 file.set("helpersNamespace", t.identifier("babelHelpers")); 36381 } 36382 }; 36383 }; 36384 36385 module.exports = exports["default"]; 36386 36387/***/ }, 36388/* 320 */ 36389/***/ function(module, exports) { 36390 36391 "use strict"; 36392 36393 exports.__esModule = true; 36394 36395 exports.default = function () { 36396 return { 36397 manipulateOptions: function manipulateOptions(opts, parserOpts) { 36398 parserOpts.plugins.push("dynamicImport"); 36399 } 36400 }; 36401 }; 36402 36403 module.exports = exports["default"]; 36404 36405/***/ }, 36406/* 321 */ 36407/***/ function(module, exports) { 36408 36409 "use strict"; 36410 36411 exports.__esModule = true; 36412 36413 exports.default = function () { 36414 return { 36415 manipulateOptions: function manipulateOptions(opts, parserOpts) { 36416 parserOpts.plugins.push("functionSent"); 36417 } 36418 }; 36419 }; 36420 36421 module.exports = exports["default"]; 36422 36423/***/ }, 36424/* 322 */ 36425/***/ function(module, exports, __webpack_require__) { 36426 36427 "use strict"; 36428 36429 exports.__esModule = true; 36430 36431 exports.default = function () { 36432 return { 36433 inherits: __webpack_require__(65) 36434 }; 36435 }; 36436 36437 module.exports = exports["default"]; 36438 36439/***/ }, 36440/* 323 */ 36441/***/ function(module, exports, __webpack_require__) { 36442 36443 "use strict"; 36444 36445 exports.__esModule = true; 36446 36447 exports.default = function (_ref) { 36448 var t = _ref.types; 36449 36450 var yieldStarVisitor = { 36451 Function: function Function(path) { 36452 path.skip(); 36453 }, 36454 YieldExpression: function YieldExpression(_ref2, state) { 36455 var node = _ref2.node; 36456 36457 if (!node.delegate) return; 36458 var callee = state.addHelper("asyncGeneratorDelegate"); 36459 node.argument = t.callExpression(callee, [t.callExpression(state.addHelper("asyncIterator"), [node.argument]), t.memberExpression(state.addHelper("asyncGenerator"), t.identifier("await"))]); 36460 } 36461 }; 36462 36463 return { 36464 inherits: __webpack_require__(192), 36465 visitor: { 36466 Function: function Function(path, state) { 36467 if (!path.node.async || !path.node.generator) return; 36468 36469 path.traverse(yieldStarVisitor, state); 36470 36471 (0, _babelHelperRemapAsyncToGenerator2.default)(path, state.file, { 36472 wrapAsync: t.memberExpression(state.addHelper("asyncGenerator"), t.identifier("wrap")), 36473 wrapAwait: t.memberExpression(state.addHelper("asyncGenerator"), t.identifier("await")) 36474 }); 36475 } 36476 } 36477 }; 36478 }; 36479 36480 var _babelHelperRemapAsyncToGenerator = __webpack_require__(121); 36481 36482 var _babelHelperRemapAsyncToGenerator2 = _interopRequireDefault(_babelHelperRemapAsyncToGenerator); 36483 36484 function _interopRequireDefault(obj) { 36485 return obj && obj.__esModule ? obj : { default: obj }; 36486 } 36487 36488 module.exports = exports["default"]; 36489 36490/***/ }, 36491/* 324 */ 36492/***/ function(module, exports, __webpack_require__) { 36493 36494 "use strict"; 36495 36496 exports.__esModule = true; 36497 36498 exports.default = function () { 36499 return { 36500 inherits: __webpack_require__(65), 36501 36502 visitor: { 36503 Function: function Function(path, state) { 36504 if (!path.node.async || path.node.generator) return; 36505 36506 (0, _babelHelperRemapAsyncToGenerator2.default)(path, state.file, { 36507 wrapAsync: state.addImport(state.opts.module, state.opts.method) 36508 }); 36509 } 36510 } 36511 }; 36512 }; 36513 36514 var _babelHelperRemapAsyncToGenerator = __webpack_require__(121); 36515 36516 var _babelHelperRemapAsyncToGenerator2 = _interopRequireDefault(_babelHelperRemapAsyncToGenerator); 36517 36518 function _interopRequireDefault(obj) { 36519 return obj && obj.__esModule ? obj : { default: obj }; 36520 } 36521 36522 module.exports = exports["default"]; 36523 36524/***/ }, 36525/* 325 */ 36526/***/ function(module, exports, __webpack_require__) { 36527 36528 'use strict'; 36529 36530 Object.defineProperty(exports, "__esModule", { 36531 value: true 36532 }); 36533 36534 exports.default = function (_ref) { 36535 var t = _ref.types; 36536 36537 /** 36538 * Add a helper to take an initial descriptor, apply some decorators to it, and optionally 36539 * define the property. 36540 */ 36541 function ensureApplyDecoratedDescriptorHelper(path, state) { 36542 if (!state.applyDecoratedDescriptor) { 36543 state.applyDecoratedDescriptor = path.scope.generateUidIdentifier('applyDecoratedDescriptor'); 36544 var helper = buildApplyDecoratedDescriptor({ 36545 NAME: state.applyDecoratedDescriptor 36546 }); 36547 path.scope.getProgramParent().path.unshiftContainer('body', helper); 36548 } 36549 36550 return state.applyDecoratedDescriptor; 36551 } 36552 36553 /** 36554 * Add a helper to call as a replacement for class property definition. 36555 */ 36556 function ensureInitializerDefineProp(path, state) { 36557 if (!state.initializerDefineProp) { 36558 state.initializerDefineProp = path.scope.generateUidIdentifier('initDefineProp'); 36559 var helper = buildInitializerDefineProperty({ 36560 NAME: state.initializerDefineProp 36561 }); 36562 path.scope.getProgramParent().path.unshiftContainer('body', helper); 36563 } 36564 36565 return state.initializerDefineProp; 36566 } 36567 36568 /** 36569 * Add a helper that will throw a useful error if the transform fails to detect the class 36570 * property assignment, so users know something failed. 36571 */ 36572 function ensureInitializerWarning(path, state) { 36573 if (!state.initializerWarningHelper) { 36574 state.initializerWarningHelper = path.scope.generateUidIdentifier('initializerWarningHelper'); 36575 var helper = buildInitializerWarningHelper({ 36576 NAME: state.initializerWarningHelper 36577 }); 36578 path.scope.getProgramParent().path.unshiftContainer('body', helper); 36579 } 36580 36581 return state.initializerWarningHelper; 36582 } 36583 36584 /** 36585 * If the decorator expressions are non-identifiers, hoist them to before the class so we can be sure 36586 * that they are evaluated in order. 36587 */ 36588 function applyEnsureOrdering(path) { 36589 // TODO: This should probably also hoist computed properties. 36590 var decorators = (path.isClass() ? [path].concat(path.get('body.body')) : path.get('properties')).reduce(function (acc, prop
36590) { 36591 return acc.concat(prop.node.decorators || []); 36592 }, []); 36593 36594 var identDecorators = decorators.filter(function (decorator) { 36595 return !t.isIdentifier(decorator.expression); 36596 }); 36597 if (identDecorators.length === 0) return; 36598 36599 return t.sequenceExpression(identDecorators.map(function (decorator) { 36600 var expression = decorator.expression; 36601 var id = decorator.expression = path.scope.generateDeclaredUidIdentifier('dec'); 36602 return t.assignmentExpression('=', id, expression); 36603 }).concat([path.node])); 36604 } 36605 36606 /** 36607 * Given a class expression with class-level decorators, create a new expression 36608 * with the proper decorated behavior. 36609 */ 36610 function applyClassDecorators(classPath, state) { 36611 var decorators = classPath.node.decorators || []; 36612 classPath.node.decorators = null; 36613 36614 if (decorators.length === 0) return; 36615 36616 var name = classPath.scope.generateDeclaredUidIdentifier('class'); 36617 36618 return decorators.map(function (dec) { 36619 return dec.expression; 36620 }).reverse().reduce(function (acc, decorator) { 36621 return buildClassDecorator({ 36622 CLASS_REF: name, 36623 DECORATOR: decorator, 36624 INNER: acc 36625 }).expression; 36626 }, classPath.node); 36627 } 36628 36629 /** 36630 * Given a class expression with method-level decorators, create a new expression 36631 * with the proper decorated behavior. 36632 */ 36633 function applyMethodDecorators(path, state) { 36634 var hasMethodDecorators = path.node.body.body.some(function (node) { 36635 return (node.decorators || []).length > 0; 36636 }); 36637 36638 if (!hasMethodDecorators) return; 36639 36640 return applyTargetDecorators(path, state, path.node.body.body); 36641 } 36642 36643 /** 36644 * Given an object expression with property decorators, create a new expression 36645 * with the proper decorated behavior. 36646 */ 36647 function applyObjectDecorators(path, state) { 36648 var hasMethodDecorators = path.node.properties.some(function (node) { 36649 return (node.decorators || []).length > 0; 36650 }); 36651 36652 if (!hasMethodDecorators) return; 36653 36654 return applyTargetDecorators(path, state, path.node.properties); 36655 } 36656 36657 /** 36658 * A helper to pull out property decorators into a sequence expression. 36659 */ 36660 function applyTargetDecorators(path, state, decoratedProps) { 36661 var descName = path.scope.generateDeclaredUidIdentifier('desc'); 36662 var valueTemp = path.scope.generateDeclaredUidIdentifier('value'); 36663 36664 var name = path.scope.generateDeclaredUidIdentifier(path.isClass() ? 'class' : 'obj'); 36665 36666 var exprs = decoratedProps.reduce(function (acc, node) { 36667 var decorators = node.decorators || []; 36668 node.decorators = null; 36669 36670 if (decorators.length === 0) return acc; 36671 36672 if (node.computed) { 36673 throw path.buildCodeFrameError('Computed method/property decorators are not yet supported.'); 36674 } 36675 36676 var property = t.isLiteral(node.key) ? node.key : t.stringLiteral(node.key.name); 36677 36678 var target = path.isClass() && !node.static ? buildClassPrototype({ 36679 CLASS_REF: name 36680 }).expression : name; 36681 36682 if (t.isClassProperty(node, { static: false })) { 36683 var descriptor = path.scope.generateDeclaredUidIdentifier('descriptor'); 36684 36685 var initializer = node.value ? t.functionExpression(null, [], t.blockStatement([t.returnStatement
36685(node.value)])) : t.nullLiteral(); 36686 node.value = t.callExpression(ensureInitializerWarning(path, state), [descriptor, t.thisExpression()]); 36687 36688 acc = acc.concat([t.assignmentExpression('=', descriptor, t.callExpression(ensureApplyDecoratedDescriptorHelper(path, state), [target, property, t.arrayExpression(decorators.map(function (dec) { 36689 return dec.expression; 36690 })), t.objectExpression([t.objectProperty(t.identifier('enumerable'), t.booleanLiteral(true)), t.objectProperty(t.identifier('initializer'), initializer)])]))]); 36691 } else { 36692 acc = acc.concat(t.callExpression(ensureApplyDecoratedDescriptorHelper(path, state), [target, property, t.arrayExpression(decorators.map(function (dec) { 36693 return dec.expression; 36694 })), t.isObjectProperty(node) || t.isClassProperty(node, { static: true }) ? buildGetObjectInitializer({ 36695 TEMP: path.scope.generateDeclaredUidIdentifier('init'), 36696 TARGET: target, 36697 PROPERTY: property 36698 }).expression : buildGetDescriptor({ 36699 TARGET: target, 36700 PROPERTY: property 36701 }).expression, target])); 36702 } 36703 36704 return acc; 36705 }, []); 36706 36707 return t.sequenceExpression([t.assignmentExpression('=', name, path.node), t.sequenceExpression(exprs), name]); 36708 } 36709 36710 return { 36711 inherits: __webpack_require__(122), 36712 36713 visitor: { 36714 ExportDefaultDeclaration: function ExportDefaultDeclaration(path) { 36715 if (!path.get("declaration").isClassDeclaration()) return; 36716 36717 var node = path.node; 36718 36719 var ref = node.declaration.id || path.scope.generateUidIdentifier("default"); 36720 node.declaration.id = ref; 36721 36722 // Split the class declaration and the export into two separate statements. 36723 path.replaceWith(node.declaration); 36724 path.insertAfter(t.exportNamedDeclaration(null, [t.exportSpecifier(ref, t.identifier('default'))])); 36725 }, 36726 ClassDeclaration: function ClassDeclaration(path) { 36727 var node = path.node; 36728 36729 var ref = node.id || path.scope.generateUidIdentifier("class"); 36730 36731 path.replaceWith(t.variableDeclaration("let", [t.variableDeclarator(ref, t.toExpression(node))])); 36732 }, 36733 ClassExpression: function ClassExpression(path, state) { 36734 // Create a replacement for the class node if there is one. We do one pass to replace classes with 36735 // class decorators, and a second pass to process method decorators. 36736 var decoratedClass = applyEnsureOrdering(path) || applyClassDecorators(path, state) || applyMethodDecorators(path, state); 36737 36738 if (decoratedClass) path.replaceWith(decoratedClass); 36739 }, 36740 ObjectExpression: function ObjectExpression(path, state) { 36741 var decoratedObject = applyEnsureOrdering(path) || applyObjectDecorators(path, state); 36742 36743 if (decoratedObject) path.replaceWith(decoratedObject); 36744 }, 36745 AssignmentExpression: function AssignmentExpression(path, state) { 36746 if (!state.initializerWarningHelper) return; 36747 36748 if (!path.get('left').isMemberExpression()) return; 36749 if (!path.get('left.property').isIdentifier()) return; 36750 if (!path.get('right').isCallExpression()) return; 36751 if (!path.get('right.callee').isIdentifier({ name: state.initializerWarningHelper.name })) return; 36752 36753 path.replaceWith(t.callExpression(ensureInitializerDefineProp(path, state), [path.get('left.object').node, t.stringLiteral(path.get('left.property').node.name), path.get('right.arguments')[0].node, path.get('right.arguments')[1].node])); 36754 } 36755 } 36756 }; 36757 }; 36758 36759 var _babelTemplate = __webpack_require__(4); 36760 36761 var _babelTemplate2 = _interopRequireDefault(_babelTemplate); 36762 36763 function _interopRequireDefault(obj) { 36764 return obj && obj.__esModule ? obj : { default: obj }; 36765 } 36766 36767 var buildClassDecorator = (0, _babelTemplate2.default)('\n DECORATOR(CLASS_REF = INNER) || CLASS_REF;\n'); 36768 36769 var buildClassPrototype = (0, _babelTemplate2.default)('\n CLASS_REF.prototype;\n'); 36770 36771 var buildGetDescriptor = (0, _babelTemplate2.default)('\n Object.getOwnPropertyDescriptor(TARGET, PROPERTY);\n'); 36772 36773 var buildGetObjectInitializer = (0, _babelTemplate2.default)('\n (TEMP = Object.getOwnPropertyDescriptor(TARGET, PROPERTY), (TEMP = TEMP ? TEMP.value : undefined), {\n enumerable: true,\n configurable: true,\n writable: true,\n initializer: function(){\n return TEMP;\n }\n })\n'); 36774 36775 var buildInitializerWarningHelper = (0, _babelTemplate2.default)('\n function NAME(descriptor, context){\n throw new Error(\'Decorating class property failed. Please ensure that transform-class-properties is enabled.\');\n }\n'); 36776 36777 var buildInitializerDefineProperty = (0, _babelTemplate2.default)('\n function NAME(target, property, descriptor, context){\n if (!descriptor) return;\n\n Object.defineProperty(target, property, {\n enumerable: descriptor.enumerable,\n configurable: descriptor.configurable,\n writable: descriptor.writable,\n value: descriptor.initializer ? descriptor.initializer.call(context) : void 0,\n });\n }\n'); 36778 36779 var buildApplyDecoratedDescriptor = (0, _babelTemplate2.default)('\n function NAME(target, property, decorators, descriptor, context){\n var desc = {};\n Object[\'ke\' + \'ys\'](descriptor).forEach(function(key){\n desc[key] = descriptor[key];\n });\n desc.enumerable = !!desc.enumerable;\n desc.configurable = !!desc.configurable;\n if (\'value\' in desc || desc.initializer){\n desc.writable = true;\n }\n\n desc = decorators.slice().reverse().reduce(function(desc, decorator){\n return decorator(target, property, desc) || desc;\n }, desc);\n\n if (context && desc.initializer !== void 0){\n desc.value = desc.initializer ? desc.initializer.call(context) : void 0;\n desc.initializer = undefined;\n }\n\n if (desc.initializer === void 0){\n // This is a hack to avoid this being processed by \'transform-runtime\'.\n // See issue #9.\n Object[\'define\' + \'Property\'](target, property, desc);\n desc = null;\n }\n\n return desc;\n }\n'); 36780 36781 ; 36782 36783/***/ }, 36784/* 326 */ 36785/***/ function(module, exports, __webpack_require__) { 36786 36787 "use strict"; 36788 36789 exports.__esModule = true; 36790 exports.visitor = undefined; 36791 36792 var _babelTypes = __webpack_require__(1); 36793 36794 var t = _interopRequireWildcard(_babelTypes); 36795 36796 function _interopRequireWildcard(obj) { 36797 if (obj && obj.__esModule) { 36798 return obj; 36799 } else { 36800 var newObj = {};if (obj != null) { 36801 for (var key in obj) { 36802 if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; 36803 } 36804 }newObj.default = obj;return newObj; 36805 } 36806 } 36807 36808 function getTDZStatus(refPath, bindingPath) { 36809 var executionStatus = bindingPath._guessExecutionStatusRelativeTo(refPath); 36810 36811 if (executionStatus === "before") { 36812 return "inside"; 36813 } else if (executionStatus === "after") { 36814 return "outside"; 36815 } else { 36816 return "maybe"; 36817 } 36818 } 36819 36820 function buildTDZAssert(node, file) { 36821 return t.callExpression(file.addHelper("temporalRef"), [node, t.stringLiteral(node.name), file.addHelper("temporalUndefined")]); 36822 } 36823 36824 function isReference(node, scope, state) { 36825 var declared = state.letReferences[node.name]; 36826 if (!declared) return false;
36827 36828 return scope.getBindingIdentifier(node.name) === declared; 36829 } 36830 36831 var visitor = exports.visitor = { 36832 ReferencedIdentifier: function ReferencedIdentifier(path, state) { 36833 if (!this.file.opts.tdz) return; 36834 36835 var node = path.node, 36836 parent = path.parent, 36837 scope = path.scope; 36838 36839 if (path.parentPath.isFor({ left: node })) return; 36840 if (!isReference(node, scope, state)) return; 36841 36842 var bindingPath = scope.getBinding(node.name).path; 36843 36844 var status = getTDZStatus(path, bindingPath); 36845 if (status === "inside") return; 36846 36847 if (status === "maybe") { 36848 var assert = buildTDZAssert(node, state.file); 36849 36850 bindingPath.parent._tdzThis = true; 36851 36852 path.skip(); 36853 36854 if (path.parentPath.isUpdateExpression()) { 36855 if (parent._ignoreBlockScopingTDZ) return; 36856 path.parentPath.replaceWith(t.sequenceExpression([assert, parent])); 36857 } else { 36858 path.replaceWith(assert); 36859 } 36860 } else if (status === "outside") { 36861 path.replaceWith(t.throwStatement(t.inherits(t.newExpression(t.identifier("ReferenceError"), [t.stringLiteral(node.name + " is not defined - temporal dead zone")]), node))); 36862 } 36863 }, 36864 36865 AssignmentExpression: { 36866 exit: function exit(path, state) { 36867 if (!this.file.opts.tdz) return; 36868 36869 var node = path.node; 36870 36871 if (node._ignoreBlockScopingTDZ) return; 36872 36873 var nodes = []; 36874 var ids = path.getBindingIdentifiers(); 36875 36876 for (var name in ids) { 36877 var id = ids[name]; 36878 36879 if (isReference(id, path.scope, state)) { 36880 nodes.push(buildTDZAssert(id, state.file)); 36881 } 36882 } 36883 36884 if (nodes.length) { 36885 node._ignoreBlockScopingTDZ = true; 36886 nodes.push(node); 36887 path.replaceWithMultiple(nodes.map(t.expressionStatement)); 36888 } 36889 } 36890 } 36891 }; 36892 36893/***/ }, 36894/* 327 */ 36895/***/ function(module, exports, __webpack_require__) { 36896 36897 "use strict"; 36898 36899 exports.__esModule = true; 36900 36901 var _classCallCheck2 = __webpack_require__(3); 36902 36903 var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); 36904 36905 var _possibleConstructorReturn2 = __webpack_require__(42); 36906 36907 var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); 36908 36909 var _inherits2 = __webpack_require__(41); 36910 36911 var _inherits3 = _interopRequireDefault(_inherits2); 36912 36913 var _babelHelperFunctionName = __webpack_require__(40); 36914 36915 var _babelHelperFunctionName2 = _interopRequireDefault(_babelHelperFunctionName); 36916 36917 var _vanilla = __webpack_require__(204); 36918 36919 var _vanilla2 = _interopRequireDefault(_vanilla); 36920 36921 var _babelTypes = __webpack_require__(1); 36922 36923 var t = _interopRequireWildcard(_babelTypes); 36924 36925 function _interopRequireWildcard(obj) { 36926 if (obj && obj.__esModule) { 36927 return obj; 36928 } else { 36929 var newObj = {};if (obj != null) { 36930 for (var key in obj) { 36931 if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; 36932 } 36933 }newObj.default = obj;return newObj; 36934 } 36935 } 36936 36937 function _interopRequireDefault(obj) { 36938 return obj && obj.__esModule ? obj : { default: obj }; 36939 } 36940 36941 var LooseClassTransformer = function (_VanillaTransformer) { 36942 (0, _inherits3.default)(LooseClassTransformer, _VanillaTransformer); 36943 36944 function LooseClassTransformer() { 36945 (0, _classCallCheck3.default)(this, LooseClassTransformer); 36946 36947 var _this = (0, _possibleConstructorReturn3.default)(this, _VanillaTransformer.apply(this, arguments)); 36948 36949 _this.isLoose = true; 36950 return _this; 36951 } 36952 36953 LooseClassTransformer.prototype._processMethod = function _processMethod(node, scope) { 36954 if (!node.decorators) { 36955 36956 var classRef = this.classRef; 36957 if (!node.static) classRef = t.memberExpression(classRef, t.identifier("prototype")); 36958 var methodName = t.memberExpression(classRef, node.key, node.computed || t.isLiteral(node.key)); 36959 36960 var func = t.functionExpression(null, node.params, node.body, node.generator, node.async); 36961 func.returnType = node.returnType; 36962 var key = t.toComputedKey(node, node.key); 36963 if (t.isStringLiteral(key)) { 36964 func = (0, _babelHelperFunctionName2.default)({ 36965 node: func, 36966 id: key, 36967 scope: scope 36968 }); 36969 } 36970
36971 var expr = t.expressionStatement(t.assignmentExpression("=", methodName, func)); 36972 t.inheritsComments(expr, node); 36973 this.body.push(expr); 36974 return true; 36975 } 36976 }; 36977 36978 return LooseClassTransformer; 36979 }(_vanilla2.default); 36980 36981 exports.default = LooseClassTransformer; 36982 module.exports = exports["default"]; 36983 36984/***/ }, 36985/* 328 */ 36986/***/ function(module, exports) { 36987 36988 "use strict"; 36989 36990 exports.__esModule = true; 36991 36992 exports.default = function (_ref) { 36993 var t = _ref.types; 36994 36995 return { 36996 visitor: { 36997 BinaryExpression: function BinaryExpression(path) { 36998 var node = path.node; 36999 37000 if (node.operator === "instanceof") { 37001 path.replaceWith(t.callExpression(this.addHelper("instanceof"), [node.left, node.right])); 37002 } 37003 } 37004 } 37005 }; 37006 }; 37007 37008 module.exports = exports["default"]; 37009 37010/***/ }, 37011/* 329 */ 37012/***/ function(module, exports, __webpack_require__) { 37013 37014 "use strict"; 37015 37016 exports.__esModule = true; 37017 exports.visitor = undefined; 37018 37019 var _getIterator2 = __webpack_require__(2); 37020 37021 var _getIterator3 = _interopRequireDefault(_getIterator2); 37022 37023 var _babelHelperGetFunctionArity = __webpack_require__(186); 37024 37025 var _babelHelperGetFunctionArity2 = _interopRequireDefault(_babelHelperGetFunctionArity); 37026 37027 var _babelHelperCallDelegate = __webpack_require__(314); 37028 37029 var _babelHelperCallDelegate2 = _interopRequireDefault(_babelHelperCallDelegate); 37030 37031 var _babelTemplate = __webpack_require__(4); 37032 37033 var _babelTemplate2 = _interopRequireDefault(_babelTemplate); 37034 37035 var _babelTypes = __webpack_require__(1); 37036 37037 var t = _interopRequireWildcard(_babelTypes); 37038 37039 function _interopRequireWildcard(obj) { 37040 if (obj && obj.__esModule) { 37041 return obj; 37042 } else { 37043 var newObj = {};if (obj != null) { 37044 for (var key in obj) { 37045 if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; 37046 } 37047 }newObj.default = obj;return newObj; 37048 } 37049 } 37050 37051 function _interopRequireDefault(obj) { 37052 return obj && obj.__esModule ? obj : { default: obj }; 37053 } 37054 37055 var buildDefaultParam = (0, _babelTemplate2.default)("\n let VARIABLE_NAME =\n ARGUMENTS.length > ARGUMENT_KEY && ARGUMENTS[ARGUMENT_KEY] !== undefined ?\n ARGUMENTS[ARGUMENT_KEY]\n :\n DEFAULT_VALUE;\n"); 37056 37057 var buildCutOff = (0, _babelTemplate2.default)("\n let $0 = $1[$2];\n"); 37058 37059 function hasDefaults(node) { 37060 for (var _iterator = node.params, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) { 37061 var _ref; 37062 37063 if (_isArray) { 37064 if (_i >= _iterator.length) break; 37065 _ref = _iterator[_i++]; 37066 } else { 37067 _i = _iterator.next(); 37068 if (_i.done) break; 37069 _ref = _i.value; 37070 } 37071 37072 var param = _ref;
37073 37074 if (!t.isIdentifier(param)) return true; 37075 } 37076 return false; 37077 } 37078 37079 function isSafeBinding(scope, node) { 37080 if (!scope.hasOwnBinding(node.name)) return true; 37081 37082 var _scope$getOwnBinding = scope.getOwnBinding(node.name), 37083 kind = _scope$getOwnBinding.kind; 37084 37085 return kind === "param" || kind === "local"; 37086 } 37087 37088 var iifeVisitor = { 37089 ReferencedIdentifier: function ReferencedIdentifier(path, state) { 37090 var scope = path.scope, 37091 node = path.node; 37092 37093 if (node.name === "eval" || !isSafeBinding(scope, node)) { 37094 state.iife = true; 37095 path.stop(); 37096 } 37097 }, 37098 Scope: function Scope(path) { 37099 path.skip(); 37100 } 37101 }; 37102 37103 var visitor = exports.visitor = { 37104 Function: function Function(path) { 37105 var node = path.node, 37106 scope = path.scope; 37107 37108 if (!hasDefaults(node)) return; 37109 37110 path.ensureBlock(); 37111 37112 var state = { 37113 iife: false, 37114 scope: scope 37115 }; 37116 37117 var body = []; 37118 37119 var argsIdentifier = t.identifier("arguments"); 37120 argsIdentifier._shadowedFunctionLiteral = path; 37121 37122 function pushDefNode(left, right, i) { 37123 var defNode = buildDefaultParam({ 37124 VARIABLE_NAME: left, 37125 DEFAULT_VALUE: right, 37126 ARGUMENT_KEY: t.numericLiteral(i), 37127 ARGUMENTS: argsIdentifier 37128 }); 37129 defNode._blockHoist = node.params.length - i; 37130 body.push(defNode); 37131 } 37132 37133 var lastNonDefaultParam = (0, _babelHelperGetFunctionArity2.default)(node); 37134 37135 var params = path.get("params"); 37136 for (var i = 0; i < params.length; i++) { 37137 var param = params[i]; 37138 37139 if (!param.isAssignmentPattern()) { 37140 if (!state.iife && !param.isIdentifier()) { 37141 param.traverse(iifeVisitor, state); 37142 } 37143 37144 continue; 37145 } 37146 37147 var left = param.get("left"); 37148 var right = param.get("right"); 37149 37150 if (i >= lastNonDefaultParam || left.isPattern()) { 37151 var placeholder = scope.generateUidIdentifier("x"); 37152 placeholder._isDefaultPlaceholder = true; 37153 node.params[i] = placeholder; 37154 } else { 37155 node.params[i] = left.node; 37156 } 37157 37158 if (!state.iife) { 37159 if (right.isIdentifier() && !isSafeBinding(scope, right.node)) { 37160 state.iife = true; 37161 } else { 37162 right.traverse(iifeVisitor, state); 37163 } 37164 } 37165 37166 pushDefNode(left.node, right.node, i); 37167 } 37168 37169 for (var _i2 = lastNonDefaultParam + 1; _i2 < node.params.length; _i2++) { 37170 var _param = node.params[_i2]; 37171 if (_param._isDefaultPlaceholder) continue; 37172 37173 var declar = buildCutOff(_param, argsIdentifier, t.numericLiteral(_i2)); 37174 declar._blockHoist = node.params.length - _i2; 37175 body.push(declar); 37176 } 37177 37178 node.params = node.params.slice(0, lastNonDefaultParam); 37179 37180 if (state.iife) { 37181 body.push((0, _babelHelperCallDelegate2.default)(path, scope)); 37182 path.set("body", t.blockStatement(body)); 37183 } else { 37184 path.get("body").unshiftContainer("body", body); 37185 } 37186 } 37187 }; 37188 37189/***/ }, 37190/* 330 */ 37191/***/ function(module, exports, __webpack_require__) { 37192 37193 "use strict"; 37194 37195 exports.__esModule = true; 37196 exports.visitor = undefined; 37197 37198 var _babelTypes = __webpack_require__(1); 37199 37200 var t = _interopRequireWildcard(_babelTypes); 37201 37202 function _interopRequireWildcard(obj) { 37203 if (obj && obj.__esModule) { 37204 return obj; 37205 } else { 37206 var newObj = {};if (obj != null) { 37207 for (var key in obj) { 37208 if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; 37209 } 37210 }newObj.default = obj;return newObj; 37211 } 37212 } 37213 37214 var visitor = exports.visitor = { 37215 Function: function Function(path) { 37216 var params = path.get("params"); 37217 37218 var hoistTweak = t.isRestElement(params[params.length - 1]) ? 1 : 0; 37219 var outputParamsLength = params.length - hoistTweak; 37220 37221 for (var i = 0; i < outputParamsLength; i++) { 37222 var param = params[i]; 37223 if (param.isArrayPattern() || param.isObjectPattern()) { 37224 var uid = path.scope.generateUidIdentifier("ref"); 37225 37226 var declar = t.variableDeclaration("let", [t.variableDeclarator(param.node, uid)]); 37227 declar._blockHoist = outputParamsLength - i; 37228 37229 path.ensureBlock(); 37230 path.get("body").unshiftContainer("body", declar); 37231 37232 param.replaceWith(uid); 37233 } 37234 } 37235 } 37236 }; 37237 37238/***/ }, 37239/* 331 */ 37240/***/ function(module, exports, __webpack_require__) { 37241 37242 "use strict"; 37243 37244 exports.__esModule = true; 37245 exports.visitor = undefined; 37246 37247 var _getIterator2 = __webpack_require__(2); 37248 37249 var _getIterator3 = _interopRequireDefault(_getIterator2); 37250 37251 var _babelTemplate = __webpack_require__(4); 37252 37253 var _babelTemplate2 = _interopRequireDefault(_babelTemplate); 37254 37255 var _babelTypes = __webpack_require__(1); 37256 37257 var t = _interopRequireWildcard(_babelTypes); 37258 37259 function _interopRequireWildcard(obj) { 37260 if (obj && obj.__esModule) { 37261 return obj; 37262 } else { 37263 var newObj = {};if (obj != null) { 37264 for (var key in obj) { 37265 if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; 37266 } 37267 }newObj.default = obj;return newObj; 37268 } 37269 } 37270 37271 function _interopRequireDefault(obj) { 37272 return obj && obj.__esModule ? obj : { default: obj }; 37273 } 37274 37275 var buildRest = (0, _babelTemplate2.default)("\n for (var LEN = ARGUMENTS.length,\n ARRAY = Array(ARRAY_LEN),\n KEY = START;\n KEY < LEN;\n KEY++) {\n ARRAY[ARRAY_KEY] = ARGUMENTS[KEY];\n }\n"); 37276 37277 var restIndex = (0, _babelTemplate2.default)("\n ARGUMENTS.length <= INDEX ? undefined : ARGUMENTS[INDEX]\n"); 37278 37279 var restIndexImpure = (0, _babelTemplate2.default)("\n REF = INDEX, ARGUMENTS.length <= REF ? undefined : ARGUMENTS[REF]\n"); 37280 37281 var restLength = (0, _babelTemplate2.default)("\n ARGUMENTS.length <= OFFSET ? 0 : ARGUMENTS.length - OFFSET\n"); 37282 37283 var memberExpressionOptimisationVisitor = { 37284 Scope: function Scope(path, state) { 37285 if (!path.scope.bindingIdentifierEquals(state.name, state.outerBinding)) { 37286 path.skip(); 37287 } 37288 }, 37289 Flow: function Flow(path) { 37290 if (path.isTypeCastExpression()) return; 37291 37292 path.skip(); 37293 }, 37294 37295 "Function|ClassProperty": function FunctionClassProperty(path, state) { 37296 var oldNoOptimise = state.noOptimise; 37297 state.noOptimise = true; 37298 path.traverse(memberExpressionOptimisationVisitor, state); 37299 state.noOptimise = oldNoOptimise; 37300 37301 path.skip(); 37302 }, 37303 37304 ReferencedIdentifier: function ReferencedIdentifier(path, state) { 37305 var node = path.node; 37306 37307 if (node.name === "arguments") { 37308 state.deopted = true; 37309 } 37310 37311 if (node.name !== state.name) return; 37312 37313 if (state.noOptimise) { 37314 state.deopted = true; 37315 } else { 37316 var parentPath = path.parentPath; 37317 37318 if (parentPath.listKey === "params" && parentPath.key < state.offset) { 37319 return; 37320 } 37321 37322 if (parentPath.isMemberExpression({ object: node })) { 37323 var grandparentPath = parentPath.parentPath; 37324 37325 var argsOptEligible = !state.deopted && !(grandparentPath.isAssignmentExpression() && parentPath.node === grandparentPath.node.left || grandparentPath.isLVal() || grandparentPath.isForXStatement
37325() || grandparentPath.isUpdateExpression() || grandparentPath.isUnaryExpression({ operator: "delete" }) || (grandparentPath.isCallExpression() || grandparentPath.isNewExpression()) && parentPath.node === grandparentPath.node.callee); 37326 37327 if (argsOptEligible) { 37328 if (parentPath.node.computed) { 37329 if (parentPath.get("property").isBaseType("number")) { 37330 state.candidates.push({ cause: "indexGetter", path: path }); 37331 return; 37332 } 37333 } else if (parentPath.node.property.name === "length") { 37334 state.candidates.push({ cause: "lengthGetter", path: path }); 37335 return; 37336 } 37337 } 37338 } 37339 37340 if (state.offset === 0 && parentPath.isSpreadElement()) { 37341 var call = parentPath.parentPath; 37342 if (call.isCallExpression() && call.node.arguments.length === 1) { 37343 state.candidates.push({ cause: "argSpread", path: path }); 37344 return; 37345 } 37346 } 37347 37348 state.references.push(path); 37349 } 37350 }, 37351 BindingIdentifier: function BindingIdentifier(_ref, state) { 37352 var node = _ref.node; 37353 37354 if (node.name === state.name) { 37355 state.deopted = true; 37356 } 37357 } 37358 }; 37359 function hasRest(node) { 37360 return t.isRestElement(node.params[node.params.length - 1]); 37361 } 37362 37363 function optimiseIndexGetter(path, argsId, offset) { 37364 var index = void 0; 37365 37366 if (t.isNumericLiteral(path.parent.property)) { 37367 index = t.numericLiteral(path.parent.property.value + offset); 37368 } else if (offset === 0) { 37369 index = path.parent.property; 37370 } else { 37371 index = t.binaryExpression("+", path.parent.property, t.numericLiteral(offset)); 37372 } 37373 37374 var scope = path.scope; 37375 37376 if (!scope.isPure(index)) { 37377 var temp = scope.generateUidIdentifierBasedOnNode(index); 37378 scope.push({ id: temp, kind: "var" }); 37379 path.parentPath.replaceWith(restIndexImpure({ 37380 ARGUMENTS: argsId, 37381 INDEX: index, 37382 REF: temp 37383 })); 37384 } else { 37385 path.parentPath.replaceWith(restIndex({ 37386 ARGUMENTS: argsId, 37387 INDEX: index 37388 })); 37389 } 37390 } 37391 37392 function optimiseLengthGetter(path, argsId, offset) { 37393 if (offset) { 37394 path.parentPath.replaceWith(restLength({ 37395 ARGUMENTS: argsId, 37396 OFFSET: t.numericLiteral(offset) 37397 })); 37398 } else { 37399 path.replaceWith(argsId); 37400 } 37401 } 37402 37403 var visitor = exports.visitor = { 37404 Function: function Function(path) { 37405 var node = path.node, 37406 scope = path.scope; 37407 37408 if (!hasRest(node)) return; 37409 37410 var rest = node.params.pop().argument; 37411 37412 var argsId = t.identifier("arguments"); 37413 37414 argsId._shadowedFunctionLiteral = path; 37415 37416 var state = { 37417 references: [], 37418 offset: node.params.length, 37419 37420 argumentsNode: argsId, 37421 outerBinding: scope.getBindingIdentifier(rest.name), 37422 37423 candidates: [], 37424 37425 name: rest.name, 37426 37427 deopted: false 37428 }; 37429 37430 path.traverse(memberExpressionOptimisationVisitor, state); 37431 37432 if (!state.deopted && !state.references.length) { 37433 for (var _iterator = state.candidates, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) { 37434 var _ref3; 37435 37436 if (_isArray) { 37437 if (_i >= _iterator.length) break; 37438 _ref3 = _iterator[_i++]; 37439 } else { 37440 _i = _iterator.next(); 37441 if (_i.done) break; 37442 _ref3 = _i.value; 37443 } 37444 37445 var _ref4 = _ref3; 37446 var _path = _ref4.path, 37447 cause = _ref4.cause; 37448 37449 switch (cause) { 37450 case "indexGetter": 37451 optimiseIndexGetter(_path, argsId, state.offset); 37452 break; 37453 case "lengthGetter": 37454 optimiseLengthGetter(_path, argsId, state.offset); 37455 break; 37456 default: 37457 _path.replaceWith(argsId); 37458 } 37459 } 37460 return; 37461 } 37462 37463 state.references = state.references.concat(state.candidates.map(function (_ref5) { 37464 var path = _ref5.path; 37465 return path; 37466 })); 37467 37468 state.deopted = state.deopted || !!node.shadow; 37469 37470 var start = t.numericLiteral(node.params.length); 37471 var key = scope.generateUidIdentifier("key"); 37472 var len = scope.generateUidIdentifier("len"); 37473 37474 var arrKey = key; 37475 var arrLen = len; 37476 if (node.params.length) { 37477 arrKey = t.binaryExpression("-", key, start); 37478 37479 arrLen = t.conditionalExpression(t.binaryExpression(">", len, start), t.binaryExpression("-", len, start), t.numericLiteral(0)); 37480 } 37481 37482 var loop = buildRest({ 37483 ARGUMENTS: argsId, 37484 ARRAY_KEY: arrKey, 37485 ARRAY_LEN: arrLen, 37486 START: start, 37487 ARRAY: rest, 37488 KEY: key, 37489 LEN: len 37490 }); 37491 37492 if (state.deopted) { 37493 loop._blockHoist = node.params.length + 1; 37494 node.body.body.unshift(loop); 37495 } else { 37496 loop._blockHoist = 1; 37497 37498 var target = path.getEarliestCommonAncestorFrom(state.references).getStatementParent(); 37499 37500 target.findParent(function (path) { 37501 if (path.isLoop()) { 37502 target = path; 37503 } else { 37504 return path.isFunction(); 37505 } 37506 }); 37507 37508 target.insertBefore(loop); 37509 } 37510 } 37511 }; 37512 37513/***/ }, 37514/* 332 */
37515/***/ function(module, exports) { 37516 37517 "use strict"; 37518 37519 exports.__esModule = true; 37520 37521 exports.default = function (_ref) { 37522 var t = _ref.types; 37523 37524 return { 37525 visitor: { 37526 MemberExpression: { 37527 exit: function exit(_ref2) { 37528 var node = _ref2.node; 37529 37530 var prop = node.property; 37531 if (!node.computed && t.isIdentifier(prop) && !t.isValidIdentifier(prop.name)) { 37532 node.property = t.stringLiteral(prop.name); 37533 node.computed = true; 37534 } 37535 } 37536 } 37537 } 37538 }; 37539 }; 37540 37541 module.exports = exports["default"]; 37542 37543/***/ }, 37544/* 333 */ 37545/***/ function(module, exports) { 37546 37547 "use strict"; 37548 37549 exports.__esModule = true; 37550 37551 exports.default = function (_ref) { 37552 var t = _ref.types; 37553 37554 return { 37555 visitor: { 37556 ObjectProperty: { 37557 exit: function exit(_ref2) { 37558 var node = _ref2.node; 37559 37560 var key = node.key; 37561 if (!node.computed && t.isIdentifier(key) && !t.isValidIdentifier(key.name)) { 37562 node.key = t.stringLiteral(key.name); 37563 } 37564 } 37565 } 37566 } 37567 }; 37568 }; 37569 37570 module.exports = exports["default"]; 37571 37572/***/ }, 37573/* 334 */ 37574/***/ function(module, exports, __webpack_require__) { 37575 37576 "use strict"; 37577 37578 exports.__esModule = true; 37579 37580 var _getIterator2 = __webpack_require__(2); 37581 37582 var _getIterator3 = _interopRequireDefault(_getIterator2); 37583 37584 exports.default = function (_ref) { 37585 var t = _ref.types; 37586 37587 return { 37588 visitor: { 37589 ObjectExpression: function ObjectExpression(path, file) { 37590 var node = path.node; 37591 37592 var hasAny = false; 37593 for (var _iterator = node.properties, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) { 37594 var _ref2; 37595 37596 if (_isArray) { 37597 if (_i >= _iterator.length) break; 37598 _ref2 = _iterator[_i++]; 37599 } else { 37600 _i = _iterator.next(); 37601 if (_i.done) break; 37602 _ref2 = _i.value; 37603 } 37604 37605 var prop = _ref2; 37606 37607 if (prop.kind === "get" || prop.kind === "set") { 37608 hasAny = true; 37609 break; 37610 } 37611 } 37612 if (!hasAny) return; 37613 37614 var mutatorMap = {}; 37615 37616 node.properties = node.properties.filter(function (prop) { 37617 if (!prop.computed && (prop.kind === "get" || prop.kind === "set")) { 37618 defineMap.push(mutatorMap, prop, null, file); 37619 return false; 37620 } else { 37621 return true; 37622 } 37623 }); 37624 37625 path.replaceWith(t.callExpression(t.memberExpression(t.identifier("Object"), t.identifier("defineProperties")), [node, defineMap.toDefineObject(mutatorMap)])); 37626 } 37627 } 37628 }; 37629 }; 37630 37631 var _babelHelperDefineMap = __webpack_require__(185); 37632 37633 var defineMap = _interopRequireWildcard(_babelHelperDefineMap); 37634 37635 function _interopRequireWildcard(obj) { 37636 if (obj && obj.__esModule) { 37637 return obj; 37638 } else { 37639 var newObj = {};if (obj != null) { 37640 for (var key in obj) { 37641 if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; 37642 } 37643 }newObj.default = obj;return newObj; 37644 } 37645 } 37646 37647 function _interopRequireDefault(obj) { 37648 return obj && obj.__esModule ? obj : { default: obj }; 37649 } 37650 37651 module.exports = exports["default"]; 37652 37653/***/ }, 37654/* 335 */ 37655/***/ function(module, exports) { 37656 37657 "use strict"; 37658 37659 exports.__esModule = true; 37660 37661 exports.default = function (_ref) { 37662 var parse = _ref.parse, 37663 traverse = _ref.traverse; 37664 37665 return { 37666 visitor: { 37667 CallExpression: function CallExpression(path) { 37668 if (path.get("callee").isIdentifier({ name: "eval" }) && path.node.arguments.length === 1) { 37669 var evaluate = path.get("arguments")[0].evaluate(); 37670 if (!evaluate.confident) return; 37671 37672 var code = evaluate.value; 37673 if (typeof code !== "string") return; 37674 37675 var ast = parse(code); 37676 traverse.removeProperties(ast); 37677 return ast.program; 37678 } 37679 } 37680 } 37681 }; 37682 }; 37683 37684 module.exports = exports["default"]; 37685 37686/***/ }, 37687/* 336 */ 37688/***/ function(module, exports, __webpack_require__) { 37689 37690 "use strict"; 37691 37692 exports.__esModule = true; 37693 37694 exports.default = function (_ref) { 37695 var t = _ref.types; 37696 37697 function wrapInFlowComment(path, parent) { 37698 path.addComment("trailing", generateComment(path, parent)); 37699 path.replaceWith(t.noop()); 37700 } 37701 37702 function generateComment(path, parent) { 37703 var comment = path.getSource().replace(/\*-\//g, "*-ESCAPED/").replace(/\*\//g, "*-/"); 37704 if (parent && parent.optional) comment = "?" + comment; 37705 if (comment[0] !== ":") comment = ":: " + comment; 37706 return comment; 37707 } 37708 37709 return { 37710 inherits: __webpack_require__(123), 37711 37712 visitor: { 37713 TypeCastExpression: function TypeCastExpression(path) { 37714 var node = path.node; 37715 37716 path.get("expression").addComment("trailing", generateComment(path.get("typeAnnotation"))); 37717 path.replaceWith(t.parenthesizedExpression(node.expression)); 37718 }, 37719 Identifier: function Identifier(path) { 37720 var node = path.node; 37721 37722 if (!node.optional || node.typeAnnotation) { 37723 return; 37724 } 37725 path.addComment("trailing", ":: ?"); 37726 }, 37727 37728 AssignmentPattern: { 37729 exit: function exit(_ref2) { 37730 var node = _ref2.node; 37731 37732 node.left.optional = false;
37733 } 37734 }, 37735 37736 Function: { 37737 exit: function exit(_ref3) { 37738 var node = _ref3.node; 37739 37740 node.params.forEach(function (param) { 37741 return param.optional = false; 37742 }); 37743 } 37744 }, 37745 37746 ClassProperty: function ClassProperty(path) { 37747 var node = path.node, 37748 parent = path.parent; 37749 37750 if (!node.value) wrapInFlowComment(path, parent); 37751 }, 37752 "ExportNamedDeclaration|Flow": function ExportNamedDeclarationFlow(path) { 37753 var node = path.node, 37754 parent = path.parent; 37755 37756 if (t.isExportNamedDeclaration(node) && !t.isFlow(node.declaration)) { 37757 return; 37758 } 37759 wrapInFlowComment(path, parent); 37760 }, 37761 ImportDeclaration: function ImportDeclaration(path) { 37762 var node = path.node, 37763 parent = path.parent; 37764 37765 if (t.isImportDeclaration(node) && node.importKind !== "type" && node.importKind !== "typeof") { 37766 return; 37767 } 37768 wrapInFlowComment(path, parent); 37769 } 37770 } 37771 }; 37772 }; 37773 37774 module.exports = exports["default"]; 37775 37776/***/ }, 37777/* 337 */ 37778/***/ function(module, exports) { 37779 37780 "use strict"; 37781 37782 exports.__esModule = true; 37783 37784 exports.default = function (_ref) { 37785 var t = _ref.types; 37786 37787 return { 37788 visitor: { 37789 FunctionExpression: { 37790 exit: function exit(path) { 37791 var node = path.node; 37792 37793 if (!node.id) return; 37794 node._ignoreUserWhitespace = true; 37795 37796 path.replaceWith(t.callExpression(t.functionExpression(null, [], t.blockStatement([t.toStatement(node), t.returnStatement
37796(node.id)])), [])); 37797 } 37798 } 37799 } 37800 }; 37801 }; 37802 37803 module.exports = exports["default"]; 37804 37805/***/ }, 37806/* 338 */ 37807/***/ function(module, exports) { 37808 37809 "use strict"; 37810 37811 exports.__esModule = true; 37812 37813 exports.default = function () { 37814 return { 37815 visitor: { 37816 CallExpression: function CallExpression(path, file) { 37817 if (path.get("callee").matchesPattern("Object.assign")) { 37818 path.node.callee = file.addHelper("extends"); 37819 } 37820 } 37821 } 37822 }; 37823 }; 37824 37825 module.exports = exports["default"]; 37826 37827/***/ }, 37828/* 339 */ 37829/***/ function(module, exports) { 37830 37831 "use strict"; 37832 37833 exports.__esModule = true; 37834 37835 exports.default = function () { 37836 return { 37837 visitor: { 37838 CallExpression: function CallExpression(path, file) { 37839 if (path.get("callee").matchesPattern("Object.setPrototypeOf")) { 37840 path.node.callee = file.addHelper("defaults"); 37841 } 37842 } 37843 } 37844 }; 37845 }; 37846 37847 module.exports = exports["default"]; 37848 37849/***/ }, 37850/* 340 */ 37851/***/ function(module, exports, __webpack_require__) { 37852 37853 "use strict"; 37854 37855 exports.__esModule = true; 37856 37857 var _getIterator2 = __webpack_require__(2); 37858 37859 var _getIterator3 = _interopRequireDefault(_getIterator2); 37860 37861 exports.default = function (_ref) { 37862 var t = _ref.types; 37863 37864 function isProtoKey(node) { 37865 return t.isLiteral(t.toComputedKey(node, node.key), { value: "__proto__" }); 37866 } 37867 37868 function isProtoAssignmentExpression(node) { 37869 var left = node.left; 37870 return t.isMemberExpression(left) && t.isLiteral(t.toComputedKey(left, left.property), { value: "__proto__" }); 37871 } 37872 37873 function buildDefaultsCallExpression(expr, ref, file) { 37874 return t.expressionStatement(t.callExpression(file.addHelper("defaults"), [ref, expr.right])); 37875 } 37876 37877 return { 37878 visitor: { 37879 AssignmentExpression: function AssignmentExpression(path, file) { 37880 if (!isProtoAssignmentExpression(path.node)) return; 37881 37882 var nodes = []; 37883 var left = path.node.left.object; 37884 var temp = path.scope.maybeGenerateMemoised(left); 37885 37886 if (temp) nodes.push(t.expressionStatement(t.assignmentExpression("=", temp, left))); 37887 nodes.push(buildDefaultsCallExpression(path.node, temp || left, file)); 37888 if (temp) nodes.push(temp); 37889 37890 path.replaceWithMultiple(nodes); 37891 }, 37892 ExpressionStatement: function ExpressionStatement(path, file) { 37893 var expr = path.node.expression; 37894 if (!t.isAssignmentExpression(expr, { operator: "=" })) return; 37895 37896 if (isProtoAssignmentExpression(expr)) { 37897 path.replaceWith(buildDefaultsCallExpression(expr, expr.left.object, file)); 37898 } 37899 }, 37900 ObjectExpression: function ObjectExpression(path, file) { 37901 var proto = void 0; 37902 var node = path.node; 37903 37904 for (var _iterator = node.properties, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) { 37905 var _ref2; 37906 37907 if (_isArray) { 37908 if (_i >= _iterator.length) break; 37909 _ref2 = _iterator[_i++]; 37910 } else { 37911 _i = _iterator.next(); 37912 if (_i.done) break; 37913 _ref2 = _i.value; 37914 } 37915 37916 var prop = _ref2; 37917 37918 if (isProtoKey(prop)) { 37919 proto = prop.value; 37920 (0, _pull2.default)(node.properties, prop); 37921 } 37922 } 37923 37924 if (proto) { 37925 var args = [t.objectExpression([]), proto]; 37926 if (node.properties.length) args.push(node); 37927 path.replaceWith(t.callExpression(file.addHelper("extends"), args)); 37928 } 37929 } 37930 } 37931 }; 37932 }; 37933 37934 var _pull = __webpack_require__(273); 37935 37936 var _pull2 = _interopRequireDefault(_pull); 37937 37938 function _interopRequireDefault(obj) { 37939 return obj && obj.__esModule ? obj : { default: obj }; 37940 } 37941 37942 module.exports = exports["default"]; 37943 37944/***/ }, 37945/* 341 */ 37946/***/ function(module, exports, __webpack_require__) { 37947 37948 "use strict"; 37949 37950 exports.__esModule = true; 37951 37952 var _typeof2 = __webpack_require__(6); 37953 37954 var _typeof3 = _interopRequireDefault(_typeof2); 37955 37956 exports.default = function (_ref) { 37957 var t = _ref.types; 37958 37959 var immutabilityVisitor = { 37960 enter: function enter(path, state) { 37961 var stop = function stop() { 37962 state.isImmutable = false;
37963 path.stop(); 37964 }; 37965 37966 if (path.isJSXClosingElement()) { 37967 path.skip(); 37968 return; 37969 } 37970 37971 if (path.isJSXIdentifier({ name: "ref" }) && path.parentPath.isJSXAttribute({ name: path.node })) { 37972 return stop(); 37973 } 37974 37975 if (path.isJSXIdentifier() || path.isIdentifier() || path.isJSXMemberExpression()) { 37976 return; 37977 } 37978 37979 if (!path.isImmutable()) { 37980 if (path.isPure()) { 37981 var expressionResult = path.evaluate(); 37982 if (expressionResult.confident) { 37983 var value = expressionResult.value; 37984 37985 var isMutable = value && (typeof value === "undefined" ? "undefined" : (0, _typeof3.default)(value)) === "object" || typeof value === "function"; 37986 if (!isMutable) { 37987 return; 37988 } 37989 } else if (t.isIdentifier(expressionResult.deopt)) { 37990 return; 37991 } 37992 } 37993 stop(); 37994 } 37995 } 37996 }; 37997 37998 return { 37999 visitor: { 38000 JSXElement: function JSXElement(path) { 38001 if (path.node._hoisted) return; 38002 38003 var state = { isImmutable: true }; 38004 path.traverse(immutabilityVisitor, state); 38005 38006 if (state.isImmutable) { 38007 path.hoist(); 38008 } else { 38009 path.node._hoisted = true; 38010 } 38011 } 38012 } 38013 }; 38014 }; 38015 38016 function _interopRequireDefault(obj) { 38017 return obj && obj.__esModule ? obj : { default: obj }; 38018 } 38019 38020 module.exports = exports["default"]; 38021 38022/***/ }, 38023/* 342 */ 38024/***/ function(module, exports, __webpack_require__) { 38025 38026 "use strict"; 38027 38028 exports.__esModule = true; 38029 38030 var _getIterator2 = __webpack_require__(2); 38031 38032 var _getIterator3 = _interopRequireDefault(_getIterator2); 38033 38034 exports.default = function (_ref) { 38035 var t = _ref.types; 38036 38037 function hasRefOrSpread(attrs) { 38038 for (var i = 0; i < attrs.length; i++) { 38039 var attr = attrs[i]; 38040 if (t.isJSXSpreadAttribute(attr)) return true; 38041 if (isJSXAttributeOfName(attr, "ref")) return true; 38042 } 38043 return false; 38044 } 38045 38046 function isJSXAttributeOfName(attr, name) { 38047 return t.isJSXAttribute(attr) && t.isJSXIdentifier(attr.name, { name: name }); 38048 } 38049 38050 function getAttributeValue(attr) { 38051 var value = attr.value; 38052 if (!value) return t.identifier("true"); 38053 if (t.isJSXExpressionContainer(value)) value = value.expression; 38054 return value; 38055 } 38056 38057 return { 38058 visitor: { 38059 JSXElement: function JSXElement(path, file) { 38060 var node = path.node; 38061 38062 var open = node.openingElement; 38063 if (hasRefOrSpread(open.attributes)) return; 38064 38065 var props = t.objectExpression([]); 38066 var key = null; 38067 var type = open.name; 38068 38069 if (t.isJSXIdentifier(type) && t.react.isCompatTag(type.name)) { 38070 type = t.stringLiteral(type.name); 38071 } 38072 38073 function pushProp(objProps, key, value) { 38074 objProps.push(t.objectProperty(key, value)); 38075 } 38076 38077 for (var _iterator = open.attributes, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) { 38078 var _ref2; 38079 38080 if (_isArray) { 38081 if (_i >= _iterator.length) break; 38082 _ref2 = _iterator[_i++]; 38083 } else { 38084 _i = _iterator.next(); 38085 if (_i.done) break; 38086 _ref2 = _i.value; 38087 } 38088 38089 var attr = _ref2; 38090 38091 if (isJSXAttributeOfName(attr, "key")) { 38092 key = getAttributeValue(attr); 38093 } else { 38094 var name = attr.name.name; 38095 var propertyKey = t.isValidIdentifier(name) ? t.identifier(name) : t.stringLiteral(name); 38096 pushProp(props.properties, propertyKey, getAttributeValue(attr)); 38097 } 38098 } 38099 38100 var args = [type, props]; 38101 if (key || node.children.length) { 38102 var children = t.react.buildChildren(node); 38103 args.push.apply(args, [key || t.unaryExpression("void", t.numericLiteral(0), true)].concat(children)); 38104 } 38105 38106 var el = t.callExpression(file.addHelper("jsx"), args); 38107 path.replaceWith(el); 38108 } 38109 } 38110 }; 38111 }; 38112 38113 function _interopRequireDefault(obj) { 38114 return obj && obj.__esModule ? obj : { default: obj }; 38115 } 38116 38117 module.exports = exports["default"]; 38118 38119/***/ }, 38120/* 343 */ 38121/***/ function(module, exports, __webpack_require__) { 38122 38123 "use strict"; 38124 38125 exports.__esModule = true; 38126 38127 exports.default = function (_ref) { 38128 var t = _ref.types; 38129 38130 return { 38131 manipulateOptions: function manipulateOptions(opts, parserOpts) { 38132 parserOpts.plugins.push("jsx"); 38133 }, 38134 38135 visitor: (0, _babelHelperBuilderReactJsx2.default)({ 38136 pre: function pre(state) { 38137 state.callee = state.tagExpr; 38138 }, 38139 post: function post(state) { 38140 if (t.react.isCompatTag(state.tagName)) { 38141 state.call = t.callExpression(t.memberExpression(t.memberExpression(t.identifier("React"), t.identifier("DOM")), state.tagExpr, t.isLiteral(state.tagExpr)), state.args); 38142 } 38143 } 38144 }) 38145 }; 38146 }; 38147 38148 var _babelHelperBuilderReactJsx = __webpack_require__(184); 38149 38150 var _babelHelperBuilderReactJsx2 = _interopRequireDefault(_babelHelperBuilderReactJsx); 38151 38152 function _interopRequireDefault(obj) { 38153 return obj && obj.__esModule ? obj : { default: obj }; 38154 } 38155 38156 module.exports = exports["default"]; 38157 38158/***/ }, 38159/* 344 */
38160/***/ function(module, exports) { 38161 38162 "use strict"; 38163 38164 exports.__esModule = true; 38165 38166 exports.default = function (_ref) { 38167 var t = _ref.types; 38168 38169 var visitor = { 38170 JSXOpeningElement: function JSXOpeningElement(_ref2) { 38171 var node = _ref2.node; 38172 38173 var id = t.jSXIdentifier(TRACE_ID); 38174 var trace = t.thisExpression(); 38175 38176 node.attributes.push(t.jSXAttribute(id, t.jSXExpressionContainer(trace))); 38177 } 38178 }; 38179 38180 return { 38181 visitor: visitor 38182 }; 38183 }; 38184 38185 var TRACE_ID = "__self"; 38186 38187 module.exports = exports["default"]; 38188 38189/***/ }, 38190/* 345 */ 38191/***/ function(module, exports) { 38192 38193 "use strict"; 38194 38195 exports.__esModule = true; 38196 38197 exports.default = function (_ref) { 38198 var t = _ref.types; 38199 38200 function makeTrace(fileNameIdentifier, lineNumber) { 38201 var fileLineLiteral = lineNumber != null ? t.numericLiteral(lineNumber) : t.nullLiteral(); 38202 var fileNameProperty = t.objectProperty(t.identifier("fileName"), fileNameIdentifier); 38203 var lineNumberProperty = t.objectProperty(t.identifier("lineNumber"), fileLineLiteral); 38204 return t.objectExpression([fileNameProperty, lineNumberProperty]); 38205 } 38206 38207 var visitor = { 38208 JSXOpeningElement: function JSXOpeningElement(path, state) { 38209 var id = t.jSXIdentifier(TRACE_ID); 38210 var location = path.container.openingElement.loc; 38211 if (!location) { 38212 return; 38213 } 38214 38215 var attributes = path.container.openingElement.attributes; 38216 for (var i = 0; i < attributes.length; i++) { 38217 var name = attributes[i].name; 38218 if (name && name.name === TRACE_ID) { 38219 return; 38220 } 38221 } 38222 38223 if (!state.fileNameIdentifier) { 38224 var fileName = state.file.log.filename !== "unknown" ? state.file.log.filename : null; 38225 38226 var fileNameIdentifier = path.scope.generateUidIdentifier(FILE_NAME_VAR); 38227 path.hub.file.scope.push({ id: fileNameIdentifier, init: t.stringLiteral(fileName) }); 38228 state.fileNameIdentifier = fileNameIdentifier; 38229 } 38230 38231 var trace = makeTrace(state.fileNameIdentifier, location.start.line); 38232 attributes.push(t.jSXAttribute(id, t.jSXExpressionContainer(trace))); 38233 } 38234 }; 38235 38236 return { 38237 visitor: visitor 38238 }; 38239 }; 38240 38241 var TRACE_ID = "__source"; 38242 var FILE_NAME_VAR = "_jsxFileName"; 38243 38244 module.exports = exports["default"]; 38245 38246/***/ }, 38247/* 346 */ 38248/***/ function(module, exports) { 38249 38250 "use strict"; 38251 38252 module.exports = { 38253 builtins: { 38254 Symbol: "symbol", 38255 Promise: "promise", 38256 Map: "map", 38257 WeakMap: "weak-map", 38258 Set: "set", 38259 WeakSet: "weak-set", 38260 Observable: "observable", 38261 setImmediate: "set-immediate", 38262 clearImmediate: "clear-immediate", 38263 asap: "asap" 38264 }, 38265 38266 methods: { 38267 Array: { 38268 concat: "array/concat", 38269 copyWithin: "array/copy-within", 38270 entries: "array/entries", 38271 every: "array/every", 38272 fill: "array/fill", 38273 filter: "array/filter", 38274 findIndex: "array/find-index", 38275 find: "array/find", 38276 forEach: "array/for-each", 38277 from: "array/from", 38278 includes: "array/includes", 38279 indexOf: "array/index-of", 38280 38281 join: "array/join", 38282 keys: "array/keys", 38283 lastIndexOf: "array/last-index-of", 38284 map: "array/map", 38285 of: "array/of", 38286 pop: "array/pop", 38287 push: "array/push", 38288 reduceRight: "array/reduce-right", 38289 reduce: "array/reduce", 38290 reverse: "array/reverse", 38291 shift: "array/shift", 38292 slice: "array/slice", 38293 some: "array/some", 38294 sort: "array/sort", 38295 splice: "array/splice", 38296 unshift: "array/unshift", 38297 values: "array/values" 38298 }, 38299 38300 JSON: { 38301 stringify: "json/stringify" 38302 }, 38303 38304 Object: { 38305 assign: "object/assign", 38306 create: "object/create", 38307 defineProperties: "object/define-properties", 38308 defineProperty: "object/define-property", 38309 entries: "object/entries", 38310 freeze: "object/freeze", 38311 getOwnPropertyDescriptor: "object/get-own-property-descriptor", 38312 getOwnPropertyDescriptors: "object/get-own-property-descriptors", 38313 getOwnPropertyNames: "object/get-own-property-names",
38314 getOwnPropertySymbols: "object/get-own-property-symbols", 38315 getPrototypeOf: "object/get-prototype-of", 38316 isExtensible: "object/is-extensible", 38317 isFrozen: "object/is-frozen", 38318 isSealed: "object/is-sealed", 38319 is: "object/is", 38320 keys: "object/keys", 38321 preventExtensions: "object/prevent-extensions", 38322 seal: "object/seal", 38323 setPrototypeOf: "object/set-prototype-of", 38324 values: "object/values" 38325 }, 38326 38327 RegExp: { 38328 escape: "regexp/escape" }, 38329 38330 Math: { 38331 acosh: "math/acosh", 38332 asinh: "math/asinh", 38333 atanh: "math/atanh", 38334 cbrt: "math/cbrt", 38335 clz32: "math/clz32", 38336 cosh: "math/cosh", 38337 expm1: "math/expm1", 38338 fround: "math/fround", 38339 hypot: "math/hypot", 38340 imul: "math/imul", 38341 log10: "math/log10", 38342 log1p: "math/log1p", 38343 log2: "math/log2", 38344 sign: "math/sign", 38345 sinh: "math/sinh", 38346 tanh: "math/tanh", 38347 trunc: "math/trunc", 38348 iaddh: "math/iaddh", 38349 isubh: "math/isubh", 38350 imulh: "math/imulh", 38351 umulh: "math/umulh" 38352 }, 38353 38354 Symbol: { 38355 for: "symbol/for", 38356 hasInstance: "symbol/has-instance", 38357 isConcatSpreadable: "symbol/is-concat-spreadable", 38358 iterator: "symbol/iterator", 38359 keyFor: "symbol/key-for", 38360 match: "symbol/match", 38361 replace: "symbol/replace", 38362 search: "symbol/search", 38363 species: "symbol/species", 38364 split: "symbol/split", 38365 toPrimitive: "symbol/to-primitive", 38366 toStringTag: "symbol/to-string-tag", 38367 unscopables: "symbol/unscopables" 38368 }, 38369 38370 String: { 38371 at: "string/at", 38372 codePointAt: "string/code-point-at", 38373 endsWith: "string/ends-with", 38374 fromCodePoint: "string/from-code-point", 38375 includes: "string/includes", 38376 matchAll: "string/match-all", 38377 padLeft: "string/pad-left", 38378 padRight: "string/pad-right", 38379 padStart: "string/pad-start", 38380 padEnd: "string/pad-end", 38381 raw: "string/raw", 38382 repeat: "string/repeat", 38383 startsWith: "string/starts-with", 38384 trim: "string/trim", 38385 trimLeft: "string/trim-left", 38386 trimRight: "string/trim-right", 38387 trimStart: "string/trim-start", 38388 trimEnd: "string/trim-end" 38389 }, 38390 38391 Number: { 38392 EPSILON: "number/epsilon", 38393 isFinite: "number/is-finite", 38394 isInteger: "number/is-integer", 38395 isNaN: "number/is-nan", 38396 isSafeInteger: "number/is-safe-integer", 38397 MAX_SAFE_INTEGER: "number/max-safe-integer", 38398 MIN_SAFE_INTEGER: "number/min-safe-integer", 38399 parseFloat: "number/parse-float", 38400 parseInt: "number/parse-int" 38401 }, 38402 38403 Reflect: { 38404 apply: "reflect/apply", 38405 construct: "reflect/construct", 38406 defineProperty: "reflect/define-property", 38407 deleteProperty: "reflect/delete-property", 38408 enumerate: "reflect/enumerate", 38409 getOwnPropertyDescriptor: "reflect/get-own-property-descriptor", 38410 getPrototypeOf: "reflect/get-prototype-of", 38411 get: "reflect/get", 38412 has: "reflect/has", 38413 isExtensible: "reflect/is-extensible", 38414 ownKeys: "reflect/own-keys", 38415 preventExtensions: "reflect/prevent-extensions", 38416 setPrototypeOf: "reflect/set-prototype-of", 38417 set: "reflect/set", 38418 defineMetadata: "reflect/define-metadata", 38419 deleteMetadata: "reflect/delete-metadata", 38420 getMetadata: "reflect/get-metadata", 38421 getMetadataKeys: "reflect/get-metadata-keys", 38422 getOwnMetadata: "reflect/get-own-metadata", 38423 getOwnMetadataKeys: "reflect/get-own-metadata-keys", 38424 hasMetadata: "reflect/has-metadata", 38425 hasOwnMetadata: "reflect/has-own-metadata", 38426 metadata: "reflect/metadata" 38427 }, 38428 38429 System: { 38430 global: "system/global" 38431 }, 38432 38433 Error: { 38434 isError: "error/is-error" }, 38435 38436 Date: {}, 38437 38438 Function: {} 38439 } 38440 }; 38441 38442/***/ }, 38443/* 347 */ 38444/***/ function(module, exports, __webpack_require__) { 38445 38446 "use strict"; 38447 38448 exports.__esModule = true; 38449 exports.definitions = undefined; 38450 38451 exports.default = function (_ref) { 38452 var t = _ref.types; 38453 38454 function getRuntimeModuleName(opts) { 38455 return opts.moduleName || "babel-runtime"; 38456 } 38457 38458 function has(obj, key) { 38459 return Object.prototype.hasOwnProperty.call(obj, key); 38460 } 38461 38462 var HELPER_BLACKLIST = ["interopRequireWildcard", "interopRequireDefault"]; 38463 38464 return { 38465 pre: function pre(file) { 38466 var moduleName = getRuntimeModuleName(this.opts); 38467 38468 if (this.opts.helpers !== false) { 38469 file.set("helperGenerator", function (name) { 38470 if (HELPER_BLACKLIST.indexOf(name) < 0) { 38471 return file.addImport(moduleName + "/helpers/" + name, "default", name); 38472 } 38473 }); 38474 } 38475 38476 this.setDynamic("regeneratorIdentifier", function () { 38477 return file.addImport(moduleName + "/regenerator", "default", "regeneratorRuntime"); 38478 }); 38479 }, 38480 38481 visitor: { 38482 ReferencedIdentifier: function ReferencedIdentifier(path, state) { 38483 var node = path.node, 38484 parent = path.parent, 38485 scope = path.scope; 38486 38487 if (node.name === "regeneratorRuntime" && state.opts.regenerator !== false) { 38488 path.replaceWith(state.get("regeneratorIdentifier")); 38489 return; 38490 } 38491 38492 if (state.opts.polyfill === false) return; 38493 38494 if (t.isMemberExpression(parent)) return; 38495 if (!has(_definitions2.default.builtins, node.name)) return; 38496 if (scope.getBindingIdentifier(node.name)) return; 38497 38498 var moduleName = getRuntimeModuleName(state.opts); 38499 path.replaceWith(state.addImport(moduleName + "/core-js/" + _definitions2.default.builtins[node.name], "default", node.name)); 38500 }, 38501 CallExpression: function CallExpression(path, state) { 38502 if (state.opts.polyfill === false) return; 38503 38504 if (path.node.arguments.length) return; 38505 38506 var callee = path.node.callee; 38507 if (!t.isMemberExpression(callee)) return; 38508 if (!callee.computed) return; 38509 if (!path.get("callee.property").matchesPattern("Symbol.iterator")) return; 38510 38511 var moduleName = getRuntimeModuleName(state.opts); 38512 path.replaceWith(t.callExpression(state.addImport(moduleName + "/core-js/get-iterator", "default", "getIterator"), [callee.object])); 38513 }, 38514 BinaryExpression: function BinaryExpression(path, state) { 38515 if (state.opts.polyfill === false) return; 38516 38517 if (path.node.operator !== "in") return; 38518 if (!path.get("left").matchesPattern("Symbol.iterator")) return; 38519 38520 var moduleName = getRuntimeModuleName(state.opts); 38521 path.replaceWith(t.callExpression(state.addImport(moduleName + "/core-js/is-iterable", "default", "isIterable"), [path.node.right])); 38522 }, 38523 38524 MemberExpression: { 38525 enter: function enter(path, state) { 38526 if (state.opts.polyfill === false) return; 38527 if (!path.isReferenced()) return; 38528 38529 var node = path.node; 38530 38531 var obj = node.object; 38532 var prop = node.property; 38533 38534 if (!t.isReferenced(obj, node)) return; 38535 if (node.computed) return; 38536 if (!has(_definitions2.default.methods, obj.name)) return; 38537 38538 var methods = _definitions2.default.methods[obj.name]; 38539 if (!has(methods, prop.name)) return; 38540 38541 if (path.scope.getBindingIdentifier(obj.name)) return; 38542 38543 if (obj.name === "Object" && prop.name === "defineProperty" && path.parentPath.isCallExpression()) { 38544 var call = path.parentPath.node; 38545 if (call.arguments.length === 3 && t.isLiteral(call.arguments[1])) return; 38546 } 38547 38548 var moduleName = getRuntimeModuleName(state.opts); 38549 path.replaceWith(state.addImport(moduleName + "/core-js/" + methods[prop.name], "default", obj.name + "$" + prop.name)); 38550 }, 38551 exit: function exit(path, state) { 38552 if (state.opts.polyfill === false) return; 38553 if (!path.isReferenced()) return; 38554 38555 var node = path.node; 38556 38557 var obj = node.object; 38558 38559 if (!has(_definitions2.default.builtins, obj.name)) return; 38560 if (path.scope.getBindingIdentifier(obj.name)) return; 38561 38562 var moduleName = getRuntimeModuleName(state.opts); 38563 path.replaceWith(t.memberExpression(state.addImport(moduleName + "/core-js/" + _definitions2.default.builtins[obj.name], "default", obj.name), node.property, node.computed)); 38564 } 38565 } 38566 } 38567 }; 38568 }; 38569 38570 var _definitions = __webpack_require__(346); 38571 38572 var _definitions2 = _interopRequireDefault(_definitions); 38573 38574 function _interopRequireDefault(obj) { 38575 return obj && obj.__esModule ? obj : { default: obj }; 38576 } 38577 38578 exports.definitions = _definitions2.default; 38579 38580/***/ }, 38581/* 348 */ 38582/***/ function(module, exports, __webpack_require__) { 38583 38584 "use strict"; 38585 38586 exports.__esModule = true; 38587 38588 exports.default = function (_ref) { 38589 var messages = _ref.messages; 38590 38591 return { 38592 visitor: { 38593 ReferencedIdentifier: function ReferencedIdentifier(path) { 38594 var node = path.node, 38595 scope = path.scope; 38596 38597 var binding = scope.getBinding(node.name); 38598 if (binding && binding.kind === "type" && !path.parentPath.isFlow()) { 38599 throw path.buildCodeFrameError(messages.get("undeclaredVariableType", node.name), ReferenceError); 38600 } 38601 38602 if (scope.hasBinding(node.name)) return; 38603 38604 var bindings = scope.getAllBindings(); 38605 38606 var closest = void 0; 38607 var shortest = -1; 38608 38609 for (var name in bindings) { 38610 var distance = (0, _leven2.default)(node.name, name); 38611 if (distance <= 0 || distance > 3) continue; 38612 if (distance <= shortest) continue; 38613 38614 closest = name; 38615 shortest = distance; 38616 } 38617 38618 var msg = void 0; 38619 if (closest) { 38620 msg = messages.get("undeclaredVariableSuggestion", node.name, closest); 38621 } else { 38622 msg = messages.get("undeclaredVariable", node.name); 38623 } 38624 38625 throw path.buildCodeFrameError(msg, ReferenceError); 38626 } 38627 } 38628 }; 38629 }; 38630 38631 var _leven = __webpack_require__(460); 38632 38633 var _leven2 = _interopRequireDefault(_leven); 38634 38635 function _interopRequireDefault(obj) { 38636 return obj && obj.__esModule ? obj : { default: obj }; 38637 } 38638 38639 module.exports = exports["default"]; 38640 38641/***/ }, 38642/* 349 */ 38643/***/ function(module, exports, __webpack_require__) { 38644 38645 "use strict"; 38646 38647 exports.__esModule = true; 38648 38649 var _babelPluginTransformFlowStripTypes = __webpack_require__(208); 38650 38651 var _babelPluginTransformFlowStripTypes2 = _interopRequireDefault(_babelPluginTransformFlowStripTypes); 38652 38653 function _interopRequireDefault(obj) { 38654 return obj && obj.__esModule ? obj : { default: obj }; 38655 } 38656 38657 exports.default = { 38658 plugins: [_babelPluginTransformFlowStripTypes2.default] 38659 }; 38660 module.exports = exports["default"]; 38661 38662/***/ }, 38663/* 350 */ 38664/***/ function(module, exports, __webpack_require__) { 38665 38666 "use strict"; 38667 38668 exports.__esModule = true; 38669 38670 exports.default = function (context) { 38671 var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; 38672 38673 return { 38674 presets: [opts.es2015 !== false && [_babelPresetEs2.default.buildPreset, opts.es2015], opts.es2016 !== false && _babelPresetEs4.default, opts.es2017 !== false && _babelPresetEs6.default].filter(
38674Boolean) }; 38675 }; 38676 38677 var _babelPresetEs = __webpack_require__(214); 38678 38679 var _babelPresetEs2 = _interopRequireDefault(_babelPresetEs); 38680 38681 var _babelPresetEs3 = __webpack_require__(215); 38682 38683 var _babelPresetEs4 = _interopRequireDefault(_babelPresetEs3); 38684 38685 var _babelPresetEs5 = __webpack_require__(216); 38686 38687 var _babelPresetEs6 = _interopRequireDefault(_babelPresetEs5); 38688 38689 function _interopRequireDefault(obj) { 38690 return obj && obj.__esModule ? obj : { default: obj }; 38691 } 38692 38693 module.exports = exports["default"]; 38694 38695/***/ }, 38696/* 351 */ 38697/***/ function(module, exports, __webpack_require__) { 38698 38699 "use strict"; 38700 38701 exports.__esModule = true; 38702 38703 var _babelPresetFlow = __webpack_require__(349); 38704 38705 var _babelPresetFlow2 = _interopRequireDefault(_babelPresetFlow); 38706 38707 var _babelPluginTransformReactJsx = __webpack_require__(212); 38708 38709 var _babelPluginTransformReactJsx2 = _interopRequireDefault(_babelPluginTransformReactJsx); 38710 38711 var _babelPluginSyntaxJsx = __webpack_require__(124); 38712 38713 var _babelPluginSyntaxJsx2 = _interopRequireDefault(_babelPluginSyntaxJsx); 38714 38715 var _babelPluginTransformReactDisplayName = __webpack_require__(211); 38716 38717 var _babelPluginTransformReactDisplayName2 = _interopRequireDefault(_babelPluginTransformReactDisplayName); 38718 38719 function _interopRequireDefault(obj) { 38720 return obj && obj.__esModule ? obj : { default: obj }; 38721 } 38722 38723 exports.default = { 38724 presets: [_babelPresetFlow2.default], 38725 plugins: [_babelPluginTransformReactJsx2.default, _babelPluginSyntaxJsx2.default, _babelPluginTransformReactDisplayName2.default], 38726 env: { 38727 development: { 38728 plugins: [] 38729 } 38730 } 38731 }; 38732 module.exports = exports["default"]; 38733 38734/***/ }, 38735/* 352 */ 38736/***/ function(module, exports, __webpack_require__) { 38737 38738 "use strict"; 38739 38740 exports.__esModule = true; 38741 38742 var _babelPresetStage = __webpack_require__(217); 38743 38744 var _babelPresetStage2 = _interopRequireDefault(_babelPresetStage); 38745 38746 var _babelPluginTransformDoExpressions = __webpack_require__(203); 38747 38748 var _babelPluginTransformDoExpressions2 = _interopRequireDefault(_babelPluginTransformDoExpressions); 38749 38750 var _babelPluginTransformFunctionBind = __webpack_require__(209); 38751 38752 var _babelPluginTransformFunctionBind2 = _interopRequireDefault(_babelPluginTransformFunctionBind); 38753 38754 function _interopRequireDefault(obj) { 38755 return obj && obj.__esModule ? obj : { default: obj }; 38756 } 38757 38758 exports.default = { 38759 presets: [_babelPresetStage2.default], 38760 plugins: [_babelPluginTransformDoExpressions2.default, _babelPluginTransformFunctionBind2.default] 38761 }; 38762 module.exports = exports["default"]; 38763 38764/***/ }, 38765/* 353 */ 38766/***/ function(module, exports, __webpack_require__) { 38767 38768 "use strict"; 38769 38770 module.exports = { "default": __webpack_require__(401), __esModule: true }; 38771 38772/***/ }, 38773/* 354 */ 38774/***/ function(module, exports, __webpack_require__) { 38775 38776 "use strict"; 38777 38778 module.exports = { "default": __webpack_require__(404), __esModule: true }; 38779 38780/***/ }, 38781/* 355 */ 38782/***/ function(module, exports, __webpack_require__) { 38783 38784 "use strict"; 38785 38786 module.exports = { "default": __webpack_require__(406), __esModule: true }; 38787 38788/***/ }, 38789/* 356 */ 38790/***/ function(module, exports, __webpack_require__) { 38791 38792 "use strict"; 38793 38794 module.exports = { "default": __webpack_require__(407), __esModule: true }; 38795 38796/***/ }, 38797/* 357 */ 38798/***/ function(module, exports, __webpack_require__) { 38799 38800 "use strict"; 38801 38802 module.exports = { "default": __webpack_require__(409), __esModule: true }; 38803 38804/***/ }, 38805/* 358 */ 38806/***/ function(module, exports, __webpack_require__) { 38807 38808 "use strict"; 38809 38810 module.exports = { "default": __webpack_require__(410), __esModule: true }; 38811 38812/***/ }, 38813/* 359 */ 38814/***/ function(module, exports, __webpack_require__) { 38815 38816 "use strict"; 38817 38818 module.exports = { "default": __webpack_require__(411), __esModule: true }; 38819 38820/***/ }, 38821/* 360 */ 38822/***/ function(module, exports) { 38823 38824 "use strict"; 38825 38826 exports.__esModule = true; 38827 38828 exports.default = function (obj, keys) { 38829 var target = {}; 38830 38831 for (var i in obj) { 38832 if (keys.indexOf(i) >= 0) continue; 38833 if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; 38834 target[i] = obj[i]; 38835 } 38836 38837 return target; 38838 }; 38839 38840/***/ }, 38841/* 361 */ 38842/***/ function(module, exports, __webpack_require__) { 38843 38844 "use strict"; 38845 38846 exports.__esModule = true; 38847 38848 var _getIterator2 = __webpack_require__(2); 38849 38850 var _getIterator3 = _interopRequireDefault(_getIterator2); 38851 38852 var _classCallCheck2 = __webpack_require__(3); 38853 38854 var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); 38855 38856 var _path2 = __webpack_require__(35); 38857 38858 var _path3 = _interopRequireDefault(_path2); 38859 38860 var _babelTypes = __webpack_require__(1); 38861 38862 var t = _interopRequireWildcard(_babelTypes); 38863 38864 function _interopRequireWildcard(obj) { 38865 if (obj && obj.__esModule) { 38866 return obj; 38867 } else { 38868 var newObj = {};if (obj != null) { 38869 for (var key in obj) { 38870 if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; 38871 } 38872 }newObj.default = obj;return newObj; 38873 } 38874 } 38875 38876 function _interopRequireDefault(obj) { 38877 return obj && obj.__esModule ? obj : { default: obj }; 38878 } 38879 38880 var testing = ("production") === "test"; 38881 38882 var TraversalContext = function () { 38883 function TraversalContext(scope, opts, state, parentPath) { 38884 (0, _classCallCheck3.default)(this, TraversalContext); 38885 this.queue = null; 38886 38887 this.parentPath = parentPath; 38888 this.scope = scope; 38889 this.state = state; 38890 this.opts = opts; 38891 } 38892 38893 TraversalContext.prototype.shouldVisit = function shouldVisit(node) { 38894 var opts = this.opts; 38895 if (opts.enter || opts.exit) return true; 38896 38897 if (opts[node.type]) return true; 38898 38899 var keys = t.VISITOR_KEYS[node.type]; 38900 if (!keys || !keys.length) return false;
38901 38902 for (var _iterator = keys, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) { 38903 var _ref; 38904 38905 if (_isArray) { 38906 if (_i >= _iterator.length) break; 38907 _ref = _iterator[_i++]; 38908 } else { 38909 _i = _iterator.next(); 38910 if (_i.done) break; 38911 _ref = _i.value; 38912 } 38913 38914 var key = _ref; 38915 38916 if (node[key]) return true; 38917 } 38918 38919 return false; 38920 }; 38921 38922 TraversalContext.prototype.create = function create(node, obj, key, listKey) { 38923 return _path3.default.get({ 38924 parentPath: this.parentPath, 38925 parent: node, 38926 container: obj, 38927 key: key, 38928 listKey: listKey 38929 }); 38930 }; 38931 38932 TraversalContext.prototype.maybeQueue = function maybeQueue(path, notPriority) { 38933 if (this.trap) { 38934 throw new Error("Infinite cycle detected"); 38935 } 38936 38937 if (this.queue) { 38938 if (notPriority) { 38939 this.queue.push(path); 38940 } else { 38941 this.priorityQueue.push(path); 38942 } 38943 } 38944 }; 38945 38946 TraversalContext.prototype.visitMultiple = function visitMultiple(container, parent, listKey) { 38947 if (container.length === 0) return false; 38948 38949 var queue = []; 38950 38951 for (var key = 0; key < container.length; key++) { 38952 var node = container[key]; 38953 if (node && this.shouldVisit(node)) { 38954 queue.push(this.create(parent, container, key, listKey)); 38955 } 38956 } 38957 38958 return this.visitQueue(queue); 38959 }; 38960 38961 TraversalContext.prototype.visitSingle = function visitSingle(node, key) { 38962 if (this.shouldVisit(node[key])) { 38963 return this.visitQueue([this.create(node, node, key)]); 38964 } else { 38965 return false; 38966 } 38967 }; 38968 38969 TraversalContext.prototype.visitQueue = function visitQueue(queue) { 38970 this.queue = queue; 38971 this.priorityQueue = []; 38972 38973 var visited = []; 38974 var stop = false; 38975 38976 for (var _iterator2 = queue, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) { 38977 var _ref2; 38978 38979 if (_isArray2) { 38980 if (_i2 >= _iterator2.length) break; 38981 _ref2 = _iterator2[_i2++]; 38982 } else { 38983 _i2 = _iterator2.next(); 38984 if (_i2.done) break; 38985 _ref2 = _i2.value; 38986 } 38987 38988 var path = _ref2; 38989 38990 path.resync(); 38991 38992 if (path.contexts.length === 0 || path.contexts[path.contexts.length - 1] !== this) { 38993 path.pushContext(this); 38994 } 38995 38996 if (path.key === null) continue; 38997 38998 if (testing && queue.length >= 10000) { 38999 this.trap = true; 39000 } 39001 39002 if (visited.indexOf(path.node) >= 0) continue; 39003 visited.push(path.node); 39004 39005 if (path.visit()) { 39006 stop = true; 39007 break; 39008 } 39009 39010 if (this.priorityQueue.length) { 39011 stop = this.visitQueue(this.priorityQueue); 39012 this.priorityQueue = []; 39013 this.queue = queue; 39014 if (stop) break; 39015 } 39016 } 39017 39018 for (var _iterator3 = queue, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, _getIterator3.default)(_iterator3);;) { 39019 var _ref3; 39020 39021 if (_isArray3) { 39022 if (_i3 >= _iterator3.length) break; 39023 _ref3 = _iterator3[_i3++]; 39024 } else { 39025 _i3 = _iterator3.next(); 39026 if (_i3.done) break; 39027 _ref3 = _i3.value; 39028 } 39029 39030 var _path = _ref3; 39031 39032 _path.popContext(); 39033 } 39034 39035 this.queue = null; 39036 39037 return stop; 39038 }; 39039 39040 TraversalContext.prototype.visit = function visit(node, key) { 39041 var nodes = node[key]; 39042 if (!nodes) return false; 39043 39044 if (Array.isArray(nodes)) { 39045 return this.visitMultiple(nodes, node, key); 39046 } else { 39047 return this.visitSingle(node, key); 39048 } 39049 }; 39050 39051 return TraversalContext; 39052 }(); 39053 39054 exports.default = TraversalContext; 39055 module.exports = exports["default"]; 39056 39057/***/ }, 39058/* 362 */ 39059/***/ function(module, exports, __webpack_require__) { 39060 39061 "use strict"; 39062 39063 exports.__esModule = true; 39064 39065 var _getIterator2 = __webpack_require__(2); 39066 39067 var _getIterator3 = _interopRequireDefault(_getIterator2); 39068 39069 exports.findParent = findParent; 39070 exports.find = find; 39071 exports.getFunctionParent = getFunctionParent; 39072 exports.getStatementParent = getStatementParent; 39073 exports.getEarliestCommonAncestorFrom = getEarliestCommonAncestorFrom; 39074 exports.getDeepestCommonAncestorFrom = getDeepestCommonAncestorFrom; 39075 exports.getAncestry = getAncestry; 39076 exports.isAncestor = isAncestor; 39077 exports.isDescendant = isDescendant; 39078 exports.inType = inType;
39079 exports.inShadow = inShadow; 39080 39081 var _babelTypes = __webpack_require__(1); 39082 39083 var t = _interopRequireWildcard(_babelTypes); 39084 39085 var _index = __webpack_require__(35); 39086 39087 var _index2 = _interopRequireDefault(_index); 39088 39089 function _interopRequireWildcard(obj) { 39090 if (obj && obj.__esModule) { 39091 return obj; 39092 } else { 39093 var newObj = {};if (obj != null) { 39094 for (var key in obj) { 39095 if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; 39096 } 39097 }newObj.default = obj;return newObj; 39098 } 39099 } 39100 39101 function _interopRequireDefault(obj) { 39102 return obj && obj.__esModule ? obj : { default: obj }; 39103 } 39104 39105 function findParent(callback) { 39106 var path = this; 39107 while (path = path.parentPath) { 39108 if (callback(path)) return path; 39109 } 39110 return null; 39111 } 39112 39113 function find(callback) { 39114 var path = this; 39115 do { 39116 if (callback(path)) return path; 39117 } while (path = path.parentPath); 39118 return null; 39119 } 39120 39121 function getFunctionParent() { 39122 return this.findParent(function (path) { 39123 return path.isFunction() || path.isProgram(); 39124 }); 39125 } 39126 39127 function getStatementParent() { 39128 var path = this; 39129 do { 39130 if (Array.isArray(path.container)) { 39131 return path; 39132 } 39133 } while (path = path.parentPath); 39134 } 39135 39136 function getEarliestCommonAncestorFrom(paths) { 39137 return this.getDeepestCommonAncestorFrom(paths, function (deepest, i, ancestries) { 39138 var earliest = void 0; 39139 var keys = t.VISITOR_KEYS[deepest.type]; 39140 39141 for (var _iterator = ancestries, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) { 39142 var _ref; 39143 39144 if (_isArray) { 39145 if (_i >= _iterator.length) break; 39146 _ref = _iterator[_i++]; 39147 } else { 39148 _i = _iterator.next(); 39149 if (_i.done) break; 39150 _ref = _i.value; 39151 } 39152 39153 var ancestry = _ref; 39154 39155 var path = ancestry[i + 1]; 39156 39157 if (!earliest) { 39158 earliest = path; 39159 continue; 39160 } 39161 39162 if (path.listKey && earliest.listKey === path.listKey) { 39163 if (path.key < earliest.key) { 39164 earliest = path; 39165 continue; 39166 } 39167 } 39168 39169 var earliestKeyIndex = keys.indexOf(earliest.parentKey); 39170 var currentKeyIndex = keys.indexOf(path.parentKey); 39171 if (earliestKeyIndex > currentKeyIndex) { 39172 earliest = path; 39173 } 39174 } 39175 39176 return earliest; 39177 }); 39178 } 39179 39180 function getDeepestCommonAncestorFrom(paths, filter) { 39181 var _this = this; 39182 39183 if (!paths.length) { 39184 return this; 39185 } 39186 39187 if (paths.length === 1) { 39188 return paths[0]; 39189 } 39190 39191 var minDepth = Infinity; 39192 39193 var lastCommonIndex = void 0, 39194 lastCommon = void 0; 39195 39196 var ancestries = paths.map(function (path) { 39197 var ancestry = []; 39198 39199 do { 39200 ancestry.unshift(path); 39201 } while ((path = path.parentPath) && path !== _this); 39202 39203 if (ancestry.length < minDepth) { 39204 minDepth = ancestry.length; 39205 } 39206 39207 return ancestry; 39208 }); 39209 39210 var first = ancestries[0]; 39211 39212 depthLoop: for (var i = 0; i < minDepth; i++) { 39213 var shouldMatch = first[i]; 39214 39215 for (var _iterator2 = ancestries, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) { 39216 var _ref2; 39217 39218 if (_isArray2) { 39219 if (_i2 >= _iterator2.length) break; 39220 _ref2 = _iterator2[_i2++]; 39221 } else { 39222 _i2 = _iterator2.next(); 39223 if (_i2.done) break; 39224 _ref2 = _i2.value; 39225 } 39226 39227 var ancestry = _ref2; 39228 39229 if (ancestry[i] !== shouldMatch) { 39230 break depthLoop; 39231 } 39232 } 39233 39234 lastCommonIndex = i; 39235 lastCommon = shouldMatch; 39236 } 39237 39238 if (lastCommon) { 39239 if (filter) { 39240 return filter(lastCommon, lastCommonIndex, ancestries); 39241 } else { 39242 return lastCommon; 39243 } 39244 } else { 39245 throw new Error("Couldn't find intersection"); 39246 } 39247 } 39248 39249 function getAncestry() { 39250 var path = this; 39251 var paths = []; 39252 do { 39253 paths.push(path); 39254 } while (path = path.parentPath); 39255 return paths; 39256 } 39257 39258 function isAncestor(maybeDescendant) { 39259 return maybeDescendant.isDescendant(this); 39260 } 39261 39262 function isDescendant(maybeAncestor) { 39263 return !!this.findParent(function (parent) { 39264 return parent === maybeAncestor; 39265 }); 39266 } 39267 39268 function inType() { 39269 var path = this; 39270 while (path) { 39271 for (var _iterator3 = arguments, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, _getIterator3.default)(_iterator3);;) { 39272 var _ref3; 39273 39274 if (_isArray3) { 39275 if (_i3 >= _iterator3.length) break; 39276 _ref3 = _iterator3[_i3++]; 39277 } else { 39278 _i3 = _iterator3.next(); 39279 if (_i3.done) break; 39280 _ref3 = _i3.value; 39281 } 39282 39283 var type = _ref3; 39284 39285 if (path.node.type === type) return true; 39286 } 39287 path = path.parentPath; 39288 } 39289 39290 return false;
39291 } 39292 39293 function inShadow(key) { 39294 var parentFn = this.isFunction() ? this : this.findParent(function (p) { 39295 return p.isFunction(); 39296 }); 39297 if (!parentFn) return; 39298 39299 if (parentFn.isFunctionExpression() || parentFn.isFunctionDeclaration()) { 39300 var shadow = parentFn.node.shadow; 39301 39302 if (shadow && (!key || shadow[key] !== false)) { 39303 return parentFn; 39304 } 39305 } else if (parentFn.isArrowFunctionExpression()) { 39306 return parentFn; 39307 } 39308 39309 return null; 39310 } 39311 39312/***/ }, 39313/* 363 */ 39314/***/ function(module, exports) { 39315 39316 "use strict"; 39317 39318 exports.__esModule = true; 39319 exports.shareCommentsWithSiblings = shareCommentsWithSiblings; 39320 exports.addComment = addComment; 39321 exports.addComments = addComments; 39322 function shareCommentsWithSiblings() { 39323 if (typeof this.key === "string") return; 39324 39325 var node = this.node; 39326 if (!node) return; 39327 39328 var trailing = node.trailingComments; 39329 var leading = node.leadingComments; 39330 if (!trailing && !leading) return; 39331 39332 var prev = this.getSibling(this.key - 1); 39333 var next = this.getSibling(this.key + 1); 39334 39335 if (!prev.node) prev = next; 39336 if (!next.node) next = prev; 39337 39338 prev.addComments("trailing", leading); 39339 next.addComments("leading", trailing); 39340 } 39341 39342 function addComment(type, content, line) { 39343 this.addComments(type, [{ 39344 type: line ? "CommentLine" : "CommentBlock", 39345 value: content 39346 }]); 39347 } 39348 39349 function addComments(type, comments) { 39350 if (!comments) return; 39351 39352 var node = this.node; 39353 if (!node) return; 39354 39355 var key = type + "Comments"; 39356 39357 if (node[key]) { 39358 node[key] = node[key].concat(comments); 39359 } else { 39360 node[key] = comments; 39361 } 39362 } 39363 39364/***/ }, 39365/* 364 */ 39366/***/ function(module, exports, __webpack_require__) { 39367 39368 "use strict"; 39369 39370 exports.__esModule = true; 39371 39372 var _getIterator2 = __webpack_require__(2); 39373 39374 var _getIterator3 = _interopRequireDefault(_getIterator2); 39375 39376 exports.call = call; 39377 exports._call = _call; 39378 exports.isBlacklisted = isBlacklisted; 39379 exports.visit = visit; 39380 exports.skip = skip; 39381 exports.skipKey = skipKey; 39382 exports.stop = stop; 39383 exports.setScope = setScope; 39384 exports.setContext = setContext; 39385 exports.resync = resync; 39386 exports._resyncParent = _resyncParent; 39387 exports._resyncKey = _resyncKey; 39388 exports._resyncList = _resyncList; 39389 exports._resyncRemoved = _resyncRemoved; 39390 exports.popContext = popContext; 39391 exports.pushContext = pushContext; 39392 exports.setup = setup; 39393 exports.setKey = setKey; 39394 exports.requeue = requeue; 39395 exports._getQueueContexts = _getQueueContexts; 39396 39397 var _index = __webpack_require__(8); 39398 39399 var _index2 = _interopRequireDefault(_index); 39400 39401 function _interopRequireDefault(obj) { 39402 return obj && obj.__esModule ? obj : { default: obj }; 39403 } 39404 39405 function call(key) { 39406 var opts = this.opts; 39407 39408 this.debug(function () { 39409 return key; 39410 }); 39411 39412 if (this.node) { 39413 if (this._call(opts[key])) return true; 39414 } 39415 39416 if (this.node) { 39417 return this._call(opts[this.node.type] && opts[this.node.type][key]); 39418 } 39419 39420 return false; 39421 } 39422 39423 function _call(fns) { 39424 if (!fns) return false; 39425 39426 for (var _iterator = fns, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) { 39427 var _ref; 39428 39429 if (_isArray) { 39430 if (_i >= _iterator.length) break; 39431 _ref = _iterator[_i++]; 39432 } else { 39433 _i = _iterator.next(); 39434 if (_i.done) break; 39435 _ref = _i.value; 39436 } 39437 39438 var fn = _ref; 39439 39440 if (!fn) continue; 39441 39442 var node = this.node; 39443 if (!node) return true; 39444 39445 var ret = fn.call(this.state, this, this.state); 39446 if (ret) throw new Error("Unexpected return value from visitor method " + fn); 39447 39448 if (this.node !== node) return true; 39449 39450 if (this.shouldStop || this.shouldSkip || this.removed) return true; 39451 } 39452 39453 return false; 39454 } 39455 39456 function isBlacklisted() { 39457 var blacklist = this.opts.blacklist; 39458 return blacklist && blacklist.indexOf(this.node.type) > -1; 39459 } 39460 39461 function visit() { 39462 if (!this.node) { 39463 return false; 39464 } 39465 39466 if (this.isBlacklisted()) { 39467 return false; 39468 } 39469 39470 if (this.opts.shouldSkip && this.opts.shouldSkip(this)) { 39471 return false; 39472 } 39473 39474 if (this.call("enter") || this.shouldSkip) { 39475 this.debug(function () {
39476 return "Skip..."; 39477 }); 39478 return this.shouldStop; 39479 } 39480 39481 this.debug(function () { 39482 return "Recursing into..."; 39483 }); 39484 _index2.default.node(this.node, this.opts, this.scope, this.state, this, this.skipKeys); 39485 39486 this.call("exit"); 39487 39488 return this.shouldStop; 39489 } 39490 39491 function skip() { 39492 this.shouldSkip = true; 39493 } 39494 39495 function skipKey(key) { 39496 this.skipKeys[key] = true; 39497 } 39498 39499 function stop() { 39500 this.shouldStop = true; 39501 this.shouldSkip = true; 39502 } 39503 39504 function setScope() { 39505 if (this.opts && this.opts.noScope) return; 39506 39507 var target = this.context && this.context.scope; 39508 39509 if (!target) { 39510 var path = this.parentPath; 39511 while (path && !target) { 39512 if (path.opts && path.opts.noScope) return; 39513 39514 target = path.scope; 39515 path = path.parentPath; 39516 } 39517 } 39518 39519 this.scope = this.getScope(target); 39520 if (this.scope) this.scope.init(); 39521 } 39522 39523 function setContext(context) { 39524 this.shouldSkip = false; 39525 this.shouldStop = false; 39526 this.removed = false; 39527 this.skipKeys = {}; 39528 39529 if (context) { 39530 this.context = context; 39531 this.state = context.state; 39532 this.opts = context.opts; 39533 } 39534 39535 this.setScope(); 39536 39537 return this; 39538 } 39539 39540 function resync() { 39541 if (this.removed) return; 39542 39543 this._resyncParent(); 39544 this._resyncList(); 39545 this._resyncKey(); 39546 } 39547 39548 function _resyncParent() { 39549 if (this.parentPath) { 39550 this.parent = this.parentPath.node; 39551 } 39552 } 39553 39554 function _resyncKey() { 39555 if (!this.container) return; 39556 39557 if (this.node === this.container[this.key]) return; 39558 39559 if (Array.isArray(this.container)) { 39560 for (var i = 0; i < this.container.length; i++) { 39561 if (this.container[i] === this.node) { 39562 return this.setKey(i); 39563 } 39564 } 39565 } else { 39566 for (var key in this.container) { 39567 if (this.container[key] === this.node) { 39568 return this.setKey(key); 39569 } 39570 } 39571 } 39572 39573 this.key = null; 39574 } 39575 39576 function _resyncList() { 39577 if (!this.parent || !this.inList) return; 39578 39579 var newContainer = this.parent[this.listKey]; 39580 if (this.container === newContainer) return; 39581 39582 this.container = newContainer || null; 39583 } 39584 39585 function _resyncRemoved() { 39586 if (this.key == null || !this.container || this.container[this.key] !== this.node) { 39587 this._markRemoved(); 39588 } 39589 } 39590 39591 function popContext() { 39592 this.contexts.pop(); 39593 this.setContext(this.contexts[this.contexts.length - 1]); 39594 } 39595 39596 function pushContext(context) { 39597 this.contexts.push(context); 39598 this.setContext(context); 39599 } 39600
39601 function setup(parentPath, container, listKey, key) { 39602 this.inList = !!listKey; 39603 this.listKey = listKey; 39604 this.parentKey = listKey || key; 39605 this.container = container; 39606 39607 this.parentPath = parentPath || this.parentPath; 39608 this.setKey(key); 39609 } 39610 39611 function setKey(key) { 39612 this.key = key; 39613 this.node = this.container[this.key]; 39614 this.type = this.node && this.node.type; 39615 } 39616 39617 function requeue() { 39618 var pathToQueue = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this; 39619 39620 if (pathToQueue.removed) return; 39621 39622 var contexts = this.contexts; 39623 39624 for (var _iterator2 = contexts, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) { 39625 var _ref2; 39626 39627 if (_isArray2) { 39628 if (_i2 >= _iterator2.length) break; 39629 _ref2 = _iterator2[_i2++]; 39630 } else { 39631 _i2 = _iterator2.next(); 39632 if (_i2.done) break; 39633 _ref2 = _i2.value; 39634 } 39635 39636 var context = _ref2; 39637 39638 context.maybeQueue(pathToQueue); 39639 } 39640 } 39641 39642 function _getQueueContexts() { 39643 var path = this; 39644 var contexts = this.contexts; 39645 while (!contexts.length) { 39646 path = path.parentPath; 39647 contexts = path.contexts; 39648 } 39649 return contexts; 39650 } 39651 39652/***/ }, 39653/* 365 */ 39654/***/ function(module, exports, __webpack_require__) { 39655 39656 "use strict"; 39657 39658 exports.__esModule = true; 39659 exports.toComputedKey = toComputedKey; 39660 exports.ensureBlock = ensureBlock; 39661 exports.arrowFunctionToShadowed = arrowFunctionToShadowed; 39662 39663 var _babelTypes = __webpack_require__(1); 39664 39665 var t = _interopRequireWildcard(_babelTypes); 39666 39667 function _interopRequireWildcard(obj) { 39668 if (obj && obj.__esModule) { 39669 return obj; 39670 } else { 39671 var newObj = {};if (obj != null) { 39672 for (var key in obj) { 39673 if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; 39674 } 39675 }newObj.default = obj;return newObj; 39676 } 39677 } 39678 39679 function toComputedKey() { 39680 var node = this.node; 39681 39682 var key = void 0; 39683 if (this.isMemberExpression()) { 39684 key = node.property; 39685 } else if (this.isProperty() || this.isMethod()) { 39686 key = node.key; 39687 } else { 39688 throw new ReferenceError("todo"); 39689 } 39690 39691 if (!node.computed) { 39692 if (t.isIdentifier(key)) key = t.stringLiteral(key.name); 39693 } 39694 39695 return key; 39696 } 39697 39698 function ensureBlock() { 39699 return t.ensureBlock(this.node); 39700 } 39701 39702 function arrowFunctionToShadowed() { 39703 if (!this.isArrowFunctionExpression()) return; 39704 39705 this.ensureBlock(); 39706 39707 var node = this.node; 39708 39709 node.expression = false; 39710 node.type = "FunctionExpression"; 39711 node.shadow = node.shadow || true; 39712 } 39713 39714/***/ }, 39715/* 366 */ 39716/***/ function(module, exports, __webpack_require__) { 39717 39718 /* WEBPACK VAR INJECTION */(function(global) {"use strict"; 39719 39720 exports.__esModule = true; 39721 39722 var _typeof2 = __webpack_require__(6); 39723 39724 var _typeof3 = _interopRequireDefault(_typeof2); 39725 39726 var _getIterator2 = __webpack_require__(2); 39727 39728 var _getIterator3 = _interopRequireDefault(_getIterator2); 39729 39730 var _map = __webpack_require__(130); 39731 39732 var _map2 = _interopRequireDefault(_map); 39733 39734 exports.evaluateTruthy = evaluateTruthy; 39735 exports.evaluate = evaluate; 39736 39737 function _interopRequireDefault(obj) { 39738 return obj && obj.__esModule ? obj : { default: obj }; 39739 } 39740 39741 var VALID_CALLEES = ["String", "Number", "Math"]; 39742 var INVALID_METHODS = ["random"]; 39743 39744 function evaluateTruthy() { 39745 var res = this.evaluate(); 39746 if (res.confident) return !!res.value; 39747 } 39748 39749 function evaluate() { 39750 var confident = true; 39751 var deoptPath = void 0; 39752 var seen = new _map2.default(); 39753 39754 function deopt(path) { 39755 if (!confident) return; 39756 deoptPath = path; 39757 confident = false; 39758 } 39759 39760 var value = evaluate(this); 39761 if (!confident) value = undefined; 39762 return { 39763 confident: confident, 39764 deopt: deoptPath, 39765 value: value 39766 }; 39767 39768 function evaluate(path) { 39769 var node = path.node; 39770 39771 if (seen.has(node)) { 39772 var existing = seen.get(node); 39773 if (existing.resolved) { 39774 return existing.value; 39775 } else { 39776 deopt(path); 39777 return; 39778 } 39779 } else { 39780 var item = { resolved: false }; 39781 seen.set(node, item); 39782 39783 var val = _evaluate(path); 39784 if (confident) { 39785 item.resolved = true; 39786 item.value = val; 39787 } 39788 return val; 39789 } 39790 } 39791 39792 function _evaluate(path) { 39793 if (!confident) return; 39794 39795 var node = path.node; 39796 39797 if (path.isSequenceExpression()) { 39798 var exprs = path.get("expressions"); 39799 return evaluate(exprs[exprs.length - 1]); 39800 } 39801 39802 if (path.isStringLiteral() || path.isNumericLiteral() || path.isBooleanLiteral()) { 39803 return node.value; 39804 } 39805 39806 if (path.isNullLiteral()) { 39807 return null; 39808 } 39809 39810 if (path.isTemplateLiteral()) { 39811 var str = ""; 39812 39813 var i = 0; 39814 var _exprs = path.get("expressions"); 39815
39816 for (var _iterator = node.quasis, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) { 39817 var _ref; 39818 39819 if (_isArray) { 39820 if (_i >= _iterator.length) break; 39821 _ref = _iterator[_i++]; 39822 } else { 39823 _i = _iterator.next(); 39824 if (_i.done) break; 39825 _ref = _i.value; 39826 } 39827 39828 var elem = _ref; 39829 39830 if (!confident) break; 39831 39832 str += elem.value.cooked; 39833 39834 var expr = _exprs[i++]; 39835 if (expr) str += String(evaluate(expr)); 39836 } 39837 39838 if (!confident) return; 39839 return str; 39840 } 39841 39842 if (path.isConditionalExpression()) { 39843 var testResult = evaluate(path.get("test")); 39844 if (!confident) return; 39845 if (testResult) { 39846 return evaluate(path.get("consequent")); 39847 } else { 39848 return evaluate(path.get("alternate")); 39849 } 39850 } 39851 39852 if (path.isExpressionWrapper()) { 39853 return evaluate(path.get("expression")); 39854 } 39855 39856 if (path.isMemberExpression() && !path.parentPath.isCallExpression({ callee: node })) { 39857 var property = path.get("property"); 39858 var object = path.get("object"); 39859 39860 if (object.isLiteral() && property.isIdentifier()) { 39861 var _value = object.node.value; 39862 var type = typeof _value === "undefined" ? "undefined" : (0, _typeof3.default)(_value); 39863 if (type === "number" || type === "string") { 39864 return _value[property.node.name]; 39865 } 39866 } 39867 } 39868 39869 if (path.isReferencedIdentifier()) { 39870 var binding = path.scope.getBinding(node.name); 39871 39872 if (binding && binding.constantViolations.length > 0) { 39873 return deopt(binding.path); 39874 } 39875 39876 if (binding && path.node.start < binding.path.node.end) { 39877 return deopt(binding.path); 39878 } 39879 39880 if (binding && binding.hasValue) { 39881 return binding.value; 39882 } else { 39883 if (node.name === "undefined") { 39884 return binding ? deopt(binding.path) : undefined; 39885 } else if (node.name === "Infinity") { 39886 return binding ? deopt(binding.path) : Infinity; 39887 } else if (node.name === "NaN") { 39888 return binding ? deopt(binding.path) : NaN; 39889 } 39890 39891 var resolved = path.resolve(); 39892 if (resolved === path) { 39893 return deopt(path); 39894 } else { 39895 return evaluate(resolved); 39896 } 39897 } 39898 } 39899 39900 if (path.isUnaryExpression({ prefix: true })) { 39901 if (node.operator === "void") { 39902 return undefined; 39903 } 39904 39905 var argument = path.get("argument"); 39906 if (node.operator === "typeof" && (argument.isFunction() || argument.isClass())) { 39907 return "function"; 39908 } 39909 39910 var arg = evaluate(argument); 39911 if (!confident) return; 39912 switch (node.operator) { 39913 case "!": 39914 return !arg; 39915 case "+": 39916 return +arg; 39917 case "-": 39918 return -arg; 39919 case "~": 39920 return ~arg; 39921 case "typeof": 39922 return typeof arg === "undefined" ? "undefined" : (0, _typeof3.default)(arg); 39923 } 39924 } 39925 39926 if (path.isArrayExpression()) { 39927 var arr = []; 39928 var elems = path.get("elements"); 39929 for (var _iterator2 = elems, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) { 39930 var _ref2; 39931 39932 if (_isArray2) { 39933 if (_i2 >= _iterator2.length) break; 39934 _ref2 = _iterator2[_i2++]; 39935 } else { 39936 _i2 = _iterator2.next(); 39937 if (_i2.done) break; 39938 _ref2 = _i2.value; 39939 } 39940 39941 var _elem = _ref2; 39942 39943 _elem = _elem.evaluate(); 39944 39945 if (_elem.confident) { 39946 arr.push(_elem.value); 39947 } else { 39948 return deopt(_elem); 39949 } 39950 } 39951 return arr; 39952 } 39953 39954 if (path.isObjectExpression()) { 39955 var obj = {}; 39956 var props = path.get("properties"); 39957 for (var _iterator3 = props, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, _getIterator3.default)(_iterator3);;) { 39958 var _ref3; 39959 39960 if (_isArray3) { 39961 if (_i3 >= _iterator3.length) break; 39962 _ref3 = _iterator3[_i3++]; 39963 } else { 39964 _i3 = _iterator3.next(); 39965 if (_i3.done) break; 39966 _ref3 = _i3.value; 39967 } 39968 39969 var prop = _ref3; 39970 39971 if (prop.isObjectMethod() || prop.isSpreadProperty()) { 39972 return deopt(prop); 39973 } 39974 var keyPath = prop.get("key"); 39975 var key = keyPath; 39976 if (prop.node.computed) { 39977 key = key.evaluate(); 39978 if (!key.confident) { 39979 return deopt(keyPath); 39980 } 39981 key = key.value; 39982 } else if (key.isIdentifier()) { 39983 key = key.node.name; 39984 } else { 39985 key = key.node.value; 39986 }
39987 var valuePath = prop.get("value"); 39988 var _value2 = valuePath.evaluate(); 39989 if (!_value2.confident) { 39990 return deopt(valuePath); 39991 } 39992 _value2 = _value2.value; 39993 obj[key] = _value2; 39994 } 39995 return obj; 39996 } 39997 39998 if (path.isLogicalExpression()) { 39999 var wasConfident = confident; 40000 var left = evaluate(path.get("left")); 40001 var leftConfident = confident; 40002 confident = wasConfident; 40003 var right = evaluate(path.get("right")); 40004 var rightConfident = confident; 40005 confident = leftConfident && rightConfident; 40006 40007 switch (node.operator) { 40008 case "||": 40009 if (left && leftConfident) { 40010 confident = true; 40011 return left; 40012 } 40013 40014 if (!confident) return; 40015 40016 return left || right; 40017 case "&&": 40018 if (!left && leftConfident || !right && rightConfident) { 40019 confident = true; 40020 } 40021 40022 if (!confident) return; 40023 40024 return left && right; 40025 } 40026 } 40027 40028 if (path.isBinaryExpression()) { 40029 var _left = evaluate(path.get("left")); 40030 if (!confident) return; 40031 var _right = evaluate(path.get("right")); 40032 if (!confident) return; 40033 40034 switch (node.operator) { 40035 case "-": 40036 return _left - _right; 40037 case "+": 40038 return _left + _right; 40039 case "/": 40040 return _left / _right; 40041 case "*": 40042 return _left * _right; 40043 case "%": 40044 return _left % _right; 40045 case "**": 40046 return Math.pow(_left, _right); 40047 case "<": 40048 return _left < _right; 40049 case ">": 40050 return _left > _right; 40051 case "<=": 40052 return _left <= _right; 40053 case ">=": 40054 return _left >= _right; 40055 case "==": 40056 return _left == _right; 40057 case "!=": 40058 return _left != _right; 40059 case "===": 40060 return _left === _right; 40061 case "!==": 40062 return _left !== _right; 40063 case "|": 40064 return _left | _right; 40065 case "&": 40066 return _left & _right; 40067 case "^": 40068 return _left ^ _right; 40069 case "<<": 40070 return _left << _right; 40071 case ">>": 40072 return _left >> _right; 40073 case ">>>": 40074 return _left >>> _right; 40075 } 40076 } 40077 40078 if (path.isCallExpression()) { 40079 var callee = path.get("callee"); 40080 var context = void 0; 40081 var func = void 0; 40082 40083 if (callee.isIdentifier() && !path.scope.getBinding(callee.node.name, true) && VALID_CALLEES.indexOf(callee.node.name) >= 0) { 40084 func = global[node.callee.name]; 40085 } 40086 40087 if (callee.isMemberExpression()) { 40088 var _object = callee.get("object"); 40089 var _property = callee.get("property"); 40090 40091 if (_object.isIdentifier() && _property.isIdentifier() && VALID_CALLEES.indexOf(_object.node.name) >= 0 && INVALID_METHODS.indexOf(_property.node.name) < 0) { 40092 context = global[_object.node.name]; 40093 func = context[_property.node.name]; 40094 } 40095 40096 if (_object.isLiteral() && _property.isIdentifier()) { 40097 var _type = (0, _typeof3.default)(_object.node.value); 40098 if (_type === "string" || _type === "number") { 40099 context = _object.node.value; 40100 func = context[_property.node.name]; 40101 } 40102 } 40103 } 40104 40105 if (func) { 40106 var args = path.get("arguments").map(evaluate); 40107 if (!confident) return; 40108 40109 return func.apply(context, args); 40110 } 40111 } 40112 40113 deopt(path); 40114 } 40115 } 40116 /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()))) 40117 40118/***/ }, 40119/* 367 */ 40120/***/ function(module, exports, __webpack_require__) { 40121 40122 "use strict"; 40123 40124 exports.__esModule = true; 40125 40126 var _create = __webpack_require__(10); 40127 40128 var _create2 = _interopRequireDefault(_create); 40129 40130 var _getIterator2 = __webpack_require__(2); 40131 40132 var _getIterator3 = _interopRequireDefault(_getIterator2); 40133 40134 exports.getStatementParent = getStatementParent; 40135 exports.getOpposite = getOpposite; 40136 exports.getCompletionRecords = getCompletionRecords; 40137 exports.getSibling = getSibling; 40138 exports.getPrevSibling = getPrevSibling; 40139 exports.getNextSibling = getNextSibling; 40140 exports.getAllNextSiblings = getAllNextSiblings; 40141 exports.getAllPrevSiblings = getAllPrevSiblings; 40142 exports.get = get;
40143 exports._getKey = _getKey; 40144 exports._getPattern = _getPattern; 40145 exports.getBindingIdentifiers = getBindingIdentifiers; 40146 exports.getOuterBindingIdentifiers = getOuterBindingIdentifiers; 40147 exports.getBindingIdentifierPaths = getBindingIdentifierPaths; 40148 exports.getOuterBindingIdentifierPaths = getOuterBindingIdentifierPaths; 40149 40150 var _index = __webpack_require__(35); 40151 40152 var _index2 = _interopRequireDefault(_index); 40153 40154 var _babelTypes = __webpack_require__(1); 40155 40156 var t = _interopRequireWildcard(_babelTypes); 40157 40158 function _interopRequireWildcard(obj) { 40159 if (obj && obj.__esModule) { 40160 return obj; 40161 } else { 40162 var newObj = {};if (obj != null) { 40163 for (var key in obj) { 40164 if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; 40165 } 40166 }newObj.default = obj;return newObj; 40167 } 40168 } 40169 40170 function _interopRequireDefault(obj) { 40171 return obj && obj.__esModule ? obj : { default: obj }; 40172 } 40173 40174 function getStatementParent() { 40175 var path = this; 40176 40177 do { 40178 if (!path.parentPath || Array.isArray(path.container) && path.isStatement()) { 40179 break; 40180 } else { 40181 path = path.parentPath; 40182 } 40183 } while (path); 40184 40185 if (path && (path.isProgram() || path.isFile())) { 40186 throw new Error("File/Program node, we can't possibly find a statement parent to this"); 40187 } 40188 40189 return path; 40190 } 40191 40192 function getOpposite() { 40193 if (this.key === "left") { 40194 return this.getSibling("right"); 40195 } else if (this.key === "right") { 40196 return this.getSibling("left"); 40197 } 40198 } 40199 40200 function getCompletionRecords() { 40201 var paths = []; 40202 40203 var add = function add(path) { 40204 if (path) paths = paths.concat(path.getCompletionRecords()); 40205 }; 40206 40207 if (this.isIfStatement()) { 40208 add(this.get("consequent")); 40209 add(this.get("alternate")); 40210 } else if (this.isDoExpression() || this.isFor() || this.isWhile()) { 40211 add(this.get("body")); 40212 } else if (this.isProgram() || this.isBlockStatement()) { 40213 add(this.get("body").pop()); 40214 } else if (this.isFunction()) { 40215 return this.get("body").getCompletionRecords(); 40216 }
40216 else if (this.isTryStatement()) { 40217 add(this.get("block")); 40218 add(this.get("handler")); 40219 add(this.get("finalizer")); 40220 } else { 40221 paths.push(this); 40222 } 40223 40224 return paths; 40225 } 40226 40227 function getSibling(key) { 40228 return _index2.default.get({ 40229 parentPath: this.parentPath, 40230 parent: this.parent, 40231 container: this.container, 40232 listKey: this.listKey, 40233 key: key 40234 }); 40235 } 40236 40237 function getPrevSibling() { 40238 return this.getSibling(this.key - 1); 40239 } 40240 40241 function getNextSibling() { 40242 return this.getSibling(this.key + 1); 40243 } 40244 40245 function getAllNextSiblings() { 40246 var _key = this.key; 40247 var sibling = this.getSibling(++_key); 40248 var siblings = []; 40249 while (sibling.node) { 40250 siblings.push(sibling); 40251 sibling = this.getSibling(++_key); 40252 } 40253 return siblings; 40254 } 40255 40256 function getAllPrevSiblings() { 40257 var _key = this.key; 40258 var sibling = this.getSibling(--_key); 40259 var siblings = []; 40260 while (sibling.node) { 40261 siblings.push(sibling); 40262 sibling = this.getSibling(--_key); 40263 } 40264 return siblings; 40265 } 40266 40267 function get(key, context) { 40268 if (context === true) context = this.context; 40269 var parts = key.split("."); 40270 if (parts.length === 1) { 40271 return this._getKey(key, context); 40272 } else { 40273 return this._getPattern(parts, context); 40274 } 40275 } 40276 40277 function _getKey(key, context) { 40278 var _this = this; 40279 40280 var node = this.node; 40281 var container = node[key]; 40282 40283 if (Array.isArray(container)) { 40284 return container.map(function (_, i) { 40285 return _index2.default.get({ 40286 listKey: key, 40287 parentPath: _this, 40288 parent: node, 40289 container: container, 40290 key: i 40291 }).setContext(context); 40292 }); 40293 } else { 40294 return _index2.default.get({ 40295 parentPath: this, 40296 parent: node, 40297 container: node, 40298 key: key 40299 }).setContext(context); 40300 } 40301 } 40302 40303 function _getPattern(parts, context) { 40304 var path = this; 40305 for (var _iterator = parts, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) { 40306 var _ref; 40307 40308 if (_isArray) { 40309 if (_i >= _iterator.length) break; 40310 _ref = _iterator[_i++]; 40311 } else { 40312 _i = _iterator.next(); 40313 if (_i.done) break; 40314 _ref = _i.value; 40315 } 40316 40317 var part = _ref; 40318 40319 if (part === ".") { 40320 path = path.parentPath; 40321 } else { 40322 if (Array.isArray(path)) { 40323 path = path[part]; 40324 } else { 40325 path = path.get(part, context); 40326 } 40327 } 40328 } 40329 return path; 40330 } 40331 40332 function getBindingIdentifiers(duplicates) { 40333 return t.getBindingIdentifiers(this.node, duplicates); 40334 } 40335 40336 function getOuterBindingIdentifiers(duplicates) { 40337 return t.getOuterBindingIdentifiers(this.node, duplicates); 40338 } 40339 40340 function getBindingIdentifierPaths() { 40341 var duplicates = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; 40342 var outerOnly = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; 40343 40344 var path = this; 40345 var search = [].concat(path); 40346 var ids = (0, _create2.default)(null); 40347 40348 while (search.length) { 40349 var id = search.shift(); 40350 if (!id) continue; 40351 if (!id.node) continue; 40352 40353 var keys = t.getBindingIdentifiers.keys[id.node.type]; 40354 40355 if (id.isIdentifier()) { 40356 if (duplicates) { 40357 var _ids = ids[id.node.name] = ids[id.node.name] || []; 40358 _ids.push(id); 40359 } else { 40360 ids[id.node.name] = id; 40361 } 40362 continue; 40363 } 40364 40365 if (id.isExportDeclaration()) { 40366 var declaration = id.get("declaration"); 40367 if (declaration.isDeclaration()) { 40368 search.push(declaration); 40369 } 40370 continue; 40371 } 40372 40373 if (outerOnly) { 40374 if (id.isFunctionDeclaration()) { 40375 search.push(id.get("id")); 40376 continue; 40377 } 40378 if (id.isFunctionExpression()) { 40379 continue; 40380 } 40381 } 40382 40383 if (keys) { 40384 for (var i = 0; i < keys.length; i++) { 40385 var key = keys[i]; 40386 var child = id.get(key); 40387 if (Array.isArray(child) || child.node) { 40388 search = search.concat(child); 40389 } 40390 } 40391 } 40392 } 40393 40394 return ids; 40395 } 40396 40397 function getOuterBindingIdentifierPaths(duplicates) { 40398 return this.getBindingIdentifierPaths(duplicates, true); 40399 } 40400 40401/***/ }, 40402/* 368 */ 40403/***/ function(module, exports, __webpack_require__) { 40404 40405 "use strict"; 40406 40407 exports.__esModule = true; 40408 40409 var _getIterator2 = __webpack_require__(2); 40410 40411 var _getIterator3 = _interopRequireDefault(_getIterator2); 40412 40413 exports.getTypeAnnotation = getTypeAnnotation; 40414 exports._getTypeAnnotation = _getTypeAnnotation; 40415 exports.isBaseType = isBaseType;
40416 exports.couldBeBaseType = couldBeBaseType; 40417 exports.baseTypeStrictlyMatches = baseTypeStrictlyMatches; 40418 exports.isGenericType = isGenericType; 40419 40420 var _inferers = __webpack_require__(370); 40421 40422 var inferers = _interopRequireWildcard(_inferers); 40423 40424 var _babelTypes = __webpack_require__(1); 40425 40426 var t = _interopRequireWildcard(_babelTypes); 40427 40428 function _interopRequireWildcard(obj) { 40429 if (obj && obj.__esModule) { 40430 return obj; 40431 } else { 40432 var newObj = {};if (obj != null) { 40433 for (var key in obj) { 40434 if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; 40435 } 40436 }newObj.default = obj;return newObj; 40437 } 40438 } 40439 40440 function _interopRequireDefault(obj) { 40441 return obj && obj.__esModule ? obj : { default: obj }; 40442 } 40443 40444 function getTypeAnnotation() { 40445 if (this.typeAnnotation) return this.typeAnnotation; 40446 40447 var type = this._getTypeAnnotation() || t.anyTypeAnnotation(); 40448 if (t.isTypeAnnotation(type)) type = type.typeAnnotation; 40449 return this.typeAnnotation = type; 40450 } 40451 40452 function _getTypeAnnotation() { 40453 var node = this.node; 40454 40455 if (!node) { 40456 if (this.key === "init" && this.parentPath.isVariableDeclarator()) { 40457 var declar = this.parentPath.parentPath; 40458 var declarParent = declar.parentPath; 40459 40460 if (declar.key === "left" && declarParent.isForInStatement()) { 40461 return t.stringTypeAnnotation(); 40462 } 40463 40464 if (declar.key === "left" && declarParent.isForOfStatement()) { 40465 return t.anyTypeAnnotation(); 40466 } 40467 40468 return t.voidTypeAnnotation(); 40469 } else { 40470 return; 40471 } 40472 } 40473 40474 if (node.typeAnnotation) { 40475 return node.typeAnnotation; 40476 } 40477 40478 var inferer = inferers[node.type]; 40479 if (inferer) { 40480 return inferer.call(this, node); 40481 } 40482 40483 inferer = inferers[this.parentPath.type]; 40484 if (inferer && inferer.validParent) { 40485 return this.parentPath.getTypeAnnotation(); 40486 } 40487 } 40488 40489 function isBaseType(baseName, soft) { 40490 return _isBaseType(baseName, this.getTypeAnnotation(), soft); 40491 } 40492 40493 function _isBaseType(baseName, type, soft) { 40494 if (baseName === "string") { 40495 return t.isStringTypeAnnotation(type); 40496 } else if (baseName === "number") { 40497 return t.isNumberTypeAnnotation(type); 40498 } else if (baseName === "boolean") { 40499 return t.isBooleanTypeAnnotation(type); 40500 } else if (baseName === "any") { 40501 return t.isAnyTypeAnnotation(type); 40502 } else if (baseName === "mixed") { 40503 return t.isMixedTypeAnnotation(type); 40504 } else if (baseName === "empty") { 40505 return t.isEmptyTypeAnnotation(type); 40506 } else if (baseName === "void") { 40507 return t.isVoidTypeAnnotation(type); 40508 } else { 40509 if (soft) { 40510 return false; 40511 } else { 40512 throw new Error("Unknown base type " + baseName); 40513 } 40514 } 40515 } 40516 40517 function couldBeBaseType(name) { 40518 var type = this.getTypeAnnotation(); 40519 if (t.isAnyTypeAnnotation(type)) return true; 40520 40521 if (t.isUnionTypeAnnotation(type)) { 40522 for (var _iterator = type.types, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) { 40523 var _ref; 40524 40525 if (_isArray) { 40526 if (_i >= _iterator.length) break; 40527 _ref = _iterator[_i++]; 40528 } else { 40529 _i = _iterator.next(); 40530 if (_i.done) break; 40531 _ref = _i.value; 40532 } 40533 40534 var type2 = _ref;
40535 40536 if (t.isAnyTypeAnnotation(type2) || _isBaseType(name, type2, true)) { 40537 return true; 40538 } 40539 } 40540 return false; 40541 } else { 40542 return _isBaseType(name, type, true); 40543 } 40544 } 40545 40546 function baseTypeStrictlyMatches(right) { 40547 var left = this.getTypeAnnotation(); 40548 right = right.getTypeAnnotation(); 40549 40550 if (!t.isAnyTypeAnnotation(left) && t.isFlowBaseAnnotation(left)) { 40551 return right.type === left.type; 40552 } 40553 } 40554 40555 function isGenericType(genericName) { 40556 var type = this.getTypeAnnotation(); 40557 return t.isGenericTypeAnnotation(type) && t.isIdentifier(type.id, { name: genericName }); 40558 } 40559 40560/***/ }, 40561/* 369 */ 40562/***/ function(module, exports, __webpack_require__) { 40563 40564 "use strict"; 40565 40566 exports.__esModule = true; 40567 40568 var _getIterator2 = __webpack_require__(2); 40569 40570 var _getIterator3 = _interopRequireDefault(_getIterator2); 40571 40572 exports.default = function (node) { 40573 if (!this.isReferenced()) return; 40574 40575 var binding = this.scope.getBinding(node.name); 40576 if (binding) { 40577 if (binding.identifier.typeAnnotation) { 40578 return binding.identifier.typeAnnotation; 40579 } else { 40580 return getTypeAnnotationBindingConstantViolations(this, node.name); 40581 } 40582 } 40583 40584 if (node.name === "undefined") { 40585 return t.voidTypeAnnotation(); 40586 } else if (node.name === "NaN" || node.name === "Infinity") { 40587 return t.numberTypeAnnotation(); 40588 } else if (node.name === "arguments") {} 40589 }; 40590 40591 var _babelTypes = __webpack_require__(1); 40592 40593 var t = _interopRequireWildcard(_babelTypes); 40594 40595 function _interopRequireWildcard(obj) { 40596 if (obj && obj.__esModule) { 40597 return obj; 40598 } else { 40599 var newObj = {};if (obj != null) { 40600 for (var key in obj) { 40601 if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; 40602 } 40603 }newObj.default = obj;return newObj; 40604 } 40605 } 40606 40607 function _interopRequireDefault(obj) { 40608 return obj && obj.__esModule ? obj : { default: obj }; 40609 } 40610 40611 function getTypeAnnotationBindingConstantViolations(path, name) { 40612 var binding = path.scope.getBinding(name); 40613 40614 var types = []; 40615 path.typeAnnotation = t.unionTypeAnnotation(types); 40616 40617 var functionConstantViolations = []; 40618 var constantViolations = getConstantViolationsBefore(binding, path, functionConstantViolations); 40619 40620 var testType = getConditionalAnnotation(path, name); 40621 if (testType) { 40622 (function () { 40623 var testConstantViolations = getConstantViolationsBefore(binding, testType.ifStatement); 40624 40625 constantViolations = constantViolations.filter(function (path) { 40626 return testConstantViolations.indexOf(path) < 0; 40627 }); 40628 40629 types.push(testType.typeAnnotation); 40630 })(); 40631 } 40632 40633 if (constantViolations.length) { 40634 constantViolations = constantViolations.concat(functionConstantViolations); 40635 40636 for (var _iterator = constantViolations, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) { 40637 var _ref; 40638 40639 if (_isArray) { 40640 if (_i >= _iterator.length) break; 40641 _ref = _iterator[_i++]; 40642 } else { 40643 _i = _iterator.next(); 40644 if (_i.done) break; 40645 _ref = _i.value; 40646 } 40647 40648 var violation = _ref; 40649 40650 types.push(violation.getTypeAnnotation()); 40651 } 40652 } 40653 40654 if (types.length) { 40655 return t.createUnionTypeAnnotation(types); 40656 } 40657 } 40658 40659 function getConstantViolationsBefore(binding, path, functions) { 40660 var violations = binding.constantViolations.slice(); 40661 violations.unshift(binding.path); 40662 return violations.filter(function (violation) { 40663 violation = violation.resolve(); 40664 var status = violation._guessExecutionStatusRelativeTo(path); 40665 if (functions && status === "function") functions.push(violation); 40666 return status === "before"; 40667 }); 40668 } 40669 40670 function inferAnnotationFromBinaryExpression(name, path) { 40671 var operator = path.node.operator; 40672 40673 var right = path.get("right").resolve(); 40674 var left = path.get("left").resolve(); 40675 40676 var target = void 0; 40677 if (left.isIdentifier({ name: name })) { 40678 target = right; 40679 } else if (right.isIdentifier({ name: name })) { 40680 target = left; 40681 } 40682 if (target) { 40683 if (operator === "===") { 40684 return target.getTypeAnnotation(); 40685 } else if (t.BOOLEAN_NUMBER_BINARY_OPERATORS.indexOf(operator) >= 0) { 40686 return t.numberTypeAnnotation(); 40687 } else { 40688 return; 40689 } 40690 } else { 40691 if (operator !== "===") return; 40692 } 40693 40694 var typeofPath = void 0; 40695 var typePath = void 0; 40696 if (left.isUnaryExpression({ operator: "typeof" })) { 40697 typeofPath = left; 40698 typePath = right; 40699 } else if (right.isUnaryExpression({ operator: "typeof" })) { 40700 typeofPath = right; 40701 typePath = left; 40702 } 40703 if (!typePath && !typeofPath) return; 40704 40705 typePath = typePath.resolve(); 40706 if (!typePath.isLiteral()) return; 40707 40708 var typeValue = typePath.node.value; 40709 if (typeof typeValue !== "string") return; 40710 40711 if (!typeofPath.get("argument").isIdentifier({ name: name })) return; 40712 40713 return t.createTypeAnnotationBasedOnTypeof(typePath.node.value); 40714 } 40715 40716 function getParentConditionalPath(path) { 40717 var parentPath = void 0; 40718 while (parentPath = path.parentPath) {
40719 if (parentPath.isIfStatement() || parentPath.isConditionalExpression()) { 40720 if (path.key === "test") { 40721 return; 40722 } else { 40723 return parentPath; 40724 } 40725 } else { 40726 path = parentPath; 40727 } 40728 } 40729 } 40730 40731 function getConditionalAnnotation(path, name) { 40732 var ifStatement = getParentConditionalPath(path); 40733 if (!ifStatement) return; 40734 40735 var test = ifStatement.get("test"); 40736 var paths = [test]; 40737 var types = []; 40738 40739 do { 40740 var _path = paths.shift().resolve(); 40741 40742 if (_path.isLogicalExpression()) { 40743 paths.push(_path.get("left")); 40744 paths.push(_path.get("right")); 40745 } 40746 40747 if (_path.isBinaryExpression()) { 40748 var type = inferAnnotationFromBinaryExpression(name, _path); 40749 if (type) types.push(type); 40750 } 40751 } while (paths.length); 40752 40753 if (types.length) { 40754 return { 40755 typeAnnotation: t.createUnionTypeAnnotation(types), 40756 ifStatement: ifStatement 40757 }; 40758 } else { 40759 return getConditionalAnnotation(ifStatement, name); 40760 } 40761 } 40762 module.exports = exports["default"]; 40763 40764/***/ }, 40765/* 370 */ 40766/***/ function(module, exports, __webpack_require__) { 40767 40768 "use strict"; 40769 40770 exports.__esModule = true; 40771 exports.ClassDeclaration = exports.ClassExpression = exports.FunctionDeclaration = exports.ArrowFunctionExpression = exports.FunctionExpression = exports.Identifier = undefined; 40772 40773 var _infererReference = __webpack_require__(369); 40774 40775 Object.defineProperty(exports, "Identifier", { 40776 enumerable: true, 40777 get: function get() { 40778 return _interopRequireDefault(_infererReference).default; 40779 } 40780 }); 40781 exports.VariableDeclarator = VariableDeclarator; 40782 exports.TypeCastExpression = TypeCastExpression; 40783 exports.NewExpression = NewExpression; 40784 exports.TemplateLiteral = TemplateLiteral; 40785 exports.UnaryExpression = UnaryExpression; 40786 exports.BinaryExpression = BinaryExpression; 40787 exports.LogicalExpression = LogicalExpression; 40788 exports.ConditionalExpression = ConditionalExpression; 40789 exports.SequenceExpression = SequenceExpression; 40790 exports.AssignmentExpression = AssignmentExpression; 40791 exports.UpdateExpression = UpdateExpression; 40792 exports.StringLiteral = StringLiteral; 40793 exports.NumericLiteral = NumericLiteral; 40794 exports.BooleanLiteral = BooleanLiteral; 40795 exports.NullLiteral = NullLiteral; 40796 exports.RegExpLiteral = RegExpLiteral; 40797 exports.ObjectExpression = ObjectExpression; 40798 exports.ArrayExpression = ArrayExpression; 40799 exports.RestElement = RestElement; 40800 exports.CallExpression = CallExpression; 40801 exports.TaggedTemplateExpression = TaggedTemplateExpression; 40802 40803 var _babelTypes = __webpack_require__(1); 40804 40805 var t = _interopRequireWildcard(_babelTypes); 40806 40807 function _interopRequireWildcard(obj) { 40808 if (obj && obj.__esModule) { 40809 return obj; 40810 } else { 40811 var newObj = {};if (obj != null) { 40812 for (var key in obj) { 40813 if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; 40814 } 40815 }newObj.default = obj;return newObj; 40816 } 40817 } 40818 40819 function _interopRequireDefault(obj) { 40820 return obj && obj.__esModule ? obj : { default: obj }; 40821 } 40822 40823 function VariableDeclarator() { 40824 var id = this.get("id"); 40825 40826 if (id.isIdentifier()) { 40827 return this.get("init").getTypeAnnotation(); 40828 } else { 40829 return; 40830 } 40831 } 40832 40833 function TypeCastExpression(node) { 40834 return node.typeAnnotation; 40835 } 40836 40837 TypeCastExpression.validParent = true; 40838 40839 function NewExpression(node) { 40840 if (this.get("callee").isIdentifier()) { 40841 return t.genericTypeAnnotation(node.callee); 40842 } 40843 } 40844 40845 function TemplateLiteral() { 40846 return t.stringTypeAnnotation(); 40847 } 40848 40849 function UnaryExpression(node) { 40850 var operator = node.operator; 40851 40852 if (operator === "void") { 40853 return t.voidTypeAnnotation(); 40854 } else if (t.NUMBER_UNARY_OPERATORS.indexOf(operator) >= 0) { 40855 return t.numberTypeAnnotation(); 40856 } else if (t.STRING_UNARY_OPERATORS.indexOf(operator) >= 0) { 40857 return t.stringTypeAnnotation(); 40858 } else if (t.BOOLEAN_UNARY_OPERATORS.indexOf(operator) >= 0) { 40859 return t.booleanTypeAnnotation(); 40860 } 40861 } 40862 40863 function BinaryExpression(node) { 40864 var operator = node.operator; 40865 40866 if (t.NUMBER_BINARY_OPERATORS.indexOf(operator) >= 0) { 40867 return t.numberTypeAnnotation(); 40868 } else if (t.BOOLEAN_BINARY_OPERATORS.indexOf(operator) >= 0) { 40869 return t.booleanTypeAnnotation(); 40870 } else if (operator === "+") { 40871 var right = this.get("right"); 40872 var left = this.get("left"); 40873 40874 if (left.isBaseType("number") && right.isBaseType("number")) { 40875 return t.numberTypeAnnotation(); 40876 } else if (left.isBaseType("string") || right.isBaseType("string")) { 40877 return t.stringTypeAnnotation(); 40878 } 40879 40880 return t.unionTypeAnnotation([t.stringTypeAnnotation(), t.numberTypeAnnotation()]); 40881 } 40882 } 40883 40884 function LogicalExpression() { 40885 return t.createUnionTypeAnnotation([this.get("left").getTypeAnnotation(), this.get("right").getTypeAnnotation()]); 40886 } 40887 40888 function ConditionalExpression() { 40889 return t.createUnionTypeAnnotation([this.get("consequent").getTypeAnnotation(), this.get("alternate").getTypeAnnotation()]); 40890 } 40891 40892 function SequenceExpression() { 40893 return this.get("expressions").pop().getTypeAnnotation(); 40894 } 40895 40896 function AssignmentExpression() { 40897 return this.get("right").getTypeAnnotation(); 40898 } 40899 40900 function UpdateExpression(node) {
40901 var operator = node.operator; 40902 if (operator === "++" || operator === "--") { 40903 return t.numberTypeAnnotation(); 40904 } 40905 } 40906 40907 function StringLiteral() { 40908 return t.stringTypeAnnotation(); 40909 } 40910 40911 function NumericLiteral() { 40912 return t.numberTypeAnnotation(); 40913 } 40914 40915 function BooleanLiteral() { 40916 return t.booleanTypeAnnotation(); 40917 } 40918 40919 function NullLiteral() { 40920 return t.nullLiteralTypeAnnotation(); 40921 } 40922 40923 function RegExpLiteral() { 40924 return t.genericTypeAnnotation(t.identifier("RegExp")); 40925 } 40926 40927 function ObjectExpression() { 40928 return t.genericTypeAnnotation(t.identifier("Object")); 40929 } 40930 40931 function ArrayExpression() { 40932 return t.genericTypeAnnotation(t.identifier("Array")); 40933 } 40934 40935 function RestElement() { 40936 return ArrayExpression(); 40937 } 40938 40939 RestElement.validParent = true; 40940 40941 function Func() { 40942 return t.genericTypeAnnotation(t.identifier("Function")); 40943 } 40944 40945 exports.FunctionExpression = Func; 40946 exports.ArrowFunctionExpression = Func; 40947 exports.FunctionDeclaration = Func; 40948 exports.ClassExpression = Func; 40949 exports.ClassDeclaration = Func; 40950 function CallExpression() { 40951 return resolveCall(this.get("callee")); 40952 } 40953 40954 function TaggedTemplateExpression() { 40955 return resolveCall(this.get("tag")); 40956 } 40957 40958 function resolveCall(callee) { 40959 callee = callee.resolve(); 40960 40961 if (callee.isFunction()) { 40962 if (callee.is("async")) { 40963 if (callee.is("generator")) { 40964 return t.genericTypeAnnotation(t.identifier("AsyncIterator")); 40965 } else { 40966 return t.genericTypeAnnotation(t.identifier("Promise")); 40967 } 40968 } else { 40969 if (callee.node.returnType) { 40970 return callee.node.returnType; 40971 } else {} 40972 } 40973 } 40974 } 40975 40976/***/ }, 40977/* 371 */ 40978/***/ function(module, exports, __webpack_require__) { 40979 40980 "use strict"; 40981 40982 exports.__esModule = true; 40983 exports.is = undefined; 40984 40985 var _typeof2 = __webpack_require__(6); 40986 40987 var _typeof3 = _interopRequireDefault(_typeof2); 40988 40989 var _getIterator2 = __webpack_require__(2); 40990 40991 var _getIterator3 = _interopRequireDefault(_getIterator2); 40992 40993 exports.matchesPattern = matchesPattern; 40994 exports.has = has; 40995 exports.isStatic = isStatic; 40996 exports.isnt = isnt; 40997 exports.equals = equals; 40998 exports.isNodeType = isNodeType; 40999 exports.canHaveVariableDeclarationOrExpression = canHaveVariableDeclarationOrExpression; 41000 exports.canSwapBetweenExpressionAndStatement = canSwapBetweenExpressionAndStatement; 41001 exports.isCompletionRecord = isCompletionRecord; 41002 exports.isStatementOrBlock = isStatementOrBlock; 41003 exports.referencesImport = referencesImport; 41004 exports.getSource = getSource; 41005 exports.willIMaybeExecuteBefore = willIMaybeExecuteBefore; 41006 exports._guessExecutionStatusRelativeTo = _guessExecutionStatusRelativeTo; 41007 exports._guessExecutionStatusRelativeToDifferentFunctions = _guessExecutionStatusRelativeToDifferentFunctions; 41008 exports.resolve = resolve; 41009 exports._resolve = _resolve; 41010 41011 var _includes = __webpack_require__(109); 41012 41013 var _includes2 = _interopRequireDefault(_includes); 41014 41015 var _babelTypes = __webpack_require__(1); 41016 41017 var t = _interopRequireWildcard(_babelTypes); 41018 41019 function _interopRequireWildcard(obj) { 41020 if (obj && obj.__esModule) { 41021 return obj; 41022 } else { 41023 var newObj = {};if (obj != null) { 41024 for (var key in obj) { 41025 if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; 41026 } 41027 }newObj.default = obj;return newObj; 41028 } 41029 } 41030 41031 function _interopRequireDefault(obj) { 41032 return obj && obj.__esModule ? obj : { default: obj }; 41033 } 41034 41035 function matchesPattern(pattern, allowPartial) { 41036 if (!this.isMemberExpression()) return false; 41037 41038 var parts = pattern.split("."); 41039 var search = [this.node]; 41040 var i = 0; 41041 41042 function matches(name) { 41043 var part = parts[i]; 41044 return part === "*" || name === part; 41045 } 41046 41047 while (search.length) { 41048 var node = search.shift(); 41049 41050 if (allowPartial && i === parts.length) { 41051 return true; 41052 } 41053 41054 if (t.isIdentifier(node)) { 41055 if (!matches(node.name)) return false; 41056 } else if (t.isLiteral(node)) { 41057 if (!matches(node.value)) return false; 41058 } else if (t.isMemberExpression(node)) { 41059 if (node.computed && !t.isLiteral(node.property)) { 41060 return false;
41061 } else { 41062 search.unshift(node.property); 41063 search.unshift(node.object); 41064 continue; 41065 } 41066 } else if (t.isThisExpression(node)) { 41067 if (!matches("this")) return false; 41068 } else { 41069 return false; 41070 } 41071 41072 if (++i > parts.length) { 41073 return false; 41074 } 41075 } 41076 41077 return i === parts.length; 41078 } 41079 41080 function has(key) { 41081 var val = this.node && this.node[key]; 41082 if (val && Array.isArray(val)) { 41083 return !!val.length; 41084 } else { 41085 return !!val; 41086 } 41087 } 41088 41089 function isStatic() { 41090 return this.scope.isStatic(this.node); 41091 } 41092 41093 var is = exports.is = has; 41094 41095 function isnt(key) { 41096 return !this.has(key); 41097 } 41098 41099 function equals(key, value) { 41100 return this.node[key] === value; 41101 } 41102 41103 function isNodeType(type) { 41104 return t.isType(this.type, type); 41105 } 41106 41107 function canHaveVariableDeclarationOrExpression() { 41108 return (this.key === "init" || this.key === "left") && this.parentPath.isFor(); 41109 } 41110 41111 function canSwapBetweenExpressionAndStatement(replacement) { 41112 if (this.key !== "body" || !this.parentPath.isArrowFunctionExpression()) { 41113 return false; 41114 } 41115 41116 if (this.isExpression()) { 41117 return t.isBlockStatement(replacement); 41118 } else if (this.isBlockStatement()) { 41119 return t.isExpression(replacement); 41120 } 41121 41122 return false; 41123 } 41124 41125 function isCompletionRecord(allowInsideFunction) { 41126 var path = this; 41127 var first = true; 41128 41129 do { 41130 var container = path.container; 41131 41132 if (path.isFunction() && !first) { 41133 return !!allowInsideFunction; 41134 } 41135 41136 first = false; 41137 41138 if (Array.isArray(container) && path.key !== container.length - 1) { 41139 return false; 41140 } 41141 } while ((path = path.parentPath) && !path.isProgram()); 41142 41143 return true; 41144 } 41145 41146 function isStatementOrBlock() { 41147 if (this.parentPath.isLabeledStatement() || t.isBlockStatement(this.container)) { 41148 return false; 41149 } else { 41150 return (0, _includes2.default)(t.STATEMENT_OR_BLOCK_KEYS, this.key); 41151 } 41152 } 41153 41154 function referencesImport(moduleSource, importName) { 41155 if (!this.isReferencedIdentifier()) return false; 41156 41157 var binding = this.scope.getBinding(this.node.name); 41158 if (!binding || binding.kind !== "module") return false; 41159 41160 var path = binding.path; 41161 var parent = path.parentPath; 41162 if (!parent.isImportDeclaration()) return false; 41163 41164 if (parent.node.source.value === moduleSource) { 41165 if (!importName) return true; 41166 } else { 41167 return false; 41168 } 41169 41170 if (path.isImportDefaultSpecifier() && importName === "default") { 41171 return true; 41172 } 41173 41174 if (path.isImportNamespaceSpecifier() && importName === "*") { 41175 return true; 41176 } 41177 41178 if (path.isImportSpecifier() && path.node.imported.name === importName) { 41179 return true; 41180 } 41181 41182 return false; 41183 } 41184 41185 function getSource() { 41186 var node = this.node; 41187 if (node.end) { 41188 return this.hub.file.code.slice(node.start, node.end); 41189 } else { 41190 return ""; 41191 } 41192 } 41193 41194 function willIMaybeExecuteBefore(target) { 41195 return this._guessExecutionStatusRelativeTo(target) !== "after"; 41196 } 41197 41198 function _guessExecutionStatusRelativeTo(target) { 41199 var targetFuncParent = target.scope.getFunctionParent(); 41200 var selfFuncParent = this.scope.getFunctionParent(); 41201 41202 if (targetFuncParent.node !== selfFuncParent.node) { 41203 var status = this._guessExecutionStatusRelativeToDifferentFunctions(targetFuncParent); 41204 if (status) { 41205 return status; 41206 } else { 41207 target = targetFuncParent.path; 41208 } 41209 } 41210 41211 var targetPaths = target.getAncestry(); 41212 if (targetPaths.indexOf(this) >= 0) return "after"; 41213 41214 var selfPaths = this.getAncestry(); 41215 41216 var commonPath = void 0; 41217 var targetIndex = void 0; 41218 var selfIndex = void 0; 41219 for (selfIndex = 0; selfIndex < selfPaths.length; selfIndex++) { 41220 var selfPath = selfPaths[selfIndex]; 41221 targetIndex = targetPaths.indexOf(selfPath); 41222 if (targetIndex >= 0) { 41223 commonPath = selfPath; 41224 break; 41225 } 41226 } 41227 if (!commonPath) { 41228 return "before"; 41229 } 41230 41231 var targetRelationship = targetPaths[targetIndex - 1]; 41232 var selfRelationship = selfPaths[selfIndex - 1];
41233 if (!targetRelationship || !selfRelationship) { 41234 return "before"; 41235 } 41236 41237 if (targetRelationship.listKey && targetRelationship.container === selfRelationship.container) { 41238 return targetRelationship.key > selfRelationship.key ? "before" : "after"; 41239 } 41240 41241 var targetKeyPosition = t.VISITOR_KEYS[targetRelationship.type].indexOf(targetRelationship.key); 41242 var selfKeyPosition = t.VISITOR_KEYS[selfRelationship.type].indexOf(selfRelationship.key); 41243 return targetKeyPosition > selfKeyPosition ? "before" : "after"; 41244 } 41245 41246 function _guessExecutionStatusRelativeToDifferentFunctions(targetFuncParent) { 41247 var targetFuncPath = targetFuncParent.path; 41248 if (!targetFuncPath.isFunctionDeclaration()) return; 41249 41250 var binding = targetFuncPath.scope.getBinding(targetFuncPath.node.id.name); 41251 41252 if (!binding.references) return "before"; 41253 41254 var referencePaths = binding.referencePaths; 41255 41256 for (var _iterator = referencePaths, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) { 41257 var _ref; 41258 41259 if (_isArray) { 41260 if (_i >= _iterator.length) break; 41261 _ref = _iterator[_i++]; 41262 } else { 41263 _i = _iterator.next(); 41264 if (_i.done) break; 41265 _ref = _i.value; 41266 } 41267 41268 var path = _ref; 41269 41270 if (path.key !== "callee" || !path.parentPath.isCallExpression()) { 41271 return; 41272 } 41273 } 41274 41275 var allStatus = void 0; 41276 41277 for (var _iterator2 = referencePaths, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) { 41278 var _ref2; 41279 41280 if (_isArray2) { 41281 if (_i2 >= _iterator2.length) break; 41282 _ref2 = _iterator2[_i2++]; 41283 } else { 41284 _i2 = _iterator2.next(); 41285 if (_i2.done) break; 41286 _ref2 = _i2.value; 41287 } 41288 41289 var _path = _ref2; 41290 41291 var childOfFunction = !!_path.find(function (path) { 41292 return path.node === targetFuncPath.node; 41293 }); 41294 if (childOfFunction) continue; 41295 41296 var status = this._guessExecutionStatusRelativeTo(_path); 41297 41298 if (allStatus) { 41299 if (allStatus !== status) return; 41300 } else { 41301 allStatus = status; 41302 } 41303 } 41304 41305 return allStatus; 41306 } 41307 41308 function resolve(dangerous, resolved) { 41309 return this._resolve(dangerous, resolved) || this; 41310 } 41311 41312 function _resolve(dangerous, resolved) { 41313 var _this = this; 41314 41315 if (resolved && resolved.indexOf(this) >= 0) return; 41316 41317 resolved = resolved || []; 41318 resolved.push(this); 41319 41320 if (this.isVariableDeclarator()) { 41321 if (this.get("id").isIdentifier()) { 41322 return this.get("init").resolve(dangerous, resolved); 41323 } else {} 41324 } else if (this.isReferencedIdentifier()) { 41325 var binding = this.scope.getBinding(this.node.name); 41326 if (!binding) return; 41327 41328 if (!binding.constant) return; 41329 41330 if (binding.kind === "module") return; 41331 41332 if (binding.path !== this) { 41333 var _ret = function () { 41334 var ret = binding.path.resolve(dangerous, resolved); 41335 41336 if (_this.find(function (parent) { 41337 return parent.node === ret.node; 41338 })) return { 41339 v: void 0 41340 }; 41341 return { 41342 v: ret 41343 }; 41344 }(); 41345 41346 if ((typeof _ret === "undefined" ? "undefined" : (0, _typeof3.default)(_ret)) === "object") return _ret.v; 41347 } 41348 } else if (this.isTypeCastExpression()) { 41349 return this.get("expression").resolve(dangerous, resolved); 41350 } else if (dangerous && this.isMemberExpression()) { 41351 41352 var targetKey = this.toComputedKey(); 41353 if (!t.isLiteral(targetKey)) return; 41354 41355 var targetName = targetKey.value; 41356 41357 var target = this.get("object").resolve(dangerous, resolved); 41358 41359 if (target.isObjectExpression()) { 41360 var props = target.get("properties"); 41361 for (var _iterator3 = props, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, _getIterator3.default)(_iterator3);;) { 41362 var _ref3; 41363 41364 if (_isArray3) { 41365 if (_i3 >= _iterator3.length) break; 41366 _ref3 = _iterator3[_i3++]; 41367 } else { 41368 _i3 = _iterator3.next(); 41369 if (_i3.done) break; 41370 _ref3 = _i3.value; 41371 } 41372 41373 var prop = _ref3; 41374 41375 if (!prop.isProperty()) continue; 41376 41377 var key = prop.get("key"); 41378 41379 var match = prop.isnt("computed") && key.isIdentifier({ name: targetName }); 41380 41381 match = match || key.isLiteral({ value: targetName }); 41382 41383 if (match) return prop.get("value").resolve(dangerous, resolved); 41384 } 41385 } else if (target.isArrayExpression() && !isNaN(+targetName)) { 41386 var elems = target.get("elements"); 41387 var elem = elems[targetName]; 41388 if (elem) return elem.resolve(dangerous, resolved); 41389 } 41390 } 41391 } 41392 41393/***/ }, 41394/* 372 */ 41395/***/ function(module, exports, __webpack_require__) { 41396 41397 "use strict"; 41398 41399 exports.__esModule = true; 41400 41401 var _getIterator2 = __webpack_require__(2); 41402 41403 var _getIterator3 = _interopRequireDefault(_getIterator2); 41404 41405 var _classCallCheck2 = __webpack_require__(3); 41406 41407 var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); 41408 41409 var _babelTypes = __webpack_require__(1); 41410 41411 var t = _interopRequireWildcard(_babelTypes); 41412 41413 function _interopRequireWildcard(obj) { 41414 if (obj && obj.__esModule) { 41415 return obj; 41416 } else { 41417 var newObj = {};if (obj != null) { 41418 for (var key in obj) { 41419 if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; 41420 } 41421 }newObj.default = obj;return newObj; 41422 } 41423 } 41424 41425 function _interopRequireDefault(obj) { 41426 return obj && obj.__esModule ? obj : { default: obj }; 41427 } 41428 41429 var referenceVisitor = { 41430 ReferencedIdentifier: function ReferencedIdentifier(path, state) { 41431 if (path.isJSXIdentifier() && _babelTypes.react.isCompatTag(path.node.name) && !path.parentPath.isJSXMemberExpression()) { 41432 return; 41433 } 41434 41435 if (path.node.name === "this") { 41436 var scope = path.scope; 41437 do { 41438 if (scope.path.isFunction() && !scope.path.isArrowFunctionExpression()) break; 41439 } while (scope = scope.parent); 41440 if (scope) state.breakOnScopePaths.push(scope.path); 41441 } 41442 41443 var binding = path.scope.getBinding(path.node.name); 41444 if (!binding) return; 41445 41446 if (binding !== state.scope.getBinding(path.node.name)) return; 41447 41448 state.bindings[path.node.name] = binding; 41449 } 41450 }; 41451 41452 var PathHoister = function () { 41453 function PathHoister(path, scope) { 41454 (0, _classCallCheck3.default)(this, PathHoister); 41455 41456 this.breakOnScopePaths = []; 41457 41458 this.bindings = {}; 41459 41460 this.scopes = []; 41461 41462 this.scope = scope; 41463 this.path = path; 41464 41465 this.attachAfter = false;
41466 } 41467 41468 PathHoister.prototype.isCompatibleScope = function isCompatibleScope(scope) { 41469 for (var key in this.bindings) { 41470 var binding = this.bindings[key]; 41471 if (!scope.bindingIdentifierEquals(key, binding.identifier)) { 41472 return false; 41473 } 41474 } 41475 41476 return true; 41477 }; 41478 41479 PathHoister.prototype.getCompatibleScopes = function getCompatibleScopes() { 41480 var scope = this.path.scope; 41481 do { 41482 if (this.isCompatibleScope(scope)) { 41483 this.scopes.push(scope); 41484 } else { 41485 break; 41486 } 41487 41488 if (this.breakOnScopePaths.indexOf(scope.path) >= 0) { 41489 break; 41490 } 41491 } while (scope = scope.parent); 41492 }; 41493 41494 PathHoister.prototype.getAttachmentPath = function getAttachmentPath() { 41495 var path = this._getAttachmentPath(); 41496 if (!path) return; 41497 41498 var targetScope = path.scope; 41499 41500 if (targetScope.path === path) { 41501 targetScope = path.scope.parent; 41502 } 41503 41504 if (targetScope.path.isProgram() || targetScope.path.isFunction()) { 41505 for (var name in this.bindings) { 41506 if (!targetScope.hasOwnBinding(name)) continue; 41507 41508 var binding = this.bindings[name]; 41509 41510 if (binding.kind === "param") continue; 41511 41512 if (this.getAttachmentParentForPath(binding.path).key > path.key) { 41513 this.attachAfter = true; 41514 path = binding.path; 41515 41516 for (var _iterator = binding.constantViolations, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) { 41517 var _ref; 41518 41519 if (_isArray) { 41520 if (_i >= _iterator.length) break; 41521 _ref = _iterator[_i++]; 41522 } else { 41523 _i = _iterator.next(); 41524 if (_i.done) break; 41525 _ref = _i.value; 41526 } 41527 41528 var violationPath = _ref; 41529 41530 if (this.getAttachmentParentForPath(violationPath).key > path.key) { 41531 path = violationPath; 41532 } 41533 } 41534 } 41535 } 41536 } 41537 41538 return path; 41539 }; 41540 41541 PathHoister.prototype._getAttachmentPath = function _getAttachmentPath() { 41542 var scopes = this.scopes; 41543 41544 var scope = scopes.pop(); 41545 41546 if (!scope) return; 41547 41548 if (scope.path.isFunction()) { 41549 if (this.hasOwnParamBindings(scope)) { 41550 if (this.scope === scope) return; 41551 41552 return scope.path.get("body").get("body")[0]; 41553 } else { 41554 return this.getNextScopeAttachmentParent(); 41555 } 41556 } else if (scope.path.isProgram()) { 41557 return this.getNextScopeAttachmentParent(); 41558 } 41559 }; 41560 41561 PathHoister.prototype.getNextScopeAttachmentParent = function getNextScopeAttachmentParent() { 41562 var scope = this.scopes.pop(); 41563 if (scope) return this.getAttachmentParentForPath(scope.path); 41564 }; 41565 41566 PathHoister.prototype.getAttachmentParentForPath = function getAttachmentParentForPath(path) { 41567 do { 41568 if (!path.parentPath || Array.isArray(path.container) && path.isStatement() || path.isVariableDeclarator() && path.parentPath.node !== null && path.parentPath.node.declarations.length > 1) return path; 41569 } while (path = path.parentPath); 41570 }; 41571 41572 PathHoister.prototype.hasOwnParamBindings = function hasOwnParamBindings(scope) { 41573 for (var name in this.bindings) { 41574 if (!scope.hasOwnBinding(name)) continue; 41575 41576 var binding = this.bindings[name]; 41577 41578 if (binding.kind === "param" && binding.constant) return true; 41579 } 41580 return false; 41581 }; 41582 41583 PathHoister.prototype.run = function run() { 41584 var node = this.path.node; 41585 if (node._hoisted) return; 41586 node._hoisted = true; 41587 41588 this.path.traverse(referenceVisitor, this); 41589 41590 this.getCompatibleScopes(); 41591 41592 var attachTo = this.getAttachmentPath(); 41593 if (!attachTo) return; 41594 41595 if (attachTo.getFunctionParent() === this.path.getFunctionParent()) return; 41596 41597 var uid = attachTo.scope.generateUidIdentifier("ref"); 41598 var declarator = t.variableDeclarator(uid, this.path.node); 41599 41600 var insertFn = this.attachAfter ? "insertAfter" : "insertBefore"; 41601 attachTo[insertFn]([attachTo.isVariableDeclarator() ? declarator : t.variableDeclaration("var", [declarator])]); 41602 41603 var parent = this.path.parentPath; 41604 if (parent.isJSXElement() && this.path.container === parent.node.children) { 41605 uid = t.JSXExpressionContainer(uid); 41606 } 41607 41608 this.path.replaceWith(uid); 41609 }; 41610 41611 return PathHoister; 41612 }(); 41613 41614 exports.default = PathHoister; 41615 module.exports = exports["default"]; 41616 41617/***/ }, 41618/* 373 */
41619/***/ function(module, exports) { 41620 41621 "use strict"; 41622 41623 exports.__esModule = true; 41624 var hooks = exports.hooks = [function (self, parent) { 41625 var removeParent = self.key === "test" && (parent.isWhile() || parent.isSwitchCase()) || self.key === "declaration" && parent.isExportDeclaration() || self.key === "body" && parent.isLabeledStatement() || self.listKey === "declarations" && parent.isVariableDeclaration() && parent.node.declarations.length === 1 || self.key === "expression" && parent.isExpressionStatement(); 41626 41627 if (removeParent) { 41628 parent.remove(); 41629 return true; 41630 } 41631 }, function (self, parent) { 41632 if (parent.isSequenceExpression() && parent.node.expressions.length === 1) { 41633 parent.replaceWith(parent.node.expressions[0]); 41634 return true; 41635 } 41636 }, function (self, parent) { 41637 if (parent.isBinary()) { 41638 if (self.key === "left") { 41639 parent.replaceWith(parent.node.right); 41640 } else { 41641 parent.replaceWith(parent.node.left); 41642 } 41643 return true; 41644 } 41645 }, function (self, parent) { 41646 if (parent.isIfStatement() && (self.key === "consequent" || self.key === "alternate") || self.key === "body" && (parent.isLoop() || parent.isArrowFunctionExpression())) { 41647 self.replaceWith({ 41648 type: "BlockStatement", 41649 body: [] 41650 }); 41651 return true; 41652 } 41653 }]; 41654 41655/***/ }, 41656/* 374 */ 41657/***/ function(module, exports, __webpack_require__) { 41658 41659 "use strict"; 41660 41661 exports.__esModule = true; 41662 41663 var _typeof2 = __webpack_require__(6); 41664 41665 var _typeof3 = _interopRequireDefault(_typeof2); 41666 41667 var _getIterator2 = __webpack_require__(2); 41668 41669 var _getIterator3 = _interopRequireDefault(_getIterator2); 41670 41671 exports.insertBefore = insertBefore; 41672 exports._containerInsert = _containerInsert; 41673 exports._containerInsertBefore = _containerInsertBefore; 41674 exports._containerInsertAfter = _containerInsertAfter; 41675 exports._maybePopFromStatements = _maybePopFromStatements; 41676 exports.insertAfter = insertAfter; 41677 exports.updateSiblingKeys = updateSiblingKeys; 41678 exports._verifyNodeList = _verifyNodeList; 41679 exports.unshiftContainer = unshiftContainer; 41680 exports.pushContainer = pushContainer; 41681 exports.hoist = hoist; 41682 41683 var _cache = __webpack_require__(86); 41684 41685 var _hoister = __webpack_require__(372); 41686 41687 var _hoister2 = _interopRequireDefault(_hoister); 41688 41689 var _index = __webpack_require__(35); 41690 41691 var _index2 = _interopRequireDefault(_index); 41692 41693 var _babelTypes = __webpack_require__(1); 41694 41695 var t = _interopRequireWildcard(_babelTypes); 41696 41697 function _interopRequireWildcard(obj) { 41698 if (obj && obj.__esModule) { 41699 return obj; 41700 } else { 41701 var newObj = {};if (obj != null) { 41702 for (var key in obj) { 41703 if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; 41704 } 41705 }newObj.default = obj;return newObj; 41706 } 41707 } 41708 41709 function _interopRequireDefault(obj) { 41710 return obj && obj.__esModule ? obj : { default: obj }; 41711 } 41712 41713 function insertBefore(nodes) { 41714 this._assertUnremoved(); 41715 41716 nodes = this._verifyNodeList(nodes); 41717 41718 if (this.parentPath.isExpressionStatement() || this.parentPath.isLabeledStatement()) { 41719 return this.parentPath.insertBefore(nodes); 41720 } else if (this.isNodeType("Expression") || this.parentPath.isForStatement() && this.key === "init") { 41721 if (this.node) nodes.push(this.node); 41722 this.replaceExpressionWithStatements(nodes); 41723 } else { 41724 this._maybePopFromStatements(nodes); 41725 if (Array.isArray(this.container)) { 41726 return this._containerInsertBefore(nodes); 41727 } else if (this.isStatementOrBlock()) { 41728 if (this.node) nodes.push(this.node); 41729 this._replaceWith(t.blockStatement(nodes)); 41730 } else { 41731 throw new Error("We don't know what to do with this node type. " + "We were previously a Statement but we can't fit in here?"); 41732 } 41733 } 41734 41735 return [this]; 41736 } 41737 41738 function _containerInsert(from, nodes) { 41739 this.updateSiblingKeys(from, nodes.length); 41740 41741 var paths = []; 41742 41743 for (var i = 0; i < nodes.length; i++) { 41744 var to = from + i; 41745 var node = nodes[i]; 41746 this.container.splice(to, 0, node); 41747 41748 if (this.context) { 41749 var path = this.context.create(this.parent, this.container, to, this.listKey); 41750 41751 if (this.context.queue) path.pushContext(this.context); 41752 paths.push(path); 41753 } else { 41754 paths.push(_index2.default.get({ 41755 parentPath: this.parentPath, 41756 parent: this.parent, 41757 container: this.container, 41758 listKey: this.listKey, 41759 key: to 41760 })); 41761 } 41762 } 41763 41764 var contexts = this._getQueueContexts(); 41765 41766 for (var _iterator = paths, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) { 41767 var _ref; 41768 41769 if (_isArray) { 41770 if (_i >= _iterator.length) break; 41771 _ref = _iterator[_i++]; 41772 } else { 41773 _i = _iterator.next(); 41774 if (_i.done) break; 41775 _ref = _i.value; 41776 } 41777 41778 var _path = _ref; 41779 41780 _path.setScope(); 41781 _path.debug(function () { 41782 return "Inserted."; 41783 }); 41784 41785 for (var _iterator2 = contexts, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) { 41786 var _ref2; 41787 41788 if (_isArray2) { 41789 if (_i2 >= _iterator2.length) break; 41790 _ref2 = _iterator2[_i2++]; 41791 } else { 41792 _i2 = _iterator2.next(); 41793 if (_i2.done) break; 41794 _ref2 = _i2.value; 41795 } 41796 41797 var context = _ref2; 41798 41799 context.maybeQueue(_path, true); 41800 } 41801 } 41802 41803 return paths; 41804 } 41805 41806 function _containerInsertBefore(nodes) { 41807 return this._containerInsert(this.key, nodes); 41808 } 41809 41810 function _containerInsertAfter(nodes) { 41811 return this._containerInsert(this.key + 1, nodes); 41812 } 41813 41814 function _maybePopFromStatements(nodes) { 41815 var last = nodes[nodes.length - 1]; 41816 var isIdentifier = t.isIdentifier(last) || t.isExpressionStatement
41816(last) && t.isIdentifier(last.expression); 41817 41818 if (isIdentifier && !this.isCompletionRecord()) { 41819 nodes.pop(); 41820 } 41821 } 41822 41823 function insertAfter(nodes) { 41824 this._assertUnremoved(); 41825 41826 nodes = this._verifyNodeList(nodes); 41827 41828 if (this.parentPath.isExpressionStatement() || this.parentPath.isLabeledStatement()) { 41829 return this.parentPath.insertAfter(nodes); 41830 } else if (this.isNodeType("Expression") || this.parentPath.isForStatement() && this.key === "init") { 41831 if (this.node) { 41832 var temp = this.scope.generateDeclaredUidIdentifier(); 41833 nodes.unshift(t.expressionStatement(t.assignmentExpression("=", temp, this.node))); 41834 nodes.push(t.expressionStatement(temp)); 41835 } 41836 this.replaceExpressionWithStatements(nodes); 41837 } else { 41838 this._maybePopFromStatements(nodes); 41839 if (Array.isArray(this.container)) { 41840 return this._containerInsertAfter(nodes); 41841 } else if (this.isStatementOrBlock()) { 41842 if (this.node) nodes.unshift(this.node); 41843 this._replaceWith(t.blockStatement(nodes)); 41844 } else { 41845 throw new Error("We don't know what to do with this node type. " + "We were previously a Statement but we can't fit in here?"); 41846 } 41847 } 41848 41849 return [this]; 41850 } 41851 41852 function updateSiblingKeys(fromIndex, incrementBy) { 41853 if (!this.parent) return; 41854 41855 var paths = _cache.path.get(this.parent); 41856 for (var i = 0; i < paths.length; i++) { 41857 var path = paths[i]; 41858 if (path.key >= fromIndex) { 41859 path.key += incrementBy; 41860 } 41861 } 41862 } 41863 41864 function _verifyNodeList(nodes) { 41865 if (!nodes) { 41866 return []; 41867 } 41868 41869 if (nodes.constructor !== Array) { 41870 nodes = [nodes]; 41871 } 41872 41873 for (var i = 0; i < nodes.length; i++) { 41874 var node = nodes[i]; 41875 var msg = void 0; 41876 41877 if (!node) { 41878 msg = "has falsy node"; 41879 } else if ((typeof node === "undefined" ? "undefined" : (0, _typeof3.default)(node)) !== "object") { 41880 msg = "contains a non-object node"; 41881 } else if (!node.type) { 41882 msg = "without a type"; 41883 } else if (node instanceof _index2.default) { 41884 msg = "has a NodePath when it expected a raw object"; 41885 } 41886 41887 if (msg) { 41888 var type = Array.isArray(node) ? "array" : typeof node === "undefined" ? "undefined" : (0, _typeof3.default)(node); 41889 throw new Error("Node list " + msg + " with the index of " + i + " and type of " + type); 41890 } 41891 } 41892 41893 return nodes; 41894 } 41895 41896 function unshiftContainer(listKey, nodes) { 41897 this._assertUnremoved(); 41898 41899 nodes = this._verifyNodeList(nodes); 41900 41901 var path = _index2.default.get({ 41902 parentPath: this, 41903 parent: this.node, 41904 container: this.node[listKey], 41905 listKey: listKey, 41906 key: 0 41907 }); 41908 41909 return path.insertBefore(nodes); 41910 } 41911 41912 function pushContainer(listKey, nodes) { 41913 this._assertUnremoved(); 41914 41915 nodes = this._verifyNodeList(nodes); 41916 41917 var container = this.node[listKey]; 41918 var path = _index2.default.get({ 41919 parentPath: this, 41920 parent: this.node, 41921 container: container, 41922 listKey: listKey, 41923 key: container.length 41924 }); 41925 41926 return path.replaceWithMultiple(nodes); 41927 } 41928 41929 function hoist() { 41930 var scope = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.scope; 41931 41932 var hoister = new _hoister2.default(this, scope); 41933 return hoister.run(); 41934 } 41935 41936/***/ }, 41937/* 375 */ 41938/***/ function(module, exports, __webpack_require__) { 41939 41940 "use strict"; 41941 41942 exports.__esModule = true; 41943 41944 var _getIterator2 = __webpack_require__(2); 41945 41946 var _getIterator3 = _interopRequireDefault(_getIterator2); 41947 41948 exports.remove = remove; 41949 exports._callRemovalHooks = _callRemovalHooks; 41950 exports._remove = _remove; 41951 exports._markRemoved = _markRemoved; 41952 exports._assertUnremoved = _assertUnremoved; 41953 41954 var _removalHooks = __webpack_require__(373); 41955 41956 function _interopRequireDefault(obj) { 41957 return obj && obj.__esModule ? obj : { default: obj }; 41958 } 41959 41960 function remove() { 41961 this._assertUnremoved(); 41962 41963 this.resync(); 41964 41965 if (this._callRemovalHooks()) { 41966 this._markRemoved(); 41967 return; 41968 } 41969 41970 this.shareCommentsWithSiblings(); 41971 this._remove(); 41972 this._markRemoved(); 41973 } 41974 41975 function _callRemovalHooks() { 41976 for (var _iterator = _removalHooks.hooks, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) { 41977 var _ref; 41978 41979 if (_isArray) { 41980 if (_i >= _iterator.length) break; 41981 _ref = _iterator[_i++]; 41982 } else { 41983 _i = _iterator.next(); 41984 if (_i.done) break; 41985 _ref = _i.value; 41986 } 41987 41988 var fn = _ref; 41989 41990 if (fn(this, this.parentPath)) return true; 41991 } 41992 } 41993 41994 function _remove() { 41995 if (Array.isArray(this.container)) { 41996 this.container.splice(this.key, 1); 41997 this.updateSiblingKeys(this.key, -1); 41998 } else { 41999 this._replaceWith(null); 42000 } 42001 } 42002 42003 function _markRemoved() { 42004 this.shouldSkip = true; 42005 this.removed = true; 42006 this.node = null; 42007 } 42008 42009 function _assertUnremoved() { 42010 if (this.removed) { 42011 throw this.buildCodeFrameError("NodePath has been removed so is read-only."); 42012 } 42013 } 42014 42015/***/ }, 42016/* 376 */ 42017/***/ function(module, exports, __webpack_require__) { 42018 42019 "use strict"; 42020 42021 exports.__esModule = true; 42022 42023 var _getIterator2 = __webpack_require__(2); 42024 42025 var _getIterator3 = _interopRequireDefault(_getIterator2); 42026 42027 exports.replaceWithMultiple = replaceWithMultiple; 42028 exports.replaceWithSourceString = replaceWithSourceString; 42029 exports.replaceWith = replaceWith; 42030 exports._replaceWith = _replaceWith; 42031 exports.replaceExpressionWithStatements = replaceExpressionWithStatements; 42032 exports.replaceInline = replaceInline; 42033 42034 var _babelCodeFrame = __webpack_require__(177); 42035 42036 var _babelCodeFrame2 = _interopRequireDefault(_babelCodeFrame); 42037 42038 var _index = __webpack_require__(8); 42039 42040 var _index2 = _interopRequireDefault(_index); 42041 42042 var _index3 = __webpack_require__(35); 42043 42044 var _index4 = _interopRequireDefault(_index3); 42045 42046 var _babylon = __webpack_require__(133); 42047 42048 var _babelTypes = __webpack_require__(1); 42049 42050 var t = _interopRequireWildcard(_babelTypes); 42051 42052 function _interopRequireWildcard(obj) { 42053 if (obj && obj.__esModule) { 42054 return obj; 42055 } else { 42056 var newObj = {};if (obj != null) { 42057 for (var key in obj) { 42058 if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; 42059 } 42060 }newObj.default = obj;return newObj; 42061 } 42062 } 42063 42064 function _interopRequireDefault(obj) { 42065 return obj && obj.__esModule ? obj : { default: obj }; 42066 } 42067
42068 var hoistVariablesVisitor = { 42069 Function: function Function(path) { 42070 path.skip(); 42071 }, 42072 VariableDeclaration: function VariableDeclaration(path) { 42073 if (path.node.kind !== "var") return; 42074 42075 var bindings = path.getBindingIdentifiers(); 42076 for (var key in bindings) { 42077 path.scope.push({ id: bindings[key] }); 42078 } 42079 42080 var exprs = []; 42081 42082 for (var _iterator = path.node.declarations, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) { 42083 var _ref; 42084 42085 if (_isArray) { 42086 if (_i >= _iterator.length) break; 42087 _ref = _iterator[_i++]; 42088 } else { 42089 _i = _iterator.next(); 42090 if (_i.done) break; 42091 _ref = _i.value; 42092 } 42093 42094 var declar = _ref; 42095 42096 if (declar.init) { 42097 exprs.push(t.expressionStatement(t.assignmentExpression("=", declar.id, declar.init))); 42098 } 42099 } 42100 42101 path.replaceWithMultiple(exprs); 42102 } 42103 }; 42104 42105 function replaceWithMultiple(nodes) { 42106 this.resync(); 42107 42108 nodes = this._verifyNodeList(nodes); 42109 t.inheritLeadingComments(nodes[0], this.node); 42110 t.inheritTrailingComments(nodes[nodes.length - 1], this.node); 42111 this.node = this.container[this.key] = null; 42112 this.insertAfter(nodes); 42113 42114 if (this.node) { 42115 this.requeue(); 42116 } else { 42117 this.remove(); 42118 } 42119 } 42120 42121 function replaceWithSourceString(replacement) { 42122 this.resync(); 42123 42124 try { 42125 replacement = "(" + replacement + ")"; 42126 replacement = (0, _babylon.parse)(replacement); 42127 } catch (err) { 42128 var loc = err.loc; 42129 if (loc) { 42130 err.message += " - make sure this is an expression."; 42131 err.message += "\n" + (0, _babelCodeFrame2.default)(replacement, loc.line, loc.column + 1); 42132 } 42133 throw err; 42134 } 42135 42136 replacement = replacement.program.body[0].expression; 42137 _index2.default.removeProperties(replacement); 42138 return this.replaceWith(replacement); 42139 } 42140 42141 function replaceWith(replacement) { 42142 this.resync(); 42143 42144 if (this.removed) { 42145 throw new Error("You can't replace this node, we've already removed it"); 42146 } 42147 42148 if (replacement instanceof _index4.default) { 42149 replacement = replacement.node; 42150 } 42151 42152 if (!replacement) { 42153 throw new Error("You passed `path.replaceWith()` a falsy node, use `path.remove()` instead"); 42154 } 42155 42156 if (this.node === replacement) { 42157 return; 42158 } 42159 42160 if (this.isProgram() && !t.isProgram(replacement)) { 42161 throw new Error("You can only replace a Program root node with another Program node"); 42162 } 42163 42164 if (Array.isArray(replacement)) { 42165 throw new Error("Don't use `path.replaceWith()` with an array of nodes, use `path.replaceWithMultiple()`"); 42166 } 42167 42168 if (typeof replacement === "string") { 42169 throw new Error("Don't use `path.replaceWith()` with a source string, use `path.replaceWithSourceString()`"); 42170 } 42171 42172 if (this.isNodeType("Statement") && t.isExpression(replacement)) { 42173 if (!this.canHaveVariableDeclarationOrExpression() && !this.canSwapBetweenExpressionAndStatement
42173(replacement)) { 42174 replacement = t.expressionStatement(replacement); 42175 } 42176 } 42177 42178 if (this.isNodeType("Expression") && t.isStatement(replacement)) { 42179 if (!this.canHaveVariableDeclarationOrExpression() && !this.canSwapBetweenExpressionAndStatement(replacement)) { 42180 return this.replaceExpressionWithStatements([replacement]); 42181 } 42182 } 42183 42184 var oldNode = this.node; 42185 if (oldNode) { 42186 t.inheritsComments(replacement, oldNode); 42187 t.removeComments(oldNode); 42188 } 42189 42190 this._replaceWith(replacement); 42191 this.type = replacement.type; 42192 42193 this.setScope(); 42194 42195 this.requeue(); 42196 } 42197 42198 function _replaceWith(node) { 42199 if (!this.container) { 42200 throw new ReferenceError("Container is falsy"); 42201 } 42202 42203 if (this.inList) { 42204 t.validate(this.parent, this.key, [node]); 42205 } else { 42206 t.validate(this.parent, this.key, node); 42207 } 42208 42209 this.debug(function () { 42210 return "Replace with " + (node && node.type); 42211 }); 42212 42213 this.node = this.container[this.key] = node; 42214 } 42215 42216 function replaceExpressionWithStatements(nodes) { 42217 this.resync(); 42218 42219 var toSequenceExpression = t.toSequenceExpression(nodes, this.scope); 42220 42221 if (t.isSequenceExpression(toSequenceExpression)) { 42222 var exprs = toSequenceExpression.expressions; 42223 42224 if (exprs.length >= 2 && this.parentPath.isExpressionStatement()) { 42225 this._maybePopFromStatements(exprs); 42226 } 42227 42228 if (exprs.length === 1) { 42229 this.replaceWith(exprs[0]); 42230 } else { 42231 this.replaceWith(toSequenceExpression); 42232 } 42233 } else if (toSequenceExpression) { 42234 this.replaceWith(toSequenceExpression); 42235 } else { 42236 var container = t.functionExpression(null, [], t.blockStatement(nodes)); 42237 container.shadow = true; 42238 42239 this.replaceWith(t.callExpression(container, [])); 42240 this.traverse(hoistVariablesVisitor); 42241 42242 var completionRecords = this.get("callee").getCompletionRecords(); 42243 for (var _iterator2 = completionRecords, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) { 42244 var _ref2; 42245 42246 if (_isArray2) { 42247 if (_i2 >= _iterator2.length) break; 42248 _ref2 = _iterator2[_i2++]; 42249 } else { 42250 _i2 = _iterator2.next(); 42251 if (_i2.done) break; 42252 _ref2 = _i2.value; 42253 } 42254 42255 var path = _ref2; 42256 42257 if (!path.isExpressionStatement()) continue; 42258 42259 var loop = path.findParent(function (path) { 42260 return path.isLoop(); 42261 }); 42262 if (loop) { 42263 var uid = loop.getData("expressionReplacementReturnUid"); 42264 42265 if (!uid) { 42266 var callee = this.get("callee"); 42267 uid = callee.scope.generateDeclaredUidIdentifier("ret"); 42268 callee.get("body").pushContainer("body", t.returnStatement
42268(uid)); 42269 loop.setData("expressionReplacementReturnUid", uid); 42270 } else { 42271 uid = t.identifier(uid.name); 42272 } 42273 42274 path.get("expression").replaceWith(t.assignmentExpression("=", uid, path.node.expression)); 42275 } else { 42276 path.replaceWith(t.returnStatement(path.node.expression)); 42277 } 42278 } 42279 42280 return this.node; 42281 } 42282 } 42283 42284 function replaceInline(nodes) { 42285 this.resync(); 42286 42287 if (Array.isArray(nodes)) { 42288 if (Array.isArray(this.container)) { 42289 nodes = this._verifyNodeList(nodes); 42290 this._containerInsertAfter(nodes); 42291 return this.remove(); 42292 } else { 42293 return this.replaceWithMultiple(nodes); 42294 } 42295 } else { 42296 return this.replaceWith(nodes); 42297 } 42298 } 42299 42300/***/ }, 42301/* 377 */ 42302/***/ function(module, exports, __webpack_require__) { 42303 42304 "use strict"; 42305 42306 exports.__esModule = true; 42307 42308 var _classCallCheck2 = __webpack_require__(3); 42309 42310 var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); 42311 42312 var _binding = __webpack_require__(222); 42313 42314 var _binding2 = _interopRequireDefault(_binding); 42315 42316 var _babelTypes = __webpack_require__(1); 42317 42318 var t = _interopRequireWildcard(_babelTypes); 42319 42320 function _interopRequireWildcard(obj) { 42321 if (obj && obj.__esModule) { 42322 return obj; 42323 } else { 42324 var newObj = {};if (obj != null) { 42325 for (var key in obj) { 42326 if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; 42327 } 42328 }newObj.default = obj;return newObj; 42329 } 42330 } 42331 42332 function _interopRequireDefault(obj) { 42333 return obj && obj.__esModule ? obj : { default: obj }; 42334 } 42335 42336 var renameVisitor = { 42337 ReferencedIdentifier: function ReferencedIdentifier(_ref, state) { 42338 var node = _ref.node; 42339 42340 if (node.name === state.oldName) { 42341 node.name = state.newName; 42342 } 42343 }, 42344 Scope: function Scope(path, state) { 42345 if (!path.scope.bindingIdentifierEquals(state.oldName, state.binding.identifier)) { 42346 path.skip(); 42347 } 42348 }, 42349 "AssignmentExpression|Declaration": function AssignmentExpressionDeclaration(path, state) { 42350 var ids = path.getOuterBindingIdentifiers(); 42351 42352 for (var name in ids) { 42353 if (name === state.oldName) ids[name].name = state.newName; 42354 } 42355 } 42356 }; 42357 42358 var Renamer = function () {
42359 function Renamer(binding, oldName, newName) { 42360 (0, _classCallCheck3.default)(this, Renamer); 42361 42362 this.newName = newName; 42363 this.oldName = oldName; 42364 this.binding = binding; 42365 } 42366 42367 Renamer.prototype.maybeConvertFromExportDeclaration = function maybeConvertFromExportDeclaration(parentDeclar) { 42368 var exportDeclar = parentDeclar.parentPath.isExportDeclaration() && parentDeclar.parentPath; 42369 if (!exportDeclar) return; 42370 42371 var isDefault = exportDeclar.isExportDefaultDeclaration(); 42372 42373 if (isDefault && (parentDeclar.isFunctionDeclaration() || parentDeclar.isClassDeclaration()) && !parentDeclar.node.id) { 42374 parentDeclar.node.id = parentDeclar.scope.generateUidIdentifier("default"); 42375 } 42376 42377 var bindingIdentifiers = parentDeclar.getOuterBindingIdentifiers(); 42378 var specifiers = []; 42379 42380 for (var name in bindingIdentifiers) { 42381 var localName = name === this.oldName ? this.newName : name; 42382 var exportedName = isDefault ? "default" : name; 42383 specifiers.push(t.exportSpecifier(t.identifier(localName), t.identifier(exportedName))); 42384 } 42385 42386 if (specifiers.length) { 42387 var aliasDeclar = t.exportNamedDeclaration(null, specifiers); 42388 42389 if (parentDeclar.isFunctionDeclaration()) { 42390 aliasDeclar._blockHoist = 3; 42391 } 42392 42393 exportDeclar.insertAfter(aliasDeclar); 42394 exportDeclar.replaceWith(parentDeclar.node); 42395 } 42396 }; 42397 42398 Renamer.prototype.maybeConvertFromClassFunctionDeclaration = function maybeConvertFromClassFunctionDeclaration(path) { 42399 return; 42400 42401 if (!path.isFunctionDeclaration() && !path.isClassDeclaration()) return; 42402 if (this.binding.kind !== "hoisted") return; 42403 42404 path.node.id = t.identifier(this.oldName); 42405 path.node._blockHoist = 3; 42406 42407 path.replaceWith(t.variableDeclaration("let", [t.variableDeclarator(t.identifier(this.newName), t.toExpression(path.node))])); 42408 }; 42409 42410 Renamer.prototype.maybeConvertFromClassFunctionExpression = function maybeConvertFromClassFunctionExpression(path) { 42411 return; 42412 42413 if (!path.isFunctionExpression() && !path.isClassExpression()) return; 42414 if (this.binding.kind !== "local") return; 42415 42416 path.node.id = t.identifier(this.oldName); 42417 42418 this.binding.scope.parent.push({ 42419 id: t.identifier(this.newName) 42420 }); 42421 42422 path.replaceWith(t.assignmentExpression("=", t.identifier(this.newName), path.node)); 42423 }; 42424 42425 Renamer.prototype.rename = function rename(block) { 42426 var binding = this.binding, 42427 oldName = this.oldName, 42428 newName = this.newName; 42429 var scope = binding.scope, 42430 path = binding.path; 42431 42432 var parentDeclar = path.find(function (path) { 42433 return path.isDeclaration() || path.isFunctionExpression(); 42434 }); 42435 if (parentDeclar) { 42436 this.maybeConvertFromExportDeclaration(parentDeclar); 42437 } 42438 42439 scope.traverse(block || scope.block, renameVisitor, this); 42440 42441 if (!block) { 42442 scope.removeOwnBinding(oldName); 42443 scope.bindings[newName] = binding; 42444 this.binding.identifier.name = newName; 42445 } 42446 42447 if (binding.type === "hoisted") {} 42448 42449 if (parentDeclar) { 42450 this.maybeConvertFromClassFunctionDeclaration(parentDeclar); 42451 this.maybeConvertFromClassFunctionExpression(parentDeclar); 42452 } 42453 }; 42454 42455 return Renamer; 42456 }(); 42457 42458 exports.default = Renamer; 42459 module.exports = exports["default"]; 42460 42461/***/ }, 42462/* 378 */ 42463/***/ function(module, exports, __webpack_require__) { 42464 42465 "use strict"; 42466 42467 exports.__esModule = true; 42468 42469 var _typeof2 = __webpack_require__(6); 42470 42471 var _typeof3 = _interopRequireDefault(_typeof2); 42472 42473 var _keys = __webpack_require__(13); 42474 42475 var _keys2 = _interopRequireDefault(_keys); 42476 42477 var _getIterator2 = __webpack_require__(2); 42478 42479 var _getIterator3 = _interopRequireDefault(_getIterator2); 42480 42481 exports.explode = explode; 42482 exports.verify = verify; 42483 exports.merge = merge; 42484 42485 var _virtualTypes = __webpack_require__(221); 42486 42487 var virtualTypes = _interopRequireWildcard(_virtualTypes); 42488 42489 var _babelMessages = __webpack_require__(18); 42490 42491 var messages = _interopRequireWildcard(_babelMessages); 42492 42493 var _babelTypes = __webpack_require__(1); 42494 42495 var t = _interopRequireWildcard(_babelTypes); 42496 42497 var _clone = __webpack_require__(107); 42498 42499 var _clone2 = _interopRequireDefault(_clone); 42500 42501 function _interopRequireWildcard(obj) { 42502 if (obj && obj.__esModule) { 42503 return obj; 42504 } else { 42505 var newObj = {};if (obj != null) { 42506 for (var key in obj) { 42507 if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; 42508 } 42509 }newObj.default = obj;return newObj; 42510 } 42511 } 42512 42513 function _interopRequireDefault(obj) { 42514 return obj && obj.__esModule ? obj : { default: obj }; 42515 } 42516 42517 function explode(visitor) { 42518 if (visitor._exploded) return visitor; 42519 visitor._exploded = true; 42520 42521 for (var nodeType in visitor) { 42522 if (shouldIgnoreKey(nodeType)) continue; 42523 42524 var parts = nodeType.split("|"); 42525 if (parts.length === 1) continue; 42526 42527 var fns = visitor[nodeType]; 42528 delete visitor[nodeType]; 42529 42530 for (var _iterator = parts, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) { 42531 var _ref; 42532 42533 if (_isArray) { 42534 if (_i >= _iterator.length) break; 42535 _ref = _iterator[_i++]; 42536 } else { 42537 _i = _iterator.next(); 42538 if (_i.done) break; 42539 _ref = _i.value; 42540 } 42541 42542 var part = _ref;
42543 42544 visitor[part] = fns; 42545 } 42546 } 42547 42548 verify(visitor); 42549 42550 delete visitor.__esModule; 42551 42552 ensureEntranceObjects(visitor); 42553 42554 ensureCallbackArrays(visitor); 42555 42556 for (var _iterator2 = (0, _keys2.default)(visitor), _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) { 42557 var _ref2; 42558 42559 if (_isArray2) { 42560 if (_i2 >= _iterator2.length) break; 42561 _ref2 = _iterator2[_i2++]; 42562 } else { 42563 _i2 = _iterator2.next(); 42564 if (_i2.done) break; 42565 _ref2 = _i2.value; 42566 } 42567 42568 var _nodeType3 = _ref2; 42569 42570 if (shouldIgnoreKey(_nodeType3)) continue; 42571 42572 var wrapper = virtualTypes[_nodeType3]; 42573 if (!wrapper) continue; 42574 42575 var _fns2 = visitor[_nodeType3]; 42576 for (var type in _fns2) { 42577 _fns2[type] = wrapCheck(wrapper, _fns2[type]); 42578 } 42579 42580 delete visitor[_nodeType3]; 42581 42582 if (wrapper.types) { 42583 for (var _iterator4 = wrapper.types, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, _getIterator3.default)(_iterator4);;) { 42584 var _ref4; 42585 42586 if (_isArray4) { 42587 if (_i4 >= _iterator4.length) break; 42588 _ref4 = _iterator4[_i4++]; 42589 } else { 42590 _i4 = _iterator4.next(); 42591 if (_i4.done) break; 42592 _ref4 = _i4.value; 42593 } 42594 42595 var _type = _ref4; 42596 42597 if (visitor[_type]) { 42598 mergePair(visitor[_type], _fns2); 42599 } else { 42600 visitor[_type] = _fns2; 42601 } 42602 } 42603 } else { 42604 mergePair(visitor, _fns2); 42605 } 42606 } 42607 42608 for (var _nodeType in visitor) { 42609 if (shouldIgnoreKey(_nodeType)) continue; 42610 42611 var _fns = visitor[_nodeType]; 42612 42613 var aliases = t.FLIPPED_ALIAS_KEYS[_nodeType]; 42614 42615 var deprecratedKey = t.DEPRECATED_KEYS[_nodeType]; 42616 if (deprecratedKey) { 42617 console.trace("Visitor defined for " + _nodeType + " but it has been renamed to " + deprecratedKey); 42618 aliases = [deprecratedKey]; 42619 } 42620 42621 if (!aliases) continue; 42622 42623 delete visitor[_nodeType]; 42624 42625 for (var _iterator3 = aliases, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, _getIterator3.default)(_iterator3);;) { 42626 var _ref3; 42627 42628 if (_isArray3) { 42629 if (_i3 >= _iterator3.length) break; 42630 _ref3 = _iterator3[_i3++]; 42631 } else { 42632 _i3 = _iterator3.next(); 42633 if (_i3.done) break; 42634 _ref3 = _i3.value; 42635 } 42636 42637 var alias = _ref3; 42638 42639 var existing = visitor[alias]; 42640 if (existing) { 42641 mergePair(existing, _fns); 42642 } else { 42643 visitor[alias] = (0, _clone2.default)(_fns); 42644 } 42645 } 42646 } 42647 42648 for (var _nodeType2 in visitor) { 42649 if (shouldIgnoreKey(_nodeType2)) continue; 42650 42651 ensureCallbackArrays(visitor[_nodeType2]); 42652 } 42653 42654 return visitor; 42655 } 42656 42657 function verify(visitor) { 42658 if (visitor._verified) return; 42659 42660 if (typeof visitor === "function") { 42661 throw new Error(messages.get("traverseVerifyRootFunction")); 42662 } 42663 42664 for (var nodeType in visitor) { 42665 if (nodeType === "enter" || nodeType === "exit") { 42666 validateVisitorMethods(nodeType, visitor[nodeType]); 42667 } 42668 42669 if (shouldIgnoreKey(nodeType)) continue; 42670 42671 if (t.TYPES.indexOf(nodeType) < 0) { 42672 throw new Error(messages.get("traverseVerifyNodeType", nodeType)); 42673 } 42674 42675 var visitors = visitor[nodeType]; 42676 if ((typeof visitors === "undefined" ? "undefined" : (0, _typeof3.default)(visitors)) === "object") { 42677 for (var visitorKey in visitors) { 42678 if (visitorKey === "enter" || visitorKey === "exit") { 42679 validateVisitorMethods(nodeType + "." + visitorKey, visitors[visitorKey]); 42680 } else { 42681 throw new Error(messages.get("traverseVerifyVisitorProperty", nodeType, visitorKey)); 42682 } 42683 } 42684 } 42685 } 42686 42687 visitor._verified = true; 42688 } 42689 42690 function validateVisitorMethods(path, val) { 42691 var fns = [].concat(val); 42692 for (var _iterator5 = fns, _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : (0, _getIterator3.default)(_iterator5);;) { 42693 var _ref5; 42694 42695 if (_isArray5) { 42696 if (_i5 >= _iterator5.length) break; 42697 _ref5 = _iterator5[_i5++]; 42698 } else { 42699 _i5 = _iterator5.next(); 42700 if (_i5.done) break; 42701 _ref5 = _i5.value; 42702 } 42703 42704 var fn = _ref5; 42705 42706 if (typeof fn !== "function") { 42707 throw new TypeError("Non-function found defined in " + path + " with type " + (typeof fn === "undefined" ? "undefined" : (0, _typeof3.default)(fn))); 42708 } 42709 } 42710 } 42711 42712 function merge(visitors) { 42713 var states = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; 42714 var wrapper = arguments[2]; 42715 42716 var rootVisitor = {}; 42717 42718 for (var i = 0; i < visitors.length; i++) { 42719 var visitor = visitors[i]; 42720 var state = states[i]; 42721 42722 explode(visitor); 42723 42724 for (var type in visitor) { 42725 var visitorType = visitor[type]; 42726 42727 if (state || wrapper) { 42728 visitorType = wrapWithStateOrWrapper(visitorType, state, wrapper); 42729 } 42730 42731 var nodeVisitor = rootVisitor[type] = rootVisitor[type] || {}; 42732 mergePair(nodeVisitor, visitorType); 42733 } 42734 } 42735 42736 return rootVisitor; 42737 } 42738 42739 function wrapWithStateOrWrapper(oldVisitor, state, wrapper) { 42740 var newVisitor = {}; 42741 42742 var _loop = function _loop(key) { 42743 var fns = oldVisitor[key]; 42744 42745 if (!Array.isArray(fns)) return "continue";
42746 42747 fns = fns.map(function (fn) { 42748 var newFn = fn; 42749 42750 if (state) { 42751 newFn = function newFn(path) { 42752 return fn.call(state, path, state); 42753 }; 42754 } 42755 42756 if (wrapper) { 42757 newFn = wrapper(state.key, key, newFn); 42758 } 42759 42760 return newFn; 42761 }); 42762 42763 newVisitor[key] = fns; 42764 }; 42765 42766 for (var key in oldVisitor) { 42767 var _ret = _loop(key); 42768 42769 if (_ret === "continue") continue; 42770 } 42771 42772 return newVisitor; 42773 } 42774 42775 function ensureEntranceObjects(obj) { 42776 for (var key in obj) { 42777 if (shouldIgnoreKey(key)) continue; 42778 42779 var fns = obj[key]; 42780 if (typeof fns === "function") { 42781 obj[key] = { enter: fns }; 42782 } 42783 } 42784 } 42785 42786 function ensureCallbackArrays(obj) { 42787 if (obj.enter && !Array.isArray(obj.enter)) obj.enter = [obj.enter]; 42788 if (obj.exit && !Array.isArray(obj.exit)) obj.exit = [obj.exit]; 42789 } 42790 42791 function wrapCheck(wrapper, fn) { 42792 var newFn = function newFn(path) { 42793 if (wrapper.checkPath(path)) { 42794 return fn.apply(this, arguments); 42795 } 42796 }; 42797 newFn.toString = function () { 42798 return fn.toString(); 42799 }; 42800 return newFn; 42801 } 42802 42803 function shouldIgnoreKey(key) { 42804 if (key[0] === "_") return true; 42805 42806 if (key === "enter" || key === "exit" || key === "shouldSkip") return true; 42807 42808 if (key === "blacklist" || key === "noScope" || key === "skipKeys") return true; 42809 42810 return false; 42811 } 42812 42813 function mergePair(dest, src) { 42814 for (var key in src) { 42815 dest[key] = [].concat(dest[key] || [], src[key]); 42816 } 42817 } 42818 42819/***/ }, 42820/* 379 */ 42821/***/ function(module, exports, __webpack_require__) { 42822 42823 "use strict"; 42824 42825 exports.__esModule = true; 42826 42827 var _maxSafeInteger = __webpack_require__(353); 42828 42829 var _maxSafeInteger2 = _interopRequireDefault(_maxSafeInteger); 42830 42831 var _stringify = __webpack_require__(34); 42832 42833 var _stringify2 = _interopRequireDefault(_stringify); 42834 42835 var _getIterator2 = __webpack_require__(2); 42836 42837 var _getIterator3 = _interopRequireDefault(_getIterator2); 42838 42839 exports.toComputedKey = toComputedKey; 42840 exports.toSequenceExpression = toSequenceExpression; 42841 exports.toKeyAlias = toKeyAlias; 42842 exports.toIdentifier = toIdentifier;
42843 exports.toBindingIdentifierName = toBindingIdentifierName; 42844 exports.toStatement = toStatement; 42845 exports.toExpression = toExpression; 42846 exports.toBlock = toBlock; 42847 exports.valueToNode = valueToNode; 42848 42849 var _isPlainObject = __webpack_require__(271); 42850 42851 var _isPlainObject2 = _interopRequireDefault(_isPlainObject); 42852 42853 var _isRegExp = __webpack_require__(272); 42854 42855 var _isRegExp2 = _interopRequireDefault(_isRegExp); 42856 42857 var _index = __webpack_require__(1); 42858 42859 var t = _interopRequireWildcard(_index); 42860 42861 function _interopRequireWildcard(obj) { 42862 if (obj && obj.__esModule) { 42863 return obj; 42864 } else { 42865 var newObj = {};if (obj != null) { 42866 for (var key in obj) { 42867 if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; 42868 } 42869 }newObj.default = obj;return newObj; 42870 } 42871 } 42872 42873 function _interopRequireDefault(obj) { 42874 return obj && obj.__esModule ? obj : { default: obj }; 42875 } 42876 42877 function toComputedKey(node) { 42878 var key = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : node.key || node.property; 42879 42880 if (!node.computed) { 42881 if (t.isIdentifier(key)) key = t.stringLiteral(key.name); 42882 } 42883 return key; 42884 } 42885 42886 function toSequenceExpression(nodes, scope) { 42887 if (!nodes || !nodes.length) return; 42888 42889 var declars = []; 42890 var bailed = false; 42891 42892 var result = convert(nodes); 42893 if (bailed) return; 42894 42895 for (var i = 0; i < declars.length; i++) { 42896 scope.push(declars[i]); 42897 } 42898 42899 return result; 42900 42901 function convert(nodes) { 42902 var ensureLastUndefined = false; 42903 var exprs = []; 42904 42905 for (var _iterator = nodes, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) { 42906 var _ref; 42907 42908 if (_isArray) { 42909 if (_i >= _iterator.length) break; 42910 _ref = _iterator[_i++]; 42911 } else { 42912 _i = _iterator.next(); 42913 if (_i.done) break; 42914 _ref = _i.value; 42915 } 42916 42917 var node = _ref; 42918 42919 if (t.isExpression(node)) { 42920 exprs.push(node); 42921 } else if (t.isExpressionStatement(node)) { 42922 exprs.push(node.expression); 42923 } else if (t.isVariableDeclaration(node)) { 42924 if (node.kind !== "var") return bailed = true; 42925 42926 for (var _iterator2 = node.declarations, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) { 42927 var _ref2; 42928 42929 if (_isArray2) { 42930 if (_i2 >= _iterator2.length) break; 42931 _ref2 = _iterator2[_i2++]; 42932 } else { 42933 _i2 = _iterator2.next(); 42934 if (_i2.done) break; 42935 _ref2 = _i2.value; 42936 } 42937 42938 var declar = _ref2; 42939 42940 var bindings = t.getBindingIdentifiers(declar); 42941 for (var key in bindings) { 42942 declars.push({ 42943 kind: node.kind, 42944 id: bindings[key] 42945 }); 42946 } 42947 42948 if (declar.init) { 42949 exprs.push(t.assignmentExpression("=", declar.id, declar.init)); 42950 } 42951 } 42952 42953 ensureLastUndefined = true; 42954 continue; 42955 } else if (t.isIfStatement(node)) { 42956 var consequent = node.consequent ? convert([node.consequent]) : scope.buildUndefinedNode(); 42957 var alternate = node.alternate ? convert([node.alternate]) : scope.buildUndefinedNode(); 42958 if (!consequent || !alternate) return bailed = true; 42959 42960 exprs.push(t.conditionalExpression(node.test, consequent, alternate)); 42961 } else if (t.isBlockStatement(node)) { 42962 exprs.push(convert(node.body)); 42963 } else if (t.isEmptyStatement(node)) { 42964 ensureLastUndefined = true; 42965 continue; 42966 } else { 42967 return bailed = true; 42968 } 42969 42970 ensureLastUndefined = false; 42971 } 42972 42973 if (ensureLastUndefined || exprs.length === 0) { 42974 exprs.push(scope.buildUndefinedNode()); 42975 } 42976 42977 if (exprs.length === 1) { 42978 return exprs[0]; 42979 } else { 42980 return t.sequenceExpression(exprs); 42981 } 42982 } 42983 } 42984 42985 function toKeyAlias(node) { 42986 var key = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : node.key; 42987 42988 var alias = void 0; 42989 42990 if (node.kind === "method") { 42991 return toKeyAlias.increment() + ""; 42992 } else if (t.isIdentifier(key)) { 42993 alias = key.name; 42994 } else if (t.isStringLiteral(key)) { 42995 alias = (0, _stringify2.default)(key.value); 42996 } else { 42997 alias = (0, _stringify2.default)(t.removePropertiesDeep(t.cloneDeep(key))); 42998 } 42999 43000 if (node.computed) { 43001 alias = "[" + alias + "]"; 43002 } 43003 43004 if (node.static) { 43005 alias = "static:" + alias; 43006 } 43007 43008 return alias; 43009 } 43010 43011 toKeyAlias.uid = 0; 43012 43013 toKeyAlias.increment = function () { 43014 if (toKeyAlias.uid >= _maxSafeInteger2.default) { 43015 return toKeyAlias.uid = 0; 43016 } else { 43017 return toKeyAlias.uid++; 43018 } 43019 }; 43020 43021 function toIdentifier(name) { 43022 name = name + ""; 43023 43024 name = name.replace(/[^a-zA-Z0-9$_]/g, "-"); 43025 43026 name = name.replace(/^[-0-9]+/, ""); 43027 43028 name = name.replace(/[-\s]+(.)?/g, function (match, c) { 43029 return c ? c.toUpperCase() : ""; 43030 }); 43031 43032 if (!t.isValidIdentifier(name)) { 43033 name = "_" + name; 43034 } 43035 43036 return name || "_"; 43037 } 43038 43039 function toBindingIdentifierName(name) { 43040 name = toIdentifier(name); 43041 if (name === "eval" || name === "arguments") name = "_" + name; 43042 return name; 43043 } 43044
43045 function toStatement(node, ignore) { 43046 if (t.isStatement(node)) { 43047 return node; 43048 } 43049 43050 var mustHaveId = false; 43051 var newType = void 0; 43052 43053 if (t.isClass(node)) { 43054 mustHaveId = true; 43055 newType = "ClassDeclaration"; 43056 } else if (t.isFunction(node)) { 43057 mustHaveId = true; 43058 newType = "FunctionDeclaration"; 43059 } else if (t.isAssignmentExpression(node)) { 43060 return t.expressionStatement(node); 43061 } 43062 43063 if (mustHaveId && !node.id) { 43064 newType = false; 43065 } 43066 43067 if (!newType) { 43068 if (ignore) { 43069 return false; 43070 } else { 43071 throw new Error("cannot turn " + node.type + " to a statement"); 43072 } 43073 } 43074 43075 node.type = newType; 43076 43077 return node; 43078 } 43079 43080 function toExpression(node) { 43081 if (t.isExpressionStatement(node)) { 43082 node = node.expression; 43083 } 43084 43085 if (t.isExpression(node)) { 43086 return node; 43087 } 43088 43089 if (t.isClass(node)) { 43090 node.type = "ClassExpression"; 43091 } else if (t.isFunction(node)) { 43092 node.type = "FunctionExpression"; 43093 } 43094 43095 if (!t.isExpression(node)) { 43096 throw new Error("cannot turn " + node.type + " to an expression"); 43097 } 43098 43099 return node; 43100 } 43101 43102 function toBlock(node, parent) { 43103 if (t.isBlockStatement(node)) { 43104 return node; 43105 } 43106 43107 if (t.isEmptyStatement(node)) { 43108 node = []; 43109 } 43110 43111 if (!Array.isArray(node)) { 43112 if (!t.isStatement(node)) { 43113 if (t.isFunction(parent)) {
43114 node = t.returnStatement(node); 43115 } else { 43116 node = t.expressionStatement(node); 43117 } 43118 } 43119 43120 node = [node]; 43121 } 43122 43123 return t.blockStatement(node); 43124 } 43125 43126 function valueToNode(value) { 43127 if (value === undefined) { 43128 return t.identifier("undefined"); 43129 } 43130 43131 if (value === true || value === false) { 43132 return t.booleanLiteral(value); 43133 } 43134 43135 if (value === null) { 43136 return t.nullLiteral(); 43137 } 43138 43139 if (typeof value === "string") { 43140 return t.stringLiteral(value); 43141 } 43142 43143 if (typeof value === "number") { 43144 return t.numericLiteral(value); 43145 } 43146 43147 if ((0, _isRegExp2.default)(value)) { 43148 var pattern = value.source; 43149 var flags = value.toString().match(/\/([a-z]+|)$/)[1]; 43150 return t.regExpLiteral(pattern, flags); 43151 } 43152 43153 if (Array.isArray(value)) { 43154 return t.arrayExpression(value.map(t.valueToNode)); 43155 } 43156 43157 if ((0, _isPlainObject2.default)(value)) { 43158 var props = []; 43159 for (var key in value) { 43160 var nodeKey = void 0; 43161 if (t.isValidIdentifier(key)) { 43162 nodeKey = t.identifier(key); 43163 } else { 43164 nodeKey = t.stringLiteral(key); 43165 } 43166 props.push(t.objectProperty(nodeKey, t.valueToNode(value[key]))); 43167 } 43168 return t.objectExpression(props); 43169 } 43170 43171 throw new Error("don't know how to turn this value into a node"); 43172 } 43173 43174/***/ }, 43175/* 380 */ 43176/***/ function(module, exports, __webpack_require__) { 43177 43178 "use strict"; 43179 43180 var _index = __webpack_require__(1); 43181 43182 var t = _interopRequireWildcard(_index); 43183 43184 var _constants = __webpack_require__(132); 43185 43186 var _index2 = __webpack_require__(26); 43187 43188 var _index3 = _interopRequireDefault(_index2); 43189 43190 function _interopRequireDefault(obj) { 43191 return obj && obj.__esModule ? obj : { default: obj }; 43192 } 43193 43194 function _interopRequireWildcard(obj) { 43195 if (obj && obj.__esModule) { 43196 return obj; 43197 } else { 43198 var newObj = {};if (obj != null) { 43199 for (var key in obj) { 43200 if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; 43201 } 43202 }newObj.default = obj;return newObj; 43203 } 43204 } 43205 43206 (0, _index3.default)("ArrayExpression", { 43207 fields: { 43208 elements: { 43209 validate: (0, _index2.chain)((0, _index2.assertValueType)("array"), (0, _index2.assertEach)((0, _index2.assertNodeOrValueType)("null", "Expression", "SpreadElement"))), 43210 default: [] 43211 } 43212 }, 43213 visitor: ["elements"], 43214 aliases: ["Expression"] 43215 }); 43216 43217 (0, _index3.default)("AssignmentExpression", { 43218 fields: { 43219 operator: { 43220 validate: (0, _index2.assertValueType)("string") 43221 }, 43222 left: { 43223 validate: (0, _index2.assertNodeType)("LVal") 43224 }, 43225 right: { 43226 validate: (0, _index2.assertNodeType)("Expression") 43227 } 43228 }, 43229 builder: ["operator", "left", "right"], 43230 visitor: ["left", "right"], 43231 aliases: ["Expression"] 43232 }); 43233 43234 (0, _index3.default)("BinaryExpression", { 43235 builder: ["operator", "left", "right"], 43236 fields: { 43237 operator: { 43238 validate: _index2.assertOneOf.apply(undefined, _constants.BINARY_OPERATORS) 43239 }, 43240 left: { 43241 validate: (0, _index2.assertNodeType)("Expression") 43242 }, 43243 right: { 43244 validate: (0, _index2.assertNodeType)("Expression") 43245 } 43246 }, 43247 visitor: ["left", "right"], 43248 aliases: ["Binary", "Expression"] 43249 }); 43250 43251 (0, _index3.default)("Directive", { 43252 visitor: ["value"], 43253 fields: { 43254 value: { 43255 validate: (0, _index2.assertNodeType)("DirectiveLiteral") 43256 } 43257 } 43258 }); 43259 43260 (0, _index3.default)("DirectiveLiteral", { 43261 builder: ["value"], 43262 fields: { 43263 value: { 43264 validate: (0, _index2.assertValueType)("string") 43265 } 43266 } 43267 }); 43268 43269 (0, _index3.default)("BlockStatement", { 43270 builder: ["body", "directives"], 43271 visitor: ["directives", "body"], 43272 fields: { 43273 directives: { 43274 validate: (0, _index2.chain)((0, _index2.assertValueType)("array"), (0, _index2.assertEach)((0, _index2.assertNodeType)("Directive"))), 43275 default: [] 43276 }, 43277 body: { 43278 validate: (0, _index2.chain)((0, _index2.assertValueType)("array"), (0, _index2.assertEach)((0, _index2.assertNodeType)("Statement"))) 43279 } 43280 }, 43281 aliases: ["Scopable", "BlockParent", "Block", "Statement"] 43282 }); 43283 43284 (0, _index3.default)("BreakStatement", { 43285 visitor: ["label"], 43286 fields: { 43287 label: { 43288 validate: (0, _index2.assertNodeType)("Identifier"), 43289 optional: true 43290 } 43291 }, 43292 aliases: ["Statement", "Terminatorless", "CompletionStatement"] 43293 }); 43294 43295 (0, _index3.default)("CallExpression", { 43296 visitor: ["callee", "arguments"], 43297 fields: {
43298 callee: { 43299 validate: (0, _index2.assertNodeType)("Expression") 43300 }, 43301 arguments: { 43302 validate: (0, _index2.chain)((0, _index2.assertValueType)("array"), (0, _index2.assertEach)((0, _index2.assertNodeType)("Expression", "SpreadElement"))) 43303 } 43304 }, 43305 aliases: ["Expression"] 43306 }); 43307 43308 (0, _index3.default)("CatchClause", { 43309 visitor: ["param", "body"], 43310 fields: { 43311 param: { 43312 validate: (0, _index2.assertNodeType)("Identifier") 43313 }, 43314 body: { 43315 validate: (0, _index2.assertNodeType)("BlockStatement") 43316 } 43317 }, 43318 aliases: ["Scopable"] 43319 }); 43320 43321 (0, _index3.default)("ConditionalExpression", { 43322 visitor: ["test", "consequent", "alternate"], 43323 fields: { 43324 test: { 43325 validate: (0, _index2.assertNodeType)("Expression") 43326 }, 43327 consequent: { 43328 validate: (0, _index2.assertNodeType)("Expression") 43329 }, 43330 alternate: { 43331 validate: (0, _index2.assertNodeType)("Expression") 43332 } 43333 }, 43334 aliases: ["Expression", "Conditional"] 43335 }); 43336 43337 (0, _index3.default)("ContinueStatement", { 43338 visitor: ["label"], 43339 fields: { 43340 label: { 43341 validate: (0, _index2.assertNodeType)("Identifier"), 43342 optional: true 43343 } 43344 }, 43345 aliases: ["Statement", "Terminatorless", "CompletionStatement"] 43346 }); 43347 43348 (0, _index3.default)("DebuggerStatement", { 43349 aliases: ["Statement"] 43350 }); 43351 43352 (0, _index3.default)("DoWhileStatement", { 43353 visitor: ["test", "body"], 43354 fields: { 43355 test: { 43356 validate: (0, _index2.assertNodeType)("Expression") 43357 }, 43358 body: { 43359 validate: (0, _index2.assertNodeType)("Statement") 43360 } 43361 }, 43362 aliases: ["Statement", "BlockParent", "Loop", "While", "Scopable"] 43363 }); 43364 43365 (0, _index3.default)("EmptyStatement", { 43366 aliases: ["Statement"] 43367 }); 43368 43369 (0, _index3.default)("ExpressionStatement", { 43370 visitor: ["expression"], 43371 fields: { 43372 expression: { 43373 validate: (0, _index2.assertNodeType)("Expression") 43374 } 43375 }, 43376 aliases: ["Statement", "ExpressionWrapper"] 43377 }); 43378 43379 (0, _index3.default)("File", { 43380 builder: ["program", "comments", "tokens"], 43381 visitor: ["program"], 43382 fields: { 43383 program: { 43384 validate: (0, _index2.assertNodeType)("Program") 43385 } 43386 } 43387 }); 43388 43389 (0, _index3.default)("ForInStatement", { 43390 visitor: ["left", "right", "body"], 43391 aliases: ["Scopable", "Statement", "For", "BlockParent", "Loop", "ForXStatement"], 43392 fields: { 43393 left: { 43394 validate: (0, _index2.assertNodeType)("VariableDeclaration", "LVal") 43395 }, 43396 right: { 43397 validate: (0, _index2.assertNodeType)("Expression") 43398 }, 43399 body: { 43400 validate: (0, _index2.assertNodeType)("Statement") 43401 } 43402 } 43403 }); 43404 43405 (0, _index3.default)("ForStatement", { 43406 visitor: ["init", "test", "update", "body"], 43407 aliases: ["Scopable", "Statement", "For", "BlockParent", "Loop"], 43408 fields: { 43409 init: { 43410 validate: (0, _index2.assertNodeType)("VariableDeclaration", "Expression"), 43411 optional: true 43412 }, 43413 test: { 43414 validate: (0, _index2.assertNodeType)("Expression"), 43415 optional: true 43416 }, 43417 update: { 43418 validate: (0, _index2.assertNodeType)("Expression"), 43419 optional: true 43420 }, 43421 body: { 43422 validate: (0, _index2.assertNodeType)("Statement") 43423 } 43424 } 43425 }); 43426 43427 (0, _index3.default)("FunctionDeclaration", { 43428 builder: ["id", "params", "body", "generator", "async"], 43429 visitor: ["id", "params", "body", "returnType", "typeParameters"], 43430 fields: { 43431 id: { 43432 validate: (0, _index2.assertNodeType)("Identifier") 43433 }, 43434 params: { 43435 validate: (0, _index2.chain)((0, _index2.assertValueType)("array"), (0, _index2.assertEach)((0, _index2.assertNodeType)("LVal"))) 43436 }, 43437 body: { 43438 validate: (0, _index2.assertNodeType)("BlockStatement") 43439 }, 43440 generator: { 43441 default: false, 43442 validate: (0, _index2.assertValueType)("boolean") 43443 }, 43444 async: { 43445 default: false, 43446 validate: (0, _index2.assertValueType)("boolean") 43447 } 43448 }, 43449 aliases: ["Scopable", "Function", "BlockParent", "FunctionParent", "Statement", "Pureish", "Declaration"] 43450 }); 43451 43452 (0, _index3.default)("FunctionExpression", { 43453 inherits: "FunctionDeclaration", 43454 aliases: ["Scopable", "Function", "BlockParent", "FunctionParent", "Expression", "Pureish"], 43455 fields: { 43456 id: { 43457 validate: (0, _index2.assertNodeType)("Identifier"), 43458 optional: true 43459 }, 43460 params: { 43461 validate: (0, _index2.chain)((0, _index2.assertValueType)("array"), (0, _index2.assertEach)((0, _index2.assertNodeType)("LVal"))) 43462 }, 43463 body: { 43464 validate: (0, _index2.assertNodeType)("BlockStatement") 43465 }, 43466 generator: { 43467 default: false, 43468 validate: (0, _index2.assertValueType)("boolean") 43469 }, 43470 async: { 43471 default: false, 43472 validate: (0, _index2.assertValueType)("boolean") 43473 } 43474 } 43475 }); 43476 43477 (0, _index3.default)("Identifier", { 43478 builder: ["name"], 43479 visitor: ["typeAnnotation"], 43480 aliases: ["Expression", "LVal"], 43481 fields: { 43482 name: { 43483 validate: function validate(node, key, val) { 43484 if (!t.isValidIdentifier(val)) {} 43485 } 43486 }, 43487 decorators: { 43488 validate: (0, _index2.chain)((0, _index2.assertValueType)("array"), (0, _index2.assertEach)((0, _index2.assertNodeType)("Decorator"))) 43489 } 43490 } 43491 }); 43492 43493 (0, _index3.default)("IfStatement", { 43494 visitor: ["test", "consequent", "alternate"], 43495 aliases: ["Statement", "Conditional"], 43496 fields: { 43497 test: { 43498 validate: (0, _index2.assertNodeType)("Expression") 43499 }, 43500 consequent: { 43501 validate: (0, _index2.assertNodeType)("Statement") 43502 }, 43503 alternate: { 43504 optional: true, 43505 validate: (0, _index2.assertNodeType)("Statement") 43506 } 43507 } 43508 }); 43509 43510 (0, _index3.default)("LabeledStatement", { 43511 visitor: ["label", "body"], 43512 aliases: ["Statement"], 43513 fields: { 43514 label: { 43515 validate: (0, _index2.assertNodeType)("Identifier") 43516 }, 43517 body: { 43518 validate: (0, _index2.assertNodeType)("Statement") 43519 } 43520 } 43521 }); 43522 43523 (0, _index3.default)("StringLiteral", { 43524 builder: ["value"], 43525 fields: { 43526 value: { 43527 validate: (0, _index2.assertValueType)("string") 43528 } 43529 }, 43530 aliases: ["Expression", "Pureish", "Literal", "Immutable"] 43531 }); 43532 43533 (0, _index3.default)("NumericLiteral", { 43534 builder: ["value"], 43535 deprecatedAlias: "NumberLiteral", 43536 fields: { 43537 value: { 43538 validate: (0, _index2.assertValueType)("number") 43539 } 43540 }, 43541 aliases: ["Expression", "Pureish", "Literal", "Immutable"] 43542 }); 43543 43544 (0, _index3.default)("NullLiteral", { 43545 aliases: ["Expression", "Pureish", "Literal", "Immutable"] 43546 }); 43547 43548 (0, _index3.default)("BooleanLiteral", { 43549 builder: ["value"], 43550 fields: { 43551 value: { 43552 validate: (0, _index2.assertValueType)("boolean") 43553 } 43554 }, 43555 aliases: ["Expression", "Pureish", "Literal", "Immutable"] 43556 }); 43557 43558 (0, _index3.default)("RegExpLiteral", { 43559 builder: ["pattern", "flags"], 43560 deprecatedAlias: "RegexLiteral", 43561 aliases: ["Expression", "Literal"], 43562 fields: { 43563 pattern: { 43564 validate: (0, _index2.assertValueType)("string") 43565 }, 43566 flags: { 43567 validate: (0, _index2.assertValueType)("string"), 43568 default: "" 43569 } 43570 } 43571 }); 43572 43573 (0, _index3.default)("LogicalExpression", { 43574 builder: ["operator", "left", "right"], 43575 visitor: ["left", "right"], 43576 aliases: ["Binary", "Expression"], 43577 fields: { 43578 operator: { 43579 validate: _index2.assertOneOf.apply(undefined, _constants.LOGICAL_OPERATORS) 43580 }, 43581 left: { 43582 validate: (0, _index2.assertNodeType)("Expression") 43583 }, 43584 right: { 43585 validate: (0, _index2.assertNodeType)("Expression") 43586 } 43587 } 43588 }); 43589 43590 (0, _index3.default)("MemberExpression", { 43591 builder: ["object", "property", "computed"], 43592 visitor: ["object", "property"], 43593 aliases: ["Expression", "LVal"], 43594 fields: { 43595 object: { 43596 validate: (0, _index2.assertNodeType)("Expression") 43597 }, 43598 property: { 43599 validate: function validate(node, key, val) { 43600 var expectedType = node.computed ? "Expression" : "Identifier"; 43601 (0, _index2.assertNodeType)(expectedType)(node, key, val); 43602 } 43603 }, 43604 computed: { 43605 default: false 43606 } 43607 } 43608 }); 43609 43610 (0, _index3.default)("NewExpression", { 43611 visitor: ["callee", "arguments"], 43612 aliases: ["Expression"], 43613 fields: {
43614 callee: { 43615 validate: (0, _index2.assertNodeType)("Expression") 43616 }, 43617 arguments: { 43618 validate: (0, _index2.chain)((0, _index2.assertValueType)("array"), (0, _index2.assertEach)((0, _index2.assertNodeType)("Expression", "SpreadElement"))) 43619 } 43620 } 43621 }); 43622 43623 (0, _index3.default)("Program", { 43624 visitor: ["directives", "body"], 43625 builder: ["body", "directives"], 43626 fields: { 43627 directives: { 43628 validate: (0, _index2.chain)((0, _index2.assertValueType)("array"), (0, _index2.assertEach)((0, _index2.assertNodeType)("Directive"))), 43629 default: [] 43630 }, 43631 body: { 43632 validate: (0, _index2.chain)((0, _index2.assertValueType)("array"), (0, _index2.assertEach)((0, _index2.assertNodeType)("Statement"))) 43633 } 43634 }, 43635 aliases: ["Scopable", "BlockParent", "Block", "FunctionParent"] 43636 }); 43637 43638 (0, _index3.default)("ObjectExpression", { 43639 visitor: ["properties"], 43640 aliases: ["Expression"], 43641 fields: { 43642 properties: { 43643 validate: (0, _index2.chain)((0, _index2.assertValueType)("array"), (0, _index2.assertEach)((0, _index2.assertNodeType)("ObjectMethod", "ObjectProperty", "SpreadProperty"))) 43644 } 43645 } 43646 }); 43647 43648 (0, _index3.default)("ObjectMethod", { 43649 builder: ["kind", "key", "params", "body", "computed"], 43650 fields: { 43651 kind: { 43652 validate: (0, _index2.chain)((0, _index2.assertValueType)("string"), (0, _index2.assertOneOf)("method", "get", "set")), 43653 default: "method" 43654 }, 43655 computed: { 43656 validate: (0, _index2.assertValueType)("boolean"), 43657 default: false 43658 }, 43659 key: { 43660 validate: function validate(node, key, val) { 43661 var expectedTypes = node.computed ? ["Expression"] : ["Identifier", "StringLiteral", "NumericLiteral"]; 43662 _index2.assertNodeType.apply(undefined, expectedTypes)(node, key, val); 43663 } 43664 }, 43665 decorators: { 43666 validate: (0, _index2.chain)((0, _index2.assertValueType)("array"), (0, _index2.assertEach)((0, _index2.assertNodeType)("Decorator"))) 43667 }, 43668 body: { 43669 validate: (0, _index2.assertNodeType)("BlockStatement") 43670 }, 43671 generator: { 43672 default: false, 43673 validate: (0, _index2.assertValueType)("boolean") 43674 }, 43675 async: { 43676 default: false, 43677 validate: (0, _index2.assertValueType)("boolean") 43678 } 43679 }, 43680 visitor: ["key", "params", "body", "decorators", "returnType", "typeParameters"], 43681 aliases: ["UserWhitespacable", "Function", "Scopable", "BlockParent", "FunctionParent", "Method", "ObjectMember"] 43682 }); 43683 43684 (0, _index3.default)("ObjectProperty", { 43685 builder: ["key", "value", "computed", "shorthand", "decorators"], 43686 fields: { 43687 computed: { 43688 validate: (0, _index2.assertValueType)("boolean"), 43689 default: false 43690 }, 43691 key: { 43692 validate: function validate(node, key, val) { 43693 var expectedTypes = node.computed ? ["Expression"] : ["Identifier", "StringLiteral", "NumericLiteral"]; 43694 _index2.assertNodeType.apply(undefined, expectedTypes)(node, key, val); 43695 } 43696 }, 43697 value: { 43698 validate: (0, _index2.assertNodeType)("Expression") 43699 }, 43700 shorthand: { 43701 validate: (0, _index2.assertValueType)("boolean"), 43702 default: false 43703 }, 43704 decorators: { 43705 validate: (0, _index2.chain)((0, _index2.assertValueType)("array"), (0, _index2.assertEach)((0, _index2.assertNodeType)("Decorator"))), 43706 optional: true 43707 } 43708 }, 43709 visitor: ["key", "value", "decorators"], 43710 aliases: ["UserWhitespacable", "Property", "ObjectMember"] 43711 }); 43712 43713 (0, _index3.default)("RestElement", { 43714 visitor: ["argument", "typeAnnotation"], 43715 aliases: ["LVal"], 43716 fields: { 43717 argument: { 43718 validate: (0, _index2.assertNodeType)("LVal") 43719 }, 43720 decorators: { 43721 validate: (0, _index2.chain)((0, _index2.assertValueType)("array"), (0, _index2.assertEach)((0, _index2.assertNodeType)("Decorator"))) 43722 } 43723 } 43724 }); 43725 43726 (0, _index3.default)("ReturnStatement", { 43727 visitor: ["argument"], 43728 aliases: ["Statement", "Terminatorless", "CompletionStatement"], 43729 fields: { 43730 argument: { 43731 validate: (0, _index2.assertNodeType)("Expression"), 43732 optional: true 43733 } 43734 } 43735 }); 43736 43737 (0, _index3.default)("SequenceExpression", { 43738 visitor: ["expressions"], 43739 fields: { 43740 expressions: { 43741 validate: (0, _index2.chain)((0, _index2.assertValueType)("array"), (0, _index2.assertEach)((0, _index2.assertNodeType)("Expression"))) 43742 } 43743 }, 43744 aliases: ["Expression"] 43745 }); 43746 43747 (0, _index3.default)("SwitchCase", { 43748 visitor: ["test", "consequent"], 43749 fields: { 43750 test: { 43751 validate: (0, _index2.assertNodeType)("Expression"), 43752 optional: true 43753 }, 43754 consequent: { 43755 validate: (0, _index2.chain)((0, _index2.assertValueType)("array"), (0, _index2.assertEach)((0, _index2.assertNodeType)("Statement"))) 43756 } 43757 } 43758 }); 43759 43760 (0, _index3.default)("SwitchStatement", { 43761 visitor: ["discriminant", "cases"], 43762 aliases: ["Statement", "BlockParent", "Scopable"], 43763 fields: { 43764 discriminant: { 43765 validate: (0, _index2.assertNodeType)("Expression") 43766 },
43767 cases: { 43768 validate: (0, _index2.chain)((0, _index2.assertValueType)("array"), (0, _index2.assertEach)((0, _index2.assertNodeType)("SwitchCase"))) 43769 } 43770 } 43771 }); 43772 43773 (0, _index3.default)("ThisExpression", { 43774 aliases: ["Expression"] 43775 }); 43776 43777 (0, _index3.default)("ThrowStatement", { 43778 visitor: ["argument"], 43779 aliases: ["Statement", "Terminatorless", "CompletionStatement"], 43780 fields: { 43781 argument: { 43782 validate: (0, _index2.assertNodeType)("Expression") 43783 } 43784 } 43785 }); 43786 43787 (0, _index3.default)("TryStatement", { 43788 visitor: ["block", "handler", "finalizer"], 43789 aliases: ["Statement"], 43790 fields: { 43791 body: { 43792 validate: (0, _index2.assertNodeType)("BlockStatement") 43793 }, 43794 handler: { 43795 optional: true, 43796 handler: (0, _index2.assertNodeType)("BlockStatement") 43797 }, 43798 finalizer: { 43799 optional: true, 43800 validate: (0, _index2.assertNodeType)("BlockStatement") 43801 } 43802 } 43803 }); 43804 43805 (0, _index3.default)("UnaryExpression", { 43806 builder: ["operator", "argument", "prefix"], 43807 fields: { 43808 prefix: { 43809 default: true 43810 }, 43811 argument: { 43812 validate: (0, _index2.assertNodeType)("Expression") 43813 }, 43814 operator: { 43815 validate: _index2.assertOneOf.apply(undefined, _constants.UNARY_OPERATORS) 43816 } 43817 }, 43818 visitor: ["argument"], 43819 aliases: ["UnaryLike", "Expression"] 43820 }); 43821 43822 (0, _index3.default)("UpdateExpression", { 43823 builder: ["operator", "argument", "prefix"], 43824 fields: { 43825 prefix: { 43826 default: false 43827 }, 43828 argument: { 43829 validate: (0, _index2.assertNodeType)("Expression") 43830 }, 43831 operator: { 43832 validate: _index2.assertOneOf.apply(undefined, _constants.UPDATE_OPERATORS) 43833 } 43834 }, 43835 visitor: ["argument"], 43836 aliases: ["Expression"] 43837 }); 43838 43839 (0, _index3.default)("VariableDeclaration", { 43840 builder: ["kind", "declarations"], 43841 visitor: ["declarations"], 43842 aliases: ["Statement", "Declaration"], 43843 fields: { 43844 kind: { 43845 validate: (0, _index2.chain)((0, _index2.assertValueType)("string"), (0, _index2.assertOneOf)("var", "let", "const")) 43846 }, 43847 declarations: { 43848 validate: (0, _index2.chain)((0, _index2.assertValueType)("array"), (0, _index2.assertEach)((0, _index2.assertNodeType)("VariableDeclarator"))) 43849 } 43850 } 43851 }); 43852 43853 (0, _index3.default)("VariableDeclarator", { 43854 visitor: ["id", "init"], 43855 fields: { 43856 id: { 43857 validate: (0, _index2.assertNodeType)("LVal") 43858 }, 43859 init: { 43860 optional: true, 43861 validate: (0, _index2.assertNodeType)("Expression") 43862 } 43863 } 43864 }); 43865 43866 (0, _index3.default)("WhileStatement", { 43867 visitor: ["test", "body"], 43868 aliases: ["Statement", "BlockParent", "Loop", "While", "Scopable"], 43869 fields: { 43870 test: { 43871 validate: (0, _index2.assertNodeType)("Expression") 43872 }, 43873 body: { 43874 validate: (0, _index2.assertNodeType)("BlockStatement", "Statement") 43875 } 43876 } 43877 }); 43878 43879 (0, _index3.default)("WithStatement", { 43880 visitor: ["object", "body"], 43881 aliases: ["Statement"], 43882 fields: { 43883 object: { 43884 object: (0, _index2.assertNodeType)("Expression") 43885 }, 43886 body: { 43887 validate: (0, _index2.assertNodeType)("BlockStatement", "Statement") 43888 } 43889 } 43890 }); 43891 43892/***/ }, 43893/* 381 */ 43894/***/ function(module, exports, __webpack_require__) { 43895 43896 "use strict"; 43897 43898 var _index = __webpack_require__(26); 43899 43900 var _index2 = _interopRequireDefault(_index); 43901 43902 function _interopRequireDefault(obj) { 43903 return obj && obj.__esModule ? obj : { default: obj }; 43904 } 43905 43906 (0, _index2.default)("AssignmentPattern", { 43907 visitor: ["left", "right"], 43908 aliases: ["Pattern", "LVal"], 43909 fields: { 43910 left: { 43911 validate: (0, _index.assertNodeType)("Identifier") 43912 }, 43913 right: { 43914 validate: (0, _index.assertNodeType)("Expression") 43915 }, 43916 decorators: { 43917 validate: (0, _index.chain)((0, _index.assertValueType)("array"), (0, _index.assertEach)((0, _index.assertNodeType)("Decorator"))) 43918 } 43919 } 43920 }); 43921 43922 (0, _index2.default)("ArrayPattern", { 43923 visitor: ["elements", "typeAnnotation"], 43924 aliases: ["Pattern", "LVal"], 43925 fields: { 43926 elements: { 43927 validate: (0, _index.chain)((0, _index.assertValueType)("array"), (0, _index.assertEach)((0, _index.assertNodeType)("Expression"))) 43928 }, 43929 decorators: { 43930 validate: (0, _index.chain)((0, _index.assertValueType)("array"), (0, _index.assertEach)((0, _index.assertNodeType)("Decorator"))) 43931 } 43932 } 43933 }); 43934 43935 (0, _index2.default)("ArrowFunctionExpression", { 43936 builder: ["params", "body", "async"], 43937 visitor: ["params", "body", "returnType", "typeParameters"], 43938 aliases: ["Scopable", "Function", "BlockParent", "FunctionParent", "Expression", "Pureish"], 43939 fields: { 43940 params: { 43941 validate: (0, _index.chain)((0, _index.assertValueType)("array"), (0, _index.assertEach)((0, _index.assertNodeType)("LVal"))) 43942 }, 43943 body: { 43944 validate: (0, _index.assertNodeType)("BlockStatement", "Expression") 43945 }, 43946 async: { 43947 validate: (0, _index.assertValueType)("boolean"), 43948 default: false 43949 } 43950 } 43951 }); 43952 43953 (0, _index2.default)("ClassBody", { 43954 visitor: ["body"], 43955 fields: { 43956 body: { 43957 validate: (0, _index.chain)((0, _index.assertValueType)("array"), (0, _index.assertEach)((0, _index.assertNodeType)("
43957ClassMethod", "ClassProperty"))) 43958 } 43959 } 43960 }); 43961 43962 (0, _index2.default)("ClassDeclaration", { 43963 builder: ["id", "superClass", "body", "decorators"], 43964 visitor: ["id", "body", "superClass", "mixins", "typeParameters", "superTypeParameters", "implements", "decorators"], 43965 aliases: ["Scopable", "Class", "Statement", "Declaration", "Pureish"], 43966 fields: { 43967 id: { 43968 validate: (0, _index.assertNodeType)("Identifier") 43969 }, 43970 body: { 43971 validate: (0, _index.assertNodeType)("ClassBody") 43972 }, 43973 superClass: { 43974 optional: true, 43975 validate: (0, _index.assertNodeType)("Expression") 43976 }, 43977 decorators: { 43978 validate: (0, _index.chain)((0, _index.assertValueType)("array"), (0, _index.assertEach)((0, _index.assertNodeType)("Decorator"))) 43979 } 43980 } 43981 }); 43982 43983 (0, _index2.default)("ClassExpression", { 43984 inherits: "ClassDeclaration", 43985 aliases: ["Scopable", "Class", "Expression", "Pureish"], 43986 fields: { 43987 id: { 43988 optional: true, 43989 validate: (0, _index.assertNodeType)("Identifier") 43990 }, 43991 body: { 43992 validate: (0, _index.assertNodeType)("ClassBody") 43993 }, 43994 superClass: { 43995 optional: true, 43996 validate: (0, _index.assertNodeType)("Expression") 43997 }, 43998 decorators: { 43999 validate: (0, _index.chain)((0, _index.assertValueType)("array"), (0, _index.assertEach)((0, _index.assertNodeType)("Decorator"))) 44000 } 44001 } 44002 }); 44003 44004 (0, _index2.default)("ExportAllDeclaration", { 44005 visitor: ["source"], 44006 aliases: ["Statement", "Declaration", "ModuleDeclaration", "ExportDeclaration"], 44007 fields: { 44008 source: { 44009 validate: (0, _index.assertNodeType)("StringLiteral") 44010 } 44011 } 44012 }); 44013 44014 (0, _index2.default)("ExportDefaultDeclaration", { 44015 visitor: ["declaration"], 44016 aliases: ["Statement", "Declaration", "ModuleDeclaration", "ExportDeclaration"], 44017 fields: { 44018 declaration: { 44019 validate: (0, _index.assertNodeType)("FunctionDeclaration", "ClassDeclaration", "Expression") 44020 } 44021 } 44022 }); 44023 44024 (0, _index2.default)("ExportNamedDeclaration", { 44025 visitor: ["declaration", "specifiers", "source"], 44026 aliases: ["Statement", "Declaration", "ModuleDeclaration", "ExportDeclaration"], 44027 fields: { 44028 declaration: { 44029 validate: (0, _index.assertNodeType)("Declaration"), 44030 optional: true 44031 }, 44032 specifiers: { 44033 validate: (0, _index.chain)((0, _index.assertValueType)("array"), (0, _index.assertEach)((0, _index.assertNodeType)("ExportSpecifier"))) 44034 }, 44035 source: { 44036 validate: (0, _index.assertNodeType)("StringLiteral"), 44037 optional: true 44038 } 44039 } 44040 }); 44041 44042 (0, _index2.default)("ExportSpecifier", { 44043 visitor: ["local", "exported"], 44044 aliases: ["ModuleSpecifier"], 44045 fields: { 44046 local: { 44047 validate: (0, _index.assertNodeType)("Identifier") 44048 }, 44049 exported: { 44050 validate: (0, _index.assertNodeType)("Identifier") 44051 } 44052 } 44053 }); 44054 44055 (0, _index2.default)("ForOfStatement", { 44056 visitor: ["left", "right", "body"], 44057 aliases: ["Scopable", "Statement", "For", "BlockParent", "Loop", "ForXStatement"], 44058 fields: { 44059 left: { 44060 validate: (0, _index.assertNodeType)("VariableDeclaration", "LVal") 44061 }, 44062 right: { 44063 validate: (0, _index.assertNodeType)("Expression") 44064 }, 44065 body: { 44066 validate: (0, _index.assertNodeType)("Statement") 44067 } 44068 } 44069 }); 44070 44071 (0, _index2.default)("ImportDeclaration", { 44072 visitor: ["specifiers", "source"], 44073 aliases: ["Statement", "Declaration", "ModuleDeclaration"], 44074 fields: { 44075 specifiers: { 44076 validate: (0, _index.chain)((0, _index.assertValueType)("array"), (0, _index.assertEach)((0, _index.assertNodeType)("ImportSpecifier", "ImportDefaultSpecifier", "ImportNamespaceSpecifier"))) 44077 }, 44078 source: { 44079 validate: (0, _index.assertNodeType)("StringLiteral") 44080 } 44081 } 44082 }); 44083 44084 (0, _index2.default)("ImportDefaultSpecifier", { 44085 visitor: ["local"], 44086 aliases: ["ModuleSpecifier"], 44087 fields: { 44088 local: { 44089 validate: (0, _index.assertNodeType)("Identifier") 44090 } 44091 } 44092 }); 44093 44094 (0, _index2.default)("ImportNamespaceSpecifier", { 44095 visitor: ["local"], 44096 aliases: ["ModuleSpecifier"], 44097 fields: { 44098 local: { 44099 validate: (0, _index.assertNodeType)("Identifier") 44100 } 44101 } 44102 }); 44103 44104 (0, _index2.default)("ImportSpecifier", { 44105 visitor: ["local", "imported"], 44106 aliases: ["ModuleSpecifier"], 44107 fields: { 44108 local: { 44109 validate: (0, _index.assertNodeType)("Identifier") 44110 }, 44111 imported: { 44112 validate: (0, _index.assertNodeType)("Identifier") 44113 }, 44114 importKind: { 44115 validate: (0, _index.assertOneOf)(null, "type", "typeof") 44116 } 44117 } 44118 }); 44119 44120 (0, _index2.default)("MetaProperty", { 44121 visitor: ["meta", "property"], 44122 aliases: ["Expression"], 44123 fields: { 44124 meta: { 44125 validate: (0, _index.assertValueType)("string") 44126 }, 44127 property: { 44128 validate: (0, _index.assertValueType)("string") 44129 } 44130 } 44131 }); 44132 44133 (0, _index2.default)("ClassMethod", { 44134 aliases: ["Function", "Scopable", "BlockParent", "FunctionParent", "Method"], 44135 builder: ["kind", "key", "params", "body", "computed", "static"], 44136 visitor: ["key", "params", "body", "decorators", "returnType", "typeParameters"], 44137 fields: { 44138 kind: { 44139 validate: (0, _index.chain)((0, _index.assertValueType)("string"), (0, _index.assertOneOf)("get", "set", "method", "constructor")), 44140 default: "method" 44141 }, 44142 computed: { 44143 default: false, 44144 validate: (0, _index.assertValueType)("boolean") 44145 }, 44146 static: { 44147 default: false, 44148 validate: (0, _index.assertValueType)("boolean") 44149 }, 44150 key: { 44151 validate: function validate(node, key, val) { 44152 var expectedTypes = node.computed ? ["Expression"] : ["Identifier", "StringLiteral", "NumericLiteral"]; 44153 _index.assertNodeType.apply(undefined, expectedTypes)(node, key, val); 44154 } 44155 }, 44156 params: { 44157 validate: (0, _index.chain)((0, _index.assertValueType)("array"), (0, _index.assertEach)((0, _index.assertNodeType)("LVal"))) 44158 }, 44159 body: { 44160 validate: (0, _index.assertNodeType)("BlockStatement") 44161 }, 44162 generator: { 44163 default: false, 44164 validate: (0, _index.assertValueType)("boolean") 44165 }, 44166 async: { 44167 default: false, 44168 validate: (0, _index.assertValueType)("boolean") 44169 } 44170 } 44171 }); 44172 44173 (0, _index2.default)("ObjectPattern", { 44174 visitor: ["properties", "typeAnnotation"], 44175 aliases: ["Pattern", "LVal"], 44176 fields: { 44177 properties: { 44178 validate: (0, _index.chain)((0, _index.assertValueType)("array"), (0, _index.assertEach)((0, _index.assertNodeType)("RestProperty", "Property"))) 44179 }, 44180 decorators: { 44181 validate: (0, _index.chain)((0, _index.assertValueType)("array"), (0, _index.assertEach)((0, _index.assertNodeType)("Decorator"))) 44182 } 44183 } 44184 }); 44185 44186 (0, _index2.default)("SpreadElement", { 44187 visitor: ["argument"], 44188 aliases: ["UnaryLike"], 44189 fields: { 44190 argument: { 44191 validate: (0, _index.assertNodeType)("Expression") 44192 } 44193 } 44194 }); 44195 44196 (0, _index2.default)("Super", { 44197 aliases: ["Expression"] 44198 }); 44199 44200 (0, _index2.default)("TaggedTemplateExpression", { 44201 visitor: ["tag", "quasi"], 44202 aliases: ["Expression"], 44203 fields: { 44204 tag: { 44205 validate: (0, _index.assertNodeType)("Expression") 44206 }, 44207 quasi: { 44208 validate: (0, _index.assertNodeType)("TemplateLiteral") 44209 } 44210 } 44211 }); 44212 44213 (0, _index2.default)("TemplateElement", { 44214 builder: ["value", "tail"], 44215 fields: { 44216 value: {}, 44217 tail: { 44218 validate: (0, _index.assertValueType)("boolean"), 44219 default: false 44220 } 44221 } 44222 }); 44223 44224 (0, _index2.default)("TemplateLiteral", { 44225 visitor: ["quasis", "expressions"], 44226 aliases: ["Expression", "Literal"], 44227 fields: { 44228 quasis: { 44229 validate: (0, _index.chain)((0, _index.assertValueType)("array"), (0, _index.assertEach)((0, _index.assertNodeType)("TemplateElement"))) 44230 }, 44231 expressions: { 44232 validate: (0, _index.chain)((0, _index.assertValueType)("array"), (0, _index.assertEach)((0, _index.assertNodeType)("Expression"))) 44233 } 44234 } 44235 }); 44236 44237 (0, _index2.default)("YieldExpression", { 44238 builder: ["argument", "delegate"], 44239 visitor: ["argument"], 44240 aliases: ["Expression", "Terminatorless"], 44241 fields: { 44242 delegate: { 44243 validate: (0, _index.assertValueType)("boolean"), 44244 default: false 44245 }, 44246 argument: { 44247 optional: true, 44248 validate: (0, _index.assertNodeType)("Expression") 44249 } 44250 } 44251 }); 44252 44253/***/ }, 44254/* 382 */ 44255/***/ function(module, exports, __webpack_require__) { 44256 44257 "use strict"; 44258 44259 var _index = __webpack_require__(26); 44260 44261 var _index2 = _interopRequireDefault(_index); 44262 44263 function _interopRequireDefault(obj) { 44264 return obj && obj.__esModule ? obj : { default: obj }; 44265 } 44266 44267 (0, _index2.default)("AwaitExpression", { 44268 builder: ["argument"], 44269 visitor: ["argument"], 44270 aliases: ["Expression", "Terminatorless"], 44271 fields: { 44272 argument: { 44273 validate: (0, _index.assertNodeType)("Expression") 44274 } 44275 } 44276 }); 44277 44278 (0, _index2.default)("ForAwaitStatement", { 44279 visitor: ["left", "right", "body"], 44280 aliases: ["Scopable", "Statement", "For", "BlockParent", "Loop", "ForXStatement"], 44281 fields: { 44282 left: { 44283 validate: (0, _index.assertNodeType)("VariableDeclaration", "LVal") 44284 }, 44285 right: { 44286 validate: (0, _index.assertNodeType)("Expression") 44287 }, 44288 body: { 44289 validate: (0, _index.assertNodeType)("Statement") 44290 } 44291 } 44292 }); 44293 44294 (0, _index2.default)("BindExpression", { 44295 visitor: ["object", "callee"], 44296 aliases: ["Expression"], 44297 fields: {} 44298 }); 44299 44300 (0, _index2.default)("Import", { 44301 aliases: ["Expression"] 44302 }); 44303 44304 (0, _index2.default)("Decorator", { 44305 visitor: ["expression"], 44306 fields: { 44307 expression: { 44308 validate: (0, _index.assertNodeType)("Expression") 44309 } 44310 } 44311 }); 44312 44313 (0, _index2.default)("DoExpression", { 44314 visitor: ["body"], 44315 aliases: ["Expression"], 44316 fields: { 44317 body: { 44318 validate: (0, _index.assertNodeType)("BlockStatement") 44319 } 44320 } 44321 }); 44322 44323 (0, _index2.default)("ExportDefaultSpecifier", { 44324 visitor: ["exported"], 44325 aliases: ["ModuleSpecifier"], 44326 fields: { 44327 exported: { 44328 validate: (0, _index.assertNodeType)("Identifier") 44329 } 44330 } 44331 }); 44332 44333 (0, _index2.default)("ExportNamespaceSpecifier", { 44334 visitor: ["exported"], 44335 aliases: ["ModuleSpecifier"], 44336 fields: { 44337 exported: { 44338 validate: (0, _index.assertNodeType)("Identifier") 44339 } 44340 } 44341 }); 44342 44343 (0, _index2.default)("RestProperty", { 44344 visitor: ["argument"], 44345 aliases: ["UnaryLike"], 44346 fields: { 44347 argument: { 44348 validate: (0, _index.assertNodeType)("LVal") 44349 } 44350 } 44351 }); 44352 44353 (0, _index2.default)("SpreadProperty", { 44354 visitor: ["argument"], 44355 aliases: ["UnaryLike"], 44356 fields: { 44357 argument: { 44358 validate: (0, _index.assertNodeType)("Expression") 44359 } 44360 } 44361 }); 44362 44363/***/ }, 44364/* 383 */ 44365/***/ function(module, exports, __webpack_require__) { 44366 44367 "use strict"; 44368 44369 var _index = __webpack_require__(26); 44370 44371 var _index2 = _interopRequireDefault(_index); 44372 44373 function _interopRequireDefault(obj) { 44374 return obj && obj.__esModule ? obj : { default: obj }; 44375 } 44376 44377 (0, _index2.default)("AnyTypeAnnotation", { 44378 aliases: ["Flow", "FlowBaseAnnotation"], 44379 fields: {} 44380 }); 44381 44382 (0, _index2.default)("ArrayTypeAnnotation", { 44383 visitor: ["elementType"], 44384 aliases: ["Flow"], 44385 fields: {} 44386 }); 44387 44388 (0, _index2.default)("BooleanTypeAnnotation", { 44389 aliases: ["Flow", "FlowBaseAnnotation"], 44390 fields: {} 44391 }); 44392 44393 (0, _index2.default)("BooleanLiteralTypeAnnotation", { 44394 aliases: ["Flow"], 44395 fields: {} 44396 }); 44397 44398 (0, _index2.default)("NullLiteralTypeAnnotation", { 44399 aliases: ["Flow", "FlowBaseAnnotation"], 44400 fields: {} 44401 }); 44402 44403 (0, _index2.default)("ClassImplements", { 44404 visitor: ["id", "typeParameters"], 44405 aliases: ["Flow"], 44406 fields: {} 44407 }); 44408 44409 (0, _index2.default)("ClassProperty", { 44410 visitor: ["key", "value", "typeAnnotation", "decorators"], 44411 builder: ["key", "value", "typeAnnotation", "decorators", "computed"], 44412 aliases: ["Property"], 44413 fields: { 44414 computed: { 44415 validate: (0, _index.assertValueType)("boolean"), 44416 default: false 44417 } 44418 } 44419 }); 44420 44421 (0, _index2.default)("DeclareClass", { 44422 visitor: ["id", "typeParameters", "extends", "body"], 44423 aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"], 44424 fields: {} 44425 }); 44426 44427 (0, _index2.default)("DeclareFunction", { 44428 visitor: ["id"], 44429 aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"], 44430 fields: {} 44431 }); 44432 44433 (0, _index2.default)("DeclareInterface", { 44434 visitor: ["id", "typeParameters", "extends", "body"], 44435 aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"], 44436 fields: {} 44437 }); 44438 44439 (0, _index2.default)("DeclareModule", { 44440 visitor: ["id", "body"], 44441 aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"], 44442 fields: {} 44443 }); 44444 44445 (0, _index2.default)("DeclareModuleExports", { 44446 visitor: ["typeAnnotation"], 44447 aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"], 44448 fields: {} 44449 }); 44450 44451 (0, _index2.default)("DeclareTypeAlias", { 44452 visitor: ["id", "typeParameters", "right"], 44453 aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"], 44454 fields: {} 44455 }); 44456 44457 (0, _index2.default)("DeclareVariable", { 44458 visitor: ["id"], 44459 aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"], 44460 fields: {} 44461 }); 44462 44463 (0, _index2.default)("ExistentialTypeParam", { 44464 aliases: ["Flow"] 44465 }); 44466 44467 (0, _index2.default)("FunctionTypeAnnotation", { 44468 visitor: ["typeParameters", "params", "rest", "returnType"], 44469 aliases: ["Flow"], 44470 fields: {} 44471 }); 44472 44473 (0, _index2.default)("FunctionTypeParam", { 44474 visitor: ["name", "typeAnnotation"], 44475 aliases: ["Flow"], 44476 fields: {} 44477 }); 44478 44479 (0, _index2.default)("GenericTypeAnnotation", { 44480 visitor: ["id", "typeParameters"], 44481 aliases: ["Flow"], 44482 fields: {} 44483 }); 44484 44485 (0, _index2.default)("InterfaceExtends", { 44486 visitor: ["id", "typeParameters"], 44487 aliases: ["Flow"], 44488 fields: {} 44489 }); 44490 44491 (0, _index2.default)("InterfaceDeclaration", { 44492 visitor: ["id", "typeParameters", "extends", "body"], 44493 aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"], 44494 fields: {} 44495 }); 44496 44497 (0, _index2.default)("IntersectionTypeAnnotation", { 44498 visitor: ["types"], 44499 aliases: ["Flow"], 44500 fields: {} 44501 }); 44502 44503 (0, _index2.default)("MixedTypeAnnotation", { 44504 aliases: ["Flow", "FlowBaseAnnotation"] 44505 }); 44506 44507 (0, _index2.default)("EmptyTypeAnnotation", { 44508 aliases: ["Flow", "FlowBaseAnnotation"] 44509 }); 44510 44511 (0, _index2.default)("NullableTypeAnnotation", { 44512 visitor: ["typeAnnotation"], 44513 aliases: ["Flow"], 44514 fields: {} 44515 }); 44516 44517 (0, _index2.default)("NumericLiteralTypeAnnotation", { 44518 aliases: ["Flow"], 44519 fields: {} 44520 }); 44521 44522 (0, _index2.default)("NumberTypeAnnotation", { 44523 aliases: ["Flow", "FlowBaseAnnotation"], 44524 fields: {} 44525 }); 44526 44527 (0, _index2.default)("StringLiteralTypeAnnotation", { 44528 aliases: ["Flow"], 44529 fields: {} 44530 }); 44531 44532 (0, _index2.default)("StringTypeAnnotation", { 44533 aliases: ["Flow", "FlowBaseAnnotation"], 44534 fields: {} 44535 }); 44536 44537 (0, _index2.default)("ThisTypeAnnotation", { 44538 aliases: ["Flow", "FlowBaseAnnotation"], 44539 fields: {} 44540 }); 44541 44542 (0, _index2.default)("TupleTypeAnnotation", { 44543 visitor: ["types"], 44544 aliases: ["Flow"], 44545 fields: {} 44546 }); 44547 44548 (0, _index2.default)("TypeofTypeAnnotation", { 44549 visitor: ["argument"], 44550 aliases: ["Flow"], 44551 fields: {} 44552 }); 44553 44554 (0, _index2.default)("TypeAlias", { 44555 visitor: ["id", "typeParameters", "right"], 44556 aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"], 44557 fields: {} 44558 }); 44559 44560 (0, _index2.default)("TypeAnnotation", { 44561 visitor: ["typeAnnotation"], 44562 aliases: ["Flow"], 44563 fields: {} 44564 }); 44565 44566 (0, _index2.default)("TypeCastExpression", { 44567 visitor: ["expression", "typeAnnotation"], 44568 aliases: ["Flow", "ExpressionWrapper", "Expression"], 44569 fields: {} 44570 }); 44571 44572 (0, _index2.default)("TypeParameter", { 44573 visitor: ["bound"], 44574 aliases: ["Flow"], 44575 fields: {} 44576 }); 44577 44578 (0, _index2.default)("TypeParameterDeclaration", { 44579 visitor: ["params"], 44580 aliases: ["Flow"], 44581 fields: {} 44582 }); 44583 44584 (0, _index2.default)("TypeParameterInstantiation", { 44585 visitor: ["params"], 44586 aliases: ["Flow"], 44587 fields: {} 44588 }); 44589 44590 (0, _index2.default)("ObjectTypeAnnotation", { 44591 visitor: ["properties", "indexers", "callProperties"], 44592 aliases: ["Flow"], 44593 fields: {} 44594 }); 44595 44596 (0, _index2.default)("ObjectTypeCallProperty", { 44597 visitor: ["value"], 44598 aliases: ["Flow", "UserWhitespacable"], 44599 fields: {} 44600 }); 44601 44602 (0, _index2.default)("ObjectTypeIn
44602dexer", { 44603 visitor: ["id", "key", "value"], 44604 aliases: ["Flow", "UserWhitespacable"], 44605 fields: {} 44606 }); 44607 44608 (0, _index2.default)("ObjectTypeProperty", { 44609 visitor: ["key", "value"], 44610 aliases: ["Flow", "UserWhitespacable"], 44611 fields: {} 44612 }); 44613 44614 (0, _index2.default)("QualifiedTypeIdentifier", { 44615 visitor: ["id", "qualification"], 44616 aliases: ["Flow"], 44617 fields: {} 44618 }); 44619 44620 (0, _index2.default)("UnionTypeAnnotation", { 44621 visitor: ["types"], 44622 aliases: ["Flow"], 44623 fields: {} 44624 }); 44625 44626 (0, _index2.default)("VoidTypeAnnotation", { 44627 aliases: ["Flow", "FlowBaseAnnotation"], 44628 fields: {} 44629 }); 44630 44631/***/ }, 44632/* 384 */ 44633/***/ function(module, exports, __webpack_require__) { 44634 44635 "use strict"; 44636 44637 __webpack_require__(26); 44638 44639 __webpack_require__(380); 44640 44641 __webpack_require__(381); 44642 44643 __webpack_require__(383); 44644 44645 __webpack_require__(385); 44646 44647 __webpack_require__(386); 44648 44649 __webpack_require__(382); 44650 44651/***/ }, 44652/* 385 */ 44653/***/ function(module, exports, __webpack_require__) { 44654 44655 "use strict"; 44656 44657 var _index = __webpack_require__(26); 44658 44659 var _index2 = _interopRequireDefault(_index); 44660 44661 function _interopRequireDefault(obj) { 44662 return obj && obj.__esModule ? obj : { default: obj }; 44663 } 44664 44665 (0, _index2.default)("JSXAttribute", { 44666 visitor: ["name", "value"], 44667 aliases: ["JSX", "Immutable"], 44668 fields: { 44669 name: { 44670 validate: (0, _index.assertNodeType)("JSXIdentifier", "JSXNamespacedName") 44671 }, 44672 value: { 44673 optional: true, 44674 validate: (0, _index.assertNodeType)("JSXElement", "StringLiteral", "JSXExpressionContainer") 44675 } 44676 } 44677 }); 44678 44679 (0, _index2.default)("JSXClosingElement", { 44680 visitor: ["name"], 44681 aliases: ["JSX", "Immutable"], 44682 fields: { 44683 name: { 44684 validate: (0, _index.assertNodeType)("JSXIdentifier", "JSXMemberExpression") 44685 } 44686 } 44687 }); 44688 44689 (0, _index2.default)("JSXElement", { 44690 builder: ["openingElement", "closingElement", "children", "selfClosing"], 44691 visitor: ["openingElement", "children", "closingElement"], 44692 aliases: ["JSX", "Immutable", "Expression"], 44693 fields: { 44694 openingElement: { 44695 validate: (0, _index.assertNodeType)("JSXOpeningElement") 44696 }, 44697 closingElement: { 44698 optional: true, 44699 validate: (0, _index.assertNodeType)("JSXClosingElement") 44700 }, 44701 children: { 44702 validate: (0, _index.chain)((0, _index.assertValueType)("array"), (0, _index.assertEach)((0, _index.assertNodeType)("JSXText", "JSXExpressionContainer", "JSXSpreadChild", "JSXElement"))) 44703 } 44704 } 44705 }); 44706 44707 (0, _index2.default)("JSXEmptyExpression", { 44708 aliases: ["JSX", "Expression"] 44709 }); 44710 44711 (0, _index2.default)("JSXExpressionContainer", { 44712 visitor: ["expression"], 44713 aliases: ["JSX", "Immutable"], 44714 fields: { 44715 expression: { 44716 validate: (0, _index.assertNodeType)("Expression") 44717 } 44718 } 44719 }); 44720 44721 (0, _index2.default)("JSXSpreadChild", { 44722 visitor: ["expression"], 44723 aliases: ["JSX", "Immutable"], 44724 fields: { 44725 expression: { 44726 validate: (0, _index.assertNodeType)("Expression") 44727 } 44728 } 44729 }); 44730 44731 (0, _index2.default)("JSXIdentifier", { 44732 builder: ["name"], 44733 aliases: ["JSX", "Expression"], 44734 fields: { 44735 name: { 44736 validate: (0, _index.assertValueType)("string") 44737 } 44738 } 44739 }); 44740 44741 (0, _index2.default)("JSXMemberExpression", { 44742 visitor: ["object", "property"], 44743 aliases: ["JSX", "Expression"], 44744 fields: { 44745 object: { 44746 validate: (0, _index.assertNodeType)("JSXMemberExpression", "JSXIdentifier") 44747 }, 44748 property: { 44749 validate: (0, _index.assertNodeType)("JSXIdentifier") 44750 } 44751 } 44752 }); 44753 44754 (0, _index2.default)("JSXNamespacedName", { 44755 visitor: ["namespace", "name"], 44756 aliases: ["JSX"], 44757 fields: { 44758 namespace: { 44759 validate: (0, _index.assertNodeType)("JSXIdentifier") 44760 }, 44761 name: { 44762 validate: (0, _index.assertNodeType)("JSXIdentifier") 44763 } 44764 } 44765 }); 44766 44767 (0, _index2.default)("JSXOpeningElement", { 44768 builder: ["name", "attributes", "selfClosing"], 44769 visitor: ["name", "attributes"], 44770 aliases: ["JSX", "Immutable"], 44771 fields: { 44772 name: { 44773 validate: (0, _index.assertNodeType)("JSXIdentifier", "JSXMemberExpression") 44774 }, 44775 selfClosing: { 44776 default: false, 44777 validate: (0, _index.assertValueType)("boolean") 44778 }, 44779 attributes: { 44780 validate: (0, _index.chain)((0, _index.assertValueType)("array"), (0, _index.assertEach)((0, _index.assertNodeType)("JSXAttribute", "JSXSpreadAttribute"))) 44781 } 44782 } 44783 }); 44784 44785 (0, _index2.default)("JSXSpreadAttribute", { 44786 visitor: ["argument"], 44787 aliases: ["JSX"], 44788 fields: { 44789 argument: { 44790 validate: (0, _index.assertNodeType)("Expression") 44791 } 44792 } 44793 }); 44794 44795 (0, _index2.default)("JSXText", { 44796 aliases: ["JSX", "Immutable"], 44797 builder: ["value"], 44798 fields: { 44799 value: { 44800 validate: (0, _index.assertValueType)("string") 44801 } 44802 } 44803 }); 44804 44805/***/ }, 44806/* 386 */ 44807/***/ function(module, exports, __webpack_require__) { 44808 44809 "use strict"; 44810 44811 var _index = __webpack_require__(26); 44812 44813 var _index2 = _interopRequireDefault(_index); 44814 44815 function _interopRequireDefault(obj) { 44816 return obj && obj.__esModule ? obj : { default: obj }; 44817 } 44818 44819 (0, _index2.default)("Noop", { 44820 visitor: [] 44821 }); 44822 44823 (0, _index2.default)("ParenthesizedExpression", { 44824 visitor: ["expression"], 44825 aliases: ["Expression", "ExpressionWrapper"], 44826 fields: { 44827 expression: { 44828 validate: (0, _index.assertNodeType)("Expression") 44829 } 44830 } 44831 }); 44832 44833/***/ }, 44834/* 387 */ 44835/***/ function(module, exports, __webpack_require__) { 44836 44837 "use strict"; 44838 44839 exports.__esModule = true; 44840 exports.createUnionTypeAnnotation = createUnionTypeAnnotation; 44841 exports.removeTypeDuplicates = removeTypeDuplicates; 44842 exports.createTypeAnnotationBasedOnTypeof = createTypeAnnotationBasedOnTypeof; 44843 44844 var _index = __webpack_require__(1); 44845 44846 var t = _interopRequireWildcard(_index); 44847 44848 function _interopRequireWildcard(obj) { 44849 if (obj && obj.__esModule) { 44850 return obj; 44851 } else { 44852 var newObj = {};if (obj != null) { 44853 for (var key in obj) { 44854 if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; 44855 } 44856 }newObj.default = obj;return newObj; 44857 } 44858 } 44859 44860 function createUnionTypeAnnotation(types) { 44861 var flattened = removeTypeDuplicates(types); 44862 44863 if (flattened.length === 1) { 44864 return flattened[0]; 44865 } else { 44866 return t.unionTypeAnnotation(flattened); 44867 } 44868 } 44869 44870 function removeTypeDuplicates(nodes) { 44871 var generics = {}; 44872 var bases = {}; 44873 44874 var typeGroups = []; 44875 44876 var types = []; 44877 44878 for (var i = 0; i < nodes.length; i++) { 44879 var node = nodes[i]; 44880 if (!node) continue; 44881 44882 if (types.indexOf(node) >= 0) { 44883 continue; 44884 } 44885 44886 if (t.isAnyTypeAnnotation(node)) { 44887 return [node]; 44888 } 44889 44890 if (t.isFlowBaseAnnotation(node)) { 44891 bases[node.type] = node; 44892 continue; 44893 } 44894 44895 if (t.isUnionTypeAnnotation(node)) { 44896 if (typeGroups.indexOf(node.types) < 0) { 44897 nodes = nodes.concat(node.types); 44898 typeGroups.push(node.types); 44899 } 44900 continue; 44901 } 44902 44903 if (t.isGenericTypeAnnotation(node)) { 44904 var name = node.id.name; 44905 44906 if (generics[name]) { 44907 var existing = generics[name]; 44908 if (existing.typeParameters) { 44909 if (node.typeParameters) { 44910 existing.typeParameters.params = removeTypeDuplicates(existing.typeParameters.params.concat(node.typeParameters.params)); 44911 } 44912 } else { 44913 existing = node.typeParameters; 44914 } 44915 } else { 44916 generics[name] = node; 44917 } 44918 44919 continue; 44920 } 44921 44922 types.push(node); 44923 } 44924 44925 for (var type in bases) { 44926 types.push(bases[type]); 44927 } 44928 44929 for (var _name in generics) { 44930 types.push(generics[_name]); 44931 } 44932 44933 return types; 44934 } 44935 44936 function createTypeAnnotationBasedOnTypeof(type) { 44937 if (type === "string") { 44938 return t.stringTypeAnnotation(); 44939 } else if (type === "number") { 44940 return t.numberTypeAnnotation(); 44941 } else if (type === "undefined") { 44942 return t.voidTypeAnnotation(); 44943 } else if (type === "boolean") { 44944 return t.booleanTypeAnnotation(); 44945 } else if (type === "function") { 44946 return t.genericTypeAnnotation(t.identifier("Function")); 44947 } else if (type === "object") { 44948 return t.genericTypeAnnotation(t.identifier("Object")); 44949 } else if (type === "symbol") { 44950 return t.genericTypeAnnotation(t.identifier("Symbol")); 44951 } else { 44952 throw new Error("Invalid typeof value"); 44953 } 44954 } 44955 44956/***/ }, 44957/* 388 */ 44958/***/ function(module, exports, __webpack_require__) { 44959 44960 "use strict"; 44961 44962 exports.__esModule = true; 44963 exports.isReactComponent = undefined; 44964 exports.isCompatTag = isCompatTag; 44965 exports.buildChildren = buildChildren; 44966 44967 var _index = __webpack_require__(1); 44968 44969 var t = _interopRequireWildcard(_index); 44970 44971 function _interopRequireWildcard(obj) { 44972 if (obj && obj.__esModule) { 44973 return obj; 44974 } else { 44975 var newObj = {};if (obj != null) { 44976 for (var key in obj) { 44977 if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; 44978 } 44979 }newObj.default = obj;return newObj; 44980 } 44981 } 44982 44983 var isReactComponent = exports.isReactComponent = t.buildMatchMemberExpression("React.Component"); 44984 44985 function isCompatTag(tagName) { 44986 return !!tagName && /^[a-z]|\-/.test(tagName); 44987 } 44988 44989 function cleanJSXElementLiteralChild(child, args) { 44990 var lines = child.value.split(/\r\n|\n|\r/); 44991 44992 var lastNonEmptyLine = 0; 44993 44994 for (var i = 0; i < lines.length; i++) { 44995 if (lines[i].match(/[^ \t]/)) { 44996 lastNonEmptyLine = i; 44997 } 44998 } 44999 45000 var str = ""; 45001 45002 for (var _i = 0; _i < lines.length; _i++) { 45003 var line = lines[_i]; 45004 45005 var isFirstLine = _i === 0; 45006 var isLastLine = _i === lines.length - 1; 45007 var isLastNonEmptyLine = _i === lastNonEmptyLine; 45008 45009 var trimmedLine = line.replace(/\t/g, " "); 45010 45011 if (!isFirstLine) { 45012 trimmedLine = trimmedLine.replace(/^[ ]+/, ""); 45013 } 45014 45015 if (!isLastLine) { 45016 trimmedLine = trimmedLine.replace(/[ ]+$/, ""); 45017 } 45018 45019 if (trimmedLine) { 45020 if (!isLastNonEmptyLine) { 45021 trimmedLine += " ";
45022 } 45023 45024 str += trimmedLine; 45025 } 45026 } 45027 45028 if (str) args.push(t.stringLiteral(str)); 45029 } 45030 45031 function buildChildren(node) { 45032 var elems = []; 45033 45034 for (var i = 0; i < node.children.length; i++) { 45035 var child = node.children[i]; 45036 45037 if (t.isJSXText(child)) { 45038 cleanJSXElementLiteralChild(child, elems); 45039 continue; 45040 } 45041 45042 if (t.isJSXExpressionContainer(child)) child = child.expression; 45043 if (t.isJSXEmptyExpression(child)) continue; 45044 45045 elems.push(child); 45046 } 45047 45048 return elems; 45049 } 45050 45051/***/ }, 45052/* 389 */ 45053/***/ function(module, exports, __webpack_require__) { 45054 45055 "use strict"; 45056 45057 exports.__esModule = true; 45058 45059 var _keys = __webpack_require__(13); 45060 45061 var _keys2 = _interopRequireDefault(_keys); 45062 45063 var _typeof2 = __webpack_require__(6); 45064 45065 var _typeof3 = _interopRequireDefault(_typeof2); 45066 45067 var _getIterator2 = __webpack_require__(2); 45068 45069 var _getIterator3 = _interopRequireDefault(_getIterator2); 45070 45071 exports.isBinding = isBinding; 45072 exports.isReferenced = isReferenced; 45073 exports.isValidIdentifier = isValidIdentifier;
45074 exports.isLet = isLet; 45075 exports.isBlockScoped = isBlockScoped; 45076 exports.isVar = isVar; 45077 exports.isSpecifierDefault = isSpecifierDefault; 45078 exports.isScope = isScope; 45079 exports.isImmutable = isImmutable; 45080 exports.isNodesEquivalent = isNodesEquivalent; 45081 45082 var _retrievers = __webpack_require__(223); 45083 45084 var _esutils = __webpack_require__(154); 45085 45086 var _esutils2 = _interopRequireDefault(_esutils); 45087 45088 var _index = __webpack_require__(1); 45089 45090 var t = _interopRequireWildcard(_index); 45091 45092 var _constants = __webpack_require__(132); 45093 45094 function _interopRequireWildcard(obj) { 45095 if (obj && obj.__esModule) { 45096 return obj; 45097 } else { 45098 var newObj = {};if (obj != null) { 45099 for (var key in obj) { 45100 if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; 45101 } 45102 }newObj.default = obj;return newObj; 45103 } 45104 } 45105 45106 function _interopRequireDefault(obj) { 45107 return obj && obj.__esModule ? obj : { default: obj }; 45108 } 45109 45110 function isBinding(node, parent) { 45111 var keys = _retrievers.getBindingIdentifiers.keys[parent.type]; 45112 if (keys) { 45113 for (var i = 0; i < keys.length; i++) { 45114 var key = keys[i]; 45115 var val = parent[key]; 45116 if (Array.isArray(val)) { 45117 if (val.indexOf(node) >= 0) return true; 45118 } else { 45119 if (val === node) return true; 45120 } 45121 } 45122 } 45123 45124 return false; 45125 } 45126 45127 function isReferenced(node, parent) { 45128 switch (parent.type) { 45129 case "BindExpression": 45130 return parent.object === node || parent.callee === node; 45131 45132 case "MemberExpression": 45133 case "JSXMemberExpression": 45134 if (parent.property === node && parent.computed) { 45135 return true; 45136 } else if (parent.object === node) { 45137 return true; 45138 } else { 45139 return false; 45140 } 45141 45142 case "MetaProperty": 45143 return false; 45144 45145 case "ObjectProperty": 45146 if (parent.key === node) { 45147 return parent.computed; 45148 } 45149 45150 case "VariableDeclarator": 45151 return parent.id !== node; 45152 45153 case "ArrowFunctionExpression": 45154 case "FunctionDeclaration": 45155 case "FunctionExpression": 45156 for (var _iterator = parent.params, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) { 45157 var _ref; 45158 45159 if (_isArray) { 45160 if (_i >= _iterator.length) break; 45161 _ref = _iterator[_i++]; 45162 } else { 45163 _i = _iterator.next(); 45164 if (_i.done) break; 45165 _ref = _i.value; 45166 } 45167 45168 var param = _ref;
45169 45170 if (param === node) return false; 45171 } 45172 45173 return parent.id !== node; 45174 45175 case "ExportSpecifier": 45176 if (parent.source) { 45177 return false; 45178 } else { 45179 return parent.local === node; 45180 } 45181 45182 case "ExportNamespaceSpecifier": 45183 case "ExportDefaultSpecifier": 45184 return false; 45185 45186 case "JSXAttribute": 45187 return parent.name !== node; 45188 45189 case "ClassProperty": 45190 if (parent.key === node) { 45191 return parent.computed; 45192 } else { 45193 return parent.value === node; 45194 } 45195 45196 case "ImportDefaultSpecifier": 45197 case "ImportNamespaceSpecifier": 45198 case "ImportSpecifier": 45199 return false; 45200 45201 case "ClassDeclaration": 45202 case "ClassExpression": 45203 return parent.id !== node; 45204 45205 case "ClassMethod": 45206 case "ObjectMethod": 45207 return parent.key === node && parent.computed; 45208 45209 case "LabeledStatement": 45210 return false; 45211 45212 case "CatchClause": 45213 return parent.param !== node; 45214 45215 case "RestElement": 45216 return false; 45217 45218 case "AssignmentExpression": 45219 return parent.right === node; 45220 45221 case "AssignmentPattern": 45222 return parent.right === node; 45223 45224 case "ObjectPattern": 45225 case "ArrayPattern": 45226 return false; 45227 } 45228 45229 return true; 45230 } 45231 45232 function isValidIdentifier(name) { 45233 if (typeof name !== "string" || _esutils2.default.keyword.isReservedWordES6(name, true)) { 45234 return false; 45235 } else { 45236 return _esutils2.default.keyword.isIdentifierNameES6(name); 45237 } 45238 } 45239 45240 function isLet(node) { 45241 return t.isVariableDeclaration(node) && (node.kind !== "var" || node[_constants.BLOCK_SCOPED_SYMBOL]); 45242 } 45243 45244 function isBlockScoped(node) { 45245 return t.isFunctionDeclaration(node) || t.isClassDeclaration(node) || t.isLet(node); 45246 } 45247 45248 function isVar(node) { 45249 return t.isVariableDeclaration(node, { kind: "var" }) && !node[_constants.BLOCK_SCOPED_SYMBOL]; 45250 } 45251 45252 function isSpecifierDefault(specifier) { 45253 return t.isImportDefaultSpecifier(specifier) || t.isIdentifier(specifier.imported || specifier.exported, { name: "default" }); 45254 } 45255 45256 function isScope(node, parent) { 45257 if (t.isBlockStatement(node) && t.isFunction(parent, { body: node })) { 45258 return false; 45259 } 45260 45261 return t.isScopable(node); 45262 } 45263 45264 function isImmutable(node) { 45265 if (t.isType(node.type, "Immutable")) return true; 45266 45267 if (t.isIdentifier(node)) { 45268 if (node.name === "undefined") { 45269 return true; 45270 } else { 45271 return false; 45272 } 45273 } 45274 45275 return false; 45276 } 45277 45278 function isNodesEquivalent(a, b) { 45279 if ((typeof a === "undefined" ? "undefined" : (0, _typeof3.default)(a)) !== "object" || (typeof a === "undefined" ? "undefined" : (0, _typeof3.default)(a)) !== "object" || a == null || b == null) { 45280 return a === b; 45281 } 45282 45283 if (a.type !== b.type) { 45284 return false; 45285 } 45286 45287 var fields = (0, _keys2.default)(t.NODE_FIELDS[a.type] || a.type); 45288 45289 for (var _iterator2 = fields, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) { 45290 var _ref2; 45291 45292 if (_isArray2) { 45293 if (_i2 >= _iterator2.length) break; 45294 _ref2 = _iterator2[_i2++]; 45295 } else { 45296 _i2 = _iterator2.next(); 45297 if (_i2.done) break; 45298 _ref2 = _i2.value; 45299 } 45300 45301 var field = _ref2; 45302 45303 if ((0, _typeof3.default)(a[field]) !== (0, _typeof3.default)(b[field])) { 45304 return false; 45305 } 45306 45307 if (Array.isArray(a[field])) { 45308 if (!Array.isArray(b[field])) { 45309 return false; 45310 } 45311 if (a[field].length !== b[field].length) { 45312 return false; 45313 } 45314 45315 for (var i = 0; i < a[field].length; i++) { 45316 if (!isNodesEquivalent(a[field][i], b[field][i])) { 45317 return false; 45318 } 45319 } 45320 continue; 45321 } 45322 45323 if (!isNodesEquivalent(a[field], b[field])) { 45324 return false; 45325 } 45326 } 45327 45328 return true; 45329 } 45330 45331/***/ }, 45332/* 390 */ 45333/***/ function(module, exports) { 45334 45335 "use strict"; 45336 45337 module.exports = balanced; 45338 function balanced(a, b, str) { 45339 if (a instanceof RegExp) a = maybeMatch(a, str); 45340 if (b instanceof RegExp) b = maybeMatch(b, str); 45341 45342 var r = range(a, b, str); 45343 45344 return r && { 45345 start: r[0], 45346 end: r[1], 45347 pre: str.slice(0, r[0]), 45348 body: str.slice(r[0] + a.length, r[1]), 45349 post: str.slice(r[1] + b.length) 45350 }; 45351 } 45352 45353 function maybeMatch(reg, str) { 45354 var m = str.match(reg); 45355 return m ? m[0] : null; 45356 } 45357 45358 balanced.range = range; 45359 function range(a, b, str) { 45360 var begs, beg, left, right, result; 45361 var ai = str.indexOf(a); 45362 var bi = str.indexOf(b, ai + 1); 45363 var i = ai; 45364 45365 if (ai >= 0 && bi > 0) { 45366 begs = []; 45367 left = str.length; 45368 45369 while (i >= 0 && !result) { 45370 if (i == ai) { 45371 begs.push(i); 45372 ai = str.indexOf(a, i + 1); 45373 } else if (begs.length == 1) { 45374 result = [begs.pop(), bi]; 45375 } else { 45376 beg = begs.pop(); 45377 if (beg < left) { 45378 left = beg; 45379 right = bi; 45380 } 45381 45382 bi = str.indexOf(b, i + 1); 45383 } 45384 45385 i = ai < bi && ai >= 0 ? ai : bi; 45386 } 45387 45388 if (begs.length) { 45389 result = [left, right]; 45390 } 45391 } 45392 45393 return result; 45394 } 45395 45396/***/ }, 45397/* 391 */
45398/***/ function(module, exports) { 45399 45400 'use strict'; 45401 45402 exports.byteLength = byteLength; 45403 exports.toByteArray = toByteArray; 45404 exports.fromByteArray = fromByteArray; 45405 45406 var lookup = []; 45407 var revLookup = []; 45408 var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array; 45409 45410 var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; 45411 for (var i = 0, len = code.length; i < len; ++i) { 45412 lookup[i] = code[i]; 45413 revLookup[code.charCodeAt(i)] = i; 45414 } 45415 45416 revLookup['-'.charCodeAt(0)] = 62; 45417 revLookup['_'.charCodeAt(0)] = 63; 45418 45419 function placeHoldersCount(b64) { 45420 var len = b64.length; 45421 if (len % 4 > 0) { 45422 throw new Error('Invalid string. Length must be a multiple of 4'); 45423 } 45424 45425 // the number of equal signs (place holders) 45426 // if there are two placeholders, than the two characters before it 45427 // represent one byte 45428 // if there is only one, then the three characters before it represent 2 bytes 45429 // this is just a cheap hack to not do indexOf twice 45430 return b64[len - 2] === '=' ? 2 : b64[len - 1] === '=' ? 1 : 0; 45431 } 45432 45433 function byteLength(b64) { 45434 // base64 is 4/3 + up to two characters of the original data 45435 return b64.length * 3 / 4 - placeHoldersCount(b64); 45436 } 45437 45438 function toByteArray(b64) { 45439 var i, j, l, tmp, placeHolders, arr; 45440 var len = b64.length; 45441 placeHolders = placeHoldersCount(b64); 45442 45443 arr = new Arr(len * 3 / 4 - placeHolders); 45444 45445 // if there are placeholders, only get up to the last complete 4 chars 45446 l = placeHolders > 0 ? len - 4 : len; 45447 45448 var L = 0; 45449 45450 for (i = 0, j = 0; i < l; i += 4, j += 3) { 45451 tmp = revLookup[b64.charCodeAt(i)] << 18 | revLookup[b64.charCodeAt(i + 1)] << 12 | revLookup[b64.charCodeAt(i + 2)] << 6 | revLookup[b64.charCodeAt(i + 3)]; 45452 arr[L++] = tmp >> 16 & 0xFF; 45453 arr[L++] = tmp >> 8 & 0xFF; 45454 arr[L++] = tmp & 0xFF; 45455 } 45456 45457 if (placeHolders === 2) { 45458 tmp = revLookup[b64.charCodeAt(i)] << 2 | revLookup[b64.charCodeAt(i + 1)] >> 4; 45459 arr[L++] = tmp & 0xFF; 45460 } else if (placeHolders === 1) { 45461 tmp = revLookup[b64.charCodeAt(i)] << 10 | revLookup[b64.charCodeAt(i + 1)] << 4 | revLookup[b64.charCodeAt(i + 2)] >> 2; 45462 arr[L++] = tmp >> 8 & 0xFF; 45463 arr[L++] = tmp & 0xFF; 45464 } 45465 45466 return arr; 45467 } 45468 45469 function tripletToBase64(num) { 45470 return lookup[num >> 18 & 0x3F] + lookup[num >> 12 & 0x3F] + lookup[num >> 6 & 0x3F] + lookup[num & 0x3F]; 45471 } 45472 45473 function encodeChunk(uint8, start, end) { 45474 var tmp; 45475 var output = []; 45476 for (var i = start; i < end; i += 3) { 45477 tmp = (uint8[i] << 16) + (uint8[i + 1] << 8) + uint8[i + 2]; 45478 output.push(tripletToBase64(tmp)); 45479 } 45480 return output.join(''); 45481 } 45482 45483 function fromByteArray(uint8) { 45484 var tmp; 45485 var len = uint8.length; 45486 var extraBytes = len % 3; // if we have 1 byte left, pad 2 bytes 45487 var output = ''; 45488 var parts = []; 45489 var maxChunkLength = 16383; // must be multiple of 3 45490 45491 // go through the array every three bytes, we'll deal with trailing stuff later 45492 for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) { 45493 parts.push(encodeChunk(uint8, i, i + maxChunkLength > len2 ? len2 : i + maxChunkLength)); 45494 } 45495 45496 // pad the end with zeros, but make sure to not forget the extra bytes 45497 if (extraBytes === 1) { 45498 tmp = uint8[len - 1]; 45499 output += lookup[tmp >> 2]; 45500 output += lookup[tmp << 4 & 0x3F]; 45501 output += '=='; 45502 } else if (extraBytes === 2) { 45503 tmp = (uint8[len - 2] << 8) + uint8[len - 1]; 45504 output += lookup[tmp >> 10]; 45505 output += lookup[tmp >> 4 & 0x3F]; 45506 output += lookup[tmp << 2 & 0x3F]; 45507 output += '='; 45508 } 45509 45510 parts.push(output); 45511 45512 return parts.join(''); 45513 } 45514 45515/***/ }, 45516/* 392 */ 45517/***/ function(module, exports, __webpack_require__) { 45518 45519 'use strict'; 45520 45521 var concatMap = __webpack_require__(396); 45522 var balanced = __webpack_require__(390); 45523 45524 module.exports = expandTop; 45525 45526 var escSlash = '\0SLASH' + Math.random() + '\0'; 45527 var escOpen = '\0OPEN' + Math.random() + '\0'; 45528 var escClose = '\0CLOSE' + Math.random() + '\0'; 45529 var escComma = '\0COMMA' + Math.random() + '\0'; 45530 var escPeriod = '\0PERIOD' + Math.random() + '\0'; 45531 45532 function numeric(str) { 45533 return parseInt(str, 10) == str ? parseInt(str, 10) : str.charCodeAt(0); 45534 } 45535 45536 function escapeBraces(str) { 45537 return str.split('\\\\').join(escSlash).split('\\{').join(escOpen).split('\\}').join(escClose).split('\\,').join(escComma).split('\\.').join(escPeriod); 45538 } 45539 45540 function unescapeBraces(str) { 45541 return str.split(escSlash).join('\\').split(escOpen).join('{').split(escClose).join('}').split(escComma).join(',').split(escPeriod).join('.'); 45542 } 45543 45544 // Basically just str.split(","), but handling cases 45545 // where we have nested braced sections, which should be 45546 // treated as individual members, like {a,{b,c},d} 45547 function parseCommaParts(str) { 45548 if (!str) return ['']; 45549 45550 var parts = []; 45551 var m = balanced('{', '}', str); 45552 45553 if (!m) return str.split(','); 45554 45555 var pre = m.pre; 45556 var body = m.body; 45557 var post = m.post; 45558 var p = pre.split(','); 45559 45560 p[p.length - 1] += '{' + body + '}'; 45561 var postParts = parseCommaParts(post); 45562 if (post.length) { 45563 p[p.length - 1] += postParts.shift();
vendor: 4,355 bytes, lines 45564-45734
45564 p.push.apply(p, postParts); 45565 } 45566 45567 parts.push.apply(parts, p); 45568 45569 return parts; 45570 } 45571 45572 function expandTop(str) { 45573 if (!str) return []; 45574 45575 // I don't know why Bash 4.3 does this, but it does. 45576 // Anything starting with {} will have the first two bytes preserved 45577 // but *only* at the top level, so {},a}b will not expand to anything, 45578 // but a{},b}c will be expanded to [a}c,abc]. 45579 // One could argue that this is a bug in Bash, but since the goal of 45580 // this module is to match Bash's rules, we escape a leading {} 45581 if (str.substr(0, 2) === '{}') { 45582 str = '\\{\\}' + str.substr(2); 45583 } 45584 45585 return expand(escapeBraces(str), true).map(unescapeBraces); 45586 } 45587 45588 function identity(e) { 45589 return e; 45590 } 45591 45592 function embrace(str) { 45593 return '{' + str + '}'; 45594 } 45595 function isPadded(el) { 45596 return (/^-?0\d/.test(el) 45597 ); 45598 } 45599 45600 function lte(i, y) { 45601 return i <= y; 45602 } 45603 function gte(i, y) { 45604 return i >= y; 45605 } 45606 45607 function expand(str, isTop) { 45608 var expansions = []; 45609 45610 var m = balanced('{', '}', str); 45611 if (!m || /\$$/.test(m.pre)) return [str]; 45612 45613 var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body); 45614 var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body); 45615 var isSequence = isNumericSequence || isAlphaSequence; 45616 var isOptions = /^(.*,)+(.+)?$/.test(m.body); 45617 if (!isSequence && !isOptions) { 45618 // {a},b} 45619 if (m.post.match(/,.*\}/)) { 45620 str = m.pre + '{' + m.body + escClose + m.post; 45621 return expand(str); 45622 } 45623 return [str]; 45624 } 45625 45626 var n; 45627 if (isSequence) { 45628 n = m.body.split(/\.\./); 45629 } else { 45630 n = parseCommaParts(m.body); 45631 if (n.length === 1) { 45632 // x{{a,b}}y ==> x{a}y x{b}y 45633 n = expand(n[0], false).map(embrace); 45634 if (n.length === 1) { 45635 var post = m.post.length ? expand(m.post, false) : ['']; 45636 return post.map(function (p) { 45637 return m.pre + n[0] + p; 45638 }); 45639 } 45640 } 45641 } 45642 45643 // at this point, n is the parts, and we know it's not a comma set 45644 // with a single entry. 45645 45646 // no need to expand pre, since it is guaranteed to be free of brace-sets 45647 var pre = m.pre; 45648 var post = m.post.length ? expand(m.post, false) : ['']; 45649 45650 var N; 45651 45652 if (isSequence) { 45653 var x = numeric(n[0]); 45654 var y = numeric(n[1]); 45655 var width = Math.max(n[0].length, n[1].length); 45656 var incr = n.length == 3 ? Math.abs(numeric(n[2])) : 1; 45657 var test = lte; 45658 var reverse = y < x; 45659 if (reverse) { 45660 incr *= -1; 45661 test = gte; 45662 } 45663 var pad = n.some(isPadded); 45664 45665 N = []; 45666 45667 for (var i = x; test(i, y); i += incr) { 45668 var c; 45669 if (isAlphaSequence) { 45670 c = String.fromCharCode(i); 45671 if (c === '\\') c = ''; 45672 } else { 45673 c = String(i); 45674 if (pad) { 45675 var need = width - c.length; 45676 if (need > 0) { 45677 var z = new Array(need + 1).join('0'); 45678 if (i < 0) c = '-' + z + c.slice(1);else c = z + c; 45679 } 45680 } 45681 } 45682 N.push(c); 45683 } 45684 } else { 45685 N = concatMap(n, function (el) { 45686 return expand(el, false); 45687 }); 45688 } 45689 45690 for (var j = 0; j < N.length; j++) { 45691 for (var k = 0; k < post.length; k++) { 45692 var expansion = pre + N[j] + post[k]; 45693 if (!isTop || isSequence || expansion) expansions.push(expansion); 45694 } 45695 } 45696 45697 return expansions; 45698 } 45699 45700/***/ }, 45701/* 393 */ 45702/***/ function(module, exports, __webpack_require__) { 45703 45704 /* WEBPACK VAR INJECTION */(function(global) {/*! 45705 * The buffer module from node.js, for the browser. 45706 * 45707 * @author Feross Aboukhadijeh <[email protected]> <http://feross.org> 45708 * @license MIT 45709 */ 45710 /* eslint-disable no-proto */ 45711 45712 'use strict'; 45713 45714 var base64 = __webpack_require__(391); 45715 var ieee754 = __webpack_require__(454); 45716 var isArray = __webpack_require__(394); 45717 45718 exports.Buffer = Buffer; 45719 exports.SlowBuffer = SlowBuffer; 45720 exports.INSPECT_MAX_BYTES = 50; 45721 45722 /** 45723 * If `Buffer.TYPED_ARRAY_SUPPORT`: 45724 * === true Use Uint8Array implementation (fastest) 45725 * === false Use Object implementation (most compatible, even IE6) 45726 * 45727 * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+, 45728 * Opera 11.6+, iOS 4.2+. 45729 * 45730 * Due to various browser bugs, sometimes the Object implementation will be used even 45731 * when the browser supports typed arrays. 45732 * 45733 * Note: 45734 *
vendor: 23,202 bytes, lines 45735-46557
45735 * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances, 45736 * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438. 45737 * 45738 * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function. 45739 * 45740 * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of 45741 * incorrect length in some situations. 45742 45743 * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they 45744 * get the Object implementation, which is slower but behaves correctly. 45745 */ 45746 Buffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined ? global.TYPED_ARRAY_SUPPORT : typedArraySupport(); 45747 45748 /* 45749 * Export kMaxLength after typed array support is determined. 45750 */ 45751 exports.kMaxLength = kMaxLength(); 45752 45753 function typedArraySupport() { 45754 try { 45755 var arr = new Uint8Array(1); 45756 arr.__proto__ = { __proto__: Uint8Array.prototype, foo: function foo() { 45757 return 42; 45758 } }; 45759 return arr.foo() === 42 && // typed array instances can be augmented 45760 typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray` 45761 arr.subarray(1, 1).byteLength === 0; // ie10 has broken `subarray` 45762 } catch (e) { 45763 return false; 45764 } 45765 } 45766 45767 function kMaxLength() { 45768 return Buffer.TYPED_ARRAY_SUPPORT ? 0x7fffffff : 0x3fffffff; 45769 } 45770 45771 function createBuffer(that, length) { 45772 if (kMaxLength() < length) { 45773 throw new RangeError('Invalid typed array length'); 45774 } 45775 if (Buffer.TYPED_ARRAY_SUPPORT) { 45776 // Return an augmented `Uint8Array` instance, for best performance 45777 that = new Uint8Array(length); 45778 that.__proto__ = Buffer.prototype; 45779 } else { 45780 // Fallback: Return an object instance of the Buffer class 45781 if (that === null) { 45782 that = new Buffer(length); 45783 } 45784 that.length = length; 45785 } 45786 45787 return that; 45788 } 45789 45790 /** 45791 * The Buffer constructor returns instances of `Uint8Array` that have their 45792 * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of 45793 * `Uint8Array`, so the returned instances will have all the node `Buffer` methods 45794 * and the `Uint8Array` methods. Square bracket notation works as expected -- it 45795 * returns a single octet. 45796 * 45797 * The `Uint8Array` prototype remains unmodified. 45798 */ 45799 45800 function Buffer(arg, encodingOrOffset, length) { 45801 if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) { 45802 return new Buffer(arg, encodingOrOffset, length); 45803 } 45804 45805 // Common case. 45806 if (typeof arg === 'number') { 45807 if (typeof encodingOrOffset === 'string') { 45808 throw new Error('If encoding is specified then the first argument must be a string'); 45809 } 45810 return allocUnsafe(this, arg); 45811 } 45812 return from(this, arg, encodingOrOffset, length); 45813 } 45814 45815 Buffer.poolSize = 8192; // not used by this implementation 45816 45817 // TODO: Legacy, not needed anymore. Remove in next major version. 45818 Buffer._augment = function (arr) { 45819 arr.__proto__ = Buffer.prototype; 45820 return arr; 45821 }; 45822 45823 function from(that, value, encodingOrOffset, length) { 45824 if (typeof value === 'number') { 45825 throw new TypeError('"value" argument must not be a number'); 45826 } 45827 45828 if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) { 45829 return fromArrayBuffer(that, value, encodingOrOffset, length); 45830 } 45831 45832 if (typeof value === 'string') { 45833 return fromString(that, value, encodingOrOffset); 45834 } 45835 45836 return fromObject(that, value); 45837 } 45838 45839 /** 45840 * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError 45841 * if value is a number. 45842 * Buffer.from(str[, encoding]) 45843 * Buffer.from(array) 45844 * Buffer.from(buffer) 45845 * Buffer.from(arrayBuffer[, byteOffset[, length]]) 45846 **/ 45847 Buffer.from = function (value, encodingOrOffset, length) { 45848 return from(null, value, encodingOrOffset, length); 45849 }; 45850 45851 if (Buffer.TYPED_ARRAY_SUPPORT) { 45852 Buffer.prototype.__proto__ = Uint8Array.prototype; 45853 Buffer.__proto__ = Uint8Array; 45854 if (typeof Symbol !== 'undefined' && Symbol.species && Buffer[Symbol.species] === Buffer) { 45855 // Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97 45856 Object.defineProperty(Buffer, Symbol.species, { 45857 value: null, 45858 configurable: true 45859 }); 45860 } 45861 } 45862 45863 function assertSize(size) { 45864 if (typeof size !== 'number') { 45865 throw new TypeError('"size" argument must be a number'); 45866 } else if (size < 0) { 45867 throw new RangeError('"size" argument must not be negative'); 45868 } 45869 } 45870 45871 function alloc(that, size, fill, encoding) { 45872 assertSize(size); 45873 if (size <= 0) { 45874 return createBuffer(that, size); 45875 } 45876 if (fill !== undefined) { 45877 // Only pay attention to encoding if it's a string. This 45878 // prevents accidentally sending in a number that would 45879 // be interpretted as a start offset. 45880 return typeof encoding === 'string' ? createBuffer(that, size).fill(fill, encoding) : createBuffer(that, size).fill(fill); 45881 } 45882 return createBuffer(that, size); 45883 } 45884 45885 /** 45886 * Creates a new filled Buffer instance. 45887 * alloc(size[, fill[, encoding]]) 45888 **/ 45889 Buffer.alloc = function (size, fill, encoding) { 45890 return alloc(null, size, fill, encoding); 45891 }; 45892 45893 function allocUnsafe(that, size) { 45894 assertSize(size); 45895 that = createBuffer(that, size < 0 ? 0 : checked(size) | 0); 45896 if (!Buffer.TYPED_ARRAY_SUPPORT) { 45897 for (var i = 0; i < size; ++i) { 45898 that[i] = 0; 45899 } 45900 } 45901 return that; 45902 } 45903 45904 /** 45905 * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance. 45906 * */ 45907 Buffer.allocUnsafe = function (size) { 45908 return allocUnsafe(null, size); 45909 }; 45910 /** 45911 * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. 45912 */ 45913 Buffer.allocUnsafeSlow = function (size) { 45914 return allocUnsafe(null, size); 45915 }; 45916 45917 function fromString(that, string, encoding) { 45918 if (typeof encoding !== 'string' || encoding === '') { 45919 encoding = 'utf8'; 45920 } 45921 45922 if (!Buffer.isEncoding(encoding)) { 45923 throw new TypeError('"encoding" must be a valid string encoding'); 45924 } 45925 45926 var length = byteLength(string, encoding) | 0; 45927 that = createBuffer(that, length); 45928 45929 var actual = that.write(string, encoding); 45930 45931 if (actual !== length) { 45932 // Writing a hex string, for example, that contains invalid characters will 45933 // cause everything after the first invalid character to be ignored. (e.g. 45934 // 'abxxcd' will be treated as 'ab') 45935 that = that.slice(0, actual); 45936 } 45937 45938 return that; 45939 } 45940 45941 function fromArrayLike(that, array) { 45942 var length = array.length < 0 ? 0 : checked(array.length) | 0; 45943 that = createBuffer(that, length); 45944 for (var i = 0; i < length; i += 1) { 45945 that[i] = array[i] & 255; 45946 } 45947 return that; 45948 } 45949 45950 function fromArrayBuffer(that, array, byteOffset, length) { 45951 array.byteLength; // this throws if `array` is not a valid ArrayBuffer 45952 45953 if (byteOffset < 0 || array.byteLength < byteOffset) { 45954 throw new RangeError('\'offset\' is out of bounds'); 45955 } 45956 45957 if (array.byteLength < byteOffset + (length || 0)) { 45958 throw new RangeError('\'length\' is out of bounds'); 45959 } 45960 45961 if (byteOffset === undefined && length === undefined) { 45962 array = new Uint8Array(array); 45963 } else if (length === undefined) { 45964 array = new Uint8Array(array, byteOffset); 45965 } else { 45966 array = new Uint8Array(array, byteOffset, length); 45967 } 45968 45969 if (Buffer.TYPED_ARRAY_SUPPORT) { 45970 // Return an augmented `Uint8Array` instance, for best performance 45971 that = array; 45972 that.__proto__ = Buffer.prototype; 45973 } else { 45974 // Fallback: Return an object instance of the Buffer class 45975 that = fromArrayLike(that, array); 45976 } 45977 return that; 45978 } 45979 45980 function fromObject(that, obj) { 45981 if (Buffer.isBuffer(obj)) { 45982 var len = checked(obj.length) | 0; 45983 that = createBuffer(that, len); 45984 45985 if (that.length === 0) { 45986 return that; 45987 } 45988 45989 obj.copy(that, 0, 0, len); 45990 return that; 45991 } 45992 45993 if (obj) { 45994 if (typeof ArrayBuffer !== 'undefined' && obj.buffer instanceof ArrayBuffer || 'length' in obj) { 45995 if (typeof obj.length !== 'number' || isnan(obj.length)) { 45996 return createBuffer(that, 0); 45997 } 45998 return fromArrayLike(that, obj); 45999 } 46000 46001 if (obj.type === 'Buffer' && isArray(obj.data)) { 46002 return fromArrayLike(that, obj.data); 46003 } 46004 } 46005 46006 throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.'); 46007 } 46008 46009 function checked(length) { 46010 // Note: cannot use `length < kMaxLength()` here because that fails when 46011 // length is NaN (which is otherwise coerced to zero.) 46012 if (length >= kMaxLength()) { 46013 throw new RangeError('Attempt to allocate Buffer larger than maximum ' + 'size: 0x' + kMaxLength().toString(16) + ' bytes'); 46014 } 46015 return length | 0; 46016 } 46017 46018 function SlowBuffer(length) { 46019 if (+length != length) { 46020 // eslint-disable-line eqeqeq 46021 length = 0; 46022 } 46023 return Buffer.alloc(+length); 46024 } 46025 46026 Buffer.isBuffer = function isBuffer(b) { 46027 return !!(b != null && b._isBuffer); 46028 }; 46029 46030 Buffer.compare = function compare(a, b) { 46031 if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) { 46032 throw new TypeError('Arguments must be Buffers'); 46033 } 46034 46035 if (a === b) return 0; 46036 46037 var x = a.length; 46038 var y = b.length; 46039 46040 for (var i = 0, len = Math.min(x, y); i < len; ++i) { 46041 if (a[i] !== b[i]) { 46042 x = a[i]; 46043 y = b[i]; 46044 break; 46045 } 46046 } 46047 46048 if (x < y) return -1; 46049 if (y < x) return 1; 46050 return 0; 46051 }; 46052 46053 Buffer.isEncoding = function isEncoding(encoding) { 46054 switch (String(encoding).toLowerCase()) { 46055 case 'hex': 46056 case 'utf8': 46057 case 'utf-8': 46058 case 'ascii': 46059 case 'latin1': 46060 case 'binary': 46061 case 'base64': 46062 case 'ucs2': 46063 case 'ucs-2': 46064 case 'utf16le': 46065 case 'utf-16le': 46066 return true; 46067 default: 46068 return false; 46069 } 46070 }; 46071 46072 Buffer.concat = function concat(list, length) { 46073 if (!isArray(list)) { 46074 throw new TypeError('"list" argument must be an Array of Buffers'); 46075 } 46076 46077 if (list.length === 0) { 46078 return Buffer.alloc(0); 46079 } 46080 46081 var i; 46082 if (length === undefined) { 46083 length = 0; 46084 for (i = 0; i < list.length; ++i) { 46085 length += list[i].length; 46086 } 46087 } 46088 46089 var buffer = Buffer.allocUnsafe(length); 46090 var pos = 0; 46091 for (i = 0; i < list.length; ++i) { 46092 var buf = list[i]; 46093 if (!Buffer.isBuffer(buf)) { 46094 throw new TypeError('"list" argument must be an Array of Buffers'); 46095 } 46096 buf.copy(buffer, pos); 46097 pos += buf.length; 46098 } 46099 return buffer; 46100 }; 46101 46102 function byteLength(string, encoding) { 46103 if (Buffer.isBuffer(string)) { 46104 return string.length; 46105 } 46106 if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' && (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) { 46107 return string.byteLength; 46108 } 46109 if (typeof string !== 'string') { 46110 string = '' + string; 46111 } 46112 46113 var len = string.length; 46114 if (len === 0) return 0; 46115 46116 // Use a for loop to avoid recursion 46117 var loweredCase = false; 46118 for (;;) { 46119 switch (encoding) { 46120 case 'ascii': 46121 case 'latin1': 46122 case 'binary': 46123 return len; 46124 case 'utf8': 46125 case 'utf-8': 46126 case undefined: 46127 return utf8ToBytes(string).length; 46128 case 'ucs2': 46129 case 'ucs-2': 46130 case 'utf16le': 46131 case 'utf-16le': 46132 return len * 2; 46133 case 'hex': 46134 return len >>> 1; 46135 case 'base64': 46136 return base64ToBytes(string).length; 46137 default: 46138 if (loweredCase) return utf8ToBytes(string).length; // assume utf8 46139 encoding = ('' + encoding).toLowerCase(); 46140 loweredCase = true; 46141 } 46142 } 46143 } 46144 Buffer.byteLength = byteLength; 46145 46146 function slowToString(encoding, start, end) { 46147 var loweredCase = false; 46148 46149 // No need to verify that "this.length <= MAX_UINT32" since it's a read-only 46150 // property of a typed array. 46151 46152 // This behaves neither like String nor Uint8Array in that we set start/end 46153 // to their upper/lower bounds if the value passed is out of range. 46154 // undefined is handled specially as per ECMA-262 6th Edition, 46155 // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization. 46156 if (start === undefined || start < 0) { 46157 start = 0; 46158 } 46159 // Return early if start > this.length. Done here to prevent potential uint32 46160 // coercion fail below. 46161 if (start > this.length) { 46162 return ''; 46163 } 46164 46165 if (end === undefined || end > this.length) { 46166 end = this.length; 46167 } 46168 46169 if (end <= 0) { 46170 return ''; 46171 } 46172 46173 // Force coersion to uint32. This will also coerce falsey/NaN values to 0. 46174 end >>>= 0; 46175 start >>>= 0; 46176 46177 if (end <= start) { 46178 return ''; 46179 } 46180 46181 if (!encoding) encoding = 'utf8'; 46182 46183 while (true) { 46184 switch (encoding) { 46185 case 'hex': 46186 return hexSlice(this, start, end); 46187 46188 case 'utf8': 46189 case 'utf-8': 46190 return utf8Slice(this, start, end); 46191 46192 case 'ascii': 46193 return asciiSlice(this, start, end); 46194 46195 case 'latin1': 46196 case 'binary': 46197 return latin1Slice(this, start, end); 46198 46199 case 'base64': 46200 return base64Slice(this, start, end); 46201 46202 case 'ucs2': 46203 case 'ucs-2': 46204 case 'utf16le': 46205 case 'utf-16le': 46206 return utf16leSlice(this, start, end); 46207 46208 default: 46209 if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding); 46210 encoding = (encoding + '').toLowerCase(); 46211 loweredCase = true; 46212 } 46213 } 46214 } 46215 46216 // The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect 46217 // Buffer instances. 46218 Buffer.prototype._isBuffer = true; 46219 46220 function swap(b, n, m) { 46221 var i = b[n]; 46222 b[n] = b[m]; 46223 b[m] = i; 46224 } 46225 46226 Buffer.prototype.swap16 = function swap16() { 46227 var len = this.length; 46228 if (len % 2 !== 0) { 46229 throw new RangeError('Buffer size must be a multiple of 16-bits'); 46230 } 46231 for (var i = 0; i < len; i += 2) { 46232 swap(this, i, i + 1); 46233 } 46234 return this; 46235 }; 46236 46237 Buffer.prototype.swap32 = function swap32() { 46238 var len = this.length; 46239 if (len % 4 !== 0) { 46240 throw new RangeError('Buffer size must be a multiple of 32-bits'); 46241 } 46242 for (var i = 0; i < len; i += 4) { 46243 swap(this, i, i + 3); 46244 swap(this, i + 1, i + 2); 46245 } 46246 return this; 46247 }; 46248 46249 Buffer.prototype.swap64 = function swap64() { 46250 var len = this.length; 46251 if (len % 8 !== 0) { 46252 throw new RangeError('Buffer size must be a multiple of 64-bits'); 46253 } 46254 for (var i = 0; i < len; i += 8) { 46255 swap(this, i, i + 7); 46256 swap(this, i + 1, i + 6); 46257 swap(this, i + 2, i + 5); 46258 swap(this, i + 3, i + 4); 46259 } 46260 return this; 46261 }; 46262 46263 Buffer.prototype.toString = function toString() { 46264 var length = this.length | 0; 46265 if (length === 0) return ''; 46266 if (arguments.length === 0) return utf8Slice(this, 0, length); 46267 return slowToString.apply(this, arguments); 46268 }; 46269 46270 Buffer.prototype.equals = function equals(b) { 46271 if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer'); 46272 if (this === b) return true; 46273 return Buffer.compare(this, b) === 0; 46274 }; 46275 46276 Buffer.prototype.inspect = function inspect() { 46277 var str = ''; 46278 var max = exports.INSPECT_MAX_BYTES; 46279 if (this.length > 0) { 46280 str = this.toString('hex', 0, max).match(/.{2}/g).join(' '); 46281 if (this.length > max) str += ' ... '; 46282 } 46283 return '<Buffer ' + str + '>'; 46284 }; 46285 46286 Buffer.prototype.compare = function compare(target, start, end, thisStart, thisEnd) { 46287 if (!Buffer.isBuffer(target)) { 46288 throw new TypeError('Argument must be a Buffer'); 46289 } 46290 46291 if (start === undefined) { 46292 start = 0; 46293 } 46294 if (end === undefined) { 46295 end = target ? target.length : 0; 46296 } 46297 if (thisStart === undefined) { 46298 thisStart = 0; 46299 } 46300 if (thisEnd === undefined) { 46301 thisEnd = this.length; 46302 } 46303 46304 if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) { 46305 throw new RangeError('out of range index'); 46306 } 46307 46308 if (thisStart >= thisEnd && start >= end) { 46309 return 0; 46310 } 46311 if (thisStart >= thisEnd) { 46312 return -1; 46313 } 46314 if (start >= end) { 46315 return 1; 46316 } 46317 46318 start >>>= 0; 46319 end >>>= 0; 46320 thisStart >>>= 0; 46321 thisEnd >>>= 0; 46322 46323 if (this === target) return 0; 46324 46325 var x = thisEnd - thisStart; 46326 var y = end - start; 46327 var len = Math.min(x, y); 46328 46329 var thisCopy = this.slice(thisStart, thisEnd); 46330 var targetCopy = target.slice(start, end); 46331 46332 for (var i = 0; i < len; ++i) { 46333 if (thisCopy[i] !== targetCopy[i]) { 46334 x = thisCopy[i]; 46335 y = targetCopy[i]; 46336 break; 46337 } 46338 } 46339 46340 if (x < y) return -1; 46341 if (y < x) return 1; 46342 return 0; 46343 }; 46344 46345 // Finds either the first index of `val` in `buffer` at offset >= `byteOffset`, 46346 // OR the last index of `val` in `buffer` at offset <= `byteOffset`. 46347 // 46348 // Arguments: 46349 // - buffer - a Buffer to search 46350 // - val - a string, Buffer, or number 46351 // - byteOffset - an index into `buffer`; will be clamped to an int32 46352 // - encoding - an optional encoding, relevant is val is a string 46353 // - dir - true for indexOf, false for lastIndexOf 46354 function bidirectionalIndexOf(buffer, val, byteOffset, encoding, dir) { 46355 // Empty buffer means no match 46356 if (buffer.length === 0) return -1; 46357 46358 // Normalize byteOffset 46359 if (typeof byteOffset === 'string') { 46360 encoding = byteOffset; 46361 byteOffset = 0; 46362 } else if (byteOffset > 0x7fffffff) { 46363 byteOffset = 0x7fffffff; 46364 } else if (byteOffset < -0x80000000) { 46365 byteOffset = -0x80000000; 46366 } 46367 byteOffset = +byteOffset; // Coerce to Number. 46368 if (isNaN(byteOffset)) { 46369 // byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer 46370 byteOffset = dir ? 0 : buffer.length - 1; 46371 } 46372 46373 // Normalize byteOffset: negative offsets start from the end of the buffer 46374 if (byteOffset < 0) byteOffset = buffer.length + byteOffset; 46375 if (byteOffset >= buffer.length) { 46376 if (dir) return -1;else byteOffset = buffer.length - 1; 46377 } else if (byteOffset < 0) { 46378 if (dir) byteOffset = 0;else return -1; 46379 } 46380 46381 // Normalize val 46382 if (typeof val === 'string') { 46383 val = Buffer.from(val, encoding); 46384 } 46385 46386 // Finally, search either indexOf (if dir is true) or lastIndexOf 46387 if (Buffer.isBuffer(val)) { 46388 // Special case: looking for empty string/buffer always fails 46389 if (val.length === 0) { 46390 return -1; 46391 } 46392 return arrayIndexOf(buffer, val, byteOffset, encoding, dir); 46393 } else if (typeof val === 'number') { 46394 val = val & 0xFF; // Search for a byte value [0-255] 46395 if (Buffer.TYPED_ARRAY_SUPPORT && typeof Uint8Array.prototype.indexOf === 'function') { 46396 if (dir) { 46397 return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset); 46398 } else { 46399 return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset); 46400 } 46401 } 46402 return arrayIndexOf(buffer, [val], byteOffset, encoding, dir); 46403 } 46404 46405 throw new TypeError('val must be string, number or Buffer'); 46406 } 46407 46408 function arrayIndexOf(arr, val, byteOffset, encoding, dir) { 46409 var indexSize = 1; 46410 var arrLength = arr.length; 46411 var valLength = val.length; 46412 46413 if (encoding !== undefined) { 46414 encoding = String(encoding).toLowerCase(); 46415 if (encoding === 'ucs2' || encoding === 'ucs-2' || encoding === 'utf16le' || encoding === 'utf-16le') { 46416 if (arr.length < 2 || val.length < 2) { 46417 return -1; 46418 } 46419 indexSize = 2; 46420 arrLength /= 2; 46421 valLength /= 2; 46422 byteOffset /= 2; 46423 } 46424 } 46425 46426 function read(buf, i) { 46427 if (indexSize === 1) { 46428 return buf[i]; 46429 } else { 46430 return buf.readUInt16BE(i * indexSize); 46431 } 46432 } 46433 46434 var i; 46435 if (dir) { 46436 var foundIndex = -1; 46437 for (i = byteOffset; i < arrLength; i++) { 46438 if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) { 46439 if (foundIndex === -1) foundIndex = i; 46440 if (i - foundIndex + 1 === valLength) return foundIndex * indexSize; 46441 } else { 46442 if (foundIndex !== -1) i -= i - foundIndex; 46443 foundIndex = -1; 46444 } 46445 } 46446 } else { 46447 if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength; 46448 for (i = byteOffset; i >= 0; i--) { 46449 var found = true; 46450 for (var j = 0; j < valLength; j++) { 46451 if (read(arr, i + j) !== read(val, j)) { 46452 found = false; 46453 break; 46454 } 46455 } 46456 if (found) return i; 46457 } 46458 } 46459 46460 return -1; 46461 } 46462 46463 Buffer.prototype.includes = function includes(val, byteOffset, encoding) { 46464 return this.indexOf(val, byteOffset, encoding) !== -1; 46465 }; 46466 46467 Buffer.prototype.indexOf = function indexOf(val, byteOffset, encoding) { 46468 return bidirectionalIndexOf(this, val, byteOffset, encoding, true); 46469 }; 46470 46471 Buffer.prototype.lastIndexOf = function lastIndexOf(val, byteOffset, encoding) { 46472 return bidirectionalIndexOf(this, val, byteOffset, encoding, false); 46473 }; 46474 46475 function hexWrite(buf, string, offset, length) { 46476 offset = Number(offset) || 0; 46477 var remaining = buf.length - offset; 46478 if (!length) { 46479 length = remaining; 46480 } else { 46481 length = Number(length); 46482 if (length > remaining) { 46483 length = remaining; 46484 } 46485 } 46486 46487 // must be an even number of digits 46488 var strLen = string.length; 46489 if (strLen % 2 !== 0) throw new TypeError('Invalid hex string'); 46490 46491 if (length > strLen / 2) { 46492 length = strLen / 2; 46493 } 46494 for (var i = 0; i < length; ++i) { 46495 var parsed = parseInt(string.substr(i * 2, 2), 16); 46496 if (isNaN(parsed)) return i; 46497 buf[offset + i] = parsed; 46498 } 46499 return i; 46500 } 46501 46502 function utf8Write(buf, string, offset, length) { 46503 return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length); 46504 } 46505 46506 function asciiWrite(buf, string, offset, length) { 46507 return blitBuffer(asciiToBytes(string), buf, offset, length); 46508 } 46509 46510 function latin1Write(buf, string, offset, length) { 46511 return asciiWrite(buf, string, offset, length); 46512 } 46513 46514 function base64Write(buf, string, offset, length) { 46515 return blitBuffer(base64ToBytes(string), buf, offset, length); 46516 } 46517 46518 function ucs2Write(buf, string, offset, length) { 46519 return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length); 46520 } 46521 46522 Buffer.prototype.write = function write(string, offset, length, encoding) { 46523 // Buffer#write(string) 46524 if (offset === undefined) { 46525 encoding = 'utf8'; 46526 length = this.length; 46527 offset = 0; 46528 // Buffer#write(string, encoding) 46529 } else if (length === undefined && typeof offset === 'string') { 46530 encoding = offset; 46531 length = this.length; 46532 offset = 0; 46533 // Buffer#write(string, offset[, length][, encoding]) 46534 } else if (isFinite(offset)) { 46535 offset = offset | 0; 46536 if (isFinite(length)) { 46537 length = length | 0; 46538 if (encoding === undefined) encoding = 'utf8'; 46539 } else { 46540 encoding = length; 46541 length = undefined; 46542 } 46543 // legacy write(string, encoding, offset, length) - remove in v0.13 46544 } else { 46545 throw new Error('Buffer.write(string, encoding, offset[, length]) is no longer supported'); 46546 } 46547 46548 var remaining = this.length - offset; 46549 if (length === undefined || length > remaining) length = remaining; 46550 46551 if (string.length > 0 && (length < 0 || offset < 0) || offset > this.length) { 46552 throw new RangeError('Attempt to write outside buffer bounds'); 46553 } 46554 46555 if (!encoding) encoding = 'utf8'; 46556 46557 var loweredCase = false;
vendor: 3,421 bytes, lines 46558-46666
46558 for (;;) { 46559 switch (encoding) { 46560 case 'hex': 46561 return hexWrite(this, string, offset, length); 46562 46563 case 'utf8': 46564 case 'utf-8': 46565 return utf8Write(this, string, offset, length); 46566 46567 case 'ascii': 46568 return asciiWrite(this, string, offset, length); 46569 46570 case 'latin1': 46571 case 'binary': 46572 return latin1Write(this, string, offset, length); 46573 46574 case 'base64': 46575 // Warning: maxLength not taken into account in base64Write 46576 return base64Write(this, string, offset, length); 46577 46578 case 'ucs2': 46579 case 'ucs-2': 46580 case 'utf16le': 46581 case 'utf-16le': 46582 return ucs2Write(this, string, offset, length); 46583 46584 default: 46585 if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding); 46586 encoding = ('' + encoding).toLowerCase(); 46587 loweredCase = true; 46588 } 46589 } 46590 }; 46591 46592 Buffer.prototype.toJSON = function toJSON() { 46593 return { 46594 type: 'Buffer', 46595 data: Array.prototype.slice.call(this._arr || this, 0) 46596 }; 46597 }; 46598 46599 function base64Slice(buf, start, end) { 46600 if (start === 0 && end === buf.length) { 46601 return base64.fromByteArray(buf); 46602 } else { 46603 return base64.fromByteArray(buf.slice(start, end)); 46604 } 46605 } 46606 46607 function utf8Slice(buf, start, end) { 46608 end = Math.min(buf.length, end); 46609 var res = []; 46610 46611 var i = start; 46612 while (i < end) { 46613 var firstByte = buf[i]; 46614 var codePoint = null; 46615 var bytesPerSequence = firstByte > 0xEF ? 4 : firstByte > 0xDF ? 3 : firstByte > 0xBF ? 2 : 1; 46616 46617 if (i + bytesPerSequence <= end) { 46618 var secondByte, thirdByte, fourthByte, tempCodePoint; 46619 46620 switch (bytesPerSequence) { 46621 case 1: 46622 if (firstByte < 0x80) { 46623 codePoint = firstByte; 46624 } 46625 break; 46626 case 2: 46627 secondByte = buf[i + 1]; 46628 if ((secondByte & 0xC0) === 0x80) { 46629 tempCodePoint = (firstByte & 0x1F) << 0x6 | secondByte & 0x3F; 46630 if (tempCodePoint > 0x7F) { 46631 codePoint = tempCodePoint; 46632 } 46633 } 46634 break; 46635 case 3: 46636 secondByte = buf[i + 1]; 46637 thirdByte = buf[i + 2]; 46638 if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) { 46639 tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | thirdByte & 0x3F; 46640 if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) { 46641 codePoint = tempCodePoint; 46642 } 46643 } 46644 break; 46645 case 4: 46646 secondByte = buf[i + 1]; 46647 thirdByte = buf[i + 2]; 46648 fourthByte = buf[i + 3]; 46649 if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) { 46650 tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | fourthByte & 0x3F; 46651 if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) { 46652 codePoint = tempCodePoint; 46653 } 46654 } 46655 } 46656 } 46657 46658 if (codePoint === null) { 46659 // we did not generate a valid codePoint so insert a 46660 // replacement char (U+FFFD) and advance only 1 byte 46661 codePoint = 0xFFFD; 46662 bytesPerSequence = 1; 46663 } else if (codePoint > 0xFFFF) { 46664 // encode to utf16 (surrogate pair dance) 46665 codePoint -= 0x10000; 46666 res.push(codePoint >>>
vendor: 22,866 bytes, lines 46666-47444
46666 10 & 0x3FF | 0xD800); 46667 codePoint = 0xDC00 | codePoint & 0x3FF; 46668 } 46669 46670 res.push(codePoint); 46671 i += bytesPerSequence; 46672 } 46673 46674 return decodeCodePointsArray(res); 46675 } 46676 46677 // Based on http://stackoverflow.com/a/22747272/680742, the browser with 46678 // the lowest limit is Chrome, with 0x10000 args. 46679 // We go 1 magnitude less, for safety 46680 var MAX_ARGUMENTS_LENGTH = 0x1000; 46681 46682 function decodeCodePointsArray(codePoints) { 46683 var len = codePoints.length; 46684 if (len <= MAX_ARGUMENTS_LENGTH) { 46685 return String.fromCharCode.apply(String, codePoints); // avoid extra slice() 46686 } 46687 46688 // Decode in chunks to avoid "call stack size exceeded". 46689 var res = ''; 46690 var i = 0; 46691 while (i < len) { 46692 res += String.fromCharCode.apply(String, codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)); 46693 } 46694 return res; 46695 } 46696 46697 function asciiSlice(buf, start, end) { 46698 var ret = ''; 46699 end = Math.min(buf.length, end); 46700 46701 for (var i = start; i < end; ++i) { 46702 ret += String.fromCharCode(buf[i] & 0x7F); 46703 } 46704 return ret; 46705 } 46706 46707 function latin1Slice(buf, start, end) { 46708 var ret = ''; 46709 end = Math.min(buf.length, end); 46710 46711 for (var i = start; i < end; ++i) { 46712 ret += String.fromCharCode(buf[i]); 46713 } 46714 return ret; 46715 } 46716 46717 function hexSlice(buf, start, end) { 46718 var len = buf.length; 46719 46720 if (!start || start < 0) start = 0; 46721 if (!end || end < 0 || end > len) end = len; 46722 46723 var out = ''; 46724 for (var i = start; i < end; ++i) { 46725 out += toHex(buf[i]); 46726 } 46727 return out; 46728 } 46729 46730 function utf16leSlice(buf, start, end) { 46731 var bytes = buf.slice(start, end); 46732 var res = ''; 46733 for (var i = 0; i < bytes.length; i += 2) { 46734 res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256); 46735 } 46736 return res; 46737 } 46738 46739 Buffer.prototype.slice = function slice(start, end) { 46740 var len = this.length; 46741 start = ~~start; 46742 end = end === undefined ? len : ~~end; 46743 46744 if (start < 0) { 46745 start += len; 46746 if (start < 0) start = 0; 46747 } else if (start > len) { 46748 start = len; 46749 } 46750 46751 if (end < 0) { 46752 end += len; 46753 if (end < 0) end = 0; 46754 } else if (end > len) { 46755 end = len; 46756 } 46757 46758 if (end < start) end = start; 46759 46760 var newBuf; 46761 if (Buffer.TYPED_ARRAY_SUPPORT) { 46762 newBuf = this.subarray(start, end); 46763 newBuf.__proto__ = Buffer.prototype; 46764 } else { 46765 var sliceLen = end - start; 46766 newBuf = new Buffer(sliceLen, undefined); 46767 for (var i = 0; i < sliceLen; ++i) { 46768 newBuf[i] = this[i + start]; 46769 } 46770 } 46771 46772 return newBuf; 46773 }; 46774 46775 /* 46776 * Need to make sure that buffer isn't trying to write out of bounds. 46777 */ 46778 function checkOffset(offset, ext, length) { 46779 if (offset % 1 !== 0 || offset < 0) throw new RangeError('offset is not uint'); 46780 if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length'); 46781 } 46782 46783 Buffer.prototype.readUIntLE = function readUIntLE(offset, byteLength, noAssert) { 46784 offset = offset | 0; 46785 byteLength = byteLength | 0; 46786 if (!noAssert) checkOffset(offset, byteLength, this.length); 46787 46788 var val = this[offset]; 46789 var mul = 1; 46790 var i = 0; 46791 while (++i < byteLength && (mul *= 0x100)) { 46792 val += this[offset + i] * mul; 46793 } 46794 46795 return val; 46796 }; 46797 46798 Buffer.prototype.readUIntBE = function readUIntBE(offset, byteLength, noAssert) { 46799 offset = offset | 0; 46800 byteLength = byteLength | 0; 46801 if (!noAssert) { 46802 checkOffset(offset, byteLength, this.length); 46803 } 46804 46805 var val = this[offset + --byteLength]; 46806 var mul = 1; 46807 while (byteLength > 0 && (mul *= 0x100)) { 46808 val += this[offset + --byteLength] * mul; 46809 } 46810 46811 return val; 46812 }; 46813 46814 Buffer.prototype.readUInt8 = function readUInt8(offset, noAssert) { 46815 if (!noAssert) checkOffset(offset, 1, this.length); 46816 return this[offset]; 46817 }; 46818 46819 Buffer.prototype.readUInt16LE = function readUInt16LE(offset, noAssert) { 46820 if (!noAssert) checkOffset(offset, 2, this.length); 46821 return this[offset] | this[offset + 1] << 8; 46822 }; 46823 46824 Buffer.prototype.readUInt16BE = function readUInt16BE(offset, noAssert) { 46825 if (!noAssert) checkOffset(offset, 2, this.length); 46826 return this[offset] << 8 | this[offset + 1]; 46827 }; 46828 46829 Buffer.prototype.readUInt32LE = function readUInt32LE(offset, noAssert) { 46830 if (!noAssert) checkOffset(offset, 4, this.length); 46831 46832 return (this[offset] | this[offset + 1] << 8 | this[offset + 2] << 16) + this[offset + 3] * 0x1000000; 46833 }; 46834 46835 Buffer.prototype.readUInt32BE = function readUInt32BE(offset, noAssert) { 46836 if (!noAssert) checkOffset(offset, 4, this.length); 46837 46838 return this[offset] * 0x1000000 + (this[offset + 1] << 16 | this[offset + 2] << 8 | this[offset + 3]); 46839 }; 46840 46841 Buffer.prototype.readIntLE = function readIntLE(offset, byteLength, noAssert) { 46842 offset = offset | 0; 46843 byteLength = byteLength | 0; 46844 if (!noAssert) checkOffset(offset, byteLength, this.length); 46845 46846 var val = this[offset]; 46847 var mul = 1; 46848 var i = 0; 46849 while (++i < byteLength && (mul *= 0x100)) { 46850 val += this[offset + i] * mul; 46851 } 46852 mul *= 0x80; 46853 46854 if (val >= mul) val -= Math.pow(2, 8 * byteLength); 46855 46856 return val; 46857 }; 46858 46859 Buffer.prototype.readIntBE = function readIntBE(offset, byteLength, noAssert) { 46860 offset = offset | 0; 46861 byteLength = byteLength | 0; 46862 if (!noAssert) checkOffset(offset, byteLength, this.length); 46863 46864 var i = byteLength; 46865 var mul = 1; 46866 var val = this[offset + --i]; 46867 while (i > 0 && (mul *= 0x100)) { 46868 val += this[offset + --i] * mul; 46869 } 46870 mul *= 0x80; 46871 46872 if (val >= mul) val -= Math.pow(2, 8 * byteLength); 46873 46874 return val; 46875 }; 46876 46877 Buffer.prototype.readInt8 = function readInt8(offset, noAssert) { 46878 if (!noAssert) checkOffset(offset, 1, this.length); 46879 if (!(this[offset] & 0x80)) return this[offset]; 46880 return (0xff - this[offset] + 1) * -1; 46881 }; 46882 46883 Buffer.prototype.readInt16LE = function readInt16LE(offset, noAssert) { 46884 if (!noAssert) checkOffset(offset, 2, this.length); 46885 var val = this[offset] | this[offset + 1] << 8; 46886 return val & 0x8000 ? val | 0xFFFF0000 : val; 46887 }; 46888 46889 Buffer.prototype.readInt16BE = function readInt16BE(offset, noAssert) { 46890 if (!noAssert) checkOffset(offset, 2, this.length); 46891 var val = this[offset + 1] | this[offset] << 8; 46892 return val & 0x8000 ? val | 0xFFFF0000 : val; 46893 }; 46894 46895 Buffer.prototype.readInt32LE = function readInt32LE(offset, noAssert) { 46896 if (!noAssert) checkOffset(offset, 4, this.length); 46897 46898 return this[offset] | this[offset + 1] << 8 | this[offset + 2] << 16 | this[offset + 3] << 24; 46899 }; 46900 46901 Buffer.prototype.readInt32BE = function readInt32BE(offset, noAssert) { 46902 if (!noAssert) checkOffset(offset, 4, this.length); 46903 46904 return this[offset] << 24 | this[offset + 1] << 16 | this[offset + 2] << 8 | this[offset + 3]; 46905 }; 46906 46907 Buffer.prototype.readFloatLE = function readFloatLE(offset, noAssert) { 46908 if (!noAssert) checkOffset(offset, 4, this.length); 46909 return ieee754.read(this, offset, true, 23, 4); 46910 }; 46911 46912 Buffer.prototype.readFloatBE = function readFloatBE(offset, noAssert) { 46913 if (!noAssert) checkOffset(offset, 4, this.length); 46914 return ieee754.read(this, offset, false, 23, 4); 46915 }; 46916 46917 Buffer.prototype.readDoubleLE = function readDoubleLE(offset, noAssert) { 46918 if (!noAssert) checkOffset(offset, 8, this.length); 46919 return ieee754.read(this, offset, true, 52, 8); 46920 }; 46921 46922 Buffer.prototype.readDoubleBE = function readDoubleBE(offset, noAssert) { 46923 if (!noAssert) checkOffset(offset, 8, this.length); 46924 return ieee754.read(this, offset, false, 52, 8); 46925 }; 46926 46927 function checkInt(buf, value, offset, ext, max, min) { 46928 if (!Buffer.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance'); 46929 if (value > max || value < min) throw new RangeError('"value" argument is out of bounds'); 46930 if (offset + ext > buf.length) throw new RangeError('Index out of range'); 46931 } 46932 46933 Buffer.prototype.writeUIntLE = function writeUIntLE(value, offset, byteLength, noAssert) { 46934 value = +value; 46935 offset = offset | 0; 46936 byteLength = byteLength | 0; 46937 if (!noAssert) { 46938 var maxBytes = Math.pow(2, 8 * byteLength) - 1; 46939 checkInt(this, value, offset, byteLength, maxBytes, 0); 46940 } 46941 46942 var mul = 1; 46943 var i = 0; 46944 this[offset] = value & 0xFF; 46945 while (++i < byteLength && (mul *= 0x100)) { 46946 this[offset + i] = value / mul & 0xFF; 46947 } 46948 46949 return offset + byteLength; 46950 }; 46951 46952 Buffer.prototype.writeUIntBE = function writeUIntBE(value, offset, byteLength, noAssert) { 46953 value = +value; 46954 offset = offset | 0; 46955 byteLength = byteLength | 0; 46956 if (!noAssert) { 46957 var maxBytes = Math.pow(2, 8 * byteLength) - 1; 46958 checkInt(this, value, offset, byteLength, maxBytes, 0); 46959 } 46960 46961 var i = byteLength - 1; 46962 var mul = 1; 46963 this[offset + i] = value & 0xFF; 46964 while (--i >= 0 && (mul *= 0x100)) { 46965 this[offset + i] = value / mul & 0xFF; 46966 } 46967 46968 return offset + byteLength; 46969 }; 46970 46971 Buffer.prototype.writeUInt8 = function writeUInt8(value, offset, noAssert) { 46972 value = +value; 46973 offset = offset | 0; 46974 if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0); 46975 if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value); 46976 this[offset] = value & 0xff; 46977 return offset + 1; 46978 }; 46979 46980 function objectWriteUInt16(buf, value, offset, littleEndian) { 46981 if (value < 0) value = 0xffff + value + 1; 46982 for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) { 46983 buf[offset + i] = (value & 0xff << 8 * (littleEndian ? i : 1 - i)) >>> (littleEndian ? i : 1 - i) * 8; 46984 } 46985 } 46986 46987 Buffer.prototype.writeUInt16LE = function writeUInt16LE(value, offset, noAssert) { 46988 value = +value; 46989 offset = offset | 0; 46990 if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0); 46991 if (Buffer.TYPED_ARRAY_SUPPORT) { 46992 this[offset] = value & 0xff; 46993 this[offset + 1] = value >>> 8; 46994 } else { 46995 objectWriteUInt16(this, value, offset, true); 46996 } 46997 return offset + 2; 46998 }; 46999 47000 Buffer.prototype.writeUInt16BE = function writeUInt16BE(value, offset, noAssert) { 47001 value = +value; 47002 offset = offset | 0; 47003 if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0); 47004 if (Buffer.TYPED_ARRAY_SUPPORT) { 47005 this[offset] = value >>> 8; 47006 this[offset + 1] = value & 0xff; 47007 } else { 47008 objectWriteUInt16(this, value, offset, false); 47009 } 47010 return offset + 2; 47011 }; 47012 47013 function objectWriteUInt32(buf, value, offset, littleEndian) { 47014 if (value < 0) value = 0xffffffff + value + 1; 47015 for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) { 47016 buf[offset + i] = value >>> (littleEndian ? i : 3 - i) * 8 & 0xff; 47017 } 47018 } 47019 47020 Buffer.prototype.writeUInt32LE = function writeUInt32LE(value, offset, noAssert) { 47021 value = +value; 47022 offset = offset | 0; 47023 if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0); 47024 if (Buffer.TYPED_ARRAY_SUPPORT) { 47025 this[offset + 3] = value >>> 24; 47026 this[offset + 2] = value >>> 16; 47027 this[offset + 1] = value >>> 8; 47028 this[offset] = value & 0xff; 47029 } else { 47030 objectWriteUInt32(this, value, offset, true); 47031 } 47032 return offset + 4; 47033 }; 47034 47035 Buffer.prototype.writeUInt32BE = function writeUInt32BE(value, offset, noAssert) { 47036 value = +value; 47037 offset = offset | 0; 47038 if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0); 47039 if (Buffer.TYPED_ARRAY_SUPPORT) { 47040 this[offset] = value >>> 24; 47041 this[offset + 1] = value >>> 16; 47042 this[offset + 2] = value >>> 8; 47043 this[offset + 3] = value & 0xff; 47044 } else { 47045 objectWriteUInt32(this, value, offset, false); 47046 } 47047 return offset + 4; 47048 }; 47049 47050 Buffer.prototype.writeIntLE = function writeIntLE(value, offset, byteLength, noAssert) { 47051 value = +value; 47052 offset = offset | 0; 47053 if (!noAssert) { 47054 var limit = Math.pow(2, 8 * byteLength - 1); 47055 47056 checkInt(this, value, offset, byteLength, limit - 1, -limit); 47057 } 47058 47059 var i = 0; 47060 var mul = 1; 47061 var sub = 0; 47062 this[offset] = value & 0xFF; 47063 while (++i < byteLength && (mul *= 0x100)) { 47064 if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) { 47065 sub = 1; 47066 } 47067 this[offset + i] = (value / mul >> 0) - sub & 0xFF; 47068 } 47069 47070 return offset + byteLength; 47071 }; 47072 47073 Buffer.prototype.writeIntBE = function writeIntBE(value, offset, byteLength, noAssert) { 47074 value = +value; 47075 offset = offset | 0; 47076 if (!noAssert) { 47077 var limit = Math.pow(2, 8 * byteLength - 1); 47078 47079 checkInt(this, value, offset, byteLength, limit - 1, -limit); 47080 } 47081 47082 var i = byteLength - 1; 47083 var mul = 1; 47084 var sub = 0; 47085 this[offset + i] = value & 0xFF; 47086 while (--i >= 0 && (mul *= 0x100)) { 47087 if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) { 47088 sub = 1; 47089 } 47090 this[offset + i] = (value / mul >> 0) - sub & 0xFF; 47091 } 47092 47093 return offset + byteLength; 47094 }; 47095 47096 Buffer.prototype.writeInt8 = function writeInt8(value, offset, noAssert) { 47097 value = +value; 47098 offset = offset | 0; 47099 if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80); 47100 if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value); 47101 if (value < 0) value = 0xff + value + 1; 47102 this[offset] = value & 0xff; 47103 return offset + 1; 47104 }; 47105 47106 Buffer.prototype.writeInt16LE = function writeInt16LE(value, offset, noAssert) { 47107 value = +value; 47108 offset = offset | 0; 47109 if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000); 47110 if (Buffer.TYPED_ARRAY_SUPPORT) { 47111 this[offset] = value & 0xff; 47112 this[offset + 1] = value >>> 8; 47113 } else { 47114 objectWriteUInt16(this, value, offset, true); 47115 } 47116 return offset + 2; 47117 }; 47118 47119 Buffer.prototype.writeInt16BE = function writeInt16BE(value, offset, noAssert) { 47120 value = +value; 47121 offset = offset | 0; 47122 if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000); 47123 if (Buffer.TYPED_ARRAY_SUPPORT) { 47124 this[offset] = value >>> 8; 47125 this[offset + 1] = value & 0xff; 47126 } else { 47127 objectWriteUInt16(this, value, offset, false); 47128 } 47129 return offset + 2; 47130 }; 47131 47132 Buffer.prototype.writeInt32LE = function writeInt32LE(value, offset, noAssert) { 47133 value = +value; 47134 offset = offset | 0; 47135 if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000); 47136 if (Buffer.TYPED_ARRAY_SUPPORT) { 47137 this[offset] = value & 0xff; 47138 this[offset + 1] = value >>> 8; 47139 this[offset + 2] = value >>> 16; 47140 this[offset + 3] = value >>> 24; 47141 } else { 47142 objectWriteUInt32(this, value, offset, true); 47143 } 47144 return offset + 4; 47145 }; 47146 47147 Buffer.prototype.writeInt32BE = function writeInt32BE(value, offset, noAssert) { 47148 value = +value; 47149 offset = offset | 0; 47150 if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000); 47151 if (value < 0) value = 0xffffffff + value + 1; 47152 if (Buffer.TYPED_ARRAY_SUPPORT) { 47153 this[offset] = value >>> 24; 47154 this[offset + 1] = value >>> 16; 47155 this[offset + 2] = value >>> 8; 47156 this[offset + 3] = value & 0xff; 47157 } else { 47158 objectWriteUInt32(this, value, offset, false); 47159 } 47160 return offset + 4; 47161 }; 47162 47163 function checkIEEE754(buf, value, offset, ext, max, min) { 47164 if (offset + ext > buf.length) throw new RangeError('Index out of range'); 47165 if (offset < 0) throw new RangeError('Index out of range'); 47166 } 47167 47168 function writeFloat(buf, value, offset, littleEndian, noAssert) { 47169 if (!noAssert) { 47170 checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38); 47171 } 47172 ieee754.write(buf, value, offset, littleEndian, 23, 4); 47173 return offset + 4; 47174 } 47175 47176 Buffer.prototype.writeFloatLE = function writeFloatLE(value, offset, noAssert) { 47177 return writeFloat(this, value, offset, true, noAssert); 47178 }; 47179 47180 Buffer.prototype.writeFloatBE = function writeFloatBE(value, offset, noAssert) { 47181 return writeFloat(this, value, offset, false, noAssert); 47182 }; 47183 47184 function writeDouble(buf, value, offset, littleEndian, noAssert) { 47185 if (!noAssert) { 47186 checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308); 47187 } 47188 ieee754.write(buf, value, offset, littleEndian, 52, 8); 47189 return offset + 8; 47190 } 47191 47192 Buffer.prototype.writeDoubleLE = function writeDoubleLE(value, offset, noAssert) { 47193 return writeDouble(this, value, offset, true, noAssert); 47194 }; 47195 47196 Buffer.prototype.writeDoubleBE = function writeDoubleBE(value, offset, noAssert) { 47197 return writeDouble(this, value, offset, false, noAssert); 47198 }; 47199 47200 // copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length) 47201 Buffer.prototype.copy = function copy(target, targetStart, start, end) { 47202 if (!start) start = 0; 47203 if (!end && end !== 0) end = this.length; 47204 if (targetStart >= target.length) targetStart = target.length; 47205 if (!targetStart) targetStart = 0; 47206 if (end > 0 && end < start) end = start; 47207 47208 // Copy 0 bytes; we're done 47209 if (end === start) return 0; 47210 if (target.length === 0 || this.length === 0) return 0; 47211 47212 // Fatal error conditions 47213 if (targetStart < 0) { 47214 throw new RangeError('targetStart out of bounds'); 47215 } 47216 if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds'); 47217 if (end < 0) throw new RangeError('sourceEnd out of bounds'); 47218 47219 // Are we oob? 47220 if (end > this.length) end = this.length; 47221 if (target.length - targetStart < end - start) { 47222 end = target.length - targetStart + start; 47223 } 47224 47225 var len = end - start; 47226 var i; 47227 47228 if (this === target && start < targetStart && targetStart < end) { 47229 // descending copy from end 47230 for (i = len - 1; i >= 0; --i) { 47231 target[i + targetStart] = this[i + start]; 47232 } 47233 } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) { 47234 // ascending copy from start 47235 for (i = 0; i < len; ++i) { 47236 target[i + targetStart] = this[i + start]; 47237 } 47238 } else { 47239 Uint8Array.prototype.set.call(target, this.subarray(start, start + len), targetStart); 47240 } 47241 47242 return len; 47243 }; 47244 47245 // Usage: 47246 // buffer.fill(number[, offset[, end]]) 47247 // buffer.fill(buffer[, offset[, end]]) 47248 // buffer.fill(string[, offset[, end]][, encoding]) 47249 Buffer.prototype.fill = function fill(val, start, end, encoding) { 47250 // Handle string cases: 47251 if (typeof val === 'string') { 47252 if (typeof start === 'string') { 47253 encoding = start; 47254 start = 0; 47255 end = this.length; 47256 } else if (typeof end === 'string') { 47257 encoding = end; 47258 end = this.length; 47259 } 47260 if (val.length === 1) { 47261 var code = val.charCodeAt(0); 47262 if (code < 256) { 47263 val = code; 47264 } 47265 } 47266 if (encoding !== undefined && typeof encoding !== 'string') { 47267 throw new TypeError('encoding must be a string'); 47268 } 47269 if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) { 47270 throw new TypeError('Unknown encoding: ' + encoding); 47271 } 47272 } else if (typeof val === 'number') { 47273 val = val & 255; 47274 } 47275 47276 // Invalid ranges are not set to a default, so can range check early. 47277 if (start < 0 || this.length < start || this.length < end) { 47278 throw new RangeError('Out of range index'); 47279 } 47280 47281 if (end <= start) { 47282 return this; 47283 } 47284 47285 start = start >>> 0; 47286 end = end === undefined ? this.length : end >>> 0; 47287 47288 if (!val) val = 0; 47289 47290 var i; 47291 if (typeof val === 'number') { 47292 for (i = start; i < end; ++i) { 47293 this[i] = val; 47294 } 47295 } else { 47296 var bytes = Buffer.isBuffer(val) ? val : utf8ToBytes(new Buffer(val, encoding).toString()); 47297 var len = bytes.length; 47298 for (i = 0; i < end - start; ++i) { 47299 this[i + start] = bytes[i % len]; 47300 } 47301 } 47302 47303 return this; 47304 }; 47305 47306 // HELPER FUNCTIONS 47307 // ================ 47308 47309 var INVALID_BASE64_RE = /[^+\/0-9A-Za-z-_]/g; 47310 47311 function base64clean(str) { 47312 // Node strips out invalid characters like \n and \t from the string, base64-js does not 47313 str = stringtrim(str).replace(INVALID_BASE64_RE, ''); 47314 // Node converts strings with length < 2 to '' 47315 if (str.length < 2) return ''; 47316 // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not 47317 while (str.length % 4 !== 0) { 47318 str = str + '='; 47319 } 47320 return str; 47321 } 47322 47323 function stringtrim(str) { 47324 if (str.trim) return str.trim(); 47325 return str.replace(/^\s+|\s+$/g, ''); 47326 } 47327 47328 function toHex(n) { 47329 if (n < 16) return '0' + n.toString(16); 47330 return n.toString(16); 47331 } 47332 47333 function utf8ToBytes(string, units) { 47334 units = units || Infinity; 47335 var codePoint; 47336 var length = string.length; 47337 var leadSurrogate = null; 47338 var bytes = []; 47339 47340 for (var i = 0; i < length; ++i) { 47341 codePoint = string.charCodeAt(i); 47342 47343 // is surrogate component 47344 if (codePoint > 0xD7FF && codePoint < 0xE000) { 47345 // last char was a lead 47346 if (!leadSurrogate) { 47347 // no lead yet 47348 if (codePoint > 0xDBFF) { 47349 // unexpected trail 47350 if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD); 47351 continue; 47352 } else if (i + 1 === length) { 47353 // unpaired lead 47354 if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD); 47355 continue; 47356 } 47357 47358 // valid lead 47359 leadSurrogate = codePoint; 47360 47361 continue; 47362 } 47363 47364 // 2 leads in a row 47365 if (codePoint < 0xDC00) { 47366 if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD); 47367 leadSurrogate = codePoint; 47368 continue; 47369 } 47370 47371 // valid surrogate pair 47372 codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000; 47373 } else if (leadSurrogate) { 47374 // valid bmp char, but last char was a lead 47375 if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD); 47376 } 47377 47378 leadSurrogate = null; 47379 47380 // encode utf8 47381 if (codePoint < 0x80) { 47382 if ((units -= 1) < 0) break; 47383 bytes.push(codePoint); 47384 } else if (codePoint < 0x800) { 47385 if ((units -= 2) < 0) break; 47386 bytes.push(codePoint >> 0x6 | 0xC0, codePoint & 0x3F | 0x80); 47387 } else if (codePoint < 0x10000) { 47388 if ((units -= 3) < 0) break; 47389 bytes.push(codePoint >> 0xC | 0xE0, codePoint >> 0x6 & 0x3F | 0x80, codePoint & 0x3F | 0x80); 47390 } else if (codePoint < 0x110000) { 47391 if ((units -= 4) < 0) break; 47392 bytes.push(codePoint >> 0x12 | 0xF0, codePoint >> 0xC & 0x3F | 0x80, codePoint >> 0x6 & 0x3F | 0x80, codePoint & 0x3F | 0x80); 47393 } else { 47394 throw new Error('Invalid code point'); 47395 } 47396 } 47397 47398 return bytes; 47399 } 47400 47401 function asciiToBytes(str) { 47402 var byteArray = []; 47403 for (var i = 0; i < str.length; ++i) { 47404 // Node's code seems to be doing this and not & 0x7F.. 47405 byteArray.push(str.charCodeAt(i) & 0xFF); 47406 } 47407 return byteArray; 47408 } 47409 47410 function utf16leToBytes(str, units) { 47411 var c, hi, lo; 47412 var byteArray = []; 47413 for (var i = 0; i < str.length; ++i) { 47414 if ((units -= 2) < 0) break; 47415 47416 c = str.charCodeAt(i); 47417 hi = c >> 8; 47418 lo = c % 256; 47419 byteArray.push(lo); 47420 byteArray.push(hi); 47421 } 47422 47423 return byteArray; 47424 } 47425 47426 function base64ToBytes(str) { 47427 return base64.toByteArray(base64clean(str)); 47428 } 47429 47430 function blitBuffer(src, dst, offset, length) { 47431 for (var i = 0; i < length; ++i) { 47432 if (i + offset >= dst.length || i >= src.length) break; 47433 dst[i + offset] = src[i]; 47434 } 47435 return i; 47436 } 47437 47438 function isnan(val) { 47439 return val !== val; // eslint-disable-line no-self-compare 47440 } 47441 /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()))) 47442 47443/***/ }, 47444/* 394 */
47445/***/ function(module, exports) { 47446 47447 'use strict'; 47448 47449 var toString = {}.toString; 47450 47451 module.exports = Array.isArray || function (arr) { 47452 return toString.call(arr) == '[object Array]'; 47453 }; 47454 47455/***/ }, 47456/* 395 */ 47457/***/ function(module, exports, __webpack_require__) { 47458 47459 /* WEBPACK VAR INJECTION */(function(process) {'use strict'; 47460 47461 var escapeStringRegexp = __webpack_require__(449); 47462 var ansiStyles = __webpack_require__(286); 47463 var stripAnsi = __webpack_require__(610); 47464 var hasAnsi = __webpack_require__(453); 47465 var supportsColor = __webpack_require__(611); 47466 var defineProps = Object.defineProperties; 47467 var isSimpleWindowsTerm = process.platform === 'win32' && !/^xterm/i.test(process.env.TERM); 47468 47469 function Chalk(options) { 47470 // detect mode if not set manually 47471 this.enabled = !options || options.enabled === undefined ? supportsColor : options.enabled; 47472 } 47473 47474 // use bright blue on Windows as the normal blue color is illegible 47475 if (isSimpleWindowsTerm) { 47476 ansiStyles.blue.open = '\x1B[94m'; 47477 } 47478 47479 var styles = function () { 47480 var ret = {}; 47481 47482 Object.keys(ansiStyles).forEach(function (key) { 47483 ansiStyles[key].closeRe = new RegExp(escapeStringRegexp(ansiStyles[key].close), 'g'); 47484 47485 ret[key] = { 47486 get: function get() { 47487 return build.call(this, this._styles.concat(key)); 47488 } 47489 }; 47490 }); 47491 47492 return ret; 47493 }(); 47494 47495 var proto = defineProps(function chalk() {}, styles); 47496 47497 function build(_styles) { 47498 var builder = function builder() { 47499 return applyStyle.apply(builder, arguments); 47500 }; 47501 47502 builder._styles = _styles; 47503 builder.enabled = this.enabled; 47504 // __proto__ is used because we must return a function, but there is 47505 // no way to create a function with a different prototype. 47506 /* eslint-disable no-proto */ 47507 builder.__proto__ = proto; 47508 47509 return builder; 47510 } 47511 47512 function applyStyle() { 47513 // support varags, but simply cast to string in case there's only one arg 47514 var args = arguments; 47515 var argsLen = args.length; 47516 var str = argsLen !== 0 && String(arguments[0]); 47517 47518 if (argsLen > 1) { 47519 // don't slice `arguments`, it prevents v8 optimizations 47520 for (var a = 1; a < argsLen; a++) { 47521 str += ' ' + args[a]; 47522 } 47523 } 47524 47525 if (!this.enabled || !str) { 47526 return str; 47527 } 47528 47529 var nestedStyles = this._styles; 47530 var i = nestedStyles.length; 47531 47532 // Turns out that on Windows dimmed gray text becomes invisible in cmd.exe, 47533 // see https://github.com/chalk/chalk/issues/58 47534 // If we're on Windows and we're dealing with a gray color, temporarily make 'dim' a noop. 47535 var originalDim = ansiStyles.dim.open; 47536 if (isSimpleWindowsTerm && (nestedStyles.indexOf('gray') !== -1 || nestedStyles.indexOf('grey') !== -1)) { 47537 ansiStyles.dim.open = ''; 47538 } 47539 47540 while (i--) { 47541 var code = ansiStyles[nestedStyles[i]]; 47542 47543 // Replace any instances already present with a re-opening code 47544 // otherwise only the part of the string until said closing code 47545 // will be colored, and the rest will simply be 'plain'. 47546 str = code.open + str.replace(code.closeRe, code.open) + code.close; 47547 } 47548 47549 // Reset the original 'dim' if we changed it to work around the Windows dimmed gray issue. 47550 ansiStyles.dim.open = originalDim; 47551 47552 return str; 47553 } 47554 47555 function init() { 47556 var ret = {}; 47557 47558 Object.keys(styles).forEach(function (name) { 47559 ret[name] = { 47560 get: function get() { 47561 return build.call(this, [name]); 47562 } 47563 }; 47564 }); 47565 47566 return ret; 47567 } 47568 47569 defineProps(Chalk.prototype, init()); 47570 47571 module.exports = new Chalk(); 47572 module.exports.styles = ansiStyles; 47573 module.exports.hasColor = hasAnsi; 47574 module.exports.stripColor = stripAnsi; 47575 module.exports.supportsColor = supportsColor; 47576 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(9))) 47577 47578/***/ }, 47579/* 396 */ 47580/***/ function(module, exports) { 47581 47582 'use strict'; 47583 47584 module.exports = function (xs, fn) { 47585 var res = []; 47586 for (var i = 0; i < xs.length; i++) { 47587 var x = fn(xs[i], i); 47588 if (isArray(x)) res.push.apply(res, x);else res.push(x); 47589 } 47590 return res; 47591 }; 47592 47593 var isArray = Array.isArray || function (xs) { 47594 return Object.prototype.toString.call(xs) === '[object Array]'; 47595 }; 47596 47597/***/ }, 47598/* 397 */ 47599/***/ function(module, exports, __webpack_require__) { 47600 47601 /* WEBPACK VAR INJECTION */(function(Buffer) {'use strict'; 47602 47603 var fs = __webpack_require__(113); 47604 var path = __webpack_require__(17); 47605 47606 var commentRx = /^\s*\/(?:\/|\*)[@#]\s+sourceMappingURL=data:(?:application|text)\/json;(?:charset[:=]\S+?;)?base64,(?:.*)$/mg; 47607 var mapFileCommentRx = 47608 //Example (Extra space between slashes added to solve Safari bug. Exclude space in production): 47609 // / /# sourceMappingURL=foo.js.map /*# sourceMappingURL=foo.js.map */ 47610 /(?:\/\/[@#][ \t]+sourceMappingURL=([^\s'"]+?)[ \t]*$)|(?:\/\*[@#][ \t]+sourceMappingURL=([^\*]+?)[ \t]*(?:\*\/){1}[ \t]*$)/mg; 47611 47612 function decodeBase64(base64) { 47613 return new Buffer(base64, 'base64').toString(); 47614 } 47615 47616 function stripComment(sm) { 47617 return sm.split(',').pop(); 47618 } 47619 47620 function readFromFileMap(sm, dir) { 47621 // NOTE: this will only work on the server since it attempts to read the map file 47622 47623 mapFileCommentRx.lastIndex = 0; 47624 var r = mapFileCommentRx.exec(sm); 47625 47626 // for some odd reason //# .. captures in 1 and /* .. */ in 2 47627 var filename = r[1] || r[2]; 47628 var filepath = path.resolve(dir, filename); 47629 47630 try { 47631 return fs.readFileSync(filepath, 'utf8'); 47632 } catch (e) { 47633 throw new Error('An error occurred while trying to read the map file at ' + filepath + '\n' + e); 47634 } 47635 } 47636 47637 function Converter(sm, opts) { 47638 opts = opts || {}; 47639 47640 if (opts.isFileComment) sm = readFromFileMap(sm, opts.commentFileDir); 47641 if (opts.hasComment) sm = stripComment(sm); 47642 if (opts.isEncoded) sm = decodeBase64(sm); 47643 if (opts.isJSON || opts.isEncoded) sm = JSON.parse(sm); 47644 47645 this.sourcemap = sm; 47646 } 47647 47648 Converter.prototype.toJSON = function (space) { 47649 return JSON.stringify(this.sourcemap, null, space); 47650 }; 47651 47652 Converter.prototype.toBase64 = function () { 47653 var json = this.toJSON(); 47654 return new Buffer(json).toString('base64'); 47655 }; 47656 47657 Converter.prototype.toComment = function (options) { 47658 var base64 = this.toBase64(); 47659 var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64; 47660 return options && options.multiline ? '/*# ' + data + ' */' : '//# ' + data; 47661 }; 47662 47663 // returns copy instead of original 47664 Converter.prototype.toObject = function () { 47665 return JSON.parse(this.toJSON()); 47666 }; 47667 47668 Converter.prototype.addProperty = function (key, value) { 47669 if (this.sourcemap.hasOwnProperty(key)) throw new Error('property %s already exists on the sourcemap, use set property instead'); 47670 return this.setProperty(key, value); 47671 }; 47672 47673 Converter.prototype.setProperty = function (key, value) { 47674 this.sourcemap[key] = value; 47675 return this; 47676 }; 47677 47678 Converter.prototype.getProperty = function (key) { 47679 return this.sourcemap[key]; 47680 }; 47681 47682 exports.fromObject = function (obj) { 47683 return new Converter(obj); 47684 }; 47685 47686 exports.fromJSON = function (json) { 47687 return new Converter(json, { isJSON: true }); 47688 }; 47689 47690 exports.fromBase64 = function (base64) { 47691 return new Converter(base64, { isEncoded: true }); 47692 }; 47693 47694 exports.fromComment = function (comment) { 47695 comment = comment.replace(/^\/\*/g, '//').replace(/\*\/$/g, ''); 47696 47697 return new Converter(comment, { isEncoded: true, hasComment: true }); 47698 }; 47699
47700 exports.fromMapFileComment = function (comment, dir) { 47701 return new Converter(comment, { commentFileDir: dir, isFileComment: true, isJSON: true }); 47702 }; 47703 47704 // Finds last sourcemap comment in file or returns null if none was found 47705 exports.fromSource = function (content) { 47706 var m = content.match(commentRx); 47707 return m ? exports.fromComment(m.pop()) : null; 47708 }; 47709 47710 // Finds last sourcemap comment in file or returns null if none was found 47711 exports.fromMapFileSource = function (content, dir) { 47712 var m = content.match(mapFileCommentRx); 47713 return m ? exports.fromMapFileComment(m.pop(), dir) : null; 47714 }; 47715 47716 exports.removeComments = function (src) { 47717 return src.replace(commentRx, ''); 47718 }; 47719 47720 exports.removeMapFileComments = function (src) { 47721 return src.replace(mapFileCommentRx, ''); 47722 }; 47723 47724 exports.generateMapFileComment = function (file, options) { 47725 var data = 'sourceMappingURL=' + file; 47726 return options && options.multiline ? '/*# ' + data + ' */' : '//# ' + data; 47727 }; 47728 47729 Object.defineProperty(exports, 'commentRegex', { 47730 get: function getCommentRegex() { 47731 return commentRx; 47732 } 47733 }); 47734 47735 Object.defineProperty(exports, 'mapFileCommentRegex', { 47736 get: function getMapFileCommentRegex() { 47737 return mapFileCommentRx; 47738 } 47739 }); 47740 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(393).Buffer)) 47741 47742/***/ }, 47743/* 398 */ 47744/***/ function(module, exports, __webpack_require__) { 47745 47746 'use strict'; 47747 47748 __webpack_require__(57); 47749 __webpack_require__(152); 47750 module.exports = __webpack_require__(434); 47751 47752/***/ }, 47753/* 399 */ 47754/***/ function(module, exports, __webpack_require__) { 47755 47756 'use strict'; 47757 47758 var core = __webpack_require__(5), 47759 $JSON = core.JSON || (core.JSON = { stringify: JSON.stringify }); 47760 module.exports = function stringify(it) { 47761 // eslint-disable-line no-unused-vars 47762 return $JSON.stringify.apply($JSON, arguments); 47763 }; 47764 47765/***/ }, 47766/* 400 */ 47767/***/ function(module, exports, __webpack_require__) { 47768 47769 'use strict'; 47770 47771 __webpack_require__(95); 47772 __webpack_require__(152); 47773 __webpack_require__(57); 47774 __webpack_require__(436); 47775 __webpack_require__(444); 47776 module.exports = __webpack_require__(5).Map; 47777 47778/***/ }, 47779/* 401 */ 47780/***/ function(module, exports, __webpack_require__) { 47781 47782 'use strict'; 47783 47784 __webpack_require__(437); 47785 module.exports = 0x1fffffffffffff; 47786 47787/***/ }, 47788/* 402 */ 47789/***/ function(module, exports, __webpack_require__) { 47790 47791 'use strict'; 47792 47793 __webpack_require__(438); 47794 module.exports = __webpack_require__(5).Object.assign; 47795 47796/***/ }, 47797/* 403 */ 47798/***/ function(module, exports, __webpack_require__) { 47799 47800 'use strict'; 47801 47802 __webpack_require__(439); 47803 var $Object = __webpack_require__(5).Object; 47804 module.exports = function create(P, D) { 47805 return $Object.create(P, D); 47806 }; 47807 47808/***/ }, 47809/* 404 */ 47810/***/ function(module, exports, __webpack_require__) { 47811 47812 'use strict'; 47813 47814 __webpack_require__(153); 47815 module.exports = __webpack_require__(5).Object.getOwnPropertySymbols; 47816 47817/***/ }, 47818/* 405 */ 47819/***/ function(module, exports, __webpack_require__) { 47820 47821 'use strict'; 47822 47823 __webpack_require__(440); 47824 module.exports = __webpack_require__(5).Object.keys; 47825 47826/***/ }, 47827/* 406 */ 47828/***/ function(module, exports, __webpack_require__) { 47829 47830 'use strict'; 47831 47832 __webpack_require__(441); 47833 module.exports = __webpack_require__(5).Object.setPrototypeOf; 47834 47835/***/ }, 47836/* 407 */ 47837/***/ function(module, exports, __webpack_require__) { 47838 47839 'use strict'; 47840 47841 __webpack_require__(153); 47842 module.exports = __webpack_require__(5).Symbol['for']; 47843 47844/***/ }, 47845/* 408 */ 47846/***/ function(module, exports, __webpack_require__) { 47847 47848 'use strict'; 47849 47850 __webpack_require__(153); 47851 __webpack_require__(95); 47852 __webpack_require__(445); 47853 __webpack_require__(446); 47854 module.exports = __webpack_require__(5).Symbol; 47855 47856/***/ }, 47857/* 409 */ 47858/***/ function(module, exports, __webpack_require__) { 47859 47860 'use strict'; 47861 47862 __webpack_require__(152); 47863 __webpack_require__(57); 47864 module.exports = __webpack_require__(151).f('iterator'); 47865 47866/***/ }, 47867/* 410 */ 47868/***/ function(module, exports, __webpack_require__) { 47869 47870 'use strict'; 47871 47872 __webpack_require__(95); 47873 __webpack_require__(57); 47874 __webpack_require__(442); 47875 module.exports = __webpack_require__(5).WeakMap; 47876 47877/***/ }, 47878/* 411 */ 47879/***/ function(module, exports, __webpack_require__) { 47880 47881 'use strict'; 47882 47883 __webpack_require__(95); 47884 __webpack_require__(57); 47885 __webpack_require__(443); 47886 module.exports = __webpack_require__(5).WeakSet; 47887 47888/***/ }, 47889/* 412 */
47890/***/ function(module, exports) { 47891 47892 'use strict'; 47893 47894 module.exports = function (it) { 47895 if (typeof it != 'function') throw TypeError(it + ' is not a function!'); 47896 return it; 47897 }; 47898 47899/***/ }, 47900/* 413 */ 47901/***/ function(module, exports) { 47902 47903 "use strict"; 47904 47905 module.exports = function () {/* empty */}; 47906 47907/***/ }, 47908/* 414 */ 47909/***/ function(module, exports, __webpack_require__) { 47910 47911 'use strict'; 47912 47913 var forOf = __webpack_require__(88); 47914 47915 module.exports = function (iter, ITERATOR) { 47916 var result = []; 47917 forOf(iter, false, result.push, result, ITERATOR); 47918 return result; 47919 }; 47920 47921/***/ }, 47922/* 415 */ 47923/***/ function(module, exports, __webpack_require__) { 47924 47925 'use strict'; 47926 47927 // false -> Array#indexOf 47928 // true -> Array#includes 47929 var toIObject = __webpack_require__(37), 47930 toLength = __webpack_require__(148), 47931 toIndex = __webpack_require__(433); 47932 module.exports = function (IS_INCLUDES) { 47933 return function ($this, el, fromIndex) { 47934 var O = toIObject($this), 47935 length = toLength(O.length), 47936 index = toIndex(fromIndex, length), 47937 value; 47938 // Array#includes uses SameValueZero equality algorithm 47939 if (IS_INCLUDES && el != el) while (length > index) { 47940 value = O[index++]; 47941 if (value != value) return true; 47942 // Array#toIndex ignores holes, Array#includes - not 47943 } else for (; length > index; index++) { 47944 if (IS_INCLUDES || index in O) { 47945 if (O[index] === el) return IS_INCLUDES || index || 0; 47946 } 47947 }return !IS_INCLUDES && -1; 47948 }; 47949 }; 47950 47951/***/ }, 47952/* 416 */ 47953/***/ function(module, exports, __webpack_require__) { 47954 47955 'use strict'; 47956 47957 var isObject = __webpack_require__(22), 47958 isArray = __webpack_require__(228), 47959 SPECIES = __webpack_require__(12)('species'); 47960 47961 module.exports = function (original) { 47962 var C; 47963 if (isArray(original)) { 47964 C = original.constructor; 47965 // cross-realm fallback 47966 if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined; 47967 if (isObject(C)) { 47968 C = C[SPECIES]; 47969 if (C === null) C = undefined; 47970 } 47971 }return C === undefined ? Array : C; 47972 }; 47973 47974/***/ }, 47975/* 417 */ 47976/***/ function(module, exports, __webpack_require__) { 47977 47978 'use strict'; 47979 47980 // 9.4.2.3 ArraySpeciesCreate(originalArray, length) 47981 var speciesConstructor = __webpack_require__(416); 47982 47983 module.exports = function (original, length) { 47984 return new (speciesConstructor(original))(length); 47985 }; 47986 47987/***/ }, 47988/* 418 */ 47989/***/ function(module, exports, __webpack_require__) { 47990 47991 'use strict'; 47992 47993 var dP = __webpack_require__(23).f, 47994 create = __webpack_require__(89), 47995 redefineAll = __webpack_require__(143), 47996 ctx = __webpack_require__(54), 47997 anInstance = __webpack_require__(134), 47998 defined = __webpack_require__(87), 47999 forOf = __webpack_require__(88), 48000 $iterDefine = __webpack_require__(140), 48001 step = __webpack_require__(229), 48002 setSpecies = __webpack_require__(431), 48003 DESCRIPTORS = __webpack_require__(20), 48004 fastKey = __webpack_require__(56).fastKey, 48005 SIZE = DESCRIPTORS ? '_s' : 'size'; 48006 48007 var getEntry = function getEntry(that, key) { 48008 // fast case 48009 var index = fastKey(key), 48010 entry; 48011 if (index !== 'F') return that._i[index]; 48012 // frozen object case 48013 for (entry = that._f; entry; entry = entry.n) { 48014 if (entry.k == key) return entry; 48015 } 48016 }; 48017 48018 module.exports = { 48019 getConstructor: function getConstructor(wrapper, NAME, IS_MAP, ADDER) { 48020 var C = wrapper(function (that, iterable) { 48021 anInstance(that, C, NAME, '_i'); 48022 that._i = create(null); // index 48023 that._f = undefined; // first entry 48024 that._l = undefined; // last entry 48025 that[SIZE] = 0; // size 48026 if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that); 48027 }); 48028 redefineAll(C.prototype, { 48029 // 23.1.3.1 Map.prototype.clear() 48030 // 23.2.3.2 Set.prototype.clear() 48031 clear: function clear() { 48032 for (var that = this, data = that._i, entry = that._f; entry; entry = entry.n) { 48033 entry.r = true; 48034 if (entry.p) entry.p = entry.p.n = undefined; 48035 delete data[entry.i]; 48036 } 48037 that._f = that._l = undefined;
48038 that[SIZE] = 0; 48039 }, 48040 // 23.1.3.3 Map.prototype.delete(key) 48041 // 23.2.3.4 Set.prototype.delete(value) 48042 'delete': function _delete(key) { 48043 var that = this, 48044 entry = getEntry(that, key); 48045 if (entry) { 48046 var next = entry.n, 48047 prev = entry.p; 48048 delete that._i[entry.i]; 48049 entry.r = true; 48050 if (prev) prev.n = next; 48051 if (next) next.p = prev; 48052 if (that._f == entry) that._f = next; 48053 if (that._l == entry) that._l = prev; 48054 that[SIZE]--; 48055 }return !!entry; 48056 }, 48057 // 23.2.3.6 Set.prototype.forEach(callbackfn, thisArg = undefined) 48058 // 23.1.3.5 Map.prototype.forEach(callbackfn, thisArg = undefined) 48059 forEach: function forEach(callbackfn /*, that = undefined */) { 48060 anInstance(this, C, 'forEach'); 48061 var f = ctx(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3), 48062 entry; 48063 while (entry = entry ? entry.n : this._f) { 48064 f(entry.v, entry.k, this); 48065 // revert to the last existing entry 48066 while (entry && entry.r) { 48067 entry = entry.p; 48068 } 48069 } 48070 }, 48071 // 23.1.3.7 Map.prototype.has(key) 48072 // 23.2.3.7 Set.prototype.has(value) 48073 has: function has(key) { 48074 return !!getEntry(this, key); 48075 } 48076 }); 48077 if (DESCRIPTORS) dP(C.prototype, 'size', { 48078 get: function get() { 48079 return defined(this[SIZE]); 48080 } 48081 }); 48082 return C; 48083 }, 48084 def: function def(that, key, value) { 48085 var entry = getEntry(that, key), 48086 prev, 48087 index; 48088 // change existing entry 48089 if (entry) { 48090 entry.v = value; 48091 // create new entry 48092 } else { 48093 that._l = entry = { 48094 i: index = fastKey(key, true), // <- index 48095 k: key, // <- key 48096 v: value, // <- value 48097 p: prev = that._l, // <- previous entry 48098 n: undefined, // <- next entry 48099 r: false // <- removed 48100 }; 48101 if (!that._f) that._f = entry; 48102 if (prev) prev.n = entry; 48103 that[SIZE]++; 48104 // add to index 48105 if (index !== 'F') that._i[index] = entry; 48106 }return that; 48107 }, 48108 getEntry: getEntry, 48109 setStrong: function setStrong(C, NAME, IS_MAP) { 48110 // add .keys, .values, .entries, [@@iterator] 48111 // 23.1.3.4, 23.1.3.8, 23.1.3.11, 23.1.3.12, 23.2.3.5, 23.2.3.8, 23.2.3.10, 23.2.3.11 48112 $iterDefine(C, NAME, function (iterated, kind) { 48113 this._t = iterated; // target 48114 this._k = kind; // kind 48115 this._l = undefined; // previous 48116 }, function () { 48117 var that = this, 48118 kind = that._k, 48119 entry = that._l; 48120 // revert to the last existing entry 48121 while (entry && entry.r) { 48122 entry = entry.p; 48123 } // get next entry 48124 if (!that._t || !(that._l = entry = entry ? entry.n : that._t._f)) { 48125 // or finish the iteration 48126 that._t = undefined; 48127 return step(1); 48128 } 48129 // return step by kind 48130 if (kind == 'keys') return step(0, entry.k); 48131 if (kind == 'values') return step(0, entry.v); 48132 return step(0, [entry.k, entry.v]); 48133 }, IS_MAP ? 'entries' : 'values', !IS_MAP, true); 48134 48135 // add [@@species], 23.1.2.2, 23.2.2.2 48136 setSpecies(NAME); 48137 } 48138 }; 48139 48140/***/ }, 48141/* 419 */ 48142/***/ function(module, exports, __webpack_require__) { 48143 48144 'use strict'; 48145 48146 // https://github.com/DavidBruant/Map-Set.prototype.toJSON 48147 var classof = __webpack_require__(224), 48148 from = __webpack_require__(414); 48149 module.exports = function (NAME) { 48150 return function toJSON() { 48151 if (classof(this) != NAME) throw TypeError(NAME + "#toJSON isn't generic"); 48152 return from(this); 48153 }; 48154 }; 48155 48156/***/ }, 48157/* 420 */ 48158/***/ function(module, exports, __webpack_require__) { 48159 48160 'use strict'; 48161 48162 // all enumerable object keys, includes symbols 48163 var getKeys = __webpack_require__(43), 48164 gOPS = __webpack_require__(142), 48165 pIE = __webpack_require__(90); 48166 module.exports = function (it) { 48167 var result = getKeys(it), 48168 getSymbols = gOPS.f; 48169 if (getSymbols) { 48170 var symbols = getSymbols(it), 48171 isEnum = pIE.f, 48172 i = 0, 48173 key; 48174 while (symbols.length > i) { 48175 if (isEnum.call(it, key = symbols[i++])) result.push(key); 48176 } 48177 }return result; 48178 }; 48179 48180/***/ }, 48181/* 421 */ 48182/***/ function(module, exports, __webpack_require__) { 48183 48184 'use strict'; 48185 48186 module.exports = __webpack_require__(14).document && document.documentElement; 48187 48188/***/ }, 48189/* 422 */ 48190/***/ function(module, exports, __webpack_require__) { 48191 48192 'use strict'; 48193 48194 // check on default Array iterator 48195 var Iterators = __webpack_require__(55), 48196 ITERATOR = __webpack_require__(12)('iterator'), 48197 ArrayProto = Array.prototype; 48198 48199 module.exports = function (it) { 48200 return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it); 48201 }; 48202 48203/***/ }, 48204/* 423 */ 48205/***/ function(module, exports, __webpack_require__) { 48206 48207 'use strict'; 48208 48209 // call something on iterator step with safe closing on error 48210 var anObject = __webpack_require__(19); 48211 module.exports = function (iterator, fn, value, entries) { 48212 try { 48213 return entries ? fn(anObject(value)[0], value[1]) : fn(value); 48214 // 7.4.6 IteratorClose(iterator, completion) 48215 } catch (e) { 48216 var ret = iterator['return']; 48217 if (ret !== undefined) anObject(ret.call(iterator)); 48218 throw e; 48219 } 48220 }; 48221 48222/***/ }, 48223/* 424 */ 48224/***/ function(module, exports, __webpack_require__) { 48225 48226 'use strict'; 48227 48228 var create = __webpack_require__(89), 48229 descriptor = __webpack_require__(91), 48230 setToStringTag = __webpack_require__(92), 48231 IteratorPrototype = {}; 48232 48233 // 25.1.2.1.1 %IteratorPrototype%[@@iterator]() 48234 __webpack_require__(28)(IteratorPrototype, __webpack_require__(12)('iterator'), function () { 48235 return this; 48236 }); 48237 48238 module.exports = function (Constructor, NAME, next) { 48239 Constructor.prototype = create(IteratorPrototype, { next: descriptor(1, next) }); 48240 setToStringTag(Constructor, NAME + ' Iterator'); 48241 }; 48242 48243/***/ }, 48244/* 425 */ 48245/***/ function(module, exports, __webpack_require__) { 48246 48247 'use strict'; 48248 48249 var getKeys = __webpack_require__(43), 48250 toIObject = __webpack_require__(37); 48251 module.exports = function (object, el) { 48252 var O = toIObject(object), 48253 keys = getKeys(O), 48254 length = keys.length, 48255 index = 0, 48256 key; 48257 while (length > index) { 48258 if (O[key = keys[index++]] === el) return key; 48259 } 48260 }; 48261 48262/***/ }, 48263/* 426 */ 48264/***/ function(module, exports, __webpack_require__) { 48265 48266 'use strict'; 48267 48268 var dP = __webpack_require__(23), 48269 anObject = __webpack_require__(19), 48270 getKeys = __webpack_require__(43); 48271 48272 module.exports = __webpack_require__(20) ? Object.defineProperties : function defineProperties(O, Properties) { 48273 anObject(O); 48274 var keys = getKeys(Properties), 48275 length = keys.length, 48276 i = 0, 48277 P; 48278 while (length > i) { 48279 dP.f(O, P = keys[i++], Properties[P]); 48280 }return O; 48281 }; 48282 48283/***/ }, 48284/* 427 */ 48285/***/ function(module, exports, __webpack_require__) { 48286 48287 'use strict'; 48288 48289 var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; 48290 48291 // fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window 48292 var toIObject = __webpack_require__(37), 48293 gOPN = __webpack_require__(232).f, 48294 toString = {}.toString; 48295 48296 var windowNames = (typeof window === 'undefined' ? 'undefined' : _typeof(window)) == 'object' && window && Object.getOwnPropertyNames ? Object.getOwnPropertyNames(window) : []; 48297 48298 var getWindowNames = function getWindowNames(it) { 48299 try { 48300 return gOPN(it); 48301 } catch (e) { 48302 return windowNames.slice(); 48303 } 48304 }; 48305 48306 module.exports.f = function getOwnPropertyNames(it) { 48307 return windowNames && toString.call(it) == '[object Window]' ? getWindowNames(it) : gOPN(toIObject(it)); 48308 }; 48309 48310/***/ }, 48311/* 428 */ 48312/***/ function(module, exports, __webpack_require__) { 48313 48314 'use strict'; 48315 48316 // 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O) 48317 var has = __webpack_require__(27), 48318 toObject = __webpack_require__(93), 48319 IE_PROTO = __webpack_require__(145)('IE_PROTO'), 48320 ObjectProto = Object.prototype; 48321 48322 module.exports = Object.getPrototypeOf || function (O) { 48323 O = toObject(O); 48324 if (has(O, IE_PROTO)) return O[IE_PROTO]; 48325 if (typeof O.constructor == 'function' && O instanceof O.constructor) { 48326 return O.constructor.prototype; 48327 }return O instanceof Object ? ObjectProto : null; 48328 }; 48329 48330/***/ }, 48331/* 429 */ 48332/***/ function(module, exports, __webpack_require__) { 48333 48334 'use strict'; 48335
48336 // most Object methods by ES6 should accept primitives 48337 var $export = __webpack_require__(21), 48338 core = __webpack_require__(5), 48339 fails = __webpack_require__(36); 48340 module.exports = function (KEY, exec) { 48341 var fn = (core.Object || {})[KEY] || Object[KEY], 48342 exp = {}; 48343 exp[KEY] = exec(fn); 48344 $export($export.S + $export.F * fails(function () { 48345 fn(1); 48346 }), 'Object', exp); 48347 }; 48348 48349/***/ }, 48350/* 430 */ 48351/***/ function(module, exports, __webpack_require__) { 48352 48353 'use strict'; 48354 48355 // Works with __proto__ only. Old v8 can't work with null proto objects. 48356 /* eslint-disable no-proto */ 48357 var isObject = __webpack_require__(22), 48358 anObject = __webpack_require__(19); 48359 var check = function check(O, proto) { 48360 anObject(O); 48361 if (!isObject(proto) && proto !== null) throw TypeError(proto + ": can't set as prototype!"); 48362 }; 48363 module.exports = { 48364 set: Object.setPrototypeOf || ('__proto__' in {} ? // eslint-disable-line 48365 function (test, buggy, set) { 48366 try { 48367 set = __webpack_require__(54)(Function.call, __webpack_require__(231).f(Object.prototype, '__proto__').set, 2); 48368 set(test, []); 48369 buggy = !(test instanceof Array); 48370 } catch (e) { 48371 buggy = true; 48372 } 48373 return function setPrototypeOf(O, proto) { 48374 check(O, proto); 48375 if (buggy) O.__proto__ = proto;else set(O, proto); 48376 return O; 48377 }; 48378 }({}, false) : undefined), 48379 check: check 48380 }; 48381 48382/***/ }, 48383/* 431 */ 48384/***/ function(module, exports, __webpack_require__) { 48385 48386 'use strict'; 48387 48388 var global = __webpack_require__(14), 48389 core = __webpack_require__(5), 48390 dP = __webpack_require__(23), 48391 DESCRIPTORS = __webpack_require__(20), 48392 SPECIES = __webpack_require__(12)('species'); 48393 48394 module.exports = function (KEY) { 48395 var C = typeof core[KEY] == 'function' ? core[KEY] : global[KEY]; 48396 if (DESCRIPTORS && C && !C[SPECIES]) dP.f(C, SPECIES, { 48397 configurable: true, 48398 get: function get() { 48399 return this; 48400 } 48401 }); 48402 }; 48403 48404/***/ }, 48405/* 432 */ 48406/***/ function(module, exports, __webpack_require__) { 48407 48408 'use strict'; 48409 48410 var toInteger = __webpack_require__(147), 48411 defined = __webpack_require__(87); 48412 // true -> String#at 48413 // false -> String#codePointAt 48414 module.exports = function (TO_STRING) { 48415 return function (that, pos) { 48416 var s = String(defined(that)), 48417 i = toInteger(pos), 48418 l = s.length, 48419 a, 48420 b; 48421 if (i < 0 || i >= l) return TO_STRING ? '' : undefined; 48422 a = s.charCodeAt(i); 48423 return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff ? TO_STRING ? s.charAt(i) : a : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000; 48424 }; 48425 }; 48426 48427/***/ }, 48428/* 433 */ 48429/***/ function(module, exports, __webpack_require__) { 48430 48431 'use strict'; 48432 48433 var toInteger = __webpack_require__(147), 48434 max = Math.max, 48435 min = Math.min; 48436 module.exports = function (index, length) { 48437 index = toInteger(index); 48438 return index < 0 ? max(index + length, 0) : min(index, length); 48439 }; 48440 48441/***/ }, 48442/* 434 */ 48443/***/ function(module, exports, __webpack_require__) { 48444 48445 'use strict'; 48446 48447 var anObject = __webpack_require__(19), 48448 get = __webpack_require__(234); 48449 module.exports = __webpack_require__(5).getIterator = function (it) { 48450 var iterFn = get(it); 48451 if (typeof iterFn != 'function') throw TypeError(it + ' is not iterable!'); 48452 return anObject(iterFn.call(it)); 48453 }; 48454 48455/***/ }, 48456/* 435 */ 48457/***/ function(module, exports, __webpack_require__) { 48458 48459 'use strict'; 48460 48461 var addToUnscopables = __webpack_require__(413), 48462 step = __webpack_require__(229), 48463 Iterators = __webpack_require__(55), 48464 toIObject = __webpack_require__(37); 48465 48466 // 22.1.3.4 Array.prototype.entries() 48467 // 22.1.3.13 Array.prototype.keys() 48468 // 22.1.3.29 Array.prototype.values() 48469 // 22.1.3.30 Array.prototype[@@iterator]() 48470 module.exports = __webpack_require__(140)(Array, 'Array', function (iterated, kind) { 48471 this._t = toIObject(iterated); // target 48472 this._i = 0; // next index 48473 this._k = kind; // kind 48474 // 22.1.5.2.1 %ArrayIteratorPrototype%.next() 48475 }, function () { 48476 var O = this._t, 48477 kind = this._k, 48478 index = this._i++; 48479 if (!O || index >= O.length) { 48480 this._t = undefined; 48481 return step(1); 48482 } 48483 if (kind == 'keys') return step(0, index); 48484 if (kind == 'values') return step(0, O[index]); 48485 return step(0, [index, O[index]]); 48486 }, 'values'); 48487 48488 // argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7) 48489 Iterators.Arguments = Iterators.Array; 48490 48491 addToUnscopables('keys'); 48492 addToUnscopables('values'); 48493 addToUnscopables('entries'); 48494 48495/***/ }, 48496/* 436 */ 48497/***/ function(module, exports, __webpack_require__) { 48498 48499 'use strict'; 48500 48501 var strong = __webpack_require__(418); 48502 48503 // 23.1 Map Objects 48504 module.exports = __webpack_require__(137)('Map', function (get) { 48505 return function Map() { 48506 return get(this, arguments.length > 0 ? arguments[0] : undefined); 48507 }; 48508 }, { 48509 // 23.1.3.6 Map.prototype.get(key) 48510 get: function get(key) { 48511 var entry = strong.getEntry(this, key); 48512 return entry && entry.v; 48513 }, 48514 // 23.1.3.9 Map.prototype.set(key, value)
48515 set: function set(key, value) { 48516 return strong.def(this, key === 0 ? 0 : key, value); 48517 } 48518 }, strong, true); 48519 48520/***/ }, 48521/* 437 */ 48522/***/ function(module, exports, __webpack_require__) { 48523 48524 'use strict'; 48525 48526 // 20.1.2.6 Number.MAX_SAFE_INTEGER 48527 var $export = __webpack_require__(21); 48528 48529 $export($export.S, 'Number', { MAX_SAFE_INTEGER: 0x1fffffffffffff }); 48530 48531/***/ }, 48532/* 438 */ 48533/***/ function(module, exports, __webpack_require__) { 48534 48535 'use strict'; 48536 48537 // 19.1.3.1 Object.assign(target, source) 48538 var $export = __webpack_require__(21); 48539 48540 $export($export.S + $export.F, 'Object', { assign: __webpack_require__(230) }); 48541 48542/***/ }, 48543/* 439 */ 48544/***/ function(module, exports, __webpack_require__) { 48545 48546 'use strict'; 48547 48548 var $export = __webpack_require__(21); 48549 // 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) 48550 $export($export.S, 'Object', { create: __webpack_require__(89) }); 48551 48552/***/ }, 48553/* 440 */ 48554/***/ function(module, exports, __webpack_require__) { 48555 48556 'use strict'; 48557 48558 // 19.1.2.14 Object.keys(O) 48559 var toObject = __webpack_require__(93), 48560 $keys = __webpack_require__(43); 48561 48562 __webpack_require__(429)('keys', function () { 48563 return function keys(it) { 48564 return $keys(toObject(it)); 48565 }; 48566 }); 48567 48568/***/ }, 48569/* 441 */ 48570/***/ function(module, exports, __webpack_require__) { 48571 48572 'use strict'; 48573 48574 // 19.1.3.19 Object.setPrototypeOf(O, proto) 48575 var $export = __webpack_require__(21); 48576 $export($export.S, 'Object', { setPrototypeOf: __webpack_require__(430).set }); 48577 48578/***/ }, 48579/* 442 */ 48580/***/ function(module, exports, __webpack_require__) { 48581 48582 'use strict'; 48583 48584 var each = __webpack_require__(135)(0), 48585 redefine = __webpack_require__(144), 48586 meta = __webpack_require__(56), 48587 assign = __webpack_require__(230), 48588 weak = __webpack_require__(225), 48589 isObject = __webpack_require__(22), 48590 getWeak = meta.getWeak, 48591 isExtensible = Object.isExtensible, 48592 uncaughtFrozenStore = weak.ufstore, 48593 tmp = {}, 48594 InternalMap; 48595 48596 var wrapper = function wrapper(get) { 48597 return function WeakMap() { 48598 return get(this, arguments.length > 0 ? arguments[0] : undefined); 48599 }; 48600 }; 48601 48602 var methods = { 48603 // 23.3.3.3 WeakMap.prototype.get(key) 48604 get: function get(key) { 48605 if (isObject(key)) { 48606 var data = getWeak(key); 48607 if (data === true) return uncaughtFrozenStore(this).get(key); 48608 return data ? data[this._i] : undefined; 48609 } 48610 }, 48611 // 23.3.3.5 WeakMap.prototype.set(key, value) 48612 set: function set(key, value) { 48613 return weak.def(this, key, value); 48614 } 48615 }; 48616 48617 // 23.3 WeakMap Objects 48618 var $WeakMap = module.exports = __webpack_require__(137)('WeakMap', wrapper, methods, weak, true, true); 48619 48620 // IE11 WeakMap frozen keys fix 48621 if (new $WeakMap().set((Object.freeze || Object)(tmp), 7).get(tmp) != 7) { 48622 InternalMap = weak.getConstructor(wrapper); 48623 assign(InternalMap.prototype, methods); 48624 meta.NEED = true; 48625 each(['delete', 'has', 'get', 'set'], function (key) { 48626 var proto = $WeakMap.prototype, 48627 method = proto[key]; 48628 redefine(proto, key, function (a, b) { 48629 // store frozen objects on internal weakmap shim 48630 if (isObject(a) && !isExtensible(a)) { 48631 if (!this._f) this._f = new InternalMap(); 48632 var result = this._f[key](a, b); 48633 return key == 'set' ? this : result; 48634 // store all the rest on native weakmap 48635 }return method.call(this, a, b); 48636 }); 48637 }); 48638 } 48639 48640/***/ }, 48641/* 443 */ 48642/***/ function(module, exports, __webpack_require__) { 48643 48644 'use strict'; 48645 48646 var weak = __webpack_require__(225); 48647 48648 // 23.4 WeakSet Objects 48649 __webpack_require__(137)('WeakSet', function (get) { 48650 return function WeakSet() { 48651 return get(this, arguments.length > 0 ? arguments[0] : undefined); 48652 }; 48653 }, { 48654 // 23.4.3.1 WeakSet.prototype.add(value) 48655 add: function add(value) { 48656 return weak.def(this, value, true); 48657 } 48658 }, weak, false, true); 48659 48660/***/ }, 48661/* 444 */ 48662/***/ function(module, exports, __webpack_require__) { 48663 48664 'use strict'; 48665 48666 // https://github.com/DavidBruant/Map-Set.prototype.toJSON 48667 var $export = __webpack_require__(21); 48668 48669 $export($export.P + $export.R, 'Map', { toJSON: __webpack_require__(419)('Map') }); 48670 48671/***/ }, 48672/* 445 */ 48673/***/ function(module, exports, __webpack_require__) { 48674 48675 'use strict'; 48676 48677 __webpack_require__(150)('asyncIterator'); 48678 48679/***/ }, 48680/* 446 */ 48681/***/ function(module, exports, __webpack_require__) { 48682 48683 'use strict'; 48684 48685 __webpack_require__(150)('observable'); 48686 48687/***/ }, 48688/* 447 */ 48689/***/ function(module, exports, __webpack_require__) { 48690 48691 'use strict'; 48692 48693 /** 48694 * This is the common logic for both the Node.js and web browser 48695 * implementations of `debug()`. 48696 * 48697 * Expose `debug()` as the module. 48698 */ 48699 48700 exports = module.exports = createDebug.debug = createDebug['default'] = createDebug;
vendor: 3,823 bytes, lines 48701-48869
48701 exports.coerce = coerce; 48702 exports.disable = disable; 48703 exports.enable = enable; 48704 exports.enabled = enabled; 48705 exports.humanize = __webpack_require__(591); 48706 48707 /** 48708 * The currently active debug mode names, and names to skip. 48709 */ 48710 48711 exports.names = []; 48712 exports.skips = []; 48713 48714 /** 48715 * Map of special "%n" handling functions, for the debug "format" argument. 48716 * 48717 * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N". 48718 */ 48719 48720 exports.formatters = {}; 48721 48722 /** 48723 * Previous log timestamp. 48724 */ 48725 48726 var prevTime; 48727 48728 /** 48729 * Select a color. 48730 * @param {String} namespace 48731 * @return {Number} 48732 * @api private 48733 */ 48734 48735 function selectColor(namespace) { 48736 var hash = 0, 48737 i; 48738 48739 for (i in namespace) { 48740 hash = (hash << 5) - hash + namespace.charCodeAt(i); 48741 hash |= 0; // Convert to 32bit integer 48742 } 48743 48744 return exports.colors[Math.abs(hash) % exports.colors.length]; 48745 } 48746 48747 /** 48748 * Create a debugger with the given `namespace`. 48749 * 48750 * @param {String} namespace 48751 * @return {Function} 48752 * @api public 48753 */ 48754 48755 function createDebug(namespace) { 48756 48757 function debug() { 48758 // disabled? 48759 if (!debug.enabled) return; 48760 48761 var self = debug; 48762 48763 // set `diff` timestamp 48764 var curr = +new Date(); 48765 var ms = curr - (prevTime || curr); 48766 self.diff = ms; 48767 self.prev = prevTime; 48768 self.curr = curr; 48769 prevTime = curr; 48770 48771 // turn the `arguments` into a proper Array 48772 var args = new Array(arguments.length); 48773 for (var i = 0; i < args.length; i++) { 48774 args[i] = arguments[i]; 48775 } 48776 48777 args[0] = exports.coerce(args[0]); 48778 48779 if ('string' !== typeof args[0]) { 48780 // anything else let's inspect with %O 48781 args.unshift('%O'); 48782 } 48783 48784 // apply any `formatters` transformations 48785 var index = 0; 48786 args[0] = args[0].replace(/%([a-zA-Z%])/g, function (match, format) { 48787 // if we encounter an escaped % then don't increase the array index 48788 if (match === '%%') return match; 48789 index++; 48790 var formatter = exports.formatters[format]; 48791 if ('function' === typeof formatter) { 48792 var val = args[index]; 48793 match = formatter.call(self, val); 48794 48795 // now we need to remove `args[index]` since it's inlined in the `format` 48796 args.splice(index, 1); 48797 index--; 48798 } 48799 return match; 48800 }); 48801 48802 // apply env-specific formatting (colors, etc.) 48803 exports.formatArgs.call(self, args); 48804 48805 var logFn = debug.log || exports.log || console.log.bind(console); 48806 logFn.apply(self, args); 48807 } 48808 48809 debug.namespace = namespace; 48810 debug.enabled = exports.enabled(namespace); 48811 debug.useColors = exports.useColors(); 48812 debug.color = selectColor(namespace); 48813 48814 // env-specific initialization logic for debug instances 48815 if ('function' === typeof exports.init) { 48816 exports.init(debug); 48817 } 48818 48819 return debug; 48820 } 48821 48822 /** 48823 * Enables a debug mode by namespaces. This can include modes 48824 * separated by a colon and wildcards. 48825 * 48826 * @param {String} namespaces 48827 * @api public 48828 */ 48829 48830 function enable(namespaces) { 48831 exports.save(namespaces); 48832 48833 exports.names = []; 48834 exports.skips = []; 48835 48836 var split = (namespaces || '').split(/[\s,]+/); 48837 var len = split.length; 48838 48839 for (var i = 0; i < len; i++) { 48840 if (!split[i]) continue; // ignore empty strings 48841 namespaces = split[i].replace(/\*/g, '.*?'); 48842 if (namespaces[0] === '-') { 48843 exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$')); 48844 } else { 48845 exports.names.push(new RegExp('^' + namespaces + '$')); 48846 } 48847 } 48848 } 48849 48850 /** 48851 * Disable debug output. 48852 * 48853 * @api public 48854 */ 48855 48856 function disable() { 48857 exports.enable(''); 48858 } 48859 48860 /** 48861 * Returns true if the given mode name is enabled, false otherwise. 48862 * 48863 * @param {String} name 48864 * @return {Boolean} 48865 * @api public 48866 */ 48867 48868 function enabled(name) { 48869 var i, len;
48870 for (i = 0, len = exports.skips.length; i < len; i++) { 48871 if (exports.skips[i].test(name)) { 48872 return false; 48873 } 48874 } 48875 for (i = 0, len = exports.names.length; i < len; i++) { 48876 if (exports.names[i].test(name)) { 48877 return true; 48878 } 48879 } 48880 return false; 48881 } 48882 48883 /** 48884 * Coerce `val`. 48885 * 48886 * @param {Mixed} val 48887 * @return {Mixed} 48888 * @api private 48889 */ 48890 48891 function coerce(val) { 48892 if (val instanceof Error) return val.stack || val.message; 48893 return val; 48894 } 48895 48896/***/ }, 48897/* 448 */ 48898/***/ function(module, exports, __webpack_require__) { 48899 48900 /* eslint-disable guard-for-in */ 48901 'use strict'; 48902 48903 var repeating = __webpack_require__(603); 48904 48905 // detect either spaces or tabs but not both to properly handle tabs 48906 // for indentation and spaces for alignment 48907 var INDENT_RE = /^(?:( )+|\t+)/; 48908 48909 function getMostUsed(indents) { 48910 var result = 0; 48911 var maxUsed = 0; 48912 var maxWeight = 0; 48913 48914 for (var n in indents) { 48915 var indent = indents[n]; 48916 var u = indent[0]; 48917 var w = indent[1]; 48918 48919 if (u > maxUsed || u === maxUsed && w > maxWeight) { 48920 maxUsed = u; 48921 maxWeight = w; 48922 result = Number(n); 48923 } 48924 } 48925 48926 return result; 48927 } 48928 48929 module.exports = function (str) { 48930 if (typeof str !== 'string') { 48931 throw new TypeError('Expected a string'); 48932 } 48933 48934 // used to see if tabs or spaces are the most used 48935 var tabs = 0; 48936 var spaces = 0; 48937 48938 // remember the size of previous line's indentation 48939 var prev = 0; 48940 48941 // remember how many indents/unindents as occurred for a given size 48942 // and how much lines follow a given indentation 48943 // 48944 // indents = { 48945 // 3: [1, 0], 48946 // 4: [1, 5], 48947 // 5: [1, 0], 48948 // 12: [1, 0], 48949 // } 48950 var indents = {}; 48951 48952 // pointer to the array of last used indent 48953 var current; 48954 48955 // whether the last action was an indent (opposed to an unindent) 48956 var isIndent; 48957 48958 str.split(/\n/g).forEach(function (line) { 48959 if (!line) { 48960 // ignore empty lines 48961 return; 48962 } 48963 48964 var indent; 48965 var matches = line.match(INDENT_RE); 48966 48967 if (!matches) { 48968 indent = 0; 48969 } else { 48970 indent = matches[0].length; 48971 48972 if (matches[1]) { 48973 spaces++; 48974 } else { 48975 tabs++; 48976 } 48977 } 48978 48979 var diff = indent - prev; 48980 prev = indent; 48981 48982 if (diff) { 48983 // an indent or unindent has been detected 48984 48985 isIndent = diff > 0; 48986 48987 current = indents[isIndent ? diff : -diff]; 48988 48989 if (current) { 48990 current[0]++; 48991 } else { 48992 current = indents[diff] = [1, 0]; 48993 } 48994 } else if (current) { 48995 // if the last action was an indent, increment the weight 48996 current[1] += Number(isIndent); 48997 } 48998 }); 48999 49000 var amount = getMostUsed(indents); 49001 49002 var type; 49003 var actual; 49004 if (!amount) { 49005 type = null; 49006 actual = ''; 49007 } else if (spaces >= tabs) { 49008 type = 'space'; 49009 actual = repeating(' ', amount); 49010 } else { 49011 type = 'tab'; 49012 actual = repeating('\t', amount); 49013 } 49014 49015 return { 49016 amount: amount, 49017 type: type, 49018 indent: actual 49019 }; 49020 }; 49021 49022/***/ }, 49023/* 449 */ 49024/***/ function(module, exports) { 49025 49026 'use strict'; 49027 49028 var matchOperatorsRe = /[|\\{}()[\]^$+*?.]/g; 49029 49030 module.exports = function (str) { 49031 if (typeof str !== 'string') { 49032 throw new TypeError('Expected a string'); 49033 } 49034 49035 return str.replace(matchOperatorsRe, '\\$&'); 49036 }; 49037 49038/***/ }, 49039/* 450 */ 49040/***/ function(module, exports) { 49041 49042 'use strict'; 49043 49044 /* 49045 Copyright (C) 2013 Yusuke Suzuki <[email protected]> 49046 49047 Redistribution and use in source and binary forms, with or without 49048 modification, are permitted provided that the following conditions are met: 49049 49050 * Redistributions of source code must retain the above copyright 49051 notice, this list of conditions and the following disclaimer. 49052 * Redistributions in binary form must reproduce the above copyright 49053 notice, this list of conditions and the following disclaimer in the 49054 documentation and/or other materials provided with the distribution. 49055 49056 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' 49057 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 49058 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 49059 ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY 49060 DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 49061 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 49062 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 49063 ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 49064 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 49065 THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 49066 */ 49067 49068 (function () { 49069 'use strict'; 49070 49071 function isExpression(node) { 49072 if (node == null) { 49073 return false;
49074 } 49075 switch (node.type) { 49076 case 'ArrayExpression': 49077 case 'AssignmentExpression': 49078 case 'BinaryExpression': 49079 case 'CallExpression': 49080 case 'ConditionalExpression': 49081 case 'FunctionExpression': 49082 case 'Identifier': 49083 case 'Literal': 49084 case 'LogicalExpression': 49085 case 'MemberExpression': 49086 case 'NewExpression': 49087 case 'ObjectExpression': 49088 case 'SequenceExpression': 49089 case 'ThisExpression': 49090 case 'UnaryExpression': 49091 case 'UpdateExpression': 49092 return true; 49093 } 49094 return false; 49095 } 49096 49097 function isIterationStatement(node) { 49098 if (node == null) { 49099 return false; 49100 } 49101 switch (node.type) { 49102 case 'DoWhileStatement': 49103 case 'ForInStatement': 49104 case 'ForStatement': 49105 case 'WhileStatement': 49106 return true; 49107 } 49108 return false; 49109 } 49110 49111 function isStatement(node) { 49112 if (node == null) { 49113 return false; 49114 } 49115 switch (node.type) { 49116 case 'BlockStatement': 49117 case 'BreakStatement': 49118 case 'ContinueStatement': 49119 case 'DebuggerStatement': 49120 case 'DoWhileStatement': 49121 case 'EmptyStatement': 49122 case 'ExpressionStatement': 49123 case 'ForInStatement': 49124 case 'ForStatement': 49125 case 'IfStatement': 49126 case 'LabeledStatement': 49127 case 'ReturnStatement': 49128 case 'SwitchStatement': 49129 case 'ThrowStatement': 49130 case 'TryStatement': 49131 case 'VariableDeclaration': 49132 case 'WhileStatement': 49133 case 'WithStatement': 49134 return true; 49135 } 49136 return false; 49137 } 49138 49139 function isSourceElement(node) { 49140 return isStatement(node) || node != null && node.type === 'FunctionDeclaration'; 49141 } 49142 49143 function trailingStatement(node) { 49144 switch (node.type) { 49145 case 'IfStatement': 49146 if (node.alternate != null) { 49147 return node.alternate; 49148 } 49149 return node.consequent; 49150 49151 case 'LabeledStatement': 49152 case 'ForStatement': 49153 case 'ForInStatement': 49154 case 'WhileStatement': 49155 case 'WithStatement': 49156 return node.body; 49157 } 49158 return null; 49159 } 49160 49161 function isProblematicIfStatement(node) { 49162 var current; 49163 49164 if (node.type !== 'IfStatement') { 49165 return false; 49166 } 49167 if (node.alternate == null) { 49168 return false; 49169 } 49170 current = node.consequent; 49171 do { 49172 if (current.type === 'IfStatement') { 49173 if (current.alternate == null) { 49174 return true; 49175 } 49176 } 49177 current = trailingStatement(current); 49178 } while (current); 49179 49180 return false; 49181 } 49182 49183 module.exports = { 49184 isExpression: isExpression, 49185 isStatement: isStatement, 49186 isIterationStatement: isIterationStatement, 49187 isSourceElement: isSourceElement, 49188 isProblematicIfStatement: isProblematicIfStatement, 49189 49190 trailingStatement: trailingStatement 49191 }; 49192 })(); 49193 /* vim: set sw=4 ts=4 et tw=80 : */ 49194 49195/***/ }, 49196/* 451 */ 49197/***/ function(module, exports, __webpack_require__) { 49198 49199 'use strict'; 49200 49201 /* 49202 Copyright (C) 2013 Yusuke Suzuki <[email protected]> 49203 49204 Redistribution and use in source and binary forms, with or without 49205 modification, are permitted provided that the following conditions are met: 49206 49207 * Redistributions of source code must retain the above copyright 49208 notice, this list of conditions and the following disclaimer. 49209 * Redistributions in binary form must reproduce the above copyright 49210 notice, this list of conditions and the following disclaimer in the 49211 documentation and/or other materials provided with the distribution. 49212 49213 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 49214 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 49215 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 49216 ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY 49217 DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 49218 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 49219 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 49220 ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 49221 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 49222 THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 49223 */ 49224 49225 (function () { 49226 'use strict'; 49227 49228 var code = __webpack_require__(236); 49229 49230 function isStrictModeReservedWordES6(id) { 49231 switch (id) { 49232 case 'implements': 49233 case 'interface': 49234 case 'package': 49235 case 'private': 49236 case 'protected': 49237 case 'public': 49238 case 'static':
49239 case 'let': 49240 return true; 49241 default: 49242 return false; 49243 } 49244 } 49245 49246 function isKeywordES5(id, strict) { 49247 // yield should not be treated as keyword under non-strict mode. 49248 if (!strict && id === 'yield') { 49249 return false; 49250 } 49251 return isKeywordES6(id, strict); 49252 } 49253 49254 function isKeywordES6(id, strict) { 49255 if (strict && isStrictModeReservedWordES6(id)) { 49256 return true; 49257 } 49258 49259 switch (id.length) { 49260 case 2: 49261 return id === 'if' || id === 'in' || id === 'do'; 49262 case 3: 49263 return id === 'var' || id === 'for' || id === 'new' || id === 'try'; 49264 case 4: 49265 return id === 'this' || id === 'else' || id === 'case' || id === 'void' || id === 'with' || id === 'enum'; 49266 case 5: 49267 return id === 'while' || id === 'break' || id === 'catch' || id === 'throw' || id === 'const' || id === 'yield' || id === 'class' || id === 'super'; 49268 case 6: 49269 return id === 'return' || id === 'typeof' || id === 'delete' || id === 'switch' || id === 'export' || id === 'import'; 49270 case 7: 49271 return id === 'default' || id === 'finally' || id === 'extends'; 49272 case 8: 49273 return id === 'function' || id === 'continue' || id === 'debugger'; 49274 case 10: 49275 return id === 'instanceof'; 49276 default: 49277 return false; 49278 } 49279 } 49280 49281 function isReservedWordES5(id, strict) { 49282 return id === 'null' || id === 'true' || id === 'false' || isKeywordES5(id, strict); 49283 } 49284 49285 function isReservedWordES6(id, strict) { 49286 return id === 'null' || id === 'true' || id === 'false' || isKeywordES6(id, strict); 49287 } 49288 49289 function isRestrictedWord(id) { 49290 return id === 'eval' || id === 'arguments'; 49291 } 49292 49293 function isIdentifierNameES5(id) { 49294 var i, iz, ch; 49295 49296 if (id.length === 0) { 49297 return false; 49298 } 49299
49300 ch = id.charCodeAt(0); 49301 if (!code.isIdentifierStartES5(ch)) { 49302 return false; 49303 } 49304 49305 for (i = 1, iz = id.length; i < iz; ++i) { 49306 ch = id.charCodeAt(i); 49307 if (!code.isIdentifierPartES5(ch)) { 49308 return false; 49309 } 49310 } 49311 return true; 49312 } 49313 49314 function decodeUtf16(lead, trail) { 49315 return (lead - 0xD800) * 0x400 + (trail - 0xDC00) + 0x10000; 49316 } 49317 49318 function isIdentifierNameES6(id) { 49319 var i, iz, ch, lowCh, check; 49320 49321 if (id.length === 0) { 49322 return false; 49323 } 49324 49325 check = code.isIdentifierStartES6; 49326 for (i = 0, iz = id.length; i < iz; ++i) { 49327 ch = id.charCodeAt(i); 49328 if (0xD800 <= ch && ch <= 0xDBFF) { 49329 ++i; 49330 if (i >= iz) { 49331 return false; 49332 } 49333 lowCh = id.charCodeAt(i); 49334 if (!(0xDC00 <= lowCh && lowCh <= 0xDFFF)) { 49335 return false; 49336 } 49337 ch = decodeUtf16(ch, lowCh); 49338 } 49339 if (!check(ch)) { 49340 return false; 49341 } 49342 check = code.isIdentifierPartES6; 49343 } 49344 return true; 49345 } 49346 49347 function isIdentifierES5(id, strict) { 49348 return isIdentifierNameES5(id) && !isReservedWordES5(id, strict); 49349 } 49350 49351 function isIdentifierES6(id, strict) { 49352 return isIdentifierNameES6(id) && !isReservedWordES6(id, strict); 49353 } 49354 49355 module.exports = { 49356 isKeywordES5: isKeywordES5, 49357 isKeywordES6: isKeywordES6, 49358 isReservedWordES5: isReservedWordES5, 49359 isReservedWordES6: isReservedWordES6, 49360 isRestrictedWord: isRestrictedWord, 49361 isIdentifierNameES5: isIdentifierNameES5, 49362 isIdentifierNameES6: isIdentifierNameES6, 49363 isIdentifierES5: isIdentifierES5, 49364 isIdentifierES6: isIdentifierES6 49365 }; 49366 })(); 49367 /* vim: set sw=4 ts=4 et tw=80 : */ 49368 49369/***/ }, 49370/* 452 */ 49371/***/ function(module, exports, __webpack_require__) { 49372 49373 'use strict'; 49374 49375 module.exports = __webpack_require__(618); 49376 49377/***/ }, 49378/* 453 */ 49379/***/ function(module, exports, __webpack_require__) { 49380 49381 'use strict'; 49382 49383 var ansiRegex = __webpack_require__(176); 49384 var re = new RegExp(ansiRegex().source); // remove the `g` flag 49385 module.exports = re.test.bind(re); 49386 49387/***/ }, 49388/* 454 */ 49389/***/ function(module, exports) { 49390 49391 "use strict"; 49392 49393 exports.read = function (buffer, offset, isLE, mLen, nBytes) { 49394 var e, m; 49395 var eLen = nBytes * 8 - mLen - 1; 49396 var eMax = (1 << eLen) - 1; 49397 var eBias = eMax >> 1; 49398 var nBits = -7; 49399 var i = isLE ? nBytes - 1 : 0; 49400 var d = isLE ? -1 : 1; 49401 var s = buffer[offset + i]; 49402 49403 i += d; 49404 49405 e = s & (1 << -nBits) - 1; 49406 s >>= -nBits; 49407 nBits += eLen; 49408 for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) {} 49409 49410 m = e & (1 << -nBits) - 1; 49411 e >>= -nBits; 49412 nBits += mLen; 49413 for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) {} 49414 49415 if (e === 0) { 49416 e = 1 - eBias; 49417 } else if (e === eMax) { 49418 return m ? NaN : (s ? -1 : 1) * Infinity; 49419 } else { 49420 m = m + Math.pow(2, mLen); 49421 e = e - eBias; 49422 } 49423 return (s ? -1 : 1) * m * Math.pow(2, e - mLen); 49424 }; 49425 49426 exports.write = function (buffer, value, offset, isLE, mLen, nBytes) { 49427 var e, m, c; 49428 var eLen = nBytes * 8 - mLen - 1; 49429 var eMax = (1 << eLen) - 1; 49430 var eBias = eMax >> 1; 49431 var rt = mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0; 49432 var i = isLE ? 0 : nBytes - 1; 49433 var d = isLE ? 1 : -1; 49434 var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0; 49435 49436 value = Math.abs(value); 49437 49438 if (isNaN(value) || value === Infinity) { 49439 m = isNaN(value) ? 1 : 0; 49440 e = eMax; 49441 } else { 49442 e = Math.floor(Math.log(value) / Math.LN2); 49443 if (value * (c = Math.pow(2, -e)) < 1) { 49444 e--; 49445 c *= 2; 49446 } 49447 if (e + eBias >= 1) { 49448 value += rt / c; 49449 } else { 49450 value += rt * Math.pow(2, 1 - eBias); 49451 } 49452 if (value * c >= 2) { 49453 e++; 49454 c /= 2; 49455 } 49456 49457 if (e + eBias >= eMax) { 49458 m = 0; 49459 e = eMax; 49460 } else if (e + eBias >= 1) { 49461 m = (value * c - 1) * Math.pow(2, mLen); 49462 e = e + eBias; 49463 } else { 49464 m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen); 49465 e = 0; 49466 } 49467 } 49468 49469 for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {} 49470 49471 e = e << mLen | m; 49472 eLen += mLen; 49473 for (; eLen > 0;
49473 buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {} 49474 49475 buffer[offset + i - d] |= s * 128; 49476 }; 49477 49478/***/ }, 49479/* 455 */ 49480/***/ function(module, exports, __webpack_require__) { 49481 49482 /** 49483 * Copyright 2013-2015, Facebook, Inc. 49484 * All rights reserved. 49485 * 49486 * This source code is licensed under the BSD-style license found in the 49487 * LICENSE file in the root directory of this source tree. An additional grant 49488 * of patent rights can be found in the PATENTS file in the same directory. 49489 */ 49490 49491 'use strict'; 49492 49493 /** 49494 * Use invariant() to assert state which your program assumes to be true. 49495 * 49496 * Provide sprintf-style format (only %s is supported) and arguments 49497 * to provide information about what broke and what you were 49498 * expecting. 49499 * 49500 * The invariant message will be stripped in production, but the invariant 49501 * will remain to ensure logic does not differ in production. 49502 */ 49503 49504 var invariant = function invariant(condition, format, a, b, c, d, e, f) { 49505 if (false) { 49506 if (format === undefined) { 49507 throw new Error('invariant requires an error message argument'); 49508 } 49509 } 49510 49511 if (!condition) { 49512 var error; 49513 if (format === undefined) { 49514 error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.'); 49515 } else { 49516 var args = [a, b, c, d, e, f]; 49517 var argIndex = 0; 49518 error = new Error(format.replace(/%s/g, function () { 49519 return args[argIndex++]; 49520 })); 49521 error.name = 'Invariant Violation'; 49522 } 49523 49524 error.framesToPop = 1; // we don't care about invariant's own frame 49525 throw error; 49526 } 49527 }; 49528 49529 module.exports = invariant; 49530 49531/***/ }, 49532/* 456 */ 49533/***/ function(module, exports, __webpack_require__) { 49534 49535 'use strict'; 49536 49537 var numberIsNan = __webpack_require__(592); 49538 49539 module.exports = Number.isFinite || function (val) { 49540 return !(typeof val !== 'number' || numberIsNan(val) || val === Infinity || val === -Infinity); 49541 }; 49542 49543/***/ }, 49544/* 457 */ 49545/***/ function(module, exports) { 49546 49547 "use strict"; 49548 49549 // Copyright 2014, 2015, 2016, 2017 Simon Lydell 49550 // License: MIT. (See LICENSE.) 49551 49552 Object.defineProperty(exports, "__esModule", { 49553 value: true 49554 }); 49555 49556 // This regex comes from regex.coffee, and is inserted here by generate-index.js 49557 // (run `npm run build`). 49558 exports.default = /((['"])(?:(?!\2|\\).|\\(?:\r\n|[\s\S]))*(\2)?|`(?:[^`\\$]|\\[\s\S]|\$(?!\{)|\$\{(?:[^{}]|\{[^}]*\}?)*\}?)*(`)?)|(\/\/.*)|(\/\*(?:[^*]|\*(?!\/))*(\*\/)?)|(\/(?!\*)(?:\[(?:(?![\]\\]).|\\.)*\]|(?![\/\]\\]).|\\.)+\/(?:(?!\s*(?:\b|[\u0080-\uFFFF$\\'"~({]|[+\-!](?!=)|\.?\d))|[gmiyu]{1,5}\b(?![\u0080-\uFFFF$\\]|\s*(?:[+\-*%&|^<>!=?({]|\/(?![\/*])))))|(0[xX][\da-fA-F]+|0[oO][0-7]+|0[bB][01]+|(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?)|((?!\d)(?:(?!\s)[$\w\u0080-\uFFFF]|\\u[\da-fA-F]{4}|\\u\{[\da-fA-F]+\})+)|(--|\+\+|&&|\|\||=>|\.{3}|(?:[+\-\/%&|^]|\*{1,2}|<{1,2}|>{1,3}|!=?|={1,2})=?|[?~.,:;[\](){}])|(\s+)|(^$|[\s\S])/g; 49559 49560 exports.matchToToken = function (match) { 49561 var token = { type: "invalid", value: match[0] }; 49562 if (match[1]) token.type = "string", token.closed = !!(match[3] || match[4]);else if (match[5]) token.type = "comment";else if (match[6]) token.type = "comment", token.closed = !!match[7];else if (match[8]) token.type = "regex";else if (match[9]) token.type = "number";else if (match[10]) token.type = "name";else if (match[11]) token.type = "punctuator";else if (match[12]) token.type = "whitespace"; 49563 return token; 49564 }; 49565 49566/***/ }, 49567/* 458 */ 49568/***/ function(module, exports, __webpack_require__) { 49569 49570 var __WEBPACK_AMD_DEFINE_RESULT__;/* WEBPACK VAR INJECTION */(function(module, global) {'use strict'; 49571 49572 var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; 49573 49574 /*! https://mths.be/jsesc v1.3.0 by @mathias */ 49575 ;(function (root) { 49576 49577 // Detect free variables `exports` 49578 var freeExports = ( false ? 'undefined' : _typeof(exports)) == 'object' && exports; 49579 49580 // Detect free variable `module` 49581 var freeModule = ( false ? 'undefined' : _typeof(module)) == 'object' && module && module.exports == freeExports && module; 49582 49583 // Detect free variable `global`, from Node.js or Browserified code, 49584 // and use it as `root` 49585 var freeGlobal = (typeof global === 'undefined' ? 'undefined' : _typeof(global)) == 'object' && global; 49586 if (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal) { 49587 root = freeGlobal; 49588 } 49589 49590 /*--------------------------------------------------------------------------*/ 49591 49592 var object = {}; 49593 var hasOwnProperty = object.hasOwnProperty; 49594 var forOwn = function forOwn(object, callback) { 49595 var key; 49596 for (key in object) { 49597 if (hasOwnProperty.call(object, key)) { 49598 callback(key, object[key]); 49599 } 49600 } 49601 }; 49602 49603 var extend = function extend(destination, source) { 49604 if (!source) { 49605 return destination; 49606 } 49607 forOwn(source, function (key, value) { 49608 destination[key] = value; 49609 }); 49610 return destination; 49611 }; 49612
49613 var forEach = function forEach(array, callback) { 49614 var length = array.length; 49615 var index = -1; 49616 while (++index < length) { 49617 callback(array[index]); 49618 } 49619 }; 49620 49621 var toString = object.toString; 49622 var isArray = function isArray(value) { 49623 return toString.call(value) == '[object Array]'; 49624 }; 49625 var isObject = function isObject(value) { 49626 // This is a very simple check, but it’s good enough for what we need. 49627 return toString.call(value) == '[object Object]'; 49628 }; 49629 var isString = function isString(value) { 49630 return typeof value == 'string' || toString.call(value) == '[object String]'; 49631 }; 49632 var isNumber = function isNumber(value) { 49633 return typeof value == 'number' || toString.call(value) == '[object Number]'; 49634 }; 49635 var isFunction = function isFunction(value) { 49636 // In a perfect world, the `typeof` check would be sufficient. However, 49637 // in Chrome 1–12, `typeof /x/ == 'object'`, and in IE 6–8 49638 // `typeof alert == 'object'` and similar for other host objects. 49639 return typeof value == 'function' || toString.call(value) == '[object Function]'; 49640 }; 49641 var isMap = function isMap(value) { 49642 return toString.call(value) == '[object Map]'; 49643 }; 49644 var isSet = function isSet(value) { 49645 return toString.call(value) == '[object Set]'; 49646 }; 49647 49648 /*--------------------------------------------------------------------------*/ 49649 49650 // https://mathiasbynens.be/notes/javascript-escapes#single 49651 var singleEscapes = { 49652 '"': '\\"', 49653 '\'': '\\\'', 49654 '\\': '\\\\', 49655 '\b': '\\b', 49656 '\f': '\\f', 49657 '\n': '\\n', 49658 '\r': '\\r', 49659 '\t': '\\t' 49660 // `\v` is omitted intentionally, because in IE < 9, '\v' == 'v'. 49661 // '\v': '\\x0B' 49662 }; 49663 var regexSingleEscape = /["'\\\b\f\n\r\t]/; 49664 49665 var regexDigit = /[0-9]/; 49666 var regexWhitelist = /[ !#-&\(-\[\]-~]/; 49667 49668 var jsesc = function jsesc(argument, options) { 49669 // Handle options 49670 var defaults = { 49671 'escapeEverything': false, 49672 'escapeEtago': false, 49673 'quotes': 'single', 49674 'wrap': false, 49675 'es6': false, 49676 'json': false, 49677 'compact': true, 49678 'lowercaseHex': false, 49679 'numbers': 'decimal', 49680 'indent': '\t', 49681 '__indent__': '', 49682 '__inline1__': false, 49683 '__inline2__': false 49684 }; 49685 var json = options && options.json; 49686 if (json) { 49687 defaults.quotes = 'double'; 49688 defaults.wrap = true; 49689 } 49690 options = extend(defaults, options); 49691 if (options.quotes != 'single' && options.quotes != 'double') { 49692 options.quotes = 'single'; 49693 } 49694 var quote = options.quotes == 'double' ? '"' : '\''; 49695 var compact = options.compact; 49696 var indent = options.indent; 49697 var lowercaseHex = options.lowercaseHex; 49698 var oldIndent = ''; 49699 var inline1 = options.__inline1__; 49700 var inline2 = options.__inline2__; 49701 var newLine = compact ? '' : '\n'; 49702 var result; 49703 var isEmpty = true; 49704 var useBinNumbers = options.numbers == 'binary'; 49705 var useOctNumbers = options.numbers == 'octal'; 49706 var useDecNumbers = options.numbers == 'decimal'; 49707 var useHexNumbers = options.numbers == 'hexadecimal'; 49708 49709 if (json && argument && isFunction(argument.toJSON)) { 49710 argument = argument.toJSON(); 49711 } 49712 49713 if (!isString(argument)) { 49714 if (isMap(argument)) { 49715 if (argument.size == 0) { 49716 return 'new Map()'; 49717 } 49718 if (!compact) { 49719 options.__inline1__ = true; 49720 } 49721 return 'new Map(' + jsesc(Array.from(argument), options) + ')'; 49722 } 49723 if (isSet(argument)) { 49724 if (argument.size == 0) { 49725 return 'new Set()'; 49726 } 49727 return 'new Set(' + jsesc(Array.from(argument), options) + ')'; 49728 } 49729 if (isArray(argument)) { 49730 result = []; 49731 options.wrap = true; 49732 if (inline1) { 49733 options.__inline1__ = false; 49734 options.__inline2__ = true; 49735 } else { 49736 oldIndent = options.__indent__; 49737 indent += oldIndent; 49738 options.__indent__ = indent; 49739 } 49740 forEach(argument, function (value) { 49741 isEmpty = false; 49742 if (inline2) { 49743 options.__inline2__ = false; 49744 } 49745 result.push((compact || inline2 ? '' : indent) + jsesc(value, options)); 49746 }); 49747 if (isEmpty) { 49748 return '[]'; 49749 } 49750 if (inline2) { 49751 return '[' + result.join(', ') + ']'; 49752 } 49753 return '[' + newLine + result.join(',' + newLine) + newLine + (compact ? '' : oldIndent) + ']'; 49754 } else if (isNumber(argument)) { 49755 if (json) { 49756 // Some number values (e.g. `Infinity`) cannot be represented in JSON. 49757 return JSON.stringify(argument); 49758 } 49759 if (useDecNumbers) { 49760 return String(argument); 49761 } 49762 if (useHexNumbers) { 49763 var tmp = argument.toString(16); 49764 if (!lowercaseHex) { 49765 tmp = tmp.toUpperCase(); 49766 } 49767 return '0x' + tmp; 49768 } 49769 if (useBinNumbers) { 49770 return '0b' + argument.toString(2); 49771 } 49772 if (useOctNumbers) { 49773 return '0o' + argument.toString(8); 49774 } 49775 } else if (!isObject(argument)) { 49776 if (json) { 49777 // For some values (e.g. `undefined`, `function` objects), 49778 // `JSON.stringify(value)` returns `undefined` (which isn’t valid 49779 // JSON) instead of `'null'`. 49780 return JSON.stringify(argument) || 'null'; 49781 } 49782 return String(argument); 49783 } else { 49784 // it’s an object 49785 result = []; 49786 options.wrap = true; 49787 oldIndent = options.__indent__; 49788 indent += oldIndent; 49789 options.__indent__ = indent; 49790 forOwn(argument, function (key, value) { 49791 isEmpty = false;
49792 result.push((compact ? '' : indent) + jsesc(key, options) + ':' + (compact ? '' : ' ') + jsesc(value, options)); 49793 }); 49794 if (isEmpty) { 49795 return '{}'; 49796 } 49797 return '{' + newLine + result.join(',' + newLine) + newLine + (compact ? '' : oldIndent) + '}'; 49798 } 49799 } 49800 49801 var string = argument; 49802 // Loop over each code unit in the string and escape it 49803 var index = -1; 49804 var length = string.length; 49805 var first; 49806 var second; 49807 var codePoint; 49808 result = ''; 49809 while (++index < length) { 49810 var character = string.charAt(index); 49811 if (options.es6) { 49812 first = string.charCodeAt(index); 49813 if ( // check if it’s the start of a surrogate pair 49814 first >= 0xD800 && first <= 0xDBFF && // high surrogate 49815 length > index + 1 // there is a next code unit 49816 ) { 49817 second = string.charCodeAt(index + 1); 49818 if (second >= 0xDC00 && second <= 0xDFFF) { 49819 // low surrogate 49820 // https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae 49821 codePoint = (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000; 49822 var hexadecimal = codePoint.toString(16); 49823 if (!lowercaseHex) { 49824 hexadecimal = hexadecimal.toUpperCase(); 49825 } 49826 result += '\\u{' + hexadecimal + '}'; 49827 index++; 49828 continue; 49829 } 49830 } 49831 } 49832 if (!options.escapeEverything) { 49833 if (regexWhitelist.test(character)) { 49834 // It’s a printable ASCII character that is not `"`, `'` or `\`, 49835 // so don’t escape it. 49836 result += character; 49837 continue; 49838 } 49839 if (character == '"') { 49840 result += quote == character ? '\\"' : character; 49841 continue; 49842 } 49843 if (character == '\'') { 49844 result += quote == character ? '\\\'' : character; 49845 continue; 49846 } 49847 } 49848 if (character == '\0' && !json && !regexDigit.test(string.charAt(index + 1))) { 49849 result += '\\0'; 49850 continue; 49851 } 49852 if (regexSingleEscape.test(character)) { 49853 // no need for a `hasOwnProperty` check here 49854 result += singleEscapes[character]; 49855 continue; 49856 } 49857 var charCode = character.charCodeAt(0); 49858 var hexadecimal = charCode.toString(16); 49859 if (!lowercaseHex) { 49860 hexadecimal = hexadecimal.toUpperCase(); 49861 } 49862 var longhand = hexadecimal.length > 2 || json; 49863 var escaped = '\\' + (longhand ? 'u' : 'x') + ('0000' + hexadecimal).slice(longhand ? -4 : -2); 49864 result += escaped; 49865 continue; 49866 } 49867 if (options.wrap) { 49868 result = quote + result + quote; 49869 } 49870 if (options.escapeEtago) { 49871 // https://mathiasbynens.be/notes/etago 49872 return result.replace(/<\/(script|style)/gi, '<\\/$1'); 49873 } 49874 return result; 49875 }; 49876 49877 jsesc.version = '1.3.0'; 49878 49879 /*--------------------------------------------------------------------------*/ 49880 49881 // Some AMD build optimizers, like r.js, check for specific condition patterns 49882 // like the following: 49883 if ("function" == 'function' && _typeof(__webpack_require__(48)) == 'object' && __webpack_require__(48)) { 49884 !(__WEBPACK_AMD_DEFINE_RESULT__ = function () { 49885 return jsesc; 49886 }
49886.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); 49887 } else if (freeExports && !freeExports.nodeType) { 49888 if (freeModule) { 49889 // in Node.js or RingoJS v0.8.0+ 49890 freeModule.exports = jsesc; 49891 } else { 49892 // in Narwhal or RingoJS v0.7.0- 49893 freeExports.jsesc = jsesc; 49894 } 49895 } else { 49896 // in Rhino or a web browser 49897 root.jsesc = jsesc; 49898 } 49899 })(undefined); 49900 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(39)(module), (function() { return this; }()))) 49901 49902/***/ }, 49903/* 459 */ 49904/***/ function(module, exports, __webpack_require__) { 49905 49906 "use strict"; 49907 49908 var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; 49909 49910 // json5.js 49911 // Modern JSON. See README.md for details. 49912 // 49913 // This file is based directly off of Douglas Crockford's json_parse.js: 49914 // https://github.com/douglascrockford/JSON-js/blob/master/json_parse.js 49915 49916 var JSON5 = ( false ? "undefined" : _typeof(exports)) === 'object' ? exports : {}; 49917 49918 JSON5.parse = function () { 49919 "use strict"; 49920 49921 // This is a function that can parse a JSON5 text, producing a JavaScript 49922 // data structure. It is a simple, recursive descent parser. It does not use 49923 // eval or regular expressions, so it can be used as a model for implementing 49924 // a JSON5 parser in other languages. 49925 49926 // We are defining the function inside of another function to avoid creating 49927 // global variables. 49928 49929 var at, 49930 // The index of the current character 49931 lineNumber, 49932 // The current line number 49933 columnNumber, 49934 // The current column number 49935 ch, 49936 // The current character 49937 escapee = { 49938 "'": "'", 49939 '"': '"', 49940 '\\': '\\', 49941 '/': '/', 49942 '\n': '', // Replace escaped newlines in strings w/ empty string 49943 b: '\b', 49944 f: '\f', 49945 n: '\n', 49946 r: '\r', 49947 t: '\t' 49948 }, 49949 ws = [' ', '\t', '\r', '\n', '\v', '\f', '\xA0', "\uFEFF"], 49950 text, 49951 renderChar = function renderChar(chr) { 49952 return chr === '' ? 'EOF' : "'" + chr + "'"; 49953 }, 49954 error = function error(m) { 49955 49956 // Call error when something is wrong. 49957 49958 var error = new SyntaxError(); 49959 // beginning of message suffix to agree with that provided by Gecko - see https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse 49960 error.message = m + " at line " + lineNumber + " column " + columnNumber + " of the JSON5 data. Still to read: " + JSON.stringify(text.substring(at - 1, at + 19)); 49961 error.at = at; 49962 // These two property names have been chosen to agree with the ones in Gecko, the only popular 49963 // environment which seems to supply this info on JSON.parse 49964 error.lineNumber = lineNumber; 49965 error.columnNumber = columnNumber; 49966 throw error; 49967 }, 49968 next = function next(c) { 49969 49970 // If a c parameter is provided, verify that it matches the current character. 49971 49972 if (c && c !== ch) { 49973 error("Expected " + renderChar(c) + " instead of " + renderChar(ch)); 49974 } 49975 49976 // Get the next character. When there are no more characters, 49977 // return the empty string. 49978 49979 ch = text.charAt(at); 49980 at++; 49981 columnNumber++; 49982 if (ch === '\n' || ch === '\r' && peek() !== '\n') { 49983 lineNumber++; 49984 columnNumber = 0; 49985 } 49986 return ch; 49987 }, 49988 peek = function peek() { 49989 49990 // Get the next character without consuming it or 49991 // assigning it to the ch varaible. 49992 49993 return text.charAt(at); 49994 }, 49995 identifier = function identifier() { 49996 49997 // Parse an identifier. Normally, reserved words are disallowed here, but we 49998 // only use this for unquoted object keys, where reserved words are allowed, 49999 // so we don't check for those here. References: 50000 // - http://es5.github.com/#x7.6 50001 // - https://developer.mozilla.org/en/Core_JavaScript_1.5_Guide/Core_Language_Features#Variables 50002 // - http://docstore.mik.ua/orelly/webprog/jscript/ch02_07.htm 50003 // TODO Identifiers can have Unicode "letters" in them; add support for those. 50004 50005 var key = ch; 50006 50007 // Identifiers must start with a letter, _ or $. 50008 if (ch !== '_' && ch !== '$' && (ch < 'a' || ch > 'z') && (ch < 'A' || ch > 'Z')) { 50009 error("Bad identifier as unquoted key"); 50010 } 50011 50012 // Subsequent characters can contain digits. 50013 while (next() && (ch === '_' || ch === '$' || ch >= 'a' && ch <= 'z' || ch >= 'A' && ch <= 'Z' || ch >= '0' && ch <= '9')) { 50014 key += ch; 50015 } 50016 50017 return key; 50018 }, 50019 number = function number() { 50020 50021 // Parse a number value. 50022 50023 var number, 50024 sign = '',
50025 string = '', 50026 base = 10; 50027 50028 if (ch === '-' || ch === '+') { 50029 sign = ch; 50030 next(ch); 50031 } 50032 50033 // support for Infinity (could tweak to allow other words): 50034 if (ch === 'I') { 50035 number = word(); 50036 if (typeof number !== 'number' || isNaN(number)) { 50037 error('Unexpected word for number'); 50038 } 50039 return sign === '-' ? -number : number; 50040 } 50041 50042 // support for NaN 50043 if (ch === 'N') { 50044 number = word(); 50045 if (!isNaN(number)) { 50046 error('expected word to be NaN'); 50047 } 50048 // ignore sign as -NaN also is NaN 50049 return number; 50050 } 50051 50052 if (ch === '0') { 50053 string += ch; 50054 next(); 50055 if (ch === 'x' || ch === 'X') { 50056 string += ch; 50057 next(); 50058 base = 16; 50059 } else if (ch >= '0' && ch <= '9') { 50060 error('Octal literal'); 50061 } 50062 } 50063 50064 switch (base) { 50065 case 10: 50066 while (ch >= '0' && ch <= '9') { 50067 string += ch; 50068 next(); 50069 } 50070 if (ch === '.') { 50071 string += '.'; 50072 while (next() && ch >= '0' && ch <= '9') { 50073 string += ch; 50074 } 50075 } 50076 if (ch === 'e' || ch === 'E') { 50077 string += ch; 50078 next(); 50079 if (ch === '-' || ch === '+') { 50080 string += ch; 50081 next(); 50082 } 50083 while (ch >= '0' && ch <= '9') { 50084 string += ch; 50085 next(); 50086 } 50087 } 50088 break; 50089 case 16: 50090 while (ch >= '0' && ch <= '9' || ch >= 'A' && ch <= 'F' || ch >= 'a' && ch <= 'f') { 50091 string += ch; 50092 next(); 50093 } 50094 break; 50095 } 50096 50097 if (sign === '-') { 50098 number = -string; 50099 } else { 50100 number = +string; 50101 } 50102 50103 if (!isFinite(number)) { 50104 error("Bad number"); 50105 } else { 50106 return number; 50107 } 50108 }, 50109 string = function string() { 50110 50111 // Parse a string value. 50112 50113 var hex, 50114 i, 50115 string = '', 50116 delim, 50117 // double quote or single quote 50118 uffff; 50119 50120 // When parsing for string values, we must look for ' or " and \ characters. 50121 50122 if (ch === '"' || ch === "'") { 50123 delim = ch; 50124 while (next()) { 50125 if (ch === delim) { 50126 next(); 50127 return string; 50128 } else if (ch === '\\') { 50129 next(); 50130 if (ch === 'u') { 50131 uffff = 0; 50132 for (i = 0; i < 4; i += 1) { 50133 hex = parseInt(next(), 16); 50134 if (!isFinite(hex)) { 50135 break; 50136 } 50137 uffff = uffff * 16 + hex; 50138 } 50139 string += String.fromCharCode(uffff); 50140 } else if (ch === '\r') { 50141 if (peek() === '\n') { 50142 next(); 50143 } 50144 } else if (typeof escapee[ch] === 'string') { 50145 string += escapee[ch]; 50146 } else { 50147 break; 50148 } 50149 } else if (ch === '\n') { 50150 // unescaped newlines are invalid; see: 50151 // https://github.com/aseemk/json5/issues/24 50152 // TODO this feels special-cased; are there other 50153 // invalid unescaped chars? 50154 break; 50155 } else {
50156 string += ch; 50157 } 50158 } 50159 } 50160 error("Bad string"); 50161 }, 50162 inlineComment = function inlineComment() { 50163 50164 // Skip an inline comment, assuming this is one. The current character should 50165 // be the second / character in the // pair that begins this inline comment. 50166 // To finish the inline comment, we look for a newline or the end of the text. 50167 50168 if (ch !== '/') { 50169 error("Not an inline comment"); 50170 } 50171 50172 do { 50173 next(); 50174 if (ch === '\n' || ch === '\r') { 50175 next(); 50176 return; 50177 } 50178 } while (ch); 50179 }, 50180 blockComment = function blockComment() { 50181 50182 // Skip a block comment, assuming this is one. The current character should be 50183 // the * character in the /* pair that begins this block comment. 50184 // To finish the block comment, we look for an ending */ pair of characters, 50185 // but we also watch for the end of text before the comment is terminated. 50186 50187 if (ch !== '*') { 50188 error("Not a block comment"); 50189 } 50190 50191 do { 50192 next(); 50193 while (ch === '*') { 50194 next('*'); 50195 if (ch === '/') { 50196 next('/'); 50197 return; 50198 } 50199 } 50200 } while (ch); 50201 50202 error("Unterminated block comment"); 50203 }, 50204 comment = function comment() { 50205 50206 // Skip a comment, whether inline or block-level, assuming this is one. 50207 // Comments always begin with a / character. 50208 50209 if (ch !== '/') { 50210 error("Not a comment"); 50211 } 50212 50213 next('/'); 50214 50215 if (ch === '/') { 50216 inlineComment(); 50217 } else if (ch === '*') { 50218 blockComment(); 50219 } else { 50220 error("Unrecognized comment"); 50221 } 50222 }, 50223 white = function white() { 50224 50225 // Skip whitespace and comments. 50226 // Note that we're detecting comments by only a single / character. 50227 // This works since regular expressions are not valid JSON(5), but this will 50228 // break if there are other valid values that begin with a / character! 50229 50230 while (ch) { 50231 if (ch === '/') { 50232 comment(); 50233 } else if (ws.indexOf(ch) >= 0) { 50234 next(); 50235 } else { 50236 return; 50237 } 50238 } 50239 }, 50240 word = function word() { 50241 50242 // true, false, or null. 50243 50244 switch (ch) { 50245 case 't': 50246 next('t'); 50247 next('r'); 50248 next('u'); 50249 next('e'); 50250 return true; 50251 case 'f': 50252 next('f'); 50253 next('a'); 50254 next('l'); 50255 next('s'); 50256 next('e'); 50257 return false; 50258 case 'n': 50259 next('n'); 50260 next('u'); 50261 next('l'); 50262 next('l'); 50263 return null; 50264 case 'I': 50265 next('I'); 50266 next('n'); 50267 next('f'); 50268 next('i'); 50269 next('n'); 50270 next('i'); 50271 next('t'); 50272 next('y'); 50273 return Infinity; 50274 case 'N': 50275 next('N'); 50276 next('a'); 50277 next('N'); 50278 return NaN; 50279 } 50280 error("Unexpected " + renderChar(ch)); 50281 }, 50282 value, 50283 // Place holder for the value function. 50284 50285 array = function array() { 50286 50287 // Parse an array value. 50288 50289 var array = []; 50290 50291 if (ch === '[') { 50292 next('['); 50293 white(); 50294 while (ch) { 50295 if (ch === ']') { 50296 next(']'); 50297 return array; // Potentially empty array 50298 } 50299 // ES5 allows omitting elements in arrays, e.g. [,] and 50300 // [,null]. We don't allow this in JSON5. 50301 if (ch === ',') { 50302 error("Missing array element"); 50303 } else { 50304 array.push(value()); 50305 } 50306 white(); 50307 // If there's no comma after this value, this needs to 50308 // be the end of the array. 50309 if (ch !== ',') { 50310 next(']'); 50311 return array; 50312 } 50313 next(','); 50314 white(); 50315 } 50316 } 50317 error("Bad array"); 50318 }, 50319 object = function object() { 50320 50321 // Parse an object value. 50322 50323 var key, 50324 object = {}; 50325 50326 if (ch === '{') { 50327 next('{'); 50328 white(); 50329 while (ch) { 50330 if (ch === '}') { 50331 next('}'); 50332 return object; // Potentially empty object 50333 } 50334 50335 // Keys can be unquoted. If they are, they need to be 50336 // valid JS identifiers. 50337 if (ch === '"' || ch === "'") { 50338 key = string(); 50339 } else { 50340 key = identifier(); 50341 } 50342 50343 white(); 50344 next(':'); 50345 object[key] = value(); 50346 white(); 50347 // If there's no comma after this pair, this needs to be 50348 // the end of the object. 50349 if (ch !== ',') { 50350 next('}'); 50351 return object; 50352 } 50353 next(','); 50354 white(); 50355 } 50356 } 50357 error("Bad object"); 50358 }; 50359 50360 value = function value() { 50361 50362 // Parse a JSON value. It could be an object, an array, a string, a number, 50363 // or a word. 50364 50365 white(); 50366 switch (ch) { 50367 case '{': 50368 return object(); 50369 case '[': 50370 return array(); 50371 case '"':
50372 case "'": 50373 return string(); 50374 case '-': 50375 case '+': 50376 case '.': 50377 return number(); 50378 default: 50379 return ch >= '0' && ch <= '9' ? number() : word(); 50380 } 50381 }; 50382 50383 // Return the json_parse function. It will have access to all of the above 50384 // functions and variables. 50385 50386 return function (source, reviver) { 50387 var result; 50388 50389 text = String(source); 50390 at = 0; 50391 lineNumber = 1; 50392 columnNumber = 1; 50393 ch = ' '; 50394 result = value(); 50395 white(); 50396 if (ch) { 50397 error("Syntax error"); 50398 } 50399 50400 // If there is a reviver function, we recursively walk the new structure, 50401 // passing each name/value pair to the reviver function for possible 50402 // transformation, starting with a temporary root object that holds the result 50403 // in an empty key. If there is not a reviver function, we simply return the 50404 // result. 50405 50406 return typeof reviver === 'function' ? function walk(holder, key) { 50407 var k, 50408 v, 50409 value = holder[key]; 50410 if (value && (typeof value === "undefined" ? "undefined" : _typeof(value)) === 'object') { 50411 for (k in value) { 50412 if (Object.prototype.hasOwnProperty.call(value, k)) { 50413 v = walk(value, k); 50414 if (v !== undefined) { 50415 value[k] = v; 50416 } else { 50417 delete value[k]; 50418 } 50419 } 50420 } 50421 } 50422 return reviver.call(holder, key, value); 50423 }({ '': result }, '') : result; 50424 }; 50425 }(); 50426 50427 // JSON5 stringify will not quote keys where appropriate 50428 JSON5.stringify = function (obj, replacer, space) { 50429 if (replacer && typeof replacer !== "function" && !isArray(replacer)) { 50430 throw new Error('Replacer must be a function or an array'); 50431 } 50432 var getReplacedValueOrUndefined = function getReplacedValueOrUndefined(holder, key, isTopLevel) { 50433 var value = holder[key]; 50434 50435 // Replace the value with its toJSON value first, if possible 50436 if (value && value.toJSON && typeof value.toJSON === "function") { 50437 value = value.toJSON(); 50438 } 50439 50440 // If the user-supplied replacer if a function, call it. If it's an array, check objects' string keys for 50441 // presence in the array (removing the key/value pair from the resulting JSON if the key is missing). 50442 if (typeof replacer === "function") { 50443 return replacer.call(holder, key, value); 50444 } else if (replacer) { 50445 if (isTopLevel || isArray(holder) || replacer.indexOf(key) >= 0) { 50446 return value; 50447 } else { 50448 return undefined; 50449 } 50450 } else { 50451 return value; 50452 } 50453 }; 50454 50455 function isWordChar(c) { 50456 return c >= 'a' && c <= 'z' || c >= 'A' && c <= 'Z' || c >= '0' && c <= '9' || c === '_' || c === '$'; 50457 } 50458 50459 function isWordStart(c) { 50460 return c >= 'a' && c <= 'z' || c >= 'A' && c <= 'Z' || c === '_' || c === '$'; 50461 } 50462 50463 function isWord(key) { 50464 if (typeof key !== 'string') { 50465 return false; 50466 } 50467 if (!isWordStart(key[0])) { 50468 return false; 50469 } 50470 var i = 1, 50471 length = key.length; 50472 while (i < length) { 50473 if (!isWordChar(key[i])) { 50474 return false; 50475 } 50476 i++; 50477 } 50478 return true; 50479 } 50480 50481 // export for use in tests 50482 JSON5.isWord = isWord; 50483 50484 // polyfills 50485 function isArray(obj) { 50486 if (Array.isArray) { 50487 return Array.isArray(obj); 50488 } else { 50489 return Object.prototype.toString.call(obj) === '[object Array]'; 50490 } 50491 } 50492 50493 function isDate(obj) { 50494 return Object.prototype.toString.call(obj) === '[object Date]'; 50495 } 50496 50497 var objStack = []; 50498 function checkForCircular(obj) { 50499 for (var i = 0; i < objStack.length; i++) { 50500 if (objStack[i] === obj) { 50501 throw new TypeError("Converting circular structure to JSON"); 50502 } 50503 } 50504 } 50505 50506 function makeIndent(str, num, noNewLine) { 50507 if (!str) { 50508 return ""; 50509 } 50510 // indentation no more than 10 chars 50511 if (str.length > 10) { 50512 str = str.substring(0, 10); 50513 } 50514 50515 var indent = noNewLine ? "" : "\n"; 50516 for (var i = 0; i < num; i++) { 50517 indent += str; 50518 } 50519 50520 return indent; 50521 } 50522 50523 var indentStr; 50524 if (space) { 50525 if (typeof space === "string") { 50526 indentStr = space; 50527 } else if (typeof space === "number" && space >= 0) { 50528 indentStr = makeIndent(" ", space, true); 50529 } else { 50530 // ignore space parameter 50531 } 50532 } 50533 50534 // Copied from Crokford's implementation of JSON 50535 // See https://github.com/douglascrockford/JSON-js/blob/e39db4b7e6249f04a195e7dd0840e610cc9e941e/json2.js#L195 50536 // Begin 50537 var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, 50538 escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, 50539 meta = { // table of character substitutions 50540 '\b': '\\b', 50541 '\t': '\\t', 50542 '\n': '\\n', 50543 '\f': '\\f', 50544 '\r': '\\r', 50545 '"': '\\"', 50546 '\\': '\\\\' 50547 }; 50548 function escapeString(string) { 50549
50550 // If the string contains no control characters, no quote characters, and no 50551 // backslash characters, then we can safely slap some quotes around it. 50552 // Otherwise we must also replace the offending characters with safe escape 50553 // sequences. 50554 escapable.lastIndex = 0; 50555 return escapable.test(string) ? '"' + string.replace(escapable, function (a) { 50556 var c = meta[a]; 50557 return typeof c === 'string' ? c : "\\u" + ('0000' + a.charCodeAt(0).toString(16)).slice(-4); 50558 }) + '"' : '"' + string + '"'; 50559 } 50560 // End 50561 50562 function internalStringify(holder, key, isTopLevel) { 50563 var buffer, res; 50564 50565 // Replace the value, if necessary 50566 var obj_part = getReplacedValueOrUndefined(holder, key, isTopLevel); 50567 50568 if (obj_part && !isDate(obj_part)) { 50569 // unbox objects 50570 // don't unbox dates, since will turn it into number 50571 obj_part = obj_part.valueOf(); 50572 } 50573 switch (typeof obj_part === "undefined" ? "undefined" : _typeof(obj_part)) { 50574 case "boolean": 50575 return obj_part.toString(); 50576 50577 case "number": 50578 if (isNaN(obj_part) || !isFinite(obj_part)) { 50579 return "null"; 50580 } 50581 return obj_part.toString(); 50582 50583 case "string": 50584 return escapeString(obj_part.toString()); 50585 50586 case "object": 50587 if (obj_part === null) { 50588 return "null"; 50589 } else if (isArray(obj_part)) { 50590 checkForCircular(obj_part); 50591 buffer = "["; 50592 objStack.push(obj_part); 50593 50594 for (var i = 0; i < obj_part.length; i++) { 50595 res = internalStringify(obj_part, i, false); 50596 buffer += makeIndent(indentStr, objStack.length); 50597 if (res === null || typeof res === "undefined") { 50598 buffer += "null"; 50599 } else { 50600 buffer += res; 50601 } 50602 if (i < obj_part.length - 1) { 50603 buffer += ","; 50604 } else if (indentStr) { 50605 buffer += "\n"; 50606 } 50607 } 50608 objStack.pop(); 50609 if (obj_part.length) { 50610 buffer += makeIndent(indentStr, objStack.length, true); 50611 } 50612 buffer += "]"; 50613 } else { 50614 checkForCircular(obj_part); 50615 buffer = "{"; 50616 var nonEmpty = false; 50617 objStack.push(obj_part); 50618 for (var prop in obj_part) { 50619 if (obj_part.hasOwnProperty(prop)) { 50620 var value = internalStringify(obj_part, prop, false); 50621 isTopLevel = false; 50622 if (typeof value !== "undefined" && value !== null) { 50623 buffer += makeIndent(indentStr, objStack.length); 50624 nonEmpty = true; 50625 key = isWord(prop) ? prop : escapeString(prop); 50626 buffer += key + ":" + (indentStr ? ' ' : '') + value + ","; 50627 } 50628 } 50629 } 50630 objStack.pop(); 50631 if (nonEmpty) { 50632 buffer = buffer.substring(0, buffer.length - 1) + makeIndent(indentStr, objStack.length) + "}"; 50633 } else { 50634 buffer = '{}'; 50635 } 50636 } 50637 return buffer; 50638 default: 50639 // functions and undefined should be ignored 50640 return undefined; 50641 } 50642 } 50643 50644 // special case...when undefined is used inside of 50645 // a compound object/array, return null. 50646 // but when top-level, return undefined 50647 var topLevelHolder = { "": obj }; 50648 if (obj === undefined) { 50649 return getReplacedValueOrUndefined(topLevelHolder, '', true); 50650 } 50651 return internalStringify(topLevelHolder, '', true); 50652 }; 50653 50654/***/ }, 50655/* 460 */
50656/***/ function(module, exports) { 50657 50658 'use strict'; 50659 50660 var arr = []; 50661 var charCodeCache = []; 50662 50663 module.exports = function (a, b) { 50664 if (a === b) { 50665 return 0; 50666 } 50667 50668 var aLen = a.length; 50669 var bLen = b.length; 50670 50671 if (aLen === 0) { 50672 return bLen; 50673 } 50674 50675 if (bLen === 0) { 50676 return aLen; 50677 } 50678 50679 var bCharCode; 50680 var ret; 50681 var tmp; 50682 var tmp2; 50683 var i = 0; 50684 var j = 0; 50685 50686 while (i < aLen) { 50687 charCodeCache[i] = a.charCodeAt(i); 50688 arr[i] = ++i; 50689 } 50690 50691 while (j < bLen) { 50692 bCharCode = b.charCodeAt(j); 50693 tmp = j++; 50694 ret = j; 50695 50696 for (i = 0; i < aLen; i++) { 50697 tmp2 = bCharCode === charCodeCache[i] ? tmp : tmp + 1; 50698 tmp = arr[i]; 50699 ret = arr[i] = tmp > ret ? tmp2 > ret ? ret + 1 : tmp2 : tmp2 > tmp ? tmp + 1 : tmp2; 50700 } 50701 } 50702 50703 return ret; 50704 }; 50705 50706/***/ }, 50707/* 461 */ 50708/***/ function(module, exports, __webpack_require__) { 50709 50710 'use strict'; 50711 50712 var getNative = __webpack_require__(38), 50713 root = __webpack_require__(15); 50714 50715 /* Built-in method references that are verified to be native. */ 50716 var DataView = getNative(root, 'DataView'); 50717 50718 module.exports = DataView; 50719 50720/***/ }, 50721/* 462 */ 50722/***/ function(module, exports, __webpack_require__) { 50723 50724 'use strict'; 50725 50726 var hashClear = __webpack_require__(525), 50727 hashDelete = __webpack_require__(526), 50728 hashGet = __webpack_require__(527), 50729 hashHas = __webpack_require__(528), 50730 hashSet = __webpack_require__(529); 50731 50732 /** 50733 * Creates a hash object. 50734 * 50735 * @private 50736 * @constructor 50737 * @param {Array} [entries] The key-value pairs to cache. 50738 */ 50739 function Hash(entries) { 50740 var index = -1, 50741 length = entries == null ? 0 : entries.length; 50742 50743 this.clear(); 50744 while (++index < length) { 50745 var entry = entries[index]; 50746 this.set(entry[0], entry[1]); 50747 } 50748 } 50749 50750 // Add methods to `Hash`. 50751 Hash.prototype.clear = hashClear; 50752 Hash.prototype['delete'] = hashDelete; 50753 Hash.prototype.get = hashGet; 50754 Hash.prototype.has = hashHas; 50755 Hash.prototype.set = hashSet; 50756 50757 module.exports = Hash; 50758 50759/***/ }, 50760/* 463 */ 50761/***/ function(module, exports, __webpack_require__) { 50762 50763 'use strict'; 50764 50765 var getNative = __webpack_require__(38), 50766 root = __webpack_require__(15); 50767 50768 /* Built-in method references that are verified to be native. */ 50769 var Promise = getNative(root, 'Promise'); 50770 50771 module.exports = Promise; 50772 50773/***/ }, 50774/* 464 */ 50775/***/ function(module, exports, __webpack_require__) { 50776 50777 'use strict'; 50778 50779 var getNative = __webpack_require__(38), 50780 root = __webpack_require__(15); 50781 50782 /* Built-in method references that are verified to be native. */ 50783 var WeakMap = getNative(root, 'WeakMap'); 50784 50785 module.exports = WeakMap; 50786 50787/***/ }, 50788/* 465 */ 50789/***/ function(module, exports) { 50790 50791 "use strict"; 50792 50793 /** 50794 * Adds the key-value `pair` to `map`. 50795 * 50796 * @private 50797 * @param {Object} map The map to modify. 50798 * @param {Array} pair The key-value pair to add. 50799 * @returns {Object} Returns `map`. 50800 */ 50801 function addMapEntry(map, pair) { 50802 // Don't return `map.set` because it's not chainable in IE 11. 50803 map.set(pair[0], pair[1]); 50804 return map; 50805 } 50806 50807 module.exports = addMapEntry; 50808 50809/***/ }, 50810/* 466 */ 50811/***/ function(module, exports) { 50812 50813 "use strict"; 50814 50815 /** 50816 * Adds `value` to `set`. 50817 * 50818 * @private 50819 * @param {Object} set The set to modify. 50820 * @param {*} value The value to add. 50821 * @returns {Object} Returns `set`. 50822 */ 50823 function addSetEntry(set, value) { 50824 // Don't return `set.add` because it's not chainable in IE 11. 50825 set.add(value); 50826 return set; 50827 } 50828 50829 module.exports = addSetEntry; 50830 50831/***/ }, 50832/* 467 */ 50833/***/ function(module, exports) { 50834 50835 "use strict"; 50836 50837 /** 50838 * A specialized version of `_.forEach` for arrays without support for 50839 * iteratee shorthands. 50840 * 50841 * @private 50842 * @param {Array} [array] The array to iterate over. 50843 * @param {Function} iteratee The function invoked per iteration. 50844 * @returns {Array} Returns `array`. 50845 */ 50846 function arrayEach(array, iteratee) { 50847 var index = -1, 50848 length = array == null ? 0 : array.length; 50849 50850 while (++index < length) { 50851 if (iteratee(array[index], index, array) === false) { 50852 break; 50853 } 50854 } 50855 return array; 50856 } 50857 50858 module.exports = arrayEach; 50859 50860/***/ }, 50861/* 468 */
50862/***/ function(module, exports) { 50863 50864 "use strict"; 50865 50866 /** 50867 * A specialized version of `_.filter` for arrays without support for 50868 * iteratee shorthands. 50869 * 50870 * @private 50871 * @param {Array} [array] The array to iterate over. 50872 * @param {Function} predicate The function invoked per iteration. 50873 * @returns {Array} Returns the new filtered array. 50874 */ 50875 function arrayFilter(array, predicate) { 50876 var index = -1, 50877 length = array == null ? 0 : array.length, 50878 resIndex = 0, 50879 result = []; 50880 50881 while (++index < length) { 50882 var value = array[index]; 50883 if (predicate(value, index, array)) { 50884 result[resIndex++] = value; 50885 } 50886 } 50887 return result; 50888 } 50889 50890 module.exports = arrayFilter; 50891 50892/***/ }, 50893/* 469 */ 50894/***/ function(module, exports, __webpack_require__) { 50895 50896 'use strict'; 50897 50898 var baseIndexOf = __webpack_require__(162); 50899 50900 /** 50901 * A specialized version of `_.includes` for arrays without support for 50902 * specifying an index to search from. 50903 * 50904 * @private 50905 * @param {Array} [array] The array to inspect. 50906 * @param {*} target The value to search for. 50907 * @returns {boolean} Returns `true` if `target` is found, else `false`. 50908 */ 50909 function arrayIncludes(array, value) { 50910 var length = array == null ? 0 : array.length; 50911 return !!length && baseIndexOf(array, value, 0) > -1; 50912 } 50913 50914 module.exports = arrayIncludes; 50915 50916/***/ }, 50917/* 470 */ 50918/***/ function(module, exports) { 50919 50920 "use strict"; 50921 50922 /** 50923 * This function is like `arrayIncludes` except that it accepts a comparator. 50924 * 50925 * @private 50926 * @param {Array} [array] The array to inspect. 50927 * @param {*} target The value to search for. 50928 * @param {Function} comparator The comparator invoked per element. 50929 * @returns {boolean} Returns `true` if `target` is found, else `false`. 50930 */ 50931 function arrayIncludesWith(array, value, comparator) { 50932 var index = -1, 50933 length = array == null ? 0 : array.length; 50934 50935 while (++index < length) { 50936 if (comparator(value, array[index])) { 50937 return true; 50938 } 50939 } 50940 return false; 50941 } 50942 50943 module.exports = arrayIncludesWith; 50944 50945/***/ }, 50946/* 471 */ 50947/***/ function(module, exports) { 50948 50949 "use strict"; 50950 50951 /** 50952 * A specialized version of `_.some` for arrays without support for iteratee 50953 * shorthands. 50954 * 50955 * @private 50956 * @param {Array} [array] The array to iterate over. 50957 * @param {Function} predicate The function invoked per iteration. 50958 * @returns {boolean} Returns `true` if any element passes the predicate check, 50959 * else `false`. 50960 */ 50961 function arraySome(array, predicate) { 50962 var index = -1, 50963 length = array == null ? 0 : array.length; 50964 50965 while (++index < length) { 50966 if (predicate(array[index], index, array)) { 50967 return true; 50968 } 50969 } 50970 return false; 50971 } 50972 50973 module.exports = arraySome; 50974 50975/***/ }, 50976/* 472 */ 50977/***/ function(module, exports, __webpack_require__) { 50978 50979 'use strict'; 50980 50981 var copyObject = __webpack_require__(30), 50982 keys = __webpack_require__(31); 50983 50984 /** 50985 * The base implementation of `_.assign` without support for multiple sources 50986 * or `customizer` functions. 50987 * 50988 * @private 50989 * @param {Object} object The destination object. 50990 * @param {Object} source The source object. 50991 * @returns {Object} Returns `object`. 50992 */ 50993 function baseAssign(object, source) { 50994 return object && copyObject(source, keys(source), object); 50995 } 50996 50997 module.exports = baseAssign; 50998 50999/***/ }, 51000/* 473 */ 51001/***/ function(module, exports, __webpack_require__) { 51002 51003 'use strict'; 51004 51005 var copyObject = __webpack_require__(30), 51006 keysIn = __webpack_require__(46); 51007 51008 /** 51009 * The base implementation of `_.assignIn` without support for multiple sources 51010 * or `customizer` functions. 51011 * 51012 * @private 51013 * @param {Object} object The destination object. 51014 * @param {Object} source The source object. 51015 * @returns {Object} Returns `object`. 51016 */ 51017 function baseAssignIn(object, source) { 51018 return object && copyObject(source, keysIn(source), object); 51019 } 51020 51021 module.exports = baseAssignIn; 51022 51023/***/ }, 51024/* 474 */ 51025/***/ function(module, exports) { 51026 51027 "use strict"; 51028 51029 /** 51030 * The base implementation of `_.clamp` which doesn't coerce arguments. 51031 * 51032 * @private 51033 * @param {number} number The number to clamp. 51034 * @param {number} [lower] The lower bound. 51035 * @param {number} upper The upper bound. 51036 * @returns {number} Returns the clamped number. 51037 */ 51038 function baseClamp(number, lower, upper) { 51039 if (number === number) { 51040 if (upper !== undefined) { 51041 number = number <= upper ? number : upper; 51042 } 51043 if (lower !== undefined) { 51044 number = number >= lower ? number : lower; 51045 } 51046 } 51047 return number; 51048 } 51049 51050 module.exports = baseClamp; 51051 51052/***/ }, 51053/* 475 */ 51054/***/ function(module, exports, __webpack_require__) { 51055 51056 'use strict'; 51057 51058 var isObject = __webpack_require__(16); 51059 51060 /** Built-in value references. */ 51061 var objectCreate = Object.create; 51062 51063 /** 51064 * The base implementation of `_.create` without support for assigning 51065 * properties to the created object. 51066 * 51067 * @private 51068 * @param {Object} proto The object to inherit from. 51069 * @returns {Object} Returns the new object. 51070 */ 51071 var baseCreate = function () { 51072 function object() {} 51073 return function (proto) { 51074 if (!isObject(proto)) { 51075 return {}; 51076 } 51077 if (objectCreate) { 51078 return objectCreate(proto); 51079 } 51080 object.prototype = proto; 51081 var result = new object(); 51082 object.prototype = undefined; 51083 return result; 51084 }; 51085 }(); 51086 51087 module.exports = baseCreate; 51088 51089/***/ }, 51090/* 476 */ 51091/***/ function(module, exports, __webpack_require__) { 51092 51093 'use strict'; 51094 51095 var baseForOwn = __webpack_require__(478), 51096 createBaseEach = __webpack_require__(515); 51097 51098 /** 51099 * The base implementation of `_.forEach` without support for iteratee shorthands. 51100 * 51101 * @private 51102 * @param {Array|Object} collection The collection to iterate over. 51103 * @param {Function} iteratee The function invoked per iteration. 51104 * @returns {Array|Object} Returns `collection`. 51105 */ 51106 var baseEach = createBaseEach(baseForOwn); 51107 51108 module.exports = baseEach; 51109 51110/***/ }, 51111/* 477 */ 51112/***/ function(module, exports, __webpack_require__) { 51113 51114 'use strict'; 51115 51116 var arrayPush = __webpack_require__(157), 51117 isFlattenable = __webpack_require__(532); 51118 51119 /** 51120 * The base implementation of `_.flatten` with support for restricting flattening. 51121 * 51122 * @private 51123 * @param {Array} array The array to flatten. 51124 * @param {number} depth The maximum recursion depth. 51125 * @param {boolean} [predicate=isFlattenable] The function invoked per iteration. 51126 * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks. 51127 * @param {Array} [result=[]] The initial result value. 51128 * @returns {Array} Returns the new flattened array.
51129 */ 51130 function baseFlatten(array, depth, predicate, isStrict, result) { 51131 var index = -1, 51132 length = array.length; 51133 51134 predicate || (predicate = isFlattenable); 51135 result || (result = []); 51136 51137 while (++index < length) { 51138 var value = array[index]; 51139 if (depth > 0 && predicate(value)) { 51140 if (depth > 1) { 51141 // Recursively flatten arrays (susceptible to call stack limits). 51142 baseFlatten(value, depth - 1, predicate, isStrict, result); 51143 } else { 51144 arrayPush(result, value); 51145 } 51146 } else if (!isStrict) { 51147 result[result.length] = value; 51148 } 51149 } 51150 return result; 51151 } 51152 51153 module.exports = baseFlatten; 51154 51155/***/ }, 51156/* 478 */ 51157/***/ function(module, exports, __webpack_require__) { 51158 51159 'use strict'; 51160 51161 var baseFor = __webpack_require__(244), 51162 keys = __webpack_require__(31); 51163 51164 /** 51165 * The base implementation of `_.forOwn` without support for iteratee shorthands. 51166 * 51167 * @private 51168 * @param {Object} object The object to iterate over. 51169 * @param {Function} iteratee The function invoked per iteration. 51170 * @returns {Object} Returns `object`. 51171 */ 51172 function baseForOwn(object, iteratee) { 51173 return object && baseFor(object, iteratee, keys); 51174 } 51175 51176 module.exports = baseForOwn; 51177 51178/***/ }, 51179/* 479 */ 51180/***/ function(module, exports) { 51181 51182 "use strict"; 51183 51184 /** Used for built-in method references. */ 51185 var objectProto = Object.prototype; 51186 51187 /** Used to check objects for own properties. */ 51188 var hasOwnProperty = objectProto.hasOwnProperty; 51189 51190 /** 51191 * The base implementation of `_.has` without support for deep paths. 51192 * 51193 * @private 51194 * @param {Object} [object] The object to query. 51195 * @param {Array|string} key The key to check. 51196 * @returns {boolean} Returns `true` if `key` exists, else `false`. 51197 */ 51198 function baseHas(object, key) { 51199 return object != null && hasOwnProperty.call(object, key); 51200 } 51201 51202 module.exports = baseHas; 51203 51204/***/ }, 51205/* 480 */ 51206/***/ function(module, exports) { 51207 51208 "use strict"; 51209 51210 /** 51211 * The base implementation of `_.hasIn` without support for deep paths. 51212 * 51213 * @private 51214 * @param {Object} [object] The object to query. 51215 * @param {Array|string} key The key to check. 51216 * @returns {boolean} Returns `true` if `key` exists, else `false`. 51217 */ 51218 function baseHasIn(object, key) { 51219 return object != null && key in Object(object); 51220 } 51221 51222 module.exports = baseHasIn; 51223 51224/***/ }, 51225/* 481 */ 51226/***/ function(module, exports) { 51227 51228 "use strict"; 51229 51230 /** 51231 * This function is like `baseIndexOf` except that it accepts a comparator. 51232 * 51233 * @private 51234 * @param {Array} array The array to inspect. 51235 * @param {*} value The value to search for. 51236 * @param {number} fromIndex The index to search from. 51237 * @param {Function} comparator The comparator invoked per element. 51238 * @returns {number} Returns the index of the matched value, else `-1`. 51239 */ 51240 function baseIndexOfWith(array, value, fromIndex, comparator) { 51241 var index = fromIndex - 1, 51242 length = array.length; 51243 51244 while (++index < length) { 51245 if (comparator(array[index], value)) { 51246 return index; 51247 } 51248 } 51249 return -1; 51250 } 51251 51252 module.exports = baseIndexOfWith; 51253 51254/***/ }, 51255/* 482 */ 51256/***/ function(module, exports, __webpack_require__) { 51257 51258 'use strict'; 51259 51260 var baseGetTag = __webpack_require__(29), 51261 isObjectLike = __webpack_require__(25); 51262 51263 /** `Object#toString` result references. */ 51264 var argsTag = '[object Arguments]'; 51265 51266 /** 51267 * The base implementation of `_.isArguments`. 51268 * 51269 * @private 51270 * @param {*} value The value to check. 51271 * @returns {boolean} Returns `true` if `value` is an `arguments` object, 51272 */ 51273 function baseIsArguments(value) { 51274 return isObjectLike(value) && baseGetTag(value) == argsTag; 51275 } 51276 51277 module.exports = baseIsArguments; 51278 51279/***/ }, 51280/* 483 */ 51281/***/ function(module, exports, __webpack_require__) { 51282 51283 'use strict'; 51284 51285 var Stack = __webpack_require__(97), 51286 equalArrays = __webpack_require__(256), 51287 equalByTag = __webpack_require__(519), 51288 equalObjects = __webpack_require__(520), 51289 getTag = __webpack_require__(260), 51290 isArray = __webpack_require__(7), 51291 isBuffer = __webpack_require__(111), 51292 isTypedArray = __webpack_require__(173); 51293 51294 /** Used to compose bitmasks for value comparisons. */ 51295 var COMPARE_PARTIAL_FLAG = 1; 51296 51297 /** `Object#toString` result references. */ 51298 var argsTag = '[object Arguments]', 51299 arrayTag = '[object Array]', 51300 objectTag = '[object Object]'; 51301 51302 /** Used for built-in method references. */ 51303 var objectProto = Object.prototype; 51304 51305 /** Used to check objects for own properties. */ 51306 var hasOwnProperty = objectProto.hasOwnProperty; 51307 51308 /** 51309 * A specialized version of `baseIsEqual` for arrays and objects which performs 51310 * deep comparisons and tracks traversed objects enabling objects with circular 51311 * references to be compared. 51312 * 51313 * @private 51314 * @param {Object} object The object to compare. 51315 * @param {Object} other The other object to compare. 51316 * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. 51317 * @param {Function} customizer The function to customize comparisons. 51318 * @param {Function} equalFunc The function to determine equivalents of values. 51319 * @param {Object} [stack] Tracks traversed `object` and `other` objects. 51320 * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. 51321 */ 51322 function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) { 51323 var objIsArr = isArray(object), 51324 othIsArr = isArray(other), 51325 objTag = objIsArr ? arrayTag : getTag(object), 51326 othTag = othIsArr ? arrayTag : getTag(other); 51327 51328 objTag = objTag == argsTag ? objectTag : objTag; 51329 othTag = othTag == argsTag ? objectTag : othTag; 51330 51331 var objIsObj = objTag == objectTag, 51332 othIsObj = othTag == objectTag, 51333 isSameTag = objTag == othTag; 51334 51335 if (isSameTag && isBuffer(object)) { 51336 if (!isBuffer(other)) { 51337 return false;
vendor: 4,651 bytes, lines 51338-51492
51338 } 51339 objIsArr = true; 51340 objIsObj = false; 51341 } 51342 if (isSameTag && !objIsObj) { 51343 stack || (stack = new Stack()); 51344 return objIsArr || isTypedArray(object) ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack); 51345 } 51346 if (!(bitmask & COMPARE_PARTIAL_FLAG)) { 51347 var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'), 51348 othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__'); 51349 51350 if (objIsWrapped || othIsWrapped) { 51351 var objUnwrapped = objIsWrapped ? object.value() : object, 51352 othUnwrapped = othIsWrapped ? other.value() : other; 51353 51354 stack || (stack = new Stack()); 51355 return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack); 51356 } 51357 } 51358 if (!isSameTag) { 51359 return false; 51360 } 51361 stack || (stack = new Stack()); 51362 return equalObjects(object, other, bitmask, customizer, equalFunc, stack); 51363 } 51364 51365 module.exports = baseIsEqualDeep; 51366 51367/***/ }, 51368/* 484 */ 51369/***/ function(module, exports, __webpack_require__) { 51370 51371 'use strict'; 51372 51373 var Stack = __webpack_require__(97), 51374 baseIsEqual = __webpack_require__(247); 51375 51376 /** Used to compose bitmasks for value comparisons. */ 51377 var COMPARE_PARTIAL_FLAG = 1, 51378 COMPARE_UNORDERED_FLAG = 2; 51379 51380 /** 51381 * The base implementation of `_.isMatch` without support for iteratee shorthands. 51382 * 51383 * @private 51384 * @param {Object} object The object to inspect. 51385 * @param {Object} source The object of property values to match. 51386 * @param {Array} matchData The property names, values, and compare flags to match. 51387 * @param {Function} [customizer] The function to customize comparisons. 51388 * @returns {boolean} Returns `true` if `object` is a match, else `false`. 51389 */ 51390 function baseIsMatch(object, source, matchData, customizer) { 51391 var index = matchData.length, 51392 length = index, 51393 noCustomizer = !customizer; 51394 51395 if (object == null) { 51396 return !length; 51397 } 51398 object = Object(object); 51399 while (index--) { 51400 var data = matchData[index]; 51401 if (noCustomizer && data[2] ? data[1] !== object[data[0]] : !(data[0] in object)) { 51402 return false; 51403 } 51404 } 51405 while (++index < length) { 51406 data = matchData[index]; 51407 var key = data[0], 51408 objValue = object[key], 51409 srcValue = data[1]; 51410 51411 if (noCustomizer && data[2]) { 51412 if (objValue === undefined && !(key in object)) { 51413 return false; 51414 } 51415 } else { 51416 var stack = new Stack(); 51417 if (customizer) { 51418 var result = customizer(objValue, srcValue, key, object, source, stack); 51419 } 51420 if (!(result === undefined ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack) : result)) { 51421 return false; 51422 } 51423 } 51424 } 51425 return true; 51426 } 51427 51428 module.exports = baseIsMatch; 51429 51430/***/ }, 51431/* 485 */ 51432/***/ function(module, exports) { 51433 51434 "use strict"; 51435 51436 /** 51437 * The base implementation of `_.isNaN` without support for number objects. 51438 * 51439 * @private 51440 * @param {*} value The value to check. 51441 * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. 51442 */ 51443 function baseIsNaN(value) { 51444 return value !== value; 51445 } 51446 51447 module.exports = baseIsNaN; 51448 51449/***/ }, 51450/* 486 */ 51451/***/ function(module, exports, __webpack_require__) { 51452 51453 'use strict'; 51454 51455 var isFunction = __webpack_require__(171), 51456 isMasked = __webpack_require__(534), 51457 isObject = __webpack_require__(16), 51458 toSource = __webpack_require__(268); 51459 51460 /** 51461 * Used to match `RegExp` 51462 * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). 51463 */ 51464 var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; 51465 51466 /** Used to detect host constructors (Safari). */ 51467 var reIsHostCtor = /^\[object .+?Constructor\]$/; 51468 51469 /** Used for built-in method references. */ 51470 var funcProto = Function.prototype, 51471 objectProto = Object.prototype; 51472 51473 /** Used to resolve the decompiled source of functions. */ 51474 var funcToString = funcProto.toString; 51475 51476 /** Used to check objects for own properties. */ 51477 var hasOwnProperty = objectProto.hasOwnProperty; 51478 51479 /** Used to detect if a method is native. */ 51480 var reIsNative = RegExp('^' + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&').replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'); 51481 51482 /** 51483 * The base implementation of `_.isNative` without bad shim checks. 51484 * 51485 * @private 51486 * @param {*} value The value to check. 51487 * @returns {boolean} Returns `true` if `value` is a native function, 51488 * else `false`. 51489 */ 51490 function baseIsNative(value) { 51491 if (!isObject(value) || isMasked(value)) { 51492 return false;
vendor: 10,681 bytes, lines 51493-51830
51493 } 51494 var pattern = isFunction(value) ? reIsNative : reIsHostCtor; 51495 return pattern.test(toSource(value)); 51496 } 51497 51498 module.exports = baseIsNative; 51499 51500/***/ }, 51501/* 487 */ 51502/***/ function(module, exports, __webpack_require__) { 51503 51504 'use strict'; 51505 51506 var baseGetTag = __webpack_require__(29), 51507 isObjectLike = __webpack_require__(25); 51508 51509 /** `Object#toString` result references. */ 51510 var regexpTag = '[object RegExp]'; 51511 51512 /** 51513 * The base implementation of `_.isRegExp` without Node.js optimizations. 51514 * 51515 * @private 51516 * @param {*} value The value to check. 51517 * @returns {boolean} Returns `true` if `value` is a regexp, else `false`. 51518 */ 51519 function baseIsRegExp(value) { 51520 return isObjectLike(value) && baseGetTag(value) == regexpTag; 51521 } 51522 51523 module.exports = baseIsRegExp; 51524 51525/***/ }, 51526/* 488 */ 51527/***/ function(module, exports, __webpack_require__) { 51528 51529 'use strict'; 51530 51531 var baseGetTag = __webpack_require__(29), 51532 isLength = __webpack_require__(172), 51533 isObjectLike = __webpack_require__(25); 51534 51535 /** `Object#toString` result references. */ 51536 var argsTag = '[object Arguments]', 51537 arrayTag = '[object Array]', 51538 boolTag = '[object Boolean]', 51539 dateTag = '[object Date]', 51540 errorTag = '[object Error]', 51541 funcTag = '[object Function]', 51542 mapTag = '[object Map]', 51543 numberTag = '[object Number]', 51544 objectTag = '[object Object]', 51545 regexpTag = '[object RegExp]', 51546 setTag = '[object Set]', 51547 stringTag = '[object String]', 51548 weakMapTag = '[object WeakMap]'; 51549 51550 var arrayBufferTag = '[object ArrayBuffer]', 51551 dataViewTag = '[object DataView]', 51552 float32Tag = '[object Float32Array]', 51553 float64Tag = '[object Float64Array]', 51554 int8Tag = '[object Int8Array]', 51555 int16Tag = '[object Int16Array]', 51556 int32Tag = '[object Int32Array]', 51557 uint8Tag = '[object Uint8Array]', 51558 uint8ClampedTag = '[object Uint8ClampedArray]', 51559 uint16Tag = '[object Uint16Array]', 51560 uint32Tag = '[object Uint32Array]'; 51561 51562 /** Used to identify `toStringTag` values of typed arrays. */ 51563 var typedArrayTags = {}; 51564 typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true; 51565 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; 51566 51567 /** 51568 * The base implementation of `_.isTypedArray` without Node.js optimizations. 51569 * 51570 * @private 51571 * @param {*} value The value to check. 51572 * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. 51573 */ 51574 function baseIsTypedArray(value) { 51575 return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[baseGetTag(value)]; 51576 } 51577 51578 module.exports = baseIsTypedArray; 51579 51580/***/ }, 51581/* 489 */ 51582/***/ function(module, exports, __webpack_require__) { 51583 51584 'use strict'; 51585 51586 var isPrototype = __webpack_require__(103), 51587 nativeKeys = __webpack_require__(546); 51588 51589 /** Used for built-in method references. */ 51590 var objectProto = Object.prototype; 51591 51592 /** Used to check objects for own properties. */ 51593 var hasOwnProperty = objectProto.hasOwnProperty; 51594 51595 /** 51596 * The base implementation of `_.keys` which doesn't treat sparse arrays as dense. 51597 * 51598 * @private 51599 * @param {Object} object The object to query. 51600 * @returns {Array} Returns the array of property names. 51601 */ 51602 function baseKeys(object) { 51603 if (!isPrototype(object)) { 51604 return nativeKeys(object); 51605 } 51606 var result = []; 51607 for (var key in Object(object)) { 51608 if (hasOwnProperty.call(object, key) && key != 'constructor') { 51609 result.push(key); 51610 } 51611 } 51612 return result; 51613 } 51614 51615 module.exports = baseKeys; 51616 51617/***/ }, 51618/* 490 */ 51619/***/ function(module, exports, __webpack_require__) { 51620 51621 'use strict'; 51622 51623 var isObject = __webpack_require__(16), 51624 isPrototype = __webpack_require__(103), 51625 nativeKeysIn = __webpack_require__(547); 51626 51627 /** Used for built-in method references. */ 51628 var objectProto = Object.prototype; 51629 51630 /** Used to check objects for own properties. */ 51631 var hasOwnProperty = objectProto.hasOwnProperty; 51632 51633 /** 51634 * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense. 51635 * 51636 * @private 51637 * @param {Object} object The object to query. 51638 * @returns {Array} Returns the array of property names. 51639 */ 51640 function baseKeysIn(object) { 51641 if (!isObject(object)) { 51642 return nativeKeysIn(object); 51643 } 51644 var isProto = isPrototype(object), 51645 result = []; 51646 51647 for (var key in object) { 51648 if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) { 51649 result.push(key); 51650 } 51651 } 51652 return result; 51653 } 51654 51655 module.exports = baseKeysIn; 51656 51657/***/ }, 51658/* 491 */ 51659/***/ function(module, exports, __webpack_require__) { 51660 51661 'use strict'; 51662 51663 var baseIsMatch = __webpack_require__(484), 51664 getMatchData = __webpack_require__(522), 51665 matchesStrictComparable = __webpack_require__(265); 51666 51667 /** 51668 * The base implementation of `_.matches` which doesn't clone `source`. 51669 * 51670 * @private 51671 * @param {Object} source The object of property values to match. 51672 * @returns {Function} Returns the new spec function. 51673 */ 51674 function baseMatches(source) { 51675 var matchData = getMatchData(source); 51676 if (matchData.length == 1 && matchData[0][2]) { 51677 return matchesStrictComparable(matchData[0][0], matchData[0][1]); 51678 } 51679 return function (object) { 51680 return object === source || baseIsMatch(object, source, matchData); 51681 }; 51682 } 51683 51684 module.exports = baseMatches; 51685 51686/***/ }, 51687/* 492 */ 51688/***/ function(module, exports, __webpack_require__) { 51689 51690 'use strict'; 51691 51692 var baseIsEqual = __webpack_require__(247), 51693 get = __webpack_require__(572), 51694 hasIn = __webpack_require__(573), 51695 isKey = __webpack_require__(169), 51696 isStrictComparable = __webpack_require__(263), 51697 matchesStrictComparable = __webpack_require__(265), 51698 toKey = __webpack_require__(106); 51699 51700 /** Used to compose bitmasks for value comparisons. */ 51701 var COMPARE_PARTIAL_FLAG = 1, 51702 COMPARE_UNORDERED_FLAG = 2; 51703 51704 /** 51705 * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`. 51706 * 51707 * @private 51708 * @param {string} path The path of the property to get. 51709 * @param {*} srcValue The value to match. 51710 * @returns {Function} Returns the new spec function. 51711 */ 51712 function baseMatchesProperty(path, srcValue) { 51713 if (isKey(path) && isStrictComparable(srcValue)) { 51714 return matchesStrictComparable(toKey(path), srcValue); 51715 } 51716 return function (object) { 51717 var objValue = get(object, path); 51718 return objValue === undefined && objValue === srcValue ? hasIn(object, path) : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG); 51719 }; 51720 } 51721 51722 module.exports = baseMatchesProperty; 51723 51724/***/ }, 51725/* 493 */ 51726/***/ function(module, exports, __webpack_require__) { 51727 51728 'use strict'; 51729 51730 var Stack = __webpack_require__(97), 51731 assignMergeValue = __webpack_require__(243), 51732 baseFor = __webpack_require__(244), 51733 baseMergeDeep = __webpack_require__(494), 51734 isObject = __webpack_require__(16), 51735 keysIn = __webpack_require__(46); 51736 51737 /** 51738 * The base implementation of `_.merge` without support for multiple sources. 51739 * 51740 * @private 51741 * @param {Object} object The destination object. 51742 * @param {Object} source The source object. 51743 * @param {number} srcIndex The index of `source`. 51744 * @param {Function} [customizer] The function to customize merged values. 51745 * @param {Object} [stack] Tracks traversed source values and their merged 51746 * counterparts. 51747 */ 51748 function baseMerge(object, source, srcIndex, customizer, stack) { 51749 if (object === source) { 51750 return; 51751 } 51752 baseFor(source, function (srcValue, key) { 51753 if (isObject(srcValue)) { 51754 stack || (stack = new Stack()); 51755 baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack); 51756 } else { 51757 var newValue = customizer ? customizer(object[key], srcValue, key + '', object, source, stack) : undefined; 51758 51759 if (newValue === undefined) { 51760 newValue = srcValue; 51761 } 51762 assignMergeValue(object, key, newValue); 51763 } 51764 }, keysIn); 51765 } 51766 51767 module.exports = baseMerge; 51768 51769/***/ }, 51770/* 494 */ 51771/***/ function(module, exports, __webpack_require__) { 51772 51773 'use strict'; 51774 51775 var assignMergeValue = __webpack_require__(243), 51776 cloneBuffer = __webpack_require__(252), 51777 cloneTypedArray = __webpack_require__(253), 51778 copyArray = __webpack_require__(164), 51779 initCloneObject = __webpack_require__(262), 51780 isArguments = __webpack_require__(110), 51781 isArray = __webpack_require__(7), 51782 isArrayLikeObject = __webpack_require__(574), 51783 isBuffer = __webpack_require__(111), 51784 isFunction = __webpack_require__(171), 51785 isObject = __webpack_require__(16), 51786 isPlainObject = __webpack_require__(271), 51787 isTypedArray = __webpack_require__(173), 51788 toPlainObject = __webpack_require__(588); 51789 51790 /** 51791 * A specialized version of `baseMerge` for arrays and objects which performs 51792 * deep merges and tracks traversed objects enabling objects with circular 51793 * references to be merged. 51794 * 51795 * @private 51796 * @param {Object} object The destination object. 51797 * @param {Object} source The source object. 51798 * @param {string} key The key of the value to merge. 51799 * @param {number} srcIndex The index of `source`. 51800 * @param {Function} mergeFunc The function to merge values. 51801 * @param {Function} [customizer] The function to customize assigned values. 51802 * @param {Object} [stack] Tracks traversed source values and their merged 51803 * counterparts. 51804 */ 51805 function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) { 51806 var objValue = object[key], 51807 srcValue = source[key], 51808 stacked = stack.get(srcValue); 51809 51810 if (stacked) { 51811 assignMergeValue(object, key, stacked); 51812 return; 51813 } 51814 var newValue = customizer ? customizer(objValue, srcValue, key + '', object, source, stack) : undefined; 51815 51816 var isCommon = newValue === undefined; 51817 51818 if (isCommon) { 51819 var isArr = isArray(srcValue), 51820 isBuff = !isArr && isBuffer(srcValue), 51821 isTyped = !isArr && !isBuff && isTypedArray(srcValue); 51822 51823 newValue = srcValue; 51824 if (isArr || isBuff || isTyped) { 51825 if (isArray(objValue)) { 51826 newValue = objValue; 51827 } else if (isArrayLikeObject(objValue)) { 51828 newValue = copyArray(objValue); 51829 } else if (isBuff) { 51830 isCommon = false;
51831 newValue = cloneBuffer(srcValue, true); 51832 } else if (isTyped) { 51833 isCommon = false; 51834 newValue = cloneTypedArray(srcValue, true); 51835 } else { 51836 newValue = []; 51837 } 51838 } else if (isPlainObject(srcValue) || isArguments(srcValue)) { 51839 newValue = objValue; 51840 if (isArguments(objValue)) { 51841 newValue = toPlainObject(objValue); 51842 } else if (!isObject(objValue) || srcIndex && isFunction(objValue)) { 51843 newValue = initCloneObject(srcValue); 51844 } 51845 } else { 51846 isCommon = false; 51847 } 51848 } 51849 if (isCommon) { 51850 // Recursively merge objects and arrays (susceptible to call stack limits). 51851 stack.set(srcValue, newValue); 51852 mergeFunc(newValue, srcValue, srcIndex, customizer, stack); 51853 stack['delete'](srcValue); 51854 } 51855 assignMergeValue(object, key, newValue); 51856 } 51857 51858 module.exports = baseMergeDeep; 51859 51860/***/ }, 51861/* 495 */ 51862/***/ function(module, exports, __webpack_require__) { 51863 51864 'use strict'; 51865 51866 var arrayMap = __webpack_require__(58), 51867 baseIteratee = __webpack_require__(59), 51868 baseMap = __webpack_require__(248), 51869 baseSortBy = __webpack_require__(501), 51870 baseUnary = __webpack_require__(100), 51871 compareMultiple = __webpack_require__(511), 51872 identity = __webpack_require__(108); 51873 51874 /** 51875 * The base implementation of `_.orderBy` without param guards. 51876 * 51877 * @private 51878 * @param {Array|Object} collection The collection to iterate over. 51879 * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by. 51880 * @param {string[]} orders The sort orders of `iteratees`. 51881 * @returns {Array} Returns the new sorted array. 51882 */ 51883 function baseOrderBy(collection, iteratees, orders) { 51884 var index = -1; 51885 iteratees = arrayMap(iteratees.length ? iteratees : [identity], baseUnary(baseIteratee)); 51886 51887 var result = baseMap(collection, function (value, key, collection) { 51888 var criteria = arrayMap(iteratees, function (iteratee) { 51889 return iteratee(value); 51890 }); 51891 return { 'criteria': criteria, 'index': ++index, 'value': value }; 51892 }); 51893 51894 return baseSortBy(result, function (object, other) { 51895 return compareMultiple(object, other, orders); 51896 }); 51897 } 51898 51899 module.exports = baseOrderBy; 51900 51901/***/ }, 51902/* 496 */ 51903/***/ function(module, exports) { 51904 51905 "use strict"; 51906 51907 /** 51908 * The base implementation of `_.property` without support for deep paths. 51909 * 51910 * @private 51911 * @param {string} key The key of the property to get. 51912 * @returns {Function} Returns the new accessor function. 51913 */ 51914 function baseProperty(key) { 51915 return function (object) { 51916 return object == null ? undefined : object[key]; 51917 }; 51918 } 51919 51920 module.exports = baseProperty; 51921 51922/***/ }, 51923/* 497 */ 51924/***/ function(module, exports, __webpack_require__) { 51925 51926 'use strict'; 51927 51928 var baseGet = __webpack_require__(245); 51929 51930 /** 51931 * A specialized version of `baseProperty` which supports deep paths. 51932 * 51933 * @private 51934 * @param {Array|string} path The path of the property to get. 51935 * @returns {Function} Returns the new accessor function. 51936 */ 51937 function basePropertyDeep(path) { 51938 return function (object) { 51939 return baseGet(object, path); 51940 }; 51941 } 51942 51943 module.exports = basePropertyDeep; 51944 51945/***/ }, 51946/* 498 */ 51947/***/ function(module, exports, __webpack_require__) { 51948 51949 'use strict'; 51950 51951 var arrayMap = __webpack_require__(58), 51952 baseIndexOf = __webpack_require__(162), 51953 baseIndexOfWith = __webpack_require__(481), 51954 baseUnary = __webpack_require__(100), 51955 copyArray = __webpack_require__(164); 51956 51957 /** Used for built-in method references. */ 51958 var arrayProto = Array.prototype; 51959 51960 /** Built-in value references. */ 51961 var splice = arrayProto.splice; 51962 51963 /** 51964 * The base implementation of `_.pullAllBy` without support for iteratee 51965 * shorthands. 51966 * 51967 * @private 51968 * @param {Array} array The array to modify. 51969 * @param {Array} values The values to remove. 51970 * @param {Function} [iteratee] The iteratee invoked per element. 51971 * @param {Function} [comparator] The comparator invoked per element. 51972 * @returns {Array} Returns `array`. 51973 */ 51974 function basePullAll(array, values, iteratee, comparator) { 51975 var indexOf = comparator ? baseIndexOfWith : baseIndexOf, 51976 index = -1, 51977 length = values.length, 51978 seen = array; 51979 51980 if (array === values) { 51981 values = copyArray(values); 51982 } 51983 if (iteratee) { 51984 seen = arrayMap(array, baseUnary(iteratee)); 51985 } 51986 while (++index < length) { 51987 var fromIndex = 0, 51988 value = values[index], 51989 computed = iteratee ? iteratee(value) : value; 51990 51991 while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) { 51992 if (seen !== array) { 51993 splice.call(seen, fromIndex, 1); 51994 } 51995 splice.call(array, fromIndex, 1); 51996 } 51997 } 51998 return array; 51999 } 52000 52001 module.exports = basePullAll; 52002 52003/***/ }, 52004/* 499 */
52005/***/ function(module, exports) { 52006 52007 'use strict'; 52008 52009 /** Used as references for various `Number` constants. */ 52010 var MAX_SAFE_INTEGER = 9007199254740991; 52011 52012 /* Built-in method references for those with the same name as other `lodash` methods. */ 52013 var nativeFloor = Math.floor; 52014 52015 /** 52016 * The base implementation of `_.repeat` which doesn't coerce arguments. 52017 * 52018 * @private 52019 * @param {string} string The string to repeat. 52020 * @param {number} n The number of times to repeat the string. 52021 * @returns {string} Returns the repeated string. 52022 */ 52023 function baseRepeat(string, n) { 52024 var result = ''; 52025 if (!string || n < 1 || n > MAX_SAFE_INTEGER) { 52026 return result; 52027 } 52028 // Leverage the exponentiation by squaring algorithm for a faster repeat. 52029 // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details. 52030 do { 52031 if (n % 2) { 52032 result += string; 52033 } 52034 n = nativeFloor(n / 2); 52035 if (n) { 52036 string += string; 52037 } 52038 } while (n); 52039 52040 return result; 52041 } 52042 52043 module.exports = baseRepeat; 52044 52045/***/ }, 52046/* 500 */ 52047/***/ function(module, exports, __webpack_require__) { 52048 52049 'use strict'; 52050 52051 var constant = __webpack_require__(565), 52052 defineProperty = __webpack_require__(255), 52053 identity = __webpack_require__(108); 52054 52055 /** 52056 * The base implementation of `setToString` without support for hot loop shorting. 52057 * 52058 * @private 52059 * @param {Function} func The function to modify. 52060 * @param {Function} string The `toString` result. 52061 * @returns {Function} Returns `func`. 52062 */ 52063 var baseSetToString = !defineProperty ? identity : function (func, string) { 52064 return defineProperty(func, 'toString', { 52065 'configurable': true, 52066 'enumerable': false, 52067 'value': constant(string), 52068 'writable': true 52069 }); 52070 }; 52071 52072 module.exports = baseSetToString; 52073 52074/***/ }, 52075/* 501 */ 52076/***/ function(module, exports) { 52077 52078 "use strict"; 52079 52080 /** 52081 * The base implementation of `_.sortBy` which uses `comparer` to define the 52082 * sort order of `array` and replaces criteria objects with their corresponding 52083 * values. 52084 * 52085 * @private 52086 * @param {Array} array The array to sort. 52087 * @param {Function} comparer The function to define sort order. 52088 * @returns {Array} Returns `array`. 52089 */ 52090 function baseSortBy(array, comparer) { 52091 var length = array.length; 52092 52093 array.sort(comparer); 52094 while (length--) { 52095 array[length] = array[length].value; 52096 } 52097 return array; 52098 } 52099 52100 module.exports = baseSortBy; 52101 52102/***/ }, 52103/* 502 */ 52104/***/ function(module, exports) { 52105 52106 "use strict"; 52107 52108 /** 52109 * The base implementation of `_.times` without support for iteratee shorthands 52110 * or max array length checks. 52111 * 52112 * @private 52113 * @param {number} n The number of times to invoke `iteratee`. 52114 * @param {Function} iteratee The function invoked per iteration. 52115 * @returns {Array} Returns the array of results. 52116 */ 52117 function baseTimes(n, iteratee) { 52118 var index = -1, 52119 result = Array(n); 52120 52121 while (++index < n) { 52122 result[index] = iteratee(index); 52123 } 52124 return result; 52125 } 52126 52127 module.exports = baseTimes; 52128 52129/***/ }, 52130/* 503 */ 52131/***/ function(module, exports, __webpack_require__) { 52132 52133 'use strict'; 52134 52135 var SetCache = __webpack_require__(238), 52136 arrayIncludes = __webpack_require__(469), 52137 arrayIncludesWith = __webpack_require__(470), 52138 cacheHas = __webpack_require__(250), 52139 createSet = __webpack_require__(517), 52140 setToArray = __webpack_require__(105); 52141 52142 /** Used as the size to enable large array optimizations. */ 52143 var LARGE_ARRAY_SIZE = 200; 52144 52145 /** 52146 * The base implementation of `_.uniqBy` without support for iteratee shorthands. 52147 * 52148 * @private 52149 * @param {Array} array The array to inspect. 52150 * @param {Function} [iteratee] The iteratee invoked per element. 52151 * @param {Function} [comparator] The comparator invoked per element. 52152 * @returns {Array} Returns the new duplicate free array. 52153 */ 52154 function baseUniq(array, iteratee, comparator) { 52155 var index = -1, 52156 includes = arrayIncludes, 52157 length = array.length, 52158 isCommon = true, 52159 result = [], 52160 seen = result; 52161 52162 if (comparator) { 52163 isCommon = false; 52164 includes = arrayIncludesWith; 52165 } else if (length >= LARGE_ARRAY_SIZE) { 52166 var set = iteratee ? null : createSet(array); 52167 if (set) { 52168 return setToArray(set); 52169 } 52170 isCommon = false;
52171 includes = cacheHas; 52172 seen = new SetCache(); 52173 } else { 52174 seen = iteratee ? [] : result; 52175 } 52176 outer: while (++index < length) { 52177 var value = array[index], 52178 computed = iteratee ? iteratee(value) : value; 52179 52180 value = comparator || value !== 0 ? value : 0; 52181 if (isCommon && computed === computed) { 52182 var seenIndex = seen.length; 52183 while (seenIndex--) { 52184 if (seen[seenIndex] === computed) { 52185 continue outer; 52186 } 52187 } 52188 if (iteratee) { 52189 seen.push(computed); 52190 } 52191 result.push(value); 52192 } else if (!includes(seen, computed, comparator)) { 52193 if (seen !== result) { 52194 seen.push(computed); 52195 } 52196 result.push(value); 52197 } 52198 } 52199 return result; 52200 } 52201 52202 module.exports = baseUniq; 52203 52204/***/ }, 52205/* 504 */ 52206/***/ function(module, exports, __webpack_require__) { 52207 52208 'use strict'; 52209 52210 var arrayMap = __webpack_require__(58); 52211 52212 /** 52213 * The base implementation of `_.values` and `_.valuesIn` which creates an 52214 * array of `object` property values corresponding to the property names 52215 * of `props`. 52216 * 52217 * @private 52218 * @param {Object} object The object to query. 52219 * @param {Array} props The property names to get values for. 52220 * @returns {Object} Returns the array of property values. 52221 */ 52222 function baseValues(object, props) { 52223 return arrayMap(props, function (key) { 52224 return object[key]; 52225 }); 52226 } 52227 52228 module.exports = baseValues; 52229 52230/***/ }, 52231/* 505 */ 52232/***/ function(module, exports, __webpack_require__) { 52233 52234 'use strict'; 52235 52236 var cloneArrayBuffer = __webpack_require__(163); 52237 52238 /** 52239 * Creates a clone of `dataView`. 52240 * 52241 * @private 52242 * @param {Object} dataView The data view to clone. 52243 * @param {boolean} [isDeep] Specify a deep clone. 52244 * @returns {Object} Returns the cloned data view. 52245 */ 52246 function cloneDataView(dataView, isDeep) { 52247 var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer; 52248 return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength); 52249 } 52250 52251 module.exports = cloneDataView; 52252 52253/***/ }, 52254/* 506 */ 52255/***/ function(module, exports, __webpack_require__) { 52256 52257 'use strict'; 52258 52259 var addMapEntry = __webpack_require__(465), 52260 arrayReduce = __webpack_require__(242), 52261 mapToArray = __webpack_require__(264); 52262 52263 /** Used to compose bitmasks for cloning. */ 52264 var CLONE_DEEP_FLAG = 1; 52265 52266 /** 52267 * Creates a clone of `map`. 52268 * 52269 * @private 52270 * @param {Object} map The map to clone. 52271 * @param {Function} cloneFunc The function to clone values. 52272 * @param {boolean} [isDeep] Specify a deep clone. 52273 * @returns {Object} Returns the cloned map. 52274 */ 52275 function cloneMap(map, isDeep, cloneFunc) { 52276 var array = isDeep ? cloneFunc(mapToArray(map), CLONE_DEEP_FLAG) : mapToArray(map); 52277 return arrayReduce(array, addMapEntry, new map.constructor()); 52278 } 52279 52280 module.exports = cloneMap; 52281 52282/***/ }, 52283/* 507 */ 52284/***/ function(module, exports) { 52285 52286 "use strict"; 52287 52288 /** Used to match `RegExp` flags from their coerced string values. */ 52289 var reFlags = /\w*$/; 52290 52291 /** 52292 * Creates a clone of `regexp`. 52293 * 52294 * @private 52295 * @param {Object} regexp The regexp to clone. 52296 * @returns {Object} Returns the cloned regexp. 52297 */ 52298 function cloneRegExp(regexp) { 52299 var result = new regexp.constructor(regexp.source, reFlags.exec(regexp)); 52300 result.lastIndex = regexp.lastIndex; 52301 return result; 52302 } 52303 52304 module.exports = cloneRegExp; 52305 52306/***/ }, 52307/* 508 */ 52308/***/ function(module, exports, __webpack_require__) { 52309 52310 'use strict'; 52311 52312 var addSetEntry = __webpack_require__(466), 52313 arrayReduce = __webpack_require__(242), 52314 setToArray = __webpack_require__(105); 52315 52316 /** Used to compose bitmasks for cloning. */ 52317 var CLONE_DEEP_FLAG = 1; 52318 52319 /** 52320 * Creates a clone of `set`. 52321 * 52322 * @private 52323 * @param {Object} set The set to clone. 52324 * @param {Function} cloneFunc The function to clone values. 52325 * @param {boolean} [isDeep] Specify a deep clone. 52326 * @returns {Object} Returns the cloned set. 52327 */ 52328 function cloneSet(set, isDeep, cloneFunc) { 52329 var array = isDeep ? cloneFunc(setToArray(set), CLONE_DEEP_FLAG) : setToArray(set); 52330 return arrayReduce(array, addSetEntry, new set.constructor()); 52331 } 52332 52333 module.exports = cloneSet; 52334 52335/***/ }, 52336/* 509 */ 52337/***/ function(module, exports, __webpack_require__) { 52338 52339 'use strict'; 52340 52341 var _Symbol = __webpack_require__(44); 52342 52343 /** Used to convert symbols to primitives and strings. */ 52344 var symbolProto = _Symbol ? _Symbol.prototype : undefined, 52345 symbolValueOf = symbolProto ? symbolProto.valueOf : undefined; 52346 52347 /** 52348 * Creates a clone of the `symbol` object. 52349 * 52350 * @private 52351 * @param {Object} symbol The symbol object to clone. 52352 * @returns {Object} Returns the cloned symbol object. 52353 */ 52354 function cloneSymbol(symbol) { 52355 return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {}; 52356 } 52357 52358 module.exports = cloneSymbol; 52359 52360/***/ }, 52361/* 510 */ 52362/***/ function(module, exports, __webpack_require__) { 52363 52364 'use strict'; 52365 52366 var isSymbol = __webpack_require__(60); 52367 52368 /** 52369 * Compares values to sort them in ascending order. 52370 * 52371 * @private 52372 * @param {*} value The value to compare. 52373 * @param {*} other The other value to compare. 52374 * @returns {number} Returns the sort order indicator for `value`. 52375 */ 52376 function compareAscending(value, other) { 52377 if (value !== other) { 52378 var valIsDefined = value !== undefined, 52379 valIsNull = value === null, 52380 valIsReflexive = value === value, 52381 valIsSymbol = isSymbol(value); 52382 52383 var othIsDefined = other !== undefined, 52384 othIsNull = other === null, 52385 othIsReflexive = other === other, 52386 othIsSymbol = isSymbol(other); 52387 52388 if (!othIsNull && !othIsSymbol && !valIsSymbol && value > other || valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol || valIsNull && othIsDefined && othIsReflexive || !valIsDef
52388ined && othIsReflexive || !valIsReflexive) { 52389 return 1; 52390 } 52391 if (!valIsNull && !valIsSymbol && !othIsSymbol && value < other || othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol || othIsNull && valIsDefined && valIsReflexive || !othIsDefined && valIsReflexive || !othIsReflexive) { 52392 return -1; 52393 } 52394 } 52395 return 0; 52396 } 52397 52398 module.exports = compareAscending; 52399 52400/***/ }, 52401/* 511 */ 52402/***/ function(module, exports, __webpack_require__) { 52403 52404 'use strict'; 52405 52406 var compareAscending = __webpack_require__(510); 52407 52408 /** 52409 * Used by `_.orderBy` to compare multiple properties of a value to another 52410 * and stable sort them. 52411 * 52412 * If `orders` is unspecified, all values are sorted in ascending order. Otherwise, 52413 * specify an order of "desc" for descending or "asc" for ascending sort order 52414 * of corresponding values. 52415 * 52416 * @private 52417 * @param {Object} object The object to compare. 52418 * @param {Object} other The other object to compare. 52419 * @param {boolean[]|string[]} orders The order to sort by for each property. 52420 * @returns {number} Returns the sort order indicator for `object`. 52421 */ 52422 function compareMultiple(object, other, orders) { 52423 var index = -1, 52424 objCriteria = object.criteria, 52425 othCriteria = other.criteria, 52426 length = objCriteria.length, 52427 ordersLength = orders.length; 52428 52429 while (++index < length) { 52430 var result = compareAscending(objCriteria[index], othCriteria[index]); 52431 if (result) { 52432 if (index >= ordersLength) { 52433 return result; 52434 } 52435 var order = orders[index]; 52436 return result * (order == 'desc' ? -1 : 1); 52437 } 52438 } 52439 // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications 52440 // that causes it, under certain circumstances, to provide the same value for 52441 // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247 52442 // for more details. 52443 // 52444 // This also ensures a stable sort in V8 and other engines. 52445 // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details. 52446 return object.index - other.index; 52447 } 52448 52449 module.exports = compareMultiple; 52450 52451/***/ }, 52452/* 512 */ 52453/***/ function(module, exports, __webpack_require__) { 52454 52455 'use strict'; 52456 52457 var copyObject = __webpack_require__(30), 52458 getSymbols = __webpack_require__(166); 52459 52460 /** 52461 * Copies own symbols of `source` to `object`. 52462 * 52463 * @private 52464 * @param {Object} source The object to copy symbols from. 52465 * @param {Object} [object={}] The object to copy symbols to. 52466 * @returns {Object} Returns `object`. 52467 */ 52468 function copySymbols(source, object) { 52469 return copyObject(source, getSymbols(source), object); 52470 } 52471 52472 module.exports = copySymbols; 52473 52474/***/ }, 52475/* 513 */ 52476/***/ function(module, exports, __webpack_require__) { 52477 52478 'use strict'; 52479 52480 var copyObject = __webpack_require__(30), 52481 getSymbolsIn = __webpack_require__(259); 52482 52483 /** 52484 * Copies own and inherited symbols of `source` to `object`. 52485 * 52486 * @private 52487 * @param {Object} source The object to copy symbols from. 52488 * @param {Object} [object={}] The object to copy symbols to. 52489 * @returns {Object} Returns `object`. 52490 */ 52491 function copySymbolsIn(source, object) { 52492 return copyObject(source, getSymbolsIn(source), object); 52493 } 52494 52495 module.exports = copySymbolsIn; 52496 52497/***/ }, 52498/* 514 */ 52499/***/ function(module, exports, __webpack_require__) { 52500 52501 'use strict'; 52502 52503 var root = __webpack_require__(15); 52504 52505 /** Used to detect overreaching core-js shims. */ 52506 var coreJsData = root['__core-js_shared__']; 52507 52508 module.exports = coreJsData; 52509 52510/***/ }, 52511/* 515 */ 52512/***/ function(module, exports, __webpack_require__) { 52513 52514 'use strict'; 52515 52516 var isArrayLike = __webpack_require__(24); 52517 52518 /** 52519 * Creates a `baseEach` or `baseEachRight` function. 52520 * 52521 * @private 52522 * @param {Function} eachFunc The function to iterate over a collection. 52523 * @param {boolean} [fromRight] Specify iterating from right to left. 52524 * @returns {Function} Returns the new base function. 52525 */ 52526 function createBaseEach(eachFunc, fromRight) { 52527 return function (collection, iteratee) { 52528 if (collection == null) { 52529 return collection; 52530 } 52531 if (!isArrayLike(collection)) { 52532 return eachFunc(collection, iteratee); 52533 } 52534 var length = collection.length, 52535 index = fromRight ? length : -1, 52536 iterable = Object(collection); 52537 52538 while (fromRight ? index-- : ++index < length) { 52539 if (iteratee(iterable[index], index, iterable) === false) { 52540 break; 52541 } 52542 } 52543 return collection; 52544 }; 52545 } 52546 52547 module.exports = createBaseEach; 52548 52549/***/ }, 52550/* 516 */
52551/***/ function(module, exports) { 52552 52553 "use strict"; 52554 52555 /** 52556 * Creates a base function for methods like `_.forIn` and `_.forOwn`. 52557 * 52558 * @private 52559 * @param {boolean} [fromRight] Specify iterating from right to left. 52560 * @returns {Function} Returns the new base function. 52561 */ 52562 function createBaseFor(fromRight) { 52563 return function (object, iteratee, keysFunc) { 52564 var index = -1, 52565 iterable = Object(object), 52566 props = keysFunc(object), 52567 length = props.length; 52568 52569 while (length--) { 52570 var key = props[fromRight ? length : ++index]; 52571 if (iteratee(iterable[key], key, iterable) === false) { 52572 break; 52573 } 52574 } 52575 return object; 52576 }; 52577 } 52578 52579 module.exports = createBaseFor; 52580 52581/***/ }, 52582/* 517 */ 52583/***/ function(module, exports, __webpack_require__) { 52584 52585 'use strict'; 52586 52587 var Set = __webpack_require__(237), 52588 noop = __webpack_require__(580), 52589 setToArray = __webpack_require__(105); 52590 52591 /** Used as references for various `Number` constants. */ 52592 var INFINITY = 1 / 0; 52593 52594 /** 52595 * Creates a set object of `values`. 52596 * 52597 * @private 52598 * @param {Array} values The values to add to the set. 52599 * @returns {Object} Returns the new set. 52600 */ 52601 var createSet = !(Set && 1 / setToArray(new Set([, -0]))[1] == INFINITY) ? noop : function (values) { 52602 return new Set(values); 52603 }; 52604 52605 module.exports = createSet; 52606 52607/***/ }, 52608/* 518 */ 52609/***/ function(module, exports, __webpack_require__) { 52610 52611 'use strict'; 52612 52613 var eq = __webpack_require__(45); 52614 52615 /** Used for built-in method references. */ 52616 var objectProto = Object.prototype; 52617 52618 /** Used to check objects for own properties. */ 52619 var hasOwnProperty = objectProto.hasOwnProperty; 52620 52621 /** 52622 * Used by `_.defaults` to customize its `_.assignIn` use to assign properties 52623 * of source objects to the destination object for all destination properties 52624 * that resolve to `undefined`. 52625 * 52626 * @private 52627 * @param {*} objValue The destination value. 52628 * @param {*} srcValue The source value. 52629 * @param {string} key The key of the property to assign. 52630 * @param {Object} object The parent object of `objValue`. 52631 * @returns {*} Returns the value to assign. 52632 */ 52633 function customDefaultsAssignIn(objValue, srcValue, key, object) { 52634 if (objValue === undefined || eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key)) { 52635 return srcValue; 52636 } 52637 return objValue; 52638 } 52639 52640 module.exports = customDefaultsAssignIn; 52641 52642/***/ }, 52643/* 519 */ 52644/***/ function(module, exports, __webpack_require__) { 52645 52646 'use strict'; 52647 52648 var _Symbol = __webpack_require__(44), 52649 Uint8Array = __webpack_require__(239), 52650 eq = __webpack_require__(45), 52651 equalArrays = __webpack_require__(256), 52652 mapToArray = __webpack_require__(264), 52653 setToArray = __webpack_require__(105); 52654 52655 /** Used to compose bitmasks for value comparisons. */ 52656 var COMPARE_PARTIAL_FLAG = 1, 52657 COMPARE_UNORDERED_FLAG = 2; 52658 52659 /** `Object#toString` result references. */ 52660 var boolTag = '[object Boolean]', 52661 dateTag = '[object Date]', 52662 errorTag = '[object Error]', 52663 mapTag = '[object Map]', 52664 numberTag = '[object Number]', 52665 regexpTag = '[object RegExp]', 52666 setTag = '[object Set]', 52667 stringTag = '[object String]', 52668 symbolTag = '[object Symbol]'; 52669 52670 var arrayBufferTag = '[object ArrayBuffer]', 52671 dataViewTag = '[object DataView]'; 52672 52673 /** Used to convert symbols to primitives and strings. */ 52674 var symbolProto = _Symbol ? _Symbol.prototype : undefined, 52675 symbolValueOf = symbolProto ? symbolProto.valueOf : undefined; 52676 52677 /** 52678 * A specialized version of `baseIsEqualDeep` for comparing objects of 52679 * the same `toStringTag`. 52680 * 52681 * **Note:** This function only supports comparing values with tags of 52682 * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. 52683 * 52684 * @private 52685 * @param {Object} object The object to compare. 52686 * @param {Object} other The other object to compare. 52687 * @param {string} tag The `toStringTag` of the objects to compare. 52688 * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. 52689 * @param {Function} customizer The function to customize comparisons. 52690 * @param {Function} equalFunc The function to determine equivalents of values. 52691 * @param {Object} stack Tracks traversed `object` and `other` objects. 52692 * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. 52693 */ 52694 function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) { 52695 switch (tag) {
vendor: 4,262 bytes, lines 52696-52826
52696 case dataViewTag: 52697 if (object.byteLength != other.byteLength || object.byteOffset != other.byteOffset) { 52698 return false; 52699 } 52700 object = object.buffer; 52701 other = other.buffer; 52702 52703 case arrayBufferTag: 52704 if (object.byteLength != other.byteLength || !equalFunc(new Uint8Array(object), new Uint8Array(other))) { 52705 return false; 52706 } 52707 return true; 52708 52709 case boolTag: 52710 case dateTag: 52711 case numberTag: 52712 // Coerce booleans to `1` or `0` and dates to milliseconds. 52713 // Invalid dates are coerced to `NaN`. 52714 return eq(+object, +other); 52715 52716 case errorTag: 52717 return object.name == other.name && object.message == other.message; 52718 52719 case regexpTag: 52720 case stringTag: 52721 // Coerce regexes to strings and treat strings, primitives and objects, 52722 // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring 52723 // for more details. 52724 return object == other + ''; 52725 52726 case mapTag: 52727 var convert = mapToArray; 52728 52729 case setTag: 52730 var isPartial = bitmask & COMPARE_PARTIAL_FLAG; 52731 convert || (convert = setToArray); 52732 52733 if (object.size != other.size && !isPartial) { 52734 return false; 52735 } 52736 // Assume cyclic values are equal. 52737 var stacked = stack.get(object); 52738 if (stacked) { 52739 return stacked == other; 52740 } 52741 bitmask |= COMPARE_UNORDERED_FLAG; 52742 52743 // Recursively compare objects (susceptible to call stack limits). 52744 stack.set(object, other); 52745 var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack); 52746 stack['delete'](object); 52747 return result; 52748 52749 case symbolTag: 52750 if (symbolValueOf) { 52751 return symbolValueOf.call(object) == symbolValueOf.call(other); 52752 } 52753 } 52754 return false; 52755 } 52756 52757 module.exports = equalByTag; 52758 52759/***/ }, 52760/* 520 */ 52761/***/ function(module, exports, __webpack_require__) { 52762 52763 'use strict'; 52764 52765 var getAllKeys = __webpack_require__(258); 52766 52767 /** Used to compose bitmasks for value comparisons. */ 52768 var COMPARE_PARTIAL_FLAG = 1; 52769 52770 /** Used for built-in method references. */ 52771 var objectProto = Object.prototype; 52772 52773 /** Used to check objects for own properties. */ 52774 var hasOwnProperty = objectProto.hasOwnProperty; 52775 52776 /** 52777 * A specialized version of `baseIsEqualDeep` for objects with support for 52778 * partial deep comparisons. 52779 * 52780 * @private 52781 * @param {Object} object The object to compare. 52782 * @param {Object} other The other object to compare. 52783 * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. 52784 * @param {Function} customizer The function to customize comparisons. 52785 * @param {Function} equalFunc The function to determine equivalents of values. 52786 * @param {Object} stack Tracks traversed `object` and `other` objects. 52787 * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. 52788 */ 52789 function equalObjects(object, other, bitmask, customizer, equalFunc, stack) { 52790 var isPartial = bitmask & COMPARE_PARTIAL_FLAG, 52791 objProps = getAllKeys(object), 52792 objLength = objProps.length, 52793 othProps = getAllKeys(other), 52794 othLength = othProps.length; 52795 52796 if (objLength != othLength && !isPartial) { 52797 return false; 52798 } 52799 var index = objLength; 52800 while (index--) { 52801 var key = objProps[index]; 52802 if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) { 52803 return false; 52804 } 52805 } 52806 // Assume cyclic values are equal. 52807 var stacked = stack.get(object); 52808 if (stacked && stack.get(other)) { 52809 return stacked == other; 52810 } 52811 var result = true; 52812 stack.set(object, other); 52813 stack.set(other, object); 52814 52815 var skipCtor = isPartial; 52816 while (++index < objLength) { 52817 key = objProps[index]; 52818 var objValue = object[key], 52819 othValue = other[key]; 52820 52821 if (customizer) { 52822 var compared = isPartial ? customizer(othValue, objValue, key, other, object, stack) : customizer(objValue, othValue, key, object, other, stack); 52823 } 52824 // Recursively compare objects (susceptible to call stack limits). 52825 if (!(compared === undefined ? objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack) : compared)) { 52826 result = false;
vendor: 6,865 bytes, lines 52827-53119
52827 break; 52828 } 52829 skipCtor || (skipCtor = key == 'constructor'); 52830 } 52831 if (result && !skipCtor) { 52832 var objCtor = object.constructor, 52833 othCtor = other.constructor; 52834 52835 // Non `Object` object instances with different constructors are not equal. 52836 if (objCtor != othCtor && 'constructor' in object && 'constructor' in other && !(typeof objCtor == 'function' && objCtor instanceof objCtor && typeof othCtor == 'function' && othCtor instanceof othCtor)) { 52837 result = false; 52838 } 52839 } 52840 stack['delete'](object); 52841 stack['delete'](other); 52842 return result; 52843 } 52844 52845 module.exports = equalObjects; 52846 52847/***/ }, 52848/* 521 */ 52849/***/ function(module, exports, __webpack_require__) { 52850 52851 'use strict'; 52852 52853 var baseGetAllKeys = __webpack_require__(246), 52854 getSymbolsIn = __webpack_require__(259), 52855 keysIn = __webpack_require__(46); 52856 52857 /** 52858 * Creates an array of own and inherited enumerable property names and 52859 * symbols of `object`. 52860 * 52861 * @private 52862 * @param {Object} object The object to query. 52863 * @returns {Array} Returns the array of property names and symbols. 52864 */ 52865 function getAllKeysIn(object) { 52866 return baseGetAllKeys(object, keysIn, getSymbolsIn); 52867 } 52868 52869 module.exports = getAllKeysIn; 52870 52871/***/ }, 52872/* 522 */ 52873/***/ function(module, exports, __webpack_require__) { 52874 52875 'use strict'; 52876 52877 var isStrictComparable = __webpack_require__(263), 52878 keys = __webpack_require__(31); 52879 52880 /** 52881 * Gets the property names, values, and compare flags of `object`. 52882 * 52883 * @private 52884 * @param {Object} object The object to query. 52885 * @returns {Array} Returns the match data of `object`. 52886 */ 52887 function getMatchData(object) { 52888 var result = keys(object), 52889 length = result.length; 52890 52891 while (length--) { 52892 var key = result[length], 52893 value = object[key]; 52894 52895 result[length] = [key, value, isStrictComparable(value)]; 52896 } 52897 return result; 52898 } 52899 52900 module.exports = getMatchData; 52901 52902/***/ }, 52903/* 523 */ 52904/***/ function(module, exports, __webpack_require__) { 52905 52906 'use strict'; 52907 52908 var _Symbol = __webpack_require__(44); 52909 52910 /** Used for built-in method references. */ 52911 var objectProto = Object.prototype; 52912 52913 /** Used to check objects for own properties. */ 52914 var hasOwnProperty = objectProto.hasOwnProperty; 52915 52916 /** 52917 * Used to resolve the 52918 * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) 52919 * of values. 52920 */ 52921 var nativeObjectToString = objectProto.toString; 52922 52923 /** Built-in value references. */ 52924 var symToStringTag = _Symbol ? _Symbol.toStringTag : undefined; 52925 52926 /** 52927 * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. 52928 * 52929 * @private 52930 * @param {*} value The value to query. 52931 * @returns {string} Returns the raw `toStringTag`. 52932 */ 52933 function getRawTag(value) { 52934 var isOwn = hasOwnProperty.call(value, symToStringTag), 52935 tag = value[symToStringTag]; 52936 52937 try { 52938 value[symToStringTag] = undefined; 52939 var unmasked = true; 52940 } catch (e) {} 52941 52942 var result = nativeObjectToString.call(value); 52943 if (unmasked) { 52944 if (isOwn) { 52945 value[symToStringTag] = tag; 52946 } else { 52947 delete value[symToStringTag]; 52948 } 52949 } 52950 return result; 52951 } 52952 52953 module.exports = getRawTag; 52954 52955/***/ }, 52956/* 524 */ 52957/***/ function(module, exports) { 52958 52959 "use strict"; 52960 52961 /** 52962 * Gets the value at `key` of `object`. 52963 * 52964 * @private 52965 * @param {Object} [object] The object to query. 52966 * @param {string} key The key of the property to get. 52967 * @returns {*} Returns the property value. 52968 */ 52969 function getValue(object, key) { 52970 return object == null ? undefined : object[key]; 52971 } 52972 52973 module.exports = getValue; 52974 52975/***/ }, 52976/* 525 */ 52977/***/ function(module, exports, __webpack_require__) { 52978 52979 'use strict'; 52980 52981 var nativeCreate = __webpack_require__(104); 52982 52983 /** 52984 * Removes all key-value entries from the hash. 52985 * 52986 * @private 52987 * @name clear 52988 * @memberOf Hash 52989 */ 52990 function hashClear() { 52991 this.__data__ = nativeCreate ? nativeCreate(null) : {}; 52992 this.size = 0; 52993 } 52994 52995 module.exports = hashClear; 52996 52997/***/ }, 52998/* 526 */ 52999/***/ function(module, exports) { 53000 53001 "use strict"; 53002 53003 /** 53004 * Removes `key` and its value from the hash. 53005 * 53006 * @private 53007 * @name delete 53008 * @memberOf Hash 53009 * @param {Object} hash The hash to modify. 53010 * @param {string} key The key of the value to remove. 53011 * @returns {boolean} Returns `true` if the entry was removed, else `false`. 53012 */ 53013 function hashDelete(key) { 53014 var result = this.has(key) && delete this.__data__[key]; 53015 this.size -= result ? 1 : 0; 53016 return result; 53017 } 53018 53019 module.exports = hashDelete; 53020 53021/***/ }, 53022/* 527 */ 53023/***/ function(module, exports, __webpack_require__) { 53024 53025 'use strict'; 53026 53027 var nativeCreate = __webpack_require__(104); 53028 53029 /** Used to stand-in for `undefined` hash values. */ 53030 var HASH_UNDEFINED = '__lodash_hash_undefined__'; 53031 53032 /** Used for built-in method references. */ 53033 var objectProto = Object.prototype; 53034 53035 /** Used to check objects for own properties. */ 53036 var hasOwnProperty = objectProto.hasOwnProperty; 53037 53038 /** 53039 * Gets the hash value for `key`. 53040 * 53041 * @private 53042 * @name get 53043 * @memberOf Hash 53044 * @param {string} key The key of the value to get. 53045 * @returns {*} Returns the entry value. 53046 */ 53047 function hashGet(key) { 53048 var data = this.__data__; 53049 if (nativeCreate) { 53050 var result = data[key]; 53051 return result === HASH_UNDEFINED ? undefined : result; 53052 } 53053 return hasOwnProperty.call(data, key) ? data[key] : undefined; 53054 } 53055 53056 module.exports = hashGet; 53057 53058/***/ }, 53059/* 528 */ 53060/***/ function(module, exports, __webpack_require__) { 53061 53062 'use strict'; 53063 53064 var nativeCreate = __webpack_require__(104); 53065 53066 /** Used for built-in method references. */ 53067 var objectProto = Object.prototype; 53068 53069 /** Used to check objects for own properties. */ 53070 var hasOwnProperty = objectProto.hasOwnProperty; 53071 53072 /** 53073 * Checks if a hash value for `key` exists. 53074 * 53075 * @private 53076 * @name has 53077 * @memberOf Hash 53078 * @param {string} key The key of the entry to check. 53079 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. 53080 */ 53081 function hashHas(key) { 53082 var data = this.__data__; 53083 return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key); 53084 } 53085 53086 module.exports = hashHas; 53087 53088/***/ }, 53089/* 529 */ 53090/***/ function(module, exports, __webpack_require__) { 53091 53092 'use strict'; 53093 53094 var nativeCreate = __webpack_require__(104); 53095 53096 /** Used to stand-in for `undefined` hash values. */ 53097 var HASH_UNDEFINED = '__lodash_hash_undefined__'; 53098 53099 /** 53100 * Sets the hash `key` to `value`. 53101 * 53102 * @private 53103 * @name set 53104 * @memberOf Hash 53105 * @param {string} key The key of the value to set. 53106 * @param {*} value The value to set. 53107 * @returns {Object} Returns the hash instance. 53108 */ 53109 function hashSet(key, value) { 53110 var data = this.__data__; 53111 this.size += this.has(key) ? 0 : 1; 53112 data[key] = nativeCreate && value === undefined ? HASH_UNDEFINED : value; 53113 return this; 53114 } 53115 53116 module.exports = hashSet; 53117 53118/***/ }, 53119/* 530 */
vendor: 4,096 bytes, lines 53120-53265
53120/***/ function(module, exports) { 53121 53122 'use strict'; 53123 53124 /** Used for built-in method references. */ 53125 var objectProto = Object.prototype; 53126 53127 /** Used to check objects for own properties. */ 53128 var hasOwnProperty = objectProto.hasOwnProperty; 53129 53130 /** 53131 * Initializes an array clone. 53132 * 53133 * @private 53134 * @param {Array} array The array to clone. 53135 * @returns {Array} Returns the initialized clone. 53136 */ 53137 function initCloneArray(array) { 53138 var length = array.length, 53139 result = array.constructor(length); 53140 53141 // Add properties assigned by `RegExp#exec`. 53142 if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) { 53143 result.index = array.index; 53144 result.input = array.input; 53145 } 53146 return result; 53147 } 53148 53149 module.exports = initCloneArray; 53150 53151/***/ }, 53152/* 531 */ 53153/***/ function(module, exports, __webpack_require__) { 53154 53155 'use strict'; 53156 53157 var cloneArrayBuffer = __webpack_require__(163), 53158 cloneDataView = __webpack_require__(505), 53159 cloneMap = __webpack_require__(506), 53160 cloneRegExp = __webpack_require__(507), 53161 cloneSet = __webpack_require__(508), 53162 cloneSymbol = __webpack_require__(509), 53163 cloneTypedArray = __webpack_require__(253); 53164 53165 /** `Object#toString` result references. */ 53166 var boolTag = '[object Boolean]', 53167 dateTag = '[object Date]', 53168 mapTag = '[object Map]', 53169 numberTag = '[object Number]', 53170 regexpTag = '[object RegExp]', 53171 setTag = '[object Set]', 53172 stringTag = '[object String]', 53173 symbolTag = '[object Symbol]'; 53174 53175 var arrayBufferTag = '[object ArrayBuffer]', 53176 dataViewTag = '[object DataView]', 53177 float32Tag = '[object Float32Array]', 53178 float64Tag = '[object Float64Array]', 53179 int8Tag = '[object Int8Array]', 53180 int16Tag = '[object Int16Array]', 53181 int32Tag = '[object Int32Array]', 53182 uint8Tag = '[object Uint8Array]', 53183 uint8ClampedTag = '[object Uint8ClampedArray]', 53184 uint16Tag = '[object Uint16Array]', 53185 uint32Tag = '[object Uint32Array]'; 53186 53187 /** 53188 * Initializes an object clone based on its `toStringTag`. 53189 * 53190 * **Note:** This function only supports cloning values with tags of 53191 * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. 53192 * 53193 * @private 53194 * @param {Object} object The object to clone. 53195 * @param {string} tag The `toStringTag` of the object to clone. 53196 * @param {Function} cloneFunc The function to clone values. 53197 * @param {boolean} [isDeep] Specify a deep clone. 53198 * @returns {Object} Returns the initialized clone. 53199 */ 53200 function initCloneByTag(object, tag, cloneFunc, isDeep) { 53201 var Ctor = object.constructor; 53202 switch (tag) { 53203 case arrayBufferTag: 53204 return cloneArrayBuffer(object); 53205 53206 case boolTag: 53207 case dateTag: 53208 return new Ctor(+object); 53209 53210 case dataViewTag: 53211 return cloneDataView(object, isDeep); 53212 53213 case float32Tag:case float64Tag: 53214 case int8Tag:case int16Tag:case int32Tag: 53215 case uint8Tag:case uint8ClampedTag:case uint16Tag:case uint32Tag: 53216 return cloneTypedArray(object, isDeep); 53217 53218 case mapTag: 53219 return cloneMap(object, isDeep, cloneFunc); 53220 53221 case numberTag: 53222 case stringTag: 53223 return new Ctor(object); 53224 53225 case regexpTag: 53226 return cloneRegExp(object); 53227 53228 case setTag: 53229 return cloneSet(object, isDeep, cloneFunc); 53230 53231 case symbolTag: 53232 return cloneSymbol(object); 53233 } 53234 } 53235 53236 module.exports = initCloneByTag; 53237 53238/***/ }, 53239/* 532 */ 53240/***/ function(module, exports, __webpack_require__) { 53241 53242 'use strict'; 53243 53244 var _Symbol = __webpack_require__(44), 53245 isArguments = __webpack_require__(110), 53246 isArray = __webpack_require__(7); 53247 53248 /** Built-in value references. */ 53249 var spreadableSymbol = _Symbol ? _Symbol.isConcatSpreadable : undefined; 53250 53251 /** 53252 * Checks if `value` is a flattenable `arguments` object or array. 53253 * 53254 * @private 53255 * @param {*} value The value to check. 53256 * @returns {boolean} Returns `true` if `value` is flattenable, else `false`. 53257 */ 53258 function isFlattenable(value) { 53259 return isArray(value) || isArguments(value) || !!(spreadableSymbol && value && value[spreadableSymbol]); 53260 } 53261 53262 module.exports = isFlattenable; 53263 53264/***/ }, 53265/* 533 */
53266/***/ function(module, exports) { 53267 53268 'use strict'; 53269 53270 var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; 53271 53272 /** 53273 * Checks if `value` is suitable for use as unique object key. 53274 * 53275 * @private 53276 * @param {*} value The value to check. 53277 * @returns {boolean} Returns `true` if `value` is suitable, else `false`. 53278 */ 53279 function isKeyable(value) { 53280 var type = typeof value === 'undefined' ? 'undefined' : _typeof(value); 53281 return type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean' ? value !== '__proto__' : value === null; 53282 } 53283 53284 module.exports = isKeyable; 53285 53286/***/ }, 53287/* 534 */ 53288/***/ function(module, exports, __webpack_require__) { 53289 53290 'use strict'; 53291 53292 var coreJsData = __webpack_require__(514); 53293 53294 /** Used to detect methods masquerading as native. */ 53295 var maskSrcKey = function () { 53296 var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); 53297 return uid ? 'Symbol(src)_1.' + uid : ''; 53298 }(); 53299 53300 /** 53301 * Checks if `func` has its source masked. 53302 * 53303 * @private 53304 * @param {Function} func The function to check. 53305 * @returns {boolean} Returns `true` if `func` is masked, else `false`. 53306 */ 53307 function isMasked(func) { 53308 return !!maskSrcKey && maskSrcKey in func; 53309 } 53310 53311 module.exports = isMasked; 53312 53313/***/ }, 53314/* 535 */ 53315/***/ function(module, exports) { 53316 53317 "use strict"; 53318 53319 /** 53320 * Removes all key-value entries from the list cache. 53321 * 53322 * @private 53323 * @name clear 53324 * @memberOf ListCache 53325 */ 53326 function listCacheClear() { 53327 this.__data__ = []; 53328 this.size = 0; 53329 } 53330 53331 module.exports = listCacheClear; 53332 53333/***/ }, 53334/* 536 */ 53335/***/ function(module, exports, __webpack_require__) { 53336 53337 'use strict'; 53338 53339 var assocIndexOf = __webpack_require__(98); 53340 53341 /** Used for built-in method references. */ 53342 var arrayProto = Array.prototype; 53343 53344 /** Built-in value references. */ 53345 var splice = arrayProto.splice; 53346 53347 /** 53348 * Removes `key` and its value from the list cache. 53349 * 53350 * @private 53351 * @name delete 53352 * @memberOf ListCache 53353 * @param {string} key The key of the value to remove. 53354 * @returns {boolean} Returns `true` if the entry was removed, else `false`. 53355 */ 53356 function listCacheDelete(key) { 53357 var data = this.__data__, 53358 index = assocIndexOf(data, key); 53359 53360 if (index < 0) { 53361 return false; 53362 } 53363 var lastIndex = data.length - 1; 53364 if (index == lastIndex) { 53365 data.pop(); 53366 } else { 53367 splice.call(data, index, 1); 53368 } 53369 --this.size; 53370 return true; 53371 } 53372 53373 module.exports = listCacheDelete; 53374 53375/***/ }, 53376/* 537 */ 53377/***/ function(module, exports, __webpack_require__) { 53378 53379 'use strict'; 53380 53381 var assocIndexOf = __webpack_require__(98); 53382 53383 /** 53384 * Gets the list cache value for `key`. 53385 * 53386 * @private 53387 * @name get 53388 * @memberOf ListCache 53389 * @param {string} key The key of the value to get. 53390 * @returns {*} Returns the entry value. 53391 */ 53392 function listCacheGet(key) { 53393 var data = this.__data__, 53394 index = assocIndexOf(data, key); 53395 53396 return index < 0 ? undefined : data[index][1]; 53397 } 53398 53399 module.exports = listCacheGet; 53400 53401/***/ }, 53402/* 538 */ 53403/***/ function(module, exports, __webpack_require__) { 53404 53405 'use strict'; 53406 53407 var assocIndexOf = __webpack_require__(98); 53408 53409 /** 53410 * Checks if a list cache value for `key` exists. 53411 * 53412 * @private 53413 * @name has 53414 * @memberOf ListCache 53415 * @param {string} key The key of the entry to check. 53416 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. 53417 */ 53418 function listCacheHas(key) { 53419 return assocIndexOf(this.__data__, key) > -1; 53420 } 53421 53422 module.exports = listCacheHas; 53423 53424/***/ }, 53425/* 539 */ 53426/***/ function(module, exports, __webpack_require__) { 53427 53428 'use strict'; 53429 53430 var assocIndexOf = __webpack_require__(98); 53431 53432 /** 53433 * Sets the list cache `key` to `value`. 53434 * 53435 * @private 53436 * @name set 53437 * @memberOf ListCache 53438 * @param {string} key The key of the value to set. 53439 * @param {*} value The value to set. 53440 * @returns {Object} Returns the list cache instance. 53441 */ 53442 function listCacheSet(key, value) { 53443 var data = this.__data__, 53444 index = assocIndexOf(data, key); 53445 53446 if (index < 0) { 53447 ++this.size; 53448 data.push([key, value]); 53449 } else { 53450 data[index][1] = value; 53451 } 53452 return this; 53453 } 53454 53455 module.exports = listCacheSet; 53456 53457/***/ }, 53458/* 540 */ 53459/***/ function(module, exports, __webpack_require__) { 53460 53461 'use strict'; 53462 53463 var Hash = __webpack_require__(462), 53464 ListCache = __webpack_require__(96), 53465 Map = __webpack_require__(155); 53466 53467 /** 53468 * Removes all key-value entries from the map. 53469 * 53470 * @private 53471 * @name clear 53472 * @memberOf MapCache 53473 */ 53474 function mapCacheClear() { 53475 this.size = 0; 53476 this.__data__ = { 53477 'hash': new Hash(), 53478 'map': new (Map || ListCache)(), 53479 'string': new Hash() 53480 }; 53481 } 53482 53483 module.exports = mapCacheClear; 53484 53485/***/ }, 53486/* 541 */ 53487/***/ function(module, exports, __webpack_require__) { 53488 53489 'use strict'; 53490 53491 var getMapData = __webpack_require__(102); 53492 53493 /** 53494 * Removes `key` and its value from the map. 53495 * 53496 * @private 53497 * @name delete 53498 * @memberOf MapCache 53499 * @param {string} key The key of the value to remove. 53500 * @returns {boolean} Returns `true` if the entry was removed, else `false`. 53501 */ 53502 function mapCacheDelete(key) { 53503 var result = getMapData(this, key)['delete'](key); 53504 this.size -= result ? 1 : 0; 53505 return result; 53506 } 53507 53508 module.exports = mapCacheDelete; 53509 53510/***/ }, 53511/* 542 */ 53512/***/ function(module, exports, __webpack_require__) { 53513 53514 'use strict'; 53515 53516 var getMapData = __webpack_require__(102); 53517 53518 /** 53519 * Gets the map value for `key`. 53520 * 53521 * @private 53522 * @name get 53523 * @memberOf MapCache 53524 * @param {string} key The key of the value to get. 53525 * @returns {*} Returns the entry value. 53526 */ 53527 function mapCacheGet(key) { 53528 return getMapData(this, key).get(key); 53529 } 53530 53531 module.exports = mapCacheGet; 53532 53533/***/ }, 53534/* 543 */ 53535/***/ function(module, exports, __webpack_require__) { 53536 53537 'use strict'; 53538 53539 var getMapData = __webpack_require__(102); 53540 53541 /** 53542 * Checks if a map value for `key` exists. 53543 * 53544 * @private 53545 * @name has 53546 * @memberOf MapCache 53547 * @param {string} key The key of the entry to check. 53548 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. 53549 */ 53550 function mapCacheHas(key) { 53551 return getMapData(this, key).has(key); 53552 } 53553 53554 module.exports = mapCacheHas; 53555 53556/***/ }, 53557/* 544 */ 53558/***/ function(module, exports, __webpack_require__) { 53559 53560 'use strict'; 53561 53562 var getMapData = __webpack_require__(102); 53563 53564 /** 53565 * Sets the map `key` to `value`. 53566 * 53567 * @private 53568 * @name set 53569 * @memberOf MapCache 53570 * @param {string} key The key of the value to set. 53571 * @param {*} value The value to set. 53572 * @returns {Object} Returns the map cache instance. 53573 */ 53574 function mapCacheSet(key, value) { 53575 var data = getMapData(this, key), 53576 size = data.size; 53577 53578 data.set(key, value); 53579 this.size += data.size == size ? 0 : 1; 53580 return this; 53581 } 53582 53583 module.exports = mapCacheSet; 53584 53585/***/ }, 53586/* 545 */ 53587/***/ function(module, exports, __webpack_require__) { 53588 53589 'use strict'; 53590 53591 var memoize = __webpack_require__(578); 53592 53593 /** Used as the maximum memoize cache size. */ 53594 var MAX_MEMOIZE_SIZE = 500; 53595 53596 /** 53597 * A specialized version of `_.memoize` which clears the memoized function's 53598 * cache when it exceeds `MAX_MEMOIZE_SIZE`. 53599 * 53600 * @private 53601 * @param {Function} func The function to have its output memoized. 53602 * @returns {Function} Returns the new memoized function. 53603 */ 53604 function memoizeCapped(func) { 53605 var result = memoize(func, function (key) { 53606 if (cache.size === MAX_MEMOIZE_SIZE) { 53607 cache.clear(); 53608 } 53609 return key; 53610 }); 53611 53612 var cache = result.cache; 53613 return result; 53614 } 53615 53616 module.exports = memoizeCapped; 53617 53618/***/ }, 53619/* 546 */ 53620/***/ function(module, exports, __webpack_require__) { 53621 53622 'use strict'; 53623 53624 var overArg = __webpack_require__(267); 53625 53626 /* Built-in method references for those with the same name as other `lodash` methods. */ 53627 var nativeKeys = overArg(Object.keys, Object); 53628 53629 module.exports = nativeKeys; 53630 53631/***/ }, 53632/* 547 */
53633/***/ function(module, exports) { 53634 53635 "use strict"; 53636 53637 /** 53638 * This function is like 53639 * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) 53640 * except that it includes inherited enumerable properties. 53641 * 53642 * @private 53643 * @param {Object} object The object to query. 53644 * @returns {Array} Returns the array of property names. 53645 */ 53646 function nativeKeysIn(object) { 53647 var result = []; 53648 if (object != null) { 53649 for (var key in Object(object)) { 53650 result.push(key); 53651 } 53652 } 53653 return result; 53654 } 53655 53656 module.exports = nativeKeysIn; 53657 53658/***/ }, 53659/* 548 */ 53660/***/ function(module, exports) { 53661 53662 "use strict"; 53663 53664 /** Used for built-in method references. */ 53665 var objectProto = Object.prototype; 53666 53667 /** 53668 * Used to resolve the 53669 * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) 53670 * of values. 53671 */ 53672 var nativeObjectToString = objectProto.toString; 53673 53674 /** 53675 * Converts `value` to a string using `Object.prototype.toString`. 53676 * 53677 * @private 53678 * @param {*} value The value to convert. 53679 * @returns {string} Returns the converted string. 53680 */ 53681 function objectToString(value) { 53682 return nativeObjectToString.call(value); 53683 } 53684 53685 module.exports = objectToString; 53686 53687/***/ }, 53688/* 549 */ 53689/***/ function(module, exports, __webpack_require__) { 53690 53691 'use strict'; 53692 53693 var apply = __webpack_require__(240); 53694 53695 /* Built-in method references for those with the same name as other `lodash` methods. */ 53696 var nativeMax = Math.max; 53697 53698 /** 53699 * A specialized version of `baseRest` which transforms the rest array. 53700 * 53701 * @private 53702 * @param {Function} func The function to apply a rest parameter to. 53703 * @param {number} [start=func.length-1] The start position of the rest parameter. 53704 * @param {Function} transform The rest array transform. 53705 * @returns {Function} Returns the new function. 53706 */ 53707 function overRest(func, start, transform) { 53708 start = nativeMax(start === undefined ? func.length - 1 : start, 0); 53709 return function () { 53710 var args = arguments, 53711 index = -1, 53712 length = nativeMax(args.length - start, 0), 53713 array = Array(length); 53714 53715 while (++index < length) { 53716 array[index] = args[start + index]; 53717 } 53718 index = -1; 53719 var otherArgs = Array(start + 1); 53720 while (++index < start) { 53721 otherArgs[index] = args[index]; 53722 } 53723 otherArgs[start] = transform(array); 53724 return apply(func, this, otherArgs); 53725 }; 53726 } 53727 53728 module.exports = overRest; 53729 53730/***/ }, 53731/* 550 */ 53732/***/ function(module, exports) { 53733 53734 'use strict'; 53735 53736 /** Used to stand-in for `undefined` hash values. */ 53737 var HASH_UNDEFINED = '__lodash_hash_undefined__'; 53738 53739 /** 53740 * Adds `value` to the array cache. 53741 * 53742 * @private 53743 * @name add 53744 * @memberOf SetCache 53745 * @alias push 53746 * @param {*} value The value to cache. 53747 * @returns {Object} Returns the cache instance. 53748 */ 53749 function setCacheAdd(value) { 53750 this.__data__.set(value, HASH_UNDEFINED); 53751 return this; 53752 } 53753 53754 module.exports = setCacheAdd; 53755 53756/***/ }, 53757/* 551 */ 53758/***/ function(module, exports) { 53759 53760 "use strict"; 53761 53762 /** 53763 * Checks if `value` is in the array cache. 53764 * 53765 * @private 53766 * @name has 53767 * @memberOf SetCache 53768 * @param {*} value The value to search for. 53769 * @returns {number} Returns `true` if `value` is found, else `false`. 53770 */ 53771 function setCacheHas(value) { 53772 return this.__data__.has(value); 53773 } 53774 53775 module.exports = setCacheHas; 53776 53777/***/ }, 53778/* 552 */ 53779/***/ function(module, exports, __webpack_require__) { 53780 53781 'use strict'; 53782 53783 var baseSetToString = __webpack_require__(500), 53784 shortOut = __webpack_require__(553); 53785 53786 /** 53787 * Sets the `toString` method of `func` to return `string`. 53788 * 53789 * @private 53790 * @param {Function} func The function to modify. 53791 * @param {Function} string The `toString` result. 53792 * @returns {Function} Returns `func`. 53793 */ 53794 var setToString = shortOut(baseSetToString); 53795 53796 module.exports = setToString; 53797 53798/***/ }, 53799/* 553 */ 53800/***/ function(module, exports) { 53801 53802 "use strict"; 53803 53804 /** Used to detect hot functions by number of calls within a span of milliseconds. */ 53805 var HOT_COUNT = 800, 53806 HOT_SPAN = 16; 53807 53808 /* Built-in method references for those with the same name as other `lodash` methods. */ 53809 var nativeNow = Date.now; 53810 53811 /** 53812 * Creates a function that'll short out and invoke `identity` instead 53813 * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN` 53814 * milliseconds. 53815 * 53816 * @private 53817 * @param {Function} func The function to restrict. 53818 * @returns {Function} Returns the new shortable function. 53819 */ 53820 function shortOut(func) { 53821 var count = 0, 53822 lastCalled = 0; 53823 53824 return function () { 53825 var stamp = nativeNow(), 53826 remaining = HOT_SPAN - (stamp - lastCalled); 53827 53828 lastCalled = stamp; 53829 if (remaining > 0) { 53830 if (++count >= HOT_COUNT) { 53831 return arguments[0]; 53832 } 53833 } else { 53834 count = 0; 53835 } 53836 return func.apply(undefined, arguments); 53837 }; 53838 } 53839 53840 module.exports = shortOut; 53841 53842/***/ }, 53843/* 554 */ 53844/***/ function(module, exports, __webpack_require__) { 53845 53846 'use strict'; 53847 53848 var ListCache = __webpack_require__(96); 53849 53850 /** 53851 * Removes all key-value entries from the stack. 53852 * 53853 * @private 53854 * @name clear 53855 * @memberOf Stack 53856 */ 53857 function stackClear() {
53858 this.__data__ = new ListCache(); 53859 this.size = 0; 53860 } 53861 53862 module.exports = stackClear; 53863 53864/***/ }, 53865/* 555 */ 53866/***/ function(module, exports) { 53867 53868 'use strict'; 53869 53870 /** 53871 * Removes `key` and its value from the stack. 53872 * 53873 * @private 53874 * @name delete 53875 * @memberOf Stack 53876 * @param {string} key The key of the value to remove. 53877 * @returns {boolean} Returns `true` if the entry was removed, else `false`. 53878 */ 53879 function stackDelete(key) { 53880 var data = this.__data__, 53881 result = data['delete'](key); 53882 53883 this.size = data.size; 53884 return result; 53885 } 53886 53887 module.exports = stackDelete; 53888 53889/***/ }, 53890/* 556 */ 53891/***/ function(module, exports) { 53892 53893 "use strict"; 53894 53895 /** 53896 * Gets the stack value for `key`. 53897 * 53898 * @private 53899 * @name get 53900 * @memberOf Stack 53901 * @param {string} key The key of the value to get. 53902 * @returns {*} Returns the entry value. 53903 */ 53904 function stackGet(key) { 53905 return this.__data__.get(key); 53906 } 53907 53908 module.exports = stackGet; 53909 53910/***/ }, 53911/* 557 */ 53912/***/ function(module, exports) { 53913 53914 "use strict"; 53915 53916 /** 53917 * Checks if a stack value for `key` exists. 53918 * 53919 * @private 53920 * @name has 53921 * @memberOf Stack 53922 * @param {string} key The key of the entry to check. 53923 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. 53924 */ 53925 function stackHas(key) { 53926 return this.__data__.has(key); 53927 } 53928 53929 module.exports = stackHas; 53930 53931/***/ }, 53932/* 558 */ 53933/***/ function(module, exports, __webpack_require__) { 53934 53935 'use strict'; 53936 53937 var ListCache = __webpack_require__(96), 53938 Map = __webpack_require__(155), 53939 MapCache = __webpack_require__(156); 53940 53941 /** Used as the size to enable large array optimizations. */ 53942 var LARGE_ARRAY_SIZE = 200; 53943 53944 /** 53945 * Sets the stack `key` to `value`. 53946 * 53947 * @private 53948 * @name set 53949 * @memberOf Stack 53950 * @param {string} key The key of the value to set. 53951 * @param {*} value The value to set. 53952 * @returns {Object} Returns the stack cache instance. 53953 */ 53954 function stackSet(key, value) { 53955 var data = this.__data__; 53956 if (data instanceof ListCache) { 53957 var pairs = data.__data__; 53958 if (!Map || pairs.length < LARGE_ARRAY_SIZE - 1) { 53959 pairs.push([key, value]); 53960 this.size = ++data.size; 53961 return this; 53962 } 53963 data = this.__data__ = new MapCache(pairs); 53964 } 53965 data.set(key, value); 53966 this.size = data.size; 53967 return this; 53968 } 53969 53970 module.exports = stackSet; 53971 53972/***/ }, 53973/* 559 */ 53974/***/ function(module, exports) { 53975 53976 "use strict"; 53977 53978 /** 53979 * A specialized version of `_.indexOf` which performs strict equality 53980 * comparisons of values, i.e. `===`. 53981 * 53982 * @private 53983 * @param {Array} array The array to inspect. 53984 * @param {*} value The value to search for. 53985 * @param {number} fromIndex The index to search from. 53986 * @returns {number} Returns the index of the matched value, else `-1`. 53987 */ 53988 function strictIndexOf(array, value, fromIndex) { 53989 var index = fromIndex - 1, 53990 length = array.length; 53991 53992 while (++index < length) { 53993 if (array[index] === value) { 53994 return index; 53995 } 53996 } 53997 return -1; 53998 } 53999 54000 module.exports = strictIndexOf; 54001 54002/***/ }, 54003/* 560 */ 54004/***/ function(module, exports, __webpack_require__) { 54005 54006 'use strict'; 54007 54008 var memoizeCapped = __webpack_require__(545); 54009 54010 /** Used to match property names within property paths. */ 54011 var reLeadingDot = /^\./, 54012 rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; 54013 54014 /** Used to match backslashes in property paths. */ 54015 var reEscapeChar = /\\(\\)?/g; 54016 54017 /** 54018 * Converts `string` to a property path array. 54019 * 54020 * @private 54021 * @param {string} string The string to convert. 54022 * @returns {Array} Returns the property path array. 54023 */ 54024 var stringToPath = memoizeCapped(function (string) { 54025 var result = []; 54026 if (reLeadingDot.test(string)) { 54027 result.push(''); 54028 } 54029 string.replace(rePropName, function (match, number, quote, string) { 54030 result.push(quote ? string.replace(reEscapeChar, '$1') : number || match); 54031 }); 54032 return result; 54033 }); 54034 54035 module.exports = stringToPath; 54036 54037/***/ }, 54038/* 561 */ 54039/***/ function(module, exports, __webpack_require__) { 54040 54041 'use strict'; 54042 54043 var copyObject = __webpack_require__(30), 54044 createAssigner = __webpack_require__(101), 54045 keysIn = __webpack_require__(46); 54046 54047 /** 54048 * This method is like `_.assign` except that it iterates over own and 54049 * inherited source properties. 54050 * 54051 * **Note:** This method mutates `object`. 54052 * 54053 * @static 54054 * @memberOf _ 54055 * @since 4.0.0 54056 * @alias extend 54057 * @category Object 54058 * @param {Object} object The destination object. 54059 * @param {...Object} [sources] The source objects. 54060 * @returns {Object} Returns `object`. 54061 * @see _.assign 54062 * @example 54063 * 54064 * function Foo() { 54065 * this.a = 1; 54066 * } 54067 * 54068 * function Bar() { 54069 * this.c = 3; 54070 * } 54071 * 54072 * Foo.prototype.b = 2; 54073 * Bar.prototype.d = 4; 54074 * 54075 * _.assignIn({ 'a': 0 }, new Foo, new Bar); 54076 * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 } 54077 */ 54078 var assignIn = createAssigner(function (object, source) { 54079 copyObject(source, keysIn(source), object); 54080 }); 54081 54082 module.exports = assignIn; 54083 54084/***/ }, 54085/* 562 */ 54086/***/ function(module, exports, __webpack_require__) { 54087 54088 'use strict'; 54089 54090 var copyObject = __webpack_require__(30), 54091 createAssigner = __webpack_require__(101), 54092 keysIn = __webpack_require__(46); 54093 54094 /** 54095 * This method is like `_.assignIn` except that it accepts `customizer` 54096 * which is invoked to produce the assigned values. If `customizer` returns 54097 * `undefined`, assignment is handled by the method instead. The `customizer` 54098 * is invoked with five arguments: (objValue, srcValue, key, object, source).
54099 * 54100 * **Note:** This method mutates `object`. 54101 * 54102 * @static 54103 * @memberOf _ 54104 * @since 4.0.0 54105 * @alias extendWith 54106 * @category Object 54107 * @param {Object} object The destination object. 54108 * @param {...Object} sources The source objects. 54109 * @param {Function} [customizer] The function to customize assigned values. 54110 * @returns {Object} Returns `object`. 54111 * @see _.assignWith 54112 * @example 54113 * 54114 * function customizer(objValue, srcValue) { 54115 * return _.isUndefined(objValue) ? srcValue : objValue; 54116 * } 54117 * 54118 * var defaults = _.partialRight(_.assignInWith, customizer); 54119 * 54120 * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); 54121 * // => { 'a': 1, 'b': 2 } 54122 */ 54123 var assignInWith = createAssigner(function (object, source, srcIndex, customizer) { 54124 copyObject(source, keysIn(source), object, customizer); 54125 }); 54126 54127 module.exports = assignInWith; 54128 54129/***/ }, 54130/* 563 */ 54131/***/ function(module, exports, __webpack_require__) { 54132 54133 'use strict'; 54134 54135 var baseClone = __webpack_require__(160); 54136 54137 /** Used to compose bitmasks for cloning. */ 54138 var CLONE_DEEP_FLAG = 1, 54139 CLONE_SYMBOLS_FLAG = 4; 54140 54141 /** 54142 * This method is like `_.clone` except that it recursively clones `value`. 54143 * 54144 * @static 54145 * @memberOf _ 54146 * @since 1.0.0 54147 * @category Lang 54148 * @param {*} value The value to recursively clone. 54149 * @returns {*} Returns the deep cloned value. 54150 * @see _.clone 54151 * @example 54152 * 54153 * var objects = [{ 'a': 1 }, { 'b': 2 }]; 54154 * 54155 * var deep = _.cloneDeep(objects); 54156 * console.log(deep[0] === objects[0]); 54157 * // => false 54158 */ 54159 function cloneDeep(value) { 54160 return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG); 54161 } 54162 54163 module.exports = cloneDeep; 54164 54165/***/ }, 54166/* 564 */ 54167/***/ function(module, exports, __webpack_require__) { 54168 54169 'use strict'; 54170 54171 var baseClone = __webpack_require__(160); 54172 54173 /** Used to compose bitmasks for cloning. */ 54174 var CLONE_DEEP_FLAG = 1, 54175 CLONE_SYMBOLS_FLAG = 4; 54176 54177 /** 54178 * This method is like `_.cloneWith` except that it recursively clones `value`. 54179 * 54180 * @static 54181 * @memberOf _ 54182 * @since 4.0.0 54183 * @category Lang 54184 * @param {*} value The value to recursively clone. 54185 * @param {Function} [customizer] The function to customize cloning. 54186 * @returns {*} Returns the deep cloned value. 54187 * @see _.cloneWith 54188 * @example 54189 * 54190 * function customizer(value) { 54191 * if (_.isElement(value)) { 54192 * return value.cloneNode(true); 54193 * } 54194 * } 54195 * 54196 * var el = _.cloneDeepWith(document.body, customizer); 54197 * 54198 * console.log(el === document.body); 54199 * // => false 54200 * console.log(el.nodeName); 54201 * // => 'BODY' 54202 * console.log(el.childNodes.length); 54203 * // => 20 54204 */ 54205 function cloneDeepWith(value, customizer) { 54206 customizer = typeof customizer == 'function' ? customizer : undefined; 54207 return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer); 54208 } 54209 54210 module.exports = cloneDeepWith; 54211 54212/***/ }, 54213/* 565 */ 54214/***/ function(module, exports) { 54215 54216 "use strict"; 54217 54218 /** 54219 * Creates a function that returns `value`. 54220 * 54221 * @static 54222 * @memberOf _ 54223 * @since 2.4.0 54224 * @category Util 54225 * @param {*} value The value to return from the new function. 54226 * @returns {Function} Returns the new constant function. 54227 * @example 54228 * 54229 * var objects = _.times(2, _.constant({ 'a': 1 })); 54230 * 54231 * console.log(objects); 54232 * // => [{ 'a': 1 }, { 'a': 1 }] 54233 * 54234 * console.log(objects[0] === objects[1]); 54235 * // => true 54236 */ 54237 function constant(value) { 54238 return function () { 54239 return value; 54240 }; 54241 } 54242 54243 module.exports = constant; 54244 54245/***/ }, 54246/* 566 */ 54247/***/ function(module, exports, __webpack_require__) { 54248 54249 'use strict'; 54250 54251 var toString = __webpack_require__(112); 54252 54253 /** 54254 * Used to match `RegExp` 54255 * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). 54256 */ 54257 var reRegExpChar = /[\\^$.*+?()[\]{}|]/g, 54258 reHasRegExpChar = RegExp(reRegExpChar.source); 54259 54260 /** 54261 * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+", 54262 * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`. 54263 * 54264 * @static 54265 * @memberOf _ 54266 * @since 3.0.0 54267 * @category String 54268 * @param {string} [string=''] The string to escape. 54269 * @returns {string} Returns the escaped string. 54270 * @example 54271 * 54272 * _.escapeRegExp('[lodash](https://lodash.com/)'); 54273 * // => '\[lodash\]\(https://lodash\.com/\)' 54274 */ 54275 function escapeRegExp(string) { 54276 string = toString(string); 54277 return string && reHasRegExpChar.test(string) ? string.replace(reRegExpChar, '\\$&') : string; 54278 } 54279 54280 module.exports = escapeRegExp; 54281 54282/***/ }, 54283/* 567 */ 54284/***/ function(module, exports, __webpack_require__) { 54285 54286 'use strict'; 54287 54288 module.exports = __webpack_require__(561); 54289 54290/***/ }, 54291/* 568 */ 54292/***/ function(module, exports, __webpack_require__) { 54293 54294 'use strict'; 54295 54296 var createFind = __webpack_require__(254), 54297 findIndex = __webpack_require__(569); 54298 54299 /** 54300 * Iterates over elements of `collection`, returning the first element 54301 * `predicate` returns truthy for. The predicate is invoked with three 54302 * arguments: (value, index|key, collection). 54303 * 54304 * @static 54305 * @memberOf _ 54306 * @since 0.1.0 54307 * @category Collection 54308 * @param {Array|Object} collection The collection to inspect. 54309 * @param {Function} [predicate=_.identity] The function invoked per iteration. 54310 * @param {number} [fromIndex=0] The index to search from. 54311 * @returns {*} Returns the matched element, else `undefined`. 54312 * @example 54313 * 54314 * var users = [ 54315 * { 'user': 'barney', 'age': 36, 'active': true }, 54316 * { 'user': 'fred', 'age': 40, 'active': false }, 54317 * { 'user': 'pebbles', 'age': 1, 'active': true } 54318 * ]; 54319 * 54320 * _.find(users, function(o) { return o.age < 40; }); 54321 * // => object for 'barney' 54322 * 54323 * // The `_.matches` iteratee shorthand. 54324 * _.find(users, { 'age': 1, 'active': true }); 54325 * // => object for 'pebbles' 54326 * 54327 * // The `_.matchesProperty` iteratee shorthand. 54328 * _.find(users, ['active', false]); 54329 * // => object for 'fred' 54330 * 54331 * // The `_.property` iteratee shorthand. 54332 * _.find(users, 'active'); 54333 * // => object for 'barney' 54334 */ 54335 var find = createFind(findIndex); 54336 54337 module.exports = find; 54338 54339/***/ }, 54340/* 569 */ 54341/***/ function(module, exports, __webpack_require__) { 54342 54343 'use strict'; 54344 54345 var baseFindIndex = __webpack_require__(161), 54346 baseIteratee = __webpack_require__(59), 54347 toInteger = __webpack_require__(47); 54348 54349 /* Built-in method references for those with the same name as other `lodash` methods. */ 54350 var nativeMax = Math.max; 54351 54352 /** 54353 * This method is like `_.find` except that it returns the index of the first 54354 * element `predicate` returns truthy for instead of the element itself. 54355 * 54356 * @static 54357 * @memberOf _ 54358 * @since 1.1.0 54359 * @category Array 54360 * @param {Array} array The array to inspect. 54361 * @param {Function} [predicate=_.identity] The function invoked per iteration. 54362 * @param {number} [fromIndex=0] The index to search from. 54363 * @returns {number} Returns the index of the found element, else `-1`. 54364 * @example 54365 * 54366 * var users = [ 54367 * { 'user': 'barney', 'active': false }, 54368 * { 'user': 'fred', 'active': false }, 54369 * { 'user': 'pebbles', 'active': true } 54370 * ]; 54371 * 54372 * _.findIndex(users, function(o) { return o.user == 'barney'; }); 54373 * // => 0 54374 * 54375 * // The `_.matches` iteratee shorthand. 54376 * _.findIndex(users, { 'user': 'fred', 'active': false }); 54377 * // => 1 54378 * 54379 * // The `_.matchesProperty` iteratee shorthand. 54380 * _.findIndex(users, ['active', false]); 54381 * // => 0 54382 * 54383 * // The `_.property` iteratee shorthand. 54384 * _.findIndex(users, 'active'); 54385 * // => 2 54386 */ 54387 function findIndex(array, predicate, fromIndex) { 54388 var length = array == null ? 0 : array.length; 54389 if (!length) { 54390 return -1; 54391 } 54392 var index = fromIndex == null ? 0 : toInteger(fromIndex); 54393 if (index < 0) { 54394 index = nativeMax(length + index, 0); 54395 } 54396 return baseFindIndex(array, baseIteratee(predicate, 3), index); 54397 } 54398 54399 module.exports = findIndex; 54400 54401/***/ }, 54402/* 570 */ 54403/***/ function(module, exports, __webpack_require__) { 54404 54405 'use strict'; 54406 54407 var createFind = __webpack_require__(254), 54408 findLastIndex = __webpack_require__(571); 54409 54410 /** 54411 * This method is like `_.find` except that it iterates over elements of 54412 * `collection` from right to left. 54413 * 54414 * @static 54415 * @memberOf _ 54416 * @since 2.0.0 54417 * @category Collection 54418 * @param {Array|Object} collection The collection to inspect. 54419 * @param {Function} [predicate=_.identity] The function invoked per iteration. 54420 * @param {number} [fromIndex=collection.length-1] The index to search from. 54421 * @returns {*} Returns the matched element, else `undefined`. 54422 * @example 54423 * 54424 * _.findLast([1, 2, 3, 4], function(n) { 54425 * return n % 2 == 1; 54426 * }); 54427 * // => 3 54428 */ 54429 var findLast = createFind(findLastIndex); 54430 54431 module.exports = findLast; 54432 54433/***/ }, 54434/* 571 */ 54435/***/ function(module, exports, __webpack_require__) { 54436 54437 'use strict'; 54438 54439 var baseFindIndex = __webpack_require__(161), 54440 baseIteratee = __webpack_require__(59), 54441 toInteger = __webpack_require__(47); 54442 54443 /* Built-in method references for those with the same name as other `lodash` methods. */ 54444 var nativeMax = Math.max, 54445 nativeMin = Math.min; 54446 54447 /** 54448 * This method is like `_.findIndex` except that it iterates over elements 54449 * of `collection` from right to left. 54450 * 54451 * @static 54452 * @memberOf _ 54453 * @since 2.0.0 54454 * @category Array 54455 * @param {Array} array The array to inspect. 54456 * @param {Function} [predicate=_.identity] The function invoked per iteration. 54457 * @param {number} [fromIndex=array.length-1] The index to search from. 54458 * @returns {number} Returns the index of the found element, else `-1`. 54459 * @example 54460 * 54461 * var users = [ 54462 * { 'user': 'barney', 'active': true }, 54463 * { 'user': 'fred', 'active': false }, 54464 * { 'user': 'pebbles', 'active': false } 54465 * ]; 54466 * 54467 * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; }); 54468 * // => 2 54469 * 54470 * // The `_.matches` iteratee shorthand. 54471 * _.findLastIndex(users, { 'user': 'barney', 'active': true }); 54472 * // => 0 54473 * 54474 * // The `_.matchesProperty` iteratee shorthand. 54475 * _.findLastIndex(users, ['active', false]); 54476 * // => 2 54477 * 54478 * // The `_.property` iteratee shorthand. 54479 * _.findLastIndex(users, 'active'); 54480 * // => 0 54481 */ 54482 function findLastIndex(array, predicate, fromIndex) { 54483 var length = array == null ? 0 : array.length; 54484 if (!length) { 54485 return -1; 54486 } 54487 var index = length - 1; 54488 if (fromIndex !== undefined) { 54489 index = toInteger(fromIndex); 54490 index = fromIndex < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1); 54491 } 54492 return baseFindIndex(array, baseIteratee(predicate, 3), index, true); 54493 } 54494 54495 module.exports = findLastIndex; 54496 54497/***/ }, 54498/* 572 */ 54499/***/ function(module, exports, __webpack_require__) { 54500 54501 'use strict'; 54502 54503 var baseGet = __webpack_require__(245); 54504 54505 /** 54506 * Gets the value at `path` of `object`. If the resolved value is 54507 * `undefined`, the `defaultValue` is returned in its place. 54508 * 54509 * @static 54510 * @memberOf _ 54511 * @since 3.7.0 54512 * @category Object 54513 * @param {Object} object The object to query. 54514 * @param {Array|string} path The path of the property to get. 54515 * @param {*} [defaultValue] The value returned for `undefined` resolved values. 54516 * @returns {*} Returns the resolved value. 54517 * @example 54518 * 54519 * var object = { 'a': [{ 'b': { 'c': 3 } }] }; 54520 * 54521 * _.get(object, 'a[0].b.c'); 54522 * // => 3 54523 * 54524 * _.get(object, ['a', '0', 'b', 'c']); 54525 * // => 3 54526 * 54527 * _.get(object, 'a.b.c', 'default'); 54528 * // => 'default' 54529 */ 54530 function get(object, path, defaultValue) { 54531 var result = object == null ? undefined : baseGet(object, path); 54532 return result === undefined ? defaultValue : result; 54533 } 54534 54535 module.exports = get; 54536 54537/***/ }, 54538/* 573 */ 54539/***/ function(module, exports, __webpack_require__) { 54540 54541 'use strict'; 54542 54543 var baseHasIn = __webpack_require__(480), 54544 hasPath = __webpack_require__(261); 54545 54546 /** 54547 * Checks if `path` is a direct or inherited property of `object`. 54548 * 54549 * @static 54550 * @memberOf _ 54551 * @since 4.0.0 54552 * @category Object 54553 * @param {Object} object The object to query. 54554 * @param {Array|string} path The path to check. 54555 * @returns {boolean} Returns `true` if `path` exists, else `false`. 54556 * @example 54557 * 54558 * var object = _.create({ 'a': _.create({ 'b': 2 }) }); 54559 * 54560 * _.hasIn(object, 'a'); 54561 * // => true 54562 * 54563 * _.hasIn(object, 'a.b'); 54564 * // => true 54565 * 54566 * _.hasIn(object, ['a', 'b']); 54567 * // => true 54568 * 54569 * _.hasIn(object, 'b'); 54570 * // => false 54571 */ 54572 function hasIn(object, path) { 54573 return object != null && hasPath(object, path, baseHasIn); 54574 } 54575 54576 module.exports = hasIn; 54577 54578/***/ }, 54579/* 574 */ 54580/***/ function(module, exports, __webpack_require__) { 54581 54582 'use strict'; 54583 54584 var isArrayLike = __webpack_require__(24), 54585 isObjectLike = __webpack_require__(25); 54586 54587 /** 54588 * This method is like `_.isArrayLike` except that it also checks if `value` 54589 * is an object. 54590 * 54591 * @static 54592 * @memberOf _ 54593 * @since 4.0.0 54594 * @category Lang 54595 * @param {*} value The value to check. 54596 * @returns {boolean} Returns `true` if `value` is an array-like object, 54597 * else `false`. 54598 * @example 54599 * 54600 * _.isArrayLikeObject([1, 2, 3]); 54601 * // => true 54602 * 54603 * _.isArrayLikeObject(document.body.children); 54604 * // => true 54605 * 54606 * _.isArrayLikeObject('abc'); 54607 * // => false 54608 * 54609 * _.isArrayLikeObject(_.noop); 54610 * // => false 54611 */ 54612 function isArrayLikeObject(value) { 54613 return isObjectLike(value) && isArrayLike(value); 54614 } 54615 54616 module.exports = isArrayLikeObject; 54617 54618/***/ }, 54619/* 575 */ 54620/***/ function(module, exports, __webpack_require__) { 54621 54622 'use strict'; 54623 54624 var toInteger = __webpack_require__(47); 54625 54626 /** 54627 * Checks if `value` is an integer. 54628 * 54629 * **Note:** This method is based on 54630 * [`Number.isInteger`](https://mdn.io/Number/isInteger). 54631 * 54632 * @static 54633 * @memberOf _ 54634 * @since 4.0.0 54635 * @category Lang 54636 * @param {*} value The value to check. 54637 * @returns {boolean} Returns `true` if `value` is an integer, else `false`. 54638 * @example 54639 * 54640 * _.isInteger(3); 54641 * // => true 54642 * 54643 * _.isInteger(Number.MIN_VALUE); 54644 * // => false 54645 * 54646 * _.isInteger(Infinity); 54647 * // => false 54648 * 54649 * _.isInteger('3'); 54650 * // => false 54651 */ 54652 function isInteger(value) { 54653 return typeof value == 'number' && value == toInteger(value); 54654 } 54655 54656 module.exports = isInteger; 54657 54658/***/ }, 54659/* 576 */ 54660/***/ function(module, exports, __webpack_require__) { 54661 54662 'use strict'; 54663 54664 var baseGetTag = __webpack_require__(29), 54665 isArray = __webpack_require__(7), 54666 isObjectLike = __webpack_require__(25); 54667 54668 /** `Object#toString` result references. */ 54669 var stringTag = '[object String]'; 54670 54671 /** 54672 * Checks if `value` is classified as a `String` primitive or object. 54673 * 54674 * @static 54675 * @since 0.1.0 54676 * @memberOf _ 54677 * @category Lang 54678 * @param {*} value The value to check. 54679 * @returns {boolean} Returns `true` if `value` is a string, else `false`. 54680 * @example 54681 * 54682 * _.isString('abc'); 54683 * // => true 54684 * 54685 * _.isString(1); 54686 * // => false 54687 */ 54688 function isString(value) { 54689 return typeof value == 'string' || !isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag; 54690 } 54691 54692 module.exports = isString; 54693 54694/***/ }, 54695/* 577 */ 54696/***/ function(module, exports, __webpack_require__) { 54697 54698 'use strict'; 54699 54700 var arrayMap = __webpack_require__(58), 54701 baseIteratee = __webpack_require__(59), 54702 baseMap = __webpack_require__(248), 54703 isArray = __webpack_require__(7); 54704 54705 /** 54706 * Creates an array of values by running each element in `collection` thru 54707 * `iteratee`. The iteratee is invoked with three arguments: 54708 * (value, index|key, collection). 54709 * 54710 * Many lodash methods are guarded to work as iteratees for methods like 54711 * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`. 54712 * 54713 * The guarded methods are: 54714 * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`, 54715 * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`, 54716 * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`, 54717 * `template`, `trim`, `trimEnd`, `trimStart`, and `words` 54718 * 54719 * @static 54720 * @memberOf _ 54721 * @since 0.1.0 54722 * @category Collection 54723 * @param {Array|Object} collection The collection to iterate over. 54724 * @param {Function} [iteratee=_.identity] The function invoked per iteration. 54725 * @returns {Array} Returns the new mapped array.
54726 * @example 54727 * 54728 * function square(n) { 54729 * return n * n; 54730 * } 54731 * 54732 * _.map([4, 8], square); 54733 * // => [16, 64] 54734 * 54735 * _.map({ 'a': 4, 'b': 8 }, square); 54736 * // => [16, 64] (iteration order is not guaranteed) 54737 * 54738 * var users = [ 54739 * { 'user': 'barney' }, 54740 * { 'user': 'fred' } 54741 * ]; 54742 * 54743 * // The `_.property` iteratee shorthand. 54744 * _.map(users, 'user'); 54745 * // => ['barney', 'fred'] 54746 */ 54747 function map(collection, iteratee) { 54748 var func = isArray(collection) ? arrayMap : baseMap; 54749 return func(collection, baseIteratee(iteratee, 3)); 54750 } 54751 54752 module.exports = map; 54753 54754/***/ }, 54755/* 578 */ 54756/***/ function(module, exports, __webpack_require__) { 54757 54758 'use strict'; 54759 54760 var MapCache = __webpack_require__(156); 54761 54762 /** Error message constants. */ 54763 var FUNC_ERROR_TEXT = 'Expected a function'; 54764 54765 /** 54766 * Creates a function that memoizes the result of `func`. If `resolver` is 54767 * provided, it determines the cache key for storing the result based on the 54768 * arguments provided to the memoized function. By default, the first argument 54769 * provided to the memoized function is used as the map cache key. The `func` 54770 * is invoked with the `this` binding of the memoized function. 54771 * 54772 * **Note:** The cache is exposed as the `cache` property on the memoized 54773 * function. Its creation may be customized by replacing the `_.memoize.Cache` 54774 * constructor with one whose instances implement the 54775 * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object) 54776 * method interface of `clear`, `delete`, `get`, `has`, and `set`. 54777 * 54778 * @static 54779 * @memberOf _ 54780 * @since 0.1.0 54781 * @category Function 54782 * @param {Function} func The function to have its output memoized. 54783 * @param {Function} [resolver] The function to resolve the cache key. 54784 * @returns {Function} Returns the new memoized function. 54785 * @example 54786 * 54787 * var object = { 'a': 1, 'b': 2 }; 54788 * var other = { 'c': 3, 'd': 4 }; 54789 * 54790 * var values = _.memoize(_.values); 54791 * values(object); 54792 * // => [1, 2] 54793 * 54794 * values(other); 54795 * // => [3, 4] 54796 * 54797 * object.a = 2; 54798 * values(object); 54799 * // => [1, 2] 54800 * 54801 * // Modify the result cache. 54802 * values.cache.set(object, ['a', 'b']); 54803 * values(object); 54804 * // => ['a', 'b'] 54805 * 54806 * // Replace `_.memoize.Cache`. 54807 * _.memoize.Cache = WeakMap; 54808 */ 54809 function memoize(func, resolver) { 54810 if (typeof func != 'function' || resolver != null && typeof resolver != 'function') { 54811 throw new TypeError(FUNC_ERROR_TEXT); 54812 } 54813 var memoized = function memoized() { 54814 var args = arguments, 54815 key = resolver ? resolver.apply(this, args) : args[0], 54816 cache = memoized.cache; 54817 54818 if (cache.has(key)) { 54819 return cache.get(key); 54820 } 54821 var result = func.apply(this, args); 54822 memoized.cache = cache.set(key, result) || cache; 54823 return result; 54824 }; 54825 memoized.cache = new (memoize.Cache || MapCache)(); 54826 return memoized; 54827 } 54828 54829 // Expose `MapCache`. 54830 memoize.Cache = MapCache; 54831 54832 module.exports = memoize; 54833 54834/***/ }, 54835/* 579 */ 54836/***/ function(module, exports, __webpack_require__) { 54837 54838 'use strict'; 54839 54840 var baseMerge = __webpack_require__(493), 54841 createAssigner = __webpack_require__(101); 54842 54843 /** 54844 * This method is like `_.merge` except that it accepts `customizer` which 54845 * is invoked to produce the merged values of the destination and source 54846 * properties. If `customizer` returns `undefined`, merging is handled by the 54847 * method instead. The `customizer` is invoked with six arguments: 54848 * (objValue, srcValue, key, object, source, stack). 54849 * 54850 * **Note:** This method mutates `object`. 54851 * 54852 * @static 54853 * @memberOf _ 54854 * @since 4.0.0 54855 * @category Object 54856 * @param {Object} object The destination object. 54857 * @param {...Object} sources The source objects. 54858 * @param {Function} customizer The function to customize assigned values. 54859 * @returns {Object} Returns `object`. 54860 * @example 54861 * 54862 * function customizer(objValue, srcValue) { 54863 * if (_.isArray(objValue)) { 54864 * return objValue.concat(srcValue); 54865 * } 54866 * } 54867 * 54868 * var object = { 'a': [1], 'b': [2] }; 54869 * var other = { 'a': [3], 'b': [4] }; 54870 * 54871 * _.mergeWith(object, other, customizer); 54872 * // => { 'a': [1, 3], 'b': [2, 4] } 54873 */ 54874 var mergeWith = createAssigner(function (object, source, srcIndex, customizer) { 54875 baseMerge(object, source, srcIndex, customizer); 54876 }); 54877 54878 module.exports = mergeWith; 54879 54880/***/ }, 54881/* 580 */
54882/***/ function(module, exports) { 54883 54884 "use strict"; 54885 54886 /** 54887 * This method returns `undefined`. 54888 * 54889 * @static 54890 * @memberOf _ 54891 * @since 2.3.0 54892 * @category Util 54893 * @example 54894 * 54895 * _.times(2, _.noop); 54896 * // => [undefined, undefined] 54897 */ 54898 function noop() { 54899 // No operation performed. 54900 } 54901 54902 module.exports = noop; 54903 54904/***/ }, 54905/* 581 */ 54906/***/ function(module, exports, __webpack_require__) { 54907 54908 'use strict'; 54909 54910 var baseProperty = __webpack_require__(496), 54911 basePropertyDeep = __webpack_require__(497), 54912 isKey = __webpack_require__(169), 54913 toKey = __webpack_require__(106); 54914 54915 /** 54916 * Creates a function that returns the value at `path` of a given object. 54917 * 54918 * @static 54919 * @memberOf _ 54920 * @since 2.4.0 54921 * @category Util 54922 * @param {Array|string} path The path of the property to get. 54923 * @returns {Function} Returns the new accessor function. 54924 * @example 54925 * 54926 * var objects = [ 54927 * { 'a': { 'b': 2 } }, 54928 * { 'a': { 'b': 1 } } 54929 * ]; 54930 * 54931 * _.map(objects, _.property('a.b')); 54932 * // => [2, 1] 54933 * 54934 * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b'); 54935 * // => [1, 2] 54936 */ 54937 function property(path) { 54938 return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path); 54939 } 54940 54941 module.exports = property; 54942 54943/***/ }, 54944/* 582 */ 54945/***/ function(module, exports, __webpack_require__) { 54946 54947 'use strict'; 54948 54949 var basePullAll = __webpack_require__(498); 54950 54951 /** 54952 * This method is like `_.pull` except that it accepts an array of values to remove. 54953 * 54954 * **Note:** Unlike `_.difference`, this method mutates `array`. 54955 * 54956 * @static 54957 * @memberOf _ 54958 * @since 4.0.0 54959 * @category Array 54960 * @param {Array} array The array to modify. 54961 * @param {Array} values The values to remove. 54962 * @returns {Array} Returns `array`. 54963 * @example 54964 * 54965 * var array = ['a', 'b', 'c', 'a', 'b', 'c']; 54966 * 54967 * _.pullAll(array, ['a', 'c']); 54968 * console.log(array); 54969 * // => ['b', 'b'] 54970 */ 54971 function pullAll(array, values) { 54972 return array && array.length && values && values.length ? basePullAll(array, values) : array; 54973 } 54974 54975 module.exports = pullAll; 54976 54977/***/ }, 54978/* 583 */ 54979/***/ function(module, exports, __webpack_require__) { 54980 54981 'use strict'; 54982 54983 var baseFlatten = __webpack_require__(477), 54984 baseOrderBy = __webpack_require__(495), 54985 baseRest = __webpack_require__(99), 54986 isIterateeCall = __webpack_require__(168); 54987 54988 /** 54989 * Creates an array of elements, sorted in ascending order by the results of 54990 * running each element in a collection thru each iteratee. This method 54991 * performs a stable sort, that is, it preserves the original sort order of 54992 * equal elements. The iteratees are invoked with one argument: (value). 54993 * 54994 * @static 54995 * @memberOf _ 54996 * @since 0.1.0 54997 * @category Collection 54998 * @param {Array|Object} collection The collection to iterate over. 54999 * @param {...(Function|Function[])} [iteratees=[_.identity]] 55000 * The iteratees to sort by. 55001 * @returns {Array} Returns the new sorted array. 55002 * @example 55003 * 55004 * var users = [ 55005 * { 'user': 'fred', 'age': 48 }, 55006 * { 'user': 'barney', 'age': 36 }, 55007 * { 'user': 'fred', 'age': 40 }, 55008 * { 'user': 'barney', 'age': 34 } 55009 * ]; 55010 * 55011 * _.sortBy(users, [function(o) { return o.user; }]); 55012 * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]] 55013 * 55014 * _.sortBy(users, ['user', 'age']); 55015 * // => objects for [['barney', 34], ['barney', 36], ['fred', 40], ['fred', 48]] 55016 */ 55017 var sortBy = baseRest(function (collection, iteratees) { 55018 if (collection == null) { 55019 return []; 55020 } 55021 var length = iteratees.length; 55022 if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) { 55023 iteratees = []; 55024 } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) { 55025 iteratees = [iteratees[0]]; 55026 } 55027 return baseOrderBy(collection, baseFlatten(iteratees, 1), []); 55028 }); 55029 55030 module.exports = sortBy; 55031 55032/***/ }, 55033/* 584 */ 55034/***/ function(module, exports, __webpack_require__) { 55035 55036 'use strict'; 55037 55038 var baseClamp = __webpack_require__(474), 55039 baseToString = __webpack_require__(249), 55040 toInteger = __webpack_require__(47), 55041 toString = __webpack_require__(112); 55042 55043 /** 55044 * Checks if `string` starts with the given target string. 55045 * 55046 * @static 55047 * @memberOf _ 55048 * @since 3.0.0 55049 * @category String 55050 * @param {string} [string=''] The string to inspect. 55051 * @param {string} [target] The string to search for. 55052 * @param {number} [position=0] The position to search from. 55053 * @returns {boolean}
55053 Returns `true` if `string` starts with `target`, 55054 * else `false`. 55055 * @example 55056 * 55057 * _.startsWith('abc', 'a'); 55058 * // => true 55059 * 55060 * _.startsWith('abc', 'b'); 55061 * // => false 55062 * 55063 * _.startsWith('abc', 'b', 1); 55064 * // => true 55065 */ 55066 function startsWith(string, target, position) { 55067 string = toString(string); 55068 position = position == null ? 0 : baseClamp(toInteger(position), 0, string.length); 55069 55070 target = baseToString(target); 55071 return string.slice(position, position + target.length) == target; 55072 } 55073 55074 module.exports = startsWith; 55075 55076/***/ }, 55077/* 585 */ 55078/***/ function(module, exports) { 55079 55080 "use strict"; 55081 55082 /** 55083 * This method returns `false`. 55084 * 55085 * @static 55086 * @memberOf _ 55087 * @since 4.13.0 55088 * @category Util 55089 * @returns {boolean} Returns `false`. 55090 * @example 55091 * 55092 * _.times(2, _.stubFalse); 55093 * // => [false, false] 55094 */ 55095 function stubFalse() { 55096 return false; 55097 } 55098 55099 module.exports = stubFalse; 55100 55101/***/ }, 55102/* 586 */ 55103/***/ function(module, exports, __webpack_require__) { 55104 55105 'use strict'; 55106 55107 var toNumber = __webpack_require__(587); 55108 55109 /** Used as references for various `Number` constants. */ 55110 var INFINITY = 1 / 0, 55111 MAX_INTEGER = 1.7976931348623157e+308; 55112 55113 /** 55114 * Converts `value` to a finite number. 55115 * 55116 * @static 55117 * @memberOf _ 55118 * @since 4.12.0 55119 * @category Lang 55120 * @param {*} value The value to convert. 55121 * @returns {number} Returns the converted number. 55122 * @example 55123 * 55124 * _.toFinite(3.2); 55125 * // => 3.2 55126 * 55127 * _.toFinite(Number.MIN_VALUE); 55128 * // => 5e-324 55129 * 55130 * _.toFinite(Infinity); 55131 * // => 1.7976931348623157e+308 55132 * 55133 * _.toFinite('3.2'); 55134 * // => 3.2 55135 */ 55136 function toFinite(value) { 55137 if (!value) { 55138 return value === 0 ? value : 0; 55139 } 55140 value = toNumber(value); 55141 if (value === INFINITY || value === -INFINITY) { 55142 var sign = value < 0 ? -1 : 1; 55143 return sign * MAX_INTEGER; 55144 } 55145 return value === value ? value : 0; 55146 } 55147 55148 module.exports = toFinite; 55149 55150/***/ }, 55151/* 587 */ 55152/***/ function(module, exports, __webpack_require__) { 55153 55154 'use strict'; 55155 55156 var isObject = __webpack_require__(16), 55157 isSymbol = __webpack_require__(60); 55158 55159 /** Used as references for various `Number` constants. */ 55160 var NAN = 0 / 0; 55161 55162 /** Used to match leading and trailing whitespace. */ 55163 var reTrim = /^\s+|\s+$/g; 55164 55165 /** Used to detect bad signed hexadecimal string values. */ 55166 var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; 55167 55168 /** Used to detect binary string values. */ 55169 var reIsBinary = /^0b[01]+$/i; 55170 55171 /** Used to detect octal string values. */ 55172 var reIsOctal = /^0o[0-7]+$/i; 55173 55174 /** Built-in method references without a dependency on `root`. */ 55175 var freeParseInt = parseInt; 55176 55177 /** 55178 * Converts `value` to a number. 55179 * 55180 * @static 55181 * @memberOf _ 55182 * @since 4.0.0 55183 * @category Lang 55184 * @param {*} value The value to process. 55185 * @returns {number} Returns the number. 55186 * @example 55187 * 55188 * _.toNumber(3.2); 55189 * // => 3.2 55190 * 55191 * _.toNumber(Number.MIN_VALUE); 55192 * // => 5e-324 55193 * 55194 * _.toNumber(Infinity); 55195 * // => Infinity 55196 * 55197 * _.toNumber('3.2'); 55198 * // => 3.2 55199 */ 55200 function toNumber(value) { 55201 if (typeof value == 'number') { 55202 return value; 55203 } 55204 if (isSymbol(value)) { 55205 return NAN; 55206 } 55207 if (isObject(value)) { 55208 var other = typeof value.valueOf == 'function' ? value.valueOf() : value; 55209 value = isObject(other) ? other + '' : other; 55210 } 55211 if (typeof value != 'string') { 55212 return value === 0 ? value : +value; 55213 } 55214 value = value.replace(reTrim, ''); 55215 var isBinary = reIsBinary.test(value); 55216 return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value; 55217 } 55218 55219 module.exports = toNumber; 55220 55221/***/ }, 55222/* 588 */ 55223/***/ function(module, exports, __webpack_require__) { 55224 55225 'use strict'; 55226 55227 var copyObject = __webpack_require__(30), 55228 keysIn = __webpack_require__(46); 55229 55230 /** 55231 * Converts `value` to a plain object flattening inherited enumerable string 55232 * keyed properties of `value` to own properties of the plain object. 55233 * 55234 * @static 55235 * @memberOf _ 55236 * @since 3.0.0 55237 * @category Lang 55238 * @param {*} value The value to convert. 55239 * @returns {Object} Returns the converted plain object. 55240 * @example 55241 * 55242 * function Foo() { 55243 * this.b = 2; 55244 * } 55245 * 55246 * Foo.prototype.c = 3; 55247 * 55248 * _.assign({ 'a': 1 }, new Foo); 55249 * // => { 'a': 1, 'b': 2 } 55250 * 55251 * _.assign({ 'a': 1 }, _.toPlainObject(new Foo)); 55252 * // => { 'a': 1, 'b': 2, 'c': 3 } 55253 */ 55254 function toPlainObject(value) { 55255 return copyObject(value, keysIn(value)); 55256 } 55257 55258 module.exports = toPlainObject; 55259 55260/***/ }, 55261/* 589 */ 55262/***/ function(module, exports, __webpack_require__) { 55263 55264 'use strict'; 55265 55266 var baseUniq = __webpack_require__(503); 55267 55268 /** 55269 * Creates a duplicate-free version of an array, using 55270 * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) 55271 * for equality comparisons, in which only the first occurrence of each element 55272 * is kept. The order of result values is determined by the order they occur 55273 * in the array. 55274 * 55275 * @static 55276 * @memberOf _ 55277 * @since 0.1.0 55278 * @category Array 55279 * @param {Array} array The array to inspect. 55280 * @returns {Array} Returns the new duplicate free array. 55281 * @example 55282 * 55283 * _.uniq([2, 1, 2]); 55284 * // => [2, 1] 55285 */ 55286 function uniq(array) { 55287 return array && array.length ? baseUniq(array) : []; 55288 } 55289 55290 module.exports = uniq; 55291 55292/***/ }, 55293/* 590 */ 55294/***/ function(module, exports, __webpack_require__) { 55295 55296 'use strict'; 55297 55298 module.exports = minimatch; 55299 minimatch.Minimatch = Minimatch; 55300 55301 var path = { sep: '/' }; 55302 try { 55303 path = __webpack_require__(17); 55304 } catch (er) {} 55305 55306 var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {}; 55307 var expand = __webpack_require__(392); 55308 55309 var plTypes = { 55310 '!': { open: '(?:(?!(?:', close: '))[^/]*?)' }, 55311 '?': { open: '(?:', close: ')?' }, 55312 '+': { open: '(?:', close: ')+' }, 55313 '*': { open: '(?:', close: ')*' }, 55314 '@': { open: '(?:', close: ')' } 55315 }; 55316 55317 // any single thing other than / 55318 // don't need to escape / when using new RegExp() 55319 var qmark = '[^/]'; 55320 55321 // * => any number of characters 55322 var star = qmark + '*?'; 55323 55324 // ** when dots are allowed. Anything goes, except .. and .
55325 // not (^ or / followed by one or two dots followed by $ or /), 55326 // followed by anything, any number of times. 55327 var twoStarDot = '(?:(?!(?:\\\/|^)(?:\\.{1,2})($|\\\/)).)*?'; 55328 55329 // not a ^ or / followed by a dot, 55330 // followed by anything, any number of times. 55331 var twoStarNoDot = '(?:(?!(?:\\\/|^)\\.).)*?'; 55332 55333 // characters that need to be escaped in RegExp. 55334 var reSpecials = charSet('().*{}+?[]^$\\!'); 55335 55336 // "abc" -> { a:true, b:true, c:true } 55337 function charSet(s) { 55338 return s.split('').reduce(function (set, c) { 55339 set[c] = true; 55340 return set; 55341 }, {}); 55342 } 55343 55344 // normalizes slashes. 55345 var slashSplit = /\/+/; 55346 55347 minimatch.filter = filter; 55348 function filter(pattern, options) { 55349 options = options || {}; 55350 return function (p, i, list) { 55351 return minimatch(p, pattern, options); 55352 }; 55353 } 55354 55355 function ext(a, b) { 55356 a = a || {}; 55357 b = b || {}; 55358 var t = {}; 55359 Object.keys(b).forEach(function (k) { 55360 t[k] = b[k]; 55361 }); 55362 Object.keys(a).forEach(function (k) { 55363 t[k] = a[k]; 55364 }); 55365 return t; 55366 } 55367 55368 minimatch.defaults = function (def) { 55369 if (!def || !Object.keys(def).length) return minimatch; 55370 55371 var orig = minimatch; 55372 55373 var m = function minimatch(p, pattern, options) { 55374 return orig.minimatch(p, pattern, ext(def, options)); 55375 }; 55376 55377 m.Minimatch = function Minimatch(pattern, options) { 55378 return new orig.Minimatch(pattern, ext(def, options)); 55379 }; 55380 55381 return m; 55382 }; 55383 55384 Minimatch.defaults = function (def) { 55385 if (!def || !Object.keys(def).length) return Minimatch; 55386 return minimatch.defaults(def).Minimatch; 55387 }; 55388 55389 function minimatch(p, pattern, options) { 55390 if (typeof pattern !== 'string') { 55391 throw new TypeError('glob pattern string required'); 55392 } 55393 55394 if (!options) options = {}; 55395 55396 // shortcut: comments match nothing. 55397 if (!options.nocomment && pattern.charAt(0) === '#') { 55398 return false; 55399 } 55400 55401 // "" only matches "" 55402 if (pattern.trim() === '') return p === ''; 55403 55404 return new Minimatch(pattern, options).match(p); 55405 } 55406 55407 function Minimatch(pattern, options) { 55408 if (!(this instanceof Minimatch)) { 55409 return new Minimatch(pattern, options); 55410 } 55411 55412 if (typeof pattern !== 'string') { 55413 throw new TypeError('glob pattern string required'); 55414 } 55415 55416 if (!options) options = {}; 55417 pattern = pattern.trim(); 55418 55419 // windows support: need to use /, not \ 55420 if (path.sep !== '/') { 55421 pattern = pattern.split(path.sep).join('/'); 55422 } 55423 55424 this.options = options; 55425 this.set = []; 55426 this.pattern = pattern; 55427 this.regexp = null; 55428 this.negate = false; 55429 this.comment = false; 55430 this.empty = false; 55431 55432 // make the set of regexps etc. 55433 this.make(); 55434 } 55435 55436 Minimatch.prototype.debug = function () {}; 55437 55438 Minimatch.prototype.make = make; 55439 function make() { 55440 // don't do it more than once. 55441 if (this._made) return; 55442 55443 var pattern = this.pattern; 55444 var options = this.options; 55445 55446 // empty patterns and comments match nothing. 55447 if (!options.nocomment && pattern.charAt(0) === '#') { 55448 this.comment = true; 55449 return; 55450 } 55451 if (!pattern) { 55452 this.empty = true; 55453 return; 55454 } 55455 55456 // step 1: figure out negation, etc. 55457 this.parseNegate(); 55458 55459 // step 2: expand braces 55460 var set = this.globSet = this.braceExpand(); 55461 55462 if (options.debug) this.debug = console.error; 55463 55464 this.debug(this.pattern, set); 55465 55466 // step 3: now we have a set, so turn each one into a series of path-portion 55467 // matching patterns. 55468 // These will be regexps, except in the case of "**", which is 55469 // set to the GLOBSTAR object for globstar behavior, 55470 // and will not contain any / characters 55471 set = this.globParts = set.map(function (s) { 55472 return s.split(slashSplit); 55473 }); 55474 55475 this.debug(this.pattern, set); 55476 55477 // glob --> regexps 55478 set = set.map(function (s, si, set) { 55479 return s.map(this.parse, this); 55480 }, this); 55481 55482 this.debug(this.pattern, set); 55483 55484 // filter out everything that didn't compile properly. 55485 set = set.filter(function (s) { 55486 return s.indexOf(false) === -1; 55487 }); 55488 55489 this.debug(this.pattern, set); 55490 55491 this.set = set; 55492 } 55493 55494 Minimatch.prototype.parseNegate = parseNegate; 55495 function parseNegate() { 55496 var pattern = this.pattern; 55497 var negate = false;
vendor: 18,960 bytes, lines 55498-56121
55498 var options = this.options; 55499 var negateOffset = 0; 55500 55501 if (options.nonegate) return; 55502 55503 for (var i = 0, l = pattern.length; i < l && pattern.charAt(i) === '!'; i++) { 55504 negate = !negate; 55505 negateOffset++; 55506 } 55507 55508 if (negateOffset) this.pattern = pattern.substr(negateOffset); 55509 this.negate = negate; 55510 } 55511 55512 // Brace expansion: 55513 // a{b,c}d -> abd acd 55514 // a{b,}c -> abc ac 55515 // a{0..3}d -> a0d a1d a2d a3d 55516 // a{b,c{d,e}f}g -> abg acdfg acefg 55517 // a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg 55518 // 55519 // Invalid sets are not expanded. 55520 // a{2..}b -> a{2..}b 55521 // a{b}c -> a{b}c 55522 minimatch.braceExpand = function (pattern, options) { 55523 return braceExpand(pattern, options); 55524 }; 55525 55526 Minimatch.prototype.braceExpand = braceExpand; 55527 55528 function braceExpand(pattern, options) { 55529 if (!options) { 55530 if (this instanceof Minimatch) { 55531 options = this.options; 55532 } else { 55533 options = {}; 55534 } 55535 } 55536 55537 pattern = typeof pattern === 'undefined' ? this.pattern : pattern; 55538 55539 if (typeof pattern === 'undefined') { 55540 throw new TypeError('undefined pattern'); 55541 } 55542 55543 if (options.nobrace || !pattern.match(/\{.*\}/)) { 55544 // shortcut. no need to expand. 55545 return [pattern]; 55546 } 55547 55548 return expand(pattern); 55549 } 55550 55551 // parse a component of the expanded set. 55552 // At this point, no pattern may contain "/" in it 55553 // so we're going to return a 2d array, where each entry is the full 55554 // pattern, split on '/', and then turned into a regular expression. 55555 // A regexp is made at the end which joins each array with an 55556 // escaped /, and another full one which joins each regexp with |. 55557 // 55558 // Following the lead of Bash 4.1, note that "**" only has special meaning 55559 // when it is the *only* thing in a path portion. Otherwise, any series 55560 // of * is equivalent to a single *. Globstar behavior is enabled by 55561 // default, and can be disabled by setting options.noglobstar. 55562 Minimatch.prototype.parse = parse; 55563 var SUBPARSE = {}; 55564 function parse(pattern, isSub) { 55565 if (pattern.length > 1024 * 64) { 55566 throw new TypeError('pattern is too long'); 55567 } 55568 55569 var options = this.options; 55570 55571 // shortcuts 55572 if (!options.noglobstar && pattern === '**') return GLOBSTAR; 55573 if (pattern === '') return ''; 55574 55575 var re = ''; 55576 var hasMagic = !!options.nocase; 55577 var escaping = false; 55578 // ? => one single character 55579 var patternListStack = []; 55580 var negativeLists = []; 55581 var stateChar; 55582 var inClass = false; 55583 var reClassStart = -1; 55584 var classStart = -1; 55585 // . and .. never match anything that doesn't start with ., 55586 // even when options.dot is set. 55587 var patternStart = pattern.charAt(0) === '.' ? '' // anything 55588 // not (start or / followed by . or .. followed by / or end) 55589 : options.dot ? '(?!(?:^|\\\/)\\.{1,2}(?:$|\\\/))' : '(?!\\.)'; 55590 var self = this; 55591 55592 function clearStateChar() { 55593 if (stateChar) { 55594 // we had some state-tracking character 55595 // that wasn't consumed by this pass. 55596 switch (stateChar) { 55597 case '*': 55598 re += star; 55599 hasMagic = true; 55600 break; 55601 case '?': 55602 re += qmark; 55603 hasMagic = true; 55604 break; 55605 default: 55606 re += '\\' + stateChar; 55607 break; 55608 } 55609 self.debug('clearStateChar %j %j', stateChar, re); 55610 stateChar = false; 55611 } 55612 } 55613 55614 for (var i = 0, len = pattern.length, c; i < len && (c = pattern.charAt(i)); i++) { 55615 this.debug('%s\t%s %s %j', pattern, i, re, c); 55616 55617 // skip over any that are escaped. 55618 if (escaping && reSpecials[c]) { 55619 re += '\\' + c; 55620 escaping = false; 55621 continue; 55622 } 55623 55624 switch (c) { 55625 case '/': 55626 // completely not allowed, even escaped. 55627 // Should already be path-split by now. 55628 return false; 55629 55630 case '\\': 55631 clearStateChar(); 55632 escaping = true; 55633 continue; 55634 55635 // the various stateChar values 55636 // for the "extglob" stuff. 55637 case '?': 55638 case '*': 55639 case '+': 55640 case '@': 55641 case '!': 55642 this.debug('%s\t%s %s %j <-- stateChar', pattern, i, re, c); 55643 55644 // all of those are literals inside a class, except that 55645 // the glob [!a] means [^a] in regexp 55646 if (inClass) { 55647 this.debug(' in class'); 55648 if (c === '!' && i === classStart + 1) c = '^'; 55649 re += c; 55650 continue; 55651 } 55652 55653 // if we already have a stateChar, then it means 55654 // that there was something like ** or +? in there. 55655 // Handle the stateChar, then proceed with this one. 55656 self.debug('call clearStateChar %j', stateChar); 55657 clearStateChar(); 55658 stateChar = c; 55659 // if extglob is disabled, then +(asdf|foo) isn't a thing. 55660 // just clear the statechar *now*, rather than even diving into 55661 // the patternList stuff. 55662 if (options.noext) clearStateChar(); 55663 continue; 55664 55665 case '(': 55666 if (inClass) { 55667 re += '('; 55668 continue; 55669 } 55670 55671 if (!stateChar) { 55672 re += '\\('; 55673 continue; 55674 } 55675 55676 patternListStack.push({ 55677 type: stateChar, 55678 start: i - 1, 55679 reStart: re.length, 55680 open: plTypes[stateChar].open, 55681 close: plTypes[stateChar].close 55682 }); 55683 // negation is (?:(?!js)[^/]*) 55684 re += stateChar === '!' ? '(?:(?!(?:' : '(?:'; 55685 this.debug('plType %j %j', stateChar, re); 55686 stateChar = false; 55687 continue; 55688 55689 case ')': 55690 if (inClass || !patternListStack.length) { 55691 re += '\\)'; 55692 continue; 55693 } 55694 55695 clearStateChar(); 55696 hasMagic = true; 55697 var pl = patternListStack.pop(); 55698 // negation is (?:(?!js)[^/]*) 55699 // The others are (?:<pattern>)<type> 55700 re += pl.close; 55701 if (pl.type === '!') { 55702 negativeLists.push(pl); 55703 } 55704 pl.reEnd = re.length; 55705 continue; 55706 55707 case '|': 55708 if (inClass || !patternListStack.length || escaping) { 55709 re += '\\|'; 55710 escaping = false; 55711 continue; 55712 } 55713 55714 clearStateChar(); 55715 re += '|'; 55716 continue; 55717 55718 // these are mostly the same in regexp and glob 55719 case '[': 55720 // swallow any state-tracking char before the [ 55721 clearStateChar(); 55722 55723 if (inClass) { 55724 re += '\\' + c; 55725 continue; 55726 } 55727 55728 inClass = true; 55729 classStart = i; 55730 reClassStart = re.length; 55731 re += c; 55732 continue; 55733 55734 case ']': 55735 // a right bracket shall lose its special 55736 // meaning and represent itself in 55737 // a bracket expression if it occurs 55738 // first in the list. -- POSIX.2 2.8.3.2 55739 if (i === classStart + 1 || !inClass) { 55740 re += '\\' + c; 55741 escaping = false; 55742 continue; 55743 } 55744 55745 // handle the case where we left a class open. 55746 // "[z-a]" is valid, equivalent to "\[z-a\]" 55747 if (inClass) { 55748 // split where the last [ was, make sure we don't have 55749 // an invalid re. if so, re-walk the contents of the 55750 // would-be class to re-translate any characters that 55751 // were passed through as-is 55752 // TODO: It would probably be faster to determine this 55753 // without a try/catch and a new RegExp, but it's tricky 55754 // to do safely. For now, this is safe and works. 55755 var cs = pattern.substring(classStart + 1, i); 55756 try { 55757 RegExp('[' + cs + ']'); 55758 } catch (er) { 55759 // not a valid class! 55760 var sp = this.parse(cs, SUBPARSE); 55761 re = re.substr(0, reClassStart) + '\\[' + sp[0] + '\\]'; 55762 hasMagic = hasMagic || sp[1]; 55763 inClass = false; 55764 continue; 55765 } 55766 } 55767 55768 // finish up the class. 55769 hasMagic = true; 55770 inClass = false; 55771 re += c; 55772 continue; 55773 55774 default: 55775 // swallow any state char that wasn't consumed 55776 clearStateChar(); 55777 55778 if (escaping) { 55779 // no need 55780 escaping = false; 55781 } else if (reSpecials[c] && !(c === '^' && inClass)) { 55782 re += '\\'; 55783 } 55784 55785 re += c; 55786 55787 } // switch 55788 } // for 55789 55790 // handle the case where we left a class open. 55791 // "[abc" is valid, equivalent to "\[abc" 55792 if (inClass) { 55793 // split where the last [ was, and escape it 55794 // this is a huge pita. We now have to re-walk 55795 // the contents of the would-be class to re-translate 55796 // any characters that were passed through as-is 55797 cs = pattern.substr(classStart + 1); 55798 sp = this.parse(cs, SUBPARSE); 55799 re = re.substr(0, reClassStart) + '\\[' + sp[0]; 55800 hasMagic = hasMagic || sp[1]; 55801 } 55802 55803 // handle the case where we had a +( thing at the *end* 55804 // of the pattern. 55805 // each pattern list stack adds 3 chars, and we need to go through 55806 // and escape any | chars that were passed through as-is for the regexp. 55807 // Go through and escape them, taking care not to double-escape any 55808 // | chars that were already escaped. 55809 for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) { 55810 var tail = re.slice(pl.reStart + pl.open.length); 55811 this.debug('setting tail', re, pl); 55812 // maybe some even number of \, then maybe 1 \, followed by a | 55813 tail = tail.replace(/((?:\\{2}){0,64})(\\?)\|/g, function (_, $1, $2) { 55814 if (!$2) { 55815 // the | isn't already escaped, so escape it. 55816 $2 = '\\'; 55817 } 55818 55819 // need to escape all those slashes *again*, without escaping the 55820 // one that we need for escaping the | character. As it works out, 55821 // escaping an even number of slashes can be done by simply repeating 55822 // it exactly after itself. That's why this trick works. 55823 // 55824 // I am sorry that you have to see this. 55825 return $1 + $1 + $2 + '|'; 55826 }); 55827 55828 this.debug('tail=%j\n %s', tail, tail, pl, re); 55829 var t = pl.type === '*' ? star : pl.type === '?' ? qmark : '\\' + pl.type; 55830 55831 hasMagic = true; 55832 re = re.slice(0, pl.reStart) + t + '\\(' + tail; 55833 } 55834 55835 // handle trailing things that only matter at the very end. 55836 clearStateChar(); 55837 if (escaping) { 55838 // trailing \\ 55839 re += '\\\\'; 55840 } 55841 55842 // only need to apply the nodot start if the re starts with 55843 // something that could conceivably capture a dot 55844 var addPatternStart = false; 55845 switch (re.charAt(0)) { 55846 case '.': 55847 case '[': 55848 case '(': 55849 addPatternStart = true; 55850 } 55851 55852 // Hack to work around lack of negative lookbehind in JS 55853 // A pattern like: *.!(x).!(y|z) needs to ensure that a name 55854 // like 'a.xyz.yz' doesn't match. So, the first negative 55855 // lookahead, has to look ALL the way ahead, to the end of 55856 // the pattern. 55857 for (var n = negativeLists.length - 1; n > -1; n--) { 55858 var nl = negativeLists[n]; 55859 55860 var nlBefore = re.slice(0, nl.reStart); 55861 var nlFirst = re.slice(nl.reStart, nl.reEnd - 8); 55862 var nlLast = re.slice(nl.reEnd - 8, nl.reEnd); 55863 var nlAfter = re.slice(nl.reEnd); 55864 55865 nlLast += nlAfter; 55866 55867 // Handle nested stuff like *(*.js|!(*.json)), where open parens 55868 // mean that we should *not* include the ) in the bit that is considered 55869 // "after" the negated section. 55870 var openParensBefore = nlBefore.split('(').length - 1; 55871 var cleanAfter = nlAfter; 55872 for (i = 0; i < openParensBefore; i++) { 55873 cleanAfter = cleanAfter.replace(/\)[+*?]?/, ''); 55874 } 55875 nlAfter = cleanAfter; 55876 55877 var dollar = ''; 55878 if (nlAfter === '' && isSub !== SUBPARSE) { 55879 dollar = '$'; 55880 } 55881 var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast; 55882 re = newRe; 55883 } 55884 55885 // if the re is not "" at this point, then we need to make sure 55886 // it doesn't match against an empty path part. 55887 // Otherwise a/* will match a/, which it should not. 55888 if (re !== '' && hasMagic) { 55889 re = '(?=.)' + re; 55890 } 55891 55892 if (addPatternStart) { 55893 re = patternStart + re; 55894 } 55895 55896 // parsing just a piece of a larger pattern. 55897 if (isSub === SUBPARSE) { 55898 return [re, hasMagic]; 55899 } 55900 55901 // skip the regexp for non-magical patterns 55902 // unescape anything in it, though, so that it'll be 55903 // an exact match against a file etc. 55904 if (!hasMagic) { 55905 return globUnescape(pattern); 55906 } 55907 55908 var flags = options.nocase ? 'i' : ''; 55909 try { 55910 var regExp = new RegExp('^' + re + '$', flags); 55911 } catch (er) { 55912 // If it was an invalid regular expression, then it can't match 55913 // anything. This trick looks for a character after the end of 55914 // the string, which is of course impossible, except in multi-line 55915 // mode, but it's not a /m regex. 55916 return new RegExp('$.'); 55917 } 55918 55919 regExp._glob = pattern; 55920 regExp._src = re; 55921 55922 return regExp; 55923 } 55924 55925 minimatch.makeRe = function (pattern, options) { 55926 return new Minimatch(pattern, options || {}).makeRe(); 55927 }; 55928 55929 Minimatch.prototype.makeRe = makeRe; 55930 function makeRe() { 55931 if (this.regexp || this.regexp === false) return this.regexp; 55932 55933 // at this point, this.set is a 2d array of partial 55934 // pattern strings, or "**". 55935 // 55936 // It's better to use .match(). This function shouldn't 55937 // be used, really, but it's pretty convenient sometimes, 55938 // when you just want to work with a regex. 55939 var set = this.set; 55940 55941 if (!set.length) { 55942 this.regexp = false; 55943 return this.regexp; 55944 } 55945 var options = this.options; 55946 55947 var twoStar = options.noglobstar ? star : options.dot ? twoStarDot : twoStarNoDot; 55948 var flags = options.nocase ? 'i' : ''; 55949 55950 var re = set.map(function (pattern) { 55951 return pattern.map(function (p) { 55952 return p === GLOBSTAR ? twoStar : typeof p === 'string' ? regExpEscape(p) : p._src; 55953 }).join('\\\/'); 55954 }).join('|'); 55955 55956 // must match entire pattern 55957 // ending in a * or ** will make it less strict. 55958 re = '^(?:' + re + ')$'; 55959 55960 // can match anything, as long as it's not this. 55961 if (this.negate) re = '^(?!' + re + ').*$'; 55962 55963 try { 55964 this.regexp = new RegExp(re, flags); 55965 } catch (ex) { 55966 this.regexp = false; 55967 } 55968 return this.regexp; 55969 } 55970 55971 minimatch.match = function (list, pattern, options) { 55972 options = options || {}; 55973 var mm = new Minimatch(pattern, options); 55974 list = list.filter(function (f) { 55975 return mm.match(f); 55976 }); 55977 if (mm.options.nonull && !list.length) { 55978 list.push(pattern); 55979 } 55980 return list; 55981 }; 55982 55983 Minimatch.prototype.match = match; 55984 function match(f, partial) { 55985 this.debug('match', f, this.pattern); 55986 // short-circuit in the case of busted things. 55987 // comments, etc. 55988 if (this.comment) return false; 55989 if (this.empty) return f === ''; 55990 55991 if (f === '/' && partial) return true; 55992 55993 var options = this.options; 55994 55995 // windows: need to use /, not \ 55996 if (path.sep !== '/') { 55997 f = f.split(path.sep).join('/'); 55998 } 55999 56000 // treat the test path as a set of pathparts. 56001 f = f.split(slashSplit); 56002 this.debug(this.pattern, 'split', f); 56003 56004 // just ONE of the pattern sets in this.set needs to match 56005 // in order for it to be valid. If negating, then just one 56006 // match means that we have failed. 56007 // Either way, return on the first hit. 56008 56009 var set = this.set; 56010 this.debug(this.pattern, 'set', set); 56011 56012 // Find the basename of the path by looking for the last non-empty segment 56013 var filename; 56014 var i; 56015 for (i = f.length - 1; i >= 0; i--) { 56016 filename = f[i]; 56017 if (filename) break; 56018 } 56019 56020 for (i = 0; i < set.length; i++) { 56021 var pattern = set[i]; 56022 var file = f; 56023 if (options.matchBase && pattern.length === 1) { 56024 file = [filename]; 56025 } 56026 var hit = this.matchOne(file, pattern, partial); 56027 if (hit) { 56028 if (options.flipNegate) return true; 56029 return !this.negate; 56030 } 56031 } 56032 56033 // didn't get any hits. this is success if it's a negative 56034 // pattern, failure otherwise. 56035 if (options.flipNegate) return false; 56036 return this.negate; 56037 } 56038 56039 // set partial to true to test if, for example, 56040 // "/a/b" matches the start of "/*/b/*/d" 56041 // Partial means, if you run out of file before you run 56042 // out of pattern, then that's fine, as long as all 56043 // the parts match. 56044 Minimatch.prototype.matchOne = function (file, pattern, partial) { 56045 var options = this.options; 56046 56047 this.debug('matchOne', { 'this': this, file: file, pattern: pattern }); 56048 56049 this.debug('matchOne', file.length, pattern.length); 56050 56051 for (var fi = 0, pi = 0, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) { 56052 this.debug('matchOne loop'); 56053 var p = pattern[pi]; 56054 var f = file[fi]; 56055 56056 this.debug(pattern, p, f); 56057 56058 // should be impossible. 56059 // some invalid regexp stuff in the set. 56060 if (p === false) return false; 56061 56062 if (p === GLOBSTAR) { 56063 this.debug('GLOBSTAR', [pattern, p, f]); 56064 56065 // "**" 56066 // a/**/b/**/c would match the following: 56067 // a/b/x/y/z/c 56068 // a/x/y/z/b/c 56069 // a/b/x/b/x/c 56070 // a/b/c 56071 // To do this, take the rest of the pattern after 56072 // the **, and see if it would match the file remainder. 56073 // If so, return success. 56074 // If not, the ** "swallows" a segment, and try again. 56075 // This is recursively awful. 56076 // 56077 // a/**/b/**/c matching a/b/x/y/z/c 56078 // - a matches a 56079 // - doublestar 56080 // - matchOne(b/x/y/z/c, b/**/c) 56081 // - b matches b 56082 // - doublestar 56083 // - matchOne(x/y/z/c, c) -> no 56084 // - matchOne(y/z/c, c) -> no 56085 // - matchOne(z/c, c) -> no 56086 // - matchOne(c, c) yes, hit 56087 var fr = fi; 56088 var pr = pi + 1; 56089 if (pr === pl) { 56090 this.debug('** at the end'); 56091 // a ** at the end will just swallow the rest. 56092 // We have found a match. 56093 // however, it will not swallow /.x, unless 56094 // options.dot is set. 56095 // . and .. are *never* matched by **, for explosively 56096 // exponential reasons. 56097 for (; fi < fl; fi++) { 56098 if (file[fi] === '.' || file[fi] === '..' || !options.dot && file[fi].charAt(0) === '.') return false; 56099 } 56100 return true; 56101 } 56102 56103 // ok, let's see if we can swallow whatever we can. 56104 while (fr < fl) { 56105 var swallowee = file[fr]; 56106 56107 this.debug('\nglobstar while', file, fr, pattern, pr, swallowee); 56108 56109 // XXX remove this slice. Just pass the start index. 56110 if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) { 56111 this.debug('globstar found match!', fr, fl, swallowee); 56112 // found a match. 56113 return true; 56114 } else { 56115 // can't swallow "." or ".." ever. 56116 // can only swallow ".foo" when explicitly asked. 56117 if (swallowee === '.' || swallowee === '..' || !options.dot && swallowee.charAt(0) === '.') { 56118 this.debug('dot detected!', file, fr, pattern, pr); 56119 break; 56120 } 56121
56122 // ** swallows a segment, and continue. 56123 this.debug('globstar swallow a segment, and continue'); 56124 fr++; 56125 } 56126 } 56127 56128 // no match was found. 56129 // However, in partial mode, we can't say this is necessarily over. 56130 // If there's more *pattern* left, then 56131 if (partial) { 56132 // ran out of file 56133 this.debug('\n>>> no match, partial?', file, fr, pattern, pr); 56134 if (fr === fl) return true; 56135 } 56136 return false; 56137 } 56138 56139 // something other than ** 56140 // non-magic patterns just have to match exactly 56141 // patterns with magic have been turned into regexps. 56142 var hit; 56143 if (typeof p === 'string') { 56144 if (options.nocase) { 56145 hit = f.toLowerCase() === p.toLowerCase(); 56146 } else { 56147 hit = f === p; 56148 } 56149 this.debug('string match', p, f, hit); 56150 } else { 56151 hit = f.match(p); 56152 this.debug('pattern match', p, f, hit); 56153 } 56154 56155 if (!hit) return false; 56156 } 56157 56158 // Note: ending in / means that we'll get a final "" 56159 // at the end of the pattern. This can only match a 56160 // corresponding "" at the end of the file. 56161 // If the file ends in /, then it can only match a 56162 // a pattern that ends in /, unless the pattern just 56163 // doesn't have any more for it. But, a/b/ should *not* 56164 // match "a/b/*", even though "" matches against the 56165 // [^/]*? pattern, except in partial mode, where it might 56166 // simply not be reached yet. 56167 // However, a/b/ should still satisfy a/* 56168 56169 // now either we fell off the end of the pattern, or we're done. 56170 if (fi === fl && pi === pl) { 56171 // ran out of pattern and filename at the same time. 56172 // an exact hit! 56173 return true; 56174 } else if (fi === fl) { 56175 // ran out of file, but still had pattern left. 56176 // this is ok if we're doing the match as part of 56177 // a glob fs traversal. 56178 return partial; 56179 } else if (pi === pl) { 56180 // ran out of pattern, still have file left. 56181 // this is only acceptable if we're on the very last 56182 // empty segment of a file with a trailing slash. 56183 // a/* should match a/b/ 56184 var emptyFileEnd = fi === fl - 1 && file[fi] === ''; 56185 return emptyFileEnd; 56186 } 56187 56188 // should be unreachable. 56189 throw new Error('wtf?'); 56190 }; 56191 56192 // replace stuff like \* with * 56193 function globUnescape(s) { 56194 return s.replace(/\\(.)/g, '$1'); 56195 } 56196 56197 function regExpEscape(s) { 56198 return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&'); 56199 } 56200 56201/***/ }, 56202/* 591 */ 56203/***/ function(module, exports) { 56204 56205 'use strict'; 56206 56207 var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; 56208 56209 /** 56210 * Helpers. 56211 */ 56212 56213 var s = 1000; 56214 var m = s * 60; 56215 var h = m * 60; 56216 var d = h * 24; 56217 var y = d * 365.25; 56218 56219 /** 56220 * Parse or format the given `val`. 56221 * 56222 * Options: 56223 * 56224 * - `long` verbose formatting [false] 56225 * 56226 * @param {String|Number} val 56227 * @param {Object} options 56228 * @throws {Error} throw an error if val is not a non-empty string or a number 56229 * @return {String|Number} 56230 * @api public 56231 */ 56232 56233 module.exports = function (val, options) { 56234 options = options || {}; 56235 var type = typeof val === 'undefined' ? 'undefined' : _typeof(val); 56236 if (type === 'string' && val.length > 0) { 56237 return parse(val); 56238 } else if (type === 'number' && isNaN(val) === false) { 56239 return options.long ? fmtLong(val) : fmtShort(val); 56240 } 56241 throw new Error('val is not a non-empty string or a valid number. val=' + JSON.stringify(val)); 56242 }; 56243 56244 /** 56245 * Parse the given `str` and return milliseconds. 56246 * 56247 * @param {String} str 56248 * @return {Number} 56249 * @api private 56250 */ 56251 56252 function parse(str) { 56253 str = String(str); 56254 if (str.length > 10000) { 56255 return; 56256 } 56257 var match = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(str); 56258 if (!match) { 56259 return; 56260 } 56261 var n = parseFloat(match[1]); 56262 var type = (match[2] || 'ms').toLowerCase(); 56263 switch (type) {
56264 case 'years': 56265 case 'year': 56266 case 'yrs': 56267 case 'yr': 56268 case 'y': 56269 return n * y; 56270 case 'days': 56271 case 'day': 56272 case 'd': 56273 return n * d; 56274 case 'hours': 56275 case 'hour': 56276 case 'hrs': 56277 case 'hr': 56278 case 'h': 56279 return n * h; 56280 case 'minutes': 56281 case 'minute': 56282 case 'mins': 56283 case 'min': 56284 case 'm': 56285 return n * m; 56286 case 'seconds': 56287 case 'second': 56288 case 'secs': 56289 case 'sec': 56290 case 's': 56291 return n * s; 56292 case 'milliseconds': 56293 case 'millisecond': 56294 case 'msecs': 56295 case 'msec': 56296 case 'ms': 56297 return n; 56298 default: 56299 return undefined; 56300 } 56301 } 56302 56303 /** 56304 * Short format for `ms`. 56305 * 56306 * @param {Number} ms 56307 * @return {String} 56308 * @api private 56309 */ 56310 56311 function fmtShort(ms) { 56312 if (ms >= d) { 56313 return Math.round(ms / d) + 'd'; 56314 } 56315 if (ms >= h) { 56316 return Math.round(ms / h) + 'h'; 56317 } 56318 if (ms >= m) { 56319 return Math.round(ms / m) + 'm'; 56320 } 56321 if (ms >= s) { 56322 return Math.round(ms / s) + 's'; 56323 } 56324 return ms + 'ms'; 56325 } 56326 56327 /** 56328 * Long format for `ms`. 56329 * 56330 * @param {Number} ms 56331 * @return {String} 56332 * @api private 56333 */ 56334 56335 function fmtLong(ms) { 56336 return plural(ms, d, 'day') || plural(ms, h, 'hour') || plural(ms, m, 'minute') || plural(ms, s, 'second') || ms + ' ms'; 56337 } 56338 56339 /** 56340 * Pluralization helper. 56341 */ 56342 56343 function plural(ms, n, name) { 56344 if (ms < n) { 56345 return; 56346 } 56347 if (ms < n * 1.5) { 56348 return Math.floor(ms / n) + ' ' + name; 56349 } 56350 return Math.ceil(ms / n) + ' ' + name + 's'; 56351 } 56352 56353/***/ }, 56354/* 592 */ 56355/***/ function(module, exports) { 56356 56357 'use strict'; 56358 56359 module.exports = Number.isNaN || function (x) { 56360 return x !== x; 56361 }; 56362 56363/***/ }, 56364/* 593 */ 56365/***/ function(module, exports, __webpack_require__) { 56366 56367 /* WEBPACK VAR INJECTION */(function(process) {'use strict'; 56368 56369 function posix(path) { 56370 return path.charAt(0) === '/'; 56371 } 56372 56373 function win32(path) { 56374 // https://github.com/nodejs/node/blob/b3fcc245fb25539909ef1d5eaa01dbf92e168633/lib/path.js#L56 56375 var splitDeviceRe = /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/; 56376 var result = splitDeviceRe.exec(path); 56377 var device = result[1] || ''; 56378 var isUnc = Boolean(device && device.charAt(1) !== ':'); 56379 56380 // UNC paths are always absolute 56381 return Boolean(result[2] || isUnc); 56382 } 56383 56384 module.exports = process.platform === 'win32' ? win32 : posix; 56385 module.exports.posix = posix; 56386 module.exports.win32 = win32; 56387 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(9))) 56388 56389/***/ }, 56390/* 594 */ 56391/***/ function(module, exports, __webpack_require__) { 56392 56393 "use strict"; 56394 56395 var _keys = __webpack_require__(13); 56396 56397 var _keys2 = _interopRequireDefault(_keys); 56398 56399 var _babelTypes = __webpack_require__(1); 56400 56401 var t = _interopRequireWildcard(_babelTypes); 56402 56403 function _interopRequireWildcard(obj) { 56404 if (obj && obj.__esModule) { 56405 return obj; 56406 } else { 56407 var newObj = {};if (obj != null) { 56408 for (var key in obj) { 56409 if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; 56410 } 56411 }newObj.default = obj;return newObj; 56412 } 56413 } 56414 56415 function _interopRequireDefault(obj) { 56416 return obj && obj.__esModule ? obj : { default: obj }; 56417 } 56418 56419 var hasOwn = Object.prototype.hasOwnProperty; 56420 56421 // The hoist function takes a FunctionExpression or FunctionDeclaration 56422 // and replaces any Declaration nodes in its body with assignments, then 56423 // returns a VariableDeclaration containing just the names of the removed 56424 // declarations. 56425 /** 56426 * Copyright (c) 2014, Facebook, Inc. 56427 * All rights reserved. 56428 * 56429 * This source code is licensed under the BSD-style license found in the 56430 * https://raw.github.com/facebook/regenerator/master/LICENSE file. An 56431 * additional grant of patent rights can be found in the PATENTS file in 56432 * the same directory. 56433 */ 56434 56435 exports.hoist = function (funPath) { 56436 t.assertFunction(funPath.node); 56437 56438 var vars = {}; 56439 56440 function varDeclToExpr(vdec, includeIdentifiers) { 56441 t.assertVariableDeclaration(vdec); 56442 // TODO assert.equal(vdec.kind, "var"); 56443 var exprs = []; 56444 56445 vdec.declarations.forEach(function (dec) { 56446 // Note: We duplicate 'dec.id' here to ensure that the variable declaration IDs don't 56447 // have the same 'loc' value, since that can make sourcemaps and retainLines behave poorly. 56448 vars[dec.id.name] = t.identifier(dec.id.name); 56449 56450 if (dec.init) { 56451 exprs.push(t.assignmentExpression("=", dec.id, dec.init)); 56452 } else if (includeIdentifiers) { 56453 exprs.push(dec.id); 56454 } 56455 }); 56456 56457 if (exprs.length === 0) return null; 56458 56459 if (exprs.length === 1) return exprs[0]; 56460 56461 return t.sequenceExpression(exprs); 56462 } 56463 56464 funPath.get("body").traverse({ 56465 VariableDeclaration: { 56466 exit: function exit(path) { 56467 var expr = varDeclToExpr(path.node, false); 56468 if (expr === null) { 56469 path.remove(); 56470 } else { 56471 // We don't need to traverse this expression any further because 56472 // there can't be any new declarations inside an expression.
56473 path.replaceWith(t.expressionStatement(expr)); 56474 } 56475 56476 // Since the original node has been either removed or replaced, 56477 // avoid traversing it any further. 56478 path.skip(); 56479 } 56480 }, 56481 56482 ForStatement: function ForStatement(path) { 56483 var init = path.node.init; 56484 if (t.isVariableDeclaration(init)) { 56485 path.get("init").replaceWith(varDeclToExpr(init, false)); 56486 } 56487 }, 56488 56489 ForXStatement: function ForXStatement(path) { 56490 var left = path.get("left"); 56491 if (left.isVariableDeclaration()) { 56492 left.replaceWith(varDeclToExpr(left.node, true)); 56493 } 56494 }, 56495 56496 FunctionDeclaration: function FunctionDeclaration(path) { 56497 var node = path.node; 56498 vars[node.id.name] = node.id; 56499 56500 var assignment = t.expressionStatement(t.assignmentExpression("=", node.id, t.functionExpression(node.id, node.params, node.body, node.generator, node.expression))); 56501 56502 if (path.parentPath.isBlockStatement()) { 56503 // Insert the assignment form before the first statement in the 56504 // enclosing block. 56505 path.parentPath.unshiftContainer("body", assignment); 56506 56507 // Remove the function declaration now that we've inserted the 56508 // equivalent assignment form at the beginning of the block. 56509 path.remove(); 56510 } else { 56511 // If the parent node is not a block statement, then we can just 56512 // replace the declaration with the equivalent assignment form 56513 // without worrying about hoisting it. 56514 path.replaceWith(assignment); 56515 } 56516 56517 // Don't hoist variables out of inner functions. 56518 path.skip(); 56519 }, 56520 56521 FunctionExpression: function FunctionExpression(path) { 56522 // Don't descend into nested function expressions. 56523 path.skip(); 56524 } 56525 }); 56526 56527 var paramNames = {}; 56528 funPath.get("params").forEach(function (paramPath) { 56529 var param = paramPath.node; 56530 if (t.isIdentifier(param)) { 56531 paramNames[param.name] = param; 56532 } else { 56533 // Variables declared by destructuring parameter patterns will be 56534 // harmlessly re-declared. 56535 } 56536 }); 56537 56538 var declarations = []; 56539 56540 (0, _keys2.default)(vars).forEach(function (name) { 56541 if (!hasOwn.call(paramNames, name)) { 56542 declarations.push(t.variableDeclarator(vars[name], null)); 56543 } 56544 }); 56545 56546 if (declarations.length === 0) { 56547 return null; // Be sure to handle this case! 56548 } 56549 56550 return t.variableDeclaration("var", declarations); 56551 }; 56552 56553/***/ }, 56554/* 595 */ 56555/***/ function(module, exports, __webpack_require__) { 56556 56557 "use strict"; 56558 56559 exports.__esModule = true; 56560 56561 exports.default = function () { 56562 return __webpack_require__(598); 56563 }; 56564 56565/***/ }, 56566/* 596 */ 56567/***/ function(module, exports, __webpack_require__) { 56568 56569 "use strict"; 56570 56571 var _assert = __webpack_require__(62); 56572 56573 var _assert2 = _interopRequireDefault(_assert); 56574 56575 var _babelTypes = __webpack_require__(1); 56576 56577 var t = _interopRequireWildcard(_babelTypes); 56578 56579 var _util = __webpack_require__(114); 56580 56581 function _interopRequireWildcard(obj) { 56582 if (obj && obj.__esModule) { 56583 return obj; 56584 } else { 56585 var newObj = {};if (obj != null) { 56586 for (var key in obj) { 56587 if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; 56588 } 56589 }newObj.default = obj;return newObj; 56590 } 56591 } 56592 56593 function _interopRequireDefault(obj) { 56594 return obj && obj.__esModule ? obj : { default: obj }; 56595 } 56596 56597 function Entry() { 56598 _assert2.default.ok(this instanceof Entry); 56599 } /** 56600 * Copyright (c) 2014, Facebook, Inc. 56601 * All rights reserved. 56602 * 56603 * This source code is licensed under the BSD-style license found in the 56604 * https://raw.github.com/facebook/regenerator/master/LICENSE file. An 56605 * additional grant of patent rights can be found in the PATENTS file in 56606 * the same directory. 56607 */ 56608 56609 function FunctionEntry(returnLoc) { 56610 Entry.call(this); 56611 t.assertLiteral(returnLoc); 56612 this.returnLoc = returnLoc; 56613 } 56614 56615 (0, _util.inherits)(FunctionEntry, Entry); 56616 exports.FunctionEntry = FunctionEntry; 56617 56618 function LoopEntry(breakLoc, continueLoc, label) { 56619 Entry.call(this); 56620 56621 t.assertLiteral(breakLoc); 56622 t.assertLiteral(continueLoc); 56623 56624 if (label) { 56625 t.assertIdentifier(label); 56626 } else { 56627 label = null; 56628 } 56629 56630 this.breakLoc = breakLoc; 56631 this.continueLoc = continueLoc; 56632 this.label = label; 56633 } 56634
56635 (0, _util.inherits)(LoopEntry, Entry); 56636 exports.LoopEntry = LoopEntry; 56637 56638 function SwitchEntry(breakLoc) { 56639 Entry.call(this); 56640 t.assertLiteral(breakLoc); 56641 this.breakLoc = breakLoc; 56642 } 56643 56644 (0, _util.inherits)(SwitchEntry, Entry); 56645 exports.SwitchEntry = SwitchEntry; 56646 56647 function TryEntry(firstLoc, catchEntry, finallyEntry) { 56648 Entry.call(this); 56649 56650 t.assertLiteral(firstLoc); 56651 56652 if (catchEntry) { 56653 _assert2.default.ok(catchEntry instanceof CatchEntry); 56654 } else { 56655 catchEntry = null; 56656 } 56657 56658 if (finallyEntry) { 56659 _assert2.default.ok(finallyEntry instanceof FinallyEntry); 56660 } else { 56661 finallyEntry = null; 56662 } 56663 56664 // Have to have one or the other (or both). 56665 _assert2.default.ok(catchEntry || finallyEntry); 56666 56667 this.firstLoc = firstLoc; 56668 this.catchEntry = catchEntry; 56669 this.finallyEntry = finallyEntry; 56670 } 56671 56672 (0, _util.inherits)(TryEntry, Entry); 56673 exports.TryEntry = TryEntry; 56674 56675 function CatchEntry(firstLoc, paramId) { 56676 Entry.call(this); 56677 56678 t.assertLiteral(firstLoc); 56679 t.assertIdentifier(paramId); 56680 56681 this.firstLoc = firstLoc; 56682 this.paramId = paramId; 56683 } 56684 56685 (0, _util.inherits)(CatchEntry, Entry); 56686 exports.CatchEntry = CatchEntry; 56687 56688 function FinallyEntry(firstLoc, afterLoc) { 56689 Entry.call(this); 56690 t.assertLiteral(firstLoc); 56691 t.assertLiteral(afterLoc); 56692 this.firstLoc = firstLoc; 56693 this.afterLoc = afterLoc; 56694 } 56695 56696 (0, _util.inherits)(FinallyEntry, Entry); 56697 exports.FinallyEntry = FinallyEntry; 56698 56699 function LabeledEntry(breakLoc, label) { 56700 Entry.call(this); 56701 56702 t.assertLiteral(breakLoc); 56703 t.assertIdentifier(label); 56704 56705 this.breakLoc = breakLoc; 56706 this.label = label; 56707 } 56708 56709 (0, _util.inherits)(LabeledEntry, Entry); 56710 exports.LabeledEntry = LabeledEntry; 56711 56712 function LeapManager(emitter) { 56713 _assert2.default.ok(this instanceof LeapManager); 56714 56715 var Emitter = __webpack_require__(279).Emitter; 56716 _assert2.default.ok(emitter instanceof Emitter); 56717 56718 this.emitter = emitter; 56719 this.entryStack = [new FunctionEntry(emitter.finalLoc)]; 56720 } 56721 56722 var LMp = LeapManager.prototype; 56723 exports.LeapManager = LeapManager; 56724 56725 LMp.withEntry = function (entry, callback) { 56726 _assert2.default.ok(entry instanceof Entry); 56727 this.entryStack.push(entry); 56728 try { 56729 callback.call(this.emitter); 56730 } finally { 56731 var popped = this.entryStack.pop(); 56732 _assert2.default.strictEqual(popped, entry); 56733 } 56734 }; 56735 56736 LMp._findLeapLocation = function (property, label) { 56737 for (var i = this.entryStack.length - 1; i >= 0; --i) { 56738 var entry = this.entryStack[i]; 56739 var loc = entry[property]; 56740 if (loc) { 56741 if (label) { 56742 if (entry.label && entry.label.name === label.name) { 56743 return loc; 56744 } 56745 } else if (entry instanceof LabeledEntry) { 56746 // Ignore LabeledEntry entries unless we are actually breaking to 56747 // a label. 56748 } else { 56749 return loc; 56750 } 56751 } 56752 } 56753 56754 return null; 56755 }; 56756 56757 LMp.getBreakLoc = function (label) { 56758 return this._findLeapLocation("breakLoc", label); 56759 }; 56760 56761 LMp.getContinueLoc = function (label) { 56762 return this._findLeapLocation("continueLoc", label); 56763 }; 56764 56765/***/ }, 56766/* 597 */ 56767/***/ function(module, exports, __webpack_require__) { 56768 56769 "use strict"; 56770 56771 var _assert = __webpack_require__(62); 56772 56773 var _assert2 = _interopRequireDefault(_assert); 56774 56775 var _babelTypes = __webpack_require__(1); 56776 56777 var t = _interopRequireWildcard(_babelTypes); 56778 56779 function _interopRequireWildcard(obj) { 56780 if (obj && obj.__esModule) { 56781 return obj; 56782 } else { 56783 var newObj = {};if (obj != null) { 56784 for (var key in obj) { 56785 if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; 56786 } 56787 }newObj.default = obj;return newObj; 56788 } 56789 } 56790 56791 function _interopRequireDefault(obj) { 56792 return obj && obj.__esModule ? obj : { default: obj }; 56793 } 56794 56795 var m = __webpack_require__(277).makeAccessor(); /** 56796 * Copyright (c) 2014, Facebook, Inc. 56797 * All rights reserved. 56798 * 56799 * This source code is licensed under the BSD-style license found in the 56800 * https://raw.github.com/facebook/regenerator/master/LICENSE file. An 56801 * additional grant of patent rights can be found in the PATENTS file in 56802 * the same directory. 56803 */ 56804 56805 var hasOwn = Object.prototype.hasOwnProperty; 56806 56807 function makePredicate(propertyName, knownTypes) { 56808 function onlyChildren(node) { 56809 t.assertNode(node); 56810 56811 // Assume no side effects until we find out otherwise. 56812 var result = false;
56813 56814 function check(child) { 56815 if (result) { 56816 // Do nothing. 56817 } else if (Array.isArray(child)) { 56818 child.some(check); 56819 } else if (t.isNode(child)) { 56820 _assert2.default.strictEqual(result, false); 56821 result = predicate(child); 56822 } 56823 return result; 56824 } 56825 56826 var keys = t.VISITOR_KEYS[node.type]; 56827 if (keys) { 56828 for (var i = 0; i < keys.length; i++) { 56829 var key = keys[i]; 56830 var child = node[key]; 56831 check(child); 56832 } 56833 } 56834 56835 return result; 56836 } 56837 56838 function predicate(node) { 56839 t.assertNode(node); 56840 56841 var meta = m(node); 56842 if (hasOwn.call(meta, propertyName)) return meta[propertyName]; 56843 56844 // Certain types are "opaque," which means they have no side 56845 // effects or leaps and we don't care about their subexpressions. 56846 if (hasOwn.call(opaqueTypes, node.type)) return meta[propertyName] = false; 56847 56848 if (hasOwn.call(knownTypes, node.type)) return meta[propertyName] = true; 56849 56850 return meta[propertyName] = onlyChildren(node); 56851 } 56852 56853 predicate.onlyChildren = onlyChildren; 56854 56855 return predicate; 56856 } 56857 56858 var opaqueTypes = { 56859 FunctionExpression: true 56860 }; 56861 56862 // These types potentially have side effects regardless of what side 56863 // effects their subexpressions have. 56864 var sideEffectTypes = { 56865 CallExpression: true, // Anything could happen! 56866 ForInStatement: true, // Modifies the key variable. 56867 UnaryExpression: true, // Think delete. 56868 BinaryExpression: true, // Might invoke .toString() or .valueOf(). 56869 AssignmentExpression: true, // Side-effecting by definition. 56870 UpdateExpression: true, // Updates are essentially assignments. 56871 NewExpression: true // Similar to CallExpression. 56872 }; 56873 56874 // These types are the direct cause of all leaps in control flow. 56875 var leapTypes = { 56876 YieldExpression: true, 56877 BreakStatement: true, 56878 ContinueStatement: true, 56879 ReturnStatement: true, 56880 ThrowStatement: true 56881 }; 56882 56883 // All leap types are also side effect types. 56884 for (var type in leapTypes) { 56885 if (hasOwn.call(leapTypes, type)) { 56886 sideEffectTypes[type] = leapTypes[type]; 56887 } 56888 } 56889 56890 exports.hasSideEffects = makePredicate("hasSideEffects", sideEffectTypes); 56891 exports.containsLeap = makePredicate("containsLeap", leapTypes); 56892 56893/***/ }, 56894/* 598 */ 56895/***/ function(module, exports, __webpack_require__) { 56896 56897 "use strict"; 56898 56899 var _assert = __webpack_require__(62); 56900 56901 var _assert2 = _interopRequireDefault(_assert); 56902 56903 var _babelTypes = __webpack_require__(1); 56904 56905 var t = _interopRequireWildcard(_babelTypes); 56906 56907 var _hoist = __webpack_require__(594); 56908 56909 var _emit = __webpack_require__(279); 56910 56911 var _util = __webpack_require__(280); 56912 56913 var util = _interopRequireWildcard(_util); 56914 56915 function _interopRequireWildcard(obj) { 56916 if (obj && obj.__esModule) { 56917 return obj; 56918 } else { 56919 var newObj = {};if (obj != null) { 56920 for (var key in obj) { 56921 if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; 56922 } 56923 }newObj.default = obj;return newObj; 56924 } 56925 } 56926 56927 function _interopRequireDefault(obj) { 56928 return obj && obj.__esModule ? obj : { default: obj }; 56929 } 56930 56931 var getMarkInfo = __webpack_require__(277).makeAccessor(); /** 56932 * Copyright (c) 2014, Facebook, Inc. 56933 * All rights reserved. 56934 * 56935 * This source code is licensed under the BSD-style license found in the 56936 * https://raw.github.com/facebook/regenerator/master/LICENSE file. An 56937 * additional grant of patent rights can be found in the PATENTS file in 56938 * the same directory. 56939 */ 56940 56941 exports.visitor = { 56942 Function: { 56943 exit: function exit(path, state) { 56944 var node = path.node; 56945 56946 if (node.generator) { 56947 if (node.async) { 56948 // Async generator 56949 if (state.opts.asyncGenerators === false) return; 56950 } else { 56951 // Plain generator 56952 if (state.opts.generators === false) return; 56953 } 56954 } else if (node.async) { 56955 // Async function 56956 if (state.opts.async === false) return; 56957 } else { 56958 // Not a generator or async function. 56959 return; 56960 } 56961 56962 var contextId = path.scope.generateUidIdentifier("context"); 56963 var argsId = path.scope.generateUidIdentifier("args"); 56964 56965 path.ensureBlock(); 56966 var bodyBlockPath = path.get("body"); 56967 56968 if (node.async) { 56969 bodyBlockPath.traverse(awaitVisitor); 56970 } 56971 56972 bodyBlockPath.traverse(functionSentVisitor, { 56973 context: contextId 56974 }); 56975 56976 var outerBody = []; 56977 var innerBody = []; 56978 56979 bodyBlockPath.get("body").forEach(function (childPath) { 56980 var node = childPath.node;
56981 if (t.isExpressionStatement(node) && t.isStringLiteral(node.expression)) { 56982 // Babylon represents directives like "use strict" as elements 56983 // of a bodyBlockPath.node.directives array, but they could just 56984 // as easily be represented (by other parsers) as traditional 56985 // string-literal-valued expression statements, so we need to 56986 // handle that here. (#248) 56987 outerBody.push(node); 56988 } else if (node && node._blockHoist != null) { 56989 outerBody.push(node); 56990 } else { 56991 innerBody.push(node); 56992 } 56993 }); 56994 56995 if (outerBody.length > 0) { 56996 // Only replace the inner body if we actually hoisted any statements 56997 // to the outer body. 56998 bodyBlockPath.node.body = innerBody; 56999 } 57000 57001 var outerFnExpr = getOuterFnExpr(path); 57002 // Note that getOuterFnExpr has the side-effect of ensuring that the 57003 // function has a name (so node.id will always be an Identifier), even 57004 // if a temporary name has to be synthesized. 57005 t.assertIdentifier(node.id); 57006 var innerFnId = t.identifier(node.id.name + "$"); 57007 57008 // Turn all declarations into vars, and replace the original 57009 // declarations with equivalent assignment expressions. 57010 var vars = (0, _hoist.hoist)(path); 57011 57012 var didRenameArguments = renameArguments(path, argsId); 57013 if (didRenameArguments) { 57014 vars = vars || t.variableDeclaration("var", []); 57015 vars.declarations.push(t.variableDeclarator(argsId, t.identifier("arguments"))); 57016 } 57017 57018 var emitter = new _emit.Emitter(contextId); 57019 emitter.explode(path.get("body")); 57020 57021 if (vars && vars.declarations.length > 0) { 57022 outerBody.push(vars); 57023 } 57024 57025 var wrapArgs = [emitter.getContextFunction(innerFnId), 57026 // Async functions that are not generators don't care about the 57027 // outer function because they don't need it to be marked and don't 57028 // inherit from its .prototype. 57029 node.generator ? outerFnExpr : t.nullLiteral(), t.thisExpression()]; 57030 57031 var tryLocsList = emitter.getTryLocsList(); 57032 if (tryLocsList) { 57033 wrapArgs.push(tryLocsList); 57034 } 57035 57036 var wrapCall = t.callExpression(util.runtimeProperty(node.async ? "async" : "wrap"), wrapArgs); 57037
57038 outerBody.push(t.returnStatement(wrapCall)); 57039 node.body = t.blockStatement(outerBody); 57040 57041 var oldDirectives = bodyBlockPath.node.directives; 57042 if (oldDirectives) { 57043 // Babylon represents directives like "use strict" as elements of 57044 // a bodyBlockPath.node.directives array. (#248) 57045 node.body.directives = oldDirectives; 57046 } 57047 57048 var wasGeneratorFunction = node.generator; 57049 if (wasGeneratorFunction) { 57050 node.generator = false; 57051 } 57052 57053 if (node.async) { 57054 node.async = false; 57055 } 57056 57057 if (wasGeneratorFunction && t.isExpression(node)) { 57058 path.replaceWith(t.callExpression(util.runtimeProperty("mark"), [node])); 57059 } 57060 57061 // Generators are processed in 'exit' handlers so that regenerator only has to run on 57062 // an ES5 AST, but that means traversal will not pick up newly inserted references 57063 // to things like 'regeneratorRuntime'. To avoid this, we explicitly requeue. 57064 path.requeue(); 57065 } 57066 } 57067 }; 57068 57069 // Given a NodePath for a Function, return an Expression node that can be 57070 // used to refer reliably to the function object from inside the function. 57071 // This expression is essentially a replacement for arguments.callee, with 57072 // the key advantage that it works in strict mode. 57073 function getOuterFnExpr(funPath) { 57074 var node = funPath.node; 57075 t.assertFunction(node); 57076 57077 if (!node.id) { 57078 // Default-exported function declarations, and function expressions may not 57079 // have a name to reference, so we explicitly add one. 57080 node.id = funPath.scope.parent.generateUidIdentifier("callee"); 57081 } 57082 57083 if (node.generator && // Non-generator functions don't need to be marked. 57084 t.isFunctionDeclaration(node)) { 57085 var pp = funPath.findParent(function (path) { 57086 return path.isProgram() || path.isBlockStatement(); 57087 }); 57088 57089 if (!pp) { 57090 return node.id; 57091 } 57092 57093 var markDecl = getRuntimeMarkDecl(pp); 57094 var markedArray = markDecl.declarations[0].id; 57095 var funDeclIdArray = markDecl.declarations[0].init.callee.object; 57096 t.assertArrayExpression(funDeclIdArray); 57097 57098 var index = funDeclIdArray.elements.length; 57099 funDeclIdArray.elements.push(node.id); 57100 57101 return t.memberExpression(markedArray, t.numericLiteral(index), true); 57102 } 57103 57104 return node.id; 57105 } 57106 57107 function getRuntimeMarkDecl(blockPath) { 57108 var block = blockPath.node; 57109 _assert2.default.ok(Array.isArray(block.body)); 57110 57111 var info = getMarkInfo(block); 57112 if (info.decl) { 57113 return info.decl; 57114 } 57115 57116 info.decl = t.variableDeclaration("var", [t.variableDeclarator(blockPath.scope.generateUidIdentifier("marked"), t.callExpression(t.memberExpression(t.arrayExpression([]), t.identifier("map"), false), [util.runtimeProperty("mark")]))]); 57117 57118 blockPath.unshiftContainer("body", info.decl); 57119 57120 return info.decl; 57121 } 57122 57123 function renameArguments(funcPath, argsId) { 57124 var state = { 57125 didRenameArguments: false, 57126 argsId: argsId 57127 }; 57128 57129 funcPath.traverse(argumentsVisitor, state); 57130 57131 // If the traversal replaced any arguments references, then we need to 57132 // alias the outer function's arguments binding (be it the implicit 57133 // arguments object or some other parameter or variable) to the variable 57134 // named by argsId. 57135 return state.didRenameArguments; 57136 } 57137 57138 var argumentsVisitor = { 57139 "FunctionExpression|FunctionDeclaration": function FunctionExpressionFunctionDeclaration(path) { 57140 path.skip(); 57141 }, 57142 57143 Identifier: function Identifier(path, state) { 57144 if (path.node.name === "arguments" && util.isReference(path)) { 57145 path.replaceWith(state.argsId); 57146 state.didRenameArguments = true; 57147 } 57148 } 57149 }; 57150 57151 var functionSentVisitor = { 57152 MetaProperty: function MetaProperty(path) { 57153 var node = path.node; 57154 57155 if (node.meta.name === "function" && node.property.name === "sent") { 57156 path.replaceWith(t.memberExpression(this.context, t.identifier("_sent"))); 57157 } 57158 } 57159 }; 57160 57161 var awaitVisitor = { 57162 Function: function Function(path) { 57163 path.skip(); // Don't descend into nested function scopes. 57164 }, 57165 57166 AwaitExpression: function AwaitExpression(path) { 57167 // Convert await expressions to yield expressions. 57168 var argument = path.node.argument; 57169 57170 // Transforming `await x` to `yield regeneratorRuntime.awrap(x)` 57171 // causes the argument to be wrapped in such a way that the runtime 57172 // can distinguish between awaited and merely yielded values. 57173 path.replaceWith(t.yieldExpression(t.callExpression(util.runtimeProperty("awrap"), [argument]), false)); 57174 } 57175 }; 57176 57177/***/ }, 57178/* 599 */ 57179/***/ function(module, exports, __webpack_require__) { 57180 57181 'use strict'; 57182 57183 // Generated by `/scripts/character-class-escape-sets.js`. Do not edit. 57184 var regenerate = __webpack_require__(278); 57185 57186 exports.REGULAR = { 57187 'd': regenerate().addRange(0x30, 0x39), 57188 'D': regenerate().addRange(0x0, 0x2F).addRange(0x3A, 0xFFFF), 57189 's': regenerate(0x20, 0xA0, 0x1680, 0x202F, 0x205F, 0x3000, 0xFEFF).addRange(0x9, 0xD
57189).addRange(0x2000, 0x200A).addRange(0x2028, 0x2029), 57190 'S': regenerate().addRange(0x0, 0x8).addRange(0xE, 0x1F).addRange(0x21, 0x9F).addRange(0xA1, 0x167F).addRange(0x1681, 0x1FFF).addRange(0x200B, 0x2027).addRange(0x202A, 0x202E).addRange(0x2030, 0x205E).addRange(0x2060, 0x2FFF).addRange(0x3001, 0xFEFE).addRange(0xFF00, 0xFFFF), 57191 'w': regenerate(0x5F).addRange(0x30, 0x39).addRange(0x41, 0x5A).addRange(0x61, 0x7A), 57192 'W': regenerate(0x60).addRange(0x0, 0x2F).addRange(0x3A, 0x40).addRange(0x5B, 0x5E).addRange(0x7B, 0xFFFF) 57193 }; 57194 57195 exports.UNICODE = { 57196 'd': regenerate().addRange(0x30, 0x39), 57197 'D': regenerate().addRange(0x0, 0x2F).addRange(0x3A, 0x10FFFF), 57198 's': regenerate(0x20, 0xA0, 0x1680, 0x202F, 0x205F, 0x3000, 0xFEFF).addRange(0x9, 0xD).addRange(0x2000, 0x200A).addRange(0x2028, 0x2029), 57199 'S': regenerate().addRange(0x0, 0x8).addRange(0xE, 0x1F).addRange(0x21, 0x9F).addRange(0xA1, 0x167F).addRange(0x1681, 0x1FFF).addRange(0x200B, 0x2027).addRange(0x202A, 0x202E).addRange(0x2030, 0x205E).addRange(0x2060, 0x2FFF).addRange(0x3001, 0xFEFE).addRange(0xFF00, 0x10FFFF), 57200 'w': regenerate(0x5F).addRange(0x30, 0x39).addRange(0x41, 0x5A).addRange(0x61, 0x7A), 57201 'W': regenerate(0x60).addRange(0x0, 0x2F).addRange(0x3A, 0x40).addRange(0x5B, 0x5E).addRange(0x7B, 0x10FFFF) 57202 }; 57203 57204 exports.UNICODE_IGNORE_CASE = { 57205 'd': regenerate().addRange(0x30, 0x39), 57206 'D': regenerate().addRange(0x0, 0x2F).addRange(0x3A, 0x10FFFF), 57207 's': regenerate(0x20, 0xA0, 0x1680, 0x202F, 0x205F, 0x3000, 0xFEFF).addRange(0x9, 0xD).addRange(0x2000, 0x200A).addRange(0x2028, 0x2029), 57208 'S': regenerate().addRange(0x0, 0x8).addRange(0xE, 0x1F).addRange(0x21, 0x9F).addRange(0xA1, 0x167F).addRange(0x1681, 0x1FFF).addRange(0x200B, 0x2027).addRange(0x202A, 0x202E).addRange(0x2030, 0x205E).addRange(0x2060, 0x2FFF).addRange(0x3001, 0xFEFE).addRange(0xFF00, 0x10FFFF), 57209 'w': regenerate(0x5F, 0x17F, 0x212A).addRange(0x30, 0x39).addRange(0x41, 0x5A).addRange(0x61, 0x7A), 57210 'W': regenerate(0x4B, 0x53, 0x60).addRange(0x0, 0x2F).addRange(0x3A, 0x40).addRange(0x5B, 0x5E).addRange(0x7B, 0x10FFFF) 57211 }; 57212 57213/***/ }, 57214/* 600 */ 57215/***/ function(module, exports, __webpack_require__) { 57216 57217 'use strict'; 57218 57219 var generate = __webpack_require__(601).generate; 57220 var parse = __webpack_require__(602).parse; 57221 var regenerate = __webpack_require__(278); 57222 var iuMappings = __webpack_require__(619); 57223 var ESCAPE_SETS = __webpack_require__(599); 57224 57225 function getCharacterClassEscapeSet(character) { 57226 if (unicode) { 57227 if (ignoreCase) { 57228 return ESCAPE_SETS.UNICODE_IGNORE_CASE[character]; 57229 } 57230 return ESCAPE_SETS.UNICODE[character]; 57231 } 57232 return ESCAPE_SETS.REGULAR[character]; 57233 } 57234 57235 var object = {}; 57236 var hasOwnProperty = object.hasOwnProperty; 57237 function has(object, property) { 57238 return hasOwnProperty.call(object, property); 57239 } 57240 57241 // Prepare a Regenerate set containing all code points, used for negative 57242 // character classes (if any). 57243 var UNICODE_SET = regenerate().addRange(0x0, 0x10FFFF); 57244 // Without the `u` flag, the range stops at 0xFFFF. 57245 // https://mths.be/es6#sec-pattern-semantics 57246 var BMP_SET = regenerate().addRange(0x0, 0xFFFF); 57247 57248 // Prepare a Regenerate set containing all code points that are supposed to be 57249 // matched by `/./u`. https://mths.be/es6#sec-atom 57250 var DOT_SET_UNICODE = UNICODE_SET.clone() // all Unicode code points 57251 .remove( 57252 // minus `LineTerminator`s (https://mths.be/es6#sec-line-terminators): 57253 0x000A, // Line Feed <LF> 57254 0x000D, // Carriage Return <CR> 57255 0x2028, // Line Separator <LS> 57256 0x2029 // Paragraph Separator <PS> 57257 ); 57258 // Prepare a Regenerate set containing all code points that are supposed to be 57259 // matched by `/./` (only BMP code points). 57260 var DOT_SET = DOT_SET_UNICODE.clone().intersection(BMP_SET); 57261 57262 // Add a range of code points + any case-folded code points in that range to a 57263 // set. 57264 regenerate.prototype.iuAddRange = function (min, max) { 57265 var $this = this; 57266 do { 57267 var folded = caseFold(min); 57268 if (folded) { 57269 $this.add(folded); 57270 } 57271 } while (++min <= max); 57272 return $this; 57273 }; 57274 57275 function assign(target, source) { 57276 for (var key in source) { 57277 // Note: `hasOwnProperty` is not needed here. 57278 target[key] = source[key]; 57279 } 57280 } 57281 57282 function update(item, pattern) { 57283 // TODO: Test if memoizing `pattern` here is worth the effort. 57284 if (!pattern) { 57285 return; 57286 } 57287 var tree = parse(pattern, ''); 57288 switch (tree.type) { 57289 case 'characterClass': 57290 case 'group': 57291 case 'value': 57292 // No wrapping needed. 57293 break; 57294 default: 57295 // Wrap the pattern in a non-capturing group. 57296 tree = wrap(tree, pattern); 57297 } 57298 assign(item, tree); 57299 } 57300 57301 function wrap(tree, pattern) { 57302 // Wrap the pattern in a non-capturing group. 57303 return { 57304 'type': 'group', 57305 'behavior': 'ignore', 57306 'body': [tree], 57307 'raw': '(?:' + pattern + ')' 57308 }; 57309 } 57310 57311 function caseFold(codePoint) { 57312 return has(iuMappings, codePoint) ? iuMappings[codePoint] : false;
57313 } 57314 57315 var ignoreCase = false; 57316 var unicode = false; 57317 function processCharacterClass(characterClassItem) { 57318 var set = regenerate(); 57319 var body = characterClassItem.body.forEach(function (item) { 57320 switch (item.type) { 57321 case 'value': 57322 set.add(item.codePoint); 57323 if (ignoreCase && unicode) { 57324 var folded = caseFold(item.codePoint); 57325 if (folded) { 57326 set.add(folded); 57327 } 57328 } 57329 break; 57330 case 'characterClassRange': 57331 var min = item.min.codePoint; 57332 var max = item.max.codePoint; 57333 set.addRange(min, max); 57334 if (ignoreCase && unicode) { 57335 set.iuAddRange(min, max); 57336 } 57337 break; 57338 case 'characterClassEscape': 57339 set.add(getCharacterClassEscapeSet(item.value)); 57340 break; 57341 // The `default` clause is only here as a safeguard; it should never be 57342 // reached. Code coverage tools should ignore it. 57343 /* istanbul ignore next */ 57344 default: 57345 throw Error('Unknown term type: ' + item.type); 57346 } 57347 }); 57348 if (characterClassItem.negative) { 57349 set = (unicode ? UNICODE_SET : BMP_SET).clone().remove(set); 57350 } 57351 update(characterClassItem, set.toString()); 57352 return characterClassItem; 57353 } 57354 57355 function processTerm(item) { 57356 switch (item.type) { 57357 case 'dot': 57358 update(item, (unicode ? DOT_SET_UNICODE : DOT_SET).toString()); 57359 break; 57360 case 'characterClass': 57361 item = processCharacterClass(item); 57362 break; 57363 case 'characterClassEscape': 57364 update(item, getCharacterClassEscapeSet(item.value).toString()); 57365 break; 57366 case 'alternative': 57367 case 'disjunction': 57368 case 'group': 57369 case 'quantifier': 57370 item.body = item.body.map(processTerm); 57371 break; 57372 case 'value': 57373 var codePoint = item.codePoint; 57374 var set = regenerate(codePoint); 57375 if (ignoreCase && unicode) { 57376 var folded = caseFold(codePoint); 57377 if (folded) { 57378 set.add(folded); 57379 } 57380 } 57381 update(item, set.toString()); 57382 break; 57383 case 'anchor': 57384 case 'empty': 57385 case 'group': 57386 case 'reference': 57387 // Nothing to do here. 57388 break; 57389 // The `default` clause is only here as a safeguard; it should never be 57390 // reached. Code coverage tools should ignore it. 57391 /* istanbul ignore next */ 57392 default: 57393 throw Error('Unknown term type: ' + item.type); 57394 } 57395 return item; 57396 }; 57397 57398 module.exports = function (pattern, flags) { 57399 var tree = parse(pattern, flags); 57400 ignoreCase = flags ? flags.indexOf('i') > -1 : false; 57401 unicode = flags ? flags.indexOf('u') > -1 : false; 57402 assign(tree, processTerm(tree)); 57403 return generate(tree); 57404 }; 57405 57406/***/ }, 57407/* 601 */ 57408/***/ function(module, exports, __webpack_require__) { 57409 57410 var __WEBPACK_AMD_DEFINE_RESULT__;/* WEBPACK VAR INJECTION */(function(module, global) {'use strict'; 57411 57412 var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; 57413 57414 /*! 57415 * RegJSGen 57416 * Copyright 2014 Benjamin Tan <https://d10.github.io/> 57417 * Available under MIT license <http://d10.mit-license.org/> 57418 */ 57419 ;(function () { 57420 'use strict'; 57421 57422 /** Used to determine if values are of the language type `Object` */ 57423 57424 var objectTypes = { 57425 'function': true, 57426 'object': true 57427 }; 57428 57429 /** Used as a reference to the global object */ 57430 var root = objectTypes[typeof window === 'undefined' ? 'undefined' : _typeof(window)] && window || this; 57431 57432 /** Backup possible global object */ 57433 var oldRoot = root; 57434 57435 /** Detect free variable `exports` */ 57436 var freeExports = objectTypes[ false ? 'undefined' : _typeof(exports)] && exports; 57437 57438 /** Detect free variable `module` */ 57439 var freeModule = objectTypes[ false ? 'undefined' : _typeof(module)] && module && !module.nodeType && module; 57440 57441 /** Detect free variable `global` from Node.js or Browserified code and use it as `root` */ 57442 var freeGlobal = freeExports && freeModule && (typeof global === 'undefined' ? 'undefined' : _typeof(global)) == 'object' && global; 57443 if (freeGlobal && (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal || freeGlobal.self === freeGlobal)) { 57444 root = freeGlobal; 57445 } 57446 57447 /*--------------------------------------------------------------------------*/ 57448 57449 /*! Based on https://mths.be/fromcodepoint v0.2.0 by @mathias */ 57450 57451 var stringFromCharCode = String.fromCharCode; 57452 var floor = Math.floor; 57453 function fromCodePoint() { 57454 var MAX_SIZE = 0x4000; 57455 var codeUnits = []; 57456 var highSurrogate; 57457 var lowSurrogate; 57458 var index = -1; 57459 var length = arguments.length; 57460 if (!length) { 57461 return ''; 57462 } 57463 var result = ''; 57464 while (++index < length) { 57465 var codePoint = Number(arguments[index]); 57466 if (!isFinite(codePoint) || // `NaN`, `+Infinity`, or `-Infinity` 57467 codePoint < 0 || // not a valid Unicode code point 57468 codePoint > 0x10FFFF || // not a valid Unicode code point 57469 floor(codePoint) != codePoint // not an integer 57470 ) { 57471 throw RangeError('Invalid code point: ' + codePoint); 57472 } 57473 if (codePoint <= 0xFFFF) { 57474 // BMP code point 57475 codeUnits.push(codePoint); 57476 } else { 57477 // Astral code point; split in surrogate halves 57478 // http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae 57479 codePoint -= 0x10000; 57480 highSurrogate = (codePoint >> 10) + 0xD800; 57481 lowSurrogate = codePoint % 0x400 + 0xDC00; 57482 codeUnits.push(highSurrogate, lowSurrogate); 57483 } 57484 if (index + 1 == length || codeUnits.length > MAX_SIZE) { 57485 result += stringFromCharCode.apply(null, codeUnits); 57486 codeUnits.length = 0; 57487 } 57488 } 57489 return result; 57490 } 57491 57492 function assertType(type, expected) { 57493 if (expected.indexOf('|') == -1) { 57494 if (type == expected) { 57495 return; 57496 } 57497 57498 throw Error('Invalid node type: ' + type); 57499 } 57500 57501 expected = assertType.hasOwnProperty(expected) ? assertType[expected] : assertType[expected] = RegExp('^(?:' + expected + ')$'); 57502 57503 if (expected.test(type)) { 57504 return; 57505 } 57506 57507 throw Error('Invalid node type: ' + type); 57508 } 57509 57510 /*--------------------------------------------------------------------------*/ 57511 57512 function generate(node) { 57513 var type = node.type; 57514 57515 if (generate.hasOwnProperty(type) && typeof generate[type] == 'function') { 57516 return generate[type](node); 57517 } 57518 57519 throw Error('Invalid node type: ' + type); 57520 } 57521 57522 /*--------------------------------------------------------------------------*/ 57523 57524 function generateAlternative(node) { 57525 assertType(node.type, 'alternative'); 57526 57527 var terms = node.body, 57528 length = terms ? terms.length : 0; 57529 57530 if (length == 1) { 57531 return generateTerm(terms[0]); 57532 } else { 57533 var i = -1, 57534 result = ''; 57535 57536 while (++i < length) { 57537 result += generateTerm(terms[i]); 57538 } 57539 57540 return result; 57541 } 57542 } 57543 57544 function generateAnchor(node) { 57545 assertType(node.type, 'anchor'); 57546 57547 switch (node.kind) { 57548 case 'start': 57549 return '^'; 57550 case 'end': 57551 return '$'; 57552 case 'boundary': 57553 return '\\b'; 57554 case 'not-boundary': 57555 return '\\B'; 57556 default: 57557 throw Error('Invalid assertion'); 57558 } 57559 } 57560 57561 function generateAtom(node) { 57562 assertType(node.type, 'anchor|characterClass|characterClassEscape|dot|group|reference|value'); 57563 57564 return generate(node); 57565 } 57566 57567 function generateCharacterClass(node) { 57568 assertType(node.type, 'characterClass'); 57569 57570 var classRanges = node.body, 57571 length = classRanges ? classRanges.length : 0; 57572 57573 var i = -1, 57574 result = '['; 57575 57576 if (node.negative) { 57577 result += '^'; 57578 } 57579 57580 while (++i < length) { 57581 result += generateClassAtom(classRanges[i]); 57582 } 57583 57584 result += ']'; 57585 57586 return result; 57587 } 57588 57589 function generateCharacterClassEscape(node) { 57590 assertType(node.type, 'characterClassEscape'); 57591 57592 return '\\' + node.value; 57593 } 57594 57595 function generateCharacterClassRange(node) { 57596 assertType(node.type, 'characterClassRange'); 57597 57598 var min = node.min, 57599 max = node.max; 57600 57601 if (min.type == 'characterClassRange' || max.type == 'characterClassRange') { 57602 throw Error('Invalid character class range'); 57603 } 57604 57605 return generateClassAtom(min) + '-' + generateClassAtom(max); 57606 } 57607 57608 function generateClassAtom(node) { 57609 assertType(node.type, 'anchor|characterClassEscape|characterClassRange|dot|value'); 57610 57611 return generate(node); 57612 } 57613 57614 function generateDisjunction(node) { 57615 assertType(node.type, 'disjunction'); 57616 57617 var body = node.body, 57618 length = body ? body.length : 0; 57619 57620 if (length == 0) { 57621 throw Error('No body'); 57622 } else if (length == 1) { 57623 return generate(body[0]); 57624 } else { 57625 var i = -1, 57626 result = ''; 57627 57628 while (++i < length) { 57629 if (i != 0) { 57630 result += '|'; 57631 } 57632 result += generate(body[i]); 57633 } 57634 57635 return result; 57636 } 57637 } 57638 57639 function generateDot(node) { 57640 assertType(node.type, 'dot'); 57641 57642 return '.'; 57643 } 57644 57645 function generateGroup(node) { 57646 assertType(node.type, 'group'); 57647 57648 var result = '('; 57649 57650 switch (node.behavior) { 57651 case 'normal': 57652 break; 57653 case 'ignore': 57654 result += '?:'; 57655 break; 57656 case 'lookahead': 57657 result += '?='; 57658 break; 57659 case 'negativeLookahead': 57660 result += '?!'; 57661 break; 57662 default: 57663 throw Error('Invalid behaviour: ' + node.behaviour); 57664 } 57665 57666 var body = node.body, 57667 length = body ? body.length : 0; 57668 57669 if (length == 1) { 57670 result += generate(body[0]); 57671 } else { 57672 var i = -1; 57673 57674 while (++i < length) { 57675 result += generate(body[i]); 57676 } 57677 } 57678 57679 result += ')'; 57680 57681 return result; 57682 } 57683 57684 function generateQuantifier(node) { 57685 assertType(node.type, 'quantifier'); 57686 57687 var quantifier = '', 57688 min = node.min, 57689 max = node.max; 57690 57691 switch (max) { 57692 case undefined: 57693 case null: 57694 switch (min) { 57695 case 0: 57696 quantifier = '*'; 57697 break; 57698 case 1: 57699 quantifier = '+'; 57700 break; 57701 default: 57702 quantifier = '{' + min + ',}'; 57703 break; 57704 } 57705 break; 57706 default: 57707 if (min == max) { 57708 quantifier = '{' + min + '}'; 57709 } else if (min == 0 && max == 1) { 57710 quantifier = '?'; 57711 } else { 57712 quantifier = '{' + min + ',' + max + '}'; 57713 } 57714 break; 57715 } 57716 57717 if (!node.greedy) { 57718 quantifier += '?'; 57719 } 57720 57721 return generateAtom(node.body[0]) + quantifier; 57722 } 57723 57724 function generateReference(node) { 57725 assertType(node.type, 'reference'); 57726 57727 return '\\' + node.matchIndex; 57728 } 57729 57730 function generateTerm(node) { 57731 assertType(node.type, 'anchor|characterClass|characterClassEscape|empty|group|quantifier|reference|value'); 57732 57733 return generate(node); 57734 } 57735 57736 function generateValue(node) { 57737 assertType(node.type, 'value'); 57738 57739 var kind = node.kind, 57740 codePoint = node.codePoint; 57741 57742 switch (kind) { 57743 case 'controlLetter': 57744 return '\\c' + fromCodePoint(codePoint + 64); 57745 case 'hexadecimalEscape': 57746 return '\\x' + ('00' + codePoint.toString(16).toUpperCase()).slice(-2); 57747 case 'identifier': 57748 return '\\' + fromCodePoint(codePoint); 57749 case 'null': 57750 return '\\' + codePoint; 57751 case 'octal': 57752 return '\\' + codePoint.toString(8); 57753 case 'singleEscape': 57754 switch (codePoint) { 57755 case 0x0008: 57756 return '\\b'; 57757 case 0x009: 57758 return '\\t'; 57759 case 0x00A: 57760 return '\\n'; 57761 case 0x00B: 57762 return '\\v'; 57763 case 0x00C: 57764 return '\\f'; 57765 case 0x00D: 57766 return '\\r'; 57767 default: 57768 throw Error('Invalid codepoint: ' + codePoint); 57769 } 57770 case 'symbol': 57771 return fromCodePoint(codePoint); 57772 case 'unicodeEscape':
57773 return '\\u' + ('0000' + codePoint.toString(16).toUpperCase()).slice(-4); 57774 case 'unicodeCodePointEscape': 57775 return '\\u{' + codePoint.toString(16).toUpperCase() + '}'; 57776 default: 57777 throw Error('Unsupported node kind: ' + kind); 57778 } 57779 } 57780 57781 /*--------------------------------------------------------------------------*/ 57782 57783 generate.alternative = generateAlternative; 57784 generate.anchor = generateAnchor; 57785 generate.characterClass = generateCharacterClass; 57786 generate.characterClassEscape = generateCharacterClassEscape; 57787 generate.characterClassRange = generateCharacterClassRange; 57788 generate.disjunction = generateDisjunction; 57789 generate.dot = generateDot; 57790 generate.group = generateGroup; 57791 generate.quantifier = generateQuantifier; 57792 generate.reference = generateReference; 57793 generate.value = generateValue; 57794 57795 /*--------------------------------------------------------------------------*/ 57796 57797 // export regjsgen 57798 // some AMD build optimizers, like r.js, check for condition patterns like the following: 57799 if ("function" == 'function' && _typeof(__webpack_require__(48)) == 'object' && __webpack_require__(48)) { 57800 // define as an anonymous module so, through path mapping, it can be aliased 57801 !(__WEBPACK_AMD_DEFINE_RESULT__ = function () { 57802 return { 57803 'generate': generate 57804 }; 57805 }.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); 57806 } 57807 // check for `exports` after `define` in case a build optimizer adds an `exports` object 57808 else if (freeExports && freeModule) { 57809 // in Narwhal, Node.js, Rhino -require, or RingoJS 57810 freeExports.generate = generate; 57811 } 57812 // in a browser or Rhino 57813 else { 57814 root.regjsgen = { 57815 'generate': generate 57816 }; 57817 } 57818 }).call(undefined); 57819 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(39)(module), (function() { return this; }()))) 57820 57821/***/ }, 57822/* 602 */ 57823/***/ function(module, exports) { 57824 57825 'use strict'; 57826 57827 // regjsparser 57828 // 57829 // ================================================================== 57830 // 57831 // See ECMA-262 Standard: 15.10.1 57832 // 57833 // NOTE: The ECMA-262 standard uses the term "Assertion" for /^/. Here the 57834 // term "Anchor" is used. 57835 // 57836 // Pattern :: 57837 // Disjunction 57838 // 57839 // Disjunction :: 57840 // Alternative 57841 // Alternative | Disjunction 57842 // 57843 // Alternative :: 57844 // [empty] 57845 // Alternative Term 57846 // 57847 // Term :: 57848 // Anchor 57849 // Atom 57850 // Atom Quantifier 57851 // 57852 // Anchor :: 57853 // ^ 57854 // $ 57855 // \ b 57856 // \ B 57857 // ( ? = Disjunction ) 57858 // ( ? ! Disjunction ) 57859 // 57860 // Quantifier :: 57861 // QuantifierPrefix 57862 // QuantifierPrefix ? 57863 // 57864 // QuantifierPrefix :: 57865 // * 57866 // + 57867 // ? 57868 // { DecimalDigits } 57869 // { DecimalDigits , } 57870 // { DecimalDigits , DecimalDigits } 57871 // 57872 // Atom :: 57873 // PatternCharacter 57874 // . 57875 // \ AtomEscape 57876 // CharacterClass 57877 // ( Disjunction ) 57878 // ( ? : Disjunction ) 57879 // 57880 // PatternCharacter :: 57881 // SourceCharacter but not any of: ^ $ \ . * + ? ( ) [ ] { } | 57882 // 57883 // AtomEscape :: 57884 // DecimalEscape 57885 // CharacterEscape 57886 // CharacterClassEscape 57887 // 57888 // CharacterEscape[U] :: 57889 // ControlEscape 57890 // c ControlLetter 57891 // HexEscapeSequence 57892 // RegExpUnicodeEscapeSequence[?U] (ES6) 57893 // IdentityEscape[?U] 57894 // 57895 // ControlEscape :: 57896 // one of f n r t v 57897 // ControlLetter :: 57898 // one of 57899 // a b c d e f g h i j k l m n o p q r s t u v w x y z 57900 // A B C D E F G H I J K L M N O P Q R S T U V W X Y Z 57901 // 57902 // IdentityEscape :: 57903 // SourceCharacter but not IdentifierPart 57904 // <ZWJ> 57905 // <ZWNJ> 57906 // 57907 // DecimalEscape :: 57908 // DecimalIntegerLiteral [lookahead ∉ DecimalDigit] 57909 // 57910 // CharacterClassEscape :: 57911 // one of d D s S w W 57912 // 57913 // CharacterClass :: 57914 // [ [lookahead ∉ {^}] ClassRanges ] 57915 // [ ^ ClassRanges ] 57916 // 57917 // ClassRanges :: 57918 // [empty] 57919 // NonemptyClassRanges 57920 // 57921 // NonemptyClassRanges :: 57922 // ClassAtom 57923 // ClassAtom NonemptyClassRangesNoDash 57924 // ClassAtom - ClassAtom ClassRanges 57925 // 57926 // NonemptyClassRangesNoDash :: 57927 // ClassAtom 57928 // ClassAtomNoDash NonemptyClassRangesNoDash 57929 // ClassAtomNoDash - ClassAtom ClassRanges 57930 // 57931 // ClassAtom :: 57932 // - 57933 // ClassAtomNoDash 57934 // 57935 // ClassAtomNoDash :: 57936 // SourceCharacter but not one of \ or ] or - 57937 // \ ClassEscape 57938 // 57939 // ClassEscape :: 57940 // DecimalEscape 57941 // b 57942 // CharacterEscape 57943 // CharacterClassEscape 57944 57945 (function () { 57946 57947 function parse(str, flags) { 57948 function addRaw(node) { 57949 node.raw = str.substring(node.range[0], node.range[1]); 57950 return node; 57951 } 57952 57953 function updateRawStart(node, start) { 57954 node.range[0] = start; 57955 return addRaw(node); 57956 } 57957 57958 function createAnchor(kind, rawLength) { 57959 return addRaw({ 57960 type: 'anchor', 57961 kind: kind, 57962 range: [pos - rawLength, pos] 57963 }); 57964 } 57965 57966 function createValue(kind, codePoint, from, to) { 57967 return addRaw({ 57968 type: 'value', 57969 kind: kind, 57970 codePoint: codePoint, 57971 range: [from, to] 57972 }); 57973 } 57974 57975 function createEscaped(kind, codePoint, value, fromOffset) { 57976 fromOffset = fromOffset || 0; 57977 return createValue(kind, codePoint, pos - (value.length + fromOffset), pos); 57978 } 57979 57980 function createCharacter(matches) { 57981 var _char = matches[0]; 57982 var first = _char.charCodeAt(0); 57983 if (hasUnicodeFlag) { 57984 var second; 57985 if (_char.length === 1 && first >= 0xD800 && first <= 0xDBFF) {
57986 second = lookahead().charCodeAt(0); 57987 if (second >= 0xDC00 && second <= 0xDFFF) { 57988 // Unicode surrogate pair 57989 pos++; 57990 return createValue('symbol', (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000, pos - 2, pos); 57991 } 57992 } 57993 } 57994 return createValue('symbol', first, pos - 1, pos); 57995 } 57996 57997 function createDisjunction(alternatives, from, to) { 57998 return addRaw({ 57999 type: 'disjunction', 58000 body: alternatives, 58001 range: [from, to] 58002 }); 58003 } 58004 58005 function createDot() { 58006 return addRaw({ 58007 type: 'dot', 58008 range: [pos - 1, pos] 58009 }); 58010 } 58011 58012 function createCharacterClassEscape(value) { 58013 return addRaw({ 58014 type: 'characterClassEscape', 58015 value: value, 58016 range: [pos - 2, pos] 58017 }); 58018 } 58019 58020 function createReference(matchIndex) { 58021 return addRaw({ 58022 type: 'reference', 58023 matchIndex: parseInt(matchIndex, 10), 58024 range: [pos - 1 - matchIndex.length, pos] 58025 }); 58026 } 58027 58028 function createGroup(behavior, disjunction, from, to) { 58029 return addRaw({ 58030 type: 'group', 58031 behavior: behavior, 58032 body: disjunction, 58033 range: [from, to] 58034 }); 58035 } 58036 58037 function createQuantifier(min, max, from, to) { 58038 if (to == null) { 58039 from = pos - 1; 58040 to = pos; 58041 } 58042 58043 return addRaw({ 58044 type: 'quantifier', 58045 min: min, 58046 max: max, 58047 greedy: true, 58048 body: null, // set later on 58049 range: [from, to] 58050 }); 58051 } 58052 58053 function createAlternative(terms, from, to) { 58054 return addRaw({ 58055 type: 'alternative', 58056 body: terms, 58057 range: [from, to] 58058 }); 58059 } 58060 58061 function createCharacterClass(classRanges, negative, from, to) { 58062 return addRaw({ 58063 type: 'characterClass', 58064 body: classRanges, 58065 negative: negative, 58066 range: [from, to] 58067 }); 58068 } 58069 58070 function createClassRange(min, max, from, to) { 58071 // See 15.10.2.15: 58072 if (min.codePoint > max.codePoint) { 58073 bail('invalid range in character class', min.raw + '-' + max.raw, from, to); 58074 } 58075 58076 return addRaw({ 58077 type: 'characterClassRange', 58078 min: min, 58079 max: max, 58080 range: [from, to] 58081 }); 58082 } 58083 58084 function flattenBody(body) { 58085 if (body.type === 'alternative') { 58086 return body.body; 58087 } else { 58088 return [body]; 58089 } 58090 } 58091 58092 function isEmpty(obj) { 58093 return obj.type === 'empty'; 58094 } 58095 58096 function incr(amount) { 58097 amount = amount || 1; 58098 var res = str.substring(pos, pos + amount); 58099 pos += amount || 1; 58100 return res; 58101 } 58102 58103 function skip(value) { 58104 if (!match(value)) { 58105 bail('character', value); 58106 } 58107 } 58108 58109 function match(value) { 58110 if (str.indexOf(value, pos) === pos) { 58111 return incr(value.length); 58112 } 58113 } 58114 58115 function lookahead() { 58116 return str[pos]; 58117 } 58118 58119 function current(value) { 58120 return str.indexOf(value, pos) === pos; 58121 } 58122 58123 function next(value) { 58124 return str[pos + 1] === value; 58125 } 58126 58127 function matchReg(regExp) { 58128 var subStr = str.substring(pos); 58129 var res = subStr.match(regExp); 58130 if (res) { 58131 res.range = []; 58132 res.range[0] = pos; 58133 incr(res[0].length); 58134 res.range[1] = pos; 58135 } 58136 return res; 58137 } 58138 58139 function parseDisjunction() { 58140 // Disjunction :: 58141 // Alternative 58142 // Alternative | Disjunction 58143 var res = [], 58144 from = pos; 58145 res.push(parseAlternative()); 58146 58147 while (match('|')) { 58148 res.push(parseAlternative()); 58149 } 58150 58151 if (res.length === 1) { 58152 return res[0]; 58153 } 58154 58155 return createDisjunction(res, from, pos); 58156 } 58157 58158 function parseAlternative() { 58159 var res = [], 58160 from = pos; 58161 var term; 58162 58163 // Alternative :: 58164 // [empty] 58165 // Alternative Term 58166 while (term = parseTerm()) { 58167 res.push(term); 58168 } 58169 58170 if (res.length === 1) { 58171 return res[0]; 58172 } 58173 58174 return createAlternative(res, from, pos); 58175 } 58176 58177 function parseTerm() { 58178 // Term :: 58179 // Anchor 58180 // Atom 58181 // Atom Quantifier 58182 58183 if (pos >= str.length || current('|') || current(')')) { 58184 return null; /* Means: The term is empty */ 58185 } 58186 58187 var anchor = parseAnchor(); 58188 58189 if (anchor) { 58190 return anchor; 58191 } 58192 58193 var atom = parseAtom(); 58194 if (!atom) { 58195 bail('Expected atom'); 58196 } 58197 var quantifier = parseQuantifier() || false; 58198 if (quantifier) { 58199 quantifier.body = flattenBody(atom); 58200 // The quantifier contains the atom. Therefore, the beginning of the 58201 // quantifier range is given by the beginning of the atom. 58202 updateRawStart(quantifier, atom.range[0]); 58203 return quantifier; 58204 } 58205 return atom; 58206 } 58207 58208 function parseGroup(matchA, typeA, matchB, typeB) { 58209 var type = null, 58210 from = pos; 58211 58212 if (match(matchA)) { 58213 type = typeA; 58214 } else if (match(matchB)) { 58215 type = typeB; 58216 } else { 58217 return false;
58218 } 58219 58220 var body = parseDisjunction(); 58221 if (!body) { 58222 bail('Expected disjunction'); 58223 } 58224 skip(')'); 58225 var group = createGroup(type, flattenBody(body), from, pos); 58226 58227 if (type == 'normal') { 58228 // Keep track of the number of closed groups. This is required for 58229 // parseDecimalEscape(). In case the string is parsed a second time the 58230 // value already holds the total count and no incrementation is required. 58231 if (firstIteration) { 58232 closedCaptureCounter++; 58233 } 58234 } 58235 return group; 58236 } 58237 58238 function parseAnchor() { 58239 // Anchor :: 58240 // ^ 58241 // $ 58242 // \ b 58243 // \ B 58244 // ( ? = Disjunction ) 58245 // ( ? ! Disjunction ) 58246 var res, 58247 from = pos; 58248 58249 if (match('^')) { 58250 return createAnchor('start', 1 /* rawLength */); 58251 } else if (match('$')) { 58252 return createAnchor('end', 1 /* rawLength */); 58253 } else if (match('\\b')) { 58254 return createAnchor('boundary', 2 /* rawLength */); 58255 } else if (match('\\B')) { 58256 return createAnchor('not-boundary', 2 /* rawLength */); 58257 } else { 58258 return parseGroup('(?=', 'lookahead', '(?!', 'negativeLookahead'); 58259 } 58260 } 58261 58262 function parseQuantifier() { 58263 // Quantifier :: 58264 // QuantifierPrefix 58265 // QuantifierPrefix ? 58266 // 58267 // QuantifierPrefix :: 58268 // * 58269 // + 58270 // ? 58271 // { DecimalDigits } 58272 // { DecimalDigits , } 58273 // { DecimalDigits , DecimalDigits } 58274 58275 var res, 58276 from = pos; 58277 var quantifier; 58278 var min, max; 58279 58280 if (match('*')) { 58281 quantifier = createQuantifier(0); 58282 } else if (match('+')) { 58283 quantifier = createQuantifier(1); 58284 } else if (match('?')) { 58285 quantifier = createQuantifier(0, 1); 58286 } else if (res = matchReg(/^\{([0-9]+)\}/)) { 58287 min = parseInt(res[1], 10); 58288 quantifier = createQuantifier(min, min, res.range[0], res.range[1]); 58289 } else if (res = matchReg(/^\{([0-9]+),\}/)) { 58290 min = parseInt(res[1], 10); 58291 quantifier = createQuantifier(min, undefined, res.range[0], res.range[1]); 58292 } else if (res = matchReg(/^\{([0-9]+),([0-9]+)\}/)) { 58293 min = parseInt(res[1], 10); 58294 max = parseInt(res[2], 10); 58295 if (min > max) { 58296 bail('numbers out of order in {} quantifier', '', from, pos); 58297 } 58298 quantifier = createQuantifier(min, max, res.range[0], res.range[1]); 58299 } 58300 58301 if (quantifier) { 58302 if (match('?')) { 58303 quantifier.greedy = false; 58304 quantifier.range[1] += 1; 58305 } 58306 } 58307 58308 return quantifier; 58309 } 58310 58311 function parseAtom() { 58312 // Atom :: 58313 // PatternCharacter 58314 // . 58315 // \ AtomEscape 58316 // CharacterClass 58317 // ( Disjunction ) 58318 // ( ? : Disjunction ) 58319 58320 var res; 58321 58322 // jviereck: allow ']', '}' here as well to be compatible with browser's 58323 // implementations: ']'.match(/]/); 58324 // if (res = matchReg(/^[^^$\\.*+?()[\]{}|]/)) { 58325 if (res = matchReg(/^[^^$\\.*+?(){[|]/)) { 58326 // PatternCharacter 58327 return createCharacter(res); 58328 } else if (match('.')) { 58329 // . 58330 return createDot(); 58331 } else if (match('\\')) { 58332 // \ AtomEscape 58333 res = parseAtomEscape(); 58334 if (!res) { 58335 bail('atomEscape'); 58336 } 58337 return res; 58338 } else if (res = parseCharacterClass()) { 58339 return res; 58340 } else { 58341 // ( Disjunction ) 58342 // ( ? : Disjunction ) 58343 return parseGroup('(?:', 'ignore', '(', 'normal'); 58344 } 58345 } 58346 58347 function parseUnicodeSurrogatePairEscape(firstEscape) { 58348 if (hasUnicodeFlag) { 58349 var first, second; 58350 if (firstEscape.kind == 'unicodeEscape' && (first = firstEscape.codePoint) >= 0xD800 && first <= 0xDBFF && current('\\') && next('u')) { 58351 var prevPos = pos; 58352 pos++; 58353 var secondEscape = parseClassEscape(); 58354 if (secondEscape.kind == 'unicodeEscape' && (second = secondEscape.codePoint) >= 0xDC00 && second <= 0xDFFF) { 58355 // Unicode surrogate pair 58356 firstEscape.range[1] = secondEscape.range[1]; 58357 firstEscape.codePoint = (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000; 58358 firstEscape.type = 'value'; 58359 firstEscape.kind = 'unicodeCodePointEscape'; 58360 addRaw(firstEscape); 58361 } else { 58362 pos = prevPos; 58363 } 58364 } 58365 } 58366 return firstEscape; 58367 } 58368 58369 function parseClassEscape() { 58370 return parseAtomEscape(true); 58371 } 58372 58373 function parseAtomEscape(insideCharacterClass) { 58374 // AtomEscape :: 58375 // DecimalEscape 58376 // CharacterEscape 58377 // CharacterClassEscape 58378 58379 var res, 58380 from = pos; 58381 58382 res = parseDecimalEscape(); 58383 if (res) { 58384 return res; 58385 } 58386 58387 // For ClassEscape 58388 if (insideCharacterClass) { 58389 if (match('b')) { 58390 // 15.10.2.19 58391 // The production ClassEscape :: b evaluates by returning the 58392 // CharSet containing the one character <BS> (Unicode value 0008). 58393 return createEscaped('singleEscape', 0x0008, '\\b'); 58394 } else if (match('B')) { 58395 bail('\\B not possible inside of CharacterClass', '', from); 58396 } 58397 } 58398 58399 res = parseCharacterEscape(); 58400 58401 return res; 58402 } 58403 58404 function parseDecimalEscape() { 58405 // DecimalEscape :: 58406 // DecimalIntegerLiteral [lookahead ∉ DecimalDigit] 58407 // CharacterClassEscape :: one of d D s S w W 58408 58409 var res, match; 58410 58411 if (res = matchReg(/^(?!0)\d+/)) { 58412 match = res[0]; 58413 var refIdx = parseInt(res[0], 10); 58414 if (refIdx <= closedCaptureCounter) { 58415 // If the number is smaller than the normal-groups foun
58415d so 58416 // far, then it is a reference... 58417 return createReference(res[0]); 58418 } else { 58419 // ... otherwise it needs to be interpreted as a octal (if the 58420 // number is in an octal format). If it is NOT octal format, 58421 // then the slash is ignored and the number is matched later 58422 // as normal characters. 58423 58424 // Recall the negative decision to decide if the input must be parsed 58425 // a second time with the total normal-groups. 58426 backrefDenied.push(refIdx); 58427 58428 // Reset the position again, as maybe only parts of the previous 58429 // matched numbers are actual octal numbers. E.g. in '019' only 58430 // the '01' should be matched. 58431 incr(-res[0].length); 58432 if (res = matchReg(/^[0-7]{1,3}/)) { 58433 return createEscaped('octal', parseInt(res[0], 8), res[0], 1); 58434 } else { 58435 // If we end up here, we have a case like /\91/. Then the 58436 // first slash is to be ignored and the 9 & 1 to be treated 58437 // like ordinary characters. Create a character for the 58438 // first number only here - other number-characters 58439 // (if available) will be matched later. 58440 res = createCharacter(matchReg(/^[89]/)); 58441 return updateRawStart(res, res.range[0] - 1); 58442 } 58443 } 58444 } 58445 // Only allow octal numbers in the following. All matched numbers start 58446 // with a zero (if the do not, the previous if-branch is executed). 58447 // If the number is not octal format and starts with zero (e.g. `091`) 58448 // then only the zeros `0` is treated here and the `91` are ordinary 58449 // characters. 58450 // Example: 58451 // /\091/.exec('\091')[0].length === 3 58452 else if (res = matchReg(/^[0-7]{1,3}/)) { 58453 match = res[0]; 58454 if (/^0{1,3}$/.test(match)) { 58455 // If they are all zeros, then only take the first one. 58456 return createEscaped('null', 0x0000, '0', match.length + 1); 58457 } else { 58458 return createEscaped('octal', parseInt(match, 8), match, 1); 58459 } 58460 } else if (res = matchReg(/^[dDsSwW]/)) { 58461 return createCharacterClassEscape(res[0]); 58462 } 58463 return false; 58464 } 58465 58466 function parseCharacterEscape() { 58467 // CharacterEscape :: 58468 // ControlEscape 58469 // c ControlLetter 58470 // HexEscapeSequence 58471 // UnicodeEscapeSequence 58472 // IdentityEscape 58473 58474 var res; 58475 if (res = matchReg(/^[fnrtv]/)) { 58476 // ControlEscape 58477 var codePoint = 0; 58478 switch (res[0]) { 58479 case 't': 58480 codePoint = 0x009;break; 58481 case 'n': 58482 codePoint = 0x00A;break; 58483 case 'v': 58484 codePoint = 0x00B;break; 58485 case 'f': 58486 codePoint = 0x00C;break; 58487 case 'r': 58488 codePoint = 0x00D;break; 58489 } 58490 return createEscaped('singleEscape', codePoint, '\\' + res[0]); 58491 } else if (res = matchReg(/^c([a-zA-Z])/)) { 58492 // c ControlLetter 58493 return createEscaped('controlLetter', res[1].charCodeAt(0) % 32, res[1], 2); 58494 } else if (res = matchReg(/^x([0-9a-fA-F]{2})/)) { 58495 // HexEscapeSequence 58496 return createEscaped('hexadecimalEscape', parseInt(res[1], 16), res[1], 2); 58497 } else if (res = matchReg(/^u([0-9a-fA-F]{4})/)) { 58498 // UnicodeEscapeSequence 58499 return parseUnicodeSurrogatePairEscape(createEscaped('unicodeEscape', parseInt(res[1], 16), res[1], 2)); 58500 } else if (hasUnicodeFlag && (res = matchReg(/^u\{([0-9a-fA-F]+)\}/))) { 58501 // RegExpUnicodeEscapeSequence (ES6 Unicode code point escape) 58502 return createEscaped('unicodeCodePointEscape', parseInt(res[1], 16), res[1], 4); 58503 } else { 58504 // IdentityEscape 58505 return parseIdentityEscape(); 58506 } 58507 } 58508 58509 // Taken from the Esprima parser. 58510 function isIdentifierPart(ch) { 58511 // Generated by `tools/generate-identifier-regex.js`. 58512 var NonAsciiIdentifierPart = new RegExp('[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B2\u08E4-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58\u0C59\u0C60-\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D60-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\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\u135D-\u135F\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\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\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA69D\uA69F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA7AD\uA7B0\uA7B1\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB5F\uAB64\uAB65\uABC0-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFB
58512D3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2D\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]'); 58513 58514 return ch === 36 || ch === 95 || // $ (dollar) and _ (underscore) 58515 ch >= 65 && ch <= 90 || // A..Z 58516 ch >= 97 && ch <= 122 || // a..z 58517 ch >= 48 && ch <= 57 || // 0..9 58518 ch === 92 || // \ (backslash) 58519 ch >= 0x80 && NonAsciiIdentifierPart.test(String.fromCharCode(ch)); 58520 } 58521 58522 function parseIdentityEscape() { 58523 // IdentityEscape :: 58524 // SourceCharacter but not IdentifierPart 58525 // <ZWJ> 58526 // <ZWNJ> 58527 58528 var ZWJ = '\u200C'; 58529 var ZWNJ = '\u200D'; 58530 58531 var tmp; 58532 58533 if (!isIdentifierPart(lookahead())) { 58534 tmp = incr(); 58535 return createEscaped('identifier', tmp.charCodeAt(0), tmp, 1); 58536 } 58537 58538 if (match(ZWJ)) { 58539 // <ZWJ> 58540 return createEscaped('identifier', 0x200C, ZWJ); 58541 } else if (match(ZWNJ)) { 58542 // <ZWNJ> 58543 return createEscaped('identifier', 0x200D, ZWNJ); 58544 } 58545 58546 return null; 58547 } 58548 58549 function parseCharacterClass() { 58550 // CharacterClass :: 58551 // [ [lookahead ∉ {^}] ClassRanges ] 58552 // [ ^ ClassRanges ] 58553 58554 var res, 58555 from = pos; 58556 if (res = matchReg(/^\[\^/)) { 58557 res = parseClassRanges(); 58558 skip(']'); 58559 return createCharacterClass(res, true, from, pos); 58560 } else if (match('[')) { 58561 res = parseClassRanges(); 58562 skip(']'); 58563 return createCharacterClass(res, false, from, pos); 58564 } 58565 58566 return null; 58567 } 58568 58569 function parseClassRanges() { 58570 // ClassRanges :: 58571 // [empty] 58572 // NonemptyClassRanges 58573 58574 var res; 58575 if (current(']')) { 58576 // Empty array means nothing insinde of the ClassRange. 58577 return []; 58578 } else { 58579 res = parseNonemptyClassRanges(); 58580 if (!res) { 58581 bail('nonEmptyClassRanges'); 58582 } 58583 return res; 58584 } 58585 } 58586 58587 function parseHelperClassRanges(atom) { 58588 var from, to, res; 58589 if (current('-') && !next(']')) { 58590 // ClassAtom - ClassAtom ClassRanges 58591 skip('-'); 58592 58593 res = parseClassAtom(); 58594 if (!res) { 58595 bail('classAtom'); 58596 } 58597 to = pos; 58598 var classRanges = parseClassRanges(); 58599 if (!classRanges) { 58600 bail('classRanges'); 58601 } 58602 from = atom.range[0]; 58603 if (classRanges.type === 'empty') { 58604 return [createClassRange(atom, res, from, to)]; 58605 } 58606 return [createClassRange(atom, res, from, to)].concat(classRanges); 58607 } 58608 58609 res = parseNonemptyClassRangesNoDash(); 58610 if (!res) { 58611 bail('nonEmptyClassRangesNoDash'); 58612 } 58613 58614 return [atom].concat(res); 58615 } 58616 58617 function parseNonemptyClassRanges() { 58618 // NonemptyClassRanges :: 58619 // ClassAtom 58620 // ClassAtom NonemptyClassRangesNoDash 58621 // ClassAtom - ClassAtom ClassRanges 58622 58623 var atom = parseClassAtom(); 58624 if (!atom) { 58625 bail('classAtom'); 58626 } 58627 58628 if (current(']')) { 58629 // ClassAtom 58630 return [atom]; 58631 } 58632 58633 // ClassAtom NonemptyClassRangesNoDash 58634 // ClassAtom - ClassAtom ClassRanges 58635 return parseHelperClassRanges(atom); 58636 } 58637 58638 function parseNonemptyClassRangesNoDash() { 58639 // NonemptyClassRangesNoDash :: 58640 // ClassAtom 58641 // ClassAtomNoDash NonemptyClassRangesNoDash 58642 // ClassAtomNoDash - ClassAtom ClassRanges 58643 58644 var res = parseClassAtom(); 58645 if (!res) { 58646 bail('classAtom'); 58647 } 58648 if (current(']')) { 58649 // ClassAtom 58650 return res; 58651 } 58652 58653 // ClassAtomNoDash NonemptyClassRangesNoDash 58654 // ClassAtomNoDash - ClassAtom ClassRanges 58655 return parseHelperClassRanges(res); 58656 } 58657 58658 function parseClassAtom() { 58659 // ClassAtom :: 58660 // - 58661 // ClassAtomNoDash 58662 if (match('-')) { 58663 return createCharacter('-'); 58664 } else { 58665 return parseClassAtomNoDash(); 58666 } 58667 } 58668 58669 function parseClassAtomNoDash() { 58670 // ClassAtomNoDash :: 58671 // SourceCharacter but not one of \ or ] or - 58672 // \ ClassEscape 58673 58674 var res; 58675 if (res = matchReg(/^[^\\\]-]/)) { 58676 return createCharacter(res[0]); 58677 } else if (match('\\')) { 58678 res = parseClassEscape(); 58679 if (!res) { 58680 bail('classEscape'); 58681 } 58682 58683 return parseUnicodeSurrogatePairEscape(res); 58684 } 58685 } 58686 58687 function bail(message, details, from, to) { 58688 from = from == null ? pos : from;
58689 to = to == null ? from : to; 58690 58691 var contextStart = Math.max(0, from - 10); 58692 var contextEnd = Math.min(to + 10, str.length); 58693 58694 // Output a bit of context and a line pointing to where our error is. 58695 // 58696 // We are assuming that there are no actual newlines in the content as this is a regular expression. 58697 var context = ' ' + str.substring(contextStart, contextEnd); 58698 var pointer = ' ' + new Array(from - contextStart + 1).join(' ') + '^'; 58699 58700 throw SyntaxError(message + ' at position ' + from + (details ? ': ' + details : '') + '\n' + context + '\n' + pointer); 58701 } 58702 58703 var backrefDenied = []; 58704 var closedCaptureCounter = 0; 58705 var firstIteration = true; 58706 var hasUnicodeFlag = (flags || "").indexOf("u") !== -1; 58707 var pos = 0; 58708 58709 // Convert the input to a string and treat the empty string special. 58710 str = String(str); 58711 if (str === '') { 58712 str = '(?:)'; 58713 } 58714 58715 var result = parseDisjunction(); 58716 58717 if (result.range[1] !== str.length) { 58718 bail('Could not parse entire input - got stuck', '', result.range[1]); 58719 } 58720 58721 // The spec requires to interpret the `\2` in `/\2()()/` as backreference. 58722 // As the parser collects the number of capture groups as the string is 58723 // parsed it is impossible to make these decisions at the point when the 58724 // `\2` is handled. In case the local decision turns out to be wrong after 58725 // the parsing has finished, the input string is parsed a second time with 58726 // the total number of capture groups set. 58727 // 58728 // SEE: https://github.com/jviereck/regjsparser/issues/70 58729 for (var i = 0; i < backrefDenied.length; i++) { 58730 if (backrefDenied[i] <= closedCaptureCounter) { 58731 // Parse the input a second time. 58732 pos = 0; 58733 firstIteration = false; 58734 return parseDisjunction(); 58735 } 58736 } 58737 58738 return result; 58739 } 58740 58741 var regjsparser = { 58742 parse: parse 58743 }; 58744 58745 if (typeof module !== 'undefined' && module.exports) { 58746 module.exports = regjsparser; 58747 } else { 58748 window.regjsparser = regjsparser; 58749 } 58750 })(); 58751 58752/***/ }, 58753/* 603 */ 58754/***/ function(module, exports, __webpack_require__) { 58755 58756 'use strict'; 58757 58758 var isFinite = __webpack_require__(456); 58759 58760 module.exports = function (str, n) { 58761 if (typeof str !== 'string') { 58762 throw new TypeError('Expected `input` to be a string'); 58763 } 58764 58765 if (n < 0 || !isFinite(n)) { 58766 throw new TypeError('Expected `count` to be a positive finite number'); 58767 } 58768 58769 var ret = ''; 58770 58771 do { 58772 if (n & 1) { 58773 ret += str; 58774 } 58775 58776 str += str; 58777 } while (n >>= 1); 58778 58779 return ret; 58780 }; 58781 58782/***/ }, 58783/* 604 */ 58784/***/ function(module, exports) { 58785 58786 'use strict'; 58787 58788 /* -*- Mode: js; js-indent-level: 2; -*- */ 58789 /* 58790 * Copyright 2011 Mozilla Foundation and contributors 58791 * Licensed under the New BSD license. See LICENSE or: 58792 * http://opensource.org/licenses/BSD-3-Clause 58793 */ 58794 58795 var intToCharMap = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split(''); 58796 58797 /** 58798 * Encode an integer in the range of 0 to 63 to a single base 64 digit. 58799 */ 58800 exports.encode = function (number) { 58801 if (0 <= number && number < intToCharMap.length) { 58802 return intToCharMap[number]; 58803 } 58804 throw new TypeError("Must be between 0 and 63: " + number); 58805 }; 58806 58807 /** 58808 * Decode a single base 64 character code digit to an integer. Returns -1 on 58809 * failure. 58810 */ 58811 exports.decode = function (charCode) { 58812 var bigA = 65; // 'A' 58813 var bigZ = 90; // 'Z' 58814 58815 var littleA = 97; // 'a' 58816 var littleZ = 122; // 'z' 58817 58818 var zero = 48; // '0' 58819 var nine = 57; // '9' 58820 58821 var plus = 43; // '+' 58822 var slash = 47; // '/' 58823 58824 var littleOffset = 26; 58825 var numberOffset = 52; 58826 58827 // 0 - 25: ABCDEFGHIJKLMNOPQRSTUVWXYZ 58828 if (bigA <= charCode && charCode <= bigZ) { 58829 return charCode - bigA; 58830 } 58831 58832 // 26 - 51: abcdefghijklmnopqrstuvwxyz 58833 if (littleA <= charCode && charCode <= littleZ) { 58834 return charCode - littleA + littleOffset; 58835 } 58836 58837 // 52 - 61: 0123456789 58838 if (zero <= charCode && charCode <= nine) { 58839 return charCode - zero + numberOffset; 58840 } 58841 58842 // 62: + 58843 if (charCode == plus) { 58844 return 62; 58845 } 58846 58847 // 63: / 58848 if (charCode == slash) { 58849 return 63; 58850 } 58851 58852 // Invalid base64 digit. 58853 return -1; 58854 }; 58855 58856/***/ }, 58857/* 605 */
vendor: 5,436 bytes, lines 58858-59003
58858/***/ function(module, exports) { 58859 58860 "use strict"; 58861 58862 /* -*- Mode: js; js-indent-level: 2; -*- */ 58863 /* 58864 * Copyright 2011 Mozilla Foundation and contributors 58865 * Licensed under the New BSD license. See LICENSE or: 58866 * http://opensource.org/licenses/BSD-3-Clause 58867 */ 58868 58869 exports.GREATEST_LOWER_BOUND = 1; 58870 exports.LEAST_UPPER_BOUND = 2; 58871 58872 /** 58873 * Recursive implementation of binary search. 58874 * 58875 * @param aLow Indices here and lower do not contain the needle. 58876 * @param aHigh Indices here and higher do not contain the needle. 58877 * @param aNeedle The element being searched for. 58878 * @param aHaystack The non-empty array being searched. 58879 * @param aCompare Function which takes two elements and returns -1, 0, or 1. 58880 * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or 58881 * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the 58882 * closest element that is smaller than or greater than the one we are 58883 * searching for, respectively, if the exact element cannot be found. 58884 */ 58885 function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) { 58886 // This function terminates when one of the following is true: 58887 // 58888 // 1. We find the exact element we are looking for. 58889 // 58890 // 2. We did not find the exact element, but we can return the index of 58891 // the next-closest element. 58892 // 58893 // 3. We did not find the exact element, and there is no next-closest 58894 // element than the one we are searching for, so we return -1. 58895 var mid = Math.floor((aHigh - aLow) / 2) + aLow; 58896 var cmp = aCompare(aNeedle, aHaystack[mid], true); 58897 if (cmp === 0) { 58898 // Found the element we are looking for. 58899 return mid; 58900 } else if (cmp > 0) { 58901 // Our needle is greater than aHaystack[mid]. 58902 if (aHigh - mid > 1) { 58903 // The element is in the upper half. 58904 return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias); 58905 } 58906 58907 // The exact needle element was not found in this haystack. Determine if 58908 // we are in termination case (3) or (2) and return the appropriate thing. 58909 if (aBias == exports.LEAST_UPPER_BOUND) { 58910 return aHigh < aHaystack.length ? aHigh : -1; 58911 } else { 58912 return mid; 58913 } 58914 } else { 58915 // Our needle is less than aHaystack[mid]. 58916 if (mid - aLow > 1) { 58917 // The element is in the lower half. 58918 return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias); 58919 } 58920 58921 // we are in termination case (3) or (2) and return the appropriate thing. 58922 if (aBias == exports.LEAST_UPPER_BOUND) { 58923 return mid; 58924 } else { 58925 return aLow < 0 ? -1 : aLow; 58926 } 58927 } 58928 } 58929 58930 /** 58931 * This is an implementation of binary search which will always try and return 58932 * the index of the closest element if there is no exact hit. This is because 58933 * mappings between original and generated line/col pairs are single points, 58934 * and there is an implicit region between each of them, so a miss just means 58935 * that you aren't on the very start of a region. 58936 * 58937 * @param aNeedle The element you are looking for. 58938 * @param aHaystack The array that is being searched. 58939 * @param aCompare A function which takes the needle and an element in the 58940 * array and returns -1, 0, or 1 depending on whether the needle is less 58941 * than, equal to, or greater than the element, respectively. 58942 * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or 58943 * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the 58944 * closest element that is smaller than or greater than the one we are 58945 * searching for, respectively, if the exact element cannot be found. 58946 * Defaults to 'binarySearch.GREATEST_LOWER_BOUND'. 58947 */ 58948 exports.search = function search(aNeedle, aHaystack, aCompare, aBias) { 58949 if (aHaystack.length === 0) { 58950 return -1; 58951 } 58952 58953 var index = recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack, aCompare, aBias || exports.GREATEST_LOWER_BOUND); 58954 if (index < 0) { 58955 return -1; 58956 } 58957 58958 // We have found either the exact element, or the next-closest element than 58959 // the one we are searching for. However, there may be more than one such 58960 // element. Make sure we always return the smallest of these. 58961 while (index - 1 >= 0) { 58962 if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) { 58963 break; 58964 } 58965 --index; 58966 } 58967 58968 return index; 58969 }; 58970 58971/***/ }, 58972/* 606 */ 58973/***/ function(module, exports, __webpack_require__) { 58974 58975 'use strict'; 58976 58977 /* -*- Mode: js; js-indent-level: 2; -*- */ 58978 /* 58979 * Copyright 2014 Mozilla Foundation and contributors 58980 * Licensed under the New BSD license. See LICENSE or: 58981 * http://opensource.org/licenses/BSD-3-Clause 58982 */ 58983 58984 var util = __webpack_require__(61); 58985 58986 /** 58987 * Determine whether mappingB is after mappingA with respect to generated 58988 * position. 58989 */ 58990 function generatedPositionAfter(mappingA, mappingB) { 58991 // Optimized for most common case 58992 var lineA = mappingA.generatedLine; 58993 var lineB = mappingB.generatedLine; 58994 var columnA = mappingA.generatedColumn; 58995 var columnB = mappingB.generatedColumn; 58996 return lineB > lineA || lineB == lineA && columnB >= columnA || util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0; 58997 } 58998 58999 /** 59000 * A data structure to provide a sorted view of accumulated mappings in a 59001 * performance conscious manner. It trades a neglibable overhead in general 59002 * case for a large speedup in case of mappings being added in order. 59003 */
vendor: 4,887 bytes, lines 59004-59163
59004 function MappingList() { 59005 this._array = []; 59006 this._sorted = true; 59007 // Serves as infimum 59008 this._last = { generatedLine: -1, generatedColumn: 0 }; 59009 } 59010 59011 /** 59012 * Iterate through internal items. This method takes the same arguments that 59013 * `Array.prototype.forEach` takes. 59014 * 59015 * NOTE: The order of the mappings is NOT guaranteed. 59016 */ 59017 MappingList.prototype.unsortedForEach = function MappingList_forEach(aCallback, aThisArg) { 59018 this._array.forEach(aCallback, aThisArg); 59019 }; 59020 59021 /** 59022 * Add the given source mapping. 59023 * 59024 * @param Object aMapping 59025 */ 59026 MappingList.prototype.add = function MappingList_add(aMapping) { 59027 if (generatedPositionAfter(this._last, aMapping)) { 59028 this._last = aMapping; 59029 this._array.push(aMapping); 59030 } else { 59031 this._sorted = false; 59032 this._array.push(aMapping); 59033 } 59034 }; 59035 59036 /** 59037 * Returns the flat, sorted array of mappings. The mappings are sorted by 59038 * generated position. 59039 * 59040 * WARNING: This method returns internal data without copying, for 59041 * performance. The return value must NOT be mutated, and should be treated as 59042 * an immutable borrow. If you want to take ownership, you must make your own 59043 * copy. 59044 */ 59045 MappingList.prototype.toArray = function MappingList_toArray() { 59046 if (!this._sorted) { 59047 this._array.sort(util.compareByGeneratedPositionsInflated); 59048 this._sorted = true; 59049 } 59050 return this._array; 59051 }; 59052 59053 exports.MappingList = MappingList; 59054 59055/***/ }, 59056/* 607 */ 59057/***/ function(module, exports) { 59058 59059 "use strict"; 59060 59061 /* -*- Mode: js; js-indent-level: 2; -*- */ 59062 /* 59063 * Copyright 2011 Mozilla Foundation and contributors 59064 * Licensed under the New BSD license. See LICENSE or: 59065 * http://opensource.org/licenses/BSD-3-Clause 59066 */ 59067 59068 // It turns out that some (most?) JavaScript engines don't self-host 59069 // `Array.prototype.sort`. This makes sense because C++ will likely remain 59070 // faster than JS when doing raw CPU-intensive sorting. However, when using a 59071 // custom comparator function, calling back and forth between the VM's C++ and 59072 // JIT'd JS is rather slow *and* loses JIT type information, resulting in 59073 // worse generated code for the comparator function than would be optimal. In 59074 // fact, when sorting with a comparator, these costs outweigh the benefits of 59075 // sorting in C++. By using our own JS-implemented Quick Sort (below), we get 59076 // a ~3500ms mean speed-up in `bench/bench.html`. 59077 59078 /** 59079 * Swap the elements indexed by `x` and `y` in the array `ary`. 59080 * 59081 * @param {Array} ary 59082 * The array. 59083 * @param {Number} x 59084 * The index of the first item. 59085 * @param {Number} y 59086 * The index of the second item. 59087 */ 59088 function swap(ary, x, y) { 59089 var temp = ary[x]; 59090 ary[x] = ary[y]; 59091 ary[y] = temp; 59092 } 59093 59094 /** 59095 * Returns a random integer within the range `low .. high` inclusive. 59096 * 59097 * @param {Number} low 59098 * The lower bound on the range. 59099 * @param {Number} high 59100 * The upper bound on the range. 59101 */ 59102 function randomIntInRange(low, high) { 59103 return Math.round(low + Math.random() * (high - low)); 59104 } 59105 59106 /** 59107 * The Quick Sort algorithm. 59108 * 59109 * @param {Array} ary 59110 * An array to sort. 59111 * @param {function} comparator 59112 * Function to use to compare two items. 59113 * @param {Number} p 59114 * Start index of the array 59115 * @param {Number} r 59116 * End index of the array 59117 */ 59118 function doQuickSort(ary, comparator, p, r) { 59119 // If our lower bound is less than our upper bound, we (1) partition the 59120 // array into two pieces and (2) recurse on each half. If it is not, this is 59121 // the empty array and our base case. 59122 59123 if (p < r) { 59124 // (1) Partitioning. 59125 // 59126 // The partitioning chooses a pivot between `p` and `r` and moves all 59127 // elements that are less than or equal to the pivot to the before it, and 59128 // all the elements that are greater than it after it. The effect is that 59129 // once partition is done, the pivot is in the exact place it will be when 59130 // the array is put in sorted order, and it will not need to be moved 59131 // again. This runs in O(n) time. 59132 59133 // Always choose a random pivot so that an input array which is reverse 59134 // sorted does not cause O(n^2) running time. 59135 var pivotIndex = randomIntInRange(p, r); 59136 var i = p - 1; 59137 59138 swap(ary, pivotIndex, r); 59139 var pivot = ary[r]; 59140 59141 // Immediately after `j` is incremented in this loop, the following hold 59142 // true: 59143 // 59144 // * Every element in `ary[p .. i]` is less than or equal to the pivot. 59145 // 59146 // * Every element in `ary[i+1 .. j-1]` is greater than the pivot. 59147 for (var j = p; j < r; j++) { 59148 if (comparator(ary[j], pivot) <= 0) { 59149 i += 1; 59150 swap(ary, i, j); 59151 } 59152 } 59153 59154 swap(ary, i + 1, j); 59155 var q = i + 1; 59156 59157 // (2) Recurse on each half. 59158 59159 doQuickSort(ary, comparator, p, q - 1); 59160 doQuickSort(ary, comparator, q + 1, r); 59161 } 59162 } 59163
59164 /** 59165 * Sort the given array in-place with the given comparator function. 59166 * 59167 * @param {Array} ary 59168 * An array to sort. 59169 * @param {function} comparator 59170 * Function to use to compare two items. 59171 */ 59172 exports.quickSort = function (ary, comparator) { 59173 doQuickSort(ary, comparator, 0, ary.length - 1); 59174 }; 59175 59176/***/ }, 59177/* 608 */ 59178/***/ function(module, exports, __webpack_require__) { 59179 59180 'use strict'; 59181 59182 /* -*- Mode: js; js-indent-level: 2; -*- */ 59183 /* 59184 * Copyright 2011 Mozilla Foundation and contributors 59185 * Licensed under the New BSD license. See LICENSE or: 59186 * http://opensource.org/licenses/BSD-3-Clause 59187 */ 59188 59189 var util = __webpack_require__(61); 59190 var binarySearch = __webpack_require__(605); 59191 var ArraySet = __webpack_require__(282).ArraySet; 59192 var base64VLQ = __webpack_require__(283); 59193 var quickSort = __webpack_require__(607).quickSort; 59194 59195 function SourceMapConsumer(aSourceMap) { 59196 var sourceMap = aSourceMap; 59197 if (typeof aSourceMap === 'string') { 59198 sourceMap = JSON.parse(aSourceMap.replace(/^\)\]\}'/, '')); 59199 } 59200 59201 return sourceMap.sections != null ? new IndexedSourceMapConsumer(sourceMap) : new BasicSourceMapConsumer(sourceMap); 59202 } 59203 59204 SourceMapConsumer.fromSourceMap = function (aSourceMap) { 59205 return BasicSourceMapConsumer.fromSourceMap(aSourceMap); 59206 }; 59207 59208 /** 59209 * The version of the source mapping spec that we are consuming. 59210 */ 59211 SourceMapConsumer.prototype._version = 3; 59212 59213 // `__generatedMappings` and `__originalMappings` are arrays that hold the 59214 // parsed mapping coordinates from the source map's "mappings" attribute. They 59215 // are lazily instantiated, accessed via the `_generatedMappings` and 59216 // `_originalMappings` getters respectively, and we only parse the mappings 59217 // and create these arrays once queried for a source location. We jump through 59218 // these hoops because there can be many thousands of mappings, and parsing 59219 // them is expensive, so we only want to do it if we must. 59220 // 59221 // Each object in the arrays is of the form: 59222 // 59223 // { 59224 // generatedLine: The line number in the generated code, 59225 // generatedColumn: The column number in the generated code, 59226 // source: The path to the original source file that generated this 59227 // chunk of code, 59228 // originalLine: The line number in the original source that 59229 // corresponds to this chunk of generated code, 59230 // originalColumn: The column number in the original source that 59231 // corresponds to this chunk of generated code, 59232 // name: The name of the original symbol which generated this chunk of 59233 // code. 59234 // } 59235 // 59236 // All properties except for `generatedLine` and `generatedColumn` can be 59237 // `null`. 59238 // 59239 // `_generatedMappings` is ordered by the generated positions. 59240 // 59241 // `_originalMappings` is ordered by the original positions. 59242 59243 SourceMapConsumer.prototype.__generatedMappings = null; 59244 Object.defineProperty(SourceMapConsumer.prototype, '_generatedMappings', { 59245 get: function get() { 59246 if (!this.__generatedMappings) { 59247 this._parseMappings(this._mappings, this.sourceRoot); 59248 } 59249 59250 return this.__generatedMappings; 59251 } 59252 }); 59253 59254 SourceMapConsumer.prototype.__originalMappings = null; 59255 Object.defineProperty(SourceMapConsumer.prototype, '_originalMappings', { 59256 get: function get() { 59257 if (!this.__originalMappings) { 59258 this._parseMappings(this._mappings, this.sourceRoot); 59259 } 59260 59261 return this.__originalMappings; 59262 } 59263 }); 59264 59265 SourceMapConsumer.prototype._charIsMappingSeparator = function SourceMapConsumer_charIsMappingSeparator(aStr, index) { 59266 var c = aStr.charAt(index); 59267 return c === ";" || c === ","; 59268 }; 59269 59270 /** 59271 * Parse the mappings in a string in to a data structure which we can easily 59272 * query (the ordered arrays in the `this.__generatedMappings` and 59273 * `this.__originalMappings` properties). 59274 */ 59275 SourceMapConsumer.prototype._parseMappings = function SourceMapConsumer_parseMappings(aStr, aSourceRoot) { 59276 throw new Error("Subclasses must implement _parseMappings"); 59277 }; 59278 59279 SourceMapConsumer.GENERATED_ORDER = 1; 59280 SourceMapConsumer.ORIGINAL_ORDER = 2; 59281 59282 SourceMapConsumer.GREATEST_LOWER_BOUND = 1; 59283 SourceMapConsumer.LEAST_UPPER_BOUND = 2; 59284 59285 /** 59286 * Iterate over each mapping between an original source/line/column and a 59287 * generated line/column in this source map. 59288 * 59289 * @param Function aCallback 59290 * The function that is called with each mapping. 59291 * @param Object aContext 59292 * Optional. If specified, this object will be the value of `this` every 59293 * time that `aCallback` is called. 59294 * @param aOrder 59295 * Either `SourceMapConsumer.GENERATED_ORDER` or 59296 * `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to 59297 * iterate over the mappings sorted by the generated file's line/column 59298 * order or the original's source/line/column order, respectively. Defaults to 59299 * `SourceMapConsumer.GENERATED_ORDER`. 59300 */ 59301 SourceMapConsumer.prototype.eachMapping = function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) { 59302 var context = aContext || null; 59303 var order = aOrder || SourceMapConsumer.GENERATED_ORDER; 59304 59305 var mappings; 59306 switch (order) {
vendor: 8,798 bytes, lines 59307-59516
59307 case SourceMapConsumer.GENERATED_ORDER: 59308 mappings = this._generatedMappings; 59309 break; 59310 case SourceMapConsumer.ORIGINAL_ORDER: 59311 mappings = this._originalMappings; 59312 break; 59313 default: 59314 throw new Error("Unknown order of iteration."); 59315 } 59316 59317 var sourceRoot = this.sourceRoot; 59318 mappings.map(function (mapping) { 59319 var source = mapping.source === null ? null : this._sources.at(mapping.source); 59320 if (source != null && sourceRoot != null) { 59321 source = util.join(sourceRoot, source); 59322 } 59323 return { 59324 source: source, 59325 generatedLine: mapping.generatedLine, 59326 generatedColumn: mapping.generatedColumn, 59327 originalLine: mapping.originalLine, 59328 originalColumn: mapping.originalColumn, 59329 name: mapping.name === null ? null : this._names.at(mapping.name) 59330 }; 59331 }, this).forEach(aCallback, context); 59332 }; 59333 59334 /** 59335 * Returns all generated line and column information for the original source, 59336 * line, and column provided. If no column is provided, returns all mappings 59337 * corresponding to a either the line we are searching for or the next 59338 * closest line that has any mappings. Otherwise, returns all mappings 59339 * corresponding to the given line and either the column we are searching for 59340 * or the next closest column that has any offsets. 59341 * 59342 * The only argument is an object with the following properties: 59343 * 59344 * - source: The filename of the original source. 59345 * - line: The line number in the original source. 59346 * - column: Optional. the column number in the original source. 59347 * 59348 * and an array of objects is returned, each with the following properties: 59349 * 59350 * - line: The line number in the generated source, or null. 59351 * - column: The column number in the generated source, or null. 59352 */ 59353 SourceMapConsumer.prototype.allGeneratedPositionsFor = function SourceMapConsumer_allGeneratedPositionsFor(aArgs) { 59354 var line = util.getArg(aArgs, 'line'); 59355 59356 // When there is no exact match, BasicSourceMapConsumer.prototype._findMapping 59357 // returns the index of the closest mapping less than the needle. By 59358 // setting needle.originalColumn to 0, we thus find the last mapping for 59359 // the given line, provided such a mapping exists. 59360 var needle = { 59361 source: util.getArg(aArgs, 'source'), 59362 originalLine: line, 59363 originalColumn: util.getArg(aArgs, 'column', 0) 59364 }; 59365 59366 if (this.sourceRoot != null) { 59367 needle.source = util.relative(this.sourceRoot, needle.source); 59368 } 59369 if (!this._sources.has(needle.source)) { 59370 return []; 59371 } 59372 needle.source = this._sources.indexOf(needle.source); 59373 59374 var mappings = []; 59375 59376 var index = this._findMapping(needle, this._originalMappings, "originalLine", "originalColumn", util.compareByOriginalPositions, binarySearch.LEAST_UPPER_BOUND); 59377 if (index >= 0) { 59378 var mapping = this._originalMappings[index]; 59379 59380 if (aArgs.column === undefined) { 59381 var originalLine = mapping.originalLine; 59382 59383 // Iterate until either we run out of mappings, or we run into 59384 // a mapping for a different line than the one we found. Since 59385 // mappings are sorted, this is guaranteed to find all mappings for 59386 // the line we found. 59387 while (mapping && mapping.originalLine === originalLine) { 59388 mappings.push({ 59389 line: util.getArg(mapping, 'generatedLine', null), 59390 column: util.getArg(mapping, 'generatedColumn', null), 59391 lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) 59392 }); 59393 59394 mapping = this._originalMappings[++index]; 59395 } 59396 } else { 59397 var originalColumn = mapping.originalColumn; 59398 59399 // Iterate until either we run out of mappings, or we run into 59400 // a mapping for a different line than the one we were searching for. 59401 // Since mappings are sorted, this is guaranteed to find all mappings for 59402 // the line we are searching for. 59403 while (mapping && mapping.originalLine === line && mapping.originalColumn == originalColumn) { 59404 mappings.push({ 59405 line: util.getArg(mapping, 'generatedLine', null), 59406 column: util.getArg(mapping, 'generatedColumn', null), 59407 lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) 59408 }); 59409 59410 mapping = this._originalMappings[++index]; 59411 } 59412 } 59413 } 59414 59415 return mappings; 59416 }; 59417 59418 exports.SourceMapConsumer = SourceMapConsumer; 59419 59420 /** 59421 * A BasicSourceMapConsumer instance represents a parsed source map which we can 59422 * query for information about the original file positions by giving it a file 59423 * position in the generated source. 59424 * 59425 * The only parameter is the raw source map (either as a JSON string, or 59426 * already parsed to an object). According to the spec, source maps have the 59427 * following attributes: 59428 * 59429 * - version: Which version of the source map spec this map is following. 59430 * - sources: An array of URLs to the original source files. 59431 * - names: An array of identifiers which can be referrenced by individual mappings. 59432 * - sourceRoot: Optional. The URL root from which all sources are relative. 59433 * - sourcesContent: Optional. An array of contents of the original source files. 59434 * - mappings: A string of base64 VLQs which contain the actual mappings. 59435 * - file: Optional. The generated file this source map is associated with. 59436 * 59437 * Here is an example source map, taken from the source map spec[0]: 59438 * 59439 * { 59440 * version : 3, 59441 * file: "out.js", 59442 * sourceRoot : "", 59443 * sources: ["foo.js", "bar.js"], 59444 * names: ["src", "maps", "are", "fun"], 59445 * mappings: "AA,AB;;ABCDE;" 59446 * } 59447 * 59448 * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit?pli=1# 59449 */ 59450 function BasicSourceMapConsumer(aSourceMap) { 59451 var sourceMap = aSourceMap; 59452 if (typeof aSourceMap === 'string') { 59453 sourceMap = JSON.parse(aSourceMap.replace(/^\)\]\}'/, '')); 59454 } 59455 59456 var version = util.getArg(sourceMap, 'version'); 59457 var sources = util.getArg(sourceMap, 'sources'); 59458 // Sass 3.3 leaves out the 'names' array, so we deviate from the spec (which 59459 // requires the array) to play nice here. 59460 var names = util.getArg(sourceMap, 'names', []); 59461 var sourceRoot = util.getArg(sourceMap, 'sourceRoot', null); 59462 var sourcesContent = util.getArg(sourceMap, 'sourcesContent', null); 59463 var mappings = util.getArg(sourceMap, 'mappings'); 59464 var file = util.getArg(sourceMap, 'file', null); 59465 59466 // Once again, Sass deviates from the spec and supplies the version as a 59467 // string rather than a number, so we use loose equality checking here. 59468 if (version != this._version) { 59469 throw new Error('Unsupported version: ' + version); 59470 } 59471 59472 sources = sources.map(String) 59473 // Some source maps produce relative source paths like "./foo.js" instead of 59474 // "foo.js". Normalize these first so that future comparisons will succeed. 59475 // See bugzil.la/1090768. 59476 .map(util.normalize) 59477 // Always ensure that absolute sources are internally stored relative to 59478 // the source root, if the source root is absolute. Not doing this would 59479 // be particularly problematic when the source root is a prefix of the 59480 // source (valid, but why??). See github issue #199 and bugzil.la/1188982. 59481 .map(function (source) { 59482 return sourceRoot && util.isAbsolute(sourceRoot) && util.isAbsolute(source) ? util.relative(sourceRoot, source) : source; 59483 }); 59484 59485 // Pass `true` below to allow duplicate names and sources. While source maps 59486 // are intended to be compressed and deduplicated, the TypeScript compiler 59487 // sometimes generates source maps with duplicates in them. See Github issue 59488 // #72 and bugzil.la/889492. 59489 this._names = ArraySet.fromArray(names.map(String), true); 59490 this._sources = ArraySet.fromArray(sources, true); 59491 59492 this.sourceRoot = sourceRoot; 59493 this.sourcesContent = sourcesContent; 59494 this._mappings = mappings; 59495 this.file = file; 59496 } 59497 59498 BasicSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype); 59499 BasicSourceMapConsumer.prototype.consumer = SourceMapConsumer; 59500 59501 /** 59502 * Create a BasicSourceMapConsumer from a SourceMapGenerator. 59503 * 59504 * @param SourceMapGenerator aSourceMap 59505 * The source map that will be consumed. 59506 * @returns BasicSourceMapConsumer 59507 */ 59508 BasicSourceMapConsumer.fromSourceMap = function SourceMapConsumer_fromSourceMap(aSourceMap) { 59509 var smc = Object.create(BasicSourceMapConsumer.prototype); 59510 59511 var names = smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true); 59512 var sources = smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true); 59513 smc.sourceRoot = aSourceMap._sourceRoot; 59514 smc.sourcesContent = aSourceMap._generateSourcesContent(smc._sources.toArray(), smc.sourceRoot); 59515 smc.file = aSourceMap._file; 59516
vendor: 8,304 bytes, lines 59517-59752
59517 // Because we are modifying the entries (by converting string sources and 59518 // names to indices into the sources and names ArraySets), we have to make 59519 // a copy of the entry or else bad things happen. Shared mutable state 59520 // strikes again! See github issue #191. 59521 59522 var generatedMappings = aSourceMap._mappings.toArray().slice(); 59523 var destGeneratedMappings = smc.__generatedMappings = []; 59524 var destOriginalMappings = smc.__originalMappings = []; 59525 59526 for (var i = 0, length = generatedMappings.length; i < length; i++) { 59527 var srcMapping = generatedMappings[i]; 59528 var destMapping = new Mapping(); 59529 destMapping.generatedLine = srcMapping.generatedLine; 59530 destMapping.generatedColumn = srcMapping.generatedColumn; 59531 59532 if (srcMapping.source) { 59533 destMapping.source = sources.indexOf(srcMapping.source); 59534 destMapping.originalLine = srcMapping.originalLine; 59535 destMapping.originalColumn = srcMapping.originalColumn; 59536 59537 if (srcMapping.name) { 59538 destMapping.name = names.indexOf(srcMapping.name); 59539 } 59540 59541 destOriginalMappings.push(destMapping); 59542 } 59543 59544 destGeneratedMappings.push(destMapping); 59545 } 59546 59547 quickSort(smc.__originalMappings, util.compareByOriginalPositions); 59548 59549 return smc; 59550 }; 59551 59552 /** 59553 * The version of the source mapping spec that we are consuming. 59554 */ 59555 BasicSourceMapConsumer.prototype._version = 3; 59556 59557 /** 59558 * The list of original sources. 59559 */ 59560 Object.defineProperty(BasicSourceMapConsumer.prototype, 'sources', { 59561 get: function get() { 59562 return this._sources.toArray().map(function (s) { 59563 return this.sourceRoot != null ? util.join(this.sourceRoot, s) : s; 59564 }, this); 59565 } 59566 }); 59567 59568 /** 59569 * Provide the JIT with a nice shape / hidden class. 59570 */ 59571 function Mapping() { 59572 this.generatedLine = 0; 59573 this.generatedColumn = 0; 59574 this.source = null; 59575 this.originalLine = null; 59576 this.originalColumn = null; 59577 this.name = null; 59578 } 59579 59580 /** 59581 * Parse the mappings in a string in to a data structure which we can easily 59582 * query (the ordered arrays in the `this.__generatedMappings` and 59583 * `this.__originalMappings` properties). 59584 */ 59585 BasicSourceMapConsumer.prototype._parseMappings = function SourceMapConsumer_parseMappings(aStr, aSourceRoot) { 59586 var generatedLine = 1; 59587 var previousGeneratedColumn = 0; 59588 var previousOriginalLine = 0; 59589 var previousOriginalColumn = 0; 59590 var previousSource = 0; 59591 var previousName = 0; 59592 var length = aStr.length; 59593 var index = 0; 59594 var cachedSegments = {}; 59595 var temp = {}; 59596 var originalMappings = []; 59597 var generatedMappings = []; 59598 var mapping, str, segment, end, value; 59599 59600 while (index < length) { 59601 if (aStr.charAt(index) === ';') { 59602 generatedLine++; 59603 index++; 59604 previousGeneratedColumn = 0; 59605 } else if (aStr.charAt(index) === ',') { 59606 index++; 59607 } else { 59608 mapping = new Mapping(); 59609 mapping.generatedLine = generatedLine; 59610 59611 // Because each offset is encoded relative to the previous one, 59612 // many segments often have the same encoding. We can exploit this 59613 // fact by caching the parsed variable length fields of each segment, 59614 // allowing us to avoid a second parse if we encounter the same 59615 // segment again. 59616 for (end = index; end < length; end++) { 59617 if (this._charIsMappingSeparator(aStr, end)) { 59618 break; 59619 } 59620 } 59621 str = aStr.slice(index, end); 59622 59623 segment = cachedSegments[str]; 59624 if (segment) { 59625 index += str.length; 59626 } else { 59627 segment = []; 59628 while (index < end) { 59629 base64VLQ.decode(aStr, index, temp); 59630 value = temp.value; 59631 index = temp.rest; 59632 segment.push(value); 59633 } 59634 59635 if (segment.length === 2) { 59636 throw new Error('Found a source, but no line and column'); 59637 } 59638 59639 if (segment.length === 3) { 59640 throw new Error('Found a source and line, but no column'); 59641 } 59642 59643 cachedSegments[str] = segment; 59644 } 59645 59646 // Generated column. 59647 mapping.generatedColumn = previousGeneratedColumn + segment[0]; 59648 previousGeneratedColumn = mapping.generatedColumn; 59649 59650 if (segment.length > 1) { 59651 // Original source. 59652 mapping.source = previousSource + segment[1]; 59653 previousSource += segment[1]; 59654 59655 // Original line. 59656 mapping.originalLine = previousOriginalLine + segment[2]; 59657 previousOriginalLine = mapping.originalLine; 59658 // Lines are stored 0-based 59659 mapping.originalLine += 1; 59660 59661 // Original column. 59662 mapping.originalColumn = previousOriginalColumn + segment[3]; 59663 previousOriginalColumn = mapping.originalColumn; 59664 59665 if (segment.length > 4) { 59666 // Original name. 59667 mapping.name = previousName + segment[4]; 59668 previousName += segment[4]; 59669 } 59670 } 59671 59672 generatedMappings.push(mapping); 59673 if (typeof mapping.originalLine === 'number') { 59674 originalMappings.push(mapping); 59675 } 59676 } 59677 } 59678 59679 quickSort(generatedMappings, util.compareByGeneratedPositionsDeflated); 59680 this.__generatedMappings = generatedMappings; 59681 59682 quickSort(originalMappings, util.compareByOriginalPositions); 59683 this.__originalMappings = originalMappings; 59684 }; 59685 59686 /** 59687 * Find the mapping that best matches the hypothetical "needle" mapping that 59688 * we are searching for in the given "haystack" of mappings. 59689 */ 59690 BasicSourceMapConsumer.prototype._findMapping = function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName, aColumnName, aComparator, aBias) { 59691 // To return the position we are searching for, we must first find the 59692 // mapping for the given position and then return the opposite position it 59693 // points to. Because the mappings are sorted, we can use binary search to 59694 // find the best mapping. 59695 59696 if (aNeedle[aLineName] <= 0) { 59697 throw new TypeError('Line must be greater than or equal to 1, got ' + aNeedle[aLineName]); 59698 } 59699 if (aNeedle[aColumnName] < 0) { 59700 throw new TypeError('Column must be greater than or equal to 0, got ' + aNeedle[aColumnName]); 59701 } 59702 59703 return binarySearch.search(aNeedle, aMappings, aComparator, aBias); 59704 }; 59705 59706 /** 59707 * Compute the last column for each generated mapping. The last column is 59708 * inclusive. 59709 */ 59710 BasicSourceMapConsumer.prototype.computeColumnSpans = function SourceMapConsumer_computeColumnSpans() { 59711 for (var index = 0; index < this._generatedMappings.length; ++index) { 59712 var mapping = this._generatedMappings[index]; 59713 59714 // Mappings do not contain a field for the last generated columnt. We 59715 // can come up with an optimistic estimate, however, by assuming that 59716 // mappings are contiguous (i.e. given two consecutive mappings, the 59717 // first mapping ends where the second one starts). 59718 if (index + 1 < this._generatedMappings.length) { 59719 var nextMapping = this._generatedMappings[index + 1]; 59720 59721 if (mapping.generatedLine === nextMapping.generatedLine) { 59722 mapping.lastGeneratedColumn = nextMapping.generatedColumn - 1; 59723 continue; 59724 } 59725 } 59726 59727 // The last mapping for each line spans the entire line. 59728 mapping.lastGeneratedColumn = Infinity; 59729 } 59730 }; 59731 59732 /** 59733 * Returns the original source, line, and column information for the generated 59734 * source's line and column positions provided. The only argument is an object 59735 * with the following properties: 59736 * 59737 * - line: The line number in the generated source. 59738 * - column: The column number in the generated source. 59739 * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or 59740 * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the 59741 * closest element that is smaller than or greater than the one we are 59742 * searching for, respectively, if the exact element cannot be found. 59743 * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'. 59744 * 59745 * and an object is returned with the following properties: 59746 * 59747 * - source: The original source file, or null. 59748 * - line: The line number in the original source, or null. 59749 * - column: The column number in the original source, or null. 59750 * - name: The original identifier, or null. 59751 */ 59752 BasicSourceMapConsumer.prototype.originalPositionFor = function SourceMapConsumer_originalPositionFor(
vendor: 4,308 bytes, lines 59752-59869
59752aArgs) { 59753 var needle = { 59754 generatedLine: util.getArg(aArgs, 'line'), 59755 generatedColumn: util.getArg(aArgs, 'column') 59756 }; 59757 59758 var index = this._findMapping(needle, this._generatedMappings, "generatedLine", "generatedColumn", util.compareByGeneratedPositionsDeflated, util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND)); 59759 59760 if (index >= 0) { 59761 var mapping = this._generatedMappings[index]; 59762 59763 if (mapping.generatedLine === needle.generatedLine) { 59764 var source = util.getArg(mapping, 'source', null); 59765 if (source !== null) { 59766 source = this._sources.at(source); 59767 if (this.sourceRoot != null) { 59768 source = util.join(this.sourceRoot, source); 59769 } 59770 } 59771 var name = util.getArg(mapping, 'name', null); 59772 if (name !== null) { 59773 name = this._names.at(name); 59774 } 59775 return { 59776 source: source, 59777 line: util.getArg(mapping, 'originalLine', null), 59778 column: util.getArg(mapping, 'originalColumn', null), 59779 name: name 59780 }; 59781 } 59782 } 59783 59784 return { 59785 source: null, 59786 line: null, 59787 column: null, 59788 name: null 59789 }; 59790 }; 59791 59792 /** 59793 * Return true if we have the source content for every source in the source 59794 * map, false otherwise. 59795 */ 59796 BasicSourceMapConsumer.prototype.hasContentsOfAllSources = function BasicSourceMapConsumer_hasContentsOfAllSources() { 59797 if (!this.sourcesContent) { 59798 return false; 59799 } 59800 return this.sourcesContent.length >= this._sources.size() && !this.sourcesContent.some(function (sc) { 59801 return sc == null; 59802 }); 59803 }; 59804 59805 /** 59806 * Returns the original source content. The only argument is the url of the 59807 * original source file. Returns null if no original source content is 59808 * available. 59809 */ 59810 BasicSourceMapConsumer.prototype.sourceContentFor = function SourceMapConsumer_sourceContentFor(aSource, nullOnMissing) { 59811 if (!this.sourcesContent) { 59812 return null; 59813 } 59814 59815 if (this.sourceRoot != null) { 59816 aSource = util.relative(this.sourceRoot, aSource); 59817 } 59818 59819 if (this._sources.has(aSource)) { 59820 return this.sourcesContent[this._sources.indexOf(aSource)]; 59821 } 59822 59823 var url; 59824 if (this.sourceRoot != null && (url = util.urlParse(this.sourceRoot))) { 59825 // XXX: file:// URIs and absolute paths lead to unexpected behavior for 59826 // many users. We can help them out when they expect file:// URIs to 59827 // behave like it would if they were running a local HTTP server. See 59828 // https://bugzilla.mozilla.org/show_bug.cgi?id=885597. 59829 var fileUriAbsPath = aSource.replace(/^file:\/\//, ""); 59830 if (url.scheme == "file" && this._sources.has(fileUriAbsPath)) { 59831 return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)]; 59832 } 59833 59834 if ((!url.path || url.path == "/") && this._sources.has("/" + aSource)) { 59835 return this.sourcesContent[this._sources.indexOf("/" + aSource)]; 59836 } 59837 } 59838 59839 // This function is used recursively from 59840 // IndexedSourceMapConsumer.prototype.sourceContentFor. In that case, we 59841 // don't want to throw if we can't find the source - we just want to 59842 // return null, so we provide a flag to exit gracefully. 59843 if (nullOnMissing) { 59844 return null; 59845 } else { 59846 throw new Error('"' + aSource + '" is not in the SourceMap.'); 59847 } 59848 }; 59849 59850 /** 59851 * Returns the generated line and column information for the original source, 59852 * line, and column positions provided. The only argument is an object with 59853 * the following properties: 59854 * 59855 * - source: The filename of the original source. 59856 * - line: The line number in the original source. 59857 * - column: The column number in the original source. 59858 * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or 59859 * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the 59860 * closest element that is smaller than or greater than the one we are 59861 * searching for, respectively, if the exact element cannot be found. 59862 * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'. 59863 * 59864 * and an object is returned with the following properties: 59865 * 59866 * - line: The line number in the generated source, or null. 59867 * - column: The column number in the generated source, or null. 59868 */ 59869 BasicSourceMapConsumer.prototype.generatedPositionFor = function SourceMapConsumer_generatedPositionFor(
vendor: 12,085 bytes, lines 59869-60216
59869aArgs) { 59870 var source = util.getArg(aArgs, 'source'); 59871 if (this.sourceRoot != null) { 59872 source = util.relative(this.sourceRoot, source); 59873 } 59874 if (!this._sources.has(source)) { 59875 return { 59876 line: null, 59877 column: null, 59878 lastColumn: null 59879 }; 59880 } 59881 source = this._sources.indexOf(source); 59882 59883 var needle = { 59884 source: source, 59885 originalLine: util.getArg(aArgs, 'line'), 59886 originalColumn: util.getArg(aArgs, 'column') 59887 }; 59888 59889 var index = this._findMapping(needle, this._originalMappings, "originalLine", "originalColumn", util.compareByOriginalPositions, util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND)); 59890 59891 if (index >= 0) { 59892 var mapping = this._originalMappings[index]; 59893 59894 if (mapping.source === needle.source) { 59895 return { 59896 line: util.getArg(mapping, 'generatedLine', null), 59897 column: util.getArg(mapping, 'generatedColumn', null), 59898 lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) 59899 }; 59900 } 59901 } 59902 59903 return { 59904 line: null, 59905 column: null, 59906 lastColumn: null 59907 }; 59908 }; 59909 59910 exports.BasicSourceMapConsumer = BasicSourceMapConsumer; 59911 59912 /** 59913 * An IndexedSourceMapConsumer instance represents a parsed source map which 59914 * we can query for information. It differs from BasicSourceMapConsumer in 59915 * that it takes "indexed" source maps (i.e. ones with a "sections" field) as 59916 * input. 59917 * 59918 * The only parameter is a raw source map (either as a JSON string, or already 59919 * parsed to an object). According to the spec for indexed source maps, they 59920 * have the following attributes: 59921 * 59922 * - version: Which version of the source map spec this map is following. 59923 * - file: Optional. The generated file this source map is associated with. 59924 * - sections: A list of section definitions. 59925 * 59926 * Each value under the "sections" field has two fields: 59927 * - offset: The offset into the original specified at which this section 59928 * begins to apply, defined as an object with a "line" and "column" 59929 * field. 59930 * - map: A source map definition. This source map could also be indexed, 59931 * but doesn't have to be. 59932 * 59933 * Instead of the "map" field, it's also possible to have a "url" field 59934 * specifying a URL to retrieve a source map from, but that's currently 59935 * unsupported. 59936 * 59937 * Here's an example source map, taken from the source map spec[0], but 59938 * modified to omit a section which uses the "url" field. 59939 * 59940 * { 59941 * version : 3, 59942 * file: "app.js", 59943 * sections: [{ 59944 * offset: {line:100, column:10}, 59945 * map: { 59946 * version : 3, 59947 * file: "section.js", 59948 * sources: ["foo.js", "bar.js"], 59949 * names: ["src", "maps", "are", "fun"], 59950 * mappings: "AAAA,E;;ABCDE;" 59951 * } 59952 * }], 59953 * } 59954 * 59955 * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit#heading=h.535es3xeprgt 59956 */ 59957 function IndexedSourceMapConsumer(aSourceMap) { 59958 var sourceMap = aSourceMap; 59959 if (typeof aSourceMap === 'string') { 59960 sourceMap = JSON.parse(aSourceMap.replace(/^\)\]\}'/, '')); 59961 } 59962 59963 var version = util.getArg(sourceMap, 'version'); 59964 var sections = util.getArg(sourceMap, 'sections'); 59965 59966 if (version != this._version) { 59967 throw new Error('Unsupported version: ' + version); 59968 } 59969 59970 this._sources = new ArraySet(); 59971 this._names = new ArraySet(); 59972 59973 var lastOffset = { 59974 line: -1, 59975 column: 0 59976 }; 59977 this._sections = sections.map(function (s) { 59978 if (s.url) { 59979 // The url field will require support for asynchronicity. 59980 // See https://github.com/mozilla/source-map/issues/16 59981 throw new Error('Support for url field in sections not implemented.'); 59982 } 59983 var offset = util.getArg(s, 'offset'); 59984 var offsetLine = util.getArg(offset, 'line'); 59985 var offsetColumn = util.getArg(offset, 'column'); 59986 59987 if (offsetLine < lastOffset.line || offsetLine === lastOffset.line && offsetColumn < lastOffset.column) { 59988 throw new Error('Section offsets must be ordered and non-overlapping.'); 59989 } 59990 lastOffset = offset; 59991 59992 return { 59993 generatedOffset: { 59994 // The offset fields are 0-based, but we use 1-based indices when 59995 // encoding/decoding from VLQ. 59996 generatedLine: offsetLine + 1, 59997 generatedColumn: offsetColumn + 1 59998 }, 59999 consumer: new SourceMapConsumer(util.getArg(s, 'map')) 60000 }; 60001 }); 60002 } 60003 60004 IndexedSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype); 60005 IndexedSourceMapConsumer.prototype.constructor = SourceMapConsumer; 60006 60007 /** 60008 * The version of the source mapping spec that we are consuming. 60009 */ 60010 IndexedSourceMapConsumer.prototype._version = 3; 60011 60012 /** 60013 * The list of original sources. 60014 */ 60015 Object.defineProperty(IndexedSourceMapConsumer.prototype, 'sources', { 60016 get: function get() { 60017 var sources = []; 60018 for (var i = 0; i < this._sections.length; i++) { 60019 for (var j = 0; j < this._sections[i].consumer.sources.length; j++) { 60020 sources.push(this._sections[i].consumer.sources[j]); 60021 } 60022 } 60023 return sources; 60024 } 60025 }); 60026 60027 /** 60028 * Returns the original source, line, and column information for the generated 60029 * source's line and column positions provided. The only argument is an object 60030 * with the following properties: 60031 * 60032 * - line: The line number in the generated source. 60033 * - column: The column number in the generated source. 60034 * 60035 * and an object is returned with the following properties: 60036 * 60037 * - source: The original source file, or null. 60038 * - line: The line number in the original source, or null. 60039 * - column: The column number in the original source, or null. 60040 * - name: The original identifier, or null. 60041 */ 60042 IndexedSourceMapConsumer.prototype.originalPositionFor = function IndexedSourceMapConsumer_originalPositionFor(aArgs) { 60043 var needle = { 60044 generatedLine: util.getArg(aArgs, 'line'), 60045 generatedColumn: util.getArg(aArgs, 'column') 60046 }; 60047 60048 // Find the section containing the generated position we're trying to map 60049 // to an original position. 60050 var sectionIndex = binarySearch.search(needle, this._sections, function (needle, section) { 60051 var cmp = needle.generatedLine - section.generatedOffset.generatedLine; 60052 if (cmp) { 60053 return cmp; 60054 } 60055 60056 return needle.generatedColumn - section.generatedOffset.generatedColumn; 60057 }); 60058 var section = this._sections[sectionIndex]; 60059 60060 if (!section) { 60061 return { 60062 source: null, 60063 line: null, 60064 column: null, 60065 name: null 60066 }; 60067 } 60068 60069 return section.consumer.originalPositionFor({ 60070 line: needle.generatedLine - (section.generatedOffset.generatedLine - 1), 60071 column: needle.generatedColumn - (section.generatedOffset.generatedLine === needle.generatedLine ? section.generatedOffset.generatedColumn - 1 : 0), 60072 bias: aArgs.bias 60073 }); 60074 }; 60075 60076 /** 60077 * Return true if we have the source content for every source in the source 60078 * map, false otherwise. 60079 */ 60080 IndexedSourceMapConsumer.prototype.hasContentsOfAllSources = function IndexedSourceMapConsumer_hasContentsOfAllSources() { 60081 return this._sections.every(function (s) { 60082 return s.consumer.hasContentsOfAllSources(); 60083 }); 60084 }; 60085 60086 /** 60087 * Returns the original source content. The only argument is the url of the 60088 * original source file. Returns null if no original source content is 60089 * available. 60090 */ 60091 IndexedSourceMapConsumer.prototype.sourceContentFor = function IndexedSourceMapConsumer_sourceContentFor(aSource, nullOnMissing) { 60092 for (var i = 0; i < this._sections.length; i++) { 60093 var section = this._sections[i]; 60094 60095 var content = section.consumer.sourceContentFor(aSource, true); 60096 if (content) { 60097 return content; 60098 } 60099 } 60100 if (nullOnMissing) { 60101 return null; 60102 } else { 60103 throw new Error('"' + aSource + '" is not in the SourceMap.'); 60104 } 60105 }; 60106 60107 /** 60108 * Returns the generated line and column information for the original source, 60109 * line, and column positions provided. The only argument is an object with 60110 * the following properties: 60111 * 60112 * - source: The filename of the original source. 60113 * - line: The line number in the original source. 60114 * - column: The column number in the original source. 60115 * 60116 * and an object is returned with the following properties: 60117 * 60118 * - line: The line number in the generated source, or null. 60119 * - column: The column number in the generated source, or null. 60120 */ 60121 IndexedSourceMapConsumer.prototype.generatedPositionFor = function IndexedSourceMapConsumer_generatedPositionFor(aArgs) { 60122 for (var i = 0; i < this._sections.length; i++) { 60123 var section = this._sections[i]; 60124 60125 // Only consider this section if the requested source is in the list of 60126 // sources of the consumer. 60127 if (section.consumer.sources.indexOf(util.getArg(aArgs, 'source')) === -1) { 60128 continue; 60129 } 60130 var generatedPosition = section.consumer.generatedPositionFor(aArgs); 60131 if (generatedPosition) { 60132 var ret = { 60133 line: generatedPosition.line + (section.generatedOffset.generatedLine - 1), 60134 column: generatedPosition.column + (section.generatedOffset.generatedLine === generatedPosition.line ? section.generatedOffset.generatedColumn - 1 : 0) 60135 }; 60136 return ret; 60137 } 60138 } 60139 60140 return { 60141 line: null, 60142 column: null 60143 }; 60144 }; 60145 60146 /** 60147 * Parse the mappings in a string in to a data structure which we can easily 60148 * query (the ordered arrays in the `this.__generatedMappings` and 60149 * `this.__originalMappings` properties). 60150 */ 60151 IndexedSourceMapConsumer.prototype._parseMappings = function IndexedSourceMapConsumer_parseMappings(aStr, aSourceRoot) { 60152 this.__generatedMappings = []; 60153 this.__originalMappings = []; 60154 for (var i = 0; i < this._sections.length; i++) { 60155 var section = this._sections[i]; 60156 var sectionMappings = section.consumer._generatedMappings; 60157 for (var j = 0; j < sectionMappings.length; j++) { 60158 var mapping = sectionMappings[j]; 60159 60160 var source = section.consumer._sources.at(mapping.source); 60161 if (section.consumer.sourceRoot !== null) { 60162 source = util.join(section.consumer.sourceRoot, source); 60163 } 60164 this._sources.add(source); 60165 source = this._sources.indexOf(source); 60166 60167 var name = section.consumer._names.at(mapping.name); 60168 this._names.add(name); 60169 name = this._names.indexOf(name); 60170 60171 // The mappings coming from the consumer for the section have 60172 // generated positions relative to the start of the section, so we 60173 // need to offset them to be relative to the start of the concatenated 60174 // generated file. 60175 var adjustedMapping = { 60176 source: source, 60177 generatedLine: mapping.generatedLine + (section.generatedOffset.generatedLine - 1), 60178 generatedColumn: mapping.generatedColumn + (section.generatedOffset.generatedLine === mapping.generatedLine ? section.generatedOffset.generatedColumn - 1 : 0), 60179 originalLine: mapping.originalLine, 60180 originalColumn: mapping.originalColumn, 60181 name: name 60182 }; 60183 60184 this.__generatedMappings.push(adjustedMapping); 60185 if (typeof adjustedMapping.originalLine === 'number') { 60186 this.__originalMappings.push(adjustedMapping); 60187 } 60188 } 60189 } 60190 60191 quickSort(this.__generatedMappings, util.compareByGeneratedPositionsDeflated); 60192 quickSort(this.__originalMappings, util.compareByOriginalPositions); 60193 }; 60194 60195 exports.IndexedSourceMapConsumer = IndexedSourceMapConsumer; 60196 60197/***/ }, 60198/* 609 */ 60199/***/ function(module, exports, __webpack_require__) { 60200 60201 'use strict'; 60202 60203 /* -*- Mode: js; js-indent-level: 2; -*- */ 60204 /* 60205 * Copyright 2011 Mozilla Foundation and contributors 60206 * Licensed under the New BSD license. See LICENSE or: 60207 * http://opensource.org/licenses/BSD-3-Clause 60208 */ 60209 60210 var SourceMapGenerator = __webpack_require__(284).SourceMapGenerator; 60211 var util = __webpack_require__(61); 60212 60213 // Matches a Windows-style `\r\n` newline or a `\n` newline used by all other 60214 // operating systems these days (capturing the result). 60215 var REGEX_NEWLINE = /(\r?\n)/; 60216
60217 // Newline character code for charCodeAt() comparisons 60218 var NEWLINE_CODE = 10; 60219 60220 // Private symbol for identifying `SourceNode`s when multiple versions of 60221 // the source-map library are loaded. This MUST NOT CHANGE across 60222 // versions! 60223 var isSourceNode = "$$$isSourceNode$$$"; 60224 60225 /** 60226 * SourceNodes provide a way to abstract over interpolating/concatenating 60227 * snippets of generated JavaScript source code while maintaining the line and 60228 * column information associated with the original source code. 60229 * 60230 * @param aLine The original line number. 60231 * @param aColumn The original column number. 60232 * @param aSource The original source's filename. 60233 * @param aChunks Optional. An array of strings which are snippets of 60234 * generated JS, or other SourceNodes. 60235 * @param aName The original identifier. 60236 */ 60237 function SourceNode(aLine, aColumn, aSource, aChunks, aName) { 60238 this.children = []; 60239 this.sourceContents = {}; 60240 this.line = aLine == null ? null : aLine; 60241 this.column = aColumn == null ? null : aColumn; 60242 this.source = aSource == null ? null : aSource; 60243 this.name = aName == null ? null : aName; 60244 this[isSourceNode] = true; 60245 if (aChunks != null) this.add(aChunks); 60246 } 60247 60248 /** 60249 * Creates a SourceNode from generated code and a SourceMapConsumer. 60250 * 60251 * @param aGeneratedCode The generated code 60252 * @param aSourceMapConsumer The SourceMap for the generated code 60253 * @param aRelativePath Optional. The path that relative sources in the 60254 * SourceMapConsumer should be relative to. 60255 */ 60256 SourceNode.fromStringWithSourceMap = function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer, aRelativePath) { 60257 // The SourceNode we want to fill with the generated code 60258 // and the SourceMap 60259 var node = new SourceNode(); 60260 60261 // All even indices of this array are one line of the generated code, 60262 // while all odd indices are the newlines between two adjacent lines 60263 // (since `REGEX_NEWLINE` captures its match). 60264 // Processed fragments are removed from this array, by calling `shiftNextLine`. 60265 var remainingLines = aGeneratedCode.split(REGEX_NEWLINE); 60266 var shiftNextLine = function shiftNextLine() { 60267 var lineContents = remainingLines.shift(); 60268 // The last line of a file might not have a newline. 60269 var newLine = remainingLines.shift() || ""; 60270 return lineContents + newLine; 60271 }; 60272 60273 // We need to remember the position of "remainingLines" 60274 var lastGeneratedLine = 1, 60275 lastGeneratedColumn = 0; 60276 60277 // The generate SourceNodes we need a code range. 60278 // To extract it current and last mapping is used. 60279 // Here we store the last mapping. 60280 var lastMapping = null; 60281 60282 aSourceMapConsumer.eachMapping(function (mapping) { 60283 if (lastMapping !== null) { 60284 // We add the code from "lastMapping" to "mapping": 60285 // First check if there is a new line in between. 60286 if (lastGeneratedLine < mapping.generatedLine) { 60287 // Associate first line with "lastMapping" 60288 addMappingWithCode(lastMapping, shiftNextLine()); 60289 lastGeneratedLine++; 60290 lastGeneratedColumn = 0; 60291 // The remaining code is added without mapping 60292 } else { 60293 // There is no new line in between. 60294 // Associate the code between "lastGeneratedColumn" and 60295 // "mapping.generatedColumn" with "lastMapping" 60296 var nextLine = remainingLines[0]; 60297 var code = nextLine.substr(0, mapping.generatedColumn - lastGeneratedColumn); 60298 remainingLines[0] = nextLine.substr(mapping.generatedColumn - lastGeneratedColumn); 60299 lastGeneratedColumn = mapping.generatedColumn; 60300 addMappingWithCode(lastMapping, code); 60301 // No more remaining code, continue 60302 lastMapping = mapping; 60303 return; 60304 } 60305 } 60306 // We add the generated code until the first mapping 60307 // to the SourceNode without any mapping. 60308 // Each line is added as separate string. 60309 while (lastGeneratedLine < mapping.generatedLine) { 60310 node.add(shiftNextLine()); 60311 lastGeneratedLine++; 60312 } 60313 if (lastGeneratedColumn < mapping.generatedColumn) { 60314 var nextLine = remainingLines[0]; 60315 node.add(nextLine.substr(0, mapping.generatedColumn)); 60316 remainingLines[0] = nextLine.substr(mapping.generatedColumn); 60317 lastGeneratedColumn = mapping.generatedColumn; 60318 } 60319 lastMapping = mapping; 60320 }, this); 60321 // We have processed all mappings. 60322 if (remainingLines.length > 0) { 60323 if (lastMapping) { 60324 // Associate the remaining code in the current line with "lastMapping"
vendor: 4,458 bytes, lines 60325-60463
60325 addMappingWithCode(lastMapping, shiftNextLine()); 60326 } 60327 // and add the remaining lines without any mapping 60328 node.add(remainingLines.join("")); 60329 } 60330 60331 // Copy sourcesContent into SourceNode 60332 aSourceMapConsumer.sources.forEach(function (sourceFile) { 60333 var content = aSourceMapConsumer.sourceContentFor(sourceFile); 60334 if (content != null) { 60335 if (aRelativePath != null) { 60336 sourceFile = util.join(aRelativePath, sourceFile); 60337 } 60338 node.setSourceContent(sourceFile, content); 60339 } 60340 }); 60341 60342 return node; 60343 60344 function addMappingWithCode(mapping, code) { 60345 if (mapping === null || mapping.source === undefined) { 60346 node.add(code); 60347 } else { 60348 var source = aRelativePath ? util.join(aRelativePath, mapping.source) : mapping.source; 60349 node.add(new SourceNode(mapping.originalLine, mapping.originalColumn, source, code, mapping.name)); 60350 } 60351 } 60352 }; 60353 60354 /** 60355 * Add a chunk of generated JS to this source node. 60356 * 60357 * @param aChunk A string snippet of generated JS code, another instance of 60358 * SourceNode, or an array where each member is one of those things. 60359 */ 60360 SourceNode.prototype.add = function SourceNode_add(aChunk) { 60361 if (Array.isArray(aChunk)) { 60362 aChunk.forEach(function (chunk) { 60363 this.add(chunk); 60364 }, this); 60365 } else if (aChunk[isSourceNode] || typeof aChunk === "string") { 60366 if (aChunk) { 60367 this.children.push(aChunk); 60368 } 60369 } else { 60370 throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk); 60371 } 60372 return this; 60373 }; 60374 60375 /** 60376 * Add a chunk of generated JS to the beginning of this source node. 60377 * 60378 * @param aChunk A string snippet of generated JS code, another instance of 60379 * SourceNode, or an array where each member is one of those things. 60380 */ 60381 SourceNode.prototype.prepend = function SourceNode_prepend(aChunk) { 60382 if (Array.isArray(aChunk)) { 60383 for (var i = aChunk.length - 1; i >= 0; i--) { 60384 this.prepend(aChunk[i]); 60385 } 60386 } else if (aChunk[isSourceNode] || typeof aChunk === "string") { 60387 this.children.unshift(aChunk); 60388 } else { 60389 throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk); 60390 } 60391 return this; 60392 }; 60393 60394 /** 60395 * Walk over the tree of JS snippets in this node and its children. The 60396 * walking function is called once for each snippet of JS and is passed that 60397 * snippet and the its original associated source's line/column location. 60398 * 60399 * @param aFn The traversal function. 60400 */ 60401 SourceNode.prototype.walk = function SourceNode_walk(aFn) { 60402 var chunk; 60403 for (var i = 0, len = this.children.length; i < len; i++) { 60404 chunk = this.children[i]; 60405 if (chunk[isSourceNode]) { 60406 chunk.walk(aFn); 60407 } else { 60408 if (chunk !== '') { 60409 aFn(chunk, { source: this.source, 60410 line: this.line, 60411 column: this.column, 60412 name: this.name }); 60413 } 60414 } 60415 } 60416 }; 60417 60418 /** 60419 * Like `String.prototype.join` except for SourceNodes. Inserts `aStr` between 60420 * each of `this.children`. 60421 * 60422 * @param aSep The separator. 60423 */ 60424 SourceNode.prototype.join = function SourceNode_join(aSep) { 60425 var newChildren; 60426 var i; 60427 var len = this.children.length; 60428 if (len > 0) { 60429 newChildren = []; 60430 for (i = 0; i < len - 1; i++) { 60431 newChildren.push(this.children[i]); 60432 newChildren.push(aSep); 60433 } 60434 newChildren.push(this.children[i]); 60435 this.children = newChildren; 60436 } 60437 return this; 60438 }; 60439 60440 /** 60441 * Call String.prototype.replace on the very right-most source snippet. Useful 60442 * for trimming whitespace from the end of a source node, etc. 60443 * 60444 * @param aPattern The pattern to replace. 60445 * @param aReplacement The thing to replace the pattern with. 60446 */ 60447 SourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) { 60448 var lastChild = this.children[this.children.length - 1]; 60449 if (lastChild[isSourceNode]) { 60450 lastChild.replaceRight(aPattern, aReplacement); 60451 } else if (typeof lastChild === 'string') { 60452 this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement); 60453 } else { 60454 this.children.push(''.replace(aPattern, aReplacement)); 60455 } 60456 return this; 60457 }; 60458 60459 /** 60460 * Set the source content for a source file. This will be added to the SourceMapGenerator 60461 * in the sourcesContent field. 60462 * 60463 * @param aSourceFile The filename of the source file
60464 * @param aSourceContent The content of the source file 60465 */ 60466 SourceNode.prototype.setSourceContent = function SourceNode_setSourceContent(aSourceFile, aSourceContent) { 60467 this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent; 60468 }; 60469 60470 /** 60471 * Walk over the tree of SourceNodes. The walking function is called for each 60472 * source file content and is passed the filename and source content. 60473 * 60474 * @param aFn The traversal function. 60475 */ 60476 SourceNode.prototype.walkSourceContents = function SourceNode_walkSourceContents(aFn) { 60477 for (var i = 0, len = this.children.length; i < len; i++) { 60478 if (this.children[i][isSourceNode]) { 60479 this.children[i].walkSourceContents(aFn); 60480 } 60481 } 60482 60483 var sources = Object.keys(this.sourceContents); 60484 for (var i = 0, len = sources.length; i < len; i++) { 60485 aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]]); 60486 } 60487 }; 60488 60489 /** 60490 * Return the string representation of this source node. Walks over the tree 60491 * and concatenates all the various snippets together to one string. 60492 */ 60493 SourceNode.prototype.toString = function SourceNode_toString() { 60494 var str = ""; 60495 this.walk(function (chunk) { 60496 str += chunk; 60497 }); 60498 return str; 60499 }; 60500 60501 /** 60502 * Returns the string representation of this source node along with a source 60503 * map. 60504 */ 60505 SourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) { 60506 var generated = { 60507 code: "", 60508 line: 1, 60509 column: 0 60510 }; 60511 var map = new SourceMapGenerator(aArgs); 60512 var sourceMappingActive = false; 60513 var lastOriginalSource = null; 60514 var lastOriginalLine = null; 60515 var lastOriginalColumn = null; 60516 var lastOriginalName = null; 60517 this.walk(function (chunk, original) { 60518 generated.code += chunk; 60519 if (original.source !== null && original.line !== null && original.column !== null) { 60520 if (lastOriginalSource !== original.source || lastOriginalLine !== original.line || lastOriginalColumn !== original.column || lastOriginalName !== original.name) { 60521 map.addMapping({ 60522 source: original.source, 60523 original: { 60524 line: original.line, 60525 column: original.column 60526 }, 60527 generated: { 60528 line: generated.line, 60529 column: generated.column 60530 }, 60531 name: original.name 60532 }); 60533 } 60534 lastOriginalSource = original.source; 60535 lastOriginalLine = original.line; 60536 lastOriginalColumn = original.column; 60537 lastOriginalName = original.name; 60538 sourceMappingActive = true; 60539 } else if (sourceMappingActive) { 60540 map.addMapping({ 60541 generated: { 60542 line: generated.line, 60543 column: generated.column 60544 } 60545 }); 60546 lastOriginalSource = null; 60547 sourceMappingActive = false; 60548 } 60549 for (var idx = 0, length = chunk.length; idx < length; idx++) { 60550 if (chunk.charCodeAt(idx) === NEWLINE_CODE) { 60551 generated.line++; 60552 generated.column = 0; 60553 // Mappings end at eol 60554 if (idx + 1 === length) { 60555 lastOriginalSource = null; 60556 sourceMappingActive = false; 60557 } else if (sourceMappingActive) { 60558 map.addMapping({ 60559 source: original.source, 60560 original: { 60561 line: original.line, 60562 column: original.column 60563 }, 60564 generated: { 60565 line: generated.line, 60566 column: generated.column 60567 }, 60568 name: original.name 60569 }); 60570 } 60571 } else { 60572 generated.column++; 60573 } 60574 } 60575 }); 60576 this.walkSourceContents(function (sourceFile, sourceContent) { 60577 map.setSourceContent(sourceFile, sourceContent); 60578 }); 60579 60580 return { code: generated.code, map: map }; 60581 }; 60582 60583 exports.SourceNode = SourceNode; 60584 60585/***/ }, 60586/* 610 */ 60587/***/ function(module, exports, __webpack_require__) { 60588 60589 'use strict'; 60590 60591 var ansiRegex = __webpack_require__(176)(); 60592 60593 module.exports = function (str) { 60594 return typeof str === 'string' ? str.replace(ansiRegex, '') : str; 60595 }; 60596 60597/***/ }, 60598/* 611 */ 60599/***/ function(module, exports, __webpack_require__) { 60600 60601 /* WEBPACK VAR INJECTION */(function(process) {'use strict'; 60602 60603 var argv = process.argv; 60604 60605 var terminator = argv.indexOf('--'); 60606 var hasFlag = function hasFlag(flag) { 60607 flag = '--' + flag; 60608 var pos = argv.indexOf(flag); 60609 return pos !== -1 && (terminator !== -1 ? pos < terminator : true); 60610 }; 60611 60612 module.exports = function () { 60613 if ('FORCE_COLOR' in process.env) { 60614 return true; 60615 } 60616 60617 if (hasFlag('no-color') || hasFlag('no-colors') || hasFlag('color=false')) { 60618 return false;
60619 } 60620 60621 if (hasFlag('color') || hasFlag('colors') || hasFlag('color=true') || hasFlag('color=always')) { 60622 return true; 60623 } 60624 60625 if (process.stdout && !process.stdout.isTTY) { 60626 return false; 60627 } 60628 60629 if (process.platform === 'win32') { 60630 return true; 60631 } 60632 60633 if ('COLORTERM' in process.env) { 60634 return true; 60635 } 60636 60637 if (process.env.TERM === 'dumb') { 60638 return false; 60639 } 60640 60641 if (/^screen|^xterm|^vt100|color|ansi|cygwin|linux/i.test(process.env.TERM)) { 60642 return true; 60643 } 60644 60645 return false; 60646 }(); 60647 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(9))) 60648 60649/***/ }, 60650/* 612 */ 60651/***/ function(module, exports) { 60652 60653 'use strict'; 60654 60655 module.exports = function toFastProperties(obj) { 60656 function f() {} 60657 f.prototype = obj; 60658 new f(); 60659 return; 60660 eval(obj); 60661 }; 60662 60663/***/ }, 60664/* 613 */ 60665/***/ function(module, exports) { 60666 60667 'use strict'; 60668 60669 module.exports = function (str) { 60670 var tail = str.length; 60671 60672 while (/[\s\uFEFF\u00A0]/.test(str[tail - 1])) { 60673 tail--; 60674 } 60675 60676 return str.slice(0, tail); 60677 }; 60678 60679/***/ }, 60680/* 614 */ 60681/***/ function(module, exports) { 60682 60683 'use strict'; 60684 60685 if (typeof Object.create === 'function') { 60686 // implementation from standard node.js 'util' module 60687 module.exports = function inherits(ctor, superCtor) { 60688 ctor.super_ = superCtor; 60689 ctor.prototype = Object.create(superCtor.prototype, { 60690 constructor: { 60691 value: ctor, 60692 enumerable: false, 60693 writable: true, 60694 configurable: true 60695 } 60696 }); 60697 }; 60698 } else { 60699 // old school shim for old browsers 60700 module.exports = function inherits(ctor, superCtor) { 60701 ctor.super_ = superCtor; 60702 var TempCtor = function TempCtor() {}; 60703 TempCtor.prototype = superCtor.prototype; 60704 ctor.prototype = new TempCtor(); 60705 ctor.prototype.constructor = ctor; 60706 }; 60707 } 60708 60709/***/ }, 60710/* 615 */ 60711/***/ function(module, exports) { 60712 60713 'use strict'; 60714 60715 var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; 60716 60717 module.exports = function isBuffer(arg) { 60718 return arg && (typeof arg === 'undefined' ? 'undefined' : _typeof(arg)) === 'object' && typeof arg.copy === 'function' && typeof arg.fill === 'function' && typeof arg.readUInt8 === 'function'; 60719 }; 60720 60721/***/ }, 60722/* 616 */ 60723/***/ function(module, exports, __webpack_require__) { 60724 60725 "use strict"; 60726 60727 Object.defineProperty(exports, "__esModule", { 60728 value: true 60729 }); 60730 /** 60731 * A shim that replaces Babel's require('package.json') statement. 60732 * Babel requires the entire package.json file just to get the version number. 60733 */ 60734 var version = exports.version = ("6.24.0"); 60735 60736/***/ }, 60737/* 617 */ 60738/***/ function(module, exports) { 60739 60740 'use strict'; 60741 60742 Object.defineProperty(exports, "__esModule", { 60743 value: true 60744 }); 60745 60746 var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; 60747 60748 exports.runScripts = runScripts; 60749 /** 60750 * Copyright 2013-2015, Facebook, Inc. 60751 * All rights reserved. 60752 * 60753 * This source code is licensed under the BSD-style license found in the 60754 * LICENSE file in the root directory of the React source tree. An additional 60755 * grant of patent rights can be found in the PATENTS file in the same directory. 60756 */ 60757 60758 var scriptTypes = ['text/jsx', 'text/babel']; 60759 60760 var headEl = void 0; 60761 var inlineScriptCount = 0; 60762 60763 /** 60764 * Actually transform the code. 60765 */ 60766 function transformCode(transformFn, script) { 60767 var source = void 0; 60768 if (script.url != null) { 60769 source = script.url; 60770 } else { 60771 source = 'Inline Babel script'; 60772 inlineScriptCount++; 60773 if (inlineScriptCount > 1) { 60774 source += ' (' + inlineScriptCount + ')'; 60775 } 60776 } 60777 60778 return transformFn(script.content, _extends({ 60779 filename: source 60780 }, buildBabelOptions(script))).code; 60781 } 60782 60783 /** 60784 * Builds the Babel options for transforming the specified script, using some 60785 * sensible default presets and plugins if none were explicitly provided. 60786 */ 60787 function buildBabelOptions(script) { 60788 return { 60789 presets: script.presets || ['react', 'es2015'], 60790 plugins: script.plugins || ['transform-class-properties', 'transform-object-rest-spread', 'transform-flow-strip-types'], 60791 sourceMaps: 'inline' 60792 }; 60793 } 60794 60795 /** 60796 * Appends a script element at the end of the <head> with the content of code, 60797 * after transforming it. 60798 */ 60799 function run(transformFn, script) { 60800 var scriptEl = document.createElement('script'); 60801 scriptEl.text = transformCode(transformFn, script); 60802 headEl.appendChild(scriptEl); 60803 } 60804 60805 /** 60806 * Load script from the provided url and pass the content to the callback. 60807 */ 60808 function load(url, successCallback, errorCallback) { 60809 var xhr = new XMLHttpRequest(); 60810 60811 // async, however scripts will be executed in the order they are in the 60812 // DOM to mirror normal script loading. 60813 xhr.open('GET', url, true); 60814 if ('overrideMimeType' in xhr) { 60815 xhr.overrideMimeType('text/plain'); 60816 } 60817 xhr.onreadystatechange = function () { 60818 if (xhr.readyState === 4) { 60819 if (xhr.status === 0 || xhr.status === 200) { 60820 successCallback(xhr.responseText); 60821 } else { 60822 errorCallback(); 60823 throw new Error('Could not load ' + url); 60824 } 60825 } 60826 }; 60827 return xhr.send(null); 60828 } 60829 60830 /** 60831 * Converts a comma-separated data attribute string into an array of values. If 60832 * the string is empty, returns an empty array. If the string is not defined, 60833 * returns null. 60834 */ 60835 function getPluginsOrPresetsFromScript(script, attributeName) { 60836 var rawValue = script.getAttribute(attributeName); 60837 if (rawValue === '') { 60838 // Empty string means to not load ANY presets or plugins 60839 return []; 60840 } 60841 if (!rawValue) { 60842 // Any other falsy value (null, undefined) means we're not overriding this 60843 // setting, and should use the default. 60844 return null; 60845 } 60846 return rawValue.split(',').map(function (item) { 60847 return item.trim(); 60848 }); 60849 } 60850 60851 /** 60852 * Loop over provided script tags and get the content, via innerHTML if an 60853 * inline script, or by using XHR. Transforms are applied if needed. The scripts 60854 * are executed in the order they are found on the page. 60855 */ 60856 function loadScripts(transformFn, scripts) { 60857 var result = []; 60858 var count = scripts.length; 60859 60860 function check() { 60861 var script, i; 60862 60863 for (i = 0; i < count; i++) { 60864 script = result[i]; 60865 60866 if (script.loaded && !script.executed) { 60867 script.executed = true; 60868 run(transformFn, script); 60869 } else if (!script.loaded && !script.error && !script.async) { 60870 break; 60871 } 60872 } 60873 } 60874
60875 scripts.forEach(function (script, i) { 60876 var scriptData = { 60877 // script.async is always true for non-JavaScript script tags 60878 async: script.hasAttribute('async'), 60879 error: false, 60880 executed: false, 60881 plugins: getPluginsOrPresetsFromScript(script, 'data-plugins'), 60882 presets: getPluginsOrPresetsFromScript(script, 'data-presets') 60883 }; 60884 60885 if (script.src) { 60886 result[i] = _extends({}, scriptData, { 60887 content: null, 60888 loaded: false, 60889 url: script.src 60890 }); 60891 60892 load(script.src, function (content) { 60893 result[i].loaded = true; 60894 result[i].content = content; 60895 check(); 60896 }, function () { 60897 result[i].error = true; 60898 check(); 60899 }); 60900 } else { 60901 result[i] = _extends({}, scriptData, { 60902 content: script.innerHTML, 60903 loaded: true, 60904 url: null 60905 }); 60906 } 60907 }); 60908 60909 check(); 60910 } 60911 60912 /** 60913 * Find and run all script tags with type="text/jsx". 60914 */ 60915 function runScripts(transformFn) { 60916 headEl = document.getElementsByTagName('head')[0]; 60917 var scripts = document.getElementsByTagName('script'); 60918 60919 // Array.prototype.slice cannot be used on NodeList on IE8 60920 var jsxScripts = []; 60921 for (var i = 0; i < scripts.length; i++) { 60922 var script = scripts.item(i); 60923 // Support the old type="text/jsx;harmony=true" 60924 var type = script.type.split(';')[0]; 60925 if (scriptTypes.indexOf(type) !== -1) { 60926 jsxScripts.push(script); 60927 } 60928 } 60929 60930 if (jsxScripts.length === 0) { 60931 return; 60932 } 60933 60934 console.warn('You are using the in-browser Babel transformer. Be sure to precompile ' + 'your scripts for production - https://babeljs.io/docs/setup/'); 60935 60936 loadScripts(transformFn, jsxScripts); 60937 } 60938 60939/***/ }, 60940/* 618 */ 60941/***/ function(module, exports) { 60942 60943 module.exports = { 60944 "builtin": { 60945 "Array": false, 60946 "ArrayBuffer": false, 60947 "Boolean": false, 60948 "constructor": false, 60949 "DataView": false, 60950 "Date": false, 60951 "decodeURI": false, 60952 "decodeURIComponent": false, 60953 "encodeURI": false, 60954 "encodeURIComponent": false, 60955 "Error": false, 60956 "escape": false, 60957 "eval": false, 60958 "EvalError": false, 60959 "Float32Array": false, 60960 "Float64Array": false, 60961 "Function": false, 60962 "hasOwnProperty": false, 60963 "Infinity": false, 60964 "Int16Array": false, 60965 "Int32Array": false, 60966 "Int8Array": false, 60967 "isFinite": false, 60968 "isNaN": false, 60969 "isPrototypeOf": false, 60970 "JSON": false, 60971 "Map": false, 60972 "Math": false, 60973 "NaN": false, 60974 "Number": false, 60975 "Object": false, 60976 "parseFloat": false, 60977 "parseInt": false, 60978 "Promise": false, 60979 "propertyIsEnumerable": false, 60980 "Proxy": false, 60981 "RangeError": false, 60982 "ReferenceError": false, 60983 "Reflect": false, 60984 "RegExp": false, 60985 "Set": false, 60986 "String": false, 60987 "Symbol": false, 60988 "SyntaxError": false, 60989 "System": false, 60990 "toLocaleString": false, 60991 "toString": false, 60992 "TypeError": false, 60993 "Uint16Array": false, 60994 "Uint32Array": false, 60995 "Uint8Array": false, 60996 "Uint8ClampedArray": false, 60997 "undefined": false, 60998 "unescape": false, 60999 "URIError": false, 61000 "valueOf": false, 61001 "WeakMap": false, 61002 "WeakSet": false 61003 }, 61004 "es5": { 61005 "Array": false, 61006 "Boolean": false, 61007 "constructor": false, 61008 "Date": false, 61009 "decodeURI": false, 61010 "decodeURIComponent": false, 61011 "encodeURI": false, 61012 "encodeURIComponent": false, 61013 "Error": false, 61014 "escape": false, 61015 "eval": false, 61016 "EvalError": false, 61017 "Function": false, 61018 "hasOwnProperty": false, 61019 "Infinity": false, 61020 "isFinite": false, 61021 "isNaN": false, 61022 "isPrototypeOf": false, 61023 "JSON": false, 61024 "Math": false, 61025 "NaN": false, 61026 "Number": false, 61027 "Object": false, 61028 "parseFloat": false, 61029 "parseInt": false, 61030 "propertyIsEnumerable": false, 61031 "RangeError": false, 61032 "ReferenceError": false, 61033 "RegExp": false, 61034 "String": false, 61035 "SyntaxError": false, 61036 "toLocaleString": false, 61037 "toString": false, 61038 "TypeError": false, 61039 "undefined": false, 61040 "unescape": false, 61041 "URIError": false, 61042 "valueOf": false 61043 }, 61044 "es6": { 61045 "Array": false, 61046 "ArrayBuffer": false, 61047 "Boolean": false, 61048 "constructor": false, 61049 "DataView": false, 61050 "Date": false, 61051 "decodeURI": false, 61052 "decodeURIComponent": false, 61053 "encodeURI": false, 61054 "encodeURIComponent": false, 61055 "Error": false, 61056 "escape": false, 61057 "eval": false, 61058 "EvalError": false, 61059 "Float32Array": false, 61060 "Float64Array": false, 61061 "Function": false, 61062 "hasOwnProperty": false, 61063 "Infinity": false, 61064 "Int16Array": false, 61065 "Int32Array": false, 61066 "Int8Array": false, 61067 "isFinite": false, 61068 "isNaN": false, 61069 "isPrototypeOf": false, 61070 "JSON": false, 61071 "Map": false, 61072 "Math": false, 61073 "NaN": false, 61074 "Number": false, 61075 "Object": false, 61076 "parseFloat": false, 61077 "parseInt": false, 61078 "Promise": false, 61079 "propertyIsEnumerable": false, 61080 "Proxy": false, 61081 "RangeError": false, 61082 "ReferenceError": false, 61083 "Reflect": false, 61084 "RegExp": false, 61085 "Set": false, 61086 "String": false, 61087 "Symbol": false, 61088 "SyntaxError": false, 61089 "System": false,
61090 "toLocaleString": false, 61091 "toString": false, 61092 "TypeError": false, 61093 "Uint16Array": false, 61094 "Uint32Array": false, 61095 "Uint8Array": false, 61096 "Uint8ClampedArray": false, 61097 "undefined": false, 61098 "unescape": false, 61099 "URIError": false, 61100 "valueOf": false, 61101 "WeakMap": false, 61102 "WeakSet": false 61103 }, 61104 "browser": { 61105 "addEventListener": false, 61106 "alert": false, 61107 "AnalyserNode": false, 61108 "Animation": false, 61109 "AnimationEffectReadOnly": false, 61110 "AnimationEffectTiming": false, 61111 "AnimationEffectTimingReadOnly": false, 61112 "AnimationEvent": false, 61113 "AnimationPlaybackEvent": false, 61114 "AnimationTimeline": false, 61115 "applicationCache": false, 61116 "ApplicationCache": false, 61117 "ApplicationCacheErrorEvent": false, 61118 "atob": false, 61119 "Attr": false, 61120 "Audio": false, 61121 "AudioBuffer": false, 61122 "AudioBufferSourceNode": false, 61123 "AudioContext": false, 61124 "AudioDestinationNode": false, 61125 "AudioListener": false, 61126 "AudioNode": false, 61127 "AudioParam": false, 61128 "AudioProcessingEvent": false, 61129 "AutocompleteErrorEvent": false, 61130 "BarProp": false, 61131 "BatteryManager": false, 61132 "BeforeUnloadEvent": false, 61133 "BiquadFilterNode": false, 61134 "Blob": false, 61135 "blur": false, 61136 "btoa": false, 61137 "Cache": false, 61138 "caches": false, 61139 "CacheStorage": false, 61140 "cancelAnimationFrame": false, 61141 "CanvasGradient": false, 61142 "CanvasPattern": false, 61143 "CanvasRenderingContext2D": false, 61144 "CDATASection": false, 61145 "ChannelMergerNode": false, 61146 "ChannelSplitterNode": false, 61147 "CharacterData": false, 61148 "clearInterval": false, 61149 "clearTimeout": false, 61150 "clientInformation": false, 61151 "ClientRect": false, 61152 "ClientRectList": false, 61153 "ClipboardEvent": false, 61154 "close": false, 61155 "closed": false, 61156 "CloseEvent": false, 61157 "Comment": false, 61158 "CompositionEvent": false, 61159 "confirm": false, 61160 "console": false, 61161 "ConvolverNode": false, 61162 "Credential": false, 61163 "CredentialsContainer": false, 61164 "crypto": false, 61165 "Crypto": false, 61166 "CryptoKey": false, 61167 "CSS": false, 61168 "CSSAnimation": false, 61169 "CSSFontFaceRule": false, 61170 "CSSImportRule": false, 61171 "CSSKeyframeRule": false, 61172 "CSSKeyframesRule": false, 61173 "CSSMediaRule": false, 61174 "CSSPageRule": false, 61175 "CSSRule": false, 61176 "CSSRuleList": false, 61177 "CSSStyleDeclaration": false, 61178 "CSSStyleRule": false, 61179 "CSSStyleSheet": false, 61180 "CSSSupportsRule": false, 61181 "CSSTransition": false, 61182 "CSSUnknownRule": false, 61183 "CSSViewportRule": false, 61184 "customElements": false, 61185 "CustomEvent": false, 61186 "DataTransfer": false, 61187 "DataTransferItem": false, 61188 "DataTransferItemList": false, 61189 "Debug": false, 61190 "defaultStatus": false, 61191 "defaultstatus": false, 61192 "DelayNode": false, 61193 "DeviceMotionEvent": false, 61194 "DeviceOrientationEvent": false, 61195 "devicePixelRatio": false, 61196 "dispatchEvent": false, 61197 "document": false, 61198 "Document": false, 61199 "DocumentFragment": false, 61200 "DocumentTimeline": false, 61201 "DocumentType": false, 61202 "DOMError": false, 61203 "DOMException": false, 61204 "DOMImplementation": false, 61205 "DOMParser": false, 61206 "DOMSettableTokenList": false, 61207 "DOMStringList": false, 61208 "DOMStringMap": false, 61209 "DOMTokenList": false, 61210 "DragEvent": false, 61211 "DynamicsCompressorNode": false, 61212 "Element": false, 61213 "ElementTimeControl": false, 61214 "ErrorEvent": false, 61215 "event": false, 61216 "Event": false, 61217 "EventSource": false, 61218 "EventTarget": false, 61219 "external": false, 61220 "FederatedCredential": false, 61221 "fetch": false, 61222 "File": false, 61223 "FileError": false, 61224 "FileList": false, 61225 "FileReader": false, 61226 "find": false, 61227 "focus": false, 61228 "FocusEvent": false, 61229 "FontFace": false, 61230 "FormData": false, 61231 "frameElement": false, 61232 "frames": false, 61233 "GainNode": false, 61234 "Gamepad": false, 61235 "GamepadButton": false, 61236 "GamepadEvent": false, 61237 "getComputedStyle": false, 61238 "getSelection": false, 61239 "HashChangeEvent": false, 61240 "Headers": false, 61241 "history": false, 61242 "History": false, 61243 "HTMLAllCollection": false, 61244 "HTMLAnchorElement": false, 61245 "HTMLAppletElement": false, 61246 "HTMLAreaElement": false, 61247 "HTMLAudioElement": false, 61248 "HTMLBaseElement": false, 61249 "HTMLBlockquoteElement": false, 61250 "HTMLBodyElement": false, 61251 "HTMLBRElement": false, 61252 "HTMLButtonElement": false, 61253 "HTMLCanvasElement": false, 61254 "HTMLCollection": false, 61255 "HTMLContentElement": false, 61256 "HTMLDataListElement": false, 61257 "HTMLDetailsElement": false, 61258 "HTMLDialogElement": false, 61259 "HTMLDirectoryElement": false, 61260 "HTMLDivElement": false, 61261 "HTMLDListElement": false, 61262 "HTMLDocument": false, 61263 "HTMLElement": false, 61264 "HTMLEmbedElement": false, 61265 "HTMLFieldSetElement": false, 61266 "HTMLFontElement": false, 61267 "HTMLFormControlsCollection": false, 61268 "HTMLFormElement": false, 61269 "HTMLFrameElement": false, 61270 "HTMLFrameSetElement": false, 61271 "HTMLHeadElement": false, 61272 "HTMLHeadingElement": false, 61273 "HTMLHRElement": false, 61274 "HTMLHtmlElement": false, 61275 "HTMLIFrameElement": false, 61276 "HTMLImageElement": false, 61277 "HTMLInputElement": false, 61278 "HTMLIsIndexElement": false, 61279 "HTMLKeygenElement": false, 61280 "HTMLLabelElement": false, 61281 "HTMLLayerElement": false, 61282 "HTMLLegendElement": false, 61283 "HTMLLIElement": false, 61284 "HTMLLinkElement": false, 61285 "HTMLMapElement": false, 61286 "HTMLMarqueeElement": false, 61287 "HTMLMediaElement": false, 61288 "HTMLMenuElement": false, 61289 "HTMLMetaElement": false, 61290 "HTMLMeterElement": false, 61291 "HTMLModElement": false, 61292 "HTMLObjectElement": false, 61293 "HTMLOListElement": false, 61294 "HTMLOptGroupElement": false, 61295 "HTMLOptionElement": false, 61296 "HTMLOptionsCollection": false, 61297 "HTMLOutputElement": false, 61298 "HTMLParagraphElement": false, 61299 "HTMLParamElement": false, 61300 "HTMLPictureElement": false, 61301 "HTMLPreElement": false, 61302 "HTMLProgressElement": false, 61303 "HTMLQuoteElement": false, 61304 "HTMLScriptElement": false, 61305 "HTMLSelectElement": false, 61306 "HTMLShadowElement": false, 61307 "HTMLSourceElement": false, 61308 "HTMLSpanElement": false, 61309 "HTMLStyleElement": false, 61310 "HTMLTableCaptionElement": false, 61311 "HTMLTableCellElement": false, 61312 "HTMLTableColElement": false, 61313 "HTMLTableElement": false, 61314 "HTMLTableRowElement": false, 61315 "HTMLTableSectionElement": false, 61316 "HTMLTemplateElement": false, 61317 "HTMLTextAreaElement": false, 61318 "HTMLTitleElement": false, 61319 "HTMLTrackElement": false, 61320 "HTMLUListElement": false, 61321 "HTMLUnknownElement": false, 61322 "HTMLVideoElement": false, 61323 "IDBCursor": false, 61324 "IDBCursorWithValue": false, 61325 "IDBDatabase": false, 61326 "IDBEnvironment": false, 61327 "IDBFactory": false, 61328 "IDBIndex": false, 61329 "IDBKeyRange": false, 61330 "IDBObjectStore": false, 61331 "IDBOpenDBRequest": false, 61332 "IDBRequest": false, 61333 "IDBTransaction": false, 61334 "IDBVersionChangeEvent": false, 61335 "Image": false, 61336 "ImageBitmap": false, 61337 "ImageData": false, 61338 "indexedDB": false,
61339 "innerHeight": false, 61340 "innerWidth": false, 61341 "InputEvent": false, 61342 "InputMethodContext": false, 61343 "IntersectionObserver": false, 61344 "IntersectionObserverEntry": false, 61345 "Intl": false, 61346 "KeyboardEvent": false, 61347 "KeyframeEffect": false, 61348 "KeyframeEffectReadOnly": false, 61349 "length": false, 61350 "localStorage": false, 61351 "location": false, 61352 "Location": false, 61353 "locationbar": false, 61354 "matchMedia": false, 61355 "MediaElementAudioSourceNode": false, 61356 "MediaEncryptedEvent": false, 61357 "MediaError": false, 61358 "MediaKeyError": false, 61359 "MediaKeyEvent": false, 61360 "MediaKeyMessageEvent": false, 61361 "MediaKeys": false, 61362 "MediaKeySession": false, 61363 "MediaKeyStatusMap": false, 61364 "MediaKeySystemAccess": false, 61365 "MediaList": false, 61366 "MediaQueryList": false, 61367 "MediaQueryListEvent": false, 61368 "MediaSource": false, 61369 "MediaRecorder": false, 61370 "MediaStream": false, 61371 "MediaStreamAudioDestinationNode": false, 61372 "MediaStreamAudioSourceNode": false, 61373 "MediaStreamEvent": false, 61374 "MediaStreamTrack": false, 61375 "menubar": false, 61376 "MessageChannel": false, 61377 "MessageEvent": false, 61378 "MessagePort": false, 61379 "MIDIAccess": false, 61380 "MIDIConnectionEvent": false, 61381 "MIDIInput": false, 61382 "MIDIInputMap": false, 61383 "MIDIMessageEvent": false, 61384 "MIDIOutput": false, 61385 "MIDIOutputMap": false, 61386 "MIDIPort": false, 61387 "MimeType": false, 61388 "MimeTypeArray": false, 61389 "MouseEvent": false, 61390 "moveBy": false, 61391 "moveTo": false, 61392 "MutationEvent": false, 61393 "MutationObserver": false, 61394 "MutationRecord": false, 61395 "name": false, 61396 "NamedNodeMap": false, 61397 "navigator": false, 61398 "Navigator": false, 61399 "Node": false, 61400 "NodeFilter": false, 61401 "NodeIterator": false, 61402 "NodeList": false, 61403 "Notification": false, 61404 "OfflineAudioCompletionEvent": false, 61405 "OfflineAudioContext": false, 61406 "offscreenBuffering": false, 61407 "onbeforeunload": true, 61408 "onblur": true, 61409 "onerror": true, 61410 "onfocus": true, 61411 "onload": true, 61412 "onresize": true, 61413 "onunload": true, 61414 "open": false, 61415 "openDatabase": false, 61416 "opener": false, 61417 "opera": false, 61418 "Option": false, 61419 "OscillatorNode": false, 61420 "outerHeight": false, 61421 "outerWidth": false, 61422 "PageTransitionEvent": false, 61423 "pageXOffset": false, 61424 "pageYOffset": false, 61425 "parent": false, 61426 "PasswordCredential": false, 61427 "Path2D": false, 61428 "performance": false, 61429 "Performance": false, 61430 "PerformanceEntry": false, 61431 "PerformanceMark": false, 61432 "PerformanceMeasure": false, 61433 "PerformanceNavigation": false, 61434 "PerformanceResourceTiming": false, 61435 "PerformanceTiming": false, 61436 "PeriodicWave": false, 61437 "Permissions": false, 61438 "PermissionStatus": false, 61439 "personalbar": false, 61440 "Plugin": false, 61441 "PluginArray": false, 61442 "PopStateEvent": false, 61443 "postMessage": false, 61444 "print": false, 61445 "ProcessingInstruction": false, 61446 "ProgressEvent": false, 61447 "PromiseRejectionEvent": false, 61448 "prompt": false, 61449 "PushManager": false, 61450 "PushSubscription": false, 61451 "RadioNodeList": false, 61452 "Range": false, 61453 "ReadableByteStream": false, 61454 "ReadableStream": false, 61455 "removeEventListener": false, 61456 "Request": false, 61457 "requestAnimationFrame": false, 61458 "requestIdleCallback": false, 61459 "resizeBy": false, 61460 "resizeTo": false, 61461 "Response": false, 61462 "RTCIceCandidate": false, 61463 "RTCSessionDescription": false, 61464 "RTCPeerConnection": false, 61465 "screen": false, 61466 "Screen": false, 61467 "screenLeft": false, 61468 "ScreenOrientation": false, 61469 "screenTop": false, 61470 "screenX": false, 61471 "screenY": false, 61472 "ScriptProcessorNode": false, 61473 "scroll": false, 61474 "scrollbars": false, 61475 "scrollBy": false, 61476 "scrollTo": false, 61477 "scrollX": false, 61478 "scrollY": false, 61479 "SecurityPolicyViolationEvent": false, 61480 "Selection": false, 61481 "self": false, 61482 "ServiceWorker": false, 61483 "ServiceWorkerContainer": false, 61484 "ServiceWorkerRegistration": false, 61485 "sessionStorage": false, 61486 "setInterval": false, 61487 "setTimeout": false, 61488 "ShadowRoot": false, 61489 "SharedKeyframeList": false, 61490 "SharedWorker": false, 61491 "showModalDialog": false, 61492 "SiteBoundCredential": false, 61493 "speechSynthesis": false, 61494 "SpeechSynthesisEvent": false, 61495 "SpeechSynthesisUtterance": false, 61496 "status": false, 61497 "statusbar": false, 61498 "stop": false, 61499 "Storage": false, 61500 "StorageEvent": false, 61501 "styleMedia": false, 61502 "StyleSheet": false, 61503 "StyleSheetList": false, 61504 "SubtleCrypto": false, 61505 "SVGAElement": false, 61506 "SVGAltGlyphDefElement": false, 61507 "SVGAltGlyphElement": false, 61508 "SVGAltGlyphItemElement": false, 61509 "SVGAngle": false, 61510 "SVGAnimateColorElement": false, 61511 "SVGAnimatedAngle": false, 61512 "SVGAnimatedBoolean": false, 61513 "SVGAnimatedEnumeration": false, 61514 "SVGAnimatedInteger": false, 61515 "SVGAnimatedLength": false, 61516 "SVGAnimatedLengthList": false, 61517 "SVGAnimatedNumber": false, 61518 "SVGAnimatedNumberList": false, 61519 "SVGAnimatedPathData": false, 61520 "SVGAnimatedPoints": false, 61521 "SVGAnimatedPreserveAspectRatio": false, 61522 "SVGAnimatedRect": false, 61523 "SVGAnimatedString": false, 61524 "SVGAnimatedTransformList": false, 61525 "SVGAnimateElement": false, 61526 "SVGAnimateMotionElement": false, 61527 "SVGAnimateTransformElement": false, 61528 "SVGAnimationElement": false, 61529 "SVGCircleElement": false, 61530 "SVGClipPathElement": false, 61531 "SVGColor": false, 61532 "SVGColorProfileElement": false, 61533 "SVGColorProfileRule": false, 61534 "SVGComponentTransferFunctionElement": false, 61535 "SVGCSSRule": false, 61536 "SVGCursorElement": false, 61537 "SVGDefsElement": false, 61538 "SVGDescElement": false, 61539 "SVGDiscardElement": false, 61540 "SVGDocument": false, 61541 "SVGElement": false, 61542 "SVGElementInstance": false, 61543 "SVGElementInstanceList": false, 61544 "SVGEllipseElement": false, 61545 "SVGEvent": false,
61546 "SVGExternalResourcesRequired": false, 61547 "SVGFEBlendElement": false, 61548 "SVGFEColorMatrixElement": false, 61549 "SVGFEComponentTransferElement": false, 61550 "SVGFECompositeElement": false, 61551 "SVGFEConvolveMatrixElement": false, 61552 "SVGFEDiffuseLightingElement": false, 61553 "SVGFEDisplacementMapElement": false, 61554 "SVGFEDistantLightElement": false, 61555 "SVGFEDropShadowElement": false, 61556 "SVGFEFloodElement": false, 61557 "SVGFEFuncAElement": false, 61558 "SVGFEFuncBElement": false, 61559 "SVGFEFuncGElement": false, 61560 "SVGFEFuncRElement": false, 61561 "SVGFEGaussianBlurElement": false, 61562 "SVGFEImageElement": false, 61563 "SVGFEMergeElement": false, 61564 "SVGFEMergeNodeElement": false, 61565 "SVGFEMorphologyElement": false, 61566 "SVGFEOffsetElement": false, 61567 "SVGFEPointLightElement": false, 61568 "SVGFESpecularLightingElement": false, 61569 "SVGFESpotLightElement": false, 61570 "SVGFETileElement": false, 61571 "SVGFETurbulenceElement": false, 61572 "SVGFilterElement": false, 61573 "SVGFilterPrimitiveStandardAttributes": false, 61574 "SVGFitToViewBox": false, 61575 "SVGFontElement": false, 61576 "SVGFontFaceElement": false, 61577 "SVGFontFaceFormatElement": false, 61578 "SVGFontFaceNameElement": false, 61579 "SVGFontFaceSrcElement": false, 61580 "SVGFontFaceUriElement": false, 61581 "SVGForeignObjectElement": false, 61582 "SVGGElement": false, 61583 "SVGGeometryElement": false, 61584 "SVGGlyphElement": false, 61585 "SVGGlyphRefElement": false, 61586 "SVGGradientElement": false, 61587 "SVGGraphicsElement": false, 61588 "SVGHKernElement": false, 61589 "SVGICCColor": false, 61590 "SVGImageElement": false, 61591 "SVGLangSpace": false, 61592 "SVGLength": false, 61593 "SVGLengthList": false, 61594 "SVGLinearGradientElement": false, 61595 "SVGLineElement": false, 61596 "SVGLocatable": false, 61597 "SVGMarkerElement": false, 61598 "SVGMaskElement": false, 61599 "SVGMatrix": false, 61600 "SVGMetadataElement": false, 61601 "SVGMissingGlyphElement": false, 61602 "SVGMPathElement": false, 61603 "SVGNumber": false, 61604 "SVGNumberList": false, 61605 "SVGPaint": false, 61606 "SVGPathElement": false, 61607 "SVGPathSeg": false, 61608 "SVGPathSegArcAbs": false, 61609 "SVGPathSegArcRel": false, 61610 "SVGPathSegClosePath": false, 61611 "SVGPathSegCurvetoCubicAbs": false, 61612 "SVGPathSegCurvetoCubicRel": false, 61613 "SVGPathSegCurvetoCubicSmoothAbs": false, 61614 "SVGPathSegCurvetoCubicSmoothRel": false, 61615 "SVGPathSegCurvetoQuadraticAbs": false, 61616 "SVGPathSegCurvetoQuadraticRel": false, 61617 "SVGPathSegCurvetoQuadraticSmoothAbs": false, 61618 "SVGPathSegCurvetoQuadraticSmoothRel": false, 61619 "SVGPathSegLinetoAbs": false, 61620 "SVGPathSegLinetoHorizontalAbs": false, 61621 "SVGPathSegLinetoHorizontalRel": false, 61622 "SVGPathSegLinetoRel": false, 61623 "SVGPathSegLinetoVerticalAbs": false, 61624 "SVGPathSegLinetoVerticalRel": false, 61625 "SVGPathSegList": false, 61626 "SVGPathSegMovetoAbs": false, 61627 "SVGPathSegMovetoRel": false, 61628 "SVGPatternElement": false, 61629 "SVGPoint": false, 61630 "SVGPointList": false, 61631 "SVGPolygonElement": false, 61632 "SVGPolylineElement": false, 61633 "SVGPreserveAspectRatio": false, 61634 "SVGRadialGradientElement": false, 61635 "SVGRect": false, 61636 "SVGRectElement": false, 61637 "SVGRenderingIntent": false, 61638 "SVGScriptElement": false, 61639 "SVGSetElement": false, 61640 "SVGStopElement": false, 61641 "SVGStringList": false, 61642 "SVGStylable": false, 61643 "SVGStyleElement": false, 61644 "SVGSVGElement": false, 61645 "SVGSwitchElement": false, 61646 "SVGSymbolElement": false, 61647 "SVGTests": false, 61648 "SVGTextContentElement": false, 61649 "SVGTextElement": false, 61650 "SVGTextPathElement": false, 61651 "SVGTextPositioningElement": false, 61652 "SVGTitleElement": false, 61653 "SVGTransform": false, 61654 "SVGTransformable": false, 61655 "SVGTransformList": false, 61656 "SVGTRefElement": false, 61657 "SVGTSpanElement": false, 61658 "SVGUnitTypes": false, 61659 "SVGURIReference": false, 61660 "SVGUseElement": false, 61661 "SVGViewElement": false, 61662 "SVGViewSpec": false, 61663 "SVGVKernElement": false, 61664 "SVGZoomAndPan": false, 61665 "SVGZoomEvent": false, 61666 "Text": false, 61667 "TextDecoder": false, 61668 "TextEncoder": false, 61669 "TextEvent": false, 61670 "TextMetrics": false, 61671 "TextTrack": false, 61672 "TextTrackCue": false, 61673 "TextTrackCueList": false, 61674 "TextTrackList": false, 61675 "TimeEvent": false, 61676 "TimeRanges": false, 61677 "toolbar": false, 61678 "top": false, 61679 "Touch": false, 61680 "TouchEvent": false, 61681 "TouchList": false, 61682 "TrackEvent": false, 61683 "TransitionEvent": false, 61684 "TreeWalker": false, 61685 "UIEvent": false, 61686 "URL": false, 61687 "URLSearchParams": false, 61688 "ValidityState": false, 61689 "VTTCue": false, 61690 "WaveShaperNode": false, 61691 "WebGLActiveInfo": false, 61692 "WebGLBuffer": false, 61693 "WebGLContextEvent": false, 61694 "WebGLFramebuffer": false, 61695 "WebGLProgram": false, 61696 "WebGLRenderbuffer": false, 61697 "WebGLRenderingContext": false, 61698 "WebGLShader": false, 61699 "WebGLShaderPrecisionFormat": false, 61700 "WebGLTexture": false, 61701 "WebGLUniformLocation": false, 61702 "WebSocket": false, 61703 "WheelEvent": false, 61704 "window": false, 61705 "Window": false, 61706 "Worker": false, 61707 "XDomainRequest": false, 61708 "XMLDocument": false, 61709 "XMLHttpRequest": false, 61710 "XMLHttpRequestEventTarget": false, 61711 "XMLHttpRequestProgressEvent": false, 61712 "XMLHttpRequestUpload": false, 61713 "XMLSerializer": false, 61714 "XPathEvaluator": false, 61715 "XPathException": false, 61716 "XPathExpression": false, 61717 "XPathNamespace": false,
61718 "XPathNSResolver": false, 61719 "XPathResult": false, 61720 "XSLTProcessor": false 61721 }, 61722 "worker": { 61723 "applicationCache": false, 61724 "atob": false, 61725 "Blob": false, 61726 "BroadcastChannel": false, 61727 "btoa": false, 61728 "Cache": false, 61729 "caches": false, 61730 "clearInterval": false, 61731 "clearTimeout": false, 61732 "close": true, 61733 "console": false, 61734 "fetch": false, 61735 "FileReaderSync": false, 61736 "FormData": false, 61737 "Headers": false, 61738 "IDBCursor": false, 61739 "IDBCursorWithValue": false, 61740 "IDBDatabase": false, 61741 "IDBFactory": false, 61742 "IDBIndex": false, 61743 "IDBKeyRange": false, 61744 "IDBObjectStore": false, 61745 "IDBOpenDBRequest": false, 61746 "IDBRequest": false, 61747 "IDBTransaction": false, 61748 "IDBVersionChangeEvent": false, 61749 "ImageData": false, 61750 "importScripts": true, 61751 "indexedDB": false, 61752 "location": false, 61753 "MessageChannel": false, 61754 "MessagePort": false, 61755 "name": false, 61756 "navigator": false, 61757 "Notification": false, 61758 "onclose": true, 61759 "onconnect": true, 61760 "onerror": true, 61761 "onlanguagechange": true, 61762 "onmessage": true, 61763 "onoffline": true, 61764 "ononline": true, 61765 "onrejectionhandled": true, 61766 "onunhandledrejection": true, 61767 "performance": false, 61768 "Performance": false, 61769 "PerformanceEntry": false, 61770 "PerformanceMark": false, 61771 "PerformanceMeasure": false, 61772 "PerformanceNavigation": false, 61773 "PerformanceResourceTiming": false, 61774 "PerformanceTiming": false, 61775 "postMessage": true, 61776 "Promise": false, 61777 "Request": false, 61778 "Response": false, 61779 "self": true, 61780 "ServiceWorkerRegistration": false, 61781 "setInterval": false, 61782 "setTimeout": false, 61783 "TextDecoder": false, 61784 "TextEncoder": false, 61785 "URL": false, 61786 "URLSearchParams": false, 61787 "WebSocket": false, 61788 "Worker": false, 61789 "XMLHttpRequest": false 61790 }, 61791 "node": { 61792 "__dirname": false, 61793 "__filename": false, 61794 "arguments": false, 61795 "Buffer": false, 61796 "clearImmediate": false, 61797 "clearInterval": false, 61798 "clearTimeout": false, 61799 "console": false, 61800 "exports": true, 61801 "GLOBAL": false, 61802 "global": false, 61803 "Intl": false, 61804 "module": false, 61805 "process": false, 61806 "require": false, 61807 "root": false, 61808 "setImmediate": false, 61809 "setInterval": false, 61810 "setTimeout": false 61811 }, 61812 "commonjs": { 61813 "exports": true, 61814 "module": false, 61815 "require": false, 61816 "global": false 61817 }, 61818 "amd": { 61819 "define": false, 61820 "require": false 61821 }, 61822 "mocha": { 61823 "after": false, 61824 "afterEach": false, 61825 "before": false, 61826 "beforeEach": false, 61827 "context": false, 61828 "describe": false, 61829 "it": false, 61830 "mocha": false, 61831 "run": false, 61832 "setup": false, 61833 "specify": false, 61834 "suite": false, 61835 "suiteSetup": false, 61836 "suiteTeardown": false, 61837 "teardown": false, 61838 "test": false, 61839 "xcontext": false, 61840 "xdescribe": false, 61841 "xit": false, 61842 "xspecify": false 61843 }, 61844 "jasmine": { 61845 "afterAll": false, 61846 "afterEach": false, 61847 "beforeAll": false, 61848 "beforeEach": false, 61849 "describe": false, 61850 "expect": false, 61851 "fail": false, 61852 "fdescribe": false, 61853 "fit": false, 61854 "it": false, 61855 "jasmine": false, 61856 "pending": false, 61857 "runs": false, 61858 "spyOn": false, 61859 "waits": false, 61860 "waitsFor": false, 61861 "xdescribe": false, 61862 "xit": false 61863 }, 61864 "jest": { 61865 "afterAll": false, 61866 "afterEach": false, 61867 "beforeAll": false, 61868 "beforeEach": false, 61869 "check": false, 61870 "describe": false, 61871 "expect": false, 61872 "gen": false, 61873 "it": false, 61874 "fdescribe": false, 61875 "fit": false, 61876 "jest": false, 61877 "pit": false, 61878 "require": false, 61879 "test": false, 61880 "xdescribe": false, 61881 "xit": false, 61882 "xtest": false 61883 }, 61884 "qunit": { 61885 "asyncTest": false, 61886 "deepEqual": false, 61887 "equal": false, 61888 "expect": false, 61889 "module": false, 61890 "notDeepEqual": false, 61891 "notEqual": false, 61892 "notOk": false, 61893 "notPropEqual": false, 61894 "notStrictEqual": false, 61895 "ok": false, 61896 "propEqual": false, 61897 "QUnit": false, 61898 "raises": false, 61899 "start": false, 61900 "stop": false, 61901 "strictEqual": false, 61902 "test": false, 61903 "throws": false 61904 }, 61905 "phantomjs": { 61906 "console": true, 61907 "exports": true, 61908 "phantom": true, 61909 "require": true, 61910 "WebPage": true 61911 }, 61912 "couch": { 61913 "emit": false, 61914 "exports": false, 61915 "getRow": false, 61916 "log": false, 61917 "module": false, 61918 "provides": false, 61919 "require": false, 61920 "respond": false, 61921 "send": false, 61922 "start": false, 61923 "sum": false 61924 }, 61925 "rhino": { 61926 "defineClass": false, 61927 "deserialize": false, 61928 "gc": false, 61929 "help": false, 61930 "importClass": false, 61931 "importPackage": false, 61932 "java": false, 61933 "load": false, 61934 "loadClass": false, 61935 "Packages": false, 61936 "print": false, 61937 "quit": false, 61938 "readFile": false, 61939 "readUrl": false, 61940 "runCommand": false, 61941 "seal": false, 61942 "serialize": false, 61943 "spawn": false, 61944 "sync": false, 61945 "toint32": false, 61946 "version": false 61947 }, 61948 "nashorn": { 61949 "__DIR__": false, 61950 "__FILE__": false, 61951 "__LINE__": false, 61952 "com": false, 61953 "edu": false, 61954 "exit": false, 61955 "Java": false, 61956 "java": false, 61957 "javafx": false, 61958 "JavaImporter": false, 61959 "javax": false, 61960 "JSAdapter": false, 61961 "load": false, 61962 "loadWithNewGlobal": false, 61963 "org": false, 61964 "Packages": false, 61965 "print": false, 61966 "quit": false 61967 }, 61968 "wsh": { 61969 "ActiveXObject": true, 61970 "Enumerator": true, 61971 "GetObject": true, 61972 "ScriptEngine": true, 61973 "ScriptEngineBuildVersion": true, 61974 "ScriptEngineMajorVersion": true, 61975 "ScriptEngineMinorVersion": true, 61976 "VBArray": true, 61977 "WScript": true, 61978 "WSH": true, 61979 "XDomainRequest": true 61980 }, 61981 "jquery": { 61982 "$": false, 61983 "jQuery": false 61984 }, 61985 "yui": { 61986 "Y": false, 61987 "YUI": false, 61988 "YUI_config": false 61989 }, 61990 "shelljs": { 61991 "cat": false, 61992 "cd": false, 61993 "chmod": false, 61994 "config": false, 61995 "cp": false, 61996 "dirs": false, 61997 "echo": false, 61998 "env": false, 61999 "error": false, 62000 "exec": false, 62001 "exit": false, 62002 "find": false, 62003 "grep": false, 62004 "ls": false, 62005 "ln": false, 62006 "mkdir": false, 62007 "mv": false, 62008 "popd": false, 62009 "pushd": false, 62010 "pwd": false, 62011 "rm": false, 62012 "sed": false, 62013 "set": false, 62014 "target": false, 62015 "tempdir": false, 62016 "test": false, 62017 "touch": false, 62018 "which": false 62019 }, 62020 "prototypejs": { 62021 "$": false, 62022 "$$": false, 62023 "$A": false, 62024 "$break": false, 62025 "$continue": false, 62026 "$F": false, 62027 "$H": false, 62028 "$R": false, 62029 "$w": false, 62030 "Abstract": false, 62031 "Ajax": false, 62032 "Autocompleter": false, 62033 "Builder": false, 62034 "Class": false, 62035 "Control": false, 62036 "Draggable": false, 62037 "Draggables": false, 62038 "Droppables": false, 62039 "Effect": false, 62040 "Element": false, 62041 "Enumerable": false, 62042 "Event": false, 62043 "Field": false, 62044 "Form": false, 62045 "Hash": false, 62046 "Insertion": false, 62047 "ObjectRange": false, 62048 "PeriodicalExecuter": false, 62049 "Position": false, 62050 "Prototype": false, 62051 "Scriptaculous": false, 62052 "Selector": false, 62053 "Sortable": false,
62054 "SortableObserver": false, 62055 "Sound": false, 62056 "Template": false, 62057 "Toggle": false, 62058 "Try": false 62059 }, 62060 "meteor": { 62061 "$": false, 62062 "_": false, 62063 "Accounts": false, 62064 "AccountsClient": false, 62065 "AccountsServer": false, 62066 "AccountsCommon": false, 62067 "App": false, 62068 "Assets": false, 62069 "Blaze": false, 62070 "check": false, 62071 "Cordova": false, 62072 "DDP": false, 62073 "DDPServer": false, 62074 "DDPRateLimiter": false, 62075 "Deps": false, 62076 "EJSON": false, 62077 "Email": false, 62078 "HTTP": false, 62079 "Log": false, 62080 "Match": false, 62081 "Meteor": false, 62082 "Mongo": false, 62083 "MongoInternals": false, 62084 "Npm": false, 62085 "Package": false, 62086 "Plugin": false, 62087 "process": false, 62088 "Random": false, 62089 "ReactiveDict": false, 62090 "ReactiveVar": false, 62091 "Router": false, 62092 "ServiceConfiguration": false, 62093 "Session": false, 62094 "share": false, 62095 "Spacebars": false, 62096 "Template": false, 62097 "Tinytest": false, 62098 "Tracker": false, 62099 "UI": false, 62100 "Utils": false, 62101 "WebApp": false, 62102 "WebAppInternals": false 62103 }, 62104 "mongo": { 62105 "_isWindows": false, 62106 "_rand": false, 62107 "BulkWriteResult": false, 62108 "cat": false, 62109 "cd": false, 62110 "connect": false, 62111 "db": false, 62112 "getHostName": false, 62113 "getMemInfo": false, 62114 "hostname": false, 62115 "ISODate": false, 62116 "listFiles": false, 62117 "load": false, 62118 "ls": false, 62119 "md5sumFile": false, 62120 "mkdir": false, 62121 "Mongo": false, 62122 "NumberInt": false, 62123 "NumberLong": false, 62124 "ObjectId": false, 62125 "PlanCache": false, 62126 "print": false, 62127 "printjson": false, 62128 "pwd": false, 62129 "quit": false, 62130 "removeFile": false, 62131 "rs": false, 62132 "sh": false, 62133 "UUID": false, 62134 "version": false, 62135 "WriteResult": false 62136 }, 62137 "applescript": { 62138 "$": false, 62139 "Application": false, 62140 "Automation": false, 62141 "console": false, 62142 "delay": false, 62143 "Library": false, 62144 "ObjC": false, 62145 "ObjectSpecifier": false, 62146 "Path": false, 62147 "Progress": false, 62148 "Ref": false 62149 }, 62150 "serviceworker": { 62151 "caches": false, 62152 "Cache": false, 62153 "CacheStorage": false, 62154 "Client": false, 62155 "clients": false, 62156 "Clients": false, 62157 "ExtendableEvent": false, 62158 "ExtendableMessageEvent": false, 62159 "FetchEvent": false, 62160 "importScripts": false, 62161 "registration": false, 62162 "self": false, 62163 "ServiceWorker": false, 62164 "ServiceWorkerContainer": false, 62165 "ServiceWorkerGlobalScope": false, 62166 "ServiceWorkerMessageEvent": false, 62167 "ServiceWorkerRegistration": false, 62168 "skipWaiting": false, 62169 "WindowClient": false 62170 }, 62171 "atomtest": { 62172 "advanceClock": false, 62173 "fakeClearInterval": false, 62174 "fakeClearTimeout": false, 62175 "fakeSetInterval": false, 62176 "fakeSetTimeout": false, 62177 "resetTimeouts": false, 62178 "waitsForPromise": false 62179 }, 62180 "embertest": { 62181 "andThen": false, 62182 "click": false, 62183 "currentPath": false, 62184 "currentRouteName": false, 62185 "currentURL": false, 62186 "fillIn": false, 62187 "find": false, 62188 "findWithAssert": false, 62189 "keyEvent": false, 62190 "pauseTest": false, 62191 "resumeTest": false, 62192 "triggerEvent": false, 62193 "visit": false 62194 }, 62195 "protractor": { 62196 "$": false, 62197 "$$": false, 62198 "browser": false, 62199 "By": false, 62200 "by": false, 62201 "DartObject": false, 62202 "element": false, 62203 "protractor": false 62204 }, 62205 "shared-node-browser": { 62206 "clearInterval": false, 62207 "clearTimeout": false, 62208 "console": false, 62209 "setInterval": false, 62210 "setTimeout": false 62211 }, 62212 "webextensions": { 62213 "browser": false, 62214 "chrome": false, 62215 "opr": false 62216 }, 62217 "greasemonkey": { 62218 "GM_addStyle": false, 62219 "GM_deleteValue": false, 62220 "GM_getResourceText": false, 62221 "GM_getResourceURL": false, 62222 "GM_getValue": false, 62223 "GM_info": false, 62224 "GM_listValues": false, 62225 "GM_log": false, 62226 "GM_openInTab": false, 62227 "GM_registerMenuCommand": false, 62228 "GM_setClipboard": false, 62229 "GM_setValue": false, 62230 "GM_xmlhttpRequest": false, 62231 "unsafeWindow": false 62232 } 62233 }; 62234 62235/***/ }, 62236/* 619 */ 62237/***/ function(module, exports) { 62238 62239 module.exports = { 62240 "75": 8490, 62241 "83": 383, 62242 "107": 8490, 62243 "115": 383, 62244 "181": 924, 62245 "197": 8491, 62246 "383": 83, 62247 "452": 453, 62248 "453": 452, 62249 "455": 456, 62250 "456": 455, 62251 "458": 459, 62252 "459": 458, 62253 "497": 498, 62254 "498": 497, 62255 "837": 8126, 62256 "914": 976, 62257 "917": 1013, 62258 "920": 1012, 62259 "921": 8126, 62260 "922": 1008, 62261 "924": 181, 62262 "928": 982, 62263 "929": 1009, 62264 "931": 962, 62265 "934": 981, 62266 "937": 8486, 62267 "962": 931, 62268 "976": 914, 62269 "977": 1012, 62270 "981": 934, 62271 "982": 928, 62272 "1008": 922, 62273 "1009": 929, 62274 "1012": [ 62275 920, 62276 977 62277 ], 62278 "1013": 917, 62279 "7776": 7835, 62280 "7835": 7776, 62281 "8126": [ 62282 837, 62283 921 62284 ], 62285 "8486": 937, 62286 "8490": 75, 62287 "8491": 197, 62288 "66560": 66600, 62289 "66561": 66601, 62290 "66562": 66602, 62291 "66563": 66603, 62292 "66564": 66604, 62293 "66565": 66605, 62294 "66566": 66606, 62295 "66567": 66607, 62296 "66568": 66608, 62297 "66569": 66609, 62298 "66570": 66610, 62299 "66571": 66611, 62300 "66572": 66612, 62301 "66573": 66613, 62302 "66574": 66614, 62303 "66575": 66615, 62304 "66576": 66616, 62305 "66577": 66617, 62306 "66578": 66618, 62307 "66579": 66619, 62308 "66580": 66620, 62309 "66581": 66621, 62310 "66582": 66622, 62311 "66583": 66623, 62312 "66584": 66624, 62313 "66585": 66625, 62314 "66586": 66626, 62315 "66587": 66627, 62316 "66588": 66628, 62317 "66589": 66629, 62318 "66590": 66630, 62319 "66591": 66631, 62320 "66592": 66632, 62321 "66593": 66633, 62322 "66594": 66634, 62323 "66595": 66635, 62324 "66596": 66636, 62325 "66597": 66637, 62326 "66598": 66638, 62327 "66599": 66639, 62328 "66600": 66560, 62329 "66601": 66561, 62330 "66602": 66562, 62331 "66603": 66563, 62332 "66604": 66564, 62333 "66605": 66565, 62334 "66606": 66566, 62335 "66607": 66567, 62336 "66608": 66568, 62337 "66609": 66569, 62338 "66610": 66570, 62339 "66611": 66571, 62340 "66612": 66572, 62341 "66613": 66573, 62342 "66614": 66574, 62343 "66615": 66575, 62344 "66616": 66576, 62345 "66617": 66577, 62346 "66618": 66578, 62347 "66619": 66579, 62348 "66620": 66580, 62349 "66621": 66581, 62350 "66622": 66582, 62351 "66623": 66583, 62352 "66624": 66584, 62353 "66625": 66585, 62354 "66626": 66586, 62355 "66627": 66587,
62356 "66628": 66588, 62357 "66629": 66589, 62358 "66630": 66590, 62359 "66631": 66591, 62360 "66632": 66592, 62361 "66633": 66593, 62362 "66634": 66594, 62363 "66635": 66595, 62364 "66636": 66596, 62365 "66637": 66597, 62366 "66638": 66598, 62367 "66639": 66599, 62368 "68736": 68800, 62369 "68737": 68801, 62370 "68738": 68802, 62371 "68739": 68803, 62372 "68740": 68804, 62373 "68741": 68805, 62374 "68742": 68806, 62375 "68743": 68807, 62376 "68744": 68808, 62377 "68745": 68809, 62378 "68746": 68810, 62379 "68747": 68811, 62380 "68748": 68812, 62381 "68749": 68813, 62382 "68750": 68814, 62383 "68751": 68815, 62384 "68752": 68816, 62385 "68753": 68817, 62386 "68754": 68818, 62387 "68755": 68819, 62388 "68756": 68820, 62389 "68757": 68821, 62390 "68758": 68822, 62391 "68759": 68823, 62392 "68760": 68824, 62393 "68761": 68825, 62394 "68762": 68826, 62395 "68763": 68827, 62396 "68764": 68828, 62397 "68765": 68829, 62398 "68766": 68830, 62399 "68767": 68831, 62400 "68768": 68832, 62401 "68769": 68833, 62402 "68770": 68834, 62403 "68771": 68835, 62404 "68772": 68836, 62405 "68773": 68837, 62406 "68774": 68838, 62407 "68775": 68839, 62408 "68776": 68840, 62409 "68777": 68841, 62410 "68778": 68842, 62411 "68779": 68843, 62412 "68780": 68844, 62413 "68781": 68845, 62414 "68782": 68846, 62415 "68783": 68847, 62416 "68784": 68848, 62417 "68785": 68849, 62418 "68786": 68850, 62419 "68800": 68736, 62420 "68801": 68737, 62421 "68802": 68738, 62422 "68803": 68739, 62423 "68804": 68740, 62424 "68805": 68741, 62425 "68806": 68742, 62426 "68807": 68743, 62427 "68808": 68744, 62428 "68809": 68745, 62429 "68810": 68746, 62430 "68811": 68747, 62431 "68812": 68748, 62432 "68813": 68749, 62433 "68814": 68750, 62434 "68815": 68751, 62435 "68816": 68752, 62436 "68817": 68753, 62437 "68818": 68754, 62438 "68819": 68755, 62439 "68820": 68756, 62440 "68821": 68757, 62441 "68822": 68758, 62442 "68823": 68759, 62443 "68824": 68760, 62444 "68825": 68761, 62445 "68826": 68762, 62446 "68827": 68763, 62447 "68828": 68764, 62448 "68829": 68765, 62449 "68830": 68766, 62450 "68831": 68767, 62451 "68832": 68768, 62452 "68833": 68769, 62453 "68834": 68770, 62454 "68835": 68771, 62455 "68836": 68772, 62456 "68837": 68773, 62457 "68838": 68774, 62458 "68839": 68775, 62459 "68840": 68776, 62460 "68841": 68777, 62461 "68842": 68778, 62462 "68843": 68779, 62463 "68844": 68780, 62464 "68845": 68781, 62465 "68846": 68782, 62466 "68847": 68783, 62467 "68848": 68784, 62468 "68849": 68785, 62469 "68850": 68786, 62470 "71840": 71872, 62471 "71841": 71873, 62472 "71842": 71874, 62473 "71843": 71875, 62474 "71844": 71876, 62475 "71845": 71877, 62476 "71846": 71878, 62477 "71847": 71879, 62478 "71848": 71880, 62479 "71849": 71881, 62480 "71850": 71882, 62481 "71851": 71883, 62482 "71852": 71884, 62483 "71853": 71885, 62484 "71854": 71886, 62485 "71855": 71887, 62486 "71856": 71888, 62487 "71857": 71889, 62488 "71858": 71890, 62489 "71859": 71891, 62490 "71860": 71892, 62491 "71861": 71893, 62492 "71862": 71894, 62493 "71863": 71895, 62494 "71864": 71896, 62495 "71865": 71897, 62496 "71866": 71898, 62497 "71867": 71899, 62498 "71868": 71900, 62499 "71869": 71901, 62500 "71870": 71902, 62501 "71871": 71903, 62502 "71872": 71840, 62503 "71873": 71841, 62504 "71874": 71842, 62505 "71875": 71843, 62506 "71876": 71844, 62507 "71877": 71845, 62508 "71878": 71846, 62509 "71879": 71847, 62510 "71880": 71848, 62511 "71881": 71849, 62512 "71882": 71850, 62513 "71883": 71851, 62514 "71884": 71852, 62515 "71885": 71853, 62516 "71886": 71854, 62517 "71887": 71855, 62518 "71888": 71856, 62519 "71889": 71857, 62520 "71890": 71858, 62521 "71891": 71859, 62522 "71892": 71860, 62523 "71893": 71861, 62524 "71894": 71862, 62525 "71895": 71863, 62526 "71896": 71864, 62527 "71897": 71865, 62528 "71898": 71866, 62529 "71899": 71867, 62530 "71900": 71868, 62531 "71901": 71869, 62532 "71902": 71870, 62533 "71903": 71871 62534 }; 62535 62536/***/ } 62537/******/ ]))) 62538}); 62539;
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.