UNPKG

1.37 MBJavaScriptView Raw
1/******/ (function(modules) { // webpackBootstrap
2/******/ // The module cache
3/******/ var installedModules = {};
4/******/
5/******/ // The require function
6/******/ function __webpack_require__(moduleId) {
7/******/
8/******/ // Check if module is in cache
9/******/ if(installedModules[moduleId]) {
10/******/ return installedModules[moduleId].exports;
11/******/ }
12/******/ // Create a new module (and put it into the cache)
13/******/ var module = installedModules[moduleId] = {
14/******/ i: moduleId,
15/******/ l: false,
16/******/ exports: {}
17/******/ };
18/******/
19/******/ // Execute the module function
20/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
21/******/
22/******/ // Flag the module as loaded
23/******/ module.l = true;
24/******/
25/******/ // Return the exports of the module
26/******/ return module.exports;
27/******/ }
28/******/
29/******/
30/******/ // expose the modules object (__webpack_modules__)
31/******/ __webpack_require__.m = modules;
32/******/
33/******/ // expose the module cache
34/******/ __webpack_require__.c = installedModules;
35/******/
36/******/ // define getter function for harmony exports
37/******/ __webpack_require__.d = function(exports, name, getter) {
38/******/ if(!__webpack_require__.o(exports, name)) {
39/******/ Object.defineProperty(exports, name, {
40/******/ configurable: false,
41/******/ enumerable: true,
42/******/ get: getter
43/******/ });
44/******/ }
45/******/ };
46/******/
47/******/ // getDefaultExport function for compatibility with non-harmony modules
48/******/ __webpack_require__.n = function(module) {
49/******/ var getter = module && module.__esModule ?
50/******/ function getDefault() { return module['default']; } :
51/******/ function getModuleExports() { return module; };
52/******/ __webpack_require__.d(getter, 'a', getter);
53/******/ return getter;
54/******/ };
55/******/
56/******/ // Object.prototype.hasOwnProperty.call
57/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
58/******/
59/******/ // __webpack_public_path__
60/******/ __webpack_require__.p = "";
61/******/
62/******/ // Load entry module and return exports
63/******/ return __webpack_require__(__webpack_require__.s = 89);
64/******/ })
65/************************************************************************/
66/******/ ([
67/* 0 */
68/***/ (function(module, exports) {
69
70// shim for using process in browser
71var process = module.exports = {};
72
73// cached from whatever global is present so that test runners that stub it
74// don't break things. But we need to wrap it in a try catch in case it is
75// wrapped in strict mode code which doesn't define any globals. It's inside a
76// function because try/catches deoptimize in certain engines.
77
78var cachedSetTimeout;
79var cachedClearTimeout;
80
81function defaultSetTimout() {
82 throw new Error('setTimeout has not been defined');
83}
84function defaultClearTimeout () {
85 throw new Error('clearTimeout has not been defined');
86}
87(function () {
88 try {
89 if (typeof setTimeout === 'function') {
90 cachedSetTimeout = setTimeout;
91 } else {
92 cachedSetTimeout = defaultSetTimout;
93 }
94 } catch (e) {
95 cachedSetTimeout = defaultSetTimout;
96 }
97 try {
98 if (typeof clearTimeout === 'function') {
99 cachedClearTimeout = clearTimeout;
100 } else {
101 cachedClearTimeout = defaultClearTimeout;
102 }
103 } catch (e) {
104 cachedClearTimeout = defaultClearTimeout;
105 }
106} ())
107function runTimeout(fun) {
108 if (cachedSetTimeout === setTimeout) {
109 //normal enviroments in sane situations
110 return setTimeout(fun, 0);
111 }
112 // if setTimeout wasn't available but was latter defined
113 if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
114 cachedSetTimeout = setTimeout;
115 return setTimeout(fun, 0);
116 }
117 try {
118 // when when somebody has screwed with setTimeout but no I.E. maddness
119 return cachedSetTimeout(fun, 0);
120 } catch(e){
121 try {
122 // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
123 return cachedSetTimeout.call(null, fun, 0);
124 } catch(e){
125 // 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
126 return cachedSetTimeout.call(this, fun, 0);
127 }
128 }
129
130
131}
132function runClearTimeout(marker) {
133 if (cachedClearTimeout === clearTimeout) {
134 //normal enviroments in sane situations
135 return clearTimeout(marker);
136 }
137 // if clearTimeout wasn't available but was latter defined
138 if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
139 cachedClearTimeout = clearTimeout;
140 return clearTimeout(marker);
141 }
142 try {
143 // when when somebody has screwed with setTimeout but no I.E. maddness
144 return cachedClearTimeout(marker);
145 } catch (e){
146 try {
147 // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
148 return cachedClearTimeout.call(null, marker);
149 } catch (e){
150 // 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.
151 // Some versions of I.E. have different rules for clearTimeout vs setTimeout
152 return cachedClearTimeout.call(this, marker);
153 }
154 }
155
156
157
158}
159var queue = [];
160var draining = false;
161var currentQueue;
162var queueIndex = -1;
163
164function cleanUpNextTick() {
165 if (!draining || !currentQueue) {
166 return;
167 }
168 draining = false;
169 if (currentQueue.length) {
170 queue = currentQueue.concat(queue);
171 } else {
172 queueIndex = -1;
173 }
174 if (queue.length) {
175 drainQueue();
176 }
177}
178
179function drainQueue() {
180 if (draining) {
181 return;
182 }
183 var timeout = runTimeout(cleanUpNextTick);
184 draining = true;
185
186 var len = queue.length;
187 while(len) {
188 currentQueue = queue;
189 queue = [];
190 while (++queueIndex < len) {
191 if (currentQueue) {
192 currentQueue[queueIndex].run();
193 }
194 }
195 queueIndex = -1;
196 len = queue.length;
197 }
198 currentQueue = null;
199 draining = false;
200 runClearTimeout(timeout);
201}
202
203process.nextTick = function (fun) {
204 var args = new Array(arguments.length - 1);
205 if (arguments.length > 1) {
206 for (var i = 1; i < arguments.length; i++) {
207 args[i - 1] = arguments[i];
208 }
209 }
210 queue.push(new Item(fun, args));
211 if (queue.length === 1 && !draining) {
212 runTimeout(drainQueue);
213 }
214};
215
216// v8 likes predictible objects
217function Item(fun, array) {
218 this.fun = fun;
219 this.array = array;
220}
221Item.prototype.run = function () {
222 this.fun.apply(null, this.array);
223};
224process.title = 'browser';
225process.browser = true;
226process.env = {};
227process.argv = [];
228process.version = ''; // empty string to avoid regexp issues
229process.versions = {};
230
231function noop() {}
232
233process.on = noop;
234process.addListener = noop;
235process.once = noop;
236process.off = noop;
237process.removeListener = noop;
238process.removeAllListeners = noop;
239process.emit = noop;
240process.prependListener = noop;
241process.prependOnceListener = noop;
242
243process.listeners = function (name) { return [] }
244
245process.binding = function (name) {
246 throw new Error('process.binding is not supported');
247};
248
249process.cwd = function () { return '/' };
250process.chdir = function (dir) {
251 throw new Error('process.chdir is not supported');
252};
253process.umask = function() { return 0; };
254
255
256/***/ }),
257/* 1 */
258/***/ (function(module, exports, __webpack_require__) {
259
260"use strict";
261/* WEBPACK VAR INJECTION */(function(process) {/**
262 * Copyright (c) 2013-present, Facebook, Inc.
263 * All rights reserved.
264 *
265 * This source code is licensed under the BSD-style license found in the
266 * LICENSE file in the root directory of this source tree. An additional grant
267 * of patent rights can be found in the PATENTS file in the same directory.
268 *
269 */
270
271
272
273/**
274 * Use invariant() to assert state which your program assumes to be true.
275 *
276 * Provide sprintf-style format (only %s is supported) and arguments
277 * to provide information about what broke and what you were
278 * expecting.
279 *
280 * The invariant message will be stripped in production, but the invariant
281 * will remain to ensure logic does not differ in production.
282 */
283
284var validateFormat = function validateFormat(format) {};
285
286if (process.env.NODE_ENV !== 'production') {
287 validateFormat = function validateFormat(format) {
288 if (format === undefined) {
289 throw new Error('invariant requires an error message argument');
290 }
291 };
292}
293
294function invariant(condition, format, a, b, c, d, e, f) {
295 validateFormat(format);
296
297 if (!condition) {
298 var error;
299 if (format === undefined) {
300 error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');
301 } else {
302 var args = [a, b, c, d, e, f];
303 var argIndex = 0;
304 error = new Error(format.replace(/%s/g, function () {
305 return args[argIndex++];
306 }));
307 error.name = 'Invariant Violation';
308 }
309
310 error.framesToPop = 1; // we don't care about invariant's own frame
311 throw error;
312 }
313}
314
315module.exports = invariant;
316/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
317
318/***/ }),
319/* 2 */
320/***/ (function(module, exports, __webpack_require__) {
321
322"use strict";
323/* WEBPACK VAR INJECTION */(function(process) {/**
324 * Copyright 2014-2015, Facebook, Inc.
325 * All rights reserved.
326 *
327 * This source code is licensed under the BSD-style license found in the
328 * LICENSE file in the root directory of this source tree. An additional grant
329 * of patent rights can be found in the PATENTS file in the same directory.
330 *
331 */
332
333
334
335var emptyFunction = __webpack_require__(8);
336
337/**
338 * Similar to invariant but only logs a warning if the condition is not met.
339 * This can be used to log issues in development environments in critical
340 * paths. Removing the logging code for production environments will keep the
341 * same logic and follow the same code paths.
342 */
343
344var warning = emptyFunction;
345
346if (process.env.NODE_ENV !== 'production') {
347 var printWarning = function printWarning(format) {
348 for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
349 args[_key - 1] = arguments[_key];
350 }
351
352 var argIndex = 0;
353 var message = 'Warning: ' + format.replace(/%s/g, function () {
354 return args[argIndex++];
355 });
356 if (typeof console !== 'undefined') {
357 console.error(message);
358 }
359 try {
360 // --- Welcome to debugging React ---
361 // This error was thrown as a convenience so that you can use this stack
362 // to find the callsite that caused this warning to fire.
363 throw new Error(message);
364 } catch (x) {}
365 };
366
367 warning = function warning(condition, format) {
368 if (format === undefined) {
369 throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument');
370 }
371
372 if (format.indexOf('Failed Composite propType: ') === 0) {
373 return; // Ignore CompositeComponent proptype check.
374 }
375
376 if (!condition) {
377 for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
378 args[_key2 - 2] = arguments[_key2];
379 }
380
381 printWarning.apply(undefined, [format].concat(args));
382 }
383 };
384}
385
386module.exports = warning;
387/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
388
389/***/ }),
390/* 3 */
391/***/ (function(module, exports, __webpack_require__) {
392
393"use strict";
394/**
395 * Copyright (c) 2013-present, Facebook, Inc.
396 * All rights reserved.
397 *
398 * This source code is licensed under the BSD-style license found in the
399 * LICENSE file in the root directory of this source tree. An additional grant
400 * of patent rights can be found in the PATENTS file in the same directory.
401 *
402 *
403 */
404
405
406/**
407 * WARNING: DO NOT manually require this module.
408 * This is a replacement for `invariant(...)` used by the error code system
409 * and will _only_ be required by the corresponding babel pass.
410 * It always throws.
411 */
412
413function reactProdInvariant(code) {
414 var argCount = arguments.length - 1;
415
416 var message = 'Minified React error #' + code + '; visit ' + 'http://facebook.github.io/react/docs/error-decoder.html?invariant=' + code;
417
418 for (var argIdx = 0; argIdx < argCount; argIdx++) {
419 message += '&args[]=' + encodeURIComponent(arguments[argIdx + 1]);
420 }
421
422 message += ' for the full message or use the non-minified dev environment' + ' for full errors and additional helpful warnings.';
423
424 var error = new Error(message);
425 error.name = 'Invariant Violation';
426 error.framesToPop = 1; // we don't care about reactProdInvariant's own frame
427
428 throw error;
429}
430
431module.exports = reactProdInvariant;
432
433/***/ }),
434/* 4 */
435/***/ (function(module, exports, __webpack_require__) {
436
437"use strict";
438/*
439object-assign
440(c) Sindre Sorhus
441@license MIT
442*/
443
444
445/* eslint-disable no-unused-vars */
446var getOwnPropertySymbols = Object.getOwnPropertySymbols;
447var hasOwnProperty = Object.prototype.hasOwnProperty;
448var propIsEnumerable = Object.prototype.propertyIsEnumerable;
449
450function toObject(val) {
451 if (val === null || val === undefined) {
452 throw new TypeError('Object.assign cannot be called with null or undefined');
453 }
454
455 return Object(val);
456}
457
458function shouldUseNative() {
459 try {
460 if (!Object.assign) {
461 return false;
462 }
463
464 // Detect buggy property enumeration order in older V8 versions.
465
466 // https://bugs.chromium.org/p/v8/issues/detail?id=4118
467 var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
468 test1[5] = 'de';
469 if (Object.getOwnPropertyNames(test1)[0] === '5') {
470 return false;
471 }
472
473 // https://bugs.chromium.org/p/v8/issues/detail?id=3056
474 var test2 = {};
475 for (var i = 0; i < 10; i++) {
476 test2['_' + String.fromCharCode(i)] = i;
477 }
478 var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
479 return test2[n];
480 });
481 if (order2.join('') !== '0123456789') {
482 return false;
483 }
484
485 // https://bugs.chromium.org/p/v8/issues/detail?id=3056
486 var test3 = {};
487 'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
488 test3[letter] = letter;
489 });
490 if (Object.keys(Object.assign({}, test3)).join('') !==
491 'abcdefghijklmnopqrst') {
492 return false;
493 }
494
495 return true;
496 } catch (err) {
497 // We don't expect any of the above to throw, but better to be safe.
498 return false;
499 }
500}
501
502module.exports = shouldUseNative() ? Object.assign : function (target, source) {
503 var from;
504 var to = toObject(target);
505 var symbols;
506
507 for (var s = 1; s < arguments.length; s++) {
508 from = Object(arguments[s]);
509
510 for (var key in from) {
511 if (hasOwnProperty.call(from, key)) {
512 to[key] = from[key];
513 }
514 }
515
516 if (getOwnPropertySymbols) {
517 symbols = getOwnPropertySymbols(from);
518 for (var i = 0; i < symbols.length; i++) {
519 if (propIsEnumerable.call(from, symbols[i])) {
520 to[symbols[i]] = from[symbols[i]];
521 }
522 }
523 }
524 }
525
526 return to;
527};
528
529
530/***/ }),
531/* 5 */
532/***/ (function(module, exports, __webpack_require__) {
533
534"use strict";
535/* WEBPACK VAR INJECTION */(function(process) {/**
536 * Copyright 2013-present, Facebook, Inc.
537 * All rights reserved.
538 *
539 * This source code is licensed under the BSD-style license found in the
540 * LICENSE file in the root directory of this source tree. An additional grant
541 * of patent rights can be found in the PATENTS file in the same directory.
542 *
543 */
544
545
546
547var _prodInvariant = __webpack_require__(3);
548
549var DOMProperty = __webpack_require__(13);
550var ReactDOMComponentFlags = __webpack_require__(64);
551
552var invariant = __webpack_require__(1);
553
554var ATTR_NAME = DOMProperty.ID_ATTRIBUTE_NAME;
555var Flags = ReactDOMComponentFlags;
556
557var internalInstanceKey = '__reactInternalInstance$' + Math.random().toString(36).slice(2);
558
559/**
560 * Check if a given node should be cached.
561 */
562function shouldPrecacheNode(node, nodeID) {
563 return node.nodeType === 1 && node.getAttribute(ATTR_NAME) === String(nodeID) || node.nodeType === 8 && node.nodeValue === ' react-text: ' + nodeID + ' ' || node.nodeType === 8 && node.nodeValue === ' react-empty: ' + nodeID + ' ';
564}
565
566/**
567 * Drill down (through composites and empty components) until we get a host or
568 * host text component.
569 *
570 * This is pretty polymorphic but unavoidable with the current structure we have
571 * for `_renderedChildren`.
572 */
573function getRenderedHostOrTextFromComponent(component) {
574 var rendered;
575 while (rendered = component._renderedComponent) {
576 component = rendered;
577 }
578 return component;
579}
580
581/**
582 * Populate `_hostNode` on the rendered host/text component with the given
583 * DOM node. The passed `inst` can be a composite.
584 */
585function precacheNode(inst, node) {
586 var hostInst = getRenderedHostOrTextFromComponent(inst);
587 hostInst._hostNode = node;
588 node[internalInstanceKey] = hostInst;
589}
590
591function uncacheNode(inst) {
592 var node = inst._hostNode;
593 if (node) {
594 delete node[internalInstanceKey];
595 inst._hostNode = null;
596 }
597}
598
599/**
600 * Populate `_hostNode` on each child of `inst`, assuming that the children
601 * match up with the DOM (element) children of `node`.
602 *
603 * We cache entire levels at once to avoid an n^2 problem where we access the
604 * children of a node sequentially and have to walk from the start to our target
605 * node every time.
606 *
607 * Since we update `_renderedChildren` and the actual DOM at (slightly)
608 * different times, we could race here and see a newer `_renderedChildren` than
609 * the DOM nodes we see. To avoid this, ReactMultiChild calls
610 * `prepareToManageChildren` before we change `_renderedChildren`, at which
611 * time the container's child nodes are always cached (until it unmounts).
612 */
613function precacheChildNodes(inst, node) {
614 if (inst._flags & Flags.hasCachedChildNodes) {
615 return;
616 }
617 var children = inst._renderedChildren;
618 var childNode = node.firstChild;
619 outer: for (var name in children) {
620 if (!children.hasOwnProperty(name)) {
621 continue;
622 }
623 var childInst = children[name];
624 var childID = getRenderedHostOrTextFromComponent(childInst)._domID;
625 if (childID === 0) {
626 // We're currently unmounting this child in ReactMultiChild; skip it.
627 continue;
628 }
629 // We assume the child nodes are in the same order as the child instances.
630 for (; childNode !== null; childNode = childNode.nextSibling) {
631 if (shouldPrecacheNode(childNode, childID)) {
632 precacheNode(childInst, childNode);
633 continue outer;
634 }
635 }
636 // We reached the end of the DOM children without finding an ID match.
637 true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;
638 }
639 inst._flags |= Flags.hasCachedChildNodes;
640}
641
642/**
643 * Given a DOM node, return the closest ReactDOMComponent or
644 * ReactDOMTextComponent instance ancestor.
645 */
646function getClosestInstanceFromNode(node) {
647 if (node[internalInstanceKey]) {
648 return node[internalInstanceKey];
649 }
650
651 // Walk up the tree until we find an ancestor whose instance we have cached.
652 var parents = [];
653 while (!node[internalInstanceKey]) {
654 parents.push(node);
655 if (node.parentNode) {
656 node = node.parentNode;
657 } else {
658 // Top of the tree. This node must not be part of a React tree (or is
659 // unmounted, potentially).
660 return null;
661 }
662 }
663
664 var closest;
665 var inst;
666 for (; node && (inst = node[internalInstanceKey]); node = parents.pop()) {
667 closest = inst;
668 if (parents.length) {
669 precacheChildNodes(inst, node);
670 }
671 }
672
673 return closest;
674}
675
676/**
677 * Given a DOM node, return the ReactDOMComponent or ReactDOMTextComponent
678 * instance, or null if the node was not rendered by this React.
679 */
680function getInstanceFromNode(node) {
681 var inst = getClosestInstanceFromNode(node);
682 if (inst != null && inst._hostNode === node) {
683 return inst;
684 } else {
685 return null;
686 }
687}
688
689/**
690 * Given a ReactDOMComponent or ReactDOMTextComponent, return the corresponding
691 * DOM node.
692 */
693function getNodeFromInstance(inst) {
694 // Without this first invariant, passing a non-DOM-component triggers the next
695 // invariant for a missing parent, which is super confusing.
696 !(inst._hostNode !== undefined) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'getNodeFromInstance: Invalid argument.') : _prodInvariant('33') : void 0;
697
698 if (inst._hostNode) {
699 return inst._hostNode;
700 }
701
702 // Walk up the tree until we find an ancestor whose DOM node we have cached.
703 var parents = [];
704 while (!inst._hostNode) {
705 parents.push(inst);
706 !inst._hostParent ? process.env.NODE_ENV !== 'production' ? invariant(false, 'React DOM tree root should always have a node reference.') : _prodInvariant('34') : void 0;
707 inst = inst._hostParent;
708 }
709
710 // Now parents contains each ancestor that does *not* have a cached native
711 // node, and `inst` is the deepest ancestor that does.
712 for (; parents.length; inst = parents.pop()) {
713 precacheChildNodes(inst, inst._hostNode);
714 }
715
716 return inst._hostNode;
717}
718
719var ReactDOMComponentTree = {
720 getClosestInstanceFromNode: getClosestInstanceFromNode,
721 getInstanceFromNode: getInstanceFromNode,
722 getNodeFromInstance: getNodeFromInstance,
723 precacheChildNodes: precacheChildNodes,
724 precacheNode: precacheNode,
725 uncacheNode: uncacheNode
726};
727
728module.exports = ReactDOMComponentTree;
729/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
730
731/***/ }),
732/* 6 */
733/***/ (function(module, exports, __webpack_require__) {
734
735"use strict";
736/**
737 * Copyright (c) 2013-present, Facebook, Inc.
738 * All rights reserved.
739 *
740 * This source code is licensed under the BSD-style license found in the
741 * LICENSE file in the root directory of this source tree. An additional grant
742 * of patent rights can be found in the PATENTS file in the same directory.
743 *
744 */
745
746
747
748var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);
749
750/**
751 * Simple, lightweight module assisting with the detection and context of
752 * Worker. Helps avoid circular dependencies and allows code to reason about
753 * whether or not they are in a Worker, even if they never include the main
754 * `ReactWorker` dependency.
755 */
756var ExecutionEnvironment = {
757
758 canUseDOM: canUseDOM,
759
760 canUseWorkers: typeof Worker !== 'undefined',
761
762 canUseEventListeners: canUseDOM && !!(window.addEventListener || window.attachEvent),
763
764 canUseViewport: canUseDOM && !!window.screen,
765
766 isInWorker: !canUseDOM // For now, this is true - might change in the future.
767
768};
769
770module.exports = ExecutionEnvironment;
771
772/***/ }),
773/* 7 */
774/***/ (function(module, exports, __webpack_require__) {
775
776"use strict";
777/* WEBPACK VAR INJECTION */(function(process) {/**
778 * Copyright 2016-present, Facebook, Inc.
779 * All rights reserved.
780 *
781 * This source code is licensed under the BSD-style license found in the
782 * LICENSE file in the root directory of this source tree. An additional grant
783 * of patent rights can be found in the PATENTS file in the same directory.
784 *
785 *
786 */
787
788
789
790var _prodInvariant = __webpack_require__(18);
791
792var ReactCurrentOwner = __webpack_require__(10);
793
794var invariant = __webpack_require__(1);
795var warning = __webpack_require__(2);
796
797function isNative(fn) {
798 // Based on isNative() from Lodash
799 var funcToString = Function.prototype.toString;
800 var hasOwnProperty = Object.prototype.hasOwnProperty;
801 var reIsNative = RegExp('^' + funcToString
802 // Take an example native function source for comparison
803 .call(hasOwnProperty
804 // Strip regex characters so we can use it for regex
805 ).replace(/[\\^$.*+?()[\]{}|]/g, '\\$&'
806 // Remove hasOwnProperty from the template to make it generic
807 ).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$');
808 try {
809 var source = funcToString.call(fn);
810 return reIsNative.test(source);
811 } catch (err) {
812 return false;
813 }
814}
815
816var canUseCollections =
817// Array.from
818typeof Array.from === 'function' &&
819// Map
820typeof Map === 'function' && isNative(Map) &&
821// Map.prototype.keys
822Map.prototype != null && typeof Map.prototype.keys === 'function' && isNative(Map.prototype.keys) &&
823// Set
824typeof Set === 'function' && isNative(Set) &&
825// Set.prototype.keys
826Set.prototype != null && typeof Set.prototype.keys === 'function' && isNative(Set.prototype.keys);
827
828var setItem;
829var getItem;
830var removeItem;
831var getItemIDs;
832var addRoot;
833var removeRoot;
834var getRootIDs;
835
836if (canUseCollections) {
837 var itemMap = new Map();
838 var rootIDSet = new Set();
839
840 setItem = function (id, item) {
841 itemMap.set(id, item);
842 };
843 getItem = function (id) {
844 return itemMap.get(id);
845 };
846 removeItem = function (id) {
847 itemMap['delete'](id);
848 };
849 getItemIDs = function () {
850 return Array.from(itemMap.keys());
851 };
852
853 addRoot = function (id) {
854 rootIDSet.add(id);
855 };
856 removeRoot = function (id) {
857 rootIDSet['delete'](id);
858 };
859 getRootIDs = function () {
860 return Array.from(rootIDSet.keys());
861 };
862} else {
863 var itemByKey = {};
864 var rootByKey = {};
865
866 // Use non-numeric keys to prevent V8 performance issues:
867 // https://github.com/facebook/react/pull/7232
868 var getKeyFromID = function (id) {
869 return '.' + id;
870 };
871 var getIDFromKey = function (key) {
872 return parseInt(key.substr(1), 10);
873 };
874
875 setItem = function (id, item) {
876 var key = getKeyFromID(id);
877 itemByKey[key] = item;
878 };
879 getItem = function (id) {
880 var key = getKeyFromID(id);
881 return itemByKey[key];
882 };
883 removeItem = function (id) {
884 var key = getKeyFromID(id);
885 delete itemByKey[key];
886 };
887 getItemIDs = function () {
888 return Object.keys(itemByKey).map(getIDFromKey);
889 };
890
891 addRoot = function (id) {
892 var key = getKeyFromID(id);
893 rootByKey[key] = true;
894 };
895 removeRoot = function (id) {
896 var key = getKeyFromID(id);
897 delete rootByKey[key];
898 };
899 getRootIDs = function () {
900 return Object.keys(rootByKey).map(getIDFromKey);
901 };
902}
903
904var unmountedIDs = [];
905
906function purgeDeep(id) {
907 var item = getItem(id);
908 if (item) {
909 var childIDs = item.childIDs;
910
911 removeItem(id);
912 childIDs.forEach(purgeDeep);
913 }
914}
915
916function describeComponentFrame(name, source, ownerName) {
917 return '\n in ' + (name || 'Unknown') + (source ? ' (at ' + source.fileName.replace(/^.*[\\\/]/, '') + ':' + source.lineNumber + ')' : ownerName ? ' (created by ' + ownerName + ')' : '');
918}
919
920function getDisplayName(element) {
921 if (element == null) {
922 return '#empty';
923 } else if (typeof element === 'string' || typeof element === 'number') {
924 return '#text';
925 } else if (typeof element.type === 'string') {
926 return element.type;
927 } else {
928 return element.type.displayName || element.type.name || 'Unknown';
929 }
930}
931
932function describeID(id) {
933 var name = ReactComponentTreeHook.getDisplayName(id);
934 var element = ReactComponentTreeHook.getElement(id);
935 var ownerID = ReactComponentTreeHook.getOwnerID(id);
936 var ownerName;
937 if (ownerID) {
938 ownerName = ReactComponentTreeHook.getDisplayName(ownerID);
939 }
940 process.env.NODE_ENV !== 'production' ? warning(element, 'ReactComponentTreeHook: Missing React element for debugID %s when ' + 'building stack', id) : void 0;
941 return describeComponentFrame(name, element && element._source, ownerName);
942}
943
944var ReactComponentTreeHook = {
945 onSetChildren: function (id, nextChildIDs) {
946 var item = getItem(id);
947 !item ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Item must have been set') : _prodInvariant('144') : void 0;
948 item.childIDs = nextChildIDs;
949
950 for (var i = 0; i < nextChildIDs.length; i++) {
951 var nextChildID = nextChildIDs[i];
952 var nextChild = getItem(nextChildID);
953 !nextChild ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Expected hook events to fire for the child before its parent includes it in onSetChildren().') : _prodInvariant('140') : void 0;
954 !(nextChild.childIDs != null || typeof nextChild.element !== 'object' || nextChild.element == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Expected onSetChildren() to fire for a container child before its parent includes it in onSetChildren().') : _prodInvariant('141') : void 0;
955 !nextChild.isMounted ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Expected onMountComponent() to fire for the child before its parent includes it in onSetChildren().') : _prodInvariant('71') : void 0;
956 if (nextChild.parentID == null) {
957 nextChild.parentID = id;
958 // TODO: This shouldn't be necessary but mounting a new root during in
959 // componentWillMount currently causes not-yet-mounted components to
960 // be purged from our tree data so their parent id is missing.
961 }
962 !(nextChild.parentID === id) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Expected onBeforeMountComponent() parent and onSetChildren() to be consistent (%s has parents %s and %s).', nextChildID, nextChild.parentID, id) : _prodInvariant('142', nextChildID, nextChild.parentID, id) : void 0;
963 }
964 },
965 onBeforeMountComponent: function (id, element, parentID) {
966 var item = {
967 element: element,
968 parentID: parentID,
969 text: null,
970 childIDs: [],
971 isMounted: false,
972 updateCount: 0
973 };
974 setItem(id, item);
975 },
976 onBeforeUpdateComponent: function (id, element) {
977 var item = getItem(id);
978 if (!item || !item.isMounted) {
979 // We may end up here as a result of setState() in componentWillUnmount().
980 // In this case, ignore the element.
981 return;
982 }
983 item.element = element;
984 },
985 onMountComponent: function (id) {
986 var item = getItem(id);
987 !item ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Item must have been set') : _prodInvariant('144') : void 0;
988 item.isMounted = true;
989 var isRoot = item.parentID === 0;
990 if (isRoot) {
991 addRoot(id);
992 }
993 },
994 onUpdateComponent: function (id) {
995 var item = getItem(id);
996 if (!item || !item.isMounted) {
997 // We may end up here as a result of setState() in componentWillUnmount().
998 // In this case, ignore the element.
999 return;
1000 }
1001 item.updateCount++;
1002 },
1003 onUnmountComponent: function (id) {
1004 var item = getItem(id);
1005 if (item) {
1006 // We need to check if it exists.
1007 // `item` might not exist if it is inside an error boundary, and a sibling
1008 // error boundary child threw while mounting. Then this instance never
1009 // got a chance to mount, but it still gets an unmounting event during
1010 // the error boundary cleanup.
1011 item.isMounted = false;
1012 var isRoot = item.parentID === 0;
1013 if (isRoot) {
1014 removeRoot(id);
1015 }
1016 }
1017 unmountedIDs.push(id);
1018 },
1019 purgeUnmountedComponents: function () {
1020 if (ReactComponentTreeHook._preventPurging) {
1021 // Should only be used for testing.
1022 return;
1023 }
1024
1025 for (var i = 0; i < unmountedIDs.length; i++) {
1026 var id = unmountedIDs[i];
1027 purgeDeep(id);
1028 }
1029 unmountedIDs.length = 0;
1030 },
1031 isMounted: function (id) {
1032 var item = getItem(id);
1033 return item ? item.isMounted : false;
1034 },
1035 getCurrentStackAddendum: function (topElement) {
1036 var info = '';
1037 if (topElement) {
1038 var name = getDisplayName(topElement);
1039 var owner = topElement._owner;
1040 info += describeComponentFrame(name, topElement._source, owner && owner.getName());
1041 }
1042
1043 var currentOwner = ReactCurrentOwner.current;
1044 var id = currentOwner && currentOwner._debugID;
1045
1046 info += ReactComponentTreeHook.getStackAddendumByID(id);
1047 return info;
1048 },
1049 getStackAddendumByID: function (id) {
1050 var info = '';
1051 while (id) {
1052 info += describeID(id);
1053 id = ReactComponentTreeHook.getParentID(id);
1054 }
1055 return info;
1056 },
1057 getChildIDs: function (id) {
1058 var item = getItem(id);
1059 return item ? item.childIDs : [];
1060 },
1061 getDisplayName: function (id) {
1062 var element = ReactComponentTreeHook.getElement(id);
1063 if (!element) {
1064 return null;
1065 }
1066 return getDisplayName(element);
1067 },
1068 getElement: function (id) {
1069 var item = getItem(id);
1070 return item ? item.element : null;
1071 },
1072 getOwnerID: function (id) {
1073 var element = ReactComponentTreeHook.getElement(id);
1074 if (!element || !element._owner) {
1075 return null;
1076 }
1077 return element._owner._debugID;
1078 },
1079 getParentID: function (id) {
1080 var item = getItem(id);
1081 return item ? item.parentID : null;
1082 },
1083 getSource: function (id) {
1084 var item = getItem(id);
1085 var element = item ? item.element : null;
1086 var source = element != null ? element._source : null;
1087 return source;
1088 },
1089 getText: function (id) {
1090 var element = ReactComponentTreeHook.getElement(id);
1091 if (typeof element === 'string') {
1092 return element;
1093 } else if (typeof element === 'number') {
1094 return '' + element;
1095 } else {
1096 return null;
1097 }
1098 },
1099 getUpdateCount: function (id) {
1100 var item = getItem(id);
1101 return item ? item.updateCount : 0;
1102 },
1103
1104
1105 getRootIDs: getRootIDs,
1106 getRegisteredIDs: getItemIDs,
1107
1108 pushNonStandardWarningStack: function (isCreatingElement, currentSource) {
1109 if (typeof console.reactStack !== 'function') {
1110 return;
1111 }
1112
1113 var stack = [];
1114 var currentOwner = ReactCurrentOwner.current;
1115 var id = currentOwner && currentOwner._debugID;
1116
1117 try {
1118 if (isCreatingElement) {
1119 stack.push({
1120 name: id ? ReactComponentTreeHook.getDisplayName(id) : null,
1121 fileName: currentSource ? currentSource.fileName : null,
1122 lineNumber: currentSource ? currentSource.lineNumber : null
1123 });
1124 }
1125
1126 while (id) {
1127 var element = ReactComponentTreeHook.getElement(id);
1128 var parentID = ReactComponentTreeHook.getParentID(id);
1129 var ownerID = ReactComponentTreeHook.getOwnerID(id);
1130 var ownerName = ownerID ? ReactComponentTreeHook.getDisplayName(ownerID) : null;
1131 var source = element && element._source;
1132 stack.push({
1133 name: ownerName,
1134 fileName: source ? source.fileName : null,
1135 lineNumber: source ? source.lineNumber : null
1136 });
1137 id = parentID;
1138 }
1139 } catch (err) {
1140 // Internal state is messed up.
1141 // Stop building the stack (it's just a nice to have).
1142 }
1143
1144 console.reactStack(stack);
1145 },
1146 popNonStandardWarningStack: function () {
1147 if (typeof console.reactStackEnd !== 'function') {
1148 return;
1149 }
1150 console.reactStackEnd();
1151 }
1152};
1153
1154module.exports = ReactComponentTreeHook;
1155/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
1156
1157/***/ }),
1158/* 8 */
1159/***/ (function(module, exports, __webpack_require__) {
1160
1161"use strict";
1162
1163
1164/**
1165 * Copyright (c) 2013-present, Facebook, Inc.
1166 * All rights reserved.
1167 *
1168 * This source code is licensed under the BSD-style license found in the
1169 * LICENSE file in the root directory of this source tree. An additional grant
1170 * of patent rights can be found in the PATENTS file in the same directory.
1171 *
1172 *
1173 */
1174
1175function makeEmptyFunction(arg) {
1176 return function () {
1177 return arg;
1178 };
1179}
1180
1181/**
1182 * This function accepts and discards inputs; it has no side effects. This is
1183 * primarily useful idiomatically for overridable function endpoints which
1184 * always need to be callable, since JS lacks a null-call idiom ala Cocoa.
1185 */
1186var emptyFunction = function emptyFunction() {};
1187
1188emptyFunction.thatReturns = makeEmptyFunction;
1189emptyFunction.thatReturnsFalse = makeEmptyFunction(false);
1190emptyFunction.thatReturnsTrue = makeEmptyFunction(true);
1191emptyFunction.thatReturnsNull = makeEmptyFunction(null);
1192emptyFunction.thatReturnsThis = function () {
1193 return this;
1194};
1195emptyFunction.thatReturnsArgument = function (arg) {
1196 return arg;
1197};
1198
1199module.exports = emptyFunction;
1200
1201/***/ }),
1202/* 9 */
1203/***/ (function(module, exports, __webpack_require__) {
1204
1205"use strict";
1206/* WEBPACK VAR INJECTION */(function(process) {/**
1207 * Copyright 2016-present, Facebook, Inc.
1208 * All rights reserved.
1209 *
1210 * This source code is licensed under the BSD-style license found in the
1211 * LICENSE file in the root directory of this source tree. An additional grant
1212 * of patent rights can be found in the PATENTS file in the same directory.
1213 *
1214 *
1215 */
1216
1217
1218
1219// Trust the developer to only use ReactInstrumentation with a __DEV__ check
1220
1221var debugTool = null;
1222
1223if (process.env.NODE_ENV !== 'production') {
1224 var ReactDebugTool = __webpack_require__(116);
1225 debugTool = ReactDebugTool;
1226}
1227
1228module.exports = { debugTool: debugTool };
1229/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
1230
1231/***/ }),
1232/* 10 */
1233/***/ (function(module, exports, __webpack_require__) {
1234
1235"use strict";
1236/**
1237 * Copyright 2013-present, Facebook, Inc.
1238 * All rights reserved.
1239 *
1240 * This source code is licensed under the BSD-style license found in the
1241 * LICENSE file in the root directory of this source tree. An additional grant
1242 * of patent rights can be found in the PATENTS file in the same directory.
1243 *
1244 *
1245 */
1246
1247
1248
1249/**
1250 * Keeps track of the current owner.
1251 *
1252 * The current owner is the component who should own any components that are
1253 * currently being constructed.
1254 */
1255var ReactCurrentOwner = {
1256 /**
1257 * @internal
1258 * @type {ReactComponent}
1259 */
1260 current: null
1261};
1262
1263module.exports = ReactCurrentOwner;
1264
1265/***/ }),
1266/* 11 */
1267/***/ (function(module, exports, __webpack_require__) {
1268
1269"use strict";
1270/* WEBPACK VAR INJECTION */(function(process) {/**
1271 * Copyright 2013-present, Facebook, Inc.
1272 * All rights reserved.
1273 *
1274 * This source code is licensed under the BSD-style license found in the
1275 * LICENSE file in the root directory of this source tree. An additional grant
1276 * of patent rights can be found in the PATENTS file in the same directory.
1277 *
1278 */
1279
1280
1281
1282var _prodInvariant = __webpack_require__(3),
1283 _assign = __webpack_require__(4);
1284
1285var CallbackQueue = __webpack_require__(68);
1286var PooledClass = __webpack_require__(16);
1287var ReactFeatureFlags = __webpack_require__(69);
1288var ReactReconciler = __webpack_require__(19);
1289var Transaction = __webpack_require__(29);
1290
1291var invariant = __webpack_require__(1);
1292
1293var dirtyComponents = [];
1294var updateBatchNumber = 0;
1295var asapCallbackQueue = CallbackQueue.getPooled();
1296var asapEnqueued = false;
1297
1298var batchingStrategy = null;
1299
1300function ensureInjected() {
1301 !(ReactUpdates.ReactReconcileTransaction && batchingStrategy) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates: must inject a reconcile transaction class and batching strategy') : _prodInvariant('123') : void 0;
1302}
1303
1304var NESTED_UPDATES = {
1305 initialize: function () {
1306 this.dirtyComponentsLength = dirtyComponents.length;
1307 },
1308 close: function () {
1309 if (this.dirtyComponentsLength !== dirtyComponents.length) {
1310 // Additional updates were enqueued by componentDidUpdate handlers or
1311 // similar; before our own UPDATE_QUEUEING wrapper closes, we want to run
1312 // these new updates so that if A's componentDidUpdate calls setState on
1313 // B, B will update before the callback A's updater provided when calling
1314 // setState.
1315 dirtyComponents.splice(0, this.dirtyComponentsLength);
1316 flushBatchedUpdates();
1317 } else {
1318 dirtyComponents.length = 0;
1319 }
1320 }
1321};
1322
1323var UPDATE_QUEUEING = {
1324 initialize: function () {
1325 this.callbackQueue.reset();
1326 },
1327 close: function () {
1328 this.callbackQueue.notifyAll();
1329 }
1330};
1331
1332var TRANSACTION_WRAPPERS = [NESTED_UPDATES, UPDATE_QUEUEING];
1333
1334function ReactUpdatesFlushTransaction() {
1335 this.reinitializeTransaction();
1336 this.dirtyComponentsLength = null;
1337 this.callbackQueue = CallbackQueue.getPooled();
1338 this.reconcileTransaction = ReactUpdates.ReactReconcileTransaction.getPooled(
1339 /* useCreateElement */true);
1340}
1341
1342_assign(ReactUpdatesFlushTransaction.prototype, Transaction, {
1343 getTransactionWrappers: function () {
1344 return TRANSACTION_WRAPPERS;
1345 },
1346
1347 destructor: function () {
1348 this.dirtyComponentsLength = null;
1349 CallbackQueue.release(this.callbackQueue);
1350 this.callbackQueue = null;
1351 ReactUpdates.ReactReconcileTransaction.release(this.reconcileTransaction);
1352 this.reconcileTransaction = null;
1353 },
1354
1355 perform: function (method, scope, a) {
1356 // Essentially calls `this.reconcileTransaction.perform(method, scope, a)`
1357 // with this transaction's wrappers around it.
1358 return Transaction.perform.call(this, this.reconcileTransaction.perform, this.reconcileTransaction, method, scope, a);
1359 }
1360});
1361
1362PooledClass.addPoolingTo(ReactUpdatesFlushTransaction);
1363
1364function batchedUpdates(callback, a, b, c, d, e) {
1365 ensureInjected();
1366 return batchingStrategy.batchedUpdates(callback, a, b, c, d, e);
1367}
1368
1369/**
1370 * Array comparator for ReactComponents by mount ordering.
1371 *
1372 * @param {ReactComponent} c1 first component you're comparing
1373 * @param {ReactComponent} c2 second component you're comparing
1374 * @return {number} Return value usable by Array.prototype.sort().
1375 */
1376function mountOrderComparator(c1, c2) {
1377 return c1._mountOrder - c2._mountOrder;
1378}
1379
1380function runBatchedUpdates(transaction) {
1381 var len = transaction.dirtyComponentsLength;
1382 !(len === dirtyComponents.length) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Expected flush transaction\'s stored dirty-components length (%s) to match dirty-components array length (%s).', len, dirtyComponents.length) : _prodInvariant('124', len, dirtyComponents.length) : void 0;
1383
1384 // Since reconciling a component higher in the owner hierarchy usually (not
1385 // always -- see shouldComponentUpdate()) will reconcile children, reconcile
1386 // them before their children by sorting the array.
1387 dirtyComponents.sort(mountOrderComparator);
1388
1389 // Any updates enqueued while reconciling must be performed after this entire
1390 // batch. Otherwise, if dirtyComponents is [A, B] where A has children B and
1391 // C, B could update twice in a single batch if C's render enqueues an update
1392 // to B (since B would have already updated, we should skip it, and the only
1393 // way we can know to do so is by checking the batch counter).
1394 updateBatchNumber++;
1395
1396 for (var i = 0; i < len; i++) {
1397 // If a component is unmounted before pending changes apply, it will still
1398 // be here, but we assume that it has cleared its _pendingCallbacks and
1399 // that performUpdateIfNecessary is a noop.
1400 var component = dirtyComponents[i];
1401
1402 // If performUpdateIfNecessary happens to enqueue any new updates, we
1403 // shouldn't execute the callbacks until the next render happens, so
1404 // stash the callbacks first
1405 var callbacks = component._pendingCallbacks;
1406 component._pendingCallbacks = null;
1407
1408 var markerName;
1409 if (ReactFeatureFlags.logTopLevelRenders) {
1410 var namedComponent = component;
1411 // Duck type TopLevelWrapper. This is probably always true.
1412 if (component._currentElement.type.isReactTopLevelWrapper) {
1413 namedComponent = component._renderedComponent;
1414 }
1415 markerName = 'React update: ' + namedComponent.getName();
1416 console.time(markerName);
1417 }
1418
1419 ReactReconciler.performUpdateIfNecessary(component, transaction.reconcileTransaction, updateBatchNumber);
1420
1421 if (markerName) {
1422 console.timeEnd(markerName);
1423 }
1424
1425 if (callbacks) {
1426 for (var j = 0; j < callbacks.length; j++) {
1427 transaction.callbackQueue.enqueue(callbacks[j], component.getPublicInstance());
1428 }
1429 }
1430 }
1431}
1432
1433var flushBatchedUpdates = function () {
1434 // ReactUpdatesFlushTransaction's wrappers will clear the dirtyComponents
1435 // array and perform any updates enqueued by mount-ready handlers (i.e.,
1436 // componentDidUpdate) but we need to check here too in order to catch
1437 // updates enqueued by setState callbacks and asap calls.
1438 while (dirtyComponents.length || asapEnqueued) {
1439 if (dirtyComponents.length) {
1440 var transaction = ReactUpdatesFlushTransaction.getPooled();
1441 transaction.perform(runBatchedUpdates, null, transaction);
1442 ReactUpdatesFlushTransaction.release(transaction);
1443 }
1444
1445 if (asapEnqueued) {
1446 asapEnqueued = false;
1447 var queue = asapCallbackQueue;
1448 asapCallbackQueue = CallbackQueue.getPooled();
1449 queue.notifyAll();
1450 CallbackQueue.release(queue);
1451 }
1452 }
1453};
1454
1455/**
1456 * Mark a component as needing a rerender, adding an optional callback to a
1457 * list of functions which will be executed once the rerender occurs.
1458 */
1459function enqueueUpdate(component) {
1460 ensureInjected();
1461
1462 // Various parts of our code (such as ReactCompositeComponent's
1463 // _renderValidatedComponent) assume that calls to render aren't nested;
1464 // verify that that's the case. (This is called by each top-level update
1465 // function, like setState, forceUpdate, etc.; creation and
1466 // destruction of top-level components is guarded in ReactMount.)
1467
1468 if (!batchingStrategy.isBatchingUpdates) {
1469 batchingStrategy.batchedUpdates(enqueueUpdate, component);
1470 return;
1471 }
1472
1473 dirtyComponents.push(component);
1474 if (component._updateBatchNumber == null) {
1475 component._updateBatchNumber = updateBatchNumber + 1;
1476 }
1477}
1478
1479/**
1480 * Enqueue a callback to be run at the end of the current batching cycle. Throws
1481 * if no updates are currently being performed.
1482 */
1483function asap(callback, context) {
1484 !batchingStrategy.isBatchingUpdates ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates.asap: Can\'t enqueue an asap callback in a context whereupdates are not being batched.') : _prodInvariant('125') : void 0;
1485 asapCallbackQueue.enqueue(callback, context);
1486 asapEnqueued = true;
1487}
1488
1489var ReactUpdatesInjection = {
1490 injectReconcileTransaction: function (ReconcileTransaction) {
1491 !ReconcileTransaction ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates: must provide a reconcile transaction class') : _prodInvariant('126') : void 0;
1492 ReactUpdates.ReactReconcileTransaction = ReconcileTransaction;
1493 },
1494
1495 injectBatchingStrategy: function (_batchingStrategy) {
1496 !_batchingStrategy ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates: must provide a batching strategy') : _prodInvariant('127') : void 0;
1497 !(typeof _batchingStrategy.batchedUpdates === 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates: must provide a batchedUpdates() function') : _prodInvariant('128') : void 0;
1498 !(typeof _batchingStrategy.isBatchingUpdates === 'boolean') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates: must provide an isBatchingUpdates boolean attribute') : _prodInvariant('129') : void 0;
1499 batchingStrategy = _batchingStrategy;
1500 }
1501};
1502
1503var ReactUpdates = {
1504 /**
1505 * React references `ReactReconcileTransaction` using this property in order
1506 * to allow dependency injection.
1507 *
1508 * @internal
1509 */
1510 ReactReconcileTransaction: null,
1511
1512 batchedUpdates: batchedUpdates,
1513 enqueueUpdate: enqueueUpdate,
1514 flushBatchedUpdates: flushBatchedUpdates,
1515 injection: ReactUpdatesInjection,
1516 asap: asap
1517};
1518
1519module.exports = ReactUpdates;
1520/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
1521
1522/***/ }),
1523/* 12 */
1524/***/ (function(module, exports, __webpack_require__) {
1525
1526"use strict";
1527/* WEBPACK VAR INJECTION */(function(process) {/**
1528 * Copyright 2013-present, Facebook, Inc.
1529 * All rights reserved.
1530 *
1531 * This source code is licensed under the BSD-style license found in the
1532 * LICENSE file in the root directory of this source tree. An additional grant
1533 * of patent rights can be found in the PATENTS file in the same directory.
1534 *
1535 */
1536
1537
1538
1539var _assign = __webpack_require__(4);
1540
1541var PooledClass = __webpack_require__(16);
1542
1543var emptyFunction = __webpack_require__(8);
1544var warning = __webpack_require__(2);
1545
1546var didWarnForAddedNewProperty = false;
1547var isProxySupported = typeof Proxy === 'function';
1548
1549var shouldBeReleasedProperties = ['dispatchConfig', '_targetInst', 'nativeEvent', 'isDefaultPrevented', 'isPropagationStopped', '_dispatchListeners', '_dispatchInstances'];
1550
1551/**
1552 * @interface Event
1553 * @see http://www.w3.org/TR/DOM-Level-3-Events/
1554 */
1555var EventInterface = {
1556 type: null,
1557 target: null,
1558 // currentTarget is set when dispatching; no use in copying it here
1559 currentTarget: emptyFunction.thatReturnsNull,
1560 eventPhase: null,
1561 bubbles: null,
1562 cancelable: null,
1563 timeStamp: function (event) {
1564 return event.timeStamp || Date.now();
1565 },
1566 defaultPrevented: null,
1567 isTrusted: null
1568};
1569
1570/**
1571 * Synthetic events are dispatched by event plugins, typically in response to a
1572 * top-level event delegation handler.
1573 *
1574 * These systems should generally use pooling to reduce the frequency of garbage
1575 * collection. The system should check `isPersistent` to determine whether the
1576 * event should be released into the pool after being dispatched. Users that
1577 * need a persisted event should invoke `persist`.
1578 *
1579 * Synthetic events (and subclasses) implement the DOM Level 3 Events API by
1580 * normalizing browser quirks. Subclasses do not necessarily have to implement a
1581 * DOM interface; custom application-specific events can also subclass this.
1582 *
1583 * @param {object} dispatchConfig Configuration used to dispatch this event.
1584 * @param {*} targetInst Marker identifying the event target.
1585 * @param {object} nativeEvent Native browser event.
1586 * @param {DOMEventTarget} nativeEventTarget Target node.
1587 */
1588function SyntheticEvent(dispatchConfig, targetInst, nativeEvent, nativeEventTarget) {
1589 if (process.env.NODE_ENV !== 'production') {
1590 // these have a getter/setter for warnings
1591 delete this.nativeEvent;
1592 delete this.preventDefault;
1593 delete this.stopPropagation;
1594 }
1595
1596 this.dispatchConfig = dispatchConfig;
1597 this._targetInst = targetInst;
1598 this.nativeEvent = nativeEvent;
1599
1600 var Interface = this.constructor.Interface;
1601 for (var propName in Interface) {
1602 if (!Interface.hasOwnProperty(propName)) {
1603 continue;
1604 }
1605 if (process.env.NODE_ENV !== 'production') {
1606 delete this[propName]; // this has a getter/setter for warnings
1607 }
1608 var normalize = Interface[propName];
1609 if (normalize) {
1610 this[propName] = normalize(nativeEvent);
1611 } else {
1612 if (propName === 'target') {
1613 this.target = nativeEventTarget;
1614 } else {
1615 this[propName] = nativeEvent[propName];
1616 }
1617 }
1618 }
1619
1620 var defaultPrevented = nativeEvent.defaultPrevented != null ? nativeEvent.defaultPrevented : nativeEvent.returnValue === false;
1621 if (defaultPrevented) {
1622 this.isDefaultPrevented = emptyFunction.thatReturnsTrue;
1623 } else {
1624 this.isDefaultPrevented = emptyFunction.thatReturnsFalse;
1625 }
1626 this.isPropagationStopped = emptyFunction.thatReturnsFalse;
1627 return this;
1628}
1629
1630_assign(SyntheticEvent.prototype, {
1631 preventDefault: function () {
1632 this.defaultPrevented = true;
1633 var event = this.nativeEvent;
1634 if (!event) {
1635 return;
1636 }
1637
1638 if (event.preventDefault) {
1639 event.preventDefault();
1640 // eslint-disable-next-line valid-typeof
1641 } else if (typeof event.returnValue !== 'unknown') {
1642 event.returnValue = false;
1643 }
1644 this.isDefaultPrevented = emptyFunction.thatReturnsTrue;
1645 },
1646
1647 stopPropagation: function () {
1648 var event = this.nativeEvent;
1649 if (!event) {
1650 return;
1651 }
1652
1653 if (event.stopPropagation) {
1654 event.stopPropagation();
1655 // eslint-disable-next-line valid-typeof
1656 } else if (typeof event.cancelBubble !== 'unknown') {
1657 // The ChangeEventPlugin registers a "propertychange" event for
1658 // IE. This event does not support bubbling or cancelling, and
1659 // any references to cancelBubble throw "Member not found". A
1660 // typeof check of "unknown" circumvents this issue (and is also
1661 // IE specific).
1662 event.cancelBubble = true;
1663 }
1664
1665 this.isPropagationStopped = emptyFunction.thatReturnsTrue;
1666 },
1667
1668 /**
1669 * We release all dispatched `SyntheticEvent`s after each event loop, adding
1670 * them back into the pool. This allows a way to hold onto a reference that
1671 * won't be added back into the pool.
1672 */
1673 persist: function () {
1674 this.isPersistent = emptyFunction.thatReturnsTrue;
1675 },
1676
1677 /**
1678 * Checks if this event should be released back into the pool.
1679 *
1680 * @return {boolean} True if this should not be released, false otherwise.
1681 */
1682 isPersistent: emptyFunction.thatReturnsFalse,
1683
1684 /**
1685 * `PooledClass` looks for `destructor` on each instance it releases.
1686 */
1687 destructor: function () {
1688 var Interface = this.constructor.Interface;
1689 for (var propName in Interface) {
1690 if (process.env.NODE_ENV !== 'production') {
1691 Object.defineProperty(this, propName, getPooledWarningPropertyDefinition(propName, Interface[propName]));
1692 } else {
1693 this[propName] = null;
1694 }
1695 }
1696 for (var i = 0; i < shouldBeReleasedProperties.length; i++) {
1697 this[shouldBeReleasedProperties[i]] = null;
1698 }
1699 if (process.env.NODE_ENV !== 'production') {
1700 Object.defineProperty(this, 'nativeEvent', getPooledWarningPropertyDefinition('nativeEvent', null));
1701 Object.defineProperty(this, 'preventDefault', getPooledWarningPropertyDefinition('preventDefault', emptyFunction));
1702 Object.defineProperty(this, 'stopPropagation', getPooledWarningPropertyDefinition('stopPropagation', emptyFunction));
1703 }
1704 }
1705});
1706
1707SyntheticEvent.Interface = EventInterface;
1708
1709if (process.env.NODE_ENV !== 'production') {
1710 if (isProxySupported) {
1711 /*eslint-disable no-func-assign */
1712 SyntheticEvent = new Proxy(SyntheticEvent, {
1713 construct: function (target, args) {
1714 return this.apply(target, Object.create(target.prototype), args);
1715 },
1716 apply: function (constructor, that, args) {
1717 return new Proxy(constructor.apply(that, args), {
1718 set: function (target, prop, value) {
1719 if (prop !== 'isPersistent' && !target.constructor.Interface.hasOwnProperty(prop) && shouldBeReleasedProperties.indexOf(prop) === -1) {
1720 process.env.NODE_ENV !== 'production' ? warning(didWarnForAddedNewProperty || target.isPersistent(), "This synthetic event is reused for performance reasons. If you're " + "seeing this, you're adding a new property in the synthetic event object. " + 'The property is never released. See ' + 'https://fb.me/react-event-pooling for more information.') : void 0;
1721 didWarnForAddedNewProperty = true;
1722 }
1723 target[prop] = value;
1724 return true;
1725 }
1726 });
1727 }
1728 });
1729 /*eslint-enable no-func-assign */
1730 }
1731}
1732/**
1733 * Helper to reduce boilerplate when creating subclasses.
1734 *
1735 * @param {function} Class
1736 * @param {?object} Interface
1737 */
1738SyntheticEvent.augmentClass = function (Class, Interface) {
1739 var Super = this;
1740
1741 var E = function () {};
1742 E.prototype = Super.prototype;
1743 var prototype = new E();
1744
1745 _assign(prototype, Class.prototype);
1746 Class.prototype = prototype;
1747 Class.prototype.constructor = Class;
1748
1749 Class.Interface = _assign({}, Super.Interface, Interface);
1750 Class.augmentClass = Super.augmentClass;
1751
1752 PooledClass.addPoolingTo(Class, PooledClass.fourArgumentPooler);
1753};
1754
1755PooledClass.addPoolingTo(SyntheticEvent, PooledClass.fourArgumentPooler);
1756
1757module.exports = SyntheticEvent;
1758
1759/**
1760 * Helper to nullify syntheticEvent instance properties when destructing
1761 *
1762 * @param {object} SyntheticEvent
1763 * @param {String} propName
1764 * @return {object} defineProperty object
1765 */
1766function getPooledWarningPropertyDefinition(propName, getVal) {
1767 var isFunction = typeof getVal === 'function';
1768 return {
1769 configurable: true,
1770 set: set,
1771 get: get
1772 };
1773
1774 function set(val) {
1775 var action = isFunction ? 'setting the method' : 'setting the property';
1776 warn(action, 'This is effectively a no-op');
1777 return val;
1778 }
1779
1780 function get() {
1781 var action = isFunction ? 'accessing the method' : 'accessing the property';
1782 var result = isFunction ? 'This is a no-op function' : 'This is set to null';
1783 warn(action, result);
1784 return getVal;
1785 }
1786
1787 function warn(action, result) {
1788 var warningCondition = false;
1789 process.env.NODE_ENV !== 'production' ? warning(warningCondition, "This synthetic event is reused for performance reasons. If you're seeing this, " + "you're %s `%s` on a released/nullified synthetic event. %s. " + 'If you must keep the original synthetic event around, use event.persist(). ' + 'See https://fb.me/react-event-pooling for more information.', action, propName, result) : void 0;
1790 }
1791}
1792/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
1793
1794/***/ }),
1795/* 13 */
1796/***/ (function(module, exports, __webpack_require__) {
1797
1798"use strict";
1799/* WEBPACK VAR INJECTION */(function(process) {/**
1800 * Copyright 2013-present, Facebook, Inc.
1801 * All rights reserved.
1802 *
1803 * This source code is licensed under the BSD-style license found in the
1804 * LICENSE file in the root directory of this source tree. An additional grant
1805 * of patent rights can be found in the PATENTS file in the same directory.
1806 *
1807 */
1808
1809
1810
1811var _prodInvariant = __webpack_require__(3);
1812
1813var invariant = __webpack_require__(1);
1814
1815function checkMask(value, bitmask) {
1816 return (value & bitmask) === bitmask;
1817}
1818
1819var DOMPropertyInjection = {
1820 /**
1821 * Mapping from normalized, camelcased property names to a configuration that
1822 * specifies how the associated DOM property should be accessed or rendered.
1823 */
1824 MUST_USE_PROPERTY: 0x1,
1825 HAS_BOOLEAN_VALUE: 0x4,
1826 HAS_NUMERIC_VALUE: 0x8,
1827 HAS_POSITIVE_NUMERIC_VALUE: 0x10 | 0x8,
1828 HAS_OVERLOADED_BOOLEAN_VALUE: 0x20,
1829
1830 /**
1831 * Inject some specialized knowledge about the DOM. This takes a config object
1832 * with the following properties:
1833 *
1834 * isCustomAttribute: function that given an attribute name will return true
1835 * if it can be inserted into the DOM verbatim. Useful for data-* or aria-*
1836 * attributes where it's impossible to enumerate all of the possible
1837 * attribute names,
1838 *
1839 * Properties: object mapping DOM property name to one of the
1840 * DOMPropertyInjection constants or null. If your attribute isn't in here,
1841 * it won't get written to the DOM.
1842 *
1843 * DOMAttributeNames: object mapping React attribute name to the DOM
1844 * attribute name. Attribute names not specified use the **lowercase**
1845 * normalized name.
1846 *
1847 * DOMAttributeNamespaces: object mapping React attribute name to the DOM
1848 * attribute namespace URL. (Attribute names not specified use no namespace.)
1849 *
1850 * DOMPropertyNames: similar to DOMAttributeNames but for DOM properties.
1851 * Property names not specified use the normalized name.
1852 *
1853 * DOMMutationMethods: Properties that require special mutation methods. If
1854 * `value` is undefined, the mutation method should unset the property.
1855 *
1856 * @param {object} domPropertyConfig the config as described above.
1857 */
1858 injectDOMPropertyConfig: function (domPropertyConfig) {
1859 var Injection = DOMPropertyInjection;
1860 var Properties = domPropertyConfig.Properties || {};
1861 var DOMAttributeNamespaces = domPropertyConfig.DOMAttributeNamespaces || {};
1862 var DOMAttributeNames = domPropertyConfig.DOMAttributeNames || {};
1863 var DOMPropertyNames = domPropertyConfig.DOMPropertyNames || {};
1864 var DOMMutationMethods = domPropertyConfig.DOMMutationMethods || {};
1865
1866 if (domPropertyConfig.isCustomAttribute) {
1867 DOMProperty._isCustomAttributeFunctions.push(domPropertyConfig.isCustomAttribute);
1868 }
1869
1870 for (var propName in Properties) {
1871 !!DOMProperty.properties.hasOwnProperty(propName) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'injectDOMPropertyConfig(...): You\'re trying to inject DOM property \'%s\' which has already been injected. You may be accidentally injecting the same DOM property config twice, or you may be injecting two configs that have conflicting property names.', propName) : _prodInvariant('48', propName) : void 0;
1872
1873 var lowerCased = propName.toLowerCase();
1874 var propConfig = Properties[propName];
1875
1876 var propertyInfo = {
1877 attributeName: lowerCased,
1878 attributeNamespace: null,
1879 propertyName: propName,
1880 mutationMethod: null,
1881
1882 mustUseProperty: checkMask(propConfig, Injection.MUST_USE_PROPERTY),
1883 hasBooleanValue: checkMask(propConfig, Injection.HAS_BOOLEAN_VALUE),
1884 hasNumericValue: checkMask(propConfig, Injection.HAS_NUMERIC_VALUE),
1885 hasPositiveNumericValue: checkMask(propConfig, Injection.HAS_POSITIVE_NUMERIC_VALUE),
1886 hasOverloadedBooleanValue: checkMask(propConfig, Injection.HAS_OVERLOADED_BOOLEAN_VALUE)
1887 };
1888 !(propertyInfo.hasBooleanValue + propertyInfo.hasNumericValue + propertyInfo.hasOverloadedBooleanValue <= 1) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'DOMProperty: Value can be one of boolean, overloaded boolean, or numeric value, but not a combination: %s', propName) : _prodInvariant('50', propName) : void 0;
1889
1890 if (process.env.NODE_ENV !== 'production') {
1891 DOMProperty.getPossibleStandardName[lowerCased] = propName;
1892 }
1893
1894 if (DOMAttributeNames.hasOwnProperty(propName)) {
1895 var attributeName = DOMAttributeNames[propName];
1896 propertyInfo.attributeName = attributeName;
1897 if (process.env.NODE_ENV !== 'production') {
1898 DOMProperty.getPossibleStandardName[attributeName] = propName;
1899 }
1900 }
1901
1902 if (DOMAttributeNamespaces.hasOwnProperty(propName)) {
1903 propertyInfo.attributeNamespace = DOMAttributeNamespaces[propName];
1904 }
1905
1906 if (DOMPropertyNames.hasOwnProperty(propName)) {
1907 propertyInfo.propertyName = DOMPropertyNames[propName];
1908 }
1909
1910 if (DOMMutationMethods.hasOwnProperty(propName)) {
1911 propertyInfo.mutationMethod = DOMMutationMethods[propName];
1912 }
1913
1914 DOMProperty.properties[propName] = propertyInfo;
1915 }
1916 }
1917};
1918
1919/* eslint-disable max-len */
1920var ATTRIBUTE_NAME_START_CHAR = ':A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD';
1921/* eslint-enable max-len */
1922
1923/**
1924 * DOMProperty exports lookup objects that can be used like functions:
1925 *
1926 * > DOMProperty.isValid['id']
1927 * true
1928 * > DOMProperty.isValid['foobar']
1929 * undefined
1930 *
1931 * Although this may be confusing, it performs better in general.
1932 *
1933 * @see http://jsperf.com/key-exists
1934 * @see http://jsperf.com/key-missing
1935 */
1936var DOMProperty = {
1937 ID_ATTRIBUTE_NAME: 'data-reactid',
1938 ROOT_ATTRIBUTE_NAME: 'data-reactroot',
1939
1940 ATTRIBUTE_NAME_START_CHAR: ATTRIBUTE_NAME_START_CHAR,
1941 ATTRIBUTE_NAME_CHAR: ATTRIBUTE_NAME_START_CHAR + '\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040',
1942
1943 /**
1944 * Map from property "standard name" to an object with info about how to set
1945 * the property in the DOM. Each object contains:
1946 *
1947 * attributeName:
1948 * Used when rendering markup or with `*Attribute()`.
1949 * attributeNamespace
1950 * propertyName:
1951 * Used on DOM node instances. (This includes properties that mutate due to
1952 * external factors.)
1953 * mutationMethod:
1954 * If non-null, used instead of the property or `setAttribute()` after
1955 * initial render.
1956 * mustUseProperty:
1957 * Whether the property must be accessed and mutated as an object property.
1958 * hasBooleanValue:
1959 * Whether the property should be removed when set to a falsey value.
1960 * hasNumericValue:
1961 * Whether the property must be numeric or parse as a numeric and should be
1962 * removed when set to a falsey value.
1963 * hasPositiveNumericValue:
1964 * Whether the property must be positive numeric or parse as a positive
1965 * numeric and should be removed when set to a falsey value.
1966 * hasOverloadedBooleanValue:
1967 * Whether the property can be used as a flag as well as with a value.
1968 * Removed when strictly equal to false; present without a value when
1969 * strictly equal to true; present with a value otherwise.
1970 */
1971 properties: {},
1972
1973 /**
1974 * Mapping from lowercase property names to the properly cased version, used
1975 * to warn in the case of missing properties. Available only in __DEV__.
1976 *
1977 * autofocus is predefined, because adding it to the property whitelist
1978 * causes unintended side effects.
1979 *
1980 * @type {Object}
1981 */
1982 getPossibleStandardName: process.env.NODE_ENV !== 'production' ? { autofocus: 'autoFocus' } : null,
1983
1984 /**
1985 * All of the isCustomAttribute() functions that have been injected.
1986 */
1987 _isCustomAttributeFunctions: [],
1988
1989 /**
1990 * Checks whether a property name is a custom attribute.
1991 * @method
1992 */
1993 isCustomAttribute: function (attributeName) {
1994 for (var i = 0; i < DOMProperty._isCustomAttributeFunctions.length; i++) {
1995 var isCustomAttributeFn = DOMProperty._isCustomAttributeFunctions[i];
1996 if (isCustomAttributeFn(attributeName)) {
1997 return true;
1998 }
1999 }
2000 return false;
2001 },
2002
2003 injection: DOMPropertyInjection
2004};
2005
2006module.exports = DOMProperty;
2007/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
2008
2009/***/ }),
2010/* 14 */
2011/***/ (function(module, exports, __webpack_require__) {
2012
2013"use strict";
2014
2015
2016module.exports = __webpack_require__(17);
2017
2018
2019/***/ }),
2020/* 15 */
2021/***/ (function(module, exports, __webpack_require__) {
2022
2023"use strict";
2024/* WEBPACK VAR INJECTION */(function(process) {/**
2025 * Copyright 2014-present, Facebook, Inc.
2026 * All rights reserved.
2027 *
2028 * This source code is licensed under the BSD-style license found in the
2029 * LICENSE file in the root directory of this source tree. An additional grant
2030 * of patent rights can be found in the PATENTS file in the same directory.
2031 *
2032 */
2033
2034
2035
2036var _assign = __webpack_require__(4);
2037
2038var ReactCurrentOwner = __webpack_require__(10);
2039
2040var warning = __webpack_require__(2);
2041var canDefineProperty = __webpack_require__(26);
2042var hasOwnProperty = Object.prototype.hasOwnProperty;
2043
2044var REACT_ELEMENT_TYPE = __webpack_require__(59);
2045
2046var RESERVED_PROPS = {
2047 key: true,
2048 ref: true,
2049 __self: true,
2050 __source: true
2051};
2052
2053var specialPropKeyWarningShown, specialPropRefWarningShown;
2054
2055function hasValidRef(config) {
2056 if (process.env.NODE_ENV !== 'production') {
2057 if (hasOwnProperty.call(config, 'ref')) {
2058 var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;
2059 if (getter && getter.isReactWarning) {
2060 return false;
2061 }
2062 }
2063 }
2064 return config.ref !== undefined;
2065}
2066
2067function hasValidKey(config) {
2068 if (process.env.NODE_ENV !== 'production') {
2069 if (hasOwnProperty.call(config, 'key')) {
2070 var getter = Object.getOwnPropertyDescriptor(config, 'key').get;
2071 if (getter && getter.isReactWarning) {
2072 return false;
2073 }
2074 }
2075 }
2076 return config.key !== undefined;
2077}
2078
2079function defineKeyPropWarningGetter(props, displayName) {
2080 var warnAboutAccessingKey = function () {
2081 if (!specialPropKeyWarningShown) {
2082 specialPropKeyWarningShown = true;
2083 process.env.NODE_ENV !== 'production' ? warning(false, '%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://fb.me/react-special-props)', displayName) : void 0;
2084 }
2085 };
2086 warnAboutAccessingKey.isReactWarning = true;
2087 Object.defineProperty(props, 'key', {
2088 get: warnAboutAccessingKey,
2089 configurable: true
2090 });
2091}
2092
2093function defineRefPropWarningGetter(props, displayName) {
2094 var warnAboutAccessingRef = function () {
2095 if (!specialPropRefWarningShown) {
2096 specialPropRefWarningShown = true;
2097 process.env.NODE_ENV !== 'production' ? warning(false, '%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://fb.me/react-special-props)', displayName) : void 0;
2098 }
2099 };
2100 warnAboutAccessingRef.isReactWarning = true;
2101 Object.defineProperty(props, 'ref', {
2102 get: warnAboutAccessingRef,
2103 configurable: true
2104 });
2105}
2106
2107/**
2108 * Factory method to create a new React element. This no longer adheres to
2109 * the class pattern, so do not use new to call it. Also, no instanceof check
2110 * will work. Instead test $$typeof field against Symbol.for('react.element') to check
2111 * if something is a React Element.
2112 *
2113 * @param {*} type
2114 * @param {*} key
2115 * @param {string|object} ref
2116 * @param {*} self A *temporary* helper to detect places where `this` is
2117 * different from the `owner` when React.createElement is called, so that we
2118 * can warn. We want to get rid of owner and replace string `ref`s with arrow
2119 * functions, and as long as `this` and owner are the same, there will be no
2120 * change in behavior.
2121 * @param {*} source An annotation object (added by a transpiler or otherwise)
2122 * indicating filename, line number, and/or other information.
2123 * @param {*} owner
2124 * @param {*} props
2125 * @internal
2126 */
2127var ReactElement = function (type, key, ref, self, source, owner, props) {
2128 var element = {
2129 // This tag allow us to uniquely identify this as a React Element
2130 $$typeof: REACT_ELEMENT_TYPE,
2131
2132 // Built-in properties that belong on the element
2133 type: type,
2134 key: key,
2135 ref: ref,
2136 props: props,
2137
2138 // Record the component responsible for creating this element.
2139 _owner: owner
2140 };
2141
2142 if (process.env.NODE_ENV !== 'production') {
2143 // The validation flag is currently mutative. We put it on
2144 // an external backing store so that we can freeze the whole object.
2145 // This can be replaced with a WeakMap once they are implemented in
2146 // commonly used development environments.
2147 element._store = {};
2148
2149 // To make comparing ReactElements easier for testing purposes, we make
2150 // the validation flag non-enumerable (where possible, which should
2151 // include every environment we run tests in), so the test framework
2152 // ignores it.
2153 if (canDefineProperty) {
2154 Object.defineProperty(element._store, 'validated', {
2155 configurable: false,
2156 enumerable: false,
2157 writable: true,
2158 value: false
2159 });
2160 // self and source are DEV only properties.
2161 Object.defineProperty(element, '_self', {
2162 configurable: false,
2163 enumerable: false,
2164 writable: false,
2165 value: self
2166 });
2167 // Two elements created in two different places should be considered
2168 // equal for testing purposes and therefore we hide it from enumeration.
2169 Object.defineProperty(element, '_source', {
2170 configurable: false,
2171 enumerable: false,
2172 writable: false,
2173 value: source
2174 });
2175 } else {
2176 element._store.validated = false;
2177 element._self = self;
2178 element._source = source;
2179 }
2180 if (Object.freeze) {
2181 Object.freeze(element.props);
2182 Object.freeze(element);
2183 }
2184 }
2185
2186 return element;
2187};
2188
2189/**
2190 * Create and return a new ReactElement of the given type.
2191 * See https://facebook.github.io/react/docs/top-level-api.html#react.createelement
2192 */
2193ReactElement.createElement = function (type, config, children) {
2194 var propName;
2195
2196 // Reserved names are extracted
2197 var props = {};
2198
2199 var key = null;
2200 var ref = null;
2201 var self = null;
2202 var source = null;
2203
2204 if (config != null) {
2205 if (hasValidRef(config)) {
2206 ref = config.ref;
2207 }
2208 if (hasValidKey(config)) {
2209 key = '' + config.key;
2210 }
2211
2212 self = config.__self === undefined ? null : config.__self;
2213 source = config.__source === undefined ? null : config.__source;
2214 // Remaining properties are added to a new props object
2215 for (propName in config) {
2216 if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
2217 props[propName] = config[propName];
2218 }
2219 }
2220 }
2221
2222 // Children can be more than one argument, and those are transferred onto
2223 // the newly allocated props object.
2224 var childrenLength = arguments.length - 2;
2225 if (childrenLength === 1) {
2226 props.children = children;
2227 } else if (childrenLength > 1) {
2228 var childArray = Array(childrenLength);
2229 for (var i = 0; i < childrenLength; i++) {
2230 childArray[i] = arguments[i + 2];
2231 }
2232 if (process.env.NODE_ENV !== 'production') {
2233 if (Object.freeze) {
2234 Object.freeze(childArray);
2235 }
2236 }
2237 props.children = childArray;
2238 }
2239
2240 // Resolve default props
2241 if (type && type.defaultProps) {
2242 var defaultProps = type.defaultProps;
2243 for (propName in defaultProps) {
2244 if (props[propName] === undefined) {
2245 props[propName] = defaultProps[propName];
2246 }
2247 }
2248 }
2249 if (process.env.NODE_ENV !== 'production') {
2250 if (key || ref) {
2251 if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {
2252 var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;
2253 if (key) {
2254 defineKeyPropWarningGetter(props, displayName);
2255 }
2256 if (ref) {
2257 defineRefPropWarningGetter(props, displayName);
2258 }
2259 }
2260 }
2261 }
2262 return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
2263};
2264
2265/**
2266 * Return a function that produces ReactElements of a given type.
2267 * See https://facebook.github.io/react/docs/top-level-api.html#react.createfactory
2268 */
2269ReactElement.createFactory = function (type) {
2270 var factory = ReactElement.createElement.bind(null, type);
2271 // Expose the type on the factory and the prototype so that it can be
2272 // easily accessed on elements. E.g. `<Foo />.type === Foo`.
2273 // This should not be named `constructor` since this may not be the function
2274 // that created the element, and it may not even be a constructor.
2275 // Legacy hook TODO: Warn if this is accessed
2276 factory.type = type;
2277 return factory;
2278};
2279
2280ReactElement.cloneAndReplaceKey = function (oldElement, newKey) {
2281 var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props);
2282
2283 return newElement;
2284};
2285
2286/**
2287 * Clone and return a new ReactElement using element as the starting point.
2288 * See https://facebook.github.io/react/docs/top-level-api.html#react.cloneelement
2289 */
2290ReactElement.cloneElement = function (element, config, children) {
2291 var propName;
2292
2293 // Original props are copied
2294 var props = _assign({}, element.props);
2295
2296 // Reserved names are extracted
2297 var key = element.key;
2298 var ref = element.ref;
2299 // Self is preserved since the owner is preserved.
2300 var self = element._self;
2301 // Source is preserved since cloneElement is unlikely to be targeted by a
2302 // transpiler, and the original source is probably a better indicator of the
2303 // true owner.
2304 var source = element._source;
2305
2306 // Owner will be preserved, unless ref is overridden
2307 var owner = element._owner;
2308
2309 if (config != null) {
2310 if (hasValidRef(config)) {
2311 // Silently steal the ref from the parent.
2312 ref = config.ref;
2313 owner = ReactCurrentOwner.current;
2314 }
2315 if (hasValidKey(config)) {
2316 key = '' + config.key;
2317 }
2318
2319 // Remaining properties override existing props
2320 var defaultProps;
2321 if (element.type && element.type.defaultProps) {
2322 defaultProps = element.type.defaultProps;
2323 }
2324 for (propName in config) {
2325 if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
2326 if (config[propName] === undefined && defaultProps !== undefined) {
2327 // Resolve default props
2328 props[propName] = defaultProps[propName];
2329 } else {
2330 props[propName] = config[propName];
2331 }
2332 }
2333 }
2334 }
2335
2336 // Children can be more than one argument, and those are transferred onto
2337 // the newly allocated props object.
2338 var childrenLength = arguments.length - 2;
2339 if (childrenLength === 1) {
2340 props.children = children;
2341 } else if (childrenLength > 1) {
2342 var childArray = Array(childrenLength);
2343 for (var i = 0; i < childrenLength; i++) {
2344 childArray[i] = arguments[i + 2];
2345 }
2346 props.children = childArray;
2347 }
2348
2349 return ReactElement(element.type, key, ref, self, source, owner, props);
2350};
2351
2352/**
2353 * Verifies the object is a ReactElement.
2354 * See https://facebook.github.io/react/docs/top-level-api.html#react.isvalidelement
2355 * @param {?object} object
2356 * @return {boolean} True if `object` is a valid component.
2357 * @final
2358 */
2359ReactElement.isValidElement = function (object) {
2360 return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
2361};
2362
2363module.exports = ReactElement;
2364/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
2365
2366/***/ }),
2367/* 16 */
2368/***/ (function(module, exports, __webpack_require__) {
2369
2370"use strict";
2371/* WEBPACK VAR INJECTION */(function(process) {/**
2372 * Copyright 2013-present, Facebook, Inc.
2373 * All rights reserved.
2374 *
2375 * This source code is licensed under the BSD-style license found in the
2376 * LICENSE file in the root directory of this source tree. An additional grant
2377 * of patent rights can be found in the PATENTS file in the same directory.
2378 *
2379 *
2380 */
2381
2382
2383
2384var _prodInvariant = __webpack_require__(3);
2385
2386var invariant = __webpack_require__(1);
2387
2388/**
2389 * Static poolers. Several custom versions for each potential number of
2390 * arguments. A completely generic pooler is easy to implement, but would
2391 * require accessing the `arguments` object. In each of these, `this` refers to
2392 * the Class itself, not an instance. If any others are needed, simply add them
2393 * here, or in their own files.
2394 */
2395var oneArgumentPooler = function (copyFieldsFrom) {
2396 var Klass = this;
2397 if (Klass.instancePool.length) {
2398 var instance = Klass.instancePool.pop();
2399 Klass.call(instance, copyFieldsFrom);
2400 return instance;
2401 } else {
2402 return new Klass(copyFieldsFrom);
2403 }
2404};
2405
2406var twoArgumentPooler = function (a1, a2) {
2407 var Klass = this;
2408 if (Klass.instancePool.length) {
2409 var instance = Klass.instancePool.pop();
2410 Klass.call(instance, a1, a2);
2411 return instance;
2412 } else {
2413 return new Klass(a1, a2);
2414 }
2415};
2416
2417var threeArgumentPooler = function (a1, a2, a3) {
2418 var Klass = this;
2419 if (Klass.instancePool.length) {
2420 var instance = Klass.instancePool.pop();
2421 Klass.call(instance, a1, a2, a3);
2422 return instance;
2423 } else {
2424 return new Klass(a1, a2, a3);
2425 }
2426};
2427
2428var fourArgumentPooler = function (a1, a2, a3, a4) {
2429 var Klass = this;
2430 if (Klass.instancePool.length) {
2431 var instance = Klass.instancePool.pop();
2432 Klass.call(instance, a1, a2, a3, a4);
2433 return instance;
2434 } else {
2435 return new Klass(a1, a2, a3, a4);
2436 }
2437};
2438
2439var standardReleaser = function (instance) {
2440 var Klass = this;
2441 !(instance instanceof Klass) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Trying to release an instance into a pool of a different type.') : _prodInvariant('25') : void 0;
2442 instance.destructor();
2443 if (Klass.instancePool.length < Klass.poolSize) {
2444 Klass.instancePool.push(instance);
2445 }
2446};
2447
2448var DEFAULT_POOL_SIZE = 10;
2449var DEFAULT_POOLER = oneArgumentPooler;
2450
2451/**
2452 * Augments `CopyConstructor` to be a poolable class, augmenting only the class
2453 * itself (statically) not adding any prototypical fields. Any CopyConstructor
2454 * you give this may have a `poolSize` property, and will look for a
2455 * prototypical `destructor` on instances.
2456 *
2457 * @param {Function} CopyConstructor Constructor that can be used to reset.
2458 * @param {Function} pooler Customizable pooler.
2459 */
2460var addPoolingTo = function (CopyConstructor, pooler) {
2461 // Casting as any so that flow ignores the actual implementation and trusts
2462 // it to match the type we declared
2463 var NewKlass = CopyConstructor;
2464 NewKlass.instancePool = [];
2465 NewKlass.getPooled = pooler || DEFAULT_POOLER;
2466 if (!NewKlass.poolSize) {
2467 NewKlass.poolSize = DEFAULT_POOL_SIZE;
2468 }
2469 NewKlass.release = standardReleaser;
2470 return NewKlass;
2471};
2472
2473var PooledClass = {
2474 addPoolingTo: addPoolingTo,
2475 oneArgumentPooler: oneArgumentPooler,
2476 twoArgumentPooler: twoArgumentPooler,
2477 threeArgumentPooler: threeArgumentPooler,
2478 fourArgumentPooler: fourArgumentPooler
2479};
2480
2481module.exports = PooledClass;
2482/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
2483
2484/***/ }),
2485/* 17 */
2486/***/ (function(module, exports, __webpack_require__) {
2487
2488"use strict";
2489/* WEBPACK VAR INJECTION */(function(process) {/**
2490 * Copyright 2013-present, Facebook, Inc.
2491 * All rights reserved.
2492 *
2493 * This source code is licensed under the BSD-style license found in the
2494 * LICENSE file in the root directory of this source tree. An additional grant
2495 * of patent rights can be found in the PATENTS file in the same directory.
2496 *
2497 */
2498
2499
2500
2501var _assign = __webpack_require__(4);
2502
2503var ReactBaseClasses = __webpack_require__(57);
2504var ReactChildren = __webpack_require__(91);
2505var ReactDOMFactories = __webpack_require__(95);
2506var ReactElement = __webpack_require__(15);
2507var ReactPropTypes = __webpack_require__(99);
2508var ReactVersion = __webpack_require__(101);
2509
2510var createReactClass = __webpack_require__(102);
2511var onlyChild = __webpack_require__(104);
2512
2513var createElement = ReactElement.createElement;
2514var createFactory = ReactElement.createFactory;
2515var cloneElement = ReactElement.cloneElement;
2516
2517if (process.env.NODE_ENV !== 'production') {
2518 var lowPriorityWarning = __webpack_require__(36);
2519 var canDefineProperty = __webpack_require__(26);
2520 var ReactElementValidator = __webpack_require__(61);
2521 var didWarnPropTypesDeprecated = false;
2522 createElement = ReactElementValidator.createElement;
2523 createFactory = ReactElementValidator.createFactory;
2524 cloneElement = ReactElementValidator.cloneElement;
2525}
2526
2527var __spread = _assign;
2528var createMixin = function (mixin) {
2529 return mixin;
2530};
2531
2532if (process.env.NODE_ENV !== 'production') {
2533 var warnedForSpread = false;
2534 var warnedForCreateMixin = false;
2535 __spread = function () {
2536 lowPriorityWarning(warnedForSpread, 'React.__spread is deprecated and should not be used. Use ' + 'Object.assign directly or another helper function with similar ' + 'semantics. You may be seeing this warning due to your compiler. ' + 'See https://fb.me/react-spread-deprecation for more details.');
2537 warnedForSpread = true;
2538 return _assign.apply(null, arguments);
2539 };
2540
2541 createMixin = function (mixin) {
2542 lowPriorityWarning(warnedForCreateMixin, 'React.createMixin is deprecated and should not be used. ' + 'In React v16.0, it will be removed. ' + 'You can use this mixin directly instead. ' + 'See https://fb.me/createmixin-was-never-implemented for more info.');
2543 warnedForCreateMixin = true;
2544 return mixin;
2545 };
2546}
2547
2548var React = {
2549 // Modern
2550
2551 Children: {
2552 map: ReactChildren.map,
2553 forEach: ReactChildren.forEach,
2554 count: ReactChildren.count,
2555 toArray: ReactChildren.toArray,
2556 only: onlyChild
2557 },
2558
2559 Component: ReactBaseClasses.Component,
2560 PureComponent: ReactBaseClasses.PureComponent,
2561
2562 createElement: createElement,
2563 cloneElement: cloneElement,
2564 isValidElement: ReactElement.isValidElement,
2565
2566 // Classic
2567
2568 PropTypes: ReactPropTypes,
2569 createClass: createReactClass,
2570 createFactory: createFactory,
2571 createMixin: createMixin,
2572
2573 // This looks DOM specific but these are actually isomorphic helpers
2574 // since they are just generating DOM strings.
2575 DOM: ReactDOMFactories,
2576
2577 version: ReactVersion,
2578
2579 // Deprecated hook for JSX spread, don't use this for anything.
2580 __spread: __spread
2581};
2582
2583if (process.env.NODE_ENV !== 'production') {
2584 var warnedForCreateClass = false;
2585 if (canDefineProperty) {
2586 Object.defineProperty(React, 'PropTypes', {
2587 get: function () {
2588 lowPriorityWarning(didWarnPropTypesDeprecated, 'Accessing PropTypes via the main React package is deprecated,' + ' and will be removed in React v16.0.' + ' Use the latest available v15.* prop-types package from npm instead.' + ' For info on usage, compatibility, migration and more, see ' + 'https://fb.me/prop-types-docs');
2589 didWarnPropTypesDeprecated = true;
2590 return ReactPropTypes;
2591 }
2592 });
2593
2594 Object.defineProperty(React, 'createClass', {
2595 get: function () {
2596 lowPriorityWarning(warnedForCreateClass, 'Accessing createClass via the main React package is deprecated,' + ' and will be removed in React v16.0.' + " Use a plain JavaScript class instead. If you're not yet " + 'ready to migrate, create-react-class v15.* is available ' + 'on npm as a temporary, drop-in replacement. ' + 'For more info see https://fb.me/react-create-class');
2597 warnedForCreateClass = true;
2598 return createReactClass;
2599 }
2600 });
2601 }
2602
2603 // React.DOM factories are deprecated. Wrap these methods so that
2604 // invocations of the React.DOM namespace and alert users to switch
2605 // to the `react-dom-factories` package.
2606 React.DOM = {};
2607 var warnedForFactories = false;
2608 Object.keys(ReactDOMFactories).forEach(function (factory) {
2609 React.DOM[factory] = function () {
2610 if (!warnedForFactories) {
2611 lowPriorityWarning(false, 'Accessing factories like React.DOM.%s has been deprecated ' + 'and will be removed in v16.0+. Use the ' + 'react-dom-factories package instead. ' + ' Version 1.0 provides a drop-in replacement.' + ' For more info, see https://fb.me/react-dom-factories', factory);
2612 warnedForFactories = true;
2613 }
2614 return ReactDOMFactories[factory].apply(ReactDOMFactories, arguments);
2615 };
2616 });
2617}
2618
2619module.exports = React;
2620/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
2621
2622/***/ }),
2623/* 18 */
2624/***/ (function(module, exports, __webpack_require__) {
2625
2626"use strict";
2627/**
2628 * Copyright (c) 2013-present, Facebook, Inc.
2629 * All rights reserved.
2630 *
2631 * This source code is licensed under the BSD-style license found in the
2632 * LICENSE file in the root directory of this source tree. An additional grant
2633 * of patent rights can be found in the PATENTS file in the same directory.
2634 *
2635 *
2636 */
2637
2638
2639/**
2640 * WARNING: DO NOT manually require this module.
2641 * This is a replacement for `invariant(...)` used by the error code system
2642 * and will _only_ be required by the corresponding babel pass.
2643 * It always throws.
2644 */
2645
2646function reactProdInvariant(code) {
2647 var argCount = arguments.length - 1;
2648
2649 var message = 'Minified React error #' + code + '; visit ' + 'http://facebook.github.io/react/docs/error-decoder.html?invariant=' + code;
2650
2651 for (var argIdx = 0; argIdx < argCount; argIdx++) {
2652 message += '&args[]=' + encodeURIComponent(arguments[argIdx + 1]);
2653 }
2654
2655 message += ' for the full message or use the non-minified dev environment' + ' for full errors and additional helpful warnings.';
2656
2657 var error = new Error(message);
2658 error.name = 'Invariant Violation';
2659 error.framesToPop = 1; // we don't care about reactProdInvariant's own frame
2660
2661 throw error;
2662}
2663
2664module.exports = reactProdInvariant;
2665
2666/***/ }),
2667/* 19 */
2668/***/ (function(module, exports, __webpack_require__) {
2669
2670"use strict";
2671/* WEBPACK VAR INJECTION */(function(process) {/**
2672 * Copyright 2013-present, Facebook, Inc.
2673 * All rights reserved.
2674 *
2675 * This source code is licensed under the BSD-style license found in the
2676 * LICENSE file in the root directory of this source tree. An additional grant
2677 * of patent rights can be found in the PATENTS file in the same directory.
2678 *
2679 */
2680
2681
2682
2683var ReactRef = __webpack_require__(114);
2684var ReactInstrumentation = __webpack_require__(9);
2685
2686var warning = __webpack_require__(2);
2687
2688/**
2689 * Helper to call ReactRef.attachRefs with this composite component, split out
2690 * to avoid allocations in the transaction mount-ready queue.
2691 */
2692function attachRefs() {
2693 ReactRef.attachRefs(this, this._currentElement);
2694}
2695
2696var ReactReconciler = {
2697 /**
2698 * Initializes the component, renders markup, and registers event listeners.
2699 *
2700 * @param {ReactComponent} internalInstance
2701 * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
2702 * @param {?object} the containing host component instance
2703 * @param {?object} info about the host container
2704 * @return {?string} Rendered markup to be inserted into the DOM.
2705 * @final
2706 * @internal
2707 */
2708 mountComponent: function (internalInstance, transaction, hostParent, hostContainerInfo, context, parentDebugID) // 0 in production and for roots
2709 {
2710 if (process.env.NODE_ENV !== 'production') {
2711 if (internalInstance._debugID !== 0) {
2712 ReactInstrumentation.debugTool.onBeforeMountComponent(internalInstance._debugID, internalInstance._currentElement, parentDebugID);
2713 }
2714 }
2715 var markup = internalInstance.mountComponent(transaction, hostParent, hostContainerInfo, context, parentDebugID);
2716 if (internalInstance._currentElement && internalInstance._currentElement.ref != null) {
2717 transaction.getReactMountReady().enqueue(attachRefs, internalInstance);
2718 }
2719 if (process.env.NODE_ENV !== 'production') {
2720 if (internalInstance._debugID !== 0) {
2721 ReactInstrumentation.debugTool.onMountComponent(internalInstance._debugID);
2722 }
2723 }
2724 return markup;
2725 },
2726
2727 /**
2728 * Returns a value that can be passed to
2729 * ReactComponentEnvironment.replaceNodeWithMarkup.
2730 */
2731 getHostNode: function (internalInstance) {
2732 return internalInstance.getHostNode();
2733 },
2734
2735 /**
2736 * Releases any resources allocated by `mountComponent`.
2737 *
2738 * @final
2739 * @internal
2740 */
2741 unmountComponent: function (internalInstance, safely) {
2742 if (process.env.NODE_ENV !== 'production') {
2743 if (internalInstance._debugID !== 0) {
2744 ReactInstrumentation.debugTool.onBeforeUnmountComponent(internalInstance._debugID);
2745 }
2746 }
2747 ReactRef.detachRefs(internalInstance, internalInstance._currentElement);
2748 internalInstance.unmountComponent(safely);
2749 if (process.env.NODE_ENV !== 'production') {
2750 if (internalInstance._debugID !== 0) {
2751 ReactInstrumentation.debugTool.onUnmountComponent(internalInstance._debugID);
2752 }
2753 }
2754 },
2755
2756 /**
2757 * Update a component using a new element.
2758 *
2759 * @param {ReactComponent} internalInstance
2760 * @param {ReactElement} nextElement
2761 * @param {ReactReconcileTransaction} transaction
2762 * @param {object} context
2763 * @internal
2764 */
2765 receiveComponent: function (internalInstance, nextElement, transaction, context) {
2766 var prevElement = internalInstance._currentElement;
2767
2768 if (nextElement === prevElement && context === internalInstance._context) {
2769 // Since elements are immutable after the owner is rendered,
2770 // we can do a cheap identity compare here to determine if this is a
2771 // superfluous reconcile. It's possible for state to be mutable but such
2772 // change should trigger an update of the owner which would recreate
2773 // the element. We explicitly check for the existence of an owner since
2774 // it's possible for an element created outside a composite to be
2775 // deeply mutated and reused.
2776
2777 // TODO: Bailing out early is just a perf optimization right?
2778 // TODO: Removing the return statement should affect correctness?
2779 return;
2780 }
2781
2782 if (process.env.NODE_ENV !== 'production') {
2783 if (internalInstance._debugID !== 0) {
2784 ReactInstrumentation.debugTool.onBeforeUpdateComponent(internalInstance._debugID, nextElement);
2785 }
2786 }
2787
2788 var refsChanged = ReactRef.shouldUpdateRefs(prevElement, nextElement);
2789
2790 if (refsChanged) {
2791 ReactRef.detachRefs(internalInstance, prevElement);
2792 }
2793
2794 internalInstance.receiveComponent(nextElement, transaction, context);
2795
2796 if (refsChanged && internalInstance._currentElement && internalInstance._currentElement.ref != null) {
2797 transaction.getReactMountReady().enqueue(attachRefs, internalInstance);
2798 }
2799
2800 if (process.env.NODE_ENV !== 'production') {
2801 if (internalInstance._debugID !== 0) {
2802 ReactInstrumentation.debugTool.onUpdateComponent(internalInstance._debugID);
2803 }
2804 }
2805 },
2806
2807 /**
2808 * Flush any dirty changes in a component.
2809 *
2810 * @param {ReactComponent} internalInstance
2811 * @param {ReactReconcileTransaction} transaction
2812 * @internal
2813 */
2814 performUpdateIfNecessary: function (internalInstance, transaction, updateBatchNumber) {
2815 if (internalInstance._updateBatchNumber !== updateBatchNumber) {
2816 // The component's enqueued batch number should always be the current
2817 // batch or the following one.
2818 process.env.NODE_ENV !== 'production' ? warning(internalInstance._updateBatchNumber == null || internalInstance._updateBatchNumber === updateBatchNumber + 1, 'performUpdateIfNecessary: Unexpected batch number (current %s, ' + 'pending %s)', updateBatchNumber, internalInstance._updateBatchNumber) : void 0;
2819 return;
2820 }
2821 if (process.env.NODE_ENV !== 'production') {
2822 if (internalInstance._debugID !== 0) {
2823 ReactInstrumentation.debugTool.onBeforeUpdateComponent(internalInstance._debugID, internalInstance._currentElement);
2824 }
2825 }
2826 internalInstance.performUpdateIfNecessary(transaction);
2827 if (process.env.NODE_ENV !== 'production') {
2828 if (internalInstance._debugID !== 0) {
2829 ReactInstrumentation.debugTool.onUpdateComponent(internalInstance._debugID);
2830 }
2831 }
2832 }
2833};
2834
2835module.exports = ReactReconciler;
2836/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
2837
2838/***/ }),
2839/* 20 */
2840/***/ (function(module, exports, __webpack_require__) {
2841
2842"use strict";
2843/**
2844 * Copyright 2015-present, Facebook, Inc.
2845 * All rights reserved.
2846 *
2847 * This source code is licensed under the BSD-style license found in the
2848 * LICENSE file in the root directory of this source tree. An additional grant
2849 * of patent rights can be found in the PATENTS file in the same directory.
2850 *
2851 */
2852
2853
2854
2855var DOMNamespaces = __webpack_require__(44);
2856var setInnerHTML = __webpack_require__(31);
2857
2858var createMicrosoftUnsafeLocalFunction = __webpack_require__(45);
2859var setTextContent = __webpack_require__(73);
2860
2861var ELEMENT_NODE_TYPE = 1;
2862var DOCUMENT_FRAGMENT_NODE_TYPE = 11;
2863
2864/**
2865 * In IE (8-11) and Edge, appending nodes with no children is dramatically
2866 * faster than appending a full subtree, so we essentially queue up the
2867 * .appendChild calls here and apply them so each node is added to its parent
2868 * before any children are added.
2869 *
2870 * In other browsers, doing so is slower or neutral compared to the other order
2871 * (in Firefox, twice as slow) so we only do this inversion in IE.
2872 *
2873 * See https://github.com/spicyj/innerhtml-vs-createelement-vs-clonenode.
2874 */
2875var enableLazy = typeof document !== 'undefined' && typeof document.documentMode === 'number' || typeof navigator !== 'undefined' && typeof navigator.userAgent === 'string' && /\bEdge\/\d/.test(navigator.userAgent);
2876
2877function insertTreeChildren(tree) {
2878 if (!enableLazy) {
2879 return;
2880 }
2881 var node = tree.node;
2882 var children = tree.children;
2883 if (children.length) {
2884 for (var i = 0; i < children.length; i++) {
2885 insertTreeBefore(node, children[i], null);
2886 }
2887 } else if (tree.html != null) {
2888 setInnerHTML(node, tree.html);
2889 } else if (tree.text != null) {
2890 setTextContent(node, tree.text);
2891 }
2892}
2893
2894var insertTreeBefore = createMicrosoftUnsafeLocalFunction(function (parentNode, tree, referenceNode) {
2895 // DocumentFragments aren't actually part of the DOM after insertion so
2896 // appending children won't update the DOM. We need to ensure the fragment
2897 // is properly populated first, breaking out of our lazy approach for just
2898 // this level. Also, some <object> plugins (like Flash Player) will read
2899 // <param> nodes immediately upon insertion into the DOM, so <object>
2900 // must also be populated prior to insertion into the DOM.
2901 if (tree.node.nodeType === DOCUMENT_FRAGMENT_NODE_TYPE || tree.node.nodeType === ELEMENT_NODE_TYPE && tree.node.nodeName.toLowerCase() === 'object' && (tree.node.namespaceURI == null || tree.node.namespaceURI === DOMNamespaces.html)) {
2902 insertTreeChildren(tree);
2903 parentNode.insertBefore(tree.node, referenceNode);
2904 } else {
2905 parentNode.insertBefore(tree.node, referenceNode);
2906 insertTreeChildren(tree);
2907 }
2908});
2909
2910function replaceChildWithTree(oldNode, newTree) {
2911 oldNode.parentNode.replaceChild(newTree.node, oldNode);
2912 insertTreeChildren(newTree);
2913}
2914
2915function queueChild(parentTree, childTree) {
2916 if (enableLazy) {
2917 parentTree.children.push(childTree);
2918 } else {
2919 parentTree.node.appendChild(childTree.node);
2920 }
2921}
2922
2923function queueHTML(tree, html) {
2924 if (enableLazy) {
2925 tree.html = html;
2926 } else {
2927 setInnerHTML(tree.node, html);
2928 }
2929}
2930
2931function queueText(tree, text) {
2932 if (enableLazy) {
2933 tree.text = text;
2934 } else {
2935 setTextContent(tree.node, text);
2936 }
2937}
2938
2939function toString() {
2940 return this.node.nodeName;
2941}
2942
2943function DOMLazyTree(node) {
2944 return {
2945 node: node,
2946 children: [],
2947 html: null,
2948 text: null,
2949 toString: toString
2950 };
2951}
2952
2953DOMLazyTree.insertTreeBefore = insertTreeBefore;
2954DOMLazyTree.replaceChildWithTree = replaceChildWithTree;
2955DOMLazyTree.queueChild = queueChild;
2956DOMLazyTree.queueHTML = queueHTML;
2957DOMLazyTree.queueText = queueText;
2958
2959module.exports = DOMLazyTree;
2960
2961/***/ }),
2962/* 21 */
2963/***/ (function(module, exports, __webpack_require__) {
2964
2965"use strict";
2966/* WEBPACK VAR INJECTION */(function(process) {/**
2967 * Copyright 2013-present, Facebook, Inc.
2968 * All rights reserved.
2969 *
2970 * This source code is licensed under the BSD-style license found in the
2971 * LICENSE file in the root directory of this source tree. An additional grant
2972 * of patent rights can be found in the PATENTS file in the same directory.
2973 *
2974 */
2975
2976
2977
2978var EventPluginHub = __webpack_require__(22);
2979var EventPluginUtils = __webpack_require__(38);
2980
2981var accumulateInto = __webpack_require__(65);
2982var forEachAccumulated = __webpack_require__(66);
2983var warning = __webpack_require__(2);
2984
2985var getListener = EventPluginHub.getListener;
2986
2987/**
2988 * Some event types have a notion of different registration names for different
2989 * "phases" of propagation. This finds listeners by a given phase.
2990 */
2991function listenerAtPhase(inst, event, propagationPhase) {
2992 var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];
2993 return getListener(inst, registrationName);
2994}
2995
2996/**
2997 * Tags a `SyntheticEvent` with dispatched listeners. Creating this function
2998 * here, allows us to not have to bind or create functions for each event.
2999 * Mutating the event's members allows us to not have to create a wrapping
3000 * "dispatch" object that pairs the event with the listener.
3001 */
3002function accumulateDirectionalDispatches(inst, phase, event) {
3003 if (process.env.NODE_ENV !== 'production') {
3004 process.env.NODE_ENV !== 'production' ? warning(inst, 'Dispatching inst must not be null') : void 0;
3005 }
3006 var listener = listenerAtPhase(inst, event, phase);
3007 if (listener) {
3008 event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);
3009 event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);
3010 }
3011}
3012
3013/**
3014 * Collect dispatches (must be entirely collected before dispatching - see unit
3015 * tests). Lazily allocate the array to conserve memory. We must loop through
3016 * each event and perform the traversal for each one. We cannot perform a
3017 * single traversal for the entire collection of events because each event may
3018 * have a different target.
3019 */
3020function accumulateTwoPhaseDispatchesSingle(event) {
3021 if (event && event.dispatchConfig.phasedRegistrationNames) {
3022 EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);
3023 }
3024}
3025
3026/**
3027 * Same as `accumulateTwoPhaseDispatchesSingle`, but skips over the targetID.
3028 */
3029function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {
3030 if (event && event.dispatchConfig.phasedRegistrationNames) {
3031 var targetInst = event._targetInst;
3032 var parentInst = targetInst ? EventPluginUtils.getParentInstance(targetInst) : null;
3033 EventPluginUtils.traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);
3034 }
3035}
3036
3037/**
3038 * Accumulates without regard to direction, does not look for phased
3039 * registration names. Same as `accumulateDirectDispatchesSingle` but without
3040 * requiring that the `dispatchMarker` be the same as the dispatched ID.
3041 */
3042function accumulateDispatches(inst, ignoredDirection, event) {
3043 if (event && event.dispatchConfig.registrationName) {
3044 var registrationName = event.dispatchConfig.registrationName;
3045 var listener = getListener(inst, registrationName);
3046 if (listener) {
3047 event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);
3048 event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);
3049 }
3050 }
3051}
3052
3053/**
3054 * Accumulates dispatches on an `SyntheticEvent`, but only for the
3055 * `dispatchMarker`.
3056 * @param {SyntheticEvent} event
3057 */
3058function accumulateDirectDispatchesSingle(event) {
3059 if (event && event.dispatchConfig.registrationName) {
3060 accumulateDispatches(event._targetInst, null, event);
3061 }
3062}
3063
3064function accumulateTwoPhaseDispatches(events) {
3065 forEachAccumulated(events, accumulateTwoPhaseDispatchesSingle);
3066}
3067
3068function accumulateTwoPhaseDispatchesSkipTarget(events) {
3069 forEachAccumulated(events, accumulateTwoPhaseDispatchesSingleSkipTarget);
3070}
3071
3072function accumulateEnterLeaveDispatches(leave, enter, from, to) {
3073 EventPluginUtils.traverseEnterLeave(from, to, accumulateDispatches, leave, enter);
3074}
3075
3076function accumulateDirectDispatches(events) {
3077 forEachAccumulated(events, accumulateDirectDispatchesSingle);
3078}
3079
3080/**
3081 * A small set of propagation patterns, each of which will accept a small amount
3082 * of information, and generate a set of "dispatch ready event objects" - which
3083 * are sets of events that have already been annotated with a set of dispatched
3084 * listener functions/ids. The API is designed this way to discourage these
3085 * propagation strategies from actually executing the dispatches, since we
3086 * always want to collect the entire set of dispatches before executing event a
3087 * single one.
3088 *
3089 * @constructor EventPropagators
3090 */
3091var EventPropagators = {
3092 accumulateTwoPhaseDispatches: accumulateTwoPhaseDispatches,
3093 accumulateTwoPhaseDispatchesSkipTarget: accumulateTwoPhaseDispatchesSkipTarget,
3094 accumulateDirectDispatches: accumulateDirectDispatches,
3095 accumulateEnterLeaveDispatches: accumulateEnterLeaveDispatches
3096};
3097
3098module.exports = EventPropagators;
3099/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
3100
3101/***/ }),
3102/* 22 */
3103/***/ (function(module, exports, __webpack_require__) {
3104
3105"use strict";
3106/* WEBPACK VAR INJECTION */(function(process) {/**
3107 * Copyright 2013-present, Facebook, Inc.
3108 * All rights reserved.
3109 *
3110 * This source code is licensed under the BSD-style license found in the
3111 * LICENSE file in the root directory of this source tree. An additional grant
3112 * of patent rights can be found in the PATENTS file in the same directory.
3113 *
3114 */
3115
3116
3117
3118var _prodInvariant = __webpack_require__(3);
3119
3120var EventPluginRegistry = __webpack_require__(28);
3121var EventPluginUtils = __webpack_require__(38);
3122var ReactErrorUtils = __webpack_require__(39);
3123
3124var accumulateInto = __webpack_require__(65);
3125var forEachAccumulated = __webpack_require__(66);
3126var invariant = __webpack_require__(1);
3127
3128/**
3129 * Internal store for event listeners
3130 */
3131var listenerBank = {};
3132
3133/**
3134 * Internal queue of events that have accumulated their dispatches and are
3135 * waiting to have their dispatches executed.
3136 */
3137var eventQueue = null;
3138
3139/**
3140 * Dispatches an event and releases it back into the pool, unless persistent.
3141 *
3142 * @param {?object} event Synthetic event to be dispatched.
3143 * @param {boolean} simulated If the event is simulated (changes exn behavior)
3144 * @private
3145 */
3146var executeDispatchesAndRelease = function (event, simulated) {
3147 if (event) {
3148 EventPluginUtils.executeDispatchesInOrder(event, simulated);
3149
3150 if (!event.isPersistent()) {
3151 event.constructor.release(event);
3152 }
3153 }
3154};
3155var executeDispatchesAndReleaseSimulated = function (e) {
3156 return executeDispatchesAndRelease(e, true);
3157};
3158var executeDispatchesAndReleaseTopLevel = function (e) {
3159 return executeDispatchesAndRelease(e, false);
3160};
3161
3162var getDictionaryKey = function (inst) {
3163 // Prevents V8 performance issue:
3164 // https://github.com/facebook/react/pull/7232
3165 return '.' + inst._rootNodeID;
3166};
3167
3168function isInteractive(tag) {
3169 return tag === 'button' || tag === 'input' || tag === 'select' || tag === 'textarea';
3170}
3171
3172function shouldPreventMouseEvent(name, type, props) {
3173 switch (name) {
3174 case 'onClick':
3175 case 'onClickCapture':
3176 case 'onDoubleClick':
3177 case 'onDoubleClickCapture':
3178 case 'onMouseDown':
3179 case 'onMouseDownCapture':
3180 case 'onMouseMove':
3181 case 'onMouseMoveCapture':
3182 case 'onMouseUp':
3183 case 'onMouseUpCapture':
3184 return !!(props.disabled && isInteractive(type));
3185 default:
3186 return false;
3187 }
3188}
3189
3190/**
3191 * This is a unified interface for event plugins to be installed and configured.
3192 *
3193 * Event plugins can implement the following properties:
3194 *
3195 * `extractEvents` {function(string, DOMEventTarget, string, object): *}
3196 * Required. When a top-level event is fired, this method is expected to
3197 * extract synthetic events that will in turn be queued and dispatched.
3198 *
3199 * `eventTypes` {object}
3200 * Optional, plugins that fire events must publish a mapping of registration
3201 * names that are used to register listeners. Values of this mapping must
3202 * be objects that contain `registrationName` or `phasedRegistrationNames`.
3203 *
3204 * `executeDispatch` {function(object, function, string)}
3205 * Optional, allows plugins to override how an event gets dispatched. By
3206 * default, the listener is simply invoked.
3207 *
3208 * Each plugin that is injected into `EventsPluginHub` is immediately operable.
3209 *
3210 * @public
3211 */
3212var EventPluginHub = {
3213 /**
3214 * Methods for injecting dependencies.
3215 */
3216 injection: {
3217 /**
3218 * @param {array} InjectedEventPluginOrder
3219 * @public
3220 */
3221 injectEventPluginOrder: EventPluginRegistry.injectEventPluginOrder,
3222
3223 /**
3224 * @param {object} injectedNamesToPlugins Map from names to plugin modules.
3225 */
3226 injectEventPluginsByName: EventPluginRegistry.injectEventPluginsByName
3227 },
3228
3229 /**
3230 * Stores `listener` at `listenerBank[registrationName][key]`. Is idempotent.
3231 *
3232 * @param {object} inst The instance, which is the source of events.
3233 * @param {string} registrationName Name of listener (e.g. `onClick`).
3234 * @param {function} listener The callback to store.
3235 */
3236 putListener: function (inst, registrationName, listener) {
3237 !(typeof listener === 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Expected %s listener to be a function, instead got type %s', registrationName, typeof listener) : _prodInvariant('94', registrationName, typeof listener) : void 0;
3238
3239 var key = getDictionaryKey(inst);
3240 var bankForRegistrationName = listenerBank[registrationName] || (listenerBank[registrationName] = {});
3241 bankForRegistrationName[key] = listener;
3242
3243 var PluginModule = EventPluginRegistry.registrationNameModules[registrationName];
3244 if (PluginModule && PluginModule.didPutListener) {
3245 PluginModule.didPutListener(inst, registrationName, listener);
3246 }
3247 },
3248
3249 /**
3250 * @param {object} inst The instance, which is the source of events.
3251 * @param {string} registrationName Name of listener (e.g. `onClick`).
3252 * @return {?function} The stored callback.
3253 */
3254 getListener: function (inst, registrationName) {
3255 // TODO: shouldPreventMouseEvent is DOM-specific and definitely should not
3256 // live here; needs to be moved to a better place soon
3257 var bankForRegistrationName = listenerBank[registrationName];
3258 if (shouldPreventMouseEvent(registrationName, inst._currentElement.type, inst._currentElement.props)) {
3259 return null;
3260 }
3261 var key = getDictionaryKey(inst);
3262 return bankForRegistrationName && bankForRegistrationName[key];
3263 },
3264
3265 /**
3266 * Deletes a listener from the registration bank.
3267 *
3268 * @param {object} inst The instance, which is the source of events.
3269 * @param {string} registrationName Name of listener (e.g. `onClick`).
3270 */
3271 deleteListener: function (inst, registrationName) {
3272 var PluginModule = EventPluginRegistry.registrationNameModules[registrationName];
3273 if (PluginModule && PluginModule.willDeleteListener) {
3274 PluginModule.willDeleteListener(inst, registrationName);
3275 }
3276
3277 var bankForRegistrationName = listenerBank[registrationName];
3278 // TODO: This should never be null -- when is it?
3279 if (bankForRegistrationName) {
3280 var key = getDictionaryKey(inst);
3281 delete bankForRegistrationName[key];
3282 }
3283 },
3284
3285 /**
3286 * Deletes all listeners for the DOM element with the supplied ID.
3287 *
3288 * @param {object} inst The instance, which is the source of events.
3289 */
3290 deleteAllListeners: function (inst) {
3291 var key = getDictionaryKey(inst);
3292 for (var registrationName in listenerBank) {
3293 if (!listenerBank.hasOwnProperty(registrationName)) {
3294 continue;
3295 }
3296
3297 if (!listenerBank[registrationName][key]) {
3298 continue;
3299 }
3300
3301 var PluginModule = EventPluginRegistry.registrationNameModules[registrationName];
3302 if (PluginModule && PluginModule.willDeleteListener) {
3303 PluginModule.willDeleteListener(inst, registrationName);
3304 }
3305
3306 delete listenerBank[registrationName][key];
3307 }
3308 },
3309
3310 /**
3311 * Allows registered plugins an opportunity to extract events from top-level
3312 * native browser events.
3313 *
3314 * @return {*} An accumulation of synthetic events.
3315 * @internal
3316 */
3317 extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
3318 var events;
3319 var plugins = EventPluginRegistry.plugins;
3320 for (var i = 0; i < plugins.length; i++) {
3321 // Not every plugin in the ordering may be loaded at runtime.
3322 var possiblePlugin = plugins[i];
3323 if (possiblePlugin) {
3324 var extractedEvents = possiblePlugin.extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget);
3325 if (extractedEvents) {
3326 events = accumulateInto(events, extractedEvents);
3327 }
3328 }
3329 }
3330 return events;
3331 },
3332
3333 /**
3334 * Enqueues a synthetic event that should be dispatched when
3335 * `processEventQueue` is invoked.
3336 *
3337 * @param {*} events An accumulation of synthetic events.
3338 * @internal
3339 */
3340 enqueueEvents: function (events) {
3341 if (events) {
3342 eventQueue = accumulateInto(eventQueue, events);
3343 }
3344 },
3345
3346 /**
3347 * Dispatches all synthetic events on the event queue.
3348 *
3349 * @internal
3350 */
3351 processEventQueue: function (simulated) {
3352 // Set `eventQueue` to null before processing it so that we can tell if more
3353 // events get enqueued while processing.
3354 var processingEventQueue = eventQueue;
3355 eventQueue = null;
3356 if (simulated) {
3357 forEachAccumulated(processingEventQueue, executeDispatchesAndReleaseSimulated);
3358 } else {
3359 forEachAccumulated(processingEventQueue, executeDispatchesAndReleaseTopLevel);
3360 }
3361 !!eventQueue ? process.env.NODE_ENV !== 'production' ? invariant(false, 'processEventQueue(): Additional events were enqueued while processing an event queue. Support for this has not yet been implemented.') : _prodInvariant('95') : void 0;
3362 // This would be a good time to rethrow if any of the event handlers threw.
3363 ReactErrorUtils.rethrowCaughtError();
3364 },
3365
3366 /**
3367 * These are needed for tests only. Do not use!
3368 */
3369 __purge: function () {
3370 listenerBank = {};
3371 },
3372
3373 __getListenerBank: function () {
3374 return listenerBank;
3375 }
3376};
3377
3378module.exports = EventPluginHub;
3379/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
3380
3381/***/ }),
3382/* 23 */
3383/***/ (function(module, exports, __webpack_require__) {
3384
3385"use strict";
3386/**
3387 * Copyright 2013-present, Facebook, Inc.
3388 * All rights reserved.
3389 *
3390 * This source code is licensed under the BSD-style license found in the
3391 * LICENSE file in the root directory of this source tree. An additional grant
3392 * of patent rights can be found in the PATENTS file in the same directory.
3393 *
3394 */
3395
3396
3397
3398var SyntheticEvent = __webpack_require__(12);
3399
3400var getEventTarget = __webpack_require__(40);
3401
3402/**
3403 * @interface UIEvent
3404 * @see http://www.w3.org/TR/DOM-Level-3-Events/
3405 */
3406var UIEventInterface = {
3407 view: function (event) {
3408 if (event.view) {
3409 return event.view;
3410 }
3411
3412 var target = getEventTarget(event);
3413 if (target.window === target) {
3414 // target is a window object
3415 return target;
3416 }
3417
3418 var doc = target.ownerDocument;
3419 // TODO: Figure out why `ownerDocument` is sometimes undefined in IE8.
3420 if (doc) {
3421 return doc.defaultView || doc.parentWindow;
3422 } else {
3423 return window;
3424 }
3425 },
3426 detail: function (event) {
3427 return event.detail || 0;
3428 }
3429};
3430
3431/**
3432 * @param {object} dispatchConfig Configuration used to dispatch this event.
3433 * @param {string} dispatchMarker Marker identifying the event target.
3434 * @param {object} nativeEvent Native browser event.
3435 * @extends {SyntheticEvent}
3436 */
3437function SyntheticUIEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
3438 return SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
3439}
3440
3441SyntheticEvent.augmentClass(SyntheticUIEvent, UIEventInterface);
3442
3443module.exports = SyntheticUIEvent;
3444
3445/***/ }),
3446/* 24 */
3447/***/ (function(module, exports, __webpack_require__) {
3448
3449"use strict";
3450/**
3451 * Copyright 2013-present, Facebook, Inc.
3452 * All rights reserved.
3453 *
3454 * This source code is licensed under the BSD-style license found in the
3455 * LICENSE file in the root directory of this source tree. An additional grant
3456 * of patent rights can be found in the PATENTS file in the same directory.
3457 *
3458 */
3459
3460
3461
3462/**
3463 * `ReactInstanceMap` maintains a mapping from a public facing stateful
3464 * instance (key) and the internal representation (value). This allows public
3465 * methods to accept the user facing instance as an argument and map them back
3466 * to internal methods.
3467 */
3468
3469// TODO: Replace this with ES6: var ReactInstanceMap = new Map();
3470
3471var ReactInstanceMap = {
3472 /**
3473 * This API should be called `delete` but we'd have to make sure to always
3474 * transform these to strings for IE support. When this transform is fully
3475 * supported we can rename it.
3476 */
3477 remove: function (key) {
3478 key._reactInternalInstance = undefined;
3479 },
3480
3481 get: function (key) {
3482 return key._reactInternalInstance;
3483 },
3484
3485 has: function (key) {
3486 return key._reactInternalInstance !== undefined;
3487 },
3488
3489 set: function (key, value) {
3490 key._reactInternalInstance = value;
3491 }
3492};
3493
3494module.exports = ReactInstanceMap;
3495
3496/***/ }),
3497/* 25 */
3498/***/ (function(module, exports, __webpack_require__) {
3499
3500/* WEBPACK VAR INJECTION */(function(process) {/**
3501 * Copyright 2013-present, Facebook, Inc.
3502 * All rights reserved.
3503 *
3504 * This source code is licensed under the BSD-style license found in the
3505 * LICENSE file in the root directory of this source tree. An additional grant
3506 * of patent rights can be found in the PATENTS file in the same directory.
3507 */
3508
3509if (process.env.NODE_ENV !== 'production') {
3510 var REACT_ELEMENT_TYPE = (typeof Symbol === 'function' &&
3511 Symbol.for &&
3512 Symbol.for('react.element')) ||
3513 0xeac7;
3514
3515 var isValidElement = function(object) {
3516 return typeof object === 'object' &&
3517 object !== null &&
3518 object.$$typeof === REACT_ELEMENT_TYPE;
3519 };
3520
3521 // By explicitly using `prop-types` you are opting into new development behavior.
3522 // http://fb.me/prop-types-in-prod
3523 var throwOnDirectAccess = true;
3524 module.exports = __webpack_require__(63)(isValidElement, throwOnDirectAccess);
3525} else {
3526 // By explicitly using `prop-types` you are opting into new production behavior.
3527 // http://fb.me/prop-types-in-prod
3528 module.exports = __webpack_require__(195)();
3529}
3530
3531/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
3532
3533/***/ }),
3534/* 26 */
3535/***/ (function(module, exports, __webpack_require__) {
3536
3537"use strict";
3538/* WEBPACK VAR INJECTION */(function(process) {/**
3539 * Copyright 2013-present, Facebook, Inc.
3540 * All rights reserved.
3541 *
3542 * This source code is licensed under the BSD-style license found in the
3543 * LICENSE file in the root directory of this source tree. An additional grant
3544 * of patent rights can be found in the PATENTS file in the same directory.
3545 *
3546 *
3547 */
3548
3549
3550
3551var canDefineProperty = false;
3552if (process.env.NODE_ENV !== 'production') {
3553 try {
3554 // $FlowFixMe https://github.com/facebook/flow/issues/285
3555 Object.defineProperty({}, 'x', { get: function () {} });
3556 canDefineProperty = true;
3557 } catch (x) {
3558 // IE will fail on defineProperty
3559 }
3560}
3561
3562module.exports = canDefineProperty;
3563/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
3564
3565/***/ }),
3566/* 27 */
3567/***/ (function(module, exports, __webpack_require__) {
3568
3569"use strict";
3570/* WEBPACK VAR INJECTION */(function(process) {/**
3571 * Copyright (c) 2013-present, Facebook, Inc.
3572 * All rights reserved.
3573 *
3574 * This source code is licensed under the BSD-style license found in the
3575 * LICENSE file in the root directory of this source tree. An additional grant
3576 * of patent rights can be found in the PATENTS file in the same directory.
3577 *
3578 */
3579
3580
3581
3582var emptyObject = {};
3583
3584if (process.env.NODE_ENV !== 'production') {
3585 Object.freeze(emptyObject);
3586}
3587
3588module.exports = emptyObject;
3589/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
3590
3591/***/ }),
3592/* 28 */
3593/***/ (function(module, exports, __webpack_require__) {
3594
3595"use strict";
3596/* WEBPACK VAR INJECTION */(function(process) {/**
3597 * Copyright 2013-present, Facebook, Inc.
3598 * All rights reserved.
3599 *
3600 * This source code is licensed under the BSD-style license found in the
3601 * LICENSE file in the root directory of this source tree. An additional grant
3602 * of patent rights can be found in the PATENTS file in the same directory.
3603 *
3604 *
3605 */
3606
3607
3608
3609var _prodInvariant = __webpack_require__(3);
3610
3611var invariant = __webpack_require__(1);
3612
3613/**
3614 * Injectable ordering of event plugins.
3615 */
3616var eventPluginOrder = null;
3617
3618/**
3619 * Injectable mapping from names to event plugin modules.
3620 */
3621var namesToPlugins = {};
3622
3623/**
3624 * Recomputes the plugin list using the injected plugins and plugin ordering.
3625 *
3626 * @private
3627 */
3628function recomputePluginOrdering() {
3629 if (!eventPluginOrder) {
3630 // Wait until an `eventPluginOrder` is injected.
3631 return;
3632 }
3633 for (var pluginName in namesToPlugins) {
3634 var pluginModule = namesToPlugins[pluginName];
3635 var pluginIndex = eventPluginOrder.indexOf(pluginName);
3636 !(pluginIndex > -1) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : _prodInvariant('96', pluginName) : void 0;
3637 if (EventPluginRegistry.plugins[pluginIndex]) {
3638 continue;
3639 }
3640 !pluginModule.extractEvents ? process.env.NODE_ENV !== 'production' ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : _prodInvariant('97', pluginName) : void 0;
3641 EventPluginRegistry.plugins[pluginIndex] = pluginModule;
3642 var publishedEvents = pluginModule.eventTypes;
3643 for (var eventName in publishedEvents) {
3644 !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : _prodInvariant('98', eventName, pluginName) : void 0;
3645 }
3646 }
3647}
3648
3649/**
3650 * Publishes an event so that it can be dispatched by the supplied plugin.
3651 *
3652 * @param {object} dispatchConfig Dispatch configuration for the event.
3653 * @param {object} PluginModule Plugin publishing the event.
3654 * @return {boolean} True if the event was successfully published.
3655 * @private
3656 */
3657function publishEventForPlugin(dispatchConfig, pluginModule, eventName) {
3658 !!EventPluginRegistry.eventNameDispatchConfigs.hasOwnProperty(eventName) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'EventPluginHub: More than one plugin attempted to publish the same event name, `%s`.', eventName) : _prodInvariant('99', eventName) : void 0;
3659 EventPluginRegistry.eventNameDispatchConfigs[eventName] = dispatchConfig;
3660
3661 var phasedRegistrationNames = dispatchConfig.phasedRegistrationNames;
3662 if (phasedRegistrationNames) {
3663 for (var phaseName in phasedRegistrationNames) {
3664 if (phasedRegistrationNames.hasOwnProperty(phaseName)) {
3665 var phasedRegistrationName = phasedRegistrationNames[phaseName];
3666 publishRegistrationName(phasedRegistrationName, pluginModule, eventName);
3667 }
3668 }
3669 return true;
3670 } else if (dispatchConfig.registrationName) {
3671 publishRegistrationName(dispatchConfig.registrationName, pluginModule, eventName);
3672 return true;
3673 }
3674 return false;
3675}
3676
3677/**
3678 * Publishes a registration name that is used to identify dispatched events and
3679 * can be used with `EventPluginHub.putListener` to register listeners.
3680 *
3681 * @param {string} registrationName Registration name to add.
3682 * @param {object} PluginModule Plugin publishing the event.
3683 * @private
3684 */
3685function publishRegistrationName(registrationName, pluginModule, eventName) {
3686 !!EventPluginRegistry.registrationNameModules[registrationName] ? process.env.NODE_ENV !== 'production' ? invariant(false, 'EventPluginHub: More than one plugin attempted to publish the same registration name, `%s`.', registrationName) : _prodInvariant('100', registrationName) : void 0;
3687 EventPluginRegistry.registrationNameModules[registrationName] = pluginModule;
3688 EventPluginRegistry.registrationNameDependencies[registrationName] = pluginModule.eventTypes[eventName].dependencies;
3689
3690 if (process.env.NODE_ENV !== 'production') {
3691 var lowerCasedName = registrationName.toLowerCase();
3692 EventPluginRegistry.possibleRegistrationNames[lowerCasedName] = registrationName;
3693
3694 if (registrationName === 'onDoubleClick') {
3695 EventPluginRegistry.possibleRegistrationNames.ondblclick = registrationName;
3696 }
3697 }
3698}
3699
3700/**
3701 * Registers plugins so that they can extract and dispatch events.
3702 *
3703 * @see {EventPluginHub}
3704 */
3705var EventPluginRegistry = {
3706 /**
3707 * Ordered list of injected plugins.
3708 */
3709 plugins: [],
3710
3711 /**
3712 * Mapping from event name to dispatch config
3713 */
3714 eventNameDispatchConfigs: {},
3715
3716 /**
3717 * Mapping from registration name to plugin module
3718 */
3719 registrationNameModules: {},
3720
3721 /**
3722 * Mapping from registration name to event name
3723 */
3724 registrationNameDependencies: {},
3725
3726 /**
3727 * Mapping from lowercase registration names to the properly cased version,
3728 * used to warn in the case of missing event handlers. Available
3729 * only in __DEV__.
3730 * @type {Object}
3731 */
3732 possibleRegistrationNames: process.env.NODE_ENV !== 'production' ? {} : null,
3733 // Trust the developer to only use possibleRegistrationNames in __DEV__
3734
3735 /**
3736 * Injects an ordering of plugins (by plugin name). This allows the ordering
3737 * to be decoupled from injection of the actual plugins so that ordering is
3738 * always deterministic regardless of packaging, on-the-fly injection, etc.
3739 *
3740 * @param {array} InjectedEventPluginOrder
3741 * @internal
3742 * @see {EventPluginHub.injection.injectEventPluginOrder}
3743 */
3744 injectEventPluginOrder: function (injectedEventPluginOrder) {
3745 !!eventPluginOrder ? process.env.NODE_ENV !== 'production' ? invariant(false, 'EventPluginRegistry: Cannot inject event plugin ordering more than once. You are likely trying to load more than one copy of React.') : _prodInvariant('101') : void 0;
3746 // Clone the ordering so it cannot be dynamically mutated.
3747 eventPluginOrder = Array.prototype.slice.call(injectedEventPluginOrder);
3748 recomputePluginOrdering();
3749 },
3750
3751 /**
3752 * Injects plugins to be used by `EventPluginHub`. The plugin names must be
3753 * in the ordering injected by `injectEventPluginOrder`.
3754 *
3755 * Plugins can be injected as part of page initialization or on-the-fly.
3756 *
3757 * @param {object} injectedNamesToPlugins Map from names to plugin modules.
3758 * @internal
3759 * @see {EventPluginHub.injection.injectEventPluginsByName}
3760 */
3761 injectEventPluginsByName: function (injectedNamesToPlugins) {
3762 var isOrderingDirty = false;
3763 for (var pluginName in injectedNamesToPlugins) {
3764 if (!injectedNamesToPlugins.hasOwnProperty(pluginName)) {
3765 continue;
3766 }
3767 var pluginModule = injectedNamesToPlugins[pluginName];
3768 if (!namesToPlugins.hasOwnProperty(pluginName) || namesToPlugins[pluginName] !== pluginModule) {
3769 !!namesToPlugins[pluginName] ? process.env.NODE_ENV !== 'production' ? invariant(false, 'EventPluginRegistry: Cannot inject two different event plugins using the same name, `%s`.', pluginName) : _prodInvariant('102', pluginName) : void 0;
3770 namesToPlugins[pluginName] = pluginModule;
3771 isOrderingDirty = true;
3772 }
3773 }
3774 if (isOrderingDirty) {
3775 recomputePluginOrdering();
3776 }
3777 },
3778
3779 /**
3780 * Looks up the plugin for the supplied event.
3781 *
3782 * @param {object} event A synthetic event.
3783 * @return {?object} The plugin that created the supplied event.
3784 * @internal
3785 */
3786 getPluginModuleForEvent: function (event) {
3787 var dispatchConfig = event.dispatchConfig;
3788 if (dispatchConfig.registrationName) {
3789 return EventPluginRegistry.registrationNameModules[dispatchConfig.registrationName] || null;
3790 }
3791 if (dispatchConfig.phasedRegistrationNames !== undefined) {
3792 // pulling phasedRegistrationNames out of dispatchConfig helps Flow see
3793 // that it is not undefined.
3794 var phasedRegistrationNames = dispatchConfig.phasedRegistrationNames;
3795
3796 for (var phase in phasedRegistrationNames) {
3797 if (!phasedRegistrationNames.hasOwnProperty(phase)) {
3798 continue;
3799 }
3800 var pluginModule = EventPluginRegistry.registrationNameModules[phasedRegistrationNames[phase]];
3801 if (pluginModule) {
3802 return pluginModule;
3803 }
3804 }
3805 }
3806 return null;
3807 },
3808
3809 /**
3810 * Exposed for unit testing.
3811 * @private
3812 */
3813 _resetEventPlugins: function () {
3814 eventPluginOrder = null;
3815 for (var pluginName in namesToPlugins) {
3816 if (namesToPlugins.hasOwnProperty(pluginName)) {
3817 delete namesToPlugins[pluginName];
3818 }
3819 }
3820 EventPluginRegistry.plugins.length = 0;
3821
3822 var eventNameDispatchConfigs = EventPluginRegistry.eventNameDispatchConfigs;
3823 for (var eventName in eventNameDispatchConfigs) {
3824 if (eventNameDispatchConfigs.hasOwnProperty(eventName)) {
3825 delete eventNameDispatchConfigs[eventName];
3826 }
3827 }
3828
3829 var registrationNameModules = EventPluginRegistry.registrationNameModules;
3830 for (var registrationName in registrationNameModules) {
3831 if (registrationNameModules.hasOwnProperty(registrationName)) {
3832 delete registrationNameModules[registrationName];
3833 }
3834 }
3835
3836 if (process.env.NODE_ENV !== 'production') {
3837 var possibleRegistrationNames = EventPluginRegistry.possibleRegistrationNames;
3838 for (var lowerCasedName in possibleRegistrationNames) {
3839 if (possibleRegistrationNames.hasOwnProperty(lowerCasedName)) {
3840 delete possibleRegistrationNames[lowerCasedName];
3841 }
3842 }
3843 }
3844 }
3845};
3846
3847module.exports = EventPluginRegistry;
3848/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
3849
3850/***/ }),
3851/* 29 */
3852/***/ (function(module, exports, __webpack_require__) {
3853
3854"use strict";
3855/* WEBPACK VAR INJECTION */(function(process) {/**
3856 * Copyright 2013-present, Facebook, Inc.
3857 * All rights reserved.
3858 *
3859 * This source code is licensed under the BSD-style license found in the
3860 * LICENSE file in the root directory of this source tree. An additional grant
3861 * of patent rights can be found in the PATENTS file in the same directory.
3862 *
3863 *
3864 */
3865
3866
3867
3868var _prodInvariant = __webpack_require__(3);
3869
3870var invariant = __webpack_require__(1);
3871
3872var OBSERVED_ERROR = {};
3873
3874/**
3875 * `Transaction` creates a black box that is able to wrap any method such that
3876 * certain invariants are maintained before and after the method is invoked
3877 * (Even if an exception is thrown while invoking the wrapped method). Whoever
3878 * instantiates a transaction can provide enforcers of the invariants at
3879 * creation time. The `Transaction` class itself will supply one additional
3880 * automatic invariant for you - the invariant that any transaction instance
3881 * should not be run while it is already being run. You would typically create a
3882 * single instance of a `Transaction` for reuse multiple times, that potentially
3883 * is used to wrap several different methods. Wrappers are extremely simple -
3884 * they only require implementing two methods.
3885 *
3886 * <pre>
3887 * wrappers (injected at creation time)
3888 * + +
3889 * | |
3890 * +-----------------|--------|--------------+
3891 * | v | |
3892 * | +---------------+ | |
3893 * | +--| wrapper1 |---|----+ |
3894 * | | +---------------+ v | |
3895 * | | +-------------+ | |
3896 * | | +----| wrapper2 |--------+ |
3897 * | | | +-------------+ | | |
3898 * | | | | | |
3899 * | v v v v | wrapper
3900 * | +---+ +---+ +---------+ +---+ +---+ | invariants
3901 * perform(anyMethod) | | | | | | | | | | | | maintained
3902 * +----------------->|-|---|-|---|-->|anyMethod|---|---|-|---|-|-------->
3903 * | | | | | | | | | | | |
3904 * | | | | | | | | | | | |
3905 * | | | | | | | | | | | |
3906 * | +---+ +---+ +---------+ +---+ +---+ |
3907 * | initialize close |
3908 * +-----------------------------------------+
3909 * </pre>
3910 *
3911 * Use cases:
3912 * - Preserving the input selection ranges before/after reconciliation.
3913 * Restoring selection even in the event of an unexpected error.
3914 * - Deactivating events while rearranging the DOM, preventing blurs/focuses,
3915 * while guaranteeing that afterwards, the event system is reactivated.
3916 * - Flushing a queue of collected DOM mutations to the main UI thread after a
3917 * reconciliation takes place in a worker thread.
3918 * - Invoking any collected `componentDidUpdate` callbacks after rendering new
3919 * content.
3920 * - (Future use case): Wrapping particular flushes of the `ReactWorker` queue
3921 * to preserve the `scrollTop` (an automatic scroll aware DOM).
3922 * - (Future use case): Layout calculations before and after DOM updates.
3923 *
3924 * Transactional plugin API:
3925 * - A module that has an `initialize` method that returns any precomputation.
3926 * - and a `close` method that accepts the precomputation. `close` is invoked
3927 * when the wrapped process is completed, or has failed.
3928 *
3929 * @param {Array<TransactionalWrapper>} transactionWrapper Wrapper modules
3930 * that implement `initialize` and `close`.
3931 * @return {Transaction} Single transaction for reuse in thread.
3932 *
3933 * @class Transaction
3934 */
3935var TransactionImpl = {
3936 /**
3937 * Sets up this instance so that it is prepared for collecting metrics. Does
3938 * so such that this setup method may be used on an instance that is already
3939 * initialized, in a way that does not consume additional memory upon reuse.
3940 * That can be useful if you decide to make your subclass of this mixin a
3941 * "PooledClass".
3942 */
3943 reinitializeTransaction: function () {
3944 this.transactionWrappers = this.getTransactionWrappers();
3945 if (this.wrapperInitData) {
3946 this.wrapperInitData.length = 0;
3947 } else {
3948 this.wrapperInitData = [];
3949 }
3950 this._isInTransaction = false;
3951 },
3952
3953 _isInTransaction: false,
3954
3955 /**
3956 * @abstract
3957 * @return {Array<TransactionWrapper>} Array of transaction wrappers.
3958 */
3959 getTransactionWrappers: null,
3960
3961 isInTransaction: function () {
3962 return !!this._isInTransaction;
3963 },
3964
3965 /* eslint-disable space-before-function-paren */
3966
3967 /**
3968 * Executes the function within a safety window. Use this for the top level
3969 * methods that result in large amounts of computation/mutations that would
3970 * need to be safety checked. The optional arguments helps prevent the need
3971 * to bind in many cases.
3972 *
3973 * @param {function} method Member of scope to call.
3974 * @param {Object} scope Scope to invoke from.
3975 * @param {Object?=} a Argument to pass to the method.
3976 * @param {Object?=} b Argument to pass to the method.
3977 * @param {Object?=} c Argument to pass to the method.
3978 * @param {Object?=} d Argument to pass to the method.
3979 * @param {Object?=} e Argument to pass to the method.
3980 * @param {Object?=} f Argument to pass to the method.
3981 *
3982 * @return {*} Return value from `method`.
3983 */
3984 perform: function (method, scope, a, b, c, d, e, f) {
3985 /* eslint-enable space-before-function-paren */
3986 !!this.isInTransaction() ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Transaction.perform(...): Cannot initialize a transaction when there is already an outstanding transaction.') : _prodInvariant('27') : void 0;
3987 var errorThrown;
3988 var ret;
3989 try {
3990 this._isInTransaction = true;
3991 // Catching errors makes debugging more difficult, so we start with
3992 // errorThrown set to true before setting it to false after calling
3993 // close -- if it's still set to true in the finally block, it means
3994 // one of these calls threw.
3995 errorThrown = true;
3996 this.initializeAll(0);
3997 ret = method.call(scope, a, b, c, d, e, f);
3998 errorThrown = false;
3999 } finally {
4000 try {
4001 if (errorThrown) {
4002 // If `method` throws, prefer to show that stack trace over any thrown
4003 // by invoking `closeAll`.
4004 try {
4005 this.closeAll(0);
4006 } catch (err) {}
4007 } else {
4008 // Since `method` didn't throw, we don't want to silence the exception
4009 // here.
4010 this.closeAll(0);
4011 }
4012 } finally {
4013 this._isInTransaction = false;
4014 }
4015 }
4016 return ret;
4017 },
4018
4019 initializeAll: function (startIndex) {
4020 var transactionWrappers = this.transactionWrappers;
4021 for (var i = startIndex; i < transactionWrappers.length; i++) {
4022 var wrapper = transactionWrappers[i];
4023 try {
4024 // Catching errors makes debugging more difficult, so we start with the
4025 // OBSERVED_ERROR state before overwriting it with the real return value
4026 // of initialize -- if it's still set to OBSERVED_ERROR in the finally
4027 // block, it means wrapper.initialize threw.
4028 this.wrapperInitData[i] = OBSERVED_ERROR;
4029 this.wrapperInitData[i] = wrapper.initialize ? wrapper.initialize.call(this) : null;
4030 } finally {
4031 if (this.wrapperInitData[i] === OBSERVED_ERROR) {
4032 // The initializer for wrapper i threw an error; initialize the
4033 // remaining wrappers but silence any exceptions from them to ensure
4034 // that the first error is the one to bubble up.
4035 try {
4036 this.initializeAll(i + 1);
4037 } catch (err) {}
4038 }
4039 }
4040 }
4041 },
4042
4043 /**
4044 * Invokes each of `this.transactionWrappers.close[i]` functions, passing into
4045 * them the respective return values of `this.transactionWrappers.init[i]`
4046 * (`close`rs that correspond to initializers that failed will not be
4047 * invoked).
4048 */
4049 closeAll: function (startIndex) {
4050 !this.isInTransaction() ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Transaction.closeAll(): Cannot close transaction when none are open.') : _prodInvariant('28') : void 0;
4051 var transactionWrappers = this.transactionWrappers;
4052 for (var i = startIndex; i < transactionWrappers.length; i++) {
4053 var wrapper = transactionWrappers[i];
4054 var initData = this.wrapperInitData[i];
4055 var errorThrown;
4056 try {
4057 // Catching errors makes debugging more difficult, so we start with
4058 // errorThrown set to true before setting it to false after calling
4059 // close -- if it's still set to true in the finally block, it means
4060 // wrapper.close threw.
4061 errorThrown = true;
4062 if (initData !== OBSERVED_ERROR && wrapper.close) {
4063 wrapper.close.call(this, initData);
4064 }
4065 errorThrown = false;
4066 } finally {
4067 if (errorThrown) {
4068 // The closer for wrapper i threw an error; close the remaining
4069 // wrappers but silence any exceptions from them to ensure that the
4070 // first error is the one to bubble up.
4071 try {
4072 this.closeAll(i + 1);
4073 } catch (e) {}
4074 }
4075 }
4076 }
4077 this.wrapperInitData.length = 0;
4078 }
4079};
4080
4081module.exports = TransactionImpl;
4082/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
4083
4084/***/ }),
4085/* 30 */
4086/***/ (function(module, exports, __webpack_require__) {
4087
4088"use strict";
4089/**
4090 * Copyright 2013-present, Facebook, Inc.
4091 * All rights reserved.
4092 *
4093 * This source code is licensed under the BSD-style license found in the
4094 * LICENSE file in the root directory of this source tree. An additional grant
4095 * of patent rights can be found in the PATENTS file in the same directory.
4096 *
4097 */
4098
4099
4100
4101var SyntheticUIEvent = __webpack_require__(23);
4102var ViewportMetrics = __webpack_require__(72);
4103
4104var getEventModifierState = __webpack_require__(42);
4105
4106/**
4107 * @interface MouseEvent
4108 * @see http://www.w3.org/TR/DOM-Level-3-Events/
4109 */
4110var MouseEventInterface = {
4111 screenX: null,
4112 screenY: null,
4113 clientX: null,
4114 clientY: null,
4115 ctrlKey: null,
4116 shiftKey: null,
4117 altKey: null,
4118 metaKey: null,
4119 getModifierState: getEventModifierState,
4120 button: function (event) {
4121 // Webkit, Firefox, IE9+
4122 // which: 1 2 3
4123 // button: 0 1 2 (standard)
4124 var button = event.button;
4125 if ('which' in event) {
4126 return button;
4127 }
4128 // IE<9
4129 // which: undefined
4130 // button: 0 0 0
4131 // button: 1 4 2 (onmouseup)
4132 return button === 2 ? 2 : button === 4 ? 1 : 0;
4133 },
4134 buttons: null,
4135 relatedTarget: function (event) {
4136 return event.relatedTarget || (event.fromElement === event.srcElement ? event.toElement : event.fromElement);
4137 },
4138 // "Proprietary" Interface.
4139 pageX: function (event) {
4140 return 'pageX' in event ? event.pageX : event.clientX + ViewportMetrics.currentScrollLeft;
4141 },
4142 pageY: function (event) {
4143 return 'pageY' in event ? event.pageY : event.clientY + ViewportMetrics.currentScrollTop;
4144 }
4145};
4146
4147/**
4148 * @param {object} dispatchConfig Configuration used to dispatch this event.
4149 * @param {string} dispatchMarker Marker identifying the event target.
4150 * @param {object} nativeEvent Native browser event.
4151 * @extends {SyntheticUIEvent}
4152 */
4153function SyntheticMouseEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
4154 return SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
4155}
4156
4157SyntheticUIEvent.augmentClass(SyntheticMouseEvent, MouseEventInterface);
4158
4159module.exports = SyntheticMouseEvent;
4160
4161/***/ }),
4162/* 31 */
4163/***/ (function(module, exports, __webpack_require__) {
4164
4165"use strict";
4166/**
4167 * Copyright 2013-present, Facebook, Inc.
4168 * All rights reserved.
4169 *
4170 * This source code is licensed under the BSD-style license found in the
4171 * LICENSE file in the root directory of this source tree. An additional grant
4172 * of patent rights can be found in the PATENTS file in the same directory.
4173 *
4174 */
4175
4176
4177
4178var ExecutionEnvironment = __webpack_require__(6);
4179var DOMNamespaces = __webpack_require__(44);
4180
4181var WHITESPACE_TEST = /^[ \r\n\t\f]/;
4182var NONVISIBLE_TEST = /<(!--|link|noscript|meta|script|style)[ \r\n\t\f\/>]/;
4183
4184var createMicrosoftUnsafeLocalFunction = __webpack_require__(45);
4185
4186// SVG temp container for IE lacking innerHTML
4187var reusableSVGContainer;
4188
4189/**
4190 * Set the innerHTML property of a node, ensuring that whitespace is preserved
4191 * even in IE8.
4192 *
4193 * @param {DOMElement} node
4194 * @param {string} html
4195 * @internal
4196 */
4197var setInnerHTML = createMicrosoftUnsafeLocalFunction(function (node, html) {
4198 // IE does not have innerHTML for SVG nodes, so instead we inject the
4199 // new markup in a temp node and then move the child nodes across into
4200 // the target node
4201 if (node.namespaceURI === DOMNamespaces.svg && !('innerHTML' in node)) {
4202 reusableSVGContainer = reusableSVGContainer || document.createElement('div');
4203 reusableSVGContainer.innerHTML = '<svg>' + html + '</svg>';
4204 var svgNode = reusableSVGContainer.firstChild;
4205 while (svgNode.firstChild) {
4206 node.appendChild(svgNode.firstChild);
4207 }
4208 } else {
4209 node.innerHTML = html;
4210 }
4211});
4212
4213if (ExecutionEnvironment.canUseDOM) {
4214 // IE8: When updating a just created node with innerHTML only leading
4215 // whitespace is removed. When updating an existing node with innerHTML
4216 // whitespace in root TextNodes is also collapsed.
4217 // @see quirksmode.org/bugreports/archives/2004/11/innerhtml_and_t.html
4218
4219 // Feature detection; only IE8 is known to behave improperly like this.
4220 var testElement = document.createElement('div');
4221 testElement.innerHTML = ' ';
4222 if (testElement.innerHTML === '') {
4223 setInnerHTML = function (node, html) {
4224 // Magic theory: IE8 supposedly differentiates between added and updated
4225 // nodes when processing innerHTML, innerHTML on updated nodes suffers
4226 // from worse whitespace behavior. Re-adding a node like this triggers
4227 // the initial and more favorable whitespace behavior.
4228 // TODO: What to do on a detached node?
4229 if (node.parentNode) {
4230 node.parentNode.replaceChild(node, node);
4231 }
4232
4233 // We also implement a workaround for non-visible tags disappearing into
4234 // thin air on IE8, this only happens if there is no visible text
4235 // in-front of the non-visible tags. Piggyback on the whitespace fix
4236 // and simply check if any non-visible tags appear in the source.
4237 if (WHITESPACE_TEST.test(html) || html[0] === '<' && NONVISIBLE_TEST.test(html)) {
4238 // Recover leading whitespace by temporarily prepending any character.
4239 // \uFEFF has the potential advantage of being zero-width/invisible.
4240 // UglifyJS drops U+FEFF chars when parsing, so use String.fromCharCode
4241 // in hopes that this is preserved even if "\uFEFF" is transformed to
4242 // the actual Unicode character (by Babel, for example).
4243 // https://github.com/mishoo/UglifyJS2/blob/v2.4.20/lib/parse.js#L216
4244 node.innerHTML = String.fromCharCode(0xfeff) + html;
4245
4246 // deleteData leaves an empty `TextNode` which offsets the index of all
4247 // children. Definitely want to avoid this.
4248 var textNode = node.firstChild;
4249 if (textNode.data.length === 1) {
4250 node.removeChild(textNode);
4251 } else {
4252 textNode.deleteData(0, 1);
4253 }
4254 } else {
4255 node.innerHTML = html;
4256 }
4257 };
4258 }
4259 testElement = null;
4260}
4261
4262module.exports = setInnerHTML;
4263
4264/***/ }),
4265/* 32 */
4266/***/ (function(module, exports, __webpack_require__) {
4267
4268"use strict";
4269/**
4270 * Copyright 2016-present, Facebook, Inc.
4271 * All rights reserved.
4272 *
4273 * This source code is licensed under the BSD-style license found in the
4274 * LICENSE file in the root directory of this source tree. An additional grant
4275 * of patent rights can be found in the PATENTS file in the same directory.
4276 *
4277 * Based on the escape-html library, which is used under the MIT License below:
4278 *
4279 * Copyright (c) 2012-2013 TJ Holowaychuk
4280 * Copyright (c) 2015 Andreas Lubbe
4281 * Copyright (c) 2015 Tiancheng "Timothy" Gu
4282 *
4283 * Permission is hereby granted, free of charge, to any person obtaining
4284 * a copy of this software and associated documentation files (the
4285 * 'Software'), to deal in the Software without restriction, including
4286 * without limitation the rights to use, copy, modify, merge, publish,
4287 * distribute, sublicense, and/or sell copies of the Software, and to
4288 * permit persons to whom the Software is furnished to do so, subject to
4289 * the following conditions:
4290 *
4291 * The above copyright notice and this permission notice shall be
4292 * included in all copies or substantial portions of the Software.
4293 *
4294 * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
4295 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
4296 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
4297 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
4298 * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
4299 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
4300 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
4301 *
4302 */
4303
4304
4305
4306// code copied and modified from escape-html
4307/**
4308 * Module variables.
4309 * @private
4310 */
4311
4312var matchHtmlRegExp = /["'&<>]/;
4313
4314/**
4315 * Escape special characters in the given string of html.
4316 *
4317 * @param {string} string The string to escape for inserting into HTML
4318 * @return {string}
4319 * @public
4320 */
4321
4322function escapeHtml(string) {
4323 var str = '' + string;
4324 var match = matchHtmlRegExp.exec(str);
4325
4326 if (!match) {
4327 return str;
4328 }
4329
4330 var escape;
4331 var html = '';
4332 var index = 0;
4333 var lastIndex = 0;
4334
4335 for (index = match.index; index < str.length; index++) {
4336 switch (str.charCodeAt(index)) {
4337 case 34:
4338 // "
4339 escape = '&quot;';
4340 break;
4341 case 38:
4342 // &
4343 escape = '&amp;';
4344 break;
4345 case 39:
4346 // '
4347 escape = '&#x27;'; // modified from escape-html; used to be '&#39'
4348 break;
4349 case 60:
4350 // <
4351 escape = '&lt;';
4352 break;
4353 case 62:
4354 // >
4355 escape = '&gt;';
4356 break;
4357 default:
4358 continue;
4359 }
4360
4361 if (lastIndex !== index) {
4362 html += str.substring(lastIndex, index);
4363 }
4364
4365 lastIndex = index + 1;
4366 html += escape;
4367 }
4368
4369 return lastIndex !== index ? html + str.substring(lastIndex, index) : html;
4370}
4371// end code copied and modified from escape-html
4372
4373/**
4374 * Escapes text to prevent scripting attacks.
4375 *
4376 * @param {*} text Text value to escape.
4377 * @return {string} An escaped string.
4378 */
4379function escapeTextContentForBrowser(text) {
4380 if (typeof text === 'boolean' || typeof text === 'number') {
4381 // this shortcircuit helps perf for types that we know will never have
4382 // special characters, especially given that this function is used often
4383 // for numeric dom ids.
4384 return '' + text;
4385 }
4386 return escapeHtml(text);
4387}
4388
4389module.exports = escapeTextContentForBrowser;
4390
4391/***/ }),
4392/* 33 */
4393/***/ (function(module, exports, __webpack_require__) {
4394
4395"use strict";
4396/**
4397 * Copyright 2013-present, Facebook, Inc.
4398 * All rights reserved.
4399 *
4400 * This source code is licensed under the BSD-style license found in the
4401 * LICENSE file in the root directory of this source tree. An additional grant
4402 * of patent rights can be found in the PATENTS file in the same directory.
4403 *
4404 */
4405
4406
4407
4408var _assign = __webpack_require__(4);
4409
4410var EventPluginRegistry = __webpack_require__(28);
4411var ReactEventEmitterMixin = __webpack_require__(140);
4412var ViewportMetrics = __webpack_require__(72);
4413
4414var getVendorPrefixedEventName = __webpack_require__(141);
4415var isEventSupported = __webpack_require__(41);
4416
4417/**
4418 * Summary of `ReactBrowserEventEmitter` event handling:
4419 *
4420 * - Top-level delegation is used to trap most native browser events. This
4421 * may only occur in the main thread and is the responsibility of
4422 * ReactEventListener, which is injected and can therefore support pluggable
4423 * event sources. This is the only work that occurs in the main thread.
4424 *
4425 * - We normalize and de-duplicate events to account for browser quirks. This
4426 * may be done in the worker thread.
4427 *
4428 * - Forward these native events (with the associated top-level type used to
4429 * trap it) to `EventPluginHub`, which in turn will ask plugins if they want
4430 * to extract any synthetic events.
4431 *
4432 * - The `EventPluginHub` will then process each event by annotating them with
4433 * "dispatches", a sequence of listeners and IDs that care about that event.
4434 *
4435 * - The `EventPluginHub` then dispatches the events.
4436 *
4437 * Overview of React and the event system:
4438 *
4439 * +------------+ .
4440 * | DOM | .
4441 * +------------+ .
4442 * | .
4443 * v .
4444 * +------------+ .
4445 * | ReactEvent | .
4446 * | Listener | .
4447 * +------------+ . +-----------+
4448 * | . +--------+|SimpleEvent|
4449 * | . | |Plugin |
4450 * +-----|------+ . v +-----------+
4451 * | | | . +--------------+ +------------+
4452 * | +-----------.--->|EventPluginHub| | Event |
4453 * | | . | | +-----------+ | Propagators|
4454 * | ReactEvent | . | | |TapEvent | |------------|
4455 * | Emitter | . | |<---+|Plugin | |other plugin|
4456 * | | . | | +-----------+ | utilities |
4457 * | +-----------.--->| | +------------+
4458 * | | | . +--------------+
4459 * +-----|------+ . ^ +-----------+
4460 * | . | |Enter/Leave|
4461 * + . +-------+|Plugin |
4462 * +-------------+ . +-----------+
4463 * | application | .
4464 * |-------------| .
4465 * | | .
4466 * | | .
4467 * +-------------+ .
4468 * .
4469 * React Core . General Purpose Event Plugin System
4470 */
4471
4472var hasEventPageXY;
4473var alreadyListeningTo = {};
4474var isMonitoringScrollValue = false;
4475var reactTopListenersCounter = 0;
4476
4477// For events like 'submit' which don't consistently bubble (which we trap at a
4478// lower node than `document`), binding at `document` would cause duplicate
4479// events so we don't include them here
4480var topEventMapping = {
4481 topAbort: 'abort',
4482 topAnimationEnd: getVendorPrefixedEventName('animationend') || 'animationend',
4483 topAnimationIteration: getVendorPrefixedEventName('animationiteration') || 'animationiteration',
4484 topAnimationStart: getVendorPrefixedEventName('animationstart') || 'animationstart',
4485 topBlur: 'blur',
4486 topCanPlay: 'canplay',
4487 topCanPlayThrough: 'canplaythrough',
4488 topChange: 'change',
4489 topClick: 'click',
4490 topCompositionEnd: 'compositionend',
4491 topCompositionStart: 'compositionstart',
4492 topCompositionUpdate: 'compositionupdate',
4493 topContextMenu: 'contextmenu',
4494 topCopy: 'copy',
4495 topCut: 'cut',
4496 topDoubleClick: 'dblclick',
4497 topDrag: 'drag',
4498 topDragEnd: 'dragend',
4499 topDragEnter: 'dragenter',
4500 topDragExit: 'dragexit',
4501 topDragLeave: 'dragleave',
4502 topDragOver: 'dragover',
4503 topDragStart: 'dragstart',
4504 topDrop: 'drop',
4505 topDurationChange: 'durationchange',
4506 topEmptied: 'emptied',
4507 topEncrypted: 'encrypted',
4508 topEnded: 'ended',
4509 topError: 'error',
4510 topFocus: 'focus',
4511 topInput: 'input',
4512 topKeyDown: 'keydown',
4513 topKeyPress: 'keypress',
4514 topKeyUp: 'keyup',
4515 topLoadedData: 'loadeddata',
4516 topLoadedMetadata: 'loadedmetadata',
4517 topLoadStart: 'loadstart',
4518 topMouseDown: 'mousedown',
4519 topMouseMove: 'mousemove',
4520 topMouseOut: 'mouseout',
4521 topMouseOver: 'mouseover',
4522 topMouseUp: 'mouseup',
4523 topPaste: 'paste',
4524 topPause: 'pause',
4525 topPlay: 'play',
4526 topPlaying: 'playing',
4527 topProgress: 'progress',
4528 topRateChange: 'ratechange',
4529 topScroll: 'scroll',
4530 topSeeked: 'seeked',
4531 topSeeking: 'seeking',
4532 topSelectionChange: 'selectionchange',
4533 topStalled: 'stalled',
4534 topSuspend: 'suspend',
4535 topTextInput: 'textInput',
4536 topTimeUpdate: 'timeupdate',
4537 topTouchCancel: 'touchcancel',
4538 topTouchEnd: 'touchend',
4539 topTouchMove: 'touchmove',
4540 topTouchStart: 'touchstart',
4541 topTransitionEnd: getVendorPrefixedEventName('transitionend') || 'transitionend',
4542 topVolumeChange: 'volumechange',
4543 topWaiting: 'waiting',
4544 topWheel: 'wheel'
4545};
4546
4547/**
4548 * To ensure no conflicts with other potential React instances on the page
4549 */
4550var topListenersIDKey = '_reactListenersID' + String(Math.random()).slice(2);
4551
4552function getListeningForDocument(mountAt) {
4553 // In IE8, `mountAt` is a host object and doesn't have `hasOwnProperty`
4554 // directly.
4555 if (!Object.prototype.hasOwnProperty.call(mountAt, topListenersIDKey)) {
4556 mountAt[topListenersIDKey] = reactTopListenersCounter++;
4557 alreadyListeningTo[mountAt[topListenersIDKey]] = {};
4558 }
4559 return alreadyListeningTo[mountAt[topListenersIDKey]];
4560}
4561
4562/**
4563 * `ReactBrowserEventEmitter` is used to attach top-level event listeners. For
4564 * example:
4565 *
4566 * EventPluginHub.putListener('myID', 'onClick', myFunction);
4567 *
4568 * This would allocate a "registration" of `('onClick', myFunction)` on 'myID'.
4569 *
4570 * @internal
4571 */
4572var ReactBrowserEventEmitter = _assign({}, ReactEventEmitterMixin, {
4573 /**
4574 * Injectable event backend
4575 */
4576 ReactEventListener: null,
4577
4578 injection: {
4579 /**
4580 * @param {object} ReactEventListener
4581 */
4582 injectReactEventListener: function (ReactEventListener) {
4583 ReactEventListener.setHandleTopLevel(ReactBrowserEventEmitter.handleTopLevel);
4584 ReactBrowserEventEmitter.ReactEventListener = ReactEventListener;
4585 }
4586 },
4587
4588 /**
4589 * Sets whether or not any created callbacks should be enabled.
4590 *
4591 * @param {boolean} enabled True if callbacks should be enabled.
4592 */
4593 setEnabled: function (enabled) {
4594 if (ReactBrowserEventEmitter.ReactEventListener) {
4595 ReactBrowserEventEmitter.ReactEventListener.setEnabled(enabled);
4596 }
4597 },
4598
4599 /**
4600 * @return {boolean} True if callbacks are enabled.
4601 */
4602 isEnabled: function () {
4603 return !!(ReactBrowserEventEmitter.ReactEventListener && ReactBrowserEventEmitter.ReactEventListener.isEnabled());
4604 },
4605
4606 /**
4607 * We listen for bubbled touch events on the document object.
4608 *
4609 * Firefox v8.01 (and possibly others) exhibited strange behavior when
4610 * mounting `onmousemove` events at some node that was not the document
4611 * element. The symptoms were that if your mouse is not moving over something
4612 * contained within that mount point (for example on the background) the
4613 * top-level listeners for `onmousemove` won't be called. However, if you
4614 * register the `mousemove` on the document object, then it will of course
4615 * catch all `mousemove`s. This along with iOS quirks, justifies restricting
4616 * top-level listeners to the document object only, at least for these
4617 * movement types of events and possibly all events.
4618 *
4619 * @see http://www.quirksmode.org/blog/archives/2010/09/click_event_del.html
4620 *
4621 * Also, `keyup`/`keypress`/`keydown` do not bubble to the window on IE, but
4622 * they bubble to document.
4623 *
4624 * @param {string} registrationName Name of listener (e.g. `onClick`).
4625 * @param {object} contentDocumentHandle Document which owns the container
4626 */
4627 listenTo: function (registrationName, contentDocumentHandle) {
4628 var mountAt = contentDocumentHandle;
4629 var isListening = getListeningForDocument(mountAt);
4630 var dependencies = EventPluginRegistry.registrationNameDependencies[registrationName];
4631
4632 for (var i = 0; i < dependencies.length; i++) {
4633 var dependency = dependencies[i];
4634 if (!(isListening.hasOwnProperty(dependency) && isListening[dependency])) {
4635 if (dependency === 'topWheel') {
4636 if (isEventSupported('wheel')) {
4637 ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent('topWheel', 'wheel', mountAt);
4638 } else if (isEventSupported('mousewheel')) {
4639 ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent('topWheel', 'mousewheel', mountAt);
4640 } else {
4641 // Firefox needs to capture a different mouse scroll event.
4642 // @see http://www.quirksmode.org/dom/events/tests/scroll.html
4643 ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent('topWheel', 'DOMMouseScroll', mountAt);
4644 }
4645 } else if (dependency === 'topScroll') {
4646 if (isEventSupported('scroll', true)) {
4647 ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent('topScroll', 'scroll', mountAt);
4648 } else {
4649 ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent('topScroll', 'scroll', ReactBrowserEventEmitter.ReactEventListener.WINDOW_HANDLE);
4650 }
4651 } else if (dependency === 'topFocus' || dependency === 'topBlur') {
4652 if (isEventSupported('focus', true)) {
4653 ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent('topFocus', 'focus', mountAt);
4654 ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent('topBlur', 'blur', mountAt);
4655 } else if (isEventSupported('focusin')) {
4656 // IE has `focusin` and `focusout` events which bubble.
4657 // @see http://www.quirksmode.org/blog/archives/2008/04/delegating_the.html
4658 ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent('topFocus', 'focusin', mountAt);
4659 ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent('topBlur', 'focusout', mountAt);
4660 }
4661
4662 // to make sure blur and focus event listeners are only attached once
4663 isListening.topBlur = true;
4664 isListening.topFocus = true;
4665 } else if (topEventMapping.hasOwnProperty(dependency)) {
4666 ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(dependency, topEventMapping[dependency], mountAt);
4667 }
4668
4669 isListening[dependency] = true;
4670 }
4671 }
4672 },
4673
4674 trapBubbledEvent: function (topLevelType, handlerBaseName, handle) {
4675 return ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(topLevelType, handlerBaseName, handle);
4676 },
4677
4678 trapCapturedEvent: function (topLevelType, handlerBaseName, handle) {
4679 return ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent(topLevelType, handlerBaseName, handle);
4680 },
4681
4682 /**
4683 * Protect against document.createEvent() returning null
4684 * Some popup blocker extensions appear to do this:
4685 * https://github.com/facebook/react/issues/6887
4686 */
4687 supportsEventPageXY: function () {
4688 if (!document.createEvent) {
4689 return false;
4690 }
4691 var ev = document.createEvent('MouseEvent');
4692 return ev != null && 'pageX' in ev;
4693 },
4694
4695 /**
4696 * Listens to window scroll and resize events. We cache scroll values so that
4697 * application code can access them without triggering reflows.
4698 *
4699 * ViewportMetrics is only used by SyntheticMouse/TouchEvent and only when
4700 * pageX/pageY isn't supported (legacy browsers).
4701 *
4702 * NOTE: Scroll events do not bubble.
4703 *
4704 * @see http://www.quirksmode.org/dom/events/scroll.html
4705 */
4706 ensureScrollValueMonitoring: function () {
4707 if (hasEventPageXY === undefined) {
4708 hasEventPageXY = ReactBrowserEventEmitter.supportsEventPageXY();
4709 }
4710 if (!hasEventPageXY && !isMonitoringScrollValue) {
4711 var refresh = ViewportMetrics.refreshScrollValues;
4712 ReactBrowserEventEmitter.ReactEventListener.monitorScrollValue(refresh);
4713 isMonitoringScrollValue = true;
4714 }
4715 }
4716});
4717
4718module.exports = ReactBrowserEventEmitter;
4719
4720/***/ }),
4721/* 34 */
4722/***/ (function(module, exports) {
4723
4724/*
4725 MIT License http://www.opensource.org/licenses/mit-license.php
4726 Author Tobias Koppers @sokra
4727*/
4728// css base code, injected by the css-loader
4729module.exports = function(useSourceMap) {
4730 var list = [];
4731
4732 // return the list of modules as css string
4733 list.toString = function toString() {
4734 return this.map(function (item) {
4735 var content = cssWithMappingToString(item, useSourceMap);
4736 if(item[2]) {
4737 return "@media " + item[2] + "{" + content + "}";
4738 } else {
4739 return content;
4740 }
4741 }).join("");
4742 };
4743
4744 // import a list of modules into the list
4745 list.i = function(modules, mediaQuery) {
4746 if(typeof modules === "string")
4747 modules = [[null, modules, ""]];
4748 var alreadyImportedModules = {};
4749 for(var i = 0; i < this.length; i++) {
4750 var id = this[i][0];
4751 if(typeof id === "number")
4752 alreadyImportedModules[id] = true;
4753 }
4754 for(i = 0; i < modules.length; i++) {
4755 var item = modules[i];
4756 // skip already imported module
4757 // this implementation is not 100% perfect for weird media query combinations
4758 // when a module is imported multiple times with different media queries.
4759 // I hope this will never occur (Hey this way we have smaller bundles)
4760 if(typeof item[0] !== "number" || !alreadyImportedModules[item[0]]) {
4761 if(mediaQuery && !item[2]) {
4762 item[2] = mediaQuery;
4763 } else if(mediaQuery) {
4764 item[2] = "(" + item[2] + ") and (" + mediaQuery + ")";
4765 }
4766 list.push(item);
4767 }
4768 }
4769 };
4770 return list;
4771};
4772
4773function cssWithMappingToString(item, useSourceMap) {
4774 var content = item[1] || '';
4775 var cssMapping = item[3];
4776 if (!cssMapping) {
4777 return content;
4778 }
4779
4780 if (useSourceMap && typeof btoa === 'function') {
4781 var sourceMapping = toComment(cssMapping);
4782 var sourceURLs = cssMapping.sources.map(function (source) {
4783 return '/*# sourceURL=' + cssMapping.sourceRoot + source + ' */'
4784 });
4785
4786 return [content].concat(sourceURLs).concat([sourceMapping]).join('\n');
4787 }
4788
4789 return [content].join('\n');
4790}
4791
4792// Adapted from convert-source-map (MIT)
4793function toComment(sourceMap) {
4794 // eslint-disable-next-line no-undef
4795 var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));
4796 var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;
4797
4798 return '/*# ' + data + ' */';
4799}
4800
4801
4802/***/ }),
4803/* 35 */
4804/***/ (function(module, exports, __webpack_require__) {
4805
4806/*
4807 MIT License http://www.opensource.org/licenses/mit-license.php
4808 Author Tobias Koppers @sokra
4809*/
4810
4811var stylesInDom = {};
4812
4813var memoize = function (fn) {
4814 var memo;
4815
4816 return function () {
4817 if (typeof memo === "undefined") memo = fn.apply(this, arguments);
4818 return memo;
4819 };
4820};
4821
4822var isOldIE = memoize(function () {
4823 // Test for IE <= 9 as proposed by Browserhacks
4824 // @see http://browserhacks.com/#hack-e71d8692f65334173fee715c222cb805
4825 // Tests for existence of standard globals is to allow style-loader
4826 // to operate correctly into non-standard environments
4827 // @see https://github.com/webpack-contrib/style-loader/issues/177
4828 return window && document && document.all && !window.atob;
4829});
4830
4831var getElement = (function (fn) {
4832 var memo = {};
4833
4834 return function(selector) {
4835 if (typeof memo[selector] === "undefined") {
4836 memo[selector] = fn.call(this, selector);
4837 }
4838
4839 return memo[selector]
4840 };
4841})(function (target) {
4842 return document.querySelector(target)
4843});
4844
4845var singleton = null;
4846var singletonCounter = 0;
4847var stylesInsertedAtTop = [];
4848
4849var fixUrls = __webpack_require__(198);
4850
4851module.exports = function(list, options) {
4852 if (typeof DEBUG !== "undefined" && DEBUG) {
4853 if (typeof document !== "object") throw new Error("The style-loader cannot be used in a non-browser environment");
4854 }
4855
4856 options = options || {};
4857
4858 options.attrs = typeof options.attrs === "object" ? options.attrs : {};
4859
4860 // Force single-tag solution on IE6-9, which has a hard limit on the # of <style>
4861 // tags it will allow on a page
4862 if (!options.singleton) options.singleton = isOldIE();
4863
4864 // By default, add <style> tags to the <head> element
4865 if (!options.insertInto) options.insertInto = "head";
4866
4867 // By default, add <style> tags to the bottom of the target
4868 if (!options.insertAt) options.insertAt = "bottom";
4869
4870 var styles = listToStyles(list, options);
4871
4872 addStylesToDom(styles, options);
4873
4874 return function update (newList) {
4875 var mayRemove = [];
4876
4877 for (var i = 0; i < styles.length; i++) {
4878 var item = styles[i];
4879 var domStyle = stylesInDom[item.id];
4880
4881 domStyle.refs--;
4882 mayRemove.push(domStyle);
4883 }
4884
4885 if(newList) {
4886 var newStyles = listToStyles(newList, options);
4887 addStylesToDom(newStyles, options);
4888 }
4889
4890 for (var i = 0; i < mayRemove.length; i++) {
4891 var domStyle = mayRemove[i];
4892
4893 if(domStyle.refs === 0) {
4894 for (var j = 0; j < domStyle.parts.length; j++) domStyle.parts[j]();
4895
4896 delete stylesInDom[domStyle.id];
4897 }
4898 }
4899 };
4900};
4901
4902function addStylesToDom (styles, options) {
4903 for (var i = 0; i < styles.length; i++) {
4904 var item = styles[i];
4905 var domStyle = stylesInDom[item.id];
4906
4907 if(domStyle) {
4908 domStyle.refs++;
4909
4910 for(var j = 0; j < domStyle.parts.length; j++) {
4911 domStyle.parts[j](item.parts[j]);
4912 }
4913
4914 for(; j < item.parts.length; j++) {
4915 domStyle.parts.push(addStyle(item.parts[j], options));
4916 }
4917 } else {
4918 var parts = [];
4919
4920 for(var j = 0; j < item.parts.length; j++) {
4921 parts.push(addStyle(item.parts[j], options));
4922 }
4923
4924 stylesInDom[item.id] = {id: item.id, refs: 1, parts: parts};
4925 }
4926 }
4927}
4928
4929function listToStyles (list, options) {
4930 var styles = [];
4931 var newStyles = {};
4932
4933 for (var i = 0; i < list.length; i++) {
4934 var item = list[i];
4935 var id = options.base ? item[0] + options.base : item[0];
4936 var css = item[1];
4937 var media = item[2];
4938 var sourceMap = item[3];
4939 var part = {css: css, media: media, sourceMap: sourceMap};
4940
4941 if(!newStyles[id]) styles.push(newStyles[id] = {id: id, parts: [part]});
4942 else newStyles[id].parts.push(part);
4943 }
4944
4945 return styles;
4946}
4947
4948function insertStyleElement (options, style) {
4949 var target = getElement(options.insertInto)
4950
4951 if (!target) {
4952 throw new Error("Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid.");
4953 }
4954
4955 var lastStyleElementInsertedAtTop = stylesInsertedAtTop[stylesInsertedAtTop.length - 1];
4956
4957 if (options.insertAt === "top") {
4958 if (!lastStyleElementInsertedAtTop) {
4959 target.insertBefore(style, target.firstChild);
4960 } else if (lastStyleElementInsertedAtTop.nextSibling) {
4961 target.insertBefore(style, lastStyleElementInsertedAtTop.nextSibling);
4962 } else {
4963 target.appendChild(style);
4964 }
4965 stylesInsertedAtTop.push(style);
4966 } else if (options.insertAt === "bottom") {
4967 target.appendChild(style);
4968 } else {
4969 throw new Error("Invalid value for parameter 'insertAt'. Must be 'top' or 'bottom'.");
4970 }
4971}
4972
4973function removeStyleElement (style) {
4974 if (style.parentNode === null) return false;
4975 style.parentNode.removeChild(style);
4976
4977 var idx = stylesInsertedAtTop.indexOf(style);
4978 if(idx >= 0) {
4979 stylesInsertedAtTop.splice(idx, 1);
4980 }
4981}
4982
4983function createStyleElement (options) {
4984 var style = document.createElement("style");
4985
4986 options.attrs.type = "text/css";
4987
4988 addAttrs(style, options.attrs);
4989 insertStyleElement(options, style);
4990
4991 return style;
4992}
4993
4994function createLinkElement (options) {
4995 var link = document.createElement("link");
4996
4997 options.attrs.type = "text/css";
4998 options.attrs.rel = "stylesheet";
4999
5000 addAttrs(link, options.attrs);
5001 insertStyleElement(options, link);
5002
5003 return link;
5004}
5005
5006function addAttrs (el, attrs) {
5007 Object.keys(attrs).forEach(function (key) {
5008 el.setAttribute(key, attrs[key]);
5009 });
5010}
5011
5012function addStyle (obj, options) {
5013 var style, update, remove, result;
5014
5015 // If a transform function was defined, run it on the css
5016 if (options.transform && obj.css) {
5017 result = options.transform(obj.css);
5018
5019 if (result) {
5020 // If transform returns a value, use that instead of the original css.
5021 // This allows running runtime transformations on the css.
5022 obj.css = result;
5023 } else {
5024 // If the transform function returns a falsy value, don't add this css.
5025 // This allows conditional loading of css
5026 return function() {
5027 // noop
5028 };
5029 }
5030 }
5031
5032 if (options.singleton) {
5033 var styleIndex = singletonCounter++;
5034
5035 style = singleton || (singleton = createStyleElement(options));
5036
5037 update = applyToSingletonTag.bind(null, style, styleIndex, false);
5038 remove = applyToSingletonTag.bind(null, style, styleIndex, true);
5039
5040 } else if (
5041 obj.sourceMap &&
5042 typeof URL === "function" &&
5043 typeof URL.createObjectURL === "function" &&
5044 typeof URL.revokeObjectURL === "function" &&
5045 typeof Blob === "function" &&
5046 typeof btoa === "function"
5047 ) {
5048 style = createLinkElement(options);
5049 update = updateLink.bind(null, style, options);
5050 remove = function () {
5051 removeStyleElement(style);
5052
5053 if(style.href) URL.revokeObjectURL(style.href);
5054 };
5055 } else {
5056 style = createStyleElement(options);
5057 update = applyToTag.bind(null, style);
5058 remove = function () {
5059 removeStyleElement(style);
5060 };
5061 }
5062
5063 update(obj);
5064
5065 return function updateStyle (newObj) {
5066 if (newObj) {
5067 if (
5068 newObj.css === obj.css &&
5069 newObj.media === obj.media &&
5070 newObj.sourceMap === obj.sourceMap
5071 ) {
5072 return;
5073 }
5074
5075 update(obj = newObj);
5076 } else {
5077 remove();
5078 }
5079 };
5080}
5081
5082var replaceText = (function () {
5083 var textStore = [];
5084
5085 return function (index, replacement) {
5086 textStore[index] = replacement;
5087
5088 return textStore.filter(Boolean).join('\n');
5089 };
5090})();
5091
5092function applyToSingletonTag (style, index, remove, obj) {
5093 var css = remove ? "" : obj.css;
5094
5095 if (style.styleSheet) {
5096 style.styleSheet.cssText = replaceText(index, css);
5097 } else {
5098 var cssNode = document.createTextNode(css);
5099 var childNodes = style.childNodes;
5100
5101 if (childNodes[index]) style.removeChild(childNodes[index]);
5102
5103 if (childNodes.length) {
5104 style.insertBefore(cssNode, childNodes[index]);
5105 } else {
5106 style.appendChild(cssNode);
5107 }
5108 }
5109}
5110
5111function applyToTag (style, obj) {
5112 var css = obj.css;
5113 var media = obj.media;
5114
5115 if(media) {
5116 style.setAttribute("media", media)
5117 }
5118
5119 if(style.styleSheet) {
5120 style.styleSheet.cssText = css;
5121 } else {
5122 while(style.firstChild) {
5123 style.removeChild(style.firstChild);
5124 }
5125
5126 style.appendChild(document.createTextNode(css));
5127 }
5128}
5129
5130function updateLink (link, options, obj) {
5131 var css = obj.css;
5132 var sourceMap = obj.sourceMap;
5133
5134 /*
5135 If convertToAbsoluteUrls isn't defined, but sourcemaps are enabled
5136 and there is no publicPath defined then lets turn convertToAbsoluteUrls
5137 on by default. Otherwise default to the convertToAbsoluteUrls option
5138 directly
5139 */
5140 var autoFixUrls = options.convertToAbsoluteUrls === undefined && sourceMap;
5141
5142 if (options.convertToAbsoluteUrls || autoFixUrls) {
5143 css = fixUrls(css);
5144 }
5145
5146 if (sourceMap) {
5147 // http://stackoverflow.com/a/26603875
5148 css += "\n/*# sourceMappingURL=data:application/json;base64," + btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))) + " */";
5149 }
5150
5151 var blob = new Blob([css], { type: "text/css" });
5152
5153 var oldSrc = link.href;
5154
5155 link.href = URL.createObjectURL(blob);
5156
5157 if(oldSrc) URL.revokeObjectURL(oldSrc);
5158}
5159
5160
5161/***/ }),
5162/* 36 */
5163/***/ (function(module, exports, __webpack_require__) {
5164
5165"use strict";
5166/* WEBPACK VAR INJECTION */(function(process) {/**
5167 * Copyright 2014-2015, Facebook, Inc.
5168 * All rights reserved.
5169 *
5170 * This source code is licensed under the BSD-style license found in the
5171 * LICENSE file in the root directory of this source tree. An additional grant
5172 * of patent rights can be found in the PATENTS file in the same directory.
5173 *
5174 */
5175
5176
5177
5178/**
5179 * Forked from fbjs/warning:
5180 * https://github.com/facebook/fbjs/blob/e66ba20ad5be433eb54423f2b097d829324d9de6/packages/fbjs/src/__forks__/warning.js
5181 *
5182 * Only change is we use console.warn instead of console.error,
5183 * and do nothing when 'console' is not supported.
5184 * This really simplifies the code.
5185 * ---
5186 * Similar to invariant but only logs a warning if the condition is not met.
5187 * This can be used to log issues in development environments in critical
5188 * paths. Removing the logging code for production environments will keep the
5189 * same logic and follow the same code paths.
5190 */
5191
5192var lowPriorityWarning = function () {};
5193
5194if (process.env.NODE_ENV !== 'production') {
5195 var printWarning = function (format) {
5196 for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
5197 args[_key - 1] = arguments[_key];
5198 }
5199
5200 var argIndex = 0;
5201 var message = 'Warning: ' + format.replace(/%s/g, function () {
5202 return args[argIndex++];
5203 });
5204 if (typeof console !== 'undefined') {
5205 console.warn(message);
5206 }
5207 try {
5208 // --- Welcome to debugging React ---
5209 // This error was thrown as a convenience so that you can use this stack
5210 // to find the callsite that caused this warning to fire.
5211 throw new Error(message);
5212 } catch (x) {}
5213 };
5214
5215 lowPriorityWarning = function (condition, format) {
5216 if (format === undefined) {
5217 throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument');
5218 }
5219 if (!condition) {
5220 for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
5221 args[_key2 - 2] = arguments[_key2];
5222 }
5223
5224 printWarning.apply(undefined, [format].concat(args));
5225 }
5226 };
5227}
5228
5229module.exports = lowPriorityWarning;
5230/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
5231
5232/***/ }),
5233/* 37 */
5234/***/ (function(module, exports, __webpack_require__) {
5235
5236"use strict";
5237/**
5238 * Copyright 2013-present, Facebook, Inc.
5239 * All rights reserved.
5240 *
5241 * This source code is licensed under the BSD-style license found in the
5242 * LICENSE file in the root directory of this source tree. An additional grant
5243 * of patent rights can be found in the PATENTS file in the same directory.
5244 */
5245
5246
5247
5248var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
5249
5250module.exports = ReactPropTypesSecret;
5251
5252
5253/***/ }),
5254/* 38 */
5255/***/ (function(module, exports, __webpack_require__) {
5256
5257"use strict";
5258/* WEBPACK VAR INJECTION */(function(process) {/**
5259 * Copyright 2013-present, Facebook, Inc.
5260 * All rights reserved.
5261 *
5262 * This source code is licensed under the BSD-style license found in the
5263 * LICENSE file in the root directory of this source tree. An additional grant
5264 * of patent rights can be found in the PATENTS file in the same directory.
5265 *
5266 */
5267
5268
5269
5270var _prodInvariant = __webpack_require__(3);
5271
5272var ReactErrorUtils = __webpack_require__(39);
5273
5274var invariant = __webpack_require__(1);
5275var warning = __webpack_require__(2);
5276
5277/**
5278 * Injected dependencies:
5279 */
5280
5281/**
5282 * - `ComponentTree`: [required] Module that can convert between React instances
5283 * and actual node references.
5284 */
5285var ComponentTree;
5286var TreeTraversal;
5287var injection = {
5288 injectComponentTree: function (Injected) {
5289 ComponentTree = Injected;
5290 if (process.env.NODE_ENV !== 'production') {
5291 process.env.NODE_ENV !== 'production' ? warning(Injected && Injected.getNodeFromInstance && Injected.getInstanceFromNode, 'EventPluginUtils.injection.injectComponentTree(...): Injected ' + 'module is missing getNodeFromInstance or getInstanceFromNode.') : void 0;
5292 }
5293 },
5294 injectTreeTraversal: function (Injected) {
5295 TreeTraversal = Injected;
5296 if (process.env.NODE_ENV !== 'production') {
5297 process.env.NODE_ENV !== 'production' ? warning(Injected && Injected.isAncestor && Injected.getLowestCommonAncestor, 'EventPluginUtils.injection.injectTreeTraversal(...): Injected ' + 'module is missing isAncestor or getLowestCommonAncestor.') : void 0;
5298 }
5299 }
5300};
5301
5302function isEndish(topLevelType) {
5303 return topLevelType === 'topMouseUp' || topLevelType === 'topTouchEnd' || topLevelType === 'topTouchCancel';
5304}
5305
5306function isMoveish(topLevelType) {
5307 return topLevelType === 'topMouseMove' || topLevelType === 'topTouchMove';
5308}
5309function isStartish(topLevelType) {
5310 return topLevelType === 'topMouseDown' || topLevelType === 'topTouchStart';
5311}
5312
5313var validateEventDispatches;
5314if (process.env.NODE_ENV !== 'production') {
5315 validateEventDispatches = function (event) {
5316 var dispatchListeners = event._dispatchListeners;
5317 var dispatchInstances = event._dispatchInstances;
5318
5319 var listenersIsArr = Array.isArray(dispatchListeners);
5320 var listenersLen = listenersIsArr ? dispatchListeners.length : dispatchListeners ? 1 : 0;
5321
5322 var instancesIsArr = Array.isArray(dispatchInstances);
5323 var instancesLen = instancesIsArr ? dispatchInstances.length : dispatchInstances ? 1 : 0;
5324
5325 process.env.NODE_ENV !== 'production' ? warning(instancesIsArr === listenersIsArr && instancesLen === listenersLen, 'EventPluginUtils: Invalid `event`.') : void 0;
5326 };
5327}
5328
5329/**
5330 * Dispatch the event to the listener.
5331 * @param {SyntheticEvent} event SyntheticEvent to handle
5332 * @param {boolean} simulated If the event is simulated (changes exn behavior)
5333 * @param {function} listener Application-level callback
5334 * @param {*} inst Internal component instance
5335 */
5336function executeDispatch(event, simulated, listener, inst) {
5337 var type = event.type || 'unknown-event';
5338 event.currentTarget = EventPluginUtils.getNodeFromInstance(inst);
5339 if (simulated) {
5340 ReactErrorUtils.invokeGuardedCallbackWithCatch(type, listener, event);
5341 } else {
5342 ReactErrorUtils.invokeGuardedCallback(type, listener, event);
5343 }
5344 event.currentTarget = null;
5345}
5346
5347/**
5348 * Standard/simple iteration through an event's collected dispatches.
5349 */
5350function executeDispatchesInOrder(event, simulated) {
5351 var dispatchListeners = event._dispatchListeners;
5352 var dispatchInstances = event._dispatchInstances;
5353 if (process.env.NODE_ENV !== 'production') {
5354 validateEventDispatches(event);
5355 }
5356 if (Array.isArray(dispatchListeners)) {
5357 for (var i = 0; i < dispatchListeners.length; i++) {
5358 if (event.isPropagationStopped()) {
5359 break;
5360 }
5361 // Listeners and Instances are two parallel arrays that are always in sync.
5362 executeDispatch(event, simulated, dispatchListeners[i], dispatchInstances[i]);
5363 }
5364 } else if (dispatchListeners) {
5365 executeDispatch(event, simulated, dispatchListeners, dispatchInstances);
5366 }
5367 event._dispatchListeners = null;
5368 event._dispatchInstances = null;
5369}
5370
5371/**
5372 * Standard/simple iteration through an event's collected dispatches, but stops
5373 * at the first dispatch execution returning true, and returns that id.
5374 *
5375 * @return {?string} id of the first dispatch execution who's listener returns
5376 * true, or null if no listener returned true.
5377 */
5378function executeDispatchesInOrderStopAtTrueImpl(event) {
5379 var dispatchListeners = event._dispatchListeners;
5380 var dispatchInstances = event._dispatchInstances;
5381 if (process.env.NODE_ENV !== 'production') {
5382 validateEventDispatches(event);
5383 }
5384 if (Array.isArray(dispatchListeners)) {
5385 for (var i = 0; i < dispatchListeners.length; i++) {
5386 if (event.isPropagationStopped()) {
5387 break;
5388 }
5389 // Listeners and Instances are two parallel arrays that are always in sync.
5390 if (dispatchListeners[i](event, dispatchInstances[i])) {
5391 return dispatchInstances[i];
5392 }
5393 }
5394 } else if (dispatchListeners) {
5395 if (dispatchListeners(event, dispatchInstances)) {
5396 return dispatchInstances;
5397 }
5398 }
5399 return null;
5400}
5401
5402/**
5403 * @see executeDispatchesInOrderStopAtTrueImpl
5404 */
5405function executeDispatchesInOrderStopAtTrue(event) {
5406 var ret = executeDispatchesInOrderStopAtTrueImpl(event);
5407 event._dispatchInstances = null;
5408 event._dispatchListeners = null;
5409 return ret;
5410}
5411
5412/**
5413 * Execution of a "direct" dispatch - there must be at most one dispatch
5414 * accumulated on the event or it is considered an error. It doesn't really make
5415 * sense for an event with multiple dispatches (bubbled) to keep track of the
5416 * return values at each dispatch execution, but it does tend to make sense when
5417 * dealing with "direct" dispatches.
5418 *
5419 * @return {*} The return value of executing the single dispatch.
5420 */
5421function executeDirectDispatch(event) {
5422 if (process.env.NODE_ENV !== 'production') {
5423 validateEventDispatches(event);
5424 }
5425 var dispatchListener = event._dispatchListeners;
5426 var dispatchInstance = event._dispatchInstances;
5427 !!Array.isArray(dispatchListener) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'executeDirectDispatch(...): Invalid `event`.') : _prodInvariant('103') : void 0;
5428 event.currentTarget = dispatchListener ? EventPluginUtils.getNodeFromInstance(dispatchInstance) : null;
5429 var res = dispatchListener ? dispatchListener(event) : null;
5430 event.currentTarget = null;
5431 event._dispatchListeners = null;
5432 event._dispatchInstances = null;
5433 return res;
5434}
5435
5436/**
5437 * @param {SyntheticEvent} event
5438 * @return {boolean} True iff number of dispatches accumulated is greater than 0.
5439 */
5440function hasDispatches(event) {
5441 return !!event._dispatchListeners;
5442}
5443
5444/**
5445 * General utilities that are useful in creating custom Event Plugins.
5446 */
5447var EventPluginUtils = {
5448 isEndish: isEndish,
5449 isMoveish: isMoveish,
5450 isStartish: isStartish,
5451
5452 executeDirectDispatch: executeDirectDispatch,
5453 executeDispatchesInOrder: executeDispatchesInOrder,
5454 executeDispatchesInOrderStopAtTrue: executeDispatchesInOrderStopAtTrue,
5455 hasDispatches: hasDispatches,
5456
5457 getInstanceFromNode: function (node) {
5458 return ComponentTree.getInstanceFromNode(node);
5459 },
5460 getNodeFromInstance: function (node) {
5461 return ComponentTree.getNodeFromInstance(node);
5462 },
5463 isAncestor: function (a, b) {
5464 return TreeTraversal.isAncestor(a, b);
5465 },
5466 getLowestCommonAncestor: function (a, b) {
5467 return TreeTraversal.getLowestCommonAncestor(a, b);
5468 },
5469 getParentInstance: function (inst) {
5470 return TreeTraversal.getParentInstance(inst);
5471 },
5472 traverseTwoPhase: function (target, fn, arg) {
5473 return TreeTraversal.traverseTwoPhase(target, fn, arg);
5474 },
5475 traverseEnterLeave: function (from, to, fn, argFrom, argTo) {
5476 return TreeTraversal.traverseEnterLeave(from, to, fn, argFrom, argTo);
5477 },
5478
5479 injection: injection
5480};
5481
5482module.exports = EventPluginUtils;
5483/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
5484
5485/***/ }),
5486/* 39 */
5487/***/ (function(module, exports, __webpack_require__) {
5488
5489"use strict";
5490/* WEBPACK VAR INJECTION */(function(process) {/**
5491 * Copyright 2013-present, Facebook, Inc.
5492 * All rights reserved.
5493 *
5494 * This source code is licensed under the BSD-style license found in the
5495 * LICENSE file in the root directory of this source tree. An additional grant
5496 * of patent rights can be found in the PATENTS file in the same directory.
5497 *
5498 *
5499 */
5500
5501
5502
5503var caughtError = null;
5504
5505/**
5506 * Call a function while guarding against errors that happens within it.
5507 *
5508 * @param {String} name of the guard to use for logging or debugging
5509 * @param {Function} func The function to invoke
5510 * @param {*} a First argument
5511 * @param {*} b Second argument
5512 */
5513function invokeGuardedCallback(name, func, a) {
5514 try {
5515 func(a);
5516 } catch (x) {
5517 if (caughtError === null) {
5518 caughtError = x;
5519 }
5520 }
5521}
5522
5523var ReactErrorUtils = {
5524 invokeGuardedCallback: invokeGuardedCallback,
5525
5526 /**
5527 * Invoked by ReactTestUtils.Simulate so that any errors thrown by the event
5528 * handler are sure to be rethrown by rethrowCaughtError.
5529 */
5530 invokeGuardedCallbackWithCatch: invokeGuardedCallback,
5531
5532 /**
5533 * During execution of guarded functions we will capture the first error which
5534 * we will rethrow to be handled by the top level error handler.
5535 */
5536 rethrowCaughtError: function () {
5537 if (caughtError) {
5538 var error = caughtError;
5539 caughtError = null;
5540 throw error;
5541 }
5542 }
5543};
5544
5545if (process.env.NODE_ENV !== 'production') {
5546 /**
5547 * To help development we can get better devtools integration by simulating a
5548 * real browser event.
5549 */
5550 if (typeof window !== 'undefined' && typeof window.dispatchEvent === 'function' && typeof document !== 'undefined' && typeof document.createEvent === 'function') {
5551 var fakeNode = document.createElement('react');
5552 ReactErrorUtils.invokeGuardedCallback = function (name, func, a) {
5553 var boundFunc = func.bind(null, a);
5554 var evtType = 'react-' + name;
5555 fakeNode.addEventListener(evtType, boundFunc, false);
5556 var evt = document.createEvent('Event');
5557 evt.initEvent(evtType, false, false);
5558 fakeNode.dispatchEvent(evt);
5559 fakeNode.removeEventListener(evtType, boundFunc, false);
5560 };
5561 }
5562}
5563
5564module.exports = ReactErrorUtils;
5565/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
5566
5567/***/ }),
5568/* 40 */
5569/***/ (function(module, exports, __webpack_require__) {
5570
5571"use strict";
5572/**
5573 * Copyright 2013-present, Facebook, Inc.
5574 * All rights reserved.
5575 *
5576 * This source code is licensed under the BSD-style license found in the
5577 * LICENSE file in the root directory of this source tree. An additional grant
5578 * of patent rights can be found in the PATENTS file in the same directory.
5579 *
5580 */
5581
5582
5583
5584/**
5585 * Gets the target node from a native browser event by accounting for
5586 * inconsistencies in browser DOM APIs.
5587 *
5588 * @param {object} nativeEvent Native browser event.
5589 * @return {DOMEventTarget} Target node.
5590 */
5591
5592function getEventTarget(nativeEvent) {
5593 var target = nativeEvent.target || nativeEvent.srcElement || window;
5594
5595 // Normalize SVG <use> element events #4963
5596 if (target.correspondingUseElement) {
5597 target = target.correspondingUseElement;
5598 }
5599
5600 // Safari may fire events on text nodes (Node.TEXT_NODE is 3).
5601 // @see http://www.quirksmode.org/js/events_properties.html
5602 return target.nodeType === 3 ? target.parentNode : target;
5603}
5604
5605module.exports = getEventTarget;
5606
5607/***/ }),
5608/* 41 */
5609/***/ (function(module, exports, __webpack_require__) {
5610
5611"use strict";
5612/**
5613 * Copyright 2013-present, Facebook, Inc.
5614 * All rights reserved.
5615 *
5616 * This source code is licensed under the BSD-style license found in the
5617 * LICENSE file in the root directory of this source tree. An additional grant
5618 * of patent rights can be found in the PATENTS file in the same directory.
5619 *
5620 */
5621
5622
5623
5624var ExecutionEnvironment = __webpack_require__(6);
5625
5626var useHasFeature;
5627if (ExecutionEnvironment.canUseDOM) {
5628 useHasFeature = document.implementation && document.implementation.hasFeature &&
5629 // always returns true in newer browsers as per the standard.
5630 // @see http://dom.spec.whatwg.org/#dom-domimplementation-hasfeature
5631 document.implementation.hasFeature('', '') !== true;
5632}
5633
5634/**
5635 * Checks if an event is supported in the current execution environment.
5636 *
5637 * NOTE: This will not work correctly for non-generic events such as `change`,
5638 * `reset`, `load`, `error`, and `select`.
5639 *
5640 * Borrows from Modernizr.
5641 *
5642 * @param {string} eventNameSuffix Event name, e.g. "click".
5643 * @param {?boolean} capture Check if the capture phase is supported.
5644 * @return {boolean} True if the event is supported.
5645 * @internal
5646 * @license Modernizr 3.0.0pre (Custom Build) | MIT
5647 */
5648function isEventSupported(eventNameSuffix, capture) {
5649 if (!ExecutionEnvironment.canUseDOM || capture && !('addEventListener' in document)) {
5650 return false;
5651 }
5652
5653 var eventName = 'on' + eventNameSuffix;
5654 var isSupported = eventName in document;
5655
5656 if (!isSupported) {
5657 var element = document.createElement('div');
5658 element.setAttribute(eventName, 'return;');
5659 isSupported = typeof element[eventName] === 'function';
5660 }
5661
5662 if (!isSupported && useHasFeature && eventNameSuffix === 'wheel') {
5663 // This is the only way to test support for the `wheel` event in IE9+.
5664 isSupported = document.implementation.hasFeature('Events.wheel', '3.0');
5665 }
5666
5667 return isSupported;
5668}
5669
5670module.exports = isEventSupported;
5671
5672/***/ }),
5673/* 42 */
5674/***/ (function(module, exports, __webpack_require__) {
5675
5676"use strict";
5677/**
5678 * Copyright 2013-present, Facebook, Inc.
5679 * All rights reserved.
5680 *
5681 * This source code is licensed under the BSD-style license found in the
5682 * LICENSE file in the root directory of this source tree. An additional grant
5683 * of patent rights can be found in the PATENTS file in the same directory.
5684 *
5685 */
5686
5687
5688
5689/**
5690 * Translation from modifier key to the associated property in the event.
5691 * @see http://www.w3.org/TR/DOM-Level-3-Events/#keys-Modifiers
5692 */
5693
5694var modifierKeyToProp = {
5695 Alt: 'altKey',
5696 Control: 'ctrlKey',
5697 Meta: 'metaKey',
5698 Shift: 'shiftKey'
5699};
5700
5701// IE8 does not implement getModifierState so we simply map it to the only
5702// modifier keys exposed by the event itself, does not support Lock-keys.
5703// Currently, all major browsers except Chrome seems to support Lock-keys.
5704function modifierStateGetter(keyArg) {
5705 var syntheticEvent = this;
5706 var nativeEvent = syntheticEvent.nativeEvent;
5707 if (nativeEvent.getModifierState) {
5708 return nativeEvent.getModifierState(keyArg);
5709 }
5710 var keyProp = modifierKeyToProp[keyArg];
5711 return keyProp ? !!nativeEvent[keyProp] : false;
5712}
5713
5714function getEventModifierState(nativeEvent) {
5715 return modifierStateGetter;
5716}
5717
5718module.exports = getEventModifierState;
5719
5720/***/ }),
5721/* 43 */
5722/***/ (function(module, exports, __webpack_require__) {
5723
5724"use strict";
5725/* WEBPACK VAR INJECTION */(function(process) {/**
5726 * Copyright 2013-present, Facebook, Inc.
5727 * All rights reserved.
5728 *
5729 * This source code is licensed under the BSD-style license found in the
5730 * LICENSE file in the root directory of this source tree. An additional grant
5731 * of patent rights can be found in the PATENTS file in the same directory.
5732 *
5733 */
5734
5735
5736
5737var DOMLazyTree = __webpack_require__(20);
5738var Danger = __webpack_require__(125);
5739var ReactDOMComponentTree = __webpack_require__(5);
5740var ReactInstrumentation = __webpack_require__(9);
5741
5742var createMicrosoftUnsafeLocalFunction = __webpack_require__(45);
5743var setInnerHTML = __webpack_require__(31);
5744var setTextContent = __webpack_require__(73);
5745
5746function getNodeAfter(parentNode, node) {
5747 // Special case for text components, which return [open, close] comments
5748 // from getHostNode.
5749 if (Array.isArray(node)) {
5750 node = node[1];
5751 }
5752 return node ? node.nextSibling : parentNode.firstChild;
5753}
5754
5755/**
5756 * Inserts `childNode` as a child of `parentNode` at the `index`.
5757 *
5758 * @param {DOMElement} parentNode Parent node in which to insert.
5759 * @param {DOMElement} childNode Child node to insert.
5760 * @param {number} index Index at which to insert the child.
5761 * @internal
5762 */
5763var insertChildAt = createMicrosoftUnsafeLocalFunction(function (parentNode, childNode, referenceNode) {
5764 // We rely exclusively on `insertBefore(node, null)` instead of also using
5765 // `appendChild(node)`. (Using `undefined` is not allowed by all browsers so
5766 // we are careful to use `null`.)
5767 parentNode.insertBefore(childNode, referenceNode);
5768});
5769
5770function insertLazyTreeChildAt(parentNode, childTree, referenceNode) {
5771 DOMLazyTree.insertTreeBefore(parentNode, childTree, referenceNode);
5772}
5773
5774function moveChild(parentNode, childNode, referenceNode) {
5775 if (Array.isArray(childNode)) {
5776 moveDelimitedText(parentNode, childNode[0], childNode[1], referenceNode);
5777 } else {
5778 insertChildAt(parentNode, childNode, referenceNode);
5779 }
5780}
5781
5782function removeChild(parentNode, childNode) {
5783 if (Array.isArray(childNode)) {
5784 var closingComment = childNode[1];
5785 childNode = childNode[0];
5786 removeDelimitedText(parentNode, childNode, closingComment);
5787 parentNode.removeChild(closingComment);
5788 }
5789 parentNode.removeChild(childNode);
5790}
5791
5792function moveDelimitedText(parentNode, openingComment, closingComment, referenceNode) {
5793 var node = openingComment;
5794 while (true) {
5795 var nextNode = node.nextSibling;
5796 insertChildAt(parentNode, node, referenceNode);
5797 if (node === closingComment) {
5798 break;
5799 }
5800 node = nextNode;
5801 }
5802}
5803
5804function removeDelimitedText(parentNode, startNode, closingComment) {
5805 while (true) {
5806 var node = startNode.nextSibling;
5807 if (node === closingComment) {
5808 // The closing comment is removed by ReactMultiChild.
5809 break;
5810 } else {
5811 parentNode.removeChild(node);
5812 }
5813 }
5814}
5815
5816function replaceDelimitedText(openingComment, closingComment, stringText) {
5817 var parentNode = openingComment.parentNode;
5818 var nodeAfterComment = openingComment.nextSibling;
5819 if (nodeAfterComment === closingComment) {
5820 // There are no text nodes between the opening and closing comments; insert
5821 // a new one if stringText isn't empty.
5822 if (stringText) {
5823 insertChildAt(parentNode, document.createTextNode(stringText), nodeAfterComment);
5824 }
5825 } else {
5826 if (stringText) {
5827 // Set the text content of the first node after the opening comment, and
5828 // remove all following nodes up until the closing comment.
5829 setTextContent(nodeAfterComment, stringText);
5830 removeDelimitedText(parentNode, nodeAfterComment, closingComment);
5831 } else {
5832 removeDelimitedText(parentNode, openingComment, closingComment);
5833 }
5834 }
5835
5836 if (process.env.NODE_ENV !== 'production') {
5837 ReactInstrumentation.debugTool.onHostOperation({
5838 instanceID: ReactDOMComponentTree.getInstanceFromNode(openingComment)._debugID,
5839 type: 'replace text',
5840 payload: stringText
5841 });
5842 }
5843}
5844
5845var dangerouslyReplaceNodeWithMarkup = Danger.dangerouslyReplaceNodeWithMarkup;
5846if (process.env.NODE_ENV !== 'production') {
5847 dangerouslyReplaceNodeWithMarkup = function (oldChild, markup, prevInstance) {
5848 Danger.dangerouslyReplaceNodeWithMarkup(oldChild, markup);
5849 if (prevInstance._debugID !== 0) {
5850 ReactInstrumentation.debugTool.onHostOperation({
5851 instanceID: prevInstance._debugID,
5852 type: 'replace with',
5853 payload: markup.toString()
5854 });
5855 } else {
5856 var nextInstance = ReactDOMComponentTree.getInstanceFromNode(markup.node);
5857 if (nextInstance._debugID !== 0) {
5858 ReactInstrumentation.debugTool.onHostOperation({
5859 instanceID: nextInstance._debugID,
5860 type: 'mount',
5861 payload: markup.toString()
5862 });
5863 }
5864 }
5865 };
5866}
5867
5868/**
5869 * Operations for updating with DOM children.
5870 */
5871var DOMChildrenOperations = {
5872 dangerouslyReplaceNodeWithMarkup: dangerouslyReplaceNodeWithMarkup,
5873
5874 replaceDelimitedText: replaceDelimitedText,
5875
5876 /**
5877 * Updates a component's children by processing a series of updates. The
5878 * update configurations are each expected to have a `parentNode` property.
5879 *
5880 * @param {array<object>} updates List of update configurations.
5881 * @internal
5882 */
5883 processUpdates: function (parentNode, updates) {
5884 if (process.env.NODE_ENV !== 'production') {
5885 var parentNodeDebugID = ReactDOMComponentTree.getInstanceFromNode(parentNode)._debugID;
5886 }
5887
5888 for (var k = 0; k < updates.length; k++) {
5889 var update = updates[k];
5890 switch (update.type) {
5891 case 'INSERT_MARKUP':
5892 insertLazyTreeChildAt(parentNode, update.content, getNodeAfter(parentNode, update.afterNode));
5893 if (process.env.NODE_ENV !== 'production') {
5894 ReactInstrumentation.debugTool.onHostOperation({
5895 instanceID: parentNodeDebugID,
5896 type: 'insert child',
5897 payload: {
5898 toIndex: update.toIndex,
5899 content: update.content.toString()
5900 }
5901 });
5902 }
5903 break;
5904 case 'MOVE_EXISTING':
5905 moveChild(parentNode, update.fromNode, getNodeAfter(parentNode, update.afterNode));
5906 if (process.env.NODE_ENV !== 'production') {
5907 ReactInstrumentation.debugTool.onHostOperation({
5908 instanceID: parentNodeDebugID,
5909 type: 'move child',
5910 payload: { fromIndex: update.fromIndex, toIndex: update.toIndex }
5911 });
5912 }
5913 break;
5914 case 'SET_MARKUP':
5915 setInnerHTML(parentNode, update.content);
5916 if (process.env.NODE_ENV !== 'production') {
5917 ReactInstrumentation.debugTool.onHostOperation({
5918 instanceID: parentNodeDebugID,
5919 type: 'replace children',
5920 payload: update.content.toString()
5921 });
5922 }
5923 break;
5924 case 'TEXT_CONTENT':
5925 setTextContent(parentNode, update.content);
5926 if (process.env.NODE_ENV !== 'production') {
5927 ReactInstrumentation.debugTool.onHostOperation({
5928 instanceID: parentNodeDebugID,
5929 type: 'replace text',
5930 payload: update.content.toString()
5931 });
5932 }
5933 break;
5934 case 'REMOVE_NODE':
5935 removeChild(parentNode, update.fromNode);
5936 if (process.env.NODE_ENV !== 'production') {
5937 ReactInstrumentation.debugTool.onHostOperation({
5938 instanceID: parentNodeDebugID,
5939 type: 'remove child',
5940 payload: { fromIndex: update.fromIndex }
5941 });
5942 }
5943 break;
5944 }
5945 }
5946 }
5947};
5948
5949module.exports = DOMChildrenOperations;
5950/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
5951
5952/***/ }),
5953/* 44 */
5954/***/ (function(module, exports, __webpack_require__) {
5955
5956"use strict";
5957/**
5958 * Copyright 2013-present, Facebook, Inc.
5959 * All rights reserved.
5960 *
5961 * This source code is licensed under the BSD-style license found in the
5962 * LICENSE file in the root directory of this source tree. An additional grant
5963 * of patent rights can be found in the PATENTS file in the same directory.
5964 *
5965 */
5966
5967
5968
5969var DOMNamespaces = {
5970 html: 'http://www.w3.org/1999/xhtml',
5971 mathml: 'http://www.w3.org/1998/Math/MathML',
5972 svg: 'http://www.w3.org/2000/svg'
5973};
5974
5975module.exports = DOMNamespaces;
5976
5977/***/ }),
5978/* 45 */
5979/***/ (function(module, exports, __webpack_require__) {
5980
5981"use strict";
5982/**
5983 * Copyright 2013-present, Facebook, Inc.
5984 * All rights reserved.
5985 *
5986 * This source code is licensed under the BSD-style license found in the
5987 * LICENSE file in the root directory of this source tree. An additional grant
5988 * of patent rights can be found in the PATENTS file in the same directory.
5989 *
5990 */
5991
5992/* globals MSApp */
5993
5994
5995
5996/**
5997 * Create a function which has 'unsafe' privileges (required by windows8 apps)
5998 */
5999
6000var createMicrosoftUnsafeLocalFunction = function (func) {
6001 if (typeof MSApp !== 'undefined' && MSApp.execUnsafeLocalFunction) {
6002 return function (arg0, arg1, arg2, arg3) {
6003 MSApp.execUnsafeLocalFunction(function () {
6004 return func(arg0, arg1, arg2, arg3);
6005 });
6006 };
6007 } else {
6008 return func;
6009 }
6010};
6011
6012module.exports = createMicrosoftUnsafeLocalFunction;
6013
6014/***/ }),
6015/* 46 */
6016/***/ (function(module, exports, __webpack_require__) {
6017
6018"use strict";
6019/* WEBPACK VAR INJECTION */(function(process) {/**
6020 * Copyright 2013-present, Facebook, Inc.
6021 * All rights reserved.
6022 *
6023 * This source code is licensed under the BSD-style license found in the
6024 * LICENSE file in the root directory of this source tree. An additional grant
6025 * of patent rights can be found in the PATENTS file in the same directory.
6026 *
6027 */
6028
6029
6030
6031var _prodInvariant = __webpack_require__(3);
6032
6033var ReactPropTypesSecret = __webpack_require__(77);
6034var propTypesFactory = __webpack_require__(62);
6035
6036var React = __webpack_require__(17);
6037var PropTypes = propTypesFactory(React.isValidElement);
6038
6039var invariant = __webpack_require__(1);
6040var warning = __webpack_require__(2);
6041
6042var hasReadOnlyValue = {
6043 button: true,
6044 checkbox: true,
6045 image: true,
6046 hidden: true,
6047 radio: true,
6048 reset: true,
6049 submit: true
6050};
6051
6052function _assertSingleLink(inputProps) {
6053 !(inputProps.checkedLink == null || inputProps.valueLink == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Cannot provide a checkedLink and a valueLink. If you want to use checkedLink, you probably don\'t want to use valueLink and vice versa.') : _prodInvariant('87') : void 0;
6054}
6055function _assertValueLink(inputProps) {
6056 _assertSingleLink(inputProps);
6057 !(inputProps.value == null && inputProps.onChange == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Cannot provide a valueLink and a value or onChange event. If you want to use value or onChange, you probably don\'t want to use valueLink.') : _prodInvariant('88') : void 0;
6058}
6059
6060function _assertCheckedLink(inputProps) {
6061 _assertSingleLink(inputProps);
6062 !(inputProps.checked == null && inputProps.onChange == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Cannot provide a checkedLink and a checked property or onChange event. If you want to use checked or onChange, you probably don\'t want to use checkedLink') : _prodInvariant('89') : void 0;
6063}
6064
6065var propTypes = {
6066 value: function (props, propName, componentName) {
6067 if (!props[propName] || hasReadOnlyValue[props.type] || props.onChange || props.readOnly || props.disabled) {
6068 return null;
6069 }
6070 return new Error('You provided a `value` prop to a form field without an ' + '`onChange` handler. This will render a read-only field. If ' + 'the field should be mutable use `defaultValue`. Otherwise, ' + 'set either `onChange` or `readOnly`.');
6071 },
6072 checked: function (props, propName, componentName) {
6073 if (!props[propName] || props.onChange || props.readOnly || props.disabled) {
6074 return null;
6075 }
6076 return new Error('You provided a `checked` prop to a form field without an ' + '`onChange` handler. This will render a read-only field. If ' + 'the field should be mutable use `defaultChecked`. Otherwise, ' + 'set either `onChange` or `readOnly`.');
6077 },
6078 onChange: PropTypes.func
6079};
6080
6081var loggedTypeFailures = {};
6082function getDeclarationErrorAddendum(owner) {
6083 if (owner) {
6084 var name = owner.getName();
6085 if (name) {
6086 return ' Check the render method of `' + name + '`.';
6087 }
6088 }
6089 return '';
6090}
6091
6092/**
6093 * Provide a linked `value` attribute for controlled forms. You should not use
6094 * this outside of the ReactDOM controlled form components.
6095 */
6096var LinkedValueUtils = {
6097 checkPropTypes: function (tagName, props, owner) {
6098 for (var propName in propTypes) {
6099 if (propTypes.hasOwnProperty(propName)) {
6100 var error = propTypes[propName](props, propName, tagName, 'prop', null, ReactPropTypesSecret);
6101 }
6102 if (error instanceof Error && !(error.message in loggedTypeFailures)) {
6103 // Only monitor this failure once because there tends to be a lot of the
6104 // same error.
6105 loggedTypeFailures[error.message] = true;
6106
6107 var addendum = getDeclarationErrorAddendum(owner);
6108 process.env.NODE_ENV !== 'production' ? warning(false, 'Failed form propType: %s%s', error.message, addendum) : void 0;
6109 }
6110 }
6111 },
6112
6113 /**
6114 * @param {object} inputProps Props for form component
6115 * @return {*} current value of the input either from value prop or link.
6116 */
6117 getValue: function (inputProps) {
6118 if (inputProps.valueLink) {
6119 _assertValueLink(inputProps);
6120 return inputProps.valueLink.value;
6121 }
6122 return inputProps.value;
6123 },
6124
6125 /**
6126 * @param {object} inputProps Props for form component
6127 * @return {*} current checked status of the input either from checked prop
6128 * or link.
6129 */
6130 getChecked: function (inputProps) {
6131 if (inputProps.checkedLink) {
6132 _assertCheckedLink(inputProps);
6133 return inputProps.checkedLink.value;
6134 }
6135 return inputProps.checked;
6136 },
6137
6138 /**
6139 * @param {object} inputProps Props for form component
6140 * @param {SyntheticEvent} event change event to handle
6141 */
6142 executeOnChange: function (inputProps, event) {
6143 if (inputProps.valueLink) {
6144 _assertValueLink(inputProps);
6145 return inputProps.valueLink.requestChange(event.target.value);
6146 } else if (inputProps.checkedLink) {
6147 _assertCheckedLink(inputProps);
6148 return inputProps.checkedLink.requestChange(event.target.checked);
6149 } else if (inputProps.onChange) {
6150 return inputProps.onChange.call(undefined, event);
6151 }
6152 }
6153};
6154
6155module.exports = LinkedValueUtils;
6156/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
6157
6158/***/ }),
6159/* 47 */
6160/***/ (function(module, exports, __webpack_require__) {
6161
6162"use strict";
6163/* WEBPACK VAR INJECTION */(function(process) {/**
6164 * Copyright 2014-present, Facebook, Inc.
6165 * All rights reserved.
6166 *
6167 * This source code is licensed under the BSD-style license found in the
6168 * LICENSE file in the root directory of this source tree. An additional grant
6169 * of patent rights can be found in the PATENTS file in the same directory.
6170 *
6171 *
6172 */
6173
6174
6175
6176var _prodInvariant = __webpack_require__(3);
6177
6178var invariant = __webpack_require__(1);
6179
6180var injected = false;
6181
6182var ReactComponentEnvironment = {
6183 /**
6184 * Optionally injectable hook for swapping out mount images in the middle of
6185 * the tree.
6186 */
6187 replaceNodeWithMarkup: null,
6188
6189 /**
6190 * Optionally injectable hook for processing a queue of child updates. Will
6191 * later move into MultiChildComponents.
6192 */
6193 processChildrenUpdates: null,
6194
6195 injection: {
6196 injectEnvironment: function (environment) {
6197 !!injected ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactCompositeComponent: injectEnvironment() can only be called once.') : _prodInvariant('104') : void 0;
6198 ReactComponentEnvironment.replaceNodeWithMarkup = environment.replaceNodeWithMarkup;
6199 ReactComponentEnvironment.processChildrenUpdates = environment.processChildrenUpdates;
6200 injected = true;
6201 }
6202 }
6203};
6204
6205module.exports = ReactComponentEnvironment;
6206/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
6207
6208/***/ }),
6209/* 48 */
6210/***/ (function(module, exports, __webpack_require__) {
6211
6212"use strict";
6213/**
6214 * Copyright (c) 2013-present, Facebook, Inc.
6215 * All rights reserved.
6216 *
6217 * This source code is licensed under the BSD-style license found in the
6218 * LICENSE file in the root directory of this source tree. An additional grant
6219 * of patent rights can be found in the PATENTS file in the same directory.
6220 *
6221 * @typechecks
6222 *
6223 */
6224
6225/*eslint-disable no-self-compare */
6226
6227
6228
6229var hasOwnProperty = Object.prototype.hasOwnProperty;
6230
6231/**
6232 * inlined Object.is polyfill to avoid requiring consumers ship their own
6233 * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
6234 */
6235function is(x, y) {
6236 // SameValue algorithm
6237 if (x === y) {
6238 // Steps 1-5, 7-10
6239 // Steps 6.b-6.e: +0 != -0
6240 // Added the nonzero y check to make Flow happy, but it is redundant
6241 return x !== 0 || y !== 0 || 1 / x === 1 / y;
6242 } else {
6243 // Step 6.a: NaN == NaN
6244 return x !== x && y !== y;
6245 }
6246}
6247
6248/**
6249 * Performs equality by iterating through keys on an object and returning false
6250 * when any key has values which are not strictly equal between the arguments.
6251 * Returns true when the values of all keys are strictly equal.
6252 */
6253function shallowEqual(objA, objB) {
6254 if (is(objA, objB)) {
6255 return true;
6256 }
6257
6258 if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {
6259 return false;
6260 }
6261
6262 var keysA = Object.keys(objA);
6263 var keysB = Object.keys(objB);
6264
6265 if (keysA.length !== keysB.length) {
6266 return false;
6267 }
6268
6269 // Test for A's keys different from B.
6270 for (var i = 0; i < keysA.length; i++) {
6271 if (!hasOwnProperty.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) {
6272 return false;
6273 }
6274 }
6275
6276 return true;
6277}
6278
6279module.exports = shallowEqual;
6280
6281/***/ }),
6282/* 49 */
6283/***/ (function(module, exports, __webpack_require__) {
6284
6285"use strict";
6286/**
6287 * Copyright 2013-present, Facebook, Inc.
6288 * All rights reserved.
6289 *
6290 * This source code is licensed under the BSD-style license found in the
6291 * LICENSE file in the root directory of this source tree. An additional grant
6292 * of patent rights can be found in the PATENTS file in the same directory.
6293 *
6294 */
6295
6296
6297
6298/**
6299 * Given a `prevElement` and `nextElement`, determines if the existing
6300 * instance should be updated as opposed to being destroyed or replaced by a new
6301 * instance. Both arguments are elements. This ensures that this logic can
6302 * operate on stateless trees without any backing instance.
6303 *
6304 * @param {?object} prevElement
6305 * @param {?object} nextElement
6306 * @return {boolean} True if the existing instance should be updated.
6307 * @protected
6308 */
6309
6310function shouldUpdateReactComponent(prevElement, nextElement) {
6311 var prevEmpty = prevElement === null || prevElement === false;
6312 var nextEmpty = nextElement === null || nextElement === false;
6313 if (prevEmpty || nextEmpty) {
6314 return prevEmpty === nextEmpty;
6315 }
6316
6317 var prevType = typeof prevElement;
6318 var nextType = typeof nextElement;
6319 if (prevType === 'string' || prevType === 'number') {
6320 return nextType === 'string' || nextType === 'number';
6321 } else {
6322 return nextType === 'object' && prevElement.type === nextElement.type && prevElement.key === nextElement.key;
6323 }
6324}
6325
6326module.exports = shouldUpdateReactComponent;
6327
6328/***/ }),
6329/* 50 */
6330/***/ (function(module, exports, __webpack_require__) {
6331
6332"use strict";
6333/**
6334 * Copyright 2013-present, Facebook, Inc.
6335 * All rights reserved.
6336 *
6337 * This source code is licensed under the BSD-style license found in the
6338 * LICENSE file in the root directory of this source tree. An additional grant
6339 * of patent rights can be found in the PATENTS file in the same directory.
6340 *
6341 *
6342 */
6343
6344
6345
6346/**
6347 * Escape and wrap key so it is safe to use as a reactid
6348 *
6349 * @param {string} key to be escaped.
6350 * @return {string} the escaped key.
6351 */
6352
6353function escape(key) {
6354 var escapeRegex = /[=:]/g;
6355 var escaperLookup = {
6356 '=': '=0',
6357 ':': '=2'
6358 };
6359 var escapedString = ('' + key).replace(escapeRegex, function (match) {
6360 return escaperLookup[match];
6361 });
6362
6363 return '$' + escapedString;
6364}
6365
6366/**
6367 * Unescape and unwrap key for human-readable display
6368 *
6369 * @param {string} key to unescape.
6370 * @return {string} the unescaped key.
6371 */
6372function unescape(key) {
6373 var unescapeRegex = /(=0|=2)/g;
6374 var unescaperLookup = {
6375 '=0': '=',
6376 '=2': ':'
6377 };
6378 var keySubstring = key[0] === '.' && key[1] === '$' ? key.substring(2) : key.substring(1);
6379
6380 return ('' + keySubstring).replace(unescapeRegex, function (match) {
6381 return unescaperLookup[match];
6382 });
6383}
6384
6385var KeyEscapeUtils = {
6386 escape: escape,
6387 unescape: unescape
6388};
6389
6390module.exports = KeyEscapeUtils;
6391
6392/***/ }),
6393/* 51 */
6394/***/ (function(module, exports, __webpack_require__) {
6395
6396"use strict";
6397/* WEBPACK VAR INJECTION */(function(process) {/**
6398 * Copyright 2015-present, Facebook, Inc.
6399 * All rights reserved.
6400 *
6401 * This source code is licensed under the BSD-style license found in the
6402 * LICENSE file in the root directory of this source tree. An additional grant
6403 * of patent rights can be found in the PATENTS file in the same directory.
6404 *
6405 */
6406
6407
6408
6409var _prodInvariant = __webpack_require__(3);
6410
6411var ReactCurrentOwner = __webpack_require__(10);
6412var ReactInstanceMap = __webpack_require__(24);
6413var ReactInstrumentation = __webpack_require__(9);
6414var ReactUpdates = __webpack_require__(11);
6415
6416var invariant = __webpack_require__(1);
6417var warning = __webpack_require__(2);
6418
6419function enqueueUpdate(internalInstance) {
6420 ReactUpdates.enqueueUpdate(internalInstance);
6421}
6422
6423function formatUnexpectedArgument(arg) {
6424 var type = typeof arg;
6425 if (type !== 'object') {
6426 return type;
6427 }
6428 var displayName = arg.constructor && arg.constructor.name || type;
6429 var keys = Object.keys(arg);
6430 if (keys.length > 0 && keys.length < 20) {
6431 return displayName + ' (keys: ' + keys.join(', ') + ')';
6432 }
6433 return displayName;
6434}
6435
6436function getInternalInstanceReadyForUpdate(publicInstance, callerName) {
6437 var internalInstance = ReactInstanceMap.get(publicInstance);
6438 if (!internalInstance) {
6439 if (process.env.NODE_ENV !== 'production') {
6440 var ctor = publicInstance.constructor;
6441 // Only warn when we have a callerName. Otherwise we should be silent.
6442 // We're probably calling from enqueueCallback. We don't want to warn
6443 // there because we already warned for the corresponding lifecycle method.
6444 process.env.NODE_ENV !== 'production' ? warning(!callerName, '%s(...): Can only update a mounted or mounting component. ' + 'This usually means you called %s() on an unmounted component. ' + 'This is a no-op. Please check the code for the %s component.', callerName, callerName, ctor && (ctor.displayName || ctor.name) || 'ReactClass') : void 0;
6445 }
6446 return null;
6447 }
6448
6449 if (process.env.NODE_ENV !== 'production') {
6450 process.env.NODE_ENV !== 'production' ? warning(ReactCurrentOwner.current == null, '%s(...): Cannot update during an existing state transition (such as ' + "within `render` or another component's constructor). Render methods " + 'should be a pure function of props and state; constructor ' + 'side-effects are an anti-pattern, but can be moved to ' + '`componentWillMount`.', callerName) : void 0;
6451 }
6452
6453 return internalInstance;
6454}
6455
6456/**
6457 * ReactUpdateQueue allows for state updates to be scheduled into a later
6458 * reconciliation step.
6459 */
6460var ReactUpdateQueue = {
6461 /**
6462 * Checks whether or not this composite component is mounted.
6463 * @param {ReactClass} publicInstance The instance we want to test.
6464 * @return {boolean} True if mounted, false otherwise.
6465 * @protected
6466 * @final
6467 */
6468 isMounted: function (publicInstance) {
6469 if (process.env.NODE_ENV !== 'production') {
6470 var owner = ReactCurrentOwner.current;
6471 if (owner !== null) {
6472 process.env.NODE_ENV !== 'production' ? warning(owner._warnedAboutRefsInRender, '%s is accessing isMounted inside its render() function. ' + 'render() should be a pure function of props and state. It should ' + 'never access something that requires stale data from the previous ' + 'render, such as refs. Move this logic to componentDidMount and ' + 'componentDidUpdate instead.', owner.getName() || 'A component') : void 0;
6473 owner._warnedAboutRefsInRender = true;
6474 }
6475 }
6476 var internalInstance = ReactInstanceMap.get(publicInstance);
6477 if (internalInstance) {
6478 // During componentWillMount and render this will still be null but after
6479 // that will always render to something. At least for now. So we can use
6480 // this hack.
6481 return !!internalInstance._renderedComponent;
6482 } else {
6483 return false;
6484 }
6485 },
6486
6487 /**
6488 * Enqueue a callback that will be executed after all the pending updates
6489 * have processed.
6490 *
6491 * @param {ReactClass} publicInstance The instance to use as `this` context.
6492 * @param {?function} callback Called after state is updated.
6493 * @param {string} callerName Name of the calling function in the public API.
6494 * @internal
6495 */
6496 enqueueCallback: function (publicInstance, callback, callerName) {
6497 ReactUpdateQueue.validateCallback(callback, callerName);
6498 var internalInstance = getInternalInstanceReadyForUpdate(publicInstance);
6499
6500 // Previously we would throw an error if we didn't have an internal
6501 // instance. Since we want to make it a no-op instead, we mirror the same
6502 // behavior we have in other enqueue* methods.
6503 // We also need to ignore callbacks in componentWillMount. See
6504 // enqueueUpdates.
6505 if (!internalInstance) {
6506 return null;
6507 }
6508
6509 if (internalInstance._pendingCallbacks) {
6510 internalInstance._pendingCallbacks.push(callback);
6511 } else {
6512 internalInstance._pendingCallbacks = [callback];
6513 }
6514 // TODO: The callback here is ignored when setState is called from
6515 // componentWillMount. Either fix it or disallow doing so completely in
6516 // favor of getInitialState. Alternatively, we can disallow
6517 // componentWillMount during server-side rendering.
6518 enqueueUpdate(internalInstance);
6519 },
6520
6521 enqueueCallbackInternal: function (internalInstance, callback) {
6522 if (internalInstance._pendingCallbacks) {
6523 internalInstance._pendingCallbacks.push(callback);
6524 } else {
6525 internalInstance._pendingCallbacks = [callback];
6526 }
6527 enqueueUpdate(internalInstance);
6528 },
6529
6530 /**
6531 * Forces an update. This should only be invoked when it is known with
6532 * certainty that we are **not** in a DOM transaction.
6533 *
6534 * You may want to call this when you know that some deeper aspect of the
6535 * component's state has changed but `setState` was not called.
6536 *
6537 * This will not invoke `shouldComponentUpdate`, but it will invoke
6538 * `componentWillUpdate` and `componentDidUpdate`.
6539 *
6540 * @param {ReactClass} publicInstance The instance that should rerender.
6541 * @internal
6542 */
6543 enqueueForceUpdate: function (publicInstance) {
6544 var internalInstance = getInternalInstanceReadyForUpdate(publicInstance, 'forceUpdate');
6545
6546 if (!internalInstance) {
6547 return;
6548 }
6549
6550 internalInstance._pendingForceUpdate = true;
6551
6552 enqueueUpdate(internalInstance);
6553 },
6554
6555 /**
6556 * Replaces all of the state. Always use this or `setState` to mutate state.
6557 * You should treat `this.state` as immutable.
6558 *
6559 * There is no guarantee that `this.state` will be immediately updated, so
6560 * accessing `this.state` after calling this method may return the old value.
6561 *
6562 * @param {ReactClass} publicInstance The instance that should rerender.
6563 * @param {object} completeState Next state.
6564 * @internal
6565 */
6566 enqueueReplaceState: function (publicInstance, completeState, callback) {
6567 var internalInstance = getInternalInstanceReadyForUpdate(publicInstance, 'replaceState');
6568
6569 if (!internalInstance) {
6570 return;
6571 }
6572
6573 internalInstance._pendingStateQueue = [completeState];
6574 internalInstance._pendingReplaceState = true;
6575
6576 // Future-proof 15.5
6577 if (callback !== undefined && callback !== null) {
6578 ReactUpdateQueue.validateCallback(callback, 'replaceState');
6579 if (internalInstance._pendingCallbacks) {
6580 internalInstance._pendingCallbacks.push(callback);
6581 } else {
6582 internalInstance._pendingCallbacks = [callback];
6583 }
6584 }
6585
6586 enqueueUpdate(internalInstance);
6587 },
6588
6589 /**
6590 * Sets a subset of the state. This only exists because _pendingState is
6591 * internal. This provides a merging strategy that is not available to deep
6592 * properties which is confusing. TODO: Expose pendingState or don't use it
6593 * during the merge.
6594 *
6595 * @param {ReactClass} publicInstance The instance that should rerender.
6596 * @param {object} partialState Next partial state to be merged with state.
6597 * @internal
6598 */
6599 enqueueSetState: function (publicInstance, partialState) {
6600 if (process.env.NODE_ENV !== 'production') {
6601 ReactInstrumentation.debugTool.onSetState();
6602 process.env.NODE_ENV !== 'production' ? warning(partialState != null, 'setState(...): You passed an undefined or null state object; ' + 'instead, use forceUpdate().') : void 0;
6603 }
6604
6605 var internalInstance = getInternalInstanceReadyForUpdate(publicInstance, 'setState');
6606
6607 if (!internalInstance) {
6608 return;
6609 }
6610
6611 var queue = internalInstance._pendingStateQueue || (internalInstance._pendingStateQueue = []);
6612 queue.push(partialState);
6613
6614 enqueueUpdate(internalInstance);
6615 },
6616
6617 enqueueElementInternal: function (internalInstance, nextElement, nextContext) {
6618 internalInstance._pendingElement = nextElement;
6619 // TODO: introduce _pendingContext instead of setting it directly.
6620 internalInstance._context = nextContext;
6621 enqueueUpdate(internalInstance);
6622 },
6623
6624 validateCallback: function (callback, callerName) {
6625 !(!callback || typeof callback === 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, '%s(...): Expected the last optional `callback` argument to be a function. Instead received: %s.', callerName, formatUnexpectedArgument(callback)) : _prodInvariant('122', callerName, formatUnexpectedArgument(callback)) : void 0;
6626 }
6627};
6628
6629module.exports = ReactUpdateQueue;
6630/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
6631
6632/***/ }),
6633/* 52 */
6634/***/ (function(module, exports, __webpack_require__) {
6635
6636"use strict";
6637/* WEBPACK VAR INJECTION */(function(process) {/**
6638 * Copyright 2015-present, Facebook, Inc.
6639 * All rights reserved.
6640 *
6641 * This source code is licensed under the BSD-style license found in the
6642 * LICENSE file in the root directory of this source tree. An additional grant
6643 * of patent rights can be found in the PATENTS file in the same directory.
6644 *
6645 */
6646
6647
6648
6649var _assign = __webpack_require__(4);
6650
6651var emptyFunction = __webpack_require__(8);
6652var warning = __webpack_require__(2);
6653
6654var validateDOMNesting = emptyFunction;
6655
6656if (process.env.NODE_ENV !== 'production') {
6657 // This validation code was written based on the HTML5 parsing spec:
6658 // https://html.spec.whatwg.org/multipage/syntax.html#has-an-element-in-scope
6659 //
6660 // Note: this does not catch all invalid nesting, nor does it try to (as it's
6661 // not clear what practical benefit doing so provides); instead, we warn only
6662 // for cases where the parser will give a parse tree differing from what React
6663 // intended. For example, <b><div></div></b> is invalid but we don't warn
6664 // because it still parses correctly; we do warn for other cases like nested
6665 // <p> tags where the beginning of the second element implicitly closes the
6666 // first, causing a confusing mess.
6667
6668 // https://html.spec.whatwg.org/multipage/syntax.html#special
6669 var specialTags = ['address', 'applet', 'area', 'article', 'aside', 'base', 'basefont', 'bgsound', 'blockquote', 'body', 'br', 'button', 'caption', 'center', 'col', 'colgroup', 'dd', 'details', 'dir', 'div', 'dl', 'dt', 'embed', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'frame', 'frameset', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'iframe', 'img', 'input', 'isindex', 'li', 'link', 'listing', 'main', 'marquee', 'menu', 'menuitem', 'meta', 'nav', 'noembed', 'noframes', 'noscript', 'object', 'ol', 'p', 'param', 'plaintext', 'pre', 'script', 'section', 'select', 'source', 'style', 'summary', 'table', 'tbody', 'td', 'template', 'textarea', 'tfoot', 'th', 'thead', 'title', 'tr', 'track', 'ul', 'wbr', 'xmp'];
6670
6671 // https://html.spec.whatwg.org/multipage/syntax.html#has-an-element-in-scope
6672 var inScopeTags = ['applet', 'caption', 'html', 'table', 'td', 'th', 'marquee', 'object', 'template',
6673
6674 // https://html.spec.whatwg.org/multipage/syntax.html#html-integration-point
6675 // TODO: Distinguish by namespace here -- for <title>, including it here
6676 // errs on the side of fewer warnings
6677 'foreignObject', 'desc', 'title'];
6678
6679 // https://html.spec.whatwg.org/multipage/syntax.html#has-an-element-in-button-scope
6680 var buttonScopeTags = inScopeTags.concat(['button']);
6681
6682 // https://html.spec.whatwg.org/multipage/syntax.html#generate-implied-end-tags
6683 var impliedEndTags = ['dd', 'dt', 'li', 'option', 'optgroup', 'p', 'rp', 'rt'];
6684
6685 var emptyAncestorInfo = {
6686 current: null,
6687
6688 formTag: null,
6689 aTagInScope: null,
6690 buttonTagInScope: null,
6691 nobrTagInScope: null,
6692 pTagInButtonScope: null,
6693
6694 listItemTagAutoclosing: null,
6695 dlItemTagAutoclosing: null
6696 };
6697
6698 var updatedAncestorInfo = function (oldInfo, tag, instance) {
6699 var ancestorInfo = _assign({}, oldInfo || emptyAncestorInfo);
6700 var info = { tag: tag, instance: instance };
6701
6702 if (inScopeTags.indexOf(tag) !== -1) {
6703 ancestorInfo.aTagInScope = null;
6704 ancestorInfo.buttonTagInScope = null;
6705 ancestorInfo.nobrTagInScope = null;
6706 }
6707 if (buttonScopeTags.indexOf(tag) !== -1) {
6708 ancestorInfo.pTagInButtonScope = null;
6709 }
6710
6711 // See rules for 'li', 'dd', 'dt' start tags in
6712 // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inbody
6713 if (specialTags.indexOf(tag) !== -1 && tag !== 'address' && tag !== 'div' && tag !== 'p') {
6714 ancestorInfo.listItemTagAutoclosing = null;
6715 ancestorInfo.dlItemTagAutoclosing = null;
6716 }
6717
6718 ancestorInfo.current = info;
6719
6720 if (tag === 'form') {
6721 ancestorInfo.formTag = info;
6722 }
6723 if (tag === 'a') {
6724 ancestorInfo.aTagInScope = info;
6725 }
6726 if (tag === 'button') {
6727 ancestorInfo.buttonTagInScope = info;
6728 }
6729 if (tag === 'nobr') {
6730 ancestorInfo.nobrTagInScope = info;
6731 }
6732 if (tag === 'p') {
6733 ancestorInfo.pTagInButtonScope = info;
6734 }
6735 if (tag === 'li') {
6736 ancestorInfo.listItemTagAutoclosing = info;
6737 }
6738 if (tag === 'dd' || tag === 'dt') {
6739 ancestorInfo.dlItemTagAutoclosing = info;
6740 }
6741
6742 return ancestorInfo;
6743 };
6744
6745 /**
6746 * Returns whether
6747 */
6748 var isTagValidWithParent = function (tag, parentTag) {
6749 // First, let's check if we're in an unusual parsing mode...
6750 switch (parentTag) {
6751 // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inselect
6752 case 'select':
6753 return tag === 'option' || tag === 'optgroup' || tag === '#text';
6754 case 'optgroup':
6755 return tag === 'option' || tag === '#text';
6756 // Strictly speaking, seeing an <option> doesn't mean we're in a <select>
6757 // but
6758 case 'option':
6759 return tag === '#text';
6760 // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intd
6761 // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-incaption
6762 // No special behavior since these rules fall back to "in body" mode for
6763 // all except special table nodes which cause bad parsing behavior anyway.
6764
6765 // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intr
6766 case 'tr':
6767 return tag === 'th' || tag === 'td' || tag === 'style' || tag === 'script' || tag === 'template';
6768 // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intbody
6769 case 'tbody':
6770 case 'thead':
6771 case 'tfoot':
6772 return tag === 'tr' || tag === 'style' || tag === 'script' || tag === 'template';
6773 // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-incolgroup
6774 case 'colgroup':
6775 return tag === 'col' || tag === 'template';
6776 // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intable
6777 case 'table':
6778 return tag === 'caption' || tag === 'colgroup' || tag === 'tbody' || tag === 'tfoot' || tag === 'thead' || tag === 'style' || tag === 'script' || tag === 'template';
6779 // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inhead
6780 case 'head':
6781 return tag === 'base' || tag === 'basefont' || tag === 'bgsound' || tag === 'link' || tag === 'meta' || tag === 'title' || tag === 'noscript' || tag === 'noframes' || tag === 'style' || tag === 'script' || tag === 'template';
6782 // https://html.spec.whatwg.org/multipage/semantics.html#the-html-element
6783 case 'html':
6784 return tag === 'head' || tag === 'body';
6785 case '#document':
6786 return tag === 'html';
6787 }
6788
6789 // Probably in the "in body" parsing mode, so we outlaw only tag combos
6790 // where the parsing rules cause implicit opens or closes to be added.
6791 // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inbody
6792 switch (tag) {
6793 case 'h1':
6794 case 'h2':
6795 case 'h3':
6796 case 'h4':
6797 case 'h5':
6798 case 'h6':
6799 return parentTag !== 'h1' && parentTag !== 'h2' && parentTag !== 'h3' && parentTag !== 'h4' && parentTag !== 'h5' && parentTag !== 'h6';
6800
6801 case 'rp':
6802 case 'rt':
6803 return impliedEndTags.indexOf(parentTag) === -1;
6804
6805 case 'body':
6806 case 'caption':
6807 case 'col':
6808 case 'colgroup':
6809 case 'frame':
6810 case 'head':
6811 case 'html':
6812 case 'tbody':
6813 case 'td':
6814 case 'tfoot':
6815 case 'th':
6816 case 'thead':
6817 case 'tr':
6818 // These tags are only valid with a few parents that have special child
6819 // parsing rules -- if we're down here, then none of those matched and
6820 // so we allow it only if we don't know what the parent is, as all other
6821 // cases are invalid.
6822 return parentTag == null;
6823 }
6824
6825 return true;
6826 };
6827
6828 /**
6829 * Returns whether
6830 */
6831 var findInvalidAncestorForTag = function (tag, ancestorInfo) {
6832 switch (tag) {
6833 case 'address':
6834 case 'article':
6835 case 'aside':
6836 case 'blockquote':
6837 case 'center':
6838 case 'details':
6839 case 'dialog':
6840 case 'dir':
6841 case 'div':
6842 case 'dl':
6843 case 'fieldset':
6844 case 'figcaption':
6845 case 'figure':
6846 case 'footer':
6847 case 'header':
6848 case 'hgroup':
6849 case 'main':
6850 case 'menu':
6851 case 'nav':
6852 case 'ol':
6853 case 'p':
6854 case 'section':
6855 case 'summary':
6856 case 'ul':
6857 case 'pre':
6858 case 'listing':
6859 case 'table':
6860 case 'hr':
6861 case 'xmp':
6862 case 'h1':
6863 case 'h2':
6864 case 'h3':
6865 case 'h4':
6866 case 'h5':
6867 case 'h6':
6868 return ancestorInfo.pTagInButtonScope;
6869
6870 case 'form':
6871 return ancestorInfo.formTag || ancestorInfo.pTagInButtonScope;
6872
6873 case 'li':
6874 return ancestorInfo.listItemTagAutoclosing;
6875
6876 case 'dd':
6877 case 'dt':
6878 return ancestorInfo.dlItemTagAutoclosing;
6879
6880 case 'button':
6881 return ancestorInfo.buttonTagInScope;
6882
6883 case 'a':
6884 // Spec says something about storing a list of markers, but it sounds
6885 // equivalent to this check.
6886 return ancestorInfo.aTagInScope;
6887
6888 case 'nobr':
6889 return ancestorInfo.nobrTagInScope;
6890 }
6891
6892 return null;
6893 };
6894
6895 /**
6896 * Given a ReactCompositeComponent instance, return a list of its recursive
6897 * owners, starting at the root and ending with the instance itself.
6898 */
6899 var findOwnerStack = function (instance) {
6900 if (!instance) {
6901 return [];
6902 }
6903
6904 var stack = [];
6905 do {
6906 stack.push(instance);
6907 } while (instance = instance._currentElement._owner);
6908 stack.reverse();
6909 return stack;
6910 };
6911
6912 var didWarn = {};
6913
6914 validateDOMNesting = function (childTag, childText, childInstance, ancestorInfo) {
6915 ancestorInfo = ancestorInfo || emptyAncestorInfo;
6916 var parentInfo = ancestorInfo.current;
6917 var parentTag = parentInfo && parentInfo.tag;
6918
6919 if (childText != null) {
6920 process.env.NODE_ENV !== 'production' ? warning(childTag == null, 'validateDOMNesting: when childText is passed, childTag should be null') : void 0;
6921 childTag = '#text';
6922 }
6923
6924 var invalidParent = isTagValidWithParent(childTag, parentTag) ? null : parentInfo;
6925 var invalidAncestor = invalidParent ? null : findInvalidAncestorForTag(childTag, ancestorInfo);
6926 var problematic = invalidParent || invalidAncestor;
6927
6928 if (problematic) {
6929 var ancestorTag = problematic.tag;
6930 var ancestorInstance = problematic.instance;
6931
6932 var childOwner = childInstance && childInstance._currentElement._owner;
6933 var ancestorOwner = ancestorInstance && ancestorInstance._currentElement._owner;
6934
6935 var childOwners = findOwnerStack(childOwner);
6936 var ancestorOwners = findOwnerStack(ancestorOwner);
6937
6938 var minStackLen = Math.min(childOwners.length, ancestorOwners.length);
6939 var i;
6940
6941 var deepestCommon = -1;
6942 for (i = 0; i < minStackLen; i++) {
6943 if (childOwners[i] === ancestorOwners[i]) {
6944 deepestCommon = i;
6945 } else {
6946 break;
6947 }
6948 }
6949
6950 var UNKNOWN = '(unknown)';
6951 var childOwnerNames = childOwners.slice(deepestCommon + 1).map(function (inst) {
6952 return inst.getName() || UNKNOWN;
6953 });
6954 var ancestorOwnerNames = ancestorOwners.slice(deepestCommon + 1).map(function (inst) {
6955 return inst.getName() || UNKNOWN;
6956 });
6957 var ownerInfo = [].concat(
6958 // If the parent and child instances have a common owner ancestor, start
6959 // with that -- otherwise we just start with the parent's owners.
6960 deepestCommon !== -1 ? childOwners[deepestCommon].getName() || UNKNOWN : [], ancestorOwnerNames, ancestorTag,
6961 // If we're warning about an invalid (non-parent) ancestry, add '...'
6962 invalidAncestor ? ['...'] : [], childOwnerNames, childTag).join(' > ');
6963
6964 var warnKey = !!invalidParent + '|' + childTag + '|' + ancestorTag + '|' + ownerInfo;
6965 if (didWarn[warnKey]) {
6966 return;
6967 }
6968 didWarn[warnKey] = true;
6969
6970 var tagDisplayName = childTag;
6971 var whitespaceInfo = '';
6972 if (childTag === '#text') {
6973 if (/\S/.test(childText)) {
6974 tagDisplayName = 'Text nodes';
6975 } else {
6976 tagDisplayName = 'Whitespace text nodes';
6977 whitespaceInfo = " Make sure you don't have any extra whitespace between tags on " + 'each line of your source code.';
6978 }
6979 } else {
6980 tagDisplayName = '<' + childTag + '>';
6981 }
6982
6983 if (invalidParent) {
6984 var info = '';
6985 if (ancestorTag === 'table' && childTag === 'tr') {
6986 info += ' Add a <tbody> to your code to match the DOM tree generated by ' + 'the browser.';
6987 }
6988 process.env.NODE_ENV !== 'production' ? warning(false, 'validateDOMNesting(...): %s cannot appear as a child of <%s>.%s ' + 'See %s.%s', tagDisplayName, ancestorTag, whitespaceInfo, ownerInfo, info) : void 0;
6989 } else {
6990 process.env.NODE_ENV !== 'production' ? warning(false, 'validateDOMNesting(...): %s cannot appear as a descendant of ' + '<%s>. See %s.', tagDisplayName, ancestorTag, ownerInfo) : void 0;
6991 }
6992 }
6993 };
6994
6995 validateDOMNesting.updatedAncestorInfo = updatedAncestorInfo;
6996
6997 // For testing
6998 validateDOMNesting.isTagValidInContext = function (tag, ancestorInfo) {
6999 ancestorInfo = ancestorInfo || emptyAncestorInfo;
7000 var parentInfo = ancestorInfo.current;
7001 var parentTag = parentInfo && parentInfo.tag;
7002 return isTagValidWithParent(tag, parentTag) && !findInvalidAncestorForTag(tag, ancestorInfo);
7003 };
7004}
7005
7006module.exports = validateDOMNesting;
7007/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
7008
7009/***/ }),
7010/* 53 */
7011/***/ (function(module, exports, __webpack_require__) {
7012
7013"use strict";
7014/**
7015 * Copyright 2013-present, Facebook, Inc.
7016 * All rights reserved.
7017 *
7018 * This source code is licensed under the BSD-style license found in the
7019 * LICENSE file in the root directory of this source tree. An additional grant
7020 * of patent rights can be found in the PATENTS file in the same directory.
7021 *
7022 */
7023
7024
7025
7026/**
7027 * `charCode` represents the actual "character code" and is safe to use with
7028 * `String.fromCharCode`. As such, only keys that correspond to printable
7029 * characters produce a valid `charCode`, the only exception to this is Enter.
7030 * The Tab-key is considered non-printable and does not have a `charCode`,
7031 * presumably because it does not produce a tab-character in browsers.
7032 *
7033 * @param {object} nativeEvent Native browser event.
7034 * @return {number} Normalized `charCode` property.
7035 */
7036
7037function getEventCharCode(nativeEvent) {
7038 var charCode;
7039 var keyCode = nativeEvent.keyCode;
7040
7041 if ('charCode' in nativeEvent) {
7042 charCode = nativeEvent.charCode;
7043
7044 // FF does not set `charCode` for the Enter-key, check against `keyCode`.
7045 if (charCode === 0 && keyCode === 13) {
7046 charCode = 13;
7047 }
7048 } else {
7049 // IE8 does not implement `charCode`, but `keyCode` has the correct value.
7050 charCode = keyCode;
7051 }
7052
7053 // Some non-printable keys are reported in `charCode`/`keyCode`, discard them.
7054 // Must not discard the (non-)printable Enter-key.
7055 if (charCode >= 32 || charCode === 13) {
7056 return charCode;
7057 }
7058
7059 return 0;
7060}
7061
7062module.exports = getEventCharCode;
7063
7064/***/ }),
7065/* 54 */
7066/***/ (function(module, exports, __webpack_require__) {
7067
7068/* WEBPACK VAR INJECTION */(function(global, module) {var __WEBPACK_AMD_DEFINE_RESULT__;/**
7069 * @license
7070 * Lodash <https://lodash.com/>
7071 * Copyright JS Foundation and other contributors <https://js.foundation/>
7072 * Released under MIT license <https://lodash.com/license>
7073 * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
7074 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
7075 */
7076;(function() {
7077
7078 /** Used as a safe reference for `undefined` in pre-ES5 environments. */
7079 var undefined;
7080
7081 /** Used as the semantic version number. */
7082 var VERSION = '4.17.4';
7083
7084 /** Used as the size to enable large array optimizations. */
7085 var LARGE_ARRAY_SIZE = 200;
7086
7087 /** Error message constants. */
7088 var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.',
7089 FUNC_ERROR_TEXT = 'Expected a function';
7090
7091 /** Used to stand-in for `undefined` hash values. */
7092 var HASH_UNDEFINED = '__lodash_hash_undefined__';
7093
7094 /** Used as the maximum memoize cache size. */
7095 var MAX_MEMOIZE_SIZE = 500;
7096
7097 /** Used as the internal argument placeholder. */
7098 var PLACEHOLDER = '__lodash_placeholder__';
7099
7100 /** Used to compose bitmasks for cloning. */
7101 var CLONE_DEEP_FLAG = 1,
7102 CLONE_FLAT_FLAG = 2,
7103 CLONE_SYMBOLS_FLAG = 4;
7104
7105 /** Used to compose bitmasks for value comparisons. */
7106 var COMPARE_PARTIAL_FLAG = 1,
7107 COMPARE_UNORDERED_FLAG = 2;
7108
7109 /** Used to compose bitmasks for function metadata. */
7110 var WRAP_BIND_FLAG = 1,
7111 WRAP_BIND_KEY_FLAG = 2,
7112 WRAP_CURRY_BOUND_FLAG = 4,
7113 WRAP_CURRY_FLAG = 8,
7114 WRAP_CURRY_RIGHT_FLAG = 16,
7115 WRAP_PARTIAL_FLAG = 32,
7116 WRAP_PARTIAL_RIGHT_FLAG = 64,
7117 WRAP_ARY_FLAG = 128,
7118 WRAP_REARG_FLAG = 256,
7119 WRAP_FLIP_FLAG = 512;
7120
7121 /** Used as default options for `_.truncate`. */
7122 var DEFAULT_TRUNC_LENGTH = 30,
7123 DEFAULT_TRUNC_OMISSION = '...';
7124
7125 /** Used to detect hot functions by number of calls within a span of milliseconds. */
7126 var HOT_COUNT = 800,
7127 HOT_SPAN = 16;
7128
7129 /** Used to indicate the type of lazy iteratees. */
7130 var LAZY_FILTER_FLAG = 1,
7131 LAZY_MAP_FLAG = 2,
7132 LAZY_WHILE_FLAG = 3;
7133
7134 /** Used as references for various `Number` constants. */
7135 var INFINITY = 1 / 0,
7136 MAX_SAFE_INTEGER = 9007199254740991,
7137 MAX_INTEGER = 1.7976931348623157e+308,
7138 NAN = 0 / 0;
7139
7140 /** Used as references for the maximum length and index of an array. */
7141 var MAX_ARRAY_LENGTH = 4294967295,
7142 MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1,
7143 HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
7144
7145 /** Used to associate wrap methods with their bit flags. */
7146 var wrapFlags = [
7147 ['ary', WRAP_ARY_FLAG],
7148 ['bind', WRAP_BIND_FLAG],
7149 ['bindKey', WRAP_BIND_KEY_FLAG],
7150 ['curry', WRAP_CURRY_FLAG],
7151 ['curryRight', WRAP_CURRY_RIGHT_FLAG],
7152 ['flip', WRAP_FLIP_FLAG],
7153 ['partial', WRAP_PARTIAL_FLAG],
7154 ['partialRight', WRAP_PARTIAL_RIGHT_FLAG],
7155 ['rearg', WRAP_REARG_FLAG]
7156 ];
7157
7158 /** `Object#toString` result references. */
7159 var argsTag = '[object Arguments]',
7160 arrayTag = '[object Array]',
7161 asyncTag = '[object AsyncFunction]',
7162 boolTag = '[object Boolean]',
7163 dateTag = '[object Date]',
7164 domExcTag = '[object DOMException]',
7165 errorTag = '[object Error]',
7166 funcTag = '[object Function]',
7167 genTag = '[object GeneratorFunction]',
7168 mapTag = '[object Map]',
7169 numberTag = '[object Number]',
7170 nullTag = '[object Null]',
7171 objectTag = '[object Object]',
7172 promiseTag = '[object Promise]',
7173 proxyTag = '[object Proxy]',
7174 regexpTag = '[object RegExp]',
7175 setTag = '[object Set]',
7176 stringTag = '[object String]',
7177 symbolTag = '[object Symbol]',
7178 undefinedTag = '[object Undefined]',
7179 weakMapTag = '[object WeakMap]',
7180 weakSetTag = '[object WeakSet]';
7181
7182 var arrayBufferTag = '[object ArrayBuffer]',
7183 dataViewTag = '[object DataView]',
7184 float32Tag = '[object Float32Array]',
7185 float64Tag = '[object Float64Array]',
7186 int8Tag = '[object Int8Array]',
7187 int16Tag = '[object Int16Array]',
7188 int32Tag = '[object Int32Array]',
7189 uint8Tag = '[object Uint8Array]',
7190 uint8ClampedTag = '[object Uint8ClampedArray]',
7191 uint16Tag = '[object Uint16Array]',
7192 uint32Tag = '[object Uint32Array]';
7193
7194 /** Used to match empty string literals in compiled template source. */
7195 var reEmptyStringLeading = /\b__p \+= '';/g,
7196 reEmptyStringMiddle = /\b(__p \+=) '' \+/g,
7197 reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
7198
7199 /** Used to match HTML entities and HTML characters. */
7200 var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g,
7201 reUnescapedHtml = /[&<>"']/g,
7202 reHasEscapedHtml = RegExp(reEscapedHtml.source),
7203 reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
7204
7205 /** Used to match template delimiters. */
7206 var reEscape = /<%-([\s\S]+?)%>/g,
7207 reEvaluate = /<%([\s\S]+?)%>/g,
7208 reInterpolate = /<%=([\s\S]+?)%>/g;
7209
7210 /** Used to match property names within property paths. */
7211 var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
7212 reIsPlainProp = /^\w*$/,
7213 reLeadingDot = /^\./,
7214 rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
7215
7216 /**
7217 * Used to match `RegExp`
7218 * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
7219 */
7220 var reRegExpChar = /[\\^$.*+?()[\]{}|]/g,
7221 reHasRegExpChar = RegExp(reRegExpChar.source);
7222
7223 /** Used to match leading and trailing whitespace. */
7224 var reTrim = /^\s+|\s+$/g,
7225 reTrimStart = /^\s+/,
7226 reTrimEnd = /\s+$/;
7227
7228 /** Used to match wrap detail comments. */
7229 var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,
7230 reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/,
7231 reSplitDetails = /,? & /;
7232
7233 /** Used to match words composed of alphanumeric characters. */
7234 var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
7235
7236 /** Used to match backslashes in property paths. */
7237 var reEscapeChar = /\\(\\)?/g;
7238
7239 /**
7240 * Used to match
7241 * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components).
7242 */
7243 var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
7244
7245 /** Used to match `RegExp` flags from their coerced string values. */
7246 var reFlags = /\w*$/;
7247
7248 /** Used to detect bad signed hexadecimal string values. */
7249 var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
7250
7251 /** Used to detect binary string values. */
7252 var reIsBinary = /^0b[01]+$/i;
7253
7254 /** Used to detect host constructors (Safari). */
7255 var reIsHostCtor = /^\[object .+?Constructor\]$/;
7256
7257 /** Used to detect octal string values. */
7258 var reIsOctal = /^0o[0-7]+$/i;
7259
7260 /** Used to detect unsigned integer values. */
7261 var reIsUint = /^(?:0|[1-9]\d*)$/;
7262
7263 /** Used to match Latin Unicode letters (excluding mathematical operators). */
7264 var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
7265
7266 /** Used to ensure capturing order of template delimiters. */
7267 var reNoMatch = /($^)/;
7268
7269 /** Used to match unescaped characters in compiled string literals. */
7270 var reUnescapedString = /['\n\r\u2028\u2029\\]/g;
7271
7272 /** Used to compose unicode character classes. */
7273 var rsAstralRange = '\\ud800-\\udfff',
7274 rsComboMarksRange = '\\u0300-\\u036f',
7275 reComboHalfMarksRange = '\\ufe20-\\ufe2f',
7276 rsComboSymbolsRange = '\\u20d0-\\u20ff',
7277 rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
7278 rsDingbatRange = '\\u2700-\\u27bf',
7279 rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff',
7280 rsMathOpRange = '\\xac\\xb1\\xd7\\xf7',
7281 rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf',
7282 rsPunctuationRange = '\\u2000-\\u206f',
7283 rsSpaceRange = ' \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000',
7284 rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde',
7285 rsVarRange = '\\ufe0e\\ufe0f',
7286 rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
7287
7288 /** Used to compose unicode capture groups. */
7289 var rsApos = "['\u2019]",
7290 rsAstral = '[' + rsAstralRange + ']',
7291 rsBreak = '[' + rsBreakRange + ']',
7292 rsCombo = '[' + rsComboRange + ']',
7293 rsDigits = '\\d+',
7294 rsDingbat = '[' + rsDingbatRange + ']',
7295 rsLower = '[' + rsLowerRange + ']',
7296 rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',
7297 rsFitz = '\\ud83c[\\udffb-\\udfff]',
7298 rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
7299 rsNonAstral = '[^' + rsAstralRange + ']',
7300 rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
7301 rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
7302 rsUpper = '[' + rsUpperRange + ']',
7303 rsZWJ = '\\u200d';
7304
7305 /** Used to compose unicode regexes. */
7306 var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')',
7307 rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')',
7308 rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?',
7309 rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?',
7310 reOptMod = rsModifier + '?',
7311 rsOptVar = '[' + rsVarRange + ']?',
7312 rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
7313 rsOrdLower = '\\d*(?:(?:1st|2nd|3rd|(?![123])\\dth)\\b)',
7314 rsOrdUpper = '\\d*(?:(?:1ST|2ND|3RD|(?![123])\\dTH)\\b)',
7315 rsSeq = rsOptVar + reOptMod + rsOptJoin,
7316 rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq,
7317 rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';
7318
7319 /** Used to match apostrophes. */
7320 var reApos = RegExp(rsApos, 'g');
7321
7322 /**
7323 * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and
7324 * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).
7325 */
7326 var reComboMark = RegExp(rsCombo, 'g');
7327
7328 /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */
7329 var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');
7330
7331 /** Used to match complex or compound words. */
7332 var reUnicodeWord = RegExp([
7333 rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',
7334 rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')',
7335 rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower,
7336 rsUpper + '+' + rsOptContrUpper,
7337 rsOrdUpper,
7338 rsOrdLower,
7339 rsDigits,
7340 rsEmoji
7341 ].join('|'), 'g');
7342
7343 /** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */
7344 var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');
7345
7346 /** Used to detect strings that need a more robust regexp to match words. */
7347 var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;
7348
7349 /** Used to assign default `context` object properties. */
7350 var contextProps = [
7351 'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array',
7352 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object',
7353 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array',
7354 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap',
7355 '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout'
7356 ];
7357
7358 /** Used to make template sourceURLs easier to identify. */
7359 var templateCounter = -1;
7360
7361 /** Used to identify `toStringTag` values of typed arrays. */
7362 var typedArrayTags = {};
7363 typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
7364 typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
7365 typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
7366 typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
7367 typedArrayTags[uint32Tag] = true;
7368 typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
7369 typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
7370 typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
7371 typedArrayTags[errorTag] = typedArrayTags[funcTag] =
7372 typedArrayTags[mapTag] = typedArrayTags[numberTag] =
7373 typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
7374 typedArrayTags[setTag] = typedArrayTags[stringTag] =
7375 typedArrayTags[weakMapTag] = false;
7376
7377 /** Used to identify `toStringTag` values supported by `_.clone`. */
7378 var cloneableTags = {};
7379 cloneableTags[argsTag] = cloneableTags[arrayTag] =
7380 cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =
7381 cloneableTags[boolTag] = cloneableTags[dateTag] =
7382 cloneableTags[float32Tag] = cloneableTags[float64Tag] =
7383 cloneableTags[int8Tag] = cloneableTags[int16Tag] =
7384 cloneableTags[int32Tag] = cloneableTags[mapTag] =
7385 cloneableTags[numberTag] = cloneableTags[objectTag] =
7386 cloneableTags[regexpTag] = cloneableTags[setTag] =
7387 cloneableTags[stringTag] = cloneableTags[symbolTag] =
7388 cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
7389 cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
7390 cloneableTags[errorTag] = cloneableTags[funcTag] =
7391 cloneableTags[weakMapTag] = false;
7392
7393 /** Used to map Latin Unicode letters to basic Latin letters. */
7394 var deburredLetters = {
7395 // Latin-1 Supplement block.
7396 '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A',
7397 '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a',
7398 '\xc7': 'C', '\xe7': 'c',
7399 '\xd0': 'D', '\xf0': 'd',
7400 '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E',
7401 '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e',
7402 '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I',
7403 '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i',
7404 '\xd1': 'N', '\xf1': 'n',
7405 '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O',
7406 '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o',
7407 '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U',
7408 '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u',
7409 '\xdd': 'Y', '\xfd': 'y', '\xff': 'y',
7410 '\xc6': 'Ae', '\xe6': 'ae',
7411 '\xde': 'Th', '\xfe': 'th',
7412 '\xdf': 'ss',
7413 // Latin Extended-A block.
7414 '\u0100': 'A', '\u0102': 'A', '\u0104': 'A',
7415 '\u0101': 'a', '\u0103': 'a', '\u0105': 'a',
7416 '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C',
7417 '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c',
7418 '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd',
7419 '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E',
7420 '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e',
7421 '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G',
7422 '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g',
7423 '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h',
7424 '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I',
7425 '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i',
7426 '\u0134': 'J', '\u0135': 'j',
7427 '\u0136': 'K', '\u0137': 'k', '\u0138': 'k',
7428 '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L',
7429 '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l',
7430 '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N',
7431 '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n',
7432 '\u014c': 'O', '\u014e': 'O', '\u0150': 'O',
7433 '\u014d': 'o', '\u014f': 'o', '\u0151': 'o',
7434 '\u0154': 'R', '\u0156': 'R', '\u0158': 'R',
7435 '\u0155': 'r', '\u0157': 'r', '\u0159': 'r',
7436 '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S',
7437 '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's',
7438 '\u0162': 'T', '\u0164': 'T', '\u0166': 'T',
7439 '\u0163': 't', '\u0165': 't', '\u0167': 't',
7440 '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U',
7441 '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u',
7442 '\u0174': 'W', '\u0175': 'w',
7443 '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y',
7444 '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z',
7445 '\u017a': 'z', '\u017c': 'z', '\u017e': 'z',
7446 '\u0132': 'IJ', '\u0133': 'ij',
7447 '\u0152': 'Oe', '\u0153': 'oe',
7448 '\u0149': "'n", '\u017f': 's'
7449 };
7450
7451 /** Used to map characters to HTML entities. */
7452 var htmlEscapes = {
7453 '&': '&amp;',
7454 '<': '&lt;',
7455 '>': '&gt;',
7456 '"': '&quot;',
7457 "'": '&#39;'
7458 };
7459
7460 /** Used to map HTML entities to characters. */
7461 var htmlUnescapes = {
7462 '&amp;': '&',
7463 '&lt;': '<',
7464 '&gt;': '>',
7465 '&quot;': '"',
7466 '&#39;': "'"
7467 };
7468
7469 /** Used to escape characters for inclusion in compiled string literals. */
7470 var stringEscapes = {
7471 '\\': '\\',
7472 "'": "'",
7473 '\n': 'n',
7474 '\r': 'r',
7475 '\u2028': 'u2028',
7476 '\u2029': 'u2029'
7477 };
7478
7479 /** Built-in method references without a dependency on `root`. */
7480 var freeParseFloat = parseFloat,
7481 freeParseInt = parseInt;
7482
7483 /** Detect free variable `global` from Node.js. */
7484 var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
7485
7486 /** Detect free variable `self`. */
7487 var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
7488
7489 /** Used as a reference to the global object. */
7490 var root = freeGlobal || freeSelf || Function('return this')();
7491
7492 /** Detect free variable `exports`. */
7493 var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;
7494
7495 /** Detect free variable `module`. */
7496 var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
7497
7498 /** Detect the popular CommonJS extension `module.exports`. */
7499 var moduleExports = freeModule && freeModule.exports === freeExports;
7500
7501 /** Detect free variable `process` from Node.js. */
7502 var freeProcess = moduleExports && freeGlobal.process;
7503
7504 /** Used to access faster Node.js helpers. */
7505 var nodeUtil = (function() {
7506 try {
7507 return freeProcess && freeProcess.binding && freeProcess.binding('util');
7508 } catch (e) {}
7509 }());
7510
7511 /* Node.js helper references. */
7512 var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer,
7513 nodeIsDate = nodeUtil && nodeUtil.isDate,
7514 nodeIsMap = nodeUtil && nodeUtil.isMap,
7515 nodeIsRegExp = nodeUtil && nodeUtil.isRegExp,
7516 nodeIsSet = nodeUtil && nodeUtil.isSet,
7517 nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
7518
7519 /*--------------------------------------------------------------------------*/
7520
7521 /**
7522 * Adds the key-value `pair` to `map`.
7523 *
7524 * @private
7525 * @param {Object} map The map to modify.
7526 * @param {Array} pair The key-value pair to add.
7527 * @returns {Object} Returns `map`.
7528 */
7529 function addMapEntry(map, pair) {
7530 // Don't return `map.set` because it's not chainable in IE 11.
7531 map.set(pair[0], pair[1]);
7532 return map;
7533 }
7534
7535 /**
7536 * Adds `value` to `set`.
7537 *
7538 * @private
7539 * @param {Object} set The set to modify.
7540 * @param {*} value The value to add.
7541 * @returns {Object} Returns `set`.
7542 */
7543 function addSetEntry(set, value) {
7544 // Don't return `set.add` because it's not chainable in IE 11.
7545 set.add(value);
7546 return set;
7547 }
7548
7549 /**
7550 * A faster alternative to `Function#apply`, this function invokes `func`
7551 * with the `this` binding of `thisArg` and the arguments of `args`.
7552 *
7553 * @private
7554 * @param {Function} func The function to invoke.
7555 * @param {*} thisArg The `this` binding of `func`.
7556 * @param {Array} args The arguments to invoke `func` with.
7557 * @returns {*} Returns the result of `func`.
7558 */
7559 function apply(func, thisArg, args) {
7560 switch (args.length) {
7561 case 0: return func.call(thisArg);
7562 case 1: return func.call(thisArg, args[0]);
7563 case 2: return func.call(thisArg, args[0], args[1]);
7564 case 3: return func.call(thisArg, args[0], args[1], args[2]);
7565 }
7566 return func.apply(thisArg, args);
7567 }
7568
7569 /**
7570 * A specialized version of `baseAggregator` for arrays.
7571 *
7572 * @private
7573 * @param {Array} [array] The array to iterate over.
7574 * @param {Function} setter The function to set `accumulator` values.
7575 * @param {Function} iteratee The iteratee to transform keys.
7576 * @param {Object} accumulator The initial aggregated object.
7577 * @returns {Function} Returns `accumulator`.
7578 */
7579 function arrayAggregator(array, setter, iteratee, accumulator) {
7580 var index = -1,
7581 length = array == null ? 0 : array.length;
7582
7583 while (++index < length) {
7584 var value = array[index];
7585 setter(accumulator, value, iteratee(value), array);
7586 }
7587 return accumulator;
7588 }
7589
7590 /**
7591 * A specialized version of `_.forEach` for arrays without support for
7592 * iteratee shorthands.
7593 *
7594 * @private
7595 * @param {Array} [array] The array to iterate over.
7596 * @param {Function} iteratee The function invoked per iteration.
7597 * @returns {Array} Returns `array`.
7598 */
7599 function arrayEach(array, iteratee) {
7600 var index = -1,
7601 length = array == null ? 0 : array.length;
7602
7603 while (++index < length) {
7604 if (iteratee(array[index], index, array) === false) {
7605 break;
7606 }
7607 }
7608 return array;
7609 }
7610
7611 /**
7612 * A specialized version of `_.forEachRight` for arrays without support for
7613 * iteratee shorthands.
7614 *
7615 * @private
7616 * @param {Array} [array] The array to iterate over.
7617 * @param {Function} iteratee The function invoked per iteration.
7618 * @returns {Array} Returns `array`.
7619 */
7620 function arrayEachRight(array, iteratee) {
7621 var length = array == null ? 0 : array.length;
7622
7623 while (length--) {
7624 if (iteratee(array[length], length, array) === false) {
7625 break;
7626 }
7627 }
7628 return array;
7629 }
7630
7631 /**
7632 * A specialized version of `_.every` for arrays without support for
7633 * iteratee shorthands.
7634 *
7635 * @private
7636 * @param {Array} [array] The array to iterate over.
7637 * @param {Function} predicate The function invoked per iteration.
7638 * @returns {boolean} Returns `true` if all elements pass the predicate check,
7639 * else `false`.
7640 */
7641 function arrayEvery(array, predicate) {
7642 var index = -1,
7643 length = array == null ? 0 : array.length;
7644
7645 while (++index < length) {
7646 if (!predicate(array[index], index, array)) {
7647 return false;
7648 }
7649 }
7650 return true;
7651 }
7652
7653 /**
7654 * A specialized version of `_.filter` for arrays without support for
7655 * iteratee shorthands.
7656 *
7657 * @private
7658 * @param {Array} [array] The array to iterate over.
7659 * @param {Function} predicate The function invoked per iteration.
7660 * @returns {Array} Returns the new filtered array.
7661 */
7662 function arrayFilter(array, predicate) {
7663 var index = -1,
7664 length = array == null ? 0 : array.length,
7665 resIndex = 0,
7666 result = [];
7667
7668 while (++index < length) {
7669 var value = array[index];
7670 if (predicate(value, index, array)) {
7671 result[resIndex++] = value;
7672 }
7673 }
7674 return result;
7675 }
7676
7677 /**
7678 * A specialized version of `_.includes` for arrays without support for
7679 * specifying an index to search from.
7680 *
7681 * @private
7682 * @param {Array} [array] The array to inspect.
7683 * @param {*} target The value to search for.
7684 * @returns {boolean} Returns `true` if `target` is found, else `false`.
7685 */
7686 function arrayIncludes(array, value) {
7687 var length = array == null ? 0 : array.length;
7688 return !!length && baseIndexOf(array, value, 0) > -1;
7689 }
7690
7691 /**
7692 * This function is like `arrayIncludes` except that it accepts a comparator.
7693 *
7694 * @private
7695 * @param {Array} [array] The array to inspect.
7696 * @param {*} target The value to search for.
7697 * @param {Function} comparator The comparator invoked per element.
7698 * @returns {boolean} Returns `true` if `target` is found, else `false`.
7699 */
7700 function arrayIncludesWith(array, value, comparator) {
7701 var index = -1,
7702 length = array == null ? 0 : array.length;
7703
7704 while (++index < length) {
7705 if (comparator(value, array[index])) {
7706 return true;
7707 }
7708 }
7709 return false;
7710 }
7711
7712 /**
7713 * A specialized version of `_.map` for arrays without support for iteratee
7714 * shorthands.
7715 *
7716 * @private
7717 * @param {Array} [array] The array to iterate over.
7718 * @param {Function} iteratee The function invoked per iteration.
7719 * @returns {Array} Returns the new mapped array.
7720 */
7721 function arrayMap(array, iteratee) {
7722 var index = -1,
7723 length = array == null ? 0 : array.length,
7724 result = Array(length);
7725
7726 while (++index < length) {
7727 result[index] = iteratee(array[index], index, array);
7728 }
7729 return result;
7730 }
7731
7732 /**
7733 * Appends the elements of `values` to `array`.
7734 *
7735 * @private
7736 * @param {Array} array The array to modify.
7737 * @param {Array} values The values to append.
7738 * @returns {Array} Returns `array`.
7739 */
7740 function arrayPush(array, values) {
7741 var index = -1,
7742 length = values.length,
7743 offset = array.length;
7744
7745 while (++index < length) {
7746 array[offset + index] = values[index];
7747 }
7748 return array;
7749 }
7750
7751 /**
7752 * A specialized version of `_.reduce` for arrays without support for
7753 * iteratee shorthands.
7754 *
7755 * @private
7756 * @param {Array} [array] The array to iterate over.
7757 * @param {Function} iteratee The function invoked per iteration.
7758 * @param {*} [accumulator] The initial value.
7759 * @param {boolean} [initAccum] Specify using the first element of `array` as
7760 * the initial value.
7761 * @returns {*} Returns the accumulated value.
7762 */
7763 function arrayReduce(array, iteratee, accumulator, initAccum) {
7764 var index = -1,
7765 length = array == null ? 0 : array.length;
7766
7767 if (initAccum && length) {
7768 accumulator = array[++index];
7769 }
7770 while (++index < length) {
7771 accumulator = iteratee(accumulator, array[index], index, array);
7772 }
7773 return accumulator;
7774 }
7775
7776 /**
7777 * A specialized version of `_.reduceRight` for arrays without support for
7778 * iteratee shorthands.
7779 *
7780 * @private
7781 * @param {Array} [array] The array to iterate over.
7782 * @param {Function} iteratee The function invoked per iteration.
7783 * @param {*} [accumulator] The initial value.
7784 * @param {boolean} [initAccum] Specify using the last element of `array` as
7785 * the initial value.
7786 * @returns {*} Returns the accumulated value.
7787 */
7788 function arrayReduceRight(array, iteratee, accumulator, initAccum) {
7789 var length = array == null ? 0 : array.length;
7790 if (initAccum && length) {
7791 accumulator = array[--length];
7792 }
7793 while (length--) {
7794 accumulator = iteratee(accumulator, array[length], length, array);
7795 }
7796 return accumulator;
7797 }
7798
7799 /**
7800 * A specialized version of `_.some` for arrays without support for iteratee
7801 * shorthands.
7802 *
7803 * @private
7804 * @param {Array} [array] The array to iterate over.
7805 * @param {Function} predicate The function invoked per iteration.
7806 * @returns {boolean} Returns `true` if any element passes the predicate check,
7807 * else `false`.
7808 */
7809 function arraySome(array, predicate) {
7810 var index = -1,
7811 length = array == null ? 0 : array.length;
7812
7813 while (++index < length) {
7814 if (predicate(array[index], index, array)) {
7815 return true;
7816 }
7817 }
7818 return false;
7819 }
7820
7821 /**
7822 * Gets the size of an ASCII `string`.
7823 *
7824 * @private
7825 * @param {string} string The string inspect.
7826 * @returns {number} Returns the string size.
7827 */
7828 var asciiSize = baseProperty('length');
7829
7830 /**
7831 * Converts an ASCII `string` to an array.
7832 *
7833 * @private
7834 * @param {string} string The string to convert.
7835 * @returns {Array} Returns the converted array.
7836 */
7837 function asciiToArray(string) {
7838 return string.split('');
7839 }
7840
7841 /**
7842 * Splits an ASCII `string` into an array of its words.
7843 *
7844 * @private
7845 * @param {string} The string to inspect.
7846 * @returns {Array} Returns the words of `string`.
7847 */
7848 function asciiWords(string) {
7849 return string.match(reAsciiWord) || [];
7850 }
7851
7852 /**
7853 * The base implementation of methods like `_.findKey` and `_.findLastKey`,
7854 * without support for iteratee shorthands, which iterates over `collection`
7855 * using `eachFunc`.
7856 *
7857 * @private
7858 * @param {Array|Object} collection The collection to inspect.
7859 * @param {Function} predicate The function invoked per iteration.
7860 * @param {Function} eachFunc The function to iterate over `collection`.
7861 * @returns {*} Returns the found element or its key, else `undefined`.
7862 */
7863 function baseFindKey(collection, predicate, eachFunc) {
7864 var result;
7865 eachFunc(collection, function(value, key, collection) {
7866 if (predicate(value, key, collection)) {
7867 result = key;
7868 return false;
7869 }
7870 });
7871 return result;
7872 }
7873
7874 /**
7875 * The base implementation of `_.findIndex` and `_.findLastIndex` without
7876 * support for iteratee shorthands.
7877 *
7878 * @private
7879 * @param {Array} array The array to inspect.
7880 * @param {Function} predicate The function invoked per iteration.
7881 * @param {number} fromIndex The index to search from.
7882 * @param {boolean} [fromRight] Specify iterating from right to left.
7883 * @returns {number} Returns the index of the matched value, else `-1`.
7884 */
7885 function baseFindIndex(array, predicate, fromIndex, fromRight) {
7886 var length = array.length,
7887 index = fromIndex + (fromRight ? 1 : -1);
7888
7889 while ((fromRight ? index-- : ++index < length)) {
7890 if (predicate(array[index], index, array)) {
7891 return index;
7892 }
7893 }
7894 return -1;
7895 }
7896
7897 /**
7898 * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
7899 *
7900 * @private
7901 * @param {Array} array The array to inspect.
7902 * @param {*} value The value to search for.
7903 * @param {number} fromIndex The index to search from.
7904 * @returns {number} Returns the index of the matched value, else `-1`.
7905 */
7906 function baseIndexOf(array, value, fromIndex) {
7907 return value === value
7908 ? strictIndexOf(array, value, fromIndex)
7909 : baseFindIndex(array, baseIsNaN, fromIndex);
7910 }
7911
7912 /**
7913 * This function is like `baseIndexOf` except that it accepts a comparator.
7914 *
7915 * @private
7916 * @param {Array} array The array to inspect.
7917 * @param {*} value The value to search for.
7918 * @param {number} fromIndex The index to search from.
7919 * @param {Function} comparator The comparator invoked per element.
7920 * @returns {number} Returns the index of the matched value, else `-1`.
7921 */
7922 function baseIndexOfWith(array, value, fromIndex, comparator) {
7923 var index = fromIndex - 1,
7924 length = array.length;
7925
7926 while (++index < length) {
7927 if (comparator(array[index], value)) {
7928 return index;
7929 }
7930 }
7931 return -1;
7932 }
7933
7934 /**
7935 * The base implementation of `_.isNaN` without support for number objects.
7936 *
7937 * @private
7938 * @param {*} value The value to check.
7939 * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
7940 */
7941 function baseIsNaN(value) {
7942 return value !== value;
7943 }
7944
7945 /**
7946 * The base implementation of `_.mean` and `_.meanBy` without support for
7947 * iteratee shorthands.
7948 *
7949 * @private
7950 * @param {Array} array The array to iterate over.
7951 * @param {Function} iteratee The function invoked per iteration.
7952 * @returns {number} Returns the mean.
7953 */
7954 function baseMean(array, iteratee) {
7955 var length = array == null ? 0 : array.length;
7956 return length ? (baseSum(array, iteratee) / length) : NAN;
7957 }
7958
7959 /**
7960 * The base implementation of `_.property` without support for deep paths.
7961 *
7962 * @private
7963 * @param {string} key The key of the property to get.
7964 * @returns {Function} Returns the new accessor function.
7965 */
7966 function baseProperty(key) {
7967 return function(object) {
7968 return object == null ? undefined : object[key];
7969 };
7970 }
7971
7972 /**
7973 * The base implementation of `_.propertyOf` without support for deep paths.
7974 *
7975 * @private
7976 * @param {Object} object The object to query.
7977 * @returns {Function} Returns the new accessor function.
7978 */
7979 function basePropertyOf(object) {
7980 return function(key) {
7981 return object == null ? undefined : object[key];
7982 };
7983 }
7984
7985 /**
7986 * The base implementation of `_.reduce` and `_.reduceRight`, without support
7987 * for iteratee shorthands, which iterates over `collection` using `eachFunc`.
7988 *
7989 * @private
7990 * @param {Array|Object} collection The collection to iterate over.
7991 * @param {Function} iteratee The function invoked per iteration.
7992 * @param {*} accumulator The initial value.
7993 * @param {boolean} initAccum Specify using the first or last element of
7994 * `collection` as the initial value.
7995 * @param {Function} eachFunc The function to iterate over `collection`.
7996 * @returns {*} Returns the accumulated value.
7997 */
7998 function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {
7999 eachFunc(collection, function(value, index, collection) {
8000 accumulator = initAccum
8001 ? (initAccum = false, value)
8002 : iteratee(accumulator, value, index, collection);
8003 });
8004 return accumulator;
8005 }
8006
8007 /**
8008 * The base implementation of `_.sortBy` which uses `comparer` to define the
8009 * sort order of `array` and replaces criteria objects with their corresponding
8010 * values.
8011 *
8012 * @private
8013 * @param {Array} array The array to sort.
8014 * @param {Function} comparer The function to define sort order.
8015 * @returns {Array} Returns `array`.
8016 */
8017 function baseSortBy(array, comparer) {
8018 var length = array.length;
8019
8020 array.sort(comparer);
8021 while (length--) {
8022 array[length] = array[length].value;
8023 }
8024 return array;
8025 }
8026
8027 /**
8028 * The base implementation of `_.sum` and `_.sumBy` without support for
8029 * iteratee shorthands.
8030 *
8031 * @private
8032 * @param {Array} array The array to iterate over.
8033 * @param {Function} iteratee The function invoked per iteration.
8034 * @returns {number} Returns the sum.
8035 */
8036 function baseSum(array, iteratee) {
8037 var result,
8038 index = -1,
8039 length = array.length;
8040
8041 while (++index < length) {
8042 var current = iteratee(array[index]);
8043 if (current !== undefined) {
8044 result = result === undefined ? current : (result + current);
8045 }
8046 }
8047 return result;
8048 }
8049
8050 /**
8051 * The base implementation of `_.times` without support for iteratee shorthands
8052 * or max array length checks.
8053 *
8054 * @private
8055 * @param {number} n The number of times to invoke `iteratee`.
8056 * @param {Function} iteratee The function invoked per iteration.
8057 * @returns {Array} Returns the array of results.
8058 */
8059 function baseTimes(n, iteratee) {
8060 var index = -1,
8061 result = Array(n);
8062
8063 while (++index < n) {
8064 result[index] = iteratee(index);
8065 }
8066 return result;
8067 }
8068
8069 /**
8070 * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array
8071 * of key-value pairs for `object` corresponding to the property names of `props`.
8072 *
8073 * @private
8074 * @param {Object} object The object to query.
8075 * @param {Array} props The property names to get values for.
8076 * @returns {Object} Returns the key-value pairs.
8077 */
8078 function baseToPairs(object, props) {
8079 return arrayMap(props, function(key) {
8080 return [key, object[key]];
8081 });
8082 }
8083
8084 /**
8085 * The base implementation of `_.unary` without support for storing metadata.
8086 *
8087 * @private
8088 * @param {Function} func The function to cap arguments for.
8089 * @returns {Function} Returns the new capped function.
8090 */
8091 function baseUnary(func) {
8092 return function(value) {
8093 return func(value);
8094 };
8095 }
8096
8097 /**
8098 * The base implementation of `_.values` and `_.valuesIn` which creates an
8099 * array of `object` property values corresponding to the property names
8100 * of `props`.
8101 *
8102 * @private
8103 * @param {Object} object The object to query.
8104 * @param {Array} props The property names to get values for.
8105 * @returns {Object} Returns the array of property values.
8106 */
8107 function baseValues(object, props) {
8108 return arrayMap(props, function(key) {
8109 return object[key];
8110 });
8111 }
8112
8113 /**
8114 * Checks if a `cache` value for `key` exists.
8115 *
8116 * @private
8117 * @param {Object} cache The cache to query.
8118 * @param {string} key The key of the entry to check.
8119 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
8120 */
8121 function cacheHas(cache, key) {
8122 return cache.has(key);
8123 }
8124
8125 /**
8126 * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol
8127 * that is not found in the character symbols.
8128 *
8129 * @private
8130 * @param {Array} strSymbols The string symbols to inspect.
8131 * @param {Array} chrSymbols The character symbols to find.
8132 * @returns {number} Returns the index of the first unmatched string symbol.
8133 */
8134 function charsStartIndex(strSymbols, chrSymbols) {
8135 var index = -1,
8136 length = strSymbols.length;
8137
8138 while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
8139 return index;
8140 }
8141
8142 /**
8143 * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol
8144 * that is not found in the character symbols.
8145 *
8146 * @private
8147 * @param {Array} strSymbols The string symbols to inspect.
8148 * @param {Array} chrSymbols The character symbols to find.
8149 * @returns {number} Returns the index of the last unmatched string symbol.
8150 */
8151 function charsEndIndex(strSymbols, chrSymbols) {
8152 var index = strSymbols.length;
8153
8154 while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
8155 return index;
8156 }
8157
8158 /**
8159 * Gets the number of `placeholder` occurrences in `array`.
8160 *
8161 * @private
8162 * @param {Array} array The array to inspect.
8163 * @param {*} placeholder The placeholder to search for.
8164 * @returns {number} Returns the placeholder count.
8165 */
8166 function countHolders(array, placeholder) {
8167 var length = array.length,
8168 result = 0;
8169
8170 while (length--) {
8171 if (array[length] === placeholder) {
8172 ++result;
8173 }
8174 }
8175 return result;
8176 }
8177
8178 /**
8179 * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A
8180 * letters to basic Latin letters.
8181 *
8182 * @private
8183 * @param {string} letter The matched letter to deburr.
8184 * @returns {string} Returns the deburred letter.
8185 */
8186 var deburrLetter = basePropertyOf(deburredLetters);
8187
8188 /**
8189 * Used by `_.escape` to convert characters to HTML entities.
8190 *
8191 * @private
8192 * @param {string} chr The matched character to escape.
8193 * @returns {string} Returns the escaped character.
8194 */
8195 var escapeHtmlChar = basePropertyOf(htmlEscapes);
8196
8197 /**
8198 * Used by `_.template` to escape characters for inclusion in compiled string literals.
8199 *
8200 * @private
8201 * @param {string} chr The matched character to escape.
8202 * @returns {string} Returns the escaped character.
8203 */
8204 function escapeStringChar(chr) {
8205 return '\\' + stringEscapes[chr];
8206 }
8207
8208 /**
8209 * Gets the value at `key` of `object`.
8210 *
8211 * @private
8212 * @param {Object} [object] The object to query.
8213 * @param {string} key The key of the property to get.
8214 * @returns {*} Returns the property value.
8215 */
8216 function getValue(object, key) {
8217 return object == null ? undefined : object[key];
8218 }
8219
8220 /**
8221 * Checks if `string` contains Unicode symbols.
8222 *
8223 * @private
8224 * @param {string} string The string to inspect.
8225 * @returns {boolean} Returns `true` if a symbol is found, else `false`.
8226 */
8227 function hasUnicode(string) {
8228 return reHasUnicode.test(string);
8229 }
8230
8231 /**
8232 * Checks if `string` contains a word composed of Unicode symbols.
8233 *
8234 * @private
8235 * @param {string} string The string to inspect.
8236 * @returns {boolean} Returns `true` if a word is found, else `false`.
8237 */
8238 function hasUnicodeWord(string) {
8239 return reHasUnicodeWord.test(string);
8240 }
8241
8242 /**
8243 * Converts `iterator` to an array.
8244 *
8245 * @private
8246 * @param {Object} iterator The iterator to convert.
8247 * @returns {Array} Returns the converted array.
8248 */
8249 function iteratorToArray(iterator) {
8250 var data,
8251 result = [];
8252
8253 while (!(data = iterator.next()).done) {
8254 result.push(data.value);
8255 }
8256 return result;
8257 }
8258
8259 /**
8260 * Converts `map` to its key-value pairs.
8261 *
8262 * @private
8263 * @param {Object} map The map to convert.
8264 * @returns {Array} Returns the key-value pairs.
8265 */
8266 function mapToArray(map) {
8267 var index = -1,
8268 result = Array(map.size);
8269
8270 map.forEach(function(value, key) {
8271 result[++index] = [key, value];
8272 });
8273 return result;
8274 }
8275
8276 /**
8277 * Creates a unary function that invokes `func` with its argument transformed.
8278 *
8279 * @private
8280 * @param {Function} func The function to wrap.
8281 * @param {Function} transform The argument transform.
8282 * @returns {Function} Returns the new function.
8283 */
8284 function overArg(func, transform) {
8285 return function(arg) {
8286 return func(transform(arg));
8287 };
8288 }
8289
8290 /**
8291 * Replaces all `placeholder` elements in `array` with an internal placeholder
8292 * and returns an array of their indexes.
8293 *
8294 * @private
8295 * @param {Array} array The array to modify.
8296 * @param {*} placeholder The placeholder to replace.
8297 * @returns {Array} Returns the new array of placeholder indexes.
8298 */
8299 function replaceHolders(array, placeholder) {
8300 var index = -1,
8301 length = array.length,
8302 resIndex = 0,
8303 result = [];
8304
8305 while (++index < length) {
8306 var value = array[index];
8307 if (value === placeholder || value === PLACEHOLDER) {
8308 array[index] = PLACEHOLDER;
8309 result[resIndex++] = index;
8310 }
8311 }
8312 return result;
8313 }
8314
8315 /**
8316 * Converts `set` to an array of its values.
8317 *
8318 * @private
8319 * @param {Object} set The set to convert.
8320 * @returns {Array} Returns the values.
8321 */
8322 function setToArray(set) {
8323 var index = -1,
8324 result = Array(set.size);
8325
8326 set.forEach(function(value) {
8327 result[++index] = value;
8328 });
8329 return result;
8330 }
8331
8332 /**
8333 * Converts `set` to its value-value pairs.
8334 *
8335 * @private
8336 * @param {Object} set The set to convert.
8337 * @returns {Array} Returns the value-value pairs.
8338 */
8339 function setToPairs(set) {
8340 var index = -1,
8341 result = Array(set.size);
8342
8343 set.forEach(function(value) {
8344 result[++index] = [value, value];
8345 });
8346 return result;
8347 }
8348
8349 /**
8350 * A specialized version of `_.indexOf` which performs strict equality
8351 * comparisons of values, i.e. `===`.
8352 *
8353 * @private
8354 * @param {Array} array The array to inspect.
8355 * @param {*} value The value to search for.
8356 * @param {number} fromIndex The index to search from.
8357 * @returns {number} Returns the index of the matched value, else `-1`.
8358 */
8359 function strictIndexOf(array, value, fromIndex) {
8360 var index = fromIndex - 1,
8361 length = array.length;
8362
8363 while (++index < length) {
8364 if (array[index] === value) {
8365 return index;
8366 }
8367 }
8368 return -1;
8369 }
8370
8371 /**
8372 * A specialized version of `_.lastIndexOf` which performs strict equality
8373 * comparisons of values, i.e. `===`.
8374 *
8375 * @private
8376 * @param {Array} array The array to inspect.
8377 * @param {*} value The value to search for.
8378 * @param {number} fromIndex The index to search from.
8379 * @returns {number} Returns the index of the matched value, else `-1`.
8380 */
8381 function strictLastIndexOf(array, value, fromIndex) {
8382 var index = fromIndex + 1;
8383 while (index--) {
8384 if (array[index] === value) {
8385 return index;
8386 }
8387 }
8388 return index;
8389 }
8390
8391 /**
8392 * Gets the number of symbols in `string`.
8393 *
8394 * @private
8395 * @param {string} string The string to inspect.
8396 * @returns {number} Returns the string size.
8397 */
8398 function stringSize(string) {
8399 return hasUnicode(string)
8400 ? unicodeSize(string)
8401 : asciiSize(string);
8402 }
8403
8404 /**
8405 * Converts `string` to an array.
8406 *
8407 * @private
8408 * @param {string} string The string to convert.
8409 * @returns {Array} Returns the converted array.
8410 */
8411 function stringToArray(string) {
8412 return hasUnicode(string)
8413 ? unicodeToArray(string)
8414 : asciiToArray(string);
8415 }
8416
8417 /**
8418 * Used by `_.unescape` to convert HTML entities to characters.
8419 *
8420 * @private
8421 * @param {string} chr The matched character to unescape.
8422 * @returns {string} Returns the unescaped character.
8423 */
8424 var unescapeHtmlChar = basePropertyOf(htmlUnescapes);
8425
8426 /**
8427 * Gets the size of a Unicode `string`.
8428 *
8429 * @private
8430 * @param {string} string The string inspect.
8431 * @returns {number} Returns the string size.
8432 */
8433 function unicodeSize(string) {
8434 var result = reUnicode.lastIndex = 0;
8435 while (reUnicode.test(string)) {
8436 ++result;
8437 }
8438 return result;
8439 }
8440
8441 /**
8442 * Converts a Unicode `string` to an array.
8443 *
8444 * @private
8445 * @param {string} string The string to convert.
8446 * @returns {Array} Returns the converted array.
8447 */
8448 function unicodeToArray(string) {
8449 return string.match(reUnicode) || [];
8450 }
8451
8452 /**
8453 * Splits a Unicode `string` into an array of its words.
8454 *
8455 * @private
8456 * @param {string} The string to inspect.
8457 * @returns {Array} Returns the words of `string`.
8458 */
8459 function unicodeWords(string) {
8460 return string.match(reUnicodeWord) || [];
8461 }
8462
8463 /*--------------------------------------------------------------------------*/
8464
8465 /**
8466 * Create a new pristine `lodash` function using the `context` object.
8467 *
8468 * @static
8469 * @memberOf _
8470 * @since 1.1.0
8471 * @category Util
8472 * @param {Object} [context=root] The context object.
8473 * @returns {Function} Returns a new `lodash` function.
8474 * @example
8475 *
8476 * _.mixin({ 'foo': _.constant('foo') });
8477 *
8478 * var lodash = _.runInContext();
8479 * lodash.mixin({ 'bar': lodash.constant('bar') });
8480 *
8481 * _.isFunction(_.foo);
8482 * // => true
8483 * _.isFunction(_.bar);
8484 * // => false
8485 *
8486 * lodash.isFunction(lodash.foo);
8487 * // => false
8488 * lodash.isFunction(lodash.bar);
8489 * // => true
8490 *
8491 * // Create a suped-up `defer` in Node.js.
8492 * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer;
8493 */
8494 var runInContext = (function runInContext(context) {
8495 context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps));
8496
8497 /** Built-in constructor references. */
8498 var Array = context.Array,
8499 Date = context.Date,
8500 Error = context.Error,
8501 Function = context.Function,
8502 Math = context.Math,
8503 Object = context.Object,
8504 RegExp = context.RegExp,
8505 String = context.String,
8506 TypeError = context.TypeError;
8507
8508 /** Used for built-in method references. */
8509 var arrayProto = Array.prototype,
8510 funcProto = Function.prototype,
8511 objectProto = Object.prototype;
8512
8513 /** Used to detect overreaching core-js shims. */
8514 var coreJsData = context['__core-js_shared__'];
8515
8516 /** Used to resolve the decompiled source of functions. */
8517 var funcToString = funcProto.toString;
8518
8519 /** Used to check objects for own properties. */
8520 var hasOwnProperty = objectProto.hasOwnProperty;
8521
8522 /** Used to generate unique IDs. */
8523 var idCounter = 0;
8524
8525 /** Used to detect methods masquerading as native. */
8526 var maskSrcKey = (function() {
8527 var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
8528 return uid ? ('Symbol(src)_1.' + uid) : '';
8529 }());
8530
8531 /**
8532 * Used to resolve the
8533 * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
8534 * of values.
8535 */
8536 var nativeObjectToString = objectProto.toString;
8537
8538 /** Used to infer the `Object` constructor. */
8539 var objectCtorString = funcToString.call(Object);
8540
8541 /** Used to restore the original `_` reference in `_.noConflict`. */
8542 var oldDash = root._;
8543
8544 /** Used to detect if a method is native. */
8545 var reIsNative = RegExp('^' +
8546 funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
8547 .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
8548 );
8549
8550 /** Built-in value references. */
8551 var Buffer = moduleExports ? context.Buffer : undefined,
8552 Symbol = context.Symbol,
8553 Uint8Array = context.Uint8Array,
8554 allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined,
8555 getPrototype = overArg(Object.getPrototypeOf, Object),
8556 objectCreate = Object.create,
8557 propertyIsEnumerable = objectProto.propertyIsEnumerable,
8558 splice = arrayProto.splice,
8559 spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined,
8560 symIterator = Symbol ? Symbol.iterator : undefined,
8561 symToStringTag = Symbol ? Symbol.toStringTag : undefined;
8562
8563 var defineProperty = (function() {
8564 try {
8565 var func = getNative(Object, 'defineProperty');
8566 func({}, '', {});
8567 return func;
8568 } catch (e) {}
8569 }());
8570
8571 /** Mocked built-ins. */
8572 var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout,
8573 ctxNow = Date && Date.now !== root.Date.now && Date.now,
8574 ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout;
8575
8576 /* Built-in method references for those with the same name as other `lodash` methods. */
8577 var nativeCeil = Math.ceil,
8578 nativeFloor = Math.floor,
8579 nativeGetSymbols = Object.getOwnPropertySymbols,
8580 nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,
8581 nativeIsFinite = context.isFinite,
8582 nativeJoin = arrayProto.join,
8583 nativeKeys = overArg(Object.keys, Object),
8584 nativeMax = Math.max,
8585 nativeMin = Math.min,
8586 nativeNow = Date.now,
8587 nativeParseInt = context.parseInt,
8588 nativeRandom = Math.random,
8589 nativeReverse = arrayProto.reverse;
8590
8591 /* Built-in method references that are verified to be native. */
8592 var DataView = getNative(context, 'DataView'),
8593 Map = getNative(context, 'Map'),
8594 Promise = getNative(context, 'Promise'),
8595 Set = getNative(context, 'Set'),
8596 WeakMap = getNative(context, 'WeakMap'),
8597 nativeCreate = getNative(Object, 'create');
8598
8599 /** Used to store function metadata. */
8600 var metaMap = WeakMap && new WeakMap;
8601
8602 /** Used to lookup unminified function names. */
8603 var realNames = {};
8604
8605 /** Used to detect maps, sets, and weakmaps. */
8606 var dataViewCtorString = toSource(DataView),
8607 mapCtorString = toSource(Map),
8608 promiseCtorString = toSource(Promise),
8609 setCtorString = toSource(Set),
8610 weakMapCtorString = toSource(WeakMap);
8611
8612 /** Used to convert symbols to primitives and strings. */
8613 var symbolProto = Symbol ? Symbol.prototype : undefined,
8614 symbolValueOf = symbolProto ? symbolProto.valueOf : undefined,
8615 symbolToString = symbolProto ? symbolProto.toString : undefined;
8616
8617 /*------------------------------------------------------------------------*/
8618
8619 /**
8620 * Creates a `lodash` object which wraps `value` to enable implicit method
8621 * chain sequences. Methods that operate on and return arrays, collections,
8622 * and functions can be chained together. Methods that retrieve a single value
8623 * or may return a primitive value will automatically end the chain sequence
8624 * and return the unwrapped value. Otherwise, the value must be unwrapped
8625 * with `_#value`.
8626 *
8627 * Explicit chain sequences, which must be unwrapped with `_#value`, may be
8628 * enabled using `_.chain`.
8629 *
8630 * The execution of chained methods is lazy, that is, it's deferred until
8631 * `_#value` is implicitly or explicitly called.
8632 *
8633 * Lazy evaluation allows several methods to support shortcut fusion.
8634 * Shortcut fusion is an optimization to merge iteratee calls; this avoids
8635 * the creation of intermediate arrays and can greatly reduce the number of
8636 * iteratee executions. Sections of a chain sequence qualify for shortcut
8637 * fusion if the section is applied to an array and iteratees accept only
8638 * one argument. The heuristic for whether a section qualifies for shortcut
8639 * fusion is subject to change.
8640 *
8641 * Chaining is supported in custom builds as long as the `_#value` method is
8642 * directly or indirectly included in the build.
8643 *
8644 * In addition to lodash methods, wrappers have `Array` and `String` methods.
8645 *
8646 * The wrapper `Array` methods are:
8647 * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`
8648 *
8649 * The wrapper `String` methods are:
8650 * `replace` and `split`
8651 *
8652 * The wrapper methods that support shortcut fusion are:
8653 * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,
8654 * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,
8655 * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`
8656 *
8657 * The chainable wrapper methods are:
8658 * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,
8659 * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,
8660 * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,
8661 * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,
8662 * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,
8663 * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,
8664 * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`,
8665 * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`,
8666 * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`,
8667 * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`,
8668 * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,
8669 * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`,
8670 * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`,
8671 * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`,
8672 * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`,
8673 * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`,
8674 * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`,
8675 * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`,
8676 * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`,
8677 * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`,
8678 * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`,
8679 * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`,
8680 * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`,
8681 * `zipObject`, `zipObjectDeep`, and `zipWith`
8682 *
8683 * The wrapper methods that are **not** chainable by default are:
8684 * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,
8685 * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`,
8686 * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`,
8687 * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`,
8688 * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`,
8689 * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`,
8690 * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`,
8691 * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`,
8692 * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`,
8693 * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`,
8694 * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`,
8695 * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`,
8696 * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`,
8697 * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`,
8698 * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`,
8699 * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`,
8700 * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`,
8701 * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`,
8702 * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`,
8703 * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`,
8704 * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`,
8705 * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`,
8706 * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`,
8707 * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`,
8708 * `upperFirst`, `value`, and `words`
8709 *
8710 * @name _
8711 * @constructor
8712 * @category Seq
8713 * @param {*} value The value to wrap in a `lodash` instance.
8714 * @returns {Object} Returns the new `lodash` wrapper instance.
8715 * @example
8716 *
8717 * function square(n) {
8718 * return n * n;
8719 * }
8720 *
8721 * var wrapped = _([1, 2, 3]);
8722 *
8723 * // Returns an unwrapped value.
8724 * wrapped.reduce(_.add);
8725 * // => 6
8726 *
8727 * // Returns a wrapped value.
8728 * var squares = wrapped.map(square);
8729 *
8730 * _.isArray(squares);
8731 * // => false
8732 *
8733 * _.isArray(squares.value());
8734 * // => true
8735 */
8736 function lodash(value) {
8737 if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {
8738 if (value instanceof LodashWrapper) {
8739 return value;
8740 }
8741 if (hasOwnProperty.call(value, '__wrapped__')) {
8742 return wrapperClone(value);
8743 }
8744 }
8745 return new LodashWrapper(value);
8746 }
8747
8748 /**
8749 * The base implementation of `_.create` without support for assigning
8750 * properties to the created object.
8751 *
8752 * @private
8753 * @param {Object} proto The object to inherit from.
8754 * @returns {Object} Returns the new object.
8755 */
8756 var baseCreate = (function() {
8757 function object() {}
8758 return function(proto) {
8759 if (!isObject(proto)) {
8760 return {};
8761 }
8762 if (objectCreate) {
8763 return objectCreate(proto);
8764 }
8765 object.prototype = proto;
8766 var result = new object;
8767 object.prototype = undefined;
8768 return result;
8769 };
8770 }());
8771
8772 /**
8773 * The function whose prototype chain sequence wrappers inherit from.
8774 *
8775 * @private
8776 */
8777 function baseLodash() {
8778 // No operation performed.
8779 }
8780
8781 /**
8782 * The base constructor for creating `lodash` wrapper objects.
8783 *
8784 * @private
8785 * @param {*} value The value to wrap.
8786 * @param {boolean} [chainAll] Enable explicit method chain sequences.
8787 */
8788 function LodashWrapper(value, chainAll) {
8789 this.__wrapped__ = value;
8790 this.__actions__ = [];
8791 this.__chain__ = !!chainAll;
8792 this.__index__ = 0;
8793 this.__values__ = undefined;
8794 }
8795
8796 /**
8797 * By default, the template delimiters used by lodash are like those in
8798 * embedded Ruby (ERB) as well as ES2015 template strings. Change the
8799 * following template settings to use alternative delimiters.
8800 *
8801 * @static
8802 * @memberOf _
8803 * @type {Object}
8804 */
8805 lodash.templateSettings = {
8806
8807 /**
8808 * Used to detect `data` property values to be HTML-escaped.
8809 *
8810 * @memberOf _.templateSettings
8811 * @type {RegExp}
8812 */
8813 'escape': reEscape,
8814
8815 /**
8816 * Used to detect code to be evaluated.
8817 *
8818 * @memberOf _.templateSettings
8819 * @type {RegExp}
8820 */
8821 'evaluate': reEvaluate,
8822
8823 /**
8824 * Used to detect `data` property values to inject.
8825 *
8826 * @memberOf _.templateSettings
8827 * @type {RegExp}
8828 */
8829 'interpolate': reInterpolate,
8830
8831 /**
8832 * Used to reference the data object in the template text.
8833 *
8834 * @memberOf _.templateSettings
8835 * @type {string}
8836 */
8837 'variable': '',
8838
8839 /**
8840 * Used to import variables into the compiled template.
8841 *
8842 * @memberOf _.templateSettings
8843 * @type {Object}
8844 */
8845 'imports': {
8846
8847 /**
8848 * A reference to the `lodash` function.
8849 *
8850 * @memberOf _.templateSettings.imports
8851 * @type {Function}
8852 */
8853 '_': lodash
8854 }
8855 };
8856
8857 // Ensure wrappers are instances of `baseLodash`.
8858 lodash.prototype = baseLodash.prototype;
8859 lodash.prototype.constructor = lodash;
8860
8861 LodashWrapper.prototype = baseCreate(baseLodash.prototype);
8862 LodashWrapper.prototype.constructor = LodashWrapper;
8863
8864 /*------------------------------------------------------------------------*/
8865
8866 /**
8867 * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.
8868 *
8869 * @private
8870 * @constructor
8871 * @param {*} value The value to wrap.
8872 */
8873 function LazyWrapper(value) {
8874 this.__wrapped__ = value;
8875 this.__actions__ = [];
8876 this.__dir__ = 1;
8877 this.__filtered__ = false;
8878 this.__iteratees__ = [];
8879 this.__takeCount__ = MAX_ARRAY_LENGTH;
8880 this.__views__ = [];
8881 }
8882
8883 /**
8884 * Creates a clone of the lazy wrapper object.
8885 *
8886 * @private
8887 * @name clone
8888 * @memberOf LazyWrapper
8889 * @returns {Object} Returns the cloned `LazyWrapper` object.
8890 */
8891 function lazyClone() {
8892 var result = new LazyWrapper(this.__wrapped__);
8893 result.__actions__ = copyArray(this.__actions__);
8894 result.__dir__ = this.__dir__;
8895 result.__filtered__ = this.__filtered__;
8896 result.__iteratees__ = copyArray(this.__iteratees__);
8897 result.__takeCount__ = this.__takeCount__;
8898 result.__views__ = copyArray(this.__views__);
8899 return result;
8900 }
8901
8902 /**
8903 * Reverses the direction of lazy iteration.
8904 *
8905 * @private
8906 * @name reverse
8907 * @memberOf LazyWrapper
8908 * @returns {Object} Returns the new reversed `LazyWrapper` object.
8909 */
8910 function lazyReverse() {
8911 if (this.__filtered__) {
8912 var result = new LazyWrapper(this);
8913 result.__dir__ = -1;
8914 result.__filtered__ = true;
8915 } else {
8916 result = this.clone();
8917 result.__dir__ *= -1;
8918 }
8919 return result;
8920 }
8921
8922 /**
8923 * Extracts the unwrapped value from its lazy wrapper.
8924 *
8925 * @private
8926 * @name value
8927 * @memberOf LazyWrapper
8928 * @returns {*} Returns the unwrapped value.
8929 */
8930 function lazyValue() {
8931 var array = this.__wrapped__.value(),
8932 dir = this.__dir__,
8933 isArr = isArray(array),
8934 isRight = dir < 0,
8935 arrLength = isArr ? array.length : 0,
8936 view = getView(0, arrLength, this.__views__),
8937 start = view.start,
8938 end = view.end,
8939 length = end - start,
8940 index = isRight ? end : (start - 1),
8941 iteratees = this.__iteratees__,
8942 iterLength = iteratees.length,
8943 resIndex = 0,
8944 takeCount = nativeMin(length, this.__takeCount__);
8945
8946 if (!isArr || (!isRight && arrLength == length && takeCount == length)) {
8947 return baseWrapperValue(array, this.__actions__);
8948 }
8949 var result = [];
8950
8951 outer:
8952 while (length-- && resIndex < takeCount) {
8953 index += dir;
8954
8955 var iterIndex = -1,
8956 value = array[index];
8957
8958 while (++iterIndex < iterLength) {
8959 var data = iteratees[iterIndex],
8960 iteratee = data.iteratee,
8961 type = data.type,
8962 computed = iteratee(value);
8963
8964 if (type == LAZY_MAP_FLAG) {
8965 value = computed;
8966 } else if (!computed) {
8967 if (type == LAZY_FILTER_FLAG) {
8968 continue outer;
8969 } else {
8970 break outer;
8971 }
8972 }
8973 }
8974 result[resIndex++] = value;
8975 }
8976 return result;
8977 }
8978
8979 // Ensure `LazyWrapper` is an instance of `baseLodash`.
8980 LazyWrapper.prototype = baseCreate(baseLodash.prototype);
8981 LazyWrapper.prototype.constructor = LazyWrapper;
8982
8983 /*------------------------------------------------------------------------*/
8984
8985 /**
8986 * Creates a hash object.
8987 *
8988 * @private
8989 * @constructor
8990 * @param {Array} [entries] The key-value pairs to cache.
8991 */
8992 function Hash(entries) {
8993 var index = -1,
8994 length = entries == null ? 0 : entries.length;
8995
8996 this.clear();
8997 while (++index < length) {
8998 var entry = entries[index];
8999 this.set(entry[0], entry[1]);
9000 }
9001 }
9002
9003 /**
9004 * Removes all key-value entries from the hash.
9005 *
9006 * @private
9007 * @name clear
9008 * @memberOf Hash
9009 */
9010 function hashClear() {
9011 this.__data__ = nativeCreate ? nativeCreate(null) : {};
9012 this.size = 0;
9013 }
9014
9015 /**
9016 * Removes `key` and its value from the hash.
9017 *
9018 * @private
9019 * @name delete
9020 * @memberOf Hash
9021 * @param {Object} hash The hash to modify.
9022 * @param {string} key The key of the value to remove.
9023 * @returns {boolean} Returns `true` if the entry was removed, else `false`.
9024 */
9025 function hashDelete(key) {
9026 var result = this.has(key) && delete this.__data__[key];
9027 this.size -= result ? 1 : 0;
9028 return result;
9029 }
9030
9031 /**
9032 * Gets the hash value for `key`.
9033 *
9034 * @private
9035 * @name get
9036 * @memberOf Hash
9037 * @param {string} key The key of the value to get.
9038 * @returns {*} Returns the entry value.
9039 */
9040 function hashGet(key) {
9041 var data = this.__data__;
9042 if (nativeCreate) {
9043 var result = data[key];
9044 return result === HASH_UNDEFINED ? undefined : result;
9045 }
9046 return hasOwnProperty.call(data, key) ? data[key] : undefined;
9047 }
9048
9049 /**
9050 * Checks if a hash value for `key` exists.
9051 *
9052 * @private
9053 * @name has
9054 * @memberOf Hash
9055 * @param {string} key The key of the entry to check.
9056 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
9057 */
9058 function hashHas(key) {
9059 var data = this.__data__;
9060 return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
9061 }
9062
9063 /**
9064 * Sets the hash `key` to `value`.
9065 *
9066 * @private
9067 * @name set
9068 * @memberOf Hash
9069 * @param {string} key The key of the value to set.
9070 * @param {*} value The value to set.
9071 * @returns {Object} Returns the hash instance.
9072 */
9073 function hashSet(key, value) {
9074 var data = this.__data__;
9075 this.size += this.has(key) ? 0 : 1;
9076 data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
9077 return this;
9078 }
9079
9080 // Add methods to `Hash`.
9081 Hash.prototype.clear = hashClear;
9082 Hash.prototype['delete'] = hashDelete;
9083 Hash.prototype.get = hashGet;
9084 Hash.prototype.has = hashHas;
9085 Hash.prototype.set = hashSet;
9086
9087 /*------------------------------------------------------------------------*/
9088
9089 /**
9090 * Creates an list cache object.
9091 *
9092 * @private
9093 * @constructor
9094 * @param {Array} [entries] The key-value pairs to cache.
9095 */
9096 function ListCache(entries) {
9097 var index = -1,
9098 length = entries == null ? 0 : entries.length;
9099
9100 this.clear();
9101 while (++index < length) {
9102 var entry = entries[index];
9103 this.set(entry[0], entry[1]);
9104 }
9105 }
9106
9107 /**
9108 * Removes all key-value entries from the list cache.
9109 *
9110 * @private
9111 * @name clear
9112 * @memberOf ListCache
9113 */
9114 function listCacheClear() {
9115 this.__data__ = [];
9116 this.size = 0;
9117 }
9118
9119 /**
9120 * Removes `key` and its value from the list cache.
9121 *
9122 * @private
9123 * @name delete
9124 * @memberOf ListCache
9125 * @param {string} key The key of the value to remove.
9126 * @returns {boolean} Returns `true` if the entry was removed, else `false`.
9127 */
9128 function listCacheDelete(key) {
9129 var data = this.__data__,
9130 index = assocIndexOf(data, key);
9131
9132 if (index < 0) {
9133 return false;
9134 }
9135 var lastIndex = data.length - 1;
9136 if (index == lastIndex) {
9137 data.pop();
9138 } else {
9139 splice.call(data, index, 1);
9140 }
9141 --this.size;
9142 return true;
9143 }
9144
9145 /**
9146 * Gets the list cache value for `key`.
9147 *
9148 * @private
9149 * @name get
9150 * @memberOf ListCache
9151 * @param {string} key The key of the value to get.
9152 * @returns {*} Returns the entry value.
9153 */
9154 function listCacheGet(key) {
9155 var data = this.__data__,
9156 index = assocIndexOf(data, key);
9157
9158 return index < 0 ? undefined : data[index][1];
9159 }
9160
9161 /**
9162 * Checks if a list cache value for `key` exists.
9163 *
9164 * @private
9165 * @name has
9166 * @memberOf ListCache
9167 * @param {string} key The key of the entry to check.
9168 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
9169 */
9170 function listCacheHas(key) {
9171 return assocIndexOf(this.__data__, key) > -1;
9172 }
9173
9174 /**
9175 * Sets the list cache `key` to `value`.
9176 *
9177 * @private
9178 * @name set
9179 * @memberOf ListCache
9180 * @param {string} key The key of the value to set.
9181 * @param {*} value The value to set.
9182 * @returns {Object} Returns the list cache instance.
9183 */
9184 function listCacheSet(key, value) {
9185 var data = this.__data__,
9186 index = assocIndexOf(data, key);
9187
9188 if (index < 0) {
9189 ++this.size;
9190 data.push([key, value]);
9191 } else {
9192 data[index][1] = value;
9193 }
9194 return this;
9195 }
9196
9197 // Add methods to `ListCache`.
9198 ListCache.prototype.clear = listCacheClear;
9199 ListCache.prototype['delete'] = listCacheDelete;
9200 ListCache.prototype.get = listCacheGet;
9201 ListCache.prototype.has = listCacheHas;
9202 ListCache.prototype.set = listCacheSet;
9203
9204 /*------------------------------------------------------------------------*/
9205
9206 /**
9207 * Creates a map cache object to store key-value pairs.
9208 *
9209 * @private
9210 * @constructor
9211 * @param {Array} [entries] The key-value pairs to cache.
9212 */
9213 function MapCache(entries) {
9214 var index = -1,
9215 length = entries == null ? 0 : entries.length;
9216
9217 this.clear();
9218 while (++index < length) {
9219 var entry = entries[index];
9220 this.set(entry[0], entry[1]);
9221 }
9222 }
9223
9224 /**
9225 * Removes all key-value entries from the map.
9226 *
9227 * @private
9228 * @name clear
9229 * @memberOf MapCache
9230 */
9231 function mapCacheClear() {
9232 this.size = 0;
9233 this.__data__ = {
9234 'hash': new Hash,
9235 'map': new (Map || ListCache),
9236 'string': new Hash
9237 };
9238 }
9239
9240 /**
9241 * Removes `key` and its value from the map.
9242 *
9243 * @private
9244 * @name delete
9245 * @memberOf MapCache
9246 * @param {string} key The key of the value to remove.
9247 * @returns {boolean} Returns `true` if the entry was removed, else `false`.
9248 */
9249 function mapCacheDelete(key) {
9250 var result = getMapData(this, key)['delete'](key);
9251 this.size -= result ? 1 : 0;
9252 return result;
9253 }
9254
9255 /**
9256 * Gets the map value for `key`.
9257 *
9258 * @private
9259 * @name get
9260 * @memberOf MapCache
9261 * @param {string} key The key of the value to get.
9262 * @returns {*} Returns the entry value.
9263 */
9264 function mapCacheGet(key) {
9265 return getMapData(this, key).get(key);
9266 }
9267
9268 /**
9269 * Checks if a map value for `key` exists.
9270 *
9271 * @private
9272 * @name has
9273 * @memberOf MapCache
9274 * @param {string} key The key of the entry to check.
9275 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
9276 */
9277 function mapCacheHas(key) {
9278 return getMapData(this, key).has(key);
9279 }
9280
9281 /**
9282 * Sets the map `key` to `value`.
9283 *
9284 * @private
9285 * @name set
9286 * @memberOf MapCache
9287 * @param {string} key The key of the value to set.
9288 * @param {*} value The value to set.
9289 * @returns {Object} Returns the map cache instance.
9290 */
9291 function mapCacheSet(key, value) {
9292 var data = getMapData(this, key),
9293 size = data.size;
9294
9295 data.set(key, value);
9296 this.size += data.size == size ? 0 : 1;
9297 return this;
9298 }
9299
9300 // Add methods to `MapCache`.
9301 MapCache.prototype.clear = mapCacheClear;
9302 MapCache.prototype['delete'] = mapCacheDelete;
9303 MapCache.prototype.get = mapCacheGet;
9304 MapCache.prototype.has = mapCacheHas;
9305 MapCache.prototype.set = mapCacheSet;
9306
9307 /*------------------------------------------------------------------------*/
9308
9309 /**
9310 *
9311 * Creates an array cache object to store unique values.
9312 *
9313 * @private
9314 * @constructor
9315 * @param {Array} [values] The values to cache.
9316 */
9317 function SetCache(values) {
9318 var index = -1,
9319 length = values == null ? 0 : values.length;
9320
9321 this.__data__ = new MapCache;
9322 while (++index < length) {
9323 this.add(values[index]);
9324 }
9325 }
9326
9327 /**
9328 * Adds `value` to the array cache.
9329 *
9330 * @private
9331 * @name add
9332 * @memberOf SetCache
9333 * @alias push
9334 * @param {*} value The value to cache.
9335 * @returns {Object} Returns the cache instance.
9336 */
9337 function setCacheAdd(value) {
9338 this.__data__.set(value, HASH_UNDEFINED);
9339 return this;
9340 }
9341
9342 /**
9343 * Checks if `value` is in the array cache.
9344 *
9345 * @private
9346 * @name has
9347 * @memberOf SetCache
9348 * @param {*} value The value to search for.
9349 * @returns {number} Returns `true` if `value` is found, else `false`.
9350 */
9351 function setCacheHas(value) {
9352 return this.__data__.has(value);
9353 }
9354
9355 // Add methods to `SetCache`.
9356 SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
9357 SetCache.prototype.has = setCacheHas;
9358
9359 /*------------------------------------------------------------------------*/
9360
9361 /**
9362 * Creates a stack cache object to store key-value pairs.
9363 *
9364 * @private
9365 * @constructor
9366 * @param {Array} [entries] The key-value pairs to cache.
9367 */
9368 function Stack(entries) {
9369 var data = this.__data__ = new ListCache(entries);
9370 this.size = data.size;
9371 }
9372
9373 /**
9374 * Removes all key-value entries from the stack.
9375 *
9376 * @private
9377 * @name clear
9378 * @memberOf Stack
9379 */
9380 function stackClear() {
9381 this.__data__ = new ListCache;
9382 this.size = 0;
9383 }
9384
9385 /**
9386 * Removes `key` and its value from the stack.
9387 *
9388 * @private
9389 * @name delete
9390 * @memberOf Stack
9391 * @param {string} key The key of the value to remove.
9392 * @returns {boolean} Returns `true` if the entry was removed, else `false`.
9393 */
9394 function stackDelete(key) {
9395 var data = this.__data__,
9396 result = data['delete'](key);
9397
9398 this.size = data.size;
9399 return result;
9400 }
9401
9402 /**
9403 * Gets the stack value for `key`.
9404 *
9405 * @private
9406 * @name get
9407 * @memberOf Stack
9408 * @param {string} key The key of the value to get.
9409 * @returns {*} Returns the entry value.
9410 */
9411 function stackGet(key) {
9412 return this.__data__.get(key);
9413 }
9414
9415 /**
9416 * Checks if a stack value for `key` exists.
9417 *
9418 * @private
9419 * @name has
9420 * @memberOf Stack
9421 * @param {string} key The key of the entry to check.
9422 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
9423 */
9424 function stackHas(key) {
9425 return this.__data__.has(key);
9426 }
9427
9428 /**
9429 * Sets the stack `key` to `value`.
9430 *
9431 * @private
9432 * @name set
9433 * @memberOf Stack
9434 * @param {string} key The key of the value to set.
9435 * @param {*} value The value to set.
9436 * @returns {Object} Returns the stack cache instance.
9437 */
9438 function stackSet(key, value) {
9439 var data = this.__data__;
9440 if (data instanceof ListCache) {
9441 var pairs = data.__data__;
9442 if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
9443 pairs.push([key, value]);
9444 this.size = ++data.size;
9445 return this;
9446 }
9447 data = this.__data__ = new MapCache(pairs);
9448 }
9449 data.set(key, value);
9450 this.size = data.size;
9451 return this;
9452 }
9453
9454 // Add methods to `Stack`.
9455 Stack.prototype.clear = stackClear;
9456 Stack.prototype['delete'] = stackDelete;
9457 Stack.prototype.get = stackGet;
9458 Stack.prototype.has = stackHas;
9459 Stack.prototype.set = stackSet;
9460
9461 /*------------------------------------------------------------------------*/
9462
9463 /**
9464 * Creates an array of the enumerable property names of the array-like `value`.
9465 *
9466 * @private
9467 * @param {*} value The value to query.
9468 * @param {boolean} inherited Specify returning inherited property names.
9469 * @returns {Array} Returns the array of property names.
9470 */
9471 function arrayLikeKeys(value, inherited) {
9472 var isArr = isArray(value),
9473 isArg = !isArr && isArguments(value),
9474 isBuff = !isArr && !isArg && isBuffer(value),
9475 isType = !isArr && !isArg && !isBuff && isTypedArray(value),
9476 skipIndexes = isArr || isArg || isBuff || isType,
9477 result = skipIndexes ? baseTimes(value.length, String) : [],
9478 length = result.length;
9479
9480 for (var key in value) {
9481 if ((inherited || hasOwnProperty.call(value, key)) &&
9482 !(skipIndexes && (
9483 // Safari 9 has enumerable `arguments.length` in strict mode.
9484 key == 'length' ||
9485 // Node.js 0.10 has enumerable non-index properties on buffers.
9486 (isBuff && (key == 'offset' || key == 'parent')) ||
9487 // PhantomJS 2 has enumerable non-index properties on typed arrays.
9488 (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
9489 // Skip index properties.
9490 isIndex(key, length)
9491 ))) {
9492 result.push(key);
9493 }
9494 }
9495 return result;
9496 }
9497
9498 /**
9499 * A specialized version of `_.sample` for arrays.
9500 *
9501 * @private
9502 * @param {Array} array The array to sample.
9503 * @returns {*} Returns the random element.
9504 */
9505 function arraySample(array) {
9506 var length = array.length;
9507 return length ? array[baseRandom(0, length - 1)] : undefined;
9508 }
9509
9510 /**
9511 * A specialized version of `_.sampleSize` for arrays.
9512 *
9513 * @private
9514 * @param {Array} array The array to sample.
9515 * @param {number} n The number of elements to sample.
9516 * @returns {Array} Returns the random elements.
9517 */
9518 function arraySampleSize(array, n) {
9519 return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length));
9520 }
9521
9522 /**
9523 * A specialized version of `_.shuffle` for arrays.
9524 *
9525 * @private
9526 * @param {Array} array The array to shuffle.
9527 * @returns {Array} Returns the new shuffled array.
9528 */
9529 function arrayShuffle(array) {
9530 return shuffleSelf(copyArray(array));
9531 }
9532
9533 /**
9534 * This function is like `assignValue` except that it doesn't assign
9535 * `undefined` values.
9536 *
9537 * @private
9538 * @param {Object} object The object to modify.
9539 * @param {string} key The key of the property to assign.
9540 * @param {*} value The value to assign.
9541 */
9542 function assignMergeValue(object, key, value) {
9543 if ((value !== undefined && !eq(object[key], value)) ||
9544 (value === undefined && !(key in object))) {
9545 baseAssignValue(object, key, value);
9546 }
9547 }
9548
9549 /**
9550 * Assigns `value` to `key` of `object` if the existing value is not equivalent
9551 * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
9552 * for equality comparisons.
9553 *
9554 * @private
9555 * @param {Object} object The object to modify.
9556 * @param {string} key The key of the property to assign.
9557 * @param {*} value The value to assign.
9558 */
9559 function assignValue(object, key, value) {
9560 var objValue = object[key];
9561 if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
9562 (value === undefined && !(key in object))) {
9563 baseAssignValue(object, key, value);
9564 }
9565 }
9566
9567 /**
9568 * Gets the index at which the `key` is found in `array` of key-value pairs.
9569 *
9570 * @private
9571 * @param {Array} array The array to inspect.
9572 * @param {*} key The key to search for.
9573 * @returns {number} Returns the index of the matched value, else `-1`.
9574 */
9575 function assocIndexOf(array, key) {
9576 var length = array.length;
9577 while (length--) {
9578 if (eq(array[length][0], key)) {
9579 return length;
9580 }
9581 }
9582 return -1;
9583 }
9584
9585 /**
9586 * Aggregates elements of `collection` on `accumulator` with keys transformed
9587 * by `iteratee` and values set by `setter`.
9588 *
9589 * @private
9590 * @param {Array|Object} collection The collection to iterate over.
9591 * @param {Function} setter The function to set `accumulator` values.
9592 * @param {Function} iteratee The iteratee to transform keys.
9593 * @param {Object} accumulator The initial aggregated object.
9594 * @returns {Function} Returns `accumulator`.
9595 */
9596 function baseAggregator(collection, setter, iteratee, accumulator) {
9597 baseEach(collection, function(value, key, collection) {
9598 setter(accumulator, value, iteratee(value), collection);
9599 });
9600 return accumulator;
9601 }
9602
9603 /**
9604 * The base implementation of `_.assign` without support for multiple sources
9605 * or `customizer` functions.
9606 *
9607 * @private
9608 * @param {Object} object The destination object.
9609 * @param {Object} source The source object.
9610 * @returns {Object} Returns `object`.
9611 */
9612 function baseAssign(object, source) {
9613 return object && copyObject(source, keys(source), object);
9614 }
9615
9616 /**
9617 * The base implementation of `_.assignIn` without support for multiple sources
9618 * or `customizer` functions.
9619 *
9620 * @private
9621 * @param {Object} object The destination object.
9622 * @param {Object} source The source object.
9623 * @returns {Object} Returns `object`.
9624 */
9625 function baseAssignIn(object, source) {
9626 return object && copyObject(source, keysIn(source), object);
9627 }
9628
9629 /**
9630 * The base implementation of `assignValue` and `assignMergeValue` without
9631 * value checks.
9632 *
9633 * @private
9634 * @param {Object} object The object to modify.
9635 * @param {string} key The key of the property to assign.
9636 * @param {*} value The value to assign.
9637 */
9638 function baseAssignValue(object, key, value) {
9639 if (key == '__proto__' && defineProperty) {
9640 defineProperty(object, key, {
9641 'configurable': true,
9642 'enumerable': true,
9643 'value': value,
9644 'writable': true
9645 });
9646 } else {
9647 object[key] = value;
9648 }
9649 }
9650
9651 /**
9652 * The base implementation of `_.at` without support for individual paths.
9653 *
9654 * @private
9655 * @param {Object} object The object to iterate over.
9656 * @param {string[]} paths The property paths to pick.
9657 * @returns {Array} Returns the picked elements.
9658 */
9659 function baseAt(object, paths) {
9660 var index = -1,
9661 length = paths.length,
9662 result = Array(length),
9663 skip = object == null;
9664
9665 while (++index < length) {
9666 result[index] = skip ? undefined : get(object, paths[index]);
9667 }
9668 return result;
9669 }
9670
9671 /**
9672 * The base implementation of `_.clamp` which doesn't coerce arguments.
9673 *
9674 * @private
9675 * @param {number} number The number to clamp.
9676 * @param {number} [lower] The lower bound.
9677 * @param {number} upper The upper bound.
9678 * @returns {number} Returns the clamped number.
9679 */
9680 function baseClamp(number, lower, upper) {
9681 if (number === number) {
9682 if (upper !== undefined) {
9683 number = number <= upper ? number : upper;
9684 }
9685 if (lower !== undefined) {
9686 number = number >= lower ? number : lower;
9687 }
9688 }
9689 return number;
9690 }
9691
9692 /**
9693 * The base implementation of `_.clone` and `_.cloneDeep` which tracks
9694 * traversed objects.
9695 *
9696 * @private
9697 * @param {*} value The value to clone.
9698 * @param {boolean} bitmask The bitmask flags.
9699 * 1 - Deep clone
9700 * 2 - Flatten inherited properties
9701 * 4 - Clone symbols
9702 * @param {Function} [customizer] The function to customize cloning.
9703 * @param {string} [key] The key of `value`.
9704 * @param {Object} [object] The parent object of `value`.
9705 * @param {Object} [stack] Tracks traversed objects and their clone counterparts.
9706 * @returns {*} Returns the cloned value.
9707 */
9708 function baseClone(value, bitmask, customizer, key, object, stack) {
9709 var result,
9710 isDeep = bitmask & CLONE_DEEP_FLAG,
9711 isFlat = bitmask & CLONE_FLAT_FLAG,
9712 isFull = bitmask & CLONE_SYMBOLS_FLAG;
9713
9714 if (customizer) {
9715 result = object ? customizer(value, key, object, stack) : customizer(value);
9716 }
9717 if (result !== undefined) {
9718 return result;
9719 }
9720 if (!isObject(value)) {
9721 return value;
9722 }
9723 var isArr = isArray(value);
9724 if (isArr) {
9725 result = initCloneArray(value);
9726 if (!isDeep) {
9727 return copyArray(value, result);
9728 }
9729 } else {
9730 var tag = getTag(value),
9731 isFunc = tag == funcTag || tag == genTag;
9732
9733 if (isBuffer(value)) {
9734 return cloneBuffer(value, isDeep);
9735 }
9736 if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
9737 result = (isFlat || isFunc) ? {} : initCloneObject(value);
9738 if (!isDeep) {
9739 return isFlat
9740 ? copySymbolsIn(value, baseAssignIn(result, value))
9741 : copySymbols(value, baseAssign(result, value));
9742 }
9743 } else {
9744 if (!cloneableTags[tag]) {
9745 return object ? value : {};
9746 }
9747 result = initCloneByTag(value, tag, baseClone, isDeep);
9748 }
9749 }
9750 // Check for circular references and return its corresponding clone.
9751 stack || (stack = new Stack);
9752 var stacked = stack.get(value);
9753 if (stacked) {
9754 return stacked;
9755 }
9756 stack.set(value, result);
9757
9758 var keysFunc = isFull
9759 ? (isFlat ? getAllKeysIn : getAllKeys)
9760 : (isFlat ? keysIn : keys);
9761
9762 var props = isArr ? undefined : keysFunc(value);
9763 arrayEach(props || value, function(subValue, key) {
9764 if (props) {
9765 key = subValue;
9766 subValue = value[key];
9767 }
9768 // Recursively populate clone (susceptible to call stack limits).
9769 assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));
9770 });
9771 return result;
9772 }
9773
9774 /**
9775 * The base implementation of `_.conforms` which doesn't clone `source`.
9776 *
9777 * @private
9778 * @param {Object} source The object of property predicates to conform to.
9779 * @returns {Function} Returns the new spec function.
9780 */
9781 function baseConforms(source) {
9782 var props = keys(source);
9783 return function(object) {
9784 return baseConformsTo(object, source, props);
9785 };
9786 }
9787
9788 /**
9789 * The base implementation of `_.conformsTo` which accepts `props` to check.
9790 *
9791 * @private
9792 * @param {Object} object The object to inspect.
9793 * @param {Object} source The object of property predicates to conform to.
9794 * @returns {boolean} Returns `true` if `object` conforms, else `false`.
9795 */
9796 function baseConformsTo(object, source, props) {
9797 var length = props.length;
9798 if (object == null) {
9799 return !length;
9800 }
9801 object = Object(object);
9802 while (length--) {
9803 var key = props[length],
9804 predicate = source[key],
9805 value = object[key];
9806
9807 if ((value === undefined && !(key in object)) || !predicate(value)) {
9808 return false;
9809 }
9810 }
9811 return true;
9812 }
9813
9814 /**
9815 * The base implementation of `_.delay` and `_.defer` which accepts `args`
9816 * to provide to `func`.
9817 *
9818 * @private
9819 * @param {Function} func The function to delay.
9820 * @param {number} wait The number of milliseconds to delay invocation.
9821 * @param {Array} args The arguments to provide to `func`.
9822 * @returns {number|Object} Returns the timer id or timeout object.
9823 */
9824 function baseDelay(func, wait, args) {
9825 if (typeof func != 'function') {
9826 throw new TypeError(FUNC_ERROR_TEXT);
9827 }
9828 return setTimeout(function() { func.apply(undefined, args); }, wait);
9829 }
9830
9831 /**
9832 * The base implementation of methods like `_.difference` without support
9833 * for excluding multiple arrays or iteratee shorthands.
9834 *
9835 * @private
9836 * @param {Array} array The array to inspect.
9837 * @param {Array} values The values to exclude.
9838 * @param {Function} [iteratee] The iteratee invoked per element.
9839 * @param {Function} [comparator] The comparator invoked per element.
9840 * @returns {Array} Returns the new array of filtered values.
9841 */
9842 function baseDifference(array, values, iteratee, comparator) {
9843 var index = -1,
9844 includes = arrayIncludes,
9845 isCommon = true,
9846 length = array.length,
9847 result = [],
9848 valuesLength = values.length;
9849
9850 if (!length) {
9851 return result;
9852 }
9853 if (iteratee) {
9854 values = arrayMap(values, baseUnary(iteratee));
9855 }
9856 if (comparator) {
9857 includes = arrayIncludesWith;
9858 isCommon = false;
9859 }
9860 else if (values.length >= LARGE_ARRAY_SIZE) {
9861 includes = cacheHas;
9862 isCommon = false;
9863 values = new SetCache(values);
9864 }
9865 outer:
9866 while (++index < length) {
9867 var value = array[index],
9868 computed = iteratee == null ? value : iteratee(value);
9869
9870 value = (comparator || value !== 0) ? value : 0;
9871 if (isCommon && computed === computed) {
9872 var valuesIndex = valuesLength;
9873 while (valuesIndex--) {
9874 if (values[valuesIndex] === computed) {
9875 continue outer;
9876 }
9877 }
9878 result.push(value);
9879 }
9880 else if (!includes(values, computed, comparator)) {
9881 result.push(value);
9882 }
9883 }
9884 return result;
9885 }
9886
9887 /**
9888 * The base implementation of `_.forEach` without support for iteratee shorthands.
9889 *
9890 * @private
9891 * @param {Array|Object} collection The collection to iterate over.
9892 * @param {Function} iteratee The function invoked per iteration.
9893 * @returns {Array|Object} Returns `collection`.
9894 */
9895 var baseEach = createBaseEach(baseForOwn);
9896
9897 /**
9898 * The base implementation of `_.forEachRight` without support for iteratee shorthands.
9899 *
9900 * @private
9901 * @param {Array|Object} collection The collection to iterate over.
9902 * @param {Function} iteratee The function invoked per iteration.
9903 * @returns {Array|Object} Returns `collection`.
9904 */
9905 var baseEachRight = createBaseEach(baseForOwnRight, true);
9906
9907 /**
9908 * The base implementation of `_.every` without support for iteratee shorthands.
9909 *
9910 * @private
9911 * @param {Array|Object} collection The collection to iterate over.
9912 * @param {Function} predicate The function invoked per iteration.
9913 * @returns {boolean} Returns `true` if all elements pass the predicate check,
9914 * else `false`
9915 */
9916 function baseEvery(collection, predicate) {
9917 var result = true;
9918 baseEach(collection, function(value, index, collection) {
9919 result = !!predicate(value, index, collection);
9920 return result;
9921 });
9922 return result;
9923 }
9924
9925 /**
9926 * The base implementation of methods like `_.max` and `_.min` which accepts a
9927 * `comparator` to determine the extremum value.
9928 *
9929 * @private
9930 * @param {Array} array The array to iterate over.
9931 * @param {Function} iteratee The iteratee invoked per iteration.
9932 * @param {Function} comparator The comparator used to compare values.
9933 * @returns {*} Returns the extremum value.
9934 */
9935 function baseExtremum(array, iteratee, comparator) {
9936 var index = -1,
9937 length = array.length;
9938
9939 while (++index < length) {
9940 var value = array[index],
9941 current = iteratee(value);
9942
9943 if (current != null && (computed === undefined
9944 ? (current === current && !isSymbol(current))
9945 : comparator(current, computed)
9946 )) {
9947 var computed = current,
9948 result = value;
9949 }
9950 }
9951 return result;
9952 }
9953
9954 /**
9955 * The base implementation of `_.fill` without an iteratee call guard.
9956 *
9957 * @private
9958 * @param {Array} array The array to fill.
9959 * @param {*} value The value to fill `array` with.
9960 * @param {number} [start=0] The start position.
9961 * @param {number} [end=array.length] The end position.
9962 * @returns {Array} Returns `array`.
9963 */
9964 function baseFill(array, value, start, end) {
9965 var length = array.length;
9966
9967 start = toInteger(start);
9968 if (start < 0) {
9969 start = -start > length ? 0 : (length + start);
9970 }
9971 end = (end === undefined || end > length) ? length : toInteger(end);
9972 if (end < 0) {
9973 end += length;
9974 }
9975 end = start > end ? 0 : toLength(end);
9976 while (start < end) {
9977 array[start++] = value;
9978 }
9979 return array;
9980 }
9981
9982 /**
9983 * The base implementation of `_.filter` without support for iteratee shorthands.
9984 *
9985 * @private
9986 * @param {Array|Object} collection The collection to iterate over.
9987 * @param {Function} predicate The function invoked per iteration.
9988 * @returns {Array} Returns the new filtered array.
9989 */
9990 function baseFilter(collection, predicate) {
9991 var result = [];
9992 baseEach(collection, function(value, index, collection) {
9993 if (predicate(value, index, collection)) {
9994 result.push(value);
9995 }
9996 });
9997 return result;
9998 }
9999
10000 /**
10001 * The base implementation of `_.flatten` with support for restricting flattening.
10002 *
10003 * @private
10004 * @param {Array} array The array to flatten.
10005 * @param {number} depth The maximum recursion depth.
10006 * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.
10007 * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.
10008 * @param {Array} [result=[]] The initial result value.
10009 * @returns {Array} Returns the new flattened array.
10010 */
10011 function baseFlatten(array, depth, predicate, isStrict, result) {
10012 var index = -1,
10013 length = array.length;
10014
10015 predicate || (predicate = isFlattenable);
10016 result || (result = []);
10017
10018 while (++index < length) {
10019 var value = array[index];
10020 if (depth > 0 && predicate(value)) {
10021 if (depth > 1) {
10022 // Recursively flatten arrays (susceptible to call stack limits).
10023 baseFlatten(value, depth - 1, predicate, isStrict, result);
10024 } else {
10025 arrayPush(result, value);
10026 }
10027 } else if (!isStrict) {
10028 result[result.length] = value;
10029 }
10030 }
10031 return result;
10032 }
10033
10034 /**
10035 * The base implementation of `baseForOwn` which iterates over `object`
10036 * properties returned by `keysFunc` and invokes `iteratee` for each property.
10037 * Iteratee functions may exit iteration early by explicitly returning `false`.
10038 *
10039 * @private
10040 * @param {Object} object The object to iterate over.
10041 * @param {Function} iteratee The function invoked per iteration.
10042 * @param {Function} keysFunc The function to get the keys of `object`.
10043 * @returns {Object} Returns `object`.
10044 */
10045 var baseFor = createBaseFor();
10046
10047 /**
10048 * This function is like `baseFor` except that it iterates over properties
10049 * in the opposite order.
10050 *
10051 * @private
10052 * @param {Object} object The object to iterate over.
10053 * @param {Function} iteratee The function invoked per iteration.
10054 * @param {Function} keysFunc The function to get the keys of `object`.
10055 * @returns {Object} Returns `object`.
10056 */
10057 var baseForRight = createBaseFor(true);
10058
10059 /**
10060 * The base implementation of `_.forOwn` without support for iteratee shorthands.
10061 *
10062 * @private
10063 * @param {Object} object The object to iterate over.
10064 * @param {Function} iteratee The function invoked per iteration.
10065 * @returns {Object} Returns `object`.
10066 */
10067 function baseForOwn(object, iteratee) {
10068 return object && baseFor(object, iteratee, keys);
10069 }
10070
10071 /**
10072 * The base implementation of `_.forOwnRight` without support for iteratee shorthands.
10073 *
10074 * @private
10075 * @param {Object} object The object to iterate over.
10076 * @param {Function} iteratee The function invoked per iteration.
10077 * @returns {Object} Returns `object`.
10078 */
10079 function baseForOwnRight(object, iteratee) {
10080 return object && baseForRight(object, iteratee, keys);
10081 }
10082
10083 /**
10084 * The base implementation of `_.functions` which creates an array of
10085 * `object` function property names filtered from `props`.
10086 *
10087 * @private
10088 * @param {Object} object The object to inspect.
10089 * @param {Array} props The property names to filter.
10090 * @returns {Array} Returns the function names.
10091 */
10092 function baseFunctions(object, props) {
10093 return arrayFilter(props, function(key) {
10094 return isFunction(object[key]);
10095 });
10096 }
10097
10098 /**
10099 * The base implementation of `_.get` without support for default values.
10100 *
10101 * @private
10102 * @param {Object} object The object to query.
10103 * @param {Array|string} path The path of the property to get.
10104 * @returns {*} Returns the resolved value.
10105 */
10106 function baseGet(object, path) {
10107 path = castPath(path, object);
10108
10109 var index = 0,
10110 length = path.length;
10111
10112 while (object != null && index < length) {
10113 object = object[toKey(path[index++])];
10114 }
10115 return (index && index == length) ? object : undefined;
10116 }
10117
10118 /**
10119 * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
10120 * `keysFunc` and `symbolsFunc` to get the enumerable property names and
10121 * symbols of `object`.
10122 *
10123 * @private
10124 * @param {Object} object The object to query.
10125 * @param {Function} keysFunc The function to get the keys of `object`.
10126 * @param {Function} symbolsFunc The function to get the symbols of `object`.
10127 * @returns {Array} Returns the array of property names and symbols.
10128 */
10129 function baseGetAllKeys(object, keysFunc, symbolsFunc) {
10130 var result = keysFunc(object);
10131 return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
10132 }
10133
10134 /**
10135 * The base implementation of `getTag` without fallbacks for buggy environments.
10136 *
10137 * @private
10138 * @param {*} value The value to query.
10139 * @returns {string} Returns the `toStringTag`.
10140 */
10141 function baseGetTag(value) {
10142 if (value == null) {
10143 return value === undefined ? undefinedTag : nullTag;
10144 }
10145 return (symToStringTag && symToStringTag in Object(value))
10146 ? getRawTag(value)
10147 : objectToString(value);
10148 }
10149
10150 /**
10151 * The base implementation of `_.gt` which doesn't coerce arguments.
10152 *
10153 * @private
10154 * @param {*} value The value to compare.
10155 * @param {*} other The other value to compare.
10156 * @returns {boolean} Returns `true` if `value` is greater than `other`,
10157 * else `false`.
10158 */
10159 function baseGt(value, other) {
10160 return value > other;
10161 }
10162
10163 /**
10164 * The base implementation of `_.has` without support for deep paths.
10165 *
10166 * @private
10167 * @param {Object} [object] The object to query.
10168 * @param {Array|string} key The key to check.
10169 * @returns {boolean} Returns `true` if `key` exists, else `false`.
10170 */
10171 function baseHas(object, key) {
10172 return object != null && hasOwnProperty.call(object, key);
10173 }
10174
10175 /**
10176 * The base implementation of `_.hasIn` without support for deep paths.
10177 *
10178 * @private
10179 * @param {Object} [object] The object to query.
10180 * @param {Array|string} key The key to check.
10181 * @returns {boolean} Returns `true` if `key` exists, else `false`.
10182 */
10183 function baseHasIn(object, key) {
10184 return object != null && key in Object(object);
10185 }
10186
10187 /**
10188 * The base implementation of `_.inRange` which doesn't coerce arguments.
10189 *
10190 * @private
10191 * @param {number} number The number to check.
10192 * @param {number} start The start of the range.
10193 * @param {number} end The end of the range.
10194 * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
10195 */
10196 function baseInRange(number, start, end) {
10197 return number >= nativeMin(start, end) && number < nativeMax(start, end);
10198 }
10199
10200 /**
10201 * The base implementation of methods like `_.intersection`, without support
10202 * for iteratee shorthands, that accepts an array of arrays to inspect.
10203 *
10204 * @private
10205 * @param {Array} arrays The arrays to inspect.
10206 * @param {Function} [iteratee] The iteratee invoked per element.
10207 * @param {Function} [comparator] The comparator invoked per element.
10208 * @returns {Array} Returns the new array of shared values.
10209 */
10210 function baseIntersection(arrays, iteratee, comparator) {
10211 var includes = comparator ? arrayIncludesWith : arrayIncludes,
10212 length = arrays[0].length,
10213 othLength = arrays.length,
10214 othIndex = othLength,
10215 caches = Array(othLength),
10216 maxLength = Infinity,
10217 result = [];
10218
10219 while (othIndex--) {
10220 var array = arrays[othIndex];
10221 if (othIndex && iteratee) {
10222 array = arrayMap(array, baseUnary(iteratee));
10223 }
10224 maxLength = nativeMin(array.length, maxLength);
10225 caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))
10226 ? new SetCache(othIndex && array)
10227 : undefined;
10228 }
10229 array = arrays[0];
10230
10231 var index = -1,
10232 seen = caches[0];
10233
10234 outer:
10235 while (++index < length && result.length < maxLength) {
10236 var value = array[index],
10237 computed = iteratee ? iteratee(value) : value;
10238
10239 value = (comparator || value !== 0) ? value : 0;
10240 if (!(seen
10241 ? cacheHas(seen, computed)
10242 : includes(result, computed, comparator)
10243 )) {
10244 othIndex = othLength;
10245 while (--othIndex) {
10246 var cache = caches[othIndex];
10247 if (!(cache
10248 ? cacheHas(cache, computed)
10249 : includes(arrays[othIndex], computed, comparator))
10250 ) {
10251 continue outer;
10252 }
10253 }
10254 if (seen) {
10255 seen.push(computed);
10256 }
10257 result.push(value);
10258 }
10259 }
10260 return result;
10261 }
10262
10263 /**
10264 * The base implementation of `_.invert` and `_.invertBy` which inverts
10265 * `object` with values transformed by `iteratee` and set by `setter`.
10266 *
10267 * @private
10268 * @param {Object} object The object to iterate over.
10269 * @param {Function} setter The function to set `accumulator` values.
10270 * @param {Function} iteratee The iteratee to transform values.
10271 * @param {Object} accumulator The initial inverted object.
10272 * @returns {Function} Returns `accumulator`.
10273 */
10274 function baseInverter(object, setter, iteratee, accumulator) {
10275 baseForOwn(object, function(value, key, object) {
10276 setter(accumulator, iteratee(value), key, object);
10277 });
10278 return accumulator;
10279 }
10280
10281 /**
10282 * The base implementation of `_.invoke` without support for individual
10283 * method arguments.
10284 *
10285 * @private
10286 * @param {Object} object The object to query.
10287 * @param {Array|string} path The path of the method to invoke.
10288 * @param {Array} args The arguments to invoke the method with.
10289 * @returns {*} Returns the result of the invoked method.
10290 */
10291 function baseInvoke(object, path, args) {
10292 path = castPath(path, object);
10293 object = parent(object, path);
10294 var func = object == null ? object : object[toKey(last(path))];
10295 return func == null ? undefined : apply(func, object, args);
10296 }
10297
10298 /**
10299 * The base implementation of `_.isArguments`.
10300 *
10301 * @private
10302 * @param {*} value The value to check.
10303 * @returns {boolean} Returns `true` if `value` is an `arguments` object,
10304 */
10305 function baseIsArguments(value) {
10306 return isObjectLike(value) && baseGetTag(value) == argsTag;
10307 }
10308
10309 /**
10310 * The base implementation of `_.isArrayBuffer` without Node.js optimizations.
10311 *
10312 * @private
10313 * @param {*} value The value to check.
10314 * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
10315 */
10316 function baseIsArrayBuffer(value) {
10317 return isObjectLike(value) && baseGetTag(value) == arrayBufferTag;
10318 }
10319
10320 /**
10321 * The base implementation of `_.isDate` without Node.js optimizations.
10322 *
10323 * @private
10324 * @param {*} value The value to check.
10325 * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
10326 */
10327 function baseIsDate(value) {
10328 return isObjectLike(value) && baseGetTag(value) == dateTag;
10329 }
10330
10331 /**
10332 * The base implementation of `_.isEqual` which supports partial comparisons
10333 * and tracks traversed objects.
10334 *
10335 * @private
10336 * @param {*} value The value to compare.
10337 * @param {*} other The other value to compare.
10338 * @param {boolean} bitmask The bitmask flags.
10339 * 1 - Unordered comparison
10340 * 2 - Partial comparison
10341 * @param {Function} [customizer] The function to customize comparisons.
10342 * @param {Object} [stack] Tracks traversed `value` and `other` objects.
10343 * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
10344 */
10345 function baseIsEqual(value, other, bitmask, customizer, stack) {
10346 if (value === other) {
10347 return true;
10348 }
10349 if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {
10350 return value !== value && other !== other;
10351 }
10352 return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
10353 }
10354
10355 /**
10356 * A specialized version of `baseIsEqual` for arrays and objects which performs
10357 * deep comparisons and tracks traversed objects enabling objects with circular
10358 * references to be compared.
10359 *
10360 * @private
10361 * @param {Object} object The object to compare.
10362 * @param {Object} other The other object to compare.
10363 * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
10364 * @param {Function} customizer The function to customize comparisons.
10365 * @param {Function} equalFunc The function to determine equivalents of values.
10366 * @param {Object} [stack] Tracks traversed `object` and `other` objects.
10367 * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
10368 */
10369 function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
10370 var objIsArr = isArray(object),
10371 othIsArr = isArray(other),
10372 objTag = objIsArr ? arrayTag : getTag(object),
10373 othTag = othIsArr ? arrayTag : getTag(other);
10374
10375 objTag = objTag == argsTag ? objectTag : objTag;
10376 othTag = othTag == argsTag ? objectTag : othTag;
10377
10378 var objIsObj = objTag == objectTag,
10379 othIsObj = othTag == objectTag,
10380 isSameTag = objTag == othTag;
10381
10382 if (isSameTag && isBuffer(object)) {
10383 if (!isBuffer(other)) {
10384 return false;
10385 }
10386 objIsArr = true;
10387 objIsObj = false;
10388 }
10389 if (isSameTag && !objIsObj) {
10390 stack || (stack = new Stack);
10391 return (objIsArr || isTypedArray(object))
10392 ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)
10393 : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
10394 }
10395 if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
10396 var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
10397 othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
10398
10399 if (objIsWrapped || othIsWrapped) {
10400 var objUnwrapped = objIsWrapped ? object.value() : object,
10401 othUnwrapped = othIsWrapped ? other.value() : other;
10402
10403 stack || (stack = new Stack);
10404 return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
10405 }
10406 }
10407 if (!isSameTag) {
10408 return false;
10409 }
10410 stack || (stack = new Stack);
10411 return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
10412 }
10413
10414 /**
10415 * The base implementation of `_.isMap` without Node.js optimizations.
10416 *
10417 * @private
10418 * @param {*} value The value to check.
10419 * @returns {boolean} Returns `true` if `value` is a map, else `false`.
10420 */
10421 function baseIsMap(value) {
10422 return isObjectLike(value) && getTag(value) == mapTag;
10423 }
10424
10425 /**
10426 * The base implementation of `_.isMatch` without support for iteratee shorthands.
10427 *
10428 * @private
10429 * @param {Object} object The object to inspect.
10430 * @param {Object} source The object of property values to match.
10431 * @param {Array} matchData The property names, values, and compare flags to match.
10432 * @param {Function} [customizer] The function to customize comparisons.
10433 * @returns {boolean} Returns `true` if `object` is a match, else `false`.
10434 */
10435 function baseIsMatch(object, source, matchData, customizer) {
10436 var index = matchData.length,
10437 length = index,
10438 noCustomizer = !customizer;
10439
10440 if (object == null) {
10441 return !length;
10442 }
10443 object = Object(object);
10444 while (index--) {
10445 var data = matchData[index];
10446 if ((noCustomizer && data[2])
10447 ? data[1] !== object[data[0]]
10448 : !(data[0] in object)
10449 ) {
10450 return false;
10451 }
10452 }
10453 while (++index < length) {
10454 data = matchData[index];
10455 var key = data[0],
10456 objValue = object[key],
10457 srcValue = data[1];
10458
10459 if (noCustomizer && data[2]) {
10460 if (objValue === undefined && !(key in object)) {
10461 return false;
10462 }
10463 } else {
10464 var stack = new Stack;
10465 if (customizer) {
10466 var result = customizer(objValue, srcValue, key, object, source, stack);
10467 }
10468 if (!(result === undefined
10469 ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)
10470 : result
10471 )) {
10472 return false;
10473 }
10474 }
10475 }
10476 return true;
10477 }
10478
10479 /**
10480 * The base implementation of `_.isNative` without bad shim checks.
10481 *
10482 * @private
10483 * @param {*} value The value to check.
10484 * @returns {boolean} Returns `true` if `value` is a native function,
10485 * else `false`.
10486 */
10487 function baseIsNative(value) {
10488 if (!isObject(value) || isMasked(value)) {
10489 return false;
10490 }
10491 var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
10492 return pattern.test(toSource(value));
10493 }
10494
10495 /**
10496 * The base implementation of `_.isRegExp` without Node.js optimizations.
10497 *
10498 * @private
10499 * @param {*} value The value to check.
10500 * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
10501 */
10502 function baseIsRegExp(value) {
10503 return isObjectLike(value) && baseGetTag(value) == regexpTag;
10504 }
10505
10506 /**
10507 * The base implementation of `_.isSet` without Node.js optimizations.
10508 *
10509 * @private
10510 * @param {*} value The value to check.
10511 * @returns {boolean} Returns `true` if `value` is a set, else `false`.
10512 */
10513 function baseIsSet(value) {
10514 return isObjectLike(value) && getTag(value) == setTag;
10515 }
10516
10517 /**
10518 * The base implementation of `_.isTypedArray` without Node.js optimizations.
10519 *
10520 * @private
10521 * @param {*} value The value to check.
10522 * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
10523 */
10524 function baseIsTypedArray(value) {
10525 return isObjectLike(value) &&
10526 isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
10527 }
10528
10529 /**
10530 * The base implementation of `_.iteratee`.
10531 *
10532 * @private
10533 * @param {*} [value=_.identity] The value to convert to an iteratee.
10534 * @returns {Function} Returns the iteratee.
10535 */
10536 function baseIteratee(value) {
10537 // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
10538 // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
10539 if (typeof value == 'function') {
10540 return value;
10541 }
10542 if (value == null) {
10543 return identity;
10544 }
10545 if (typeof value == 'object') {
10546 return isArray(value)
10547 ? baseMatchesProperty(value[0], value[1])
10548 : baseMatches(value);
10549 }
10550 return property(value);
10551 }
10552
10553 /**
10554 * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
10555 *
10556 * @private
10557 * @param {Object} object The object to query.
10558 * @returns {Array} Returns the array of property names.
10559 */
10560 function baseKeys(object) {
10561 if (!isPrototype(object)) {
10562 return nativeKeys(object);
10563 }
10564 var result = [];
10565 for (var key in Object(object)) {
10566 if (hasOwnProperty.call(object, key) && key != 'constructor') {
10567 result.push(key);
10568 }
10569 }
10570 return result;
10571 }
10572
10573 /**
10574 * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
10575 *
10576 * @private
10577 * @param {Object} object The object to query.
10578 * @returns {Array} Returns the array of property names.
10579 */
10580 function baseKeysIn(object) {
10581 if (!isObject(object)) {
10582 return nativeKeysIn(object);
10583 }
10584 var isProto = isPrototype(object),
10585 result = [];
10586
10587 for (var key in object) {
10588 if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
10589 result.push(key);
10590 }
10591 }
10592 return result;
10593 }
10594
10595 /**
10596 * The base implementation of `_.lt` which doesn't coerce arguments.
10597 *
10598 * @private
10599 * @param {*} value The value to compare.
10600 * @param {*} other The other value to compare.
10601 * @returns {boolean} Returns `true` if `value` is less than `other`,
10602 * else `false`.
10603 */
10604 function baseLt(value, other) {
10605 return value < other;
10606 }
10607
10608 /**
10609 * The base implementation of `_.map` without support for iteratee shorthands.
10610 *
10611 * @private
10612 * @param {Array|Object} collection The collection to iterate over.
10613 * @param {Function} iteratee The function invoked per iteration.
10614 * @returns {Array} Returns the new mapped array.
10615 */
10616 function baseMap(collection, iteratee) {
10617 var index = -1,
10618 result = isArrayLike(collection) ? Array(collection.length) : [];
10619
10620 baseEach(collection, function(value, key, collection) {
10621 result[++index] = iteratee(value, key, collection);
10622 });
10623 return result;
10624 }
10625
10626 /**
10627 * The base implementation of `_.matches` which doesn't clone `source`.
10628 *
10629 * @private
10630 * @param {Object} source The object of property values to match.
10631 * @returns {Function} Returns the new spec function.
10632 */
10633 function baseMatches(source) {
10634 var matchData = getMatchData(source);
10635 if (matchData.length == 1 && matchData[0][2]) {
10636 return matchesStrictComparable(matchData[0][0], matchData[0][1]);
10637 }
10638 return function(object) {
10639 return object === source || baseIsMatch(object, source, matchData);
10640 };
10641 }
10642
10643 /**
10644 * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.
10645 *
10646 * @private
10647 * @param {string} path The path of the property to get.
10648 * @param {*} srcValue The value to match.
10649 * @returns {Function} Returns the new spec function.
10650 */
10651 function baseMatchesProperty(path, srcValue) {
10652 if (isKey(path) && isStrictComparable(srcValue)) {
10653 return matchesStrictComparable(toKey(path), srcValue);
10654 }
10655 return function(object) {
10656 var objValue = get(object, path);
10657 return (objValue === undefined && objValue === srcValue)
10658 ? hasIn(object, path)
10659 : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
10660 };
10661 }
10662
10663 /**
10664 * The base implementation of `_.merge` without support for multiple sources.
10665 *
10666 * @private
10667 * @param {Object} object The destination object.
10668 * @param {Object} source The source object.
10669 * @param {number} srcIndex The index of `source`.
10670 * @param {Function} [customizer] The function to customize merged values.
10671 * @param {Object} [stack] Tracks traversed source values and their merged
10672 * counterparts.
10673 */
10674 function baseMerge(object, source, srcIndex, customizer, stack) {
10675 if (object === source) {
10676 return;
10677 }
10678 baseFor(source, function(srcValue, key) {
10679 if (isObject(srcValue)) {
10680 stack || (stack = new Stack);
10681 baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
10682 }
10683 else {
10684 var newValue = customizer
10685 ? customizer(object[key], srcValue, (key + ''), object, source, stack)
10686 : undefined;
10687
10688 if (newValue === undefined) {
10689 newValue = srcValue;
10690 }
10691 assignMergeValue(object, key, newValue);
10692 }
10693 }, keysIn);
10694 }
10695
10696 /**
10697 * A specialized version of `baseMerge` for arrays and objects which performs
10698 * deep merges and tracks traversed objects enabling objects with circular
10699 * references to be merged.
10700 *
10701 * @private
10702 * @param {Object} object The destination object.
10703 * @param {Object} source The source object.
10704 * @param {string} key The key of the value to merge.
10705 * @param {number} srcIndex The index of `source`.
10706 * @param {Function} mergeFunc The function to merge values.
10707 * @param {Function} [customizer] The function to customize assigned values.
10708 * @param {Object} [stack] Tracks traversed source values and their merged
10709 * counterparts.
10710 */
10711 function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
10712 var objValue = object[key],
10713 srcValue = source[key],
10714 stacked = stack.get(srcValue);
10715
10716 if (stacked) {
10717 assignMergeValue(object, key, stacked);
10718 return;
10719 }
10720 var newValue = customizer
10721 ? customizer(objValue, srcValue, (key + ''), object, source, stack)
10722 : undefined;
10723
10724 var isCommon = newValue === undefined;
10725
10726 if (isCommon) {
10727 var isArr = isArray(srcValue),
10728 isBuff = !isArr && isBuffer(srcValue),
10729 isTyped = !isArr && !isBuff && isTypedArray(srcValue);
10730
10731 newValue = srcValue;
10732 if (isArr || isBuff || isTyped) {
10733 if (isArray(objValue)) {
10734 newValue = objValue;
10735 }
10736 else if (isArrayLikeObject(objValue)) {
10737 newValue = copyArray(objValue);
10738 }
10739 else if (isBuff) {
10740 isCommon = false;
10741 newValue = cloneBuffer(srcValue, true);
10742 }
10743 else if (isTyped) {
10744 isCommon = false;
10745 newValue = cloneTypedArray(srcValue, true);
10746 }
10747 else {
10748 newValue = [];
10749 }
10750 }
10751 else if (isPlainObject(srcValue) || isArguments(srcValue)) {
10752 newValue = objValue;
10753 if (isArguments(objValue)) {
10754 newValue = toPlainObject(objValue);
10755 }
10756 else if (!isObject(objValue) || (srcIndex && isFunction(objValue))) {
10757 newValue = initCloneObject(srcValue);
10758 }
10759 }
10760 else {
10761 isCommon = false;
10762 }
10763 }
10764 if (isCommon) {
10765 // Recursively merge objects and arrays (susceptible to call stack limits).
10766 stack.set(srcValue, newValue);
10767 mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
10768 stack['delete'](srcValue);
10769 }
10770 assignMergeValue(object, key, newValue);
10771 }
10772
10773 /**
10774 * The base implementation of `_.nth` which doesn't coerce arguments.
10775 *
10776 * @private
10777 * @param {Array} array The array to query.
10778 * @param {number} n The index of the element to return.
10779 * @returns {*} Returns the nth element of `array`.
10780 */
10781 function baseNth(array, n) {
10782 var length = array.length;
10783 if (!length) {
10784 return;
10785 }
10786 n += n < 0 ? length : 0;
10787 return isIndex(n, length) ? array[n] : undefined;
10788 }
10789
10790 /**
10791 * The base implementation of `_.orderBy` without param guards.
10792 *
10793 * @private
10794 * @param {Array|Object} collection The collection to iterate over.
10795 * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.
10796 * @param {string[]} orders The sort orders of `iteratees`.
10797 * @returns {Array} Returns the new sorted array.
10798 */
10799 function baseOrderBy(collection, iteratees, orders) {
10800 var index = -1;
10801 iteratees = arrayMap(iteratees.length ? iteratees : [identity], baseUnary(getIteratee()));
10802
10803 var result = baseMap(collection, function(value, key, collection) {
10804 var criteria = arrayMap(iteratees, function(iteratee) {
10805 return iteratee(value);
10806 });
10807 return { 'criteria': criteria, 'index': ++index, 'value': value };
10808 });
10809
10810 return baseSortBy(result, function(object, other) {
10811 return compareMultiple(object, other, orders);
10812 });
10813 }
10814
10815 /**
10816 * The base implementation of `_.pick` without support for individual
10817 * property identifiers.
10818 *
10819 * @private
10820 * @param {Object} object The source object.
10821 * @param {string[]} paths The property paths to pick.
10822 * @returns {Object} Returns the new object.
10823 */
10824 function basePick(object, paths) {
10825 return basePickBy(object, paths, function(value, path) {
10826 return hasIn(object, path);
10827 });
10828 }
10829
10830 /**
10831 * The base implementation of `_.pickBy` without support for iteratee shorthands.
10832 *
10833 * @private
10834 * @param {Object} object The source object.
10835 * @param {string[]} paths The property paths to pick.
10836 * @param {Function} predicate The function invoked per property.
10837 * @returns {Object} Returns the new object.
10838 */
10839 function basePickBy(object, paths, predicate) {
10840 var index = -1,
10841 length = paths.length,
10842 result = {};
10843
10844 while (++index < length) {
10845 var path = paths[index],
10846 value = baseGet(object, path);
10847
10848 if (predicate(value, path)) {
10849 baseSet(result, castPath(path, object), value);
10850 }
10851 }
10852 return result;
10853 }
10854
10855 /**
10856 * A specialized version of `baseProperty` which supports deep paths.
10857 *
10858 * @private
10859 * @param {Array|string} path The path of the property to get.
10860 * @returns {Function} Returns the new accessor function.
10861 */
10862 function basePropertyDeep(path) {
10863 return function(object) {
10864 return baseGet(object, path);
10865 };
10866 }
10867
10868 /**
10869 * The base implementation of `_.pullAllBy` without support for iteratee
10870 * shorthands.
10871 *
10872 * @private
10873 * @param {Array} array The array to modify.
10874 * @param {Array} values The values to remove.
10875 * @param {Function} [iteratee] The iteratee invoked per element.
10876 * @param {Function} [comparator] The comparator invoked per element.
10877 * @returns {Array} Returns `array`.
10878 */
10879 function basePullAll(array, values, iteratee, comparator) {
10880 var indexOf = comparator ? baseIndexOfWith : baseIndexOf,
10881 index = -1,
10882 length = values.length,
10883 seen = array;
10884
10885 if (array === values) {
10886 values = copyArray(values);
10887 }
10888 if (iteratee) {
10889 seen = arrayMap(array, baseUnary(iteratee));
10890 }
10891 while (++index < length) {
10892 var fromIndex = 0,
10893 value = values[index],
10894 computed = iteratee ? iteratee(value) : value;
10895
10896 while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {
10897 if (seen !== array) {
10898 splice.call(seen, fromIndex, 1);
10899 }
10900 splice.call(array, fromIndex, 1);
10901 }
10902 }
10903 return array;
10904 }
10905
10906 /**
10907 * The base implementation of `_.pullAt` without support for individual
10908 * indexes or capturing the removed elements.
10909 *
10910 * @private
10911 * @param {Array} array The array to modify.
10912 * @param {number[]} indexes The indexes of elements to remove.
10913 * @returns {Array} Returns `array`.
10914 */
10915 function basePullAt(array, indexes) {
10916 var length = array ? indexes.length : 0,
10917 lastIndex = length - 1;
10918
10919 while (length--) {
10920 var index = indexes[length];
10921 if (length == lastIndex || index !== previous) {
10922 var previous = index;
10923 if (isIndex(index)) {
10924 splice.call(array, index, 1);
10925 } else {
10926 baseUnset(array, index);
10927 }
10928 }
10929 }
10930 return array;
10931 }
10932
10933 /**
10934 * The base implementation of `_.random` without support for returning
10935 * floating-point numbers.
10936 *
10937 * @private
10938 * @param {number} lower The lower bound.
10939 * @param {number} upper The upper bound.
10940 * @returns {number} Returns the random number.
10941 */
10942 function baseRandom(lower, upper) {
10943 return lower + nativeFloor(nativeRandom() * (upper - lower + 1));
10944 }
10945
10946 /**
10947 * The base implementation of `_.range` and `_.rangeRight` which doesn't
10948 * coerce arguments.
10949 *
10950 * @private
10951 * @param {number} start The start of the range.
10952 * @param {number} end The end of the range.
10953 * @param {number} step The value to increment or decrement by.
10954 * @param {boolean} [fromRight] Specify iterating from right to left.
10955 * @returns {Array} Returns the range of numbers.
10956 */
10957 function baseRange(start, end, step, fromRight) {
10958 var index = -1,
10959 length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),
10960 result = Array(length);
10961
10962 while (length--) {
10963 result[fromRight ? length : ++index] = start;
10964 start += step;
10965 }
10966 return result;
10967 }
10968
10969 /**
10970 * The base implementation of `_.repeat` which doesn't coerce arguments.
10971 *
10972 * @private
10973 * @param {string} string The string to repeat.
10974 * @param {number} n The number of times to repeat the string.
10975 * @returns {string} Returns the repeated string.
10976 */
10977 function baseRepeat(string, n) {
10978 var result = '';
10979 if (!string || n < 1 || n > MAX_SAFE_INTEGER) {
10980 return result;
10981 }
10982 // Leverage the exponentiation by squaring algorithm for a faster repeat.
10983 // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.
10984 do {
10985 if (n % 2) {
10986 result += string;
10987 }
10988 n = nativeFloor(n / 2);
10989 if (n) {
10990 string += string;
10991 }
10992 } while (n);
10993
10994 return result;
10995 }
10996
10997 /**
10998 * The base implementation of `_.rest` which doesn't validate or coerce arguments.
10999 *
11000 * @private
11001 * @param {Function} func The function to apply a rest parameter to.
11002 * @param {number} [start=func.length-1] The start position of the rest parameter.
11003 * @returns {Function} Returns the new function.
11004 */
11005 function baseRest(func, start) {
11006 return setToString(overRest(func, start, identity), func + '');
11007 }
11008
11009 /**
11010 * The base implementation of `_.sample`.
11011 *
11012 * @private
11013 * @param {Array|Object} collection The collection to sample.
11014 * @returns {*} Returns the random element.
11015 */
11016 function baseSample(collection) {
11017 return arraySample(values(collection));
11018 }
11019
11020 /**
11021 * The base implementation of `_.sampleSize` without param guards.
11022 *
11023 * @private
11024 * @param {Array|Object} collection The collection to sample.
11025 * @param {number} n The number of elements to sample.
11026 * @returns {Array} Returns the random elements.
11027 */
11028 function baseSampleSize(collection, n) {
11029 var array = values(collection);
11030 return shuffleSelf(array, baseClamp(n, 0, array.length));
11031 }
11032
11033 /**
11034 * The base implementation of `_.set`.
11035 *
11036 * @private
11037 * @param {Object} object The object to modify.
11038 * @param {Array|string} path The path of the property to set.
11039 * @param {*} value The value to set.
11040 * @param {Function} [customizer] The function to customize path creation.
11041 * @returns {Object} Returns `object`.
11042 */
11043 function baseSet(object, path, value, customizer) {
11044 if (!isObject(object)) {
11045 return object;
11046 }
11047 path = castPath(path, object);
11048
11049 var index = -1,
11050 length = path.length,
11051 lastIndex = length - 1,
11052 nested = object;
11053
11054 while (nested != null && ++index < length) {
11055 var key = toKey(path[index]),
11056 newValue = value;
11057
11058 if (index != lastIndex) {
11059 var objValue = nested[key];
11060 newValue = customizer ? customizer(objValue, key, nested) : undefined;
11061 if (newValue === undefined) {
11062 newValue = isObject(objValue)
11063 ? objValue
11064 : (isIndex(path[index + 1]) ? [] : {});
11065 }
11066 }
11067 assignValue(nested, key, newValue);
11068 nested = nested[key];
11069 }
11070 return object;
11071 }
11072
11073 /**
11074 * The base implementation of `setData` without support for hot loop shorting.
11075 *
11076 * @private
11077 * @param {Function} func The function to associate metadata with.
11078 * @param {*} data The metadata.
11079 * @returns {Function} Returns `func`.
11080 */
11081 var baseSetData = !metaMap ? identity : function(func, data) {
11082 metaMap.set(func, data);
11083 return func;
11084 };
11085
11086 /**
11087 * The base implementation of `setToString` without support for hot loop shorting.
11088 *
11089 * @private
11090 * @param {Function} func The function to modify.
11091 * @param {Function} string The `toString` result.
11092 * @returns {Function} Returns `func`.
11093 */
11094 var baseSetToString = !defineProperty ? identity : function(func, string) {
11095 return defineProperty(func, 'toString', {
11096 'configurable': true,
11097 'enumerable': false,
11098 'value': constant(string),
11099 'writable': true
11100 });
11101 };
11102
11103 /**
11104 * The base implementation of `_.shuffle`.
11105 *
11106 * @private
11107 * @param {Array|Object} collection The collection to shuffle.
11108 * @returns {Array} Returns the new shuffled array.
11109 */
11110 function baseShuffle(collection) {
11111 return shuffleSelf(values(collection));
11112 }
11113
11114 /**
11115 * The base implementation of `_.slice` without an iteratee call guard.
11116 *
11117 * @private
11118 * @param {Array} array The array to slice.
11119 * @param {number} [start=0] The start position.
11120 * @param {number} [end=array.length] The end position.
11121 * @returns {Array} Returns the slice of `array`.
11122 */
11123 function baseSlice(array, start, end) {
11124 var index = -1,
11125 length = array.length;
11126
11127 if (start < 0) {
11128 start = -start > length ? 0 : (length + start);
11129 }
11130 end = end > length ? length : end;
11131 if (end < 0) {
11132 end += length;
11133 }
11134 length = start > end ? 0 : ((end - start) >>> 0);
11135 start >>>= 0;
11136
11137 var result = Array(length);
11138 while (++index < length) {
11139 result[index] = array[index + start];
11140 }
11141 return result;
11142 }
11143
11144 /**
11145 * The base implementation of `_.some` without support for iteratee shorthands.
11146 *
11147 * @private
11148 * @param {Array|Object} collection The collection to iterate over.
11149 * @param {Function} predicate The function invoked per iteration.
11150 * @returns {boolean} Returns `true` if any element passes the predicate check,
11151 * else `false`.
11152 */
11153 function baseSome(collection, predicate) {
11154 var result;
11155
11156 baseEach(collection, function(value, index, collection) {
11157 result = predicate(value, index, collection);
11158 return !result;
11159 });
11160 return !!result;
11161 }
11162
11163 /**
11164 * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which
11165 * performs a binary search of `array` to determine the index at which `value`
11166 * should be inserted into `array` in order to maintain its sort order.
11167 *
11168 * @private
11169 * @param {Array} array The sorted array to inspect.
11170 * @param {*} value The value to evaluate.
11171 * @param {boolean} [retHighest] Specify returning the highest qualified index.
11172 * @returns {number} Returns the index at which `value` should be inserted
11173 * into `array`.
11174 */
11175 function baseSortedIndex(array, value, retHighest) {
11176 var low = 0,
11177 high = array == null ? low : array.length;
11178
11179 if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {
11180 while (low < high) {
11181 var mid = (low + high) >>> 1,
11182 computed = array[mid];
11183
11184 if (computed !== null && !isSymbol(computed) &&
11185 (retHighest ? (computed <= value) : (computed < value))) {
11186 low = mid + 1;
11187 } else {
11188 high = mid;
11189 }
11190 }
11191 return high;
11192 }
11193 return baseSortedIndexBy(array, value, identity, retHighest);
11194 }
11195
11196 /**
11197 * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy`
11198 * which invokes `iteratee` for `value` and each element of `array` to compute
11199 * their sort ranking. The iteratee is invoked with one argument; (value).
11200 *
11201 * @private
11202 * @param {Array} array The sorted array to inspect.
11203 * @param {*} value The value to evaluate.
11204 * @param {Function} iteratee The iteratee invoked per element.
11205 * @param {boolean} [retHighest] Specify returning the highest qualified index.
11206 * @returns {number} Returns the index at which `value` should be inserted
11207 * into `array`.
11208 */
11209 function baseSortedIndexBy(array, value, iteratee, retHighest) {
11210 value = iteratee(value);
11211
11212 var low = 0,
11213 high = array == null ? 0 : array.length,
11214 valIsNaN = value !== value,
11215 valIsNull = value === null,
11216 valIsSymbol = isSymbol(value),
11217 valIsUndefined = value === undefined;
11218
11219 while (low < high) {
11220 var mid = nativeFloor((low + high) / 2),
11221 computed = iteratee(array[mid]),
11222 othIsDefined = computed !== undefined,
11223 othIsNull = computed === null,
11224 othIsReflexive = computed === computed,
11225 othIsSymbol = isSymbol(computed);
11226
11227 if (valIsNaN) {
11228 var setLow = retHighest || othIsReflexive;
11229 } else if (valIsUndefined) {
11230 setLow = othIsReflexive && (retHighest || othIsDefined);
11231 } else if (valIsNull) {
11232 setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);
11233 } else if (valIsSymbol) {
11234 setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);
11235 } else if (othIsNull || othIsSymbol) {
11236 setLow = false;
11237 } else {
11238 setLow = retHighest ? (computed <= value) : (computed < value);
11239 }
11240 if (setLow) {
11241 low = mid + 1;
11242 } else {
11243 high = mid;
11244 }
11245 }
11246 return nativeMin(high, MAX_ARRAY_INDEX);
11247 }
11248
11249 /**
11250 * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without
11251 * support for iteratee shorthands.
11252 *
11253 * @private
11254 * @param {Array} array The array to inspect.
11255 * @param {Function} [iteratee] The iteratee invoked per element.
11256 * @returns {Array} Returns the new duplicate free array.
11257 */
11258 function baseSortedUniq(array, iteratee) {
11259 var index = -1,
11260 length = array.length,
11261 resIndex = 0,
11262 result = [];
11263
11264 while (++index < length) {
11265 var value = array[index],
11266 computed = iteratee ? iteratee(value) : value;
11267
11268 if (!index || !eq(computed, seen)) {
11269 var seen = computed;
11270 result[resIndex++] = value === 0 ? 0 : value;
11271 }
11272 }
11273 return result;
11274 }
11275
11276 /**
11277 * The base implementation of `_.toNumber` which doesn't ensure correct
11278 * conversions of binary, hexadecimal, or octal string values.
11279 *
11280 * @private
11281 * @param {*} value The value to process.
11282 * @returns {number} Returns the number.
11283 */
11284 function baseToNumber(value) {
11285 if (typeof value == 'number') {
11286 return value;
11287 }
11288 if (isSymbol(value)) {
11289 return NAN;
11290 }
11291 return +value;
11292 }
11293
11294 /**
11295 * The base implementation of `_.toString` which doesn't convert nullish
11296 * values to empty strings.
11297 *
11298 * @private
11299 * @param {*} value The value to process.
11300 * @returns {string} Returns the string.
11301 */
11302 function baseToString(value) {
11303 // Exit early for strings to avoid a performance hit in some environments.
11304 if (typeof value == 'string') {
11305 return value;
11306 }
11307 if (isArray(value)) {
11308 // Recursively convert values (susceptible to call stack limits).
11309 return arrayMap(value, baseToString) + '';
11310 }
11311 if (isSymbol(value)) {
11312 return symbolToString ? symbolToString.call(value) : '';
11313 }
11314 var result = (value + '');
11315 return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
11316 }
11317
11318 /**
11319 * The base implementation of `_.uniqBy` without support for iteratee shorthands.
11320 *
11321 * @private
11322 * @param {Array} array The array to inspect.
11323 * @param {Function} [iteratee] The iteratee invoked per element.
11324 * @param {Function} [comparator] The comparator invoked per element.
11325 * @returns {Array} Returns the new duplicate free array.
11326 */
11327 function baseUniq(array, iteratee, comparator) {
11328 var index = -1,
11329 includes = arrayIncludes,
11330 length = array.length,
11331 isCommon = true,
11332 result = [],
11333 seen = result;
11334
11335 if (comparator) {
11336 isCommon = false;
11337 includes = arrayIncludesWith;
11338 }
11339 else if (length >= LARGE_ARRAY_SIZE) {
11340 var set = iteratee ? null : createSet(array);
11341 if (set) {
11342 return setToArray(set);
11343 }
11344 isCommon = false;
11345 includes = cacheHas;
11346 seen = new SetCache;
11347 }
11348 else {
11349 seen = iteratee ? [] : result;
11350 }
11351 outer:
11352 while (++index < length) {
11353 var value = array[index],
11354 computed = iteratee ? iteratee(value) : value;
11355
11356 value = (comparator || value !== 0) ? value : 0;
11357 if (isCommon && computed === computed) {
11358 var seenIndex = seen.length;
11359 while (seenIndex--) {
11360 if (seen[seenIndex] === computed) {
11361 continue outer;
11362 }
11363 }
11364 if (iteratee) {
11365 seen.push(computed);
11366 }
11367 result.push(value);
11368 }
11369 else if (!includes(seen, computed, comparator)) {
11370 if (seen !== result) {
11371 seen.push(computed);
11372 }
11373 result.push(value);
11374 }
11375 }
11376 return result;
11377 }
11378
11379 /**
11380 * The base implementation of `_.unset`.
11381 *
11382 * @private
11383 * @param {Object} object The object to modify.
11384 * @param {Array|string} path The property path to unset.
11385 * @returns {boolean} Returns `true` if the property is deleted, else `false`.
11386 */
11387 function baseUnset(object, path) {
11388 path = castPath(path, object);
11389 object = parent(object, path);
11390 return object == null || delete object[toKey(last(path))];
11391 }
11392
11393 /**
11394 * The base implementation of `_.update`.
11395 *
11396 * @private
11397 * @param {Object} object The object to modify.
11398 * @param {Array|string} path The path of the property to update.
11399 * @param {Function} updater The function to produce the updated value.
11400 * @param {Function} [customizer] The function to customize path creation.
11401 * @returns {Object} Returns `object`.
11402 */
11403 function baseUpdate(object, path, updater, customizer) {
11404 return baseSet(object, path, updater(baseGet(object, path)), customizer);
11405 }
11406
11407 /**
11408 * The base implementation of methods like `_.dropWhile` and `_.takeWhile`
11409 * without support for iteratee shorthands.
11410 *
11411 * @private
11412 * @param {Array} array The array to query.
11413 * @param {Function} predicate The function invoked per iteration.
11414 * @param {boolean} [isDrop] Specify dropping elements instead of taking them.
11415 * @param {boolean} [fromRight] Specify iterating from right to left.
11416 * @returns {Array} Returns the slice of `array`.
11417 */
11418 function baseWhile(array, predicate, isDrop, fromRight) {
11419 var length = array.length,
11420 index = fromRight ? length : -1;
11421
11422 while ((fromRight ? index-- : ++index < length) &&
11423 predicate(array[index], index, array)) {}
11424
11425 return isDrop
11426 ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length))
11427 : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index));
11428 }
11429
11430 /**
11431 * The base implementation of `wrapperValue` which returns the result of
11432 * performing a sequence of actions on the unwrapped `value`, where each
11433 * successive action is supplied the return value of the previous.
11434 *
11435 * @private
11436 * @param {*} value The unwrapped value.
11437 * @param {Array} actions Actions to perform to resolve the unwrapped value.
11438 * @returns {*} Returns the resolved value.
11439 */
11440 function baseWrapperValue(value, actions) {
11441 var result = value;
11442 if (result instanceof LazyWrapper) {
11443 result = result.value();
11444 }
11445 return arrayReduce(actions, function(result, action) {
11446 return action.func.apply(action.thisArg, arrayPush([result], action.args));
11447 }, result);
11448 }
11449
11450 /**
11451 * The base implementation of methods like `_.xor`, without support for
11452 * iteratee shorthands, that accepts an array of arrays to inspect.
11453 *
11454 * @private
11455 * @param {Array} arrays The arrays to inspect.
11456 * @param {Function} [iteratee] The iteratee invoked per element.
11457 * @param {Function} [comparator] The comparator invoked per element.
11458 * @returns {Array} Returns the new array of values.
11459 */
11460 function baseXor(arrays, iteratee, comparator) {
11461 var length = arrays.length;
11462 if (length < 2) {
11463 return length ? baseUniq(arrays[0]) : [];
11464 }
11465 var index = -1,
11466 result = Array(length);
11467
11468 while (++index < length) {
11469 var array = arrays[index],
11470 othIndex = -1;
11471
11472 while (++othIndex < length) {
11473 if (othIndex != index) {
11474 result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator);
11475 }
11476 }
11477 }
11478 return baseUniq(baseFlatten(result, 1), iteratee, comparator);
11479 }
11480
11481 /**
11482 * This base implementation of `_.zipObject` which assigns values using `assignFunc`.
11483 *
11484 * @private
11485 * @param {Array} props The property identifiers.
11486 * @param {Array} values The property values.
11487 * @param {Function} assignFunc The function to assign values.
11488 * @returns {Object} Returns the new object.
11489 */
11490 function baseZipObject(props, values, assignFunc) {
11491 var index = -1,
11492 length = props.length,
11493 valsLength = values.length,
11494 result = {};
11495
11496 while (++index < length) {
11497 var value = index < valsLength ? values[index] : undefined;
11498 assignFunc(result, props[index], value);
11499 }
11500 return result;
11501 }
11502
11503 /**
11504 * Casts `value` to an empty array if it's not an array like object.
11505 *
11506 * @private
11507 * @param {*} value The value to inspect.
11508 * @returns {Array|Object} Returns the cast array-like object.
11509 */
11510 function castArrayLikeObject(value) {
11511 return isArrayLikeObject(value) ? value : [];
11512 }
11513
11514 /**
11515 * Casts `value` to `identity` if it's not a function.
11516 *
11517 * @private
11518 * @param {*} value The value to inspect.
11519 * @returns {Function} Returns cast function.
11520 */
11521 function castFunction(value) {
11522 return typeof value == 'function' ? value : identity;
11523 }
11524
11525 /**
11526 * Casts `value` to a path array if it's not one.
11527 *
11528 * @private
11529 * @param {*} value The value to inspect.
11530 * @param {Object} [object] The object to query keys on.
11531 * @returns {Array} Returns the cast property path array.
11532 */
11533 function castPath(value, object) {
11534 if (isArray(value)) {
11535 return value;
11536 }
11537 return isKey(value, object) ? [value] : stringToPath(toString(value));
11538 }
11539
11540 /**
11541 * A `baseRest` alias which can be replaced with `identity` by module
11542 * replacement plugins.
11543 *
11544 * @private
11545 * @type {Function}
11546 * @param {Function} func The function to apply a rest parameter to.
11547 * @returns {Function} Returns the new function.
11548 */
11549 var castRest = baseRest;
11550
11551 /**
11552 * Casts `array` to a slice if it's needed.
11553 *
11554 * @private
11555 * @param {Array} array The array to inspect.
11556 * @param {number} start The start position.
11557 * @param {number} [end=array.length] The end position.
11558 * @returns {Array} Returns the cast slice.
11559 */
11560 function castSlice(array, start, end) {
11561 var length = array.length;
11562 end = end === undefined ? length : end;
11563 return (!start && end >= length) ? array : baseSlice(array, start, end);
11564 }
11565
11566 /**
11567 * A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout).
11568 *
11569 * @private
11570 * @param {number|Object} id The timer id or timeout object of the timer to clear.
11571 */
11572 var clearTimeout = ctxClearTimeout || function(id) {
11573 return root.clearTimeout(id);
11574 };
11575
11576 /**
11577 * Creates a clone of `buffer`.
11578 *
11579 * @private
11580 * @param {Buffer} buffer The buffer to clone.
11581 * @param {boolean} [isDeep] Specify a deep clone.
11582 * @returns {Buffer} Returns the cloned buffer.
11583 */
11584 function cloneBuffer(buffer, isDeep) {
11585 if (isDeep) {
11586 return buffer.slice();
11587 }
11588 var length = buffer.length,
11589 result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
11590
11591 buffer.copy(result);
11592 return result;
11593 }
11594
11595 /**
11596 * Creates a clone of `arrayBuffer`.
11597 *
11598 * @private
11599 * @param {ArrayBuffer} arrayBuffer The array buffer to clone.
11600 * @returns {ArrayBuffer} Returns the cloned array buffer.
11601 */
11602 function cloneArrayBuffer(arrayBuffer) {
11603 var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
11604 new Uint8Array(result).set(new Uint8Array(arrayBuffer));
11605 return result;
11606 }
11607
11608 /**
11609 * Creates a clone of `dataView`.
11610 *
11611 * @private
11612 * @param {Object} dataView The data view to clone.
11613 * @param {boolean} [isDeep] Specify a deep clone.
11614 * @returns {Object} Returns the cloned data view.
11615 */
11616 function cloneDataView(dataView, isDeep) {
11617 var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
11618 return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
11619 }
11620
11621 /**
11622 * Creates a clone of `map`.
11623 *
11624 * @private
11625 * @param {Object} map The map to clone.
11626 * @param {Function} cloneFunc The function to clone values.
11627 * @param {boolean} [isDeep] Specify a deep clone.
11628 * @returns {Object} Returns the cloned map.
11629 */
11630 function cloneMap(map, isDeep, cloneFunc) {
11631 var array = isDeep ? cloneFunc(mapToArray(map), CLONE_DEEP_FLAG) : mapToArray(map);
11632 return arrayReduce(array, addMapEntry, new map.constructor);
11633 }
11634
11635 /**
11636 * Creates a clone of `regexp`.
11637 *
11638 * @private
11639 * @param {Object} regexp The regexp to clone.
11640 * @returns {Object} Returns the cloned regexp.
11641 */
11642 function cloneRegExp(regexp) {
11643 var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
11644 result.lastIndex = regexp.lastIndex;
11645 return result;
11646 }
11647
11648 /**
11649 * Creates a clone of `set`.
11650 *
11651 * @private
11652 * @param {Object} set The set to clone.
11653 * @param {Function} cloneFunc The function to clone values.
11654 * @param {boolean} [isDeep] Specify a deep clone.
11655 * @returns {Object} Returns the cloned set.
11656 */
11657 function cloneSet(set, isDeep, cloneFunc) {
11658 var array = isDeep ? cloneFunc(setToArray(set), CLONE_DEEP_FLAG) : setToArray(set);
11659 return arrayReduce(array, addSetEntry, new set.constructor);
11660 }
11661
11662 /**
11663 * Creates a clone of the `symbol` object.
11664 *
11665 * @private
11666 * @param {Object} symbol The symbol object to clone.
11667 * @returns {Object} Returns the cloned symbol object.
11668 */
11669 function cloneSymbol(symbol) {
11670 return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
11671 }
11672
11673 /**
11674 * Creates a clone of `typedArray`.
11675 *
11676 * @private
11677 * @param {Object} typedArray The typed array to clone.
11678 * @param {boolean} [isDeep] Specify a deep clone.
11679 * @returns {Object} Returns the cloned typed array.
11680 */
11681 function cloneTypedArray(typedArray, isDeep) {
11682 var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
11683 return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
11684 }
11685
11686 /**
11687 * Compares values to sort them in ascending order.
11688 *
11689 * @private
11690 * @param {*} value The value to compare.
11691 * @param {*} other The other value to compare.
11692 * @returns {number} Returns the sort order indicator for `value`.
11693 */
11694 function compareAscending(value, other) {
11695 if (value !== other) {
11696 var valIsDefined = value !== undefined,
11697 valIsNull = value === null,
11698 valIsReflexive = value === value,
11699 valIsSymbol = isSymbol(value);
11700
11701 var othIsDefined = other !== undefined,
11702 othIsNull = other === null,
11703 othIsReflexive = other === other,
11704 othIsSymbol = isSymbol(other);
11705
11706 if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||
11707 (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||
11708 (valIsNull && othIsDefined && othIsReflexive) ||
11709 (!valIsDefined && othIsReflexive) ||
11710 !valIsReflexive) {
11711 return 1;
11712 }
11713 if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||
11714 (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||
11715 (othIsNull && valIsDefined && valIsReflexive) ||
11716 (!othIsDefined && valIsReflexive) ||
11717 !othIsReflexive) {
11718 return -1;
11719 }
11720 }
11721 return 0;
11722 }
11723
11724 /**
11725 * Used by `_.orderBy` to compare multiple properties of a value to another
11726 * and stable sort them.
11727 *
11728 * If `orders` is unspecified, all values are sorted in ascending order. Otherwise,
11729 * specify an order of "desc" for descending or "asc" for ascending sort order
11730 * of corresponding values.
11731 *
11732 * @private
11733 * @param {Object} object The object to compare.
11734 * @param {Object} other The other object to compare.
11735 * @param {boolean[]|string[]} orders The order to sort by for each property.
11736 * @returns {number} Returns the sort order indicator for `object`.
11737 */
11738 function compareMultiple(object, other, orders) {
11739 var index = -1,
11740 objCriteria = object.criteria,
11741 othCriteria = other.criteria,
11742 length = objCriteria.length,
11743 ordersLength = orders.length;
11744
11745 while (++index < length) {
11746 var result = compareAscending(objCriteria[index], othCriteria[index]);
11747 if (result) {
11748 if (index >= ordersLength) {
11749 return result;
11750 }
11751 var order = orders[index];
11752 return result * (order == 'desc' ? -1 : 1);
11753 }
11754 }
11755 // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications
11756 // that causes it, under certain circumstances, to provide the same value for
11757 // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247
11758 // for more details.
11759 //
11760 // This also ensures a stable sort in V8 and other engines.
11761 // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.
11762 return object.index - other.index;
11763 }
11764
11765 /**
11766 * Creates an array that is the composition of partially applied arguments,
11767 * placeholders, and provided arguments into a single array of arguments.
11768 *
11769 * @private
11770 * @param {Array} args The provided arguments.
11771 * @param {Array} partials The arguments to prepend to those provided.
11772 * @param {Array} holders The `partials` placeholder indexes.
11773 * @params {boolean} [isCurried] Specify composing for a curried function.
11774 * @returns {Array} Returns the new array of composed arguments.
11775 */
11776 function composeArgs(args, partials, holders, isCurried) {
11777 var argsIndex = -1,
11778 argsLength = args.length,
11779 holdersLength = holders.length,
11780 leftIndex = -1,
11781 leftLength = partials.length,
11782 rangeLength = nativeMax(argsLength - holdersLength, 0),
11783 result = Array(leftLength + rangeLength),
11784 isUncurried = !isCurried;
11785
11786 while (++leftIndex < leftLength) {
11787 result[leftIndex] = partials[leftIndex];
11788 }
11789 while (++argsIndex < holdersLength) {
11790 if (isUncurried || argsIndex < argsLength) {
11791 result[holders[argsIndex]] = args[argsIndex];
11792 }
11793 }
11794 while (rangeLength--) {
11795 result[leftIndex++] = args[argsIndex++];
11796 }
11797 return result;
11798 }
11799
11800 /**
11801 * This function is like `composeArgs` except that the arguments composition
11802 * is tailored for `_.partialRight`.
11803 *
11804 * @private
11805 * @param {Array} args The provided arguments.
11806 * @param {Array} partials The arguments to append to those provided.
11807 * @param {Array} holders The `partials` placeholder indexes.
11808 * @params {boolean} [isCurried] Specify composing for a curried function.
11809 * @returns {Array} Returns the new array of composed arguments.
11810 */
11811 function composeArgsRight(args, partials, holders, isCurried) {
11812 var argsIndex = -1,
11813 argsLength = args.length,
11814 holdersIndex = -1,
11815 holdersLength = holders.length,
11816 rightIndex = -1,
11817 rightLength = partials.length,
11818 rangeLength = nativeMax(argsLength - holdersLength, 0),
11819 result = Array(rangeLength + rightLength),
11820 isUncurried = !isCurried;
11821
11822 while (++argsIndex < rangeLength) {
11823 result[argsIndex] = args[argsIndex];
11824 }
11825 var offset = argsIndex;
11826 while (++rightIndex < rightLength) {
11827 result[offset + rightIndex] = partials[rightIndex];
11828 }
11829 while (++holdersIndex < holdersLength) {
11830 if (isUncurried || argsIndex < argsLength) {
11831 result[offset + holders[holdersIndex]] = args[argsIndex++];
11832 }
11833 }
11834 return result;
11835 }
11836
11837 /**
11838 * Copies the values of `source` to `array`.
11839 *
11840 * @private
11841 * @param {Array} source The array to copy values from.
11842 * @param {Array} [array=[]] The array to copy values to.
11843 * @returns {Array} Returns `array`.
11844 */
11845 function copyArray(source, array) {
11846 var index = -1,
11847 length = source.length;
11848
11849 array || (array = Array(length));
11850 while (++index < length) {
11851 array[index] = source[index];
11852 }
11853 return array;
11854 }
11855
11856 /**
11857 * Copies properties of `source` to `object`.
11858 *
11859 * @private
11860 * @param {Object} source The object to copy properties from.
11861 * @param {Array} props The property identifiers to copy.
11862 * @param {Object} [object={}] The object to copy properties to.
11863 * @param {Function} [customizer] The function to customize copied values.
11864 * @returns {Object} Returns `object`.
11865 */
11866 function copyObject(source, props, object, customizer) {
11867 var isNew = !object;
11868 object || (object = {});
11869
11870 var index = -1,
11871 length = props.length;
11872
11873 while (++index < length) {
11874 var key = props[index];
11875
11876 var newValue = customizer
11877 ? customizer(object[key], source[key], key, object, source)
11878 : undefined;
11879
11880 if (newValue === undefined) {
11881 newValue = source[key];
11882 }
11883 if (isNew) {
11884 baseAssignValue(object, key, newValue);
11885 } else {
11886 assignValue(object, key, newValue);
11887 }
11888 }
11889 return object;
11890 }
11891
11892 /**
11893 * Copies own symbols of `source` to `object`.
11894 *
11895 * @private
11896 * @param {Object} source The object to copy symbols from.
11897 * @param {Object} [object={}] The object to copy symbols to.
11898 * @returns {Object} Returns `object`.
11899 */
11900 function copySymbols(source, object) {
11901 return copyObject(source, getSymbols(source), object);
11902 }
11903
11904 /**
11905 * Copies own and inherited symbols of `source` to `object`.
11906 *
11907 * @private
11908 * @param {Object} source The object to copy symbols from.
11909 * @param {Object} [object={}] The object to copy symbols to.
11910 * @returns {Object} Returns `object`.
11911 */
11912 function copySymbolsIn(source, object) {
11913 return copyObject(source, getSymbolsIn(source), object);
11914 }
11915
11916 /**
11917 * Creates a function like `_.groupBy`.
11918 *
11919 * @private
11920 * @param {Function} setter The function to set accumulator values.
11921 * @param {Function} [initializer] The accumulator object initializer.
11922 * @returns {Function} Returns the new aggregator function.
11923 */
11924 function createAggregator(setter, initializer) {
11925 return function(collection, iteratee) {
11926 var func = isArray(collection) ? arrayAggregator : baseAggregator,
11927 accumulator = initializer ? initializer() : {};
11928
11929 return func(collection, setter, getIteratee(iteratee, 2), accumulator);
11930 };
11931 }
11932
11933 /**
11934 * Creates a function like `_.assign`.
11935 *
11936 * @private
11937 * @param {Function} assigner The function to assign values.
11938 * @returns {Function} Returns the new assigner function.
11939 */
11940 function createAssigner(assigner) {
11941 return baseRest(function(object, sources) {
11942 var index = -1,
11943 length = sources.length,
11944 customizer = length > 1 ? sources[length - 1] : undefined,
11945 guard = length > 2 ? sources[2] : undefined;
11946
11947 customizer = (assigner.length > 3 && typeof customizer == 'function')
11948 ? (length--, customizer)
11949 : undefined;
11950
11951 if (guard && isIterateeCall(sources[0], sources[1], guard)) {
11952 customizer = length < 3 ? undefined : customizer;
11953 length = 1;
11954 }
11955 object = Object(object);
11956 while (++index < length) {
11957 var source = sources[index];
11958 if (source) {
11959 assigner(object, source, index, customizer);
11960 }
11961 }
11962 return object;
11963 });
11964 }
11965
11966 /**
11967 * Creates a `baseEach` or `baseEachRight` function.
11968 *
11969 * @private
11970 * @param {Function} eachFunc The function to iterate over a collection.
11971 * @param {boolean} [fromRight] Specify iterating from right to left.
11972 * @returns {Function} Returns the new base function.
11973 */
11974 function createBaseEach(eachFunc, fromRight) {
11975 return function(collection, iteratee) {
11976 if (collection == null) {
11977 return collection;
11978 }
11979 if (!isArrayLike(collection)) {
11980 return eachFunc(collection, iteratee);
11981 }
11982 var length = collection.length,
11983 index = fromRight ? length : -1,
11984 iterable = Object(collection);
11985
11986 while ((fromRight ? index-- : ++index < length)) {
11987 if (iteratee(iterable[index], index, iterable) === false) {
11988 break;
11989 }
11990 }
11991 return collection;
11992 };
11993 }
11994
11995 /**
11996 * Creates a base function for methods like `_.forIn` and `_.forOwn`.
11997 *
11998 * @private
11999 * @param {boolean} [fromRight] Specify iterating from right to left.
12000 * @returns {Function} Returns the new base function.
12001 */
12002 function createBaseFor(fromRight) {
12003 return function(object, iteratee, keysFunc) {
12004 var index = -1,
12005 iterable = Object(object),
12006 props = keysFunc(object),
12007 length = props.length;
12008
12009 while (length--) {
12010 var key = props[fromRight ? length : ++index];
12011 if (iteratee(iterable[key], key, iterable) === false) {
12012 break;
12013 }
12014 }
12015 return object;
12016 };
12017 }
12018
12019 /**
12020 * Creates a function that wraps `func` to invoke it with the optional `this`
12021 * binding of `thisArg`.
12022 *
12023 * @private
12024 * @param {Function} func The function to wrap.
12025 * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
12026 * @param {*} [thisArg] The `this` binding of `func`.
12027 * @returns {Function} Returns the new wrapped function.
12028 */
12029 function createBind(func, bitmask, thisArg) {
12030 var isBind = bitmask & WRAP_BIND_FLAG,
12031 Ctor = createCtor(func);
12032
12033 function wrapper() {
12034 var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
12035 return fn.apply(isBind ? thisArg : this, arguments);
12036 }
12037 return wrapper;
12038 }
12039
12040 /**
12041 * Creates a function like `_.lowerFirst`.
12042 *
12043 * @private
12044 * @param {string} methodName The name of the `String` case method to use.
12045 * @returns {Function} Returns the new case function.
12046 */
12047 function createCaseFirst(methodName) {
12048 return function(string) {
12049 string = toString(string);
12050
12051 var strSymbols = hasUnicode(string)
12052 ? stringToArray(string)
12053 : undefined;
12054
12055 var chr = strSymbols
12056 ? strSymbols[0]
12057 : string.charAt(0);
12058
12059 var trailing = strSymbols
12060 ? castSlice(strSymbols, 1).join('')
12061 : string.slice(1);
12062
12063 return chr[methodName]() + trailing;
12064 };
12065 }
12066
12067 /**
12068 * Creates a function like `_.camelCase`.
12069 *
12070 * @private
12071 * @param {Function} callback The function to combine each word.
12072 * @returns {Function} Returns the new compounder function.
12073 */
12074 function createCompounder(callback) {
12075 return function(string) {
12076 return arrayReduce(words(deburr(string).replace(reApos, '')), callback, '');
12077 };
12078 }
12079
12080 /**
12081 * Creates a function that produces an instance of `Ctor` regardless of
12082 * whether it was invoked as part of a `new` expression or by `call` or `apply`.
12083 *
12084 * @private
12085 * @param {Function} Ctor The constructor to wrap.
12086 * @returns {Function} Returns the new wrapped function.
12087 */
12088 function createCtor(Ctor) {
12089 return function() {
12090 // Use a `switch` statement to work with class constructors. See
12091 // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist
12092 // for more details.
12093 var args = arguments;
12094 switch (args.length) {
12095 case 0: return new Ctor;
12096 case 1: return new Ctor(args[0]);
12097 case 2: return new Ctor(args[0], args[1]);
12098 case 3: return new Ctor(args[0], args[1], args[2]);
12099 case 4: return new Ctor(args[0], args[1], args[2], args[3]);
12100 case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]);
12101 case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);
12102 case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
12103 }
12104 var thisBinding = baseCreate(Ctor.prototype),
12105 result = Ctor.apply(thisBinding, args);
12106
12107 // Mimic the constructor's `return` behavior.
12108 // See https://es5.github.io/#x13.2.2 for more details.
12109 return isObject(result) ? result : thisBinding;
12110 };
12111 }
12112
12113 /**
12114 * Creates a function that wraps `func` to enable currying.
12115 *
12116 * @private
12117 * @param {Function} func The function to wrap.
12118 * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
12119 * @param {number} arity The arity of `func`.
12120 * @returns {Function} Returns the new wrapped function.
12121 */
12122 function createCurry(func, bitmask, arity) {
12123 var Ctor = createCtor(func);
12124
12125 function wrapper() {
12126 var length = arguments.length,
12127 args = Array(length),
12128 index = length,
12129 placeholder = getHolder(wrapper);
12130
12131 while (index--) {
12132 args[index] = arguments[index];
12133 }
12134 var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder)
12135 ? []
12136 : replaceHolders(args, placeholder);
12137
12138 length -= holders.length;
12139 if (length < arity) {
12140 return createRecurry(
12141 func, bitmask, createHybrid, wrapper.placeholder, undefined,
12142 args, holders, undefined, undefined, arity - length);
12143 }
12144 var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
12145 return apply(fn, this, args);
12146 }
12147 return wrapper;
12148 }
12149
12150 /**
12151 * Creates a `_.find` or `_.findLast` function.
12152 *
12153 * @private
12154 * @param {Function} findIndexFunc The function to find the collection index.
12155 * @returns {Function} Returns the new find function.
12156 */
12157 function createFind(findIndexFunc) {
12158 return function(collection, predicate, fromIndex) {
12159 var iterable = Object(collection);
12160 if (!isArrayLike(collection)) {
12161 var iteratee = getIteratee(predicate, 3);
12162 collection = keys(collection);
12163 predicate = function(key) { return iteratee(iterable[key], key, iterable); };
12164 }
12165 var index = findIndexFunc(collection, predicate, fromIndex);
12166 return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;
12167 };
12168 }
12169
12170 /**
12171 * Creates a `_.flow` or `_.flowRight` function.
12172 *
12173 * @private
12174 * @param {boolean} [fromRight] Specify iterating from right to left.
12175 * @returns {Function} Returns the new flow function.
12176 */
12177 function createFlow(fromRight) {
12178 return flatRest(function(funcs) {
12179 var length = funcs.length,
12180 index = length,
12181 prereq = LodashWrapper.prototype.thru;
12182
12183 if (fromRight) {
12184 funcs.reverse();
12185 }
12186 while (index--) {
12187 var func = funcs[index];
12188 if (typeof func != 'function') {
12189 throw new TypeError(FUNC_ERROR_TEXT);
12190 }
12191 if (prereq && !wrapper && getFuncName(func) == 'wrapper') {
12192 var wrapper = new LodashWrapper([], true);
12193 }
12194 }
12195 index = wrapper ? index : length;
12196 while (++index < length) {
12197 func = funcs[index];
12198
12199 var funcName = getFuncName(func),
12200 data = funcName == 'wrapper' ? getData(func) : undefined;
12201
12202 if (data && isLaziable(data[0]) &&
12203 data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) &&
12204 !data[4].length && data[9] == 1
12205 ) {
12206 wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);
12207 } else {
12208 wrapper = (func.length == 1 && isLaziable(func))
12209 ? wrapper[funcName]()
12210 : wrapper.thru(func);
12211 }
12212 }
12213 return function() {
12214 var args = arguments,
12215 value = args[0];
12216
12217 if (wrapper && args.length == 1 && isArray(value)) {
12218 return wrapper.plant(value).value();
12219 }
12220 var index = 0,
12221 result = length ? funcs[index].apply(this, args) : value;
12222
12223 while (++index < length) {
12224 result = funcs[index].call(this, result);
12225 }
12226 return result;
12227 };
12228 });
12229 }
12230
12231 /**
12232 * Creates a function that wraps `func` to invoke it with optional `this`
12233 * binding of `thisArg`, partial application, and currying.
12234 *
12235 * @private
12236 * @param {Function|string} func The function or method name to wrap.
12237 * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
12238 * @param {*} [thisArg] The `this` binding of `func`.
12239 * @param {Array} [partials] The arguments to prepend to those provided to
12240 * the new function.
12241 * @param {Array} [holders] The `partials` placeholder indexes.
12242 * @param {Array} [partialsRight] The arguments to append to those provided
12243 * to the new function.
12244 * @param {Array} [holdersRight] The `partialsRight` placeholder indexes.
12245 * @param {Array} [argPos] The argument positions of the new function.
12246 * @param {number} [ary] The arity cap of `func`.
12247 * @param {number} [arity] The arity of `func`.
12248 * @returns {Function} Returns the new wrapped function.
12249 */
12250 function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {
12251 var isAry = bitmask & WRAP_ARY_FLAG,
12252 isBind = bitmask & WRAP_BIND_FLAG,
12253 isBindKey = bitmask & WRAP_BIND_KEY_FLAG,
12254 isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG),
12255 isFlip = bitmask & WRAP_FLIP_FLAG,
12256 Ctor = isBindKey ? undefined : createCtor(func);
12257
12258 function wrapper() {
12259 var length = arguments.length,
12260 args = Array(length),
12261 index = length;
12262
12263 while (index--) {
12264 args[index] = arguments[index];
12265 }
12266 if (isCurried) {
12267 var placeholder = getHolder(wrapper),
12268 holdersCount = countHolders(args, placeholder);
12269 }
12270 if (partials) {
12271 args = composeArgs(args, partials, holders, isCurried);
12272 }
12273 if (partialsRight) {
12274 args = composeArgsRight(args, partialsRight, holdersRight, isCurried);
12275 }
12276 length -= holdersCount;
12277 if (isCurried && length < arity) {
12278 var newHolders = replaceHolders(args, placeholder);
12279 return createRecurry(
12280 func, bitmask, createHybrid, wrapper.placeholder, thisArg,
12281 args, newHolders, argPos, ary, arity - length
12282 );
12283 }
12284 var thisBinding = isBind ? thisArg : this,
12285 fn = isBindKey ? thisBinding[func] : func;
12286
12287 length = args.length;
12288 if (argPos) {
12289 args = reorder(args, argPos);
12290 } else if (isFlip && length > 1) {
12291 args.reverse();
12292 }
12293 if (isAry && ary < length) {
12294 args.length = ary;
12295 }
12296 if (this && this !== root && this instanceof wrapper) {
12297 fn = Ctor || createCtor(fn);
12298 }
12299 return fn.apply(thisBinding, args);
12300 }
12301 return wrapper;
12302 }
12303
12304 /**
12305 * Creates a function like `_.invertBy`.
12306 *
12307 * @private
12308 * @param {Function} setter The function to set accumulator values.
12309 * @param {Function} toIteratee The function to resolve iteratees.
12310 * @returns {Function} Returns the new inverter function.
12311 */
12312 function createInverter(setter, toIteratee) {
12313 return function(object, iteratee) {
12314 return baseInverter(object, setter, toIteratee(iteratee), {});
12315 };
12316 }
12317
12318 /**
12319 * Creates a function that performs a mathematical operation on two values.
12320 *
12321 * @private
12322 * @param {Function} operator The function to perform the operation.
12323 * @param {number} [defaultValue] The value used for `undefined` arguments.
12324 * @returns {Function} Returns the new mathematical operation function.
12325 */
12326 function createMathOperation(operator, defaultValue) {
12327 return function(value, other) {
12328 var result;
12329 if (value === undefined && other === undefined) {
12330 return defaultValue;
12331 }
12332 if (value !== undefined) {
12333 result = value;
12334 }
12335 if (other !== undefined) {
12336 if (result === undefined) {
12337 return other;
12338 }
12339 if (typeof value == 'string' || typeof other == 'string') {
12340 value = baseToString(value);
12341 other = baseToString(other);
12342 } else {
12343 value = baseToNumber(value);
12344 other = baseToNumber(other);
12345 }
12346 result = operator(value, other);
12347 }
12348 return result;
12349 };
12350 }
12351
12352 /**
12353 * Creates a function like `_.over`.
12354 *
12355 * @private
12356 * @param {Function} arrayFunc The function to iterate over iteratees.
12357 * @returns {Function} Returns the new over function.
12358 */
12359 function createOver(arrayFunc) {
12360 return flatRest(function(iteratees) {
12361 iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
12362 return baseRest(function(args) {
12363 var thisArg = this;
12364 return arrayFunc(iteratees, function(iteratee) {
12365 return apply(iteratee, thisArg, args);
12366 });
12367 });
12368 });
12369 }
12370
12371 /**
12372 * Creates the padding for `string` based on `length`. The `chars` string
12373 * is truncated if the number of characters exceeds `length`.
12374 *
12375 * @private
12376 * @param {number} length The padding length.
12377 * @param {string} [chars=' '] The string used as padding.
12378 * @returns {string} Returns the padding for `string`.
12379 */
12380 function createPadding(length, chars) {
12381 chars = chars === undefined ? ' ' : baseToString(chars);
12382
12383 var charsLength = chars.length;
12384 if (charsLength < 2) {
12385 return charsLength ? baseRepeat(chars, length) : chars;
12386 }
12387 var result = baseRepeat(chars, nativeCeil(length / stringSize(chars)));
12388 return hasUnicode(chars)
12389 ? castSlice(stringToArray(result), 0, length).join('')
12390 : result.slice(0, length);
12391 }
12392
12393 /**
12394 * Creates a function that wraps `func` to invoke it with the `this` binding
12395 * of `thisArg` and `partials` prepended to the arguments it receives.
12396 *
12397 * @private
12398 * @param {Function} func The function to wrap.
12399 * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
12400 * @param {*} thisArg The `this` binding of `func`.
12401 * @param {Array} partials The arguments to prepend to those provided to
12402 * the new function.
12403 * @returns {Function} Returns the new wrapped function.
12404 */
12405 function createPartial(func, bitmask, thisArg, partials) {
12406 var isBind = bitmask & WRAP_BIND_FLAG,
12407 Ctor = createCtor(func);
12408
12409 function wrapper() {
12410 var argsIndex = -1,
12411 argsLength = arguments.length,
12412 leftIndex = -1,
12413 leftLength = partials.length,
12414 args = Array(leftLength + argsLength),
12415 fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
12416
12417 while (++leftIndex < leftLength) {
12418 args[leftIndex] = partials[leftIndex];
12419 }
12420 while (argsLength--) {
12421 args[leftIndex++] = arguments[++argsIndex];
12422 }
12423 return apply(fn, isBind ? thisArg : this, args);
12424 }
12425 return wrapper;
12426 }
12427
12428 /**
12429 * Creates a `_.range` or `_.rangeRight` function.
12430 *
12431 * @private
12432 * @param {boolean} [fromRight] Specify iterating from right to left.
12433 * @returns {Function} Returns the new range function.
12434 */
12435 function createRange(fromRight) {
12436 return function(start, end, step) {
12437 if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {
12438 end = step = undefined;
12439 }
12440 // Ensure the sign of `-0` is preserved.
12441 start = toFinite(start);
12442 if (end === undefined) {
12443 end = start;
12444 start = 0;
12445 } else {
12446 end = toFinite(end);
12447 }
12448 step = step === undefined ? (start < end ? 1 : -1) : toFinite(step);
12449 return baseRange(start, end, step, fromRight);
12450 };
12451 }
12452
12453 /**
12454 * Creates a function that performs a relational operation on two values.
12455 *
12456 * @private
12457 * @param {Function} operator The function to perform the operation.
12458 * @returns {Function} Returns the new relational operation function.
12459 */
12460 function createRelationalOperation(operator) {
12461 return function(value, other) {
12462 if (!(typeof value == 'string' && typeof other == 'string')) {
12463 value = toNumber(value);
12464 other = toNumber(other);
12465 }
12466 return operator(value, other);
12467 };
12468 }
12469
12470 /**
12471 * Creates a function that wraps `func` to continue currying.
12472 *
12473 * @private
12474 * @param {Function} func The function to wrap.
12475 * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
12476 * @param {Function} wrapFunc The function to create the `func` wrapper.
12477 * @param {*} placeholder The placeholder value.
12478 * @param {*} [thisArg] The `this` binding of `func`.
12479 * @param {Array} [partials] The arguments to prepend to those provided to
12480 * the new function.
12481 * @param {Array} [holders] The `partials` placeholder indexes.
12482 * @param {Array} [argPos] The argument positions of the new function.
12483 * @param {number} [ary] The arity cap of `func`.
12484 * @param {number} [arity] The arity of `func`.
12485 * @returns {Function} Returns the new wrapped function.
12486 */
12487 function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {
12488 var isCurry = bitmask & WRAP_CURRY_FLAG,
12489 newHolders = isCurry ? holders : undefined,
12490 newHoldersRight = isCurry ? undefined : holders,
12491 newPartials = isCurry ? partials : undefined,
12492 newPartialsRight = isCurry ? undefined : partials;
12493
12494 bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG);
12495 bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);
12496
12497 if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {
12498 bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);
12499 }
12500 var newData = [
12501 func, bitmask, thisArg, newPartials, newHolders, newPartialsRight,
12502 newHoldersRight, argPos, ary, arity
12503 ];
12504
12505 var result = wrapFunc.apply(undefined, newData);
12506 if (isLaziable(func)) {
12507 setData(result, newData);
12508 }
12509 result.placeholder = placeholder;
12510 return setWrapToString(result, func, bitmask);
12511 }
12512
12513 /**
12514 * Creates a function like `_.round`.
12515 *
12516 * @private
12517 * @param {string} methodName The name of the `Math` method to use when rounding.
12518 * @returns {Function} Returns the new round function.
12519 */
12520 function createRound(methodName) {
12521 var func = Math[methodName];
12522 return function(number, precision) {
12523 number = toNumber(number);
12524 precision = precision == null ? 0 : nativeMin(toInteger(precision), 292);
12525 if (precision) {
12526 // Shift with exponential notation to avoid floating-point issues.
12527 // See [MDN](https://mdn.io/round#Examples) for more details.
12528 var pair = (toString(number) + 'e').split('e'),
12529 value = func(pair[0] + 'e' + (+pair[1] + precision));
12530
12531 pair = (toString(value) + 'e').split('e');
12532 return +(pair[0] + 'e' + (+pair[1] - precision));
12533 }
12534 return func(number);
12535 };
12536 }
12537
12538 /**
12539 * Creates a set object of `values`.
12540 *
12541 * @private
12542 * @param {Array} values The values to add to the set.
12543 * @returns {Object} Returns the new set.
12544 */
12545 var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {
12546 return new Set(values);
12547 };
12548
12549 /**
12550 * Creates a `_.toPairs` or `_.toPairsIn` function.
12551 *
12552 * @private
12553 * @param {Function} keysFunc The function to get the keys of a given object.
12554 * @returns {Function} Returns the new pairs function.
12555 */
12556 function createToPairs(keysFunc) {
12557 return function(object) {
12558 var tag = getTag(object);
12559 if (tag == mapTag) {
12560 return mapToArray(object);
12561 }
12562 if (tag == setTag) {
12563 return setToPairs(object);
12564 }
12565 return baseToPairs(object, keysFunc(object));
12566 };
12567 }
12568
12569 /**
12570 * Creates a function that either curries or invokes `func` with optional
12571 * `this` binding and partially applied arguments.
12572 *
12573 * @private
12574 * @param {Function|string} func The function or method name to wrap.
12575 * @param {number} bitmask The bitmask flags.
12576 * 1 - `_.bind`
12577 * 2 - `_.bindKey`
12578 * 4 - `_.curry` or `_.curryRight` of a bound function
12579 * 8 - `_.curry`
12580 * 16 - `_.curryRight`
12581 * 32 - `_.partial`
12582 * 64 - `_.partialRight`
12583 * 128 - `_.rearg`
12584 * 256 - `_.ary`
12585 * 512 - `_.flip`
12586 * @param {*} [thisArg] The `this` binding of `func`.
12587 * @param {Array} [partials] The arguments to be partially applied.
12588 * @param {Array} [holders] The `partials` placeholder indexes.
12589 * @param {Array} [argPos] The argument positions of the new function.
12590 * @param {number} [ary] The arity cap of `func`.
12591 * @param {number} [arity] The arity of `func`.
12592 * @returns {Function} Returns the new wrapped function.
12593 */
12594 function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {
12595 var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;
12596 if (!isBindKey && typeof func != 'function') {
12597 throw new TypeError(FUNC_ERROR_TEXT);
12598 }
12599 var length = partials ? partials.length : 0;
12600 if (!length) {
12601 bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);
12602 partials = holders = undefined;
12603 }
12604 ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0);
12605 arity = arity === undefined ? arity : toInteger(arity);
12606 length -= holders ? holders.length : 0;
12607
12608 if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {
12609 var partialsRight = partials,
12610 holdersRight = holders;
12611
12612 partials = holders = undefined;
12613 }
12614 var data = isBindKey ? undefined : getData(func);
12615
12616 var newData = [
12617 func, bitmask, thisArg, partials, holders, partialsRight, holdersRight,
12618 argPos, ary, arity
12619 ];
12620
12621 if (data) {
12622 mergeData(newData, data);
12623 }
12624 func = newData[0];
12625 bitmask = newData[1];
12626 thisArg = newData[2];
12627 partials = newData[3];
12628 holders = newData[4];
12629 arity = newData[9] = newData[9] === undefined
12630 ? (isBindKey ? 0 : func.length)
12631 : nativeMax(newData[9] - length, 0);
12632
12633 if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {
12634 bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);
12635 }
12636 if (!bitmask || bitmask == WRAP_BIND_FLAG) {
12637 var result = createBind(func, bitmask, thisArg);
12638 } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) {
12639 result = createCurry(func, bitmask, arity);
12640 } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) {
12641 result = createPartial(func, bitmask, thisArg, partials);
12642 } else {
12643 result = createHybrid.apply(undefined, newData);
12644 }
12645 var setter = data ? baseSetData : setData;
12646 return setWrapToString(setter(result, newData), func, bitmask);
12647 }
12648
12649 /**
12650 * Used by `_.defaults` to customize its `_.assignIn` use to assign properties
12651 * of source objects to the destination object for all destination properties
12652 * that resolve to `undefined`.
12653 *
12654 * @private
12655 * @param {*} objValue The destination value.
12656 * @param {*} srcValue The source value.
12657 * @param {string} key The key of the property to assign.
12658 * @param {Object} object The parent object of `objValue`.
12659 * @returns {*} Returns the value to assign.
12660 */
12661 function customDefaultsAssignIn(objValue, srcValue, key, object) {
12662 if (objValue === undefined ||
12663 (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) {
12664 return srcValue;
12665 }
12666 return objValue;
12667 }
12668
12669 /**
12670 * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source
12671 * objects into destination objects that are passed thru.
12672 *
12673 * @private
12674 * @param {*} objValue The destination value.
12675 * @param {*} srcValue The source value.
12676 * @param {string} key The key of the property to merge.
12677 * @param {Object} object The parent object of `objValue`.
12678 * @param {Object} source The parent object of `srcValue`.
12679 * @param {Object} [stack] Tracks traversed source values and their merged
12680 * counterparts.
12681 * @returns {*} Returns the value to assign.
12682 */
12683 function customDefaultsMerge(objValue, srcValue, key, object, source, stack) {
12684 if (isObject(objValue) && isObject(srcValue)) {
12685 // Recursively merge objects and arrays (susceptible to call stack limits).
12686 stack.set(srcValue, objValue);
12687 baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack);
12688 stack['delete'](srcValue);
12689 }
12690 return objValue;
12691 }
12692
12693 /**
12694 * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain
12695 * objects.
12696 *
12697 * @private
12698 * @param {*} value The value to inspect.
12699 * @param {string} key The key of the property to inspect.
12700 * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`.
12701 */
12702 function customOmitClone(value) {
12703 return isPlainObject(value) ? undefined : value;
12704 }
12705
12706 /**
12707 * A specialized version of `baseIsEqualDeep` for arrays with support for
12708 * partial deep comparisons.
12709 *
12710 * @private
12711 * @param {Array} array The array to compare.
12712 * @param {Array} other The other array to compare.
12713 * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
12714 * @param {Function} customizer The function to customize comparisons.
12715 * @param {Function} equalFunc The function to determine equivalents of values.
12716 * @param {Object} stack Tracks traversed `array` and `other` objects.
12717 * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
12718 */
12719 function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
12720 var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
12721 arrLength = array.length,
12722 othLength = other.length;
12723
12724 if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
12725 return false;
12726 }
12727 // Assume cyclic values are equal.
12728 var stacked = stack.get(array);
12729 if (stacked && stack.get(other)) {
12730 return stacked == other;
12731 }
12732 var index = -1,
12733 result = true,
12734 seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;
12735
12736 stack.set(array, other);
12737 stack.set(other, array);
12738
12739 // Ignore non-index properties.
12740 while (++index < arrLength) {
12741 var arrValue = array[index],
12742 othValue = other[index];
12743
12744 if (customizer) {
12745 var compared = isPartial
12746 ? customizer(othValue, arrValue, index, other, array, stack)
12747 : customizer(arrValue, othValue, index, array, other, stack);
12748 }
12749 if (compared !== undefined) {
12750 if (compared) {
12751 continue;
12752 }
12753 result = false;
12754 break;
12755 }
12756 // Recursively compare arrays (susceptible to call stack limits).
12757 if (seen) {
12758 if (!arraySome(other, function(othValue, othIndex) {
12759 if (!cacheHas(seen, othIndex) &&
12760 (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
12761 return seen.push(othIndex);
12762 }
12763 })) {
12764 result = false;
12765 break;
12766 }
12767 } else if (!(
12768 arrValue === othValue ||
12769 equalFunc(arrValue, othValue, bitmask, customizer, stack)
12770 )) {
12771 result = false;
12772 break;
12773 }
12774 }
12775 stack['delete'](array);
12776 stack['delete'](other);
12777 return result;
12778 }
12779
12780 /**
12781 * A specialized version of `baseIsEqualDeep` for comparing objects of
12782 * the same `toStringTag`.
12783 *
12784 * **Note:** This function only supports comparing values with tags of
12785 * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
12786 *
12787 * @private
12788 * @param {Object} object The object to compare.
12789 * @param {Object} other The other object to compare.
12790 * @param {string} tag The `toStringTag` of the objects to compare.
12791 * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
12792 * @param {Function} customizer The function to customize comparisons.
12793 * @param {Function} equalFunc The function to determine equivalents of values.
12794 * @param {Object} stack Tracks traversed `object` and `other` objects.
12795 * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
12796 */
12797 function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
12798 switch (tag) {
12799 case dataViewTag:
12800 if ((object.byteLength != other.byteLength) ||
12801 (object.byteOffset != other.byteOffset)) {
12802 return false;
12803 }
12804 object = object.buffer;
12805 other = other.buffer;
12806
12807 case arrayBufferTag:
12808 if ((object.byteLength != other.byteLength) ||
12809 !equalFunc(new Uint8Array(object), new Uint8Array(other))) {
12810 return false;
12811 }
12812 return true;
12813
12814 case boolTag:
12815 case dateTag:
12816 case numberTag:
12817 // Coerce booleans to `1` or `0` and dates to milliseconds.
12818 // Invalid dates are coerced to `NaN`.
12819 return eq(+object, +other);
12820
12821 case errorTag:
12822 return object.name == other.name && object.message == other.message;
12823
12824 case regexpTag:
12825 case stringTag:
12826 // Coerce regexes to strings and treat strings, primitives and objects,
12827 // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
12828 // for more details.
12829 return object == (other + '');
12830
12831 case mapTag:
12832 var convert = mapToArray;
12833
12834 case setTag:
12835 var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
12836 convert || (convert = setToArray);
12837
12838 if (object.size != other.size && !isPartial) {
12839 return false;
12840 }
12841 // Assume cyclic values are equal.
12842 var stacked = stack.get(object);
12843 if (stacked) {
12844 return stacked == other;
12845 }
12846 bitmask |= COMPARE_UNORDERED_FLAG;
12847
12848 // Recursively compare objects (susceptible to call stack limits).
12849 stack.set(object, other);
12850 var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
12851 stack['delete'](object);
12852 return result;
12853
12854 case symbolTag:
12855 if (symbolValueOf) {
12856 return symbolValueOf.call(object) == symbolValueOf.call(other);
12857 }
12858 }
12859 return false;
12860 }
12861
12862 /**
12863 * A specialized version of `baseIsEqualDeep` for objects with support for
12864 * partial deep comparisons.
12865 *
12866 * @private
12867 * @param {Object} object The object to compare.
12868 * @param {Object} other The other object to compare.
12869 * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
12870 * @param {Function} customizer The function to customize comparisons.
12871 * @param {Function} equalFunc The function to determine equivalents of values.
12872 * @param {Object} stack Tracks traversed `object` and `other` objects.
12873 * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
12874 */
12875 function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
12876 var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
12877 objProps = getAllKeys(object),
12878 objLength = objProps.length,
12879 othProps = getAllKeys(other),
12880 othLength = othProps.length;
12881
12882 if (objLength != othLength && !isPartial) {
12883 return false;
12884 }
12885 var index = objLength;
12886 while (index--) {
12887 var key = objProps[index];
12888 if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
12889 return false;
12890 }
12891 }
12892 // Assume cyclic values are equal.
12893 var stacked = stack.get(object);
12894 if (stacked && stack.get(other)) {
12895 return stacked == other;
12896 }
12897 var result = true;
12898 stack.set(object, other);
12899 stack.set(other, object);
12900
12901 var skipCtor = isPartial;
12902 while (++index < objLength) {
12903 key = objProps[index];
12904 var objValue = object[key],
12905 othValue = other[key];
12906
12907 if (customizer) {
12908 var compared = isPartial
12909 ? customizer(othValue, objValue, key, other, object, stack)
12910 : customizer(objValue, othValue, key, object, other, stack);
12911 }
12912 // Recursively compare objects (susceptible to call stack limits).
12913 if (!(compared === undefined
12914 ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))
12915 : compared
12916 )) {
12917 result = false;
12918 break;
12919 }
12920 skipCtor || (skipCtor = key == 'constructor');
12921 }
12922 if (result && !skipCtor) {
12923 var objCtor = object.constructor,
12924 othCtor = other.constructor;
12925
12926 // Non `Object` object instances with different constructors are not equal.
12927 if (objCtor != othCtor &&
12928 ('constructor' in object && 'constructor' in other) &&
12929 !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
12930 typeof othCtor == 'function' && othCtor instanceof othCtor)) {
12931 result = false;
12932 }
12933 }
12934 stack['delete'](object);
12935 stack['delete'](other);
12936 return result;
12937 }
12938
12939 /**
12940 * A specialized version of `baseRest` which flattens the rest array.
12941 *
12942 * @private
12943 * @param {Function} func The function to apply a rest parameter to.
12944 * @returns {Function} Returns the new function.
12945 */
12946 function flatRest(func) {
12947 return setToString(overRest(func, undefined, flatten), func + '');
12948 }
12949
12950 /**
12951 * Creates an array of own enumerable property names and symbols of `object`.
12952 *
12953 * @private
12954 * @param {Object} object The object to query.
12955 * @returns {Array} Returns the array of property names and symbols.
12956 */
12957 function getAllKeys(object) {
12958 return baseGetAllKeys(object, keys, getSymbols);
12959 }
12960
12961 /**
12962 * Creates an array of own and inherited enumerable property names and
12963 * symbols of `object`.
12964 *
12965 * @private
12966 * @param {Object} object The object to query.
12967 * @returns {Array} Returns the array of property names and symbols.
12968 */
12969 function getAllKeysIn(object) {
12970 return baseGetAllKeys(object, keysIn, getSymbolsIn);
12971 }
12972
12973 /**
12974 * Gets metadata for `func`.
12975 *
12976 * @private
12977 * @param {Function} func The function to query.
12978 * @returns {*} Returns the metadata for `func`.
12979 */
12980 var getData = !metaMap ? noop : function(func) {
12981 return metaMap.get(func);
12982 };
12983
12984 /**
12985 * Gets the name of `func`.
12986 *
12987 * @private
12988 * @param {Function} func The function to query.
12989 * @returns {string} Returns the function name.
12990 */
12991 function getFuncName(func) {
12992 var result = (func.name + ''),
12993 array = realNames[result],
12994 length = hasOwnProperty.call(realNames, result) ? array.length : 0;
12995
12996 while (length--) {
12997 var data = array[length],
12998 otherFunc = data.func;
12999 if (otherFunc == null || otherFunc == func) {
13000 return data.name;
13001 }
13002 }
13003 return result;
13004 }
13005
13006 /**
13007 * Gets the argument placeholder value for `func`.
13008 *
13009 * @private
13010 * @param {Function} func The function to inspect.
13011 * @returns {*} Returns the placeholder value.
13012 */
13013 function getHolder(func) {
13014 var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func;
13015 return object.placeholder;
13016 }
13017
13018 /**
13019 * Gets the appropriate "iteratee" function. If `_.iteratee` is customized,
13020 * this function returns the custom method, otherwise it returns `baseIteratee`.
13021 * If arguments are provided, the chosen function is invoked with them and
13022 * its result is returned.
13023 *
13024 * @private
13025 * @param {*} [value] The value to convert to an iteratee.
13026 * @param {number} [arity] The arity of the created iteratee.
13027 * @returns {Function} Returns the chosen function or its result.
13028 */
13029 function getIteratee() {
13030 var result = lodash.iteratee || iteratee;
13031 result = result === iteratee ? baseIteratee : result;
13032 return arguments.length ? result(arguments[0], arguments[1]) : result;
13033 }
13034
13035 /**
13036 * Gets the data for `map`.
13037 *
13038 * @private
13039 * @param {Object} map The map to query.
13040 * @param {string} key The reference key.
13041 * @returns {*} Returns the map data.
13042 */
13043 function getMapData(map, key) {
13044 var data = map.__data__;
13045 return isKeyable(key)
13046 ? data[typeof key == 'string' ? 'string' : 'hash']
13047 : data.map;
13048 }
13049
13050 /**
13051 * Gets the property names, values, and compare flags of `object`.
13052 *
13053 * @private
13054 * @param {Object} object The object to query.
13055 * @returns {Array} Returns the match data of `object`.
13056 */
13057 function getMatchData(object) {
13058 var result = keys(object),
13059 length = result.length;
13060
13061 while (length--) {
13062 var key = result[length],
13063 value = object[key];
13064
13065 result[length] = [key, value, isStrictComparable(value)];
13066 }
13067 return result;
13068 }
13069
13070 /**
13071 * Gets the native function at `key` of `object`.
13072 *
13073 * @private
13074 * @param {Object} object The object to query.
13075 * @param {string} key The key of the method to get.
13076 * @returns {*} Returns the function if it's native, else `undefined`.
13077 */
13078 function getNative(object, key) {
13079 var value = getValue(object, key);
13080 return baseIsNative(value) ? value : undefined;
13081 }
13082
13083 /**
13084 * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
13085 *
13086 * @private
13087 * @param {*} value The value to query.
13088 * @returns {string} Returns the raw `toStringTag`.
13089 */
13090 function getRawTag(value) {
13091 var isOwn = hasOwnProperty.call(value, symToStringTag),
13092 tag = value[symToStringTag];
13093
13094 try {
13095 value[symToStringTag] = undefined;
13096 var unmasked = true;
13097 } catch (e) {}
13098
13099 var result = nativeObjectToString.call(value);
13100 if (unmasked) {
13101 if (isOwn) {
13102 value[symToStringTag] = tag;
13103 } else {
13104 delete value[symToStringTag];
13105 }
13106 }
13107 return result;
13108 }
13109
13110 /**
13111 * Creates an array of the own enumerable symbols of `object`.
13112 *
13113 * @private
13114 * @param {Object} object The object to query.
13115 * @returns {Array} Returns the array of symbols.
13116 */
13117 var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
13118 if (object == null) {
13119 return [];
13120 }
13121 object = Object(object);
13122 return arrayFilter(nativeGetSymbols(object), function(symbol) {
13123 return propertyIsEnumerable.call(object, symbol);
13124 });
13125 };
13126
13127 /**
13128 * Creates an array of the own and inherited enumerable symbols of `object`.
13129 *
13130 * @private
13131 * @param {Object} object The object to query.
13132 * @returns {Array} Returns the array of symbols.
13133 */
13134 var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {
13135 var result = [];
13136 while (object) {
13137 arrayPush(result, getSymbols(object));
13138 object = getPrototype(object);
13139 }
13140 return result;
13141 };
13142
13143 /**
13144 * Gets the `toStringTag` of `value`.
13145 *
13146 * @private
13147 * @param {*} value The value to query.
13148 * @returns {string} Returns the `toStringTag`.
13149 */
13150 var getTag = baseGetTag;
13151
13152 // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
13153 if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
13154 (Map && getTag(new Map) != mapTag) ||
13155 (Promise && getTag(Promise.resolve()) != promiseTag) ||
13156 (Set && getTag(new Set) != setTag) ||
13157 (WeakMap && getTag(new WeakMap) != weakMapTag)) {
13158 getTag = function(value) {
13159 var result = baseGetTag(value),
13160 Ctor = result == objectTag ? value.constructor : undefined,
13161 ctorString = Ctor ? toSource(Ctor) : '';
13162
13163 if (ctorString) {
13164 switch (ctorString) {
13165 case dataViewCtorString: return dataViewTag;
13166 case mapCtorString: return mapTag;
13167 case promiseCtorString: return promiseTag;
13168 case setCtorString: return setTag;
13169 case weakMapCtorString: return weakMapTag;
13170 }
13171 }
13172 return result;
13173 };
13174 }
13175
13176 /**
13177 * Gets the view, applying any `transforms` to the `start` and `end` positions.
13178 *
13179 * @private
13180 * @param {number} start The start of the view.
13181 * @param {number} end The end of the view.
13182 * @param {Array} transforms The transformations to apply to the view.
13183 * @returns {Object} Returns an object containing the `start` and `end`
13184 * positions of the view.
13185 */
13186 function getView(start, end, transforms) {
13187 var index = -1,
13188 length = transforms.length;
13189
13190 while (++index < length) {
13191 var data = transforms[index],
13192 size = data.size;
13193
13194 switch (data.type) {
13195 case 'drop': start += size; break;
13196 case 'dropRight': end -= size; break;
13197 case 'take': end = nativeMin(end, start + size); break;
13198 case 'takeRight': start = nativeMax(start, end - size); break;
13199 }
13200 }
13201 return { 'start': start, 'end': end };
13202 }
13203
13204 /**
13205 * Extracts wrapper details from the `source` body comment.
13206 *
13207 * @private
13208 * @param {string} source The source to inspect.
13209 * @returns {Array} Returns the wrapper details.
13210 */
13211 function getWrapDetails(source) {
13212 var match = source.match(reWrapDetails);
13213 return match ? match[1].split(reSplitDetails) : [];
13214 }
13215
13216 /**
13217 * Checks if `path` exists on `object`.
13218 *
13219 * @private
13220 * @param {Object} object The object to query.
13221 * @param {Array|string} path The path to check.
13222 * @param {Function} hasFunc The function to check properties.
13223 * @returns {boolean} Returns `true` if `path` exists, else `false`.
13224 */
13225 function hasPath(object, path, hasFunc) {
13226 path = castPath(path, object);
13227
13228 var index = -1,
13229 length = path.length,
13230 result = false;
13231
13232 while (++index < length) {
13233 var key = toKey(path[index]);
13234 if (!(result = object != null && hasFunc(object, key))) {
13235 break;
13236 }
13237 object = object[key];
13238 }
13239 if (result || ++index != length) {
13240 return result;
13241 }
13242 length = object == null ? 0 : object.length;
13243 return !!length && isLength(length) && isIndex(key, length) &&
13244 (isArray(object) || isArguments(object));
13245 }
13246
13247 /**
13248 * Initializes an array clone.
13249 *
13250 * @private
13251 * @param {Array} array The array to clone.
13252 * @returns {Array} Returns the initialized clone.
13253 */
13254 function initCloneArray(array) {
13255 var length = array.length,
13256 result = array.constructor(length);
13257
13258 // Add properties assigned by `RegExp#exec`.
13259 if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
13260 result.index = array.index;
13261 result.input = array.input;
13262 }
13263 return result;
13264 }
13265
13266 /**
13267 * Initializes an object clone.
13268 *
13269 * @private
13270 * @param {Object} object The object to clone.
13271 * @returns {Object} Returns the initialized clone.
13272 */
13273 function initCloneObject(object) {
13274 return (typeof object.constructor == 'function' && !isPrototype(object))
13275 ? baseCreate(getPrototype(object))
13276 : {};
13277 }
13278
13279 /**
13280 * Initializes an object clone based on its `toStringTag`.
13281 *
13282 * **Note:** This function only supports cloning values with tags of
13283 * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
13284 *
13285 * @private
13286 * @param {Object} object The object to clone.
13287 * @param {string} tag The `toStringTag` of the object to clone.
13288 * @param {Function} cloneFunc The function to clone values.
13289 * @param {boolean} [isDeep] Specify a deep clone.
13290 * @returns {Object} Returns the initialized clone.
13291 */
13292 function initCloneByTag(object, tag, cloneFunc, isDeep) {
13293 var Ctor = object.constructor;
13294 switch (tag) {
13295 case arrayBufferTag:
13296 return cloneArrayBuffer(object);
13297
13298 case boolTag:
13299 case dateTag:
13300 return new Ctor(+object);
13301
13302 case dataViewTag:
13303 return cloneDataView(object, isDeep);
13304
13305 case float32Tag: case float64Tag:
13306 case int8Tag: case int16Tag: case int32Tag:
13307 case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:
13308 return cloneTypedArray(object, isDeep);
13309
13310 case mapTag:
13311 return cloneMap(object, isDeep, cloneFunc);
13312
13313 case numberTag:
13314 case stringTag:
13315 return new Ctor(object);
13316
13317 case regexpTag:
13318 return cloneRegExp(object);
13319
13320 case setTag:
13321 return cloneSet(object, isDeep, cloneFunc);
13322
13323 case symbolTag:
13324 return cloneSymbol(object);
13325 }
13326 }
13327
13328 /**
13329 * Inserts wrapper `details` in a comment at the top of the `source` body.
13330 *
13331 * @private
13332 * @param {string} source The source to modify.
13333 * @returns {Array} details The details to insert.
13334 * @returns {string} Returns the modified source.
13335 */
13336 function insertWrapDetails(source, details) {
13337 var length = details.length;
13338 if (!length) {
13339 return source;
13340 }
13341 var lastIndex = length - 1;
13342 details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex];
13343 details = details.join(length > 2 ? ', ' : ' ');
13344 return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n');
13345 }
13346
13347 /**
13348 * Checks if `value` is a flattenable `arguments` object or array.
13349 *
13350 * @private
13351 * @param {*} value The value to check.
13352 * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
13353 */
13354 function isFlattenable(value) {
13355 return isArray(value) || isArguments(value) ||
13356 !!(spreadableSymbol && value && value[spreadableSymbol]);
13357 }
13358
13359 /**
13360 * Checks if `value` is a valid array-like index.
13361 *
13362 * @private
13363 * @param {*} value The value to check.
13364 * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
13365 * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
13366 */
13367 function isIndex(value, length) {
13368 length = length == null ? MAX_SAFE_INTEGER : length;
13369 return !!length &&
13370 (typeof value == 'number' || reIsUint.test(value)) &&
13371 (value > -1 && value % 1 == 0 && value < length);
13372 }
13373
13374 /**
13375 * Checks if the given arguments are from an iteratee call.
13376 *
13377 * @private
13378 * @param {*} value The potential iteratee value argument.
13379 * @param {*} index The potential iteratee index or key argument.
13380 * @param {*} object The potential iteratee object argument.
13381 * @returns {boolean} Returns `true` if the arguments are from an iteratee call,
13382 * else `false`.
13383 */
13384 function isIterateeCall(value, index, object) {
13385 if (!isObject(object)) {
13386 return false;
13387 }
13388 var type = typeof index;
13389 if (type == 'number'
13390 ? (isArrayLike(object) && isIndex(index, object.length))
13391 : (type == 'string' && index in object)
13392 ) {
13393 return eq(object[index], value);
13394 }
13395 return false;
13396 }
13397
13398 /**
13399 * Checks if `value` is a property name and not a property path.
13400 *
13401 * @private
13402 * @param {*} value The value to check.
13403 * @param {Object} [object] The object to query keys on.
13404 * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
13405 */
13406 function isKey(value, object) {
13407 if (isArray(value)) {
13408 return false;
13409 }
13410 var type = typeof value;
13411 if (type == 'number' || type == 'symbol' || type == 'boolean' ||
13412 value == null || isSymbol(value)) {
13413 return true;
13414 }
13415 return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
13416 (object != null && value in Object(object));
13417 }
13418
13419 /**
13420 * Checks if `value` is suitable for use as unique object key.
13421 *
13422 * @private
13423 * @param {*} value The value to check.
13424 * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
13425 */
13426 function isKeyable(value) {
13427 var type = typeof value;
13428 return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
13429 ? (value !== '__proto__')
13430 : (value === null);
13431 }
13432
13433 /**
13434 * Checks if `func` has a lazy counterpart.
13435 *
13436 * @private
13437 * @param {Function} func The function to check.
13438 * @returns {boolean} Returns `true` if `func` has a lazy counterpart,
13439 * else `false`.
13440 */
13441 function isLaziable(func) {
13442 var funcName = getFuncName(func),
13443 other = lodash[funcName];
13444
13445 if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) {
13446 return false;
13447 }
13448 if (func === other) {
13449 return true;
13450 }
13451 var data = getData(other);
13452 return !!data && func === data[0];
13453 }
13454
13455 /**
13456 * Checks if `func` has its source masked.
13457 *
13458 * @private
13459 * @param {Function} func The function to check.
13460 * @returns {boolean} Returns `true` if `func` is masked, else `false`.
13461 */
13462 function isMasked(func) {
13463 return !!maskSrcKey && (maskSrcKey in func);
13464 }
13465
13466 /**
13467 * Checks if `func` is capable of being masked.
13468 *
13469 * @private
13470 * @param {*} value The value to check.
13471 * @returns {boolean} Returns `true` if `func` is maskable, else `false`.
13472 */
13473 var isMaskable = coreJsData ? isFunction : stubFalse;
13474
13475 /**
13476 * Checks if `value` is likely a prototype object.
13477 *
13478 * @private
13479 * @param {*} value The value to check.
13480 * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
13481 */
13482 function isPrototype(value) {
13483 var Ctor = value && value.constructor,
13484 proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
13485
13486 return value === proto;
13487 }
13488
13489 /**
13490 * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
13491 *
13492 * @private
13493 * @param {*} value The value to check.
13494 * @returns {boolean} Returns `true` if `value` if suitable for strict
13495 * equality comparisons, else `false`.
13496 */
13497 function isStrictComparable(value) {
13498 return value === value && !isObject(value);
13499 }
13500
13501 /**
13502 * A specialized version of `matchesProperty` for source values suitable
13503 * for strict equality comparisons, i.e. `===`.
13504 *
13505 * @private
13506 * @param {string} key The key of the property to get.
13507 * @param {*} srcValue The value to match.
13508 * @returns {Function} Returns the new spec function.
13509 */
13510 function matchesStrictComparable(key, srcValue) {
13511 return function(object) {
13512 if (object == null) {
13513 return false;
13514 }
13515 return object[key] === srcValue &&
13516 (srcValue !== undefined || (key in Object(object)));
13517 };
13518 }
13519
13520 /**
13521 * A specialized version of `_.memoize` which clears the memoized function's
13522 * cache when it exceeds `MAX_MEMOIZE_SIZE`.
13523 *
13524 * @private
13525 * @param {Function} func The function to have its output memoized.
13526 * @returns {Function} Returns the new memoized function.
13527 */
13528 function memoizeCapped(func) {
13529 var result = memoize(func, function(key) {
13530 if (cache.size === MAX_MEMOIZE_SIZE) {
13531 cache.clear();
13532 }
13533 return key;
13534 });
13535
13536 var cache = result.cache;
13537 return result;
13538 }
13539
13540 /**
13541 * Merges the function metadata of `source` into `data`.
13542 *
13543 * Merging metadata reduces the number of wrappers used to invoke a function.
13544 * This is possible because methods like `_.bind`, `_.curry`, and `_.partial`
13545 * may be applied regardless of execution order. Methods like `_.ary` and
13546 * `_.rearg` modify function arguments, making the order in which they are
13547 * executed important, preventing the merging of metadata. However, we make
13548 * an exception for a safe combined case where curried functions have `_.ary`
13549 * and or `_.rearg` applied.
13550 *
13551 * @private
13552 * @param {Array} data The destination metadata.
13553 * @param {Array} source The source metadata.
13554 * @returns {Array} Returns `data`.
13555 */
13556 function mergeData(data, source) {
13557 var bitmask = data[1],
13558 srcBitmask = source[1],
13559 newBitmask = bitmask | srcBitmask,
13560 isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);
13561
13562 var isCombo =
13563 ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) ||
13564 ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) ||
13565 ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG));
13566
13567 // Exit early if metadata can't be merged.
13568 if (!(isCommon || isCombo)) {
13569 return data;
13570 }
13571 // Use source `thisArg` if available.
13572 if (srcBitmask & WRAP_BIND_FLAG) {
13573 data[2] = source[2];
13574 // Set when currying a bound function.
13575 newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;
13576 }
13577 // Compose partial arguments.
13578 var value = source[3];
13579 if (value) {
13580 var partials = data[3];
13581 data[3] = partials ? composeArgs(partials, value, source[4]) : value;
13582 data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];
13583 }
13584 // Compose partial right arguments.
13585 value = source[5];
13586 if (value) {
13587 partials = data[5];
13588 data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;
13589 data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];
13590 }
13591 // Use source `argPos` if available.
13592 value = source[7];
13593 if (value) {
13594 data[7] = value;
13595 }
13596 // Use source `ary` if it's smaller.
13597 if (srcBitmask & WRAP_ARY_FLAG) {
13598 data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);
13599 }
13600 // Use source `arity` if one is not provided.
13601 if (data[9] == null) {
13602 data[9] = source[9];
13603 }
13604 // Use source `func` and merge bitmasks.
13605 data[0] = source[0];
13606 data[1] = newBitmask;
13607
13608 return data;
13609 }
13610
13611 /**
13612 * This function is like
13613 * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
13614 * except that it includes inherited enumerable properties.
13615 *
13616 * @private
13617 * @param {Object} object The object to query.
13618 * @returns {Array} Returns the array of property names.
13619 */
13620 function nativeKeysIn(object) {
13621 var result = [];
13622 if (object != null) {
13623 for (var key in Object(object)) {
13624 result.push(key);
13625 }
13626 }
13627 return result;
13628 }
13629
13630 /**
13631 * Converts `value` to a string using `Object.prototype.toString`.
13632 *
13633 * @private
13634 * @param {*} value The value to convert.
13635 * @returns {string} Returns the converted string.
13636 */
13637 function objectToString(value) {
13638 return nativeObjectToString.call(value);
13639 }
13640
13641 /**
13642 * A specialized version of `baseRest` which transforms the rest array.
13643 *
13644 * @private
13645 * @param {Function} func The function to apply a rest parameter to.
13646 * @param {number} [start=func.length-1] The start position of the rest parameter.
13647 * @param {Function} transform The rest array transform.
13648 * @returns {Function} Returns the new function.
13649 */
13650 function overRest(func, start, transform) {
13651 start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
13652 return function() {
13653 var args = arguments,
13654 index = -1,
13655 length = nativeMax(args.length - start, 0),
13656 array = Array(length);
13657
13658 while (++index < length) {
13659 array[index] = args[start + index];
13660 }
13661 index = -1;
13662 var otherArgs = Array(start + 1);
13663 while (++index < start) {
13664 otherArgs[index] = args[index];
13665 }
13666 otherArgs[start] = transform(array);
13667 return apply(func, this, otherArgs);
13668 };
13669 }
13670
13671 /**
13672 * Gets the parent value at `path` of `object`.
13673 *
13674 * @private
13675 * @param {Object} object The object to query.
13676 * @param {Array} path The path to get the parent value of.
13677 * @returns {*} Returns the parent value.
13678 */
13679 function parent(object, path) {
13680 return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));
13681 }
13682
13683 /**
13684 * Reorder `array` according to the specified indexes where the element at
13685 * the first index is assigned as the first element, the element at
13686 * the second index is assigned as the second element, and so on.
13687 *
13688 * @private
13689 * @param {Array} array The array to reorder.
13690 * @param {Array} indexes The arranged array indexes.
13691 * @returns {Array} Returns `array`.
13692 */
13693 function reorder(array, indexes) {
13694 var arrLength = array.length,
13695 length = nativeMin(indexes.length, arrLength),
13696 oldArray = copyArray(array);
13697
13698 while (length--) {
13699 var index = indexes[length];
13700 array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;
13701 }
13702 return array;
13703 }
13704
13705 /**
13706 * Sets metadata for `func`.
13707 *
13708 * **Note:** If this function becomes hot, i.e. is invoked a lot in a short
13709 * period of time, it will trip its breaker and transition to an identity
13710 * function to avoid garbage collection pauses in V8. See
13711 * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070)
13712 * for more details.
13713 *
13714 * @private
13715 * @param {Function} func The function to associate metadata with.
13716 * @param {*} data The metadata.
13717 * @returns {Function} Returns `func`.
13718 */
13719 var setData = shortOut(baseSetData);
13720
13721 /**
13722 * A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout).
13723 *
13724 * @private
13725 * @param {Function} func The function to delay.
13726 * @param {number} wait The number of milliseconds to delay invocation.
13727 * @returns {number|Object} Returns the timer id or timeout object.
13728 */
13729 var setTimeout = ctxSetTimeout || function(func, wait) {
13730 return root.setTimeout(func, wait);
13731 };
13732
13733 /**
13734 * Sets the `toString` method of `func` to return `string`.
13735 *
13736 * @private
13737 * @param {Function} func The function to modify.
13738 * @param {Function} string The `toString` result.
13739 * @returns {Function} Returns `func`.
13740 */
13741 var setToString = shortOut(baseSetToString);
13742
13743 /**
13744 * Sets the `toString` method of `wrapper` to mimic the source of `reference`
13745 * with wrapper details in a comment at the top of the source body.
13746 *
13747 * @private
13748 * @param {Function} wrapper The function to modify.
13749 * @param {Function} reference The reference function.
13750 * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
13751 * @returns {Function} Returns `wrapper`.
13752 */
13753 function setWrapToString(wrapper, reference, bitmask) {
13754 var source = (reference + '');
13755 return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));
13756 }
13757
13758 /**
13759 * Creates a function that'll short out and invoke `identity` instead
13760 * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`
13761 * milliseconds.
13762 *
13763 * @private
13764 * @param {Function} func The function to restrict.
13765 * @returns {Function} Returns the new shortable function.
13766 */
13767 function shortOut(func) {
13768 var count = 0,
13769 lastCalled = 0;
13770
13771 return function() {
13772 var stamp = nativeNow(),
13773 remaining = HOT_SPAN - (stamp - lastCalled);
13774
13775 lastCalled = stamp;
13776 if (remaining > 0) {
13777 if (++count >= HOT_COUNT) {
13778 return arguments[0];
13779 }
13780 } else {
13781 count = 0;
13782 }
13783 return func.apply(undefined, arguments);
13784 };
13785 }
13786
13787 /**
13788 * A specialized version of `_.shuffle` which mutates and sets the size of `array`.
13789 *
13790 * @private
13791 * @param {Array} array The array to shuffle.
13792 * @param {number} [size=array.length] The size of `array`.
13793 * @returns {Array} Returns `array`.
13794 */
13795 function shuffleSelf(array, size) {
13796 var index = -1,
13797 length = array.length,
13798 lastIndex = length - 1;
13799
13800 size = size === undefined ? length : size;
13801 while (++index < size) {
13802 var rand = baseRandom(index, lastIndex),
13803 value = array[rand];
13804
13805 array[rand] = array[index];
13806 array[index] = value;
13807 }
13808 array.length = size;
13809 return array;
13810 }
13811
13812 /**
13813 * Converts `string` to a property path array.
13814 *
13815 * @private
13816 * @param {string} string The string to convert.
13817 * @returns {Array} Returns the property path array.
13818 */
13819 var stringToPath = memoizeCapped(function(string) {
13820 var result = [];
13821 if (reLeadingDot.test(string)) {
13822 result.push('');
13823 }
13824 string.replace(rePropName, function(match, number, quote, string) {
13825 result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
13826 });
13827 return result;
13828 });
13829
13830 /**
13831 * Converts `value` to a string key if it's not a string or symbol.
13832 *
13833 * @private
13834 * @param {*} value The value to inspect.
13835 * @returns {string|symbol} Returns the key.
13836 */
13837 function toKey(value) {
13838 if (typeof value == 'string' || isSymbol(value)) {
13839 return value;
13840 }
13841 var result = (value + '');
13842 return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
13843 }
13844
13845 /**
13846 * Converts `func` to its source code.
13847 *
13848 * @private
13849 * @param {Function} func The function to convert.
13850 * @returns {string} Returns the source code.
13851 */
13852 function toSource(func) {
13853 if (func != null) {
13854 try {
13855 return funcToString.call(func);
13856 } catch (e) {}
13857 try {
13858 return (func + '');
13859 } catch (e) {}
13860 }
13861 return '';
13862 }
13863
13864 /**
13865 * Updates wrapper `details` based on `bitmask` flags.
13866 *
13867 * @private
13868 * @returns {Array} details The details to modify.
13869 * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
13870 * @returns {Array} Returns `details`.
13871 */
13872 function updateWrapDetails(details, bitmask) {
13873 arrayEach(wrapFlags, function(pair) {
13874 var value = '_.' + pair[0];
13875 if ((bitmask & pair[1]) && !arrayIncludes(details, value)) {
13876 details.push(value);
13877 }
13878 });
13879 return details.sort();
13880 }
13881
13882 /**
13883 * Creates a clone of `wrapper`.
13884 *
13885 * @private
13886 * @param {Object} wrapper The wrapper to clone.
13887 * @returns {Object} Returns the cloned wrapper.
13888 */
13889 function wrapperClone(wrapper) {
13890 if (wrapper instanceof LazyWrapper) {
13891 return wrapper.clone();
13892 }
13893 var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);
13894 result.__actions__ = copyArray(wrapper.__actions__);
13895 result.__index__ = wrapper.__index__;
13896 result.__values__ = wrapper.__values__;
13897 return result;
13898 }
13899
13900 /*------------------------------------------------------------------------*/
13901
13902 /**
13903 * Creates an array of elements split into groups the length of `size`.
13904 * If `array` can't be split evenly, the final chunk will be the remaining
13905 * elements.
13906 *
13907 * @static
13908 * @memberOf _
13909 * @since 3.0.0
13910 * @category Array
13911 * @param {Array} array The array to process.
13912 * @param {number} [size=1] The length of each chunk
13913 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
13914 * @returns {Array} Returns the new array of chunks.
13915 * @example
13916 *
13917 * _.chunk(['a', 'b', 'c', 'd'], 2);
13918 * // => [['a', 'b'], ['c', 'd']]
13919 *
13920 * _.chunk(['a', 'b', 'c', 'd'], 3);
13921 * // => [['a', 'b', 'c'], ['d']]
13922 */
13923 function chunk(array, size, guard) {
13924 if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) {
13925 size = 1;
13926 } else {
13927 size = nativeMax(toInteger(size), 0);
13928 }
13929 var length = array == null ? 0 : array.length;
13930 if (!length || size < 1) {
13931 return [];
13932 }
13933 var index = 0,
13934 resIndex = 0,
13935 result = Array(nativeCeil(length / size));
13936
13937 while (index < length) {
13938 result[resIndex++] = baseSlice(array, index, (index += size));
13939 }
13940 return result;
13941 }
13942
13943 /**
13944 * Creates an array with all falsey values removed. The values `false`, `null`,
13945 * `0`, `""`, `undefined`, and `NaN` are falsey.
13946 *
13947 * @static
13948 * @memberOf _
13949 * @since 0.1.0
13950 * @category Array
13951 * @param {Array} array The array to compact.
13952 * @returns {Array} Returns the new array of filtered values.
13953 * @example
13954 *
13955 * _.compact([0, 1, false, 2, '', 3]);
13956 * // => [1, 2, 3]
13957 */
13958 function compact(array) {
13959 var index = -1,
13960 length = array == null ? 0 : array.length,
13961 resIndex = 0,
13962 result = [];
13963
13964 while (++index < length) {
13965 var value = array[index];
13966 if (value) {
13967 result[resIndex++] = value;
13968 }
13969 }
13970 return result;
13971 }
13972
13973 /**
13974 * Creates a new array concatenating `array` with any additional arrays
13975 * and/or values.
13976 *
13977 * @static
13978 * @memberOf _
13979 * @since 4.0.0
13980 * @category Array
13981 * @param {Array} array The array to concatenate.
13982 * @param {...*} [values] The values to concatenate.
13983 * @returns {Array} Returns the new concatenated array.
13984 * @example
13985 *
13986 * var array = [1];
13987 * var other = _.concat(array, 2, [3], [[4]]);
13988 *
13989 * console.log(other);
13990 * // => [1, 2, 3, [4]]
13991 *
13992 * console.log(array);
13993 * // => [1]
13994 */
13995 function concat() {
13996 var length = arguments.length;
13997 if (!length) {
13998 return [];
13999 }
14000 var args = Array(length - 1),
14001 array = arguments[0],
14002 index = length;
14003
14004 while (index--) {
14005 args[index - 1] = arguments[index];
14006 }
14007 return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1));
14008 }
14009
14010 /**
14011 * Creates an array of `array` values not included in the other given arrays
14012 * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
14013 * for equality comparisons. The order and references of result values are
14014 * determined by the first array.
14015 *
14016 * **Note:** Unlike `_.pullAll`, this method returns a new array.
14017 *
14018 * @static
14019 * @memberOf _
14020 * @since 0.1.0
14021 * @category Array
14022 * @param {Array} array The array to inspect.
14023 * @param {...Array} [values] The values to exclude.
14024 * @returns {Array} Returns the new array of filtered values.
14025 * @see _.without, _.xor
14026 * @example
14027 *
14028 * _.difference([2, 1], [2, 3]);
14029 * // => [1]
14030 */
14031 var difference = baseRest(function(array, values) {
14032 return isArrayLikeObject(array)
14033 ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true))
14034 : [];
14035 });
14036
14037 /**
14038 * This method is like `_.difference` except that it accepts `iteratee` which
14039 * is invoked for each element of `array` and `values` to generate the criterion
14040 * by which they're compared. The order and references of result values are
14041 * determined by the first array. The iteratee is invoked with one argument:
14042 * (value).
14043 *
14044 * **Note:** Unlike `_.pullAllBy`, this method returns a new array.
14045 *
14046 * @static
14047 * @memberOf _
14048 * @since 4.0.0
14049 * @category Array
14050 * @param {Array} array The array to inspect.
14051 * @param {...Array} [values] The values to exclude.
14052 * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
14053 * @returns {Array} Returns the new array of filtered values.
14054 * @example
14055 *
14056 * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor);
14057 * // => [1.2]
14058 *
14059 * // The `_.property` iteratee shorthand.
14060 * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x');
14061 * // => [{ 'x': 2 }]
14062 */
14063 var differenceBy = baseRest(function(array, values) {
14064 var iteratee = last(values);
14065 if (isArrayLikeObject(iteratee)) {
14066 iteratee = undefined;
14067 }
14068 return isArrayLikeObject(array)
14069 ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2))
14070 : [];
14071 });
14072
14073 /**
14074 * This method is like `_.difference` except that it accepts `comparator`
14075 * which is invoked to compare elements of `array` to `values`. The order and
14076 * references of result values are determined by the first array. The comparator
14077 * is invoked with two arguments: (arrVal, othVal).
14078 *
14079 * **Note:** Unlike `_.pullAllWith`, this method returns a new array.
14080 *
14081 * @static
14082 * @memberOf _
14083 * @since 4.0.0
14084 * @category Array
14085 * @param {Array} array The array to inspect.
14086 * @param {...Array} [values] The values to exclude.
14087 * @param {Function} [comparator] The comparator invoked per element.
14088 * @returns {Array} Returns the new array of filtered values.
14089 * @example
14090 *
14091 * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
14092 *
14093 * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual);
14094 * // => [{ 'x': 2, 'y': 1 }]
14095 */
14096 var differenceWith = baseRest(function(array, values) {
14097 var comparator = last(values);
14098 if (isArrayLikeObject(comparator)) {
14099 comparator = undefined;
14100 }
14101 return isArrayLikeObject(array)
14102 ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator)
14103 : [];
14104 });
14105
14106 /**
14107 * Creates a slice of `array` with `n` elements dropped from the beginning.
14108 *
14109 * @static
14110 * @memberOf _
14111 * @since 0.5.0
14112 * @category Array
14113 * @param {Array} array The array to query.
14114 * @param {number} [n=1] The number of elements to drop.
14115 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
14116 * @returns {Array} Returns the slice of `array`.
14117 * @example
14118 *
14119 * _.drop([1, 2, 3]);
14120 * // => [2, 3]
14121 *
14122 * _.drop([1, 2, 3], 2);
14123 * // => [3]
14124 *
14125 * _.drop([1, 2, 3], 5);
14126 * // => []
14127 *
14128 * _.drop([1, 2, 3], 0);
14129 * // => [1, 2, 3]
14130 */
14131 function drop(array, n, guard) {
14132 var length = array == null ? 0 : array.length;
14133 if (!length) {
14134 return [];
14135 }
14136 n = (guard || n === undefined) ? 1 : toInteger(n);
14137 return baseSlice(array, n < 0 ? 0 : n, length);
14138 }
14139
14140 /**
14141 * Creates a slice of `array` with `n` elements dropped from the end.
14142 *
14143 * @static
14144 * @memberOf _
14145 * @since 3.0.0
14146 * @category Array
14147 * @param {Array} array The array to query.
14148 * @param {number} [n=1] The number of elements to drop.
14149 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
14150 * @returns {Array} Returns the slice of `array`.
14151 * @example
14152 *
14153 * _.dropRight([1, 2, 3]);
14154 * // => [1, 2]
14155 *
14156 * _.dropRight([1, 2, 3], 2);
14157 * // => [1]
14158 *
14159 * _.dropRight([1, 2, 3], 5);
14160 * // => []
14161 *
14162 * _.dropRight([1, 2, 3], 0);
14163 * // => [1, 2, 3]
14164 */
14165 function dropRight(array, n, guard) {
14166 var length = array == null ? 0 : array.length;
14167 if (!length) {
14168 return [];
14169 }
14170 n = (guard || n === undefined) ? 1 : toInteger(n);
14171 n = length - n;
14172 return baseSlice(array, 0, n < 0 ? 0 : n);
14173 }
14174
14175 /**
14176 * Creates a slice of `array` excluding elements dropped from the end.
14177 * Elements are dropped until `predicate` returns falsey. The predicate is
14178 * invoked with three arguments: (value, index, array).
14179 *
14180 * @static
14181 * @memberOf _
14182 * @since 3.0.0
14183 * @category Array
14184 * @param {Array} array The array to query.
14185 * @param {Function} [predicate=_.identity] The function invoked per iteration.
14186 * @returns {Array} Returns the slice of `array`.
14187 * @example
14188 *
14189 * var users = [
14190 * { 'user': 'barney', 'active': true },
14191 * { 'user': 'fred', 'active': false },
14192 * { 'user': 'pebbles', 'active': false }
14193 * ];
14194 *
14195 * _.dropRightWhile(users, function(o) { return !o.active; });
14196 * // => objects for ['barney']
14197 *
14198 * // The `_.matches` iteratee shorthand.
14199 * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false });
14200 * // => objects for ['barney', 'fred']
14201 *
14202 * // The `_.matchesProperty` iteratee shorthand.
14203 * _.dropRightWhile(users, ['active', false]);
14204 * // => objects for ['barney']
14205 *
14206 * // The `_.property` iteratee shorthand.
14207 * _.dropRightWhile(users, 'active');
14208 * // => objects for ['barney', 'fred', 'pebbles']
14209 */
14210 function dropRightWhile(array, predicate) {
14211 return (array && array.length)
14212 ? baseWhile(array, getIteratee(predicate, 3), true, true)
14213 : [];
14214 }
14215
14216 /**
14217 * Creates a slice of `array` excluding elements dropped from the beginning.
14218 * Elements are dropped until `predicate` returns falsey. The predicate is
14219 * invoked with three arguments: (value, index, array).
14220 *
14221 * @static
14222 * @memberOf _
14223 * @since 3.0.0
14224 * @category Array
14225 * @param {Array} array The array to query.
14226 * @param {Function} [predicate=_.identity] The function invoked per iteration.
14227 * @returns {Array} Returns the slice of `array`.
14228 * @example
14229 *
14230 * var users = [
14231 * { 'user': 'barney', 'active': false },
14232 * { 'user': 'fred', 'active': false },
14233 * { 'user': 'pebbles', 'active': true }
14234 * ];
14235 *
14236 * _.dropWhile(users, function(o) { return !o.active; });
14237 * // => objects for ['pebbles']
14238 *
14239 * // The `_.matches` iteratee shorthand.
14240 * _.dropWhile(users, { 'user': 'barney', 'active': false });
14241 * // => objects for ['fred', 'pebbles']
14242 *
14243 * // The `_.matchesProperty` iteratee shorthand.
14244 * _.dropWhile(users, ['active', false]);
14245 * // => objects for ['pebbles']
14246 *
14247 * // The `_.property` iteratee shorthand.
14248 * _.dropWhile(users, 'active');
14249 * // => objects for ['barney', 'fred', 'pebbles']
14250 */
14251 function dropWhile(array, predicate) {
14252 return (array && array.length)
14253 ? baseWhile(array, getIteratee(predicate, 3), true)
14254 : [];
14255 }
14256
14257 /**
14258 * Fills elements of `array` with `value` from `start` up to, but not
14259 * including, `end`.
14260 *
14261 * **Note:** This method mutates `array`.
14262 *
14263 * @static
14264 * @memberOf _
14265 * @since 3.2.0
14266 * @category Array
14267 * @param {Array} array The array to fill.
14268 * @param {*} value The value to fill `array` with.
14269 * @param {number} [start=0] The start position.
14270 * @param {number} [end=array.length] The end position.
14271 * @returns {Array} Returns `array`.
14272 * @example
14273 *
14274 * var array = [1, 2, 3];
14275 *
14276 * _.fill(array, 'a');
14277 * console.log(array);
14278 * // => ['a', 'a', 'a']
14279 *
14280 * _.fill(Array(3), 2);
14281 * // => [2, 2, 2]
14282 *
14283 * _.fill([4, 6, 8, 10], '*', 1, 3);
14284 * // => [4, '*', '*', 10]
14285 */
14286 function fill(array, value, start, end) {
14287 var length = array == null ? 0 : array.length;
14288 if (!length) {
14289 return [];
14290 }
14291 if (start && typeof start != 'number' && isIterateeCall(array, value, start)) {
14292 start = 0;
14293 end = length;
14294 }
14295 return baseFill(array, value, start, end);
14296 }
14297
14298 /**
14299 * This method is like `_.find` except that it returns the index of the first
14300 * element `predicate` returns truthy for instead of the element itself.
14301 *
14302 * @static
14303 * @memberOf _
14304 * @since 1.1.0
14305 * @category Array
14306 * @param {Array} array The array to inspect.
14307 * @param {Function} [predicate=_.identity] The function invoked per iteration.
14308 * @param {number} [fromIndex=0] The index to search from.
14309 * @returns {number} Returns the index of the found element, else `-1`.
14310 * @example
14311 *
14312 * var users = [
14313 * { 'user': 'barney', 'active': false },
14314 * { 'user': 'fred', 'active': false },
14315 * { 'user': 'pebbles', 'active': true }
14316 * ];
14317 *
14318 * _.findIndex(users, function(o) { return o.user == 'barney'; });
14319 * // => 0
14320 *
14321 * // The `_.matches` iteratee shorthand.
14322 * _.findIndex(users, { 'user': 'fred', 'active': false });
14323 * // => 1
14324 *
14325 * // The `_.matchesProperty` iteratee shorthand.
14326 * _.findIndex(users, ['active', false]);
14327 * // => 0
14328 *
14329 * // The `_.property` iteratee shorthand.
14330 * _.findIndex(users, 'active');
14331 * // => 2
14332 */
14333 function findIndex(array, predicate, fromIndex) {
14334 var length = array == null ? 0 : array.length;
14335 if (!length) {
14336 return -1;
14337 }
14338 var index = fromIndex == null ? 0 : toInteger(fromIndex);
14339 if (index < 0) {
14340 index = nativeMax(length + index, 0);
14341 }
14342 return baseFindIndex(array, getIteratee(predicate, 3), index);
14343 }
14344
14345 /**
14346 * This method is like `_.findIndex` except that it iterates over elements
14347 * of `collection` from right to left.
14348 *
14349 * @static
14350 * @memberOf _
14351 * @since 2.0.0
14352 * @category Array
14353 * @param {Array} array The array to inspect.
14354 * @param {Function} [predicate=_.identity] The function invoked per iteration.
14355 * @param {number} [fromIndex=array.length-1] The index to search from.
14356 * @returns {number} Returns the index of the found element, else `-1`.
14357 * @example
14358 *
14359 * var users = [
14360 * { 'user': 'barney', 'active': true },
14361 * { 'user': 'fred', 'active': false },
14362 * { 'user': 'pebbles', 'active': false }
14363 * ];
14364 *
14365 * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; });
14366 * // => 2
14367 *
14368 * // The `_.matches` iteratee shorthand.
14369 * _.findLastIndex(users, { 'user': 'barney', 'active': true });
14370 * // => 0
14371 *
14372 * // The `_.matchesProperty` iteratee shorthand.
14373 * _.findLastIndex(users, ['active', false]);
14374 * // => 2
14375 *
14376 * // The `_.property` iteratee shorthand.
14377 * _.findLastIndex(users, 'active');
14378 * // => 0
14379 */
14380 function findLastIndex(array, predicate, fromIndex) {
14381 var length = array == null ? 0 : array.length;
14382 if (!length) {
14383 return -1;
14384 }
14385 var index = length - 1;
14386 if (fromIndex !== undefined) {
14387 index = toInteger(fromIndex);
14388 index = fromIndex < 0
14389 ? nativeMax(length + index, 0)
14390 : nativeMin(index, length - 1);
14391 }
14392 return baseFindIndex(array, getIteratee(predicate, 3), index, true);
14393 }
14394
14395 /**
14396 * Flattens `array` a single level deep.
14397 *
14398 * @static
14399 * @memberOf _
14400 * @since 0.1.0
14401 * @category Array
14402 * @param {Array} array The array to flatten.
14403 * @returns {Array} Returns the new flattened array.
14404 * @example
14405 *
14406 * _.flatten([1, [2, [3, [4]], 5]]);
14407 * // => [1, 2, [3, [4]], 5]
14408 */
14409 function flatten(array) {
14410 var length = array == null ? 0 : array.length;
14411 return length ? baseFlatten(array, 1) : [];
14412 }
14413
14414 /**
14415 * Recursively flattens `array`.
14416 *
14417 * @static
14418 * @memberOf _
14419 * @since 3.0.0
14420 * @category Array
14421 * @param {Array} array The array to flatten.
14422 * @returns {Array} Returns the new flattened array.
14423 * @example
14424 *
14425 * _.flattenDeep([1, [2, [3, [4]], 5]]);
14426 * // => [1, 2, 3, 4, 5]
14427 */
14428 function flattenDeep(array) {
14429 var length = array == null ? 0 : array.length;
14430 return length ? baseFlatten(array, INFINITY) : [];
14431 }
14432
14433 /**
14434 * Recursively flatten `array` up to `depth` times.
14435 *
14436 * @static
14437 * @memberOf _
14438 * @since 4.4.0
14439 * @category Array
14440 * @param {Array} array The array to flatten.
14441 * @param {number} [depth=1] The maximum recursion depth.
14442 * @returns {Array} Returns the new flattened array.
14443 * @example
14444 *
14445 * var array = [1, [2, [3, [4]], 5]];
14446 *
14447 * _.flattenDepth(array, 1);
14448 * // => [1, 2, [3, [4]], 5]
14449 *
14450 * _.flattenDepth(array, 2);
14451 * // => [1, 2, 3, [4], 5]
14452 */
14453 function flattenDepth(array, depth) {
14454 var length = array == null ? 0 : array.length;
14455 if (!length) {
14456 return [];
14457 }
14458 depth = depth === undefined ? 1 : toInteger(depth);
14459 return baseFlatten(array, depth);
14460 }
14461
14462 /**
14463 * The inverse of `_.toPairs`; this method returns an object composed
14464 * from key-value `pairs`.
14465 *
14466 * @static
14467 * @memberOf _
14468 * @since 4.0.0
14469 * @category Array
14470 * @param {Array} pairs The key-value pairs.
14471 * @returns {Object} Returns the new object.
14472 * @example
14473 *
14474 * _.fromPairs([['a', 1], ['b', 2]]);
14475 * // => { 'a': 1, 'b': 2 }
14476 */
14477 function fromPairs(pairs) {
14478 var index = -1,
14479 length = pairs == null ? 0 : pairs.length,
14480 result = {};
14481
14482 while (++index < length) {
14483 var pair = pairs[index];
14484 result[pair[0]] = pair[1];
14485 }
14486 return result;
14487 }
14488
14489 /**
14490 * Gets the first element of `array`.
14491 *
14492 * @static
14493 * @memberOf _
14494 * @since 0.1.0
14495 * @alias first
14496 * @category Array
14497 * @param {Array} array The array to query.
14498 * @returns {*} Returns the first element of `array`.
14499 * @example
14500 *
14501 * _.head([1, 2, 3]);
14502 * // => 1
14503 *
14504 * _.head([]);
14505 * // => undefined
14506 */
14507 function head(array) {
14508 return (array && array.length) ? array[0] : undefined;
14509 }
14510
14511 /**
14512 * Gets the index at which the first occurrence of `value` is found in `array`
14513 * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
14514 * for equality comparisons. If `fromIndex` is negative, it's used as the
14515 * offset from the end of `array`.
14516 *
14517 * @static
14518 * @memberOf _
14519 * @since 0.1.0
14520 * @category Array
14521 * @param {Array} array The array to inspect.
14522 * @param {*} value The value to search for.
14523 * @param {number} [fromIndex=0] The index to search from.
14524 * @returns {number} Returns the index of the matched value, else `-1`.
14525 * @example
14526 *
14527 * _.indexOf([1, 2, 1, 2], 2);
14528 * // => 1
14529 *
14530 * // Search from the `fromIndex`.
14531 * _.indexOf([1, 2, 1, 2], 2, 2);
14532 * // => 3
14533 */
14534 function indexOf(array, value, fromIndex) {
14535 var length = array == null ? 0 : array.length;
14536 if (!length) {
14537 return -1;
14538 }
14539 var index = fromIndex == null ? 0 : toInteger(fromIndex);
14540 if (index < 0) {
14541 index = nativeMax(length + index, 0);
14542 }
14543 return baseIndexOf(array, value, index);
14544 }
14545
14546 /**
14547 * Gets all but the last element of `array`.
14548 *
14549 * @static
14550 * @memberOf _
14551 * @since 0.1.0
14552 * @category Array
14553 * @param {Array} array The array to query.
14554 * @returns {Array} Returns the slice of `array`.
14555 * @example
14556 *
14557 * _.initial([1, 2, 3]);
14558 * // => [1, 2]
14559 */
14560 function initial(array) {
14561 var length = array == null ? 0 : array.length;
14562 return length ? baseSlice(array, 0, -1) : [];
14563 }
14564
14565 /**
14566 * Creates an array of unique values that are included in all given arrays
14567 * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
14568 * for equality comparisons. The order and references of result values are
14569 * determined by the first array.
14570 *
14571 * @static
14572 * @memberOf _
14573 * @since 0.1.0
14574 * @category Array
14575 * @param {...Array} [arrays] The arrays to inspect.
14576 * @returns {Array} Returns the new array of intersecting values.
14577 * @example
14578 *
14579 * _.intersection([2, 1], [2, 3]);
14580 * // => [2]
14581 */
14582 var intersection = baseRest(function(arrays) {
14583 var mapped = arrayMap(arrays, castArrayLikeObject);
14584 return (mapped.length && mapped[0] === arrays[0])
14585 ? baseIntersection(mapped)
14586 : [];
14587 });
14588
14589 /**
14590 * This method is like `_.intersection` except that it accepts `iteratee`
14591 * which is invoked for each element of each `arrays` to generate the criterion
14592 * by which they're compared. The order and references of result values are
14593 * determined by the first array. The iteratee is invoked with one argument:
14594 * (value).
14595 *
14596 * @static
14597 * @memberOf _
14598 * @since 4.0.0
14599 * @category Array
14600 * @param {...Array} [arrays] The arrays to inspect.
14601 * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
14602 * @returns {Array} Returns the new array of intersecting values.
14603 * @example
14604 *
14605 * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor);
14606 * // => [2.1]
14607 *
14608 * // The `_.property` iteratee shorthand.
14609 * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
14610 * // => [{ 'x': 1 }]
14611 */
14612 var intersectionBy = baseRest(function(arrays) {
14613 var iteratee = last(arrays),
14614 mapped = arrayMap(arrays, castArrayLikeObject);
14615
14616 if (iteratee === last(mapped)) {
14617 iteratee = undefined;
14618 } else {
14619 mapped.pop();
14620 }
14621 return (mapped.length && mapped[0] === arrays[0])
14622 ? baseIntersection(mapped, getIteratee(iteratee, 2))
14623 : [];
14624 });
14625
14626 /**
14627 * This method is like `_.intersection` except that it accepts `comparator`
14628 * which is invoked to compare elements of `arrays`. The order and references
14629 * of result values are determined by the first array. The comparator is
14630 * invoked with two arguments: (arrVal, othVal).
14631 *
14632 * @static
14633 * @memberOf _
14634 * @since 4.0.0
14635 * @category Array
14636 * @param {...Array} [arrays] The arrays to inspect.
14637 * @param {Function} [comparator] The comparator invoked per element.
14638 * @returns {Array} Returns the new array of intersecting values.
14639 * @example
14640 *
14641 * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
14642 * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
14643 *
14644 * _.intersectionWith(objects, others, _.isEqual);
14645 * // => [{ 'x': 1, 'y': 2 }]
14646 */
14647 var intersectionWith = baseRest(function(arrays) {
14648 var comparator = last(arrays),
14649 mapped = arrayMap(arrays, castArrayLikeObject);
14650
14651 comparator = typeof comparator == 'function' ? comparator : undefined;
14652 if (comparator) {
14653 mapped.pop();
14654 }
14655 return (mapped.length && mapped[0] === arrays[0])
14656 ? baseIntersection(mapped, undefined, comparator)
14657 : [];
14658 });
14659
14660 /**
14661 * Converts all elements in `array` into a string separated by `separator`.
14662 *
14663 * @static
14664 * @memberOf _
14665 * @since 4.0.0
14666 * @category Array
14667 * @param {Array} array The array to convert.
14668 * @param {string} [separator=','] The element separator.
14669 * @returns {string} Returns the joined string.
14670 * @example
14671 *
14672 * _.join(['a', 'b', 'c'], '~');
14673 * // => 'a~b~c'
14674 */
14675 function join(array, separator) {
14676 return array == null ? '' : nativeJoin.call(array, separator);
14677 }
14678
14679 /**
14680 * Gets the last element of `array`.
14681 *
14682 * @static
14683 * @memberOf _
14684 * @since 0.1.0
14685 * @category Array
14686 * @param {Array} array The array to query.
14687 * @returns {*} Returns the last element of `array`.
14688 * @example
14689 *
14690 * _.last([1, 2, 3]);
14691 * // => 3
14692 */
14693 function last(array) {
14694 var length = array == null ? 0 : array.length;
14695 return length ? array[length - 1] : undefined;
14696 }
14697
14698 /**
14699 * This method is like `_.indexOf` except that it iterates over elements of
14700 * `array` from right to left.
14701 *
14702 * @static
14703 * @memberOf _
14704 * @since 0.1.0
14705 * @category Array
14706 * @param {Array} array The array to inspect.
14707 * @param {*} value The value to search for.
14708 * @param {number} [fromIndex=array.length-1] The index to search from.
14709 * @returns {number} Returns the index of the matched value, else `-1`.
14710 * @example
14711 *
14712 * _.lastIndexOf([1, 2, 1, 2], 2);
14713 * // => 3
14714 *
14715 * // Search from the `fromIndex`.
14716 * _.lastIndexOf([1, 2, 1, 2], 2, 2);
14717 * // => 1
14718 */
14719 function lastIndexOf(array, value, fromIndex) {
14720 var length = array == null ? 0 : array.length;
14721 if (!length) {
14722 return -1;
14723 }
14724 var index = length;
14725 if (fromIndex !== undefined) {
14726 index = toInteger(fromIndex);
14727 index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);
14728 }
14729 return value === value
14730 ? strictLastIndexOf(array, value, index)
14731 : baseFindIndex(array, baseIsNaN, index, true);
14732 }
14733
14734 /**
14735 * Gets the element at index `n` of `array`. If `n` is negative, the nth
14736 * element from the end is returned.
14737 *
14738 * @static
14739 * @memberOf _
14740 * @since 4.11.0
14741 * @category Array
14742 * @param {Array} array The array to query.
14743 * @param {number} [n=0] The index of the element to return.
14744 * @returns {*} Returns the nth element of `array`.
14745 * @example
14746 *
14747 * var array = ['a', 'b', 'c', 'd'];
14748 *
14749 * _.nth(array, 1);
14750 * // => 'b'
14751 *
14752 * _.nth(array, -2);
14753 * // => 'c';
14754 */
14755 function nth(array, n) {
14756 return (array && array.length) ? baseNth(array, toInteger(n)) : undefined;
14757 }
14758
14759 /**
14760 * Removes all given values from `array` using
14761 * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
14762 * for equality comparisons.
14763 *
14764 * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove`
14765 * to remove elements from an array by predicate.
14766 *
14767 * @static
14768 * @memberOf _
14769 * @since 2.0.0
14770 * @category Array
14771 * @param {Array} array The array to modify.
14772 * @param {...*} [values] The values to remove.
14773 * @returns {Array} Returns `array`.
14774 * @example
14775 *
14776 * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
14777 *
14778 * _.pull(array, 'a', 'c');
14779 * console.log(array);
14780 * // => ['b', 'b']
14781 */
14782 var pull = baseRest(pullAll);
14783
14784 /**
14785 * This method is like `_.pull` except that it accepts an array of values to remove.
14786 *
14787 * **Note:** Unlike `_.difference`, this method mutates `array`.
14788 *
14789 * @static
14790 * @memberOf _
14791 * @since 4.0.0
14792 * @category Array
14793 * @param {Array} array The array to modify.
14794 * @param {Array} values The values to remove.
14795 * @returns {Array} Returns `array`.
14796 * @example
14797 *
14798 * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
14799 *
14800 * _.pullAll(array, ['a', 'c']);
14801 * console.log(array);
14802 * // => ['b', 'b']
14803 */
14804 function pullAll(array, values) {
14805 return (array && array.length && values && values.length)
14806 ? basePullAll(array, values)
14807 : array;
14808 }
14809
14810 /**
14811 * This method is like `_.pullAll` except that it accepts `iteratee` which is
14812 * invoked for each element of `array` and `values` to generate the criterion
14813 * by which they're compared. The iteratee is invoked with one argument: (value).
14814 *
14815 * **Note:** Unlike `_.differenceBy`, this method mutates `array`.
14816 *
14817 * @static
14818 * @memberOf _
14819 * @since 4.0.0
14820 * @category Array
14821 * @param {Array} array The array to modify.
14822 * @param {Array} values The values to remove.
14823 * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
14824 * @returns {Array} Returns `array`.
14825 * @example
14826 *
14827 * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }];
14828 *
14829 * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x');
14830 * console.log(array);
14831 * // => [{ 'x': 2 }]
14832 */
14833 function pullAllBy(array, values, iteratee) {
14834 return (array && array.length && values && values.length)
14835 ? basePullAll(array, values, getIteratee(iteratee, 2))
14836 : array;
14837 }
14838
14839 /**
14840 * This method is like `_.pullAll` except that it accepts `comparator` which
14841 * is invoked to compare elements of `array` to `values`. The comparator is
14842 * invoked with two arguments: (arrVal, othVal).
14843 *
14844 * **Note:** Unlike `_.differenceWith`, this method mutates `array`.
14845 *
14846 * @static
14847 * @memberOf _
14848 * @since 4.6.0
14849 * @category Array
14850 * @param {Array} array The array to modify.
14851 * @param {Array} values The values to remove.
14852 * @param {Function} [comparator] The comparator invoked per element.
14853 * @returns {Array} Returns `array`.
14854 * @example
14855 *
14856 * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }];
14857 *
14858 * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual);
14859 * console.log(array);
14860 * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }]
14861 */
14862 function pullAllWith(array, values, comparator) {
14863 return (array && array.length && values && values.length)
14864 ? basePullAll(array, values, undefined, comparator)
14865 : array;
14866 }
14867
14868 /**
14869 * Removes elements from `array` corresponding to `indexes` and returns an
14870 * array of removed elements.
14871 *
14872 * **Note:** Unlike `_.at`, this method mutates `array`.
14873 *
14874 * @static
14875 * @memberOf _
14876 * @since 3.0.0
14877 * @category Array
14878 * @param {Array} array The array to modify.
14879 * @param {...(number|number[])} [indexes] The indexes of elements to remove.
14880 * @returns {Array} Returns the new array of removed elements.
14881 * @example
14882 *
14883 * var array = ['a', 'b', 'c', 'd'];
14884 * var pulled = _.pullAt(array, [1, 3]);
14885 *
14886 * console.log(array);
14887 * // => ['a', 'c']
14888 *
14889 * console.log(pulled);
14890 * // => ['b', 'd']
14891 */
14892 var pullAt = flatRest(function(array, indexes) {
14893 var length = array == null ? 0 : array.length,
14894 result = baseAt(array, indexes);
14895
14896 basePullAt(array, arrayMap(indexes, function(index) {
14897 return isIndex(index, length) ? +index : index;
14898 }).sort(compareAscending));
14899
14900 return result;
14901 });
14902
14903 /**
14904 * Removes all elements from `array` that `predicate` returns truthy for
14905 * and returns an array of the removed elements. The predicate is invoked
14906 * with three arguments: (value, index, array).
14907 *
14908 * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull`
14909 * to pull elements from an array by value.
14910 *
14911 * @static
14912 * @memberOf _
14913 * @since 2.0.0
14914 * @category Array
14915 * @param {Array} array The array to modify.
14916 * @param {Function} [predicate=_.identity] The function invoked per iteration.
14917 * @returns {Array} Returns the new array of removed elements.
14918 * @example
14919 *
14920 * var array = [1, 2, 3, 4];
14921 * var evens = _.remove(array, function(n) {
14922 * return n % 2 == 0;
14923 * });
14924 *
14925 * console.log(array);
14926 * // => [1, 3]
14927 *
14928 * console.log(evens);
14929 * // => [2, 4]
14930 */
14931 function remove(array, predicate) {
14932 var result = [];
14933 if (!(array && array.length)) {
14934 return result;
14935 }
14936 var index = -1,
14937 indexes = [],
14938 length = array.length;
14939
14940 predicate = getIteratee(predicate, 3);
14941 while (++index < length) {
14942 var value = array[index];
14943 if (predicate(value, index, array)) {
14944 result.push(value);
14945 indexes.push(index);
14946 }
14947 }
14948 basePullAt(array, indexes);
14949 return result;
14950 }
14951
14952 /**
14953 * Reverses `array` so that the first element becomes the last, the second
14954 * element becomes the second to last, and so on.
14955 *
14956 * **Note:** This method mutates `array` and is based on
14957 * [`Array#reverse`](https://mdn.io/Array/reverse).
14958 *
14959 * @static
14960 * @memberOf _
14961 * @since 4.0.0
14962 * @category Array
14963 * @param {Array} array The array to modify.
14964 * @returns {Array} Returns `array`.
14965 * @example
14966 *
14967 * var array = [1, 2, 3];
14968 *
14969 * _.reverse(array);
14970 * // => [3, 2, 1]
14971 *
14972 * console.log(array);
14973 * // => [3, 2, 1]
14974 */
14975 function reverse(array) {
14976 return array == null ? array : nativeReverse.call(array);
14977 }
14978
14979 /**
14980 * Creates a slice of `array` from `start` up to, but not including, `end`.
14981 *
14982 * **Note:** This method is used instead of
14983 * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are
14984 * returned.
14985 *
14986 * @static
14987 * @memberOf _
14988 * @since 3.0.0
14989 * @category Array
14990 * @param {Array} array The array to slice.
14991 * @param {number} [start=0] The start position.
14992 * @param {number} [end=array.length] The end position.
14993 * @returns {Array} Returns the slice of `array`.
14994 */
14995 function slice(array, start, end) {
14996 var length = array == null ? 0 : array.length;
14997 if (!length) {
14998 return [];
14999 }
15000 if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {
15001 start = 0;
15002 end = length;
15003 }
15004 else {
15005 start = start == null ? 0 : toInteger(start);
15006 end = end === undefined ? length : toInteger(end);
15007 }
15008 return baseSlice(array, start, end);
15009 }
15010
15011 /**
15012 * Uses a binary search to determine the lowest index at which `value`
15013 * should be inserted into `array` in order to maintain its sort order.
15014 *
15015 * @static
15016 * @memberOf _
15017 * @since 0.1.0
15018 * @category Array
15019 * @param {Array} array The sorted array to inspect.
15020 * @param {*} value The value to evaluate.
15021 * @returns {number} Returns the index at which `value` should be inserted
15022 * into `array`.
15023 * @example
15024 *
15025 * _.sortedIndex([30, 50], 40);
15026 * // => 1
15027 */
15028 function sortedIndex(array, value) {
15029 return baseSortedIndex(array, value);
15030 }
15031
15032 /**
15033 * This method is like `_.sortedIndex` except that it accepts `iteratee`
15034 * which is invoked for `value` and each element of `array` to compute their
15035 * sort ranking. The iteratee is invoked with one argument: (value).
15036 *
15037 * @static
15038 * @memberOf _
15039 * @since 4.0.0
15040 * @category Array
15041 * @param {Array} array The sorted array to inspect.
15042 * @param {*} value The value to evaluate.
15043 * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
15044 * @returns {number} Returns the index at which `value` should be inserted
15045 * into `array`.
15046 * @example
15047 *
15048 * var objects = [{ 'x': 4 }, { 'x': 5 }];
15049 *
15050 * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
15051 * // => 0
15052 *
15053 * // The `_.property` iteratee shorthand.
15054 * _.sortedIndexBy(objects, { 'x': 4 }, 'x');
15055 * // => 0
15056 */
15057 function sortedIndexBy(array, value, iteratee) {
15058 return baseSortedIndexBy(array, value, getIteratee(iteratee, 2));
15059 }
15060
15061 /**
15062 * This method is like `_.indexOf` except that it performs a binary
15063 * search on a sorted `array`.
15064 *
15065 * @static
15066 * @memberOf _
15067 * @since 4.0.0
15068 * @category Array
15069 * @param {Array} array The array to inspect.
15070 * @param {*} value The value to search for.
15071 * @returns {number} Returns the index of the matched value, else `-1`.
15072 * @example
15073 *
15074 * _.sortedIndexOf([4, 5, 5, 5, 6], 5);
15075 * // => 1
15076 */
15077 function sortedIndexOf(array, value) {
15078 var length = array == null ? 0 : array.length;
15079 if (length) {
15080 var index = baseSortedIndex(array, value);
15081 if (index < length && eq(array[index], value)) {
15082 return index;
15083 }
15084 }
15085 return -1;
15086 }
15087
15088 /**
15089 * This method is like `_.sortedIndex` except that it returns the highest
15090 * index at which `value` should be inserted into `array` in order to
15091 * maintain its sort order.
15092 *
15093 * @static
15094 * @memberOf _
15095 * @since 3.0.0
15096 * @category Array
15097 * @param {Array} array The sorted array to inspect.
15098 * @param {*} value The value to evaluate.
15099 * @returns {number} Returns the index at which `value` should be inserted
15100 * into `array`.
15101 * @example
15102 *
15103 * _.sortedLastIndex([4, 5, 5, 5, 6], 5);
15104 * // => 4
15105 */
15106 function sortedLastIndex(array, value) {
15107 return baseSortedIndex(array, value, true);
15108 }
15109
15110 /**
15111 * This method is like `_.sortedLastIndex` except that it accepts `iteratee`
15112 * which is invoked for `value` and each element of `array` to compute their
15113 * sort ranking. The iteratee is invoked with one argument: (value).
15114 *
15115 * @static
15116 * @memberOf _
15117 * @since 4.0.0
15118 * @category Array
15119 * @param {Array} array The sorted array to inspect.
15120 * @param {*} value The value to evaluate.
15121 * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
15122 * @returns {number} Returns the index at which `value` should be inserted
15123 * into `array`.
15124 * @example
15125 *
15126 * var objects = [{ 'x': 4 }, { 'x': 5 }];
15127 *
15128 * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
15129 * // => 1
15130 *
15131 * // The `_.property` iteratee shorthand.
15132 * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x');
15133 * // => 1
15134 */
15135 function sortedLastIndexBy(array, value, iteratee) {
15136 return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true);
15137 }
15138
15139 /**
15140 * This method is like `_.lastIndexOf` except that it performs a binary
15141 * search on a sorted `array`.
15142 *
15143 * @static
15144 * @memberOf _
15145 * @since 4.0.0
15146 * @category Array
15147 * @param {Array} array The array to inspect.
15148 * @param {*} value The value to search for.
15149 * @returns {number} Returns the index of the matched value, else `-1`.
15150 * @example
15151 *
15152 * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5);
15153 * // => 3
15154 */
15155 function sortedLastIndexOf(array, value) {
15156 var length = array == null ? 0 : array.length;
15157 if (length) {
15158 var index = baseSortedIndex(array, value, true) - 1;
15159 if (eq(array[index], value)) {
15160 return index;
15161 }
15162 }
15163 return -1;
15164 }
15165
15166 /**
15167 * This method is like `_.uniq` except that it's designed and optimized
15168 * for sorted arrays.
15169 *
15170 * @static
15171 * @memberOf _
15172 * @since 4.0.0
15173 * @category Array
15174 * @param {Array} array The array to inspect.
15175 * @returns {Array} Returns the new duplicate free array.
15176 * @example
15177 *
15178 * _.sortedUniq([1, 1, 2]);
15179 * // => [1, 2]
15180 */
15181 function sortedUniq(array) {
15182 return (array && array.length)
15183 ? baseSortedUniq(array)
15184 : [];
15185 }
15186
15187 /**
15188 * This method is like `_.uniqBy` except that it's designed and optimized
15189 * for sorted arrays.
15190 *
15191 * @static
15192 * @memberOf _
15193 * @since 4.0.0
15194 * @category Array
15195 * @param {Array} array The array to inspect.
15196 * @param {Function} [iteratee] The iteratee invoked per element.
15197 * @returns {Array} Returns the new duplicate free array.
15198 * @example
15199 *
15200 * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor);
15201 * // => [1.1, 2.3]
15202 */
15203 function sortedUniqBy(array, iteratee) {
15204 return (array && array.length)
15205 ? baseSortedUniq(array, getIteratee(iteratee, 2))
15206 : [];
15207 }
15208
15209 /**
15210 * Gets all but the first element of `array`.
15211 *
15212 * @static
15213 * @memberOf _
15214 * @since 4.0.0
15215 * @category Array
15216 * @param {Array} array The array to query.
15217 * @returns {Array} Returns the slice of `array`.
15218 * @example
15219 *
15220 * _.tail([1, 2, 3]);
15221 * // => [2, 3]
15222 */
15223 function tail(array) {
15224 var length = array == null ? 0 : array.length;
15225 return length ? baseSlice(array, 1, length) : [];
15226 }
15227
15228 /**
15229 * Creates a slice of `array` with `n` elements taken from the beginning.
15230 *
15231 * @static
15232 * @memberOf _
15233 * @since 0.1.0
15234 * @category Array
15235 * @param {Array} array The array to query.
15236 * @param {number} [n=1] The number of elements to take.
15237 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
15238 * @returns {Array} Returns the slice of `array`.
15239 * @example
15240 *
15241 * _.take([1, 2, 3]);
15242 * // => [1]
15243 *
15244 * _.take([1, 2, 3], 2);
15245 * // => [1, 2]
15246 *
15247 * _.take([1, 2, 3], 5);
15248 * // => [1, 2, 3]
15249 *
15250 * _.take([1, 2, 3], 0);
15251 * // => []
15252 */
15253 function take(array, n, guard) {
15254 if (!(array && array.length)) {
15255 return [];
15256 }
15257 n = (guard || n === undefined) ? 1 : toInteger(n);
15258 return baseSlice(array, 0, n < 0 ? 0 : n);
15259 }
15260
15261 /**
15262 * Creates a slice of `array` with `n` elements taken from the end.
15263 *
15264 * @static
15265 * @memberOf _
15266 * @since 3.0.0
15267 * @category Array
15268 * @param {Array} array The array to query.
15269 * @param {number} [n=1] The number of elements to take.
15270 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
15271 * @returns {Array} Returns the slice of `array`.
15272 * @example
15273 *
15274 * _.takeRight([1, 2, 3]);
15275 * // => [3]
15276 *
15277 * _.takeRight([1, 2, 3], 2);
15278 * // => [2, 3]
15279 *
15280 * _.takeRight([1, 2, 3], 5);
15281 * // => [1, 2, 3]
15282 *
15283 * _.takeRight([1, 2, 3], 0);
15284 * // => []
15285 */
15286 function takeRight(array, n, guard) {
15287 var length = array == null ? 0 : array.length;
15288 if (!length) {
15289 return [];
15290 }
15291 n = (guard || n === undefined) ? 1 : toInteger(n);
15292 n = length - n;
15293 return baseSlice(array, n < 0 ? 0 : n, length);
15294 }
15295
15296 /**
15297 * Creates a slice of `array` with elements taken from the end. Elements are
15298 * taken until `predicate` returns falsey. The predicate is invoked with
15299 * three arguments: (value, index, array).
15300 *
15301 * @static
15302 * @memberOf _
15303 * @since 3.0.0
15304 * @category Array
15305 * @param {Array} array The array to query.
15306 * @param {Function} [predicate=_.identity] The function invoked per iteration.
15307 * @returns {Array} Returns the slice of `array`.
15308 * @example
15309 *
15310 * var users = [
15311 * { 'user': 'barney', 'active': true },
15312 * { 'user': 'fred', 'active': false },
15313 * { 'user': 'pebbles', 'active': false }
15314 * ];
15315 *
15316 * _.takeRightWhile(users, function(o) { return !o.active; });
15317 * // => objects for ['fred', 'pebbles']
15318 *
15319 * // The `_.matches` iteratee shorthand.
15320 * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false });
15321 * // => objects for ['pebbles']
15322 *
15323 * // The `_.matchesProperty` iteratee shorthand.
15324 * _.takeRightWhile(users, ['active', false]);
15325 * // => objects for ['fred', 'pebbles']
15326 *
15327 * // The `_.property` iteratee shorthand.
15328 * _.takeRightWhile(users, 'active');
15329 * // => []
15330 */
15331 function takeRightWhile(array, predicate) {
15332 return (array && array.length)
15333 ? baseWhile(array, getIteratee(predicate, 3), false, true)
15334 : [];
15335 }
15336
15337 /**
15338 * Creates a slice of `array` with elements taken from the beginning. Elements
15339 * are taken until `predicate` returns falsey. The predicate is invoked with
15340 * three arguments: (value, index, array).
15341 *
15342 * @static
15343 * @memberOf _
15344 * @since 3.0.0
15345 * @category Array
15346 * @param {Array} array The array to query.
15347 * @param {Function} [predicate=_.identity] The function invoked per iteration.
15348 * @returns {Array} Returns the slice of `array`.
15349 * @example
15350 *
15351 * var users = [
15352 * { 'user': 'barney', 'active': false },
15353 * { 'user': 'fred', 'active': false },
15354 * { 'user': 'pebbles', 'active': true }
15355 * ];
15356 *
15357 * _.takeWhile(users, function(o) { return !o.active; });
15358 * // => objects for ['barney', 'fred']
15359 *
15360 * // The `_.matches` iteratee shorthand.
15361 * _.takeWhile(users, { 'user': 'barney', 'active': false });
15362 * // => objects for ['barney']
15363 *
15364 * // The `_.matchesProperty` iteratee shorthand.
15365 * _.takeWhile(users, ['active', false]);
15366 * // => objects for ['barney', 'fred']
15367 *
15368 * // The `_.property` iteratee shorthand.
15369 * _.takeWhile(users, 'active');
15370 * // => []
15371 */
15372 function takeWhile(array, predicate) {
15373 return (array && array.length)
15374 ? baseWhile(array, getIteratee(predicate, 3))
15375 : [];
15376 }
15377
15378 /**
15379 * Creates an array of unique values, in order, from all given arrays using
15380 * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
15381 * for equality comparisons.
15382 *
15383 * @static
15384 * @memberOf _
15385 * @since 0.1.0
15386 * @category Array
15387 * @param {...Array} [arrays] The arrays to inspect.
15388 * @returns {Array} Returns the new array of combined values.
15389 * @example
15390 *
15391 * _.union([2], [1, 2]);
15392 * // => [2, 1]
15393 */
15394 var union = baseRest(function(arrays) {
15395 return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));
15396 });
15397
15398 /**
15399 * This method is like `_.union` except that it accepts `iteratee` which is
15400 * invoked for each element of each `arrays` to generate the criterion by
15401 * which uniqueness is computed. Result values are chosen from the first
15402 * array in which the value occurs. The iteratee is invoked with one argument:
15403 * (value).
15404 *
15405 * @static
15406 * @memberOf _
15407 * @since 4.0.0
15408 * @category Array
15409 * @param {...Array} [arrays] The arrays to inspect.
15410 * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
15411 * @returns {Array} Returns the new array of combined values.
15412 * @example
15413 *
15414 * _.unionBy([2.1], [1.2, 2.3], Math.floor);
15415 * // => [2.1, 1.2]
15416 *
15417 * // The `_.property` iteratee shorthand.
15418 * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
15419 * // => [{ 'x': 1 }, { 'x': 2 }]
15420 */
15421 var unionBy = baseRest(function(arrays) {
15422 var iteratee = last(arrays);
15423 if (isArrayLikeObject(iteratee)) {
15424 iteratee = undefined;
15425 }
15426 return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2));
15427 });
15428
15429 /**
15430 * This method is like `_.union` except that it accepts `comparator` which
15431 * is invoked to compare elements of `arrays`. Result values are chosen from
15432 * the first array in which the value occurs. The comparator is invoked
15433 * with two arguments: (arrVal, othVal).
15434 *
15435 * @static
15436 * @memberOf _
15437 * @since 4.0.0
15438 * @category Array
15439 * @param {...Array} [arrays] The arrays to inspect.
15440 * @param {Function} [comparator] The comparator invoked per element.
15441 * @returns {Array} Returns the new array of combined values.
15442 * @example
15443 *
15444 * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
15445 * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
15446 *
15447 * _.unionWith(objects, others, _.isEqual);
15448 * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
15449 */
15450 var unionWith = baseRest(function(arrays) {
15451 var comparator = last(arrays);
15452 comparator = typeof comparator == 'function' ? comparator : undefined;
15453 return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator);
15454 });
15455
15456 /**
15457 * Creates a duplicate-free version of an array, using
15458 * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
15459 * for equality comparisons, in which only the first occurrence of each element
15460 * is kept. The order of result values is determined by the order they occur
15461 * in the array.
15462 *
15463 * @static
15464 * @memberOf _
15465 * @since 0.1.0
15466 * @category Array
15467 * @param {Array} array The array to inspect.
15468 * @returns {Array} Returns the new duplicate free array.
15469 * @example
15470 *
15471 * _.uniq([2, 1, 2]);
15472 * // => [2, 1]
15473 */
15474 function uniq(array) {
15475 return (array && array.length) ? baseUniq(array) : [];
15476 }
15477
15478 /**
15479 * This method is like `_.uniq` except that it accepts `iteratee` which is
15480 * invoked for each element in `array` to generate the criterion by which
15481 * uniqueness is computed. The order of result values is determined by the
15482 * order they occur in the array. The iteratee is invoked with one argument:
15483 * (value).
15484 *
15485 * @static
15486 * @memberOf _
15487 * @since 4.0.0
15488 * @category Array
15489 * @param {Array} array The array to inspect.
15490 * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
15491 * @returns {Array} Returns the new duplicate free array.
15492 * @example
15493 *
15494 * _.uniqBy([2.1, 1.2, 2.3], Math.floor);
15495 * // => [2.1, 1.2]
15496 *
15497 * // The `_.property` iteratee shorthand.
15498 * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');
15499 * // => [{ 'x': 1 }, { 'x': 2 }]
15500 */
15501 function uniqBy(array, iteratee) {
15502 return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : [];
15503 }
15504
15505 /**
15506 * This method is like `_.uniq` except that it accepts `comparator` which
15507 * is invoked to compare elements of `array`. The order of result values is
15508 * determined by the order they occur in the array.The comparator is invoked
15509 * with two arguments: (arrVal, othVal).
15510 *
15511 * @static
15512 * @memberOf _
15513 * @since 4.0.0
15514 * @category Array
15515 * @param {Array} array The array to inspect.
15516 * @param {Function} [comparator] The comparator invoked per element.
15517 * @returns {Array} Returns the new duplicate free array.
15518 * @example
15519 *
15520 * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }];
15521 *
15522 * _.uniqWith(objects, _.isEqual);
15523 * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]
15524 */
15525 function uniqWith(array, comparator) {
15526 comparator = typeof comparator == 'function' ? comparator : undefined;
15527 return (array && array.length) ? baseUniq(array, undefined, comparator) : [];
15528 }
15529
15530 /**
15531 * This method is like `_.zip` except that it accepts an array of grouped
15532 * elements and creates an array regrouping the elements to their pre-zip
15533 * configuration.
15534 *
15535 * @static
15536 * @memberOf _
15537 * @since 1.2.0
15538 * @category Array
15539 * @param {Array} array The array of grouped elements to process.
15540 * @returns {Array} Returns the new array of regrouped elements.
15541 * @example
15542 *
15543 * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]);
15544 * // => [['a', 1, true], ['b', 2, false]]
15545 *
15546 * _.unzip(zipped);
15547 * // => [['a', 'b'], [1, 2], [true, false]]
15548 */
15549 function unzip(array) {
15550 if (!(array && array.length)) {
15551 return [];
15552 }
15553 var length = 0;
15554 array = arrayFilter(array, function(group) {
15555 if (isArrayLikeObject(group)) {
15556 length = nativeMax(group.length, length);
15557 return true;
15558 }
15559 });
15560 return baseTimes(length, function(index) {
15561 return arrayMap(array, baseProperty(index));
15562 });
15563 }
15564
15565 /**
15566 * This method is like `_.unzip` except that it accepts `iteratee` to specify
15567 * how regrouped values should be combined. The iteratee is invoked with the
15568 * elements of each group: (...group).
15569 *
15570 * @static
15571 * @memberOf _
15572 * @since 3.8.0
15573 * @category Array
15574 * @param {Array} array The array of grouped elements to process.
15575 * @param {Function} [iteratee=_.identity] The function to combine
15576 * regrouped values.
15577 * @returns {Array} Returns the new array of regrouped elements.
15578 * @example
15579 *
15580 * var zipped = _.zip([1, 2], [10, 20], [100, 200]);
15581 * // => [[1, 10, 100], [2, 20, 200]]
15582 *
15583 * _.unzipWith(zipped, _.add);
15584 * // => [3, 30, 300]
15585 */
15586 function unzipWith(array, iteratee) {
15587 if (!(array && array.length)) {
15588 return [];
15589 }
15590 var result = unzip(array);
15591 if (iteratee == null) {
15592 return result;
15593 }
15594 return arrayMap(result, function(group) {
15595 return apply(iteratee, undefined, group);
15596 });
15597 }
15598
15599 /**
15600 * Creates an array excluding all given values using
15601 * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
15602 * for equality comparisons.
15603 *
15604 * **Note:** Unlike `_.pull`, this method returns a new array.
15605 *
15606 * @static
15607 * @memberOf _
15608 * @since 0.1.0
15609 * @category Array
15610 * @param {Array} array The array to inspect.
15611 * @param {...*} [values] The values to exclude.
15612 * @returns {Array} Returns the new array of filtered values.
15613 * @see _.difference, _.xor
15614 * @example
15615 *
15616 * _.without([2, 1, 2, 3], 1, 2);
15617 * // => [3]
15618 */
15619 var without = baseRest(function(array, values) {
15620 return isArrayLikeObject(array)
15621 ? baseDifference(array, values)
15622 : [];
15623 });
15624
15625 /**
15626 * Creates an array of unique values that is the
15627 * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)
15628 * of the given arrays. The order of result values is determined by the order
15629 * they occur in the arrays.
15630 *
15631 * @static
15632 * @memberOf _
15633 * @since 2.4.0
15634 * @category Array
15635 * @param {...Array} [arrays] The arrays to inspect.
15636 * @returns {Array} Returns the new array of filtered values.
15637 * @see _.difference, _.without
15638 * @example
15639 *
15640 * _.xor([2, 1], [2, 3]);
15641 * // => [1, 3]
15642 */
15643 var xor = baseRest(function(arrays) {
15644 return baseXor(arrayFilter(arrays, isArrayLikeObject));
15645 });
15646
15647 /**
15648 * This method is like `_.xor` except that it accepts `iteratee` which is
15649 * invoked for each element of each `arrays` to generate the criterion by
15650 * which by which they're compared. The order of result values is determined
15651 * by the order they occur in the arrays. The iteratee is invoked with one
15652 * argument: (value).
15653 *
15654 * @static
15655 * @memberOf _
15656 * @since 4.0.0
15657 * @category Array
15658 * @param {...Array} [arrays] The arrays to inspect.
15659 * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
15660 * @returns {Array} Returns the new array of filtered values.
15661 * @example
15662 *
15663 * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor);
15664 * // => [1.2, 3.4]
15665 *
15666 * // The `_.property` iteratee shorthand.
15667 * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
15668 * // => [{ 'x': 2 }]
15669 */
15670 var xorBy = baseRest(function(arrays) {
15671 var iteratee = last(arrays);
15672 if (isArrayLikeObject(iteratee)) {
15673 iteratee = undefined;
15674 }
15675 return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2));
15676 });
15677
15678 /**
15679 * This method is like `_.xor` except that it accepts `comparator` which is
15680 * invoked to compare elements of `arrays`. The order of result values is
15681 * determined by the order they occur in the arrays. The comparator is invoked
15682 * with two arguments: (arrVal, othVal).
15683 *
15684 * @static
15685 * @memberOf _
15686 * @since 4.0.0
15687 * @category Array
15688 * @param {...Array} [arrays] The arrays to inspect.
15689 * @param {Function} [comparator] The comparator invoked per element.
15690 * @returns {Array} Returns the new array of filtered values.
15691 * @example
15692 *
15693 * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
15694 * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
15695 *
15696 * _.xorWith(objects, others, _.isEqual);
15697 * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
15698 */
15699 var xorWith = baseRest(function(arrays) {
15700 var comparator = last(arrays);
15701 comparator = typeof comparator == 'function' ? comparator : undefined;
15702 return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator);
15703 });
15704
15705 /**
15706 * Creates an array of grouped elements, the first of which contains the
15707 * first elements of the given arrays, the second of which contains the
15708 * second elements of the given arrays, and so on.
15709 *
15710 * @static
15711 * @memberOf _
15712 * @since 0.1.0
15713 * @category Array
15714 * @param {...Array} [arrays] The arrays to process.
15715 * @returns {Array} Returns the new array of grouped elements.
15716 * @example
15717 *
15718 * _.zip(['a', 'b'], [1, 2], [true, false]);
15719 * // => [['a', 1, true], ['b', 2, false]]
15720 */
15721 var zip = baseRest(unzip);
15722
15723 /**
15724 * This method is like `_.fromPairs` except that it accepts two arrays,
15725 * one of property identifiers and one of corresponding values.
15726 *
15727 * @static
15728 * @memberOf _
15729 * @since 0.4.0
15730 * @category Array
15731 * @param {Array} [props=[]] The property identifiers.
15732 * @param {Array} [values=[]] The property values.
15733 * @returns {Object} Returns the new object.
15734 * @example
15735 *
15736 * _.zipObject(['a', 'b'], [1, 2]);
15737 * // => { 'a': 1, 'b': 2 }
15738 */
15739 function zipObject(props, values) {
15740 return baseZipObject(props || [], values || [], assignValue);
15741 }
15742
15743 /**
15744 * This method is like `_.zipObject` except that it supports property paths.
15745 *
15746 * @static
15747 * @memberOf _
15748 * @since 4.1.0
15749 * @category Array
15750 * @param {Array} [props=[]] The property identifiers.
15751 * @param {Array} [values=[]] The property values.
15752 * @returns {Object} Returns the new object.
15753 * @example
15754 *
15755 * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]);
15756 * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } }
15757 */
15758 function zipObjectDeep(props, values) {
15759 return baseZipObject(props || [], values || [], baseSet);
15760 }
15761
15762 /**
15763 * This method is like `_.zip` except that it accepts `iteratee` to specify
15764 * how grouped values should be combined. The iteratee is invoked with the
15765 * elements of each group: (...group).
15766 *
15767 * @static
15768 * @memberOf _
15769 * @since 3.8.0
15770 * @category Array
15771 * @param {...Array} [arrays] The arrays to process.
15772 * @param {Function} [iteratee=_.identity] The function to combine
15773 * grouped values.
15774 * @returns {Array} Returns the new array of grouped elements.
15775 * @example
15776 *
15777 * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) {
15778 * return a + b + c;
15779 * });
15780 * // => [111, 222]
15781 */
15782 var zipWith = baseRest(function(arrays) {
15783 var length = arrays.length,
15784 iteratee = length > 1 ? arrays[length - 1] : undefined;
15785
15786 iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined;
15787 return unzipWith(arrays, iteratee);
15788 });
15789
15790 /*------------------------------------------------------------------------*/
15791
15792 /**
15793 * Creates a `lodash` wrapper instance that wraps `value` with explicit method
15794 * chain sequences enabled. The result of such sequences must be unwrapped
15795 * with `_#value`.
15796 *
15797 * @static
15798 * @memberOf _
15799 * @since 1.3.0
15800 * @category Seq
15801 * @param {*} value The value to wrap.
15802 * @returns {Object} Returns the new `lodash` wrapper instance.
15803 * @example
15804 *
15805 * var users = [
15806 * { 'user': 'barney', 'age': 36 },
15807 * { 'user': 'fred', 'age': 40 },
15808 * { 'user': 'pebbles', 'age': 1 }
15809 * ];
15810 *
15811 * var youngest = _
15812 * .chain(users)
15813 * .sortBy('age')
15814 * .map(function(o) {
15815 * return o.user + ' is ' + o.age;
15816 * })
15817 * .head()
15818 * .value();
15819 * // => 'pebbles is 1'
15820 */
15821 function chain(value) {
15822 var result = lodash(value);
15823 result.__chain__ = true;
15824 return result;
15825 }
15826
15827 /**
15828 * This method invokes `interceptor` and returns `value`. The interceptor
15829 * is invoked with one argument; (value). The purpose of this method is to
15830 * "tap into" a method chain sequence in order to modify intermediate results.
15831 *
15832 * @static
15833 * @memberOf _
15834 * @since 0.1.0
15835 * @category Seq
15836 * @param {*} value The value to provide to `interceptor`.
15837 * @param {Function} interceptor The function to invoke.
15838 * @returns {*} Returns `value`.
15839 * @example
15840 *
15841 * _([1, 2, 3])
15842 * .tap(function(array) {
15843 * // Mutate input array.
15844 * array.pop();
15845 * })
15846 * .reverse()
15847 * .value();
15848 * // => [2, 1]
15849 */
15850 function tap(value, interceptor) {
15851 interceptor(value);
15852 return value;
15853 }
15854
15855 /**
15856 * This method is like `_.tap` except that it returns the result of `interceptor`.
15857 * The purpose of this method is to "pass thru" values replacing intermediate
15858 * results in a method chain sequence.
15859 *
15860 * @static
15861 * @memberOf _
15862 * @since 3.0.0
15863 * @category Seq
15864 * @param {*} value The value to provide to `interceptor`.
15865 * @param {Function} interceptor The function to invoke.
15866 * @returns {*} Returns the result of `interceptor`.
15867 * @example
15868 *
15869 * _(' abc ')
15870 * .chain()
15871 * .trim()
15872 * .thru(function(value) {
15873 * return [value];
15874 * })
15875 * .value();
15876 * // => ['abc']
15877 */
15878 function thru(value, interceptor) {
15879 return interceptor(value);
15880 }
15881
15882 /**
15883 * This method is the wrapper version of `_.at`.
15884 *
15885 * @name at
15886 * @memberOf _
15887 * @since 1.0.0
15888 * @category Seq
15889 * @param {...(string|string[])} [paths] The property paths to pick.
15890 * @returns {Object} Returns the new `lodash` wrapper instance.
15891 * @example
15892 *
15893 * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
15894 *
15895 * _(object).at(['a[0].b.c', 'a[1]']).value();
15896 * // => [3, 4]
15897 */
15898 var wrapperAt = flatRest(function(paths) {
15899 var length = paths.length,
15900 start = length ? paths[0] : 0,
15901 value = this.__wrapped__,
15902 interceptor = function(object) { return baseAt(object, paths); };
15903
15904 if (length > 1 || this.__actions__.length ||
15905 !(value instanceof LazyWrapper) || !isIndex(start)) {
15906 return this.thru(interceptor);
15907 }
15908 value = value.slice(start, +start + (length ? 1 : 0));
15909 value.__actions__.push({
15910 'func': thru,
15911 'args': [interceptor],
15912 'thisArg': undefined
15913 });
15914 return new LodashWrapper(value, this.__chain__).thru(function(array) {
15915 if (length && !array.length) {
15916 array.push(undefined);
15917 }
15918 return array;
15919 });
15920 });
15921
15922 /**
15923 * Creates a `lodash` wrapper instance with explicit method chain sequences enabled.
15924 *
15925 * @name chain
15926 * @memberOf _
15927 * @since 0.1.0
15928 * @category Seq
15929 * @returns {Object} Returns the new `lodash` wrapper instance.
15930 * @example
15931 *
15932 * var users = [
15933 * { 'user': 'barney', 'age': 36 },
15934 * { 'user': 'fred', 'age': 40 }
15935 * ];
15936 *
15937 * // A sequence without explicit chaining.
15938 * _(users).head();
15939 * // => { 'user': 'barney', 'age': 36 }
15940 *
15941 * // A sequence with explicit chaining.
15942 * _(users)
15943 * .chain()
15944 * .head()
15945 * .pick('user')
15946 * .value();
15947 * // => { 'user': 'barney' }
15948 */
15949 function wrapperChain() {
15950 return chain(this);
15951 }
15952
15953 /**
15954 * Executes the chain sequence and returns the wrapped result.
15955 *
15956 * @name commit
15957 * @memberOf _
15958 * @since 3.2.0
15959 * @category Seq
15960 * @returns {Object} Returns the new `lodash` wrapper instance.
15961 * @example
15962 *
15963 * var array = [1, 2];
15964 * var wrapped = _(array).push(3);
15965 *
15966 * console.log(array);
15967 * // => [1, 2]
15968 *
15969 * wrapped = wrapped.commit();
15970 * console.log(array);
15971 * // => [1, 2, 3]
15972 *
15973 * wrapped.last();
15974 * // => 3
15975 *
15976 * console.log(array);
15977 * // => [1, 2, 3]
15978 */
15979 function wrapperCommit() {
15980 return new LodashWrapper(this.value(), this.__chain__);
15981 }
15982
15983 /**
15984 * Gets the next value on a wrapped object following the
15985 * [iterator protocol](https://mdn.io/iteration_protocols#iterator).
15986 *
15987 * @name next
15988 * @memberOf _
15989 * @since 4.0.0
15990 * @category Seq
15991 * @returns {Object} Returns the next iterator value.
15992 * @example
15993 *
15994 * var wrapped = _([1, 2]);
15995 *
15996 * wrapped.next();
15997 * // => { 'done': false, 'value': 1 }
15998 *
15999 * wrapped.next();
16000 * // => { 'done': false, 'value': 2 }
16001 *
16002 * wrapped.next();
16003 * // => { 'done': true, 'value': undefined }
16004 */
16005 function wrapperNext() {
16006 if (this.__values__ === undefined) {
16007 this.__values__ = toArray(this.value());
16008 }
16009 var done = this.__index__ >= this.__values__.length,
16010 value = done ? undefined : this.__values__[this.__index__++];
16011
16012 return { 'done': done, 'value': value };
16013 }
16014
16015 /**
16016 * Enables the wrapper to be iterable.
16017 *
16018 * @name Symbol.iterator
16019 * @memberOf _
16020 * @since 4.0.0
16021 * @category Seq
16022 * @returns {Object} Returns the wrapper object.
16023 * @example
16024 *
16025 * var wrapped = _([1, 2]);
16026 *
16027 * wrapped[Symbol.iterator]() === wrapped;
16028 * // => true
16029 *
16030 * Array.from(wrapped);
16031 * // => [1, 2]
16032 */
16033 function wrapperToIterator() {
16034 return this;
16035 }
16036
16037 /**
16038 * Creates a clone of the chain sequence planting `value` as the wrapped value.
16039 *
16040 * @name plant
16041 * @memberOf _
16042 * @since 3.2.0
16043 * @category Seq
16044 * @param {*} value The value to plant.
16045 * @returns {Object} Returns the new `lodash` wrapper instance.
16046 * @example
16047 *
16048 * function square(n) {
16049 * return n * n;
16050 * }
16051 *
16052 * var wrapped = _([1, 2]).map(square);
16053 * var other = wrapped.plant([3, 4]);
16054 *
16055 * other.value();
16056 * // => [9, 16]
16057 *
16058 * wrapped.value();
16059 * // => [1, 4]
16060 */
16061 function wrapperPlant(value) {
16062 var result,
16063 parent = this;
16064
16065 while (parent instanceof baseLodash) {
16066 var clone = wrapperClone(parent);
16067 clone.__index__ = 0;
16068 clone.__values__ = undefined;
16069 if (result) {
16070 previous.__wrapped__ = clone;
16071 } else {
16072 result = clone;
16073 }
16074 var previous = clone;
16075 parent = parent.__wrapped__;
16076 }
16077 previous.__wrapped__ = value;
16078 return result;
16079 }
16080
16081 /**
16082 * This method is the wrapper version of `_.reverse`.
16083 *
16084 * **Note:** This method mutates the wrapped array.
16085 *
16086 * @name reverse
16087 * @memberOf _
16088 * @since 0.1.0
16089 * @category Seq
16090 * @returns {Object} Returns the new `lodash` wrapper instance.
16091 * @example
16092 *
16093 * var array = [1, 2, 3];
16094 *
16095 * _(array).reverse().value()
16096 * // => [3, 2, 1]
16097 *
16098 * console.log(array);
16099 * // => [3, 2, 1]
16100 */
16101 function wrapperReverse() {
16102 var value = this.__wrapped__;
16103 if (value instanceof LazyWrapper) {
16104 var wrapped = value;
16105 if (this.__actions__.length) {
16106 wrapped = new LazyWrapper(this);
16107 }
16108 wrapped = wrapped.reverse();
16109 wrapped.__actions__.push({
16110 'func': thru,
16111 'args': [reverse],
16112 'thisArg': undefined
16113 });
16114 return new LodashWrapper(wrapped, this.__chain__);
16115 }
16116 return this.thru(reverse);
16117 }
16118
16119 /**
16120 * Executes the chain sequence to resolve the unwrapped value.
16121 *
16122 * @name value
16123 * @memberOf _
16124 * @since 0.1.0
16125 * @alias toJSON, valueOf
16126 * @category Seq
16127 * @returns {*} Returns the resolved unwrapped value.
16128 * @example
16129 *
16130 * _([1, 2, 3]).value();
16131 * // => [1, 2, 3]
16132 */
16133 function wrapperValue() {
16134 return baseWrapperValue(this.__wrapped__, this.__actions__);
16135 }
16136
16137 /*------------------------------------------------------------------------*/
16138
16139 /**
16140 * Creates an object composed of keys generated from the results of running
16141 * each element of `collection` thru `iteratee`. The corresponding value of
16142 * each key is the number of times the key was returned by `iteratee`. The
16143 * iteratee is invoked with one argument: (value).
16144 *
16145 * @static
16146 * @memberOf _
16147 * @since 0.5.0
16148 * @category Collection
16149 * @param {Array|Object} collection The collection to iterate over.
16150 * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
16151 * @returns {Object} Returns the composed aggregate object.
16152 * @example
16153 *
16154 * _.countBy([6.1, 4.2, 6.3], Math.floor);
16155 * // => { '4': 1, '6': 2 }
16156 *
16157 * // The `_.property` iteratee shorthand.
16158 * _.countBy(['one', 'two', 'three'], 'length');
16159 * // => { '3': 2, '5': 1 }
16160 */
16161 var countBy = createAggregator(function(result, value, key) {
16162 if (hasOwnProperty.call(result, key)) {
16163 ++result[key];
16164 } else {
16165 baseAssignValue(result, key, 1);
16166 }
16167 });
16168
16169 /**
16170 * Checks if `predicate` returns truthy for **all** elements of `collection`.
16171 * Iteration is stopped once `predicate` returns falsey. The predicate is
16172 * invoked with three arguments: (value, index|key, collection).
16173 *
16174 * **Note:** This method returns `true` for
16175 * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because
16176 * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of
16177 * elements of empty collections.
16178 *
16179 * @static
16180 * @memberOf _
16181 * @since 0.1.0
16182 * @category Collection
16183 * @param {Array|Object} collection The collection to iterate over.
16184 * @param {Function} [predicate=_.identity] The function invoked per iteration.
16185 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
16186 * @returns {boolean} Returns `true` if all elements pass the predicate check,
16187 * else `false`.
16188 * @example
16189 *
16190 * _.every([true, 1, null, 'yes'], Boolean);
16191 * // => false
16192 *
16193 * var users = [
16194 * { 'user': 'barney', 'age': 36, 'active': false },
16195 * { 'user': 'fred', 'age': 40, 'active': false }
16196 * ];
16197 *
16198 * // The `_.matches` iteratee shorthand.
16199 * _.every(users, { 'user': 'barney', 'active': false });
16200 * // => false
16201 *
16202 * // The `_.matchesProperty` iteratee shorthand.
16203 * _.every(users, ['active', false]);
16204 * // => true
16205 *
16206 * // The `_.property` iteratee shorthand.
16207 * _.every(users, 'active');
16208 * // => false
16209 */
16210 function every(collection, predicate, guard) {
16211 var func = isArray(collection) ? arrayEvery : baseEvery;
16212 if (guard && isIterateeCall(collection, predicate, guard)) {
16213 predicate = undefined;
16214 }
16215 return func(collection, getIteratee(predicate, 3));
16216 }
16217
16218 /**
16219 * Iterates over elements of `collection`, returning an array of all elements
16220 * `predicate` returns truthy for. The predicate is invoked with three
16221 * arguments: (value, index|key, collection).
16222 *
16223 * **Note:** Unlike `_.remove`, this method returns a new array.
16224 *
16225 * @static
16226 * @memberOf _
16227 * @since 0.1.0
16228 * @category Collection
16229 * @param {Array|Object} collection The collection to iterate over.
16230 * @param {Function} [predicate=_.identity] The function invoked per iteration.
16231 * @returns {Array} Returns the new filtered array.
16232 * @see _.reject
16233 * @example
16234 *
16235 * var users = [
16236 * { 'user': 'barney', 'age': 36, 'active': true },
16237 * { 'user': 'fred', 'age': 40, 'active': false }
16238 * ];
16239 *
16240 * _.filter(users, function(o) { return !o.active; });
16241 * // => objects for ['fred']
16242 *
16243 * // The `_.matches` iteratee shorthand.
16244 * _.filter(users, { 'age': 36, 'active': true });
16245 * // => objects for ['barney']
16246 *
16247 * // The `_.matchesProperty` iteratee shorthand.
16248 * _.filter(users, ['active', false]);
16249 * // => objects for ['fred']
16250 *
16251 * // The `_.property` iteratee shorthand.
16252 * _.filter(users, 'active');
16253 * // => objects for ['barney']
16254 */
16255 function filter(collection, predicate) {
16256 var func = isArray(collection) ? arrayFilter : baseFilter;
16257 return func(collection, getIteratee(predicate, 3));
16258 }
16259
16260 /**
16261 * Iterates over elements of `collection`, returning the first element
16262 * `predicate` returns truthy for. The predicate is invoked with three
16263 * arguments: (value, index|key, collection).
16264 *
16265 * @static
16266 * @memberOf _
16267 * @since 0.1.0
16268 * @category Collection
16269 * @param {Array|Object} collection The collection to inspect.
16270 * @param {Function} [predicate=_.identity] The function invoked per iteration.
16271 * @param {number} [fromIndex=0] The index to search from.
16272 * @returns {*} Returns the matched element, else `undefined`.
16273 * @example
16274 *
16275 * var users = [
16276 * { 'user': 'barney', 'age': 36, 'active': true },
16277 * { 'user': 'fred', 'age': 40, 'active': false },
16278 * { 'user': 'pebbles', 'age': 1, 'active': true }
16279 * ];
16280 *
16281 * _.find(users, function(o) { return o.age < 40; });
16282 * // => object for 'barney'
16283 *
16284 * // The `_.matches` iteratee shorthand.
16285 * _.find(users, { 'age': 1, 'active': true });
16286 * // => object for 'pebbles'
16287 *
16288 * // The `_.matchesProperty` iteratee shorthand.
16289 * _.find(users, ['active', false]);
16290 * // => object for 'fred'
16291 *
16292 * // The `_.property` iteratee shorthand.
16293 * _.find(users, 'active');
16294 * // => object for 'barney'
16295 */
16296 var find = createFind(findIndex);
16297
16298 /**
16299 * This method is like `_.find` except that it iterates over elements of
16300 * `collection` from right to left.
16301 *
16302 * @static
16303 * @memberOf _
16304 * @since 2.0.0
16305 * @category Collection
16306 * @param {Array|Object} collection The collection to inspect.
16307 * @param {Function} [predicate=_.identity] The function invoked per iteration.
16308 * @param {number} [fromIndex=collection.length-1] The index to search from.
16309 * @returns {*} Returns the matched element, else `undefined`.
16310 * @example
16311 *
16312 * _.findLast([1, 2, 3, 4], function(n) {
16313 * return n % 2 == 1;
16314 * });
16315 * // => 3
16316 */
16317 var findLast = createFind(findLastIndex);
16318
16319 /**
16320 * Creates a flattened array of values by running each element in `collection`
16321 * thru `iteratee` and flattening the mapped results. The iteratee is invoked
16322 * with three arguments: (value, index|key, collection).
16323 *
16324 * @static
16325 * @memberOf _
16326 * @since 4.0.0
16327 * @category Collection
16328 * @param {Array|Object} collection The collection to iterate over.
16329 * @param {Function} [iteratee=_.identity] The function invoked per iteration.
16330 * @returns {Array} Returns the new flattened array.
16331 * @example
16332 *
16333 * function duplicate(n) {
16334 * return [n, n];
16335 * }
16336 *
16337 * _.flatMap([1, 2], duplicate);
16338 * // => [1, 1, 2, 2]
16339 */
16340 function flatMap(collection, iteratee) {
16341 return baseFlatten(map(collection, iteratee), 1);
16342 }
16343
16344 /**
16345 * This method is like `_.flatMap` except that it recursively flattens the
16346 * mapped results.
16347 *
16348 * @static
16349 * @memberOf _
16350 * @since 4.7.0
16351 * @category Collection
16352 * @param {Array|Object} collection The collection to iterate over.
16353 * @param {Function} [iteratee=_.identity] The function invoked per iteration.
16354 * @returns {Array} Returns the new flattened array.
16355 * @example
16356 *
16357 * function duplicate(n) {
16358 * return [[[n, n]]];
16359 * }
16360 *
16361 * _.flatMapDeep([1, 2], duplicate);
16362 * // => [1, 1, 2, 2]
16363 */
16364 function flatMapDeep(collection, iteratee) {
16365 return baseFlatten(map(collection, iteratee), INFINITY);
16366 }
16367
16368 /**
16369 * This method is like `_.flatMap` except that it recursively flattens the
16370 * mapped results up to `depth` times.
16371 *
16372 * @static
16373 * @memberOf _
16374 * @since 4.7.0
16375 * @category Collection
16376 * @param {Array|Object} collection The collection to iterate over.
16377 * @param {Function} [iteratee=_.identity] The function invoked per iteration.
16378 * @param {number} [depth=1] The maximum recursion depth.
16379 * @returns {Array} Returns the new flattened array.
16380 * @example
16381 *
16382 * function duplicate(n) {
16383 * return [[[n, n]]];
16384 * }
16385 *
16386 * _.flatMapDepth([1, 2], duplicate, 2);
16387 * // => [[1, 1], [2, 2]]
16388 */
16389 function flatMapDepth(collection, iteratee, depth) {
16390 depth = depth === undefined ? 1 : toInteger(depth);
16391 return baseFlatten(map(collection, iteratee), depth);
16392 }
16393
16394 /**
16395 * Iterates over elements of `collection` and invokes `iteratee` for each element.
16396 * The iteratee is invoked with three arguments: (value, index|key, collection).
16397 * Iteratee functions may exit iteration early by explicitly returning `false`.
16398 *
16399 * **Note:** As with other "Collections" methods, objects with a "length"
16400 * property are iterated like arrays. To avoid this behavior use `_.forIn`
16401 * or `_.forOwn` for object iteration.
16402 *
16403 * @static
16404 * @memberOf _
16405 * @since 0.1.0
16406 * @alias each
16407 * @category Collection
16408 * @param {Array|Object} collection The collection to iterate over.
16409 * @param {Function} [iteratee=_.identity] The function invoked per iteration.
16410 * @returns {Array|Object} Returns `collection`.
16411 * @see _.forEachRight
16412 * @example
16413 *
16414 * _.forEach([1, 2], function(value) {
16415 * console.log(value);
16416 * });
16417 * // => Logs `1` then `2`.
16418 *
16419 * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {
16420 * console.log(key);
16421 * });
16422 * // => Logs 'a' then 'b' (iteration order is not guaranteed).
16423 */
16424 function forEach(collection, iteratee) {
16425 var func = isArray(collection) ? arrayEach : baseEach;
16426 return func(collection, getIteratee(iteratee, 3));
16427 }
16428
16429 /**
16430 * This method is like `_.forEach` except that it iterates over elements of
16431 * `collection` from right to left.
16432 *
16433 * @static
16434 * @memberOf _
16435 * @since 2.0.0
16436 * @alias eachRight
16437 * @category Collection
16438 * @param {Array|Object} collection The collection to iterate over.
16439 * @param {Function} [iteratee=_.identity] The function invoked per iteration.
16440 * @returns {Array|Object} Returns `collection`.
16441 * @see _.forEach
16442 * @example
16443 *
16444 * _.forEachRight([1, 2], function(value) {
16445 * console.log(value);
16446 * });
16447 * // => Logs `2` then `1`.
16448 */
16449 function forEachRight(collection, iteratee) {
16450 var func = isArray(collection) ? arrayEachRight : baseEachRight;
16451 return func(collection, getIteratee(iteratee, 3));
16452 }
16453
16454 /**
16455 * Creates an object composed of keys generated from the results of running
16456 * each element of `collection` thru `iteratee`. The order of grouped values
16457 * is determined by the order they occur in `collection`. The corresponding
16458 * value of each key is an array of elements responsible for generating the
16459 * key. The iteratee is invoked with one argument: (value).
16460 *
16461 * @static
16462 * @memberOf _
16463 * @since 0.1.0
16464 * @category Collection
16465 * @param {Array|Object} collection The collection to iterate over.
16466 * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
16467 * @returns {Object} Returns the composed aggregate object.
16468 * @example
16469 *
16470 * _.groupBy([6.1, 4.2, 6.3], Math.floor);
16471 * // => { '4': [4.2], '6': [6.1, 6.3] }
16472 *
16473 * // The `_.property` iteratee shorthand.
16474 * _.groupBy(['one', 'two', 'three'], 'length');
16475 * // => { '3': ['one', 'two'], '5': ['three'] }
16476 */
16477 var groupBy = createAggregator(function(result, value, key) {
16478 if (hasOwnProperty.call(result, key)) {
16479 result[key].push(value);
16480 } else {
16481 baseAssignValue(result, key, [value]);
16482 }
16483 });
16484
16485 /**
16486 * Checks if `value` is in `collection`. If `collection` is a string, it's
16487 * checked for a substring of `value`, otherwise
16488 * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
16489 * is used for equality comparisons. If `fromIndex` is negative, it's used as
16490 * the offset from the end of `collection`.
16491 *
16492 * @static
16493 * @memberOf _
16494 * @since 0.1.0
16495 * @category Collection
16496 * @param {Array|Object|string} collection The collection to inspect.
16497 * @param {*} value The value to search for.
16498 * @param {number} [fromIndex=0] The index to search from.
16499 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
16500 * @returns {boolean} Returns `true` if `value` is found, else `false`.
16501 * @example
16502 *
16503 * _.includes([1, 2, 3], 1);
16504 * // => true
16505 *
16506 * _.includes([1, 2, 3], 1, 2);
16507 * // => false
16508 *
16509 * _.includes({ 'a': 1, 'b': 2 }, 1);
16510 * // => true
16511 *
16512 * _.includes('abcd', 'bc');
16513 * // => true
16514 */
16515 function includes(collection, value, fromIndex, guard) {
16516 collection = isArrayLike(collection) ? collection : values(collection);
16517 fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0;
16518
16519 var length = collection.length;
16520 if (fromIndex < 0) {
16521 fromIndex = nativeMax(length + fromIndex, 0);
16522 }
16523 return isString(collection)
16524 ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1)
16525 : (!!length && baseIndexOf(collection, value, fromIndex) > -1);
16526 }
16527
16528 /**
16529 * Invokes the method at `path` of each element in `collection`, returning
16530 * an array of the results of each invoked method. Any additional arguments
16531 * are provided to each invoked method. If `path` is a function, it's invoked
16532 * for, and `this` bound to, each element in `collection`.
16533 *
16534 * @static
16535 * @memberOf _
16536 * @since 4.0.0
16537 * @category Collection
16538 * @param {Array|Object} collection The collection to iterate over.
16539 * @param {Array|Function|string} path The path of the method to invoke or
16540 * the function invoked per iteration.
16541 * @param {...*} [args] The arguments to invoke each method with.
16542 * @returns {Array} Returns the array of results.
16543 * @example
16544 *
16545 * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort');
16546 * // => [[1, 5, 7], [1, 2, 3]]
16547 *
16548 * _.invokeMap([123, 456], String.prototype.split, '');
16549 * // => [['1', '2', '3'], ['4', '5', '6']]
16550 */
16551 var invokeMap = baseRest(function(collection, path, args) {
16552 var index = -1,
16553 isFunc = typeof path == 'function',
16554 result = isArrayLike(collection) ? Array(collection.length) : [];
16555
16556 baseEach(collection, function(value) {
16557 result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args);
16558 });
16559 return result;
16560 });
16561
16562 /**
16563 * Creates an object composed of keys generated from the results of running
16564 * each element of `collection` thru `iteratee`. The corresponding value of
16565 * each key is the last element responsible for generating the key. The
16566 * iteratee is invoked with one argument: (value).
16567 *
16568 * @static
16569 * @memberOf _
16570 * @since 4.0.0
16571 * @category Collection
16572 * @param {Array|Object} collection The collection to iterate over.
16573 * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
16574 * @returns {Object} Returns the composed aggregate object.
16575 * @example
16576 *
16577 * var array = [
16578 * { 'dir': 'left', 'code': 97 },
16579 * { 'dir': 'right', 'code': 100 }
16580 * ];
16581 *
16582 * _.keyBy(array, function(o) {
16583 * return String.fromCharCode(o.code);
16584 * });
16585 * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
16586 *
16587 * _.keyBy(array, 'dir');
16588 * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }
16589 */
16590 var keyBy = createAggregator(function(result, value, key) {
16591 baseAssignValue(result, key, value);
16592 });
16593
16594 /**
16595 * Creates an array of values by running each element in `collection` thru
16596 * `iteratee`. The iteratee is invoked with three arguments:
16597 * (value, index|key, collection).
16598 *
16599 * Many lodash methods are guarded to work as iteratees for methods like
16600 * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
16601 *
16602 * The guarded methods are:
16603 * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,
16604 * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,
16605 * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,
16606 * `template`, `trim`, `trimEnd`, `trimStart`, and `words`
16607 *
16608 * @static
16609 * @memberOf _
16610 * @since 0.1.0
16611 * @category Collection
16612 * @param {Array|Object} collection The collection to iterate over.
16613 * @param {Function} [iteratee=_.identity] The function invoked per iteration.
16614 * @returns {Array} Returns the new mapped array.
16615 * @example
16616 *
16617 * function square(n) {
16618 * return n * n;
16619 * }
16620 *
16621 * _.map([4, 8], square);
16622 * // => [16, 64]
16623 *
16624 * _.map({ 'a': 4, 'b': 8 }, square);
16625 * // => [16, 64] (iteration order is not guaranteed)
16626 *
16627 * var users = [
16628 * { 'user': 'barney' },
16629 * { 'user': 'fred' }
16630 * ];
16631 *
16632 * // The `_.property` iteratee shorthand.
16633 * _.map(users, 'user');
16634 * // => ['barney', 'fred']
16635 */
16636 function map(collection, iteratee) {
16637 var func = isArray(collection) ? arrayMap : baseMap;
16638 return func(collection, getIteratee(iteratee, 3));
16639 }
16640
16641 /**
16642 * This method is like `_.sortBy` except that it allows specifying the sort
16643 * orders of the iteratees to sort by. If `orders` is unspecified, all values
16644 * are sorted in ascending order. Otherwise, specify an order of "desc" for
16645 * descending or "asc" for ascending sort order of corresponding values.
16646 *
16647 * @static
16648 * @memberOf _
16649 * @since 4.0.0
16650 * @category Collection
16651 * @param {Array|Object} collection The collection to iterate over.
16652 * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]]
16653 * The iteratees to sort by.
16654 * @param {string[]} [orders] The sort orders of `iteratees`.
16655 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
16656 * @returns {Array} Returns the new sorted array.
16657 * @example
16658 *
16659 * var users = [
16660 * { 'user': 'fred', 'age': 48 },
16661 * { 'user': 'barney', 'age': 34 },
16662 * { 'user': 'fred', 'age': 40 },
16663 * { 'user': 'barney', 'age': 36 }
16664 * ];
16665 *
16666 * // Sort by `user` in ascending order and by `age` in descending order.
16667 * _.orderBy(users, ['user', 'age'], ['asc', 'desc']);
16668 * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
16669 */
16670 function orderBy(collection, iteratees, orders, guard) {
16671 if (collection == null) {
16672 return [];
16673 }
16674 if (!isArray(iteratees)) {
16675 iteratees = iteratees == null ? [] : [iteratees];
16676 }
16677 orders = guard ? undefined : orders;
16678 if (!isArray(orders)) {
16679 orders = orders == null ? [] : [orders];
16680 }
16681 return baseOrderBy(collection, iteratees, orders);
16682 }
16683
16684 /**
16685 * Creates an array of elements split into two groups, the first of which
16686 * contains elements `predicate` returns truthy for, the second of which
16687 * contains elements `predicate` returns falsey for. The predicate is
16688 * invoked with one argument: (value).
16689 *
16690 * @static
16691 * @memberOf _
16692 * @since 3.0.0
16693 * @category Collection
16694 * @param {Array|Object} collection The collection to iterate over.
16695 * @param {Function} [predicate=_.identity] The function invoked per iteration.
16696 * @returns {Array} Returns the array of grouped elements.
16697 * @example
16698 *
16699 * var users = [
16700 * { 'user': 'barney', 'age': 36, 'active': false },
16701 * { 'user': 'fred', 'age': 40, 'active': true },
16702 * { 'user': 'pebbles', 'age': 1, 'active': false }
16703 * ];
16704 *
16705 * _.partition(users, function(o) { return o.active; });
16706 * // => objects for [['fred'], ['barney', 'pebbles']]
16707 *
16708 * // The `_.matches` iteratee shorthand.
16709 * _.partition(users, { 'age': 1, 'active': false });
16710 * // => objects for [['pebbles'], ['barney', 'fred']]
16711 *
16712 * // The `_.matchesProperty` iteratee shorthand.
16713 * _.partition(users, ['active', false]);
16714 * // => objects for [['barney', 'pebbles'], ['fred']]
16715 *
16716 * // The `_.property` iteratee shorthand.
16717 * _.partition(users, 'active');
16718 * // => objects for [['fred'], ['barney', 'pebbles']]
16719 */
16720 var partition = createAggregator(function(result, value, key) {
16721 result[key ? 0 : 1].push(value);
16722 }, function() { return [[], []]; });
16723
16724 /**
16725 * Reduces `collection` to a value which is the accumulated result of running
16726 * each element in `collection` thru `iteratee`, where each successive
16727 * invocation is supplied the return value of the previous. If `accumulator`
16728 * is not given, the first element of `collection` is used as the initial
16729 * value. The iteratee is invoked with four arguments:
16730 * (accumulator, value, index|key, collection).
16731 *
16732 * Many lodash methods are guarded to work as iteratees for methods like
16733 * `_.reduce`, `_.reduceRight`, and `_.transform`.
16734 *
16735 * The guarded methods are:
16736 * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,
16737 * and `sortBy`
16738 *
16739 * @static
16740 * @memberOf _
16741 * @since 0.1.0
16742 * @category Collection
16743 * @param {Array|Object} collection The collection to iterate over.
16744 * @param {Function} [iteratee=_.identity] The function invoked per iteration.
16745 * @param {*} [accumulator] The initial value.
16746 * @returns {*} Returns the accumulated value.
16747 * @see _.reduceRight
16748 * @example
16749 *
16750 * _.reduce([1, 2], function(sum, n) {
16751 * return sum + n;
16752 * }, 0);
16753 * // => 3
16754 *
16755 * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
16756 * (result[value] || (result[value] = [])).push(key);
16757 * return result;
16758 * }, {});
16759 * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)
16760 */
16761 function reduce(collection, iteratee, accumulator) {
16762 var func = isArray(collection) ? arrayReduce : baseReduce,
16763 initAccum = arguments.length < 3;
16764
16765 return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach);
16766 }
16767
16768 /**
16769 * This method is like `_.reduce` except that it iterates over elements of
16770 * `collection` from right to left.
16771 *
16772 * @static
16773 * @memberOf _
16774 * @since 0.1.0
16775 * @category Collection
16776 * @param {Array|Object} collection The collection to iterate over.
16777 * @param {Function} [iteratee=_.identity] The function invoked per iteration.
16778 * @param {*} [accumulator] The initial value.
16779 * @returns {*} Returns the accumulated value.
16780 * @see _.reduce
16781 * @example
16782 *
16783 * var array = [[0, 1], [2, 3], [4, 5]];
16784 *
16785 * _.reduceRight(array, function(flattened, other) {
16786 * return flattened.concat(other);
16787 * }, []);
16788 * // => [4, 5, 2, 3, 0, 1]
16789 */
16790 function reduceRight(collection, iteratee, accumulator) {
16791 var func = isArray(collection) ? arrayReduceRight : baseReduce,
16792 initAccum = arguments.length < 3;
16793
16794 return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight);
16795 }
16796
16797 /**
16798 * The opposite of `_.filter`; this method returns the elements of `collection`
16799 * that `predicate` does **not** return truthy for.
16800 *
16801 * @static
16802 * @memberOf _
16803 * @since 0.1.0
16804 * @category Collection
16805 * @param {Array|Object} collection The collection to iterate over.
16806 * @param {Function} [predicate=_.identity] The function invoked per iteration.
16807 * @returns {Array} Returns the new filtered array.
16808 * @see _.filter
16809 * @example
16810 *
16811 * var users = [
16812 * { 'user': 'barney', 'age': 36, 'active': false },
16813 * { 'user': 'fred', 'age': 40, 'active': true }
16814 * ];
16815 *
16816 * _.reject(users, function(o) { return !o.active; });
16817 * // => objects for ['fred']
16818 *
16819 * // The `_.matches` iteratee shorthand.
16820 * _.reject(users, { 'age': 40, 'active': true });
16821 * // => objects for ['barney']
16822 *
16823 * // The `_.matchesProperty` iteratee shorthand.
16824 * _.reject(users, ['active', false]);
16825 * // => objects for ['fred']
16826 *
16827 * // The `_.property` iteratee shorthand.
16828 * _.reject(users, 'active');
16829 * // => objects for ['barney']
16830 */
16831 function reject(collection, predicate) {
16832 var func = isArray(collection) ? arrayFilter : baseFilter;
16833 return func(collection, negate(getIteratee(predicate, 3)));
16834 }
16835
16836 /**
16837 * Gets a random element from `collection`.
16838 *
16839 * @static
16840 * @memberOf _
16841 * @since 2.0.0
16842 * @category Collection
16843 * @param {Array|Object} collection The collection to sample.
16844 * @returns {*} Returns the random element.
16845 * @example
16846 *
16847 * _.sample([1, 2, 3, 4]);
16848 * // => 2
16849 */
16850 function sample(collection) {
16851 var func = isArray(collection) ? arraySample : baseSample;
16852 return func(collection);
16853 }
16854
16855 /**
16856 * Gets `n` random elements at unique keys from `collection` up to the
16857 * size of `collection`.
16858 *
16859 * @static
16860 * @memberOf _
16861 * @since 4.0.0
16862 * @category Collection
16863 * @param {Array|Object} collection The collection to sample.
16864 * @param {number} [n=1] The number of elements to sample.
16865 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
16866 * @returns {Array} Returns the random elements.
16867 * @example
16868 *
16869 * _.sampleSize([1, 2, 3], 2);
16870 * // => [3, 1]
16871 *
16872 * _.sampleSize([1, 2, 3], 4);
16873 * // => [2, 3, 1]
16874 */
16875 function sampleSize(collection, n, guard) {
16876 if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) {
16877 n = 1;
16878 } else {
16879 n = toInteger(n);
16880 }
16881 var func = isArray(collection) ? arraySampleSize : baseSampleSize;
16882 return func(collection, n);
16883 }
16884
16885 /**
16886 * Creates an array of shuffled values, using a version of the
16887 * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).
16888 *
16889 * @static
16890 * @memberOf _
16891 * @since 0.1.0
16892 * @category Collection
16893 * @param {Array|Object} collection The collection to shuffle.
16894 * @returns {Array} Returns the new shuffled array.
16895 * @example
16896 *
16897 * _.shuffle([1, 2, 3, 4]);
16898 * // => [4, 1, 3, 2]
16899 */
16900 function shuffle(collection) {
16901 var func = isArray(collection) ? arrayShuffle : baseShuffle;
16902 return func(collection);
16903 }
16904
16905 /**
16906 * Gets the size of `collection` by returning its length for array-like
16907 * values or the number of own enumerable string keyed properties for objects.
16908 *
16909 * @static
16910 * @memberOf _
16911 * @since 0.1.0
16912 * @category Collection
16913 * @param {Array|Object|string} collection The collection to inspect.
16914 * @returns {number} Returns the collection size.
16915 * @example
16916 *
16917 * _.size([1, 2, 3]);
16918 * // => 3
16919 *
16920 * _.size({ 'a': 1, 'b': 2 });
16921 * // => 2
16922 *
16923 * _.size('pebbles');
16924 * // => 7
16925 */
16926 function size(collection) {
16927 if (collection == null) {
16928 return 0;
16929 }
16930 if (isArrayLike(collection)) {
16931 return isString(collection) ? stringSize(collection) : collection.length;
16932 }
16933 var tag = getTag(collection);
16934 if (tag == mapTag || tag == setTag) {
16935 return collection.size;
16936 }
16937 return baseKeys(collection).length;
16938 }
16939
16940 /**
16941 * Checks if `predicate` returns truthy for **any** element of `collection`.
16942 * Iteration is stopped once `predicate` returns truthy. The predicate is
16943 * invoked with three arguments: (value, index|key, collection).
16944 *
16945 * @static
16946 * @memberOf _
16947 * @since 0.1.0
16948 * @category Collection
16949 * @param {Array|Object} collection The collection to iterate over.
16950 * @param {Function} [predicate=_.identity] The function invoked per iteration.
16951 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
16952 * @returns {boolean} Returns `true` if any element passes the predicate check,
16953 * else `false`.
16954 * @example
16955 *
16956 * _.some([null, 0, 'yes', false], Boolean);
16957 * // => true
16958 *
16959 * var users = [
16960 * { 'user': 'barney', 'active': true },
16961 * { 'user': 'fred', 'active': false }
16962 * ];
16963 *
16964 * // The `_.matches` iteratee shorthand.
16965 * _.some(users, { 'user': 'barney', 'active': false });
16966 * // => false
16967 *
16968 * // The `_.matchesProperty` iteratee shorthand.
16969 * _.some(users, ['active', false]);
16970 * // => true
16971 *
16972 * // The `_.property` iteratee shorthand.
16973 * _.some(users, 'active');
16974 * // => true
16975 */
16976 function some(collection, predicate, guard) {
16977 var func = isArray(collection) ? arraySome : baseSome;
16978 if (guard && isIterateeCall(collection, predicate, guard)) {
16979 predicate = undefined;
16980 }
16981 return func(collection, getIteratee(predicate, 3));
16982 }
16983
16984 /**
16985 * Creates an array of elements, sorted in ascending order by the results of
16986 * running each element in a collection thru each iteratee. This method
16987 * performs a stable sort, that is, it preserves the original sort order of
16988 * equal elements. The iteratees are invoked with one argument: (value).
16989 *
16990 * @static
16991 * @memberOf _
16992 * @since 0.1.0
16993 * @category Collection
16994 * @param {Array|Object} collection The collection to iterate over.
16995 * @param {...(Function|Function[])} [iteratees=[_.identity]]
16996 * The iteratees to sort by.
16997 * @returns {Array} Returns the new sorted array.
16998 * @example
16999 *
17000 * var users = [
17001 * { 'user': 'fred', 'age': 48 },
17002 * { 'user': 'barney', 'age': 36 },
17003 * { 'user': 'fred', 'age': 40 },
17004 * { 'user': 'barney', 'age': 34 }
17005 * ];
17006 *
17007 * _.sortBy(users, [function(o) { return o.user; }]);
17008 * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
17009 *
17010 * _.sortBy(users, ['user', 'age']);
17011 * // => objects for [['barney', 34], ['barney', 36], ['fred', 40], ['fred', 48]]
17012 */
17013 var sortBy = baseRest(function(collection, iteratees) {
17014 if (collection == null) {
17015 return [];
17016 }
17017 var length = iteratees.length;
17018 if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {
17019 iteratees = [];
17020 } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {
17021 iteratees = [iteratees[0]];
17022 }
17023 return baseOrderBy(collection, baseFlatten(iteratees, 1), []);
17024 });
17025
17026 /*------------------------------------------------------------------------*/
17027
17028 /**
17029 * Gets the timestamp of the number of milliseconds that have elapsed since
17030 * the Unix epoch (1 January 1970 00:00:00 UTC).
17031 *
17032 * @static
17033 * @memberOf _
17034 * @since 2.4.0
17035 * @category Date
17036 * @returns {number} Returns the timestamp.
17037 * @example
17038 *
17039 * _.defer(function(stamp) {
17040 * console.log(_.now() - stamp);
17041 * }, _.now());
17042 * // => Logs the number of milliseconds it took for the deferred invocation.
17043 */
17044 var now = ctxNow || function() {
17045 return root.Date.now();
17046 };
17047
17048 /*------------------------------------------------------------------------*/
17049
17050 /**
17051 * The opposite of `_.before`; this method creates a function that invokes
17052 * `func` once it's called `n` or more times.
17053 *
17054 * @static
17055 * @memberOf _
17056 * @since 0.1.0
17057 * @category Function
17058 * @param {number} n The number of calls before `func` is invoked.
17059 * @param {Function} func The function to restrict.
17060 * @returns {Function} Returns the new restricted function.
17061 * @example
17062 *
17063 * var saves = ['profile', 'settings'];
17064 *
17065 * var done = _.after(saves.length, function() {
17066 * console.log('done saving!');
17067 * });
17068 *
17069 * _.forEach(saves, function(type) {
17070 * asyncSave({ 'type': type, 'complete': done });
17071 * });
17072 * // => Logs 'done saving!' after the two async saves have completed.
17073 */
17074 function after(n, func) {
17075 if (typeof func != 'function') {
17076 throw new TypeError(FUNC_ERROR_TEXT);
17077 }
17078 n = toInteger(n);
17079 return function() {
17080 if (--n < 1) {
17081 return func.apply(this, arguments);
17082 }
17083 };
17084 }
17085
17086 /**
17087 * Creates a function that invokes `func`, with up to `n` arguments,
17088 * ignoring any additional arguments.
17089 *
17090 * @static
17091 * @memberOf _
17092 * @since 3.0.0
17093 * @category Function
17094 * @param {Function} func The function to cap arguments for.
17095 * @param {number} [n=func.length] The arity cap.
17096 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
17097 * @returns {Function} Returns the new capped function.
17098 * @example
17099 *
17100 * _.map(['6', '8', '10'], _.ary(parseInt, 1));
17101 * // => [6, 8, 10]
17102 */
17103 function ary(func, n, guard) {
17104 n = guard ? undefined : n;
17105 n = (func && n == null) ? func.length : n;
17106 return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n);
17107 }
17108
17109 /**
17110 * Creates a function that invokes `func`, with the `this` binding and arguments
17111 * of the created function, while it's called less than `n` times. Subsequent
17112 * calls to the created function return the result of the last `func` invocation.
17113 *
17114 * @static
17115 * @memberOf _
17116 * @since 3.0.0
17117 * @category Function
17118 * @param {number} n The number of calls at which `func` is no longer invoked.
17119 * @param {Function} func The function to restrict.
17120 * @returns {Function} Returns the new restricted function.
17121 * @example
17122 *
17123 * jQuery(element).on('click', _.before(5, addContactToList));
17124 * // => Allows adding up to 4 contacts to the list.
17125 */
17126 function before(n, func) {
17127 var result;
17128 if (typeof func != 'function') {
17129 throw new TypeError(FUNC_ERROR_TEXT);
17130 }
17131 n = toInteger(n);
17132 return function() {
17133 if (--n > 0) {
17134 result = func.apply(this, arguments);
17135 }
17136 if (n <= 1) {
17137 func = undefined;
17138 }
17139 return result;
17140 };
17141 }
17142
17143 /**
17144 * Creates a function that invokes `func` with the `this` binding of `thisArg`
17145 * and `partials` prepended to the arguments it receives.
17146 *
17147 * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,
17148 * may be used as a placeholder for partially applied arguments.
17149 *
17150 * **Note:** Unlike native `Function#bind`, this method doesn't set the "length"
17151 * property of bound functions.
17152 *
17153 * @static
17154 * @memberOf _
17155 * @since 0.1.0
17156 * @category Function
17157 * @param {Function} func The function to bind.
17158 * @param {*} thisArg The `this` binding of `func`.
17159 * @param {...*} [partials] The arguments to be partially applied.
17160 * @returns {Function} Returns the new bound function.
17161 * @example
17162 *
17163 * function greet(greeting, punctuation) {
17164 * return greeting + ' ' + this.user + punctuation;
17165 * }
17166 *
17167 * var object = { 'user': 'fred' };
17168 *
17169 * var bound = _.bind(greet, object, 'hi');
17170 * bound('!');
17171 * // => 'hi fred!'
17172 *
17173 * // Bound with placeholders.
17174 * var bound = _.bind(greet, object, _, '!');
17175 * bound('hi');
17176 * // => 'hi fred!'
17177 */
17178 var bind = baseRest(function(func, thisArg, partials) {
17179 var bitmask = WRAP_BIND_FLAG;
17180 if (partials.length) {
17181 var holders = replaceHolders(partials, getHolder(bind));
17182 bitmask |= WRAP_PARTIAL_FLAG;
17183 }
17184 return createWrap(func, bitmask, thisArg, partials, holders);
17185 });
17186
17187 /**
17188 * Creates a function that invokes the method at `object[key]` with `partials`
17189 * prepended to the arguments it receives.
17190 *
17191 * This method differs from `_.bind` by allowing bound functions to reference
17192 * methods that may be redefined or don't yet exist. See
17193 * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)
17194 * for more details.
17195 *
17196 * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic
17197 * builds, may be used as a placeholder for partially applied arguments.
17198 *
17199 * @static
17200 * @memberOf _
17201 * @since 0.10.0
17202 * @category Function
17203 * @param {Object} object The object to invoke the method on.
17204 * @param {string} key The key of the method.
17205 * @param {...*} [partials] The arguments to be partially applied.
17206 * @returns {Function} Returns the new bound function.
17207 * @example
17208 *
17209 * var object = {
17210 * 'user': 'fred',
17211 * 'greet': function(greeting, punctuation) {
17212 * return greeting + ' ' + this.user + punctuation;
17213 * }
17214 * };
17215 *
17216 * var bound = _.bindKey(object, 'greet', 'hi');
17217 * bound('!');
17218 * // => 'hi fred!'
17219 *
17220 * object.greet = function(greeting, punctuation) {
17221 * return greeting + 'ya ' + this.user + punctuation;
17222 * };
17223 *
17224 * bound('!');
17225 * // => 'hiya fred!'
17226 *
17227 * // Bound with placeholders.
17228 * var bound = _.bindKey(object, 'greet', _, '!');
17229 * bound('hi');
17230 * // => 'hiya fred!'
17231 */
17232 var bindKey = baseRest(function(object, key, partials) {
17233 var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG;
17234 if (partials.length) {
17235 var holders = replaceHolders(partials, getHolder(bindKey));
17236 bitmask |= WRAP_PARTIAL_FLAG;
17237 }
17238 return createWrap(key, bitmask, object, partials, holders);
17239 });
17240
17241 /**
17242 * Creates a function that accepts arguments of `func` and either invokes
17243 * `func` returning its result, if at least `arity` number of arguments have
17244 * been provided, or returns a function that accepts the remaining `func`
17245 * arguments, and so on. The arity of `func` may be specified if `func.length`
17246 * is not sufficient.
17247 *
17248 * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,
17249 * may be used as a placeholder for provided arguments.
17250 *
17251 * **Note:** This method doesn't set the "length" property of curried functions.
17252 *
17253 * @static
17254 * @memberOf _
17255 * @since 2.0.0
17256 * @category Function
17257 * @param {Function} func The function to curry.
17258 * @param {number} [arity=func.length] The arity of `func`.
17259 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
17260 * @returns {Function} Returns the new curried function.
17261 * @example
17262 *
17263 * var abc = function(a, b, c) {
17264 * return [a, b, c];
17265 * };
17266 *
17267 * var curried = _.curry(abc);
17268 *
17269 * curried(1)(2)(3);
17270 * // => [1, 2, 3]
17271 *
17272 * curried(1, 2)(3);
17273 * // => [1, 2, 3]
17274 *
17275 * curried(1, 2, 3);
17276 * // => [1, 2, 3]
17277 *
17278 * // Curried with placeholders.
17279 * curried(1)(_, 3)(2);
17280 * // => [1, 2, 3]
17281 */
17282 function curry(func, arity, guard) {
17283 arity = guard ? undefined : arity;
17284 var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
17285 result.placeholder = curry.placeholder;
17286 return result;
17287 }
17288
17289 /**
17290 * This method is like `_.curry` except that arguments are applied to `func`
17291 * in the manner of `_.partialRight` instead of `_.partial`.
17292 *
17293 * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic
17294 * builds, may be used as a placeholder for provided arguments.
17295 *
17296 * **Note:** This method doesn't set the "length" property of curried functions.
17297 *
17298 * @static
17299 * @memberOf _
17300 * @since 3.0.0
17301 * @category Function
17302 * @param {Function} func The function to curry.
17303 * @param {number} [arity=func.length] The arity of `func`.
17304 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
17305 * @returns {Function} Returns the new curried function.
17306 * @example
17307 *
17308 * var abc = function(a, b, c) {
17309 * return [a, b, c];
17310 * };
17311 *
17312 * var curried = _.curryRight(abc);
17313 *
17314 * curried(3)(2)(1);
17315 * // => [1, 2, 3]
17316 *
17317 * curried(2, 3)(1);
17318 * // => [1, 2, 3]
17319 *
17320 * curried(1, 2, 3);
17321 * // => [1, 2, 3]
17322 *
17323 * // Curried with placeholders.
17324 * curried(3)(1, _)(2);
17325 * // => [1, 2, 3]
17326 */
17327 function curryRight(func, arity, guard) {
17328 arity = guard ? undefined : arity;
17329 var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
17330 result.placeholder = curryRight.placeholder;
17331 return result;
17332 }
17333
17334 /**
17335 * Creates a debounced function that delays invoking `func` until after `wait`
17336 * milliseconds have elapsed since the last time the debounced function was
17337 * invoked. The debounced function comes with a `cancel` method to cancel
17338 * delayed `func` invocations and a `flush` method to immediately invoke them.
17339 * Provide `options` to indicate whether `func` should be invoked on the
17340 * leading and/or trailing edge of the `wait` timeout. The `func` is invoked
17341 * with the last arguments provided to the debounced function. Subsequent
17342 * calls to the debounced function return the result of the last `func`
17343 * invocation.
17344 *
17345 * **Note:** If `leading` and `trailing` options are `true`, `func` is
17346 * invoked on the trailing edge of the timeout only if the debounced function
17347 * is invoked more than once during the `wait` timeout.
17348 *
17349 * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
17350 * until to the next tick, similar to `setTimeout` with a timeout of `0`.
17351 *
17352 * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
17353 * for details over the differences between `_.debounce` and `_.throttle`.
17354 *
17355 * @static
17356 * @memberOf _
17357 * @since 0.1.0
17358 * @category Function
17359 * @param {Function} func The function to debounce.
17360 * @param {number} [wait=0] The number of milliseconds to delay.
17361 * @param {Object} [options={}] The options object.
17362 * @param {boolean} [options.leading=false]
17363 * Specify invoking on the leading edge of the timeout.
17364 * @param {number} [options.maxWait]
17365 * The maximum time `func` is allowed to be delayed before it's invoked.
17366 * @param {boolean} [options.trailing=true]
17367 * Specify invoking on the trailing edge of the timeout.
17368 * @returns {Function} Returns the new debounced function.
17369 * @example
17370 *
17371 * // Avoid costly calculations while the window size is in flux.
17372 * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
17373 *
17374 * // Invoke `sendMail` when clicked, debouncing subsequent calls.
17375 * jQuery(element).on('click', _.debounce(sendMail, 300, {
17376 * 'leading': true,
17377 * 'trailing': false
17378 * }));
17379 *
17380 * // Ensure `batchLog` is invoked once after 1 second of debounced calls.
17381 * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
17382 * var source = new EventSource('/stream');
17383 * jQuery(source).on('message', debounced);
17384 *
17385 * // Cancel the trailing debounced invocation.
17386 * jQuery(window).on('popstate', debounced.cancel);
17387 */
17388 function debounce(func, wait, options) {
17389 var lastArgs,
17390 lastThis,
17391 maxWait,
17392 result,
17393 timerId,
17394 lastCallTime,
17395 lastInvokeTime = 0,
17396 leading = false,
17397 maxing = false,
17398 trailing = true;
17399
17400 if (typeof func != 'function') {
17401 throw new TypeError(FUNC_ERROR_TEXT);
17402 }
17403 wait = toNumber(wait) || 0;
17404 if (isObject(options)) {
17405 leading = !!options.leading;
17406 maxing = 'maxWait' in options;
17407 maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
17408 trailing = 'trailing' in options ? !!options.trailing : trailing;
17409 }
17410
17411 function invokeFunc(time) {
17412 var args = lastArgs,
17413 thisArg = lastThis;
17414
17415 lastArgs = lastThis = undefined;
17416 lastInvokeTime = time;
17417 result = func.apply(thisArg, args);
17418 return result;
17419 }
17420
17421 function leadingEdge(time) {
17422 // Reset any `maxWait` timer.
17423 lastInvokeTime = time;
17424 // Start the timer for the trailing edge.
17425 timerId = setTimeout(timerExpired, wait);
17426 // Invoke the leading edge.
17427 return leading ? invokeFunc(time) : result;
17428 }
17429
17430 function remainingWait(time) {
17431 var timeSinceLastCall = time - lastCallTime,
17432 timeSinceLastInvoke = time - lastInvokeTime,
17433 result = wait - timeSinceLastCall;
17434
17435 return maxing ? nativeMin(result, maxWait - timeSinceLastInvoke) : result;
17436 }
17437
17438 function shouldInvoke(time) {
17439 var timeSinceLastCall = time - lastCallTime,
17440 timeSinceLastInvoke = time - lastInvokeTime;
17441
17442 // Either this is the first call, activity has stopped and we're at the
17443 // trailing edge, the system time has gone backwards and we're treating
17444 // it as the trailing edge, or we've hit the `maxWait` limit.
17445 return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
17446 (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
17447 }
17448
17449 function timerExpired() {
17450 var time = now();
17451 if (shouldInvoke(time)) {
17452 return trailingEdge(time);
17453 }
17454 // Restart the timer.
17455 timerId = setTimeout(timerExpired, remainingWait(time));
17456 }
17457
17458 function trailingEdge(time) {
17459 timerId = undefined;
17460
17461 // Only invoke if we have `lastArgs` which means `func` has been
17462 // debounced at least once.
17463 if (trailing && lastArgs) {
17464 return invokeFunc(time);
17465 }
17466 lastArgs = lastThis = undefined;
17467 return result;
17468 }
17469
17470 function cancel() {
17471 if (timerId !== undefined) {
17472 clearTimeout(timerId);
17473 }
17474 lastInvokeTime = 0;
17475 lastArgs = lastCallTime = lastThis = timerId = undefined;
17476 }
17477
17478 function flush() {
17479 return timerId === undefined ? result : trailingEdge(now());
17480 }
17481
17482 function debounced() {
17483 var time = now(),
17484 isInvoking = shouldInvoke(time);
17485
17486 lastArgs = arguments;
17487 lastThis = this;
17488 lastCallTime = time;
17489
17490 if (isInvoking) {
17491 if (timerId === undefined) {
17492 return leadingEdge(lastCallTime);
17493 }
17494 if (maxing) {
17495 // Handle invocations in a tight loop.
17496 timerId = setTimeout(timerExpired, wait);
17497 return invokeFunc(lastCallTime);
17498 }
17499 }
17500 if (timerId === undefined) {
17501 timerId = setTimeout(timerExpired, wait);
17502 }
17503 return result;
17504 }
17505 debounced.cancel = cancel;
17506 debounced.flush = flush;
17507 return debounced;
17508 }
17509
17510 /**
17511 * Defers invoking the `func` until the current call stack has cleared. Any
17512 * additional arguments are provided to `func` when it's invoked.
17513 *
17514 * @static
17515 * @memberOf _
17516 * @since 0.1.0
17517 * @category Function
17518 * @param {Function} func The function to defer.
17519 * @param {...*} [args] The arguments to invoke `func` with.
17520 * @returns {number} Returns the timer id.
17521 * @example
17522 *
17523 * _.defer(function(text) {
17524 * console.log(text);
17525 * }, 'deferred');
17526 * // => Logs 'deferred' after one millisecond.
17527 */
17528 var defer = baseRest(function(func, args) {
17529 return baseDelay(func, 1, args);
17530 });
17531
17532 /**
17533 * Invokes `func` after `wait` milliseconds. Any additional arguments are
17534 * provided to `func` when it's invoked.
17535 *
17536 * @static
17537 * @memberOf _
17538 * @since 0.1.0
17539 * @category Function
17540 * @param {Function} func The function to delay.
17541 * @param {number} wait The number of milliseconds to delay invocation.
17542 * @param {...*} [args] The arguments to invoke `func` with.
17543 * @returns {number} Returns the timer id.
17544 * @example
17545 *
17546 * _.delay(function(text) {
17547 * console.log(text);
17548 * }, 1000, 'later');
17549 * // => Logs 'later' after one second.
17550 */
17551 var delay = baseRest(function(func, wait, args) {
17552 return baseDelay(func, toNumber(wait) || 0, args);
17553 });
17554
17555 /**
17556 * Creates a function that invokes `func` with arguments reversed.
17557 *
17558 * @static
17559 * @memberOf _
17560 * @since 4.0.0
17561 * @category Function
17562 * @param {Function} func The function to flip arguments for.
17563 * @returns {Function} Returns the new flipped function.
17564 * @example
17565 *
17566 * var flipped = _.flip(function() {
17567 * return _.toArray(arguments);
17568 * });
17569 *
17570 * flipped('a', 'b', 'c', 'd');
17571 * // => ['d', 'c', 'b', 'a']
17572 */
17573 function flip(func) {
17574 return createWrap(func, WRAP_FLIP_FLAG);
17575 }
17576
17577 /**
17578 * Creates a function that memoizes the result of `func`. If `resolver` is
17579 * provided, it determines the cache key for storing the result based on the
17580 * arguments provided to the memoized function. By default, the first argument
17581 * provided to the memoized function is used as the map cache key. The `func`
17582 * is invoked with the `this` binding of the memoized function.
17583 *
17584 * **Note:** The cache is exposed as the `cache` property on the memoized
17585 * function. Its creation may be customized by replacing the `_.memoize.Cache`
17586 * constructor with one whose instances implement the
17587 * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
17588 * method interface of `clear`, `delete`, `get`, `has`, and `set`.
17589 *
17590 * @static
17591 * @memberOf _
17592 * @since 0.1.0
17593 * @category Function
17594 * @param {Function} func The function to have its output memoized.
17595 * @param {Function} [resolver] The function to resolve the cache key.
17596 * @returns {Function} Returns the new memoized function.
17597 * @example
17598 *
17599 * var object = { 'a': 1, 'b': 2 };
17600 * var other = { 'c': 3, 'd': 4 };
17601 *
17602 * var values = _.memoize(_.values);
17603 * values(object);
17604 * // => [1, 2]
17605 *
17606 * values(other);
17607 * // => [3, 4]
17608 *
17609 * object.a = 2;
17610 * values(object);
17611 * // => [1, 2]
17612 *
17613 * // Modify the result cache.
17614 * values.cache.set(object, ['a', 'b']);
17615 * values(object);
17616 * // => ['a', 'b']
17617 *
17618 * // Replace `_.memoize.Cache`.
17619 * _.memoize.Cache = WeakMap;
17620 */
17621 function memoize(func, resolver) {
17622 if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
17623 throw new TypeError(FUNC_ERROR_TEXT);
17624 }
17625 var memoized = function() {
17626 var args = arguments,
17627 key = resolver ? resolver.apply(this, args) : args[0],
17628 cache = memoized.cache;
17629
17630 if (cache.has(key)) {
17631 return cache.get(key);
17632 }
17633 var result = func.apply(this, args);
17634 memoized.cache = cache.set(key, result) || cache;
17635 return result;
17636 };
17637 memoized.cache = new (memoize.Cache || MapCache);
17638 return memoized;
17639 }
17640
17641 // Expose `MapCache`.
17642 memoize.Cache = MapCache;
17643
17644 /**
17645 * Creates a function that negates the result of the predicate `func`. The
17646 * `func` predicate is invoked with the `this` binding and arguments of the
17647 * created function.
17648 *
17649 * @static
17650 * @memberOf _
17651 * @since 3.0.0
17652 * @category Function
17653 * @param {Function} predicate The predicate to negate.
17654 * @returns {Function} Returns the new negated function.
17655 * @example
17656 *
17657 * function isEven(n) {
17658 * return n % 2 == 0;
17659 * }
17660 *
17661 * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));
17662 * // => [1, 3, 5]
17663 */
17664 function negate(predicate) {
17665 if (typeof predicate != 'function') {
17666 throw new TypeError(FUNC_ERROR_TEXT);
17667 }
17668 return function() {
17669 var args = arguments;
17670 switch (args.length) {
17671 case 0: return !predicate.call(this);
17672 case 1: return !predicate.call(this, args[0]);
17673 case 2: return !predicate.call(this, args[0], args[1]);
17674 case 3: return !predicate.call(this, args[0], args[1], args[2]);
17675 }
17676 return !predicate.apply(this, args);
17677 };
17678 }
17679
17680 /**
17681 * Creates a function that is restricted to invoking `func` once. Repeat calls
17682 * to the function return the value of the first invocation. The `func` is
17683 * invoked with the `this` binding and arguments of the created function.
17684 *
17685 * @static
17686 * @memberOf _
17687 * @since 0.1.0
17688 * @category Function
17689 * @param {Function} func The function to restrict.
17690 * @returns {Function} Returns the new restricted function.
17691 * @example
17692 *
17693 * var initialize = _.once(createApplication);
17694 * initialize();
17695 * initialize();
17696 * // => `createApplication` is invoked once
17697 */
17698 function once(func) {
17699 return before(2, func);
17700 }
17701
17702 /**
17703 * Creates a function that invokes `func` with its arguments transformed.
17704 *
17705 * @static
17706 * @since 4.0.0
17707 * @memberOf _
17708 * @category Function
17709 * @param {Function} func The function to wrap.
17710 * @param {...(Function|Function[])} [transforms=[_.identity]]
17711 * The argument transforms.
17712 * @returns {Function} Returns the new function.
17713 * @example
17714 *
17715 * function doubled(n) {
17716 * return n * 2;
17717 * }
17718 *
17719 * function square(n) {
17720 * return n * n;
17721 * }
17722 *
17723 * var func = _.overArgs(function(x, y) {
17724 * return [x, y];
17725 * }, [square, doubled]);
17726 *
17727 * func(9, 3);
17728 * // => [81, 6]
17729 *
17730 * func(10, 5);
17731 * // => [100, 10]
17732 */
17733 var overArgs = castRest(function(func, transforms) {
17734 transforms = (transforms.length == 1 && isArray(transforms[0]))
17735 ? arrayMap(transforms[0], baseUnary(getIteratee()))
17736 : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee()));
17737
17738 var funcsLength = transforms.length;
17739 return baseRest(function(args) {
17740 var index = -1,
17741 length = nativeMin(args.length, funcsLength);
17742
17743 while (++index < length) {
17744 args[index] = transforms[index].call(this, args[index]);
17745 }
17746 return apply(func, this, args);
17747 });
17748 });
17749
17750 /**
17751 * Creates a function that invokes `func` with `partials` prepended to the
17752 * arguments it receives. This method is like `_.bind` except it does **not**
17753 * alter the `this` binding.
17754 *
17755 * The `_.partial.placeholder` value, which defaults to `_` in monolithic
17756 * builds, may be used as a placeholder for partially applied arguments.
17757 *
17758 * **Note:** This method doesn't set the "length" property of partially
17759 * applied functions.
17760 *
17761 * @static
17762 * @memberOf _
17763 * @since 0.2.0
17764 * @category Function
17765 * @param {Function} func The function to partially apply arguments to.
17766 * @param {...*} [partials] The arguments to be partially applied.
17767 * @returns {Function} Returns the new partially applied function.
17768 * @example
17769 *
17770 * function greet(greeting, name) {
17771 * return greeting + ' ' + name;
17772 * }
17773 *
17774 * var sayHelloTo = _.partial(greet, 'hello');
17775 * sayHelloTo('fred');
17776 * // => 'hello fred'
17777 *
17778 * // Partially applied with placeholders.
17779 * var greetFred = _.partial(greet, _, 'fred');
17780 * greetFred('hi');
17781 * // => 'hi fred'
17782 */
17783 var partial = baseRest(function(func, partials) {
17784 var holders = replaceHolders(partials, getHolder(partial));
17785 return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders);
17786 });
17787
17788 /**
17789 * This method is like `_.partial` except that partially applied arguments
17790 * are appended to the arguments it receives.
17791 *
17792 * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic
17793 * builds, may be used as a placeholder for partially applied arguments.
17794 *
17795 * **Note:** This method doesn't set the "length" property of partially
17796 * applied functions.
17797 *
17798 * @static
17799 * @memberOf _
17800 * @since 1.0.0
17801 * @category Function
17802 * @param {Function} func The function to partially apply arguments to.
17803 * @param {...*} [partials] The arguments to be partially applied.
17804 * @returns {Function} Returns the new partially applied function.
17805 * @example
17806 *
17807 * function greet(greeting, name) {
17808 * return greeting + ' ' + name;
17809 * }
17810 *
17811 * var greetFred = _.partialRight(greet, 'fred');
17812 * greetFred('hi');
17813 * // => 'hi fred'
17814 *
17815 * // Partially applied with placeholders.
17816 * var sayHelloTo = _.partialRight(greet, 'hello', _);
17817 * sayHelloTo('fred');
17818 * // => 'hello fred'
17819 */
17820 var partialRight = baseRest(function(func, partials) {
17821 var holders = replaceHolders(partials, getHolder(partialRight));
17822 return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders);
17823 });
17824
17825 /**
17826 * Creates a function that invokes `func` with arguments arranged according
17827 * to the specified `indexes` where the argument value at the first index is
17828 * provided as the first argument, the argument value at the second index is
17829 * provided as the second argument, and so on.
17830 *
17831 * @static
17832 * @memberOf _
17833 * @since 3.0.0
17834 * @category Function
17835 * @param {Function} func The function to rearrange arguments for.
17836 * @param {...(number|number[])} indexes The arranged argument indexes.
17837 * @returns {Function} Returns the new function.
17838 * @example
17839 *
17840 * var rearged = _.rearg(function(a, b, c) {
17841 * return [a, b, c];
17842 * }, [2, 0, 1]);
17843 *
17844 * rearged('b', 'c', 'a')
17845 * // => ['a', 'b', 'c']
17846 */
17847 var rearg = flatRest(function(func, indexes) {
17848 return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes);
17849 });
17850
17851 /**
17852 * Creates a function that invokes `func` with the `this` binding of the
17853 * created function and arguments from `start` and beyond provided as
17854 * an array.
17855 *
17856 * **Note:** This method is based on the
17857 * [rest parameter](https://mdn.io/rest_parameters).
17858 *
17859 * @static
17860 * @memberOf _
17861 * @since 4.0.0
17862 * @category Function
17863 * @param {Function} func The function to apply a rest parameter to.
17864 * @param {number} [start=func.length-1] The start position of the rest parameter.
17865 * @returns {Function} Returns the new function.
17866 * @example
17867 *
17868 * var say = _.rest(function(what, names) {
17869 * return what + ' ' + _.initial(names).join(', ') +
17870 * (_.size(names) > 1 ? ', & ' : '') + _.last(names);
17871 * });
17872 *
17873 * say('hello', 'fred', 'barney', 'pebbles');
17874 * // => 'hello fred, barney, & pebbles'
17875 */
17876 function rest(func, start) {
17877 if (typeof func != 'function') {
17878 throw new TypeError(FUNC_ERROR_TEXT);
17879 }
17880 start = start === undefined ? start : toInteger(start);
17881 return baseRest(func, start);
17882 }
17883
17884 /**
17885 * Creates a function that invokes `func` with the `this` binding of the
17886 * create function and an array of arguments much like
17887 * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply).
17888 *
17889 * **Note:** This method is based on the
17890 * [spread operator](https://mdn.io/spread_operator).
17891 *
17892 * @static
17893 * @memberOf _
17894 * @since 3.2.0
17895 * @category Function
17896 * @param {Function} func The function to spread arguments over.
17897 * @param {number} [start=0] The start position of the spread.
17898 * @returns {Function} Returns the new function.
17899 * @example
17900 *
17901 * var say = _.spread(function(who, what) {
17902 * return who + ' says ' + what;
17903 * });
17904 *
17905 * say(['fred', 'hello']);
17906 * // => 'fred says hello'
17907 *
17908 * var numbers = Promise.all([
17909 * Promise.resolve(40),
17910 * Promise.resolve(36)
17911 * ]);
17912 *
17913 * numbers.then(_.spread(function(x, y) {
17914 * return x + y;
17915 * }));
17916 * // => a Promise of 76
17917 */
17918 function spread(func, start) {
17919 if (typeof func != 'function') {
17920 throw new TypeError(FUNC_ERROR_TEXT);
17921 }
17922 start = start == null ? 0 : nativeMax(toInteger(start), 0);
17923 return baseRest(function(args) {
17924 var array = args[start],
17925 otherArgs = castSlice(args, 0, start);
17926
17927 if (array) {
17928 arrayPush(otherArgs, array);
17929 }
17930 return apply(func, this, otherArgs);
17931 });
17932 }
17933
17934 /**
17935 * Creates a throttled function that only invokes `func` at most once per
17936 * every `wait` milliseconds. The throttled function comes with a `cancel`
17937 * method to cancel delayed `func` invocations and a `flush` method to
17938 * immediately invoke them. Provide `options` to indicate whether `func`
17939 * should be invoked on the leading and/or trailing edge of the `wait`
17940 * timeout. The `func` is invoked with the last arguments provided to the
17941 * throttled function. Subsequent calls to the throttled function return the
17942 * result of the last `func` invocation.
17943 *
17944 * **Note:** If `leading` and `trailing` options are `true`, `func` is
17945 * invoked on the trailing edge of the timeout only if the throttled function
17946 * is invoked more than once during the `wait` timeout.
17947 *
17948 * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
17949 * until to the next tick, similar to `setTimeout` with a timeout of `0`.
17950 *
17951 * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
17952 * for details over the differences between `_.throttle` and `_.debounce`.
17953 *
17954 * @static
17955 * @memberOf _
17956 * @since 0.1.0
17957 * @category Function
17958 * @param {Function} func The function to throttle.
17959 * @param {number} [wait=0] The number of milliseconds to throttle invocations to.
17960 * @param {Object} [options={}] The options object.
17961 * @param {boolean} [options.leading=true]
17962 * Specify invoking on the leading edge of the timeout.
17963 * @param {boolean} [options.trailing=true]
17964 * Specify invoking on the trailing edge of the timeout.
17965 * @returns {Function} Returns the new throttled function.
17966 * @example
17967 *
17968 * // Avoid excessively updating the position while scrolling.
17969 * jQuery(window).on('scroll', _.throttle(updatePosition, 100));
17970 *
17971 * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.
17972 * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });
17973 * jQuery(element).on('click', throttled);
17974 *
17975 * // Cancel the trailing throttled invocation.
17976 * jQuery(window).on('popstate', throttled.cancel);
17977 */
17978 function throttle(func, wait, options) {
17979 var leading = true,
17980 trailing = true;
17981
17982 if (typeof func != 'function') {
17983 throw new TypeError(FUNC_ERROR_TEXT);
17984 }
17985 if (isObject(options)) {
17986 leading = 'leading' in options ? !!options.leading : leading;
17987 trailing = 'trailing' in options ? !!options.trailing : trailing;
17988 }
17989 return debounce(func, wait, {
17990 'leading': leading,
17991 'maxWait': wait,
17992 'trailing': trailing
17993 });
17994 }
17995
17996 /**
17997 * Creates a function that accepts up to one argument, ignoring any
17998 * additional arguments.
17999 *
18000 * @static
18001 * @memberOf _
18002 * @since 4.0.0
18003 * @category Function
18004 * @param {Function} func The function to cap arguments for.
18005 * @returns {Function} Returns the new capped function.
18006 * @example
18007 *
18008 * _.map(['6', '8', '10'], _.unary(parseInt));
18009 * // => [6, 8, 10]
18010 */
18011 function unary(func) {
18012 return ary(func, 1);
18013 }
18014
18015 /**
18016 * Creates a function that provides `value` to `wrapper` as its first
18017 * argument. Any additional arguments provided to the function are appended
18018 * to those provided to the `wrapper`. The wrapper is invoked with the `this`
18019 * binding of the created function.
18020 *
18021 * @static
18022 * @memberOf _
18023 * @since 0.1.0
18024 * @category Function
18025 * @param {*} value The value to wrap.
18026 * @param {Function} [wrapper=identity] The wrapper function.
18027 * @returns {Function} Returns the new function.
18028 * @example
18029 *
18030 * var p = _.wrap(_.escape, function(func, text) {
18031 * return '<p>' + func(text) + '</p>';
18032 * });
18033 *
18034 * p('fred, barney, & pebbles');
18035 * // => '<p>fred, barney, &amp; pebbles</p>'
18036 */
18037 function wrap(value, wrapper) {
18038 return partial(castFunction(wrapper), value);
18039 }
18040
18041 /*------------------------------------------------------------------------*/
18042
18043 /**
18044 * Casts `value` as an array if it's not one.
18045 *
18046 * @static
18047 * @memberOf _
18048 * @since 4.4.0
18049 * @category Lang
18050 * @param {*} value The value to inspect.
18051 * @returns {Array} Returns the cast array.
18052 * @example
18053 *
18054 * _.castArray(1);
18055 * // => [1]
18056 *
18057 * _.castArray({ 'a': 1 });
18058 * // => [{ 'a': 1 }]
18059 *
18060 * _.castArray('abc');
18061 * // => ['abc']
18062 *
18063 * _.castArray(null);
18064 * // => [null]
18065 *
18066 * _.castArray(undefined);
18067 * // => [undefined]
18068 *
18069 * _.castArray();
18070 * // => []
18071 *
18072 * var array = [1, 2, 3];
18073 * console.log(_.castArray(array) === array);
18074 * // => true
18075 */
18076 function castArray() {
18077 if (!arguments.length) {
18078 return [];
18079 }
18080 var value = arguments[0];
18081 return isArray(value) ? value : [value];
18082 }
18083
18084 /**
18085 * Creates a shallow clone of `value`.
18086 *
18087 * **Note:** This method is loosely based on the
18088 * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)
18089 * and supports cloning arrays, array buffers, booleans, date objects, maps,
18090 * numbers, `Object` objects, regexes, sets, strings, symbols, and typed
18091 * arrays. The own enumerable properties of `arguments` objects are cloned
18092 * as plain objects. An empty object is returned for uncloneable values such
18093 * as error objects, functions, DOM nodes, and WeakMaps.
18094 *
18095 * @static
18096 * @memberOf _
18097 * @since 0.1.0
18098 * @category Lang
18099 * @param {*} value The value to clone.
18100 * @returns {*} Returns the cloned value.
18101 * @see _.cloneDeep
18102 * @example
18103 *
18104 * var objects = [{ 'a': 1 }, { 'b': 2 }];
18105 *
18106 * var shallow = _.clone(objects);
18107 * console.log(shallow[0] === objects[0]);
18108 * // => true
18109 */
18110 function clone(value) {
18111 return baseClone(value, CLONE_SYMBOLS_FLAG);
18112 }
18113
18114 /**
18115 * This method is like `_.clone` except that it accepts `customizer` which
18116 * is invoked to produce the cloned value. If `customizer` returns `undefined`,
18117 * cloning is handled by the method instead. The `customizer` is invoked with
18118 * up to four arguments; (value [, index|key, object, stack]).
18119 *
18120 * @static
18121 * @memberOf _
18122 * @since 4.0.0
18123 * @category Lang
18124 * @param {*} value The value to clone.
18125 * @param {Function} [customizer] The function to customize cloning.
18126 * @returns {*} Returns the cloned value.
18127 * @see _.cloneDeepWith
18128 * @example
18129 *
18130 * function customizer(value) {
18131 * if (_.isElement(value)) {
18132 * return value.cloneNode(false);
18133 * }
18134 * }
18135 *
18136 * var el = _.cloneWith(document.body, customizer);
18137 *
18138 * console.log(el === document.body);
18139 * // => false
18140 * console.log(el.nodeName);
18141 * // => 'BODY'
18142 * console.log(el.childNodes.length);
18143 * // => 0
18144 */
18145 function cloneWith(value, customizer) {
18146 customizer = typeof customizer == 'function' ? customizer : undefined;
18147 return baseClone(value, CLONE_SYMBOLS_FLAG, customizer);
18148 }
18149
18150 /**
18151 * This method is like `_.clone` except that it recursively clones `value`.
18152 *
18153 * @static
18154 * @memberOf _
18155 * @since 1.0.0
18156 * @category Lang
18157 * @param {*} value The value to recursively clone.
18158 * @returns {*} Returns the deep cloned value.
18159 * @see _.clone
18160 * @example
18161 *
18162 * var objects = [{ 'a': 1 }, { 'b': 2 }];
18163 *
18164 * var deep = _.cloneDeep(objects);
18165 * console.log(deep[0] === objects[0]);
18166 * // => false
18167 */
18168 function cloneDeep(value) {
18169 return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
18170 }
18171
18172 /**
18173 * This method is like `_.cloneWith` except that it recursively clones `value`.
18174 *
18175 * @static
18176 * @memberOf _
18177 * @since 4.0.0
18178 * @category Lang
18179 * @param {*} value The value to recursively clone.
18180 * @param {Function} [customizer] The function to customize cloning.
18181 * @returns {*} Returns the deep cloned value.
18182 * @see _.cloneWith
18183 * @example
18184 *
18185 * function customizer(value) {
18186 * if (_.isElement(value)) {
18187 * return value.cloneNode(true);
18188 * }
18189 * }
18190 *
18191 * var el = _.cloneDeepWith(document.body, customizer);
18192 *
18193 * console.log(el === document.body);
18194 * // => false
18195 * console.log(el.nodeName);
18196 * // => 'BODY'
18197 * console.log(el.childNodes.length);
18198 * // => 20
18199 */
18200 function cloneDeepWith(value, customizer) {
18201 customizer = typeof customizer == 'function' ? customizer : undefined;
18202 return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);
18203 }
18204
18205 /**
18206 * Checks if `object` conforms to `source` by invoking the predicate
18207 * properties of `source` with the corresponding property values of `object`.
18208 *
18209 * **Note:** This method is equivalent to `_.conforms` when `source` is
18210 * partially applied.
18211 *
18212 * @static
18213 * @memberOf _
18214 * @since 4.14.0
18215 * @category Lang
18216 * @param {Object} object The object to inspect.
18217 * @param {Object} source The object of property predicates to conform to.
18218 * @returns {boolean} Returns `true` if `object` conforms, else `false`.
18219 * @example
18220 *
18221 * var object = { 'a': 1, 'b': 2 };
18222 *
18223 * _.conformsTo(object, { 'b': function(n) { return n > 1; } });
18224 * // => true
18225 *
18226 * _.conformsTo(object, { 'b': function(n) { return n > 2; } });
18227 * // => false
18228 */
18229 function conformsTo(object, source) {
18230 return source == null || baseConformsTo(object, source, keys(source));
18231 }
18232
18233 /**
18234 * Performs a
18235 * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
18236 * comparison between two values to determine if they are equivalent.
18237 *
18238 * @static
18239 * @memberOf _
18240 * @since 4.0.0
18241 * @category Lang
18242 * @param {*} value The value to compare.
18243 * @param {*} other The other value to compare.
18244 * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
18245 * @example
18246 *
18247 * var object = { 'a': 1 };
18248 * var other = { 'a': 1 };
18249 *
18250 * _.eq(object, object);
18251 * // => true
18252 *
18253 * _.eq(object, other);
18254 * // => false
18255 *
18256 * _.eq('a', 'a');
18257 * // => true
18258 *
18259 * _.eq('a', Object('a'));
18260 * // => false
18261 *
18262 * _.eq(NaN, NaN);
18263 * // => true
18264 */
18265 function eq(value, other) {
18266 return value === other || (value !== value && other !== other);
18267 }
18268
18269 /**
18270 * Checks if `value` is greater than `other`.
18271 *
18272 * @static
18273 * @memberOf _
18274 * @since 3.9.0
18275 * @category Lang
18276 * @param {*} value The value to compare.
18277 * @param {*} other The other value to compare.
18278 * @returns {boolean} Returns `true` if `value` is greater than `other`,
18279 * else `false`.
18280 * @see _.lt
18281 * @example
18282 *
18283 * _.gt(3, 1);
18284 * // => true
18285 *
18286 * _.gt(3, 3);
18287 * // => false
18288 *
18289 * _.gt(1, 3);
18290 * // => false
18291 */
18292 var gt = createRelationalOperation(baseGt);
18293
18294 /**
18295 * Checks if `value` is greater than or equal to `other`.
18296 *
18297 * @static
18298 * @memberOf _
18299 * @since 3.9.0
18300 * @category Lang
18301 * @param {*} value The value to compare.
18302 * @param {*} other The other value to compare.
18303 * @returns {boolean} Returns `true` if `value` is greater than or equal to
18304 * `other`, else `false`.
18305 * @see _.lte
18306 * @example
18307 *
18308 * _.gte(3, 1);
18309 * // => true
18310 *
18311 * _.gte(3, 3);
18312 * // => true
18313 *
18314 * _.gte(1, 3);
18315 * // => false
18316 */
18317 var gte = createRelationalOperation(function(value, other) {
18318 return value >= other;
18319 });
18320
18321 /**
18322 * Checks if `value` is likely an `arguments` object.
18323 *
18324 * @static
18325 * @memberOf _
18326 * @since 0.1.0
18327 * @category Lang
18328 * @param {*} value The value to check.
18329 * @returns {boolean} Returns `true` if `value` is an `arguments` object,
18330 * else `false`.
18331 * @example
18332 *
18333 * _.isArguments(function() { return arguments; }());
18334 * // => true
18335 *
18336 * _.isArguments([1, 2, 3]);
18337 * // => false
18338 */
18339 var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
18340 return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&
18341 !propertyIsEnumerable.call(value, 'callee');
18342 };
18343
18344 /**
18345 * Checks if `value` is classified as an `Array` object.
18346 *
18347 * @static
18348 * @memberOf _
18349 * @since 0.1.0
18350 * @category Lang
18351 * @param {*} value The value to check.
18352 * @returns {boolean} Returns `true` if `value` is an array, else `false`.
18353 * @example
18354 *
18355 * _.isArray([1, 2, 3]);
18356 * // => true
18357 *
18358 * _.isArray(document.body.children);
18359 * // => false
18360 *
18361 * _.isArray('abc');
18362 * // => false
18363 *
18364 * _.isArray(_.noop);
18365 * // => false
18366 */
18367 var isArray = Array.isArray;
18368
18369 /**
18370 * Checks if `value` is classified as an `ArrayBuffer` object.
18371 *
18372 * @static
18373 * @memberOf _
18374 * @since 4.3.0
18375 * @category Lang
18376 * @param {*} value The value to check.
18377 * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
18378 * @example
18379 *
18380 * _.isArrayBuffer(new ArrayBuffer(2));
18381 * // => true
18382 *
18383 * _.isArrayBuffer(new Array(2));
18384 * // => false
18385 */
18386 var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer;
18387
18388 /**
18389 * Checks if `value` is array-like. A value is considered array-like if it's
18390 * not a function and has a `value.length` that's an integer greater than or
18391 * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
18392 *
18393 * @static
18394 * @memberOf _
18395 * @since 4.0.0
18396 * @category Lang
18397 * @param {*} value The value to check.
18398 * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
18399 * @example
18400 *
18401 * _.isArrayLike([1, 2, 3]);
18402 * // => true
18403 *
18404 * _.isArrayLike(document.body.children);
18405 * // => true
18406 *
18407 * _.isArrayLike('abc');
18408 * // => true
18409 *
18410 * _.isArrayLike(_.noop);
18411 * // => false
18412 */
18413 function isArrayLike(value) {
18414 return value != null && isLength(value.length) && !isFunction(value);
18415 }
18416
18417 /**
18418 * This method is like `_.isArrayLike` except that it also checks if `value`
18419 * is an object.
18420 *
18421 * @static
18422 * @memberOf _
18423 * @since 4.0.0
18424 * @category Lang
18425 * @param {*} value The value to check.
18426 * @returns {boolean} Returns `true` if `value` is an array-like object,
18427 * else `false`.
18428 * @example
18429 *
18430 * _.isArrayLikeObject([1, 2, 3]);
18431 * // => true
18432 *
18433 * _.isArrayLikeObject(document.body.children);
18434 * // => true
18435 *
18436 * _.isArrayLikeObject('abc');
18437 * // => false
18438 *
18439 * _.isArrayLikeObject(_.noop);
18440 * // => false
18441 */
18442 function isArrayLikeObject(value) {
18443 return isObjectLike(value) && isArrayLike(value);
18444 }
18445
18446 /**
18447 * Checks if `value` is classified as a boolean primitive or object.
18448 *
18449 * @static
18450 * @memberOf _
18451 * @since 0.1.0
18452 * @category Lang
18453 * @param {*} value The value to check.
18454 * @returns {boolean} Returns `true` if `value` is a boolean, else `false`.
18455 * @example
18456 *
18457 * _.isBoolean(false);
18458 * // => true
18459 *
18460 * _.isBoolean(null);
18461 * // => false
18462 */
18463 function isBoolean(value) {
18464 return value === true || value === false ||
18465 (isObjectLike(value) && baseGetTag(value) == boolTag);
18466 }
18467
18468 /**
18469 * Checks if `value` is a buffer.
18470 *
18471 * @static
18472 * @memberOf _
18473 * @since 4.3.0
18474 * @category Lang
18475 * @param {*} value The value to check.
18476 * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
18477 * @example
18478 *
18479 * _.isBuffer(new Buffer(2));
18480 * // => true
18481 *
18482 * _.isBuffer(new Uint8Array(2));
18483 * // => false
18484 */
18485 var isBuffer = nativeIsBuffer || stubFalse;
18486
18487 /**
18488 * Checks if `value` is classified as a `Date` object.
18489 *
18490 * @static
18491 * @memberOf _
18492 * @since 0.1.0
18493 * @category Lang
18494 * @param {*} value The value to check.
18495 * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
18496 * @example
18497 *
18498 * _.isDate(new Date);
18499 * // => true
18500 *
18501 * _.isDate('Mon April 23 2012');
18502 * // => false
18503 */
18504 var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;
18505
18506 /**
18507 * Checks if `value` is likely a DOM element.
18508 *
18509 * @static
18510 * @memberOf _
18511 * @since 0.1.0
18512 * @category Lang
18513 * @param {*} value The value to check.
18514 * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`.
18515 * @example
18516 *
18517 * _.isElement(document.body);
18518 * // => true
18519 *
18520 * _.isElement('<body>');
18521 * // => false
18522 */
18523 function isElement(value) {
18524 return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value);
18525 }
18526
18527 /**
18528 * Checks if `value` is an empty object, collection, map, or set.
18529 *
18530 * Objects are considered empty if they have no own enumerable string keyed
18531 * properties.
18532 *
18533 * Array-like values such as `arguments` objects, arrays, buffers, strings, or
18534 * jQuery-like collections are considered empty if they have a `length` of `0`.
18535 * Similarly, maps and sets are considered empty if they have a `size` of `0`.
18536 *
18537 * @static
18538 * @memberOf _
18539 * @since 0.1.0
18540 * @category Lang
18541 * @param {*} value The value to check.
18542 * @returns {boolean} Returns `true` if `value` is empty, else `false`.
18543 * @example
18544 *
18545 * _.isEmpty(null);
18546 * // => true
18547 *
18548 * _.isEmpty(true);
18549 * // => true
18550 *
18551 * _.isEmpty(1);
18552 * // => true
18553 *
18554 * _.isEmpty([1, 2, 3]);
18555 * // => false
18556 *
18557 * _.isEmpty({ 'a': 1 });
18558 * // => false
18559 */
18560 function isEmpty(value) {
18561 if (value == null) {
18562 return true;
18563 }
18564 if (isArrayLike(value) &&
18565 (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||
18566 isBuffer(value) || isTypedArray(value) || isArguments(value))) {
18567 return !value.length;
18568 }
18569 var tag = getTag(value);
18570 if (tag == mapTag || tag == setTag) {
18571 return !value.size;
18572 }
18573 if (isPrototype(value)) {
18574 return !baseKeys(value).length;
18575 }
18576 for (var key in value) {
18577 if (hasOwnProperty.call(value, key)) {
18578 return false;
18579 }
18580 }
18581 return true;
18582 }
18583
18584 /**
18585 * Performs a deep comparison between two values to determine if they are
18586 * equivalent.
18587 *
18588 * **Note:** This method supports comparing arrays, array buffers, booleans,
18589 * date objects, error objects, maps, numbers, `Object` objects, regexes,
18590 * sets, strings, symbols, and typed arrays. `Object` objects are compared
18591 * by their own, not inherited, enumerable properties. Functions and DOM
18592 * nodes are compared by strict equality, i.e. `===`.
18593 *
18594 * @static
18595 * @memberOf _
18596 * @since 0.1.0
18597 * @category Lang
18598 * @param {*} value The value to compare.
18599 * @param {*} other The other value to compare.
18600 * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
18601 * @example
18602 *
18603 * var object = { 'a': 1 };
18604 * var other = { 'a': 1 };
18605 *
18606 * _.isEqual(object, other);
18607 * // => true
18608 *
18609 * object === other;
18610 * // => false
18611 */
18612 function isEqual(value, other) {
18613 return baseIsEqual(value, other);
18614 }
18615
18616 /**
18617 * This method is like `_.isEqual` except that it accepts `customizer` which
18618 * is invoked to compare values. If `customizer` returns `undefined`, comparisons
18619 * are handled by the method instead. The `customizer` is invoked with up to
18620 * six arguments: (objValue, othValue [, index|key, object, other, stack]).
18621 *
18622 * @static
18623 * @memberOf _
18624 * @since 4.0.0
18625 * @category Lang
18626 * @param {*} value The value to compare.
18627 * @param {*} other The other value to compare.
18628 * @param {Function} [customizer] The function to customize comparisons.
18629 * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
18630 * @example
18631 *
18632 * function isGreeting(value) {
18633 * return /^h(?:i|ello)$/.test(value);
18634 * }
18635 *
18636 * function customizer(objValue, othValue) {
18637 * if (isGreeting(objValue) && isGreeting(othValue)) {
18638 * return true;
18639 * }
18640 * }
18641 *
18642 * var array = ['hello', 'goodbye'];
18643 * var other = ['hi', 'goodbye'];
18644 *
18645 * _.isEqualWith(array, other, customizer);
18646 * // => true
18647 */
18648 function isEqualWith(value, other, customizer) {
18649 customizer = typeof customizer == 'function' ? customizer : undefined;
18650 var result = customizer ? customizer(value, other) : undefined;
18651 return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result;
18652 }
18653
18654 /**
18655 * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,
18656 * `SyntaxError`, `TypeError`, or `URIError` object.
18657 *
18658 * @static
18659 * @memberOf _
18660 * @since 3.0.0
18661 * @category Lang
18662 * @param {*} value The value to check.
18663 * @returns {boolean} Returns `true` if `value` is an error object, else `false`.
18664 * @example
18665 *
18666 * _.isError(new Error);
18667 * // => true
18668 *
18669 * _.isError(Error);
18670 * // => false
18671 */
18672 function isError(value) {
18673 if (!isObjectLike(value)) {
18674 return false;
18675 }
18676 var tag = baseGetTag(value);
18677 return tag == errorTag || tag == domExcTag ||
18678 (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value));
18679 }
18680
18681 /**
18682 * Checks if `value` is a finite primitive number.
18683 *
18684 * **Note:** This method is based on
18685 * [`Number.isFinite`](https://mdn.io/Number/isFinite).
18686 *
18687 * @static
18688 * @memberOf _
18689 * @since 0.1.0
18690 * @category Lang
18691 * @param {*} value The value to check.
18692 * @returns {boolean} Returns `true` if `value` is a finite number, else `false`.
18693 * @example
18694 *
18695 * _.isFinite(3);
18696 * // => true
18697 *
18698 * _.isFinite(Number.MIN_VALUE);
18699 * // => true
18700 *
18701 * _.isFinite(Infinity);
18702 * // => false
18703 *
18704 * _.isFinite('3');
18705 * // => false
18706 */
18707 function isFinite(value) {
18708 return typeof value == 'number' && nativeIsFinite(value);
18709 }
18710
18711 /**
18712 * Checks if `value` is classified as a `Function` object.
18713 *
18714 * @static
18715 * @memberOf _
18716 * @since 0.1.0
18717 * @category Lang
18718 * @param {*} value The value to check.
18719 * @returns {boolean} Returns `true` if `value` is a function, else `false`.
18720 * @example
18721 *
18722 * _.isFunction(_);
18723 * // => true
18724 *
18725 * _.isFunction(/abc/);
18726 * // => false
18727 */
18728 function isFunction(value) {
18729 if (!isObject(value)) {
18730 return false;
18731 }
18732 // The use of `Object#toString` avoids issues with the `typeof` operator
18733 // in Safari 9 which returns 'object' for typed arrays and other constructors.
18734 var tag = baseGetTag(value);
18735 return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
18736 }
18737
18738 /**
18739 * Checks if `value` is an integer.
18740 *
18741 * **Note:** This method is based on
18742 * [`Number.isInteger`](https://mdn.io/Number/isInteger).
18743 *
18744 * @static
18745 * @memberOf _
18746 * @since 4.0.0
18747 * @category Lang
18748 * @param {*} value The value to check.
18749 * @returns {boolean} Returns `true` if `value` is an integer, else `false`.
18750 * @example
18751 *
18752 * _.isInteger(3);
18753 * // => true
18754 *
18755 * _.isInteger(Number.MIN_VALUE);
18756 * // => false
18757 *
18758 * _.isInteger(Infinity);
18759 * // => false
18760 *
18761 * _.isInteger('3');
18762 * // => false
18763 */
18764 function isInteger(value) {
18765 return typeof value == 'number' && value == toInteger(value);
18766 }
18767
18768 /**
18769 * Checks if `value` is a valid array-like length.
18770 *
18771 * **Note:** This method is loosely based on
18772 * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
18773 *
18774 * @static
18775 * @memberOf _
18776 * @since 4.0.0
18777 * @category Lang
18778 * @param {*} value The value to check.
18779 * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
18780 * @example
18781 *
18782 * _.isLength(3);
18783 * // => true
18784 *
18785 * _.isLength(Number.MIN_VALUE);
18786 * // => false
18787 *
18788 * _.isLength(Infinity);
18789 * // => false
18790 *
18791 * _.isLength('3');
18792 * // => false
18793 */
18794 function isLength(value) {
18795 return typeof value == 'number' &&
18796 value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
18797 }
18798
18799 /**
18800 * Checks if `value` is the
18801 * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
18802 * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
18803 *
18804 * @static
18805 * @memberOf _
18806 * @since 0.1.0
18807 * @category Lang
18808 * @param {*} value The value to check.
18809 * @returns {boolean} Returns `true` if `value` is an object, else `false`.
18810 * @example
18811 *
18812 * _.isObject({});
18813 * // => true
18814 *
18815 * _.isObject([1, 2, 3]);
18816 * // => true
18817 *
18818 * _.isObject(_.noop);
18819 * // => true
18820 *
18821 * _.isObject(null);
18822 * // => false
18823 */
18824 function isObject(value) {
18825 var type = typeof value;
18826 return value != null && (type == 'object' || type == 'function');
18827 }
18828
18829 /**
18830 * Checks if `value` is object-like. A value is object-like if it's not `null`
18831 * and has a `typeof` result of "object".
18832 *
18833 * @static
18834 * @memberOf _
18835 * @since 4.0.0
18836 * @category Lang
18837 * @param {*} value The value to check.
18838 * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
18839 * @example
18840 *
18841 * _.isObjectLike({});
18842 * // => true
18843 *
18844 * _.isObjectLike([1, 2, 3]);
18845 * // => true
18846 *
18847 * _.isObjectLike(_.noop);
18848 * // => false
18849 *
18850 * _.isObjectLike(null);
18851 * // => false
18852 */
18853 function isObjectLike(value) {
18854 return value != null && typeof value == 'object';
18855 }
18856
18857 /**
18858 * Checks if `value` is classified as a `Map` object.
18859 *
18860 * @static
18861 * @memberOf _
18862 * @since 4.3.0
18863 * @category Lang
18864 * @param {*} value The value to check.
18865 * @returns {boolean} Returns `true` if `value` is a map, else `false`.
18866 * @example
18867 *
18868 * _.isMap(new Map);
18869 * // => true
18870 *
18871 * _.isMap(new WeakMap);
18872 * // => false
18873 */
18874 var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;
18875
18876 /**
18877 * Performs a partial deep comparison between `object` and `source` to
18878 * determine if `object` contains equivalent property values.
18879 *
18880 * **Note:** This method is equivalent to `_.matches` when `source` is
18881 * partially applied.
18882 *
18883 * Partial comparisons will match empty array and empty object `source`
18884 * values against any array or object value, respectively. See `_.isEqual`
18885 * for a list of supported value comparisons.
18886 *
18887 * @static
18888 * @memberOf _
18889 * @since 3.0.0
18890 * @category Lang
18891 * @param {Object} object The object to inspect.
18892 * @param {Object} source The object of property values to match.
18893 * @returns {boolean} Returns `true` if `object` is a match, else `false`.
18894 * @example
18895 *
18896 * var object = { 'a': 1, 'b': 2 };
18897 *
18898 * _.isMatch(object, { 'b': 2 });
18899 * // => true
18900 *
18901 * _.isMatch(object, { 'b': 1 });
18902 * // => false
18903 */
18904 function isMatch(object, source) {
18905 return object === source || baseIsMatch(object, source, getMatchData(source));
18906 }
18907
18908 /**
18909 * This method is like `_.isMatch` except that it accepts `customizer` which
18910 * is invoked to compare values. If `customizer` returns `undefined`, comparisons
18911 * are handled by the method instead. The `customizer` is invoked with five
18912 * arguments: (objValue, srcValue, index|key, object, source).
18913 *
18914 * @static
18915 * @memberOf _
18916 * @since 4.0.0
18917 * @category Lang
18918 * @param {Object} object The object to inspect.
18919 * @param {Object} source The object of property values to match.
18920 * @param {Function} [customizer] The function to customize comparisons.
18921 * @returns {boolean} Returns `true` if `object` is a match, else `false`.
18922 * @example
18923 *
18924 * function isGreeting(value) {
18925 * return /^h(?:i|ello)$/.test(value);
18926 * }
18927 *
18928 * function customizer(objValue, srcValue) {
18929 * if (isGreeting(objValue) && isGreeting(srcValue)) {
18930 * return true;
18931 * }
18932 * }
18933 *
18934 * var object = { 'greeting': 'hello' };
18935 * var source = { 'greeting': 'hi' };
18936 *
18937 * _.isMatchWith(object, source, customizer);
18938 * // => true
18939 */
18940 function isMatchWith(object, source, customizer) {
18941 customizer = typeof customizer == 'function' ? customizer : undefined;
18942 return baseIsMatch(object, source, getMatchData(source), customizer);
18943 }
18944
18945 /**
18946 * Checks if `value` is `NaN`.
18947 *
18948 * **Note:** This method is based on
18949 * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as
18950 * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for
18951 * `undefined` and other non-number values.
18952 *
18953 * @static
18954 * @memberOf _
18955 * @since 0.1.0
18956 * @category Lang
18957 * @param {*} value The value to check.
18958 * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
18959 * @example
18960 *
18961 * _.isNaN(NaN);
18962 * // => true
18963 *
18964 * _.isNaN(new Number(NaN));
18965 * // => true
18966 *
18967 * isNaN(undefined);
18968 * // => true
18969 *
18970 * _.isNaN(undefined);
18971 * // => false
18972 */
18973 function isNaN(value) {
18974 // An `NaN` primitive is the only value that is not equal to itself.
18975 // Perform the `toStringTag` check first to avoid errors with some
18976 // ActiveX objects in IE.
18977 return isNumber(value) && value != +value;
18978 }
18979
18980 /**
18981 * Checks if `value` is a pristine native function.
18982 *
18983 * **Note:** This method can't reliably detect native functions in the presence
18984 * of the core-js package because core-js circumvents this kind of detection.
18985 * Despite multiple requests, the core-js maintainer has made it clear: any
18986 * attempt to fix the detection will be obstructed. As a result, we're left
18987 * with little choice but to throw an error. Unfortunately, this also affects
18988 * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill),
18989 * which rely on core-js.
18990 *
18991 * @static
18992 * @memberOf _
18993 * @since 3.0.0
18994 * @category Lang
18995 * @param {*} value The value to check.
18996 * @returns {boolean} Returns `true` if `value` is a native function,
18997 * else `false`.
18998 * @example
18999 *
19000 * _.isNative(Array.prototype.push);
19001 * // => true
19002 *
19003 * _.isNative(_);
19004 * // => false
19005 */
19006 function isNative(value) {
19007 if (isMaskable(value)) {
19008 throw new Error(CORE_ERROR_TEXT);
19009 }
19010 return baseIsNative(value);
19011 }
19012
19013 /**
19014 * Checks if `value` is `null`.
19015 *
19016 * @static
19017 * @memberOf _
19018 * @since 0.1.0
19019 * @category Lang
19020 * @param {*} value The value to check.
19021 * @returns {boolean} Returns `true` if `value` is `null`, else `false`.
19022 * @example
19023 *
19024 * _.isNull(null);
19025 * // => true
19026 *
19027 * _.isNull(void 0);
19028 * // => false
19029 */
19030 function isNull(value) {
19031 return value === null;
19032 }
19033
19034 /**
19035 * Checks if `value` is `null` or `undefined`.
19036 *
19037 * @static
19038 * @memberOf _
19039 * @since 4.0.0
19040 * @category Lang
19041 * @param {*} value The value to check.
19042 * @returns {boolean} Returns `true` if `value` is nullish, else `false`.
19043 * @example
19044 *
19045 * _.isNil(null);
19046 * // => true
19047 *
19048 * _.isNil(void 0);
19049 * // => true
19050 *
19051 * _.isNil(NaN);
19052 * // => false
19053 */
19054 function isNil(value) {
19055 return value == null;
19056 }
19057
19058 /**
19059 * Checks if `value` is classified as a `Number` primitive or object.
19060 *
19061 * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are
19062 * classified as numbers, use the `_.isFinite` method.
19063 *
19064 * @static
19065 * @memberOf _
19066 * @since 0.1.0
19067 * @category Lang
19068 * @param {*} value The value to check.
19069 * @returns {boolean} Returns `true` if `value` is a number, else `false`.
19070 * @example
19071 *
19072 * _.isNumber(3);
19073 * // => true
19074 *
19075 * _.isNumber(Number.MIN_VALUE);
19076 * // => true
19077 *
19078 * _.isNumber(Infinity);
19079 * // => true
19080 *
19081 * _.isNumber('3');
19082 * // => false
19083 */
19084 function isNumber(value) {
19085 return typeof value == 'number' ||
19086 (isObjectLike(value) && baseGetTag(value) == numberTag);
19087 }
19088
19089 /**
19090 * Checks if `value` is a plain object, that is, an object created by the
19091 * `Object` constructor or one with a `[[Prototype]]` of `null`.
19092 *
19093 * @static
19094 * @memberOf _
19095 * @since 0.8.0
19096 * @category Lang
19097 * @param {*} value The value to check.
19098 * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
19099 * @example
19100 *
19101 * function Foo() {
19102 * this.a = 1;
19103 * }
19104 *
19105 * _.isPlainObject(new Foo);
19106 * // => false
19107 *
19108 * _.isPlainObject([1, 2, 3]);
19109 * // => false
19110 *
19111 * _.isPlainObject({ 'x': 0, 'y': 0 });
19112 * // => true
19113 *
19114 * _.isPlainObject(Object.create(null));
19115 * // => true
19116 */
19117 function isPlainObject(value) {
19118 if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
19119 return false;
19120 }
19121 var proto = getPrototype(value);
19122 if (proto === null) {
19123 return true;
19124 }
19125 var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
19126 return typeof Ctor == 'function' && Ctor instanceof Ctor &&
19127 funcToString.call(Ctor) == objectCtorString;
19128 }
19129
19130 /**
19131 * Checks if `value` is classified as a `RegExp` object.
19132 *
19133 * @static
19134 * @memberOf _
19135 * @since 0.1.0
19136 * @category Lang
19137 * @param {*} value The value to check.
19138 * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
19139 * @example
19140 *
19141 * _.isRegExp(/abc/);
19142 * // => true
19143 *
19144 * _.isRegExp('/abc/');
19145 * // => false
19146 */
19147 var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;
19148
19149 /**
19150 * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754
19151 * double precision number which isn't the result of a rounded unsafe integer.
19152 *
19153 * **Note:** This method is based on
19154 * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger).
19155 *
19156 * @static
19157 * @memberOf _
19158 * @since 4.0.0
19159 * @category Lang
19160 * @param {*} value The value to check.
19161 * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`.
19162 * @example
19163 *
19164 * _.isSafeInteger(3);
19165 * // => true
19166 *
19167 * _.isSafeInteger(Number.MIN_VALUE);
19168 * // => false
19169 *
19170 * _.isSafeInteger(Infinity);
19171 * // => false
19172 *
19173 * _.isSafeInteger('3');
19174 * // => false
19175 */
19176 function isSafeInteger(value) {
19177 return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER;
19178 }
19179
19180 /**
19181 * Checks if `value` is classified as a `Set` object.
19182 *
19183 * @static
19184 * @memberOf _
19185 * @since 4.3.0
19186 * @category Lang
19187 * @param {*} value The value to check.
19188 * @returns {boolean} Returns `true` if `value` is a set, else `false`.
19189 * @example
19190 *
19191 * _.isSet(new Set);
19192 * // => true
19193 *
19194 * _.isSet(new WeakSet);
19195 * // => false
19196 */
19197 var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
19198
19199 /**
19200 * Checks if `value` is classified as a `String` primitive or object.
19201 *
19202 * @static
19203 * @since 0.1.0
19204 * @memberOf _
19205 * @category Lang
19206 * @param {*} value The value to check.
19207 * @returns {boolean} Returns `true` if `value` is a string, else `false`.
19208 * @example
19209 *
19210 * _.isString('abc');
19211 * // => true
19212 *
19213 * _.isString(1);
19214 * // => false
19215 */
19216 function isString(value) {
19217 return typeof value == 'string' ||
19218 (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);
19219 }
19220
19221 /**
19222 * Checks if `value` is classified as a `Symbol` primitive or object.
19223 *
19224 * @static
19225 * @memberOf _
19226 * @since 4.0.0
19227 * @category Lang
19228 * @param {*} value The value to check.
19229 * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
19230 * @example
19231 *
19232 * _.isSymbol(Symbol.iterator);
19233 * // => true
19234 *
19235 * _.isSymbol('abc');
19236 * // => false
19237 */
19238 function isSymbol(value) {
19239 return typeof value == 'symbol' ||
19240 (isObjectLike(value) && baseGetTag(value) == symbolTag);
19241 }
19242
19243 /**
19244 * Checks if `value` is classified as a typed array.
19245 *
19246 * @static
19247 * @memberOf _
19248 * @since 3.0.0
19249 * @category Lang
19250 * @param {*} value The value to check.
19251 * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
19252 * @example
19253 *
19254 * _.isTypedArray(new Uint8Array);
19255 * // => true
19256 *
19257 * _.isTypedArray([]);
19258 * // => false
19259 */
19260 var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
19261
19262 /**
19263 * Checks if `value` is `undefined`.
19264 *
19265 * @static
19266 * @since 0.1.0
19267 * @memberOf _
19268 * @category Lang
19269 * @param {*} value The value to check.
19270 * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.
19271 * @example
19272 *
19273 * _.isUndefined(void 0);
19274 * // => true
19275 *
19276 * _.isUndefined(null);
19277 * // => false
19278 */
19279 function isUndefined(value) {
19280 return value === undefined;
19281 }
19282
19283 /**
19284 * Checks if `value` is classified as a `WeakMap` object.
19285 *
19286 * @static
19287 * @memberOf _
19288 * @since 4.3.0
19289 * @category Lang
19290 * @param {*} value The value to check.
19291 * @returns {boolean} Returns `true` if `value` is a weak map, else `false`.
19292 * @example
19293 *
19294 * _.isWeakMap(new WeakMap);
19295 * // => true
19296 *
19297 * _.isWeakMap(new Map);
19298 * // => false
19299 */
19300 function isWeakMap(value) {
19301 return isObjectLike(value) && getTag(value) == weakMapTag;
19302 }
19303
19304 /**
19305 * Checks if `value` is classified as a `WeakSet` object.
19306 *
19307 * @static
19308 * @memberOf _
19309 * @since 4.3.0
19310 * @category Lang
19311 * @param {*} value The value to check.
19312 * @returns {boolean} Returns `true` if `value` is a weak set, else `false`.
19313 * @example
19314 *
19315 * _.isWeakSet(new WeakSet);
19316 * // => true
19317 *
19318 * _.isWeakSet(new Set);
19319 * // => false
19320 */
19321 function isWeakSet(value) {
19322 return isObjectLike(value) && baseGetTag(value) == weakSetTag;
19323 }
19324
19325 /**
19326 * Checks if `value` is less than `other`.
19327 *
19328 * @static
19329 * @memberOf _
19330 * @since 3.9.0
19331 * @category Lang
19332 * @param {*} value The value to compare.
19333 * @param {*} other The other value to compare.
19334 * @returns {boolean} Returns `true` if `value` is less than `other`,
19335 * else `false`.
19336 * @see _.gt
19337 * @example
19338 *
19339 * _.lt(1, 3);
19340 * // => true
19341 *
19342 * _.lt(3, 3);
19343 * // => false
19344 *
19345 * _.lt(3, 1);
19346 * // => false
19347 */
19348 var lt = createRelationalOperation(baseLt);
19349
19350 /**
19351 * Checks if `value` is less than or equal to `other`.
19352 *
19353 * @static
19354 * @memberOf _
19355 * @since 3.9.0
19356 * @category Lang
19357 * @param {*} value The value to compare.
19358 * @param {*} other The other value to compare.
19359 * @returns {boolean} Returns `true` if `value` is less than or equal to
19360 * `other`, else `false`.
19361 * @see _.gte
19362 * @example
19363 *
19364 * _.lte(1, 3);
19365 * // => true
19366 *
19367 * _.lte(3, 3);
19368 * // => true
19369 *
19370 * _.lte(3, 1);
19371 * // => false
19372 */
19373 var lte = createRelationalOperation(function(value, other) {
19374 return value <= other;
19375 });
19376
19377 /**
19378 * Converts `value` to an array.
19379 *
19380 * @static
19381 * @since 0.1.0
19382 * @memberOf _
19383 * @category Lang
19384 * @param {*} value The value to convert.
19385 * @returns {Array} Returns the converted array.
19386 * @example
19387 *
19388 * _.toArray({ 'a': 1, 'b': 2 });
19389 * // => [1, 2]
19390 *
19391 * _.toArray('abc');
19392 * // => ['a', 'b', 'c']
19393 *
19394 * _.toArray(1);
19395 * // => []
19396 *
19397 * _.toArray(null);
19398 * // => []
19399 */
19400 function toArray(value) {
19401 if (!value) {
19402 return [];
19403 }
19404 if (isArrayLike(value)) {
19405 return isString(value) ? stringToArray(value) : copyArray(value);
19406 }
19407 if (symIterator && value[symIterator]) {
19408 return iteratorToArray(value[symIterator]());
19409 }
19410 var tag = getTag(value),
19411 func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values);
19412
19413 return func(value);
19414 }
19415
19416 /**
19417 * Converts `value` to a finite number.
19418 *
19419 * @static
19420 * @memberOf _
19421 * @since 4.12.0
19422 * @category Lang
19423 * @param {*} value The value to convert.
19424 * @returns {number} Returns the converted number.
19425 * @example
19426 *
19427 * _.toFinite(3.2);
19428 * // => 3.2
19429 *
19430 * _.toFinite(Number.MIN_VALUE);
19431 * // => 5e-324
19432 *
19433 * _.toFinite(Infinity);
19434 * // => 1.7976931348623157e+308
19435 *
19436 * _.toFinite('3.2');
19437 * // => 3.2
19438 */
19439 function toFinite(value) {
19440 if (!value) {
19441 return value === 0 ? value : 0;
19442 }
19443 value = toNumber(value);
19444 if (value === INFINITY || value === -INFINITY) {
19445 var sign = (value < 0 ? -1 : 1);
19446 return sign * MAX_INTEGER;
19447 }
19448 return value === value ? value : 0;
19449 }
19450
19451 /**
19452 * Converts `value` to an integer.
19453 *
19454 * **Note:** This method is loosely based on
19455 * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).
19456 *
19457 * @static
19458 * @memberOf _
19459 * @since 4.0.0
19460 * @category Lang
19461 * @param {*} value The value to convert.
19462 * @returns {number} Returns the converted integer.
19463 * @example
19464 *
19465 * _.toInteger(3.2);
19466 * // => 3
19467 *
19468 * _.toInteger(Number.MIN_VALUE);
19469 * // => 0
19470 *
19471 * _.toInteger(Infinity);
19472 * // => 1.7976931348623157e+308
19473 *
19474 * _.toInteger('3.2');
19475 * // => 3
19476 */
19477 function toInteger(value) {
19478 var result = toFinite(value),
19479 remainder = result % 1;
19480
19481 return result === result ? (remainder ? result - remainder : result) : 0;
19482 }
19483
19484 /**
19485 * Converts `value` to an integer suitable for use as the length of an
19486 * array-like object.
19487 *
19488 * **Note:** This method is based on
19489 * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
19490 *
19491 * @static
19492 * @memberOf _
19493 * @since 4.0.0
19494 * @category Lang
19495 * @param {*} value The value to convert.
19496 * @returns {number} Returns the converted integer.
19497 * @example
19498 *
19499 * _.toLength(3.2);
19500 * // => 3
19501 *
19502 * _.toLength(Number.MIN_VALUE);
19503 * // => 0
19504 *
19505 * _.toLength(Infinity);
19506 * // => 4294967295
19507 *
19508 * _.toLength('3.2');
19509 * // => 3
19510 */
19511 function toLength(value) {
19512 return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0;
19513 }
19514
19515 /**
19516 * Converts `value` to a number.
19517 *
19518 * @static
19519 * @memberOf _
19520 * @since 4.0.0
19521 * @category Lang
19522 * @param {*} value The value to process.
19523 * @returns {number} Returns the number.
19524 * @example
19525 *
19526 * _.toNumber(3.2);
19527 * // => 3.2
19528 *
19529 * _.toNumber(Number.MIN_VALUE);
19530 * // => 5e-324
19531 *
19532 * _.toNumber(Infinity);
19533 * // => Infinity
19534 *
19535 * _.toNumber('3.2');
19536 * // => 3.2
19537 */
19538 function toNumber(value) {
19539 if (typeof value == 'number') {
19540 return value;
19541 }
19542 if (isSymbol(value)) {
19543 return NAN;
19544 }
19545 if (isObject(value)) {
19546 var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
19547 value = isObject(other) ? (other + '') : other;
19548 }
19549 if (typeof value != 'string') {
19550 return value === 0 ? value : +value;
19551 }
19552 value = value.replace(reTrim, '');
19553 var isBinary = reIsBinary.test(value);
19554 return (isBinary || reIsOctal.test(value))
19555 ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
19556 : (reIsBadHex.test(value) ? NAN : +value);
19557 }
19558
19559 /**
19560 * Converts `value` to a plain object flattening inherited enumerable string
19561 * keyed properties of `value` to own properties of the plain object.
19562 *
19563 * @static
19564 * @memberOf _
19565 * @since 3.0.0
19566 * @category Lang
19567 * @param {*} value The value to convert.
19568 * @returns {Object} Returns the converted plain object.
19569 * @example
19570 *
19571 * function Foo() {
19572 * this.b = 2;
19573 * }
19574 *
19575 * Foo.prototype.c = 3;
19576 *
19577 * _.assign({ 'a': 1 }, new Foo);
19578 * // => { 'a': 1, 'b': 2 }
19579 *
19580 * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));
19581 * // => { 'a': 1, 'b': 2, 'c': 3 }
19582 */
19583 function toPlainObject(value) {
19584 return copyObject(value, keysIn(value));
19585 }
19586
19587 /**
19588 * Converts `value` to a safe integer. A safe integer can be compared and
19589 * represented correctly.
19590 *
19591 * @static
19592 * @memberOf _
19593 * @since 4.0.0
19594 * @category Lang
19595 * @param {*} value The value to convert.
19596 * @returns {number} Returns the converted integer.
19597 * @example
19598 *
19599 * _.toSafeInteger(3.2);
19600 * // => 3
19601 *
19602 * _.toSafeInteger(Number.MIN_VALUE);
19603 * // => 0
19604 *
19605 * _.toSafeInteger(Infinity);
19606 * // => 9007199254740991
19607 *
19608 * _.toSafeInteger('3.2');
19609 * // => 3
19610 */
19611 function toSafeInteger(value) {
19612 return value
19613 ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER)
19614 : (value === 0 ? value : 0);
19615 }
19616
19617 /**
19618 * Converts `value` to a string. An empty string is returned for `null`
19619 * and `undefined` values. The sign of `-0` is preserved.
19620 *
19621 * @static
19622 * @memberOf _
19623 * @since 4.0.0
19624 * @category Lang
19625 * @param {*} value The value to convert.
19626 * @returns {string} Returns the converted string.
19627 * @example
19628 *
19629 * _.toString(null);
19630 * // => ''
19631 *
19632 * _.toString(-0);
19633 * // => '-0'
19634 *
19635 * _.toString([1, 2, 3]);
19636 * // => '1,2,3'
19637 */
19638 function toString(value) {
19639 return value == null ? '' : baseToString(value);
19640 }
19641
19642 /*------------------------------------------------------------------------*/
19643
19644 /**
19645 * Assigns own enumerable string keyed properties of source objects to the
19646 * destination object. Source objects are applied from left to right.
19647 * Subsequent sources overwrite property assignments of previous sources.
19648 *
19649 * **Note:** This method mutates `object` and is loosely based on
19650 * [`Object.assign`](https://mdn.io/Object/assign).
19651 *
19652 * @static
19653 * @memberOf _
19654 * @since 0.10.0
19655 * @category Object
19656 * @param {Object} object The destination object.
19657 * @param {...Object} [sources] The source objects.
19658 * @returns {Object} Returns `object`.
19659 * @see _.assignIn
19660 * @example
19661 *
19662 * function Foo() {
19663 * this.a = 1;
19664 * }
19665 *
19666 * function Bar() {
19667 * this.c = 3;
19668 * }
19669 *
19670 * Foo.prototype.b = 2;
19671 * Bar.prototype.d = 4;
19672 *
19673 * _.assign({ 'a': 0 }, new Foo, new Bar);
19674 * // => { 'a': 1, 'c': 3 }
19675 */
19676 var assign = createAssigner(function(object, source) {
19677 if (isPrototype(source) || isArrayLike(source)) {
19678 copyObject(source, keys(source), object);
19679 return;
19680 }
19681 for (var key in source) {
19682 if (hasOwnProperty.call(source, key)) {
19683 assignValue(object, key, source[key]);
19684 }
19685 }
19686 });
19687
19688 /**
19689 * This method is like `_.assign` except that it iterates over own and
19690 * inherited source properties.
19691 *
19692 * **Note:** This method mutates `object`.
19693 *
19694 * @static
19695 * @memberOf _
19696 * @since 4.0.0
19697 * @alias extend
19698 * @category Object
19699 * @param {Object} object The destination object.
19700 * @param {...Object} [sources] The source objects.
19701 * @returns {Object} Returns `object`.
19702 * @see _.assign
19703 * @example
19704 *
19705 * function Foo() {
19706 * this.a = 1;
19707 * }
19708 *
19709 * function Bar() {
19710 * this.c = 3;
19711 * }
19712 *
19713 * Foo.prototype.b = 2;
19714 * Bar.prototype.d = 4;
19715 *
19716 * _.assignIn({ 'a': 0 }, new Foo, new Bar);
19717 * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }
19718 */
19719 var assignIn = createAssigner(function(object, source) {
19720 copyObject(source, keysIn(source), object);
19721 });
19722
19723 /**
19724 * This method is like `_.assignIn` except that it accepts `customizer`
19725 * which is invoked to produce the assigned values. If `customizer` returns
19726 * `undefined`, assignment is handled by the method instead. The `customizer`
19727 * is invoked with five arguments: (objValue, srcValue, key, object, source).
19728 *
19729 * **Note:** This method mutates `object`.
19730 *
19731 * @static
19732 * @memberOf _
19733 * @since 4.0.0
19734 * @alias extendWith
19735 * @category Object
19736 * @param {Object} object The destination object.
19737 * @param {...Object} sources The source objects.
19738 * @param {Function} [customizer] The function to customize assigned values.
19739 * @returns {Object} Returns `object`.
19740 * @see _.assignWith
19741 * @example
19742 *
19743 * function customizer(objValue, srcValue) {
19744 * return _.isUndefined(objValue) ? srcValue : objValue;
19745 * }
19746 *
19747 * var defaults = _.partialRight(_.assignInWith, customizer);
19748 *
19749 * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
19750 * // => { 'a': 1, 'b': 2 }
19751 */
19752 var assignInWith = createAssigner(function(object, source, srcIndex, customizer) {
19753 copyObject(source, keysIn(source), object, customizer);
19754 });
19755
19756 /**
19757 * This method is like `_.assign` except that it accepts `customizer`
19758 * which is invoked to produce the assigned values. If `customizer` returns
19759 * `undefined`, assignment is handled by the method instead. The `customizer`
19760 * is invoked with five arguments: (objValue, srcValue, key, object, source).
19761 *
19762 * **Note:** This method mutates `object`.
19763 *
19764 * @static
19765 * @memberOf _
19766 * @since 4.0.0
19767 * @category Object
19768 * @param {Object} object The destination object.
19769 * @param {...Object} sources The source objects.
19770 * @param {Function} [customizer] The function to customize assigned values.
19771 * @returns {Object} Returns `object`.
19772 * @see _.assignInWith
19773 * @example
19774 *
19775 * function customizer(objValue, srcValue) {
19776 * return _.isUndefined(objValue) ? srcValue : objValue;
19777 * }
19778 *
19779 * var defaults = _.partialRight(_.assignWith, customizer);
19780 *
19781 * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
19782 * // => { 'a': 1, 'b': 2 }
19783 */
19784 var assignWith = createAssigner(function(object, source, srcIndex, customizer) {
19785 copyObject(source, keys(source), object, customizer);
19786 });
19787
19788 /**
19789 * Creates an array of values corresponding to `paths` of `object`.
19790 *
19791 * @static
19792 * @memberOf _
19793 * @since 1.0.0
19794 * @category Object
19795 * @param {Object} object The object to iterate over.
19796 * @param {...(string|string[])} [paths] The property paths to pick.
19797 * @returns {Array} Returns the picked values.
19798 * @example
19799 *
19800 * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
19801 *
19802 * _.at(object, ['a[0].b.c', 'a[1]']);
19803 * // => [3, 4]
19804 */
19805 var at = flatRest(baseAt);
19806
19807 /**
19808 * Creates an object that inherits from the `prototype` object. If a
19809 * `properties` object is given, its own enumerable string keyed properties
19810 * are assigned to the created object.
19811 *
19812 * @static
19813 * @memberOf _
19814 * @since 2.3.0
19815 * @category Object
19816 * @param {Object} prototype The object to inherit from.
19817 * @param {Object} [properties] The properties to assign to the object.
19818 * @returns {Object} Returns the new object.
19819 * @example
19820 *
19821 * function Shape() {
19822 * this.x = 0;
19823 * this.y = 0;
19824 * }
19825 *
19826 * function Circle() {
19827 * Shape.call(this);
19828 * }
19829 *
19830 * Circle.prototype = _.create(Shape.prototype, {
19831 * 'constructor': Circle
19832 * });
19833 *
19834 * var circle = new Circle;
19835 * circle instanceof Circle;
19836 * // => true
19837 *
19838 * circle instanceof Shape;
19839 * // => true
19840 */
19841 function create(prototype, properties) {
19842 var result = baseCreate(prototype);
19843 return properties == null ? result : baseAssign(result, properties);
19844 }
19845
19846 /**
19847 * Assigns own and inherited enumerable string keyed properties of source
19848 * objects to the destination object for all destination properties that
19849 * resolve to `undefined`. Source objects are applied from left to right.
19850 * Once a property is set, additional values of the same property are ignored.
19851 *
19852 * **Note:** This method mutates `object`.
19853 *
19854 * @static
19855 * @since 0.1.0
19856 * @memberOf _
19857 * @category Object
19858 * @param {Object} object The destination object.
19859 * @param {...Object} [sources] The source objects.
19860 * @returns {Object} Returns `object`.
19861 * @see _.defaultsDeep
19862 * @example
19863 *
19864 * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
19865 * // => { 'a': 1, 'b': 2 }
19866 */
19867 var defaults = baseRest(function(args) {
19868 args.push(undefined, customDefaultsAssignIn);
19869 return apply(assignInWith, undefined, args);
19870 });
19871
19872 /**
19873 * This method is like `_.defaults` except that it recursively assigns
19874 * default properties.
19875 *
19876 * **Note:** This method mutates `object`.
19877 *
19878 * @static
19879 * @memberOf _
19880 * @since 3.10.0
19881 * @category Object
19882 * @param {Object} object The destination object.
19883 * @param {...Object} [sources] The source objects.
19884 * @returns {Object} Returns `object`.
19885 * @see _.defaults
19886 * @example
19887 *
19888 * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } });
19889 * // => { 'a': { 'b': 2, 'c': 3 } }
19890 */
19891 var defaultsDeep = baseRest(function(args) {
19892 args.push(undefined, customDefaultsMerge);
19893 return apply(mergeWith, undefined, args);
19894 });
19895
19896 /**
19897 * This method is like `_.find` except that it returns the key of the first
19898 * element `predicate` returns truthy for instead of the element itself.
19899 *
19900 * @static
19901 * @memberOf _
19902 * @since 1.1.0
19903 * @category Object
19904 * @param {Object} object The object to inspect.
19905 * @param {Function} [predicate=_.identity] The function invoked per iteration.
19906 * @returns {string|undefined} Returns the key of the matched element,
19907 * else `undefined`.
19908 * @example
19909 *
19910 * var users = {
19911 * 'barney': { 'age': 36, 'active': true },
19912 * 'fred': { 'age': 40, 'active': false },
19913 * 'pebbles': { 'age': 1, 'active': true }
19914 * };
19915 *
19916 * _.findKey(users, function(o) { return o.age < 40; });
19917 * // => 'barney' (iteration order is not guaranteed)
19918 *
19919 * // The `_.matches` iteratee shorthand.
19920 * _.findKey(users, { 'age': 1, 'active': true });
19921 * // => 'pebbles'
19922 *
19923 * // The `_.matchesProperty` iteratee shorthand.
19924 * _.findKey(users, ['active', false]);
19925 * // => 'fred'
19926 *
19927 * // The `_.property` iteratee shorthand.
19928 * _.findKey(users, 'active');
19929 * // => 'barney'
19930 */
19931 function findKey(object, predicate) {
19932 return baseFindKey(object, getIteratee(predicate, 3), baseForOwn);
19933 }
19934
19935 /**
19936 * This method is like `_.findKey` except that it iterates over elements of
19937 * a collection in the opposite order.
19938 *
19939 * @static
19940 * @memberOf _
19941 * @since 2.0.0
19942 * @category Object
19943 * @param {Object} object The object to inspect.
19944 * @param {Function} [predicate=_.identity] The function invoked per iteration.
19945 * @returns {string|undefined} Returns the key of the matched element,
19946 * else `undefined`.
19947 * @example
19948 *
19949 * var users = {
19950 * 'barney': { 'age': 36, 'active': true },
19951 * 'fred': { 'age': 40, 'active': false },
19952 * 'pebbles': { 'age': 1, 'active': true }
19953 * };
19954 *
19955 * _.findLastKey(users, function(o) { return o.age < 40; });
19956 * // => returns 'pebbles' assuming `_.findKey` returns 'barney'
19957 *
19958 * // The `_.matches` iteratee shorthand.
19959 * _.findLastKey(users, { 'age': 36, 'active': true });
19960 * // => 'barney'
19961 *
19962 * // The `_.matchesProperty` iteratee shorthand.
19963 * _.findLastKey(users, ['active', false]);
19964 * // => 'fred'
19965 *
19966 * // The `_.property` iteratee shorthand.
19967 * _.findLastKey(users, 'active');
19968 * // => 'pebbles'
19969 */
19970 function findLastKey(object, predicate) {
19971 return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight);
19972 }
19973
19974 /**
19975 * Iterates over own and inherited enumerable string keyed properties of an
19976 * object and invokes `iteratee` for each property. The iteratee is invoked
19977 * with three arguments: (value, key, object). Iteratee functions may exit
19978 * iteration early by explicitly returning `false`.
19979 *
19980 * @static
19981 * @memberOf _
19982 * @since 0.3.0
19983 * @category Object
19984 * @param {Object} object The object to iterate over.
19985 * @param {Function} [iteratee=_.identity] The function invoked per iteration.
19986 * @returns {Object} Returns `object`.
19987 * @see _.forInRight
19988 * @example
19989 *
19990 * function Foo() {
19991 * this.a = 1;
19992 * this.b = 2;
19993 * }
19994 *
19995 * Foo.prototype.c = 3;
19996 *
19997 * _.forIn(new Foo, function(value, key) {
19998 * console.log(key);
19999 * });
20000 * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed).
20001 */
20002 function forIn(object, iteratee) {
20003 return object == null
20004 ? object
20005 : baseFor(object, getIteratee(iteratee, 3), keysIn);
20006 }
20007
20008 /**
20009 * This method is like `_.forIn` except that it iterates over properties of
20010 * `object` in the opposite order.
20011 *
20012 * @static
20013 * @memberOf _
20014 * @since 2.0.0
20015 * @category Object
20016 * @param {Object} object The object to iterate over.
20017 * @param {Function} [iteratee=_.identity] The function invoked per iteration.
20018 * @returns {Object} Returns `object`.
20019 * @see _.forIn
20020 * @example
20021 *
20022 * function Foo() {
20023 * this.a = 1;
20024 * this.b = 2;
20025 * }
20026 *
20027 * Foo.prototype.c = 3;
20028 *
20029 * _.forInRight(new Foo, function(value, key) {
20030 * console.log(key);
20031 * });
20032 * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'.
20033 */
20034 function forInRight(object, iteratee) {
20035 return object == null
20036 ? object
20037 : baseForRight(object, getIteratee(iteratee, 3), keysIn);
20038 }
20039
20040 /**
20041 * Iterates over own enumerable string keyed properties of an object and
20042 * invokes `iteratee` for each property. The iteratee is invoked with three
20043 * arguments: (value, key, object). Iteratee functions may exit iteration
20044 * early by explicitly returning `false`.
20045 *
20046 * @static
20047 * @memberOf _
20048 * @since 0.3.0
20049 * @category Object
20050 * @param {Object} object The object to iterate over.
20051 * @param {Function} [iteratee=_.identity] The function invoked per iteration.
20052 * @returns {Object} Returns `object`.
20053 * @see _.forOwnRight
20054 * @example
20055 *
20056 * function Foo() {
20057 * this.a = 1;
20058 * this.b = 2;
20059 * }
20060 *
20061 * Foo.prototype.c = 3;
20062 *
20063 * _.forOwn(new Foo, function(value, key) {
20064 * console.log(key);
20065 * });
20066 * // => Logs 'a' then 'b' (iteration order is not guaranteed).
20067 */
20068 function forOwn(object, iteratee) {
20069 return object && baseForOwn(object, getIteratee(iteratee, 3));
20070 }
20071
20072 /**
20073 * This method is like `_.forOwn` except that it iterates over properties of
20074 * `object` in the opposite order.
20075 *
20076 * @static
20077 * @memberOf _
20078 * @since 2.0.0
20079 * @category Object
20080 * @param {Object} object The object to iterate over.
20081 * @param {Function} [iteratee=_.identity] The function invoked per iteration.
20082 * @returns {Object} Returns `object`.
20083 * @see _.forOwn
20084 * @example
20085 *
20086 * function Foo() {
20087 * this.a = 1;
20088 * this.b = 2;
20089 * }
20090 *
20091 * Foo.prototype.c = 3;
20092 *
20093 * _.forOwnRight(new Foo, function(value, key) {
20094 * console.log(key);
20095 * });
20096 * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'.
20097 */
20098 function forOwnRight(object, iteratee) {
20099 return object && baseForOwnRight(object, getIteratee(iteratee, 3));
20100 }
20101
20102 /**
20103 * Creates an array of function property names from own enumerable properties
20104 * of `object`.
20105 *
20106 * @static
20107 * @since 0.1.0
20108 * @memberOf _
20109 * @category Object
20110 * @param {Object} object The object to inspect.
20111 * @returns {Array} Returns the function names.
20112 * @see _.functionsIn
20113 * @example
20114 *
20115 * function Foo() {
20116 * this.a = _.constant('a');
20117 * this.b = _.constant('b');
20118 * }
20119 *
20120 * Foo.prototype.c = _.constant('c');
20121 *
20122 * _.functions(new Foo);
20123 * // => ['a', 'b']
20124 */
20125 function functions(object) {
20126 return object == null ? [] : baseFunctions(object, keys(object));
20127 }
20128
20129 /**
20130 * Creates an array of function property names from own and inherited
20131 * enumerable properties of `object`.
20132 *
20133 * @static
20134 * @memberOf _
20135 * @since 4.0.0
20136 * @category Object
20137 * @param {Object} object The object to inspect.
20138 * @returns {Array} Returns the function names.
20139 * @see _.functions
20140 * @example
20141 *
20142 * function Foo() {
20143 * this.a = _.constant('a');
20144 * this.b = _.constant('b');
20145 * }
20146 *
20147 * Foo.prototype.c = _.constant('c');
20148 *
20149 * _.functionsIn(new Foo);
20150 * // => ['a', 'b', 'c']
20151 */
20152 function functionsIn(object) {
20153 return object == null ? [] : baseFunctions(object, keysIn(object));
20154 }
20155
20156 /**
20157 * Gets the value at `path` of `object`. If the resolved value is
20158 * `undefined`, the `defaultValue` is returned in its place.
20159 *
20160 * @static
20161 * @memberOf _
20162 * @since 3.7.0
20163 * @category Object
20164 * @param {Object} object The object to query.
20165 * @param {Array|string} path The path of the property to get.
20166 * @param {*} [defaultValue] The value returned for `undefined` resolved values.
20167 * @returns {*} Returns the resolved value.
20168 * @example
20169 *
20170 * var object = { 'a': [{ 'b': { 'c': 3 } }] };
20171 *
20172 * _.get(object, 'a[0].b.c');
20173 * // => 3
20174 *
20175 * _.get(object, ['a', '0', 'b', 'c']);
20176 * // => 3
20177 *
20178 * _.get(object, 'a.b.c', 'default');
20179 * // => 'default'
20180 */
20181 function get(object, path, defaultValue) {
20182 var result = object == null ? undefined : baseGet(object, path);
20183 return result === undefined ? defaultValue : result;
20184 }
20185
20186 /**
20187 * Checks if `path` is a direct property of `object`.
20188 *
20189 * @static
20190 * @since 0.1.0
20191 * @memberOf _
20192 * @category Object
20193 * @param {Object} object The object to query.
20194 * @param {Array|string} path The path to check.
20195 * @returns {boolean} Returns `true` if `path` exists, else `false`.
20196 * @example
20197 *
20198 * var object = { 'a': { 'b': 2 } };
20199 * var other = _.create({ 'a': _.create({ 'b': 2 }) });
20200 *
20201 * _.has(object, 'a');
20202 * // => true
20203 *
20204 * _.has(object, 'a.b');
20205 * // => true
20206 *
20207 * _.has(object, ['a', 'b']);
20208 * // => true
20209 *
20210 * _.has(other, 'a');
20211 * // => false
20212 */
20213 function has(object, path) {
20214 return object != null && hasPath(object, path, baseHas);
20215 }
20216
20217 /**
20218 * Checks if `path` is a direct or inherited property of `object`.
20219 *
20220 * @static
20221 * @memberOf _
20222 * @since 4.0.0
20223 * @category Object
20224 * @param {Object} object The object to query.
20225 * @param {Array|string} path The path to check.
20226 * @returns {boolean} Returns `true` if `path` exists, else `false`.
20227 * @example
20228 *
20229 * var object = _.create({ 'a': _.create({ 'b': 2 }) });
20230 *
20231 * _.hasIn(object, 'a');
20232 * // => true
20233 *
20234 * _.hasIn(object, 'a.b');
20235 * // => true
20236 *
20237 * _.hasIn(object, ['a', 'b']);
20238 * // => true
20239 *
20240 * _.hasIn(object, 'b');
20241 * // => false
20242 */
20243 function hasIn(object, path) {
20244 return object != null && hasPath(object, path, baseHasIn);
20245 }
20246
20247 /**
20248 * Creates an object composed of the inverted keys and values of `object`.
20249 * If `object` contains duplicate values, subsequent values overwrite
20250 * property assignments of previous values.
20251 *
20252 * @static
20253 * @memberOf _
20254 * @since 0.7.0
20255 * @category Object
20256 * @param {Object} object The object to invert.
20257 * @returns {Object} Returns the new inverted object.
20258 * @example
20259 *
20260 * var object = { 'a': 1, 'b': 2, 'c': 1 };
20261 *
20262 * _.invert(object);
20263 * // => { '1': 'c', '2': 'b' }
20264 */
20265 var invert = createInverter(function(result, value, key) {
20266 result[value] = key;
20267 }, constant(identity));
20268
20269 /**
20270 * This method is like `_.invert` except that the inverted object is generated
20271 * from the results of running each element of `object` thru `iteratee`. The
20272 * corresponding inverted value of each inverted key is an array of keys
20273 * responsible for generating the inverted value. The iteratee is invoked
20274 * with one argument: (value).
20275 *
20276 * @static
20277 * @memberOf _
20278 * @since 4.1.0
20279 * @category Object
20280 * @param {Object} object The object to invert.
20281 * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
20282 * @returns {Object} Returns the new inverted object.
20283 * @example
20284 *
20285 * var object = { 'a': 1, 'b': 2, 'c': 1 };
20286 *
20287 * _.invertBy(object);
20288 * // => { '1': ['a', 'c'], '2': ['b'] }
20289 *
20290 * _.invertBy(object, function(value) {
20291 * return 'group' + value;
20292 * });
20293 * // => { 'group1': ['a', 'c'], 'group2': ['b'] }
20294 */
20295 var invertBy = createInverter(function(result, value, key) {
20296 if (hasOwnProperty.call(result, value)) {
20297 result[value].push(key);
20298 } else {
20299 result[value] = [key];
20300 }
20301 }, getIteratee);
20302
20303 /**
20304 * Invokes the method at `path` of `object`.
20305 *
20306 * @static
20307 * @memberOf _
20308 * @since 4.0.0
20309 * @category Object
20310 * @param {Object} object The object to query.
20311 * @param {Array|string} path The path of the method to invoke.
20312 * @param {...*} [args] The arguments to invoke the method with.
20313 * @returns {*} Returns the result of the invoked method.
20314 * @example
20315 *
20316 * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] };
20317 *
20318 * _.invoke(object, 'a[0].b.c.slice', 1, 3);
20319 * // => [2, 3]
20320 */
20321 var invoke = baseRest(baseInvoke);
20322
20323 /**
20324 * Creates an array of the own enumerable property names of `object`.
20325 *
20326 * **Note:** Non-object values are coerced to objects. See the
20327 * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
20328 * for more details.
20329 *
20330 * @static
20331 * @since 0.1.0
20332 * @memberOf _
20333 * @category Object
20334 * @param {Object} object The object to query.
20335 * @returns {Array} Returns the array of property names.
20336 * @example
20337 *
20338 * function Foo() {
20339 * this.a = 1;
20340 * this.b = 2;
20341 * }
20342 *
20343 * Foo.prototype.c = 3;
20344 *
20345 * _.keys(new Foo);
20346 * // => ['a', 'b'] (iteration order is not guaranteed)
20347 *
20348 * _.keys('hi');
20349 * // => ['0', '1']
20350 */
20351 function keys(object) {
20352 return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
20353 }
20354
20355 /**
20356 * Creates an array of the own and inherited enumerable property names of `object`.
20357 *
20358 * **Note:** Non-object values are coerced to objects.
20359 *
20360 * @static
20361 * @memberOf _
20362 * @since 3.0.0
20363 * @category Object
20364 * @param {Object} object The object to query.
20365 * @returns {Array} Returns the array of property names.
20366 * @example
20367 *
20368 * function Foo() {
20369 * this.a = 1;
20370 * this.b = 2;
20371 * }
20372 *
20373 * Foo.prototype.c = 3;
20374 *
20375 * _.keysIn(new Foo);
20376 * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
20377 */
20378 function keysIn(object) {
20379 return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
20380 }
20381
20382 /**
20383 * The opposite of `_.mapValues`; this method creates an object with the
20384 * same values as `object` and keys generated by running each own enumerable
20385 * string keyed property of `object` thru `iteratee`. The iteratee is invoked
20386 * with three arguments: (value, key, object).
20387 *
20388 * @static
20389 * @memberOf _
20390 * @since 3.8.0
20391 * @category Object
20392 * @param {Object} object The object to iterate over.
20393 * @param {Function} [iteratee=_.identity] The function invoked per iteration.
20394 * @returns {Object} Returns the new mapped object.
20395 * @see _.mapValues
20396 * @example
20397 *
20398 * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {
20399 * return key + value;
20400 * });
20401 * // => { 'a1': 1, 'b2': 2 }
20402 */
20403 function mapKeys(object, iteratee) {
20404 var result = {};
20405 iteratee = getIteratee(iteratee, 3);
20406
20407 baseForOwn(object, function(value, key, object) {
20408 baseAssignValue(result, iteratee(value, key, object), value);
20409 });
20410 return result;
20411 }
20412
20413 /**
20414 * Creates an object with the same keys as `object` and values generated
20415 * by running each own enumerable string keyed property of `object` thru
20416 * `iteratee`. The iteratee is invoked with three arguments:
20417 * (value, key, object).
20418 *
20419 * @static
20420 * @memberOf _
20421 * @since 2.4.0
20422 * @category Object
20423 * @param {Object} object The object to iterate over.
20424 * @param {Function} [iteratee=_.identity] The function invoked per iteration.
20425 * @returns {Object} Returns the new mapped object.
20426 * @see _.mapKeys
20427 * @example
20428 *
20429 * var users = {
20430 * 'fred': { 'user': 'fred', 'age': 40 },
20431 * 'pebbles': { 'user': 'pebbles', 'age': 1 }
20432 * };
20433 *
20434 * _.mapValues(users, function(o) { return o.age; });
20435 * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
20436 *
20437 * // The `_.property` iteratee shorthand.
20438 * _.mapValues(users, 'age');
20439 * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
20440 */
20441 function mapValues(object, iteratee) {
20442 var result = {};
20443 iteratee = getIteratee(iteratee, 3);
20444
20445 baseForOwn(object, function(value, key, object) {
20446 baseAssignValue(result, key, iteratee(value, key, object));
20447 });
20448 return result;
20449 }
20450
20451 /**
20452 * This method is like `_.assign` except that it recursively merges own and
20453 * inherited enumerable string keyed properties of source objects into the
20454 * destination object. Source properties that resolve to `undefined` are
20455 * skipped if a destination value exists. Array and plain object properties
20456 * are merged recursively. Other objects and value types are overridden by
20457 * assignment. Source objects are applied from left to right. Subsequent
20458 * sources overwrite property assignments of previous sources.
20459 *
20460 * **Note:** This method mutates `object`.
20461 *
20462 * @static
20463 * @memberOf _
20464 * @since 0.5.0
20465 * @category Object
20466 * @param {Object} object The destination object.
20467 * @param {...Object} [sources] The source objects.
20468 * @returns {Object} Returns `object`.
20469 * @example
20470 *
20471 * var object = {
20472 * 'a': [{ 'b': 2 }, { 'd': 4 }]
20473 * };
20474 *
20475 * var other = {
20476 * 'a': [{ 'c': 3 }, { 'e': 5 }]
20477 * };
20478 *
20479 * _.merge(object, other);
20480 * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }
20481 */
20482 var merge = createAssigner(function(object, source, srcIndex) {
20483 baseMerge(object, source, srcIndex);
20484 });
20485
20486 /**
20487 * This method is like `_.merge` except that it accepts `customizer` which
20488 * is invoked to produce the merged values of the destination and source
20489 * properties. If `customizer` returns `undefined`, merging is handled by the
20490 * method instead. The `customizer` is invoked with six arguments:
20491 * (objValue, srcValue, key, object, source, stack).
20492 *
20493 * **Note:** This method mutates `object`.
20494 *
20495 * @static
20496 * @memberOf _
20497 * @since 4.0.0
20498 * @category Object
20499 * @param {Object} object The destination object.
20500 * @param {...Object} sources The source objects.
20501 * @param {Function} customizer The function to customize assigned values.
20502 * @returns {Object} Returns `object`.
20503 * @example
20504 *
20505 * function customizer(objValue, srcValue) {
20506 * if (_.isArray(objValue)) {
20507 * return objValue.concat(srcValue);
20508 * }
20509 * }
20510 *
20511 * var object = { 'a': [1], 'b': [2] };
20512 * var other = { 'a': [3], 'b': [4] };
20513 *
20514 * _.mergeWith(object, other, customizer);
20515 * // => { 'a': [1, 3], 'b': [2, 4] }
20516 */
20517 var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {
20518 baseMerge(object, source, srcIndex, customizer);
20519 });
20520
20521 /**
20522 * The opposite of `_.pick`; this method creates an object composed of the
20523 * own and inherited enumerable property paths of `object` that are not omitted.
20524 *
20525 * **Note:** This method is considerably slower than `_.pick`.
20526 *
20527 * @static
20528 * @since 0.1.0
20529 * @memberOf _
20530 * @category Object
20531 * @param {Object} object The source object.
20532 * @param {...(string|string[])} [paths] The property paths to omit.
20533 * @returns {Object} Returns the new object.
20534 * @example
20535 *
20536 * var object = { 'a': 1, 'b': '2', 'c': 3 };
20537 *
20538 * _.omit(object, ['a', 'c']);
20539 * // => { 'b': '2' }
20540 */
20541 var omit = flatRest(function(object, paths) {
20542 var result = {};
20543 if (object == null) {
20544 return result;
20545 }
20546 var isDeep = false;
20547 paths = arrayMap(paths, function(path) {
20548 path = castPath(path, object);
20549 isDeep || (isDeep = path.length > 1);
20550 return path;
20551 });
20552 copyObject(object, getAllKeysIn(object), result);
20553 if (isDeep) {
20554 result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);
20555 }
20556 var length = paths.length;
20557 while (length--) {
20558 baseUnset(result, paths[length]);
20559 }
20560 return result;
20561 });
20562
20563 /**
20564 * The opposite of `_.pickBy`; this method creates an object composed of
20565 * the own and inherited enumerable string keyed properties of `object` that
20566 * `predicate` doesn't return truthy for. The predicate is invoked with two
20567 * arguments: (value, key).
20568 *
20569 * @static
20570 * @memberOf _
20571 * @since 4.0.0
20572 * @category Object
20573 * @param {Object} object The source object.
20574 * @param {Function} [predicate=_.identity] The function invoked per property.
20575 * @returns {Object} Returns the new object.
20576 * @example
20577 *
20578 * var object = { 'a': 1, 'b': '2', 'c': 3 };
20579 *
20580 * _.omitBy(object, _.isNumber);
20581 * // => { 'b': '2' }
20582 */
20583 function omitBy(object, predicate) {
20584 return pickBy(object, negate(getIteratee(predicate)));
20585 }
20586
20587 /**
20588 * Creates an object composed of the picked `object` properties.
20589 *
20590 * @static
20591 * @since 0.1.0
20592 * @memberOf _
20593 * @category Object
20594 * @param {Object} object The source object.
20595 * @param {...(string|string[])} [paths] The property paths to pick.
20596 * @returns {Object} Returns the new object.
20597 * @example
20598 *
20599 * var object = { 'a': 1, 'b': '2', 'c': 3 };
20600 *
20601 * _.pick(object, ['a', 'c']);
20602 * // => { 'a': 1, 'c': 3 }
20603 */
20604 var pick = flatRest(function(object, paths) {
20605 return object == null ? {} : basePick(object, paths);
20606 });
20607
20608 /**
20609 * Creates an object composed of the `object` properties `predicate` returns
20610 * truthy for. The predicate is invoked with two arguments: (value, key).
20611 *
20612 * @static
20613 * @memberOf _
20614 * @since 4.0.0
20615 * @category Object
20616 * @param {Object} object The source object.
20617 * @param {Function} [predicate=_.identity] The function invoked per property.
20618 * @returns {Object} Returns the new object.
20619 * @example
20620 *
20621 * var object = { 'a': 1, 'b': '2', 'c': 3 };
20622 *
20623 * _.pickBy(object, _.isNumber);
20624 * // => { 'a': 1, 'c': 3 }
20625 */
20626 function pickBy(object, predicate) {
20627 if (object == null) {
20628 return {};
20629 }
20630 var props = arrayMap(getAllKeysIn(object), function(prop) {
20631 return [prop];
20632 });
20633 predicate = getIteratee(predicate);
20634 return basePickBy(object, props, function(value, path) {
20635 return predicate(value, path[0]);
20636 });
20637 }
20638
20639 /**
20640 * This method is like `_.get` except that if the resolved value is a
20641 * function it's invoked with the `this` binding of its parent object and
20642 * its result is returned.
20643 *
20644 * @static
20645 * @since 0.1.0
20646 * @memberOf _
20647 * @category Object
20648 * @param {Object} object The object to query.
20649 * @param {Array|string} path The path of the property to resolve.
20650 * @param {*} [defaultValue] The value returned for `undefined` resolved values.
20651 * @returns {*} Returns the resolved value.
20652 * @example
20653 *
20654 * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };
20655 *
20656 * _.result(object, 'a[0].b.c1');
20657 * // => 3
20658 *
20659 * _.result(object, 'a[0].b.c2');
20660 * // => 4
20661 *
20662 * _.result(object, 'a[0].b.c3', 'default');
20663 * // => 'default'
20664 *
20665 * _.result(object, 'a[0].b.c3', _.constant('default'));
20666 * // => 'default'
20667 */
20668 function result(object, path, defaultValue) {
20669 path = castPath(path, object);
20670
20671 var index = -1,
20672 length = path.length;
20673
20674 // Ensure the loop is entered when path is empty.
20675 if (!length) {
20676 length = 1;
20677 object = undefined;
20678 }
20679 while (++index < length) {
20680 var value = object == null ? undefined : object[toKey(path[index])];
20681 if (value === undefined) {
20682 index = length;
20683 value = defaultValue;
20684 }
20685 object = isFunction(value) ? value.call(object) : value;
20686 }
20687 return object;
20688 }
20689
20690 /**
20691 * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
20692 * it's created. Arrays are created for missing index properties while objects
20693 * are created for all other missing properties. Use `_.setWith` to customize
20694 * `path` creation.
20695 *
20696 * **Note:** This method mutates `object`.
20697 *
20698 * @static
20699 * @memberOf _
20700 * @since 3.7.0
20701 * @category Object
20702 * @param {Object} object The object to modify.
20703 * @param {Array|string} path The path of the property to set.
20704 * @param {*} value The value to set.
20705 * @returns {Object} Returns `object`.
20706 * @example
20707 *
20708 * var object = { 'a': [{ 'b': { 'c': 3 } }] };
20709 *
20710 * _.set(object, 'a[0].b.c', 4);
20711 * console.log(object.a[0].b.c);
20712 * // => 4
20713 *
20714 * _.set(object, ['x', '0', 'y', 'z'], 5);
20715 * console.log(object.x[0].y.z);
20716 * // => 5
20717 */
20718 function set(object, path, value) {
20719 return object == null ? object : baseSet(object, path, value);
20720 }
20721
20722 /**
20723 * This method is like `_.set` except that it accepts `customizer` which is
20724 * invoked to produce the objects of `path`. If `customizer` returns `undefined`
20725 * path creation is handled by the method instead. The `customizer` is invoked
20726 * with three arguments: (nsValue, key, nsObject).
20727 *
20728 * **Note:** This method mutates `object`.
20729 *
20730 * @static
20731 * @memberOf _
20732 * @since 4.0.0
20733 * @category Object
20734 * @param {Object} object The object to modify.
20735 * @param {Array|string} path The path of the property to set.
20736 * @param {*} value The value to set.
20737 * @param {Function} [customizer] The function to customize assigned values.
20738 * @returns {Object} Returns `object`.
20739 * @example
20740 *
20741 * var object = {};
20742 *
20743 * _.setWith(object, '[0][1]', 'a', Object);
20744 * // => { '0': { '1': 'a' } }
20745 */
20746 function setWith(object, path, value, customizer) {
20747 customizer = typeof customizer == 'function' ? customizer : undefined;
20748 return object == null ? object : baseSet(object, path, value, customizer);
20749 }
20750
20751 /**
20752 * Creates an array of own enumerable string keyed-value pairs for `object`
20753 * which can be consumed by `_.fromPairs`. If `object` is a map or set, its
20754 * entries are returned.
20755 *
20756 * @static
20757 * @memberOf _
20758 * @since 4.0.0
20759 * @alias entries
20760 * @category Object
20761 * @param {Object} object The object to query.
20762 * @returns {Array} Returns the key-value pairs.
20763 * @example
20764 *
20765 * function Foo() {
20766 * this.a = 1;
20767 * this.b = 2;
20768 * }
20769 *
20770 * Foo.prototype.c = 3;
20771 *
20772 * _.toPairs(new Foo);
20773 * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)
20774 */
20775 var toPairs = createToPairs(keys);
20776
20777 /**
20778 * Creates an array of own and inherited enumerable string keyed-value pairs
20779 * for `object` which can be consumed by `_.fromPairs`. If `object` is a map
20780 * or set, its entries are returned.
20781 *
20782 * @static
20783 * @memberOf _
20784 * @since 4.0.0
20785 * @alias entriesIn
20786 * @category Object
20787 * @param {Object} object The object to query.
20788 * @returns {Array} Returns the key-value pairs.
20789 * @example
20790 *
20791 * function Foo() {
20792 * this.a = 1;
20793 * this.b = 2;
20794 * }
20795 *
20796 * Foo.prototype.c = 3;
20797 *
20798 * _.toPairsIn(new Foo);
20799 * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed)
20800 */
20801 var toPairsIn = createToPairs(keysIn);
20802
20803 /**
20804 * An alternative to `_.reduce`; this method transforms `object` to a new
20805 * `accumulator` object which is the result of running each of its own
20806 * enumerable string keyed properties thru `iteratee`, with each invocation
20807 * potentially mutating the `accumulator` object. If `accumulator` is not
20808 * provided, a new object with the same `[[Prototype]]` will be used. The
20809 * iteratee is invoked with four arguments: (accumulator, value, key, object).
20810 * Iteratee functions may exit iteration early by explicitly returning `false`.
20811 *
20812 * @static
20813 * @memberOf _
20814 * @since 1.3.0
20815 * @category Object
20816 * @param {Object} object The object to iterate over.
20817 * @param {Function} [iteratee=_.identity] The function invoked per iteration.
20818 * @param {*} [accumulator] The custom accumulator value.
20819 * @returns {*} Returns the accumulated value.
20820 * @example
20821 *
20822 * _.transform([2, 3, 4], function(result, n) {
20823 * result.push(n *= n);
20824 * return n % 2 == 0;
20825 * }, []);
20826 * // => [4, 9]
20827 *
20828 * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
20829 * (result[value] || (result[value] = [])).push(key);
20830 * }, {});
20831 * // => { '1': ['a', 'c'], '2': ['b'] }
20832 */
20833 function transform(object, iteratee, accumulator) {
20834 var isArr = isArray(object),
20835 isArrLike = isArr || isBuffer(object) || isTypedArray(object);
20836
20837 iteratee = getIteratee(iteratee, 4);
20838 if (accumulator == null) {
20839 var Ctor = object && object.constructor;
20840 if (isArrLike) {
20841 accumulator = isArr ? new Ctor : [];
20842 }
20843 else if (isObject(object)) {
20844 accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {};
20845 }
20846 else {
20847 accumulator = {};
20848 }
20849 }
20850 (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) {
20851 return iteratee(accumulator, value, index, object);
20852 });
20853 return accumulator;
20854 }
20855
20856 /**
20857 * Removes the property at `path` of `object`.
20858 *
20859 * **Note:** This method mutates `object`.
20860 *
20861 * @static
20862 * @memberOf _
20863 * @since 4.0.0
20864 * @category Object
20865 * @param {Object} object The object to modify.
20866 * @param {Array|string} path The path of the property to unset.
20867 * @returns {boolean} Returns `true` if the property is deleted, else `false`.
20868 * @example
20869 *
20870 * var object = { 'a': [{ 'b': { 'c': 7 } }] };
20871 * _.unset(object, 'a[0].b.c');
20872 * // => true
20873 *
20874 * console.log(object);
20875 * // => { 'a': [{ 'b': {} }] };
20876 *
20877 * _.unset(object, ['a', '0', 'b', 'c']);
20878 * // => true
20879 *
20880 * console.log(object);
20881 * // => { 'a': [{ 'b': {} }] };
20882 */
20883 function unset(object, path) {
20884 return object == null ? true : baseUnset(object, path);
20885 }
20886
20887 /**
20888 * This method is like `_.set` except that accepts `updater` to produce the
20889 * value to set. Use `_.updateWith` to customize `path` creation. The `updater`
20890 * is invoked with one argument: (value).
20891 *
20892 * **Note:** This method mutates `object`.
20893 *
20894 * @static
20895 * @memberOf _
20896 * @since 4.6.0
20897 * @category Object
20898 * @param {Object} object The object to modify.
20899 * @param {Array|string} path The path of the property to set.
20900 * @param {Function} updater The function to produce the updated value.
20901 * @returns {Object} Returns `object`.
20902 * @example
20903 *
20904 * var object = { 'a': [{ 'b': { 'c': 3 } }] };
20905 *
20906 * _.update(object, 'a[0].b.c', function(n) { return n * n; });
20907 * console.log(object.a[0].b.c);
20908 * // => 9
20909 *
20910 * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; });
20911 * console.log(object.x[0].y.z);
20912 * // => 0
20913 */
20914 function update(object, path, updater) {
20915 return object == null ? object : baseUpdate(object, path, castFunction(updater));
20916 }
20917
20918 /**
20919 * This method is like `_.update` except that it accepts `customizer` which is
20920 * invoked to produce the objects of `path`. If `customizer` returns `undefined`
20921 * path creation is handled by the method instead. The `customizer` is invoked
20922 * with three arguments: (nsValue, key, nsObject).
20923 *
20924 * **Note:** This method mutates `object`.
20925 *
20926 * @static
20927 * @memberOf _
20928 * @since 4.6.0
20929 * @category Object
20930 * @param {Object} object The object to modify.
20931 * @param {Array|string} path The path of the property to set.
20932 * @param {Function} updater The function to produce the updated value.
20933 * @param {Function} [customizer] The function to customize assigned values.
20934 * @returns {Object} Returns `object`.
20935 * @example
20936 *
20937 * var object = {};
20938 *
20939 * _.updateWith(object, '[0][1]', _.constant('a'), Object);
20940 * // => { '0': { '1': 'a' } }
20941 */
20942 function updateWith(object, path, updater, customizer) {
20943 customizer = typeof customizer == 'function' ? customizer : undefined;
20944 return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer);
20945 }
20946
20947 /**
20948 * Creates an array of the own enumerable string keyed property values of `object`.
20949 *
20950 * **Note:** Non-object values are coerced to objects.
20951 *
20952 * @static
20953 * @since 0.1.0
20954 * @memberOf _
20955 * @category Object
20956 * @param {Object} object The object to query.
20957 * @returns {Array} Returns the array of property values.
20958 * @example
20959 *
20960 * function Foo() {
20961 * this.a = 1;
20962 * this.b = 2;
20963 * }
20964 *
20965 * Foo.prototype.c = 3;
20966 *
20967 * _.values(new Foo);
20968 * // => [1, 2] (iteration order is not guaranteed)
20969 *
20970 * _.values('hi');
20971 * // => ['h', 'i']
20972 */
20973 function values(object) {
20974 return object == null ? [] : baseValues(object, keys(object));
20975 }
20976
20977 /**
20978 * Creates an array of the own and inherited enumerable string keyed property
20979 * values of `object`.
20980 *
20981 * **Note:** Non-object values are coerced to objects.
20982 *
20983 * @static
20984 * @memberOf _
20985 * @since 3.0.0
20986 * @category Object
20987 * @param {Object} object The object to query.
20988 * @returns {Array} Returns the array of property values.
20989 * @example
20990 *
20991 * function Foo() {
20992 * this.a = 1;
20993 * this.b = 2;
20994 * }
20995 *
20996 * Foo.prototype.c = 3;
20997 *
20998 * _.valuesIn(new Foo);
20999 * // => [1, 2, 3] (iteration order is not guaranteed)
21000 */
21001 function valuesIn(object) {
21002 return object == null ? [] : baseValues(object, keysIn(object));
21003 }
21004
21005 /*------------------------------------------------------------------------*/
21006
21007 /**
21008 * Clamps `number` within the inclusive `lower` and `upper` bounds.
21009 *
21010 * @static
21011 * @memberOf _
21012 * @since 4.0.0
21013 * @category Number
21014 * @param {number} number The number to clamp.
21015 * @param {number} [lower] The lower bound.
21016 * @param {number} upper The upper bound.
21017 * @returns {number} Returns the clamped number.
21018 * @example
21019 *
21020 * _.clamp(-10, -5, 5);
21021 * // => -5
21022 *
21023 * _.clamp(10, -5, 5);
21024 * // => 5
21025 */
21026 function clamp(number, lower, upper) {
21027 if (upper === undefined) {
21028 upper = lower;
21029 lower = undefined;
21030 }
21031 if (upper !== undefined) {
21032 upper = toNumber(upper);
21033 upper = upper === upper ? upper : 0;
21034 }
21035 if (lower !== undefined) {
21036 lower = toNumber(lower);
21037 lower = lower === lower ? lower : 0;
21038 }
21039 return baseClamp(toNumber(number), lower, upper);
21040 }
21041
21042 /**
21043 * Checks if `n` is between `start` and up to, but not including, `end`. If
21044 * `end` is not specified, it's set to `start` with `start` then set to `0`.
21045 * If `start` is greater than `end` the params are swapped to support
21046 * negative ranges.
21047 *
21048 * @static
21049 * @memberOf _
21050 * @since 3.3.0
21051 * @category Number
21052 * @param {number} number The number to check.
21053 * @param {number} [start=0] The start of the range.
21054 * @param {number} end The end of the range.
21055 * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
21056 * @see _.range, _.rangeRight
21057 * @example
21058 *
21059 * _.inRange(3, 2, 4);
21060 * // => true
21061 *
21062 * _.inRange(4, 8);
21063 * // => true
21064 *
21065 * _.inRange(4, 2);
21066 * // => false
21067 *
21068 * _.inRange(2, 2);
21069 * // => false
21070 *
21071 * _.inRange(1.2, 2);
21072 * // => true
21073 *
21074 * _.inRange(5.2, 4);
21075 * // => false
21076 *
21077 * _.inRange(-3, -2, -6);
21078 * // => true
21079 */
21080 function inRange(number, start, end) {
21081 start = toFinite(start);
21082 if (end === undefined) {
21083 end = start;
21084 start = 0;
21085 } else {
21086 end = toFinite(end);
21087 }
21088 number = toNumber(number);
21089 return baseInRange(number, start, end);
21090 }
21091
21092 /**
21093 * Produces a random number between the inclusive `lower` and `upper` bounds.
21094 * If only one argument is provided a number between `0` and the given number
21095 * is returned. If `floating` is `true`, or either `lower` or `upper` are
21096 * floats, a floating-point number is returned instead of an integer.
21097 *
21098 * **Note:** JavaScript follows the IEEE-754 standard for resolving
21099 * floating-point values which can produce unexpected results.
21100 *
21101 * @static
21102 * @memberOf _
21103 * @since 0.7.0
21104 * @category Number
21105 * @param {number} [lower=0] The lower bound.
21106 * @param {number} [upper=1] The upper bound.
21107 * @param {boolean} [floating] Specify returning a floating-point number.
21108 * @returns {number} Returns the random number.
21109 * @example
21110 *
21111 * _.random(0, 5);
21112 * // => an integer between 0 and 5
21113 *
21114 * _.random(5);
21115 * // => also an integer between 0 and 5
21116 *
21117 * _.random(5, true);
21118 * // => a floating-point number between 0 and 5
21119 *
21120 * _.random(1.2, 5.2);
21121 * // => a floating-point number between 1.2 and 5.2
21122 */
21123 function random(lower, upper, floating) {
21124 if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) {
21125 upper = floating = undefined;
21126 }
21127 if (floating === undefined) {
21128 if (typeof upper == 'boolean') {
21129 floating = upper;
21130 upper = undefined;
21131 }
21132 else if (typeof lower == 'boolean') {
21133 floating = lower;
21134 lower = undefined;
21135 }
21136 }
21137 if (lower === undefined && upper === undefined) {
21138 lower = 0;
21139 upper = 1;
21140 }
21141 else {
21142 lower = toFinite(lower);
21143 if (upper === undefined) {
21144 upper = lower;
21145 lower = 0;
21146 } else {
21147 upper = toFinite(upper);
21148 }
21149 }
21150 if (lower > upper) {
21151 var temp = lower;
21152 lower = upper;
21153 upper = temp;
21154 }
21155 if (floating || lower % 1 || upper % 1) {
21156 var rand = nativeRandom();
21157 return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper);
21158 }
21159 return baseRandom(lower, upper);
21160 }
21161
21162 /*------------------------------------------------------------------------*/
21163
21164 /**
21165 * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).
21166 *
21167 * @static
21168 * @memberOf _
21169 * @since 3.0.0
21170 * @category String
21171 * @param {string} [string=''] The string to convert.
21172 * @returns {string} Returns the camel cased string.
21173 * @example
21174 *
21175 * _.camelCase('Foo Bar');
21176 * // => 'fooBar'
21177 *
21178 * _.camelCase('--foo-bar--');
21179 * // => 'fooBar'
21180 *
21181 * _.camelCase('__FOO_BAR__');
21182 * // => 'fooBar'
21183 */
21184 var camelCase = createCompounder(function(result, word, index) {
21185 word = word.toLowerCase();
21186 return result + (index ? capitalize(word) : word);
21187 });
21188
21189 /**
21190 * Converts the first character of `string` to upper case and the remaining
21191 * to lower case.
21192 *
21193 * @static
21194 * @memberOf _
21195 * @since 3.0.0
21196 * @category String
21197 * @param {string} [string=''] The string to capitalize.
21198 * @returns {string} Returns the capitalized string.
21199 * @example
21200 *
21201 * _.capitalize('FRED');
21202 * // => 'Fred'
21203 */
21204 function capitalize(string) {
21205 return upperFirst(toString(string).toLowerCase());
21206 }
21207
21208 /**
21209 * Deburrs `string` by converting
21210 * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)
21211 * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)
21212 * letters to basic Latin letters and removing
21213 * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).
21214 *
21215 * @static
21216 * @memberOf _
21217 * @since 3.0.0
21218 * @category String
21219 * @param {string} [string=''] The string to deburr.
21220 * @returns {string} Returns the deburred string.
21221 * @example
21222 *
21223 * _.deburr('déjà vu');
21224 * // => 'deja vu'
21225 */
21226 function deburr(string) {
21227 string = toString(string);
21228 return string && string.replace(reLatin, deburrLetter).replace(reComboMark, '');
21229 }
21230
21231 /**
21232 * Checks if `string` ends with the given target string.
21233 *
21234 * @static
21235 * @memberOf _
21236 * @since 3.0.0
21237 * @category String
21238 * @param {string} [string=''] The string to inspect.
21239 * @param {string} [target] The string to search for.
21240 * @param {number} [position=string.length] The position to search up to.
21241 * @returns {boolean} Returns `true` if `string` ends with `target`,
21242 * else `false`.
21243 * @example
21244 *
21245 * _.endsWith('abc', 'c');
21246 * // => true
21247 *
21248 * _.endsWith('abc', 'b');
21249 * // => false
21250 *
21251 * _.endsWith('abc', 'b', 2);
21252 * // => true
21253 */
21254 function endsWith(string, target, position) {
21255 string = toString(string);
21256 target = baseToString(target);
21257
21258 var length = string.length;
21259 position = position === undefined
21260 ? length
21261 : baseClamp(toInteger(position), 0, length);
21262
21263 var end = position;
21264 position -= target.length;
21265 return position >= 0 && string.slice(position, end) == target;
21266 }
21267
21268 /**
21269 * Converts the characters "&", "<", ">", '"', and "'" in `string` to their
21270 * corresponding HTML entities.
21271 *
21272 * **Note:** No other characters are escaped. To escape additional
21273 * characters use a third-party library like [_he_](https://mths.be/he).
21274 *
21275 * Though the ">" character is escaped for symmetry, characters like
21276 * ">" and "/" don't need escaping in HTML and have no special meaning
21277 * unless they're part of a tag or unquoted attribute value. See
21278 * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)
21279 * (under "semi-related fun fact") for more details.
21280 *
21281 * When working with HTML you should always
21282 * [quote attribute values](http://wonko.com/post/html-escaping) to reduce
21283 * XSS vectors.
21284 *
21285 * @static
21286 * @since 0.1.0
21287 * @memberOf _
21288 * @category String
21289 * @param {string} [string=''] The string to escape.
21290 * @returns {string} Returns the escaped string.
21291 * @example
21292 *
21293 * _.escape('fred, barney, & pebbles');
21294 * // => 'fred, barney, &amp; pebbles'
21295 */
21296 function escape(string) {
21297 string = toString(string);
21298 return (string && reHasUnescapedHtml.test(string))
21299 ? string.replace(reUnescapedHtml, escapeHtmlChar)
21300 : string;
21301 }
21302
21303 /**
21304 * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+",
21305 * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`.
21306 *
21307 * @static
21308 * @memberOf _
21309 * @since 3.0.0
21310 * @category String
21311 * @param {string} [string=''] The string to escape.
21312 * @returns {string} Returns the escaped string.
21313 * @example
21314 *
21315 * _.escapeRegExp('[lodash](https://lodash.com/)');
21316 * // => '\[lodash\]\(https://lodash\.com/\)'
21317 */
21318 function escapeRegExp(string) {
21319 string = toString(string);
21320 return (string && reHasRegExpChar.test(string))
21321 ? string.replace(reRegExpChar, '\\$&')
21322 : string;
21323 }
21324
21325 /**
21326 * Converts `string` to
21327 * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).
21328 *
21329 * @static
21330 * @memberOf _
21331 * @since 3.0.0
21332 * @category String
21333 * @param {string} [string=''] The string to convert.
21334 * @returns {string} Returns the kebab cased string.
21335 * @example
21336 *
21337 * _.kebabCase('Foo Bar');
21338 * // => 'foo-bar'
21339 *
21340 * _.kebabCase('fooBar');
21341 * // => 'foo-bar'
21342 *
21343 * _.kebabCase('__FOO_BAR__');
21344 * // => 'foo-bar'
21345 */
21346 var kebabCase = createCompounder(function(result, word, index) {
21347 return result + (index ? '-' : '') + word.toLowerCase();
21348 });
21349
21350 /**
21351 * Converts `string`, as space separated words, to lower case.
21352 *
21353 * @static
21354 * @memberOf _
21355 * @since 4.0.0
21356 * @category String
21357 * @param {string} [string=''] The string to convert.
21358 * @returns {string} Returns the lower cased string.
21359 * @example
21360 *
21361 * _.lowerCase('--Foo-Bar--');
21362 * // => 'foo bar'
21363 *
21364 * _.lowerCase('fooBar');
21365 * // => 'foo bar'
21366 *
21367 * _.lowerCase('__FOO_BAR__');
21368 * // => 'foo bar'
21369 */
21370 var lowerCase = createCompounder(function(result, word, index) {
21371 return result + (index ? ' ' : '') + word.toLowerCase();
21372 });
21373
21374 /**
21375 * Converts the first character of `string` to lower case.
21376 *
21377 * @static
21378 * @memberOf _
21379 * @since 4.0.0
21380 * @category String
21381 * @param {string} [string=''] The string to convert.
21382 * @returns {string} Returns the converted string.
21383 * @example
21384 *
21385 * _.lowerFirst('Fred');
21386 * // => 'fred'
21387 *
21388 * _.lowerFirst('FRED');
21389 * // => 'fRED'
21390 */
21391 var lowerFirst = createCaseFirst('toLowerCase');
21392
21393 /**
21394 * Pads `string` on the left and right sides if it's shorter than `length`.
21395 * Padding characters are truncated if they can't be evenly divided by `length`.
21396 *
21397 * @static
21398 * @memberOf _
21399 * @since 3.0.0
21400 * @category String
21401 * @param {string} [string=''] The string to pad.
21402 * @param {number} [length=0] The padding length.
21403 * @param {string} [chars=' '] The string used as padding.
21404 * @returns {string} Returns the padded string.
21405 * @example
21406 *
21407 * _.pad('abc', 8);
21408 * // => ' abc '
21409 *
21410 * _.pad('abc', 8, '_-');
21411 * // => '_-abc_-_'
21412 *
21413 * _.pad('abc', 3);
21414 * // => 'abc'
21415 */
21416 function pad(string, length, chars) {
21417 string = toString(string);
21418 length = toInteger(length);
21419
21420 var strLength = length ? stringSize(string) : 0;
21421 if (!length || strLength >= length) {
21422 return string;
21423 }
21424 var mid = (length - strLength) / 2;
21425 return (
21426 createPadding(nativeFloor(mid), chars) +
21427 string +
21428 createPadding(nativeCeil(mid), chars)
21429 );
21430 }
21431
21432 /**
21433 * Pads `string` on the right side if it's shorter than `length`. Padding
21434 * characters are truncated if they exceed `length`.
21435 *
21436 * @static
21437 * @memberOf _
21438 * @since 4.0.0
21439 * @category String
21440 * @param {string} [string=''] The string to pad.
21441 * @param {number} [length=0] The padding length.
21442 * @param {string} [chars=' '] The string used as padding.
21443 * @returns {string} Returns the padded string.
21444 * @example
21445 *
21446 * _.padEnd('abc', 6);
21447 * // => 'abc '
21448 *
21449 * _.padEnd('abc', 6, '_-');
21450 * // => 'abc_-_'
21451 *
21452 * _.padEnd('abc', 3);
21453 * // => 'abc'
21454 */
21455 function padEnd(string, length, chars) {
21456 string = toString(string);
21457 length = toInteger(length);
21458
21459 var strLength = length ? stringSize(string) : 0;
21460 return (length && strLength < length)
21461 ? (string + createPadding(length - strLength, chars))
21462 : string;
21463 }
21464
21465 /**
21466 * Pads `string` on the left side if it's shorter than `length`. Padding
21467 * characters are truncated if they exceed `length`.
21468 *
21469 * @static
21470 * @memberOf _
21471 * @since 4.0.0
21472 * @category String
21473 * @param {string} [string=''] The string to pad.
21474 * @param {number} [length=0] The padding length.
21475 * @param {string} [chars=' '] The string used as padding.
21476 * @returns {string} Returns the padded string.
21477 * @example
21478 *
21479 * _.padStart('abc', 6);
21480 * // => ' abc'
21481 *
21482 * _.padStart('abc', 6, '_-');
21483 * // => '_-_abc'
21484 *
21485 * _.padStart('abc', 3);
21486 * // => 'abc'
21487 */
21488 function padStart(string, length, chars) {
21489 string = toString(string);
21490 length = toInteger(length);
21491
21492 var strLength = length ? stringSize(string) : 0;
21493 return (length && strLength < length)
21494 ? (createPadding(length - strLength, chars) + string)
21495 : string;
21496 }
21497
21498 /**
21499 * Converts `string` to an integer of the specified radix. If `radix` is
21500 * `undefined` or `0`, a `radix` of `10` is used unless `value` is a
21501 * hexadecimal, in which case a `radix` of `16` is used.
21502 *
21503 * **Note:** This method aligns with the
21504 * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`.
21505 *
21506 * @static
21507 * @memberOf _
21508 * @since 1.1.0
21509 * @category String
21510 * @param {string} string The string to convert.
21511 * @param {number} [radix=10] The radix to interpret `value` by.
21512 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
21513 * @returns {number} Returns the converted integer.
21514 * @example
21515 *
21516 * _.parseInt('08');
21517 * // => 8
21518 *
21519 * _.map(['6', '08', '10'], _.parseInt);
21520 * // => [6, 8, 10]
21521 */
21522 function parseInt(string, radix, guard) {
21523 if (guard || radix == null) {
21524 radix = 0;
21525 } else if (radix) {
21526 radix = +radix;
21527 }
21528 return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0);
21529 }
21530
21531 /**
21532 * Repeats the given string `n` times.
21533 *
21534 * @static
21535 * @memberOf _
21536 * @since 3.0.0
21537 * @category String
21538 * @param {string} [string=''] The string to repeat.
21539 * @param {number} [n=1] The number of times to repeat the string.
21540 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
21541 * @returns {string} Returns the repeated string.
21542 * @example
21543 *
21544 * _.repeat('*', 3);
21545 * // => '***'
21546 *
21547 * _.repeat('abc', 2);
21548 * // => 'abcabc'
21549 *
21550 * _.repeat('abc', 0);
21551 * // => ''
21552 */
21553 function repeat(string, n, guard) {
21554 if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) {
21555 n = 1;
21556 } else {
21557 n = toInteger(n);
21558 }
21559 return baseRepeat(toString(string), n);
21560 }
21561
21562 /**
21563 * Replaces matches for `pattern` in `string` with `replacement`.
21564 *
21565 * **Note:** This method is based on
21566 * [`String#replace`](https://mdn.io/String/replace).
21567 *
21568 * @static
21569 * @memberOf _
21570 * @since 4.0.0
21571 * @category String
21572 * @param {string} [string=''] The string to modify.
21573 * @param {RegExp|string} pattern The pattern to replace.
21574 * @param {Function|string} replacement The match replacement.
21575 * @returns {string} Returns the modified string.
21576 * @example
21577 *
21578 * _.replace('Hi Fred', 'Fred', 'Barney');
21579 * // => 'Hi Barney'
21580 */
21581 function replace() {
21582 var args = arguments,
21583 string = toString(args[0]);
21584
21585 return args.length < 3 ? string : string.replace(args[1], args[2]);
21586 }
21587
21588 /**
21589 * Converts `string` to
21590 * [snake case](https://en.wikipedia.org/wiki/Snake_case).
21591 *
21592 * @static
21593 * @memberOf _
21594 * @since 3.0.0
21595 * @category String
21596 * @param {string} [string=''] The string to convert.
21597 * @returns {string} Returns the snake cased string.
21598 * @example
21599 *
21600 * _.snakeCase('Foo Bar');
21601 * // => 'foo_bar'
21602 *
21603 * _.snakeCase('fooBar');
21604 * // => 'foo_bar'
21605 *
21606 * _.snakeCase('--FOO-BAR--');
21607 * // => 'foo_bar'
21608 */
21609 var snakeCase = createCompounder(function(result, word, index) {
21610 return result + (index ? '_' : '') + word.toLowerCase();
21611 });
21612
21613 /**
21614 * Splits `string` by `separator`.
21615 *
21616 * **Note:** This method is based on
21617 * [`String#split`](https://mdn.io/String/split).
21618 *
21619 * @static
21620 * @memberOf _
21621 * @since 4.0.0
21622 * @category String
21623 * @param {string} [string=''] The string to split.
21624 * @param {RegExp|string} separator The separator pattern to split by.
21625 * @param {number} [limit] The length to truncate results to.
21626 * @returns {Array} Returns the string segments.
21627 * @example
21628 *
21629 * _.split('a-b-c', '-', 2);
21630 * // => ['a', 'b']
21631 */
21632 function split(string, separator, limit) {
21633 if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) {
21634 separator = limit = undefined;
21635 }
21636 limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0;
21637 if (!limit) {
21638 return [];
21639 }
21640 string = toString(string);
21641 if (string && (
21642 typeof separator == 'string' ||
21643 (separator != null && !isRegExp(separator))
21644 )) {
21645 separator = baseToString(separator);
21646 if (!separator && hasUnicode(string)) {
21647 return castSlice(stringToArray(string), 0, limit);
21648 }
21649 }
21650 return string.split(separator, limit);
21651 }
21652
21653 /**
21654 * Converts `string` to
21655 * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).
21656 *
21657 * @static
21658 * @memberOf _
21659 * @since 3.1.0
21660 * @category String
21661 * @param {string} [string=''] The string to convert.
21662 * @returns {string} Returns the start cased string.
21663 * @example
21664 *
21665 * _.startCase('--foo-bar--');
21666 * // => 'Foo Bar'
21667 *
21668 * _.startCase('fooBar');
21669 * // => 'Foo Bar'
21670 *
21671 * _.startCase('__FOO_BAR__');
21672 * // => 'FOO BAR'
21673 */
21674 var startCase = createCompounder(function(result, word, index) {
21675 return result + (index ? ' ' : '') + upperFirst(word);
21676 });
21677
21678 /**
21679 * Checks if `string` starts with the given target string.
21680 *
21681 * @static
21682 * @memberOf _
21683 * @since 3.0.0
21684 * @category String
21685 * @param {string} [string=''] The string to inspect.
21686 * @param {string} [target] The string to search for.
21687 * @param {number} [position=0] The position to search from.
21688 * @returns {boolean} Returns `true` if `string` starts with `target`,
21689 * else `false`.
21690 * @example
21691 *
21692 * _.startsWith('abc', 'a');
21693 * // => true
21694 *
21695 * _.startsWith('abc', 'b');
21696 * // => false
21697 *
21698 * _.startsWith('abc', 'b', 1);
21699 * // => true
21700 */
21701 function startsWith(string, target, position) {
21702 string = toString(string);
21703 position = position == null
21704 ? 0
21705 : baseClamp(toInteger(position), 0, string.length);
21706
21707 target = baseToString(target);
21708 return string.slice(position, position + target.length) == target;
21709 }
21710
21711 /**
21712 * Creates a compiled template function that can interpolate data properties
21713 * in "interpolate" delimiters, HTML-escape interpolated data properties in
21714 * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data
21715 * properties may be accessed as free variables in the template. If a setting
21716 * object is given, it takes precedence over `_.templateSettings` values.
21717 *
21718 * **Note:** In the development build `_.template` utilizes
21719 * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)
21720 * for easier debugging.
21721 *
21722 * For more information on precompiling templates see
21723 * [lodash's custom builds documentation](https://lodash.com/custom-builds).
21724 *
21725 * For more information on Chrome extension sandboxes see
21726 * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).
21727 *
21728 * @static
21729 * @since 0.1.0
21730 * @memberOf _
21731 * @category String
21732 * @param {string} [string=''] The template string.
21733 * @param {Object} [options={}] The options object.
21734 * @param {RegExp} [options.escape=_.templateSettings.escape]
21735 * The HTML "escape" delimiter.
21736 * @param {RegExp} [options.evaluate=_.templateSettings.evaluate]
21737 * The "evaluate" delimiter.
21738 * @param {Object} [options.imports=_.templateSettings.imports]
21739 * An object to import into the template as free variables.
21740 * @param {RegExp} [options.interpolate=_.templateSettings.interpolate]
21741 * The "interpolate" delimiter.
21742 * @param {string} [options.sourceURL='lodash.templateSources[n]']
21743 * The sourceURL of the compiled template.
21744 * @param {string} [options.variable='obj']
21745 * The data object variable name.
21746 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
21747 * @returns {Function} Returns the compiled template function.
21748 * @example
21749 *
21750 * // Use the "interpolate" delimiter to create a compiled template.
21751 * var compiled = _.template('hello <%= user %>!');
21752 * compiled({ 'user': 'fred' });
21753 * // => 'hello fred!'
21754 *
21755 * // Use the HTML "escape" delimiter to escape data property values.
21756 * var compiled = _.template('<b><%- value %></b>');
21757 * compiled({ 'value': '<script>' });
21758 * // => '<b>&lt;script&gt;</b>'
21759 *
21760 * // Use the "evaluate" delimiter to execute JavaScript and generate HTML.
21761 * var compiled = _.template('<% _.forEach(users, function(user) { %><li><%- user %></li><% }); %>');
21762 * compiled({ 'users': ['fred', 'barney'] });
21763 * // => '<li>fred</li><li>barney</li>'
21764 *
21765 * // Use the internal `print` function in "evaluate" delimiters.
21766 * var compiled = _.template('<% print("hello " + user); %>!');
21767 * compiled({ 'user': 'barney' });
21768 * // => 'hello barney!'
21769 *
21770 * // Use the ES template literal delimiter as an "interpolate" delimiter.
21771 * // Disable support by replacing the "interpolate" delimiter.
21772 * var compiled = _.template('hello ${ user }!');
21773 * compiled({ 'user': 'pebbles' });
21774 * // => 'hello pebbles!'
21775 *
21776 * // Use backslashes to treat delimiters as plain text.
21777 * var compiled = _.template('<%= "\\<%- value %\\>" %>');
21778 * compiled({ 'value': 'ignored' });
21779 * // => '<%- value %>'
21780 *
21781 * // Use the `imports` option to import `jQuery` as `jq`.
21782 * var text = '<% jq.each(users, function(user) { %><li><%- user %></li><% }); %>';
21783 * var compiled = _.template(text, { 'imports': { 'jq': jQuery } });
21784 * compiled({ 'users': ['fred', 'barney'] });
21785 * // => '<li>fred</li><li>barney</li>'
21786 *
21787 * // Use the `sourceURL` option to specify a custom sourceURL for the template.
21788 * var compiled = _.template('hello <%= user %>!', { 'sourceURL': '/basic/greeting.jst' });
21789 * compiled(data);
21790 * // => Find the source of "greeting.jst" under the Sources tab or Resources panel of the web inspector.
21791 *
21792 * // Use the `variable` option to ensure a with-statement isn't used in the compiled template.
21793 * var compiled = _.template('hi <%= data.user %>!', { 'variable': 'data' });
21794 * compiled.source;
21795 * // => function(data) {
21796 * // var __t, __p = '';
21797 * // __p += 'hi ' + ((__t = ( data.user )) == null ? '' : __t) + '!';
21798 * // return __p;
21799 * // }
21800 *
21801 * // Use custom template delimiters.
21802 * _.templateSettings.interpolate = /{{([\s\S]+?)}}/g;
21803 * var compiled = _.template('hello {{ user }}!');
21804 * compiled({ 'user': 'mustache' });
21805 * // => 'hello mustache!'
21806 *
21807 * // Use the `source` property to inline compiled templates for meaningful
21808 * // line numbers in error messages and stack traces.
21809 * fs.writeFileSync(path.join(process.cwd(), 'jst.js'), '\
21810 * var JST = {\
21811 * "main": ' + _.template(mainText).source + '\
21812 * };\
21813 * ');
21814 */
21815 function template(string, options, guard) {
21816 // Based on John Resig's `tmpl` implementation
21817 // (http://ejohn.org/blog/javascript-micro-templating/)
21818 // and Laura Doktorova's doT.js (https://github.com/olado/doT).
21819 var settings = lodash.templateSettings;
21820
21821 if (guard && isIterateeCall(string, options, guard)) {
21822 options = undefined;
21823 }
21824 string = toString(string);
21825 options = assignInWith({}, options, settings, customDefaultsAssignIn);
21826
21827 var imports = assignInWith({}, options.imports, settings.imports, customDefaultsAssignIn),
21828 importsKeys = keys(imports),
21829 importsValues = baseValues(imports, importsKeys);
21830
21831 var isEscaping,
21832 isEvaluating,
21833 index = 0,
21834 interpolate = options.interpolate || reNoMatch,
21835 source = "__p += '";
21836
21837 // Compile the regexp to match each delimiter.
21838 var reDelimiters = RegExp(
21839 (options.escape || reNoMatch).source + '|' +
21840 interpolate.source + '|' +
21841 (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + '|' +
21842 (options.evaluate || reNoMatch).source + '|$'
21843 , 'g');
21844
21845 // Use a sourceURL for easier debugging.
21846 var sourceURL = '//# sourceURL=' +
21847 ('sourceURL' in options
21848 ? options.sourceURL
21849 : ('lodash.templateSources[' + (++templateCounter) + ']')
21850 ) + '\n';
21851
21852 string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) {
21853 interpolateValue || (interpolateValue = esTemplateValue);
21854
21855 // Escape characters that can't be included in string literals.
21856 source += string.slice(index, offset).replace(reUnescapedString, escapeStringChar);
21857
21858 // Replace delimiters with snippets.
21859 if (escapeValue) {
21860 isEscaping = true;
21861 source += "' +\n__e(" + escapeValue + ") +\n'";
21862 }
21863 if (evaluateValue) {
21864 isEvaluating = true;
21865 source += "';\n" + evaluateValue + ";\n__p += '";
21866 }
21867 if (interpolateValue) {
21868 source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'";
21869 }
21870 index = offset + match.length;
21871
21872 // The JS engine embedded in Adobe products needs `match` returned in
21873 // order to produce the correct `offset` value.
21874 return match;
21875 });
21876
21877 source += "';\n";
21878
21879 // If `variable` is not specified wrap a with-statement around the generated
21880 // code to add the data object to the top of the scope chain.
21881 var variable = options.variable;
21882 if (!variable) {
21883 source = 'with (obj) {\n' + source + '\n}\n';
21884 }
21885 // Cleanup code by stripping empty strings.
21886 source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source)
21887 .replace(reEmptyStringMiddle, '$1')
21888 .replace(reEmptyStringTrailing, '$1;');
21889
21890 // Frame code as the function body.
21891 source = 'function(' + (variable || 'obj') + ') {\n' +
21892 (variable
21893 ? ''
21894 : 'obj || (obj = {});\n'
21895 ) +
21896 "var __t, __p = ''" +
21897 (isEscaping
21898 ? ', __e = _.escape'
21899 : ''
21900 ) +
21901 (isEvaluating
21902 ? ', __j = Array.prototype.join;\n' +
21903 "function print() { __p += __j.call(arguments, '') }\n"
21904 : ';\n'
21905 ) +
21906 source +
21907 'return __p\n}';
21908
21909 var result = attempt(function() {
21910 return Function(importsKeys, sourceURL + 'return ' + source)
21911 .apply(undefined, importsValues);
21912 });
21913
21914 // Provide the compiled function's source by its `toString` method or
21915 // the `source` property as a convenience for inlining compiled templates.
21916 result.source = source;
21917 if (isError(result)) {
21918 throw result;
21919 }
21920 return result;
21921 }
21922
21923 /**
21924 * Converts `string`, as a whole, to lower case just like
21925 * [String#toLowerCase](https://mdn.io/toLowerCase).
21926 *
21927 * @static
21928 * @memberOf _
21929 * @since 4.0.0
21930 * @category String
21931 * @param {string} [string=''] The string to convert.
21932 * @returns {string} Returns the lower cased string.
21933 * @example
21934 *
21935 * _.toLower('--Foo-Bar--');
21936 * // => '--foo-bar--'
21937 *
21938 * _.toLower('fooBar');
21939 * // => 'foobar'
21940 *
21941 * _.toLower('__FOO_BAR__');
21942 * // => '__foo_bar__'
21943 */
21944 function toLower(value) {
21945 return toString(value).toLowerCase();
21946 }
21947
21948 /**
21949 * Converts `string`, as a whole, to upper case just like
21950 * [String#toUpperCase](https://mdn.io/toUpperCase).
21951 *
21952 * @static
21953 * @memberOf _
21954 * @since 4.0.0
21955 * @category String
21956 * @param {string} [string=''] The string to convert.
21957 * @returns {string} Returns the upper cased string.
21958 * @example
21959 *
21960 * _.toUpper('--foo-bar--');
21961 * // => '--FOO-BAR--'
21962 *
21963 * _.toUpper('fooBar');
21964 * // => 'FOOBAR'
21965 *
21966 * _.toUpper('__foo_bar__');
21967 * // => '__FOO_BAR__'
21968 */
21969 function toUpper(value) {
21970 return toString(value).toUpperCase();
21971 }
21972
21973 /**
21974 * Removes leading and trailing whitespace or specified characters from `string`.
21975 *
21976 * @static
21977 * @memberOf _
21978 * @since 3.0.0
21979 * @category String
21980 * @param {string} [string=''] The string to trim.
21981 * @param {string} [chars=whitespace] The characters to trim.
21982 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
21983 * @returns {string} Returns the trimmed string.
21984 * @example
21985 *
21986 * _.trim(' abc ');
21987 * // => 'abc'
21988 *
21989 * _.trim('-_-abc-_-', '_-');
21990 * // => 'abc'
21991 *
21992 * _.map([' foo ', ' bar '], _.trim);
21993 * // => ['foo', 'bar']
21994 */
21995 function trim(string, chars, guard) {
21996 string = toString(string);
21997 if (string && (guard || chars === undefined)) {
21998 return string.replace(reTrim, '');
21999 }
22000 if (!string || !(chars = baseToString(chars))) {
22001 return string;
22002 }
22003 var strSymbols = stringToArray(string),
22004 chrSymbols = stringToArray(chars),
22005 start = charsStartIndex(strSymbols, chrSymbols),
22006 end = charsEndIndex(strSymbols, chrSymbols) + 1;
22007
22008 return castSlice(strSymbols, start, end).join('');
22009 }
22010
22011 /**
22012 * Removes trailing whitespace or specified characters from `string`.
22013 *
22014 * @static
22015 * @memberOf _
22016 * @since 4.0.0
22017 * @category String
22018 * @param {string} [string=''] The string to trim.
22019 * @param {string} [chars=whitespace] The characters to trim.
22020 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
22021 * @returns {string} Returns the trimmed string.
22022 * @example
22023 *
22024 * _.trimEnd(' abc ');
22025 * // => ' abc'
22026 *
22027 * _.trimEnd('-_-abc-_-', '_-');
22028 * // => '-_-abc'
22029 */
22030 function trimEnd(string, chars, guard) {
22031 string = toString(string);
22032 if (string && (guard || chars === undefined)) {
22033 return string.replace(reTrimEnd, '');
22034 }
22035 if (!string || !(chars = baseToString(chars))) {
22036 return string;
22037 }
22038 var strSymbols = stringToArray(string),
22039 end = charsEndIndex(strSymbols, stringToArray(chars)) + 1;
22040
22041 return castSlice(strSymbols, 0, end).join('');
22042 }
22043
22044 /**
22045 * Removes leading whitespace or specified characters from `string`.
22046 *
22047 * @static
22048 * @memberOf _
22049 * @since 4.0.0
22050 * @category String
22051 * @param {string} [string=''] The string to trim.
22052 * @param {string} [chars=whitespace] The characters to trim.
22053 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
22054 * @returns {string} Returns the trimmed string.
22055 * @example
22056 *
22057 * _.trimStart(' abc ');
22058 * // => 'abc '
22059 *
22060 * _.trimStart('-_-abc-_-', '_-');
22061 * // => 'abc-_-'
22062 */
22063 function trimStart(string, chars, guard) {
22064 string = toString(string);
22065 if (string && (guard || chars === undefined)) {
22066 return string.replace(reTrimStart, '');
22067 }
22068 if (!string || !(chars = baseToString(chars))) {
22069 return string;
22070 }
22071 var strSymbols = stringToArray(string),
22072 start = charsStartIndex(strSymbols, stringToArray(chars));
22073
22074 return castSlice(strSymbols, start).join('');
22075 }
22076
22077 /**
22078 * Truncates `string` if it's longer than the given maximum string length.
22079 * The last characters of the truncated string are replaced with the omission
22080 * string which defaults to "...".
22081 *
22082 * @static
22083 * @memberOf _
22084 * @since 4.0.0
22085 * @category String
22086 * @param {string} [string=''] The string to truncate.
22087 * @param {Object} [options={}] The options object.
22088 * @param {number} [options.length=30] The maximum string length.
22089 * @param {string} [options.omission='...'] The string to indicate text is omitted.
22090 * @param {RegExp|string} [options.separator] The separator pattern to truncate to.
22091 * @returns {string} Returns the truncated string.
22092 * @example
22093 *
22094 * _.truncate('hi-diddly-ho there, neighborino');
22095 * // => 'hi-diddly-ho there, neighbo...'
22096 *
22097 * _.truncate('hi-diddly-ho there, neighborino', {
22098 * 'length': 24,
22099 * 'separator': ' '
22100 * });
22101 * // => 'hi-diddly-ho there,...'
22102 *
22103 * _.truncate('hi-diddly-ho there, neighborino', {
22104 * 'length': 24,
22105 * 'separator': /,? +/
22106 * });
22107 * // => 'hi-diddly-ho there...'
22108 *
22109 * _.truncate('hi-diddly-ho there, neighborino', {
22110 * 'omission': ' [...]'
22111 * });
22112 * // => 'hi-diddly-ho there, neig [...]'
22113 */
22114 function truncate(string, options) {
22115 var length = DEFAULT_TRUNC_LENGTH,
22116 omission = DEFAULT_TRUNC_OMISSION;
22117
22118 if (isObject(options)) {
22119 var separator = 'separator' in options ? options.separator : separator;
22120 length = 'length' in options ? toInteger(options.length) : length;
22121 omission = 'omission' in options ? baseToString(options.omission) : omission;
22122 }
22123 string = toString(string);
22124
22125 var strLength = string.length;
22126 if (hasUnicode(string)) {
22127 var strSymbols = stringToArray(string);
22128 strLength = strSymbols.length;
22129 }
22130 if (length >= strLength) {
22131 return string;
22132 }
22133 var end = length - stringSize(omission);
22134 if (end < 1) {
22135 return omission;
22136 }
22137 var result = strSymbols
22138 ? castSlice(strSymbols, 0, end).join('')
22139 : string.slice(0, end);
22140
22141 if (separator === undefined) {
22142 return result + omission;
22143 }
22144 if (strSymbols) {
22145 end += (result.length - end);
22146 }
22147 if (isRegExp(separator)) {
22148 if (string.slice(end).search(separator)) {
22149 var match,
22150 substring = result;
22151
22152 if (!separator.global) {
22153 separator = RegExp(separator.source, toString(reFlags.exec(separator)) + 'g');
22154 }
22155 separator.lastIndex = 0;
22156 while ((match = separator.exec(substring))) {
22157 var newEnd = match.index;
22158 }
22159 result = result.slice(0, newEnd === undefined ? end : newEnd);
22160 }
22161 } else if (string.indexOf(baseToString(separator), end) != end) {
22162 var index = result.lastIndexOf(separator);
22163 if (index > -1) {
22164 result = result.slice(0, index);
22165 }
22166 }
22167 return result + omission;
22168 }
22169
22170 /**
22171 * The inverse of `_.escape`; this method converts the HTML entities
22172 * `&amp;`, `&lt;`, `&gt;`, `&quot;`, and `&#39;` in `string` to
22173 * their corresponding characters.
22174 *
22175 * **Note:** No other HTML entities are unescaped. To unescape additional
22176 * HTML entities use a third-party library like [_he_](https://mths.be/he).
22177 *
22178 * @static
22179 * @memberOf _
22180 * @since 0.6.0
22181 * @category String
22182 * @param {string} [string=''] The string to unescape.
22183 * @returns {string} Returns the unescaped string.
22184 * @example
22185 *
22186 * _.unescape('fred, barney, &amp; pebbles');
22187 * // => 'fred, barney, & pebbles'
22188 */
22189 function unescape(string) {
22190 string = toString(string);
22191 return (string && reHasEscapedHtml.test(string))
22192 ? string.replace(reEscapedHtml, unescapeHtmlChar)
22193 : string;
22194 }
22195
22196 /**
22197 * Converts `string`, as space separated words, to upper case.
22198 *
22199 * @static
22200 * @memberOf _
22201 * @since 4.0.0
22202 * @category String
22203 * @param {string} [string=''] The string to convert.
22204 * @returns {string} Returns the upper cased string.
22205 * @example
22206 *
22207 * _.upperCase('--foo-bar');
22208 * // => 'FOO BAR'
22209 *
22210 * _.upperCase('fooBar');
22211 * // => 'FOO BAR'
22212 *
22213 * _.upperCase('__foo_bar__');
22214 * // => 'FOO BAR'
22215 */
22216 var upperCase = createCompounder(function(result, word, index) {
22217 return result + (index ? ' ' : '') + word.toUpperCase();
22218 });
22219
22220 /**
22221 * Converts the first character of `string` to upper case.
22222 *
22223 * @static
22224 * @memberOf _
22225 * @since 4.0.0
22226 * @category String
22227 * @param {string} [string=''] The string to convert.
22228 * @returns {string} Returns the converted string.
22229 * @example
22230 *
22231 * _.upperFirst('fred');
22232 * // => 'Fred'
22233 *
22234 * _.upperFirst('FRED');
22235 * // => 'FRED'
22236 */
22237 var upperFirst = createCaseFirst('toUpperCase');
22238
22239 /**
22240 * Splits `string` into an array of its words.
22241 *
22242 * @static
22243 * @memberOf _
22244 * @since 3.0.0
22245 * @category String
22246 * @param {string} [string=''] The string to inspect.
22247 * @param {RegExp|string} [pattern] The pattern to match words.
22248 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
22249 * @returns {Array} Returns the words of `string`.
22250 * @example
22251 *
22252 * _.words('fred, barney, & pebbles');
22253 * // => ['fred', 'barney', 'pebbles']
22254 *
22255 * _.words('fred, barney, & pebbles', /[^, ]+/g);
22256 * // => ['fred', 'barney', '&', 'pebbles']
22257 */
22258 function words(string, pattern, guard) {
22259 string = toString(string);
22260 pattern = guard ? undefined : pattern;
22261
22262 if (pattern === undefined) {
22263 return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string);
22264 }
22265 return string.match(pattern) || [];
22266 }
22267
22268 /*------------------------------------------------------------------------*/
22269
22270 /**
22271 * Attempts to invoke `func`, returning either the result or the caught error
22272 * object. Any additional arguments are provided to `func` when it's invoked.
22273 *
22274 * @static
22275 * @memberOf _
22276 * @since 3.0.0
22277 * @category Util
22278 * @param {Function} func The function to attempt.
22279 * @param {...*} [args] The arguments to invoke `func` with.
22280 * @returns {*} Returns the `func` result or error object.
22281 * @example
22282 *
22283 * // Avoid throwing errors for invalid selectors.
22284 * var elements = _.attempt(function(selector) {
22285 * return document.querySelectorAll(selector);
22286 * }, '>_>');
22287 *
22288 * if (_.isError(elements)) {
22289 * elements = [];
22290 * }
22291 */
22292 var attempt = baseRest(function(func, args) {
22293 try {
22294 return apply(func, undefined, args);
22295 } catch (e) {
22296 return isError(e) ? e : new Error(e);
22297 }
22298 });
22299
22300 /**
22301 * Binds methods of an object to the object itself, overwriting the existing
22302 * method.
22303 *
22304 * **Note:** This method doesn't set the "length" property of bound functions.
22305 *
22306 * @static
22307 * @since 0.1.0
22308 * @memberOf _
22309 * @category Util
22310 * @param {Object} object The object to bind and assign the bound methods to.
22311 * @param {...(string|string[])} methodNames The object method names to bind.
22312 * @returns {Object} Returns `object`.
22313 * @example
22314 *
22315 * var view = {
22316 * 'label': 'docs',
22317 * 'click': function() {
22318 * console.log('clicked ' + this.label);
22319 * }
22320 * };
22321 *
22322 * _.bindAll(view, ['click']);
22323 * jQuery(element).on('click', view.click);
22324 * // => Logs 'clicked docs' when clicked.
22325 */
22326 var bindAll = flatRest(function(object, methodNames) {
22327 arrayEach(methodNames, function(key) {
22328 key = toKey(key);
22329 baseAssignValue(object, key, bind(object[key], object));
22330 });
22331 return object;
22332 });
22333
22334 /**
22335 * Creates a function that iterates over `pairs` and invokes the corresponding
22336 * function of the first predicate to return truthy. The predicate-function
22337 * pairs are invoked with the `this` binding and arguments of the created
22338 * function.
22339 *
22340 * @static
22341 * @memberOf _
22342 * @since 4.0.0
22343 * @category Util
22344 * @param {Array} pairs The predicate-function pairs.
22345 * @returns {Function} Returns the new composite function.
22346 * @example
22347 *
22348 * var func = _.cond([
22349 * [_.matches({ 'a': 1 }), _.constant('matches A')],
22350 * [_.conforms({ 'b': _.isNumber }), _.constant('matches B')],
22351 * [_.stubTrue, _.constant('no match')]
22352 * ]);
22353 *
22354 * func({ 'a': 1, 'b': 2 });
22355 * // => 'matches A'
22356 *
22357 * func({ 'a': 0, 'b': 1 });
22358 * // => 'matches B'
22359 *
22360 * func({ 'a': '1', 'b': '2' });
22361 * // => 'no match'
22362 */
22363 function cond(pairs) {
22364 var length = pairs == null ? 0 : pairs.length,
22365 toIteratee = getIteratee();
22366
22367 pairs = !length ? [] : arrayMap(pairs, function(pair) {
22368 if (typeof pair[1] != 'function') {
22369 throw new TypeError(FUNC_ERROR_TEXT);
22370 }
22371 return [toIteratee(pair[0]), pair[1]];
22372 });
22373
22374 return baseRest(function(args) {
22375 var index = -1;
22376 while (++index < length) {
22377 var pair = pairs[index];
22378 if (apply(pair[0], this, args)) {
22379 return apply(pair[1], this, args);
22380 }
22381 }
22382 });
22383 }
22384
22385 /**
22386 * Creates a function that invokes the predicate properties of `source` with
22387 * the corresponding property values of a given object, returning `true` if
22388 * all predicates return truthy, else `false`.
22389 *
22390 * **Note:** The created function is equivalent to `_.conformsTo` with
22391 * `source` partially applied.
22392 *
22393 * @static
22394 * @memberOf _
22395 * @since 4.0.0
22396 * @category Util
22397 * @param {Object} source The object of property predicates to conform to.
22398 * @returns {Function} Returns the new spec function.
22399 * @example
22400 *
22401 * var objects = [
22402 * { 'a': 2, 'b': 1 },
22403 * { 'a': 1, 'b': 2 }
22404 * ];
22405 *
22406 * _.filter(objects, _.conforms({ 'b': function(n) { return n > 1; } }));
22407 * // => [{ 'a': 1, 'b': 2 }]
22408 */
22409 function conforms(source) {
22410 return baseConforms(baseClone(source, CLONE_DEEP_FLAG));
22411 }
22412
22413 /**
22414 * Creates a function that returns `value`.
22415 *
22416 * @static
22417 * @memberOf _
22418 * @since 2.4.0
22419 * @category Util
22420 * @param {*} value The value to return from the new function.
22421 * @returns {Function} Returns the new constant function.
22422 * @example
22423 *
22424 * var objects = _.times(2, _.constant({ 'a': 1 }));
22425 *
22426 * console.log(objects);
22427 * // => [{ 'a': 1 }, { 'a': 1 }]
22428 *
22429 * console.log(objects[0] === objects[1]);
22430 * // => true
22431 */
22432 function constant(value) {
22433 return function() {
22434 return value;
22435 };
22436 }
22437
22438 /**
22439 * Checks `value` to determine whether a default value should be returned in
22440 * its place. The `defaultValue` is returned if `value` is `NaN`, `null`,
22441 * or `undefined`.
22442 *
22443 * @static
22444 * @memberOf _
22445 * @since 4.14.0
22446 * @category Util
22447 * @param {*} value The value to check.
22448 * @param {*} defaultValue The default value.
22449 * @returns {*} Returns the resolved value.
22450 * @example
22451 *
22452 * _.defaultTo(1, 10);
22453 * // => 1
22454 *
22455 * _.defaultTo(undefined, 10);
22456 * // => 10
22457 */
22458 function defaultTo(value, defaultValue) {
22459 return (value == null || value !== value) ? defaultValue : value;
22460 }
22461
22462 /**
22463 * Creates a function that returns the result of invoking the given functions
22464 * with the `this` binding of the created function, where each successive
22465 * invocation is supplied the return value of the previous.
22466 *
22467 * @static
22468 * @memberOf _
22469 * @since 3.0.0
22470 * @category Util
22471 * @param {...(Function|Function[])} [funcs] The functions to invoke.
22472 * @returns {Function} Returns the new composite function.
22473 * @see _.flowRight
22474 * @example
22475 *
22476 * function square(n) {
22477 * return n * n;
22478 * }
22479 *
22480 * var addSquare = _.flow([_.add, square]);
22481 * addSquare(1, 2);
22482 * // => 9
22483 */
22484 var flow = createFlow();
22485
22486 /**
22487 * This method is like `_.flow` except that it creates a function that
22488 * invokes the given functions from right to left.
22489 *
22490 * @static
22491 * @since 3.0.0
22492 * @memberOf _
22493 * @category Util
22494 * @param {...(Function|Function[])} [funcs] The functions to invoke.
22495 * @returns {Function} Returns the new composite function.
22496 * @see _.flow
22497 * @example
22498 *
22499 * function square(n) {
22500 * return n * n;
22501 * }
22502 *
22503 * var addSquare = _.flowRight([square, _.add]);
22504 * addSquare(1, 2);
22505 * // => 9
22506 */
22507 var flowRight = createFlow(true);
22508
22509 /**
22510 * This method returns the first argument it receives.
22511 *
22512 * @static
22513 * @since 0.1.0
22514 * @memberOf _
22515 * @category Util
22516 * @param {*} value Any value.
22517 * @returns {*} Returns `value`.
22518 * @example
22519 *
22520 * var object = { 'a': 1 };
22521 *
22522 * console.log(_.identity(object) === object);
22523 * // => true
22524 */
22525 function identity(value) {
22526 return value;
22527 }
22528
22529 /**
22530 * Creates a function that invokes `func` with the arguments of the created
22531 * function. If `func` is a property name, the created function returns the
22532 * property value for a given element. If `func` is an array or object, the
22533 * created function returns `true` for elements that contain the equivalent
22534 * source properties, otherwise it returns `false`.
22535 *
22536 * @static
22537 * @since 4.0.0
22538 * @memberOf _
22539 * @category Util
22540 * @param {*} [func=_.identity] The value to convert to a callback.
22541 * @returns {Function} Returns the callback.
22542 * @example
22543 *
22544 * var users = [
22545 * { 'user': 'barney', 'age': 36, 'active': true },
22546 * { 'user': 'fred', 'age': 40, 'active': false }
22547 * ];
22548 *
22549 * // The `_.matches` iteratee shorthand.
22550 * _.filter(users, _.iteratee({ 'user': 'barney', 'active': true }));
22551 * // => [{ 'user': 'barney', 'age': 36, 'active': true }]
22552 *
22553 * // The `_.matchesProperty` iteratee shorthand.
22554 * _.filter(users, _.iteratee(['user', 'fred']));
22555 * // => [{ 'user': 'fred', 'age': 40 }]
22556 *
22557 * // The `_.property` iteratee shorthand.
22558 * _.map(users, _.iteratee('user'));
22559 * // => ['barney', 'fred']
22560 *
22561 * // Create custom iteratee shorthands.
22562 * _.iteratee = _.wrap(_.iteratee, function(iteratee, func) {
22563 * return !_.isRegExp(func) ? iteratee(func) : function(string) {
22564 * return func.test(string);
22565 * };
22566 * });
22567 *
22568 * _.filter(['abc', 'def'], /ef/);
22569 * // => ['def']
22570 */
22571 function iteratee(func) {
22572 return baseIteratee(typeof func == 'function' ? func : baseClone(func, CLONE_DEEP_FLAG));
22573 }
22574
22575 /**
22576 * Creates a function that performs a partial deep comparison between a given
22577 * object and `source`, returning `true` if the given object has equivalent
22578 * property values, else `false`.
22579 *
22580 * **Note:** The created function is equivalent to `_.isMatch` with `source`
22581 * partially applied.
22582 *
22583 * Partial comparisons will match empty array and empty object `source`
22584 * values against any array or object value, respectively. See `_.isEqual`
22585 * for a list of supported value comparisons.
22586 *
22587 * @static
22588 * @memberOf _
22589 * @since 3.0.0
22590 * @category Util
22591 * @param {Object} source The object of property values to match.
22592 * @returns {Function} Returns the new spec function.
22593 * @example
22594 *
22595 * var objects = [
22596 * { 'a': 1, 'b': 2, 'c': 3 },
22597 * { 'a': 4, 'b': 5, 'c': 6 }
22598 * ];
22599 *
22600 * _.filter(objects, _.matches({ 'a': 4, 'c': 6 }));
22601 * // => [{ 'a': 4, 'b': 5, 'c': 6 }]
22602 */
22603 function matches(source) {
22604 return baseMatches(baseClone(source, CLONE_DEEP_FLAG));
22605 }
22606
22607 /**
22608 * Creates a function that performs a partial deep comparison between the
22609 * value at `path` of a given object to `srcValue`, returning `true` if the
22610 * object value is equivalent, else `false`.
22611 *
22612 * **Note:** Partial comparisons will match empty array and empty object
22613 * `srcValue` values against any array or object value, respectively. See
22614 * `_.isEqual` for a list of supported value comparisons.
22615 *
22616 * @static
22617 * @memberOf _
22618 * @since 3.2.0
22619 * @category Util
22620 * @param {Array|string} path The path of the property to get.
22621 * @param {*} srcValue The value to match.
22622 * @returns {Function} Returns the new spec function.
22623 * @example
22624 *
22625 * var objects = [
22626 * { 'a': 1, 'b': 2, 'c': 3 },
22627 * { 'a': 4, 'b': 5, 'c': 6 }
22628 * ];
22629 *
22630 * _.find(objects, _.matchesProperty('a', 4));
22631 * // => { 'a': 4, 'b': 5, 'c': 6 }
22632 */
22633 function matchesProperty(path, srcValue) {
22634 return baseMatchesProperty(path, baseClone(srcValue, CLONE_DEEP_FLAG));
22635 }
22636
22637 /**
22638 * Creates a function that invokes the method at `path` of a given object.
22639 * Any additional arguments are provided to the invoked method.
22640 *
22641 * @static
22642 * @memberOf _
22643 * @since 3.7.0
22644 * @category Util
22645 * @param {Array|string} path The path of the method to invoke.
22646 * @param {...*} [args] The arguments to invoke the method with.
22647 * @returns {Function} Returns the new invoker function.
22648 * @example
22649 *
22650 * var objects = [
22651 * { 'a': { 'b': _.constant(2) } },
22652 * { 'a': { 'b': _.constant(1) } }
22653 * ];
22654 *
22655 * _.map(objects, _.method('a.b'));
22656 * // => [2, 1]
22657 *
22658 * _.map(objects, _.method(['a', 'b']));
22659 * // => [2, 1]
22660 */
22661 var method = baseRest(function(path, args) {
22662 return function(object) {
22663 return baseInvoke(object, path, args);
22664 };
22665 });
22666
22667 /**
22668 * The opposite of `_.method`; this method creates a function that invokes
22669 * the method at a given path of `object`. Any additional arguments are
22670 * provided to the invoked method.
22671 *
22672 * @static
22673 * @memberOf _
22674 * @since 3.7.0
22675 * @category Util
22676 * @param {Object} object The object to query.
22677 * @param {...*} [args] The arguments to invoke the method with.
22678 * @returns {Function} Returns the new invoker function.
22679 * @example
22680 *
22681 * var array = _.times(3, _.constant),
22682 * object = { 'a': array, 'b': array, 'c': array };
22683 *
22684 * _.map(['a[2]', 'c[0]'], _.methodOf(object));
22685 * // => [2, 0]
22686 *
22687 * _.map([['a', '2'], ['c', '0']], _.methodOf(object));
22688 * // => [2, 0]
22689 */
22690 var methodOf = baseRest(function(object, args) {
22691 return function(path) {
22692 return baseInvoke(object, path, args);
22693 };
22694 });
22695
22696 /**
22697 * Adds all own enumerable string keyed function properties of a source
22698 * object to the destination object. If `object` is a function, then methods
22699 * are added to its prototype as well.
22700 *
22701 * **Note:** Use `_.runInContext` to create a pristine `lodash` function to
22702 * avoid conflicts caused by modifying the original.
22703 *
22704 * @static
22705 * @since 0.1.0
22706 * @memberOf _
22707 * @category Util
22708 * @param {Function|Object} [object=lodash] The destination object.
22709 * @param {Object} source The object of functions to add.
22710 * @param {Object} [options={}] The options object.
22711 * @param {boolean} [options.chain=true] Specify whether mixins are chainable.
22712 * @returns {Function|Object} Returns `object`.
22713 * @example
22714 *
22715 * function vowels(string) {
22716 * return _.filter(string, function(v) {
22717 * return /[aeiou]/i.test(v);
22718 * });
22719 * }
22720 *
22721 * _.mixin({ 'vowels': vowels });
22722 * _.vowels('fred');
22723 * // => ['e']
22724 *
22725 * _('fred').vowels().value();
22726 * // => ['e']
22727 *
22728 * _.mixin({ 'vowels': vowels }, { 'chain': false });
22729 * _('fred').vowels();
22730 * // => ['e']
22731 */
22732 function mixin(object, source, options) {
22733 var props = keys(source),
22734 methodNames = baseFunctions(source, props);
22735
22736 if (options == null &&
22737 !(isObject(source) && (methodNames.length || !props.length))) {
22738 options = source;
22739 source = object;
22740 object = this;
22741 methodNames = baseFunctions(source, keys(source));
22742 }
22743 var chain = !(isObject(options) && 'chain' in options) || !!options.chain,
22744 isFunc = isFunction(object);
22745
22746 arrayEach(methodNames, function(methodName) {
22747 var func = source[methodName];
22748 object[methodName] = func;
22749 if (isFunc) {
22750 object.prototype[methodName] = function() {
22751 var chainAll = this.__chain__;
22752 if (chain || chainAll) {
22753 var result = object(this.__wrapped__),
22754 actions = result.__actions__ = copyArray(this.__actions__);
22755
22756 actions.push({ 'func': func, 'args': arguments, 'thisArg': object });
22757 result.__chain__ = chainAll;
22758 return result;
22759 }
22760 return func.apply(object, arrayPush([this.value()], arguments));
22761 };
22762 }
22763 });
22764
22765 return object;
22766 }
22767
22768 /**
22769 * Reverts the `_` variable to its previous value and returns a reference to
22770 * the `lodash` function.
22771 *
22772 * @static
22773 * @since 0.1.0
22774 * @memberOf _
22775 * @category Util
22776 * @returns {Function} Returns the `lodash` function.
22777 * @example
22778 *
22779 * var lodash = _.noConflict();
22780 */
22781 function noConflict() {
22782 if (root._ === this) {
22783 root._ = oldDash;
22784 }
22785 return this;
22786 }
22787
22788 /**
22789 * This method returns `undefined`.
22790 *
22791 * @static
22792 * @memberOf _
22793 * @since 2.3.0
22794 * @category Util
22795 * @example
22796 *
22797 * _.times(2, _.noop);
22798 * // => [undefined, undefined]
22799 */
22800 function noop() {
22801 // No operation performed.
22802 }
22803
22804 /**
22805 * Creates a function that gets the argument at index `n`. If `n` is negative,
22806 * the nth argument from the end is returned.
22807 *
22808 * @static
22809 * @memberOf _
22810 * @since 4.0.0
22811 * @category Util
22812 * @param {number} [n=0] The index of the argument to return.
22813 * @returns {Function} Returns the new pass-thru function.
22814 * @example
22815 *
22816 * var func = _.nthArg(1);
22817 * func('a', 'b', 'c', 'd');
22818 * // => 'b'
22819 *
22820 * var func = _.nthArg(-2);
22821 * func('a', 'b', 'c', 'd');
22822 * // => 'c'
22823 */
22824 function nthArg(n) {
22825 n = toInteger(n);
22826 return baseRest(function(args) {
22827 return baseNth(args, n);
22828 });
22829 }
22830
22831 /**
22832 * Creates a function that invokes `iteratees` with the arguments it receives
22833 * and returns their results.
22834 *
22835 * @static
22836 * @memberOf _
22837 * @since 4.0.0
22838 * @category Util
22839 * @param {...(Function|Function[])} [iteratees=[_.identity]]
22840 * The iteratees to invoke.
22841 * @returns {Function} Returns the new function.
22842 * @example
22843 *
22844 * var func = _.over([Math.max, Math.min]);
22845 *
22846 * func(1, 2, 3, 4);
22847 * // => [4, 1]
22848 */
22849 var over = createOver(arrayMap);
22850
22851 /**
22852 * Creates a function that checks if **all** of the `predicates` return
22853 * truthy when invoked with the arguments it receives.
22854 *
22855 * @static
22856 * @memberOf _
22857 * @since 4.0.0
22858 * @category Util
22859 * @param {...(Function|Function[])} [predicates=[_.identity]]
22860 * The predicates to check.
22861 * @returns {Function} Returns the new function.
22862 * @example
22863 *
22864 * var func = _.overEvery([Boolean, isFinite]);
22865 *
22866 * func('1');
22867 * // => true
22868 *
22869 * func(null);
22870 * // => false
22871 *
22872 * func(NaN);
22873 * // => false
22874 */
22875 var overEvery = createOver(arrayEvery);
22876
22877 /**
22878 * Creates a function that checks if **any** of the `predicates` return
22879 * truthy when invoked with the arguments it receives.
22880 *
22881 * @static
22882 * @memberOf _
22883 * @since 4.0.0
22884 * @category Util
22885 * @param {...(Function|Function[])} [predicates=[_.identity]]
22886 * The predicates to check.
22887 * @returns {Function} Returns the new function.
22888 * @example
22889 *
22890 * var func = _.overSome([Boolean, isFinite]);
22891 *
22892 * func('1');
22893 * // => true
22894 *
22895 * func(null);
22896 * // => true
22897 *
22898 * func(NaN);
22899 * // => false
22900 */
22901 var overSome = createOver(arraySome);
22902
22903 /**
22904 * Creates a function that returns the value at `path` of a given object.
22905 *
22906 * @static
22907 * @memberOf _
22908 * @since 2.4.0
22909 * @category Util
22910 * @param {Array|string} path The path of the property to get.
22911 * @returns {Function} Returns the new accessor function.
22912 * @example
22913 *
22914 * var objects = [
22915 * { 'a': { 'b': 2 } },
22916 * { 'a': { 'b': 1 } }
22917 * ];
22918 *
22919 * _.map(objects, _.property('a.b'));
22920 * // => [2, 1]
22921 *
22922 * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');
22923 * // => [1, 2]
22924 */
22925 function property(path) {
22926 return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
22927 }
22928
22929 /**
22930 * The opposite of `_.property`; this method creates a function that returns
22931 * the value at a given path of `object`.
22932 *
22933 * @static
22934 * @memberOf _
22935 * @since 3.0.0
22936 * @category Util
22937 * @param {Object} object The object to query.
22938 * @returns {Function} Returns the new accessor function.
22939 * @example
22940 *
22941 * var array = [0, 1, 2],
22942 * object = { 'a': array, 'b': array, 'c': array };
22943 *
22944 * _.map(['a[2]', 'c[0]'], _.propertyOf(object));
22945 * // => [2, 0]
22946 *
22947 * _.map([['a', '2'], ['c', '0']], _.propertyOf(object));
22948 * // => [2, 0]
22949 */
22950 function propertyOf(object) {
22951 return function(path) {
22952 return object == null ? undefined : baseGet(object, path);
22953 };
22954 }
22955
22956 /**
22957 * Creates an array of numbers (positive and/or negative) progressing from
22958 * `start` up to, but not including, `end`. A step of `-1` is used if a negative
22959 * `start` is specified without an `end` or `step`. If `end` is not specified,
22960 * it's set to `start` with `start` then set to `0`.
22961 *
22962 * **Note:** JavaScript follows the IEEE-754 standard for resolving
22963 * floating-point values which can produce unexpected results.
22964 *
22965 * @static
22966 * @since 0.1.0
22967 * @memberOf _
22968 * @category Util
22969 * @param {number} [start=0] The start of the range.
22970 * @param {number} end The end of the range.
22971 * @param {number} [step=1] The value to increment or decrement by.
22972 * @returns {Array} Returns the range of numbers.
22973 * @see _.inRange, _.rangeRight
22974 * @example
22975 *
22976 * _.range(4);
22977 * // => [0, 1, 2, 3]
22978 *
22979 * _.range(-4);
22980 * // => [0, -1, -2, -3]
22981 *
22982 * _.range(1, 5);
22983 * // => [1, 2, 3, 4]
22984 *
22985 * _.range(0, 20, 5);
22986 * // => [0, 5, 10, 15]
22987 *
22988 * _.range(0, -4, -1);
22989 * // => [0, -1, -2, -3]
22990 *
22991 * _.range(1, 4, 0);
22992 * // => [1, 1, 1]
22993 *
22994 * _.range(0);
22995 * // => []
22996 */
22997 var range = createRange();
22998
22999 /**
23000 * This method is like `_.range` except that it populates values in
23001 * descending order.
23002 *
23003 * @static
23004 * @memberOf _
23005 * @since 4.0.0
23006 * @category Util
23007 * @param {number} [start=0] The start of the range.
23008 * @param {number} end The end of the range.
23009 * @param {number} [step=1] The value to increment or decrement by.
23010 * @returns {Array} Returns the range of numbers.
23011 * @see _.inRange, _.range
23012 * @example
23013 *
23014 * _.rangeRight(4);
23015 * // => [3, 2, 1, 0]
23016 *
23017 * _.rangeRight(-4);
23018 * // => [-3, -2, -1, 0]
23019 *
23020 * _.rangeRight(1, 5);
23021 * // => [4, 3, 2, 1]
23022 *
23023 * _.rangeRight(0, 20, 5);
23024 * // => [15, 10, 5, 0]
23025 *
23026 * _.rangeRight(0, -4, -1);
23027 * // => [-3, -2, -1, 0]
23028 *
23029 * _.rangeRight(1, 4, 0);
23030 * // => [1, 1, 1]
23031 *
23032 * _.rangeRight(0);
23033 * // => []
23034 */
23035 var rangeRight = createRange(true);
23036
23037 /**
23038 * This method returns a new empty array.
23039 *
23040 * @static
23041 * @memberOf _
23042 * @since 4.13.0
23043 * @category Util
23044 * @returns {Array} Returns the new empty array.
23045 * @example
23046 *
23047 * var arrays = _.times(2, _.stubArray);
23048 *
23049 * console.log(arrays);
23050 * // => [[], []]
23051 *
23052 * console.log(arrays[0] === arrays[1]);
23053 * // => false
23054 */
23055 function stubArray() {
23056 return [];
23057 }
23058
23059 /**
23060 * This method returns `false`.
23061 *
23062 * @static
23063 * @memberOf _
23064 * @since 4.13.0
23065 * @category Util
23066 * @returns {boolean} Returns `false`.
23067 * @example
23068 *
23069 * _.times(2, _.stubFalse);
23070 * // => [false, false]
23071 */
23072 function stubFalse() {
23073 return false;
23074 }
23075
23076 /**
23077 * This method returns a new empty object.
23078 *
23079 * @static
23080 * @memberOf _
23081 * @since 4.13.0
23082 * @category Util
23083 * @returns {Object} Returns the new empty object.
23084 * @example
23085 *
23086 * var objects = _.times(2, _.stubObject);
23087 *
23088 * console.log(objects);
23089 * // => [{}, {}]
23090 *
23091 * console.log(objects[0] === objects[1]);
23092 * // => false
23093 */
23094 function stubObject() {
23095 return {};
23096 }
23097
23098 /**
23099 * This method returns an empty string.
23100 *
23101 * @static
23102 * @memberOf _
23103 * @since 4.13.0
23104 * @category Util
23105 * @returns {string} Returns the empty string.
23106 * @example
23107 *
23108 * _.times(2, _.stubString);
23109 * // => ['', '']
23110 */
23111 function stubString() {
23112 return '';
23113 }
23114
23115 /**
23116 * This method returns `true`.
23117 *
23118 * @static
23119 * @memberOf _
23120 * @since 4.13.0
23121 * @category Util
23122 * @returns {boolean} Returns `true`.
23123 * @example
23124 *
23125 * _.times(2, _.stubTrue);
23126 * // => [true, true]
23127 */
23128 function stubTrue() {
23129 return true;
23130 }
23131
23132 /**
23133 * Invokes the iteratee `n` times, returning an array of the results of
23134 * each invocation. The iteratee is invoked with one argument; (index).
23135 *
23136 * @static
23137 * @since 0.1.0
23138 * @memberOf _
23139 * @category Util
23140 * @param {number} n The number of times to invoke `iteratee`.
23141 * @param {Function} [iteratee=_.identity] The function invoked per iteration.
23142 * @returns {Array} Returns the array of results.
23143 * @example
23144 *
23145 * _.times(3, String);
23146 * // => ['0', '1', '2']
23147 *
23148 * _.times(4, _.constant(0));
23149 * // => [0, 0, 0, 0]
23150 */
23151 function times(n, iteratee) {
23152 n = toInteger(n);
23153 if (n < 1 || n > MAX_SAFE_INTEGER) {
23154 return [];
23155 }
23156 var index = MAX_ARRAY_LENGTH,
23157 length = nativeMin(n, MAX_ARRAY_LENGTH);
23158
23159 iteratee = getIteratee(iteratee);
23160 n -= MAX_ARRAY_LENGTH;
23161
23162 var result = baseTimes(length, iteratee);
23163 while (++index < n) {
23164 iteratee(index);
23165 }
23166 return result;
23167 }
23168
23169 /**
23170 * Converts `value` to a property path array.
23171 *
23172 * @static
23173 * @memberOf _
23174 * @since 4.0.0
23175 * @category Util
23176 * @param {*} value The value to convert.
23177 * @returns {Array} Returns the new property path array.
23178 * @example
23179 *
23180 * _.toPath('a.b.c');
23181 * // => ['a', 'b', 'c']
23182 *
23183 * _.toPath('a[0].b.c');
23184 * // => ['a', '0', 'b', 'c']
23185 */
23186 function toPath(value) {
23187 if (isArray(value)) {
23188 return arrayMap(value, toKey);
23189 }
23190 return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value)));
23191 }
23192
23193 /**
23194 * Generates a unique ID. If `prefix` is given, the ID is appended to it.
23195 *
23196 * @static
23197 * @since 0.1.0
23198 * @memberOf _
23199 * @category Util
23200 * @param {string} [prefix=''] The value to prefix the ID with.
23201 * @returns {string} Returns the unique ID.
23202 * @example
23203 *
23204 * _.uniqueId('contact_');
23205 * // => 'contact_104'
23206 *
23207 * _.uniqueId();
23208 * // => '105'
23209 */
23210 function uniqueId(prefix) {
23211 var id = ++idCounter;
23212 return toString(prefix) + id;
23213 }
23214
23215 /*------------------------------------------------------------------------*/
23216
23217 /**
23218 * Adds two numbers.
23219 *
23220 * @static
23221 * @memberOf _
23222 * @since 3.4.0
23223 * @category Math
23224 * @param {number} augend The first number in an addition.
23225 * @param {number} addend The second number in an addition.
23226 * @returns {number} Returns the total.
23227 * @example
23228 *
23229 * _.add(6, 4);
23230 * // => 10
23231 */
23232 var add = createMathOperation(function(augend, addend) {
23233 return augend + addend;
23234 }, 0);
23235
23236 /**
23237 * Computes `number` rounded up to `precision`.
23238 *
23239 * @static
23240 * @memberOf _
23241 * @since 3.10.0
23242 * @category Math
23243 * @param {number} number The number to round up.
23244 * @param {number} [precision=0] The precision to round up to.
23245 * @returns {number} Returns the rounded up number.
23246 * @example
23247 *
23248 * _.ceil(4.006);
23249 * // => 5
23250 *
23251 * _.ceil(6.004, 2);
23252 * // => 6.01
23253 *
23254 * _.ceil(6040, -2);
23255 * // => 6100
23256 */
23257 var ceil = createRound('ceil');
23258
23259 /**
23260 * Divide two numbers.
23261 *
23262 * @static
23263 * @memberOf _
23264 * @since 4.7.0
23265 * @category Math
23266 * @param {number} dividend The first number in a division.
23267 * @param {number} divisor The second number in a division.
23268 * @returns {number} Returns the quotient.
23269 * @example
23270 *
23271 * _.divide(6, 4);
23272 * // => 1.5
23273 */
23274 var divide = createMathOperation(function(dividend, divisor) {
23275 return dividend / divisor;
23276 }, 1);
23277
23278 /**
23279 * Computes `number` rounded down to `precision`.
23280 *
23281 * @static
23282 * @memberOf _
23283 * @since 3.10.0
23284 * @category Math
23285 * @param {number} number The number to round down.
23286 * @param {number} [precision=0] The precision to round down to.
23287 * @returns {number} Returns the rounded down number.
23288 * @example
23289 *
23290 * _.floor(4.006);
23291 * // => 4
23292 *
23293 * _.floor(0.046, 2);
23294 * // => 0.04
23295 *
23296 * _.floor(4060, -2);
23297 * // => 4000
23298 */
23299 var floor = createRound('floor');
23300
23301 /**
23302 * Computes the maximum value of `array`. If `array` is empty or falsey,
23303 * `undefined` is returned.
23304 *
23305 * @static
23306 * @since 0.1.0
23307 * @memberOf _
23308 * @category Math
23309 * @param {Array} array The array to iterate over.
23310 * @returns {*} Returns the maximum value.
23311 * @example
23312 *
23313 * _.max([4, 2, 8, 6]);
23314 * // => 8
23315 *
23316 * _.max([]);
23317 * // => undefined
23318 */
23319 function max(array) {
23320 return (array && array.length)
23321 ? baseExtremum(array, identity, baseGt)
23322 : undefined;
23323 }
23324
23325 /**
23326 * This method is like `_.max` except that it accepts `iteratee` which is
23327 * invoked for each element in `array` to generate the criterion by which
23328 * the value is ranked. The iteratee is invoked with one argument: (value).
23329 *
23330 * @static
23331 * @memberOf _
23332 * @since 4.0.0
23333 * @category Math
23334 * @param {Array} array The array to iterate over.
23335 * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
23336 * @returns {*} Returns the maximum value.
23337 * @example
23338 *
23339 * var objects = [{ 'n': 1 }, { 'n': 2 }];
23340 *
23341 * _.maxBy(objects, function(o) { return o.n; });
23342 * // => { 'n': 2 }
23343 *
23344 * // The `_.property` iteratee shorthand.
23345 * _.maxBy(objects, 'n');
23346 * // => { 'n': 2 }
23347 */
23348 function maxBy(array, iteratee) {
23349 return (array && array.length)
23350 ? baseExtremum(array, getIteratee(iteratee, 2), baseGt)
23351 : undefined;
23352 }
23353
23354 /**
23355 * Computes the mean of the values in `array`.
23356 *
23357 * @static
23358 * @memberOf _
23359 * @since 4.0.0
23360 * @category Math
23361 * @param {Array} array The array to iterate over.
23362 * @returns {number} Returns the mean.
23363 * @example
23364 *
23365 * _.mean([4, 2, 8, 6]);
23366 * // => 5
23367 */
23368 function mean(array) {
23369 return baseMean(array, identity);
23370 }
23371
23372 /**
23373 * This method is like `_.mean` except that it accepts `iteratee` which is
23374 * invoked for each element in `array` to generate the value to be averaged.
23375 * The iteratee is invoked with one argument: (value).
23376 *
23377 * @static
23378 * @memberOf _
23379 * @since 4.7.0
23380 * @category Math
23381 * @param {Array} array The array to iterate over.
23382 * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
23383 * @returns {number} Returns the mean.
23384 * @example
23385 *
23386 * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
23387 *
23388 * _.meanBy(objects, function(o) { return o.n; });
23389 * // => 5
23390 *
23391 * // The `_.property` iteratee shorthand.
23392 * _.meanBy(objects, 'n');
23393 * // => 5
23394 */
23395 function meanBy(array, iteratee) {
23396 return baseMean(array, getIteratee(iteratee, 2));
23397 }
23398
23399 /**
23400 * Computes the minimum value of `array`. If `array` is empty or falsey,
23401 * `undefined` is returned.
23402 *
23403 * @static
23404 * @since 0.1.0
23405 * @memberOf _
23406 * @category Math
23407 * @param {Array} array The array to iterate over.
23408 * @returns {*} Returns the minimum value.
23409 * @example
23410 *
23411 * _.min([4, 2, 8, 6]);
23412 * // => 2
23413 *
23414 * _.min([]);
23415 * // => undefined
23416 */
23417 function min(array) {
23418 return (array && array.length)
23419 ? baseExtremum(array, identity, baseLt)
23420 : undefined;
23421 }
23422
23423 /**
23424 * This method is like `_.min` except that it accepts `iteratee` which is
23425 * invoked for each element in `array` to generate the criterion by which
23426 * the value is ranked. The iteratee is invoked with one argument: (value).
23427 *
23428 * @static
23429 * @memberOf _
23430 * @since 4.0.0
23431 * @category Math
23432 * @param {Array} array The array to iterate over.
23433 * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
23434 * @returns {*} Returns the minimum value.
23435 * @example
23436 *
23437 * var objects = [{ 'n': 1 }, { 'n': 2 }];
23438 *
23439 * _.minBy(objects, function(o) { return o.n; });
23440 * // => { 'n': 1 }
23441 *
23442 * // The `_.property` iteratee shorthand.
23443 * _.minBy(objects, 'n');
23444 * // => { 'n': 1 }
23445 */
23446 function minBy(array, iteratee) {
23447 return (array && array.length)
23448 ? baseExtremum(array, getIteratee(iteratee, 2), baseLt)
23449 : undefined;
23450 }
23451
23452 /**
23453 * Multiply two numbers.
23454 *
23455 * @static
23456 * @memberOf _
23457 * @since 4.7.0
23458 * @category Math
23459 * @param {number} multiplier The first number in a multiplication.
23460 * @param {number} multiplicand The second number in a multiplication.
23461 * @returns {number} Returns the product.
23462 * @example
23463 *
23464 * _.multiply(6, 4);
23465 * // => 24
23466 */
23467 var multiply = createMathOperation(function(multiplier, multiplicand) {
23468 return multiplier * multiplicand;
23469 }, 1);
23470
23471 /**
23472 * Computes `number` rounded to `precision`.
23473 *
23474 * @static
23475 * @memberOf _
23476 * @since 3.10.0
23477 * @category Math
23478 * @param {number} number The number to round.
23479 * @param {number} [precision=0] The precision to round to.
23480 * @returns {number} Returns the rounded number.
23481 * @example
23482 *
23483 * _.round(4.006);
23484 * // => 4
23485 *
23486 * _.round(4.006, 2);
23487 * // => 4.01
23488 *
23489 * _.round(4060, -2);
23490 * // => 4100
23491 */
23492 var round = createRound('round');
23493
23494 /**
23495 * Subtract two numbers.
23496 *
23497 * @static
23498 * @memberOf _
23499 * @since 4.0.0
23500 * @category Math
23501 * @param {number} minuend The first number in a subtraction.
23502 * @param {number} subtrahend The second number in a subtraction.
23503 * @returns {number} Returns the difference.
23504 * @example
23505 *
23506 * _.subtract(6, 4);
23507 * // => 2
23508 */
23509 var subtract = createMathOperation(function(minuend, subtrahend) {
23510 return minuend - subtrahend;
23511 }, 0);
23512
23513 /**
23514 * Computes the sum of the values in `array`.
23515 *
23516 * @static
23517 * @memberOf _
23518 * @since 3.4.0
23519 * @category Math
23520 * @param {Array} array The array to iterate over.
23521 * @returns {number} Returns the sum.
23522 * @example
23523 *
23524 * _.sum([4, 2, 8, 6]);
23525 * // => 20
23526 */
23527 function sum(array) {
23528 return (array && array.length)
23529 ? baseSum(array, identity)
23530 : 0;
23531 }
23532
23533 /**
23534 * This method is like `_.sum` except that it accepts `iteratee` which is
23535 * invoked for each element in `array` to generate the value to be summed.
23536 * The iteratee is invoked with one argument: (value).
23537 *
23538 * @static
23539 * @memberOf _
23540 * @since 4.0.0
23541 * @category Math
23542 * @param {Array} array The array to iterate over.
23543 * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
23544 * @returns {number} Returns the sum.
23545 * @example
23546 *
23547 * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
23548 *
23549 * _.sumBy(objects, function(o) { return o.n; });
23550 * // => 20
23551 *
23552 * // The `_.property` iteratee shorthand.
23553 * _.sumBy(objects, 'n');
23554 * // => 20
23555 */
23556 function sumBy(array, iteratee) {
23557 return (array && array.length)
23558 ? baseSum(array, getIteratee(iteratee, 2))
23559 : 0;
23560 }
23561
23562 /*------------------------------------------------------------------------*/
23563
23564 // Add methods that return wrapped values in chain sequences.
23565 lodash.after = after;
23566 lodash.ary = ary;
23567 lodash.assign = assign;
23568 lodash.assignIn = assignIn;
23569 lodash.assignInWith = assignInWith;
23570 lodash.assignWith = assignWith;
23571 lodash.at = at;
23572 lodash.before = before;
23573 lodash.bind = bind;
23574 lodash.bindAll = bindAll;
23575 lodash.bindKey = bindKey;
23576 lodash.castArray = castArray;
23577 lodash.chain = chain;
23578 lodash.chunk = chunk;
23579 lodash.compact = compact;
23580 lodash.concat = concat;
23581 lodash.cond = cond;
23582 lodash.conforms = conforms;
23583 lodash.constant = constant;
23584 lodash.countBy = countBy;
23585 lodash.create = create;
23586 lodash.curry = curry;
23587 lodash.curryRight = curryRight;
23588 lodash.debounce = debounce;
23589 lodash.defaults = defaults;
23590 lodash.defaultsDeep = defaultsDeep;
23591 lodash.defer = defer;
23592 lodash.delay = delay;
23593 lodash.difference = difference;
23594 lodash.differenceBy = differenceBy;
23595 lodash.differenceWith = differenceWith;
23596 lodash.drop = drop;
23597 lodash.dropRight = dropRight;
23598 lodash.dropRightWhile = dropRightWhile;
23599 lodash.dropWhile = dropWhile;
23600 lodash.fill = fill;
23601 lodash.filter = filter;
23602 lodash.flatMap = flatMap;
23603 lodash.flatMapDeep = flatMapDeep;
23604 lodash.flatMapDepth = flatMapDepth;
23605 lodash.flatten = flatten;
23606 lodash.flattenDeep = flattenDeep;
23607 lodash.flattenDepth = flattenDepth;
23608 lodash.flip = flip;
23609 lodash.flow = flow;
23610 lodash.flowRight = flowRight;
23611 lodash.fromPairs = fromPairs;
23612 lodash.functions = functions;
23613 lodash.functionsIn = functionsIn;
23614 lodash.groupBy = groupBy;
23615 lodash.initial = initial;
23616 lodash.intersection = intersection;
23617 lodash.intersectionBy = intersectionBy;
23618 lodash.intersectionWith = intersectionWith;
23619 lodash.invert = invert;
23620 lodash.invertBy = invertBy;
23621 lodash.invokeMap = invokeMap;
23622 lodash.iteratee = iteratee;
23623 lodash.keyBy = keyBy;
23624 lodash.keys = keys;
23625 lodash.keysIn = keysIn;
23626 lodash.map = map;
23627 lodash.mapKeys = mapKeys;
23628 lodash.mapValues = mapValues;
23629 lodash.matches = matches;
23630 lodash.matchesProperty = matchesProperty;
23631 lodash.memoize = memoize;
23632 lodash.merge = merge;
23633 lodash.mergeWith = mergeWith;
23634 lodash.method = method;
23635 lodash.methodOf = methodOf;
23636 lodash.mixin = mixin;
23637 lodash.negate = negate;
23638 lodash.nthArg = nthArg;
23639 lodash.omit = omit;
23640 lodash.omitBy = omitBy;
23641 lodash.once = once;
23642 lodash.orderBy = orderBy;
23643 lodash.over = over;
23644 lodash.overArgs = overArgs;
23645 lodash.overEvery = overEvery;
23646 lodash.overSome = overSome;
23647 lodash.partial = partial;
23648 lodash.partialRight = partialRight;
23649 lodash.partition = partition;
23650 lodash.pick = pick;
23651 lodash.pickBy = pickBy;
23652 lodash.property = property;
23653 lodash.propertyOf = propertyOf;
23654 lodash.pull = pull;
23655 lodash.pullAll = pullAll;
23656 lodash.pullAllBy = pullAllBy;
23657 lodash.pullAllWith = pullAllWith;
23658 lodash.pullAt = pullAt;
23659 lodash.range = range;
23660 lodash.rangeRight = rangeRight;
23661 lodash.rearg = rearg;
23662 lodash.reject = reject;
23663 lodash.remove = remove;
23664 lodash.rest = rest;
23665 lodash.reverse = reverse;
23666 lodash.sampleSize = sampleSize;
23667 lodash.set = set;
23668 lodash.setWith = setWith;
23669 lodash.shuffle = shuffle;
23670 lodash.slice = slice;
23671 lodash.sortBy = sortBy;
23672 lodash.sortedUniq = sortedUniq;
23673 lodash.sortedUniqBy = sortedUniqBy;
23674 lodash.split = split;
23675 lodash.spread = spread;
23676 lodash.tail = tail;
23677 lodash.take = take;
23678 lodash.takeRight = takeRight;
23679 lodash.takeRightWhile = takeRightWhile;
23680 lodash.takeWhile = takeWhile;
23681 lodash.tap = tap;
23682 lodash.throttle = throttle;
23683 lodash.thru = thru;
23684 lodash.toArray = toArray;
23685 lodash.toPairs = toPairs;
23686 lodash.toPairsIn = toPairsIn;
23687 lodash.toPath = toPath;
23688 lodash.toPlainObject = toPlainObject;
23689 lodash.transform = transform;
23690 lodash.unary = unary;
23691 lodash.union = union;
23692 lodash.unionBy = unionBy;
23693 lodash.unionWith = unionWith;
23694 lodash.uniq = uniq;
23695 lodash.uniqBy = uniqBy;
23696 lodash.uniqWith = uniqWith;
23697 lodash.unset = unset;
23698 lodash.unzip = unzip;
23699 lodash.unzipWith = unzipWith;
23700 lodash.update = update;
23701 lodash.updateWith = updateWith;
23702 lodash.values = values;
23703 lodash.valuesIn = valuesIn;
23704 lodash.without = without;
23705 lodash.words = words;
23706 lodash.wrap = wrap;
23707 lodash.xor = xor;
23708 lodash.xorBy = xorBy;
23709 lodash.xorWith = xorWith;
23710 lodash.zip = zip;
23711 lodash.zipObject = zipObject;
23712 lodash.zipObjectDeep = zipObjectDeep;
23713 lodash.zipWith = zipWith;
23714
23715 // Add aliases.
23716 lodash.entries = toPairs;
23717 lodash.entriesIn = toPairsIn;
23718 lodash.extend = assignIn;
23719 lodash.extendWith = assignInWith;
23720
23721 // Add methods to `lodash.prototype`.
23722 mixin(lodash, lodash);
23723
23724 /*------------------------------------------------------------------------*/
23725
23726 // Add methods that return unwrapped values in chain sequences.
23727 lodash.add = add;
23728 lodash.attempt = attempt;
23729 lodash.camelCase = camelCase;
23730 lodash.capitalize = capitalize;
23731 lodash.ceil = ceil;
23732 lodash.clamp = clamp;
23733 lodash.clone = clone;
23734 lodash.cloneDeep = cloneDeep;
23735 lodash.cloneDeepWith = cloneDeepWith;
23736 lodash.cloneWith = cloneWith;
23737 lodash.conformsTo = conformsTo;
23738 lodash.deburr = deburr;
23739 lodash.defaultTo = defaultTo;
23740 lodash.divide = divide;
23741 lodash.endsWith = endsWith;
23742 lodash.eq = eq;
23743 lodash.escape = escape;
23744 lodash.escapeRegExp = escapeRegExp;
23745 lodash.every = every;
23746 lodash.find = find;
23747 lodash.findIndex = findIndex;
23748 lodash.findKey = findKey;
23749 lodash.findLast = findLast;
23750 lodash.findLastIndex = findLastIndex;
23751 lodash.findLastKey = findLastKey;
23752 lodash.floor = floor;
23753 lodash.forEach = forEach;
23754 lodash.forEachRight = forEachRight;
23755 lodash.forIn = forIn;
23756 lodash.forInRight = forInRight;
23757 lodash.forOwn = forOwn;
23758 lodash.forOwnRight = forOwnRight;
23759 lodash.get = get;
23760 lodash.gt = gt;
23761 lodash.gte = gte;
23762 lodash.has = has;
23763 lodash.hasIn = hasIn;
23764 lodash.head = head;
23765 lodash.identity = identity;
23766 lodash.includes = includes;
23767 lodash.indexOf = indexOf;
23768 lodash.inRange = inRange;
23769 lodash.invoke = invoke;
23770 lodash.isArguments = isArguments;
23771 lodash.isArray = isArray;
23772 lodash.isArrayBuffer = isArrayBuffer;
23773 lodash.isArrayLike = isArrayLike;
23774 lodash.isArrayLikeObject = isArrayLikeObject;
23775 lodash.isBoolean = isBoolean;
23776 lodash.isBuffer = isBuffer;
23777 lodash.isDate = isDate;
23778 lodash.isElement = isElement;
23779 lodash.isEmpty = isEmpty;
23780 lodash.isEqual = isEqual;
23781 lodash.isEqualWith = isEqualWith;
23782 lodash.isError = isError;
23783 lodash.isFinite = isFinite;
23784 lodash.isFunction = isFunction;
23785 lodash.isInteger = isInteger;
23786 lodash.isLength = isLength;
23787 lodash.isMap = isMap;
23788 lodash.isMatch = isMatch;
23789 lodash.isMatchWith = isMatchWith;
23790 lodash.isNaN = isNaN;
23791 lodash.isNative = isNative;
23792 lodash.isNil = isNil;
23793 lodash.isNull = isNull;
23794 lodash.isNumber = isNumber;
23795 lodash.isObject = isObject;
23796 lodash.isObjectLike = isObjectLike;
23797 lodash.isPlainObject = isPlainObject;
23798 lodash.isRegExp = isRegExp;
23799 lodash.isSafeInteger = isSafeInteger;
23800 lodash.isSet = isSet;
23801 lodash.isString = isString;
23802 lodash.isSymbol = isSymbol;
23803 lodash.isTypedArray = isTypedArray;
23804 lodash.isUndefined = isUndefined;
23805 lodash.isWeakMap = isWeakMap;
23806 lodash.isWeakSet = isWeakSet;
23807 lodash.join = join;
23808 lodash.kebabCase = kebabCase;
23809 lodash.last = last;
23810 lodash.lastIndexOf = lastIndexOf;
23811 lodash.lowerCase = lowerCase;
23812 lodash.lowerFirst = lowerFirst;
23813 lodash.lt = lt;
23814 lodash.lte = lte;
23815 lodash.max = max;
23816 lodash.maxBy = maxBy;
23817 lodash.mean = mean;
23818 lodash.meanBy = meanBy;
23819 lodash.min = min;
23820 lodash.minBy = minBy;
23821 lodash.stubArray = stubArray;
23822 lodash.stubFalse = stubFalse;
23823 lodash.stubObject = stubObject;
23824 lodash.stubString = stubString;
23825 lodash.stubTrue = stubTrue;
23826 lodash.multiply = multiply;
23827 lodash.nth = nth;
23828 lodash.noConflict = noConflict;
23829 lodash.noop = noop;
23830 lodash.now = now;
23831 lodash.pad = pad;
23832 lodash.padEnd = padEnd;
23833 lodash.padStart = padStart;
23834 lodash.parseInt = parseInt;
23835 lodash.random = random;
23836 lodash.reduce = reduce;
23837 lodash.reduceRight = reduceRight;
23838 lodash.repeat = repeat;
23839 lodash.replace = replace;
23840 lodash.result = result;
23841 lodash.round = round;
23842 lodash.runInContext = runInContext;
23843 lodash.sample = sample;
23844 lodash.size = size;
23845 lodash.snakeCase = snakeCase;
23846 lodash.some = some;
23847 lodash.sortedIndex = sortedIndex;
23848 lodash.sortedIndexBy = sortedIndexBy;
23849 lodash.sortedIndexOf = sortedIndexOf;
23850 lodash.sortedLastIndex = sortedLastIndex;
23851 lodash.sortedLastIndexBy = sortedLastIndexBy;
23852 lodash.sortedLastIndexOf = sortedLastIndexOf;
23853 lodash.startCase = startCase;
23854 lodash.startsWith = startsWith;
23855 lodash.subtract = subtract;
23856 lodash.sum = sum;
23857 lodash.sumBy = sumBy;
23858 lodash.template = template;
23859 lodash.times = times;
23860 lodash.toFinite = toFinite;
23861 lodash.toInteger = toInteger;
23862 lodash.toLength = toLength;
23863 lodash.toLower = toLower;
23864 lodash.toNumber = toNumber;
23865 lodash.toSafeInteger = toSafeInteger;
23866 lodash.toString = toString;
23867 lodash.toUpper = toUpper;
23868 lodash.trim = trim;
23869 lodash.trimEnd = trimEnd;
23870 lodash.trimStart = trimStart;
23871 lodash.truncate = truncate;
23872 lodash.unescape = unescape;
23873 lodash.uniqueId = uniqueId;
23874 lodash.upperCase = upperCase;
23875 lodash.upperFirst = upperFirst;
23876
23877 // Add aliases.
23878 lodash.each = forEach;
23879 lodash.eachRight = forEachRight;
23880 lodash.first = head;
23881
23882 mixin(lodash, (function() {
23883 var source = {};
23884 baseForOwn(lodash, function(func, methodName) {
23885 if (!hasOwnProperty.call(lodash.prototype, methodName)) {
23886 source[methodName] = func;
23887 }
23888 });
23889 return source;
23890 }()), { 'chain': false });
23891
23892 /*------------------------------------------------------------------------*/
23893
23894 /**
23895 * The semantic version number.
23896 *
23897 * @static
23898 * @memberOf _
23899 * @type {string}
23900 */
23901 lodash.VERSION = VERSION;
23902
23903 // Assign default placeholders.
23904 arrayEach(['bind', 'bindKey', 'curry', 'curryRight', 'partial', 'partialRight'], function(methodName) {
23905 lodash[methodName].placeholder = lodash;
23906 });
23907
23908 // Add `LazyWrapper` methods for `_.drop` and `_.take` variants.
23909 arrayEach(['drop', 'take'], function(methodName, index) {
23910 LazyWrapper.prototype[methodName] = function(n) {
23911 n = n === undefined ? 1 : nativeMax(toInteger(n), 0);
23912
23913 var result = (this.__filtered__ && !index)
23914 ? new LazyWrapper(this)
23915 : this.clone();
23916
23917 if (result.__filtered__) {
23918 result.__takeCount__ = nativeMin(n, result.__takeCount__);
23919 } else {
23920 result.__views__.push({
23921 'size': nativeMin(n, MAX_ARRAY_LENGTH),
23922 'type': methodName + (result.__dir__ < 0 ? 'Right' : '')
23923 });
23924 }
23925 return result;
23926 };
23927
23928 LazyWrapper.prototype[methodName + 'Right'] = function(n) {
23929 return this.reverse()[methodName](n).reverse();
23930 };
23931 });
23932
23933 // Add `LazyWrapper` methods that accept an `iteratee` value.
23934 arrayEach(['filter', 'map', 'takeWhile'], function(methodName, index) {
23935 var type = index + 1,
23936 isFilter = type == LAZY_FILTER_FLAG || type == LAZY_WHILE_FLAG;
23937
23938 LazyWrapper.prototype[methodName] = function(iteratee) {
23939 var result = this.clone();
23940 result.__iteratees__.push({
23941 'iteratee': getIteratee(iteratee, 3),
23942 'type': type
23943 });
23944 result.__filtered__ = result.__filtered__ || isFilter;
23945 return result;
23946 };
23947 });
23948
23949 // Add `LazyWrapper` methods for `_.head` and `_.last`.
23950 arrayEach(['head', 'last'], function(methodName, index) {
23951 var takeName = 'take' + (index ? 'Right' : '');
23952
23953 LazyWrapper.prototype[methodName] = function() {
23954 return this[takeName](1).value()[0];
23955 };
23956 });
23957
23958 // Add `LazyWrapper` methods for `_.initial` and `_.tail`.
23959 arrayEach(['initial', 'tail'], function(methodName, index) {
23960 var dropName = 'drop' + (index ? '' : 'Right');
23961
23962 LazyWrapper.prototype[methodName] = function() {
23963 return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1);
23964 };
23965 });
23966
23967 LazyWrapper.prototype.compact = function() {
23968 return this.filter(identity);
23969 };
23970
23971 LazyWrapper.prototype.find = function(predicate) {
23972 return this.filter(predicate).head();
23973 };
23974
23975 LazyWrapper.prototype.findLast = function(predicate) {
23976 return this.reverse().find(predicate);
23977 };
23978
23979 LazyWrapper.prototype.invokeMap = baseRest(function(path, args) {
23980 if (typeof path == 'function') {
23981 return new LazyWrapper(this);
23982 }
23983 return this.map(function(value) {
23984 return baseInvoke(value, path, args);
23985 });
23986 });
23987
23988 LazyWrapper.prototype.reject = function(predicate) {
23989 return this.filter(negate(getIteratee(predicate)));
23990 };
23991
23992 LazyWrapper.prototype.slice = function(start, end) {
23993 start = toInteger(start);
23994
23995 var result = this;
23996 if (result.__filtered__ && (start > 0 || end < 0)) {
23997 return new LazyWrapper(result);
23998 }
23999 if (start < 0) {
24000 result = result.takeRight(-start);
24001 } else if (start) {
24002 result = result.drop(start);
24003 }
24004 if (end !== undefined) {
24005 end = toInteger(end);
24006 result = end < 0 ? result.dropRight(-end) : result.take(end - start);
24007 }
24008 return result;
24009 };
24010
24011 LazyWrapper.prototype.takeRightWhile = function(predicate) {
24012 return this.reverse().takeWhile(predicate).reverse();
24013 };
24014
24015 LazyWrapper.prototype.toArray = function() {
24016 return this.take(MAX_ARRAY_LENGTH);
24017 };
24018
24019 // Add `LazyWrapper` methods to `lodash.prototype`.
24020 baseForOwn(LazyWrapper.prototype, function(func, methodName) {
24021 var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName),
24022 isTaker = /^(?:head|last)$/.test(methodName),
24023 lodashFunc = lodash[isTaker ? ('take' + (methodName == 'last' ? 'Right' : '')) : methodName],
24024 retUnwrapped = isTaker || /^find/.test(methodName);
24025
24026 if (!lodashFunc) {
24027 return;
24028 }
24029 lodash.prototype[methodName] = function() {
24030 var value = this.__wrapped__,
24031 args = isTaker ? [1] : arguments,
24032 isLazy = value instanceof LazyWrapper,
24033 iteratee = args[0],
24034 useLazy = isLazy || isArray(value);
24035
24036 var interceptor = function(value) {
24037 var result = lodashFunc.apply(lodash, arrayPush([value], args));
24038 return (isTaker && chainAll) ? result[0] : result;
24039 };
24040
24041 if (useLazy && checkIteratee && typeof iteratee == 'function' && iteratee.length != 1) {
24042 // Avoid lazy use if the iteratee has a "length" value other than `1`.
24043 isLazy = useLazy = false;
24044 }
24045 var chainAll = this.__chain__,
24046 isHybrid = !!this.__actions__.length,
24047 isUnwrapped = retUnwrapped && !chainAll,
24048 onlyLazy = isLazy && !isHybrid;
24049
24050 if (!retUnwrapped && useLazy) {
24051 value = onlyLazy ? value : new LazyWrapper(this);
24052 var result = func.apply(value, args);
24053 result.__actions__.push({ 'func': thru, 'args': [interceptor], 'thisArg': undefined });
24054 return new LodashWrapper(result, chainAll);
24055 }
24056 if (isUnwrapped && onlyLazy) {
24057 return func.apply(this, args);
24058 }
24059 result = this.thru(interceptor);
24060 return isUnwrapped ? (isTaker ? result.value()[0] : result.value()) : result;
24061 };
24062 });
24063
24064 // Add `Array` methods to `lodash.prototype`.
24065 arrayEach(['pop', 'push', 'shift', 'sort', 'splice', 'unshift'], function(methodName) {
24066 var func = arrayProto[methodName],
24067 chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru',
24068 retUnwrapped = /^(?:pop|shift)$/.test(methodName);
24069
24070 lodash.prototype[methodName] = function() {
24071 var args = arguments;
24072 if (retUnwrapped && !this.__chain__) {
24073 var value = this.value();
24074 return func.apply(isArray(value) ? value : [], args);
24075 }
24076 return this[chainName](function(value) {
24077 return func.apply(isArray(value) ? value : [], args);
24078 });
24079 };
24080 });
24081
24082 // Map minified method names to their real names.
24083 baseForOwn(LazyWrapper.prototype, function(func, methodName) {
24084 var lodashFunc = lodash[methodName];
24085 if (lodashFunc) {
24086 var key = (lodashFunc.name + ''),
24087 names = realNames[key] || (realNames[key] = []);
24088
24089 names.push({ 'name': methodName, 'func': lodashFunc });
24090 }
24091 });
24092
24093 realNames[createHybrid(undefined, WRAP_BIND_KEY_FLAG).name] = [{
24094 'name': 'wrapper',
24095 'func': undefined
24096 }];
24097
24098 // Add methods to `LazyWrapper`.
24099 LazyWrapper.prototype.clone = lazyClone;
24100 LazyWrapper.prototype.reverse = lazyReverse;
24101 LazyWrapper.prototype.value = lazyValue;
24102
24103 // Add chain sequence methods to the `lodash` wrapper.
24104 lodash.prototype.at = wrapperAt;
24105 lodash.prototype.chain = wrapperChain;
24106 lodash.prototype.commit = wrapperCommit;
24107 lodash.prototype.next = wrapperNext;
24108 lodash.prototype.plant = wrapperPlant;
24109 lodash.prototype.reverse = wrapperReverse;
24110 lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue;
24111
24112 // Add lazy aliases.
24113 lodash.prototype.first = lodash.prototype.head;
24114
24115 if (symIterator) {
24116 lodash.prototype[symIterator] = wrapperToIterator;
24117 }
24118 return lodash;
24119 });
24120
24121 /*--------------------------------------------------------------------------*/
24122
24123 // Export lodash.
24124 var _ = runInContext();
24125
24126 // Some AMD build optimizers, like r.js, check for condition patterns like:
24127 if (true) {
24128 // Expose Lodash on the global object to prevent errors when Lodash is
24129 // loaded by a script tag in the presence of an AMD loader.
24130 // See http://requirejs.org/docs/errors.html#mismatch for more details.
24131 // Use `_.noConflict` to remove Lodash from the global object.
24132 root._ = _;
24133
24134 // Define as an anonymous module so, through path mapping, it can be
24135 // referenced as the "underscore" module.
24136 !(__WEBPACK_AMD_DEFINE_RESULT__ = function() {
24137 return _;
24138 }.call(exports, __webpack_require__, exports, module),
24139 __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
24140 }
24141 // Check for `exports` after `define` in case a build optimizer adds it.
24142 else if (freeModule) {
24143 // Export for Node.js.
24144 (freeModule.exports = _)._ = _;
24145 // Export for CommonJS support.
24146 freeExports._ = _;
24147 }
24148 else {
24149 // Export to the global object.
24150 root._ = _;
24151 }
24152}.call(this));
24153
24154/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(192), __webpack_require__(193)(module)))
24155
24156/***/ }),
24157/* 55 */
24158/***/ (function(module, exports) {
24159
24160function classname () {
24161 var result = {},
24162 objects = {},
24163 resultString = "";
24164
24165 function add (strings) {
24166 classname.each(strings.split(" "), function (string) {
24167 result[string] = !!string;
24168 });
24169 }
24170
24171 classname.each([].slice.call(arguments), function (x) {
24172 switch (classname.getType(x)) {
24173 case "string":
24174 case "number":
24175 add(x);
24176 break;
24177
24178 case "array":
24179 add(classname.apply(null, x));
24180 break;
24181
24182 case "element":
24183 add(classname(x.className || ""));
24184 break;
24185
24186 case "nodelist":
24187 add(classname.apply(null, [].slice.call(x)));
24188 break;
24189
24190 case "jquery":
24191 add(classname.apply(null, x.get()));
24192 break;
24193
24194 case "object":
24195 objects = classname.extend(objects, x);
24196 break;
24197 }
24198 });
24199
24200 result = classname.extend(result, objects);
24201
24202 classname.each(result, function (val, key) {
24203 if (val) {
24204 resultString += " " + key;
24205 }
24206 });
24207
24208 return resultString.substr(1);
24209}
24210
24211classname.setTo = function (elements) {
24212 var type = classname.getType(elements);
24213
24214 if (type === "element") {
24215 elements = [elements];
24216 }
24217
24218 if (type === "jquery") {
24219 elements = elements.get();
24220 }
24221
24222 if (type === "nodelist") {
24223 elements = [].slice.call(elements);
24224 }
24225
24226 return function () {
24227 var classNames = classname.apply(null, arguments);
24228
24229 classname.each(elements, function (element) {
24230 element.className = classNames;
24231 });
24232 };
24233};
24234
24235classname.each = function (arr, fn) {
24236 var type = classname.getType(arr);
24237
24238 if (type === "array") {
24239 for (var i = 0; i < arr.length; i++) {
24240 fn(arr[i], i);
24241 }
24242 }
24243
24244 if (type === "object") {
24245 for (var key in arr) {
24246 fn(arr[key], key);
24247 }
24248 }
24249};
24250
24251classname.getType = function (x) {
24252 var type = Object.prototype.toString.call(x).slice(8, -1).toLowerCase();
24253
24254 if (type === "object" && x.jquery) {
24255 return "jquery";
24256 }
24257
24258 if (type.indexOf("element") > 1) {
24259 return "element";
24260 }
24261
24262 return type;
24263};
24264
24265classname.extend = function (obj1, obj2) {
24266 var result = {},
24267 objs = [obj1, obj2];
24268
24269 classname.each(objs, function (obj) {
24270 classname.each(obj, function (val, key) {
24271 if (obj.hasOwnProperty(key)) {
24272 result[key] = val;
24273 }
24274 });
24275 });
24276
24277 return result;
24278};
24279
24280if (typeof module !== "undefined" && module.exports) {
24281 module.exports = classname;
24282}
24283
24284
24285/***/ }),
24286/* 56 */
24287/***/ (function(module, exports, __webpack_require__) {
24288
24289"use strict";
24290
24291
24292Object.defineProperty(exports, "__esModule", {
24293 value: true
24294});
24295
24296var _lodash = __webpack_require__(54);
24297
24298var _lodash2 = _interopRequireDefault(_lodash);
24299
24300function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
24301
24302function position(elem) {
24303 if (!elem) {
24304 return;
24305 }
24306
24307 return {
24308 left: elem.offsetLeft,
24309 top: elem.offsetTop
24310 };
24311}
24312
24313function offset(elem) {
24314 var docElem = void 0,
24315 rect = void 0;
24316
24317 if (!elem) {
24318 return {};
24319 }
24320
24321 rect = elem.getBoundingClientRect();
24322
24323 // Make sure element is not hidden (display: none) or disconnected
24324 if (rect.width || rect.height || elem.getClientRects().length) {
24325 docElem = elem.ownerDocument.documentElement;
24326
24327 return {
24328 top: rect.top + window.pageYOffset - docElem.clientTop,
24329 left: rect.left + window.pageXOffset - docElem.clientLeft
24330 };
24331 }
24332
24333 return {};
24334}
24335
24336/**
24337 * Check if ChildNode is a child of the parentNode
24338 * @param DOMNode child
24339 * @param DOMNode parent
24340 * @param boolean checkEqual if true it will compare if the child is the same as the parent
24341 * @return boolean
24342 */
24343function isChildOf(child, parent) {
24344 var checkEqual = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
24345
24346 var found = false;
24347
24348 if (!(parent instanceof NodeList)) {
24349 parent = [parent];
24350 }
24351
24352 _lodash2.default.each(parent, function (_parent) {
24353 var _child = child;
24354
24355 if (found) return false;
24356 if (checkEqual && _child === _parent) return true;
24357
24358 while ((_child = _child.parentNode) && _child !== _parent) {}
24359 found = !!_child;
24360 });
24361
24362 return found;
24363}
24364
24365function ignoreSelection() {
24366 if (document.selection) {
24367 document.selection.empty();
24368 return;
24369 }
24370
24371 if (window.getSelection) {
24372 window.getSelection().removeAllRanges();
24373 }
24374}
24375
24376function getHeight(elem) {
24377 var defaultValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
24378
24379 return elem && elem.offsetHeight || defaultValue;
24380}
24381
24382function getWidth(elem) {
24383 var defaultValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
24384
24385 return elem && elem.offsetHeight || defaultValue;
24386}
24387
24388function scrollTo(element, to, duration) {
24389 if (duration <= 0) return;
24390 var difference = to - element.scrollTop;
24391 var perTick = difference / duration * 10;
24392
24393 setTimeout(function () {
24394 element.scrollTop = element.scrollTop + perTick;
24395 if (element.scrollTop === to) return;
24396 scrollTo(element, to, duration - 10);
24397 }, 10);
24398}
24399
24400exports.default = { offset: offset, position: position, isChildOf: isChildOf, ignoreSelection: ignoreSelection, getHeight: getHeight, getWidth: getWidth, scrollTo: scrollTo };
24401
24402/***/ }),
24403/* 57 */
24404/***/ (function(module, exports, __webpack_require__) {
24405
24406"use strict";
24407/* WEBPACK VAR INJECTION */(function(process) {/**
24408 * Copyright 2013-present, Facebook, Inc.
24409 * All rights reserved.
24410 *
24411 * This source code is licensed under the BSD-style license found in the
24412 * LICENSE file in the root directory of this source tree. An additional grant
24413 * of patent rights can be found in the PATENTS file in the same directory.
24414 *
24415 */
24416
24417
24418
24419var _prodInvariant = __webpack_require__(18),
24420 _assign = __webpack_require__(4);
24421
24422var ReactNoopUpdateQueue = __webpack_require__(58);
24423
24424var canDefineProperty = __webpack_require__(26);
24425var emptyObject = __webpack_require__(27);
24426var invariant = __webpack_require__(1);
24427var lowPriorityWarning = __webpack_require__(36);
24428
24429/**
24430 * Base class helpers for the updating state of a component.
24431 */
24432function ReactComponent(props, context, updater) {
24433 this.props = props;
24434 this.context = context;
24435 this.refs = emptyObject;
24436 // We initialize the default updater but the real one gets injected by the
24437 // renderer.
24438 this.updater = updater || ReactNoopUpdateQueue;
24439}
24440
24441ReactComponent.prototype.isReactComponent = {};
24442
24443/**
24444 * Sets a subset of the state. Always use this to mutate
24445 * state. You should treat `this.state` as immutable.
24446 *
24447 * There is no guarantee that `this.state` will be immediately updated, so
24448 * accessing `this.state` after calling this method may return the old value.
24449 *
24450 * There is no guarantee that calls to `setState` will run synchronously,
24451 * as they may eventually be batched together. You can provide an optional
24452 * callback that will be executed when the call to setState is actually
24453 * completed.
24454 *
24455 * When a function is provided to setState, it will be called at some point in
24456 * the future (not synchronously). It will be called with the up to date
24457 * component arguments (state, props, context). These values can be different
24458 * from this.* because your function may be called after receiveProps but before
24459 * shouldComponentUpdate, and this new state, props, and context will not yet be
24460 * assigned to this.
24461 *
24462 * @param {object|function} partialState Next partial state or function to
24463 * produce next partial state to be merged with current state.
24464 * @param {?function} callback Called after state is updated.
24465 * @final
24466 * @protected
24467 */
24468ReactComponent.prototype.setState = function (partialState, callback) {
24469 !(typeof partialState === 'object' || typeof partialState === 'function' || partialState == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'setState(...): takes an object of state variables to update or a function which returns an object of state variables.') : _prodInvariant('85') : void 0;
24470 this.updater.enqueueSetState(this, partialState);
24471 if (callback) {
24472 this.updater.enqueueCallback(this, callback, 'setState');
24473 }
24474};
24475
24476/**
24477 * Forces an update. This should only be invoked when it is known with
24478 * certainty that we are **not** in a DOM transaction.
24479 *
24480 * You may want to call this when you know that some deeper aspect of the
24481 * component's state has changed but `setState` was not called.
24482 *
24483 * This will not invoke `shouldComponentUpdate`, but it will invoke
24484 * `componentWillUpdate` and `componentDidUpdate`.
24485 *
24486 * @param {?function} callback Called after update is complete.
24487 * @final
24488 * @protected
24489 */
24490ReactComponent.prototype.forceUpdate = function (callback) {
24491 this.updater.enqueueForceUpdate(this);
24492 if (callback) {
24493 this.updater.enqueueCallback(this, callback, 'forceUpdate');
24494 }
24495};
24496
24497/**
24498 * Deprecated APIs. These APIs used to exist on classic React classes but since
24499 * we would like to deprecate them, we're not going to move them over to this
24500 * modern base class. Instead, we define a getter that warns if it's accessed.
24501 */
24502if (process.env.NODE_ENV !== 'production') {
24503 var deprecatedAPIs = {
24504 isMounted: ['isMounted', 'Instead, make sure to clean up subscriptions and pending requests in ' + 'componentWillUnmount to prevent memory leaks.'],
24505 replaceState: ['replaceState', 'Refactor your code to use setState instead (see ' + 'https://github.com/facebook/react/issues/3236).']
24506 };
24507 var defineDeprecationWarning = function (methodName, info) {
24508 if (canDefineProperty) {
24509 Object.defineProperty(ReactComponent.prototype, methodName, {
24510 get: function () {
24511 lowPriorityWarning(false, '%s(...) is deprecated in plain JavaScript React classes. %s', info[0], info[1]);
24512 return undefined;
24513 }
24514 });
24515 }
24516 };
24517 for (var fnName in deprecatedAPIs) {
24518 if (deprecatedAPIs.hasOwnProperty(fnName)) {
24519 defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);
24520 }
24521 }
24522}
24523
24524/**
24525 * Base class helpers for the updating state of a component.
24526 */
24527function ReactPureComponent(props, context, updater) {
24528 // Duplicated from ReactComponent.
24529 this.props = props;
24530 this.context = context;
24531 this.refs = emptyObject;
24532 // We initialize the default updater but the real one gets injected by the
24533 // renderer.
24534 this.updater = updater || ReactNoopUpdateQueue;
24535}
24536
24537function ComponentDummy() {}
24538ComponentDummy.prototype = ReactComponent.prototype;
24539ReactPureComponent.prototype = new ComponentDummy();
24540ReactPureComponent.prototype.constructor = ReactPureComponent;
24541// Avoid an extra prototype jump for these methods.
24542_assign(ReactPureComponent.prototype, ReactComponent.prototype);
24543ReactPureComponent.prototype.isPureReactComponent = true;
24544
24545module.exports = {
24546 Component: ReactComponent,
24547 PureComponent: ReactPureComponent
24548};
24549/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
24550
24551/***/ }),
24552/* 58 */
24553/***/ (function(module, exports, __webpack_require__) {
24554
24555"use strict";
24556/* WEBPACK VAR INJECTION */(function(process) {/**
24557 * Copyright 2015-present, Facebook, Inc.
24558 * All rights reserved.
24559 *
24560 * This source code is licensed under the BSD-style license found in the
24561 * LICENSE file in the root directory of this source tree. An additional grant
24562 * of patent rights can be found in the PATENTS file in the same directory.
24563 *
24564 */
24565
24566
24567
24568var warning = __webpack_require__(2);
24569
24570function warnNoop(publicInstance, callerName) {
24571 if (process.env.NODE_ENV !== 'production') {
24572 var constructor = publicInstance.constructor;
24573 process.env.NODE_ENV !== 'production' ? warning(false, '%s(...): Can only update a mounted or mounting component. ' + 'This usually means you called %s() on an unmounted component. ' + 'This is a no-op. Please check the code for the %s component.', callerName, callerName, constructor && (constructor.displayName || constructor.name) || 'ReactClass') : void 0;
24574 }
24575}
24576
24577/**
24578 * This is the abstract API for an update queue.
24579 */
24580var ReactNoopUpdateQueue = {
24581 /**
24582 * Checks whether or not this composite component is mounted.
24583 * @param {ReactClass} publicInstance The instance we want to test.
24584 * @return {boolean} True if mounted, false otherwise.
24585 * @protected
24586 * @final
24587 */
24588 isMounted: function (publicInstance) {
24589 return false;
24590 },
24591
24592 /**
24593 * Enqueue a callback that will be executed after all the pending updates
24594 * have processed.
24595 *
24596 * @param {ReactClass} publicInstance The instance to use as `this` context.
24597 * @param {?function} callback Called after state is updated.
24598 * @internal
24599 */
24600 enqueueCallback: function (publicInstance, callback) {},
24601
24602 /**
24603 * Forces an update. This should only be invoked when it is known with
24604 * certainty that we are **not** in a DOM transaction.
24605 *
24606 * You may want to call this when you know that some deeper aspect of the
24607 * component's state has changed but `setState` was not called.
24608 *
24609 * This will not invoke `shouldComponentUpdate`, but it will invoke
24610 * `componentWillUpdate` and `componentDidUpdate`.
24611 *
24612 * @param {ReactClass} publicInstance The instance that should rerender.
24613 * @internal
24614 */
24615 enqueueForceUpdate: function (publicInstance) {
24616 warnNoop(publicInstance, 'forceUpdate');
24617 },
24618
24619 /**
24620 * Replaces all of the state. Always use this or `setState` to mutate state.
24621 * You should treat `this.state` as immutable.
24622 *
24623 * There is no guarantee that `this.state` will be immediately updated, so
24624 * accessing `this.state` after calling this method may return the old value.
24625 *
24626 * @param {ReactClass} publicInstance The instance that should rerender.
24627 * @param {object} completeState Next state.
24628 * @internal
24629 */
24630 enqueueReplaceState: function (publicInstance, completeState) {
24631 warnNoop(publicInstance, 'replaceState');
24632 },
24633
24634 /**
24635 * Sets a subset of the state. This only exists because _pendingState is
24636 * internal. This provides a merging strategy that is not available to deep
24637 * properties which is confusing. TODO: Expose pendingState or don't use it
24638 * during the merge.
24639 *
24640 * @param {ReactClass} publicInstance The instance that should rerender.
24641 * @param {object} partialState Next partial state to be merged with state.
24642 * @internal
24643 */
24644 enqueueSetState: function (publicInstance, partialState) {
24645 warnNoop(publicInstance, 'setState');
24646 }
24647};
24648
24649module.exports = ReactNoopUpdateQueue;
24650/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
24651
24652/***/ }),
24653/* 59 */
24654/***/ (function(module, exports, __webpack_require__) {
24655
24656"use strict";
24657/**
24658 * Copyright 2014-present, Facebook, Inc.
24659 * All rights reserved.
24660 *
24661 * This source code is licensed under the BSD-style license found in the
24662 * LICENSE file in the root directory of this source tree. An additional grant
24663 * of patent rights can be found in the PATENTS file in the same directory.
24664 *
24665 *
24666 */
24667
24668
24669
24670// The Symbol used to tag the ReactElement type. If there is no native Symbol
24671// nor polyfill, then a plain number is used for performance.
24672
24673var REACT_ELEMENT_TYPE = typeof Symbol === 'function' && Symbol['for'] && Symbol['for']('react.element') || 0xeac7;
24674
24675module.exports = REACT_ELEMENT_TYPE;
24676
24677/***/ }),
24678/* 60 */
24679/***/ (function(module, exports, __webpack_require__) {
24680
24681"use strict";
24682/**
24683 * Copyright 2013-present, Facebook, Inc.
24684 * All rights reserved.
24685 *
24686 * This source code is licensed under the BSD-style license found in the
24687 * LICENSE file in the root directory of this source tree. An additional grant
24688 * of patent rights can be found in the PATENTS file in the same directory.
24689 *
24690 *
24691 */
24692
24693
24694
24695/* global Symbol */
24696
24697var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
24698var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
24699
24700/**
24701 * Returns the iterator method function contained on the iterable object.
24702 *
24703 * Be sure to invoke the function with the iterable as context:
24704 *
24705 * var iteratorFn = getIteratorFn(myIterable);
24706 * if (iteratorFn) {
24707 * var iterator = iteratorFn.call(myIterable);
24708 * ...
24709 * }
24710 *
24711 * @param {?object} maybeIterable
24712 * @return {?function}
24713 */
24714function getIteratorFn(maybeIterable) {
24715 var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
24716 if (typeof iteratorFn === 'function') {
24717 return iteratorFn;
24718 }
24719}
24720
24721module.exports = getIteratorFn;
24722
24723/***/ }),
24724/* 61 */
24725/***/ (function(module, exports, __webpack_require__) {
24726
24727"use strict";
24728/* WEBPACK VAR INJECTION */(function(process) {/**
24729 * Copyright 2014-present, Facebook, Inc.
24730 * All rights reserved.
24731 *
24732 * This source code is licensed under the BSD-style license found in the
24733 * LICENSE file in the root directory of this source tree. An additional grant
24734 * of patent rights can be found in the PATENTS file in the same directory.
24735 *
24736 */
24737
24738/**
24739 * ReactElementValidator provides a wrapper around a element factory
24740 * which validates the props passed to the element. This is intended to be
24741 * used only in DEV and could be replaced by a static type checker for languages
24742 * that support it.
24743 */
24744
24745
24746
24747var ReactCurrentOwner = __webpack_require__(10);
24748var ReactComponentTreeHook = __webpack_require__(7);
24749var ReactElement = __webpack_require__(15);
24750
24751var checkReactTypeSpec = __webpack_require__(96);
24752
24753var canDefineProperty = __webpack_require__(26);
24754var getIteratorFn = __webpack_require__(60);
24755var warning = __webpack_require__(2);
24756var lowPriorityWarning = __webpack_require__(36);
24757
24758function getDeclarationErrorAddendum() {
24759 if (ReactCurrentOwner.current) {
24760 var name = ReactCurrentOwner.current.getName();
24761 if (name) {
24762 return ' Check the render method of `' + name + '`.';
24763 }
24764 }
24765 return '';
24766}
24767
24768function getSourceInfoErrorAddendum(elementProps) {
24769 if (elementProps !== null && elementProps !== undefined && elementProps.__source !== undefined) {
24770 var source = elementProps.__source;
24771 var fileName = source.fileName.replace(/^.*[\\\/]/, '');
24772 var lineNumber = source.lineNumber;
24773 return ' Check your code at ' + fileName + ':' + lineNumber + '.';
24774 }
24775 return '';
24776}
24777
24778/**
24779 * Warn if there's no key explicitly set on dynamic arrays of children or
24780 * object keys are not valid. This allows us to keep track of children between
24781 * updates.
24782 */
24783var ownerHasKeyUseWarning = {};
24784
24785function getCurrentComponentErrorInfo(parentType) {
24786 var info = getDeclarationErrorAddendum();
24787
24788 if (!info) {
24789 var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;
24790 if (parentName) {
24791 info = ' Check the top-level render call using <' + parentName + '>.';
24792 }
24793 }
24794 return info;
24795}
24796
24797/**
24798 * Warn if the element doesn't have an explicit key assigned to it.
24799 * This element is in an array. The array could grow and shrink or be
24800 * reordered. All children that haven't already been validated are required to
24801 * have a "key" property assigned to it. Error statuses are cached so a warning
24802 * will only be shown once.
24803 *
24804 * @internal
24805 * @param {ReactElement} element Element that requires a key.
24806 * @param {*} parentType element's parent's type.
24807 */
24808function validateExplicitKey(element, parentType) {
24809 if (!element._store || element._store.validated || element.key != null) {
24810 return;
24811 }
24812 element._store.validated = true;
24813
24814 var memoizer = ownerHasKeyUseWarning.uniqueKey || (ownerHasKeyUseWarning.uniqueKey = {});
24815
24816 var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);
24817 if (memoizer[currentComponentErrorInfo]) {
24818 return;
24819 }
24820 memoizer[currentComponentErrorInfo] = true;
24821
24822 // Usually the current owner is the offender, but if it accepts children as a
24823 // property, it may be the creator of the child that's responsible for
24824 // assigning it a key.
24825 var childOwner = '';
24826 if (element && element._owner && element._owner !== ReactCurrentOwner.current) {
24827 // Give the component that originally created this child.
24828 childOwner = ' It was passed a child from ' + element._owner.getName() + '.';
24829 }
24830
24831 process.env.NODE_ENV !== 'production' ? warning(false, 'Each child in an array or iterator should have a unique "key" prop.' + '%s%s See https://fb.me/react-warning-keys for more information.%s', currentComponentErrorInfo, childOwner, ReactComponentTreeHook.getCurrentStackAddendum(element)) : void 0;
24832}
24833
24834/**
24835 * Ensure that every element either is passed in a static location, in an
24836 * array with an explicit keys property defined, or in an object literal
24837 * with valid key property.
24838 *
24839 * @internal
24840 * @param {ReactNode} node Statically passed child of any type.
24841 * @param {*} parentType node's parent's type.
24842 */
24843function validateChildKeys(node, parentType) {
24844 if (typeof node !== 'object') {
24845 return;
24846 }
24847 if (Array.isArray(node)) {
24848 for (var i = 0; i < node.length; i++) {
24849 var child = node[i];
24850 if (ReactElement.isValidElement(child)) {
24851 validateExplicitKey(child, parentType);
24852 }
24853 }
24854 } else if (ReactElement.isValidElement(node)) {
24855 // This element was passed in a valid location.
24856 if (node._store) {
24857 node._store.validated = true;
24858 }
24859 } else if (node) {
24860 var iteratorFn = getIteratorFn(node);
24861 // Entry iterators provide implicit keys.
24862 if (iteratorFn) {
24863 if (iteratorFn !== node.entries) {
24864 var iterator = iteratorFn.call(node);
24865 var step;
24866 while (!(step = iterator.next()).done) {
24867 if (ReactElement.isValidElement(step.value)) {
24868 validateExplicitKey(step.value, parentType);
24869 }
24870 }
24871 }
24872 }
24873 }
24874}
24875
24876/**
24877 * Given an element, validate that its props follow the propTypes definition,
24878 * provided by the type.
24879 *
24880 * @param {ReactElement} element
24881 */
24882function validatePropTypes(element) {
24883 var componentClass = element.type;
24884 if (typeof componentClass !== 'function') {
24885 return;
24886 }
24887 var name = componentClass.displayName || componentClass.name;
24888 if (componentClass.propTypes) {
24889 checkReactTypeSpec(componentClass.propTypes, element.props, 'prop', name, element, null);
24890 }
24891 if (typeof componentClass.getDefaultProps === 'function') {
24892 process.env.NODE_ENV !== 'production' ? warning(componentClass.getDefaultProps.isReactClassApproved, 'getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.') : void 0;
24893 }
24894}
24895
24896var ReactElementValidator = {
24897 createElement: function (type, props, children) {
24898 var validType = typeof type === 'string' || typeof type === 'function';
24899 // We warn in this case but don't throw. We expect the element creation to
24900 // succeed and there will likely be errors in render.
24901 if (!validType) {
24902 if (typeof type !== 'function' && typeof type !== 'string') {
24903 var info = '';
24904 if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
24905 info += ' You likely forgot to export your component from the file ' + "it's defined in.";
24906 }
24907
24908 var sourceInfo = getSourceInfoErrorAddendum(props);
24909 if (sourceInfo) {
24910 info += sourceInfo;
24911 } else {
24912 info += getDeclarationErrorAddendum();
24913 }
24914
24915 info += ReactComponentTreeHook.getCurrentStackAddendum();
24916
24917 var currentSource = props !== null && props !== undefined && props.__source !== undefined ? props.__source : null;
24918 ReactComponentTreeHook.pushNonStandardWarningStack(true, currentSource);
24919 process.env.NODE_ENV !== 'production' ? warning(false, 'React.createElement: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', type == null ? type : typeof type, info) : void 0;
24920 ReactComponentTreeHook.popNonStandardWarningStack();
24921 }
24922 }
24923
24924 var element = ReactElement.createElement.apply(this, arguments);
24925
24926 // The result can be nullish if a mock or a custom function is used.
24927 // TODO: Drop this when these are no longer allowed as the type argument.
24928 if (element == null) {
24929 return element;
24930 }
24931
24932 // Skip key warning if the type isn't valid since our key validation logic
24933 // doesn't expect a non-string/function type and can throw confusing errors.
24934 // We don't want exception behavior to differ between dev and prod.
24935 // (Rendering will throw with a helpful message and as soon as the type is
24936 // fixed, the key warnings will appear.)
24937 if (validType) {
24938 for (var i = 2; i < arguments.length; i++) {
24939 validateChildKeys(arguments[i], type);
24940 }
24941 }
24942
24943 validatePropTypes(element);
24944
24945 return element;
24946 },
24947
24948 createFactory: function (type) {
24949 var validatedFactory = ReactElementValidator.createElement.bind(null, type);
24950 // Legacy hook TODO: Warn if this is accessed
24951 validatedFactory.type = type;
24952
24953 if (process.env.NODE_ENV !== 'production') {
24954 if (canDefineProperty) {
24955 Object.defineProperty(validatedFactory, 'type', {
24956 enumerable: false,
24957 get: function () {
24958 lowPriorityWarning(false, 'Factory.type is deprecated. Access the class directly ' + 'before passing it to createFactory.');
24959 Object.defineProperty(this, 'type', {
24960 value: type
24961 });
24962 return type;
24963 }
24964 });
24965 }
24966 }
24967
24968 return validatedFactory;
24969 },
24970
24971 cloneElement: function (element, props, children) {
24972 var newElement = ReactElement.cloneElement.apply(this, arguments);
24973 for (var i = 2; i < arguments.length; i++) {
24974 validateChildKeys(arguments[i], newElement.type);
24975 }
24976 validatePropTypes(newElement);
24977 return newElement;
24978 }
24979};
24980
24981module.exports = ReactElementValidator;
24982/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
24983
24984/***/ }),
24985/* 62 */
24986/***/ (function(module, exports, __webpack_require__) {
24987
24988"use strict";
24989/**
24990 * Copyright 2013-present, Facebook, Inc.
24991 * All rights reserved.
24992 *
24993 * This source code is licensed under the BSD-style license found in the
24994 * LICENSE file in the root directory of this source tree. An additional grant
24995 * of patent rights can be found in the PATENTS file in the same directory.
24996 */
24997
24998
24999
25000// React 15.5 references this module, and assumes PropTypes are still callable in production.
25001// Therefore we re-export development-only version with all the PropTypes checks here.
25002// However if one is migrating to the `prop-types` npm library, they will go through the
25003// `index.js` entry point, and it will branch depending on the environment.
25004var factory = __webpack_require__(63);
25005module.exports = function(isValidElement) {
25006 // It is still allowed in 15.5.
25007 var throwOnDirectAccess = false;
25008 return factory(isValidElement, throwOnDirectAccess);
25009};
25010
25011
25012/***/ }),
25013/* 63 */
25014/***/ (function(module, exports, __webpack_require__) {
25015
25016"use strict";
25017/* WEBPACK VAR INJECTION */(function(process) {/**
25018 * Copyright 2013-present, Facebook, Inc.
25019 * All rights reserved.
25020 *
25021 * This source code is licensed under the BSD-style license found in the
25022 * LICENSE file in the root directory of this source tree. An additional grant
25023 * of patent rights can be found in the PATENTS file in the same directory.
25024 */
25025
25026
25027
25028var emptyFunction = __webpack_require__(8);
25029var invariant = __webpack_require__(1);
25030var warning = __webpack_require__(2);
25031
25032var ReactPropTypesSecret = __webpack_require__(37);
25033var checkPropTypes = __webpack_require__(100);
25034
25035module.exports = function(isValidElement, throwOnDirectAccess) {
25036 /* global Symbol */
25037 var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
25038 var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
25039
25040 /**
25041 * Returns the iterator method function contained on the iterable object.
25042 *
25043 * Be sure to invoke the function with the iterable as context:
25044 *
25045 * var iteratorFn = getIteratorFn(myIterable);
25046 * if (iteratorFn) {
25047 * var iterator = iteratorFn.call(myIterable);
25048 * ...
25049 * }
25050 *
25051 * @param {?object} maybeIterable
25052 * @return {?function}
25053 */
25054 function getIteratorFn(maybeIterable) {
25055 var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
25056 if (typeof iteratorFn === 'function') {
25057 return iteratorFn;
25058 }
25059 }
25060
25061 /**
25062 * Collection of methods that allow declaration and validation of props that are
25063 * supplied to React components. Example usage:
25064 *
25065 * var Props = require('ReactPropTypes');
25066 * var MyArticle = React.createClass({
25067 * propTypes: {
25068 * // An optional string prop named "description".
25069 * description: Props.string,
25070 *
25071 * // A required enum prop named "category".
25072 * category: Props.oneOf(['News','Photos']).isRequired,
25073 *
25074 * // A prop named "dialog" that requires an instance of Dialog.
25075 * dialog: Props.instanceOf(Dialog).isRequired
25076 * },
25077 * render: function() { ... }
25078 * });
25079 *
25080 * A more formal specification of how these methods are used:
25081 *
25082 * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)
25083 * decl := ReactPropTypes.{type}(.isRequired)?
25084 *
25085 * Each and every declaration produces a function with the same signature. This
25086 * allows the creation of custom validation functions. For example:
25087 *
25088 * var MyLink = React.createClass({
25089 * propTypes: {
25090 * // An optional string or URI prop named "href".
25091 * href: function(props, propName, componentName) {
25092 * var propValue = props[propName];
25093 * if (propValue != null && typeof propValue !== 'string' &&
25094 * !(propValue instanceof URI)) {
25095 * return new Error(
25096 * 'Expected a string or an URI for ' + propName + ' in ' +
25097 * componentName
25098 * );
25099 * }
25100 * }
25101 * },
25102 * render: function() {...}
25103 * });
25104 *
25105 * @internal
25106 */
25107
25108 var ANONYMOUS = '<<anonymous>>';
25109
25110 // Important!
25111 // Keep this list in sync with production version in `./factoryWithThrowingShims.js`.
25112 var ReactPropTypes = {
25113 array: createPrimitiveTypeChecker('array'),
25114 bool: createPrimitiveTypeChecker('boolean'),
25115 func: createPrimitiveTypeChecker('function'),
25116 number: createPrimitiveTypeChecker('number'),
25117 object: createPrimitiveTypeChecker('object'),
25118 string: createPrimitiveTypeChecker('string'),
25119 symbol: createPrimitiveTypeChecker('symbol'),
25120
25121 any: createAnyTypeChecker(),
25122 arrayOf: createArrayOfTypeChecker,
25123 element: createElementTypeChecker(),
25124 instanceOf: createInstanceTypeChecker,
25125 node: createNodeChecker(),
25126 objectOf: createObjectOfTypeChecker,
25127 oneOf: createEnumTypeChecker,
25128 oneOfType: createUnionTypeChecker,
25129 shape: createShapeTypeChecker
25130 };
25131
25132 /**
25133 * inlined Object.is polyfill to avoid requiring consumers ship their own
25134 * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
25135 */
25136 /*eslint-disable no-self-compare*/
25137 function is(x, y) {
25138 // SameValue algorithm
25139 if (x === y) {
25140 // Steps 1-5, 7-10
25141 // Steps 6.b-6.e: +0 != -0
25142 return x !== 0 || 1 / x === 1 / y;
25143 } else {
25144 // Step 6.a: NaN == NaN
25145 return x !== x && y !== y;
25146 }
25147 }
25148 /*eslint-enable no-self-compare*/
25149
25150 /**
25151 * We use an Error-like object for backward compatibility as people may call
25152 * PropTypes directly and inspect their output. However, we don't use real
25153 * Errors anymore. We don't inspect their stack anyway, and creating them
25154 * is prohibitively expensive if they are created too often, such as what
25155 * happens in oneOfType() for any type before the one that matched.
25156 */
25157 function PropTypeError(message) {
25158 this.message = message;
25159 this.stack = '';
25160 }
25161 // Make `instanceof Error` still work for returned errors.
25162 PropTypeError.prototype = Error.prototype;
25163
25164 function createChainableTypeChecker(validate) {
25165 if (process.env.NODE_ENV !== 'production') {
25166 var manualPropTypeCallCache = {};
25167 var manualPropTypeWarningCount = 0;
25168 }
25169 function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
25170 componentName = componentName || ANONYMOUS;
25171 propFullName = propFullName || propName;
25172
25173 if (secret !== ReactPropTypesSecret) {
25174 if (throwOnDirectAccess) {
25175 // New behavior only for users of `prop-types` package
25176 invariant(
25177 false,
25178 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
25179 'Use `PropTypes.checkPropTypes()` to call them. ' +
25180 'Read more at http://fb.me/use-check-prop-types'
25181 );
25182 } else if (process.env.NODE_ENV !== 'production' && typeof console !== 'undefined') {
25183 // Old behavior for people using React.PropTypes
25184 var cacheKey = componentName + ':' + propName;
25185 if (
25186 !manualPropTypeCallCache[cacheKey] &&
25187 // Avoid spamming the console because they are often not actionable except for lib authors
25188 manualPropTypeWarningCount < 3
25189 ) {
25190 warning(
25191 false,
25192 'You are manually calling a React.PropTypes validation ' +
25193 'function for the `%s` prop on `%s`. This is deprecated ' +
25194 'and will throw in the standalone `prop-types` package. ' +
25195 'You may be seeing this warning due to a third-party PropTypes ' +
25196 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.',
25197 propFullName,
25198 componentName
25199 );
25200 manualPropTypeCallCache[cacheKey] = true;
25201 manualPropTypeWarningCount++;
25202 }
25203 }
25204 }
25205 if (props[propName] == null) {
25206 if (isRequired) {
25207 if (props[propName] === null) {
25208 return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));
25209 }
25210 return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));
25211 }
25212 return null;
25213 } else {
25214 return validate(props, propName, componentName, location, propFullName);
25215 }
25216 }
25217
25218 var chainedCheckType = checkType.bind(null, false);
25219 chainedCheckType.isRequired = checkType.bind(null, true);
25220
25221 return chainedCheckType;
25222 }
25223
25224 function createPrimitiveTypeChecker(expectedType) {
25225 function validate(props, propName, componentName, location, propFullName, secret) {
25226 var propValue = props[propName];
25227 var propType = getPropType(propValue);
25228 if (propType !== expectedType) {
25229 // `propValue` being instance of, say, date/regexp, pass the 'object'
25230 // check, but we can offer a more precise error message here rather than
25231 // 'of type `object`'.
25232 var preciseType = getPreciseType(propValue);
25233
25234 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'));
25235 }
25236 return null;
25237 }
25238 return createChainableTypeChecker(validate);
25239 }
25240
25241 function createAnyTypeChecker() {
25242 return createChainableTypeChecker(emptyFunction.thatReturnsNull);
25243 }
25244
25245 function createArrayOfTypeChecker(typeChecker) {
25246 function validate(props, propName, componentName, location, propFullName) {
25247 if (typeof typeChecker !== 'function') {
25248 return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');
25249 }
25250 var propValue = props[propName];
25251 if (!Array.isArray(propValue)) {
25252 var propType = getPropType(propValue);
25253 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));
25254 }
25255 for (var i = 0; i < propValue.length; i++) {
25256 var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret);
25257 if (error instanceof Error) {
25258 return error;
25259 }
25260 }
25261 return null;
25262 }
25263 return createChainableTypeChecker(validate);
25264 }
25265
25266 function createElementTypeChecker() {
25267 function validate(props, propName, componentName, location, propFullName) {
25268 var propValue = props[propName];
25269 if (!isValidElement(propValue)) {
25270 var propType = getPropType(propValue);
25271 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));
25272 }
25273 return null;
25274 }
25275 return createChainableTypeChecker(validate);
25276 }
25277
25278 function createInstanceTypeChecker(expectedClass) {
25279 function validate(props, propName, componentName, location, propFullName) {
25280 if (!(props[propName] instanceof expectedClass)) {
25281 var expectedClassName = expectedClass.name || ANONYMOUS;
25282 var actualClassName = getClassName(props[propName]);
25283 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));
25284 }
25285 return null;
25286 }
25287 return createChainableTypeChecker(validate);
25288 }
25289
25290 function createEnumTypeChecker(expectedValues) {
25291 if (!Array.isArray(expectedValues)) {
25292 process.env.NODE_ENV !== 'production' ? warning(false, 'Invalid argument supplied to oneOf, expected an instance of array.') : void 0;
25293 return emptyFunction.thatReturnsNull;
25294 }
25295
25296 function validate(props, propName, componentName, location, propFullName) {
25297 var propValue = props[propName];
25298 for (var i = 0; i < expectedValues.length; i++) {
25299 if (is(propValue, expectedValues[i])) {
25300 return null;
25301 }
25302 }
25303
25304 var valuesString = JSON.stringify(expectedValues);
25305 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + propValue + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));
25306 }
25307 return createChainableTypeChecker(validate);
25308 }
25309
25310 function createObjectOfTypeChecker(typeChecker) {
25311 function validate(props, propName, componentName, location, propFullName) {
25312 if (typeof typeChecker !== 'function') {
25313 return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');
25314 }
25315 var propValue = props[propName];
25316 var propType = getPropType(propValue);
25317 if (propType !== 'object') {
25318 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
25319 }
25320 for (var key in propValue) {
25321 if (propValue.hasOwnProperty(key)) {
25322 var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
25323 if (error instanceof Error) {
25324 return error;
25325 }
25326 }
25327 }
25328 return null;
25329 }
25330 return createChainableTypeChecker(validate);
25331 }
25332
25333 function createUnionTypeChecker(arrayOfTypeCheckers) {
25334 if (!Array.isArray(arrayOfTypeCheckers)) {
25335 process.env.NODE_ENV !== 'production' ? warning(false, 'Invalid argument supplied to oneOfType, expected an instance of array.') : void 0;
25336 return emptyFunction.thatReturnsNull;
25337 }
25338
25339 for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
25340 var checker = arrayOfTypeCheckers[i];
25341 if (typeof checker !== 'function') {
25342 warning(
25343 false,
25344 'Invalid argument supplid to oneOfType. Expected an array of check functions, but ' +
25345 'received %s at index %s.',
25346 getPostfixForTypeWarning(checker),
25347 i
25348 );
25349 return emptyFunction.thatReturnsNull;
25350 }
25351 }
25352
25353 function validate(props, propName, componentName, location, propFullName) {
25354 for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
25355 var checker = arrayOfTypeCheckers[i];
25356 if (checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret) == null) {
25357 return null;
25358 }
25359 }
25360
25361 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.'));
25362 }
25363 return createChainableTypeChecker(validate);
25364 }
25365
25366 function createNodeChecker() {
25367 function validate(props, propName, componentName, location, propFullName) {
25368 if (!isNode(props[propName])) {
25369 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));
25370 }
25371 return null;
25372 }
25373 return createChainableTypeChecker(validate);
25374 }
25375
25376 function createShapeTypeChecker(shapeTypes) {
25377 function validate(props, propName, componentName, location, propFullName) {
25378 var propValue = props[propName];
25379 var propType = getPropType(propValue);
25380 if (propType !== 'object') {
25381 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
25382 }
25383 for (var key in shapeTypes) {
25384 var checker = shapeTypes[key];
25385 if (!checker) {
25386 continue;
25387 }
25388 var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
25389 if (error) {
25390 return error;
25391 }
25392 }
25393 return null;
25394 }
25395 return createChainableTypeChecker(validate);
25396 }
25397
25398 function isNode(propValue) {
25399 switch (typeof propValue) {
25400 case 'number':
25401 case 'string':
25402 case 'undefined':
25403 return true;
25404 case 'boolean':
25405 return !propValue;
25406 case 'object':
25407 if (Array.isArray(propValue)) {
25408 return propValue.every(isNode);
25409 }
25410 if (propValue === null || isValidElement(propValue)) {
25411 return true;
25412 }
25413
25414 var iteratorFn = getIteratorFn(propValue);
25415 if (iteratorFn) {
25416 var iterator = iteratorFn.call(propValue);
25417 var step;
25418 if (iteratorFn !== propValue.entries) {
25419 while (!(step = iterator.next()).done) {
25420 if (!isNode(step.value)) {
25421 return false;
25422 }
25423 }
25424 } else {
25425 // Iterator will provide entry [k,v] tuples rather than values.
25426 while (!(step = iterator.next()).done) {
25427 var entry = step.value;
25428 if (entry) {
25429 if (!isNode(entry[1])) {
25430 return false;
25431 }
25432 }
25433 }
25434 }
25435 } else {
25436 return false;
25437 }
25438
25439 return true;
25440 default:
25441 return false;
25442 }
25443 }
25444
25445 function isSymbol(propType, propValue) {
25446 // Native Symbol.
25447 if (propType === 'symbol') {
25448 return true;
25449 }
25450
25451 // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'
25452 if (propValue['@@toStringTag'] === 'Symbol') {
25453 return true;
25454 }
25455
25456 // Fallback for non-spec compliant Symbols which are polyfilled.
25457 if (typeof Symbol === 'function' && propValue instanceof Symbol) {
25458 return true;
25459 }
25460
25461 return false;
25462 }
25463
25464 // Equivalent of `typeof` but with special handling for array and regexp.
25465 function getPropType(propValue) {
25466 var propType = typeof propValue;
25467 if (Array.isArray(propValue)) {
25468 return 'array';
25469 }
25470 if (propValue instanceof RegExp) {
25471 // Old webkits (at least until Android 4.0) return 'function' rather than
25472 // 'object' for typeof a RegExp. We'll normalize this here so that /bla/
25473 // passes PropTypes.object.
25474 return 'object';
25475 }
25476 if (isSymbol(propType, propValue)) {
25477 return 'symbol';
25478 }
25479 return propType;
25480 }
25481
25482 // This handles more types than `getPropType`. Only used for error messages.
25483 // See `createPrimitiveTypeChecker`.
25484 function getPreciseType(propValue) {
25485 if (typeof propValue === 'undefined' || propValue === null) {
25486 return '' + propValue;
25487 }
25488 var propType = getPropType(propValue);
25489 if (propType === 'object') {
25490 if (propValue instanceof Date) {
25491 return 'date';
25492 } else if (propValue instanceof RegExp) {
25493 return 'regexp';
25494 }
25495 }
25496 return propType;
25497 }
25498
25499 // Returns a string that is postfixed to a warning about an invalid type.
25500 // For example, "undefined" or "of type array"
25501 function getPostfixForTypeWarning(value) {
25502 var type = getPreciseType(value);
25503 switch (type) {
25504 case 'array':
25505 case 'object':
25506 return 'an ' + type;
25507 case 'boolean':
25508 case 'date':
25509 case 'regexp':
25510 return 'a ' + type;
25511 default:
25512 return type;
25513 }
25514 }
25515
25516 // Returns class name of the object, if any.
25517 function getClassName(propValue) {
25518 if (!propValue.constructor || !propValue.constructor.name) {
25519 return ANONYMOUS;
25520 }
25521 return propValue.constructor.name;
25522 }
25523
25524 ReactPropTypes.checkPropTypes = checkPropTypes;
25525 ReactPropTypes.PropTypes = ReactPropTypes;
25526
25527 return ReactPropTypes;
25528};
25529
25530/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
25531
25532/***/ }),
25533/* 64 */
25534/***/ (function(module, exports, __webpack_require__) {
25535
25536"use strict";
25537/**
25538 * Copyright 2015-present, Facebook, Inc.
25539 * All rights reserved.
25540 *
25541 * This source code is licensed under the BSD-style license found in the
25542 * LICENSE file in the root directory of this source tree. An additional grant
25543 * of patent rights can be found in the PATENTS file in the same directory.
25544 *
25545 */
25546
25547
25548
25549var ReactDOMComponentFlags = {
25550 hasCachedChildNodes: 1 << 0
25551};
25552
25553module.exports = ReactDOMComponentFlags;
25554
25555/***/ }),
25556/* 65 */
25557/***/ (function(module, exports, __webpack_require__) {
25558
25559"use strict";
25560/* WEBPACK VAR INJECTION */(function(process) {/**
25561 * Copyright 2014-present, Facebook, Inc.
25562 * All rights reserved.
25563 *
25564 * This source code is licensed under the BSD-style license found in the
25565 * LICENSE file in the root directory of this source tree. An additional grant
25566 * of patent rights can be found in the PATENTS file in the same directory.
25567 *
25568 *
25569 */
25570
25571
25572
25573var _prodInvariant = __webpack_require__(3);
25574
25575var invariant = __webpack_require__(1);
25576
25577/**
25578 * Accumulates items that must not be null or undefined into the first one. This
25579 * is used to conserve memory by avoiding array allocations, and thus sacrifices
25580 * API cleanness. Since `current` can be null before being passed in and not
25581 * null after this function, make sure to assign it back to `current`:
25582 *
25583 * `a = accumulateInto(a, b);`
25584 *
25585 * This API should be sparingly used. Try `accumulate` for something cleaner.
25586 *
25587 * @return {*|array<*>} An accumulation of items.
25588 */
25589
25590function accumulateInto(current, next) {
25591 !(next != null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'accumulateInto(...): Accumulated items must not be null or undefined.') : _prodInvariant('30') : void 0;
25592
25593 if (current == null) {
25594 return next;
25595 }
25596
25597 // Both are not empty. Warning: Never call x.concat(y) when you are not
25598 // certain that x is an Array (x could be a string with concat method).
25599 if (Array.isArray(current)) {
25600 if (Array.isArray(next)) {
25601 current.push.apply(current, next);
25602 return current;
25603 }
25604 current.push(next);
25605 return current;
25606 }
25607
25608 if (Array.isArray(next)) {
25609 // A bit too dangerous to mutate `next`.
25610 return [current].concat(next);
25611 }
25612
25613 return [current, next];
25614}
25615
25616module.exports = accumulateInto;
25617/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
25618
25619/***/ }),
25620/* 66 */
25621/***/ (function(module, exports, __webpack_require__) {
25622
25623"use strict";
25624/**
25625 * Copyright 2013-present, Facebook, Inc.
25626 * All rights reserved.
25627 *
25628 * This source code is licensed under the BSD-style license found in the
25629 * LICENSE file in the root directory of this source tree. An additional grant
25630 * of patent rights can be found in the PATENTS file in the same directory.
25631 *
25632 *
25633 */
25634
25635
25636
25637/**
25638 * @param {array} arr an "accumulation" of items which is either an Array or
25639 * a single item. Useful when paired with the `accumulate` module. This is a
25640 * simple utility that allows us to reason about a collection of items, but
25641 * handling the case when there is exactly one item (and we do not need to
25642 * allocate an array).
25643 */
25644
25645function forEachAccumulated(arr, cb, scope) {
25646 if (Array.isArray(arr)) {
25647 arr.forEach(cb, scope);
25648 } else if (arr) {
25649 cb.call(scope, arr);
25650 }
25651}
25652
25653module.exports = forEachAccumulated;
25654
25655/***/ }),
25656/* 67 */
25657/***/ (function(module, exports, __webpack_require__) {
25658
25659"use strict";
25660/**
25661 * Copyright 2013-present, Facebook, Inc.
25662 * All rights reserved.
25663 *
25664 * This source code is licensed under the BSD-style license found in the
25665 * LICENSE file in the root directory of this source tree. An additional grant
25666 * of patent rights can be found in the PATENTS file in the same directory.
25667 *
25668 */
25669
25670
25671
25672var ExecutionEnvironment = __webpack_require__(6);
25673
25674var contentKey = null;
25675
25676/**
25677 * Gets the key used to access text content on a DOM node.
25678 *
25679 * @return {?string} Key used to access text content.
25680 * @internal
25681 */
25682function getTextContentAccessor() {
25683 if (!contentKey && ExecutionEnvironment.canUseDOM) {
25684 // Prefer textContent to innerText because many browsers support both but
25685 // SVG <text> elements don't support innerText even when <div> does.
25686 contentKey = 'textContent' in document.documentElement ? 'textContent' : 'innerText';
25687 }
25688 return contentKey;
25689}
25690
25691module.exports = getTextContentAccessor;
25692
25693/***/ }),
25694/* 68 */
25695/***/ (function(module, exports, __webpack_require__) {
25696
25697"use strict";
25698/* WEBPACK VAR INJECTION */(function(process) {/**
25699 * Copyright 2013-present, Facebook, Inc.
25700 * All rights reserved.
25701 *
25702 * This source code is licensed under the BSD-style license found in the
25703 * LICENSE file in the root directory of this source tree. An additional grant
25704 * of patent rights can be found in the PATENTS file in the same directory.
25705 *
25706 *
25707 */
25708
25709
25710
25711var _prodInvariant = __webpack_require__(3);
25712
25713function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
25714
25715var PooledClass = __webpack_require__(16);
25716
25717var invariant = __webpack_require__(1);
25718
25719/**
25720 * A specialized pseudo-event module to help keep track of components waiting to
25721 * be notified when their DOM representations are available for use.
25722 *
25723 * This implements `PooledClass`, so you should never need to instantiate this.
25724 * Instead, use `CallbackQueue.getPooled()`.
25725 *
25726 * @class ReactMountReady
25727 * @implements PooledClass
25728 * @internal
25729 */
25730
25731var CallbackQueue = function () {
25732 function CallbackQueue(arg) {
25733 _classCallCheck(this, CallbackQueue);
25734
25735 this._callbacks = null;
25736 this._contexts = null;
25737 this._arg = arg;
25738 }
25739
25740 /**
25741 * Enqueues a callback to be invoked when `notifyAll` is invoked.
25742 *
25743 * @param {function} callback Invoked when `notifyAll` is invoked.
25744 * @param {?object} context Context to call `callback` with.
25745 * @internal
25746 */
25747
25748
25749 CallbackQueue.prototype.enqueue = function enqueue(callback, context) {
25750 this._callbacks = this._callbacks || [];
25751 this._callbacks.push(callback);
25752 this._contexts = this._contexts || [];
25753 this._contexts.push(context);
25754 };
25755
25756 /**
25757 * Invokes all enqueued callbacks and clears the queue. This is invoked after
25758 * the DOM representation of a component has been created or updated.
25759 *
25760 * @internal
25761 */
25762
25763
25764 CallbackQueue.prototype.notifyAll = function notifyAll() {
25765 var callbacks = this._callbacks;
25766 var contexts = this._contexts;
25767 var arg = this._arg;
25768 if (callbacks && contexts) {
25769 !(callbacks.length === contexts.length) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Mismatched list of contexts in callback queue') : _prodInvariant('24') : void 0;
25770 this._callbacks = null;
25771 this._contexts = null;
25772 for (var i = 0; i < callbacks.length; i++) {
25773 callbacks[i].call(contexts[i], arg);
25774 }
25775 callbacks.length = 0;
25776 contexts.length = 0;
25777 }
25778 };
25779
25780 CallbackQueue.prototype.checkpoint = function checkpoint() {
25781 return this._callbacks ? this._callbacks.length : 0;
25782 };
25783
25784 CallbackQueue.prototype.rollback = function rollback(len) {
25785 if (this._callbacks && this._contexts) {
25786 this._callbacks.length = len;
25787 this._contexts.length = len;
25788 }
25789 };
25790
25791 /**
25792 * Resets the internal queue.
25793 *
25794 * @internal
25795 */
25796
25797
25798 CallbackQueue.prototype.reset = function reset() {
25799 this._callbacks = null;
25800 this._contexts = null;
25801 };
25802
25803 /**
25804 * `PooledClass` looks for this.
25805 */
25806
25807
25808 CallbackQueue.prototype.destructor = function destructor() {
25809 this.reset();
25810 };
25811
25812 return CallbackQueue;
25813}();
25814
25815module.exports = PooledClass.addPoolingTo(CallbackQueue);
25816/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
25817
25818/***/ }),
25819/* 69 */
25820/***/ (function(module, exports, __webpack_require__) {
25821
25822"use strict";
25823/**
25824 * Copyright 2013-present, Facebook, Inc.
25825 * All rights reserved.
25826 *
25827 * This source code is licensed under the BSD-style license found in the
25828 * LICENSE file in the root directory of this source tree. An additional grant
25829 * of patent rights can be found in the PATENTS file in the same directory.
25830 *
25831 *
25832 */
25833
25834
25835
25836var ReactFeatureFlags = {
25837 // When true, call console.time() before and .timeEnd() after each top-level
25838 // render (both initial renders and updates). Useful when looking at prod-mode
25839 // timeline profiles in Chrome, for example.
25840 logTopLevelRenders: false
25841};
25842
25843module.exports = ReactFeatureFlags;
25844
25845/***/ }),
25846/* 70 */
25847/***/ (function(module, exports, __webpack_require__) {
25848
25849"use strict";
25850/**
25851 * Copyright 2013-present, Facebook, Inc.
25852 * All rights reserved.
25853 *
25854 * This source code is licensed under the BSD-style license found in the
25855 * LICENSE file in the root directory of this source tree. An additional grant
25856 * of patent rights can be found in the PATENTS file in the same directory.
25857 *
25858 */
25859
25860
25861
25862var ReactDOMComponentTree = __webpack_require__(5);
25863
25864function isCheckable(elem) {
25865 var type = elem.type;
25866 var nodeName = elem.nodeName;
25867 return nodeName && nodeName.toLowerCase() === 'input' && (type === 'checkbox' || type === 'radio');
25868}
25869
25870function getTracker(inst) {
25871 return inst._wrapperState.valueTracker;
25872}
25873
25874function attachTracker(inst, tracker) {
25875 inst._wrapperState.valueTracker = tracker;
25876}
25877
25878function detachTracker(inst) {
25879 delete inst._wrapperState.valueTracker;
25880}
25881
25882function getValueFromNode(node) {
25883 var value;
25884 if (node) {
25885 value = isCheckable(node) ? '' + node.checked : node.value;
25886 }
25887 return value;
25888}
25889
25890var inputValueTracking = {
25891 // exposed for testing
25892 _getTrackerFromNode: function (node) {
25893 return getTracker(ReactDOMComponentTree.getInstanceFromNode(node));
25894 },
25895
25896
25897 track: function (inst) {
25898 if (getTracker(inst)) {
25899 return;
25900 }
25901
25902 var node = ReactDOMComponentTree.getNodeFromInstance(inst);
25903 var valueField = isCheckable(node) ? 'checked' : 'value';
25904 var descriptor = Object.getOwnPropertyDescriptor(node.constructor.prototype, valueField);
25905
25906 var currentValue = '' + node[valueField];
25907
25908 // if someone has already defined a value or Safari, then bail
25909 // and don't track value will cause over reporting of changes,
25910 // but it's better then a hard failure
25911 // (needed for certain tests that spyOn input values and Safari)
25912 if (node.hasOwnProperty(valueField) || typeof descriptor.get !== 'function' || typeof descriptor.set !== 'function') {
25913 return;
25914 }
25915
25916 Object.defineProperty(node, valueField, {
25917 enumerable: descriptor.enumerable,
25918 configurable: true,
25919 get: function () {
25920 return descriptor.get.call(this);
25921 },
25922 set: function (value) {
25923 currentValue = '' + value;
25924 descriptor.set.call(this, value);
25925 }
25926 });
25927
25928 attachTracker(inst, {
25929 getValue: function () {
25930 return currentValue;
25931 },
25932 setValue: function (value) {
25933 currentValue = '' + value;
25934 },
25935 stopTracking: function () {
25936 detachTracker(inst);
25937 delete node[valueField];
25938 }
25939 });
25940 },
25941
25942 updateValueIfChanged: function (inst) {
25943 if (!inst) {
25944 return false;
25945 }
25946 var tracker = getTracker(inst);
25947
25948 if (!tracker) {
25949 inputValueTracking.track(inst);
25950 return true;
25951 }
25952
25953 var lastValue = tracker.getValue();
25954 var nextValue = getValueFromNode(ReactDOMComponentTree.getNodeFromInstance(inst));
25955
25956 if (nextValue !== lastValue) {
25957 tracker.setValue(nextValue);
25958 return true;
25959 }
25960
25961 return false;
25962 },
25963 stopTracking: function (inst) {
25964 var tracker = getTracker(inst);
25965 if (tracker) {
25966 tracker.stopTracking();
25967 }
25968 }
25969};
25970
25971module.exports = inputValueTracking;
25972
25973/***/ }),
25974/* 71 */
25975/***/ (function(module, exports, __webpack_require__) {
25976
25977"use strict";
25978/**
25979 * Copyright 2013-present, Facebook, Inc.
25980 * All rights reserved.
25981 *
25982 * This source code is licensed under the BSD-style license found in the
25983 * LICENSE file in the root directory of this source tree. An additional grant
25984 * of patent rights can be found in the PATENTS file in the same directory.
25985 *
25986 *
25987 */
25988
25989
25990
25991/**
25992 * @see http://www.whatwg.org/specs/web-apps/current-work/multipage/the-input-element.html#input-type-attr-summary
25993 */
25994
25995var supportedInputTypes = {
25996 color: true,
25997 date: true,
25998 datetime: true,
25999 'datetime-local': true,
26000 email: true,
26001 month: true,
26002 number: true,
26003 password: true,
26004 range: true,
26005 search: true,
26006 tel: true,
26007 text: true,
26008 time: true,
26009 url: true,
26010 week: true
26011};
26012
26013function isTextInputElement(elem) {
26014 var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase();
26015
26016 if (nodeName === 'input') {
26017 return !!supportedInputTypes[elem.type];
26018 }
26019
26020 if (nodeName === 'textarea') {
26021 return true;
26022 }
26023
26024 return false;
26025}
26026
26027module.exports = isTextInputElement;
26028
26029/***/ }),
26030/* 72 */
26031/***/ (function(module, exports, __webpack_require__) {
26032
26033"use strict";
26034/**
26035 * Copyright 2013-present, Facebook, Inc.
26036 * All rights reserved.
26037 *
26038 * This source code is licensed under the BSD-style license found in the
26039 * LICENSE file in the root directory of this source tree. An additional grant
26040 * of patent rights can be found in the PATENTS file in the same directory.
26041 *
26042 */
26043
26044
26045
26046var ViewportMetrics = {
26047 currentScrollLeft: 0,
26048
26049 currentScrollTop: 0,
26050
26051 refreshScrollValues: function (scrollPosition) {
26052 ViewportMetrics.currentScrollLeft = scrollPosition.x;
26053 ViewportMetrics.currentScrollTop = scrollPosition.y;
26054 }
26055};
26056
26057module.exports = ViewportMetrics;
26058
26059/***/ }),
26060/* 73 */
26061/***/ (function(module, exports, __webpack_require__) {
26062
26063"use strict";
26064/**
26065 * Copyright 2013-present, Facebook, Inc.
26066 * All rights reserved.
26067 *
26068 * This source code is licensed under the BSD-style license found in the
26069 * LICENSE file in the root directory of this source tree. An additional grant
26070 * of patent rights can be found in the PATENTS file in the same directory.
26071 *
26072 */
26073
26074
26075
26076var ExecutionEnvironment = __webpack_require__(6);
26077var escapeTextContentForBrowser = __webpack_require__(32);
26078var setInnerHTML = __webpack_require__(31);
26079
26080/**
26081 * Set the textContent property of a node, ensuring that whitespace is preserved
26082 * even in IE8. innerText is a poor substitute for textContent and, among many
26083 * issues, inserts <br> instead of the literal newline chars. innerHTML behaves
26084 * as it should.
26085 *
26086 * @param {DOMElement} node
26087 * @param {string} text
26088 * @internal
26089 */
26090var setTextContent = function (node, text) {
26091 if (text) {
26092 var firstChild = node.firstChild;
26093
26094 if (firstChild && firstChild === node.lastChild && firstChild.nodeType === 3) {
26095 firstChild.nodeValue = text;
26096 return;
26097 }
26098 }
26099 node.textContent = text;
26100};
26101
26102if (ExecutionEnvironment.canUseDOM) {
26103 if (!('textContent' in document.documentElement)) {
26104 setTextContent = function (node, text) {
26105 if (node.nodeType === 3) {
26106 node.nodeValue = text;
26107 return;
26108 }
26109 setInnerHTML(node, escapeTextContentForBrowser(text));
26110 };
26111 }
26112}
26113
26114module.exports = setTextContent;
26115
26116/***/ }),
26117/* 74 */
26118/***/ (function(module, exports, __webpack_require__) {
26119
26120"use strict";
26121/**
26122 * Copyright (c) 2013-present, Facebook, Inc.
26123 * All rights reserved.
26124 *
26125 * This source code is licensed under the BSD-style license found in the
26126 * LICENSE file in the root directory of this source tree. An additional grant
26127 * of patent rights can be found in the PATENTS file in the same directory.
26128 *
26129 */
26130
26131
26132
26133/**
26134 * @param {DOMElement} node input/textarea to focus
26135 */
26136
26137function focusNode(node) {
26138 // IE8 can throw "Can't move focus to the control because it is invisible,
26139 // not enabled, or of a type that does not accept the focus." for all kinds of
26140 // reasons that are too expensive and fragile to test.
26141 try {
26142 node.focus();
26143 } catch (e) {}
26144}
26145
26146module.exports = focusNode;
26147
26148/***/ }),
26149/* 75 */
26150/***/ (function(module, exports, __webpack_require__) {
26151
26152"use strict";
26153/**
26154 * Copyright 2013-present, Facebook, Inc.
26155 * All rights reserved.
26156 *
26157 * This source code is licensed under the BSD-style license found in the
26158 * LICENSE file in the root directory of this source tree. An additional grant
26159 * of patent rights can be found in the PATENTS file in the same directory.
26160 *
26161 */
26162
26163
26164
26165/**
26166 * CSS properties which accept numbers but are not in units of "px".
26167 */
26168
26169var isUnitlessNumber = {
26170 animationIterationCount: true,
26171 borderImageOutset: true,
26172 borderImageSlice: true,
26173 borderImageWidth: true,
26174 boxFlex: true,
26175 boxFlexGroup: true,
26176 boxOrdinalGroup: true,
26177 columnCount: true,
26178 flex: true,
26179 flexGrow: true,
26180 flexPositive: true,
26181 flexShrink: true,
26182 flexNegative: true,
26183 flexOrder: true,
26184 gridRow: true,
26185 gridRowEnd: true,
26186 gridRowSpan: true,
26187 gridRowStart: true,
26188 gridColumn: true,
26189 gridColumnEnd: true,
26190 gridColumnSpan: true,
26191 gridColumnStart: true,
26192 fontWeight: true,
26193 lineClamp: true,
26194 lineHeight: true,
26195 opacity: true,
26196 order: true,
26197 orphans: true,
26198 tabSize: true,
26199 widows: true,
26200 zIndex: true,
26201 zoom: true,
26202
26203 // SVG-related properties
26204 fillOpacity: true,
26205 floodOpacity: true,
26206 stopOpacity: true,
26207 strokeDasharray: true,
26208 strokeDashoffset: true,
26209 strokeMiterlimit: true,
26210 strokeOpacity: true,
26211 strokeWidth: true
26212};
26213
26214/**
26215 * @param {string} prefix vendor-specific prefix, eg: Webkit
26216 * @param {string} key style name, eg: transitionDuration
26217 * @return {string} style name prefixed with `prefix`, properly camelCased, eg:
26218 * WebkitTransitionDuration
26219 */
26220function prefixKey(prefix, key) {
26221 return prefix + key.charAt(0).toUpperCase() + key.substring(1);
26222}
26223
26224/**
26225 * Support style names that may come passed in prefixed by adding permutations
26226 * of vendor prefixes.
26227 */
26228var prefixes = ['Webkit', 'ms', 'Moz', 'O'];
26229
26230// Using Object.keys here, or else the vanilla for-in loop makes IE8 go into an
26231// infinite loop, because it iterates over the newly added props too.
26232Object.keys(isUnitlessNumber).forEach(function (prop) {
26233 prefixes.forEach(function (prefix) {
26234 isUnitlessNumber[prefixKey(prefix, prop)] = isUnitlessNumber[prop];
26235 });
26236});
26237
26238/**
26239 * Most style properties can be unset by doing .style[prop] = '' but IE8
26240 * doesn't like doing that with shorthand properties so for the properties that
26241 * IE8 breaks on, which are listed here, we instead unset each of the
26242 * individual properties. See http://bugs.jquery.com/ticket/12385.
26243 * The 4-value 'clock' properties like margin, padding, border-width seem to
26244 * behave without any problems. Curiously, list-style works too without any
26245 * special prodding.
26246 */
26247var shorthandPropertyExpansions = {
26248 background: {
26249 backgroundAttachment: true,
26250 backgroundColor: true,
26251 backgroundImage: true,
26252 backgroundPositionX: true,
26253 backgroundPositionY: true,
26254 backgroundRepeat: true
26255 },
26256 backgroundPosition: {
26257 backgroundPositionX: true,
26258 backgroundPositionY: true
26259 },
26260 border: {
26261 borderWidth: true,
26262 borderStyle: true,
26263 borderColor: true
26264 },
26265 borderBottom: {
26266 borderBottomWidth: true,
26267 borderBottomStyle: true,
26268 borderBottomColor: true
26269 },
26270 borderLeft: {
26271 borderLeftWidth: true,
26272 borderLeftStyle: true,
26273 borderLeftColor: true
26274 },
26275 borderRight: {
26276 borderRightWidth: true,
26277 borderRightStyle: true,
26278 borderRightColor: true
26279 },
26280 borderTop: {
26281 borderTopWidth: true,
26282 borderTopStyle: true,
26283 borderTopColor: true
26284 },
26285 font: {
26286 fontStyle: true,
26287 fontVariant: true,
26288 fontWeight: true,
26289 fontSize: true,
26290 lineHeight: true,
26291 fontFamily: true
26292 },
26293 outline: {
26294 outlineWidth: true,
26295 outlineStyle: true,
26296 outlineColor: true
26297 }
26298};
26299
26300var CSSProperty = {
26301 isUnitlessNumber: isUnitlessNumber,
26302 shorthandPropertyExpansions: shorthandPropertyExpansions
26303};
26304
26305module.exports = CSSProperty;
26306
26307/***/ }),
26308/* 76 */
26309/***/ (function(module, exports, __webpack_require__) {
26310
26311"use strict";
26312/* WEBPACK VAR INJECTION */(function(process) {/**
26313 * Copyright 2013-present, Facebook, Inc.
26314 * All rights reserved.
26315 *
26316 * This source code is licensed under the BSD-style license found in the
26317 * LICENSE file in the root directory of this source tree. An additional grant
26318 * of patent rights can be found in the PATENTS file in the same directory.
26319 *
26320 */
26321
26322
26323
26324var DOMProperty = __webpack_require__(13);
26325var ReactDOMComponentTree = __webpack_require__(5);
26326var ReactInstrumentation = __webpack_require__(9);
26327
26328var quoteAttributeValueForBrowser = __webpack_require__(139);
26329var warning = __webpack_require__(2);
26330
26331var VALID_ATTRIBUTE_NAME_REGEX = new RegExp('^[' + DOMProperty.ATTRIBUTE_NAME_START_CHAR + '][' + DOMProperty.ATTRIBUTE_NAME_CHAR + ']*$');
26332var illegalAttributeNameCache = {};
26333var validatedAttributeNameCache = {};
26334
26335function isAttributeNameSafe(attributeName) {
26336 if (validatedAttributeNameCache.hasOwnProperty(attributeName)) {
26337 return true;
26338 }
26339 if (illegalAttributeNameCache.hasOwnProperty(attributeName)) {
26340 return false;
26341 }
26342 if (VALID_ATTRIBUTE_NAME_REGEX.test(attributeName)) {
26343 validatedAttributeNameCache[attributeName] = true;
26344 return true;
26345 }
26346 illegalAttributeNameCache[attributeName] = true;
26347 process.env.NODE_ENV !== 'production' ? warning(false, 'Invalid attribute name: `%s`', attributeName) : void 0;
26348 return false;
26349}
26350
26351function shouldIgnoreValue(propertyInfo, value) {
26352 return value == null || propertyInfo.hasBooleanValue && !value || propertyInfo.hasNumericValue && isNaN(value) || propertyInfo.hasPositiveNumericValue && value < 1 || propertyInfo.hasOverloadedBooleanValue && value === false;
26353}
26354
26355/**
26356 * Operations for dealing with DOM properties.
26357 */
26358var DOMPropertyOperations = {
26359 /**
26360 * Creates markup for the ID property.
26361 *
26362 * @param {string} id Unescaped ID.
26363 * @return {string} Markup string.
26364 */
26365 createMarkupForID: function (id) {
26366 return DOMProperty.ID_ATTRIBUTE_NAME + '=' + quoteAttributeValueForBrowser(id);
26367 },
26368
26369 setAttributeForID: function (node, id) {
26370 node.setAttribute(DOMProperty.ID_ATTRIBUTE_NAME, id);
26371 },
26372
26373 createMarkupForRoot: function () {
26374 return DOMProperty.ROOT_ATTRIBUTE_NAME + '=""';
26375 },
26376
26377 setAttributeForRoot: function (node) {
26378 node.setAttribute(DOMProperty.ROOT_ATTRIBUTE_NAME, '');
26379 },
26380
26381 /**
26382 * Creates markup for a property.
26383 *
26384 * @param {string} name
26385 * @param {*} value
26386 * @return {?string} Markup string, or null if the property was invalid.
26387 */
26388 createMarkupForProperty: function (name, value) {
26389 var propertyInfo = DOMProperty.properties.hasOwnProperty(name) ? DOMProperty.properties[name] : null;
26390 if (propertyInfo) {
26391 if (shouldIgnoreValue(propertyInfo, value)) {
26392 return '';
26393 }
26394 var attributeName = propertyInfo.attributeName;
26395 if (propertyInfo.hasBooleanValue || propertyInfo.hasOverloadedBooleanValue && value === true) {
26396 return attributeName + '=""';
26397 }
26398 return attributeName + '=' + quoteAttributeValueForBrowser(value);
26399 } else if (DOMProperty.isCustomAttribute(name)) {
26400 if (value == null) {
26401 return '';
26402 }
26403 return name + '=' + quoteAttributeValueForBrowser(value);
26404 }
26405 return null;
26406 },
26407
26408 /**
26409 * Creates markup for a custom property.
26410 *
26411 * @param {string} name
26412 * @param {*} value
26413 * @return {string} Markup string, or empty string if the property was invalid.
26414 */
26415 createMarkupForCustomAttribute: function (name, value) {
26416 if (!isAttributeNameSafe(name) || value == null) {
26417 return '';
26418 }
26419 return name + '=' + quoteAttributeValueForBrowser(value);
26420 },
26421
26422 /**
26423 * Sets the value for a property on a node.
26424 *
26425 * @param {DOMElement} node
26426 * @param {string} name
26427 * @param {*} value
26428 */
26429 setValueForProperty: function (node, name, value) {
26430 var propertyInfo = DOMProperty.properties.hasOwnProperty(name) ? DOMProperty.properties[name] : null;
26431 if (propertyInfo) {
26432 var mutationMethod = propertyInfo.mutationMethod;
26433 if (mutationMethod) {
26434 mutationMethod(node, value);
26435 } else if (shouldIgnoreValue(propertyInfo, value)) {
26436 this.deleteValueForProperty(node, name);
26437 return;
26438 } else if (propertyInfo.mustUseProperty) {
26439 // Contrary to `setAttribute`, object properties are properly
26440 // `toString`ed by IE8/9.
26441 node[propertyInfo.propertyName] = value;
26442 } else {
26443 var attributeName = propertyInfo.attributeName;
26444 var namespace = propertyInfo.attributeNamespace;
26445 // `setAttribute` with objects becomes only `[object]` in IE8/9,
26446 // ('' + value) makes it output the correct toString()-value.
26447 if (namespace) {
26448 node.setAttributeNS(namespace, attributeName, '' + value);
26449 } else if (propertyInfo.hasBooleanValue || propertyInfo.hasOverloadedBooleanValue && value === true) {
26450 node.setAttribute(attributeName, '');
26451 } else {
26452 node.setAttribute(attributeName, '' + value);
26453 }
26454 }
26455 } else if (DOMProperty.isCustomAttribute(name)) {
26456 DOMPropertyOperations.setValueForAttribute(node, name, value);
26457 return;
26458 }
26459
26460 if (process.env.NODE_ENV !== 'production') {
26461 var payload = {};
26462 payload[name] = value;
26463 ReactInstrumentation.debugTool.onHostOperation({
26464 instanceID: ReactDOMComponentTree.getInstanceFromNode(node)._debugID,
26465 type: 'update attribute',
26466 payload: payload
26467 });
26468 }
26469 },
26470
26471 setValueForAttribute: function (node, name, value) {
26472 if (!isAttributeNameSafe(name)) {
26473 return;
26474 }
26475 if (value == null) {
26476 node.removeAttribute(name);
26477 } else {
26478 node.setAttribute(name, '' + value);
26479 }
26480
26481 if (process.env.NODE_ENV !== 'production') {
26482 var payload = {};
26483 payload[name] = value;
26484 ReactInstrumentation.debugTool.onHostOperation({
26485 instanceID: ReactDOMComponentTree.getInstanceFromNode(node)._debugID,
26486 type: 'update attribute',
26487 payload: payload
26488 });
26489 }
26490 },
26491
26492 /**
26493 * Deletes an attributes from a node.
26494 *
26495 * @param {DOMElement} node
26496 * @param {string} name
26497 */
26498 deleteValueForAttribute: function (node, name) {
26499 node.removeAttribute(name);
26500 if (process.env.NODE_ENV !== 'production') {
26501 ReactInstrumentation.debugTool.onHostOperation({
26502 instanceID: ReactDOMComponentTree.getInstanceFromNode(node)._debugID,
26503 type: 'remove attribute',
26504 payload: name
26505 });
26506 }
26507 },
26508
26509 /**
26510 * Deletes the value for a property on a node.
26511 *
26512 * @param {DOMElement} node
26513 * @param {string} name
26514 */
26515 deleteValueForProperty: function (node, name) {
26516 var propertyInfo = DOMProperty.properties.hasOwnProperty(name) ? DOMProperty.properties[name] : null;
26517 if (propertyInfo) {
26518 var mutationMethod = propertyInfo.mutationMethod;
26519 if (mutationMethod) {
26520 mutationMethod(node, undefined);
26521 } else if (propertyInfo.mustUseProperty) {
26522 var propName = propertyInfo.propertyName;
26523 if (propertyInfo.hasBooleanValue) {
26524 node[propName] = false;
26525 } else {
26526 node[propName] = '';
26527 }
26528 } else {
26529 node.removeAttribute(propertyInfo.attributeName);
26530 }
26531 } else if (DOMProperty.isCustomAttribute(name)) {
26532 node.removeAttribute(name);
26533 }
26534
26535 if (process.env.NODE_ENV !== 'production') {
26536 ReactInstrumentation.debugTool.onHostOperation({
26537 instanceID: ReactDOMComponentTree.getInstanceFromNode(node)._debugID,
26538 type: 'remove attribute',
26539 payload: name
26540 });
26541 }
26542 }
26543};
26544
26545module.exports = DOMPropertyOperations;
26546/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
26547
26548/***/ }),
26549/* 77 */
26550/***/ (function(module, exports, __webpack_require__) {
26551
26552"use strict";
26553/**
26554 * Copyright 2013-present, Facebook, Inc.
26555 * All rights reserved.
26556 *
26557 * This source code is licensed under the BSD-style license found in the
26558 * LICENSE file in the root directory of this source tree. An additional grant
26559 * of patent rights can be found in the PATENTS file in the same directory.
26560 *
26561 *
26562 */
26563
26564
26565
26566var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
26567
26568module.exports = ReactPropTypesSecret;
26569
26570/***/ }),
26571/* 78 */
26572/***/ (function(module, exports, __webpack_require__) {
26573
26574"use strict";
26575/* WEBPACK VAR INJECTION */(function(process) {/**
26576 * Copyright 2013-present, Facebook, Inc.
26577 * All rights reserved.
26578 *
26579 * This source code is licensed under the BSD-style license found in the
26580 * LICENSE file in the root directory of this source tree. An additional grant
26581 * of patent rights can be found in the PATENTS file in the same directory.
26582 *
26583 */
26584
26585
26586
26587var _assign = __webpack_require__(4);
26588
26589var LinkedValueUtils = __webpack_require__(46);
26590var ReactDOMComponentTree = __webpack_require__(5);
26591var ReactUpdates = __webpack_require__(11);
26592
26593var warning = __webpack_require__(2);
26594
26595var didWarnValueLink = false;
26596var didWarnValueDefaultValue = false;
26597
26598function updateOptionsIfPendingUpdateAndMounted() {
26599 if (this._rootNodeID && this._wrapperState.pendingUpdate) {
26600 this._wrapperState.pendingUpdate = false;
26601
26602 var props = this._currentElement.props;
26603 var value = LinkedValueUtils.getValue(props);
26604
26605 if (value != null) {
26606 updateOptions(this, Boolean(props.multiple), value);
26607 }
26608 }
26609}
26610
26611function getDeclarationErrorAddendum(owner) {
26612 if (owner) {
26613 var name = owner.getName();
26614 if (name) {
26615 return ' Check the render method of `' + name + '`.';
26616 }
26617 }
26618 return '';
26619}
26620
26621var valuePropNames = ['value', 'defaultValue'];
26622
26623/**
26624 * Validation function for `value` and `defaultValue`.
26625 * @private
26626 */
26627function checkSelectPropTypes(inst, props) {
26628 var owner = inst._currentElement._owner;
26629 LinkedValueUtils.checkPropTypes('select', props, owner);
26630
26631 if (props.valueLink !== undefined && !didWarnValueLink) {
26632 process.env.NODE_ENV !== 'production' ? warning(false, '`valueLink` prop on `select` is deprecated; set `value` and `onChange` instead.') : void 0;
26633 didWarnValueLink = true;
26634 }
26635
26636 for (var i = 0; i < valuePropNames.length; i++) {
26637 var propName = valuePropNames[i];
26638 if (props[propName] == null) {
26639 continue;
26640 }
26641 var isArray = Array.isArray(props[propName]);
26642 if (props.multiple && !isArray) {
26643 process.env.NODE_ENV !== 'production' ? warning(false, 'The `%s` prop supplied to <select> must be an array if ' + '`multiple` is true.%s', propName, getDeclarationErrorAddendum(owner)) : void 0;
26644 } else if (!props.multiple && isArray) {
26645 process.env.NODE_ENV !== 'production' ? warning(false, 'The `%s` prop supplied to <select> must be a scalar ' + 'value if `multiple` is false.%s', propName, getDeclarationErrorAddendum(owner)) : void 0;
26646 }
26647 }
26648}
26649
26650/**
26651 * @param {ReactDOMComponent} inst
26652 * @param {boolean} multiple
26653 * @param {*} propValue A stringable (with `multiple`, a list of stringables).
26654 * @private
26655 */
26656function updateOptions(inst, multiple, propValue) {
26657 var selectedValue, i;
26658 var options = ReactDOMComponentTree.getNodeFromInstance(inst).options;
26659
26660 if (multiple) {
26661 selectedValue = {};
26662 for (i = 0; i < propValue.length; i++) {
26663 selectedValue['' + propValue[i]] = true;
26664 }
26665 for (i = 0; i < options.length; i++) {
26666 var selected = selectedValue.hasOwnProperty(options[i].value);
26667 if (options[i].selected !== selected) {
26668 options[i].selected = selected;
26669 }
26670 }
26671 } else {
26672 // Do not set `select.value` as exact behavior isn't consistent across all
26673 // browsers for all cases.
26674 selectedValue = '' + propValue;
26675 for (i = 0; i < options.length; i++) {
26676 if (options[i].value === selectedValue) {
26677 options[i].selected = true;
26678 return;
26679 }
26680 }
26681 if (options.length) {
26682 options[0].selected = true;
26683 }
26684 }
26685}
26686
26687/**
26688 * Implements a <select> host component that allows optionally setting the
26689 * props `value` and `defaultValue`. If `multiple` is false, the prop must be a
26690 * stringable. If `multiple` is true, the prop must be an array of stringables.
26691 *
26692 * If `value` is not supplied (or null/undefined), user actions that change the
26693 * selected option will trigger updates to the rendered options.
26694 *
26695 * If it is supplied (and not null/undefined), the rendered options will not
26696 * update in response to user actions. Instead, the `value` prop must change in
26697 * order for the rendered options to update.
26698 *
26699 * If `defaultValue` is provided, any options with the supplied values will be
26700 * selected.
26701 */
26702var ReactDOMSelect = {
26703 getHostProps: function (inst, props) {
26704 return _assign({}, props, {
26705 onChange: inst._wrapperState.onChange,
26706 value: undefined
26707 });
26708 },
26709
26710 mountWrapper: function (inst, props) {
26711 if (process.env.NODE_ENV !== 'production') {
26712 checkSelectPropTypes(inst, props);
26713 }
26714
26715 var value = LinkedValueUtils.getValue(props);
26716 inst._wrapperState = {
26717 pendingUpdate: false,
26718 initialValue: value != null ? value : props.defaultValue,
26719 listeners: null,
26720 onChange: _handleChange.bind(inst),
26721 wasMultiple: Boolean(props.multiple)
26722 };
26723
26724 if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValueDefaultValue) {
26725 process.env.NODE_ENV !== 'production' ? warning(false, 'Select elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled select ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components') : void 0;
26726 didWarnValueDefaultValue = true;
26727 }
26728 },
26729
26730 getSelectValueContext: function (inst) {
26731 // ReactDOMOption looks at this initial value so the initial generated
26732 // markup has correct `selected` attributes
26733 return inst._wrapperState.initialValue;
26734 },
26735
26736 postUpdateWrapper: function (inst) {
26737 var props = inst._currentElement.props;
26738
26739 // After the initial mount, we control selected-ness manually so don't pass
26740 // this value down
26741 inst._wrapperState.initialValue = undefined;
26742
26743 var wasMultiple = inst._wrapperState.wasMultiple;
26744 inst._wrapperState.wasMultiple = Boolean(props.multiple);
26745
26746 var value = LinkedValueUtils.getValue(props);
26747 if (value != null) {
26748 inst._wrapperState.pendingUpdate = false;
26749 updateOptions(inst, Boolean(props.multiple), value);
26750 } else if (wasMultiple !== Boolean(props.multiple)) {
26751 // For simplicity, reapply `defaultValue` if `multiple` is toggled.
26752 if (props.defaultValue != null) {
26753 updateOptions(inst, Boolean(props.multiple), props.defaultValue);
26754 } else {
26755 // Revert the select back to its default unselected state.
26756 updateOptions(inst, Boolean(props.multiple), props.multiple ? [] : '');
26757 }
26758 }
26759 }
26760};
26761
26762function _handleChange(event) {
26763 var props = this._currentElement.props;
26764 var returnValue = LinkedValueUtils.executeOnChange(props, event);
26765
26766 if (this._rootNodeID) {
26767 this._wrapperState.pendingUpdate = true;
26768 }
26769 ReactUpdates.asap(updateOptionsIfPendingUpdateAndMounted, this);
26770 return returnValue;
26771}
26772
26773module.exports = ReactDOMSelect;
26774/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
26775
26776/***/ }),
26777/* 79 */
26778/***/ (function(module, exports, __webpack_require__) {
26779
26780"use strict";
26781/* WEBPACK VAR INJECTION */(function(process) {/**
26782 * Copyright 2013-present, Facebook, Inc.
26783 * All rights reserved.
26784 *
26785 * This source code is licensed under the BSD-style license found in the
26786 * LICENSE file in the root directory of this source tree. An additional grant
26787 * of patent rights can be found in the PATENTS file in the same directory.
26788 *
26789 */
26790
26791
26792
26793var _prodInvariant = __webpack_require__(3),
26794 _assign = __webpack_require__(4);
26795
26796var ReactCompositeComponent = __webpack_require__(147);
26797var ReactEmptyComponent = __webpack_require__(81);
26798var ReactHostComponent = __webpack_require__(82);
26799
26800var getNextDebugID = __webpack_require__(150);
26801var invariant = __webpack_require__(1);
26802var warning = __webpack_require__(2);
26803
26804// To avoid a cyclic dependency, we create the final class in this module
26805var ReactCompositeComponentWrapper = function (element) {
26806 this.construct(element);
26807};
26808
26809function getDeclarationErrorAddendum(owner) {
26810 if (owner) {
26811 var name = owner.getName();
26812 if (name) {
26813 return ' Check the render method of `' + name + '`.';
26814 }
26815 }
26816 return '';
26817}
26818
26819/**
26820 * Check if the type reference is a known internal type. I.e. not a user
26821 * provided composite type.
26822 *
26823 * @param {function} type
26824 * @return {boolean} Returns true if this is a valid internal type.
26825 */
26826function isInternalComponentType(type) {
26827 return typeof type === 'function' && typeof type.prototype !== 'undefined' && typeof type.prototype.mountComponent === 'function' && typeof type.prototype.receiveComponent === 'function';
26828}
26829
26830/**
26831 * Given a ReactNode, create an instance that will actually be mounted.
26832 *
26833 * @param {ReactNode} node
26834 * @param {boolean} shouldHaveDebugID
26835 * @return {object} A new instance of the element's constructor.
26836 * @protected
26837 */
26838function instantiateReactComponent(node, shouldHaveDebugID) {
26839 var instance;
26840
26841 if (node === null || node === false) {
26842 instance = ReactEmptyComponent.create(instantiateReactComponent);
26843 } else if (typeof node === 'object') {
26844 var element = node;
26845 var type = element.type;
26846 if (typeof type !== 'function' && typeof type !== 'string') {
26847 var info = '';
26848 if (process.env.NODE_ENV !== 'production') {
26849 if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
26850 info += ' You likely forgot to export your component from the file ' + "it's defined in.";
26851 }
26852 }
26853 info += getDeclarationErrorAddendum(element._owner);
26854 true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s', type == null ? type : typeof type, info) : _prodInvariant('130', type == null ? type : typeof type, info) : void 0;
26855 }
26856
26857 // Special case string values
26858 if (typeof element.type === 'string') {
26859 instance = ReactHostComponent.createInternalComponent(element);
26860 } else if (isInternalComponentType(element.type)) {
26861 // This is temporarily available for custom components that are not string
26862 // representations. I.e. ART. Once those are updated to use the string
26863 // representation, we can drop this code path.
26864 instance = new element.type(element);
26865
26866 // We renamed this. Allow the old name for compat. :(
26867 if (!instance.getHostNode) {
26868 instance.getHostNode = instance.getNativeNode;
26869 }
26870 } else {
26871 instance = new ReactCompositeComponentWrapper(element);
26872 }
26873 } else if (typeof node === 'string' || typeof node === 'number') {
26874 instance = ReactHostComponent.createInstanceForText(node);
26875 } else {
26876 true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Encountered invalid React node of type %s', typeof node) : _prodInvariant('131', typeof node) : void 0;
26877 }
26878
26879 if (process.env.NODE_ENV !== 'production') {
26880 process.env.NODE_ENV !== 'production' ? warning(typeof instance.mountComponent === 'function' && typeof instance.receiveComponent === 'function' && typeof instance.getHostNode === 'function' && typeof instance.unmountComponent === 'function', 'Only React Components can be mounted.') : void 0;
26881 }
26882
26883 // These two fields are used by the DOM and ART diffing algorithms
26884 // respectively. Instead of using expandos on components, we should be
26885 // storing the state needed by the diffing algorithms elsewhere.
26886 instance._mountIndex = 0;
26887 instance._mountImage = null;
26888
26889 if (process.env.NODE_ENV !== 'production') {
26890 instance._debugID = shouldHaveDebugID ? getNextDebugID() : 0;
26891 }
26892
26893 // Internal instances should fully constructed at this point, so they should
26894 // not get any new fields added to them at this point.
26895 if (process.env.NODE_ENV !== 'production') {
26896 if (Object.preventExtensions) {
26897 Object.preventExtensions(instance);
26898 }
26899 }
26900
26901 return instance;
26902}
26903
26904_assign(ReactCompositeComponentWrapper.prototype, ReactCompositeComponent, {
26905 _instantiateReactComponent: instantiateReactComponent
26906});
26907
26908module.exports = instantiateReactComponent;
26909/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
26910
26911/***/ }),
26912/* 80 */
26913/***/ (function(module, exports, __webpack_require__) {
26914
26915"use strict";
26916/* WEBPACK VAR INJECTION */(function(process) {/**
26917 * Copyright 2013-present, Facebook, Inc.
26918 * All rights reserved.
26919 *
26920 * This source code is licensed under the BSD-style license found in the
26921 * LICENSE file in the root directory of this source tree. An additional grant
26922 * of patent rights can be found in the PATENTS file in the same directory.
26923 *
26924 *
26925 */
26926
26927
26928
26929var _prodInvariant = __webpack_require__(3);
26930
26931var React = __webpack_require__(17);
26932
26933var invariant = __webpack_require__(1);
26934
26935var ReactNodeTypes = {
26936 HOST: 0,
26937 COMPOSITE: 1,
26938 EMPTY: 2,
26939
26940 getType: function (node) {
26941 if (node === null || node === false) {
26942 return ReactNodeTypes.EMPTY;
26943 } else if (React.isValidElement(node)) {
26944 if (typeof node.type === 'function') {
26945 return ReactNodeTypes.COMPOSITE;
26946 } else {
26947 return ReactNodeTypes.HOST;
26948 }
26949 }
26950 true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unexpected node: %s', node) : _prodInvariant('26', node) : void 0;
26951 }
26952};
26953
26954module.exports = ReactNodeTypes;
26955/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
26956
26957/***/ }),
26958/* 81 */
26959/***/ (function(module, exports, __webpack_require__) {
26960
26961"use strict";
26962/**
26963 * Copyright 2014-present, Facebook, Inc.
26964 * All rights reserved.
26965 *
26966 * This source code is licensed under the BSD-style license found in the
26967 * LICENSE file in the root directory of this source tree. An additional grant
26968 * of patent rights can be found in the PATENTS file in the same directory.
26969 *
26970 */
26971
26972
26973
26974var emptyComponentFactory;
26975
26976var ReactEmptyComponentInjection = {
26977 injectEmptyComponentFactory: function (factory) {
26978 emptyComponentFactory = factory;
26979 }
26980};
26981
26982var ReactEmptyComponent = {
26983 create: function (instantiate) {
26984 return emptyComponentFactory(instantiate);
26985 }
26986};
26987
26988ReactEmptyComponent.injection = ReactEmptyComponentInjection;
26989
26990module.exports = ReactEmptyComponent;
26991
26992/***/ }),
26993/* 82 */
26994/***/ (function(module, exports, __webpack_require__) {
26995
26996"use strict";
26997/* WEBPACK VAR INJECTION */(function(process) {/**
26998 * Copyright 2014-present, Facebook, Inc.
26999 * All rights reserved.
27000 *
27001 * This source code is licensed under the BSD-style license found in the
27002 * LICENSE file in the root directory of this source tree. An additional grant
27003 * of patent rights can be found in the PATENTS file in the same directory.
27004 *
27005 */
27006
27007
27008
27009var _prodInvariant = __webpack_require__(3);
27010
27011var invariant = __webpack_require__(1);
27012
27013var genericComponentClass = null;
27014var textComponentClass = null;
27015
27016var ReactHostComponentInjection = {
27017 // This accepts a class that receives the tag string. This is a catch all
27018 // that can render any kind of tag.
27019 injectGenericComponentClass: function (componentClass) {
27020 genericComponentClass = componentClass;
27021 },
27022 // This accepts a text component class that takes the text string to be
27023 // rendered as props.
27024 injectTextComponentClass: function (componentClass) {
27025 textComponentClass = componentClass;
27026 }
27027};
27028
27029/**
27030 * Get a host internal component class for a specific tag.
27031 *
27032 * @param {ReactElement} element The element to create.
27033 * @return {function} The internal class constructor function.
27034 */
27035function createInternalComponent(element) {
27036 !genericComponentClass ? process.env.NODE_ENV !== 'production' ? invariant(false, 'There is no registered component for the tag %s', element.type) : _prodInvariant('111', element.type) : void 0;
27037 return new genericComponentClass(element);
27038}
27039
27040/**
27041 * @param {ReactText} text
27042 * @return {ReactComponent}
27043 */
27044function createInstanceForText(text) {
27045 return new textComponentClass(text);
27046}
27047
27048/**
27049 * @param {ReactComponent} component
27050 * @return {boolean}
27051 */
27052function isTextComponent(component) {
27053 return component instanceof textComponentClass;
27054}
27055
27056var ReactHostComponent = {
27057 createInternalComponent: createInternalComponent,
27058 createInstanceForText: createInstanceForText,
27059 isTextComponent: isTextComponent,
27060 injection: ReactHostComponentInjection
27061};
27062
27063module.exports = ReactHostComponent;
27064/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
27065
27066/***/ }),
27067/* 83 */
27068/***/ (function(module, exports, __webpack_require__) {
27069
27070"use strict";
27071/* WEBPACK VAR INJECTION */(function(process) {/**
27072 * Copyright 2013-present, Facebook, Inc.
27073 * All rights reserved.
27074 *
27075 * This source code is licensed under the BSD-style license found in the
27076 * LICENSE file in the root directory of this source tree. An additional grant
27077 * of patent rights can be found in the PATENTS file in the same directory.
27078 *
27079 */
27080
27081
27082
27083var _prodInvariant = __webpack_require__(3);
27084
27085var ReactCurrentOwner = __webpack_require__(10);
27086var REACT_ELEMENT_TYPE = __webpack_require__(151);
27087
27088var getIteratorFn = __webpack_require__(152);
27089var invariant = __webpack_require__(1);
27090var KeyEscapeUtils = __webpack_require__(50);
27091var warning = __webpack_require__(2);
27092
27093var SEPARATOR = '.';
27094var SUBSEPARATOR = ':';
27095
27096/**
27097 * This is inlined from ReactElement since this file is shared between
27098 * isomorphic and renderers. We could extract this to a
27099 *
27100 */
27101
27102/**
27103 * TODO: Test that a single child and an array with one item have the same key
27104 * pattern.
27105 */
27106
27107var didWarnAboutMaps = false;
27108
27109/**
27110 * Generate a key string that identifies a component within a set.
27111 *
27112 * @param {*} component A component that could contain a manual key.
27113 * @param {number} index Index that is used if a manual key is not provided.
27114 * @return {string}
27115 */
27116function getComponentKey(component, index) {
27117 // Do some typechecking here since we call this blindly. We want to ensure
27118 // that we don't block potential future ES APIs.
27119 if (component && typeof component === 'object' && component.key != null) {
27120 // Explicit key
27121 return KeyEscapeUtils.escape(component.key);
27122 }
27123 // Implicit key determined by the index in the set
27124 return index.toString(36);
27125}
27126
27127/**
27128 * @param {?*} children Children tree container.
27129 * @param {!string} nameSoFar Name of the key path so far.
27130 * @param {!function} callback Callback to invoke with each child found.
27131 * @param {?*} traverseContext Used to pass information throughout the traversal
27132 * process.
27133 * @return {!number} The number of children in this subtree.
27134 */
27135function traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext) {
27136 var type = typeof children;
27137
27138 if (type === 'undefined' || type === 'boolean') {
27139 // All of the above are perceived as null.
27140 children = null;
27141 }
27142
27143 if (children === null || type === 'string' || type === 'number' ||
27144 // The following is inlined from ReactElement. This means we can optimize
27145 // some checks. React Fiber also inlines this logic for similar purposes.
27146 type === 'object' && children.$$typeof === REACT_ELEMENT_TYPE) {
27147 callback(traverseContext, children,
27148 // If it's the only child, treat the name as if it was wrapped in an array
27149 // so that it's consistent if the number of children grows.
27150 nameSoFar === '' ? SEPARATOR + getComponentKey(children, 0) : nameSoFar);
27151 return 1;
27152 }
27153
27154 var child;
27155 var nextName;
27156 var subtreeCount = 0; // Count of children found in the current subtree.
27157 var nextNamePrefix = nameSoFar === '' ? SEPARATOR : nameSoFar + SUBSEPARATOR;
27158
27159 if (Array.isArray(children)) {
27160 for (var i = 0; i < children.length; i++) {
27161 child = children[i];
27162 nextName = nextNamePrefix + getComponentKey(child, i);
27163 subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
27164 }
27165 } else {
27166 var iteratorFn = getIteratorFn(children);
27167 if (iteratorFn) {
27168 var iterator = iteratorFn.call(children);
27169 var step;
27170 if (iteratorFn !== children.entries) {
27171 var ii = 0;
27172 while (!(step = iterator.next()).done) {
27173 child = step.value;
27174 nextName = nextNamePrefix + getComponentKey(child, ii++);
27175 subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
27176 }
27177 } else {
27178 if (process.env.NODE_ENV !== 'production') {
27179 var mapsAsChildrenAddendum = '';
27180 if (ReactCurrentOwner.current) {
27181 var mapsAsChildrenOwnerName = ReactCurrentOwner.current.getName();
27182 if (mapsAsChildrenOwnerName) {
27183 mapsAsChildrenAddendum = ' Check the render method of `' + mapsAsChildrenOwnerName + '`.';
27184 }
27185 }
27186 process.env.NODE_ENV !== 'production' ? warning(didWarnAboutMaps, 'Using Maps as children is not yet fully supported. It is an ' + 'experimental feature that might be removed. Convert it to a ' + 'sequence / iterable of keyed ReactElements instead.%s', mapsAsChildrenAddendum) : void 0;
27187 didWarnAboutMaps = true;
27188 }
27189 // Iterator will provide entry [k,v] tuples rather than values.
27190 while (!(step = iterator.next()).done) {
27191 var entry = step.value;
27192 if (entry) {
27193 child = entry[1];
27194 nextName = nextNamePrefix + KeyEscapeUtils.escape(entry[0]) + SUBSEPARATOR + getComponentKey(child, 0);
27195 subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
27196 }
27197 }
27198 }
27199 } else if (type === 'object') {
27200 var addendum = '';
27201 if (process.env.NODE_ENV !== 'production') {
27202 addendum = ' If you meant to render a collection of children, use an array ' + 'instead or wrap the object using createFragment(object) from the ' + 'React add-ons.';
27203 if (children._isReactElement) {
27204 addendum = " It looks like you're using an element created by a different " + 'version of React. Make sure to use only one copy of React.';
27205 }
27206 if (ReactCurrentOwner.current) {
27207 var name = ReactCurrentOwner.current.getName();
27208 if (name) {
27209 addendum += ' Check the render method of `' + name + '`.';
27210 }
27211 }
27212 }
27213 var childrenString = String(children);
27214 true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Objects are not valid as a React child (found: %s).%s', childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString, addendum) : _prodInvariant('31', childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString, addendum) : void 0;
27215 }
27216 }
27217
27218 return subtreeCount;
27219}
27220
27221/**
27222 * Traverses children that are typically specified as `props.children`, but
27223 * might also be specified through attributes:
27224 *
27225 * - `traverseAllChildren(this.props.children, ...)`
27226 * - `traverseAllChildren(this.props.leftPanelChildren, ...)`
27227 *
27228 * The `traverseContext` is an optional argument that is passed through the
27229 * entire traversal. It can be used to store accumulations or anything else that
27230 * the callback might find relevant.
27231 *
27232 * @param {?*} children Children tree object.
27233 * @param {!function} callback To invoke upon traversing each child.
27234 * @param {?*} traverseContext Context for traversal.
27235 * @return {!number} The number of children in this subtree.
27236 */
27237function traverseAllChildren(children, callback, traverseContext) {
27238 if (children == null) {
27239 return 0;
27240 }
27241
27242 return traverseAllChildrenImpl(children, '', callback, traverseContext);
27243}
27244
27245module.exports = traverseAllChildren;
27246/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
27247
27248/***/ }),
27249/* 84 */
27250/***/ (function(module, exports, __webpack_require__) {
27251
27252"use strict";
27253/* WEBPACK VAR INJECTION */(function(process) {
27254
27255/**
27256 * Copyright (c) 2013-present, Facebook, Inc.
27257 * All rights reserved.
27258 *
27259 * This source code is licensed under the BSD-style license found in the
27260 * LICENSE file in the root directory of this source tree. An additional grant
27261 * of patent rights can be found in the PATENTS file in the same directory.
27262 *
27263 * @typechecks
27264 */
27265
27266var emptyFunction = __webpack_require__(8);
27267
27268/**
27269 * Upstream version of event listener. Does not take into account specific
27270 * nature of platform.
27271 */
27272var EventListener = {
27273 /**
27274 * Listen to DOM events during the bubble phase.
27275 *
27276 * @param {DOMEventTarget} target DOM element to register listener on.
27277 * @param {string} eventType Event type, e.g. 'click' or 'mouseover'.
27278 * @param {function} callback Callback function.
27279 * @return {object} Object with a `remove` method.
27280 */
27281 listen: function listen(target, eventType, callback) {
27282 if (target.addEventListener) {
27283 target.addEventListener(eventType, callback, false);
27284 return {
27285 remove: function remove() {
27286 target.removeEventListener(eventType, callback, false);
27287 }
27288 };
27289 } else if (target.attachEvent) {
27290 target.attachEvent('on' + eventType, callback);
27291 return {
27292 remove: function remove() {
27293 target.detachEvent('on' + eventType, callback);
27294 }
27295 };
27296 }
27297 },
27298
27299 /**
27300 * Listen to DOM events during the capture phase.
27301 *
27302 * @param {DOMEventTarget} target DOM element to register listener on.
27303 * @param {string} eventType Event type, e.g. 'click' or 'mouseover'.
27304 * @param {function} callback Callback function.
27305 * @return {object} Object with a `remove` method.
27306 */
27307 capture: function capture(target, eventType, callback) {
27308 if (target.addEventListener) {
27309 target.addEventListener(eventType, callback, true);
27310 return {
27311 remove: function remove() {
27312 target.removeEventListener(eventType, callback, true);
27313 }
27314 };
27315 } else {
27316 if (process.env.NODE_ENV !== 'production') {
27317 console.error('Attempted to listen to events during the capture phase on a ' + 'browser that does not support the capture phase. Your application ' + 'will not receive some events.');
27318 }
27319 return {
27320 remove: emptyFunction
27321 };
27322 }
27323 },
27324
27325 registerDefault: function registerDefault() {}
27326};
27327
27328module.exports = EventListener;
27329/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
27330
27331/***/ }),
27332/* 85 */
27333/***/ (function(module, exports, __webpack_require__) {
27334
27335"use strict";
27336/**
27337 * Copyright 2013-present, Facebook, Inc.
27338 * All rights reserved.
27339 *
27340 * This source code is licensed under the BSD-style license found in the
27341 * LICENSE file in the root directory of this source tree. An additional grant
27342 * of patent rights can be found in the PATENTS file in the same directory.
27343 *
27344 */
27345
27346
27347
27348var ReactDOMSelection = __webpack_require__(164);
27349
27350var containsNode = __webpack_require__(166);
27351var focusNode = __webpack_require__(74);
27352var getActiveElement = __webpack_require__(86);
27353
27354function isInDocument(node) {
27355 return containsNode(document.documentElement, node);
27356}
27357
27358/**
27359 * @ReactInputSelection: React input selection module. Based on Selection.js,
27360 * but modified to be suitable for react and has a couple of bug fixes (doesn't
27361 * assume buttons have range selections allowed).
27362 * Input selection module for React.
27363 */
27364var ReactInputSelection = {
27365 hasSelectionCapabilities: function (elem) {
27366 var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase();
27367 return nodeName && (nodeName === 'input' && elem.type === 'text' || nodeName === 'textarea' || elem.contentEditable === 'true');
27368 },
27369
27370 getSelectionInformation: function () {
27371 var focusedElem = getActiveElement();
27372 return {
27373 focusedElem: focusedElem,
27374 selectionRange: ReactInputSelection.hasSelectionCapabilities(focusedElem) ? ReactInputSelection.getSelection(focusedElem) : null
27375 };
27376 },
27377
27378 /**
27379 * @restoreSelection: If any selection information was potentially lost,
27380 * restore it. This is useful when performing operations that could remove dom
27381 * nodes and place them back in, resulting in focus being lost.
27382 */
27383 restoreSelection: function (priorSelectionInformation) {
27384 var curFocusedElem = getActiveElement();
27385 var priorFocusedElem = priorSelectionInformation.focusedElem;
27386 var priorSelectionRange = priorSelectionInformation.selectionRange;
27387 if (curFocusedElem !== priorFocusedElem && isInDocument(priorFocusedElem)) {
27388 if (ReactInputSelection.hasSelectionCapabilities(priorFocusedElem)) {
27389 ReactInputSelection.setSelection(priorFocusedElem, priorSelectionRange);
27390 }
27391 focusNode(priorFocusedElem);
27392 }
27393 },
27394
27395 /**
27396 * @getSelection: Gets the selection bounds of a focused textarea, input or
27397 * contentEditable node.
27398 * -@input: Look up selection bounds of this input
27399 * -@return {start: selectionStart, end: selectionEnd}
27400 */
27401 getSelection: function (input) {
27402 var selection;
27403
27404 if ('selectionStart' in input) {
27405 // Modern browser with input or textarea.
27406 selection = {
27407 start: input.selectionStart,
27408 end: input.selectionEnd
27409 };
27410 } else if (document.selection && input.nodeName && input.nodeName.toLowerCase() === 'input') {
27411 // IE8 input.
27412 var range = document.selection.createRange();
27413 // There can only be one selection per document in IE, so it must
27414 // be in our element.
27415 if (range.parentElement() === input) {
27416 selection = {
27417 start: -range.moveStart('character', -input.value.length),
27418 end: -range.moveEnd('character', -input.value.length)
27419 };
27420 }
27421 } else {
27422 // Content editable or old IE textarea.
27423 selection = ReactDOMSelection.getOffsets(input);
27424 }
27425
27426 return selection || { start: 0, end: 0 };
27427 },
27428
27429 /**
27430 * @setSelection: Sets the selection bounds of a textarea or input and focuses
27431 * the input.
27432 * -@input Set selection bounds of this input or textarea
27433 * -@offsets Object of same form that is returned from get*
27434 */
27435 setSelection: function (input, offsets) {
27436 var start = offsets.start;
27437 var end = offsets.end;
27438 if (end === undefined) {
27439 end = start;
27440 }
27441
27442 if ('selectionStart' in input) {
27443 input.selectionStart = start;
27444 input.selectionEnd = Math.min(end, input.value.length);
27445 } else if (document.selection && input.nodeName && input.nodeName.toLowerCase() === 'input') {
27446 var range = input.createTextRange();
27447 range.collapse(true);
27448 range.moveStart('character', start);
27449 range.moveEnd('character', end - start);
27450 range.select();
27451 } else {
27452 ReactDOMSelection.setOffsets(input, offsets);
27453 }
27454 }
27455};
27456
27457module.exports = ReactInputSelection;
27458
27459/***/ }),
27460/* 86 */
27461/***/ (function(module, exports, __webpack_require__) {
27462
27463"use strict";
27464
27465
27466/**
27467 * Copyright (c) 2013-present, Facebook, Inc.
27468 * All rights reserved.
27469 *
27470 * This source code is licensed under the BSD-style license found in the
27471 * LICENSE file in the root directory of this source tree. An additional grant
27472 * of patent rights can be found in the PATENTS file in the same directory.
27473 *
27474 * @typechecks
27475 */
27476
27477/* eslint-disable fb-www/typeof-undefined */
27478
27479/**
27480 * Same as document.activeElement but wraps in a try-catch block. In IE it is
27481 * not safe to call document.activeElement if there is nothing focused.
27482 *
27483 * The activeElement will be null only if the document or document body is not
27484 * yet defined.
27485 *
27486 * @param {?DOMDocument} doc Defaults to current document.
27487 * @return {?DOMElement}
27488 */
27489function getActiveElement(doc) /*?DOMElement*/{
27490 doc = doc || (typeof document !== 'undefined' ? document : undefined);
27491 if (typeof doc === 'undefined') {
27492 return null;
27493 }
27494 try {
27495 return doc.activeElement || doc.body;
27496 } catch (e) {
27497 return doc.body;
27498 }
27499}
27500
27501module.exports = getActiveElement;
27502
27503/***/ }),
27504/* 87 */
27505/***/ (function(module, exports, __webpack_require__) {
27506
27507"use strict";
27508/* WEBPACK VAR INJECTION */(function(process) {/**
27509 * Copyright 2013-present, Facebook, Inc.
27510 * All rights reserved.
27511 *
27512 * This source code is licensed under the BSD-style license found in the
27513 * LICENSE file in the root directory of this source tree. An additional grant
27514 * of patent rights can be found in the PATENTS file in the same directory.
27515 *
27516 */
27517
27518
27519
27520var _prodInvariant = __webpack_require__(3);
27521
27522var DOMLazyTree = __webpack_require__(20);
27523var DOMProperty = __webpack_require__(13);
27524var React = __webpack_require__(17);
27525var ReactBrowserEventEmitter = __webpack_require__(33);
27526var ReactCurrentOwner = __webpack_require__(10);
27527var ReactDOMComponentTree = __webpack_require__(5);
27528var ReactDOMContainerInfo = __webpack_require__(181);
27529var ReactDOMFeatureFlags = __webpack_require__(182);
27530var ReactFeatureFlags = __webpack_require__(69);
27531var ReactInstanceMap = __webpack_require__(24);
27532var ReactInstrumentation = __webpack_require__(9);
27533var ReactMarkupChecksum = __webpack_require__(183);
27534var ReactReconciler = __webpack_require__(19);
27535var ReactUpdateQueue = __webpack_require__(51);
27536var ReactUpdates = __webpack_require__(11);
27537
27538var emptyObject = __webpack_require__(27);
27539var instantiateReactComponent = __webpack_require__(79);
27540var invariant = __webpack_require__(1);
27541var setInnerHTML = __webpack_require__(31);
27542var shouldUpdateReactComponent = __webpack_require__(49);
27543var warning = __webpack_require__(2);
27544
27545var ATTR_NAME = DOMProperty.ID_ATTRIBUTE_NAME;
27546var ROOT_ATTR_NAME = DOMProperty.ROOT_ATTRIBUTE_NAME;
27547
27548var ELEMENT_NODE_TYPE = 1;
27549var DOC_NODE_TYPE = 9;
27550var DOCUMENT_FRAGMENT_NODE_TYPE = 11;
27551
27552var instancesByReactRootID = {};
27553
27554/**
27555 * Finds the index of the first character
27556 * that's not common between the two given strings.
27557 *
27558 * @return {number} the index of the character where the strings diverge
27559 */
27560function firstDifferenceIndex(string1, string2) {
27561 var minLen = Math.min(string1.length, string2.length);
27562 for (var i = 0; i < minLen; i++) {
27563 if (string1.charAt(i) !== string2.charAt(i)) {
27564 return i;
27565 }
27566 }
27567 return string1.length === string2.length ? -1 : minLen;
27568}
27569
27570/**
27571 * @param {DOMElement|DOMDocument} container DOM element that may contain
27572 * a React component
27573 * @return {?*} DOM element that may have the reactRoot ID, or null.
27574 */
27575function getReactRootElementInContainer(container) {
27576 if (!container) {
27577 return null;
27578 }
27579
27580 if (container.nodeType === DOC_NODE_TYPE) {
27581 return container.documentElement;
27582 } else {
27583 return container.firstChild;
27584 }
27585}
27586
27587function internalGetID(node) {
27588 // If node is something like a window, document, or text node, none of
27589 // which support attributes or a .getAttribute method, gracefully return
27590 // the empty string, as if the attribute were missing.
27591 return node.getAttribute && node.getAttribute(ATTR_NAME) || '';
27592}
27593
27594/**
27595 * Mounts this component and inserts it into the DOM.
27596 *
27597 * @param {ReactComponent} componentInstance The instance to mount.
27598 * @param {DOMElement} container DOM element to mount into.
27599 * @param {ReactReconcileTransaction} transaction
27600 * @param {boolean} shouldReuseMarkup If true, do not insert markup
27601 */
27602function mountComponentIntoNode(wrapperInstance, container, transaction, shouldReuseMarkup, context) {
27603 var markerName;
27604 if (ReactFeatureFlags.logTopLevelRenders) {
27605 var wrappedElement = wrapperInstance._currentElement.props.child;
27606 var type = wrappedElement.type;
27607 markerName = 'React mount: ' + (typeof type === 'string' ? type : type.displayName || type.name);
27608 console.time(markerName);
27609 }
27610
27611 var markup = ReactReconciler.mountComponent(wrapperInstance, transaction, null, ReactDOMContainerInfo(wrapperInstance, container), context, 0 /* parentDebugID */
27612 );
27613
27614 if (markerName) {
27615 console.timeEnd(markerName);
27616 }
27617
27618 wrapperInstance._renderedComponent._topLevelWrapper = wrapperInstance;
27619 ReactMount._mountImageIntoNode(markup, container, wrapperInstance, shouldReuseMarkup, transaction);
27620}
27621
27622/**
27623 * Batched mount.
27624 *
27625 * @param {ReactComponent} componentInstance The instance to mount.
27626 * @param {DOMElement} container DOM element to mount into.
27627 * @param {boolean} shouldReuseMarkup If true, do not insert markup
27628 */
27629function batchedMountComponentIntoNode(componentInstance, container, shouldReuseMarkup, context) {
27630 var transaction = ReactUpdates.ReactReconcileTransaction.getPooled(
27631 /* useCreateElement */
27632 !shouldReuseMarkup && ReactDOMFeatureFlags.useCreateElement);
27633 transaction.perform(mountComponentIntoNode, null, componentInstance, container, transaction, shouldReuseMarkup, context);
27634 ReactUpdates.ReactReconcileTransaction.release(transaction);
27635}
27636
27637/**
27638 * Unmounts a component and removes it from the DOM.
27639 *
27640 * @param {ReactComponent} instance React component instance.
27641 * @param {DOMElement} container DOM element to unmount from.
27642 * @final
27643 * @internal
27644 * @see {ReactMount.unmountComponentAtNode}
27645 */
27646function unmountComponentFromNode(instance, container, safely) {
27647 if (process.env.NODE_ENV !== 'production') {
27648 ReactInstrumentation.debugTool.onBeginFlush();
27649 }
27650 ReactReconciler.unmountComponent(instance, safely);
27651 if (process.env.NODE_ENV !== 'production') {
27652 ReactInstrumentation.debugTool.onEndFlush();
27653 }
27654
27655 if (container.nodeType === DOC_NODE_TYPE) {
27656 container = container.documentElement;
27657 }
27658
27659 // http://jsperf.com/emptying-a-node
27660 while (container.lastChild) {
27661 container.removeChild(container.lastChild);
27662 }
27663}
27664
27665/**
27666 * True if the supplied DOM node has a direct React-rendered child that is
27667 * not a React root element. Useful for warning in `render`,
27668 * `unmountComponentAtNode`, etc.
27669 *
27670 * @param {?DOMElement} node The candidate DOM node.
27671 * @return {boolean} True if the DOM element contains a direct child that was
27672 * rendered by React but is not a root element.
27673 * @internal
27674 */
27675function hasNonRootReactChild(container) {
27676 var rootEl = getReactRootElementInContainer(container);
27677 if (rootEl) {
27678 var inst = ReactDOMComponentTree.getInstanceFromNode(rootEl);
27679 return !!(inst && inst._hostParent);
27680 }
27681}
27682
27683/**
27684 * True if the supplied DOM node is a React DOM element and
27685 * it has been rendered by another copy of React.
27686 *
27687 * @param {?DOMElement} node The candidate DOM node.
27688 * @return {boolean} True if the DOM has been rendered by another copy of React
27689 * @internal
27690 */
27691function nodeIsRenderedByOtherInstance(container) {
27692 var rootEl = getReactRootElementInContainer(container);
27693 return !!(rootEl && isReactNode(rootEl) && !ReactDOMComponentTree.getInstanceFromNode(rootEl));
27694}
27695
27696/**
27697 * True if the supplied DOM node is a valid node element.
27698 *
27699 * @param {?DOMElement} node The candidate DOM node.
27700 * @return {boolean} True if the DOM is a valid DOM node.
27701 * @internal
27702 */
27703function isValidContainer(node) {
27704 return !!(node && (node.nodeType === ELEMENT_NODE_TYPE || node.nodeType === DOC_NODE_TYPE || node.nodeType === DOCUMENT_FRAGMENT_NODE_TYPE));
27705}
27706
27707/**
27708 * True if the supplied DOM node is a valid React node element.
27709 *
27710 * @param {?DOMElement} node The candidate DOM node.
27711 * @return {boolean} True if the DOM is a valid React DOM node.
27712 * @internal
27713 */
27714function isReactNode(node) {
27715 return isValidContainer(node) && (node.hasAttribute(ROOT_ATTR_NAME) || node.hasAttribute(ATTR_NAME));
27716}
27717
27718function getHostRootInstanceInContainer(container) {
27719 var rootEl = getReactRootElementInContainer(container);
27720 var prevHostInstance = rootEl && ReactDOMComponentTree.getInstanceFromNode(rootEl);
27721 return prevHostInstance && !prevHostInstance._hostParent ? prevHostInstance : null;
27722}
27723
27724function getTopLevelWrapperInContainer(container) {
27725 var root = getHostRootInstanceInContainer(container);
27726 return root ? root._hostContainerInfo._topLevelWrapper : null;
27727}
27728
27729/**
27730 * Temporary (?) hack so that we can store all top-level pending updates on
27731 * composites instead of having to worry about different types of components
27732 * here.
27733 */
27734var topLevelRootCounter = 1;
27735var TopLevelWrapper = function () {
27736 this.rootID = topLevelRootCounter++;
27737};
27738TopLevelWrapper.prototype.isReactComponent = {};
27739if (process.env.NODE_ENV !== 'production') {
27740 TopLevelWrapper.displayName = 'TopLevelWrapper';
27741}
27742TopLevelWrapper.prototype.render = function () {
27743 return this.props.child;
27744};
27745TopLevelWrapper.isReactTopLevelWrapper = true;
27746
27747/**
27748 * Mounting is the process of initializing a React component by creating its
27749 * representative DOM elements and inserting them into a supplied `container`.
27750 * Any prior content inside `container` is destroyed in the process.
27751 *
27752 * ReactMount.render(
27753 * component,
27754 * document.getElementById('container')
27755 * );
27756 *
27757 * <div id="container"> <-- Supplied `container`.
27758 * <div data-reactid=".3"> <-- Rendered reactRoot of React
27759 * // ... component.
27760 * </div>
27761 * </div>
27762 *
27763 * Inside of `container`, the first element rendered is the "reactRoot".
27764 */
27765var ReactMount = {
27766 TopLevelWrapper: TopLevelWrapper,
27767
27768 /**
27769 * Used by devtools. The keys are not important.
27770 */
27771 _instancesByReactRootID: instancesByReactRootID,
27772
27773 /**
27774 * This is a hook provided to support rendering React components while
27775 * ensuring that the apparent scroll position of its `container` does not
27776 * change.
27777 *
27778 * @param {DOMElement} container The `container` being rendered into.
27779 * @param {function} renderCallback This must be called once to do the render.
27780 */
27781 scrollMonitor: function (container, renderCallback) {
27782 renderCallback();
27783 },
27784
27785 /**
27786 * Take a component that's already mounted into the DOM and replace its props
27787 * @param {ReactComponent} prevComponent component instance already in the DOM
27788 * @param {ReactElement} nextElement component instance to render
27789 * @param {DOMElement} container container to render into
27790 * @param {?function} callback function triggered on completion
27791 */
27792 _updateRootComponent: function (prevComponent, nextElement, nextContext, container, callback) {
27793 ReactMount.scrollMonitor(container, function () {
27794 ReactUpdateQueue.enqueueElementInternal(prevComponent, nextElement, nextContext);
27795 if (callback) {
27796 ReactUpdateQueue.enqueueCallbackInternal(prevComponent, callback);
27797 }
27798 });
27799
27800 return prevComponent;
27801 },
27802
27803 /**
27804 * Render a new component into the DOM. Hooked by hooks!
27805 *
27806 * @param {ReactElement} nextElement element to render
27807 * @param {DOMElement} container container to render into
27808 * @param {boolean} shouldReuseMarkup if we should skip the markup insertion
27809 * @return {ReactComponent} nextComponent
27810 */
27811 _renderNewRootComponent: function (nextElement, container, shouldReuseMarkup, context) {
27812 // Various parts of our code (such as ReactCompositeComponent's
27813 // _renderValidatedComponent) assume that calls to render aren't nested;
27814 // verify that that's the case.
27815 process.env.NODE_ENV !== 'production' ? warning(ReactCurrentOwner.current == null, '_renderNewRootComponent(): Render methods should be a pure function ' + 'of props and state; triggering nested component updates from ' + 'render is not allowed. If necessary, trigger nested updates in ' + 'componentDidUpdate. Check the render method of %s.', ReactCurrentOwner.current && ReactCurrentOwner.current.getName() || 'ReactCompositeComponent') : void 0;
27816
27817 !isValidContainer(container) ? process.env.NODE_ENV !== 'production' ? invariant(false, '_registerComponent(...): Target container is not a DOM element.') : _prodInvariant('37') : void 0;
27818
27819 ReactBrowserEventEmitter.ensureScrollValueMonitoring();
27820 var componentInstance = instantiateReactComponent(nextElement, false);
27821
27822 // The initial render is synchronous but any updates that happen during
27823 // rendering, in componentWillMount or componentDidMount, will be batched
27824 // according to the current batching strategy.
27825
27826 ReactUpdates.batchedUpdates(batchedMountComponentIntoNode, componentInstance, container, shouldReuseMarkup, context);
27827
27828 var wrapperID = componentInstance._instance.rootID;
27829 instancesByReactRootID[wrapperID] = componentInstance;
27830
27831 return componentInstance;
27832 },
27833
27834 /**
27835 * Renders a React component into the DOM in the supplied `container`.
27836 *
27837 * If the React component was previously rendered into `container`, this will
27838 * perform an update on it and only mutate the DOM as necessary to reflect the
27839 * latest React component.
27840 *
27841 * @param {ReactComponent} parentComponent The conceptual parent of this render tree.
27842 * @param {ReactElement} nextElement Component element to render.
27843 * @param {DOMElement} container DOM element to render into.
27844 * @param {?function} callback function triggered on completion
27845 * @return {ReactComponent} Component instance rendered in `container`.
27846 */
27847 renderSubtreeIntoContainer: function (parentComponent, nextElement, container, callback) {
27848 !(parentComponent != null && ReactInstanceMap.has(parentComponent)) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'parentComponent must be a valid React Component') : _prodInvariant('38') : void 0;
27849 return ReactMount._renderSubtreeIntoContainer(parentComponent, nextElement, container, callback);
27850 },
27851
27852 _renderSubtreeIntoContainer: function (parentComponent, nextElement, container, callback) {
27853 ReactUpdateQueue.validateCallback(callback, 'ReactDOM.render');
27854 !React.isValidElement(nextElement) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactDOM.render(): Invalid component element.%s', typeof nextElement === 'string' ? " Instead of passing a string like 'div', pass " + "React.createElement('div') or <div />." : typeof nextElement === 'function' ? ' Instead of passing a class like Foo, pass ' + 'React.createElement(Foo) or <Foo />.' : // Check if it quacks like an element
27855 nextElement != null && nextElement.props !== undefined ? ' This may be caused by unintentionally loading two independent ' + 'copies of React.' : '') : _prodInvariant('39', typeof nextElement === 'string' ? " Instead of passing a string like 'div', pass " + "React.createElement('div') or <div />." : typeof nextElement === 'function' ? ' Instead of passing a class like Foo, pass ' + 'React.createElement(Foo) or <Foo />.' : nextElement != null && nextElement.props !== undefined ? ' This may be caused by unintentionally loading two independent ' + 'copies of React.' : '') : void 0;
27856
27857 process.env.NODE_ENV !== 'production' ? warning(!container || !container.tagName || container.tagName.toUpperCase() !== 'BODY', 'render(): Rendering components directly into document.body is ' + 'discouraged, since its children are often manipulated by third-party ' + 'scripts and browser extensions. This may lead to subtle ' + 'reconciliation issues. Try rendering into a container element created ' + 'for your app.') : void 0;
27858
27859 var nextWrappedElement = React.createElement(TopLevelWrapper, {
27860 child: nextElement
27861 });
27862
27863 var nextContext;
27864 if (parentComponent) {
27865 var parentInst = ReactInstanceMap.get(parentComponent);
27866 nextContext = parentInst._processChildContext(parentInst._context);
27867 } else {
27868 nextContext = emptyObject;
27869 }
27870
27871 var prevComponent = getTopLevelWrapperInContainer(container);
27872
27873 if (prevComponent) {
27874 var prevWrappedElement = prevComponent._currentElement;
27875 var prevElement = prevWrappedElement.props.child;
27876 if (shouldUpdateReactComponent(prevElement, nextElement)) {
27877 var publicInst = prevComponent._renderedComponent.getPublicInstance();
27878 var updatedCallback = callback && function () {
27879 callback.call(publicInst);
27880 };
27881 ReactMount._updateRootComponent(prevComponent, nextWrappedElement, nextContext, container, updatedCallback);
27882 return publicInst;
27883 } else {
27884 ReactMount.unmountComponentAtNode(container);
27885 }
27886 }
27887
27888 var reactRootElement = getReactRootElementInContainer(container);
27889 var containerHasReactMarkup = reactRootElement && !!internalGetID(reactRootElement);
27890 var containerHasNonRootReactChild = hasNonRootReactChild(container);
27891
27892 if (process.env.NODE_ENV !== 'production') {
27893 process.env.NODE_ENV !== 'production' ? warning(!containerHasNonRootReactChild, 'render(...): Replacing React-rendered children with a new root ' + 'component. If you intended to update the children of this node, ' + 'you should instead have the existing children update their state ' + 'and render the new components instead of calling ReactDOM.render.') : void 0;
27894
27895 if (!containerHasReactMarkup || reactRootElement.nextSibling) {
27896 var rootElementSibling = reactRootElement;
27897 while (rootElementSibling) {
27898 if (internalGetID(rootElementSibling)) {
27899 process.env.NODE_ENV !== 'production' ? warning(false, 'render(): Target node has markup rendered by React, but there ' + 'are unrelated nodes as well. This is most commonly caused by ' + 'white-space inserted around server-rendered markup.') : void 0;
27900 break;
27901 }
27902 rootElementSibling = rootElementSibling.nextSibling;
27903 }
27904 }
27905 }
27906
27907 var shouldReuseMarkup = containerHasReactMarkup && !prevComponent && !containerHasNonRootReactChild;
27908 var component = ReactMount._renderNewRootComponent(nextWrappedElement, container, shouldReuseMarkup, nextContext)._renderedComponent.getPublicInstance();
27909 if (callback) {
27910 callback.call(component);
27911 }
27912 return component;
27913 },
27914
27915 /**
27916 * Renders a React component into the DOM in the supplied `container`.
27917 * See https://facebook.github.io/react/docs/top-level-api.html#reactdom.render
27918 *
27919 * If the React component was previously rendered into `container`, this will
27920 * perform an update on it and only mutate the DOM as necessary to reflect the
27921 * latest React component.
27922 *
27923 * @param {ReactElement} nextElement Component element to render.
27924 * @param {DOMElement} container DOM element to render into.
27925 * @param {?function} callback function triggered on completion
27926 * @return {ReactComponent} Component instance rendered in `container`.
27927 */
27928 render: function (nextElement, container, callback) {
27929 return ReactMount._renderSubtreeIntoContainer(null, nextElement, container, callback);
27930 },
27931
27932 /**
27933 * Unmounts and destroys the React component rendered in the `container`.
27934 * See https://facebook.github.io/react/docs/top-level-api.html#reactdom.unmountcomponentatnode
27935 *
27936 * @param {DOMElement} container DOM element containing a React component.
27937 * @return {boolean} True if a component was found in and unmounted from
27938 * `container`
27939 */
27940 unmountComponentAtNode: function (container) {
27941 // Various parts of our code (such as ReactCompositeComponent's
27942 // _renderValidatedComponent) assume that calls to render aren't nested;
27943 // verify that that's the case. (Strictly speaking, unmounting won't cause a
27944 // render but we still don't expect to be in a render call here.)
27945 process.env.NODE_ENV !== 'production' ? warning(ReactCurrentOwner.current == null, 'unmountComponentAtNode(): Render methods should be a pure function ' + 'of props and state; triggering nested component updates from render ' + 'is not allowed. If necessary, trigger nested updates in ' + 'componentDidUpdate. Check the render method of %s.', ReactCurrentOwner.current && ReactCurrentOwner.current.getName() || 'ReactCompositeComponent') : void 0;
27946
27947 !isValidContainer(container) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'unmountComponentAtNode(...): Target container is not a DOM element.') : _prodInvariant('40') : void 0;
27948
27949 if (process.env.NODE_ENV !== 'production') {
27950 process.env.NODE_ENV !== 'production' ? warning(!nodeIsRenderedByOtherInstance(container), "unmountComponentAtNode(): The node you're attempting to unmount " + 'was rendered by another copy of React.') : void 0;
27951 }
27952
27953 var prevComponent = getTopLevelWrapperInContainer(container);
27954 if (!prevComponent) {
27955 // Check if the node being unmounted was rendered by React, but isn't a
27956 // root node.
27957 var containerHasNonRootReactChild = hasNonRootReactChild(container);
27958
27959 // Check if the container itself is a React root node.
27960 var isContainerReactRoot = container.nodeType === 1 && container.hasAttribute(ROOT_ATTR_NAME);
27961
27962 if (process.env.NODE_ENV !== 'production') {
27963 process.env.NODE_ENV !== 'production' ? warning(!containerHasNonRootReactChild, "unmountComponentAtNode(): The node you're attempting to unmount " + 'was rendered by React and is not a top-level container. %s', isContainerReactRoot ? 'You may have accidentally passed in a React root node instead ' + 'of its container.' : 'Instead, have the parent component update its state and ' + 'rerender in order to remove this component.') : void 0;
27964 }
27965
27966 return false;
27967 }
27968 delete instancesByReactRootID[prevComponent._instance.rootID];
27969 ReactUpdates.batchedUpdates(unmountComponentFromNode, prevComponent, container, false);
27970 return true;
27971 },
27972
27973 _mountImageIntoNode: function (markup, container, instance, shouldReuseMarkup, transaction) {
27974 !isValidContainer(container) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'mountComponentIntoNode(...): Target container is not valid.') : _prodInvariant('41') : void 0;
27975
27976 if (shouldReuseMarkup) {
27977 var rootElement = getReactRootElementInContainer(container);
27978 if (ReactMarkupChecksum.canReuseMarkup(markup, rootElement)) {
27979 ReactDOMComponentTree.precacheNode(instance, rootElement);
27980 return;
27981 } else {
27982 var checksum = rootElement.getAttribute(ReactMarkupChecksum.CHECKSUM_ATTR_NAME);
27983 rootElement.removeAttribute(ReactMarkupChecksum.CHECKSUM_ATTR_NAME);
27984
27985 var rootMarkup = rootElement.outerHTML;
27986 rootElement.setAttribute(ReactMarkupChecksum.CHECKSUM_ATTR_NAME, checksum);
27987
27988 var normalizedMarkup = markup;
27989 if (process.env.NODE_ENV !== 'production') {
27990 // because rootMarkup is retrieved from the DOM, various normalizations
27991 // will have occurred which will not be present in `markup`. Here,
27992 // insert markup into a <div> or <iframe> depending on the container
27993 // type to perform the same normalizations before comparing.
27994 var normalizer;
27995 if (container.nodeType === ELEMENT_NODE_TYPE) {
27996 normalizer = document.createElement('div');
27997 normalizer.innerHTML = markup;
27998 normalizedMarkup = normalizer.innerHTML;
27999 } else {
28000 normalizer = document.createElement('iframe');
28001 document.body.appendChild(normalizer);
28002 normalizer.contentDocument.write(markup);
28003 normalizedMarkup = normalizer.contentDocument.documentElement.outerHTML;
28004 document.body.removeChild(normalizer);
28005 }
28006 }
28007
28008 var diffIndex = firstDifferenceIndex(normalizedMarkup, rootMarkup);
28009 var difference = ' (client) ' + normalizedMarkup.substring(diffIndex - 20, diffIndex + 20) + '\n (server) ' + rootMarkup.substring(diffIndex - 20, diffIndex + 20);
28010
28011 !(container.nodeType !== DOC_NODE_TYPE) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'You\'re trying to render a component to the document using server rendering but the checksum was invalid. This usually means you rendered a different component type or props on the client from the one on the server, or your render() methods are impure. React cannot handle this case due to cross-browser quirks by rendering at the document root. You should look for environment dependent code in your components and ensure the props are the same client and server side:\n%s', difference) : _prodInvariant('42', difference) : void 0;
28012
28013 if (process.env.NODE_ENV !== 'production') {
28014 process.env.NODE_ENV !== 'production' ? warning(false, 'React attempted to reuse markup in a container but the ' + 'checksum was invalid. This generally means that you are ' + 'using server rendering and the markup generated on the ' + 'server was not what the client was expecting. React injected ' + 'new markup to compensate which works but you have lost many ' + 'of the benefits of server rendering. Instead, figure out ' + 'why the markup being generated is different on the client ' + 'or server:\n%s', difference) : void 0;
28015 }
28016 }
28017 }
28018
28019 !(container.nodeType !== DOC_NODE_TYPE) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'You\'re trying to render a component to the document but you didn\'t use server rendering. We can\'t do this without using server rendering due to cross-browser quirks. See ReactDOMServer.renderToString() for server rendering.') : _prodInvariant('43') : void 0;
28020
28021 if (transaction.useCreateElement) {
28022 while (container.lastChild) {
28023 container.removeChild(container.lastChild);
28024 }
28025 DOMLazyTree.insertTreeBefore(container, markup, null);
28026 } else {
28027 setInnerHTML(container, markup);
28028 ReactDOMComponentTree.precacheNode(instance, container.firstChild);
28029 }
28030
28031 if (process.env.NODE_ENV !== 'production') {
28032 var hostNode = ReactDOMComponentTree.getInstanceFromNode(container.firstChild);
28033 if (hostNode._debugID !== 0) {
28034 ReactInstrumentation.debugTool.onHostOperation({
28035 instanceID: hostNode._debugID,
28036 type: 'mount',
28037 payload: markup.toString()
28038 });
28039 }
28040 }
28041 }
28042};
28043
28044module.exports = ReactMount;
28045/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
28046
28047/***/ }),
28048/* 88 */
28049/***/ (function(module, exports, __webpack_require__) {
28050
28051"use strict";
28052/**
28053 * Copyright 2013-present, Facebook, Inc.
28054 * All rights reserved.
28055 *
28056 * This source code is licensed under the BSD-style license found in the
28057 * LICENSE file in the root directory of this source tree. An additional grant
28058 * of patent rights can be found in the PATENTS file in the same directory.
28059 *
28060 */
28061
28062
28063
28064var ReactNodeTypes = __webpack_require__(80);
28065
28066function getHostComponentFromComposite(inst) {
28067 var type;
28068
28069 while ((type = inst._renderedNodeType) === ReactNodeTypes.COMPOSITE) {
28070 inst = inst._renderedComponent;
28071 }
28072
28073 if (type === ReactNodeTypes.HOST) {
28074 return inst._renderedComponent;
28075 } else if (type === ReactNodeTypes.EMPTY) {
28076 return null;
28077 }
28078}
28079
28080module.exports = getHostComponentFromComposite;
28081
28082/***/ }),
28083/* 89 */
28084/***/ (function(module, exports, __webpack_require__) {
28085
28086__webpack_require__(90);
28087module.exports = __webpack_require__(210);
28088
28089
28090/***/ }),
28091/* 90 */
28092/***/ (function(module, exports, __webpack_require__) {
28093
28094"use strict";
28095
28096
28097var _react = __webpack_require__(14);
28098
28099var _react2 = _interopRequireDefault(_react);
28100
28101var _reactDom = __webpack_require__(105);
28102
28103var _reactDom2 = _interopRequireDefault(_reactDom);
28104
28105var _App = __webpack_require__(191);
28106
28107var _App2 = _interopRequireDefault(_App);
28108
28109function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
28110
28111_reactDom2.default.render(_react2.default.createElement(_App2.default, null), document.getElementById('react'));
28112
28113/***/ }),
28114/* 91 */
28115/***/ (function(module, exports, __webpack_require__) {
28116
28117"use strict";
28118/**
28119 * Copyright 2013-present, Facebook, Inc.
28120 * All rights reserved.
28121 *
28122 * This source code is licensed under the BSD-style license found in the
28123 * LICENSE file in the root directory of this source tree. An additional grant
28124 * of patent rights can be found in the PATENTS file in the same directory.
28125 *
28126 */
28127
28128
28129
28130var PooledClass = __webpack_require__(92);
28131var ReactElement = __webpack_require__(15);
28132
28133var emptyFunction = __webpack_require__(8);
28134var traverseAllChildren = __webpack_require__(93);
28135
28136var twoArgumentPooler = PooledClass.twoArgumentPooler;
28137var fourArgumentPooler = PooledClass.fourArgumentPooler;
28138
28139var userProvidedKeyEscapeRegex = /\/+/g;
28140function escapeUserProvidedKey(text) {
28141 return ('' + text).replace(userProvidedKeyEscapeRegex, '$&/');
28142}
28143
28144/**
28145 * PooledClass representing the bookkeeping associated with performing a child
28146 * traversal. Allows avoiding binding callbacks.
28147 *
28148 * @constructor ForEachBookKeeping
28149 * @param {!function} forEachFunction Function to perform traversal with.
28150 * @param {?*} forEachContext Context to perform context with.
28151 */
28152function ForEachBookKeeping(forEachFunction, forEachContext) {
28153 this.func = forEachFunction;
28154 this.context = forEachContext;
28155 this.count = 0;
28156}
28157ForEachBookKeeping.prototype.destructor = function () {
28158 this.func = null;
28159 this.context = null;
28160 this.count = 0;
28161};
28162PooledClass.addPoolingTo(ForEachBookKeeping, twoArgumentPooler);
28163
28164function forEachSingleChild(bookKeeping, child, name) {
28165 var func = bookKeeping.func,
28166 context = bookKeeping.context;
28167
28168 func.call(context, child, bookKeeping.count++);
28169}
28170
28171/**
28172 * Iterates through children that are typically specified as `props.children`.
28173 *
28174 * See https://facebook.github.io/react/docs/top-level-api.html#react.children.foreach
28175 *
28176 * The provided forEachFunc(child, index) will be called for each
28177 * leaf child.
28178 *
28179 * @param {?*} children Children tree container.
28180 * @param {function(*, int)} forEachFunc
28181 * @param {*} forEachContext Context for forEachContext.
28182 */
28183function forEachChildren(children, forEachFunc, forEachContext) {
28184 if (children == null) {
28185 return children;
28186 }
28187 var traverseContext = ForEachBookKeeping.getPooled(forEachFunc, forEachContext);
28188 traverseAllChildren(children, forEachSingleChild, traverseContext);
28189 ForEachBookKeeping.release(traverseContext);
28190}
28191
28192/**
28193 * PooledClass representing the bookkeeping associated with performing a child
28194 * mapping. Allows avoiding binding callbacks.
28195 *
28196 * @constructor MapBookKeeping
28197 * @param {!*} mapResult Object containing the ordered map of results.
28198 * @param {!function} mapFunction Function to perform mapping with.
28199 * @param {?*} mapContext Context to perform mapping with.
28200 */
28201function MapBookKeeping(mapResult, keyPrefix, mapFunction, mapContext) {
28202 this.result = mapResult;
28203 this.keyPrefix = keyPrefix;
28204 this.func = mapFunction;
28205 this.context = mapContext;
28206 this.count = 0;
28207}
28208MapBookKeeping.prototype.destructor = function () {
28209 this.result = null;
28210 this.keyPrefix = null;
28211 this.func = null;
28212 this.context = null;
28213 this.count = 0;
28214};
28215PooledClass.addPoolingTo(MapBookKeeping, fourArgumentPooler);
28216
28217function mapSingleChildIntoContext(bookKeeping, child, childKey) {
28218 var result = bookKeeping.result,
28219 keyPrefix = bookKeeping.keyPrefix,
28220 func = bookKeeping.func,
28221 context = bookKeeping.context;
28222
28223
28224 var mappedChild = func.call(context, child, bookKeeping.count++);
28225 if (Array.isArray(mappedChild)) {
28226 mapIntoWithKeyPrefixInternal(mappedChild, result, childKey, emptyFunction.thatReturnsArgument);
28227 } else if (mappedChild != null) {
28228 if (ReactElement.isValidElement(mappedChild)) {
28229 mappedChild = ReactElement.cloneAndReplaceKey(mappedChild,
28230 // Keep both the (mapped) and old keys if they differ, just as
28231 // traverseAllChildren used to do for objects as children
28232 keyPrefix + (mappedChild.key && (!child || child.key !== mappedChild.key) ? escapeUserProvidedKey(mappedChild.key) + '/' : '') + childKey);
28233 }
28234 result.push(mappedChild);
28235 }
28236}
28237
28238function mapIntoWithKeyPrefixInternal(children, array, prefix, func, context) {
28239 var escapedPrefix = '';
28240 if (prefix != null) {
28241 escapedPrefix = escapeUserProvidedKey(prefix) + '/';
28242 }
28243 var traverseContext = MapBookKeeping.getPooled(array, escapedPrefix, func, context);
28244 traverseAllChildren(children, mapSingleChildIntoContext, traverseContext);
28245 MapBookKeeping.release(traverseContext);
28246}
28247
28248/**
28249 * Maps children that are typically specified as `props.children`.
28250 *
28251 * See https://facebook.github.io/react/docs/top-level-api.html#react.children.map
28252 *
28253 * The provided mapFunction(child, key, index) will be called for each
28254 * leaf child.
28255 *
28256 * @param {?*} children Children tree container.
28257 * @param {function(*, int)} func The map function.
28258 * @param {*} context Context for mapFunction.
28259 * @return {object} Object containing the ordered map of results.
28260 */
28261function mapChildren(children, func, context) {
28262 if (children == null) {
28263 return children;
28264 }
28265 var result = [];
28266 mapIntoWithKeyPrefixInternal(children, result, null, func, context);
28267 return result;
28268}
28269
28270function forEachSingleChildDummy(traverseContext, child, name) {
28271 return null;
28272}
28273
28274/**
28275 * Count the number of children that are typically specified as
28276 * `props.children`.
28277 *
28278 * See https://facebook.github.io/react/docs/top-level-api.html#react.children.count
28279 *
28280 * @param {?*} children Children tree container.
28281 * @return {number} The number of children.
28282 */
28283function countChildren(children, context) {
28284 return traverseAllChildren(children, forEachSingleChildDummy, null);
28285}
28286
28287/**
28288 * Flatten a children object (typically specified as `props.children`) and
28289 * return an array with appropriately re-keyed children.
28290 *
28291 * See https://facebook.github.io/react/docs/top-level-api.html#react.children.toarray
28292 */
28293function toArray(children) {
28294 var result = [];
28295 mapIntoWithKeyPrefixInternal(children, result, null, emptyFunction.thatReturnsArgument);
28296 return result;
28297}
28298
28299var ReactChildren = {
28300 forEach: forEachChildren,
28301 map: mapChildren,
28302 mapIntoWithKeyPrefixInternal: mapIntoWithKeyPrefixInternal,
28303 count: countChildren,
28304 toArray: toArray
28305};
28306
28307module.exports = ReactChildren;
28308
28309/***/ }),
28310/* 92 */
28311/***/ (function(module, exports, __webpack_require__) {
28312
28313"use strict";
28314/* WEBPACK VAR INJECTION */(function(process) {/**
28315 * Copyright 2013-present, Facebook, Inc.
28316 * All rights reserved.
28317 *
28318 * This source code is licensed under the BSD-style license found in the
28319 * LICENSE file in the root directory of this source tree. An additional grant
28320 * of patent rights can be found in the PATENTS file in the same directory.
28321 *
28322 *
28323 */
28324
28325
28326
28327var _prodInvariant = __webpack_require__(18);
28328
28329var invariant = __webpack_require__(1);
28330
28331/**
28332 * Static poolers. Several custom versions for each potential number of
28333 * arguments. A completely generic pooler is easy to implement, but would
28334 * require accessing the `arguments` object. In each of these, `this` refers to
28335 * the Class itself, not an instance. If any others are needed, simply add them
28336 * here, or in their own files.
28337 */
28338var oneArgumentPooler = function (copyFieldsFrom) {
28339 var Klass = this;
28340 if (Klass.instancePool.length) {
28341 var instance = Klass.instancePool.pop();
28342 Klass.call(instance, copyFieldsFrom);
28343 return instance;
28344 } else {
28345 return new Klass(copyFieldsFrom);
28346 }
28347};
28348
28349var twoArgumentPooler = function (a1, a2) {
28350 var Klass = this;
28351 if (Klass.instancePool.length) {
28352 var instance = Klass.instancePool.pop();
28353 Klass.call(instance, a1, a2);
28354 return instance;
28355 } else {
28356 return new Klass(a1, a2);
28357 }
28358};
28359
28360var threeArgumentPooler = function (a1, a2, a3) {
28361 var Klass = this;
28362 if (Klass.instancePool.length) {
28363 var instance = Klass.instancePool.pop();
28364 Klass.call(instance, a1, a2, a3);
28365 return instance;
28366 } else {
28367 return new Klass(a1, a2, a3);
28368 }
28369};
28370
28371var fourArgumentPooler = function (a1, a2, a3, a4) {
28372 var Klass = this;
28373 if (Klass.instancePool.length) {
28374 var instance = Klass.instancePool.pop();
28375 Klass.call(instance, a1, a2, a3, a4);
28376 return instance;
28377 } else {
28378 return new Klass(a1, a2, a3, a4);
28379 }
28380};
28381
28382var standardReleaser = function (instance) {
28383 var Klass = this;
28384 !(instance instanceof Klass) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Trying to release an instance into a pool of a different type.') : _prodInvariant('25') : void 0;
28385 instance.destructor();
28386 if (Klass.instancePool.length < Klass.poolSize) {
28387 Klass.instancePool.push(instance);
28388 }
28389};
28390
28391var DEFAULT_POOL_SIZE = 10;
28392var DEFAULT_POOLER = oneArgumentPooler;
28393
28394/**
28395 * Augments `CopyConstructor` to be a poolable class, augmenting only the class
28396 * itself (statically) not adding any prototypical fields. Any CopyConstructor
28397 * you give this may have a `poolSize` property, and will look for a
28398 * prototypical `destructor` on instances.
28399 *
28400 * @param {Function} CopyConstructor Constructor that can be used to reset.
28401 * @param {Function} pooler Customizable pooler.
28402 */
28403var addPoolingTo = function (CopyConstructor, pooler) {
28404 // Casting as any so that flow ignores the actual implementation and trusts
28405 // it to match the type we declared
28406 var NewKlass = CopyConstructor;
28407 NewKlass.instancePool = [];
28408 NewKlass.getPooled = pooler || DEFAULT_POOLER;
28409 if (!NewKlass.poolSize) {
28410 NewKlass.poolSize = DEFAULT_POOL_SIZE;
28411 }
28412 NewKlass.release = standardReleaser;
28413 return NewKlass;
28414};
28415
28416var PooledClass = {
28417 addPoolingTo: addPoolingTo,
28418 oneArgumentPooler: oneArgumentPooler,
28419 twoArgumentPooler: twoArgumentPooler,
28420 threeArgumentPooler: threeArgumentPooler,
28421 fourArgumentPooler: fourArgumentPooler
28422};
28423
28424module.exports = PooledClass;
28425/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
28426
28427/***/ }),
28428/* 93 */
28429/***/ (function(module, exports, __webpack_require__) {
28430
28431"use strict";
28432/* WEBPACK VAR INJECTION */(function(process) {/**
28433 * Copyright 2013-present, Facebook, Inc.
28434 * All rights reserved.
28435 *
28436 * This source code is licensed under the BSD-style license found in the
28437 * LICENSE file in the root directory of this source tree. An additional grant
28438 * of patent rights can be found in the PATENTS file in the same directory.
28439 *
28440 */
28441
28442
28443
28444var _prodInvariant = __webpack_require__(18);
28445
28446var ReactCurrentOwner = __webpack_require__(10);
28447var REACT_ELEMENT_TYPE = __webpack_require__(59);
28448
28449var getIteratorFn = __webpack_require__(60);
28450var invariant = __webpack_require__(1);
28451var KeyEscapeUtils = __webpack_require__(94);
28452var warning = __webpack_require__(2);
28453
28454var SEPARATOR = '.';
28455var SUBSEPARATOR = ':';
28456
28457/**
28458 * This is inlined from ReactElement since this file is shared between
28459 * isomorphic and renderers. We could extract this to a
28460 *
28461 */
28462
28463/**
28464 * TODO: Test that a single child and an array with one item have the same key
28465 * pattern.
28466 */
28467
28468var didWarnAboutMaps = false;
28469
28470/**
28471 * Generate a key string that identifies a component within a set.
28472 *
28473 * @param {*} component A component that could contain a manual key.
28474 * @param {number} index Index that is used if a manual key is not provided.
28475 * @return {string}
28476 */
28477function getComponentKey(component, index) {
28478 // Do some typechecking here since we call this blindly. We want to ensure
28479 // that we don't block potential future ES APIs.
28480 if (component && typeof component === 'object' && component.key != null) {
28481 // Explicit key
28482 return KeyEscapeUtils.escape(component.key);
28483 }
28484 // Implicit key determined by the index in the set
28485 return index.toString(36);
28486}
28487
28488/**
28489 * @param {?*} children Children tree container.
28490 * @param {!string} nameSoFar Name of the key path so far.
28491 * @param {!function} callback Callback to invoke with each child found.
28492 * @param {?*} traverseContext Used to pass information throughout the traversal
28493 * process.
28494 * @return {!number} The number of children in this subtree.
28495 */
28496function traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext) {
28497 var type = typeof children;
28498
28499 if (type === 'undefined' || type === 'boolean') {
28500 // All of the above are perceived as null.
28501 children = null;
28502 }
28503
28504 if (children === null || type === 'string' || type === 'number' ||
28505 // The following is inlined from ReactElement. This means we can optimize
28506 // some checks. React Fiber also inlines this logic for similar purposes.
28507 type === 'object' && children.$$typeof === REACT_ELEMENT_TYPE) {
28508 callback(traverseContext, children,
28509 // If it's the only child, treat the name as if it was wrapped in an array
28510 // so that it's consistent if the number of children grows.
28511 nameSoFar === '' ? SEPARATOR + getComponentKey(children, 0) : nameSoFar);
28512 return 1;
28513 }
28514
28515 var child;
28516 var nextName;
28517 var subtreeCount = 0; // Count of children found in the current subtree.
28518 var nextNamePrefix = nameSoFar === '' ? SEPARATOR : nameSoFar + SUBSEPARATOR;
28519
28520 if (Array.isArray(children)) {
28521 for (var i = 0; i < children.length; i++) {
28522 child = children[i];
28523 nextName = nextNamePrefix + getComponentKey(child, i);
28524 subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
28525 }
28526 } else {
28527 var iteratorFn = getIteratorFn(children);
28528 if (iteratorFn) {
28529 var iterator = iteratorFn.call(children);
28530 var step;
28531 if (iteratorFn !== children.entries) {
28532 var ii = 0;
28533 while (!(step = iterator.next()).done) {
28534 child = step.value;
28535 nextName = nextNamePrefix + getComponentKey(child, ii++);
28536 subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
28537 }
28538 } else {
28539 if (process.env.NODE_ENV !== 'production') {
28540 var mapsAsChildrenAddendum = '';
28541 if (ReactCurrentOwner.current) {
28542 var mapsAsChildrenOwnerName = ReactCurrentOwner.current.getName();
28543 if (mapsAsChildrenOwnerName) {
28544 mapsAsChildrenAddendum = ' Check the render method of `' + mapsAsChildrenOwnerName + '`.';
28545 }
28546 }
28547 process.env.NODE_ENV !== 'production' ? warning(didWarnAboutMaps, 'Using Maps as children is not yet fully supported. It is an ' + 'experimental feature that might be removed. Convert it to a ' + 'sequence / iterable of keyed ReactElements instead.%s', mapsAsChildrenAddendum) : void 0;
28548 didWarnAboutMaps = true;
28549 }
28550 // Iterator will provide entry [k,v] tuples rather than values.
28551 while (!(step = iterator.next()).done) {
28552 var entry = step.value;
28553 if (entry) {
28554 child = entry[1];
28555 nextName = nextNamePrefix + KeyEscapeUtils.escape(entry[0]) + SUBSEPARATOR + getComponentKey(child, 0);
28556 subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
28557 }
28558 }
28559 }
28560 } else if (type === 'object') {
28561 var addendum = '';
28562 if (process.env.NODE_ENV !== 'production') {
28563 addendum = ' If you meant to render a collection of children, use an array ' + 'instead or wrap the object using createFragment(object) from the ' + 'React add-ons.';
28564 if (children._isReactElement) {
28565 addendum = " It looks like you're using an element created by a different " + 'version of React. Make sure to use only one copy of React.';
28566 }
28567 if (ReactCurrentOwner.current) {
28568 var name = ReactCurrentOwner.current.getName();
28569 if (name) {
28570 addendum += ' Check the render method of `' + name + '`.';
28571 }
28572 }
28573 }
28574 var childrenString = String(children);
28575 true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Objects are not valid as a React child (found: %s).%s', childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString, addendum) : _prodInvariant('31', childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString, addendum) : void 0;
28576 }
28577 }
28578
28579 return subtreeCount;
28580}
28581
28582/**
28583 * Traverses children that are typically specified as `props.children`, but
28584 * might also be specified through attributes:
28585 *
28586 * - `traverseAllChildren(this.props.children, ...)`
28587 * - `traverseAllChildren(this.props.leftPanelChildren, ...)`
28588 *
28589 * The `traverseContext` is an optional argument that is passed through the
28590 * entire traversal. It can be used to store accumulations or anything else that
28591 * the callback might find relevant.
28592 *
28593 * @param {?*} children Children tree object.
28594 * @param {!function} callback To invoke upon traversing each child.
28595 * @param {?*} traverseContext Context for traversal.
28596 * @return {!number} The number of children in this subtree.
28597 */
28598function traverseAllChildren(children, callback, traverseContext) {
28599 if (children == null) {
28600 return 0;
28601 }
28602
28603 return traverseAllChildrenImpl(children, '', callback, traverseContext);
28604}
28605
28606module.exports = traverseAllChildren;
28607/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
28608
28609/***/ }),
28610/* 94 */
28611/***/ (function(module, exports, __webpack_require__) {
28612
28613"use strict";
28614/**
28615 * Copyright 2013-present, Facebook, Inc.
28616 * All rights reserved.
28617 *
28618 * This source code is licensed under the BSD-style license found in the
28619 * LICENSE file in the root directory of this source tree. An additional grant
28620 * of patent rights can be found in the PATENTS file in the same directory.
28621 *
28622 *
28623 */
28624
28625
28626
28627/**
28628 * Escape and wrap key so it is safe to use as a reactid
28629 *
28630 * @param {string} key to be escaped.
28631 * @return {string} the escaped key.
28632 */
28633
28634function escape(key) {
28635 var escapeRegex = /[=:]/g;
28636 var escaperLookup = {
28637 '=': '=0',
28638 ':': '=2'
28639 };
28640 var escapedString = ('' + key).replace(escapeRegex, function (match) {
28641 return escaperLookup[match];
28642 });
28643
28644 return '$' + escapedString;
28645}
28646
28647/**
28648 * Unescape and unwrap key for human-readable display
28649 *
28650 * @param {string} key to unescape.
28651 * @return {string} the unescaped key.
28652 */
28653function unescape(key) {
28654 var unescapeRegex = /(=0|=2)/g;
28655 var unescaperLookup = {
28656 '=0': '=',
28657 '=2': ':'
28658 };
28659 var keySubstring = key[0] === '.' && key[1] === '$' ? key.substring(2) : key.substring(1);
28660
28661 return ('' + keySubstring).replace(unescapeRegex, function (match) {
28662 return unescaperLookup[match];
28663 });
28664}
28665
28666var KeyEscapeUtils = {
28667 escape: escape,
28668 unescape: unescape
28669};
28670
28671module.exports = KeyEscapeUtils;
28672
28673/***/ }),
28674/* 95 */
28675/***/ (function(module, exports, __webpack_require__) {
28676
28677"use strict";
28678/* WEBPACK VAR INJECTION */(function(process) {/**
28679 * Copyright 2013-present, Facebook, Inc.
28680 * All rights reserved.
28681 *
28682 * This source code is licensed under the BSD-style license found in the
28683 * LICENSE file in the root directory of this source tree. An additional grant
28684 * of patent rights can be found in the PATENTS file in the same directory.
28685 *
28686 */
28687
28688
28689
28690var ReactElement = __webpack_require__(15);
28691
28692/**
28693 * Create a factory that creates HTML tag elements.
28694 *
28695 * @private
28696 */
28697var createDOMFactory = ReactElement.createFactory;
28698if (process.env.NODE_ENV !== 'production') {
28699 var ReactElementValidator = __webpack_require__(61);
28700 createDOMFactory = ReactElementValidator.createFactory;
28701}
28702
28703/**
28704 * Creates a mapping from supported HTML tags to `ReactDOMComponent` classes.
28705 *
28706 * @public
28707 */
28708var ReactDOMFactories = {
28709 a: createDOMFactory('a'),
28710 abbr: createDOMFactory('abbr'),
28711 address: createDOMFactory('address'),
28712 area: createDOMFactory('area'),
28713 article: createDOMFactory('article'),
28714 aside: createDOMFactory('aside'),
28715 audio: createDOMFactory('audio'),
28716 b: createDOMFactory('b'),
28717 base: createDOMFactory('base'),
28718 bdi: createDOMFactory('bdi'),
28719 bdo: createDOMFactory('bdo'),
28720 big: createDOMFactory('big'),
28721 blockquote: createDOMFactory('blockquote'),
28722 body: createDOMFactory('body'),
28723 br: createDOMFactory('br'),
28724 button: createDOMFactory('button'),
28725 canvas: createDOMFactory('canvas'),
28726 caption: createDOMFactory('caption'),
28727 cite: createDOMFactory('cite'),
28728 code: createDOMFactory('code'),
28729 col: createDOMFactory('col'),
28730 colgroup: createDOMFactory('colgroup'),
28731 data: createDOMFactory('data'),
28732 datalist: createDOMFactory('datalist'),
28733 dd: createDOMFactory('dd'),
28734 del: createDOMFactory('del'),
28735 details: createDOMFactory('details'),
28736 dfn: createDOMFactory('dfn'),
28737 dialog: createDOMFactory('dialog'),
28738 div: createDOMFactory('div'),
28739 dl: createDOMFactory('dl'),
28740 dt: createDOMFactory('dt'),
28741 em: createDOMFactory('em'),
28742 embed: createDOMFactory('embed'),
28743 fieldset: createDOMFactory('fieldset'),
28744 figcaption: createDOMFactory('figcaption'),
28745 figure: createDOMFactory('figure'),
28746 footer: createDOMFactory('footer'),
28747 form: createDOMFactory('form'),
28748 h1: createDOMFactory('h1'),
28749 h2: createDOMFactory('h2'),
28750 h3: createDOMFactory('h3'),
28751 h4: createDOMFactory('h4'),
28752 h5: createDOMFactory('h5'),
28753 h6: createDOMFactory('h6'),
28754 head: createDOMFactory('head'),
28755 header: createDOMFactory('header'),
28756 hgroup: createDOMFactory('hgroup'),
28757 hr: createDOMFactory('hr'),
28758 html: createDOMFactory('html'),
28759 i: createDOMFactory('i'),
28760 iframe: createDOMFactory('iframe'),
28761 img: createDOMFactory('img'),
28762 input: createDOMFactory('input'),
28763 ins: createDOMFactory('ins'),
28764 kbd: createDOMFactory('kbd'),
28765 keygen: createDOMFactory('keygen'),
28766 label: createDOMFactory('label'),
28767 legend: createDOMFactory('legend'),
28768 li: createDOMFactory('li'),
28769 link: createDOMFactory('link'),
28770 main: createDOMFactory('main'),
28771 map: createDOMFactory('map'),
28772 mark: createDOMFactory('mark'),
28773 menu: createDOMFactory('menu'),
28774 menuitem: createDOMFactory('menuitem'),
28775 meta: createDOMFactory('meta'),
28776 meter: createDOMFactory('meter'),
28777 nav: createDOMFactory('nav'),
28778 noscript: createDOMFactory('noscript'),
28779 object: createDOMFactory('object'),
28780 ol: createDOMFactory('ol'),
28781 optgroup: createDOMFactory('optgroup'),
28782 option: createDOMFactory('option'),
28783 output: createDOMFactory('output'),
28784 p: createDOMFactory('p'),
28785 param: createDOMFactory('param'),
28786 picture: createDOMFactory('picture'),
28787 pre: createDOMFactory('pre'),
28788 progress: createDOMFactory('progress'),
28789 q: createDOMFactory('q'),
28790 rp: createDOMFactory('rp'),
28791 rt: createDOMFactory('rt'),
28792 ruby: createDOMFactory('ruby'),
28793 s: createDOMFactory('s'),
28794 samp: createDOMFactory('samp'),
28795 script: createDOMFactory('script'),
28796 section: createDOMFactory('section'),
28797 select: createDOMFactory('select'),
28798 small: createDOMFactory('small'),
28799 source: createDOMFactory('source'),
28800 span: createDOMFactory('span'),
28801 strong: createDOMFactory('strong'),
28802 style: createDOMFactory('style'),
28803 sub: createDOMFactory('sub'),
28804 summary: createDOMFactory('summary'),
28805 sup: createDOMFactory('sup'),
28806 table: createDOMFactory('table'),
28807 tbody: createDOMFactory('tbody'),
28808 td: createDOMFactory('td'),
28809 textarea: createDOMFactory('textarea'),
28810 tfoot: createDOMFactory('tfoot'),
28811 th: createDOMFactory('th'),
28812 thead: createDOMFactory('thead'),
28813 time: createDOMFactory('time'),
28814 title: createDOMFactory('title'),
28815 tr: createDOMFactory('tr'),
28816 track: createDOMFactory('track'),
28817 u: createDOMFactory('u'),
28818 ul: createDOMFactory('ul'),
28819 'var': createDOMFactory('var'),
28820 video: createDOMFactory('video'),
28821 wbr: createDOMFactory('wbr'),
28822
28823 // SVG
28824 circle: createDOMFactory('circle'),
28825 clipPath: createDOMFactory('clipPath'),
28826 defs: createDOMFactory('defs'),
28827 ellipse: createDOMFactory('ellipse'),
28828 g: createDOMFactory('g'),
28829 image: createDOMFactory('image'),
28830 line: createDOMFactory('line'),
28831 linearGradient: createDOMFactory('linearGradient'),
28832 mask: createDOMFactory('mask'),
28833 path: createDOMFactory('path'),
28834 pattern: createDOMFactory('pattern'),
28835 polygon: createDOMFactory('polygon'),
28836 polyline: createDOMFactory('polyline'),
28837 radialGradient: createDOMFactory('radialGradient'),
28838 rect: createDOMFactory('rect'),
28839 stop: createDOMFactory('stop'),
28840 svg: createDOMFactory('svg'),
28841 text: createDOMFactory('text'),
28842 tspan: createDOMFactory('tspan')
28843};
28844
28845module.exports = ReactDOMFactories;
28846/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
28847
28848/***/ }),
28849/* 96 */
28850/***/ (function(module, exports, __webpack_require__) {
28851
28852"use strict";
28853/* WEBPACK VAR INJECTION */(function(process) {/**
28854 * Copyright 2013-present, Facebook, Inc.
28855 * All rights reserved.
28856 *
28857 * This source code is licensed under the BSD-style license found in the
28858 * LICENSE file in the root directory of this source tree. An additional grant
28859 * of patent rights can be found in the PATENTS file in the same directory.
28860 *
28861 */
28862
28863
28864
28865var _prodInvariant = __webpack_require__(18);
28866
28867var ReactPropTypeLocationNames = __webpack_require__(97);
28868var ReactPropTypesSecret = __webpack_require__(98);
28869
28870var invariant = __webpack_require__(1);
28871var warning = __webpack_require__(2);
28872
28873var ReactComponentTreeHook;
28874
28875if (typeof process !== 'undefined' && process.env && process.env.NODE_ENV === 'test') {
28876 // Temporary hack.
28877 // Inline requires don't work well with Jest:
28878 // https://github.com/facebook/react/issues/7240
28879 // Remove the inline requires when we don't need them anymore:
28880 // https://github.com/facebook/react/pull/7178
28881 ReactComponentTreeHook = __webpack_require__(7);
28882}
28883
28884var loggedTypeFailures = {};
28885
28886/**
28887 * Assert that the values match with the type specs.
28888 * Error messages are memorized and will only be shown once.
28889 *
28890 * @param {object} typeSpecs Map of name to a ReactPropType
28891 * @param {object} values Runtime values that need to be type-checked
28892 * @param {string} location e.g. "prop", "context", "child context"
28893 * @param {string} componentName Name of the component for error messages.
28894 * @param {?object} element The React element that is being type-checked
28895 * @param {?number} debugID The React component instance that is being type-checked
28896 * @private
28897 */
28898function checkReactTypeSpec(typeSpecs, values, location, componentName, element, debugID) {
28899 for (var typeSpecName in typeSpecs) {
28900 if (typeSpecs.hasOwnProperty(typeSpecName)) {
28901 var error;
28902 // Prop type validation may throw. In case they do, we don't want to
28903 // fail the render phase where it didn't fail before. So we log it.
28904 // After these have been cleaned up, we'll let them throw.
28905 try {
28906 // This is intentionally an invariant that gets caught. It's the same
28907 // behavior as without this statement except with a better message.
28908 !(typeof typeSpecs[typeSpecName] === 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, '%s: %s type `%s` is invalid; it must be a function, usually from React.PropTypes.', componentName || 'React class', ReactPropTypeLocationNames[location], typeSpecName) : _prodInvariant('84', componentName || 'React class', ReactPropTypeLocationNames[location], typeSpecName) : void 0;
28909 error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
28910 } catch (ex) {
28911 error = ex;
28912 }
28913 process.env.NODE_ENV !== 'production' ? warning(!error || error instanceof Error, '%s: type specification of %s `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', ReactPropTypeLocationNames[location], typeSpecName, typeof error) : void 0;
28914 if (error instanceof Error && !(error.message in loggedTypeFailures)) {
28915 // Only monitor this failure once because there tends to be a lot of the
28916 // same error.
28917 loggedTypeFailures[error.message] = true;
28918
28919 var componentStackInfo = '';
28920
28921 if (process.env.NODE_ENV !== 'production') {
28922 if (!ReactComponentTreeHook) {
28923 ReactComponentTreeHook = __webpack_require__(7);
28924 }
28925 if (debugID !== null) {
28926 componentStackInfo = ReactComponentTreeHook.getStackAddendumByID(debugID);
28927 } else if (element !== null) {
28928 componentStackInfo = ReactComponentTreeHook.getCurrentStackAddendum(element);
28929 }
28930 }
28931
28932 process.env.NODE_ENV !== 'production' ? warning(false, 'Failed %s type: %s%s', location, error.message, componentStackInfo) : void 0;
28933 }
28934 }
28935 }
28936}
28937
28938module.exports = checkReactTypeSpec;
28939/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
28940
28941/***/ }),
28942/* 97 */
28943/***/ (function(module, exports, __webpack_require__) {
28944
28945"use strict";
28946/* WEBPACK VAR INJECTION */(function(process) {/**
28947 * Copyright 2013-present, Facebook, Inc.
28948 * All rights reserved.
28949 *
28950 * This source code is licensed under the BSD-style license found in the
28951 * LICENSE file in the root directory of this source tree. An additional grant
28952 * of patent rights can be found in the PATENTS file in the same directory.
28953 *
28954 *
28955 */
28956
28957
28958
28959var ReactPropTypeLocationNames = {};
28960
28961if (process.env.NODE_ENV !== 'production') {
28962 ReactPropTypeLocationNames = {
28963 prop: 'prop',
28964 context: 'context',
28965 childContext: 'child context'
28966 };
28967}
28968
28969module.exports = ReactPropTypeLocationNames;
28970/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
28971
28972/***/ }),
28973/* 98 */
28974/***/ (function(module, exports, __webpack_require__) {
28975
28976"use strict";
28977/**
28978 * Copyright 2013-present, Facebook, Inc.
28979 * All rights reserved.
28980 *
28981 * This source code is licensed under the BSD-style license found in the
28982 * LICENSE file in the root directory of this source tree. An additional grant
28983 * of patent rights can be found in the PATENTS file in the same directory.
28984 *
28985 *
28986 */
28987
28988
28989
28990var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
28991
28992module.exports = ReactPropTypesSecret;
28993
28994/***/ }),
28995/* 99 */
28996/***/ (function(module, exports, __webpack_require__) {
28997
28998"use strict";
28999/**
29000 * Copyright 2013-present, Facebook, Inc.
29001 * All rights reserved.
29002 *
29003 * This source code is licensed under the BSD-style license found in the
29004 * LICENSE file in the root directory of this source tree. An additional grant
29005 * of patent rights can be found in the PATENTS file in the same directory.
29006 *
29007 */
29008
29009
29010
29011var _require = __webpack_require__(15),
29012 isValidElement = _require.isValidElement;
29013
29014var factory = __webpack_require__(62);
29015
29016module.exports = factory(isValidElement);
29017
29018/***/ }),
29019/* 100 */
29020/***/ (function(module, exports, __webpack_require__) {
29021
29022"use strict";
29023/* WEBPACK VAR INJECTION */(function(process) {/**
29024 * Copyright 2013-present, Facebook, Inc.
29025 * All rights reserved.
29026 *
29027 * This source code is licensed under the BSD-style license found in the
29028 * LICENSE file in the root directory of this source tree. An additional grant
29029 * of patent rights can be found in the PATENTS file in the same directory.
29030 */
29031
29032
29033
29034if (process.env.NODE_ENV !== 'production') {
29035 var invariant = __webpack_require__(1);
29036 var warning = __webpack_require__(2);
29037 var ReactPropTypesSecret = __webpack_require__(37);
29038 var loggedTypeFailures = {};
29039}
29040
29041/**
29042 * Assert that the values match with the type specs.
29043 * Error messages are memorized and will only be shown once.
29044 *
29045 * @param {object} typeSpecs Map of name to a ReactPropType
29046 * @param {object} values Runtime values that need to be type-checked
29047 * @param {string} location e.g. "prop", "context", "child context"
29048 * @param {string} componentName Name of the component for error messages.
29049 * @param {?Function} getStack Returns the component stack.
29050 * @private
29051 */
29052function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
29053 if (process.env.NODE_ENV !== 'production') {
29054 for (var typeSpecName in typeSpecs) {
29055 if (typeSpecs.hasOwnProperty(typeSpecName)) {
29056 var error;
29057 // Prop type validation may throw. In case they do, we don't want to
29058 // fail the render phase where it didn't fail before. So we log it.
29059 // After these have been cleaned up, we'll let them throw.
29060 try {
29061 // This is intentionally an invariant that gets caught. It's the same
29062 // behavior as without this statement except with a better message.
29063 invariant(typeof typeSpecs[typeSpecName] === 'function', '%s: %s type `%s` is invalid; it must be a function, usually from ' + 'React.PropTypes.', componentName || 'React class', location, typeSpecName);
29064 error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
29065 } catch (ex) {
29066 error = ex;
29067 }
29068 warning(!error || error instanceof Error, '%s: type specification of %s `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error);
29069 if (error instanceof Error && !(error.message in loggedTypeFailures)) {
29070 // Only monitor this failure once because there tends to be a lot of the
29071 // same error.
29072 loggedTypeFailures[error.message] = true;
29073
29074 var stack = getStack ? getStack() : '';
29075
29076 warning(false, 'Failed %s type: %s%s', location, error.message, stack != null ? stack : '');
29077 }
29078 }
29079 }
29080 }
29081}
29082
29083module.exports = checkPropTypes;
29084
29085/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
29086
29087/***/ }),
29088/* 101 */
29089/***/ (function(module, exports, __webpack_require__) {
29090
29091"use strict";
29092/**
29093 * Copyright 2013-present, Facebook, Inc.
29094 * All rights reserved.
29095 *
29096 * This source code is licensed under the BSD-style license found in the
29097 * LICENSE file in the root directory of this source tree. An additional grant
29098 * of patent rights can be found in the PATENTS file in the same directory.
29099 *
29100 */
29101
29102
29103
29104module.exports = '15.6.1';
29105
29106/***/ }),
29107/* 102 */
29108/***/ (function(module, exports, __webpack_require__) {
29109
29110"use strict";
29111/**
29112 * Copyright 2013-present, Facebook, Inc.
29113 * All rights reserved.
29114 *
29115 * This source code is licensed under the BSD-style license found in the
29116 * LICENSE file in the root directory of this source tree. An additional grant
29117 * of patent rights can be found in the PATENTS file in the same directory.
29118 *
29119 */
29120
29121
29122
29123var _require = __webpack_require__(57),
29124 Component = _require.Component;
29125
29126var _require2 = __webpack_require__(15),
29127 isValidElement = _require2.isValidElement;
29128
29129var ReactNoopUpdateQueue = __webpack_require__(58);
29130var factory = __webpack_require__(103);
29131
29132module.exports = factory(Component, isValidElement, ReactNoopUpdateQueue);
29133
29134/***/ }),
29135/* 103 */
29136/***/ (function(module, exports, __webpack_require__) {
29137
29138"use strict";
29139/* WEBPACK VAR INJECTION */(function(process) {/**
29140 * Copyright 2013-present, Facebook, Inc.
29141 * All rights reserved.
29142 *
29143 * This source code is licensed under the BSD-style license found in the
29144 * LICENSE file in the root directory of this source tree. An additional grant
29145 * of patent rights can be found in the PATENTS file in the same directory.
29146 *
29147 */
29148
29149
29150
29151var _assign = __webpack_require__(4);
29152
29153var emptyObject = __webpack_require__(27);
29154var _invariant = __webpack_require__(1);
29155
29156if (process.env.NODE_ENV !== 'production') {
29157 var warning = __webpack_require__(2);
29158}
29159
29160var MIXINS_KEY = 'mixins';
29161
29162// Helper function to allow the creation of anonymous functions which do not
29163// have .name set to the name of the variable being assigned to.
29164function identity(fn) {
29165 return fn;
29166}
29167
29168var ReactPropTypeLocationNames;
29169if (process.env.NODE_ENV !== 'production') {
29170 ReactPropTypeLocationNames = {
29171 prop: 'prop',
29172 context: 'context',
29173 childContext: 'child context'
29174 };
29175} else {
29176 ReactPropTypeLocationNames = {};
29177}
29178
29179function factory(ReactComponent, isValidElement, ReactNoopUpdateQueue) {
29180 /**
29181 * Policies that describe methods in `ReactClassInterface`.
29182 */
29183
29184 var injectedMixins = [];
29185
29186 /**
29187 * Composite components are higher-level components that compose other composite
29188 * or host components.
29189 *
29190 * To create a new type of `ReactClass`, pass a specification of
29191 * your new class to `React.createClass`. The only requirement of your class
29192 * specification is that you implement a `render` method.
29193 *
29194 * var MyComponent = React.createClass({
29195 * render: function() {
29196 * return <div>Hello World</div>;
29197 * }
29198 * });
29199 *
29200 * The class specification supports a specific protocol of methods that have
29201 * special meaning (e.g. `render`). See `ReactClassInterface` for
29202 * more the comprehensive protocol. Any other properties and methods in the
29203 * class specification will be available on the prototype.
29204 *
29205 * @interface ReactClassInterface
29206 * @internal
29207 */
29208 var ReactClassInterface = {
29209 /**
29210 * An array of Mixin objects to include when defining your component.
29211 *
29212 * @type {array}
29213 * @optional
29214 */
29215 mixins: 'DEFINE_MANY',
29216
29217 /**
29218 * An object containing properties and methods that should be defined on
29219 * the component's constructor instead of its prototype (static methods).
29220 *
29221 * @type {object}
29222 * @optional
29223 */
29224 statics: 'DEFINE_MANY',
29225
29226 /**
29227 * Definition of prop types for this component.
29228 *
29229 * @type {object}
29230 * @optional
29231 */
29232 propTypes: 'DEFINE_MANY',
29233
29234 /**
29235 * Definition of context types for this component.
29236 *
29237 * @type {object}
29238 * @optional
29239 */
29240 contextTypes: 'DEFINE_MANY',
29241
29242 /**
29243 * Definition of context types this component sets for its children.
29244 *
29245 * @type {object}
29246 * @optional
29247 */
29248 childContextTypes: 'DEFINE_MANY',
29249
29250 // ==== Definition methods ====
29251
29252 /**
29253 * Invoked when the component is mounted. Values in the mapping will be set on
29254 * `this.props` if that prop is not specified (i.e. using an `in` check).
29255 *
29256 * This method is invoked before `getInitialState` and therefore cannot rely
29257 * on `this.state` or use `this.setState`.
29258 *
29259 * @return {object}
29260 * @optional
29261 */
29262 getDefaultProps: 'DEFINE_MANY_MERGED',
29263
29264 /**
29265 * Invoked once before the component is mounted. The return value will be used
29266 * as the initial value of `this.state`.
29267 *
29268 * getInitialState: function() {
29269 * return {
29270 * isOn: false,
29271 * fooBaz: new BazFoo()
29272 * }
29273 * }
29274 *
29275 * @return {object}
29276 * @optional
29277 */
29278 getInitialState: 'DEFINE_MANY_MERGED',
29279
29280 /**
29281 * @return {object}
29282 * @optional
29283 */
29284 getChildContext: 'DEFINE_MANY_MERGED',
29285
29286 /**
29287 * Uses props from `this.props` and state from `this.state` to render the
29288 * structure of the component.
29289 *
29290 * No guarantees are made about when or how often this method is invoked, so
29291 * it must not have side effects.
29292 *
29293 * render: function() {
29294 * var name = this.props.name;
29295 * return <div>Hello, {name}!</div>;
29296 * }
29297 *
29298 * @return {ReactComponent}
29299 * @required
29300 */
29301 render: 'DEFINE_ONCE',
29302
29303 // ==== Delegate methods ====
29304
29305 /**
29306 * Invoked when the component is initially created and about to be mounted.
29307 * This may have side effects, but any external subscriptions or data created
29308 * by this method must be cleaned up in `componentWillUnmount`.
29309 *
29310 * @optional
29311 */
29312 componentWillMount: 'DEFINE_MANY',
29313
29314 /**
29315 * Invoked when the component has been mounted and has a DOM representation.
29316 * However, there is no guarantee that the DOM node is in the document.
29317 *
29318 * Use this as an opportunity to operate on the DOM when the component has
29319 * been mounted (initialized and rendered) for the first time.
29320 *
29321 * @param {DOMElement} rootNode DOM element representing the component.
29322 * @optional
29323 */
29324 componentDidMount: 'DEFINE_MANY',
29325
29326 /**
29327 * Invoked before the component receives new props.
29328 *
29329 * Use this as an opportunity to react to a prop transition by updating the
29330 * state using `this.setState`. Current props are accessed via `this.props`.
29331 *
29332 * componentWillReceiveProps: function(nextProps, nextContext) {
29333 * this.setState({
29334 * likesIncreasing: nextProps.likeCount > this.props.likeCount
29335 * });
29336 * }
29337 *
29338 * NOTE: There is no equivalent `componentWillReceiveState`. An incoming prop
29339 * transition may cause a state change, but the opposite is not true. If you
29340 * need it, you are probably looking for `componentWillUpdate`.
29341 *
29342 * @param {object} nextProps
29343 * @optional
29344 */
29345 componentWillReceiveProps: 'DEFINE_MANY',
29346
29347 /**
29348 * Invoked while deciding if the component should be updated as a result of
29349 * receiving new props, state and/or context.
29350 *
29351 * Use this as an opportunity to `return false` when you're certain that the
29352 * transition to the new props/state/context will not require a component
29353 * update.
29354 *
29355 * shouldComponentUpdate: function(nextProps, nextState, nextContext) {
29356 * return !equal(nextProps, this.props) ||
29357 * !equal(nextState, this.state) ||
29358 * !equal(nextContext, this.context);
29359 * }
29360 *
29361 * @param {object} nextProps
29362 * @param {?object} nextState
29363 * @param {?object} nextContext
29364 * @return {boolean} True if the component should update.
29365 * @optional
29366 */
29367 shouldComponentUpdate: 'DEFINE_ONCE',
29368
29369 /**
29370 * Invoked when the component is about to update due to a transition from
29371 * `this.props`, `this.state` and `this.context` to `nextProps`, `nextState`
29372 * and `nextContext`.
29373 *
29374 * Use this as an opportunity to perform preparation before an update occurs.
29375 *
29376 * NOTE: You **cannot** use `this.setState()` in this method.
29377 *
29378 * @param {object} nextProps
29379 * @param {?object} nextState
29380 * @param {?object} nextContext
29381 * @param {ReactReconcileTransaction} transaction
29382 * @optional
29383 */
29384 componentWillUpdate: 'DEFINE_MANY',
29385
29386 /**
29387 * Invoked when the component's DOM representation has been updated.
29388 *
29389 * Use this as an opportunity to operate on the DOM when the component has
29390 * been updated.
29391 *
29392 * @param {object} prevProps
29393 * @param {?object} prevState
29394 * @param {?object} prevContext
29395 * @param {DOMElement} rootNode DOM element representing the component.
29396 * @optional
29397 */
29398 componentDidUpdate: 'DEFINE_MANY',
29399
29400 /**
29401 * Invoked when the component is about to be removed from its parent and have
29402 * its DOM representation destroyed.
29403 *
29404 * Use this as an opportunity to deallocate any external resources.
29405 *
29406 * NOTE: There is no `componentDidUnmount` since your component will have been
29407 * destroyed by that point.
29408 *
29409 * @optional
29410 */
29411 componentWillUnmount: 'DEFINE_MANY',
29412
29413 // ==== Advanced methods ====
29414
29415 /**
29416 * Updates the component's currently mounted DOM representation.
29417 *
29418 * By default, this implements React's rendering and reconciliation algorithm.
29419 * Sophisticated clients may wish to override this.
29420 *
29421 * @param {ReactReconcileTransaction} transaction
29422 * @internal
29423 * @overridable
29424 */
29425 updateComponent: 'OVERRIDE_BASE'
29426 };
29427
29428 /**
29429 * Mapping from class specification keys to special processing functions.
29430 *
29431 * Although these are declared like instance properties in the specification
29432 * when defining classes using `React.createClass`, they are actually static
29433 * and are accessible on the constructor instead of the prototype. Despite
29434 * being static, they must be defined outside of the "statics" key under
29435 * which all other static methods are defined.
29436 */
29437 var RESERVED_SPEC_KEYS = {
29438 displayName: function(Constructor, displayName) {
29439 Constructor.displayName = displayName;
29440 },
29441 mixins: function(Constructor, mixins) {
29442 if (mixins) {
29443 for (var i = 0; i < mixins.length; i++) {
29444 mixSpecIntoComponent(Constructor, mixins[i]);
29445 }
29446 }
29447 },
29448 childContextTypes: function(Constructor, childContextTypes) {
29449 if (process.env.NODE_ENV !== 'production') {
29450 validateTypeDef(Constructor, childContextTypes, 'childContext');
29451 }
29452 Constructor.childContextTypes = _assign(
29453 {},
29454 Constructor.childContextTypes,
29455 childContextTypes
29456 );
29457 },
29458 contextTypes: function(Constructor, contextTypes) {
29459 if (process.env.NODE_ENV !== 'production') {
29460 validateTypeDef(Constructor, contextTypes, 'context');
29461 }
29462 Constructor.contextTypes = _assign(
29463 {},
29464 Constructor.contextTypes,
29465 contextTypes
29466 );
29467 },
29468 /**
29469 * Special case getDefaultProps which should move into statics but requires
29470 * automatic merging.
29471 */
29472 getDefaultProps: function(Constructor, getDefaultProps) {
29473 if (Constructor.getDefaultProps) {
29474 Constructor.getDefaultProps = createMergedResultFunction(
29475 Constructor.getDefaultProps,
29476 getDefaultProps
29477 );
29478 } else {
29479 Constructor.getDefaultProps = getDefaultProps;
29480 }
29481 },
29482 propTypes: function(Constructor, propTypes) {
29483 if (process.env.NODE_ENV !== 'production') {
29484 validateTypeDef(Constructor, propTypes, 'prop');
29485 }
29486 Constructor.propTypes = _assign({}, Constructor.propTypes, propTypes);
29487 },
29488 statics: function(Constructor, statics) {
29489 mixStaticSpecIntoComponent(Constructor, statics);
29490 },
29491 autobind: function() {}
29492 };
29493
29494 function validateTypeDef(Constructor, typeDef, location) {
29495 for (var propName in typeDef) {
29496 if (typeDef.hasOwnProperty(propName)) {
29497 // use a warning instead of an _invariant so components
29498 // don't show up in prod but only in __DEV__
29499 if (process.env.NODE_ENV !== 'production') {
29500 warning(
29501 typeof typeDef[propName] === 'function',
29502 '%s: %s type `%s` is invalid; it must be a function, usually from ' +
29503 'React.PropTypes.',
29504 Constructor.displayName || 'ReactClass',
29505 ReactPropTypeLocationNames[location],
29506 propName
29507 );
29508 }
29509 }
29510 }
29511 }
29512
29513 function validateMethodOverride(isAlreadyDefined, name) {
29514 var specPolicy = ReactClassInterface.hasOwnProperty(name)
29515 ? ReactClassInterface[name]
29516 : null;
29517
29518 // Disallow overriding of base class methods unless explicitly allowed.
29519 if (ReactClassMixin.hasOwnProperty(name)) {
29520 _invariant(
29521 specPolicy === 'OVERRIDE_BASE',
29522 'ReactClassInterface: You are attempting to override ' +
29523 '`%s` from your class specification. Ensure that your method names ' +
29524 'do not overlap with React methods.',
29525 name
29526 );
29527 }
29528
29529 // Disallow defining methods more than once unless explicitly allowed.
29530 if (isAlreadyDefined) {
29531 _invariant(
29532 specPolicy === 'DEFINE_MANY' || specPolicy === 'DEFINE_MANY_MERGED',
29533 'ReactClassInterface: You are attempting to define ' +
29534 '`%s` on your component more than once. This conflict may be due ' +
29535 'to a mixin.',
29536 name
29537 );
29538 }
29539 }
29540
29541 /**
29542 * Mixin helper which handles policy validation and reserved
29543 * specification keys when building React classes.
29544 */
29545 function mixSpecIntoComponent(Constructor, spec) {
29546 if (!spec) {
29547 if (process.env.NODE_ENV !== 'production') {
29548 var typeofSpec = typeof spec;
29549 var isMixinValid = typeofSpec === 'object' && spec !== null;
29550
29551 if (process.env.NODE_ENV !== 'production') {
29552 warning(
29553 isMixinValid,
29554 "%s: You're attempting to include a mixin that is either null " +
29555 'or not an object. Check the mixins included by the component, ' +
29556 'as well as any mixins they include themselves. ' +
29557 'Expected object but got %s.',
29558 Constructor.displayName || 'ReactClass',
29559 spec === null ? null : typeofSpec
29560 );
29561 }
29562 }
29563
29564 return;
29565 }
29566
29567 _invariant(
29568 typeof spec !== 'function',
29569 "ReactClass: You're attempting to " +
29570 'use a component class or function as a mixin. Instead, just use a ' +
29571 'regular object.'
29572 );
29573 _invariant(
29574 !isValidElement(spec),
29575 "ReactClass: You're attempting to " +
29576 'use a component as a mixin. Instead, just use a regular object.'
29577 );
29578
29579 var proto = Constructor.prototype;
29580 var autoBindPairs = proto.__reactAutoBindPairs;
29581
29582 // By handling mixins before any other properties, we ensure the same
29583 // chaining order is applied to methods with DEFINE_MANY policy, whether
29584 // mixins are listed before or after these methods in the spec.
29585 if (spec.hasOwnProperty(MIXINS_KEY)) {
29586 RESERVED_SPEC_KEYS.mixins(Constructor, spec.mixins);
29587 }
29588
29589 for (var name in spec) {
29590 if (!spec.hasOwnProperty(name)) {
29591 continue;
29592 }
29593
29594 if (name === MIXINS_KEY) {
29595 // We have already handled mixins in a special case above.
29596 continue;
29597 }
29598
29599 var property = spec[name];
29600 var isAlreadyDefined = proto.hasOwnProperty(name);
29601 validateMethodOverride(isAlreadyDefined, name);
29602
29603 if (RESERVED_SPEC_KEYS.hasOwnProperty(name)) {
29604 RESERVED_SPEC_KEYS[name](Constructor, property);
29605 } else {
29606 // Setup methods on prototype:
29607 // The following member methods should not be automatically bound:
29608 // 1. Expected ReactClass methods (in the "interface").
29609 // 2. Overridden methods (that were mixed in).
29610 var isReactClassMethod = ReactClassInterface.hasOwnProperty(name);
29611 var isFunction = typeof property === 'function';
29612 var shouldAutoBind =
29613 isFunction &&
29614 !isReactClassMethod &&
29615 !isAlreadyDefined &&
29616 spec.autobind !== false;
29617
29618 if (shouldAutoBind) {
29619 autoBindPairs.push(name, property);
29620 proto[name] = property;
29621 } else {
29622 if (isAlreadyDefined) {
29623 var specPolicy = ReactClassInterface[name];
29624
29625 // These cases should already be caught by validateMethodOverride.
29626 _invariant(
29627 isReactClassMethod &&
29628 (specPolicy === 'DEFINE_MANY_MERGED' ||
29629 specPolicy === 'DEFINE_MANY'),
29630 'ReactClass: Unexpected spec policy %s for key %s ' +
29631 'when mixing in component specs.',
29632 specPolicy,
29633 name
29634 );
29635
29636 // For methods which are defined more than once, call the existing
29637 // methods before calling the new property, merging if appropriate.
29638 if (specPolicy === 'DEFINE_MANY_MERGED') {
29639 proto[name] = createMergedResultFunction(proto[name], property);
29640 } else if (specPolicy === 'DEFINE_MANY') {
29641 proto[name] = createChainedFunction(proto[name], property);
29642 }
29643 } else {
29644 proto[name] = property;
29645 if (process.env.NODE_ENV !== 'production') {
29646 // Add verbose displayName to the function, which helps when looking
29647 // at profiling tools.
29648 if (typeof property === 'function' && spec.displayName) {
29649 proto[name].displayName = spec.displayName + '_' + name;
29650 }
29651 }
29652 }
29653 }
29654 }
29655 }
29656 }
29657
29658 function mixStaticSpecIntoComponent(Constructor, statics) {
29659 if (!statics) {
29660 return;
29661 }
29662 for (var name in statics) {
29663 var property = statics[name];
29664 if (!statics.hasOwnProperty(name)) {
29665 continue;
29666 }
29667
29668 var isReserved = name in RESERVED_SPEC_KEYS;
29669 _invariant(
29670 !isReserved,
29671 'ReactClass: You are attempting to define a reserved ' +
29672 'property, `%s`, that shouldn\'t be on the "statics" key. Define it ' +
29673 'as an instance property instead; it will still be accessible on the ' +
29674 'constructor.',
29675 name
29676 );
29677
29678 var isInherited = name in Constructor;
29679 _invariant(
29680 !isInherited,
29681 'ReactClass: You are attempting to define ' +
29682 '`%s` on your component more than once. This conflict may be ' +
29683 'due to a mixin.',
29684 name
29685 );
29686 Constructor[name] = property;
29687 }
29688 }
29689
29690 /**
29691 * Merge two objects, but throw if both contain the same key.
29692 *
29693 * @param {object} one The first object, which is mutated.
29694 * @param {object} two The second object
29695 * @return {object} one after it has been mutated to contain everything in two.
29696 */
29697 function mergeIntoWithNoDuplicateKeys(one, two) {
29698 _invariant(
29699 one && two && typeof one === 'object' && typeof two === 'object',
29700 'mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects.'
29701 );
29702
29703 for (var key in two) {
29704 if (two.hasOwnProperty(key)) {
29705 _invariant(
29706 one[key] === undefined,
29707 'mergeIntoWithNoDuplicateKeys(): ' +
29708 'Tried to merge two objects with the same key: `%s`. This conflict ' +
29709 'may be due to a mixin; in particular, this may be caused by two ' +
29710 'getInitialState() or getDefaultProps() methods returning objects ' +
29711 'with clashing keys.',
29712 key
29713 );
29714 one[key] = two[key];
29715 }
29716 }
29717 return one;
29718 }
29719
29720 /**
29721 * Creates a function that invokes two functions and merges their return values.
29722 *
29723 * @param {function} one Function to invoke first.
29724 * @param {function} two Function to invoke second.
29725 * @return {function} Function that invokes the two argument functions.
29726 * @private
29727 */
29728 function createMergedResultFunction(one, two) {
29729 return function mergedResult() {
29730 var a = one.apply(this, arguments);
29731 var b = two.apply(this, arguments);
29732 if (a == null) {
29733 return b;
29734 } else if (b == null) {
29735 return a;
29736 }
29737 var c = {};
29738 mergeIntoWithNoDuplicateKeys(c, a);
29739 mergeIntoWithNoDuplicateKeys(c, b);
29740 return c;
29741 };
29742 }
29743
29744 /**
29745 * Creates a function that invokes two functions and ignores their return vales.
29746 *
29747 * @param {function} one Function to invoke first.
29748 * @param {function} two Function to invoke second.
29749 * @return {function} Function that invokes the two argument functions.
29750 * @private
29751 */
29752 function createChainedFunction(one, two) {
29753 return function chainedFunction() {
29754 one.apply(this, arguments);
29755 two.apply(this, arguments);
29756 };
29757 }
29758
29759 /**
29760 * Binds a method to the component.
29761 *
29762 * @param {object} component Component whose method is going to be bound.
29763 * @param {function} method Method to be bound.
29764 * @return {function} The bound method.
29765 */
29766 function bindAutoBindMethod(component, method) {
29767 var boundMethod = method.bind(component);
29768 if (process.env.NODE_ENV !== 'production') {
29769 boundMethod.__reactBoundContext = component;
29770 boundMethod.__reactBoundMethod = method;
29771 boundMethod.__reactBoundArguments = null;
29772 var componentName = component.constructor.displayName;
29773 var _bind = boundMethod.bind;
29774 boundMethod.bind = function(newThis) {
29775 for (
29776 var _len = arguments.length,
29777 args = Array(_len > 1 ? _len - 1 : 0),
29778 _key = 1;
29779 _key < _len;
29780 _key++
29781 ) {
29782 args[_key - 1] = arguments[_key];
29783 }
29784
29785 // User is trying to bind() an autobound method; we effectively will
29786 // ignore the value of "this" that the user is trying to use, so
29787 // let's warn.
29788 if (newThis !== component && newThis !== null) {
29789 if (process.env.NODE_ENV !== 'production') {
29790 warning(
29791 false,
29792 'bind(): React component methods may only be bound to the ' +
29793 'component instance. See %s',
29794 componentName
29795 );
29796 }
29797 } else if (!args.length) {
29798 if (process.env.NODE_ENV !== 'production') {
29799 warning(
29800 false,
29801 'bind(): You are binding a component method to the component. ' +
29802 'React does this for you automatically in a high-performance ' +
29803 'way, so you can safely remove this call. See %s',
29804 componentName
29805 );
29806 }
29807 return boundMethod;
29808 }
29809 var reboundMethod = _bind.apply(boundMethod, arguments);
29810 reboundMethod.__reactBoundContext = component;
29811 reboundMethod.__reactBoundMethod = method;
29812 reboundMethod.__reactBoundArguments = args;
29813 return reboundMethod;
29814 };
29815 }
29816 return boundMethod;
29817 }
29818
29819 /**
29820 * Binds all auto-bound methods in a component.
29821 *
29822 * @param {object} component Component whose method is going to be bound.
29823 */
29824 function bindAutoBindMethods(component) {
29825 var pairs = component.__reactAutoBindPairs;
29826 for (var i = 0; i < pairs.length; i += 2) {
29827 var autoBindKey = pairs[i];
29828 var method = pairs[i + 1];
29829 component[autoBindKey] = bindAutoBindMethod(component, method);
29830 }
29831 }
29832
29833 var IsMountedPreMixin = {
29834 componentDidMount: function() {
29835 this.__isMounted = true;
29836 }
29837 };
29838
29839 var IsMountedPostMixin = {
29840 componentWillUnmount: function() {
29841 this.__isMounted = false;
29842 }
29843 };
29844
29845 /**
29846 * Add more to the ReactClass base class. These are all legacy features and
29847 * therefore not already part of the modern ReactComponent.
29848 */
29849 var ReactClassMixin = {
29850 /**
29851 * TODO: This will be deprecated because state should always keep a consistent
29852 * type signature and the only use case for this, is to avoid that.
29853 */
29854 replaceState: function(newState, callback) {
29855 this.updater.enqueueReplaceState(this, newState, callback);
29856 },
29857
29858 /**
29859 * Checks whether or not this composite component is mounted.
29860 * @return {boolean} True if mounted, false otherwise.
29861 * @protected
29862 * @final
29863 */
29864 isMounted: function() {
29865 if (process.env.NODE_ENV !== 'production') {
29866 warning(
29867 this.__didWarnIsMounted,
29868 '%s: isMounted is deprecated. Instead, make sure to clean up ' +
29869 'subscriptions and pending requests in componentWillUnmount to ' +
29870 'prevent memory leaks.',
29871 (this.constructor && this.constructor.displayName) ||
29872 this.name ||
29873 'Component'
29874 );
29875 this.__didWarnIsMounted = true;
29876 }
29877 return !!this.__isMounted;
29878 }
29879 };
29880
29881 var ReactClassComponent = function() {};
29882 _assign(
29883 ReactClassComponent.prototype,
29884 ReactComponent.prototype,
29885 ReactClassMixin
29886 );
29887
29888 /**
29889 * Creates a composite component class given a class specification.
29890 * See https://facebook.github.io/react/docs/top-level-api.html#react.createclass
29891 *
29892 * @param {object} spec Class specification (which must define `render`).
29893 * @return {function} Component constructor function.
29894 * @public
29895 */
29896 function createClass(spec) {
29897 // To keep our warnings more understandable, we'll use a little hack here to
29898 // ensure that Constructor.name !== 'Constructor'. This makes sure we don't
29899 // unnecessarily identify a class without displayName as 'Constructor'.
29900 var Constructor = identity(function(props, context, updater) {
29901 // This constructor gets overridden by mocks. The argument is used
29902 // by mocks to assert on what gets mounted.
29903
29904 if (process.env.NODE_ENV !== 'production') {
29905 warning(
29906 this instanceof Constructor,
29907 'Something is calling a React component directly. Use a factory or ' +
29908 'JSX instead. See: https://fb.me/react-legacyfactory'
29909 );
29910 }
29911
29912 // Wire up auto-binding
29913 if (this.__reactAutoBindPairs.length) {
29914 bindAutoBindMethods(this);
29915 }
29916
29917 this.props = props;
29918 this.context = context;
29919 this.refs = emptyObject;
29920 this.updater = updater || ReactNoopUpdateQueue;
29921
29922 this.state = null;
29923
29924 // ReactClasses doesn't have constructors. Instead, they use the
29925 // getInitialState and componentWillMount methods for initialization.
29926
29927 var initialState = this.getInitialState ? this.getInitialState() : null;
29928 if (process.env.NODE_ENV !== 'production') {
29929 // We allow auto-mocks to proceed as if they're returning null.
29930 if (
29931 initialState === undefined &&
29932 this.getInitialState._isMockFunction
29933 ) {
29934 // This is probably bad practice. Consider warning here and
29935 // deprecating this convenience.
29936 initialState = null;
29937 }
29938 }
29939 _invariant(
29940 typeof initialState === 'object' && !Array.isArray(initialState),
29941 '%s.getInitialState(): must return an object or null',
29942 Constructor.displayName || 'ReactCompositeComponent'
29943 );
29944
29945 this.state = initialState;
29946 });
29947 Constructor.prototype = new ReactClassComponent();
29948 Constructor.prototype.constructor = Constructor;
29949 Constructor.prototype.__reactAutoBindPairs = [];
29950
29951 injectedMixins.forEach(mixSpecIntoComponent.bind(null, Constructor));
29952
29953 mixSpecIntoComponent(Constructor, IsMountedPreMixin);
29954 mixSpecIntoComponent(Constructor, spec);
29955 mixSpecIntoComponent(Constructor, IsMountedPostMixin);
29956
29957 // Initialize the defaultProps property after all mixins have been merged.
29958 if (Constructor.getDefaultProps) {
29959 Constructor.defaultProps = Constructor.getDefaultProps();
29960 }
29961
29962 if (process.env.NODE_ENV !== 'production') {
29963 // This is a tag to indicate that the use of these method names is ok,
29964 // since it's used with createClass. If it's not, then it's likely a
29965 // mistake so we'll warn you to use the static property, property
29966 // initializer or constructor respectively.
29967 if (Constructor.getDefaultProps) {
29968 Constructor.getDefaultProps.isReactClassApproved = {};
29969 }
29970 if (Constructor.prototype.getInitialState) {
29971 Constructor.prototype.getInitialState.isReactClassApproved = {};
29972 }
29973 }
29974
29975 _invariant(
29976 Constructor.prototype.render,
29977 'createClass(...): Class specification must implement a `render` method.'
29978 );
29979
29980 if (process.env.NODE_ENV !== 'production') {
29981 warning(
29982 !Constructor.prototype.componentShouldUpdate,
29983 '%s has a method called ' +
29984 'componentShouldUpdate(). Did you mean shouldComponentUpdate()? ' +
29985 'The name is phrased as a question because the function is ' +
29986 'expected to return a value.',
29987 spec.displayName || 'A component'
29988 );
29989 warning(
29990 !Constructor.prototype.componentWillRecieveProps,
29991 '%s has a method called ' +
29992 'componentWillRecieveProps(). Did you mean componentWillReceiveProps()?',
29993 spec.displayName || 'A component'
29994 );
29995 }
29996
29997 // Reduce time spent doing lookups by setting these on the prototype.
29998 for (var methodName in ReactClassInterface) {
29999 if (!Constructor.prototype[methodName]) {
30000 Constructor.prototype[methodName] = null;
30001 }
30002 }
30003
30004 return Constructor;
30005 }
30006
30007 return createClass;
30008}
30009
30010module.exports = factory;
30011
30012/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
30013
30014/***/ }),
30015/* 104 */
30016/***/ (function(module, exports, __webpack_require__) {
30017
30018"use strict";
30019/* WEBPACK VAR INJECTION */(function(process) {/**
30020 * Copyright 2013-present, Facebook, Inc.
30021 * All rights reserved.
30022 *
30023 * This source code is licensed under the BSD-style license found in the
30024 * LICENSE file in the root directory of this source tree. An additional grant
30025 * of patent rights can be found in the PATENTS file in the same directory.
30026 *
30027 */
30028
30029
30030var _prodInvariant = __webpack_require__(18);
30031
30032var ReactElement = __webpack_require__(15);
30033
30034var invariant = __webpack_require__(1);
30035
30036/**
30037 * Returns the first child in a collection of children and verifies that there
30038 * is only one child in the collection.
30039 *
30040 * See https://facebook.github.io/react/docs/top-level-api.html#react.children.only
30041 *
30042 * The current implementation of this function assumes that a single child gets
30043 * passed without a wrapper, but the purpose of this helper function is to
30044 * abstract away the particular structure of children.
30045 *
30046 * @param {?object} children Child collection structure.
30047 * @return {ReactElement} The first and only `ReactElement` contained in the
30048 * structure.
30049 */
30050function onlyChild(children) {
30051 !ReactElement.isValidElement(children) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'React.Children.only expected to receive a single React element child.') : _prodInvariant('143') : void 0;
30052 return children;
30053}
30054
30055module.exports = onlyChild;
30056/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
30057
30058/***/ }),
30059/* 105 */
30060/***/ (function(module, exports, __webpack_require__) {
30061
30062"use strict";
30063
30064
30065module.exports = __webpack_require__(106);
30066
30067
30068/***/ }),
30069/* 106 */
30070/***/ (function(module, exports, __webpack_require__) {
30071
30072"use strict";
30073/* WEBPACK VAR INJECTION */(function(process) {/**
30074 * Copyright 2013-present, Facebook, Inc.
30075 * All rights reserved.
30076 *
30077 * This source code is licensed under the BSD-style license found in the
30078 * LICENSE file in the root directory of this source tree. An additional grant
30079 * of patent rights can be found in the PATENTS file in the same directory.
30080 *
30081 */
30082
30083/* globals __REACT_DEVTOOLS_GLOBAL_HOOK__*/
30084
30085
30086
30087var ReactDOMComponentTree = __webpack_require__(5);
30088var ReactDefaultInjection = __webpack_require__(107);
30089var ReactMount = __webpack_require__(87);
30090var ReactReconciler = __webpack_require__(19);
30091var ReactUpdates = __webpack_require__(11);
30092var ReactVersion = __webpack_require__(185);
30093
30094var findDOMNode = __webpack_require__(186);
30095var getHostComponentFromComposite = __webpack_require__(88);
30096var renderSubtreeIntoContainer = __webpack_require__(187);
30097var warning = __webpack_require__(2);
30098
30099ReactDefaultInjection.inject();
30100
30101var ReactDOM = {
30102 findDOMNode: findDOMNode,
30103 render: ReactMount.render,
30104 unmountComponentAtNode: ReactMount.unmountComponentAtNode,
30105 version: ReactVersion,
30106
30107 /* eslint-disable camelcase */
30108 unstable_batchedUpdates: ReactUpdates.batchedUpdates,
30109 unstable_renderSubtreeIntoContainer: renderSubtreeIntoContainer
30110 /* eslint-enable camelcase */
30111};
30112
30113// Inject the runtime into a devtools global hook regardless of browser.
30114// Allows for debugging when the hook is injected on the page.
30115if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.inject === 'function') {
30116 __REACT_DEVTOOLS_GLOBAL_HOOK__.inject({
30117 ComponentTree: {
30118 getClosestInstanceFromNode: ReactDOMComponentTree.getClosestInstanceFromNode,
30119 getNodeFromInstance: function (inst) {
30120 // inst is an internal instance (but could be a composite)
30121 if (inst._renderedComponent) {
30122 inst = getHostComponentFromComposite(inst);
30123 }
30124 if (inst) {
30125 return ReactDOMComponentTree.getNodeFromInstance(inst);
30126 } else {
30127 return null;
30128 }
30129 }
30130 },
30131 Mount: ReactMount,
30132 Reconciler: ReactReconciler
30133 });
30134}
30135
30136if (process.env.NODE_ENV !== 'production') {
30137 var ExecutionEnvironment = __webpack_require__(6);
30138 if (ExecutionEnvironment.canUseDOM && window.top === window.self) {
30139 // First check if devtools is not installed
30140 if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined') {
30141 // If we're in Chrome or Firefox, provide a download link if not installed.
30142 if (navigator.userAgent.indexOf('Chrome') > -1 && navigator.userAgent.indexOf('Edge') === -1 || navigator.userAgent.indexOf('Firefox') > -1) {
30143 // Firefox does not have the issue with devtools loaded over file://
30144 var showFileUrlMessage = window.location.protocol.indexOf('http') === -1 && navigator.userAgent.indexOf('Firefox') === -1;
30145 console.debug('Download the React DevTools ' + (showFileUrlMessage ? 'and use an HTTP server (instead of a file: URL) ' : '') + 'for a better development experience: ' + 'https://fb.me/react-devtools');
30146 }
30147 }
30148
30149 var testFunc = function testFn() {};
30150 process.env.NODE_ENV !== 'production' ? warning((testFunc.name || testFunc.toString()).indexOf('testFn') !== -1, "It looks like you're using a minified copy of the development build " + 'of React. When deploying React apps to production, make sure to use ' + 'the production build which skips development warnings and is faster. ' + 'See https://fb.me/react-minification for more details.') : void 0;
30151
30152 // If we're in IE8, check to see if we are in compatibility mode and provide
30153 // information on preventing compatibility mode
30154 var ieCompatibilityMode = document.documentMode && document.documentMode < 8;
30155
30156 process.env.NODE_ENV !== 'production' ? warning(!ieCompatibilityMode, 'Internet Explorer is running in compatibility mode; please add the ' + 'following tag to your HTML to prevent this from happening: ' + '<meta http-equiv="X-UA-Compatible" content="IE=edge" />') : void 0;
30157
30158 var expectedFeatures = [
30159 // shims
30160 Array.isArray, Array.prototype.every, Array.prototype.forEach, Array.prototype.indexOf, Array.prototype.map, Date.now, Function.prototype.bind, Object.keys, String.prototype.trim];
30161
30162 for (var i = 0; i < expectedFeatures.length; i++) {
30163 if (!expectedFeatures[i]) {
30164 process.env.NODE_ENV !== 'production' ? warning(false, 'One or more ES5 shims expected by React are not available: ' + 'https://fb.me/react-warning-polyfills') : void 0;
30165 break;
30166 }
30167 }
30168 }
30169}
30170
30171if (process.env.NODE_ENV !== 'production') {
30172 var ReactInstrumentation = __webpack_require__(9);
30173 var ReactDOMUnknownPropertyHook = __webpack_require__(188);
30174 var ReactDOMNullInputValuePropHook = __webpack_require__(189);
30175 var ReactDOMInvalidARIAHook = __webpack_require__(190);
30176
30177 ReactInstrumentation.debugTool.addHook(ReactDOMUnknownPropertyHook);
30178 ReactInstrumentation.debugTool.addHook(ReactDOMNullInputValuePropHook);
30179 ReactInstrumentation.debugTool.addHook(ReactDOMInvalidARIAHook);
30180}
30181
30182module.exports = ReactDOM;
30183/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
30184
30185/***/ }),
30186/* 107 */
30187/***/ (function(module, exports, __webpack_require__) {
30188
30189"use strict";
30190/**
30191 * Copyright 2013-present, Facebook, Inc.
30192 * All rights reserved.
30193 *
30194 * This source code is licensed under the BSD-style license found in the
30195 * LICENSE file in the root directory of this source tree. An additional grant
30196 * of patent rights can be found in the PATENTS file in the same directory.
30197 *
30198 */
30199
30200
30201
30202var ARIADOMPropertyConfig = __webpack_require__(108);
30203var BeforeInputEventPlugin = __webpack_require__(109);
30204var ChangeEventPlugin = __webpack_require__(113);
30205var DefaultEventPluginOrder = __webpack_require__(121);
30206var EnterLeaveEventPlugin = __webpack_require__(122);
30207var HTMLDOMPropertyConfig = __webpack_require__(123);
30208var ReactComponentBrowserEnvironment = __webpack_require__(124);
30209var ReactDOMComponent = __webpack_require__(130);
30210var ReactDOMComponentTree = __webpack_require__(5);
30211var ReactDOMEmptyComponent = __webpack_require__(156);
30212var ReactDOMTreeTraversal = __webpack_require__(157);
30213var ReactDOMTextComponent = __webpack_require__(158);
30214var ReactDefaultBatchingStrategy = __webpack_require__(159);
30215var ReactEventListener = __webpack_require__(160);
30216var ReactInjection = __webpack_require__(162);
30217var ReactReconcileTransaction = __webpack_require__(163);
30218var SVGDOMPropertyConfig = __webpack_require__(169);
30219var SelectEventPlugin = __webpack_require__(170);
30220var SimpleEventPlugin = __webpack_require__(171);
30221
30222var alreadyInjected = false;
30223
30224function inject() {
30225 if (alreadyInjected) {
30226 // TODO: This is currently true because these injections are shared between
30227 // the client and the server package. They should be built independently
30228 // and not share any injection state. Then this problem will be solved.
30229 return;
30230 }
30231 alreadyInjected = true;
30232
30233 ReactInjection.EventEmitter.injectReactEventListener(ReactEventListener);
30234
30235 /**
30236 * Inject modules for resolving DOM hierarchy and plugin ordering.
30237 */
30238 ReactInjection.EventPluginHub.injectEventPluginOrder(DefaultEventPluginOrder);
30239 ReactInjection.EventPluginUtils.injectComponentTree(ReactDOMComponentTree);
30240 ReactInjection.EventPluginUtils.injectTreeTraversal(ReactDOMTreeTraversal);
30241
30242 /**
30243 * Some important event plugins included by default (without having to require
30244 * them).
30245 */
30246 ReactInjection.EventPluginHub.injectEventPluginsByName({
30247 SimpleEventPlugin: SimpleEventPlugin,
30248 EnterLeaveEventPlugin: EnterLeaveEventPlugin,
30249 ChangeEventPlugin: ChangeEventPlugin,
30250 SelectEventPlugin: SelectEventPlugin,
30251 BeforeInputEventPlugin: BeforeInputEventPlugin
30252 });
30253
30254 ReactInjection.HostComponent.injectGenericComponentClass(ReactDOMComponent);
30255
30256 ReactInjection.HostComponent.injectTextComponentClass(ReactDOMTextComponent);
30257
30258 ReactInjection.DOMProperty.injectDOMPropertyConfig(ARIADOMPropertyConfig);
30259 ReactInjection.DOMProperty.injectDOMPropertyConfig(HTMLDOMPropertyConfig);
30260 ReactInjection.DOMProperty.injectDOMPropertyConfig(SVGDOMPropertyConfig);
30261
30262 ReactInjection.EmptyComponent.injectEmptyComponentFactory(function (instantiate) {
30263 return new ReactDOMEmptyComponent(instantiate);
30264 });
30265
30266 ReactInjection.Updates.injectReconcileTransaction(ReactReconcileTransaction);
30267 ReactInjection.Updates.injectBatchingStrategy(ReactDefaultBatchingStrategy);
30268
30269 ReactInjection.Component.injectEnvironment(ReactComponentBrowserEnvironment);
30270}
30271
30272module.exports = {
30273 inject: inject
30274};
30275
30276/***/ }),
30277/* 108 */
30278/***/ (function(module, exports, __webpack_require__) {
30279
30280"use strict";
30281/**
30282 * Copyright 2013-present, Facebook, Inc.
30283 * All rights reserved.
30284 *
30285 * This source code is licensed under the BSD-style license found in the
30286 * LICENSE file in the root directory of this source tree. An additional grant
30287 * of patent rights can be found in the PATENTS file in the same directory.
30288 *
30289 */
30290
30291
30292
30293var ARIADOMPropertyConfig = {
30294 Properties: {
30295 // Global States and Properties
30296 'aria-current': 0, // state
30297 'aria-details': 0,
30298 'aria-disabled': 0, // state
30299 'aria-hidden': 0, // state
30300 'aria-invalid': 0, // state
30301 'aria-keyshortcuts': 0,
30302 'aria-label': 0,
30303 'aria-roledescription': 0,
30304 // Widget Attributes
30305 'aria-autocomplete': 0,
30306 'aria-checked': 0,
30307 'aria-expanded': 0,
30308 'aria-haspopup': 0,
30309 'aria-level': 0,
30310 'aria-modal': 0,
30311 'aria-multiline': 0,
30312 'aria-multiselectable': 0,
30313 'aria-orientation': 0,
30314 'aria-placeholder': 0,
30315 'aria-pressed': 0,
30316 'aria-readonly': 0,
30317 'aria-required': 0,
30318 'aria-selected': 0,
30319 'aria-sort': 0,
30320 'aria-valuemax': 0,
30321 'aria-valuemin': 0,
30322 'aria-valuenow': 0,
30323 'aria-valuetext': 0,
30324 // Live Region Attributes
30325 'aria-atomic': 0,
30326 'aria-busy': 0,
30327 'aria-live': 0,
30328 'aria-relevant': 0,
30329 // Drag-and-Drop Attributes
30330 'aria-dropeffect': 0,
30331 'aria-grabbed': 0,
30332 // Relationship Attributes
30333 'aria-activedescendant': 0,
30334 'aria-colcount': 0,
30335 'aria-colindex': 0,
30336 'aria-colspan': 0,
30337 'aria-controls': 0,
30338 'aria-describedby': 0,
30339 'aria-errormessage': 0,
30340 'aria-flowto': 0,
30341 'aria-labelledby': 0,
30342 'aria-owns': 0,
30343 'aria-posinset': 0,
30344 'aria-rowcount': 0,
30345 'aria-rowindex': 0,
30346 'aria-rowspan': 0,
30347 'aria-setsize': 0
30348 },
30349 DOMAttributeNames: {},
30350 DOMPropertyNames: {}
30351};
30352
30353module.exports = ARIADOMPropertyConfig;
30354
30355/***/ }),
30356/* 109 */
30357/***/ (function(module, exports, __webpack_require__) {
30358
30359"use strict";
30360/**
30361 * Copyright 2013-present Facebook, Inc.
30362 * All rights reserved.
30363 *
30364 * This source code is licensed under the BSD-style license found in the
30365 * LICENSE file in the root directory of this source tree. An additional grant
30366 * of patent rights can be found in the PATENTS file in the same directory.
30367 *
30368 */
30369
30370
30371
30372var EventPropagators = __webpack_require__(21);
30373var ExecutionEnvironment = __webpack_require__(6);
30374var FallbackCompositionState = __webpack_require__(110);
30375var SyntheticCompositionEvent = __webpack_require__(111);
30376var SyntheticInputEvent = __webpack_require__(112);
30377
30378var END_KEYCODES = [9, 13, 27, 32]; // Tab, Return, Esc, Space
30379var START_KEYCODE = 229;
30380
30381var canUseCompositionEvent = ExecutionEnvironment.canUseDOM && 'CompositionEvent' in window;
30382
30383var documentMode = null;
30384if (ExecutionEnvironment.canUseDOM && 'documentMode' in document) {
30385 documentMode = document.documentMode;
30386}
30387
30388// Webkit offers a very useful `textInput` event that can be used to
30389// directly represent `beforeInput`. The IE `textinput` event is not as
30390// useful, so we don't use it.
30391var canUseTextInputEvent = ExecutionEnvironment.canUseDOM && 'TextEvent' in window && !documentMode && !isPresto();
30392
30393// In IE9+, we have access to composition events, but the data supplied
30394// by the native compositionend event may be incorrect. Japanese ideographic
30395// spaces, for instance (\u3000) are not recorded correctly.
30396var useFallbackCompositionData = ExecutionEnvironment.canUseDOM && (!canUseCompositionEvent || documentMode && documentMode > 8 && documentMode <= 11);
30397
30398/**
30399 * Opera <= 12 includes TextEvent in window, but does not fire
30400 * text input events. Rely on keypress instead.
30401 */
30402function isPresto() {
30403 var opera = window.opera;
30404 return typeof opera === 'object' && typeof opera.version === 'function' && parseInt(opera.version(), 10) <= 12;
30405}
30406
30407var SPACEBAR_CODE = 32;
30408var SPACEBAR_CHAR = String.fromCharCode(SPACEBAR_CODE);
30409
30410// Events and their corresponding property names.
30411var eventTypes = {
30412 beforeInput: {
30413 phasedRegistrationNames: {
30414 bubbled: 'onBeforeInput',
30415 captured: 'onBeforeInputCapture'
30416 },
30417 dependencies: ['topCompositionEnd', 'topKeyPress', 'topTextInput', 'topPaste']
30418 },
30419 compositionEnd: {
30420 phasedRegistrationNames: {
30421 bubbled: 'onCompositionEnd',
30422 captured: 'onCompositionEndCapture'
30423 },
30424 dependencies: ['topBlur', 'topCompositionEnd', 'topKeyDown', 'topKeyPress', 'topKeyUp', 'topMouseDown']
30425 },
30426 compositionStart: {
30427 phasedRegistrationNames: {
30428 bubbled: 'onCompositionStart',
30429 captured: 'onCompositionStartCapture'
30430 },
30431 dependencies: ['topBlur', 'topCompositionStart', 'topKeyDown', 'topKeyPress', 'topKeyUp', 'topMouseDown']
30432 },
30433 compositionUpdate: {
30434 phasedRegistrationNames: {
30435 bubbled: 'onCompositionUpdate',
30436 captured: 'onCompositionUpdateCapture'
30437 },
30438 dependencies: ['topBlur', 'topCompositionUpdate', 'topKeyDown', 'topKeyPress', 'topKeyUp', 'topMouseDown']
30439 }
30440};
30441
30442// Track whether we've ever handled a keypress on the space key.
30443var hasSpaceKeypress = false;
30444
30445/**
30446 * Return whether a native keypress event is assumed to be a command.
30447 * This is required because Firefox fires `keypress` events for key commands
30448 * (cut, copy, select-all, etc.) even though no character is inserted.
30449 */
30450function isKeypressCommand(nativeEvent) {
30451 return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&
30452 // ctrlKey && altKey is equivalent to AltGr, and is not a command.
30453 !(nativeEvent.ctrlKey && nativeEvent.altKey);
30454}
30455
30456/**
30457 * Translate native top level events into event types.
30458 *
30459 * @param {string} topLevelType
30460 * @return {object}
30461 */
30462function getCompositionEventType(topLevelType) {
30463 switch (topLevelType) {
30464 case 'topCompositionStart':
30465 return eventTypes.compositionStart;
30466 case 'topCompositionEnd':
30467 return eventTypes.compositionEnd;
30468 case 'topCompositionUpdate':
30469 return eventTypes.compositionUpdate;
30470 }
30471}
30472
30473/**
30474 * Does our fallback best-guess model think this event signifies that
30475 * composition has begun?
30476 *
30477 * @param {string} topLevelType
30478 * @param {object} nativeEvent
30479 * @return {boolean}
30480 */
30481function isFallbackCompositionStart(topLevelType, nativeEvent) {
30482 return topLevelType === 'topKeyDown' && nativeEvent.keyCode === START_KEYCODE;
30483}
30484
30485/**
30486 * Does our fallback mode think that this event is the end of composition?
30487 *
30488 * @param {string} topLevelType
30489 * @param {object} nativeEvent
30490 * @return {boolean}
30491 */
30492function isFallbackCompositionEnd(topLevelType, nativeEvent) {
30493 switch (topLevelType) {
30494 case 'topKeyUp':
30495 // Command keys insert or clear IME input.
30496 return END_KEYCODES.indexOf(nativeEvent.keyCode) !== -1;
30497 case 'topKeyDown':
30498 // Expect IME keyCode on each keydown. If we get any other
30499 // code we must have exited earlier.
30500 return nativeEvent.keyCode !== START_KEYCODE;
30501 case 'topKeyPress':
30502 case 'topMouseDown':
30503 case 'topBlur':
30504 // Events are not possible without cancelling IME.
30505 return true;
30506 default:
30507 return false;
30508 }
30509}
30510
30511/**
30512 * Google Input Tools provides composition data via a CustomEvent,
30513 * with the `data` property populated in the `detail` object. If this
30514 * is available on the event object, use it. If not, this is a plain
30515 * composition event and we have nothing special to extract.
30516 *
30517 * @param {object} nativeEvent
30518 * @return {?string}
30519 */
30520function getDataFromCustomEvent(nativeEvent) {
30521 var detail = nativeEvent.detail;
30522 if (typeof detail === 'object' && 'data' in detail) {
30523 return detail.data;
30524 }
30525 return null;
30526}
30527
30528// Track the current IME composition fallback object, if any.
30529var currentComposition = null;
30530
30531/**
30532 * @return {?object} A SyntheticCompositionEvent.
30533 */
30534function extractCompositionEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget) {
30535 var eventType;
30536 var fallbackData;
30537
30538 if (canUseCompositionEvent) {
30539 eventType = getCompositionEventType(topLevelType);
30540 } else if (!currentComposition) {
30541 if (isFallbackCompositionStart(topLevelType, nativeEvent)) {
30542 eventType = eventTypes.compositionStart;
30543 }
30544 } else if (isFallbackCompositionEnd(topLevelType, nativeEvent)) {
30545 eventType = eventTypes.compositionEnd;
30546 }
30547
30548 if (!eventType) {
30549 return null;
30550 }
30551
30552 if (useFallbackCompositionData) {
30553 // The current composition is stored statically and must not be
30554 // overwritten while composition continues.
30555 if (!currentComposition && eventType === eventTypes.compositionStart) {
30556 currentComposition = FallbackCompositionState.getPooled(nativeEventTarget);
30557 } else if (eventType === eventTypes.compositionEnd) {
30558 if (currentComposition) {
30559 fallbackData = currentComposition.getData();
30560 }
30561 }
30562 }
30563
30564 var event = SyntheticCompositionEvent.getPooled(eventType, targetInst, nativeEvent, nativeEventTarget);
30565
30566 if (fallbackData) {
30567 // Inject data generated from fallback path into the synthetic event.
30568 // This matches the property of native CompositionEventInterface.
30569 event.data = fallbackData;
30570 } else {
30571 var customData = getDataFromCustomEvent(nativeEvent);
30572 if (customData !== null) {
30573 event.data = customData;
30574 }
30575 }
30576
30577 EventPropagators.accumulateTwoPhaseDispatches(event);
30578 return event;
30579}
30580
30581/**
30582 * @param {string} topLevelType Record from `EventConstants`.
30583 * @param {object} nativeEvent Native browser event.
30584 * @return {?string} The string corresponding to this `beforeInput` event.
30585 */
30586function getNativeBeforeInputChars(topLevelType, nativeEvent) {
30587 switch (topLevelType) {
30588 case 'topCompositionEnd':
30589 return getDataFromCustomEvent(nativeEvent);
30590 case 'topKeyPress':
30591 /**
30592 * If native `textInput` events are available, our goal is to make
30593 * use of them. However, there is a special case: the spacebar key.
30594 * In Webkit, preventing default on a spacebar `textInput` event
30595 * cancels character insertion, but it *also* causes the browser
30596 * to fall back to its default spacebar behavior of scrolling the
30597 * page.
30598 *
30599 * Tracking at:
30600 * https://code.google.com/p/chromium/issues/detail?id=355103
30601 *
30602 * To avoid this issue, use the keypress event as if no `textInput`
30603 * event is available.
30604 */
30605 var which = nativeEvent.which;
30606 if (which !== SPACEBAR_CODE) {
30607 return null;
30608 }
30609
30610 hasSpaceKeypress = true;
30611 return SPACEBAR_CHAR;
30612
30613 case 'topTextInput':
30614 // Record the characters to be added to the DOM.
30615 var chars = nativeEvent.data;
30616
30617 // If it's a spacebar character, assume that we have already handled
30618 // it at the keypress level and bail immediately. Android Chrome
30619 // doesn't give us keycodes, so we need to blacklist it.
30620 if (chars === SPACEBAR_CHAR && hasSpaceKeypress) {
30621 return null;
30622 }
30623
30624 return chars;
30625
30626 default:
30627 // For other native event types, do nothing.
30628 return null;
30629 }
30630}
30631
30632/**
30633 * For browsers that do not provide the `textInput` event, extract the
30634 * appropriate string to use for SyntheticInputEvent.
30635 *
30636 * @param {string} topLevelType Record from `EventConstants`.
30637 * @param {object} nativeEvent Native browser event.
30638 * @return {?string} The fallback string for this `beforeInput` event.
30639 */
30640function getFallbackBeforeInputChars(topLevelType, nativeEvent) {
30641 // If we are currently composing (IME) and using a fallback to do so,
30642 // try to extract the composed characters from the fallback object.
30643 // If composition event is available, we extract a string only at
30644 // compositionevent, otherwise extract it at fallback events.
30645 if (currentComposition) {
30646 if (topLevelType === 'topCompositionEnd' || !canUseCompositionEvent && isFallbackCompositionEnd(topLevelType, nativeEvent)) {
30647 var chars = currentComposition.getData();
30648 FallbackCompositionState.release(currentComposition);
30649 currentComposition = null;
30650 return chars;
30651 }
30652 return null;
30653 }
30654
30655 switch (topLevelType) {
30656 case 'topPaste':
30657 // If a paste event occurs after a keypress, throw out the input
30658 // chars. Paste events should not lead to BeforeInput events.
30659 return null;
30660 case 'topKeyPress':
30661 /**
30662 * As of v27, Firefox may fire keypress events even when no character
30663 * will be inserted. A few possibilities:
30664 *
30665 * - `which` is `0`. Arrow keys, Esc key, etc.
30666 *
30667 * - `which` is the pressed key code, but no char is available.
30668 * Ex: 'AltGr + d` in Polish. There is no modified character for
30669 * this key combination and no character is inserted into the
30670 * document, but FF fires the keypress for char code `100` anyway.
30671 * No `input` event will occur.
30672 *
30673 * - `which` is the pressed key code, but a command combination is
30674 * being used. Ex: `Cmd+C`. No character is inserted, and no
30675 * `input` event will occur.
30676 */
30677 if (nativeEvent.which && !isKeypressCommand(nativeEvent)) {
30678 return String.fromCharCode(nativeEvent.which);
30679 }
30680 return null;
30681 case 'topCompositionEnd':
30682 return useFallbackCompositionData ? null : nativeEvent.data;
30683 default:
30684 return null;
30685 }
30686}
30687
30688/**
30689 * Extract a SyntheticInputEvent for `beforeInput`, based on either native
30690 * `textInput` or fallback behavior.
30691 *
30692 * @return {?object} A SyntheticInputEvent.
30693 */
30694function extractBeforeInputEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget) {
30695 var chars;
30696
30697 if (canUseTextInputEvent) {
30698 chars = getNativeBeforeInputChars(topLevelType, nativeEvent);
30699 } else {
30700 chars = getFallbackBeforeInputChars(topLevelType, nativeEvent);
30701 }
30702
30703 // If no characters are being inserted, no BeforeInput event should
30704 // be fired.
30705 if (!chars) {
30706 return null;
30707 }
30708
30709 var event = SyntheticInputEvent.getPooled(eventTypes.beforeInput, targetInst, nativeEvent, nativeEventTarget);
30710
30711 event.data = chars;
30712 EventPropagators.accumulateTwoPhaseDispatches(event);
30713 return event;
30714}
30715
30716/**
30717 * Create an `onBeforeInput` event to match
30718 * http://www.w3.org/TR/2013/WD-DOM-Level-3-Events-20131105/#events-inputevents.
30719 *
30720 * This event plugin is based on the native `textInput` event
30721 * available in Chrome, Safari, Opera, and IE. This event fires after
30722 * `onKeyPress` and `onCompositionEnd`, but before `onInput`.
30723 *
30724 * `beforeInput` is spec'd but not implemented in any browsers, and
30725 * the `input` event does not provide any useful information about what has
30726 * actually been added, contrary to the spec. Thus, `textInput` is the best
30727 * available event to identify the characters that have actually been inserted
30728 * into the target node.
30729 *
30730 * This plugin is also responsible for emitting `composition` events, thus
30731 * allowing us to share composition fallback code for both `beforeInput` and
30732 * `composition` event types.
30733 */
30734var BeforeInputEventPlugin = {
30735 eventTypes: eventTypes,
30736
30737 extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
30738 return [extractCompositionEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget), extractBeforeInputEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget)];
30739 }
30740};
30741
30742module.exports = BeforeInputEventPlugin;
30743
30744/***/ }),
30745/* 110 */
30746/***/ (function(module, exports, __webpack_require__) {
30747
30748"use strict";
30749/**
30750 * Copyright 2013-present, Facebook, Inc.
30751 * All rights reserved.
30752 *
30753 * This source code is licensed under the BSD-style license found in the
30754 * LICENSE file in the root directory of this source tree. An additional grant
30755 * of patent rights can be found in the PATENTS file in the same directory.
30756 *
30757 */
30758
30759
30760
30761var _assign = __webpack_require__(4);
30762
30763var PooledClass = __webpack_require__(16);
30764
30765var getTextContentAccessor = __webpack_require__(67);
30766
30767/**
30768 * This helper class stores information about text content of a target node,
30769 * allowing comparison of content before and after a given event.
30770 *
30771 * Identify the node where selection currently begins, then observe
30772 * both its text content and its current position in the DOM. Since the
30773 * browser may natively replace the target node during composition, we can
30774 * use its position to find its replacement.
30775 *
30776 * @param {DOMEventTarget} root
30777 */
30778function FallbackCompositionState(root) {
30779 this._root = root;
30780 this._startText = this.getText();
30781 this._fallbackText = null;
30782}
30783
30784_assign(FallbackCompositionState.prototype, {
30785 destructor: function () {
30786 this._root = null;
30787 this._startText = null;
30788 this._fallbackText = null;
30789 },
30790
30791 /**
30792 * Get current text of input.
30793 *
30794 * @return {string}
30795 */
30796 getText: function () {
30797 if ('value' in this._root) {
30798 return this._root.value;
30799 }
30800 return this._root[getTextContentAccessor()];
30801 },
30802
30803 /**
30804 * Determine the differing substring between the initially stored
30805 * text content and the current content.
30806 *
30807 * @return {string}
30808 */
30809 getData: function () {
30810 if (this._fallbackText) {
30811 return this._fallbackText;
30812 }
30813
30814 var start;
30815 var startValue = this._startText;
30816 var startLength = startValue.length;
30817 var end;
30818 var endValue = this.getText();
30819 var endLength = endValue.length;
30820
30821 for (start = 0; start < startLength; start++) {
30822 if (startValue[start] !== endValue[start]) {
30823 break;
30824 }
30825 }
30826
30827 var minEnd = startLength - start;
30828 for (end = 1; end <= minEnd; end++) {
30829 if (startValue[startLength - end] !== endValue[endLength - end]) {
30830 break;
30831 }
30832 }
30833
30834 var sliceTail = end > 1 ? 1 - end : undefined;
30835 this._fallbackText = endValue.slice(start, sliceTail);
30836 return this._fallbackText;
30837 }
30838});
30839
30840PooledClass.addPoolingTo(FallbackCompositionState);
30841
30842module.exports = FallbackCompositionState;
30843
30844/***/ }),
30845/* 111 */
30846/***/ (function(module, exports, __webpack_require__) {
30847
30848"use strict";
30849/**
30850 * Copyright 2013-present, Facebook, Inc.
30851 * All rights reserved.
30852 *
30853 * This source code is licensed under the BSD-style license found in the
30854 * LICENSE file in the root directory of this source tree. An additional grant
30855 * of patent rights can be found in the PATENTS file in the same directory.
30856 *
30857 */
30858
30859
30860
30861var SyntheticEvent = __webpack_require__(12);
30862
30863/**
30864 * @interface Event
30865 * @see http://www.w3.org/TR/DOM-Level-3-Events/#events-compositionevents
30866 */
30867var CompositionEventInterface = {
30868 data: null
30869};
30870
30871/**
30872 * @param {object} dispatchConfig Configuration used to dispatch this event.
30873 * @param {string} dispatchMarker Marker identifying the event target.
30874 * @param {object} nativeEvent Native browser event.
30875 * @extends {SyntheticUIEvent}
30876 */
30877function SyntheticCompositionEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
30878 return SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
30879}
30880
30881SyntheticEvent.augmentClass(SyntheticCompositionEvent, CompositionEventInterface);
30882
30883module.exports = SyntheticCompositionEvent;
30884
30885/***/ }),
30886/* 112 */
30887/***/ (function(module, exports, __webpack_require__) {
30888
30889"use strict";
30890/**
30891 * Copyright 2013-present, Facebook, Inc.
30892 * All rights reserved.
30893 *
30894 * This source code is licensed under the BSD-style license found in the
30895 * LICENSE file in the root directory of this source tree. An additional grant
30896 * of patent rights can be found in the PATENTS file in the same directory.
30897 *
30898 */
30899
30900
30901
30902var SyntheticEvent = __webpack_require__(12);
30903
30904/**
30905 * @interface Event
30906 * @see http://www.w3.org/TR/2013/WD-DOM-Level-3-Events-20131105
30907 * /#events-inputevents
30908 */
30909var InputEventInterface = {
30910 data: null
30911};
30912
30913/**
30914 * @param {object} dispatchConfig Configuration used to dispatch this event.
30915 * @param {string} dispatchMarker Marker identifying the event target.
30916 * @param {object} nativeEvent Native browser event.
30917 * @extends {SyntheticUIEvent}
30918 */
30919function SyntheticInputEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
30920 return SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
30921}
30922
30923SyntheticEvent.augmentClass(SyntheticInputEvent, InputEventInterface);
30924
30925module.exports = SyntheticInputEvent;
30926
30927/***/ }),
30928/* 113 */
30929/***/ (function(module, exports, __webpack_require__) {
30930
30931"use strict";
30932/**
30933 * Copyright 2013-present, Facebook, Inc.
30934 * All rights reserved.
30935 *
30936 * This source code is licensed under the BSD-style license found in the
30937 * LICENSE file in the root directory of this source tree. An additional grant
30938 * of patent rights can be found in the PATENTS file in the same directory.
30939 *
30940 */
30941
30942
30943
30944var EventPluginHub = __webpack_require__(22);
30945var EventPropagators = __webpack_require__(21);
30946var ExecutionEnvironment = __webpack_require__(6);
30947var ReactDOMComponentTree = __webpack_require__(5);
30948var ReactUpdates = __webpack_require__(11);
30949var SyntheticEvent = __webpack_require__(12);
30950
30951var inputValueTracking = __webpack_require__(70);
30952var getEventTarget = __webpack_require__(40);
30953var isEventSupported = __webpack_require__(41);
30954var isTextInputElement = __webpack_require__(71);
30955
30956var eventTypes = {
30957 change: {
30958 phasedRegistrationNames: {
30959 bubbled: 'onChange',
30960 captured: 'onChangeCapture'
30961 },
30962 dependencies: ['topBlur', 'topChange', 'topClick', 'topFocus', 'topInput', 'topKeyDown', 'topKeyUp', 'topSelectionChange']
30963 }
30964};
30965
30966function createAndAccumulateChangeEvent(inst, nativeEvent, target) {
30967 var event = SyntheticEvent.getPooled(eventTypes.change, inst, nativeEvent, target);
30968 event.type = 'change';
30969 EventPropagators.accumulateTwoPhaseDispatches(event);
30970 return event;
30971}
30972/**
30973 * For IE shims
30974 */
30975var activeElement = null;
30976var activeElementInst = null;
30977
30978/**
30979 * SECTION: handle `change` event
30980 */
30981function shouldUseChangeEvent(elem) {
30982 var nodeName = elem.nodeName && elem.nodeName.toLowerCase();
30983 return nodeName === 'select' || nodeName === 'input' && elem.type === 'file';
30984}
30985
30986var doesChangeEventBubble = false;
30987if (ExecutionEnvironment.canUseDOM) {
30988 // See `handleChange` comment below
30989 doesChangeEventBubble = isEventSupported('change') && (!document.documentMode || document.documentMode > 8);
30990}
30991
30992function manualDispatchChangeEvent(nativeEvent) {
30993 var event = createAndAccumulateChangeEvent(activeElementInst, nativeEvent, getEventTarget(nativeEvent));
30994
30995 // If change and propertychange bubbled, we'd just bind to it like all the
30996 // other events and have it go through ReactBrowserEventEmitter. Since it
30997 // doesn't, we manually listen for the events and so we have to enqueue and
30998 // process the abstract event manually.
30999 //
31000 // Batching is necessary here in order to ensure that all event handlers run
31001 // before the next rerender (including event handlers attached to ancestor
31002 // elements instead of directly on the input). Without this, controlled
31003 // components don't work properly in conjunction with event bubbling because
31004 // the component is rerendered and the value reverted before all the event
31005 // handlers can run. See https://github.com/facebook/react/issues/708.
31006 ReactUpdates.batchedUpdates(runEventInBatch, event);
31007}
31008
31009function runEventInBatch(event) {
31010 EventPluginHub.enqueueEvents(event);
31011 EventPluginHub.processEventQueue(false);
31012}
31013
31014function startWatchingForChangeEventIE8(target, targetInst) {
31015 activeElement = target;
31016 activeElementInst = targetInst;
31017 activeElement.attachEvent('onchange', manualDispatchChangeEvent);
31018}
31019
31020function stopWatchingForChangeEventIE8() {
31021 if (!activeElement) {
31022 return;
31023 }
31024 activeElement.detachEvent('onchange', manualDispatchChangeEvent);
31025 activeElement = null;
31026 activeElementInst = null;
31027}
31028
31029function getInstIfValueChanged(targetInst, nativeEvent) {
31030 var updated = inputValueTracking.updateValueIfChanged(targetInst);
31031 var simulated = nativeEvent.simulated === true && ChangeEventPlugin._allowSimulatedPassThrough;
31032
31033 if (updated || simulated) {
31034 return targetInst;
31035 }
31036}
31037
31038function getTargetInstForChangeEvent(topLevelType, targetInst) {
31039 if (topLevelType === 'topChange') {
31040 return targetInst;
31041 }
31042}
31043
31044function handleEventsForChangeEventIE8(topLevelType, target, targetInst) {
31045 if (topLevelType === 'topFocus') {
31046 // stopWatching() should be a noop here but we call it just in case we
31047 // missed a blur event somehow.
31048 stopWatchingForChangeEventIE8();
31049 startWatchingForChangeEventIE8(target, targetInst);
31050 } else if (topLevelType === 'topBlur') {
31051 stopWatchingForChangeEventIE8();
31052 }
31053}
31054
31055/**
31056 * SECTION: handle `input` event
31057 */
31058var isInputEventSupported = false;
31059if (ExecutionEnvironment.canUseDOM) {
31060 // IE9 claims to support the input event but fails to trigger it when
31061 // deleting text, so we ignore its input events.
31062
31063 isInputEventSupported = isEventSupported('input') && (!('documentMode' in document) || document.documentMode > 9);
31064}
31065
31066/**
31067 * (For IE <=9) Starts tracking propertychange events on the passed-in element
31068 * and override the value property so that we can distinguish user events from
31069 * value changes in JS.
31070 */
31071function startWatchingForValueChange(target, targetInst) {
31072 activeElement = target;
31073 activeElementInst = targetInst;
31074 activeElement.attachEvent('onpropertychange', handlePropertyChange);
31075}
31076
31077/**
31078 * (For IE <=9) Removes the event listeners from the currently-tracked element,
31079 * if any exists.
31080 */
31081function stopWatchingForValueChange() {
31082 if (!activeElement) {
31083 return;
31084 }
31085 activeElement.detachEvent('onpropertychange', handlePropertyChange);
31086
31087 activeElement = null;
31088 activeElementInst = null;
31089}
31090
31091/**
31092 * (For IE <=9) Handles a propertychange event, sending a `change` event if
31093 * the value of the active element has changed.
31094 */
31095function handlePropertyChange(nativeEvent) {
31096 if (nativeEvent.propertyName !== 'value') {
31097 return;
31098 }
31099 if (getInstIfValueChanged(activeElementInst, nativeEvent)) {
31100 manualDispatchChangeEvent(nativeEvent);
31101 }
31102}
31103
31104function handleEventsForInputEventPolyfill(topLevelType, target, targetInst) {
31105 if (topLevelType === 'topFocus') {
31106 // In IE8, we can capture almost all .value changes by adding a
31107 // propertychange handler and looking for events with propertyName
31108 // equal to 'value'
31109 // In IE9, propertychange fires for most input events but is buggy and
31110 // doesn't fire when text is deleted, but conveniently, selectionchange
31111 // appears to fire in all of the remaining cases so we catch those and
31112 // forward the event if the value has changed
31113 // In either case, we don't want to call the event handler if the value
31114 // is changed from JS so we redefine a setter for `.value` that updates
31115 // our activeElementValue variable, allowing us to ignore those changes
31116 //
31117 // stopWatching() should be a noop here but we call it just in case we
31118 // missed a blur event somehow.
31119 stopWatchingForValueChange();
31120 startWatchingForValueChange(target, targetInst);
31121 } else if (topLevelType === 'topBlur') {
31122 stopWatchingForValueChange();
31123 }
31124}
31125
31126// For IE8 and IE9.
31127function getTargetInstForInputEventPolyfill(topLevelType, targetInst, nativeEvent) {
31128 if (topLevelType === 'topSelectionChange' || topLevelType === 'topKeyUp' || topLevelType === 'topKeyDown') {
31129 // On the selectionchange event, the target is just document which isn't
31130 // helpful for us so just check activeElement instead.
31131 //
31132 // 99% of the time, keydown and keyup aren't necessary. IE8 fails to fire
31133 // propertychange on the first input event after setting `value` from a
31134 // script and fires only keydown, keypress, keyup. Catching keyup usually
31135 // gets it and catching keydown lets us fire an event for the first
31136 // keystroke if user does a key repeat (it'll be a little delayed: right
31137 // before the second keystroke). Other input methods (e.g., paste) seem to
31138 // fire selectionchange normally.
31139 return getInstIfValueChanged(activeElementInst, nativeEvent);
31140 }
31141}
31142
31143/**
31144 * SECTION: handle `click` event
31145 */
31146function shouldUseClickEvent(elem) {
31147 // Use the `click` event to detect changes to checkbox and radio inputs.
31148 // This approach works across all browsers, whereas `change` does not fire
31149 // until `blur` in IE8.
31150 var nodeName = elem.nodeName;
31151 return nodeName && nodeName.toLowerCase() === 'input' && (elem.type === 'checkbox' || elem.type === 'radio');
31152}
31153
31154function getTargetInstForClickEvent(topLevelType, targetInst, nativeEvent) {
31155 if (topLevelType === 'topClick') {
31156 return getInstIfValueChanged(targetInst, nativeEvent);
31157 }
31158}
31159
31160function getTargetInstForInputOrChangeEvent(topLevelType, targetInst, nativeEvent) {
31161 if (topLevelType === 'topInput' || topLevelType === 'topChange') {
31162 return getInstIfValueChanged(targetInst, nativeEvent);
31163 }
31164}
31165
31166function handleControlledInputBlur(inst, node) {
31167 // TODO: In IE, inst is occasionally null. Why?
31168 if (inst == null) {
31169 return;
31170 }
31171
31172 // Fiber and ReactDOM keep wrapper state in separate places
31173 var state = inst._wrapperState || node._wrapperState;
31174
31175 if (!state || !state.controlled || node.type !== 'number') {
31176 return;
31177 }
31178
31179 // If controlled, assign the value attribute to the current value on blur
31180 var value = '' + node.value;
31181 if (node.getAttribute('value') !== value) {
31182 node.setAttribute('value', value);
31183 }
31184}
31185
31186/**
31187 * This plugin creates an `onChange` event that normalizes change events
31188 * across form elements. This event fires at a time when it's possible to
31189 * change the element's value without seeing a flicker.
31190 *
31191 * Supported elements are:
31192 * - input (see `isTextInputElement`)
31193 * - textarea
31194 * - select
31195 */
31196var ChangeEventPlugin = {
31197 eventTypes: eventTypes,
31198
31199 _allowSimulatedPassThrough: true,
31200 _isInputEventSupported: isInputEventSupported,
31201
31202 extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
31203 var targetNode = targetInst ? ReactDOMComponentTree.getNodeFromInstance(targetInst) : window;
31204
31205 var getTargetInstFunc, handleEventFunc;
31206 if (shouldUseChangeEvent(targetNode)) {
31207 if (doesChangeEventBubble) {
31208 getTargetInstFunc = getTargetInstForChangeEvent;
31209 } else {
31210 handleEventFunc = handleEventsForChangeEventIE8;
31211 }
31212 } else if (isTextInputElement(targetNode)) {
31213 if (isInputEventSupported) {
31214 getTargetInstFunc = getTargetInstForInputOrChangeEvent;
31215 } else {
31216 getTargetInstFunc = getTargetInstForInputEventPolyfill;
31217 handleEventFunc = handleEventsForInputEventPolyfill;
31218 }
31219 } else if (shouldUseClickEvent(targetNode)) {
31220 getTargetInstFunc = getTargetInstForClickEvent;
31221 }
31222
31223 if (getTargetInstFunc) {
31224 var inst = getTargetInstFunc(topLevelType, targetInst, nativeEvent);
31225 if (inst) {
31226 var event = createAndAccumulateChangeEvent(inst, nativeEvent, nativeEventTarget);
31227 return event;
31228 }
31229 }
31230
31231 if (handleEventFunc) {
31232 handleEventFunc(topLevelType, targetNode, targetInst);
31233 }
31234
31235 // When blurring, set the value attribute for number inputs
31236 if (topLevelType === 'topBlur') {
31237 handleControlledInputBlur(targetInst, targetNode);
31238 }
31239 }
31240};
31241
31242module.exports = ChangeEventPlugin;
31243
31244/***/ }),
31245/* 114 */
31246/***/ (function(module, exports, __webpack_require__) {
31247
31248"use strict";
31249/**
31250 * Copyright 2013-present, Facebook, Inc.
31251 * All rights reserved.
31252 *
31253 * This source code is licensed under the BSD-style license found in the
31254 * LICENSE file in the root directory of this source tree. An additional grant
31255 * of patent rights can be found in the PATENTS file in the same directory.
31256 *
31257 *
31258 */
31259
31260
31261
31262var ReactOwner = __webpack_require__(115);
31263
31264var ReactRef = {};
31265
31266function attachRef(ref, component, owner) {
31267 if (typeof ref === 'function') {
31268 ref(component.getPublicInstance());
31269 } else {
31270 // Legacy ref
31271 ReactOwner.addComponentAsRefTo(component, ref, owner);
31272 }
31273}
31274
31275function detachRef(ref, component, owner) {
31276 if (typeof ref === 'function') {
31277 ref(null);
31278 } else {
31279 // Legacy ref
31280 ReactOwner.removeComponentAsRefFrom(component, ref, owner);
31281 }
31282}
31283
31284ReactRef.attachRefs = function (instance, element) {
31285 if (element === null || typeof element !== 'object') {
31286 return;
31287 }
31288 var ref = element.ref;
31289 if (ref != null) {
31290 attachRef(ref, instance, element._owner);
31291 }
31292};
31293
31294ReactRef.shouldUpdateRefs = function (prevElement, nextElement) {
31295 // If either the owner or a `ref` has changed, make sure the newest owner
31296 // has stored a reference to `this`, and the previous owner (if different)
31297 // has forgotten the reference to `this`. We use the element instead
31298 // of the public this.props because the post processing cannot determine
31299 // a ref. The ref conceptually lives on the element.
31300
31301 // TODO: Should this even be possible? The owner cannot change because
31302 // it's forbidden by shouldUpdateReactComponent. The ref can change
31303 // if you swap the keys of but not the refs. Reconsider where this check
31304 // is made. It probably belongs where the key checking and
31305 // instantiateReactComponent is done.
31306
31307 var prevRef = null;
31308 var prevOwner = null;
31309 if (prevElement !== null && typeof prevElement === 'object') {
31310 prevRef = prevElement.ref;
31311 prevOwner = prevElement._owner;
31312 }
31313
31314 var nextRef = null;
31315 var nextOwner = null;
31316 if (nextElement !== null && typeof nextElement === 'object') {
31317 nextRef = nextElement.ref;
31318 nextOwner = nextElement._owner;
31319 }
31320
31321 return prevRef !== nextRef ||
31322 // If owner changes but we have an unchanged function ref, don't update refs
31323 typeof nextRef === 'string' && nextOwner !== prevOwner;
31324};
31325
31326ReactRef.detachRefs = function (instance, element) {
31327 if (element === null || typeof element !== 'object') {
31328 return;
31329 }
31330 var ref = element.ref;
31331 if (ref != null) {
31332 detachRef(ref, instance, element._owner);
31333 }
31334};
31335
31336module.exports = ReactRef;
31337
31338/***/ }),
31339/* 115 */
31340/***/ (function(module, exports, __webpack_require__) {
31341
31342"use strict";
31343/* WEBPACK VAR INJECTION */(function(process) {/**
31344 * Copyright 2013-present, Facebook, Inc.
31345 * All rights reserved.
31346 *
31347 * This source code is licensed under the BSD-style license found in the
31348 * LICENSE file in the root directory of this source tree. An additional grant
31349 * of patent rights can be found in the PATENTS file in the same directory.
31350 *
31351 *
31352 */
31353
31354
31355
31356var _prodInvariant = __webpack_require__(3);
31357
31358var invariant = __webpack_require__(1);
31359
31360/**
31361 * @param {?object} object
31362 * @return {boolean} True if `object` is a valid owner.
31363 * @final
31364 */
31365function isValidOwner(object) {
31366 return !!(object && typeof object.attachRef === 'function' && typeof object.detachRef === 'function');
31367}
31368
31369/**
31370 * ReactOwners are capable of storing references to owned components.
31371 *
31372 * All components are capable of //being// referenced by owner components, but
31373 * only ReactOwner components are capable of //referencing// owned components.
31374 * The named reference is known as a "ref".
31375 *
31376 * Refs are available when mounted and updated during reconciliation.
31377 *
31378 * var MyComponent = React.createClass({
31379 * render: function() {
31380 * return (
31381 * <div onClick={this.handleClick}>
31382 * <CustomComponent ref="custom" />
31383 * </div>
31384 * );
31385 * },
31386 * handleClick: function() {
31387 * this.refs.custom.handleClick();
31388 * },
31389 * componentDidMount: function() {
31390 * this.refs.custom.initialize();
31391 * }
31392 * });
31393 *
31394 * Refs should rarely be used. When refs are used, they should only be done to
31395 * control data that is not handled by React's data flow.
31396 *
31397 * @class ReactOwner
31398 */
31399var ReactOwner = {
31400 /**
31401 * Adds a component by ref to an owner component.
31402 *
31403 * @param {ReactComponent} component Component to reference.
31404 * @param {string} ref Name by which to refer to the component.
31405 * @param {ReactOwner} owner Component on which to record the ref.
31406 * @final
31407 * @internal
31408 */
31409 addComponentAsRefTo: function (component, ref, owner) {
31410 !isValidOwner(owner) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'addComponentAsRefTo(...): Only a ReactOwner can have refs. You might be adding a ref to a component that was not created inside a component\'s `render` method, or you have multiple copies of React loaded (details: https://fb.me/react-refs-must-have-owner).') : _prodInvariant('119') : void 0;
31411 owner.attachRef(ref, component);
31412 },
31413
31414 /**
31415 * Removes a component by ref from an owner component.
31416 *
31417 * @param {ReactComponent} component Component to dereference.
31418 * @param {string} ref Name of the ref to remove.
31419 * @param {ReactOwner} owner Component on which the ref is recorded.
31420 * @final
31421 * @internal
31422 */
31423 removeComponentAsRefFrom: function (component, ref, owner) {
31424 !isValidOwner(owner) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'removeComponentAsRefFrom(...): Only a ReactOwner can have refs. You might be removing a ref to a component that was not created inside a component\'s `render` method, or you have multiple copies of React loaded (details: https://fb.me/react-refs-must-have-owner).') : _prodInvariant('120') : void 0;
31425 var ownerPublicInstance = owner.getPublicInstance();
31426 // Check that `component`'s owner is still alive and that `component` is still the current ref
31427 // because we do not want to detach the ref if another component stole it.
31428 if (ownerPublicInstance && ownerPublicInstance.refs[ref] === component.getPublicInstance()) {
31429 owner.detachRef(ref);
31430 }
31431 }
31432};
31433
31434module.exports = ReactOwner;
31435/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
31436
31437/***/ }),
31438/* 116 */
31439/***/ (function(module, exports, __webpack_require__) {
31440
31441"use strict";
31442/* WEBPACK VAR INJECTION */(function(process) {/**
31443 * Copyright 2016-present, Facebook, Inc.
31444 * All rights reserved.
31445 *
31446 * This source code is licensed under the BSD-style license found in the
31447 * LICENSE file in the root directory of this source tree. An additional grant
31448 * of patent rights can be found in the PATENTS file in the same directory.
31449 *
31450 *
31451 */
31452
31453
31454
31455var ReactInvalidSetStateWarningHook = __webpack_require__(117);
31456var ReactHostOperationHistoryHook = __webpack_require__(118);
31457var ReactComponentTreeHook = __webpack_require__(7);
31458var ExecutionEnvironment = __webpack_require__(6);
31459
31460var performanceNow = __webpack_require__(119);
31461var warning = __webpack_require__(2);
31462
31463var hooks = [];
31464var didHookThrowForEvent = {};
31465
31466function callHook(event, fn, context, arg1, arg2, arg3, arg4, arg5) {
31467 try {
31468 fn.call(context, arg1, arg2, arg3, arg4, arg5);
31469 } catch (e) {
31470 process.env.NODE_ENV !== 'production' ? warning(didHookThrowForEvent[event], 'Exception thrown by hook while handling %s: %s', event, e + '\n' + e.stack) : void 0;
31471 didHookThrowForEvent[event] = true;
31472 }
31473}
31474
31475function emitEvent(event, arg1, arg2, arg3, arg4, arg5) {
31476 for (var i = 0; i < hooks.length; i++) {
31477 var hook = hooks[i];
31478 var fn = hook[event];
31479 if (fn) {
31480 callHook(event, fn, hook, arg1, arg2, arg3, arg4, arg5);
31481 }
31482 }
31483}
31484
31485var isProfiling = false;
31486var flushHistory = [];
31487var lifeCycleTimerStack = [];
31488var currentFlushNesting = 0;
31489var currentFlushMeasurements = [];
31490var currentFlushStartTime = 0;
31491var currentTimerDebugID = null;
31492var currentTimerStartTime = 0;
31493var currentTimerNestedFlushDuration = 0;
31494var currentTimerType = null;
31495
31496var lifeCycleTimerHasWarned = false;
31497
31498function clearHistory() {
31499 ReactComponentTreeHook.purgeUnmountedComponents();
31500 ReactHostOperationHistoryHook.clearHistory();
31501}
31502
31503function getTreeSnapshot(registeredIDs) {
31504 return registeredIDs.reduce(function (tree, id) {
31505 var ownerID = ReactComponentTreeHook.getOwnerID(id);
31506 var parentID = ReactComponentTreeHook.getParentID(id);
31507 tree[id] = {
31508 displayName: ReactComponentTreeHook.getDisplayName(id),
31509 text: ReactComponentTreeHook.getText(id),
31510 updateCount: ReactComponentTreeHook.getUpdateCount(id),
31511 childIDs: ReactComponentTreeHook.getChildIDs(id),
31512 // Text nodes don't have owners but this is close enough.
31513 ownerID: ownerID || parentID && ReactComponentTreeHook.getOwnerID(parentID) || 0,
31514 parentID: parentID
31515 };
31516 return tree;
31517 }, {});
31518}
31519
31520function resetMeasurements() {
31521 var previousStartTime = currentFlushStartTime;
31522 var previousMeasurements = currentFlushMeasurements;
31523 var previousOperations = ReactHostOperationHistoryHook.getHistory();
31524
31525 if (currentFlushNesting === 0) {
31526 currentFlushStartTime = 0;
31527 currentFlushMeasurements = [];
31528 clearHistory();
31529 return;
31530 }
31531
31532 if (previousMeasurements.length || previousOperations.length) {
31533 var registeredIDs = ReactComponentTreeHook.getRegisteredIDs();
31534 flushHistory.push({
31535 duration: performanceNow() - previousStartTime,
31536 measurements: previousMeasurements || [],
31537 operations: previousOperations || [],
31538 treeSnapshot: getTreeSnapshot(registeredIDs)
31539 });
31540 }
31541
31542 clearHistory();
31543 currentFlushStartTime = performanceNow();
31544 currentFlushMeasurements = [];
31545}
31546
31547function checkDebugID(debugID) {
31548 var allowRoot = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
31549
31550 if (allowRoot && debugID === 0) {
31551 return;
31552 }
31553 if (!debugID) {
31554 process.env.NODE_ENV !== 'production' ? warning(false, 'ReactDebugTool: debugID may not be empty.') : void 0;
31555 }
31556}
31557
31558function beginLifeCycleTimer(debugID, timerType) {
31559 if (currentFlushNesting === 0) {
31560 return;
31561 }
31562 if (currentTimerType && !lifeCycleTimerHasWarned) {
31563 process.env.NODE_ENV !== 'production' ? warning(false, 'There is an internal error in the React performance measurement code. ' + 'Did not expect %s timer to start while %s timer is still in ' + 'progress for %s instance.', timerType, currentTimerType || 'no', debugID === currentTimerDebugID ? 'the same' : 'another') : void 0;
31564 lifeCycleTimerHasWarned = true;
31565 }
31566 currentTimerStartTime = performanceNow();
31567 currentTimerNestedFlushDuration = 0;
31568 currentTimerDebugID = debugID;
31569 currentTimerType = timerType;
31570}
31571
31572function endLifeCycleTimer(debugID, timerType) {
31573 if (currentFlushNesting === 0) {
31574 return;
31575 }
31576 if (currentTimerType !== timerType && !lifeCycleTimerHasWarned) {
31577 process.env.NODE_ENV !== 'production' ? warning(false, 'There is an internal error in the React performance measurement code. ' + 'We did not expect %s timer to stop while %s timer is still in ' + 'progress for %s instance. Please report this as a bug in React.', timerType, currentTimerType || 'no', debugID === currentTimerDebugID ? 'the same' : 'another') : void 0;
31578 lifeCycleTimerHasWarned = true;
31579 }
31580 if (isProfiling) {
31581 currentFlushMeasurements.push({
31582 timerType: timerType,
31583 instanceID: debugID,
31584 duration: performanceNow() - currentTimerStartTime - currentTimerNestedFlushDuration
31585 });
31586 }
31587 currentTimerStartTime = 0;
31588 currentTimerNestedFlushDuration = 0;
31589 currentTimerDebugID = null;
31590 currentTimerType = null;
31591}
31592
31593function pauseCurrentLifeCycleTimer() {
31594 var currentTimer = {
31595 startTime: currentTimerStartTime,
31596 nestedFlushStartTime: performanceNow(),
31597 debugID: currentTimerDebugID,
31598 timerType: currentTimerType
31599 };
31600 lifeCycleTimerStack.push(currentTimer);
31601 currentTimerStartTime = 0;
31602 currentTimerNestedFlushDuration = 0;
31603 currentTimerDebugID = null;
31604 currentTimerType = null;
31605}
31606
31607function resumeCurrentLifeCycleTimer() {
31608 var _lifeCycleTimerStack$ = lifeCycleTimerStack.pop(),
31609 startTime = _lifeCycleTimerStack$.startTime,
31610 nestedFlushStartTime = _lifeCycleTimerStack$.nestedFlushStartTime,
31611 debugID = _lifeCycleTimerStack$.debugID,
31612 timerType = _lifeCycleTimerStack$.timerType;
31613
31614 var nestedFlushDuration = performanceNow() - nestedFlushStartTime;
31615 currentTimerStartTime = startTime;
31616 currentTimerNestedFlushDuration += nestedFlushDuration;
31617 currentTimerDebugID = debugID;
31618 currentTimerType = timerType;
31619}
31620
31621var lastMarkTimeStamp = 0;
31622var canUsePerformanceMeasure = typeof performance !== 'undefined' && typeof performance.mark === 'function' && typeof performance.clearMarks === 'function' && typeof performance.measure === 'function' && typeof performance.clearMeasures === 'function';
31623
31624function shouldMark(debugID) {
31625 if (!isProfiling || !canUsePerformanceMeasure) {
31626 return false;
31627 }
31628 var element = ReactComponentTreeHook.getElement(debugID);
31629 if (element == null || typeof element !== 'object') {
31630 return false;
31631 }
31632 var isHostElement = typeof element.type === 'string';
31633 if (isHostElement) {
31634 return false;
31635 }
31636 return true;
31637}
31638
31639function markBegin(debugID, markType) {
31640 if (!shouldMark(debugID)) {
31641 return;
31642 }
31643
31644 var markName = debugID + '::' + markType;
31645 lastMarkTimeStamp = performanceNow();
31646 performance.mark(markName);
31647}
31648
31649function markEnd(debugID, markType) {
31650 if (!shouldMark(debugID)) {
31651 return;
31652 }
31653
31654 var markName = debugID + '::' + markType;
31655 var displayName = ReactComponentTreeHook.getDisplayName(debugID) || 'Unknown';
31656
31657 // Chrome has an issue of dropping markers recorded too fast:
31658 // https://bugs.chromium.org/p/chromium/issues/detail?id=640652
31659 // To work around this, we will not report very small measurements.
31660 // I determined the magic number by tweaking it back and forth.
31661 // 0.05ms was enough to prevent the issue, but I set it to 0.1ms to be safe.
31662 // When the bug is fixed, we can `measure()` unconditionally if we want to.
31663 var timeStamp = performanceNow();
31664 if (timeStamp - lastMarkTimeStamp > 0.1) {
31665 var measurementName = displayName + ' [' + markType + ']';
31666 performance.measure(measurementName, markName);
31667 }
31668
31669 performance.clearMarks(markName);
31670 if (measurementName) {
31671 performance.clearMeasures(measurementName);
31672 }
31673}
31674
31675var ReactDebugTool = {
31676 addHook: function (hook) {
31677 hooks.push(hook);
31678 },
31679 removeHook: function (hook) {
31680 for (var i = 0; i < hooks.length; i++) {
31681 if (hooks[i] === hook) {
31682 hooks.splice(i, 1);
31683 i--;
31684 }
31685 }
31686 },
31687 isProfiling: function () {
31688 return isProfiling;
31689 },
31690 beginProfiling: function () {
31691 if (isProfiling) {
31692 return;
31693 }
31694
31695 isProfiling = true;
31696 flushHistory.length = 0;
31697 resetMeasurements();
31698 ReactDebugTool.addHook(ReactHostOperationHistoryHook);
31699 },
31700 endProfiling: function () {
31701 if (!isProfiling) {
31702 return;
31703 }
31704
31705 isProfiling = false;
31706 resetMeasurements();
31707 ReactDebugTool.removeHook(ReactHostOperationHistoryHook);
31708 },
31709 getFlushHistory: function () {
31710 return flushHistory;
31711 },
31712 onBeginFlush: function () {
31713 currentFlushNesting++;
31714 resetMeasurements();
31715 pauseCurrentLifeCycleTimer();
31716 emitEvent('onBeginFlush');
31717 },
31718 onEndFlush: function () {
31719 resetMeasurements();
31720 currentFlushNesting--;
31721 resumeCurrentLifeCycleTimer();
31722 emitEvent('onEndFlush');
31723 },
31724 onBeginLifeCycleTimer: function (debugID, timerType) {
31725 checkDebugID(debugID);
31726 emitEvent('onBeginLifeCycleTimer', debugID, timerType);
31727 markBegin(debugID, timerType);
31728 beginLifeCycleTimer(debugID, timerType);
31729 },
31730 onEndLifeCycleTimer: function (debugID, timerType) {
31731 checkDebugID(debugID);
31732 endLifeCycleTimer(debugID, timerType);
31733 markEnd(debugID, timerType);
31734 emitEvent('onEndLifeCycleTimer', debugID, timerType);
31735 },
31736 onBeginProcessingChildContext: function () {
31737 emitEvent('onBeginProcessingChildContext');
31738 },
31739 onEndProcessingChildContext: function () {
31740 emitEvent('onEndProcessingChildContext');
31741 },
31742 onHostOperation: function (operation) {
31743 checkDebugID(operation.instanceID);
31744 emitEvent('onHostOperation', operation);
31745 },
31746 onSetState: function () {
31747 emitEvent('onSetState');
31748 },
31749 onSetChildren: function (debugID, childDebugIDs) {
31750 checkDebugID(debugID);
31751 childDebugIDs.forEach(checkDebugID);
31752 emitEvent('onSetChildren', debugID, childDebugIDs);
31753 },
31754 onBeforeMountComponent: function (debugID, element, parentDebugID) {
31755 checkDebugID(debugID);
31756 checkDebugID(parentDebugID, true);
31757 emitEvent('onBeforeMountComponent', debugID, element, parentDebugID);
31758 markBegin(debugID, 'mount');
31759 },
31760 onMountComponent: function (debugID) {
31761 checkDebugID(debugID);
31762 markEnd(debugID, 'mount');
31763 emitEvent('onMountComponent', debugID);
31764 },
31765 onBeforeUpdateComponent: function (debugID, element) {
31766 checkDebugID(debugID);
31767 emitEvent('onBeforeUpdateComponent', debugID, element);
31768 markBegin(debugID, 'update');
31769 },
31770 onUpdateComponent: function (debugID) {
31771 checkDebugID(debugID);
31772 markEnd(debugID, 'update');
31773 emitEvent('onUpdateComponent', debugID);
31774 },
31775 onBeforeUnmountComponent: function (debugID) {
31776 checkDebugID(debugID);
31777 emitEvent('onBeforeUnmountComponent', debugID);
31778 markBegin(debugID, 'unmount');
31779 },
31780 onUnmountComponent: function (debugID) {
31781 checkDebugID(debugID);
31782 markEnd(debugID, 'unmount');
31783 emitEvent('onUnmountComponent', debugID);
31784 },
31785 onTestEvent: function () {
31786 emitEvent('onTestEvent');
31787 }
31788};
31789
31790// TODO remove these when RN/www gets updated
31791ReactDebugTool.addDevtool = ReactDebugTool.addHook;
31792ReactDebugTool.removeDevtool = ReactDebugTool.removeHook;
31793
31794ReactDebugTool.addHook(ReactInvalidSetStateWarningHook);
31795ReactDebugTool.addHook(ReactComponentTreeHook);
31796var url = ExecutionEnvironment.canUseDOM && window.location.href || '';
31797if (/[?&]react_perf\b/.test(url)) {
31798 ReactDebugTool.beginProfiling();
31799}
31800
31801module.exports = ReactDebugTool;
31802/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
31803
31804/***/ }),
31805/* 117 */
31806/***/ (function(module, exports, __webpack_require__) {
31807
31808"use strict";
31809/* WEBPACK VAR INJECTION */(function(process) {/**
31810 * Copyright 2016-present, Facebook, Inc.
31811 * All rights reserved.
31812 *
31813 * This source code is licensed under the BSD-style license found in the
31814 * LICENSE file in the root directory of this source tree. An additional grant
31815 * of patent rights can be found in the PATENTS file in the same directory.
31816 *
31817 *
31818 */
31819
31820
31821
31822var warning = __webpack_require__(2);
31823
31824if (process.env.NODE_ENV !== 'production') {
31825 var processingChildContext = false;
31826
31827 var warnInvalidSetState = function () {
31828 process.env.NODE_ENV !== 'production' ? warning(!processingChildContext, 'setState(...): Cannot call setState() inside getChildContext()') : void 0;
31829 };
31830}
31831
31832var ReactInvalidSetStateWarningHook = {
31833 onBeginProcessingChildContext: function () {
31834 processingChildContext = true;
31835 },
31836 onEndProcessingChildContext: function () {
31837 processingChildContext = false;
31838 },
31839 onSetState: function () {
31840 warnInvalidSetState();
31841 }
31842};
31843
31844module.exports = ReactInvalidSetStateWarningHook;
31845/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
31846
31847/***/ }),
31848/* 118 */
31849/***/ (function(module, exports, __webpack_require__) {
31850
31851"use strict";
31852/**
31853 * Copyright 2016-present, Facebook, Inc.
31854 * All rights reserved.
31855 *
31856 * This source code is licensed under the BSD-style license found in the
31857 * LICENSE file in the root directory of this source tree. An additional grant
31858 * of patent rights can be found in the PATENTS file in the same directory.
31859 *
31860 *
31861 */
31862
31863
31864
31865var history = [];
31866
31867var ReactHostOperationHistoryHook = {
31868 onHostOperation: function (operation) {
31869 history.push(operation);
31870 },
31871 clearHistory: function () {
31872 if (ReactHostOperationHistoryHook._preventClearing) {
31873 // Should only be used for tests.
31874 return;
31875 }
31876
31877 history = [];
31878 },
31879 getHistory: function () {
31880 return history;
31881 }
31882};
31883
31884module.exports = ReactHostOperationHistoryHook;
31885
31886/***/ }),
31887/* 119 */
31888/***/ (function(module, exports, __webpack_require__) {
31889
31890"use strict";
31891
31892
31893/**
31894 * Copyright (c) 2013-present, Facebook, Inc.
31895 * All rights reserved.
31896 *
31897 * This source code is licensed under the BSD-style license found in the
31898 * LICENSE file in the root directory of this source tree. An additional grant
31899 * of patent rights can be found in the PATENTS file in the same directory.
31900 *
31901 * @typechecks
31902 */
31903
31904var performance = __webpack_require__(120);
31905
31906var performanceNow;
31907
31908/**
31909 * Detect if we can use `window.performance.now()` and gracefully fallback to
31910 * `Date.now()` if it doesn't exist. We need to support Firefox < 15 for now
31911 * because of Facebook's testing infrastructure.
31912 */
31913if (performance.now) {
31914 performanceNow = function performanceNow() {
31915 return performance.now();
31916 };
31917} else {
31918 performanceNow = function performanceNow() {
31919 return Date.now();
31920 };
31921}
31922
31923module.exports = performanceNow;
31924
31925/***/ }),
31926/* 120 */
31927/***/ (function(module, exports, __webpack_require__) {
31928
31929"use strict";
31930/**
31931 * Copyright (c) 2013-present, Facebook, Inc.
31932 * All rights reserved.
31933 *
31934 * This source code is licensed under the BSD-style license found in the
31935 * LICENSE file in the root directory of this source tree. An additional grant
31936 * of patent rights can be found in the PATENTS file in the same directory.
31937 *
31938 * @typechecks
31939 */
31940
31941
31942
31943var ExecutionEnvironment = __webpack_require__(6);
31944
31945var performance;
31946
31947if (ExecutionEnvironment.canUseDOM) {
31948 performance = window.performance || window.msPerformance || window.webkitPerformance;
31949}
31950
31951module.exports = performance || {};
31952
31953/***/ }),
31954/* 121 */
31955/***/ (function(module, exports, __webpack_require__) {
31956
31957"use strict";
31958/**
31959 * Copyright 2013-present, Facebook, Inc.
31960 * All rights reserved.
31961 *
31962 * This source code is licensed under the BSD-style license found in the
31963 * LICENSE file in the root directory of this source tree. An additional grant
31964 * of patent rights can be found in the PATENTS file in the same directory.
31965 *
31966 */
31967
31968
31969
31970/**
31971 * Module that is injectable into `EventPluginHub`, that specifies a
31972 * deterministic ordering of `EventPlugin`s. A convenient way to reason about
31973 * plugins, without having to package every one of them. This is better than
31974 * having plugins be ordered in the same order that they are injected because
31975 * that ordering would be influenced by the packaging order.
31976 * `ResponderEventPlugin` must occur before `SimpleEventPlugin` so that
31977 * preventing default on events is convenient in `SimpleEventPlugin` handlers.
31978 */
31979
31980var DefaultEventPluginOrder = ['ResponderEventPlugin', 'SimpleEventPlugin', 'TapEventPlugin', 'EnterLeaveEventPlugin', 'ChangeEventPlugin', 'SelectEventPlugin', 'BeforeInputEventPlugin'];
31981
31982module.exports = DefaultEventPluginOrder;
31983
31984/***/ }),
31985/* 122 */
31986/***/ (function(module, exports, __webpack_require__) {
31987
31988"use strict";
31989/**
31990 * Copyright 2013-present, Facebook, Inc.
31991 * All rights reserved.
31992 *
31993 * This source code is licensed under the BSD-style license found in the
31994 * LICENSE file in the root directory of this source tree. An additional grant
31995 * of patent rights can be found in the PATENTS file in the same directory.
31996 *
31997 */
31998
31999
32000
32001var EventPropagators = __webpack_require__(21);
32002var ReactDOMComponentTree = __webpack_require__(5);
32003var SyntheticMouseEvent = __webpack_require__(30);
32004
32005var eventTypes = {
32006 mouseEnter: {
32007 registrationName: 'onMouseEnter',
32008 dependencies: ['topMouseOut', 'topMouseOver']
32009 },
32010 mouseLeave: {
32011 registrationName: 'onMouseLeave',
32012 dependencies: ['topMouseOut', 'topMouseOver']
32013 }
32014};
32015
32016var EnterLeaveEventPlugin = {
32017 eventTypes: eventTypes,
32018
32019 /**
32020 * For almost every interaction we care about, there will be both a top-level
32021 * `mouseover` and `mouseout` event that occurs. Only use `mouseout` so that
32022 * we do not extract duplicate events. However, moving the mouse into the
32023 * browser from outside will not fire a `mouseout` event. In this case, we use
32024 * the `mouseover` top-level event.
32025 */
32026 extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
32027 if (topLevelType === 'topMouseOver' && (nativeEvent.relatedTarget || nativeEvent.fromElement)) {
32028 return null;
32029 }
32030 if (topLevelType !== 'topMouseOut' && topLevelType !== 'topMouseOver') {
32031 // Must not be a mouse in or mouse out - ignoring.
32032 return null;
32033 }
32034
32035 var win;
32036 if (nativeEventTarget.window === nativeEventTarget) {
32037 // `nativeEventTarget` is probably a window object.
32038 win = nativeEventTarget;
32039 } else {
32040 // TODO: Figure out why `ownerDocument` is sometimes undefined in IE8.
32041 var doc = nativeEventTarget.ownerDocument;
32042 if (doc) {
32043 win = doc.defaultView || doc.parentWindow;
32044 } else {
32045 win = window;
32046 }
32047 }
32048
32049 var from;
32050 var to;
32051 if (topLevelType === 'topMouseOut') {
32052 from = targetInst;
32053 var related = nativeEvent.relatedTarget || nativeEvent.toElement;
32054 to = related ? ReactDOMComponentTree.getClosestInstanceFromNode(related) : null;
32055 } else {
32056 // Moving to a node from outside the window.
32057 from = null;
32058 to = targetInst;
32059 }
32060
32061 if (from === to) {
32062 // Nothing pertains to our managed components.
32063 return null;
32064 }
32065
32066 var fromNode = from == null ? win : ReactDOMComponentTree.getNodeFromInstance(from);
32067 var toNode = to == null ? win : ReactDOMComponentTree.getNodeFromInstance(to);
32068
32069 var leave = SyntheticMouseEvent.getPooled(eventTypes.mouseLeave, from, nativeEvent, nativeEventTarget);
32070 leave.type = 'mouseleave';
32071 leave.target = fromNode;
32072 leave.relatedTarget = toNode;
32073
32074 var enter = SyntheticMouseEvent.getPooled(eventTypes.mouseEnter, to, nativeEvent, nativeEventTarget);
32075 enter.type = 'mouseenter';
32076 enter.target = toNode;
32077 enter.relatedTarget = fromNode;
32078
32079 EventPropagators.accumulateEnterLeaveDispatches(leave, enter, from, to);
32080
32081 return [leave, enter];
32082 }
32083};
32084
32085module.exports = EnterLeaveEventPlugin;
32086
32087/***/ }),
32088/* 123 */
32089/***/ (function(module, exports, __webpack_require__) {
32090
32091"use strict";
32092/**
32093 * Copyright 2013-present, Facebook, Inc.
32094 * All rights reserved.
32095 *
32096 * This source code is licensed under the BSD-style license found in the
32097 * LICENSE file in the root directory of this source tree. An additional grant
32098 * of patent rights can be found in the PATENTS file in the same directory.
32099 *
32100 */
32101
32102
32103
32104var DOMProperty = __webpack_require__(13);
32105
32106var MUST_USE_PROPERTY = DOMProperty.injection.MUST_USE_PROPERTY;
32107var HAS_BOOLEAN_VALUE = DOMProperty.injection.HAS_BOOLEAN_VALUE;
32108var HAS_NUMERIC_VALUE = DOMProperty.injection.HAS_NUMERIC_VALUE;
32109var HAS_POSITIVE_NUMERIC_VALUE = DOMProperty.injection.HAS_POSITIVE_NUMERIC_VALUE;
32110var HAS_OVERLOADED_BOOLEAN_VALUE = DOMProperty.injection.HAS_OVERLOADED_BOOLEAN_VALUE;
32111
32112var HTMLDOMPropertyConfig = {
32113 isCustomAttribute: RegExp.prototype.test.bind(new RegExp('^(data|aria)-[' + DOMProperty.ATTRIBUTE_NAME_CHAR + ']*$')),
32114 Properties: {
32115 /**
32116 * Standard Properties
32117 */
32118 accept: 0,
32119 acceptCharset: 0,
32120 accessKey: 0,
32121 action: 0,
32122 allowFullScreen: HAS_BOOLEAN_VALUE,
32123 allowTransparency: 0,
32124 alt: 0,
32125 // specifies target context for links with `preload` type
32126 as: 0,
32127 async: HAS_BOOLEAN_VALUE,
32128 autoComplete: 0,
32129 // autoFocus is polyfilled/normalized by AutoFocusUtils
32130 // autoFocus: HAS_BOOLEAN_VALUE,
32131 autoPlay: HAS_BOOLEAN_VALUE,
32132 capture: HAS_BOOLEAN_VALUE,
32133 cellPadding: 0,
32134 cellSpacing: 0,
32135 charSet: 0,
32136 challenge: 0,
32137 checked: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
32138 cite: 0,
32139 classID: 0,
32140 className: 0,
32141 cols: HAS_POSITIVE_NUMERIC_VALUE,
32142 colSpan: 0,
32143 content: 0,
32144 contentEditable: 0,
32145 contextMenu: 0,
32146 controls: HAS_BOOLEAN_VALUE,
32147 coords: 0,
32148 crossOrigin: 0,
32149 data: 0, // For `<object />` acts as `src`.
32150 dateTime: 0,
32151 'default': HAS_BOOLEAN_VALUE,
32152 defer: HAS_BOOLEAN_VALUE,
32153 dir: 0,
32154 disabled: HAS_BOOLEAN_VALUE,
32155 download: HAS_OVERLOADED_BOOLEAN_VALUE,
32156 draggable: 0,
32157 encType: 0,
32158 form: 0,
32159 formAction: 0,
32160 formEncType: 0,
32161 formMethod: 0,
32162 formNoValidate: HAS_BOOLEAN_VALUE,
32163 formTarget: 0,
32164 frameBorder: 0,
32165 headers: 0,
32166 height: 0,
32167 hidden: HAS_BOOLEAN_VALUE,
32168 high: 0,
32169 href: 0,
32170 hrefLang: 0,
32171 htmlFor: 0,
32172 httpEquiv: 0,
32173 icon: 0,
32174 id: 0,
32175 inputMode: 0,
32176 integrity: 0,
32177 is: 0,
32178 keyParams: 0,
32179 keyType: 0,
32180 kind: 0,
32181 label: 0,
32182 lang: 0,
32183 list: 0,
32184 loop: HAS_BOOLEAN_VALUE,
32185 low: 0,
32186 manifest: 0,
32187 marginHeight: 0,
32188 marginWidth: 0,
32189 max: 0,
32190 maxLength: 0,
32191 media: 0,
32192 mediaGroup: 0,
32193 method: 0,
32194 min: 0,
32195 minLength: 0,
32196 // Caution; `option.selected` is not updated if `select.multiple` is
32197 // disabled with `removeAttribute`.
32198 multiple: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
32199 muted: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
32200 name: 0,
32201 nonce: 0,
32202 noValidate: HAS_BOOLEAN_VALUE,
32203 open: HAS_BOOLEAN_VALUE,
32204 optimum: 0,
32205 pattern: 0,
32206 placeholder: 0,
32207 playsInline: HAS_BOOLEAN_VALUE,
32208 poster: 0,
32209 preload: 0,
32210 profile: 0,
32211 radioGroup: 0,
32212 readOnly: HAS_BOOLEAN_VALUE,
32213 referrerPolicy: 0,
32214 rel: 0,
32215 required: HAS_BOOLEAN_VALUE,
32216 reversed: HAS_BOOLEAN_VALUE,
32217 role: 0,
32218 rows: HAS_POSITIVE_NUMERIC_VALUE,
32219 rowSpan: HAS_NUMERIC_VALUE,
32220 sandbox: 0,
32221 scope: 0,
32222 scoped: HAS_BOOLEAN_VALUE,
32223 scrolling: 0,
32224 seamless: HAS_BOOLEAN_VALUE,
32225 selected: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
32226 shape: 0,
32227 size: HAS_POSITIVE_NUMERIC_VALUE,
32228 sizes: 0,
32229 span: HAS_POSITIVE_NUMERIC_VALUE,
32230 spellCheck: 0,
32231 src: 0,
32232 srcDoc: 0,
32233 srcLang: 0,
32234 srcSet: 0,
32235 start: HAS_NUMERIC_VALUE,
32236 step: 0,
32237 style: 0,
32238 summary: 0,
32239 tabIndex: 0,
32240 target: 0,
32241 title: 0,
32242 // Setting .type throws on non-<input> tags
32243 type: 0,
32244 useMap: 0,
32245 value: 0,
32246 width: 0,
32247 wmode: 0,
32248 wrap: 0,
32249
32250 /**
32251 * RDFa Properties
32252 */
32253 about: 0,
32254 datatype: 0,
32255 inlist: 0,
32256 prefix: 0,
32257 // property is also supported for OpenGraph in meta tags.
32258 property: 0,
32259 resource: 0,
32260 'typeof': 0,
32261 vocab: 0,
32262
32263 /**
32264 * Non-standard Properties
32265 */
32266 // autoCapitalize and autoCorrect are supported in Mobile Safari for
32267 // keyboard hints.
32268 autoCapitalize: 0,
32269 autoCorrect: 0,
32270 // autoSave allows WebKit/Blink to persist values of input fields on page reloads
32271 autoSave: 0,
32272 // color is for Safari mask-icon link
32273 color: 0,
32274 // itemProp, itemScope, itemType are for
32275 // Microdata support. See http://schema.org/docs/gs.html
32276 itemProp: 0,
32277 itemScope: HAS_BOOLEAN_VALUE,
32278 itemType: 0,
32279 // itemID and itemRef are for Microdata support as well but
32280 // only specified in the WHATWG spec document. See
32281 // https://html.spec.whatwg.org/multipage/microdata.html#microdata-dom-api
32282 itemID: 0,
32283 itemRef: 0,
32284 // results show looking glass icon and recent searches on input
32285 // search fields in WebKit/Blink
32286 results: 0,
32287 // IE-only attribute that specifies security restrictions on an iframe
32288 // as an alternative to the sandbox attribute on IE<10
32289 security: 0,
32290 // IE-only attribute that controls focus behavior
32291 unselectable: 0
32292 },
32293 DOMAttributeNames: {
32294 acceptCharset: 'accept-charset',
32295 className: 'class',
32296 htmlFor: 'for',
32297 httpEquiv: 'http-equiv'
32298 },
32299 DOMPropertyNames: {},
32300 DOMMutationMethods: {
32301 value: function (node, value) {
32302 if (value == null) {
32303 return node.removeAttribute('value');
32304 }
32305
32306 // Number inputs get special treatment due to some edge cases in
32307 // Chrome. Let everything else assign the value attribute as normal.
32308 // https://github.com/facebook/react/issues/7253#issuecomment-236074326
32309 if (node.type !== 'number' || node.hasAttribute('value') === false) {
32310 node.setAttribute('value', '' + value);
32311 } else if (node.validity && !node.validity.badInput && node.ownerDocument.activeElement !== node) {
32312 // Don't assign an attribute if validation reports bad
32313 // input. Chrome will clear the value. Additionally, don't
32314 // operate on inputs that have focus, otherwise Chrome might
32315 // strip off trailing decimal places and cause the user's
32316 // cursor position to jump to the beginning of the input.
32317 //
32318 // In ReactDOMInput, we have an onBlur event that will trigger
32319 // this function again when focus is lost.
32320 node.setAttribute('value', '' + value);
32321 }
32322 }
32323 }
32324};
32325
32326module.exports = HTMLDOMPropertyConfig;
32327
32328/***/ }),
32329/* 124 */
32330/***/ (function(module, exports, __webpack_require__) {
32331
32332"use strict";
32333/**
32334 * Copyright 2013-present, Facebook, Inc.
32335 * All rights reserved.
32336 *
32337 * This source code is licensed under the BSD-style license found in the
32338 * LICENSE file in the root directory of this source tree. An additional grant
32339 * of patent rights can be found in the PATENTS file in the same directory.
32340 *
32341 */
32342
32343
32344
32345var DOMChildrenOperations = __webpack_require__(43);
32346var ReactDOMIDOperations = __webpack_require__(129);
32347
32348/**
32349 * Abstracts away all functionality of the reconciler that requires knowledge of
32350 * the browser context. TODO: These callers should be refactored to avoid the
32351 * need for this injection.
32352 */
32353var ReactComponentBrowserEnvironment = {
32354 processChildrenUpdates: ReactDOMIDOperations.dangerouslyProcessChildrenUpdates,
32355
32356 replaceNodeWithMarkup: DOMChildrenOperations.dangerouslyReplaceNodeWithMarkup
32357};
32358
32359module.exports = ReactComponentBrowserEnvironment;
32360
32361/***/ }),
32362/* 125 */
32363/***/ (function(module, exports, __webpack_require__) {
32364
32365"use strict";
32366/* WEBPACK VAR INJECTION */(function(process) {/**
32367 * Copyright 2013-present, Facebook, Inc.
32368 * All rights reserved.
32369 *
32370 * This source code is licensed under the BSD-style license found in the
32371 * LICENSE file in the root directory of this source tree. An additional grant
32372 * of patent rights can be found in the PATENTS file in the same directory.
32373 *
32374 */
32375
32376
32377
32378var _prodInvariant = __webpack_require__(3);
32379
32380var DOMLazyTree = __webpack_require__(20);
32381var ExecutionEnvironment = __webpack_require__(6);
32382
32383var createNodesFromMarkup = __webpack_require__(126);
32384var emptyFunction = __webpack_require__(8);
32385var invariant = __webpack_require__(1);
32386
32387var Danger = {
32388 /**
32389 * Replaces a node with a string of markup at its current position within its
32390 * parent. The markup must render into a single root node.
32391 *
32392 * @param {DOMElement} oldChild Child node to replace.
32393 * @param {string} markup Markup to render in place of the child node.
32394 * @internal
32395 */
32396 dangerouslyReplaceNodeWithMarkup: function (oldChild, markup) {
32397 !ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? invariant(false, 'dangerouslyReplaceNodeWithMarkup(...): Cannot render markup in a worker thread. Make sure `window` and `document` are available globally before requiring React when unit testing or use ReactDOMServer.renderToString() for server rendering.') : _prodInvariant('56') : void 0;
32398 !markup ? process.env.NODE_ENV !== 'production' ? invariant(false, 'dangerouslyReplaceNodeWithMarkup(...): Missing markup.') : _prodInvariant('57') : void 0;
32399 !(oldChild.nodeName !== 'HTML') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'dangerouslyReplaceNodeWithMarkup(...): Cannot replace markup of the <html> node. This is because browser quirks make this unreliable and/or slow. If you want to render to the root you must use server rendering. See ReactDOMServer.renderToString().') : _prodInvariant('58') : void 0;
32400
32401 if (typeof markup === 'string') {
32402 var newChild = createNodesFromMarkup(markup, emptyFunction)[0];
32403 oldChild.parentNode.replaceChild(newChild, oldChild);
32404 } else {
32405 DOMLazyTree.replaceChildWithTree(oldChild, markup);
32406 }
32407 }
32408};
32409
32410module.exports = Danger;
32411/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
32412
32413/***/ }),
32414/* 126 */
32415/***/ (function(module, exports, __webpack_require__) {
32416
32417"use strict";
32418/* WEBPACK VAR INJECTION */(function(process) {
32419
32420/**
32421 * Copyright (c) 2013-present, Facebook, Inc.
32422 * All rights reserved.
32423 *
32424 * This source code is licensed under the BSD-style license found in the
32425 * LICENSE file in the root directory of this source tree. An additional grant
32426 * of patent rights can be found in the PATENTS file in the same directory.
32427 *
32428 * @typechecks
32429 */
32430
32431/*eslint-disable fb-www/unsafe-html*/
32432
32433var ExecutionEnvironment = __webpack_require__(6);
32434
32435var createArrayFromMixed = __webpack_require__(127);
32436var getMarkupWrap = __webpack_require__(128);
32437var invariant = __webpack_require__(1);
32438
32439/**
32440 * Dummy container used to render all markup.
32441 */
32442var dummyNode = ExecutionEnvironment.canUseDOM ? document.createElement('div') : null;
32443
32444/**
32445 * Pattern used by `getNodeName`.
32446 */
32447var nodeNamePattern = /^\s*<(\w+)/;
32448
32449/**
32450 * Extracts the `nodeName` of the first element in a string of markup.
32451 *
32452 * @param {string} markup String of markup.
32453 * @return {?string} Node name of the supplied markup.
32454 */
32455function getNodeName(markup) {
32456 var nodeNameMatch = markup.match(nodeNamePattern);
32457 return nodeNameMatch && nodeNameMatch[1].toLowerCase();
32458}
32459
32460/**
32461 * Creates an array containing the nodes rendered from the supplied markup. The
32462 * optionally supplied `handleScript` function will be invoked once for each
32463 * <script> element that is rendered. If no `handleScript` function is supplied,
32464 * an exception is thrown if any <script> elements are rendered.
32465 *
32466 * @param {string} markup A string of valid HTML markup.
32467 * @param {?function} handleScript Invoked once for each rendered <script>.
32468 * @return {array<DOMElement|DOMTextNode>} An array of rendered nodes.
32469 */
32470function createNodesFromMarkup(markup, handleScript) {
32471 var node = dummyNode;
32472 !!!dummyNode ? process.env.NODE_ENV !== 'production' ? invariant(false, 'createNodesFromMarkup dummy not initialized') : invariant(false) : void 0;
32473 var nodeName = getNodeName(markup);
32474
32475 var wrap = nodeName && getMarkupWrap(nodeName);
32476 if (wrap) {
32477 node.innerHTML = wrap[1] + markup + wrap[2];
32478
32479 var wrapDepth = wrap[0];
32480 while (wrapDepth--) {
32481 node = node.lastChild;
32482 }
32483 } else {
32484 node.innerHTML = markup;
32485 }
32486
32487 var scripts = node.getElementsByTagName('script');
32488 if (scripts.length) {
32489 !handleScript ? process.env.NODE_ENV !== 'production' ? invariant(false, 'createNodesFromMarkup(...): Unexpected <script> element rendered.') : invariant(false) : void 0;
32490 createArrayFromMixed(scripts).forEach(handleScript);
32491 }
32492
32493 var nodes = Array.from(node.childNodes);
32494 while (node.lastChild) {
32495 node.removeChild(node.lastChild);
32496 }
32497 return nodes;
32498}
32499
32500module.exports = createNodesFromMarkup;
32501/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
32502
32503/***/ }),
32504/* 127 */
32505/***/ (function(module, exports, __webpack_require__) {
32506
32507"use strict";
32508/* WEBPACK VAR INJECTION */(function(process) {
32509
32510/**
32511 * Copyright (c) 2013-present, Facebook, Inc.
32512 * All rights reserved.
32513 *
32514 * This source code is licensed under the BSD-style license found in the
32515 * LICENSE file in the root directory of this source tree. An additional grant
32516 * of patent rights can be found in the PATENTS file in the same directory.
32517 *
32518 * @typechecks
32519 */
32520
32521var invariant = __webpack_require__(1);
32522
32523/**
32524 * Convert array-like objects to arrays.
32525 *
32526 * This API assumes the caller knows the contents of the data type. For less
32527 * well defined inputs use createArrayFromMixed.
32528 *
32529 * @param {object|function|filelist} obj
32530 * @return {array}
32531 */
32532function toArray(obj) {
32533 var length = obj.length;
32534
32535 // Some browsers builtin objects can report typeof 'function' (e.g. NodeList
32536 // in old versions of Safari).
32537 !(!Array.isArray(obj) && (typeof obj === 'object' || typeof obj === 'function')) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'toArray: Array-like object expected') : invariant(false) : void 0;
32538
32539 !(typeof length === 'number') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'toArray: Object needs a length property') : invariant(false) : void 0;
32540
32541 !(length === 0 || length - 1 in obj) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'toArray: Object should have keys for indices') : invariant(false) : void 0;
32542
32543 !(typeof obj.callee !== 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'toArray: Object can\'t be `arguments`. Use rest params ' + '(function(...args) {}) or Array.from() instead.') : invariant(false) : void 0;
32544
32545 // Old IE doesn't give collections access to hasOwnProperty. Assume inputs
32546 // without method will throw during the slice call and skip straight to the
32547 // fallback.
32548 if (obj.hasOwnProperty) {
32549 try {
32550 return Array.prototype.slice.call(obj);
32551 } catch (e) {
32552 // IE < 9 does not support Array#slice on collections objects
32553 }
32554 }
32555
32556 // Fall back to copying key by key. This assumes all keys have a value,
32557 // so will not preserve sparsely populated inputs.
32558 var ret = Array(length);
32559 for (var ii = 0; ii < length; ii++) {
32560 ret[ii] = obj[ii];
32561 }
32562 return ret;
32563}
32564
32565/**
32566 * Perform a heuristic test to determine if an object is "array-like".
32567 *
32568 * A monk asked Joshu, a Zen master, "Has a dog Buddha nature?"
32569 * Joshu replied: "Mu."
32570 *
32571 * This function determines if its argument has "array nature": it returns
32572 * true if the argument is an actual array, an `arguments' object, or an
32573 * HTMLCollection (e.g. node.childNodes or node.getElementsByTagName()).
32574 *
32575 * It will return false for other array-like objects like Filelist.
32576 *
32577 * @param {*} obj
32578 * @return {boolean}
32579 */
32580function hasArrayNature(obj) {
32581 return (
32582 // not null/false
32583 !!obj && (
32584 // arrays are objects, NodeLists are functions in Safari
32585 typeof obj == 'object' || typeof obj == 'function') &&
32586 // quacks like an array
32587 'length' in obj &&
32588 // not window
32589 !('setInterval' in obj) &&
32590 // no DOM node should be considered an array-like
32591 // a 'select' element has 'length' and 'item' properties on IE8
32592 typeof obj.nodeType != 'number' && (
32593 // a real array
32594 Array.isArray(obj) ||
32595 // arguments
32596 'callee' in obj ||
32597 // HTMLCollection/NodeList
32598 'item' in obj)
32599 );
32600}
32601
32602/**
32603 * Ensure that the argument is an array by wrapping it in an array if it is not.
32604 * Creates a copy of the argument if it is already an array.
32605 *
32606 * This is mostly useful idiomatically:
32607 *
32608 * var createArrayFromMixed = require('createArrayFromMixed');
32609 *
32610 * function takesOneOrMoreThings(things) {
32611 * things = createArrayFromMixed(things);
32612 * ...
32613 * }
32614 *
32615 * This allows you to treat `things' as an array, but accept scalars in the API.
32616 *
32617 * If you need to convert an array-like object, like `arguments`, into an array
32618 * use toArray instead.
32619 *
32620 * @param {*} obj
32621 * @return {array}
32622 */
32623function createArrayFromMixed(obj) {
32624 if (!hasArrayNature(obj)) {
32625 return [obj];
32626 } else if (Array.isArray(obj)) {
32627 return obj.slice();
32628 } else {
32629 return toArray(obj);
32630 }
32631}
32632
32633module.exports = createArrayFromMixed;
32634/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
32635
32636/***/ }),
32637/* 128 */
32638/***/ (function(module, exports, __webpack_require__) {
32639
32640"use strict";
32641/* WEBPACK VAR INJECTION */(function(process) {
32642
32643/**
32644 * Copyright (c) 2013-present, Facebook, Inc.
32645 * All rights reserved.
32646 *
32647 * This source code is licensed under the BSD-style license found in the
32648 * LICENSE file in the root directory of this source tree. An additional grant
32649 * of patent rights can be found in the PATENTS file in the same directory.
32650 *
32651 */
32652
32653/*eslint-disable fb-www/unsafe-html */
32654
32655var ExecutionEnvironment = __webpack_require__(6);
32656
32657var invariant = __webpack_require__(1);
32658
32659/**
32660 * Dummy container used to detect which wraps are necessary.
32661 */
32662var dummyNode = ExecutionEnvironment.canUseDOM ? document.createElement('div') : null;
32663
32664/**
32665 * Some browsers cannot use `innerHTML` to render certain elements standalone,
32666 * so we wrap them, render the wrapped nodes, then extract the desired node.
32667 *
32668 * In IE8, certain elements cannot render alone, so wrap all elements ('*').
32669 */
32670
32671var shouldWrap = {};
32672
32673var selectWrap = [1, '<select multiple="true">', '</select>'];
32674var tableWrap = [1, '<table>', '</table>'];
32675var trWrap = [3, '<table><tbody><tr>', '</tr></tbody></table>'];
32676
32677var svgWrap = [1, '<svg xmlns="http://www.w3.org/2000/svg">', '</svg>'];
32678
32679var markupWrap = {
32680 '*': [1, '?<div>', '</div>'],
32681
32682 'area': [1, '<map>', '</map>'],
32683 'col': [2, '<table><tbody></tbody><colgroup>', '</colgroup></table>'],
32684 'legend': [1, '<fieldset>', '</fieldset>'],
32685 'param': [1, '<object>', '</object>'],
32686 'tr': [2, '<table><tbody>', '</tbody></table>'],
32687
32688 'optgroup': selectWrap,
32689 'option': selectWrap,
32690
32691 'caption': tableWrap,
32692 'colgroup': tableWrap,
32693 'tbody': tableWrap,
32694 'tfoot': tableWrap,
32695 'thead': tableWrap,
32696
32697 'td': trWrap,
32698 'th': trWrap
32699};
32700
32701// Initialize the SVG elements since we know they'll always need to be wrapped
32702// consistently. If they are created inside a <div> they will be initialized in
32703// the wrong namespace (and will not display).
32704var svgElements = ['circle', 'clipPath', 'defs', 'ellipse', 'g', 'image', 'line', 'linearGradient', 'mask', 'path', 'pattern', 'polygon', 'polyline', 'radialGradient', 'rect', 'stop', 'text', 'tspan'];
32705svgElements.forEach(function (nodeName) {
32706 markupWrap[nodeName] = svgWrap;
32707 shouldWrap[nodeName] = true;
32708});
32709
32710/**
32711 * Gets the markup wrap configuration for the supplied `nodeName`.
32712 *
32713 * NOTE: This lazily detects which wraps are necessary for the current browser.
32714 *
32715 * @param {string} nodeName Lowercase `nodeName`.
32716 * @return {?array} Markup wrap configuration, if applicable.
32717 */
32718function getMarkupWrap(nodeName) {
32719 !!!dummyNode ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Markup wrapping node not initialized') : invariant(false) : void 0;
32720 if (!markupWrap.hasOwnProperty(nodeName)) {
32721 nodeName = '*';
32722 }
32723 if (!shouldWrap.hasOwnProperty(nodeName)) {
32724 if (nodeName === '*') {
32725 dummyNode.innerHTML = '<link />';
32726 } else {
32727 dummyNode.innerHTML = '<' + nodeName + '></' + nodeName + '>';
32728 }
32729 shouldWrap[nodeName] = !dummyNode.firstChild;
32730 }
32731 return shouldWrap[nodeName] ? markupWrap[nodeName] : null;
32732}
32733
32734module.exports = getMarkupWrap;
32735/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
32736
32737/***/ }),
32738/* 129 */
32739/***/ (function(module, exports, __webpack_require__) {
32740
32741"use strict";
32742/**
32743 * Copyright 2013-present, Facebook, Inc.
32744 * All rights reserved.
32745 *
32746 * This source code is licensed under the BSD-style license found in the
32747 * LICENSE file in the root directory of this source tree. An additional grant
32748 * of patent rights can be found in the PATENTS file in the same directory.
32749 *
32750 */
32751
32752
32753
32754var DOMChildrenOperations = __webpack_require__(43);
32755var ReactDOMComponentTree = __webpack_require__(5);
32756
32757/**
32758 * Operations used to process updates to DOM nodes.
32759 */
32760var ReactDOMIDOperations = {
32761 /**
32762 * Updates a component's children by processing a series of updates.
32763 *
32764 * @param {array<object>} updates List of update configurations.
32765 * @internal
32766 */
32767 dangerouslyProcessChildrenUpdates: function (parentInst, updates) {
32768 var node = ReactDOMComponentTree.getNodeFromInstance(parentInst);
32769 DOMChildrenOperations.processUpdates(node, updates);
32770 }
32771};
32772
32773module.exports = ReactDOMIDOperations;
32774
32775/***/ }),
32776/* 130 */
32777/***/ (function(module, exports, __webpack_require__) {
32778
32779"use strict";
32780/* WEBPACK VAR INJECTION */(function(process) {/**
32781 * Copyright 2013-present, Facebook, Inc.
32782 * All rights reserved.
32783 *
32784 * This source code is licensed under the BSD-style license found in the
32785 * LICENSE file in the root directory of this source tree. An additional grant
32786 * of patent rights can be found in the PATENTS file in the same directory.
32787 *
32788 */
32789
32790/* global hasOwnProperty:true */
32791
32792
32793
32794var _prodInvariant = __webpack_require__(3),
32795 _assign = __webpack_require__(4);
32796
32797var AutoFocusUtils = __webpack_require__(131);
32798var CSSPropertyOperations = __webpack_require__(132);
32799var DOMLazyTree = __webpack_require__(20);
32800var DOMNamespaces = __webpack_require__(44);
32801var DOMProperty = __webpack_require__(13);
32802var DOMPropertyOperations = __webpack_require__(76);
32803var EventPluginHub = __webpack_require__(22);
32804var EventPluginRegistry = __webpack_require__(28);
32805var ReactBrowserEventEmitter = __webpack_require__(33);
32806var ReactDOMComponentFlags = __webpack_require__(64);
32807var ReactDOMComponentTree = __webpack_require__(5);
32808var ReactDOMInput = __webpack_require__(142);
32809var ReactDOMOption = __webpack_require__(143);
32810var ReactDOMSelect = __webpack_require__(78);
32811var ReactDOMTextarea = __webpack_require__(144);
32812var ReactInstrumentation = __webpack_require__(9);
32813var ReactMultiChild = __webpack_require__(145);
32814var ReactServerRenderingTransaction = __webpack_require__(154);
32815
32816var emptyFunction = __webpack_require__(8);
32817var escapeTextContentForBrowser = __webpack_require__(32);
32818var invariant = __webpack_require__(1);
32819var isEventSupported = __webpack_require__(41);
32820var shallowEqual = __webpack_require__(48);
32821var inputValueTracking = __webpack_require__(70);
32822var validateDOMNesting = __webpack_require__(52);
32823var warning = __webpack_require__(2);
32824
32825var Flags = ReactDOMComponentFlags;
32826var deleteListener = EventPluginHub.deleteListener;
32827var getNode = ReactDOMComponentTree.getNodeFromInstance;
32828var listenTo = ReactBrowserEventEmitter.listenTo;
32829var registrationNameModules = EventPluginRegistry.registrationNameModules;
32830
32831// For quickly matching children type, to test if can be treated as content.
32832var CONTENT_TYPES = { string: true, number: true };
32833
32834var STYLE = 'style';
32835var HTML = '__html';
32836var RESERVED_PROPS = {
32837 children: null,
32838 dangerouslySetInnerHTML: null,
32839 suppressContentEditableWarning: null
32840};
32841
32842// Node type for document fragments (Node.DOCUMENT_FRAGMENT_NODE).
32843var DOC_FRAGMENT_TYPE = 11;
32844
32845function getDeclarationErrorAddendum(internalInstance) {
32846 if (internalInstance) {
32847 var owner = internalInstance._currentElement._owner || null;
32848 if (owner) {
32849 var name = owner.getName();
32850 if (name) {
32851 return ' This DOM node was rendered by `' + name + '`.';
32852 }
32853 }
32854 }
32855 return '';
32856}
32857
32858function friendlyStringify(obj) {
32859 if (typeof obj === 'object') {
32860 if (Array.isArray(obj)) {
32861 return '[' + obj.map(friendlyStringify).join(', ') + ']';
32862 } else {
32863 var pairs = [];
32864 for (var key in obj) {
32865 if (Object.prototype.hasOwnProperty.call(obj, key)) {
32866 var keyEscaped = /^[a-z$_][\w$_]*$/i.test(key) ? key : JSON.stringify(key);
32867 pairs.push(keyEscaped + ': ' + friendlyStringify(obj[key]));
32868 }
32869 }
32870 return '{' + pairs.join(', ') + '}';
32871 }
32872 } else if (typeof obj === 'string') {
32873 return JSON.stringify(obj);
32874 } else if (typeof obj === 'function') {
32875 return '[function object]';
32876 }
32877 // Differs from JSON.stringify in that undefined because undefined and that
32878 // inf and nan don't become null
32879 return String(obj);
32880}
32881
32882var styleMutationWarning = {};
32883
32884function checkAndWarnForMutatedStyle(style1, style2, component) {
32885 if (style1 == null || style2 == null) {
32886 return;
32887 }
32888 if (shallowEqual(style1, style2)) {
32889 return;
32890 }
32891
32892 var componentName = component._tag;
32893 var owner = component._currentElement._owner;
32894 var ownerName;
32895 if (owner) {
32896 ownerName = owner.getName();
32897 }
32898
32899 var hash = ownerName + '|' + componentName;
32900
32901 if (styleMutationWarning.hasOwnProperty(hash)) {
32902 return;
32903 }
32904
32905 styleMutationWarning[hash] = true;
32906
32907 process.env.NODE_ENV !== 'production' ? warning(false, '`%s` was passed a style object that has previously been mutated. ' + 'Mutating `style` is deprecated. Consider cloning it beforehand. Check ' + 'the `render` %s. Previous style: %s. Mutated style: %s.', componentName, owner ? 'of `' + ownerName + '`' : 'using <' + componentName + '>', friendlyStringify(style1), friendlyStringify(style2)) : void 0;
32908}
32909
32910/**
32911 * @param {object} component
32912 * @param {?object} props
32913 */
32914function assertValidProps(component, props) {
32915 if (!props) {
32916 return;
32917 }
32918 // Note the use of `==` which checks for null or undefined.
32919 if (voidElementTags[component._tag]) {
32920 !(props.children == null && props.dangerouslySetInnerHTML == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, '%s is a void element tag and must neither have `children` nor use `dangerouslySetInnerHTML`.%s', component._tag, component._currentElement._owner ? ' Check the render method of ' + component._currentElement._owner.getName() + '.' : '') : _prodInvariant('137', component._tag, component._currentElement._owner ? ' Check the render method of ' + component._currentElement._owner.getName() + '.' : '') : void 0;
32921 }
32922 if (props.dangerouslySetInnerHTML != null) {
32923 !(props.children == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Can only set one of `children` or `props.dangerouslySetInnerHTML`.') : _prodInvariant('60') : void 0;
32924 !(typeof props.dangerouslySetInnerHTML === 'object' && HTML in props.dangerouslySetInnerHTML) ? process.env.NODE_ENV !== 'production' ? invariant(false, '`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. Please visit https://fb.me/react-invariant-dangerously-set-inner-html for more information.') : _prodInvariant('61') : void 0;
32925 }
32926 if (process.env.NODE_ENV !== 'production') {
32927 process.env.NODE_ENV !== 'production' ? warning(props.innerHTML == null, 'Directly setting property `innerHTML` is not permitted. ' + 'For more information, lookup documentation on `dangerouslySetInnerHTML`.') : void 0;
32928 process.env.NODE_ENV !== 'production' ? warning(props.suppressContentEditableWarning || !props.contentEditable || props.children == null, 'A component is `contentEditable` and contains `children` managed by ' + 'React. It is now your responsibility to guarantee that none of ' + 'those nodes are unexpectedly modified or duplicated. This is ' + 'probably not intentional.') : void 0;
32929 process.env.NODE_ENV !== 'production' ? warning(props.onFocusIn == null && props.onFocusOut == null, 'React uses onFocus and onBlur instead of onFocusIn and onFocusOut. ' + 'All React events are normalized to bubble, so onFocusIn and onFocusOut ' + 'are not needed/supported by React.') : void 0;
32930 }
32931 !(props.style == null || typeof props.style === 'object') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'The `style` prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + \'em\'}} when using JSX.%s', getDeclarationErrorAddendum(component)) : _prodInvariant('62', getDeclarationErrorAddendum(component)) : void 0;
32932}
32933
32934function enqueuePutListener(inst, registrationName, listener, transaction) {
32935 if (transaction instanceof ReactServerRenderingTransaction) {
32936 return;
32937 }
32938 if (process.env.NODE_ENV !== 'production') {
32939 // IE8 has no API for event capturing and the `onScroll` event doesn't
32940 // bubble.
32941 process.env.NODE_ENV !== 'production' ? warning(registrationName !== 'onScroll' || isEventSupported('scroll', true), "This browser doesn't support the `onScroll` event") : void 0;
32942 }
32943 var containerInfo = inst._hostContainerInfo;
32944 var isDocumentFragment = containerInfo._node && containerInfo._node.nodeType === DOC_FRAGMENT_TYPE;
32945 var doc = isDocumentFragment ? containerInfo._node : containerInfo._ownerDocument;
32946 listenTo(registrationName, doc);
32947 transaction.getReactMountReady().enqueue(putListener, {
32948 inst: inst,
32949 registrationName: registrationName,
32950 listener: listener
32951 });
32952}
32953
32954function putListener() {
32955 var listenerToPut = this;
32956 EventPluginHub.putListener(listenerToPut.inst, listenerToPut.registrationName, listenerToPut.listener);
32957}
32958
32959function inputPostMount() {
32960 var inst = this;
32961 ReactDOMInput.postMountWrapper(inst);
32962}
32963
32964function textareaPostMount() {
32965 var inst = this;
32966 ReactDOMTextarea.postMountWrapper(inst);
32967}
32968
32969function optionPostMount() {
32970 var inst = this;
32971 ReactDOMOption.postMountWrapper(inst);
32972}
32973
32974var setAndValidateContentChildDev = emptyFunction;
32975if (process.env.NODE_ENV !== 'production') {
32976 setAndValidateContentChildDev = function (content) {
32977 var hasExistingContent = this._contentDebugID != null;
32978 var debugID = this._debugID;
32979 // This ID represents the inlined child that has no backing instance:
32980 var contentDebugID = -debugID;
32981
32982 if (content == null) {
32983 if (hasExistingContent) {
32984 ReactInstrumentation.debugTool.onUnmountComponent(this._contentDebugID);
32985 }
32986 this._contentDebugID = null;
32987 return;
32988 }
32989
32990 validateDOMNesting(null, String(content), this, this._ancestorInfo);
32991 this._contentDebugID = contentDebugID;
32992 if (hasExistingContent) {
32993 ReactInstrumentation.debugTool.onBeforeUpdateComponent(contentDebugID, content);
32994 ReactInstrumentation.debugTool.onUpdateComponent(contentDebugID);
32995 } else {
32996 ReactInstrumentation.debugTool.onBeforeMountComponent(contentDebugID, content, debugID);
32997 ReactInstrumentation.debugTool.onMountComponent(contentDebugID);
32998 ReactInstrumentation.debugTool.onSetChildren(debugID, [contentDebugID]);
32999 }
33000 };
33001}
33002
33003// There are so many media events, it makes sense to just
33004// maintain a list rather than create a `trapBubbledEvent` for each
33005var mediaEvents = {
33006 topAbort: 'abort',
33007 topCanPlay: 'canplay',
33008 topCanPlayThrough: 'canplaythrough',
33009 topDurationChange: 'durationchange',
33010 topEmptied: 'emptied',
33011 topEncrypted: 'encrypted',
33012 topEnded: 'ended',
33013 topError: 'error',
33014 topLoadedData: 'loadeddata',
33015 topLoadedMetadata: 'loadedmetadata',
33016 topLoadStart: 'loadstart',
33017 topPause: 'pause',
33018 topPlay: 'play',
33019 topPlaying: 'playing',
33020 topProgress: 'progress',
33021 topRateChange: 'ratechange',
33022 topSeeked: 'seeked',
33023 topSeeking: 'seeking',
33024 topStalled: 'stalled',
33025 topSuspend: 'suspend',
33026 topTimeUpdate: 'timeupdate',
33027 topVolumeChange: 'volumechange',
33028 topWaiting: 'waiting'
33029};
33030
33031function trackInputValue() {
33032 inputValueTracking.track(this);
33033}
33034
33035function trapBubbledEventsLocal() {
33036 var inst = this;
33037 // If a component renders to null or if another component fatals and causes
33038 // the state of the tree to be corrupted, `node` here can be null.
33039 !inst._rootNodeID ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Must be mounted to trap events') : _prodInvariant('63') : void 0;
33040 var node = getNode(inst);
33041 !node ? process.env.NODE_ENV !== 'production' ? invariant(false, 'trapBubbledEvent(...): Requires node to be rendered.') : _prodInvariant('64') : void 0;
33042
33043 switch (inst._tag) {
33044 case 'iframe':
33045 case 'object':
33046 inst._wrapperState.listeners = [ReactBrowserEventEmitter.trapBubbledEvent('topLoad', 'load', node)];
33047 break;
33048 case 'video':
33049 case 'audio':
33050 inst._wrapperState.listeners = [];
33051 // Create listener for each media event
33052 for (var event in mediaEvents) {
33053 if (mediaEvents.hasOwnProperty(event)) {
33054 inst._wrapperState.listeners.push(ReactBrowserEventEmitter.trapBubbledEvent(event, mediaEvents[event], node));
33055 }
33056 }
33057 break;
33058 case 'source':
33059 inst._wrapperState.listeners = [ReactBrowserEventEmitter.trapBubbledEvent('topError', 'error', node)];
33060 break;
33061 case 'img':
33062 inst._wrapperState.listeners = [ReactBrowserEventEmitter.trapBubbledEvent('topError', 'error', node), ReactBrowserEventEmitter.trapBubbledEvent('topLoad', 'load', node)];
33063 break;
33064 case 'form':
33065 inst._wrapperState.listeners = [ReactBrowserEventEmitter.trapBubbledEvent('topReset', 'reset', node), ReactBrowserEventEmitter.trapBubbledEvent('topSubmit', 'submit', node)];
33066 break;
33067 case 'input':
33068 case 'select':
33069 case 'textarea':
33070 inst._wrapperState.listeners = [ReactBrowserEventEmitter.trapBubbledEvent('topInvalid', 'invalid', node)];
33071 break;
33072 }
33073}
33074
33075function postUpdateSelectWrapper() {
33076 ReactDOMSelect.postUpdateWrapper(this);
33077}
33078
33079// For HTML, certain tags should omit their close tag. We keep a whitelist for
33080// those special-case tags.
33081
33082var omittedCloseTags = {
33083 area: true,
33084 base: true,
33085 br: true,
33086 col: true,
33087 embed: true,
33088 hr: true,
33089 img: true,
33090 input: true,
33091 keygen: true,
33092 link: true,
33093 meta: true,
33094 param: true,
33095 source: true,
33096 track: true,
33097 wbr: true
33098 // NOTE: menuitem's close tag should be omitted, but that causes problems.
33099};
33100
33101var newlineEatingTags = {
33102 listing: true,
33103 pre: true,
33104 textarea: true
33105};
33106
33107// For HTML, certain tags cannot have children. This has the same purpose as
33108// `omittedCloseTags` except that `menuitem` should still have its closing tag.
33109
33110var voidElementTags = _assign({
33111 menuitem: true
33112}, omittedCloseTags);
33113
33114// We accept any tag to be rendered but since this gets injected into arbitrary
33115// HTML, we want to make sure that it's a safe tag.
33116// http://www.w3.org/TR/REC-xml/#NT-Name
33117
33118var VALID_TAG_REGEX = /^[a-zA-Z][a-zA-Z:_\.\-\d]*$/; // Simplified subset
33119var validatedTagCache = {};
33120var hasOwnProperty = {}.hasOwnProperty;
33121
33122function validateDangerousTag(tag) {
33123 if (!hasOwnProperty.call(validatedTagCache, tag)) {
33124 !VALID_TAG_REGEX.test(tag) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Invalid tag: %s', tag) : _prodInvariant('65', tag) : void 0;
33125 validatedTagCache[tag] = true;
33126 }
33127}
33128
33129function isCustomComponent(tagName, props) {
33130 return tagName.indexOf('-') >= 0 || props.is != null;
33131}
33132
33133var globalIdCounter = 1;
33134
33135/**
33136 * Creates a new React class that is idempotent and capable of containing other
33137 * React components. It accepts event listeners and DOM properties that are
33138 * valid according to `DOMProperty`.
33139 *
33140 * - Event listeners: `onClick`, `onMouseDown`, etc.
33141 * - DOM properties: `className`, `name`, `title`, etc.
33142 *
33143 * The `style` property functions differently from the DOM API. It accepts an
33144 * object mapping of style properties to values.
33145 *
33146 * @constructor ReactDOMComponent
33147 * @extends ReactMultiChild
33148 */
33149function ReactDOMComponent(element) {
33150 var tag = element.type;
33151 validateDangerousTag(tag);
33152 this._currentElement = element;
33153 this._tag = tag.toLowerCase();
33154 this._namespaceURI = null;
33155 this._renderedChildren = null;
33156 this._previousStyle = null;
33157 this._previousStyleCopy = null;
33158 this._hostNode = null;
33159 this._hostParent = null;
33160 this._rootNodeID = 0;
33161 this._domID = 0;
33162 this._hostContainerInfo = null;
33163 this._wrapperState = null;
33164 this._topLevelWrapper = null;
33165 this._flags = 0;
33166 if (process.env.NODE_ENV !== 'production') {
33167 this._ancestorInfo = null;
33168 setAndValidateContentChildDev.call(this, null);
33169 }
33170}
33171
33172ReactDOMComponent.displayName = 'ReactDOMComponent';
33173
33174ReactDOMComponent.Mixin = {
33175 /**
33176 * Generates root tag markup then recurses. This method has side effects and
33177 * is not idempotent.
33178 *
33179 * @internal
33180 * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
33181 * @param {?ReactDOMComponent} the parent component instance
33182 * @param {?object} info about the host container
33183 * @param {object} context
33184 * @return {string} The computed markup.
33185 */
33186 mountComponent: function (transaction, hostParent, hostContainerInfo, context) {
33187 this._rootNodeID = globalIdCounter++;
33188 this._domID = hostContainerInfo._idCounter++;
33189 this._hostParent = hostParent;
33190 this._hostContainerInfo = hostContainerInfo;
33191
33192 var props = this._currentElement.props;
33193
33194 switch (this._tag) {
33195 case 'audio':
33196 case 'form':
33197 case 'iframe':
33198 case 'img':
33199 case 'link':
33200 case 'object':
33201 case 'source':
33202 case 'video':
33203 this._wrapperState = {
33204 listeners: null
33205 };
33206 transaction.getReactMountReady().enqueue(trapBubbledEventsLocal, this);
33207 break;
33208 case 'input':
33209 ReactDOMInput.mountWrapper(this, props, hostParent);
33210 props = ReactDOMInput.getHostProps(this, props);
33211 transaction.getReactMountReady().enqueue(trackInputValue, this);
33212 transaction.getReactMountReady().enqueue(trapBubbledEventsLocal, this);
33213 break;
33214 case 'option':
33215 ReactDOMOption.mountWrapper(this, props, hostParent);
33216 props = ReactDOMOption.getHostProps(this, props);
33217 break;
33218 case 'select':
33219 ReactDOMSelect.mountWrapper(this, props, hostParent);
33220 props = ReactDOMSelect.getHostProps(this, props);
33221 transaction.getReactMountReady().enqueue(trapBubbledEventsLocal, this);
33222 break;
33223 case 'textarea':
33224 ReactDOMTextarea.mountWrapper(this, props, hostParent);
33225 props = ReactDOMTextarea.getHostProps(this, props);
33226 transaction.getReactMountReady().enqueue(trackInputValue, this);
33227 transaction.getReactMountReady().enqueue(trapBubbledEventsLocal, this);
33228 break;
33229 }
33230
33231 assertValidProps(this, props);
33232
33233 // We create tags in the namespace of their parent container, except HTML
33234 // tags get no namespace.
33235 var namespaceURI;
33236 var parentTag;
33237 if (hostParent != null) {
33238 namespaceURI = hostParent._namespaceURI;
33239 parentTag = hostParent._tag;
33240 } else if (hostContainerInfo._tag) {
33241 namespaceURI = hostContainerInfo._namespaceURI;
33242 parentTag = hostContainerInfo._tag;
33243 }
33244 if (namespaceURI == null || namespaceURI === DOMNamespaces.svg && parentTag === 'foreignobject') {
33245 namespaceURI = DOMNamespaces.html;
33246 }
33247 if (namespaceURI === DOMNamespaces.html) {
33248 if (this._tag === 'svg') {
33249 namespaceURI = DOMNamespaces.svg;
33250 } else if (this._tag === 'math') {
33251 namespaceURI = DOMNamespaces.mathml;
33252 }
33253 }
33254 this._namespaceURI = namespaceURI;
33255
33256 if (process.env.NODE_ENV !== 'production') {
33257 var parentInfo;
33258 if (hostParent != null) {
33259 parentInfo = hostParent._ancestorInfo;
33260 } else if (hostContainerInfo._tag) {
33261 parentInfo = hostContainerInfo._ancestorInfo;
33262 }
33263 if (parentInfo) {
33264 // parentInfo should always be present except for the top-level
33265 // component when server rendering
33266 validateDOMNesting(this._tag, null, this, parentInfo);
33267 }
33268 this._ancestorInfo = validateDOMNesting.updatedAncestorInfo(parentInfo, this._tag, this);
33269 }
33270
33271 var mountImage;
33272 if (transaction.useCreateElement) {
33273 var ownerDocument = hostContainerInfo._ownerDocument;
33274 var el;
33275 if (namespaceURI === DOMNamespaces.html) {
33276 if (this._tag === 'script') {
33277 // Create the script via .innerHTML so its "parser-inserted" flag is
33278 // set to true and it does not execute
33279 var div = ownerDocument.createElement('div');
33280 var type = this._currentElement.type;
33281 div.innerHTML = '<' + type + '></' + type + '>';
33282 el = div.removeChild(div.firstChild);
33283 } else if (props.is) {
33284 el = ownerDocument.createElement(this._currentElement.type, props.is);
33285 } else {
33286 // Separate else branch instead of using `props.is || undefined` above becuase of a Firefox bug.
33287 // See discussion in https://github.com/facebook/react/pull/6896
33288 // and discussion in https://bugzilla.mozilla.org/show_bug.cgi?id=1276240
33289 el = ownerDocument.createElement(this._currentElement.type);
33290 }
33291 } else {
33292 el = ownerDocument.createElementNS(namespaceURI, this._currentElement.type);
33293 }
33294 ReactDOMComponentTree.precacheNode(this, el);
33295 this._flags |= Flags.hasCachedChildNodes;
33296 if (!this._hostParent) {
33297 DOMPropertyOperations.setAttributeForRoot(el);
33298 }
33299 this._updateDOMProperties(null, props, transaction);
33300 var lazyTree = DOMLazyTree(el);
33301 this._createInitialChildren(transaction, props, context, lazyTree);
33302 mountImage = lazyTree;
33303 } else {
33304 var tagOpen = this._createOpenTagMarkupAndPutListeners(transaction, props);
33305 var tagContent = this._createContentMarkup(transaction, props, context);
33306 if (!tagContent && omittedCloseTags[this._tag]) {
33307 mountImage = tagOpen + '/>';
33308 } else {
33309 mountImage = tagOpen + '>' + tagContent + '</' + this._currentElement.type + '>';
33310 }
33311 }
33312
33313 switch (this._tag) {
33314 case 'input':
33315 transaction.getReactMountReady().enqueue(inputPostMount, this);
33316 if (props.autoFocus) {
33317 transaction.getReactMountReady().enqueue(AutoFocusUtils.focusDOMComponent, this);
33318 }
33319 break;
33320 case 'textarea':
33321 transaction.getReactMountReady().enqueue(textareaPostMount, this);
33322 if (props.autoFocus) {
33323 transaction.getReactMountReady().enqueue(AutoFocusUtils.focusDOMComponent, this);
33324 }
33325 break;
33326 case 'select':
33327 if (props.autoFocus) {
33328 transaction.getReactMountReady().enqueue(AutoFocusUtils.focusDOMComponent, this);
33329 }
33330 break;
33331 case 'button':
33332 if (props.autoFocus) {
33333 transaction.getReactMountReady().enqueue(AutoFocusUtils.focusDOMComponent, this);
33334 }
33335 break;
33336 case 'option':
33337 transaction.getReactMountReady().enqueue(optionPostMount, this);
33338 break;
33339 }
33340
33341 return mountImage;
33342 },
33343
33344 /**
33345 * Creates markup for the open tag and all attributes.
33346 *
33347 * This method has side effects because events get registered.
33348 *
33349 * Iterating over object properties is faster than iterating over arrays.
33350 * @see http://jsperf.com/obj-vs-arr-iteration
33351 *
33352 * @private
33353 * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
33354 * @param {object} props
33355 * @return {string} Markup of opening tag.
33356 */
33357 _createOpenTagMarkupAndPutListeners: function (transaction, props) {
33358 var ret = '<' + this._currentElement.type;
33359
33360 for (var propKey in props) {
33361 if (!props.hasOwnProperty(propKey)) {
33362 continue;
33363 }
33364 var propValue = props[propKey];
33365 if (propValue == null) {
33366 continue;
33367 }
33368 if (registrationNameModules.hasOwnProperty(propKey)) {
33369 if (propValue) {
33370 enqueuePutListener(this, propKey, propValue, transaction);
33371 }
33372 } else {
33373 if (propKey === STYLE) {
33374 if (propValue) {
33375 if (process.env.NODE_ENV !== 'production') {
33376 // See `_updateDOMProperties`. style block
33377 this._previousStyle = propValue;
33378 }
33379 propValue = this._previousStyleCopy = _assign({}, props.style);
33380 }
33381 propValue = CSSPropertyOperations.createMarkupForStyles(propValue, this);
33382 }
33383 var markup = null;
33384 if (this._tag != null && isCustomComponent(this._tag, props)) {
33385 if (!RESERVED_PROPS.hasOwnProperty(propKey)) {
33386 markup = DOMPropertyOperations.createMarkupForCustomAttribute(propKey, propValue);
33387 }
33388 } else {
33389 markup = DOMPropertyOperations.createMarkupForProperty(propKey, propValue);
33390 }
33391 if (markup) {
33392 ret += ' ' + markup;
33393 }
33394 }
33395 }
33396
33397 // For static pages, no need to put React ID and checksum. Saves lots of
33398 // bytes.
33399 if (transaction.renderToStaticMarkup) {
33400 return ret;
33401 }
33402
33403 if (!this._hostParent) {
33404 ret += ' ' + DOMPropertyOperations.createMarkupForRoot();
33405 }
33406 ret += ' ' + DOMPropertyOperations.createMarkupForID(this._domID);
33407 return ret;
33408 },
33409
33410 /**
33411 * Creates markup for the content between the tags.
33412 *
33413 * @private
33414 * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
33415 * @param {object} props
33416 * @param {object} context
33417 * @return {string} Content markup.
33418 */
33419 _createContentMarkup: function (transaction, props, context) {
33420 var ret = '';
33421
33422 // Intentional use of != to avoid catching zero/false.
33423 var innerHTML = props.dangerouslySetInnerHTML;
33424 if (innerHTML != null) {
33425 if (innerHTML.__html != null) {
33426 ret = innerHTML.__html;
33427 }
33428 } else {
33429 var contentToUse = CONTENT_TYPES[typeof props.children] ? props.children : null;
33430 var childrenToUse = contentToUse != null ? null : props.children;
33431 if (contentToUse != null) {
33432 // TODO: Validate that text is allowed as a child of this node
33433 ret = escapeTextContentForBrowser(contentToUse);
33434 if (process.env.NODE_ENV !== 'production') {
33435 setAndValidateContentChildDev.call(this, contentToUse);
33436 }
33437 } else if (childrenToUse != null) {
33438 var mountImages = this.mountChildren(childrenToUse, transaction, context);
33439 ret = mountImages.join('');
33440 }
33441 }
33442 if (newlineEatingTags[this._tag] && ret.charAt(0) === '\n') {
33443 // text/html ignores the first character in these tags if it's a newline
33444 // Prefer to break application/xml over text/html (for now) by adding
33445 // a newline specifically to get eaten by the parser. (Alternately for
33446 // textareas, replacing "^\n" with "\r\n" doesn't get eaten, and the first
33447 // \r is normalized out by HTMLTextAreaElement#value.)
33448 // See: <http://www.w3.org/TR/html-polyglot/#newlines-in-textarea-and-pre>
33449 // See: <http://www.w3.org/TR/html5/syntax.html#element-restrictions>
33450 // See: <http://www.w3.org/TR/html5/syntax.html#newlines>
33451 // See: Parsing of "textarea" "listing" and "pre" elements
33452 // from <http://www.w3.org/TR/html5/syntax.html#parsing-main-inbody>
33453 return '\n' + ret;
33454 } else {
33455 return ret;
33456 }
33457 },
33458
33459 _createInitialChildren: function (transaction, props, context, lazyTree) {
33460 // Intentional use of != to avoid catching zero/false.
33461 var innerHTML = props.dangerouslySetInnerHTML;
33462 if (innerHTML != null) {
33463 if (innerHTML.__html != null) {
33464 DOMLazyTree.queueHTML(lazyTree, innerHTML.__html);
33465 }
33466 } else {
33467 var contentToUse = CONTENT_TYPES[typeof props.children] ? props.children : null;
33468 var childrenToUse = contentToUse != null ? null : props.children;
33469 // TODO: Validate that text is allowed as a child of this node
33470 if (contentToUse != null) {
33471 // Avoid setting textContent when the text is empty. In IE11 setting
33472 // textContent on a text area will cause the placeholder to not
33473 // show within the textarea until it has been focused and blurred again.
33474 // https://github.com/facebook/react/issues/6731#issuecomment-254874553
33475 if (contentToUse !== '') {
33476 if (process.env.NODE_ENV !== 'production') {
33477 setAndValidateContentChildDev.call(this, contentToUse);
33478 }
33479 DOMLazyTree.queueText(lazyTree, contentToUse);
33480 }
33481 } else if (childrenToUse != null) {
33482 var mountImages = this.mountChildren(childrenToUse, transaction, context);
33483 for (var i = 0; i < mountImages.length; i++) {
33484 DOMLazyTree.queueChild(lazyTree, mountImages[i]);
33485 }
33486 }
33487 }
33488 },
33489
33490 /**
33491 * Receives a next element and updates the component.
33492 *
33493 * @internal
33494 * @param {ReactElement} nextElement
33495 * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
33496 * @param {object} context
33497 */
33498 receiveComponent: function (nextElement, transaction, context) {
33499 var prevElement = this._currentElement;
33500 this._currentElement = nextElement;
33501 this.updateComponent(transaction, prevElement, nextElement, context);
33502 },
33503
33504 /**
33505 * Updates a DOM component after it has already been allocated and
33506 * attached to the DOM. Reconciles the root DOM node, then recurses.
33507 *
33508 * @param {ReactReconcileTransaction} transaction
33509 * @param {ReactElement} prevElement
33510 * @param {ReactElement} nextElement
33511 * @internal
33512 * @overridable
33513 */
33514 updateComponent: function (transaction, prevElement, nextElement, context) {
33515 var lastProps = prevElement.props;
33516 var nextProps = this._currentElement.props;
33517
33518 switch (this._tag) {
33519 case 'input':
33520 lastProps = ReactDOMInput.getHostProps(this, lastProps);
33521 nextProps = ReactDOMInput.getHostProps(this, nextProps);
33522 break;
33523 case 'option':
33524 lastProps = ReactDOMOption.getHostProps(this, lastProps);
33525 nextProps = ReactDOMOption.getHostProps(this, nextProps);
33526 break;
33527 case 'select':
33528 lastProps = ReactDOMSelect.getHostProps(this, lastProps);
33529 nextProps = ReactDOMSelect.getHostProps(this, nextProps);
33530 break;
33531 case 'textarea':
33532 lastProps = ReactDOMTextarea.getHostProps(this, lastProps);
33533 nextProps = ReactDOMTextarea.getHostProps(this, nextProps);
33534 break;
33535 }
33536
33537 assertValidProps(this, nextProps);
33538 this._updateDOMProperties(lastProps, nextProps, transaction);
33539 this._updateDOMChildren(lastProps, nextProps, transaction, context);
33540
33541 switch (this._tag) {
33542 case 'input':
33543 // Update the wrapper around inputs *after* updating props. This has to
33544 // happen after `_updateDOMProperties`. Otherwise HTML5 input validations
33545 // raise warnings and prevent the new value from being assigned.
33546 ReactDOMInput.updateWrapper(this);
33547 break;
33548 case 'textarea':
33549 ReactDOMTextarea.updateWrapper(this);
33550 break;
33551 case 'select':
33552 // <select> value update needs to occur after <option> children
33553 // reconciliation
33554 transaction.getReactMountReady().enqueue(postUpdateSelectWrapper, this);
33555 break;
33556 }
33557 },
33558
33559 /**
33560 * Reconciles the properties by detecting differences in property values and
33561 * updating the DOM as necessary. This function is probably the single most
33562 * critical path for performance optimization.
33563 *
33564 * TODO: Benchmark whether checking for changed values in memory actually
33565 * improves performance (especially statically positioned elements).
33566 * TODO: Benchmark the effects of putting this at the top since 99% of props
33567 * do not change for a given reconciliation.
33568 * TODO: Benchmark areas that can be improved with caching.
33569 *
33570 * @private
33571 * @param {object} lastProps
33572 * @param {object} nextProps
33573 * @param {?DOMElement} node
33574 */
33575 _updateDOMProperties: function (lastProps, nextProps, transaction) {
33576 var propKey;
33577 var styleName;
33578 var styleUpdates;
33579 for (propKey in lastProps) {
33580 if (nextProps.hasOwnProperty(propKey) || !lastProps.hasOwnProperty(propKey) || lastProps[propKey] == null) {
33581 continue;
33582 }
33583 if (propKey === STYLE) {
33584 var lastStyle = this._previousStyleCopy;
33585 for (styleName in lastStyle) {
33586 if (lastStyle.hasOwnProperty(styleName)) {
33587 styleUpdates = styleUpdates || {};
33588 styleUpdates[styleName] = '';
33589 }
33590 }
33591 this._previousStyleCopy = null;
33592 } else if (registrationNameModules.hasOwnProperty(propKey)) {
33593 if (lastProps[propKey]) {
33594 // Only call deleteListener if there was a listener previously or
33595 // else willDeleteListener gets called when there wasn't actually a
33596 // listener (e.g., onClick={null})
33597 deleteListener(this, propKey);
33598 }
33599 } else if (isCustomComponent(this._tag, lastProps)) {
33600 if (!RESERVED_PROPS.hasOwnProperty(propKey)) {
33601 DOMPropertyOperations.deleteValueForAttribute(getNode(this), propKey);
33602 }
33603 } else if (DOMProperty.properties[propKey] || DOMProperty.isCustomAttribute(propKey)) {
33604 DOMPropertyOperations.deleteValueForProperty(getNode(this), propKey);
33605 }
33606 }
33607 for (propKey in nextProps) {
33608 var nextProp = nextProps[propKey];
33609 var lastProp = propKey === STYLE ? this._previousStyleCopy : lastProps != null ? lastProps[propKey] : undefined;
33610 if (!nextProps.hasOwnProperty(propKey) || nextProp === lastProp || nextProp == null && lastProp == null) {
33611 continue;
33612 }
33613 if (propKey === STYLE) {
33614 if (nextProp) {
33615 if (process.env.NODE_ENV !== 'production') {
33616 checkAndWarnForMutatedStyle(this._previousStyleCopy, this._previousStyle, this);
33617 this._previousStyle = nextProp;
33618 }
33619 nextProp = this._previousStyleCopy = _assign({}, nextProp);
33620 } else {
33621 this._previousStyleCopy = null;
33622 }
33623 if (lastProp) {
33624 // Unset styles on `lastProp` but not on `nextProp`.
33625 for (styleName in lastProp) {
33626 if (lastProp.hasOwnProperty(styleName) && (!nextProp || !nextProp.hasOwnProperty(styleName))) {
33627 styleUpdates = styleUpdates || {};
33628 styleUpdates[styleName] = '';
33629 }
33630 }
33631 // Update styles that changed since `lastProp`.
33632 for (styleName in nextProp) {
33633 if (nextProp.hasOwnProperty(styleName) && lastProp[styleName] !== nextProp[styleName]) {
33634 styleUpdates = styleUpdates || {};
33635 styleUpdates[styleName] = nextProp[styleName];
33636 }
33637 }
33638 } else {
33639 // Relies on `updateStylesByID` not mutating `styleUpdates`.
33640 styleUpdates = nextProp;
33641 }
33642 } else if (registrationNameModules.hasOwnProperty(propKey)) {
33643 if (nextProp) {
33644 enqueuePutListener(this, propKey, nextProp, transaction);
33645 } else if (lastProp) {
33646 deleteListener(this, propKey);
33647 }
33648 } else if (isCustomComponent(this._tag, nextProps)) {
33649 if (!RESERVED_PROPS.hasOwnProperty(propKey)) {
33650 DOMPropertyOperations.setValueForAttribute(getNode(this), propKey, nextProp);
33651 }
33652 } else if (DOMProperty.properties[propKey] || DOMProperty.isCustomAttribute(propKey)) {
33653 var node = getNode(this);
33654 // If we're updating to null or undefined, we should remove the property
33655 // from the DOM node instead of inadvertently setting to a string. This
33656 // brings us in line with the same behavior we have on initial render.
33657 if (nextProp != null) {
33658 DOMPropertyOperations.setValueForProperty(node, propKey, nextProp);
33659 } else {
33660 DOMPropertyOperations.deleteValueForProperty(node, propKey);
33661 }
33662 }
33663 }
33664 if (styleUpdates) {
33665 CSSPropertyOperations.setValueForStyles(getNode(this), styleUpdates, this);
33666 }
33667 },
33668
33669 /**
33670 * Reconciles the children with the various properties that affect the
33671 * children content.
33672 *
33673 * @param {object} lastProps
33674 * @param {object} nextProps
33675 * @param {ReactReconcileTransaction} transaction
33676 * @param {object} context
33677 */
33678 _updateDOMChildren: function (lastProps, nextProps, transaction, context) {
33679 var lastContent = CONTENT_TYPES[typeof lastProps.children] ? lastProps.children : null;
33680 var nextContent = CONTENT_TYPES[typeof nextProps.children] ? nextProps.children : null;
33681
33682 var lastHtml = lastProps.dangerouslySetInnerHTML && lastProps.dangerouslySetInnerHTML.__html;
33683 var nextHtml = nextProps.dangerouslySetInnerHTML && nextProps.dangerouslySetInnerHTML.__html;
33684
33685 // Note the use of `!=` which checks for null or undefined.
33686 var lastChildren = lastContent != null ? null : lastProps.children;
33687 var nextChildren = nextContent != null ? null : nextProps.children;
33688
33689 // If we're switching from children to content/html or vice versa, remove
33690 // the old content
33691 var lastHasContentOrHtml = lastContent != null || lastHtml != null;
33692 var nextHasContentOrHtml = nextContent != null || nextHtml != null;
33693 if (lastChildren != null && nextChildren == null) {
33694 this.updateChildren(null, transaction, context);
33695 } else if (lastHasContentOrHtml && !nextHasContentOrHtml) {
33696 this.updateTextContent('');
33697 if (process.env.NODE_ENV !== 'production') {
33698 ReactInstrumentation.debugTool.onSetChildren(this._debugID, []);
33699 }
33700 }
33701
33702 if (nextContent != null) {
33703 if (lastContent !== nextContent) {
33704 this.updateTextContent('' + nextContent);
33705 if (process.env.NODE_ENV !== 'production') {
33706 setAndValidateContentChildDev.call(this, nextContent);
33707 }
33708 }
33709 } else if (nextHtml != null) {
33710 if (lastHtml !== nextHtml) {
33711 this.updateMarkup('' + nextHtml);
33712 }
33713 if (process.env.NODE_ENV !== 'production') {
33714 ReactInstrumentation.debugTool.onSetChildren(this._debugID, []);
33715 }
33716 } else if (nextChildren != null) {
33717 if (process.env.NODE_ENV !== 'production') {
33718 setAndValidateContentChildDev.call(this, null);
33719 }
33720
33721 this.updateChildren(nextChildren, transaction, context);
33722 }
33723 },
33724
33725 getHostNode: function () {
33726 return getNode(this);
33727 },
33728
33729 /**
33730 * Destroys all event registrations for this instance. Does not remove from
33731 * the DOM. That must be done by the parent.
33732 *
33733 * @internal
33734 */
33735 unmountComponent: function (safely) {
33736 switch (this._tag) {
33737 case 'audio':
33738 case 'form':
33739 case 'iframe':
33740 case 'img':
33741 case 'link':
33742 case 'object':
33743 case 'source':
33744 case 'video':
33745 var listeners = this._wrapperState.listeners;
33746 if (listeners) {
33747 for (var i = 0; i < listeners.length; i++) {
33748 listeners[i].remove();
33749 }
33750 }
33751 break;
33752 case 'input':
33753 case 'textarea':
33754 inputValueTracking.stopTracking(this);
33755 break;
33756 case 'html':
33757 case 'head':
33758 case 'body':
33759 /**
33760 * Components like <html> <head> and <body> can't be removed or added
33761 * easily in a cross-browser way, however it's valuable to be able to
33762 * take advantage of React's reconciliation for styling and <title>
33763 * management. So we just document it and throw in dangerous cases.
33764 */
33765 true ? process.env.NODE_ENV !== 'production' ? invariant(false, '<%s> tried to unmount. Because of cross-browser quirks it is impossible to unmount some top-level components (eg <html>, <head>, and <body>) reliably and efficiently. To fix this, have a single top-level component that never unmounts render these elements.', this._tag) : _prodInvariant('66', this._tag) : void 0;
33766 break;
33767 }
33768
33769 this.unmountChildren(safely);
33770 ReactDOMComponentTree.uncacheNode(this);
33771 EventPluginHub.deleteAllListeners(this);
33772 this._rootNodeID = 0;
33773 this._domID = 0;
33774 this._wrapperState = null;
33775
33776 if (process.env.NODE_ENV !== 'production') {
33777 setAndValidateContentChildDev.call(this, null);
33778 }
33779 },
33780
33781 getPublicInstance: function () {
33782 return getNode(this);
33783 }
33784};
33785
33786_assign(ReactDOMComponent.prototype, ReactDOMComponent.Mixin, ReactMultiChild.Mixin);
33787
33788module.exports = ReactDOMComponent;
33789/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
33790
33791/***/ }),
33792/* 131 */
33793/***/ (function(module, exports, __webpack_require__) {
33794
33795"use strict";
33796/**
33797 * Copyright 2013-present, Facebook, Inc.
33798 * All rights reserved.
33799 *
33800 * This source code is licensed under the BSD-style license found in the
33801 * LICENSE file in the root directory of this source tree. An additional grant
33802 * of patent rights can be found in the PATENTS file in the same directory.
33803 *
33804 */
33805
33806
33807
33808var ReactDOMComponentTree = __webpack_require__(5);
33809
33810var focusNode = __webpack_require__(74);
33811
33812var AutoFocusUtils = {
33813 focusDOMComponent: function () {
33814 focusNode(ReactDOMComponentTree.getNodeFromInstance(this));
33815 }
33816};
33817
33818module.exports = AutoFocusUtils;
33819
33820/***/ }),
33821/* 132 */
33822/***/ (function(module, exports, __webpack_require__) {
33823
33824"use strict";
33825/* WEBPACK VAR INJECTION */(function(process) {/**
33826 * Copyright 2013-present, Facebook, Inc.
33827 * All rights reserved.
33828 *
33829 * This source code is licensed under the BSD-style license found in the
33830 * LICENSE file in the root directory of this source tree. An additional grant
33831 * of patent rights can be found in the PATENTS file in the same directory.
33832 *
33833 */
33834
33835
33836
33837var CSSProperty = __webpack_require__(75);
33838var ExecutionEnvironment = __webpack_require__(6);
33839var ReactInstrumentation = __webpack_require__(9);
33840
33841var camelizeStyleName = __webpack_require__(133);
33842var dangerousStyleValue = __webpack_require__(135);
33843var hyphenateStyleName = __webpack_require__(136);
33844var memoizeStringOnly = __webpack_require__(138);
33845var warning = __webpack_require__(2);
33846
33847var processStyleName = memoizeStringOnly(function (styleName) {
33848 return hyphenateStyleName(styleName);
33849});
33850
33851var hasShorthandPropertyBug = false;
33852var styleFloatAccessor = 'cssFloat';
33853if (ExecutionEnvironment.canUseDOM) {
33854 var tempStyle = document.createElement('div').style;
33855 try {
33856 // IE8 throws "Invalid argument." if resetting shorthand style properties.
33857 tempStyle.font = '';
33858 } catch (e) {
33859 hasShorthandPropertyBug = true;
33860 }
33861 // IE8 only supports accessing cssFloat (standard) as styleFloat
33862 if (document.documentElement.style.cssFloat === undefined) {
33863 styleFloatAccessor = 'styleFloat';
33864 }
33865}
33866
33867if (process.env.NODE_ENV !== 'production') {
33868 // 'msTransform' is correct, but the other prefixes should be capitalized
33869 var badVendoredStyleNamePattern = /^(?:webkit|moz|o)[A-Z]/;
33870
33871 // style values shouldn't contain a semicolon
33872 var badStyleValueWithSemicolonPattern = /;\s*$/;
33873
33874 var warnedStyleNames = {};
33875 var warnedStyleValues = {};
33876 var warnedForNaNValue = false;
33877
33878 var warnHyphenatedStyleName = function (name, owner) {
33879 if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) {
33880 return;
33881 }
33882
33883 warnedStyleNames[name] = true;
33884 process.env.NODE_ENV !== 'production' ? warning(false, 'Unsupported style property %s. Did you mean %s?%s', name, camelizeStyleName(name), checkRenderMessage(owner)) : void 0;
33885 };
33886
33887 var warnBadVendoredStyleName = function (name, owner) {
33888 if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) {
33889 return;
33890 }
33891
33892 warnedStyleNames[name] = true;
33893 process.env.NODE_ENV !== 'production' ? warning(false, 'Unsupported vendor-prefixed style property %s. Did you mean %s?%s', name, name.charAt(0).toUpperCase() + name.slice(1), checkRenderMessage(owner)) : void 0;
33894 };
33895
33896 var warnStyleValueWithSemicolon = function (name, value, owner) {
33897 if (warnedStyleValues.hasOwnProperty(value) && warnedStyleValues[value]) {
33898 return;
33899 }
33900
33901 warnedStyleValues[value] = true;
33902 process.env.NODE_ENV !== 'production' ? warning(false, "Style property values shouldn't contain a semicolon.%s " + 'Try "%s: %s" instead.', checkRenderMessage(owner), name, value.replace(badStyleValueWithSemicolonPattern, '')) : void 0;
33903 };
33904
33905 var warnStyleValueIsNaN = function (name, value, owner) {
33906 if (warnedForNaNValue) {
33907 return;
33908 }
33909
33910 warnedForNaNValue = true;
33911 process.env.NODE_ENV !== 'production' ? warning(false, '`NaN` is an invalid value for the `%s` css style property.%s', name, checkRenderMessage(owner)) : void 0;
33912 };
33913
33914 var checkRenderMessage = function (owner) {
33915 if (owner) {
33916 var name = owner.getName();
33917 if (name) {
33918 return ' Check the render method of `' + name + '`.';
33919 }
33920 }
33921 return '';
33922 };
33923
33924 /**
33925 * @param {string} name
33926 * @param {*} value
33927 * @param {ReactDOMComponent} component
33928 */
33929 var warnValidStyle = function (name, value, component) {
33930 var owner;
33931 if (component) {
33932 owner = component._currentElement._owner;
33933 }
33934 if (name.indexOf('-') > -1) {
33935 warnHyphenatedStyleName(name, owner);
33936 } else if (badVendoredStyleNamePattern.test(name)) {
33937 warnBadVendoredStyleName(name, owner);
33938 } else if (badStyleValueWithSemicolonPattern.test(value)) {
33939 warnStyleValueWithSemicolon(name, value, owner);
33940 }
33941
33942 if (typeof value === 'number' && isNaN(value)) {
33943 warnStyleValueIsNaN(name, value, owner);
33944 }
33945 };
33946}
33947
33948/**
33949 * Operations for dealing with CSS properties.
33950 */
33951var CSSPropertyOperations = {
33952 /**
33953 * Serializes a mapping of style properties for use as inline styles:
33954 *
33955 * > createMarkupForStyles({width: '200px', height: 0})
33956 * "width:200px;height:0;"
33957 *
33958 * Undefined values are ignored so that declarative programming is easier.
33959 * The result should be HTML-escaped before insertion into the DOM.
33960 *
33961 * @param {object} styles
33962 * @param {ReactDOMComponent} component
33963 * @return {?string}
33964 */
33965 createMarkupForStyles: function (styles, component) {
33966 var serialized = '';
33967 for (var styleName in styles) {
33968 if (!styles.hasOwnProperty(styleName)) {
33969 continue;
33970 }
33971 var isCustomProperty = styleName.indexOf('--') === 0;
33972 var styleValue = styles[styleName];
33973 if (process.env.NODE_ENV !== 'production') {
33974 if (!isCustomProperty) {
33975 warnValidStyle(styleName, styleValue, component);
33976 }
33977 }
33978 if (styleValue != null) {
33979 serialized += processStyleName(styleName) + ':';
33980 serialized += dangerousStyleValue(styleName, styleValue, component, isCustomProperty) + ';';
33981 }
33982 }
33983 return serialized || null;
33984 },
33985
33986 /**
33987 * Sets the value for multiple styles on a node. If a value is specified as
33988 * '' (empty string), the corresponding style property will be unset.
33989 *
33990 * @param {DOMElement} node
33991 * @param {object} styles
33992 * @param {ReactDOMComponent} component
33993 */
33994 setValueForStyles: function (node, styles, component) {
33995 if (process.env.NODE_ENV !== 'production') {
33996 ReactInstrumentation.debugTool.onHostOperation({
33997 instanceID: component._debugID,
33998 type: 'update styles',
33999 payload: styles
34000 });
34001 }
34002
34003 var style = node.style;
34004 for (var styleName in styles) {
34005 if (!styles.hasOwnProperty(styleName)) {
34006 continue;
34007 }
34008 var isCustomProperty = styleName.indexOf('--') === 0;
34009 if (process.env.NODE_ENV !== 'production') {
34010 if (!isCustomProperty) {
34011 warnValidStyle(styleName, styles[styleName], component);
34012 }
34013 }
34014 var styleValue = dangerousStyleValue(styleName, styles[styleName], component, isCustomProperty);
34015 if (styleName === 'float' || styleName === 'cssFloat') {
34016 styleName = styleFloatAccessor;
34017 }
34018 if (isCustomProperty) {
34019 style.setProperty(styleName, styleValue);
34020 } else if (styleValue) {
34021 style[styleName] = styleValue;
34022 } else {
34023 var expansion = hasShorthandPropertyBug && CSSProperty.shorthandPropertyExpansions[styleName];
34024 if (expansion) {
34025 // Shorthand property that IE8 won't like unsetting, so unset each
34026 // component to placate it
34027 for (var individualStyleName in expansion) {
34028 style[individualStyleName] = '';
34029 }
34030 } else {
34031 style[styleName] = '';
34032 }
34033 }
34034 }
34035 }
34036};
34037
34038module.exports = CSSPropertyOperations;
34039/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
34040
34041/***/ }),
34042/* 133 */
34043/***/ (function(module, exports, __webpack_require__) {
34044
34045"use strict";
34046/**
34047 * Copyright (c) 2013-present, Facebook, Inc.
34048 * All rights reserved.
34049 *
34050 * This source code is licensed under the BSD-style license found in the
34051 * LICENSE file in the root directory of this source tree. An additional grant
34052 * of patent rights can be found in the PATENTS file in the same directory.
34053 *
34054 * @typechecks
34055 */
34056
34057
34058
34059var camelize = __webpack_require__(134);
34060
34061var msPattern = /^-ms-/;
34062
34063/**
34064 * Camelcases a hyphenated CSS property name, for example:
34065 *
34066 * > camelizeStyleName('background-color')
34067 * < "backgroundColor"
34068 * > camelizeStyleName('-moz-transition')
34069 * < "MozTransition"
34070 * > camelizeStyleName('-ms-transition')
34071 * < "msTransition"
34072 *
34073 * As Andi Smith suggests
34074 * (http://www.andismith.com/blog/2012/02/modernizr-prefixed/), an `-ms` prefix
34075 * is converted to lowercase `ms`.
34076 *
34077 * @param {string} string
34078 * @return {string}
34079 */
34080function camelizeStyleName(string) {
34081 return camelize(string.replace(msPattern, 'ms-'));
34082}
34083
34084module.exports = camelizeStyleName;
34085
34086/***/ }),
34087/* 134 */
34088/***/ (function(module, exports, __webpack_require__) {
34089
34090"use strict";
34091
34092
34093/**
34094 * Copyright (c) 2013-present, Facebook, Inc.
34095 * All rights reserved.
34096 *
34097 * This source code is licensed under the BSD-style license found in the
34098 * LICENSE file in the root directory of this source tree. An additional grant
34099 * of patent rights can be found in the PATENTS file in the same directory.
34100 *
34101 * @typechecks
34102 */
34103
34104var _hyphenPattern = /-(.)/g;
34105
34106/**
34107 * Camelcases a hyphenated string, for example:
34108 *
34109 * > camelize('background-color')
34110 * < "backgroundColor"
34111 *
34112 * @param {string} string
34113 * @return {string}
34114 */
34115function camelize(string) {
34116 return string.replace(_hyphenPattern, function (_, character) {
34117 return character.toUpperCase();
34118 });
34119}
34120
34121module.exports = camelize;
34122
34123/***/ }),
34124/* 135 */
34125/***/ (function(module, exports, __webpack_require__) {
34126
34127"use strict";
34128/* WEBPACK VAR INJECTION */(function(process) {/**
34129 * Copyright 2013-present, Facebook, Inc.
34130 * All rights reserved.
34131 *
34132 * This source code is licensed under the BSD-style license found in the
34133 * LICENSE file in the root directory of this source tree. An additional grant
34134 * of patent rights can be found in the PATENTS file in the same directory.
34135 *
34136 */
34137
34138
34139
34140var CSSProperty = __webpack_require__(75);
34141var warning = __webpack_require__(2);
34142
34143var isUnitlessNumber = CSSProperty.isUnitlessNumber;
34144var styleWarnings = {};
34145
34146/**
34147 * Convert a value into the proper css writable value. The style name `name`
34148 * should be logical (no hyphens), as specified
34149 * in `CSSProperty.isUnitlessNumber`.
34150 *
34151 * @param {string} name CSS property name such as `topMargin`.
34152 * @param {*} value CSS property value such as `10px`.
34153 * @param {ReactDOMComponent} component
34154 * @return {string} Normalized style value with dimensions applied.
34155 */
34156function dangerousStyleValue(name, value, component, isCustomProperty) {
34157 // Note that we've removed escapeTextForBrowser() calls here since the
34158 // whole string will be escaped when the attribute is injected into
34159 // the markup. If you provide unsafe user data here they can inject
34160 // arbitrary CSS which may be problematic (I couldn't repro this):
34161 // https://www.owasp.org/index.php/XSS_Filter_Evasion_Cheat_Sheet
34162 // http://www.thespanner.co.uk/2007/11/26/ultimate-xss-css-injection/
34163 // This is not an XSS hole but instead a potential CSS injection issue
34164 // which has lead to a greater discussion about how we're going to
34165 // trust URLs moving forward. See #2115901
34166
34167 var isEmpty = value == null || typeof value === 'boolean' || value === '';
34168 if (isEmpty) {
34169 return '';
34170 }
34171
34172 var isNonNumeric = isNaN(value);
34173 if (isCustomProperty || isNonNumeric || value === 0 || isUnitlessNumber.hasOwnProperty(name) && isUnitlessNumber[name]) {
34174 return '' + value; // cast to string
34175 }
34176
34177 if (typeof value === 'string') {
34178 if (process.env.NODE_ENV !== 'production') {
34179 // Allow '0' to pass through without warning. 0 is already special and
34180 // doesn't require units, so we don't need to warn about it.
34181 if (component && value !== '0') {
34182 var owner = component._currentElement._owner;
34183 var ownerName = owner ? owner.getName() : null;
34184 if (ownerName && !styleWarnings[ownerName]) {
34185 styleWarnings[ownerName] = {};
34186 }
34187 var warned = false;
34188 if (ownerName) {
34189 var warnings = styleWarnings[ownerName];
34190 warned = warnings[name];
34191 if (!warned) {
34192 warnings[name] = true;
34193 }
34194 }
34195 if (!warned) {
34196 process.env.NODE_ENV !== 'production' ? warning(false, 'a `%s` tag (owner: `%s`) was passed a numeric string value ' + 'for CSS property `%s` (value: `%s`) which will be treated ' + 'as a unitless number in a future version of React.', component._currentElement.type, ownerName || 'unknown', name, value) : void 0;
34197 }
34198 }
34199 }
34200 value = value.trim();
34201 }
34202 return value + 'px';
34203}
34204
34205module.exports = dangerousStyleValue;
34206/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
34207
34208/***/ }),
34209/* 136 */
34210/***/ (function(module, exports, __webpack_require__) {
34211
34212"use strict";
34213/**
34214 * Copyright (c) 2013-present, Facebook, Inc.
34215 * All rights reserved.
34216 *
34217 * This source code is licensed under the BSD-style license found in the
34218 * LICENSE file in the root directory of this source tree. An additional grant
34219 * of patent rights can be found in the PATENTS file in the same directory.
34220 *
34221 * @typechecks
34222 */
34223
34224
34225
34226var hyphenate = __webpack_require__(137);
34227
34228var msPattern = /^ms-/;
34229
34230/**
34231 * Hyphenates a camelcased CSS property name, for example:
34232 *
34233 * > hyphenateStyleName('backgroundColor')
34234 * < "background-color"
34235 * > hyphenateStyleName('MozTransition')
34236 * < "-moz-transition"
34237 * > hyphenateStyleName('msTransition')
34238 * < "-ms-transition"
34239 *
34240 * As Modernizr suggests (http://modernizr.com/docs/#prefixed), an `ms` prefix
34241 * is converted to `-ms-`.
34242 *
34243 * @param {string} string
34244 * @return {string}
34245 */
34246function hyphenateStyleName(string) {
34247 return hyphenate(string).replace(msPattern, '-ms-');
34248}
34249
34250module.exports = hyphenateStyleName;
34251
34252/***/ }),
34253/* 137 */
34254/***/ (function(module, exports, __webpack_require__) {
34255
34256"use strict";
34257
34258
34259/**
34260 * Copyright (c) 2013-present, Facebook, Inc.
34261 * All rights reserved.
34262 *
34263 * This source code is licensed under the BSD-style license found in the
34264 * LICENSE file in the root directory of this source tree. An additional grant
34265 * of patent rights can be found in the PATENTS file in the same directory.
34266 *
34267 * @typechecks
34268 */
34269
34270var _uppercasePattern = /([A-Z])/g;
34271
34272/**
34273 * Hyphenates a camelcased string, for example:
34274 *
34275 * > hyphenate('backgroundColor')
34276 * < "background-color"
34277 *
34278 * For CSS style names, use `hyphenateStyleName` instead which works properly
34279 * with all vendor prefixes, including `ms`.
34280 *
34281 * @param {string} string
34282 * @return {string}
34283 */
34284function hyphenate(string) {
34285 return string.replace(_uppercasePattern, '-$1').toLowerCase();
34286}
34287
34288module.exports = hyphenate;
34289
34290/***/ }),
34291/* 138 */
34292/***/ (function(module, exports, __webpack_require__) {
34293
34294"use strict";
34295/**
34296 * Copyright (c) 2013-present, Facebook, Inc.
34297 * All rights reserved.
34298 *
34299 * This source code is licensed under the BSD-style license found in the
34300 * LICENSE file in the root directory of this source tree. An additional grant
34301 * of patent rights can be found in the PATENTS file in the same directory.
34302 *
34303 *
34304 * @typechecks static-only
34305 */
34306
34307
34308
34309/**
34310 * Memoizes the return value of a function that accepts one string argument.
34311 */
34312
34313function memoizeStringOnly(callback) {
34314 var cache = {};
34315 return function (string) {
34316 if (!cache.hasOwnProperty(string)) {
34317 cache[string] = callback.call(this, string);
34318 }
34319 return cache[string];
34320 };
34321}
34322
34323module.exports = memoizeStringOnly;
34324
34325/***/ }),
34326/* 139 */
34327/***/ (function(module, exports, __webpack_require__) {
34328
34329"use strict";
34330/**
34331 * Copyright 2013-present, Facebook, Inc.
34332 * All rights reserved.
34333 *
34334 * This source code is licensed under the BSD-style license found in the
34335 * LICENSE file in the root directory of this source tree. An additional grant
34336 * of patent rights can be found in the PATENTS file in the same directory.
34337 *
34338 */
34339
34340
34341
34342var escapeTextContentForBrowser = __webpack_require__(32);
34343
34344/**
34345 * Escapes attribute value to prevent scripting attacks.
34346 *
34347 * @param {*} value Value to escape.
34348 * @return {string} An escaped string.
34349 */
34350function quoteAttributeValueForBrowser(value) {
34351 return '"' + escapeTextContentForBrowser(value) + '"';
34352}
34353
34354module.exports = quoteAttributeValueForBrowser;
34355
34356/***/ }),
34357/* 140 */
34358/***/ (function(module, exports, __webpack_require__) {
34359
34360"use strict";
34361/**
34362 * Copyright 2013-present, Facebook, Inc.
34363 * All rights reserved.
34364 *
34365 * This source code is licensed under the BSD-style license found in the
34366 * LICENSE file in the root directory of this source tree. An additional grant
34367 * of patent rights can be found in the PATENTS file in the same directory.
34368 *
34369 */
34370
34371
34372
34373var EventPluginHub = __webpack_require__(22);
34374
34375function runEventQueueInBatch(events) {
34376 EventPluginHub.enqueueEvents(events);
34377 EventPluginHub.processEventQueue(false);
34378}
34379
34380var ReactEventEmitterMixin = {
34381 /**
34382 * Streams a fired top-level event to `EventPluginHub` where plugins have the
34383 * opportunity to create `ReactEvent`s to be dispatched.
34384 */
34385 handleTopLevel: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
34386 var events = EventPluginHub.extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget);
34387 runEventQueueInBatch(events);
34388 }
34389};
34390
34391module.exports = ReactEventEmitterMixin;
34392
34393/***/ }),
34394/* 141 */
34395/***/ (function(module, exports, __webpack_require__) {
34396
34397"use strict";
34398/**
34399 * Copyright 2013-present, Facebook, Inc.
34400 * All rights reserved.
34401 *
34402 * This source code is licensed under the BSD-style license found in the
34403 * LICENSE file in the root directory of this source tree. An additional grant
34404 * of patent rights can be found in the PATENTS file in the same directory.
34405 *
34406 */
34407
34408
34409
34410var ExecutionEnvironment = __webpack_require__(6);
34411
34412/**
34413 * Generate a mapping of standard vendor prefixes using the defined style property and event name.
34414 *
34415 * @param {string} styleProp
34416 * @param {string} eventName
34417 * @returns {object}
34418 */
34419function makePrefixMap(styleProp, eventName) {
34420 var prefixes = {};
34421
34422 prefixes[styleProp.toLowerCase()] = eventName.toLowerCase();
34423 prefixes['Webkit' + styleProp] = 'webkit' + eventName;
34424 prefixes['Moz' + styleProp] = 'moz' + eventName;
34425 prefixes['ms' + styleProp] = 'MS' + eventName;
34426 prefixes['O' + styleProp] = 'o' + eventName.toLowerCase();
34427
34428 return prefixes;
34429}
34430
34431/**
34432 * A list of event names to a configurable list of vendor prefixes.
34433 */
34434var vendorPrefixes = {
34435 animationend: makePrefixMap('Animation', 'AnimationEnd'),
34436 animationiteration: makePrefixMap('Animation', 'AnimationIteration'),
34437 animationstart: makePrefixMap('Animation', 'AnimationStart'),
34438 transitionend: makePrefixMap('Transition', 'TransitionEnd')
34439};
34440
34441/**
34442 * Event names that have already been detected and prefixed (if applicable).
34443 */
34444var prefixedEventNames = {};
34445
34446/**
34447 * Element to check for prefixes on.
34448 */
34449var style = {};
34450
34451/**
34452 * Bootstrap if a DOM exists.
34453 */
34454if (ExecutionEnvironment.canUseDOM) {
34455 style = document.createElement('div').style;
34456
34457 // On some platforms, in particular some releases of Android 4.x,
34458 // the un-prefixed "animation" and "transition" properties are defined on the
34459 // style object but the events that fire will still be prefixed, so we need
34460 // to check if the un-prefixed events are usable, and if not remove them from the map.
34461 if (!('AnimationEvent' in window)) {
34462 delete vendorPrefixes.animationend.animation;
34463 delete vendorPrefixes.animationiteration.animation;
34464 delete vendorPrefixes.animationstart.animation;
34465 }
34466
34467 // Same as above
34468 if (!('TransitionEvent' in window)) {
34469 delete vendorPrefixes.transitionend.transition;
34470 }
34471}
34472
34473/**
34474 * Attempts to determine the correct vendor prefixed event name.
34475 *
34476 * @param {string} eventName
34477 * @returns {string}
34478 */
34479function getVendorPrefixedEventName(eventName) {
34480 if (prefixedEventNames[eventName]) {
34481 return prefixedEventNames[eventName];
34482 } else if (!vendorPrefixes[eventName]) {
34483 return eventName;
34484 }
34485
34486 var prefixMap = vendorPrefixes[eventName];
34487
34488 for (var styleProp in prefixMap) {
34489 if (prefixMap.hasOwnProperty(styleProp) && styleProp in style) {
34490 return prefixedEventNames[eventName] = prefixMap[styleProp];
34491 }
34492 }
34493
34494 return '';
34495}
34496
34497module.exports = getVendorPrefixedEventName;
34498
34499/***/ }),
34500/* 142 */
34501/***/ (function(module, exports, __webpack_require__) {
34502
34503"use strict";
34504/* WEBPACK VAR INJECTION */(function(process) {/**
34505 * Copyright 2013-present, Facebook, Inc.
34506 * All rights reserved.
34507 *
34508 * This source code is licensed under the BSD-style license found in the
34509 * LICENSE file in the root directory of this source tree. An additional grant
34510 * of patent rights can be found in the PATENTS file in the same directory.
34511 *
34512 */
34513
34514
34515
34516var _prodInvariant = __webpack_require__(3),
34517 _assign = __webpack_require__(4);
34518
34519var DOMPropertyOperations = __webpack_require__(76);
34520var LinkedValueUtils = __webpack_require__(46);
34521var ReactDOMComponentTree = __webpack_require__(5);
34522var ReactUpdates = __webpack_require__(11);
34523
34524var invariant = __webpack_require__(1);
34525var warning = __webpack_require__(2);
34526
34527var didWarnValueLink = false;
34528var didWarnCheckedLink = false;
34529var didWarnValueDefaultValue = false;
34530var didWarnCheckedDefaultChecked = false;
34531var didWarnControlledToUncontrolled = false;
34532var didWarnUncontrolledToControlled = false;
34533
34534function forceUpdateIfMounted() {
34535 if (this._rootNodeID) {
34536 // DOM component is still mounted; update
34537 ReactDOMInput.updateWrapper(this);
34538 }
34539}
34540
34541function isControlled(props) {
34542 var usesChecked = props.type === 'checkbox' || props.type === 'radio';
34543 return usesChecked ? props.checked != null : props.value != null;
34544}
34545
34546/**
34547 * Implements an <input> host component that allows setting these optional
34548 * props: `checked`, `value`, `defaultChecked`, and `defaultValue`.
34549 *
34550 * If `checked` or `value` are not supplied (or null/undefined), user actions
34551 * that affect the checked state or value will trigger updates to the element.
34552 *
34553 * If they are supplied (and not null/undefined), the rendered element will not
34554 * trigger updates to the element. Instead, the props must change in order for
34555 * the rendered element to be updated.
34556 *
34557 * The rendered element will be initialized as unchecked (or `defaultChecked`)
34558 * with an empty value (or `defaultValue`).
34559 *
34560 * @see http://www.w3.org/TR/2012/WD-html5-20121025/the-input-element.html
34561 */
34562var ReactDOMInput = {
34563 getHostProps: function (inst, props) {
34564 var value = LinkedValueUtils.getValue(props);
34565 var checked = LinkedValueUtils.getChecked(props);
34566
34567 var hostProps = _assign({
34568 // Make sure we set .type before any other properties (setting .value
34569 // before .type means .value is lost in IE11 and below)
34570 type: undefined,
34571 // Make sure we set .step before .value (setting .value before .step
34572 // means .value is rounded on mount, based upon step precision)
34573 step: undefined,
34574 // Make sure we set .min & .max before .value (to ensure proper order
34575 // in corner cases such as min or max deriving from value, e.g. Issue #7170)
34576 min: undefined,
34577 max: undefined
34578 }, props, {
34579 defaultChecked: undefined,
34580 defaultValue: undefined,
34581 value: value != null ? value : inst._wrapperState.initialValue,
34582 checked: checked != null ? checked : inst._wrapperState.initialChecked,
34583 onChange: inst._wrapperState.onChange
34584 });
34585
34586 return hostProps;
34587 },
34588
34589 mountWrapper: function (inst, props) {
34590 if (process.env.NODE_ENV !== 'production') {
34591 LinkedValueUtils.checkPropTypes('input', props, inst._currentElement._owner);
34592
34593 var owner = inst._currentElement._owner;
34594
34595 if (props.valueLink !== undefined && !didWarnValueLink) {
34596 process.env.NODE_ENV !== 'production' ? warning(false, '`valueLink` prop on `input` is deprecated; set `value` and `onChange` instead.') : void 0;
34597 didWarnValueLink = true;
34598 }
34599 if (props.checkedLink !== undefined && !didWarnCheckedLink) {
34600 process.env.NODE_ENV !== 'production' ? warning(false, '`checkedLink` prop on `input` is deprecated; set `value` and `onChange` instead.') : void 0;
34601 didWarnCheckedLink = true;
34602 }
34603 if (props.checked !== undefined && props.defaultChecked !== undefined && !didWarnCheckedDefaultChecked) {
34604 process.env.NODE_ENV !== 'production' ? warning(false, '%s contains an input of type %s with both checked and defaultChecked props. ' + 'Input elements must be either controlled or uncontrolled ' + '(specify either the checked prop, or the defaultChecked prop, but not ' + 'both). Decide between using a controlled or uncontrolled input ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components', owner && owner.getName() || 'A component', props.type) : void 0;
34605 didWarnCheckedDefaultChecked = true;
34606 }
34607 if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValueDefaultValue) {
34608 process.env.NODE_ENV !== 'production' ? warning(false, '%s contains an input of type %s with both value and defaultValue props. ' + 'Input elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled input ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components', owner && owner.getName() || 'A component', props.type) : void 0;
34609 didWarnValueDefaultValue = true;
34610 }
34611 }
34612
34613 var defaultValue = props.defaultValue;
34614 inst._wrapperState = {
34615 initialChecked: props.checked != null ? props.checked : props.defaultChecked,
34616 initialValue: props.value != null ? props.value : defaultValue,
34617 listeners: null,
34618 onChange: _handleChange.bind(inst),
34619 controlled: isControlled(props)
34620 };
34621 },
34622
34623 updateWrapper: function (inst) {
34624 var props = inst._currentElement.props;
34625
34626 if (process.env.NODE_ENV !== 'production') {
34627 var controlled = isControlled(props);
34628 var owner = inst._currentElement._owner;
34629
34630 if (!inst._wrapperState.controlled && controlled && !didWarnUncontrolledToControlled) {
34631 process.env.NODE_ENV !== 'production' ? warning(false, '%s is changing an uncontrolled input of type %s to be controlled. ' + 'Input elements should not switch from uncontrolled to controlled (or vice versa). ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://fb.me/react-controlled-components', owner && owner.getName() || 'A component', props.type) : void 0;
34632 didWarnUncontrolledToControlled = true;
34633 }
34634 if (inst._wrapperState.controlled && !controlled && !didWarnControlledToUncontrolled) {
34635 process.env.NODE_ENV !== 'production' ? warning(false, '%s is changing a controlled input of type %s to be uncontrolled. ' + 'Input elements should not switch from controlled to uncontrolled (or vice versa). ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://fb.me/react-controlled-components', owner && owner.getName() || 'A component', props.type) : void 0;
34636 didWarnControlledToUncontrolled = true;
34637 }
34638 }
34639
34640 // TODO: Shouldn't this be getChecked(props)?
34641 var checked = props.checked;
34642 if (checked != null) {
34643 DOMPropertyOperations.setValueForProperty(ReactDOMComponentTree.getNodeFromInstance(inst), 'checked', checked || false);
34644 }
34645
34646 var node = ReactDOMComponentTree.getNodeFromInstance(inst);
34647 var value = LinkedValueUtils.getValue(props);
34648 if (value != null) {
34649 if (value === 0 && node.value === '') {
34650 node.value = '0';
34651 // Note: IE9 reports a number inputs as 'text', so check props instead.
34652 } else if (props.type === 'number') {
34653 // Simulate `input.valueAsNumber`. IE9 does not support it
34654 var valueAsNumber = parseFloat(node.value, 10) || 0;
34655
34656 if (
34657 // eslint-disable-next-line
34658 value != valueAsNumber ||
34659 // eslint-disable-next-line
34660 value == valueAsNumber && node.value != value) {
34661 // Cast `value` to a string to ensure the value is set correctly. While
34662 // browsers typically do this as necessary, jsdom doesn't.
34663 node.value = '' + value;
34664 }
34665 } else if (node.value !== '' + value) {
34666 // Cast `value` to a string to ensure the value is set correctly. While
34667 // browsers typically do this as necessary, jsdom doesn't.
34668 node.value = '' + value;
34669 }
34670 } else {
34671 if (props.value == null && props.defaultValue != null) {
34672 // In Chrome, assigning defaultValue to certain input types triggers input validation.
34673 // For number inputs, the display value loses trailing decimal points. For email inputs,
34674 // Chrome raises "The specified value <x> is not a valid email address".
34675 //
34676 // Here we check to see if the defaultValue has actually changed, avoiding these problems
34677 // when the user is inputting text
34678 //
34679 // https://github.com/facebook/react/issues/7253
34680 if (node.defaultValue !== '' + props.defaultValue) {
34681 node.defaultValue = '' + props.defaultValue;
34682 }
34683 }
34684 if (props.checked == null && props.defaultChecked != null) {
34685 node.defaultChecked = !!props.defaultChecked;
34686 }
34687 }
34688 },
34689
34690 postMountWrapper: function (inst) {
34691 var props = inst._currentElement.props;
34692
34693 // This is in postMount because we need access to the DOM node, which is not
34694 // available until after the component has mounted.
34695 var node = ReactDOMComponentTree.getNodeFromInstance(inst);
34696
34697 // Detach value from defaultValue. We won't do anything if we're working on
34698 // submit or reset inputs as those values & defaultValues are linked. They
34699 // are not resetable nodes so this operation doesn't matter and actually
34700 // removes browser-default values (eg "Submit Query") when no value is
34701 // provided.
34702
34703 switch (props.type) {
34704 case 'submit':
34705 case 'reset':
34706 break;
34707 case 'color':
34708 case 'date':
34709 case 'datetime':
34710 case 'datetime-local':
34711 case 'month':
34712 case 'time':
34713 case 'week':
34714 // This fixes the no-show issue on iOS Safari and Android Chrome:
34715 // https://github.com/facebook/react/issues/7233
34716 node.value = '';
34717 node.value = node.defaultValue;
34718 break;
34719 default:
34720 node.value = node.value;
34721 break;
34722 }
34723
34724 // Normally, we'd just do `node.checked = node.checked` upon initial mount, less this bug
34725 // this is needed to work around a chrome bug where setting defaultChecked
34726 // will sometimes influence the value of checked (even after detachment).
34727 // Reference: https://bugs.chromium.org/p/chromium/issues/detail?id=608416
34728 // We need to temporarily unset name to avoid disrupting radio button groups.
34729 var name = node.name;
34730 if (name !== '') {
34731 node.name = '';
34732 }
34733 node.defaultChecked = !node.defaultChecked;
34734 node.defaultChecked = !node.defaultChecked;
34735 if (name !== '') {
34736 node.name = name;
34737 }
34738 }
34739};
34740
34741function _handleChange(event) {
34742 var props = this._currentElement.props;
34743
34744 var returnValue = LinkedValueUtils.executeOnChange(props, event);
34745
34746 // Here we use asap to wait until all updates have propagated, which
34747 // is important when using controlled components within layers:
34748 // https://github.com/facebook/react/issues/1698
34749 ReactUpdates.asap(forceUpdateIfMounted, this);
34750
34751 var name = props.name;
34752 if (props.type === 'radio' && name != null) {
34753 var rootNode = ReactDOMComponentTree.getNodeFromInstance(this);
34754 var queryRoot = rootNode;
34755
34756 while (queryRoot.parentNode) {
34757 queryRoot = queryRoot.parentNode;
34758 }
34759
34760 // If `rootNode.form` was non-null, then we could try `form.elements`,
34761 // but that sometimes behaves strangely in IE8. We could also try using
34762 // `form.getElementsByName`, but that will only return direct children
34763 // and won't include inputs that use the HTML5 `form=` attribute. Since
34764 // the input might not even be in a form, let's just use the global
34765 // `querySelectorAll` to ensure we don't miss anything.
34766 var group = queryRoot.querySelectorAll('input[name=' + JSON.stringify('' + name) + '][type="radio"]');
34767
34768 for (var i = 0; i < group.length; i++) {
34769 var otherNode = group[i];
34770 if (otherNode === rootNode || otherNode.form !== rootNode.form) {
34771 continue;
34772 }
34773 // This will throw if radio buttons rendered by different copies of React
34774 // and the same name are rendered into the same form (same as #1939).
34775 // That's probably okay; we don't support it just as we don't support
34776 // mixing React radio buttons with non-React ones.
34777 var otherInstance = ReactDOMComponentTree.getInstanceFromNode(otherNode);
34778 !otherInstance ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactDOMInput: Mixing React and non-React radio inputs with the same `name` is not supported.') : _prodInvariant('90') : void 0;
34779 // If this is a controlled radio button group, forcing the input that
34780 // was previously checked to update will cause it to be come re-checked
34781 // as appropriate.
34782 ReactUpdates.asap(forceUpdateIfMounted, otherInstance);
34783 }
34784 }
34785
34786 return returnValue;
34787}
34788
34789module.exports = ReactDOMInput;
34790/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
34791
34792/***/ }),
34793/* 143 */
34794/***/ (function(module, exports, __webpack_require__) {
34795
34796"use strict";
34797/* WEBPACK VAR INJECTION */(function(process) {/**
34798 * Copyright 2013-present, Facebook, Inc.
34799 * All rights reserved.
34800 *
34801 * This source code is licensed under the BSD-style license found in the
34802 * LICENSE file in the root directory of this source tree. An additional grant
34803 * of patent rights can be found in the PATENTS file in the same directory.
34804 *
34805 */
34806
34807
34808
34809var _assign = __webpack_require__(4);
34810
34811var React = __webpack_require__(17);
34812var ReactDOMComponentTree = __webpack_require__(5);
34813var ReactDOMSelect = __webpack_require__(78);
34814
34815var warning = __webpack_require__(2);
34816var didWarnInvalidOptionChildren = false;
34817
34818function flattenChildren(children) {
34819 var content = '';
34820
34821 // Flatten children and warn if they aren't strings or numbers;
34822 // invalid types are ignored.
34823 React.Children.forEach(children, function (child) {
34824 if (child == null) {
34825 return;
34826 }
34827 if (typeof child === 'string' || typeof child === 'number') {
34828 content += child;
34829 } else if (!didWarnInvalidOptionChildren) {
34830 didWarnInvalidOptionChildren = true;
34831 process.env.NODE_ENV !== 'production' ? warning(false, 'Only strings and numbers are supported as <option> children.') : void 0;
34832 }
34833 });
34834
34835 return content;
34836}
34837
34838/**
34839 * Implements an <option> host component that warns when `selected` is set.
34840 */
34841var ReactDOMOption = {
34842 mountWrapper: function (inst, props, hostParent) {
34843 // TODO (yungsters): Remove support for `selected` in <option>.
34844 if (process.env.NODE_ENV !== 'production') {
34845 process.env.NODE_ENV !== 'production' ? warning(props.selected == null, 'Use the `defaultValue` or `value` props on <select> instead of ' + 'setting `selected` on <option>.') : void 0;
34846 }
34847
34848 // Look up whether this option is 'selected'
34849 var selectValue = null;
34850 if (hostParent != null) {
34851 var selectParent = hostParent;
34852
34853 if (selectParent._tag === 'optgroup') {
34854 selectParent = selectParent._hostParent;
34855 }
34856
34857 if (selectParent != null && selectParent._tag === 'select') {
34858 selectValue = ReactDOMSelect.getSelectValueContext(selectParent);
34859 }
34860 }
34861
34862 // If the value is null (e.g., no specified value or after initial mount)
34863 // or missing (e.g., for <datalist>), we don't change props.selected
34864 var selected = null;
34865 if (selectValue != null) {
34866 var value;
34867 if (props.value != null) {
34868 value = props.value + '';
34869 } else {
34870 value = flattenChildren(props.children);
34871 }
34872 selected = false;
34873 if (Array.isArray(selectValue)) {
34874 // multiple
34875 for (var i = 0; i < selectValue.length; i++) {
34876 if ('' + selectValue[i] === value) {
34877 selected = true;
34878 break;
34879 }
34880 }
34881 } else {
34882 selected = '' + selectValue === value;
34883 }
34884 }
34885
34886 inst._wrapperState = { selected: selected };
34887 },
34888
34889 postMountWrapper: function (inst) {
34890 // value="" should make a value attribute (#6219)
34891 var props = inst._currentElement.props;
34892 if (props.value != null) {
34893 var node = ReactDOMComponentTree.getNodeFromInstance(inst);
34894 node.setAttribute('value', props.value);
34895 }
34896 },
34897
34898 getHostProps: function (inst, props) {
34899 var hostProps = _assign({ selected: undefined, children: undefined }, props);
34900
34901 // Read state only from initial mount because <select> updates value
34902 // manually; we need the initial state only for server rendering
34903 if (inst._wrapperState.selected != null) {
34904 hostProps.selected = inst._wrapperState.selected;
34905 }
34906
34907 var content = flattenChildren(props.children);
34908
34909 if (content) {
34910 hostProps.children = content;
34911 }
34912
34913 return hostProps;
34914 }
34915};
34916
34917module.exports = ReactDOMOption;
34918/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
34919
34920/***/ }),
34921/* 144 */
34922/***/ (function(module, exports, __webpack_require__) {
34923
34924"use strict";
34925/* WEBPACK VAR INJECTION */(function(process) {/**
34926 * Copyright 2013-present, Facebook, Inc.
34927 * All rights reserved.
34928 *
34929 * This source code is licensed under the BSD-style license found in the
34930 * LICENSE file in the root directory of this source tree. An additional grant
34931 * of patent rights can be found in the PATENTS file in the same directory.
34932 *
34933 */
34934
34935
34936
34937var _prodInvariant = __webpack_require__(3),
34938 _assign = __webpack_require__(4);
34939
34940var LinkedValueUtils = __webpack_require__(46);
34941var ReactDOMComponentTree = __webpack_require__(5);
34942var ReactUpdates = __webpack_require__(11);
34943
34944var invariant = __webpack_require__(1);
34945var warning = __webpack_require__(2);
34946
34947var didWarnValueLink = false;
34948var didWarnValDefaultVal = false;
34949
34950function forceUpdateIfMounted() {
34951 if (this._rootNodeID) {
34952 // DOM component is still mounted; update
34953 ReactDOMTextarea.updateWrapper(this);
34954 }
34955}
34956
34957/**
34958 * Implements a <textarea> host component that allows setting `value`, and
34959 * `defaultValue`. This differs from the traditional DOM API because value is
34960 * usually set as PCDATA children.
34961 *
34962 * If `value` is not supplied (or null/undefined), user actions that affect the
34963 * value will trigger updates to the element.
34964 *
34965 * If `value` is supplied (and not null/undefined), the rendered element will
34966 * not trigger updates to the element. Instead, the `value` prop must change in
34967 * order for the rendered element to be updated.
34968 *
34969 * The rendered element will be initialized with an empty value, the prop
34970 * `defaultValue` if specified, or the children content (deprecated).
34971 */
34972var ReactDOMTextarea = {
34973 getHostProps: function (inst, props) {
34974 !(props.dangerouslySetInnerHTML == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, '`dangerouslySetInnerHTML` does not make sense on <textarea>.') : _prodInvariant('91') : void 0;
34975
34976 // Always set children to the same thing. In IE9, the selection range will
34977 // get reset if `textContent` is mutated. We could add a check in setTextContent
34978 // to only set the value if/when the value differs from the node value (which would
34979 // completely solve this IE9 bug), but Sebastian+Ben seemed to like this solution.
34980 // The value can be a boolean or object so that's why it's forced to be a string.
34981 var hostProps = _assign({}, props, {
34982 value: undefined,
34983 defaultValue: undefined,
34984 children: '' + inst._wrapperState.initialValue,
34985 onChange: inst._wrapperState.onChange
34986 });
34987
34988 return hostProps;
34989 },
34990
34991 mountWrapper: function (inst, props) {
34992 if (process.env.NODE_ENV !== 'production') {
34993 LinkedValueUtils.checkPropTypes('textarea', props, inst._currentElement._owner);
34994 if (props.valueLink !== undefined && !didWarnValueLink) {
34995 process.env.NODE_ENV !== 'production' ? warning(false, '`valueLink` prop on `textarea` is deprecated; set `value` and `onChange` instead.') : void 0;
34996 didWarnValueLink = true;
34997 }
34998 if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValDefaultVal) {
34999 process.env.NODE_ENV !== 'production' ? warning(false, 'Textarea elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled textarea ' + 'and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components') : void 0;
35000 didWarnValDefaultVal = true;
35001 }
35002 }
35003
35004 var value = LinkedValueUtils.getValue(props);
35005 var initialValue = value;
35006
35007 // Only bother fetching default value if we're going to use it
35008 if (value == null) {
35009 var defaultValue = props.defaultValue;
35010 // TODO (yungsters): Remove support for children content in <textarea>.
35011 var children = props.children;
35012 if (children != null) {
35013 if (process.env.NODE_ENV !== 'production') {
35014 process.env.NODE_ENV !== 'production' ? warning(false, 'Use the `defaultValue` or `value` props instead of setting ' + 'children on <textarea>.') : void 0;
35015 }
35016 !(defaultValue == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'If you supply `defaultValue` on a <textarea>, do not pass children.') : _prodInvariant('92') : void 0;
35017 if (Array.isArray(children)) {
35018 !(children.length <= 1) ? process.env.NODE_ENV !== 'production' ? invariant(false, '<textarea> can only have at most one child.') : _prodInvariant('93') : void 0;
35019 children = children[0];
35020 }
35021
35022 defaultValue = '' + children;
35023 }
35024 if (defaultValue == null) {
35025 defaultValue = '';
35026 }
35027 initialValue = defaultValue;
35028 }
35029
35030 inst._wrapperState = {
35031 initialValue: '' + initialValue,
35032 listeners: null,
35033 onChange: _handleChange.bind(inst)
35034 };
35035 },
35036
35037 updateWrapper: function (inst) {
35038 var props = inst._currentElement.props;
35039
35040 var node = ReactDOMComponentTree.getNodeFromInstance(inst);
35041 var value = LinkedValueUtils.getValue(props);
35042 if (value != null) {
35043 // Cast `value` to a string to ensure the value is set correctly. While
35044 // browsers typically do this as necessary, jsdom doesn't.
35045 var newValue = '' + value;
35046
35047 // To avoid side effects (such as losing text selection), only set value if changed
35048 if (newValue !== node.value) {
35049 node.value = newValue;
35050 }
35051 if (props.defaultValue == null) {
35052 node.defaultValue = newValue;
35053 }
35054 }
35055 if (props.defaultValue != null) {
35056 node.defaultValue = props.defaultValue;
35057 }
35058 },
35059
35060 postMountWrapper: function (inst) {
35061 // This is in postMount because we need access to the DOM node, which is not
35062 // available until after the component has mounted.
35063 var node = ReactDOMComponentTree.getNodeFromInstance(inst);
35064 var textContent = node.textContent;
35065
35066 // Only set node.value if textContent is equal to the expected
35067 // initial value. In IE10/IE11 there is a bug where the placeholder attribute
35068 // will populate textContent as well.
35069 // https://developer.microsoft.com/microsoft-edge/platform/issues/101525/
35070 if (textContent === inst._wrapperState.initialValue) {
35071 node.value = textContent;
35072 }
35073 }
35074};
35075
35076function _handleChange(event) {
35077 var props = this._currentElement.props;
35078 var returnValue = LinkedValueUtils.executeOnChange(props, event);
35079 ReactUpdates.asap(forceUpdateIfMounted, this);
35080 return returnValue;
35081}
35082
35083module.exports = ReactDOMTextarea;
35084/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
35085
35086/***/ }),
35087/* 145 */
35088/***/ (function(module, exports, __webpack_require__) {
35089
35090"use strict";
35091/* WEBPACK VAR INJECTION */(function(process) {/**
35092 * Copyright 2013-present, Facebook, Inc.
35093 * All rights reserved.
35094 *
35095 * This source code is licensed under the BSD-style license found in the
35096 * LICENSE file in the root directory of this source tree. An additional grant
35097 * of patent rights can be found in the PATENTS file in the same directory.
35098 *
35099 */
35100
35101
35102
35103var _prodInvariant = __webpack_require__(3);
35104
35105var ReactComponentEnvironment = __webpack_require__(47);
35106var ReactInstanceMap = __webpack_require__(24);
35107var ReactInstrumentation = __webpack_require__(9);
35108
35109var ReactCurrentOwner = __webpack_require__(10);
35110var ReactReconciler = __webpack_require__(19);
35111var ReactChildReconciler = __webpack_require__(146);
35112
35113var emptyFunction = __webpack_require__(8);
35114var flattenChildren = __webpack_require__(153);
35115var invariant = __webpack_require__(1);
35116
35117/**
35118 * Make an update for markup to be rendered and inserted at a supplied index.
35119 *
35120 * @param {string} markup Markup that renders into an element.
35121 * @param {number} toIndex Destination index.
35122 * @private
35123 */
35124function makeInsertMarkup(markup, afterNode, toIndex) {
35125 // NOTE: Null values reduce hidden classes.
35126 return {
35127 type: 'INSERT_MARKUP',
35128 content: markup,
35129 fromIndex: null,
35130 fromNode: null,
35131 toIndex: toIndex,
35132 afterNode: afterNode
35133 };
35134}
35135
35136/**
35137 * Make an update for moving an existing element to another index.
35138 *
35139 * @param {number} fromIndex Source index of the existing element.
35140 * @param {number} toIndex Destination index of the element.
35141 * @private
35142 */
35143function makeMove(child, afterNode, toIndex) {
35144 // NOTE: Null values reduce hidden classes.
35145 return {
35146 type: 'MOVE_EXISTING',
35147 content: null,
35148 fromIndex: child._mountIndex,
35149 fromNode: ReactReconciler.getHostNode(child),
35150 toIndex: toIndex,
35151 afterNode: afterNode
35152 };
35153}
35154
35155/**
35156 * Make an update for removing an element at an index.
35157 *
35158 * @param {number} fromIndex Index of the element to remove.
35159 * @private
35160 */
35161function makeRemove(child, node) {
35162 // NOTE: Null values reduce hidden classes.
35163 return {
35164 type: 'REMOVE_NODE',
35165 content: null,
35166 fromIndex: child._mountIndex,
35167 fromNode: node,
35168 toIndex: null,
35169 afterNode: null
35170 };
35171}
35172
35173/**
35174 * Make an update for setting the markup of a node.
35175 *
35176 * @param {string} markup Markup that renders into an element.
35177 * @private
35178 */
35179function makeSetMarkup(markup) {
35180 // NOTE: Null values reduce hidden classes.
35181 return {
35182 type: 'SET_MARKUP',
35183 content: markup,
35184 fromIndex: null,
35185 fromNode: null,
35186 toIndex: null,
35187 afterNode: null
35188 };
35189}
35190
35191/**
35192 * Make an update for setting the text content.
35193 *
35194 * @param {string} textContent Text content to set.
35195 * @private
35196 */
35197function makeTextContent(textContent) {
35198 // NOTE: Null values reduce hidden classes.
35199 return {
35200 type: 'TEXT_CONTENT',
35201 content: textContent,
35202 fromIndex: null,
35203 fromNode: null,
35204 toIndex: null,
35205 afterNode: null
35206 };
35207}
35208
35209/**
35210 * Push an update, if any, onto the queue. Creates a new queue if none is
35211 * passed and always returns the queue. Mutative.
35212 */
35213function enqueue(queue, update) {
35214 if (update) {
35215 queue = queue || [];
35216 queue.push(update);
35217 }
35218 return queue;
35219}
35220
35221/**
35222 * Processes any enqueued updates.
35223 *
35224 * @private
35225 */
35226function processQueue(inst, updateQueue) {
35227 ReactComponentEnvironment.processChildrenUpdates(inst, updateQueue);
35228}
35229
35230var setChildrenForInstrumentation = emptyFunction;
35231if (process.env.NODE_ENV !== 'production') {
35232 var getDebugID = function (inst) {
35233 if (!inst._debugID) {
35234 // Check for ART-like instances. TODO: This is silly/gross.
35235 var internal;
35236 if (internal = ReactInstanceMap.get(inst)) {
35237 inst = internal;
35238 }
35239 }
35240 return inst._debugID;
35241 };
35242 setChildrenForInstrumentation = function (children) {
35243 var debugID = getDebugID(this);
35244 // TODO: React Native empty components are also multichild.
35245 // This means they still get into this method but don't have _debugID.
35246 if (debugID !== 0) {
35247 ReactInstrumentation.debugTool.onSetChildren(debugID, children ? Object.keys(children).map(function (key) {
35248 return children[key]._debugID;
35249 }) : []);
35250 }
35251 };
35252}
35253
35254/**
35255 * ReactMultiChild are capable of reconciling multiple children.
35256 *
35257 * @class ReactMultiChild
35258 * @internal
35259 */
35260var ReactMultiChild = {
35261 /**
35262 * Provides common functionality for components that must reconcile multiple
35263 * children. This is used by `ReactDOMComponent` to mount, update, and
35264 * unmount child components.
35265 *
35266 * @lends {ReactMultiChild.prototype}
35267 */
35268 Mixin: {
35269 _reconcilerInstantiateChildren: function (nestedChildren, transaction, context) {
35270 if (process.env.NODE_ENV !== 'production') {
35271 var selfDebugID = getDebugID(this);
35272 if (this._currentElement) {
35273 try {
35274 ReactCurrentOwner.current = this._currentElement._owner;
35275 return ReactChildReconciler.instantiateChildren(nestedChildren, transaction, context, selfDebugID);
35276 } finally {
35277 ReactCurrentOwner.current = null;
35278 }
35279 }
35280 }
35281 return ReactChildReconciler.instantiateChildren(nestedChildren, transaction, context);
35282 },
35283
35284 _reconcilerUpdateChildren: function (prevChildren, nextNestedChildrenElements, mountImages, removedNodes, transaction, context) {
35285 var nextChildren;
35286 var selfDebugID = 0;
35287 if (process.env.NODE_ENV !== 'production') {
35288 selfDebugID = getDebugID(this);
35289 if (this._currentElement) {
35290 try {
35291 ReactCurrentOwner.current = this._currentElement._owner;
35292 nextChildren = flattenChildren(nextNestedChildrenElements, selfDebugID);
35293 } finally {
35294 ReactCurrentOwner.current = null;
35295 }
35296 ReactChildReconciler.updateChildren(prevChildren, nextChildren, mountImages, removedNodes, transaction, this, this._hostContainerInfo, context, selfDebugID);
35297 return nextChildren;
35298 }
35299 }
35300 nextChildren = flattenChildren(nextNestedChildrenElements, selfDebugID);
35301 ReactChildReconciler.updateChildren(prevChildren, nextChildren, mountImages, removedNodes, transaction, this, this._hostContainerInfo, context, selfDebugID);
35302 return nextChildren;
35303 },
35304
35305 /**
35306 * Generates a "mount image" for each of the supplied children. In the case
35307 * of `ReactDOMComponent`, a mount image is a string of markup.
35308 *
35309 * @param {?object} nestedChildren Nested child maps.
35310 * @return {array} An array of mounted representations.
35311 * @internal
35312 */
35313 mountChildren: function (nestedChildren, transaction, context) {
35314 var children = this._reconcilerInstantiateChildren(nestedChildren, transaction, context);
35315 this._renderedChildren = children;
35316
35317 var mountImages = [];
35318 var index = 0;
35319 for (var name in children) {
35320 if (children.hasOwnProperty(name)) {
35321 var child = children[name];
35322 var selfDebugID = 0;
35323 if (process.env.NODE_ENV !== 'production') {
35324 selfDebugID = getDebugID(this);
35325 }
35326 var mountImage = ReactReconciler.mountComponent(child, transaction, this, this._hostContainerInfo, context, selfDebugID);
35327 child._mountIndex = index++;
35328 mountImages.push(mountImage);
35329 }
35330 }
35331
35332 if (process.env.NODE_ENV !== 'production') {
35333 setChildrenForInstrumentation.call(this, children);
35334 }
35335
35336 return mountImages;
35337 },
35338
35339 /**
35340 * Replaces any rendered children with a text content string.
35341 *
35342 * @param {string} nextContent String of content.
35343 * @internal
35344 */
35345 updateTextContent: function (nextContent) {
35346 var prevChildren = this._renderedChildren;
35347 // Remove any rendered children.
35348 ReactChildReconciler.unmountChildren(prevChildren, false);
35349 for (var name in prevChildren) {
35350 if (prevChildren.hasOwnProperty(name)) {
35351 true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'updateTextContent called on non-empty component.') : _prodInvariant('118') : void 0;
35352 }
35353 }
35354 // Set new text content.
35355 var updates = [makeTextContent(nextContent)];
35356 processQueue(this, updates);
35357 },
35358
35359 /**
35360 * Replaces any rendered children with a markup string.
35361 *
35362 * @param {string} nextMarkup String of markup.
35363 * @internal
35364 */
35365 updateMarkup: function (nextMarkup) {
35366 var prevChildren = this._renderedChildren;
35367 // Remove any rendered children.
35368 ReactChildReconciler.unmountChildren(prevChildren, false);
35369 for (var name in prevChildren) {
35370 if (prevChildren.hasOwnProperty(name)) {
35371 true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'updateTextContent called on non-empty component.') : _prodInvariant('118') : void 0;
35372 }
35373 }
35374 var updates = [makeSetMarkup(nextMarkup)];
35375 processQueue(this, updates);
35376 },
35377
35378 /**
35379 * Updates the rendered children with new children.
35380 *
35381 * @param {?object} nextNestedChildrenElements Nested child element maps.
35382 * @param {ReactReconcileTransaction} transaction
35383 * @internal
35384 */
35385 updateChildren: function (nextNestedChildrenElements, transaction, context) {
35386 // Hook used by React ART
35387 this._updateChildren(nextNestedChildrenElements, transaction, context);
35388 },
35389
35390 /**
35391 * @param {?object} nextNestedChildrenElements Nested child element maps.
35392 * @param {ReactReconcileTransaction} transaction
35393 * @final
35394 * @protected
35395 */
35396 _updateChildren: function (nextNestedChildrenElements, transaction, context) {
35397 var prevChildren = this._renderedChildren;
35398 var removedNodes = {};
35399 var mountImages = [];
35400 var nextChildren = this._reconcilerUpdateChildren(prevChildren, nextNestedChildrenElements, mountImages, removedNodes, transaction, context);
35401 if (!nextChildren && !prevChildren) {
35402 return;
35403 }
35404 var updates = null;
35405 var name;
35406 // `nextIndex` will increment for each child in `nextChildren`, but
35407 // `lastIndex` will be the last index visited in `prevChildren`.
35408 var nextIndex = 0;
35409 var lastIndex = 0;
35410 // `nextMountIndex` will increment for each newly mounted child.
35411 var nextMountIndex = 0;
35412 var lastPlacedNode = null;
35413 for (name in nextChildren) {
35414 if (!nextChildren.hasOwnProperty(name)) {
35415 continue;
35416 }
35417 var prevChild = prevChildren && prevChildren[name];
35418 var nextChild = nextChildren[name];
35419 if (prevChild === nextChild) {
35420 updates = enqueue(updates, this.moveChild(prevChild, lastPlacedNode, nextIndex, lastIndex));
35421 lastIndex = Math.max(prevChild._mountIndex, lastIndex);
35422 prevChild._mountIndex = nextIndex;
35423 } else {
35424 if (prevChild) {
35425 // Update `lastIndex` before `_mountIndex` gets unset by unmounting.
35426 lastIndex = Math.max(prevChild._mountIndex, lastIndex);
35427 // The `removedNodes` loop below will actually remove the child.
35428 }
35429 // The child must be instantiated before it's mounted.
35430 updates = enqueue(updates, this._mountChildAtIndex(nextChild, mountImages[nextMountIndex], lastPlacedNode, nextIndex, transaction, context));
35431 nextMountIndex++;
35432 }
35433 nextIndex++;
35434 lastPlacedNode = ReactReconciler.getHostNode(nextChild);
35435 }
35436 // Remove children that are no longer present.
35437 for (name in removedNodes) {
35438 if (removedNodes.hasOwnProperty(name)) {
35439 updates = enqueue(updates, this._unmountChild(prevChildren[name], removedNodes[name]));
35440 }
35441 }
35442 if (updates) {
35443 processQueue(this, updates);
35444 }
35445 this._renderedChildren = nextChildren;
35446
35447 if (process.env.NODE_ENV !== 'production') {
35448 setChildrenForInstrumentation.call(this, nextChildren);
35449 }
35450 },
35451
35452 /**
35453 * Unmounts all rendered children. This should be used to clean up children
35454 * when this component is unmounted. It does not actually perform any
35455 * backend operations.
35456 *
35457 * @internal
35458 */
35459 unmountChildren: function (safely) {
35460 var renderedChildren = this._renderedChildren;
35461 ReactChildReconciler.unmountChildren(renderedChildren, safely);
35462 this._renderedChildren = null;
35463 },
35464
35465 /**
35466 * Moves a child component to the supplied index.
35467 *
35468 * @param {ReactComponent} child Component to move.
35469 * @param {number} toIndex Destination index of the element.
35470 * @param {number} lastIndex Last index visited of the siblings of `child`.
35471 * @protected
35472 */
35473 moveChild: function (child, afterNode, toIndex, lastIndex) {
35474 // If the index of `child` is less than `lastIndex`, then it needs to
35475 // be moved. Otherwise, we do not need to move it because a child will be
35476 // inserted or moved before `child`.
35477 if (child._mountIndex < lastIndex) {
35478 return makeMove(child, afterNode, toIndex);
35479 }
35480 },
35481
35482 /**
35483 * Creates a child component.
35484 *
35485 * @param {ReactComponent} child Component to create.
35486 * @param {string} mountImage Markup to insert.
35487 * @protected
35488 */
35489 createChild: function (child, afterNode, mountImage) {
35490 return makeInsertMarkup(mountImage, afterNode, child._mountIndex);
35491 },
35492
35493 /**
35494 * Removes a child component.
35495 *
35496 * @param {ReactComponent} child Child to remove.
35497 * @protected
35498 */
35499 removeChild: function (child, node) {
35500 return makeRemove(child, node);
35501 },
35502
35503 /**
35504 * Mounts a child with the supplied name.
35505 *
35506 * NOTE: This is part of `updateChildren` and is here for readability.
35507 *
35508 * @param {ReactComponent} child Component to mount.
35509 * @param {string} name Name of the child.
35510 * @param {number} index Index at which to insert the child.
35511 * @param {ReactReconcileTransaction} transaction
35512 * @private
35513 */
35514 _mountChildAtIndex: function (child, mountImage, afterNode, index, transaction, context) {
35515 child._mountIndex = index;
35516 return this.createChild(child, afterNode, mountImage);
35517 },
35518
35519 /**
35520 * Unmounts a rendered child.
35521 *
35522 * NOTE: This is part of `updateChildren` and is here for readability.
35523 *
35524 * @param {ReactComponent} child Component to unmount.
35525 * @private
35526 */
35527 _unmountChild: function (child, node) {
35528 var update = this.removeChild(child, node);
35529 child._mountIndex = null;
35530 return update;
35531 }
35532 }
35533};
35534
35535module.exports = ReactMultiChild;
35536/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
35537
35538/***/ }),
35539/* 146 */
35540/***/ (function(module, exports, __webpack_require__) {
35541
35542"use strict";
35543/* WEBPACK VAR INJECTION */(function(process) {/**
35544 * Copyright 2014-present, Facebook, Inc.
35545 * All rights reserved.
35546 *
35547 * This source code is licensed under the BSD-style license found in the
35548 * LICENSE file in the root directory of this source tree. An additional grant
35549 * of patent rights can be found in the PATENTS file in the same directory.
35550 *
35551 */
35552
35553
35554
35555var ReactReconciler = __webpack_require__(19);
35556
35557var instantiateReactComponent = __webpack_require__(79);
35558var KeyEscapeUtils = __webpack_require__(50);
35559var shouldUpdateReactComponent = __webpack_require__(49);
35560var traverseAllChildren = __webpack_require__(83);
35561var warning = __webpack_require__(2);
35562
35563var ReactComponentTreeHook;
35564
35565if (typeof process !== 'undefined' && process.env && process.env.NODE_ENV === 'test') {
35566 // Temporary hack.
35567 // Inline requires don't work well with Jest:
35568 // https://github.com/facebook/react/issues/7240
35569 // Remove the inline requires when we don't need them anymore:
35570 // https://github.com/facebook/react/pull/7178
35571 ReactComponentTreeHook = __webpack_require__(7);
35572}
35573
35574function instantiateChild(childInstances, child, name, selfDebugID) {
35575 // We found a component instance.
35576 var keyUnique = childInstances[name] === undefined;
35577 if (process.env.NODE_ENV !== 'production') {
35578 if (!ReactComponentTreeHook) {
35579 ReactComponentTreeHook = __webpack_require__(7);
35580 }
35581 if (!keyUnique) {
35582 process.env.NODE_ENV !== 'production' ? warning(false, 'flattenChildren(...): Encountered two children with the same key, ' + '`%s`. Child keys must be unique; when two children share a key, only ' + 'the first child will be used.%s', KeyEscapeUtils.unescape(name), ReactComponentTreeHook.getStackAddendumByID(selfDebugID)) : void 0;
35583 }
35584 }
35585 if (child != null && keyUnique) {
35586 childInstances[name] = instantiateReactComponent(child, true);
35587 }
35588}
35589
35590/**
35591 * ReactChildReconciler provides helpers for initializing or updating a set of
35592 * children. Its output is suitable for passing it onto ReactMultiChild which
35593 * does diffed reordering and insertion.
35594 */
35595var ReactChildReconciler = {
35596 /**
35597 * Generates a "mount image" for each of the supplied children. In the case
35598 * of `ReactDOMComponent`, a mount image is a string of markup.
35599 *
35600 * @param {?object} nestedChildNodes Nested child maps.
35601 * @return {?object} A set of child instances.
35602 * @internal
35603 */
35604 instantiateChildren: function (nestedChildNodes, transaction, context, selfDebugID) // 0 in production and for roots
35605 {
35606 if (nestedChildNodes == null) {
35607 return null;
35608 }
35609 var childInstances = {};
35610
35611 if (process.env.NODE_ENV !== 'production') {
35612 traverseAllChildren(nestedChildNodes, function (childInsts, child, name) {
35613 return instantiateChild(childInsts, child, name, selfDebugID);
35614 }, childInstances);
35615 } else {
35616 traverseAllChildren(nestedChildNodes, instantiateChild, childInstances);
35617 }
35618 return childInstances;
35619 },
35620
35621 /**
35622 * Updates the rendered children and returns a new set of children.
35623 *
35624 * @param {?object} prevChildren Previously initialized set of children.
35625 * @param {?object} nextChildren Flat child element maps.
35626 * @param {ReactReconcileTransaction} transaction
35627 * @param {object} context
35628 * @return {?object} A new set of child instances.
35629 * @internal
35630 */
35631 updateChildren: function (prevChildren, nextChildren, mountImages, removedNodes, transaction, hostParent, hostContainerInfo, context, selfDebugID) // 0 in production and for roots
35632 {
35633 // We currently don't have a way to track moves here but if we use iterators
35634 // instead of for..in we can zip the iterators and check if an item has
35635 // moved.
35636 // TODO: If nothing has changed, return the prevChildren object so that we
35637 // can quickly bailout if nothing has changed.
35638 if (!nextChildren && !prevChildren) {
35639 return;
35640 }
35641 var name;
35642 var prevChild;
35643 for (name in nextChildren) {
35644 if (!nextChildren.hasOwnProperty(name)) {
35645 continue;
35646 }
35647 prevChild = prevChildren && prevChildren[name];
35648 var prevElement = prevChild && prevChild._currentElement;
35649 var nextElement = nextChildren[name];
35650 if (prevChild != null && shouldUpdateReactComponent(prevElement, nextElement)) {
35651 ReactReconciler.receiveComponent(prevChild, nextElement, transaction, context);
35652 nextChildren[name] = prevChild;
35653 } else {
35654 if (prevChild) {
35655 removedNodes[name] = ReactReconciler.getHostNode(prevChild);
35656 ReactReconciler.unmountComponent(prevChild, false);
35657 }
35658 // The child must be instantiated before it's mounted.
35659 var nextChildInstance = instantiateReactComponent(nextElement, true);
35660 nextChildren[name] = nextChildInstance;
35661 // Creating mount image now ensures refs are resolved in right order
35662 // (see https://github.com/facebook/react/pull/7101 for explanation).
35663 var nextChildMountImage = ReactReconciler.mountComponent(nextChildInstance, transaction, hostParent, hostContainerInfo, context, selfDebugID);
35664 mountImages.push(nextChildMountImage);
35665 }
35666 }
35667 // Unmount children that are no longer present.
35668 for (name in prevChildren) {
35669 if (prevChildren.hasOwnProperty(name) && !(nextChildren && nextChildren.hasOwnProperty(name))) {
35670 prevChild = prevChildren[name];
35671 removedNodes[name] = ReactReconciler.getHostNode(prevChild);
35672 ReactReconciler.unmountComponent(prevChild, false);
35673 }
35674 }
35675 },
35676
35677 /**
35678 * Unmounts all rendered children. This should be used to clean up children
35679 * when this component is unmounted.
35680 *
35681 * @param {?object} renderedChildren Previously initialized set of children.
35682 * @internal
35683 */
35684 unmountChildren: function (renderedChildren, safely) {
35685 for (var name in renderedChildren) {
35686 if (renderedChildren.hasOwnProperty(name)) {
35687 var renderedChild = renderedChildren[name];
35688 ReactReconciler.unmountComponent(renderedChild, safely);
35689 }
35690 }
35691 }
35692};
35693
35694module.exports = ReactChildReconciler;
35695/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
35696
35697/***/ }),
35698/* 147 */
35699/***/ (function(module, exports, __webpack_require__) {
35700
35701"use strict";
35702/* WEBPACK VAR INJECTION */(function(process) {/**
35703 * Copyright 2013-present, Facebook, Inc.
35704 * All rights reserved.
35705 *
35706 * This source code is licensed under the BSD-style license found in the
35707 * LICENSE file in the root directory of this source tree. An additional grant
35708 * of patent rights can be found in the PATENTS file in the same directory.
35709 *
35710 */
35711
35712
35713
35714var _prodInvariant = __webpack_require__(3),
35715 _assign = __webpack_require__(4);
35716
35717var React = __webpack_require__(17);
35718var ReactComponentEnvironment = __webpack_require__(47);
35719var ReactCurrentOwner = __webpack_require__(10);
35720var ReactErrorUtils = __webpack_require__(39);
35721var ReactInstanceMap = __webpack_require__(24);
35722var ReactInstrumentation = __webpack_require__(9);
35723var ReactNodeTypes = __webpack_require__(80);
35724var ReactReconciler = __webpack_require__(19);
35725
35726if (process.env.NODE_ENV !== 'production') {
35727 var checkReactTypeSpec = __webpack_require__(148);
35728}
35729
35730var emptyObject = __webpack_require__(27);
35731var invariant = __webpack_require__(1);
35732var shallowEqual = __webpack_require__(48);
35733var shouldUpdateReactComponent = __webpack_require__(49);
35734var warning = __webpack_require__(2);
35735
35736var CompositeTypes = {
35737 ImpureClass: 0,
35738 PureClass: 1,
35739 StatelessFunctional: 2
35740};
35741
35742function StatelessComponent(Component) {}
35743StatelessComponent.prototype.render = function () {
35744 var Component = ReactInstanceMap.get(this)._currentElement.type;
35745 var element = Component(this.props, this.context, this.updater);
35746 warnIfInvalidElement(Component, element);
35747 return element;
35748};
35749
35750function warnIfInvalidElement(Component, element) {
35751 if (process.env.NODE_ENV !== 'production') {
35752 process.env.NODE_ENV !== 'production' ? warning(element === null || element === false || React.isValidElement(element), '%s(...): A valid React element (or null) must be returned. You may have ' + 'returned undefined, an array or some other invalid object.', Component.displayName || Component.name || 'Component') : void 0;
35753 process.env.NODE_ENV !== 'production' ? warning(!Component.childContextTypes, '%s(...): childContextTypes cannot be defined on a functional component.', Component.displayName || Component.name || 'Component') : void 0;
35754 }
35755}
35756
35757function shouldConstruct(Component) {
35758 return !!(Component.prototype && Component.prototype.isReactComponent);
35759}
35760
35761function isPureComponent(Component) {
35762 return !!(Component.prototype && Component.prototype.isPureReactComponent);
35763}
35764
35765// Separated into a function to contain deoptimizations caused by try/finally.
35766function measureLifeCyclePerf(fn, debugID, timerType) {
35767 if (debugID === 0) {
35768 // Top-level wrappers (see ReactMount) and empty components (see
35769 // ReactDOMEmptyComponent) are invisible to hooks and devtools.
35770 // Both are implementation details that should go away in the future.
35771 return fn();
35772 }
35773
35774 ReactInstrumentation.debugTool.onBeginLifeCycleTimer(debugID, timerType);
35775 try {
35776 return fn();
35777 } finally {
35778 ReactInstrumentation.debugTool.onEndLifeCycleTimer(debugID, timerType);
35779 }
35780}
35781
35782/**
35783 * ------------------ The Life-Cycle of a Composite Component ------------------
35784 *
35785 * - constructor: Initialization of state. The instance is now retained.
35786 * - componentWillMount
35787 * - render
35788 * - [children's constructors]
35789 * - [children's componentWillMount and render]
35790 * - [children's componentDidMount]
35791 * - componentDidMount
35792 *
35793 * Update Phases:
35794 * - componentWillReceiveProps (only called if parent updated)
35795 * - shouldComponentUpdate
35796 * - componentWillUpdate
35797 * - render
35798 * - [children's constructors or receive props phases]
35799 * - componentDidUpdate
35800 *
35801 * - componentWillUnmount
35802 * - [children's componentWillUnmount]
35803 * - [children destroyed]
35804 * - (destroyed): The instance is now blank, released by React and ready for GC.
35805 *
35806 * -----------------------------------------------------------------------------
35807 */
35808
35809/**
35810 * An incrementing ID assigned to each component when it is mounted. This is
35811 * used to enforce the order in which `ReactUpdates` updates dirty components.
35812 *
35813 * @private
35814 */
35815var nextMountID = 1;
35816
35817/**
35818 * @lends {ReactCompositeComponent.prototype}
35819 */
35820var ReactCompositeComponent = {
35821 /**
35822 * Base constructor for all composite component.
35823 *
35824 * @param {ReactElement} element
35825 * @final
35826 * @internal
35827 */
35828 construct: function (element) {
35829 this._currentElement = element;
35830 this._rootNodeID = 0;
35831 this._compositeType = null;
35832 this._instance = null;
35833 this._hostParent = null;
35834 this._hostContainerInfo = null;
35835
35836 // See ReactUpdateQueue
35837 this._updateBatchNumber = null;
35838 this._pendingElement = null;
35839 this._pendingStateQueue = null;
35840 this._pendingReplaceState = false;
35841 this._pendingForceUpdate = false;
35842
35843 this._renderedNodeType = null;
35844 this._renderedComponent = null;
35845 this._context = null;
35846 this._mountOrder = 0;
35847 this._topLevelWrapper = null;
35848
35849 // See ReactUpdates and ReactUpdateQueue.
35850 this._pendingCallbacks = null;
35851
35852 // ComponentWillUnmount shall only be called once
35853 this._calledComponentWillUnmount = false;
35854
35855 if (process.env.NODE_ENV !== 'production') {
35856 this._warnedAboutRefsInRender = false;
35857 }
35858 },
35859
35860 /**
35861 * Initializes the component, renders markup, and registers event listeners.
35862 *
35863 * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
35864 * @param {?object} hostParent
35865 * @param {?object} hostContainerInfo
35866 * @param {?object} context
35867 * @return {?string} Rendered markup to be inserted into the DOM.
35868 * @final
35869 * @internal
35870 */
35871 mountComponent: function (transaction, hostParent, hostContainerInfo, context) {
35872 var _this = this;
35873
35874 this._context = context;
35875 this._mountOrder = nextMountID++;
35876 this._hostParent = hostParent;
35877 this._hostContainerInfo = hostContainerInfo;
35878
35879 var publicProps = this._currentElement.props;
35880 var publicContext = this._processContext(context);
35881
35882 var Component = this._currentElement.type;
35883
35884 var updateQueue = transaction.getUpdateQueue();
35885
35886 // Initialize the public class
35887 var doConstruct = shouldConstruct(Component);
35888 var inst = this._constructComponent(doConstruct, publicProps, publicContext, updateQueue);
35889 var renderedElement;
35890
35891 // Support functional components
35892 if (!doConstruct && (inst == null || inst.render == null)) {
35893 renderedElement = inst;
35894 warnIfInvalidElement(Component, renderedElement);
35895 !(inst === null || inst === false || React.isValidElement(inst)) ? process.env.NODE_ENV !== 'production' ? invariant(false, '%s(...): A valid React element (or null) must be returned. You may have returned undefined, an array or some other invalid object.', Component.displayName || Component.name || 'Component') : _prodInvariant('105', Component.displayName || Component.name || 'Component') : void 0;
35896 inst = new StatelessComponent(Component);
35897 this._compositeType = CompositeTypes.StatelessFunctional;
35898 } else {
35899 if (isPureComponent(Component)) {
35900 this._compositeType = CompositeTypes.PureClass;
35901 } else {
35902 this._compositeType = CompositeTypes.ImpureClass;
35903 }
35904 }
35905
35906 if (process.env.NODE_ENV !== 'production') {
35907 // This will throw later in _renderValidatedComponent, but add an early
35908 // warning now to help debugging
35909 if (inst.render == null) {
35910 process.env.NODE_ENV !== 'production' ? warning(false, '%s(...): No `render` method found on the returned component ' + 'instance: you may have forgotten to define `render`.', Component.displayName || Component.name || 'Component') : void 0;
35911 }
35912
35913 var propsMutated = inst.props !== publicProps;
35914 var componentName = Component.displayName || Component.name || 'Component';
35915
35916 process.env.NODE_ENV !== 'production' ? warning(inst.props === undefined || !propsMutated, '%s(...): When calling super() in `%s`, make sure to pass ' + "up the same props that your component's constructor was passed.", componentName, componentName) : void 0;
35917 }
35918
35919 // These should be set up in the constructor, but as a convenience for
35920 // simpler class abstractions, we set them up after the fact.
35921 inst.props = publicProps;
35922 inst.context = publicContext;
35923 inst.refs = emptyObject;
35924 inst.updater = updateQueue;
35925
35926 this._instance = inst;
35927
35928 // Store a reference from the instance back to the internal representation
35929 ReactInstanceMap.set(inst, this);
35930
35931 if (process.env.NODE_ENV !== 'production') {
35932 // Since plain JS classes are defined without any special initialization
35933 // logic, we can not catch common errors early. Therefore, we have to
35934 // catch them here, at initialization time, instead.
35935 process.env.NODE_ENV !== 'production' ? warning(!inst.getInitialState || inst.getInitialState.isReactClassApproved || inst.state, 'getInitialState was defined on %s, a plain JavaScript class. ' + 'This is only supported for classes created using React.createClass. ' + 'Did you mean to define a state property instead?', this.getName() || 'a component') : void 0;
35936 process.env.NODE_ENV !== 'production' ? warning(!inst.getDefaultProps || inst.getDefaultProps.isReactClassApproved, 'getDefaultProps was defined on %s, a plain JavaScript class. ' + 'This is only supported for classes created using React.createClass. ' + 'Use a static property to define defaultProps instead.', this.getName() || 'a component') : void 0;
35937 process.env.NODE_ENV !== 'production' ? warning(!inst.propTypes, 'propTypes was defined as an instance property on %s. Use a static ' + 'property to define propTypes instead.', this.getName() || 'a component') : void 0;
35938 process.env.NODE_ENV !== 'production' ? warning(!inst.contextTypes, 'contextTypes was defined as an instance property on %s. Use a ' + 'static property to define contextTypes instead.', this.getName() || 'a component') : void 0;
35939 process.env.NODE_ENV !== 'production' ? warning(typeof inst.componentShouldUpdate !== 'function', '%s has a method called ' + 'componentShouldUpdate(). Did you mean shouldComponentUpdate()? ' + 'The name is phrased as a question because the function is ' + 'expected to return a value.', this.getName() || 'A component') : void 0;
35940 process.env.NODE_ENV !== 'production' ? warning(typeof inst.componentDidUnmount !== 'function', '%s has a method called ' + 'componentDidUnmount(). But there is no such lifecycle method. ' + 'Did you mean componentWillUnmount()?', this.getName() || 'A component') : void 0;
35941 process.env.NODE_ENV !== 'production' ? warning(typeof inst.componentWillRecieveProps !== 'function', '%s has a method called ' + 'componentWillRecieveProps(). Did you mean componentWillReceiveProps()?', this.getName() || 'A component') : void 0;
35942 }
35943
35944 var initialState = inst.state;
35945 if (initialState === undefined) {
35946 inst.state = initialState = null;
35947 }
35948 !(typeof initialState === 'object' && !Array.isArray(initialState)) ? process.env.NODE_ENV !== 'production' ? invariant(false, '%s.state: must be set to an object or null', this.getName() || 'ReactCompositeComponent') : _prodInvariant('106', this.getName() || 'ReactCompositeComponent') : void 0;
35949
35950 this._pendingStateQueue = null;
35951 this._pendingReplaceState = false;
35952 this._pendingForceUpdate = false;
35953
35954 var markup;
35955 if (inst.unstable_handleError) {
35956 markup = this.performInitialMountWithErrorHandling(renderedElement, hostParent, hostContainerInfo, transaction, context);
35957 } else {
35958 markup = this.performInitialMount(renderedElement, hostParent, hostContainerInfo, transaction, context);
35959 }
35960
35961 if (inst.componentDidMount) {
35962 if (process.env.NODE_ENV !== 'production') {
35963 transaction.getReactMountReady().enqueue(function () {
35964 measureLifeCyclePerf(function () {
35965 return inst.componentDidMount();
35966 }, _this._debugID, 'componentDidMount');
35967 });
35968 } else {
35969 transaction.getReactMountReady().enqueue(inst.componentDidMount, inst);
35970 }
35971 }
35972
35973 return markup;
35974 },
35975
35976 _constructComponent: function (doConstruct, publicProps, publicContext, updateQueue) {
35977 if (process.env.NODE_ENV !== 'production') {
35978 ReactCurrentOwner.current = this;
35979 try {
35980 return this._constructComponentWithoutOwner(doConstruct, publicProps, publicContext, updateQueue);
35981 } finally {
35982 ReactCurrentOwner.current = null;
35983 }
35984 } else {
35985 return this._constructComponentWithoutOwner(doConstruct, publicProps, publicContext, updateQueue);
35986 }
35987 },
35988
35989 _constructComponentWithoutOwner: function (doConstruct, publicProps, publicContext, updateQueue) {
35990 var Component = this._currentElement.type;
35991
35992 if (doConstruct) {
35993 if (process.env.NODE_ENV !== 'production') {
35994 return measureLifeCyclePerf(function () {
35995 return new Component(publicProps, publicContext, updateQueue);
35996 }, this._debugID, 'ctor');
35997 } else {
35998 return new Component(publicProps, publicContext, updateQueue);
35999 }
36000 }
36001
36002 // This can still be an instance in case of factory components
36003 // but we'll count this as time spent rendering as the more common case.
36004 if (process.env.NODE_ENV !== 'production') {
36005 return measureLifeCyclePerf(function () {
36006 return Component(publicProps, publicContext, updateQueue);
36007 }, this._debugID, 'render');
36008 } else {
36009 return Component(publicProps, publicContext, updateQueue);
36010 }
36011 },
36012
36013 performInitialMountWithErrorHandling: function (renderedElement, hostParent, hostContainerInfo, transaction, context) {
36014 var markup;
36015 var checkpoint = transaction.checkpoint();
36016 try {
36017 markup = this.performInitialMount(renderedElement, hostParent, hostContainerInfo, transaction, context);
36018 } catch (e) {
36019 // Roll back to checkpoint, handle error (which may add items to the transaction), and take a new checkpoint
36020 transaction.rollback(checkpoint);
36021 this._instance.unstable_handleError(e);
36022 if (this._pendingStateQueue) {
36023 this._instance.state = this._processPendingState(this._instance.props, this._instance.context);
36024 }
36025 checkpoint = transaction.checkpoint();
36026
36027 this._renderedComponent.unmountComponent(true);
36028 transaction.rollback(checkpoint);
36029
36030 // Try again - we've informed the component about the error, so they can render an error message this time.
36031 // If this throws again, the error will bubble up (and can be caught by a higher error boundary).
36032 markup = this.performInitialMount(renderedElement, hostParent, hostContainerInfo, transaction, context);
36033 }
36034 return markup;
36035 },
36036
36037 performInitialMount: function (renderedElement, hostParent, hostContainerInfo, transaction, context) {
36038 var inst = this._instance;
36039
36040 var debugID = 0;
36041 if (process.env.NODE_ENV !== 'production') {
36042 debugID = this._debugID;
36043 }
36044
36045 if (inst.componentWillMount) {
36046 if (process.env.NODE_ENV !== 'production') {
36047 measureLifeCyclePerf(function () {
36048 return inst.componentWillMount();
36049 }, debugID, 'componentWillMount');
36050 } else {
36051 inst.componentWillMount();
36052 }
36053 // When mounting, calls to `setState` by `componentWillMount` will set
36054 // `this._pendingStateQueue` without triggering a re-render.
36055 if (this._pendingStateQueue) {
36056 inst.state = this._processPendingState(inst.props, inst.context);
36057 }
36058 }
36059
36060 // If not a stateless component, we now render
36061 if (renderedElement === undefined) {
36062 renderedElement = this._renderValidatedComponent();
36063 }
36064
36065 var nodeType = ReactNodeTypes.getType(renderedElement);
36066 this._renderedNodeType = nodeType;
36067 var child = this._instantiateReactComponent(renderedElement, nodeType !== ReactNodeTypes.EMPTY /* shouldHaveDebugID */
36068 );
36069 this._renderedComponent = child;
36070
36071 var markup = ReactReconciler.mountComponent(child, transaction, hostParent, hostContainerInfo, this._processChildContext(context), debugID);
36072
36073 if (process.env.NODE_ENV !== 'production') {
36074 if (debugID !== 0) {
36075 var childDebugIDs = child._debugID !== 0 ? [child._debugID] : [];
36076 ReactInstrumentation.debugTool.onSetChildren(debugID, childDebugIDs);
36077 }
36078 }
36079
36080 return markup;
36081 },
36082
36083 getHostNode: function () {
36084 return ReactReconciler.getHostNode(this._renderedComponent);
36085 },
36086
36087 /**
36088 * Releases any resources allocated by `mountComponent`.
36089 *
36090 * @final
36091 * @internal
36092 */
36093 unmountComponent: function (safely) {
36094 if (!this._renderedComponent) {
36095 return;
36096 }
36097
36098 var inst = this._instance;
36099
36100 if (inst.componentWillUnmount && !inst._calledComponentWillUnmount) {
36101 inst._calledComponentWillUnmount = true;
36102
36103 if (safely) {
36104 var name = this.getName() + '.componentWillUnmount()';
36105 ReactErrorUtils.invokeGuardedCallback(name, inst.componentWillUnmount.bind(inst));
36106 } else {
36107 if (process.env.NODE_ENV !== 'production') {
36108 measureLifeCyclePerf(function () {
36109 return inst.componentWillUnmount();
36110 }, this._debugID, 'componentWillUnmount');
36111 } else {
36112 inst.componentWillUnmount();
36113 }
36114 }
36115 }
36116
36117 if (this._renderedComponent) {
36118 ReactReconciler.unmountComponent(this._renderedComponent, safely);
36119 this._renderedNodeType = null;
36120 this._renderedComponent = null;
36121 this._instance = null;
36122 }
36123
36124 // Reset pending fields
36125 // Even if this component is scheduled for another update in ReactUpdates,
36126 // it would still be ignored because these fields are reset.
36127 this._pendingStateQueue = null;
36128 this._pendingReplaceState = false;
36129 this._pendingForceUpdate = false;
36130 this._pendingCallbacks = null;
36131 this._pendingElement = null;
36132
36133 // These fields do not really need to be reset since this object is no
36134 // longer accessible.
36135 this._context = null;
36136 this._rootNodeID = 0;
36137 this._topLevelWrapper = null;
36138
36139 // Delete the reference from the instance to this internal representation
36140 // which allow the internals to be properly cleaned up even if the user
36141 // leaks a reference to the public instance.
36142 ReactInstanceMap.remove(inst);
36143
36144 // Some existing components rely on inst.props even after they've been
36145 // destroyed (in event handlers).
36146 // TODO: inst.props = null;
36147 // TODO: inst.state = null;
36148 // TODO: inst.context = null;
36149 },
36150
36151 /**
36152 * Filters the context object to only contain keys specified in
36153 * `contextTypes`
36154 *
36155 * @param {object} context
36156 * @return {?object}
36157 * @private
36158 */
36159 _maskContext: function (context) {
36160 var Component = this._currentElement.type;
36161 var contextTypes = Component.contextTypes;
36162 if (!contextTypes) {
36163 return emptyObject;
36164 }
36165 var maskedContext = {};
36166 for (var contextName in contextTypes) {
36167 maskedContext[contextName] = context[contextName];
36168 }
36169 return maskedContext;
36170 },
36171
36172 /**
36173 * Filters the context object to only contain keys specified in
36174 * `contextTypes`, and asserts that they are valid.
36175 *
36176 * @param {object} context
36177 * @return {?object}
36178 * @private
36179 */
36180 _processContext: function (context) {
36181 var maskedContext = this._maskContext(context);
36182 if (process.env.NODE_ENV !== 'production') {
36183 var Component = this._currentElement.type;
36184 if (Component.contextTypes) {
36185 this._checkContextTypes(Component.contextTypes, maskedContext, 'context');
36186 }
36187 }
36188 return maskedContext;
36189 },
36190
36191 /**
36192 * @param {object} currentContext
36193 * @return {object}
36194 * @private
36195 */
36196 _processChildContext: function (currentContext) {
36197 var Component = this._currentElement.type;
36198 var inst = this._instance;
36199 var childContext;
36200
36201 if (inst.getChildContext) {
36202 if (process.env.NODE_ENV !== 'production') {
36203 ReactInstrumentation.debugTool.onBeginProcessingChildContext();
36204 try {
36205 childContext = inst.getChildContext();
36206 } finally {
36207 ReactInstrumentation.debugTool.onEndProcessingChildContext();
36208 }
36209 } else {
36210 childContext = inst.getChildContext();
36211 }
36212 }
36213
36214 if (childContext) {
36215 !(typeof Component.childContextTypes === 'object') ? process.env.NODE_ENV !== 'production' ? invariant(false, '%s.getChildContext(): childContextTypes must be defined in order to use getChildContext().', this.getName() || 'ReactCompositeComponent') : _prodInvariant('107', this.getName() || 'ReactCompositeComponent') : void 0;
36216 if (process.env.NODE_ENV !== 'production') {
36217 this._checkContextTypes(Component.childContextTypes, childContext, 'child context');
36218 }
36219 for (var name in childContext) {
36220 !(name in Component.childContextTypes) ? process.env.NODE_ENV !== 'production' ? invariant(false, '%s.getChildContext(): key "%s" is not defined in childContextTypes.', this.getName() || 'ReactCompositeComponent', name) : _prodInvariant('108', this.getName() || 'ReactCompositeComponent', name) : void 0;
36221 }
36222 return _assign({}, currentContext, childContext);
36223 }
36224 return currentContext;
36225 },
36226
36227 /**
36228 * Assert that the context types are valid
36229 *
36230 * @param {object} typeSpecs Map of context field to a ReactPropType
36231 * @param {object} values Runtime values that need to be type-checked
36232 * @param {string} location e.g. "prop", "context", "child context"
36233 * @private
36234 */
36235 _checkContextTypes: function (typeSpecs, values, location) {
36236 if (process.env.NODE_ENV !== 'production') {
36237 checkReactTypeSpec(typeSpecs, values, location, this.getName(), null, this._debugID);
36238 }
36239 },
36240
36241 receiveComponent: function (nextElement, transaction, nextContext) {
36242 var prevElement = this._currentElement;
36243 var prevContext = this._context;
36244
36245 this._pendingElement = null;
36246
36247 this.updateComponent(transaction, prevElement, nextElement, prevContext, nextContext);
36248 },
36249
36250 /**
36251 * If any of `_pendingElement`, `_pendingStateQueue`, or `_pendingForceUpdate`
36252 * is set, update the component.
36253 *
36254 * @param {ReactReconcileTransaction} transaction
36255 * @internal
36256 */
36257 performUpdateIfNecessary: function (transaction) {
36258 if (this._pendingElement != null) {
36259 ReactReconciler.receiveComponent(this, this._pendingElement, transaction, this._context);
36260 } else if (this._pendingStateQueue !== null || this._pendingForceUpdate) {
36261 this.updateComponent(transaction, this._currentElement, this._currentElement, this._context, this._context);
36262 } else {
36263 this._updateBatchNumber = null;
36264 }
36265 },
36266
36267 /**
36268 * Perform an update to a mounted component. The componentWillReceiveProps and
36269 * shouldComponentUpdate methods are called, then (assuming the update isn't
36270 * skipped) the remaining update lifecycle methods are called and the DOM
36271 * representation is updated.
36272 *
36273 * By default, this implements React's rendering and reconciliation algorithm.
36274 * Sophisticated clients may wish to override this.
36275 *
36276 * @param {ReactReconcileTransaction} transaction
36277 * @param {ReactElement} prevParentElement
36278 * @param {ReactElement} nextParentElement
36279 * @internal
36280 * @overridable
36281 */
36282 updateComponent: function (transaction, prevParentElement, nextParentElement, prevUnmaskedContext, nextUnmaskedContext) {
36283 var inst = this._instance;
36284 !(inst != null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Attempted to update component `%s` that has already been unmounted (or failed to mount).', this.getName() || 'ReactCompositeComponent') : _prodInvariant('136', this.getName() || 'ReactCompositeComponent') : void 0;
36285
36286 var willReceive = false;
36287 var nextContext;
36288
36289 // Determine if the context has changed or not
36290 if (this._context === nextUnmaskedContext) {
36291 nextContext = inst.context;
36292 } else {
36293 nextContext = this._processContext(nextUnmaskedContext);
36294 willReceive = true;
36295 }
36296
36297 var prevProps = prevParentElement.props;
36298 var nextProps = nextParentElement.props;
36299
36300 // Not a simple state update but a props update
36301 if (prevParentElement !== nextParentElement) {
36302 willReceive = true;
36303 }
36304
36305 // An update here will schedule an update but immediately set
36306 // _pendingStateQueue which will ensure that any state updates gets
36307 // immediately reconciled instead of waiting for the next batch.
36308 if (willReceive && inst.componentWillReceiveProps) {
36309 if (process.env.NODE_ENV !== 'production') {
36310 measureLifeCyclePerf(function () {
36311 return inst.componentWillReceiveProps(nextProps, nextContext);
36312 }, this._debugID, 'componentWillReceiveProps');
36313 } else {
36314 inst.componentWillReceiveProps(nextProps, nextContext);
36315 }
36316 }
36317
36318 var nextState = this._processPendingState(nextProps, nextContext);
36319 var shouldUpdate = true;
36320
36321 if (!this._pendingForceUpdate) {
36322 if (inst.shouldComponentUpdate) {
36323 if (process.env.NODE_ENV !== 'production') {
36324 shouldUpdate = measureLifeCyclePerf(function () {
36325 return inst.shouldComponentUpdate(nextProps, nextState, nextContext);
36326 }, this._debugID, 'shouldComponentUpdate');
36327 } else {
36328 shouldUpdate = inst.shouldComponentUpdate(nextProps, nextState, nextContext);
36329 }
36330 } else {
36331 if (this._compositeType === CompositeTypes.PureClass) {
36332 shouldUpdate = !shallowEqual(prevProps, nextProps) || !shallowEqual(inst.state, nextState);
36333 }
36334 }
36335 }
36336
36337 if (process.env.NODE_ENV !== 'production') {
36338 process.env.NODE_ENV !== 'production' ? warning(shouldUpdate !== undefined, '%s.shouldComponentUpdate(): Returned undefined instead of a ' + 'boolean value. Make sure to return true or false.', this.getName() || 'ReactCompositeComponent') : void 0;
36339 }
36340
36341 this._updateBatchNumber = null;
36342 if (shouldUpdate) {
36343 this._pendingForceUpdate = false;
36344 // Will set `this.props`, `this.state` and `this.context`.
36345 this._performComponentUpdate(nextParentElement, nextProps, nextState, nextContext, transaction, nextUnmaskedContext);
36346 } else {
36347 // If it's determined that a component should not update, we still want
36348 // to set props and state but we shortcut the rest of the update.
36349 this._currentElement = nextParentElement;
36350 this._context = nextUnmaskedContext;
36351 inst.props = nextProps;
36352 inst.state = nextState;
36353 inst.context = nextContext;
36354 }
36355 },
36356
36357 _processPendingState: function (props, context) {
36358 var inst = this._instance;
36359 var queue = this._pendingStateQueue;
36360 var replace = this._pendingReplaceState;
36361 this._pendingReplaceState = false;
36362 this._pendingStateQueue = null;
36363
36364 if (!queue) {
36365 return inst.state;
36366 }
36367
36368 if (replace && queue.length === 1) {
36369 return queue[0];
36370 }
36371
36372 var nextState = _assign({}, replace ? queue[0] : inst.state);
36373 for (var i = replace ? 1 : 0; i < queue.length; i++) {
36374 var partial = queue[i];
36375 _assign(nextState, typeof partial === 'function' ? partial.call(inst, nextState, props, context) : partial);
36376 }
36377
36378 return nextState;
36379 },
36380
36381 /**
36382 * Merges new props and state, notifies delegate methods of update and
36383 * performs update.
36384 *
36385 * @param {ReactElement} nextElement Next element
36386 * @param {object} nextProps Next public object to set as properties.
36387 * @param {?object} nextState Next object to set as state.
36388 * @param {?object} nextContext Next public object to set as context.
36389 * @param {ReactReconcileTransaction} transaction
36390 * @param {?object} unmaskedContext
36391 * @private
36392 */
36393 _performComponentUpdate: function (nextElement, nextProps, nextState, nextContext, transaction, unmaskedContext) {
36394 var _this2 = this;
36395
36396 var inst = this._instance;
36397
36398 var hasComponentDidUpdate = Boolean(inst.componentDidUpdate);
36399 var prevProps;
36400 var prevState;
36401 var prevContext;
36402 if (hasComponentDidUpdate) {
36403 prevProps = inst.props;
36404 prevState = inst.state;
36405 prevContext = inst.context;
36406 }
36407
36408 if (inst.componentWillUpdate) {
36409 if (process.env.NODE_ENV !== 'production') {
36410 measureLifeCyclePerf(function () {
36411 return inst.componentWillUpdate(nextProps, nextState, nextContext);
36412 }, this._debugID, 'componentWillUpdate');
36413 } else {
36414 inst.componentWillUpdate(nextProps, nextState, nextContext);
36415 }
36416 }
36417
36418 this._currentElement = nextElement;
36419 this._context = unmaskedContext;
36420 inst.props = nextProps;
36421 inst.state = nextState;
36422 inst.context = nextContext;
36423
36424 this._updateRenderedComponent(transaction, unmaskedContext);
36425
36426 if (hasComponentDidUpdate) {
36427 if (process.env.NODE_ENV !== 'production') {
36428 transaction.getReactMountReady().enqueue(function () {
36429 measureLifeCyclePerf(inst.componentDidUpdate.bind(inst, prevProps, prevState, prevContext), _this2._debugID, 'componentDidUpdate');
36430 });
36431 } else {
36432 transaction.getReactMountReady().enqueue(inst.componentDidUpdate.bind(inst, prevProps, prevState, prevContext), inst);
36433 }
36434 }
36435 },
36436
36437 /**
36438 * Call the component's `render` method and update the DOM accordingly.
36439 *
36440 * @param {ReactReconcileTransaction} transaction
36441 * @internal
36442 */
36443 _updateRenderedComponent: function (transaction, context) {
36444 var prevComponentInstance = this._renderedComponent;
36445 var prevRenderedElement = prevComponentInstance._currentElement;
36446 var nextRenderedElement = this._renderValidatedComponent();
36447
36448 var debugID = 0;
36449 if (process.env.NODE_ENV !== 'production') {
36450 debugID = this._debugID;
36451 }
36452
36453 if (shouldUpdateReactComponent(prevRenderedElement, nextRenderedElement)) {
36454 ReactReconciler.receiveComponent(prevComponentInstance, nextRenderedElement, transaction, this._processChildContext(context));
36455 } else {
36456 var oldHostNode = ReactReconciler.getHostNode(prevComponentInstance);
36457 ReactReconciler.unmountComponent(prevComponentInstance, false);
36458
36459 var nodeType = ReactNodeTypes.getType(nextRenderedElement);
36460 this._renderedNodeType = nodeType;
36461 var child = this._instantiateReactComponent(nextRenderedElement, nodeType !== ReactNodeTypes.EMPTY /* shouldHaveDebugID */
36462 );
36463 this._renderedComponent = child;
36464
36465 var nextMarkup = ReactReconciler.mountComponent(child, transaction, this._hostParent, this._hostContainerInfo, this._processChildContext(context), debugID);
36466
36467 if (process.env.NODE_ENV !== 'production') {
36468 if (debugID !== 0) {
36469 var childDebugIDs = child._debugID !== 0 ? [child._debugID] : [];
36470 ReactInstrumentation.debugTool.onSetChildren(debugID, childDebugIDs);
36471 }
36472 }
36473
36474 this._replaceNodeWithMarkup(oldHostNode, nextMarkup, prevComponentInstance);
36475 }
36476 },
36477
36478 /**
36479 * Overridden in shallow rendering.
36480 *
36481 * @protected
36482 */
36483 _replaceNodeWithMarkup: function (oldHostNode, nextMarkup, prevInstance) {
36484 ReactComponentEnvironment.replaceNodeWithMarkup(oldHostNode, nextMarkup, prevInstance);
36485 },
36486
36487 /**
36488 * @protected
36489 */
36490 _renderValidatedComponentWithoutOwnerOrContext: function () {
36491 var inst = this._instance;
36492 var renderedElement;
36493
36494 if (process.env.NODE_ENV !== 'production') {
36495 renderedElement = measureLifeCyclePerf(function () {
36496 return inst.render();
36497 }, this._debugID, 'render');
36498 } else {
36499 renderedElement = inst.render();
36500 }
36501
36502 if (process.env.NODE_ENV !== 'production') {
36503 // We allow auto-mocks to proceed as if they're returning null.
36504 if (renderedElement === undefined && inst.render._isMockFunction) {
36505 // This is probably bad practice. Consider warning here and
36506 // deprecating this convenience.
36507 renderedElement = null;
36508 }
36509 }
36510
36511 return renderedElement;
36512 },
36513
36514 /**
36515 * @private
36516 */
36517 _renderValidatedComponent: function () {
36518 var renderedElement;
36519 if (process.env.NODE_ENV !== 'production' || this._compositeType !== CompositeTypes.StatelessFunctional) {
36520 ReactCurrentOwner.current = this;
36521 try {
36522 renderedElement = this._renderValidatedComponentWithoutOwnerOrContext();
36523 } finally {
36524 ReactCurrentOwner.current = null;
36525 }
36526 } else {
36527 renderedElement = this._renderValidatedComponentWithoutOwnerOrContext();
36528 }
36529 !(
36530 // TODO: An `isValidNode` function would probably be more appropriate
36531 renderedElement === null || renderedElement === false || React.isValidElement(renderedElement)) ? process.env.NODE_ENV !== 'production' ? invariant(false, '%s.render(): A valid React element (or null) must be returned. You may have returned undefined, an array or some other invalid object.', this.getName() || 'ReactCompositeComponent') : _prodInvariant('109', this.getName() || 'ReactCompositeComponent') : void 0;
36532
36533 return renderedElement;
36534 },
36535
36536 /**
36537 * Lazily allocates the refs object and stores `component` as `ref`.
36538 *
36539 * @param {string} ref Reference name.
36540 * @param {component} component Component to store as `ref`.
36541 * @final
36542 * @private
36543 */
36544 attachRef: function (ref, component) {
36545 var inst = this.getPublicInstance();
36546 !(inst != null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Stateless function components cannot have refs.') : _prodInvariant('110') : void 0;
36547 var publicComponentInstance = component.getPublicInstance();
36548 if (process.env.NODE_ENV !== 'production') {
36549 var componentName = component && component.getName ? component.getName() : 'a component';
36550 process.env.NODE_ENV !== 'production' ? warning(publicComponentInstance != null || component._compositeType !== CompositeTypes.StatelessFunctional, 'Stateless function components cannot be given refs ' + '(See ref "%s" in %s created by %s). ' + 'Attempts to access this ref will fail.', ref, componentName, this.getName()) : void 0;
36551 }
36552 var refs = inst.refs === emptyObject ? inst.refs = {} : inst.refs;
36553 refs[ref] = publicComponentInstance;
36554 },
36555
36556 /**
36557 * Detaches a reference name.
36558 *
36559 * @param {string} ref Name to dereference.
36560 * @final
36561 * @private
36562 */
36563 detachRef: function (ref) {
36564 var refs = this.getPublicInstance().refs;
36565 delete refs[ref];
36566 },
36567
36568 /**
36569 * Get a text description of the component that can be used to identify it
36570 * in error messages.
36571 * @return {string} The name or null.
36572 * @internal
36573 */
36574 getName: function () {
36575 var type = this._currentElement.type;
36576 var constructor = this._instance && this._instance.constructor;
36577 return type.displayName || constructor && constructor.displayName || type.name || constructor && constructor.name || null;
36578 },
36579
36580 /**
36581 * Get the publicly accessible representation of this component - i.e. what
36582 * is exposed by refs and returned by render. Can be null for stateless
36583 * components.
36584 *
36585 * @return {ReactComponent} the public component instance.
36586 * @internal
36587 */
36588 getPublicInstance: function () {
36589 var inst = this._instance;
36590 if (this._compositeType === CompositeTypes.StatelessFunctional) {
36591 return null;
36592 }
36593 return inst;
36594 },
36595
36596 // Stub
36597 _instantiateReactComponent: null
36598};
36599
36600module.exports = ReactCompositeComponent;
36601/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
36602
36603/***/ }),
36604/* 148 */
36605/***/ (function(module, exports, __webpack_require__) {
36606
36607"use strict";
36608/* WEBPACK VAR INJECTION */(function(process) {/**
36609 * Copyright 2013-present, Facebook, Inc.
36610 * All rights reserved.
36611 *
36612 * This source code is licensed under the BSD-style license found in the
36613 * LICENSE file in the root directory of this source tree. An additional grant
36614 * of patent rights can be found in the PATENTS file in the same directory.
36615 *
36616 */
36617
36618
36619
36620var _prodInvariant = __webpack_require__(3);
36621
36622var ReactPropTypeLocationNames = __webpack_require__(149);
36623var ReactPropTypesSecret = __webpack_require__(77);
36624
36625var invariant = __webpack_require__(1);
36626var warning = __webpack_require__(2);
36627
36628var ReactComponentTreeHook;
36629
36630if (typeof process !== 'undefined' && process.env && process.env.NODE_ENV === 'test') {
36631 // Temporary hack.
36632 // Inline requires don't work well with Jest:
36633 // https://github.com/facebook/react/issues/7240
36634 // Remove the inline requires when we don't need them anymore:
36635 // https://github.com/facebook/react/pull/7178
36636 ReactComponentTreeHook = __webpack_require__(7);
36637}
36638
36639var loggedTypeFailures = {};
36640
36641/**
36642 * Assert that the values match with the type specs.
36643 * Error messages are memorized and will only be shown once.
36644 *
36645 * @param {object} typeSpecs Map of name to a ReactPropType
36646 * @param {object} values Runtime values that need to be type-checked
36647 * @param {string} location e.g. "prop", "context", "child context"
36648 * @param {string} componentName Name of the component for error messages.
36649 * @param {?object} element The React element that is being type-checked
36650 * @param {?number} debugID The React component instance that is being type-checked
36651 * @private
36652 */
36653function checkReactTypeSpec(typeSpecs, values, location, componentName, element, debugID) {
36654 for (var typeSpecName in typeSpecs) {
36655 if (typeSpecs.hasOwnProperty(typeSpecName)) {
36656 var error;
36657 // Prop type validation may throw. In case they do, we don't want to
36658 // fail the render phase where it didn't fail before. So we log it.
36659 // After these have been cleaned up, we'll let them throw.
36660 try {
36661 // This is intentionally an invariant that gets caught. It's the same
36662 // behavior as without this statement except with a better message.
36663 !(typeof typeSpecs[typeSpecName] === 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, '%s: %s type `%s` is invalid; it must be a function, usually from React.PropTypes.', componentName || 'React class', ReactPropTypeLocationNames[location], typeSpecName) : _prodInvariant('84', componentName || 'React class', ReactPropTypeLocationNames[location], typeSpecName) : void 0;
36664 error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
36665 } catch (ex) {
36666 error = ex;
36667 }
36668 process.env.NODE_ENV !== 'production' ? warning(!error || error instanceof Error, '%s: type specification of %s `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', ReactPropTypeLocationNames[location], typeSpecName, typeof error) : void 0;
36669 if (error instanceof Error && !(error.message in loggedTypeFailures)) {
36670 // Only monitor this failure once because there tends to be a lot of the
36671 // same error.
36672 loggedTypeFailures[error.message] = true;
36673
36674 var componentStackInfo = '';
36675
36676 if (process.env.NODE_ENV !== 'production') {
36677 if (!ReactComponentTreeHook) {
36678 ReactComponentTreeHook = __webpack_require__(7);
36679 }
36680 if (debugID !== null) {
36681 componentStackInfo = ReactComponentTreeHook.getStackAddendumByID(debugID);
36682 } else if (element !== null) {
36683 componentStackInfo = ReactComponentTreeHook.getCurrentStackAddendum(element);
36684 }
36685 }
36686
36687 process.env.NODE_ENV !== 'production' ? warning(false, 'Failed %s type: %s%s', location, error.message, componentStackInfo) : void 0;
36688 }
36689 }
36690 }
36691}
36692
36693module.exports = checkReactTypeSpec;
36694/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
36695
36696/***/ }),
36697/* 149 */
36698/***/ (function(module, exports, __webpack_require__) {
36699
36700"use strict";
36701/* WEBPACK VAR INJECTION */(function(process) {/**
36702 * Copyright 2013-present, Facebook, Inc.
36703 * All rights reserved.
36704 *
36705 * This source code is licensed under the BSD-style license found in the
36706 * LICENSE file in the root directory of this source tree. An additional grant
36707 * of patent rights can be found in the PATENTS file in the same directory.
36708 *
36709 *
36710 */
36711
36712
36713
36714var ReactPropTypeLocationNames = {};
36715
36716if (process.env.NODE_ENV !== 'production') {
36717 ReactPropTypeLocationNames = {
36718 prop: 'prop',
36719 context: 'context',
36720 childContext: 'child context'
36721 };
36722}
36723
36724module.exports = ReactPropTypeLocationNames;
36725/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
36726
36727/***/ }),
36728/* 150 */
36729/***/ (function(module, exports, __webpack_require__) {
36730
36731"use strict";
36732/**
36733 * Copyright 2013-present, Facebook, Inc.
36734 * All rights reserved.
36735 *
36736 * This source code is licensed under the BSD-style license found in the
36737 * LICENSE file in the root directory of this source tree. An additional grant
36738 * of patent rights can be found in the PATENTS file in the same directory.
36739 *
36740 *
36741 */
36742
36743
36744
36745var nextDebugID = 1;
36746
36747function getNextDebugID() {
36748 return nextDebugID++;
36749}
36750
36751module.exports = getNextDebugID;
36752
36753/***/ }),
36754/* 151 */
36755/***/ (function(module, exports, __webpack_require__) {
36756
36757"use strict";
36758/**
36759 * Copyright 2014-present, Facebook, Inc.
36760 * All rights reserved.
36761 *
36762 * This source code is licensed under the BSD-style license found in the
36763 * LICENSE file in the root directory of this source tree. An additional grant
36764 * of patent rights can be found in the PATENTS file in the same directory.
36765 *
36766 *
36767 */
36768
36769
36770
36771// The Symbol used to tag the ReactElement type. If there is no native Symbol
36772// nor polyfill, then a plain number is used for performance.
36773
36774var REACT_ELEMENT_TYPE = typeof Symbol === 'function' && Symbol['for'] && Symbol['for']('react.element') || 0xeac7;
36775
36776module.exports = REACT_ELEMENT_TYPE;
36777
36778/***/ }),
36779/* 152 */
36780/***/ (function(module, exports, __webpack_require__) {
36781
36782"use strict";
36783/**
36784 * Copyright 2013-present, Facebook, Inc.
36785 * All rights reserved.
36786 *
36787 * This source code is licensed under the BSD-style license found in the
36788 * LICENSE file in the root directory of this source tree. An additional grant
36789 * of patent rights can be found in the PATENTS file in the same directory.
36790 *
36791 *
36792 */
36793
36794
36795
36796/* global Symbol */
36797
36798var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
36799var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
36800
36801/**
36802 * Returns the iterator method function contained on the iterable object.
36803 *
36804 * Be sure to invoke the function with the iterable as context:
36805 *
36806 * var iteratorFn = getIteratorFn(myIterable);
36807 * if (iteratorFn) {
36808 * var iterator = iteratorFn.call(myIterable);
36809 * ...
36810 * }
36811 *
36812 * @param {?object} maybeIterable
36813 * @return {?function}
36814 */
36815function getIteratorFn(maybeIterable) {
36816 var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
36817 if (typeof iteratorFn === 'function') {
36818 return iteratorFn;
36819 }
36820}
36821
36822module.exports = getIteratorFn;
36823
36824/***/ }),
36825/* 153 */
36826/***/ (function(module, exports, __webpack_require__) {
36827
36828"use strict";
36829/* WEBPACK VAR INJECTION */(function(process) {/**
36830 * Copyright 2013-present, Facebook, Inc.
36831 * All rights reserved.
36832 *
36833 * This source code is licensed under the BSD-style license found in the
36834 * LICENSE file in the root directory of this source tree. An additional grant
36835 * of patent rights can be found in the PATENTS file in the same directory.
36836 *
36837 *
36838 */
36839
36840
36841
36842var KeyEscapeUtils = __webpack_require__(50);
36843var traverseAllChildren = __webpack_require__(83);
36844var warning = __webpack_require__(2);
36845
36846var ReactComponentTreeHook;
36847
36848if (typeof process !== 'undefined' && process.env && process.env.NODE_ENV === 'test') {
36849 // Temporary hack.
36850 // Inline requires don't work well with Jest:
36851 // https://github.com/facebook/react/issues/7240
36852 // Remove the inline requires when we don't need them anymore:
36853 // https://github.com/facebook/react/pull/7178
36854 ReactComponentTreeHook = __webpack_require__(7);
36855}
36856
36857/**
36858 * @param {function} traverseContext Context passed through traversal.
36859 * @param {?ReactComponent} child React child component.
36860 * @param {!string} name String name of key path to child.
36861 * @param {number=} selfDebugID Optional debugID of the current internal instance.
36862 */
36863function flattenSingleChildIntoContext(traverseContext, child, name, selfDebugID) {
36864 // We found a component instance.
36865 if (traverseContext && typeof traverseContext === 'object') {
36866 var result = traverseContext;
36867 var keyUnique = result[name] === undefined;
36868 if (process.env.NODE_ENV !== 'production') {
36869 if (!ReactComponentTreeHook) {
36870 ReactComponentTreeHook = __webpack_require__(7);
36871 }
36872 if (!keyUnique) {
36873 process.env.NODE_ENV !== 'production' ? warning(false, 'flattenChildren(...): Encountered two children with the same key, ' + '`%s`. Child keys must be unique; when two children share a key, only ' + 'the first child will be used.%s', KeyEscapeUtils.unescape(name), ReactComponentTreeHook.getStackAddendumByID(selfDebugID)) : void 0;
36874 }
36875 }
36876 if (keyUnique && child != null) {
36877 result[name] = child;
36878 }
36879 }
36880}
36881
36882/**
36883 * Flattens children that are typically specified as `props.children`. Any null
36884 * children will not be included in the resulting object.
36885 * @return {!object} flattened children keyed by name.
36886 */
36887function flattenChildren(children, selfDebugID) {
36888 if (children == null) {
36889 return children;
36890 }
36891 var result = {};
36892
36893 if (process.env.NODE_ENV !== 'production') {
36894 traverseAllChildren(children, function (traverseContext, child, name) {
36895 return flattenSingleChildIntoContext(traverseContext, child, name, selfDebugID);
36896 }, result);
36897 } else {
36898 traverseAllChildren(children, flattenSingleChildIntoContext, result);
36899 }
36900 return result;
36901}
36902
36903module.exports = flattenChildren;
36904/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
36905
36906/***/ }),
36907/* 154 */
36908/***/ (function(module, exports, __webpack_require__) {
36909
36910"use strict";
36911/* WEBPACK VAR INJECTION */(function(process) {/**
36912 * Copyright 2014-present, Facebook, Inc.
36913 * All rights reserved.
36914 *
36915 * This source code is licensed under the BSD-style license found in the
36916 * LICENSE file in the root directory of this source tree. An additional grant
36917 * of patent rights can be found in the PATENTS file in the same directory.
36918 *
36919 */
36920
36921
36922
36923var _assign = __webpack_require__(4);
36924
36925var PooledClass = __webpack_require__(16);
36926var Transaction = __webpack_require__(29);
36927var ReactInstrumentation = __webpack_require__(9);
36928var ReactServerUpdateQueue = __webpack_require__(155);
36929
36930/**
36931 * Executed within the scope of the `Transaction` instance. Consider these as
36932 * being member methods, but with an implied ordering while being isolated from
36933 * each other.
36934 */
36935var TRANSACTION_WRAPPERS = [];
36936
36937if (process.env.NODE_ENV !== 'production') {
36938 TRANSACTION_WRAPPERS.push({
36939 initialize: ReactInstrumentation.debugTool.onBeginFlush,
36940 close: ReactInstrumentation.debugTool.onEndFlush
36941 });
36942}
36943
36944var noopCallbackQueue = {
36945 enqueue: function () {}
36946};
36947
36948/**
36949 * @class ReactServerRenderingTransaction
36950 * @param {boolean} renderToStaticMarkup
36951 */
36952function ReactServerRenderingTransaction(renderToStaticMarkup) {
36953 this.reinitializeTransaction();
36954 this.renderToStaticMarkup = renderToStaticMarkup;
36955 this.useCreateElement = false;
36956 this.updateQueue = new ReactServerUpdateQueue(this);
36957}
36958
36959var Mixin = {
36960 /**
36961 * @see Transaction
36962 * @abstract
36963 * @final
36964 * @return {array} Empty list of operation wrap procedures.
36965 */
36966 getTransactionWrappers: function () {
36967 return TRANSACTION_WRAPPERS;
36968 },
36969
36970 /**
36971 * @return {object} The queue to collect `onDOMReady` callbacks with.
36972 */
36973 getReactMountReady: function () {
36974 return noopCallbackQueue;
36975 },
36976
36977 /**
36978 * @return {object} The queue to collect React async events.
36979 */
36980 getUpdateQueue: function () {
36981 return this.updateQueue;
36982 },
36983
36984 /**
36985 * `PooledClass` looks for this, and will invoke this before allowing this
36986 * instance to be reused.
36987 */
36988 destructor: function () {},
36989
36990 checkpoint: function () {},
36991
36992 rollback: function () {}
36993};
36994
36995_assign(ReactServerRenderingTransaction.prototype, Transaction, Mixin);
36996
36997PooledClass.addPoolingTo(ReactServerRenderingTransaction);
36998
36999module.exports = ReactServerRenderingTransaction;
37000/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
37001
37002/***/ }),
37003/* 155 */
37004/***/ (function(module, exports, __webpack_require__) {
37005
37006"use strict";
37007/* WEBPACK VAR INJECTION */(function(process) {/**
37008 * Copyright 2015-present, Facebook, Inc.
37009 * All rights reserved.
37010 *
37011 * This source code is licensed under the BSD-style license found in the
37012 * LICENSE file in the root directory of this source tree. An additional grant
37013 * of patent rights can be found in the PATENTS file in the same directory.
37014 *
37015 *
37016 */
37017
37018
37019
37020function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
37021
37022var ReactUpdateQueue = __webpack_require__(51);
37023
37024var warning = __webpack_require__(2);
37025
37026function warnNoop(publicInstance, callerName) {
37027 if (process.env.NODE_ENV !== 'production') {
37028 var constructor = publicInstance.constructor;
37029 process.env.NODE_ENV !== 'production' ? warning(false, '%s(...): Can only update a mounting component. ' + 'This usually means you called %s() outside componentWillMount() on the server. ' + 'This is a no-op. Please check the code for the %s component.', callerName, callerName, constructor && (constructor.displayName || constructor.name) || 'ReactClass') : void 0;
37030 }
37031}
37032
37033/**
37034 * This is the update queue used for server rendering.
37035 * It delegates to ReactUpdateQueue while server rendering is in progress and
37036 * switches to ReactNoopUpdateQueue after the transaction has completed.
37037 * @class ReactServerUpdateQueue
37038 * @param {Transaction} transaction
37039 */
37040
37041var ReactServerUpdateQueue = function () {
37042 function ReactServerUpdateQueue(transaction) {
37043 _classCallCheck(this, ReactServerUpdateQueue);
37044
37045 this.transaction = transaction;
37046 }
37047
37048 /**
37049 * Checks whether or not this composite component is mounted.
37050 * @param {ReactClass} publicInstance The instance we want to test.
37051 * @return {boolean} True if mounted, false otherwise.
37052 * @protected
37053 * @final
37054 */
37055
37056
37057 ReactServerUpdateQueue.prototype.isMounted = function isMounted(publicInstance) {
37058 return false;
37059 };
37060
37061 /**
37062 * Enqueue a callback that will be executed after all the pending updates
37063 * have processed.
37064 *
37065 * @param {ReactClass} publicInstance The instance to use as `this` context.
37066 * @param {?function} callback Called after state is updated.
37067 * @internal
37068 */
37069
37070
37071 ReactServerUpdateQueue.prototype.enqueueCallback = function enqueueCallback(publicInstance, callback, callerName) {
37072 if (this.transaction.isInTransaction()) {
37073 ReactUpdateQueue.enqueueCallback(publicInstance, callback, callerName);
37074 }
37075 };
37076
37077 /**
37078 * Forces an update. This should only be invoked when it is known with
37079 * certainty that we are **not** in a DOM transaction.
37080 *
37081 * You may want to call this when you know that some deeper aspect of the
37082 * component's state has changed but `setState` was not called.
37083 *
37084 * This will not invoke `shouldComponentUpdate`, but it will invoke
37085 * `componentWillUpdate` and `componentDidUpdate`.
37086 *
37087 * @param {ReactClass} publicInstance The instance that should rerender.
37088 * @internal
37089 */
37090
37091
37092 ReactServerUpdateQueue.prototype.enqueueForceUpdate = function enqueueForceUpdate(publicInstance) {
37093 if (this.transaction.isInTransaction()) {
37094 ReactUpdateQueue.enqueueForceUpdate(publicInstance);
37095 } else {
37096 warnNoop(publicInstance, 'forceUpdate');
37097 }
37098 };
37099
37100 /**
37101 * Replaces all of the state. Always use this or `setState` to mutate state.
37102 * You should treat `this.state` as immutable.
37103 *
37104 * There is no guarantee that `this.state` will be immediately updated, so
37105 * accessing `this.state` after calling this method may return the old value.
37106 *
37107 * @param {ReactClass} publicInstance The instance that should rerender.
37108 * @param {object|function} completeState Next state.
37109 * @internal
37110 */
37111
37112
37113 ReactServerUpdateQueue.prototype.enqueueReplaceState = function enqueueReplaceState(publicInstance, completeState) {
37114 if (this.transaction.isInTransaction()) {
37115 ReactUpdateQueue.enqueueReplaceState(publicInstance, completeState);
37116 } else {
37117 warnNoop(publicInstance, 'replaceState');
37118 }
37119 };
37120
37121 /**
37122 * Sets a subset of the state. This only exists because _pendingState is
37123 * internal. This provides a merging strategy that is not available to deep
37124 * properties which is confusing. TODO: Expose pendingState or don't use it
37125 * during the merge.
37126 *
37127 * @param {ReactClass} publicInstance The instance that should rerender.
37128 * @param {object|function} partialState Next partial state to be merged with state.
37129 * @internal
37130 */
37131
37132
37133 ReactServerUpdateQueue.prototype.enqueueSetState = function enqueueSetState(publicInstance, partialState) {
37134 if (this.transaction.isInTransaction()) {
37135 ReactUpdateQueue.enqueueSetState(publicInstance, partialState);
37136 } else {
37137 warnNoop(publicInstance, 'setState');
37138 }
37139 };
37140
37141 return ReactServerUpdateQueue;
37142}();
37143
37144module.exports = ReactServerUpdateQueue;
37145/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
37146
37147/***/ }),
37148/* 156 */
37149/***/ (function(module, exports, __webpack_require__) {
37150
37151"use strict";
37152/**
37153 * Copyright 2014-present, Facebook, Inc.
37154 * All rights reserved.
37155 *
37156 * This source code is licensed under the BSD-style license found in the
37157 * LICENSE file in the root directory of this source tree. An additional grant
37158 * of patent rights can be found in the PATENTS file in the same directory.
37159 *
37160 */
37161
37162
37163
37164var _assign = __webpack_require__(4);
37165
37166var DOMLazyTree = __webpack_require__(20);
37167var ReactDOMComponentTree = __webpack_require__(5);
37168
37169var ReactDOMEmptyComponent = function (instantiate) {
37170 // ReactCompositeComponent uses this:
37171 this._currentElement = null;
37172 // ReactDOMComponentTree uses these:
37173 this._hostNode = null;
37174 this._hostParent = null;
37175 this._hostContainerInfo = null;
37176 this._domID = 0;
37177};
37178_assign(ReactDOMEmptyComponent.prototype, {
37179 mountComponent: function (transaction, hostParent, hostContainerInfo, context) {
37180 var domID = hostContainerInfo._idCounter++;
37181 this._domID = domID;
37182 this._hostParent = hostParent;
37183 this._hostContainerInfo = hostContainerInfo;
37184
37185 var nodeValue = ' react-empty: ' + this._domID + ' ';
37186 if (transaction.useCreateElement) {
37187 var ownerDocument = hostContainerInfo._ownerDocument;
37188 var node = ownerDocument.createComment(nodeValue);
37189 ReactDOMComponentTree.precacheNode(this, node);
37190 return DOMLazyTree(node);
37191 } else {
37192 if (transaction.renderToStaticMarkup) {
37193 // Normally we'd insert a comment node, but since this is a situation
37194 // where React won't take over (static pages), we can simply return
37195 // nothing.
37196 return '';
37197 }
37198 return '<!--' + nodeValue + '-->';
37199 }
37200 },
37201 receiveComponent: function () {},
37202 getHostNode: function () {
37203 return ReactDOMComponentTree.getNodeFromInstance(this);
37204 },
37205 unmountComponent: function () {
37206 ReactDOMComponentTree.uncacheNode(this);
37207 }
37208});
37209
37210module.exports = ReactDOMEmptyComponent;
37211
37212/***/ }),
37213/* 157 */
37214/***/ (function(module, exports, __webpack_require__) {
37215
37216"use strict";
37217/* WEBPACK VAR INJECTION */(function(process) {/**
37218 * Copyright 2015-present, Facebook, Inc.
37219 * All rights reserved.
37220 *
37221 * This source code is licensed under the BSD-style license found in the
37222 * LICENSE file in the root directory of this source tree. An additional grant
37223 * of patent rights can be found in the PATENTS file in the same directory.
37224 *
37225 */
37226
37227
37228
37229var _prodInvariant = __webpack_require__(3);
37230
37231var invariant = __webpack_require__(1);
37232
37233/**
37234 * Return the lowest common ancestor of A and B, or null if they are in
37235 * different trees.
37236 */
37237function getLowestCommonAncestor(instA, instB) {
37238 !('_hostNode' in instA) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'getNodeFromInstance: Invalid argument.') : _prodInvariant('33') : void 0;
37239 !('_hostNode' in instB) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'getNodeFromInstance: Invalid argument.') : _prodInvariant('33') : void 0;
37240
37241 var depthA = 0;
37242 for (var tempA = instA; tempA; tempA = tempA._hostParent) {
37243 depthA++;
37244 }
37245 var depthB = 0;
37246 for (var tempB = instB; tempB; tempB = tempB._hostParent) {
37247 depthB++;
37248 }
37249
37250 // If A is deeper, crawl up.
37251 while (depthA - depthB > 0) {
37252 instA = instA._hostParent;
37253 depthA--;
37254 }
37255
37256 // If B is deeper, crawl up.
37257 while (depthB - depthA > 0) {
37258 instB = instB._hostParent;
37259 depthB--;
37260 }
37261
37262 // Walk in lockstep until we find a match.
37263 var depth = depthA;
37264 while (depth--) {
37265 if (instA === instB) {
37266 return instA;
37267 }
37268 instA = instA._hostParent;
37269 instB = instB._hostParent;
37270 }
37271 return null;
37272}
37273
37274/**
37275 * Return if A is an ancestor of B.
37276 */
37277function isAncestor(instA, instB) {
37278 !('_hostNode' in instA) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'isAncestor: Invalid argument.') : _prodInvariant('35') : void 0;
37279 !('_hostNode' in instB) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'isAncestor: Invalid argument.') : _prodInvariant('35') : void 0;
37280
37281 while (instB) {
37282 if (instB === instA) {
37283 return true;
37284 }
37285 instB = instB._hostParent;
37286 }
37287 return false;
37288}
37289
37290/**
37291 * Return the parent instance of the passed-in instance.
37292 */
37293function getParentInstance(inst) {
37294 !('_hostNode' in inst) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'getParentInstance: Invalid argument.') : _prodInvariant('36') : void 0;
37295
37296 return inst._hostParent;
37297}
37298
37299/**
37300 * Simulates the traversal of a two-phase, capture/bubble event dispatch.
37301 */
37302function traverseTwoPhase(inst, fn, arg) {
37303 var path = [];
37304 while (inst) {
37305 path.push(inst);
37306 inst = inst._hostParent;
37307 }
37308 var i;
37309 for (i = path.length; i-- > 0;) {
37310 fn(path[i], 'captured', arg);
37311 }
37312 for (i = 0; i < path.length; i++) {
37313 fn(path[i], 'bubbled', arg);
37314 }
37315}
37316
37317/**
37318 * Traverses the ID hierarchy and invokes the supplied `cb` on any IDs that
37319 * should would receive a `mouseEnter` or `mouseLeave` event.
37320 *
37321 * Does not invoke the callback on the nearest common ancestor because nothing
37322 * "entered" or "left" that element.
37323 */
37324function traverseEnterLeave(from, to, fn, argFrom, argTo) {
37325 var common = from && to ? getLowestCommonAncestor(from, to) : null;
37326 var pathFrom = [];
37327 while (from && from !== common) {
37328 pathFrom.push(from);
37329 from = from._hostParent;
37330 }
37331 var pathTo = [];
37332 while (to && to !== common) {
37333 pathTo.push(to);
37334 to = to._hostParent;
37335 }
37336 var i;
37337 for (i = 0; i < pathFrom.length; i++) {
37338 fn(pathFrom[i], 'bubbled', argFrom);
37339 }
37340 for (i = pathTo.length; i-- > 0;) {
37341 fn(pathTo[i], 'captured', argTo);
37342 }
37343}
37344
37345module.exports = {
37346 isAncestor: isAncestor,
37347 getLowestCommonAncestor: getLowestCommonAncestor,
37348 getParentInstance: getParentInstance,
37349 traverseTwoPhase: traverseTwoPhase,
37350 traverseEnterLeave: traverseEnterLeave
37351};
37352/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
37353
37354/***/ }),
37355/* 158 */
37356/***/ (function(module, exports, __webpack_require__) {
37357
37358"use strict";
37359/* WEBPACK VAR INJECTION */(function(process) {/**
37360 * Copyright 2013-present, Facebook, Inc.
37361 * All rights reserved.
37362 *
37363 * This source code is licensed under the BSD-style license found in the
37364 * LICENSE file in the root directory of this source tree. An additional grant
37365 * of patent rights can be found in the PATENTS file in the same directory.
37366 *
37367 */
37368
37369
37370
37371var _prodInvariant = __webpack_require__(3),
37372 _assign = __webpack_require__(4);
37373
37374var DOMChildrenOperations = __webpack_require__(43);
37375var DOMLazyTree = __webpack_require__(20);
37376var ReactDOMComponentTree = __webpack_require__(5);
37377
37378var escapeTextContentForBrowser = __webpack_require__(32);
37379var invariant = __webpack_require__(1);
37380var validateDOMNesting = __webpack_require__(52);
37381
37382/**
37383 * Text nodes violate a couple assumptions that React makes about components:
37384 *
37385 * - When mounting text into the DOM, adjacent text nodes are merged.
37386 * - Text nodes cannot be assigned a React root ID.
37387 *
37388 * This component is used to wrap strings between comment nodes so that they
37389 * can undergo the same reconciliation that is applied to elements.
37390 *
37391 * TODO: Investigate representing React components in the DOM with text nodes.
37392 *
37393 * @class ReactDOMTextComponent
37394 * @extends ReactComponent
37395 * @internal
37396 */
37397var ReactDOMTextComponent = function (text) {
37398 // TODO: This is really a ReactText (ReactNode), not a ReactElement
37399 this._currentElement = text;
37400 this._stringText = '' + text;
37401 // ReactDOMComponentTree uses these:
37402 this._hostNode = null;
37403 this._hostParent = null;
37404
37405 // Properties
37406 this._domID = 0;
37407 this._mountIndex = 0;
37408 this._closingComment = null;
37409 this._commentNodes = null;
37410};
37411
37412_assign(ReactDOMTextComponent.prototype, {
37413 /**
37414 * Creates the markup for this text node. This node is not intended to have
37415 * any features besides containing text content.
37416 *
37417 * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
37418 * @return {string} Markup for this text node.
37419 * @internal
37420 */
37421 mountComponent: function (transaction, hostParent, hostContainerInfo, context) {
37422 if (process.env.NODE_ENV !== 'production') {
37423 var parentInfo;
37424 if (hostParent != null) {
37425 parentInfo = hostParent._ancestorInfo;
37426 } else if (hostContainerInfo != null) {
37427 parentInfo = hostContainerInfo._ancestorInfo;
37428 }
37429 if (parentInfo) {
37430 // parentInfo should always be present except for the top-level
37431 // component when server rendering
37432 validateDOMNesting(null, this._stringText, this, parentInfo);
37433 }
37434 }
37435
37436 var domID = hostContainerInfo._idCounter++;
37437 var openingValue = ' react-text: ' + domID + ' ';
37438 var closingValue = ' /react-text ';
37439 this._domID = domID;
37440 this._hostParent = hostParent;
37441 if (transaction.useCreateElement) {
37442 var ownerDocument = hostContainerInfo._ownerDocument;
37443 var openingComment = ownerDocument.createComment(openingValue);
37444 var closingComment = ownerDocument.createComment(closingValue);
37445 var lazyTree = DOMLazyTree(ownerDocument.createDocumentFragment());
37446 DOMLazyTree.queueChild(lazyTree, DOMLazyTree(openingComment));
37447 if (this._stringText) {
37448 DOMLazyTree.queueChild(lazyTree, DOMLazyTree(ownerDocument.createTextNode(this._stringText)));
37449 }
37450 DOMLazyTree.queueChild(lazyTree, DOMLazyTree(closingComment));
37451 ReactDOMComponentTree.precacheNode(this, openingComment);
37452 this._closingComment = closingComment;
37453 return lazyTree;
37454 } else {
37455 var escapedText = escapeTextContentForBrowser(this._stringText);
37456
37457 if (transaction.renderToStaticMarkup) {
37458 // Normally we'd wrap this between comment nodes for the reasons stated
37459 // above, but since this is a situation where React won't take over
37460 // (static pages), we can simply return the text as it is.
37461 return escapedText;
37462 }
37463
37464 return '<!--' + openingValue + '-->' + escapedText + '<!--' + closingValue + '-->';
37465 }
37466 },
37467
37468 /**
37469 * Updates this component by updating the text content.
37470 *
37471 * @param {ReactText} nextText The next text content
37472 * @param {ReactReconcileTransaction} transaction
37473 * @internal
37474 */
37475 receiveComponent: function (nextText, transaction) {
37476 if (nextText !== this._currentElement) {
37477 this._currentElement = nextText;
37478 var nextStringText = '' + nextText;
37479 if (nextStringText !== this._stringText) {
37480 // TODO: Save this as pending props and use performUpdateIfNecessary
37481 // and/or updateComponent to do the actual update for consistency with
37482 // other component types?
37483 this._stringText = nextStringText;
37484 var commentNodes = this.getHostNode();
37485 DOMChildrenOperations.replaceDelimitedText(commentNodes[0], commentNodes[1], nextStringText);
37486 }
37487 }
37488 },
37489
37490 getHostNode: function () {
37491 var hostNode = this._commentNodes;
37492 if (hostNode) {
37493 return hostNode;
37494 }
37495 if (!this._closingComment) {
37496 var openingComment = ReactDOMComponentTree.getNodeFromInstance(this);
37497 var node = openingComment.nextSibling;
37498 while (true) {
37499 !(node != null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Missing closing comment for text component %s', this._domID) : _prodInvariant('67', this._domID) : void 0;
37500 if (node.nodeType === 8 && node.nodeValue === ' /react-text ') {
37501 this._closingComment = node;
37502 break;
37503 }
37504 node = node.nextSibling;
37505 }
37506 }
37507 hostNode = [this._hostNode, this._closingComment];
37508 this._commentNodes = hostNode;
37509 return hostNode;
37510 },
37511
37512 unmountComponent: function () {
37513 this._closingComment = null;
37514 this._commentNodes = null;
37515 ReactDOMComponentTree.uncacheNode(this);
37516 }
37517});
37518
37519module.exports = ReactDOMTextComponent;
37520/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
37521
37522/***/ }),
37523/* 159 */
37524/***/ (function(module, exports, __webpack_require__) {
37525
37526"use strict";
37527/**
37528 * Copyright 2013-present, Facebook, Inc.
37529 * All rights reserved.
37530 *
37531 * This source code is licensed under the BSD-style license found in the
37532 * LICENSE file in the root directory of this source tree. An additional grant
37533 * of patent rights can be found in the PATENTS file in the same directory.
37534 *
37535 */
37536
37537
37538
37539var _assign = __webpack_require__(4);
37540
37541var ReactUpdates = __webpack_require__(11);
37542var Transaction = __webpack_require__(29);
37543
37544var emptyFunction = __webpack_require__(8);
37545
37546var RESET_BATCHED_UPDATES = {
37547 initialize: emptyFunction,
37548 close: function () {
37549 ReactDefaultBatchingStrategy.isBatchingUpdates = false;
37550 }
37551};
37552
37553var FLUSH_BATCHED_UPDATES = {
37554 initialize: emptyFunction,
37555 close: ReactUpdates.flushBatchedUpdates.bind(ReactUpdates)
37556};
37557
37558var TRANSACTION_WRAPPERS = [FLUSH_BATCHED_UPDATES, RESET_BATCHED_UPDATES];
37559
37560function ReactDefaultBatchingStrategyTransaction() {
37561 this.reinitializeTransaction();
37562}
37563
37564_assign(ReactDefaultBatchingStrategyTransaction.prototype, Transaction, {
37565 getTransactionWrappers: function () {
37566 return TRANSACTION_WRAPPERS;
37567 }
37568});
37569
37570var transaction = new ReactDefaultBatchingStrategyTransaction();
37571
37572var ReactDefaultBatchingStrategy = {
37573 isBatchingUpdates: false,
37574
37575 /**
37576 * Call the provided function in a context within which calls to `setState`
37577 * and friends are batched such that components aren't updated unnecessarily.
37578 */
37579 batchedUpdates: function (callback, a, b, c, d, e) {
37580 var alreadyBatchingUpdates = ReactDefaultBatchingStrategy.isBatchingUpdates;
37581
37582 ReactDefaultBatchingStrategy.isBatchingUpdates = true;
37583
37584 // The code is written this way to avoid extra allocations
37585 if (alreadyBatchingUpdates) {
37586 return callback(a, b, c, d, e);
37587 } else {
37588 return transaction.perform(callback, null, a, b, c, d, e);
37589 }
37590 }
37591};
37592
37593module.exports = ReactDefaultBatchingStrategy;
37594
37595/***/ }),
37596/* 160 */
37597/***/ (function(module, exports, __webpack_require__) {
37598
37599"use strict";
37600/**
37601 * Copyright 2013-present, Facebook, Inc.
37602 * All rights reserved.
37603 *
37604 * This source code is licensed under the BSD-style license found in the
37605 * LICENSE file in the root directory of this source tree. An additional grant
37606 * of patent rights can be found in the PATENTS file in the same directory.
37607 *
37608 */
37609
37610
37611
37612var _assign = __webpack_require__(4);
37613
37614var EventListener = __webpack_require__(84);
37615var ExecutionEnvironment = __webpack_require__(6);
37616var PooledClass = __webpack_require__(16);
37617var ReactDOMComponentTree = __webpack_require__(5);
37618var ReactUpdates = __webpack_require__(11);
37619
37620var getEventTarget = __webpack_require__(40);
37621var getUnboundedScrollPosition = __webpack_require__(161);
37622
37623/**
37624 * Find the deepest React component completely containing the root of the
37625 * passed-in instance (for use when entire React trees are nested within each
37626 * other). If React trees are not nested, returns null.
37627 */
37628function findParent(inst) {
37629 // TODO: It may be a good idea to cache this to prevent unnecessary DOM
37630 // traversal, but caching is difficult to do correctly without using a
37631 // mutation observer to listen for all DOM changes.
37632 while (inst._hostParent) {
37633 inst = inst._hostParent;
37634 }
37635 var rootNode = ReactDOMComponentTree.getNodeFromInstance(inst);
37636 var container = rootNode.parentNode;
37637 return ReactDOMComponentTree.getClosestInstanceFromNode(container);
37638}
37639
37640// Used to store ancestor hierarchy in top level callback
37641function TopLevelCallbackBookKeeping(topLevelType, nativeEvent) {
37642 this.topLevelType = topLevelType;
37643 this.nativeEvent = nativeEvent;
37644 this.ancestors = [];
37645}
37646_assign(TopLevelCallbackBookKeeping.prototype, {
37647 destructor: function () {
37648 this.topLevelType = null;
37649 this.nativeEvent = null;
37650 this.ancestors.length = 0;
37651 }
37652});
37653PooledClass.addPoolingTo(TopLevelCallbackBookKeeping, PooledClass.twoArgumentPooler);
37654
37655function handleTopLevelImpl(bookKeeping) {
37656 var nativeEventTarget = getEventTarget(bookKeeping.nativeEvent);
37657 var targetInst = ReactDOMComponentTree.getClosestInstanceFromNode(nativeEventTarget);
37658
37659 // Loop through the hierarchy, in case there's any nested components.
37660 // It's important that we build the array of ancestors before calling any
37661 // event handlers, because event handlers can modify the DOM, leading to
37662 // inconsistencies with ReactMount's node cache. See #1105.
37663 var ancestor = targetInst;
37664 do {
37665 bookKeeping.ancestors.push(ancestor);
37666 ancestor = ancestor && findParent(ancestor);
37667 } while (ancestor);
37668
37669 for (var i = 0; i < bookKeeping.ancestors.length; i++) {
37670 targetInst = bookKeeping.ancestors[i];
37671 ReactEventListener._handleTopLevel(bookKeeping.topLevelType, targetInst, bookKeeping.nativeEvent, getEventTarget(bookKeeping.nativeEvent));
37672 }
37673}
37674
37675function scrollValueMonitor(cb) {
37676 var scrollPosition = getUnboundedScrollPosition(window);
37677 cb(scrollPosition);
37678}
37679
37680var ReactEventListener = {
37681 _enabled: true,
37682 _handleTopLevel: null,
37683
37684 WINDOW_HANDLE: ExecutionEnvironment.canUseDOM ? window : null,
37685
37686 setHandleTopLevel: function (handleTopLevel) {
37687 ReactEventListener._handleTopLevel = handleTopLevel;
37688 },
37689
37690 setEnabled: function (enabled) {
37691 ReactEventListener._enabled = !!enabled;
37692 },
37693
37694 isEnabled: function () {
37695 return ReactEventListener._enabled;
37696 },
37697
37698 /**
37699 * Traps top-level events by using event bubbling.
37700 *
37701 * @param {string} topLevelType Record from `EventConstants`.
37702 * @param {string} handlerBaseName Event name (e.g. "click").
37703 * @param {object} element Element on which to attach listener.
37704 * @return {?object} An object with a remove function which will forcefully
37705 * remove the listener.
37706 * @internal
37707 */
37708 trapBubbledEvent: function (topLevelType, handlerBaseName, element) {
37709 if (!element) {
37710 return null;
37711 }
37712 return EventListener.listen(element, handlerBaseName, ReactEventListener.dispatchEvent.bind(null, topLevelType));
37713 },
37714
37715 /**
37716 * Traps a top-level event by using event capturing.
37717 *
37718 * @param {string} topLevelType Record from `EventConstants`.
37719 * @param {string} handlerBaseName Event name (e.g. "click").
37720 * @param {object} element Element on which to attach listener.
37721 * @return {?object} An object with a remove function which will forcefully
37722 * remove the listener.
37723 * @internal
37724 */
37725 trapCapturedEvent: function (topLevelType, handlerBaseName, element) {
37726 if (!element) {
37727 return null;
37728 }
37729 return EventListener.capture(element, handlerBaseName, ReactEventListener.dispatchEvent.bind(null, topLevelType));
37730 },
37731
37732 monitorScrollValue: function (refresh) {
37733 var callback = scrollValueMonitor.bind(null, refresh);
37734 EventListener.listen(window, 'scroll', callback);
37735 },
37736
37737 dispatchEvent: function (topLevelType, nativeEvent) {
37738 if (!ReactEventListener._enabled) {
37739 return;
37740 }
37741
37742 var bookKeeping = TopLevelCallbackBookKeeping.getPooled(topLevelType, nativeEvent);
37743 try {
37744 // Event queue being processed in the same cycle allows
37745 // `preventDefault`.
37746 ReactUpdates.batchedUpdates(handleTopLevelImpl, bookKeeping);
37747 } finally {
37748 TopLevelCallbackBookKeeping.release(bookKeeping);
37749 }
37750 }
37751};
37752
37753module.exports = ReactEventListener;
37754
37755/***/ }),
37756/* 161 */
37757/***/ (function(module, exports, __webpack_require__) {
37758
37759"use strict";
37760/**
37761 * Copyright (c) 2013-present, Facebook, Inc.
37762 * All rights reserved.
37763 *
37764 * This source code is licensed under the BSD-style license found in the
37765 * LICENSE file in the root directory of this source tree. An additional grant
37766 * of patent rights can be found in the PATENTS file in the same directory.
37767 *
37768 * @typechecks
37769 */
37770
37771
37772
37773/**
37774 * Gets the scroll position of the supplied element or window.
37775 *
37776 * The return values are unbounded, unlike `getScrollPosition`. This means they
37777 * may be negative or exceed the element boundaries (which is possible using
37778 * inertial scrolling).
37779 *
37780 * @param {DOMWindow|DOMElement} scrollable
37781 * @return {object} Map with `x` and `y` keys.
37782 */
37783
37784function getUnboundedScrollPosition(scrollable) {
37785 if (scrollable.Window && scrollable instanceof scrollable.Window) {
37786 return {
37787 x: scrollable.pageXOffset || scrollable.document.documentElement.scrollLeft,
37788 y: scrollable.pageYOffset || scrollable.document.documentElement.scrollTop
37789 };
37790 }
37791 return {
37792 x: scrollable.scrollLeft,
37793 y: scrollable.scrollTop
37794 };
37795}
37796
37797module.exports = getUnboundedScrollPosition;
37798
37799/***/ }),
37800/* 162 */
37801/***/ (function(module, exports, __webpack_require__) {
37802
37803"use strict";
37804/**
37805 * Copyright 2013-present, Facebook, Inc.
37806 * All rights reserved.
37807 *
37808 * This source code is licensed under the BSD-style license found in the
37809 * LICENSE file in the root directory of this source tree. An additional grant
37810 * of patent rights can be found in the PATENTS file in the same directory.
37811 *
37812 */
37813
37814
37815
37816var DOMProperty = __webpack_require__(13);
37817var EventPluginHub = __webpack_require__(22);
37818var EventPluginUtils = __webpack_require__(38);
37819var ReactComponentEnvironment = __webpack_require__(47);
37820var ReactEmptyComponent = __webpack_require__(81);
37821var ReactBrowserEventEmitter = __webpack_require__(33);
37822var ReactHostComponent = __webpack_require__(82);
37823var ReactUpdates = __webpack_require__(11);
37824
37825var ReactInjection = {
37826 Component: ReactComponentEnvironment.injection,
37827 DOMProperty: DOMProperty.injection,
37828 EmptyComponent: ReactEmptyComponent.injection,
37829 EventPluginHub: EventPluginHub.injection,
37830 EventPluginUtils: EventPluginUtils.injection,
37831 EventEmitter: ReactBrowserEventEmitter.injection,
37832 HostComponent: ReactHostComponent.injection,
37833 Updates: ReactUpdates.injection
37834};
37835
37836module.exports = ReactInjection;
37837
37838/***/ }),
37839/* 163 */
37840/***/ (function(module, exports, __webpack_require__) {
37841
37842"use strict";
37843/* WEBPACK VAR INJECTION */(function(process) {/**
37844 * Copyright 2013-present, Facebook, Inc.
37845 * All rights reserved.
37846 *
37847 * This source code is licensed under the BSD-style license found in the
37848 * LICENSE file in the root directory of this source tree. An additional grant
37849 * of patent rights can be found in the PATENTS file in the same directory.
37850 *
37851 */
37852
37853
37854
37855var _assign = __webpack_require__(4);
37856
37857var CallbackQueue = __webpack_require__(68);
37858var PooledClass = __webpack_require__(16);
37859var ReactBrowserEventEmitter = __webpack_require__(33);
37860var ReactInputSelection = __webpack_require__(85);
37861var ReactInstrumentation = __webpack_require__(9);
37862var Transaction = __webpack_require__(29);
37863var ReactUpdateQueue = __webpack_require__(51);
37864
37865/**
37866 * Ensures that, when possible, the selection range (currently selected text
37867 * input) is not disturbed by performing the transaction.
37868 */
37869var SELECTION_RESTORATION = {
37870 /**
37871 * @return {Selection} Selection information.
37872 */
37873 initialize: ReactInputSelection.getSelectionInformation,
37874 /**
37875 * @param {Selection} sel Selection information returned from `initialize`.
37876 */
37877 close: ReactInputSelection.restoreSelection
37878};
37879
37880/**
37881 * Suppresses events (blur/focus) that could be inadvertently dispatched due to
37882 * high level DOM manipulations (like temporarily removing a text input from the
37883 * DOM).
37884 */
37885var EVENT_SUPPRESSION = {
37886 /**
37887 * @return {boolean} The enabled status of `ReactBrowserEventEmitter` before
37888 * the reconciliation.
37889 */
37890 initialize: function () {
37891 var currentlyEnabled = ReactBrowserEventEmitter.isEnabled();
37892 ReactBrowserEventEmitter.setEnabled(false);
37893 return currentlyEnabled;
37894 },
37895
37896 /**
37897 * @param {boolean} previouslyEnabled Enabled status of
37898 * `ReactBrowserEventEmitter` before the reconciliation occurred. `close`
37899 * restores the previous value.
37900 */
37901 close: function (previouslyEnabled) {
37902 ReactBrowserEventEmitter.setEnabled(previouslyEnabled);
37903 }
37904};
37905
37906/**
37907 * Provides a queue for collecting `componentDidMount` and
37908 * `componentDidUpdate` callbacks during the transaction.
37909 */
37910var ON_DOM_READY_QUEUEING = {
37911 /**
37912 * Initializes the internal `onDOMReady` queue.
37913 */
37914 initialize: function () {
37915 this.reactMountReady.reset();
37916 },
37917
37918 /**
37919 * After DOM is flushed, invoke all registered `onDOMReady` callbacks.
37920 */
37921 close: function () {
37922 this.reactMountReady.notifyAll();
37923 }
37924};
37925
37926/**
37927 * Executed within the scope of the `Transaction` instance. Consider these as
37928 * being member methods, but with an implied ordering while being isolated from
37929 * each other.
37930 */
37931var TRANSACTION_WRAPPERS = [SELECTION_RESTORATION, EVENT_SUPPRESSION, ON_DOM_READY_QUEUEING];
37932
37933if (process.env.NODE_ENV !== 'production') {
37934 TRANSACTION_WRAPPERS.push({
37935 initialize: ReactInstrumentation.debugTool.onBeginFlush,
37936 close: ReactInstrumentation.debugTool.onEndFlush
37937 });
37938}
37939
37940/**
37941 * Currently:
37942 * - The order that these are listed in the transaction is critical:
37943 * - Suppresses events.
37944 * - Restores selection range.
37945 *
37946 * Future:
37947 * - Restore document/overflow scroll positions that were unintentionally
37948 * modified via DOM insertions above the top viewport boundary.
37949 * - Implement/integrate with customized constraint based layout system and keep
37950 * track of which dimensions must be remeasured.
37951 *
37952 * @class ReactReconcileTransaction
37953 */
37954function ReactReconcileTransaction(useCreateElement) {
37955 this.reinitializeTransaction();
37956 // Only server-side rendering really needs this option (see
37957 // `ReactServerRendering`), but server-side uses
37958 // `ReactServerRenderingTransaction` instead. This option is here so that it's
37959 // accessible and defaults to false when `ReactDOMComponent` and
37960 // `ReactDOMTextComponent` checks it in `mountComponent`.`
37961 this.renderToStaticMarkup = false;
37962 this.reactMountReady = CallbackQueue.getPooled(null);
37963 this.useCreateElement = useCreateElement;
37964}
37965
37966var Mixin = {
37967 /**
37968 * @see Transaction
37969 * @abstract
37970 * @final
37971 * @return {array<object>} List of operation wrap procedures.
37972 * TODO: convert to array<TransactionWrapper>
37973 */
37974 getTransactionWrappers: function () {
37975 return TRANSACTION_WRAPPERS;
37976 },
37977
37978 /**
37979 * @return {object} The queue to collect `onDOMReady` callbacks with.
37980 */
37981 getReactMountReady: function () {
37982 return this.reactMountReady;
37983 },
37984
37985 /**
37986 * @return {object} The queue to collect React async events.
37987 */
37988 getUpdateQueue: function () {
37989 return ReactUpdateQueue;
37990 },
37991
37992 /**
37993 * Save current transaction state -- if the return value from this method is
37994 * passed to `rollback`, the transaction will be reset to that state.
37995 */
37996 checkpoint: function () {
37997 // reactMountReady is the our only stateful wrapper
37998 return this.reactMountReady.checkpoint();
37999 },
38000
38001 rollback: function (checkpoint) {
38002 this.reactMountReady.rollback(checkpoint);
38003 },
38004
38005 /**
38006 * `PooledClass` looks for this, and will invoke this before allowing this
38007 * instance to be reused.
38008 */
38009 destructor: function () {
38010 CallbackQueue.release(this.reactMountReady);
38011 this.reactMountReady = null;
38012 }
38013};
38014
38015_assign(ReactReconcileTransaction.prototype, Transaction, Mixin);
38016
38017PooledClass.addPoolingTo(ReactReconcileTransaction);
38018
38019module.exports = ReactReconcileTransaction;
38020/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
38021
38022/***/ }),
38023/* 164 */
38024/***/ (function(module, exports, __webpack_require__) {
38025
38026"use strict";
38027/**
38028 * Copyright 2013-present, Facebook, Inc.
38029 * All rights reserved.
38030 *
38031 * This source code is licensed under the BSD-style license found in the
38032 * LICENSE file in the root directory of this source tree. An additional grant
38033 * of patent rights can be found in the PATENTS file in the same directory.
38034 *
38035 */
38036
38037
38038
38039var ExecutionEnvironment = __webpack_require__(6);
38040
38041var getNodeForCharacterOffset = __webpack_require__(165);
38042var getTextContentAccessor = __webpack_require__(67);
38043
38044/**
38045 * While `isCollapsed` is available on the Selection object and `collapsed`
38046 * is available on the Range object, IE11 sometimes gets them wrong.
38047 * If the anchor/focus nodes and offsets are the same, the range is collapsed.
38048 */
38049function isCollapsed(anchorNode, anchorOffset, focusNode, focusOffset) {
38050 return anchorNode === focusNode && anchorOffset === focusOffset;
38051}
38052
38053/**
38054 * Get the appropriate anchor and focus node/offset pairs for IE.
38055 *
38056 * The catch here is that IE's selection API doesn't provide information
38057 * about whether the selection is forward or backward, so we have to
38058 * behave as though it's always forward.
38059 *
38060 * IE text differs from modern selection in that it behaves as though
38061 * block elements end with a new line. This means character offsets will
38062 * differ between the two APIs.
38063 *
38064 * @param {DOMElement} node
38065 * @return {object}
38066 */
38067function getIEOffsets(node) {
38068 var selection = document.selection;
38069 var selectedRange = selection.createRange();
38070 var selectedLength = selectedRange.text.length;
38071
38072 // Duplicate selection so we can move range without breaking user selection.
38073 var fromStart = selectedRange.duplicate();
38074 fromStart.moveToElementText(node);
38075 fromStart.setEndPoint('EndToStart', selectedRange);
38076
38077 var startOffset = fromStart.text.length;
38078 var endOffset = startOffset + selectedLength;
38079
38080 return {
38081 start: startOffset,
38082 end: endOffset
38083 };
38084}
38085
38086/**
38087 * @param {DOMElement} node
38088 * @return {?object}
38089 */
38090function getModernOffsets(node) {
38091 var selection = window.getSelection && window.getSelection();
38092
38093 if (!selection || selection.rangeCount === 0) {
38094 return null;
38095 }
38096
38097 var anchorNode = selection.anchorNode;
38098 var anchorOffset = selection.anchorOffset;
38099 var focusNode = selection.focusNode;
38100 var focusOffset = selection.focusOffset;
38101
38102 var currentRange = selection.getRangeAt(0);
38103
38104 // In Firefox, range.startContainer and range.endContainer can be "anonymous
38105 // divs", e.g. the up/down buttons on an <input type="number">. Anonymous
38106 // divs do not seem to expose properties, triggering a "Permission denied
38107 // error" if any of its properties are accessed. The only seemingly possible
38108 // way to avoid erroring is to access a property that typically works for
38109 // non-anonymous divs and catch any error that may otherwise arise. See
38110 // https://bugzilla.mozilla.org/show_bug.cgi?id=208427
38111 try {
38112 /* eslint-disable no-unused-expressions */
38113 currentRange.startContainer.nodeType;
38114 currentRange.endContainer.nodeType;
38115 /* eslint-enable no-unused-expressions */
38116 } catch (e) {
38117 return null;
38118 }
38119
38120 // If the node and offset values are the same, the selection is collapsed.
38121 // `Selection.isCollapsed` is available natively, but IE sometimes gets
38122 // this value wrong.
38123 var isSelectionCollapsed = isCollapsed(selection.anchorNode, selection.anchorOffset, selection.focusNode, selection.focusOffset);
38124
38125 var rangeLength = isSelectionCollapsed ? 0 : currentRange.toString().length;
38126
38127 var tempRange = currentRange.cloneRange();
38128 tempRange.selectNodeContents(node);
38129 tempRange.setEnd(currentRange.startContainer, currentRange.startOffset);
38130
38131 var isTempRangeCollapsed = isCollapsed(tempRange.startContainer, tempRange.startOffset, tempRange.endContainer, tempRange.endOffset);
38132
38133 var start = isTempRangeCollapsed ? 0 : tempRange.toString().length;
38134 var end = start + rangeLength;
38135
38136 // Detect whether the selection is backward.
38137 var detectionRange = document.createRange();
38138 detectionRange.setStart(anchorNode, anchorOffset);
38139 detectionRange.setEnd(focusNode, focusOffset);
38140 var isBackward = detectionRange.collapsed;
38141
38142 return {
38143 start: isBackward ? end : start,
38144 end: isBackward ? start : end
38145 };
38146}
38147
38148/**
38149 * @param {DOMElement|DOMTextNode} node
38150 * @param {object} offsets
38151 */
38152function setIEOffsets(node, offsets) {
38153 var range = document.selection.createRange().duplicate();
38154 var start, end;
38155
38156 if (offsets.end === undefined) {
38157 start = offsets.start;
38158 end = start;
38159 } else if (offsets.start > offsets.end) {
38160 start = offsets.end;
38161 end = offsets.start;
38162 } else {
38163 start = offsets.start;
38164 end = offsets.end;
38165 }
38166
38167 range.moveToElementText(node);
38168 range.moveStart('character', start);
38169 range.setEndPoint('EndToStart', range);
38170 range.moveEnd('character', end - start);
38171 range.select();
38172}
38173
38174/**
38175 * In modern non-IE browsers, we can support both forward and backward
38176 * selections.
38177 *
38178 * Note: IE10+ supports the Selection object, but it does not support
38179 * the `extend` method, which means that even in modern IE, it's not possible
38180 * to programmatically create a backward selection. Thus, for all IE
38181 * versions, we use the old IE API to create our selections.
38182 *
38183 * @param {DOMElement|DOMTextNode} node
38184 * @param {object} offsets
38185 */
38186function setModernOffsets(node, offsets) {
38187 if (!window.getSelection) {
38188 return;
38189 }
38190
38191 var selection = window.getSelection();
38192 var length = node[getTextContentAccessor()].length;
38193 var start = Math.min(offsets.start, length);
38194 var end = offsets.end === undefined ? start : Math.min(offsets.end, length);
38195
38196 // IE 11 uses modern selection, but doesn't support the extend method.
38197 // Flip backward selections, so we can set with a single range.
38198 if (!selection.extend && start > end) {
38199 var temp = end;
38200 end = start;
38201 start = temp;
38202 }
38203
38204 var startMarker = getNodeForCharacterOffset(node, start);
38205 var endMarker = getNodeForCharacterOffset(node, end);
38206
38207 if (startMarker && endMarker) {
38208 var range = document.createRange();
38209 range.setStart(startMarker.node, startMarker.offset);
38210 selection.removeAllRanges();
38211
38212 if (start > end) {
38213 selection.addRange(range);
38214 selection.extend(endMarker.node, endMarker.offset);
38215 } else {
38216 range.setEnd(endMarker.node, endMarker.offset);
38217 selection.addRange(range);
38218 }
38219 }
38220}
38221
38222var useIEOffsets = ExecutionEnvironment.canUseDOM && 'selection' in document && !('getSelection' in window);
38223
38224var ReactDOMSelection = {
38225 /**
38226 * @param {DOMElement} node
38227 */
38228 getOffsets: useIEOffsets ? getIEOffsets : getModernOffsets,
38229
38230 /**
38231 * @param {DOMElement|DOMTextNode} node
38232 * @param {object} offsets
38233 */
38234 setOffsets: useIEOffsets ? setIEOffsets : setModernOffsets
38235};
38236
38237module.exports = ReactDOMSelection;
38238
38239/***/ }),
38240/* 165 */
38241/***/ (function(module, exports, __webpack_require__) {
38242
38243"use strict";
38244/**
38245 * Copyright 2013-present, Facebook, Inc.
38246 * All rights reserved.
38247 *
38248 * This source code is licensed under the BSD-style license found in the
38249 * LICENSE file in the root directory of this source tree. An additional grant
38250 * of patent rights can be found in the PATENTS file in the same directory.
38251 *
38252 */
38253
38254
38255
38256/**
38257 * Given any node return the first leaf node without children.
38258 *
38259 * @param {DOMElement|DOMTextNode} node
38260 * @return {DOMElement|DOMTextNode}
38261 */
38262
38263function getLeafNode(node) {
38264 while (node && node.firstChild) {
38265 node = node.firstChild;
38266 }
38267 return node;
38268}
38269
38270/**
38271 * Get the next sibling within a container. This will walk up the
38272 * DOM if a node's siblings have been exhausted.
38273 *
38274 * @param {DOMElement|DOMTextNode} node
38275 * @return {?DOMElement|DOMTextNode}
38276 */
38277function getSiblingNode(node) {
38278 while (node) {
38279 if (node.nextSibling) {
38280 return node.nextSibling;
38281 }
38282 node = node.parentNode;
38283 }
38284}
38285
38286/**
38287 * Get object describing the nodes which contain characters at offset.
38288 *
38289 * @param {DOMElement|DOMTextNode} root
38290 * @param {number} offset
38291 * @return {?object}
38292 */
38293function getNodeForCharacterOffset(root, offset) {
38294 var node = getLeafNode(root);
38295 var nodeStart = 0;
38296 var nodeEnd = 0;
38297
38298 while (node) {
38299 if (node.nodeType === 3) {
38300 nodeEnd = nodeStart + node.textContent.length;
38301
38302 if (nodeStart <= offset && nodeEnd >= offset) {
38303 return {
38304 node: node,
38305 offset: offset - nodeStart
38306 };
38307 }
38308
38309 nodeStart = nodeEnd;
38310 }
38311
38312 node = getLeafNode(getSiblingNode(node));
38313 }
38314}
38315
38316module.exports = getNodeForCharacterOffset;
38317
38318/***/ }),
38319/* 166 */
38320/***/ (function(module, exports, __webpack_require__) {
38321
38322"use strict";
38323
38324
38325/**
38326 * Copyright (c) 2013-present, Facebook, Inc.
38327 * All rights reserved.
38328 *
38329 * This source code is licensed under the BSD-style license found in the
38330 * LICENSE file in the root directory of this source tree. An additional grant
38331 * of patent rights can be found in the PATENTS file in the same directory.
38332 *
38333 *
38334 */
38335
38336var isTextNode = __webpack_require__(167);
38337
38338/*eslint-disable no-bitwise */
38339
38340/**
38341 * Checks if a given DOM node contains or is another DOM node.
38342 */
38343function containsNode(outerNode, innerNode) {
38344 if (!outerNode || !innerNode) {
38345 return false;
38346 } else if (outerNode === innerNode) {
38347 return true;
38348 } else if (isTextNode(outerNode)) {
38349 return false;
38350 } else if (isTextNode(innerNode)) {
38351 return containsNode(outerNode, innerNode.parentNode);
38352 } else if ('contains' in outerNode) {
38353 return outerNode.contains(innerNode);
38354 } else if (outerNode.compareDocumentPosition) {
38355 return !!(outerNode.compareDocumentPosition(innerNode) & 16);
38356 } else {
38357 return false;
38358 }
38359}
38360
38361module.exports = containsNode;
38362
38363/***/ }),
38364/* 167 */
38365/***/ (function(module, exports, __webpack_require__) {
38366
38367"use strict";
38368
38369
38370/**
38371 * Copyright (c) 2013-present, Facebook, Inc.
38372 * All rights reserved.
38373 *
38374 * This source code is licensed under the BSD-style license found in the
38375 * LICENSE file in the root directory of this source tree. An additional grant
38376 * of patent rights can be found in the PATENTS file in the same directory.
38377 *
38378 * @typechecks
38379 */
38380
38381var isNode = __webpack_require__(168);
38382
38383/**
38384 * @param {*} object The object to check.
38385 * @return {boolean} Whether or not the object is a DOM text node.
38386 */
38387function isTextNode(object) {
38388 return isNode(object) && object.nodeType == 3;
38389}
38390
38391module.exports = isTextNode;
38392
38393/***/ }),
38394/* 168 */
38395/***/ (function(module, exports, __webpack_require__) {
38396
38397"use strict";
38398
38399
38400/**
38401 * Copyright (c) 2013-present, Facebook, Inc.
38402 * All rights reserved.
38403 *
38404 * This source code is licensed under the BSD-style license found in the
38405 * LICENSE file in the root directory of this source tree. An additional grant
38406 * of patent rights can be found in the PATENTS file in the same directory.
38407 *
38408 * @typechecks
38409 */
38410
38411/**
38412 * @param {*} object The object to check.
38413 * @return {boolean} Whether or not the object is a DOM node.
38414 */
38415function isNode(object) {
38416 var doc = object ? object.ownerDocument || object : document;
38417 var defaultView = doc.defaultView || window;
38418 return !!(object && (typeof defaultView.Node === 'function' ? object instanceof defaultView.Node : typeof object === 'object' && typeof object.nodeType === 'number' && typeof object.nodeName === 'string'));
38419}
38420
38421module.exports = isNode;
38422
38423/***/ }),
38424/* 169 */
38425/***/ (function(module, exports, __webpack_require__) {
38426
38427"use strict";
38428/**
38429 * Copyright 2013-present, Facebook, Inc.
38430 * All rights reserved.
38431 *
38432 * This source code is licensed under the BSD-style license found in the
38433 * LICENSE file in the root directory of this source tree. An additional grant
38434 * of patent rights can be found in the PATENTS file in the same directory.
38435 *
38436 */
38437
38438
38439
38440var NS = {
38441 xlink: 'http://www.w3.org/1999/xlink',
38442 xml: 'http://www.w3.org/XML/1998/namespace'
38443};
38444
38445// We use attributes for everything SVG so let's avoid some duplication and run
38446// code instead.
38447// The following are all specified in the HTML config already so we exclude here.
38448// - class (as className)
38449// - color
38450// - height
38451// - id
38452// - lang
38453// - max
38454// - media
38455// - method
38456// - min
38457// - name
38458// - style
38459// - target
38460// - type
38461// - width
38462var ATTRS = {
38463 accentHeight: 'accent-height',
38464 accumulate: 0,
38465 additive: 0,
38466 alignmentBaseline: 'alignment-baseline',
38467 allowReorder: 'allowReorder',
38468 alphabetic: 0,
38469 amplitude: 0,
38470 arabicForm: 'arabic-form',
38471 ascent: 0,
38472 attributeName: 'attributeName',
38473 attributeType: 'attributeType',
38474 autoReverse: 'autoReverse',
38475 azimuth: 0,
38476 baseFrequency: 'baseFrequency',
38477 baseProfile: 'baseProfile',
38478 baselineShift: 'baseline-shift',
38479 bbox: 0,
38480 begin: 0,
38481 bias: 0,
38482 by: 0,
38483 calcMode: 'calcMode',
38484 capHeight: 'cap-height',
38485 clip: 0,
38486 clipPath: 'clip-path',
38487 clipRule: 'clip-rule',
38488 clipPathUnits: 'clipPathUnits',
38489 colorInterpolation: 'color-interpolation',
38490 colorInterpolationFilters: 'color-interpolation-filters',
38491 colorProfile: 'color-profile',
38492 colorRendering: 'color-rendering',
38493 contentScriptType: 'contentScriptType',
38494 contentStyleType: 'contentStyleType',
38495 cursor: 0,
38496 cx: 0,
38497 cy: 0,
38498 d: 0,
38499 decelerate: 0,
38500 descent: 0,
38501 diffuseConstant: 'diffuseConstant',
38502 direction: 0,
38503 display: 0,
38504 divisor: 0,
38505 dominantBaseline: 'dominant-baseline',
38506 dur: 0,
38507 dx: 0,
38508 dy: 0,
38509 edgeMode: 'edgeMode',
38510 elevation: 0,
38511 enableBackground: 'enable-background',
38512 end: 0,
38513 exponent: 0,
38514 externalResourcesRequired: 'externalResourcesRequired',
38515 fill: 0,
38516 fillOpacity: 'fill-opacity',
38517 fillRule: 'fill-rule',
38518 filter: 0,
38519 filterRes: 'filterRes',
38520 filterUnits: 'filterUnits',
38521 floodColor: 'flood-color',
38522 floodOpacity: 'flood-opacity',
38523 focusable: 0,
38524 fontFamily: 'font-family',
38525 fontSize: 'font-size',
38526 fontSizeAdjust: 'font-size-adjust',
38527 fontStretch: 'font-stretch',
38528 fontStyle: 'font-style',
38529 fontVariant: 'font-variant',
38530 fontWeight: 'font-weight',
38531 format: 0,
38532 from: 0,
38533 fx: 0,
38534 fy: 0,
38535 g1: 0,
38536 g2: 0,
38537 glyphName: 'glyph-name',
38538 glyphOrientationHorizontal: 'glyph-orientation-horizontal',
38539 glyphOrientationVertical: 'glyph-orientation-vertical',
38540 glyphRef: 'glyphRef',
38541 gradientTransform: 'gradientTransform',
38542 gradientUnits: 'gradientUnits',
38543 hanging: 0,
38544 horizAdvX: 'horiz-adv-x',
38545 horizOriginX: 'horiz-origin-x',
38546 ideographic: 0,
38547 imageRendering: 'image-rendering',
38548 'in': 0,
38549 in2: 0,
38550 intercept: 0,
38551 k: 0,
38552 k1: 0,
38553 k2: 0,
38554 k3: 0,
38555 k4: 0,
38556 kernelMatrix: 'kernelMatrix',
38557 kernelUnitLength: 'kernelUnitLength',
38558 kerning: 0,
38559 keyPoints: 'keyPoints',
38560 keySplines: 'keySplines',
38561 keyTimes: 'keyTimes',
38562 lengthAdjust: 'lengthAdjust',
38563 letterSpacing: 'letter-spacing',
38564 lightingColor: 'lighting-color',
38565 limitingConeAngle: 'limitingConeAngle',
38566 local: 0,
38567 markerEnd: 'marker-end',
38568 markerMid: 'marker-mid',
38569 markerStart: 'marker-start',
38570 markerHeight: 'markerHeight',
38571 markerUnits: 'markerUnits',
38572 markerWidth: 'markerWidth',
38573 mask: 0,
38574 maskContentUnits: 'maskContentUnits',
38575 maskUnits: 'maskUnits',
38576 mathematical: 0,
38577 mode: 0,
38578 numOctaves: 'numOctaves',
38579 offset: 0,
38580 opacity: 0,
38581 operator: 0,
38582 order: 0,
38583 orient: 0,
38584 orientation: 0,
38585 origin: 0,
38586 overflow: 0,
38587 overlinePosition: 'overline-position',
38588 overlineThickness: 'overline-thickness',
38589 paintOrder: 'paint-order',
38590 panose1: 'panose-1',
38591 pathLength: 'pathLength',
38592 patternContentUnits: 'patternContentUnits',
38593 patternTransform: 'patternTransform',
38594 patternUnits: 'patternUnits',
38595 pointerEvents: 'pointer-events',
38596 points: 0,
38597 pointsAtX: 'pointsAtX',
38598 pointsAtY: 'pointsAtY',
38599 pointsAtZ: 'pointsAtZ',
38600 preserveAlpha: 'preserveAlpha',
38601 preserveAspectRatio: 'preserveAspectRatio',
38602 primitiveUnits: 'primitiveUnits',
38603 r: 0,
38604 radius: 0,
38605 refX: 'refX',
38606 refY: 'refY',
38607 renderingIntent: 'rendering-intent',
38608 repeatCount: 'repeatCount',
38609 repeatDur: 'repeatDur',
38610 requiredExtensions: 'requiredExtensions',
38611 requiredFeatures: 'requiredFeatures',
38612 restart: 0,
38613 result: 0,
38614 rotate: 0,
38615 rx: 0,
38616 ry: 0,
38617 scale: 0,
38618 seed: 0,
38619 shapeRendering: 'shape-rendering',
38620 slope: 0,
38621 spacing: 0,
38622 specularConstant: 'specularConstant',
38623 specularExponent: 'specularExponent',
38624 speed: 0,
38625 spreadMethod: 'spreadMethod',
38626 startOffset: 'startOffset',
38627 stdDeviation: 'stdDeviation',
38628 stemh: 0,
38629 stemv: 0,
38630 stitchTiles: 'stitchTiles',
38631 stopColor: 'stop-color',
38632 stopOpacity: 'stop-opacity',
38633 strikethroughPosition: 'strikethrough-position',
38634 strikethroughThickness: 'strikethrough-thickness',
38635 string: 0,
38636 stroke: 0,
38637 strokeDasharray: 'stroke-dasharray',
38638 strokeDashoffset: 'stroke-dashoffset',
38639 strokeLinecap: 'stroke-linecap',
38640 strokeLinejoin: 'stroke-linejoin',
38641 strokeMiterlimit: 'stroke-miterlimit',
38642 strokeOpacity: 'stroke-opacity',
38643 strokeWidth: 'stroke-width',
38644 surfaceScale: 'surfaceScale',
38645 systemLanguage: 'systemLanguage',
38646 tableValues: 'tableValues',
38647 targetX: 'targetX',
38648 targetY: 'targetY',
38649 textAnchor: 'text-anchor',
38650 textDecoration: 'text-decoration',
38651 textRendering: 'text-rendering',
38652 textLength: 'textLength',
38653 to: 0,
38654 transform: 0,
38655 u1: 0,
38656 u2: 0,
38657 underlinePosition: 'underline-position',
38658 underlineThickness: 'underline-thickness',
38659 unicode: 0,
38660 unicodeBidi: 'unicode-bidi',
38661 unicodeRange: 'unicode-range',
38662 unitsPerEm: 'units-per-em',
38663 vAlphabetic: 'v-alphabetic',
38664 vHanging: 'v-hanging',
38665 vIdeographic: 'v-ideographic',
38666 vMathematical: 'v-mathematical',
38667 values: 0,
38668 vectorEffect: 'vector-effect',
38669 version: 0,
38670 vertAdvY: 'vert-adv-y',
38671 vertOriginX: 'vert-origin-x',
38672 vertOriginY: 'vert-origin-y',
38673 viewBox: 'viewBox',
38674 viewTarget: 'viewTarget',
38675 visibility: 0,
38676 widths: 0,
38677 wordSpacing: 'word-spacing',
38678 writingMode: 'writing-mode',
38679 x: 0,
38680 xHeight: 'x-height',
38681 x1: 0,
38682 x2: 0,
38683 xChannelSelector: 'xChannelSelector',
38684 xlinkActuate: 'xlink:actuate',
38685 xlinkArcrole: 'xlink:arcrole',
38686 xlinkHref: 'xlink:href',
38687 xlinkRole: 'xlink:role',
38688 xlinkShow: 'xlink:show',
38689 xlinkTitle: 'xlink:title',
38690 xlinkType: 'xlink:type',
38691 xmlBase: 'xml:base',
38692 xmlns: 0,
38693 xmlnsXlink: 'xmlns:xlink',
38694 xmlLang: 'xml:lang',
38695 xmlSpace: 'xml:space',
38696 y: 0,
38697 y1: 0,
38698 y2: 0,
38699 yChannelSelector: 'yChannelSelector',
38700 z: 0,
38701 zoomAndPan: 'zoomAndPan'
38702};
38703
38704var SVGDOMPropertyConfig = {
38705 Properties: {},
38706 DOMAttributeNamespaces: {
38707 xlinkActuate: NS.xlink,
38708 xlinkArcrole: NS.xlink,
38709 xlinkHref: NS.xlink,
38710 xlinkRole: NS.xlink,
38711 xlinkShow: NS.xlink,
38712 xlinkTitle: NS.xlink,
38713 xlinkType: NS.xlink,
38714 xmlBase: NS.xml,
38715 xmlLang: NS.xml,
38716 xmlSpace: NS.xml
38717 },
38718 DOMAttributeNames: {}
38719};
38720
38721Object.keys(ATTRS).forEach(function (key) {
38722 SVGDOMPropertyConfig.Properties[key] = 0;
38723 if (ATTRS[key]) {
38724 SVGDOMPropertyConfig.DOMAttributeNames[key] = ATTRS[key];
38725 }
38726});
38727
38728module.exports = SVGDOMPropertyConfig;
38729
38730/***/ }),
38731/* 170 */
38732/***/ (function(module, exports, __webpack_require__) {
38733
38734"use strict";
38735/**
38736 * Copyright 2013-present, Facebook, Inc.
38737 * All rights reserved.
38738 *
38739 * This source code is licensed under the BSD-style license found in the
38740 * LICENSE file in the root directory of this source tree. An additional grant
38741 * of patent rights can be found in the PATENTS file in the same directory.
38742 *
38743 */
38744
38745
38746
38747var EventPropagators = __webpack_require__(21);
38748var ExecutionEnvironment = __webpack_require__(6);
38749var ReactDOMComponentTree = __webpack_require__(5);
38750var ReactInputSelection = __webpack_require__(85);
38751var SyntheticEvent = __webpack_require__(12);
38752
38753var getActiveElement = __webpack_require__(86);
38754var isTextInputElement = __webpack_require__(71);
38755var shallowEqual = __webpack_require__(48);
38756
38757var skipSelectionChangeEvent = ExecutionEnvironment.canUseDOM && 'documentMode' in document && document.documentMode <= 11;
38758
38759var eventTypes = {
38760 select: {
38761 phasedRegistrationNames: {
38762 bubbled: 'onSelect',
38763 captured: 'onSelectCapture'
38764 },
38765 dependencies: ['topBlur', 'topContextMenu', 'topFocus', 'topKeyDown', 'topKeyUp', 'topMouseDown', 'topMouseUp', 'topSelectionChange']
38766 }
38767};
38768
38769var activeElement = null;
38770var activeElementInst = null;
38771var lastSelection = null;
38772var mouseDown = false;
38773
38774// Track whether a listener exists for this plugin. If none exist, we do
38775// not extract events. See #3639.
38776var hasListener = false;
38777
38778/**
38779 * Get an object which is a unique representation of the current selection.
38780 *
38781 * The return value will not be consistent across nodes or browsers, but
38782 * two identical selections on the same node will return identical objects.
38783 *
38784 * @param {DOMElement} node
38785 * @return {object}
38786 */
38787function getSelection(node) {
38788 if ('selectionStart' in node && ReactInputSelection.hasSelectionCapabilities(node)) {
38789 return {
38790 start: node.selectionStart,
38791 end: node.selectionEnd
38792 };
38793 } else if (window.getSelection) {
38794 var selection = window.getSelection();
38795 return {
38796 anchorNode: selection.anchorNode,
38797 anchorOffset: selection.anchorOffset,
38798 focusNode: selection.focusNode,
38799 focusOffset: selection.focusOffset
38800 };
38801 } else if (document.selection) {
38802 var range = document.selection.createRange();
38803 return {
38804 parentElement: range.parentElement(),
38805 text: range.text,
38806 top: range.boundingTop,
38807 left: range.boundingLeft
38808 };
38809 }
38810}
38811
38812/**
38813 * Poll selection to see whether it's changed.
38814 *
38815 * @param {object} nativeEvent
38816 * @return {?SyntheticEvent}
38817 */
38818function constructSelectEvent(nativeEvent, nativeEventTarget) {
38819 // Ensure we have the right element, and that the user is not dragging a
38820 // selection (this matches native `select` event behavior). In HTML5, select
38821 // fires only on input and textarea thus if there's no focused element we
38822 // won't dispatch.
38823 if (mouseDown || activeElement == null || activeElement !== getActiveElement()) {
38824 return null;
38825 }
38826
38827 // Only fire when selection has actually changed.
38828 var currentSelection = getSelection(activeElement);
38829 if (!lastSelection || !shallowEqual(lastSelection, currentSelection)) {
38830 lastSelection = currentSelection;
38831
38832 var syntheticEvent = SyntheticEvent.getPooled(eventTypes.select, activeElementInst, nativeEvent, nativeEventTarget);
38833
38834 syntheticEvent.type = 'select';
38835 syntheticEvent.target = activeElement;
38836
38837 EventPropagators.accumulateTwoPhaseDispatches(syntheticEvent);
38838
38839 return syntheticEvent;
38840 }
38841
38842 return null;
38843}
38844
38845/**
38846 * This plugin creates an `onSelect` event that normalizes select events
38847 * across form elements.
38848 *
38849 * Supported elements are:
38850 * - input (see `isTextInputElement`)
38851 * - textarea
38852 * - contentEditable
38853 *
38854 * This differs from native browser implementations in the following ways:
38855 * - Fires on contentEditable fields as well as inputs.
38856 * - Fires for collapsed selection.
38857 * - Fires after user input.
38858 */
38859var SelectEventPlugin = {
38860 eventTypes: eventTypes,
38861
38862 extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
38863 if (!hasListener) {
38864 return null;
38865 }
38866
38867 var targetNode = targetInst ? ReactDOMComponentTree.getNodeFromInstance(targetInst) : window;
38868
38869 switch (topLevelType) {
38870 // Track the input node that has focus.
38871 case 'topFocus':
38872 if (isTextInputElement(targetNode) || targetNode.contentEditable === 'true') {
38873 activeElement = targetNode;
38874 activeElementInst = targetInst;
38875 lastSelection = null;
38876 }
38877 break;
38878 case 'topBlur':
38879 activeElement = null;
38880 activeElementInst = null;
38881 lastSelection = null;
38882 break;
38883 // Don't fire the event while the user is dragging. This matches the
38884 // semantics of the native select event.
38885 case 'topMouseDown':
38886 mouseDown = true;
38887 break;
38888 case 'topContextMenu':
38889 case 'topMouseUp':
38890 mouseDown = false;
38891 return constructSelectEvent(nativeEvent, nativeEventTarget);
38892 // Chrome and IE fire non-standard event when selection is changed (and
38893 // sometimes when it hasn't). IE's event fires out of order with respect
38894 // to key and input events on deletion, so we discard it.
38895 //
38896 // Firefox doesn't support selectionchange, so check selection status
38897 // after each key entry. The selection changes after keydown and before
38898 // keyup, but we check on keydown as well in the case of holding down a
38899 // key, when multiple keydown events are fired but only one keyup is.
38900 // This is also our approach for IE handling, for the reason above.
38901 case 'topSelectionChange':
38902 if (skipSelectionChangeEvent) {
38903 break;
38904 }
38905 // falls through
38906 case 'topKeyDown':
38907 case 'topKeyUp':
38908 return constructSelectEvent(nativeEvent, nativeEventTarget);
38909 }
38910
38911 return null;
38912 },
38913
38914 didPutListener: function (inst, registrationName, listener) {
38915 if (registrationName === 'onSelect') {
38916 hasListener = true;
38917 }
38918 }
38919};
38920
38921module.exports = SelectEventPlugin;
38922
38923/***/ }),
38924/* 171 */
38925/***/ (function(module, exports, __webpack_require__) {
38926
38927"use strict";
38928/* WEBPACK VAR INJECTION */(function(process) {/**
38929 * Copyright 2013-present, Facebook, Inc.
38930 * All rights reserved.
38931 *
38932 * This source code is licensed under the BSD-style license found in the
38933 * LICENSE file in the root directory of this source tree. An additional grant
38934 * of patent rights can be found in the PATENTS file in the same directory.
38935 *
38936 *
38937 */
38938
38939
38940
38941var _prodInvariant = __webpack_require__(3);
38942
38943var EventListener = __webpack_require__(84);
38944var EventPropagators = __webpack_require__(21);
38945var ReactDOMComponentTree = __webpack_require__(5);
38946var SyntheticAnimationEvent = __webpack_require__(172);
38947var SyntheticClipboardEvent = __webpack_require__(173);
38948var SyntheticEvent = __webpack_require__(12);
38949var SyntheticFocusEvent = __webpack_require__(174);
38950var SyntheticKeyboardEvent = __webpack_require__(175);
38951var SyntheticMouseEvent = __webpack_require__(30);
38952var SyntheticDragEvent = __webpack_require__(177);
38953var SyntheticTouchEvent = __webpack_require__(178);
38954var SyntheticTransitionEvent = __webpack_require__(179);
38955var SyntheticUIEvent = __webpack_require__(23);
38956var SyntheticWheelEvent = __webpack_require__(180);
38957
38958var emptyFunction = __webpack_require__(8);
38959var getEventCharCode = __webpack_require__(53);
38960var invariant = __webpack_require__(1);
38961
38962/**
38963 * Turns
38964 * ['abort', ...]
38965 * into
38966 * eventTypes = {
38967 * 'abort': {
38968 * phasedRegistrationNames: {
38969 * bubbled: 'onAbort',
38970 * captured: 'onAbortCapture',
38971 * },
38972 * dependencies: ['topAbort'],
38973 * },
38974 * ...
38975 * };
38976 * topLevelEventsToDispatchConfig = {
38977 * 'topAbort': { sameConfig }
38978 * };
38979 */
38980var eventTypes = {};
38981var topLevelEventsToDispatchConfig = {};
38982['abort', 'animationEnd', 'animationIteration', 'animationStart', 'blur', 'canPlay', 'canPlayThrough', 'click', 'contextMenu', 'copy', 'cut', 'doubleClick', 'drag', 'dragEnd', 'dragEnter', 'dragExit', 'dragLeave', 'dragOver', 'dragStart', 'drop', 'durationChange', 'emptied', 'encrypted', 'ended', 'error', 'focus', 'input', 'invalid', 'keyDown', 'keyPress', 'keyUp', 'load', 'loadedData', 'loadedMetadata', 'loadStart', 'mouseDown', 'mouseMove', 'mouseOut', 'mouseOver', 'mouseUp', 'paste', 'pause', 'play', 'playing', 'progress', 'rateChange', 'reset', 'scroll', 'seeked', 'seeking', 'stalled', 'submit', 'suspend', 'timeUpdate', 'touchCancel', 'touchEnd', 'touchMove', 'touchStart', 'transitionEnd', 'volumeChange', 'waiting', 'wheel'].forEach(function (event) {
38983 var capitalizedEvent = event[0].toUpperCase() + event.slice(1);
38984 var onEvent = 'on' + capitalizedEvent;
38985 var topEvent = 'top' + capitalizedEvent;
38986
38987 var type = {
38988 phasedRegistrationNames: {
38989 bubbled: onEvent,
38990 captured: onEvent + 'Capture'
38991 },
38992 dependencies: [topEvent]
38993 };
38994 eventTypes[event] = type;
38995 topLevelEventsToDispatchConfig[topEvent] = type;
38996});
38997
38998var onClickListeners = {};
38999
39000function getDictionaryKey(inst) {
39001 // Prevents V8 performance issue:
39002 // https://github.com/facebook/react/pull/7232
39003 return '.' + inst._rootNodeID;
39004}
39005
39006function isInteractive(tag) {
39007 return tag === 'button' || tag === 'input' || tag === 'select' || tag === 'textarea';
39008}
39009
39010var SimpleEventPlugin = {
39011 eventTypes: eventTypes,
39012
39013 extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
39014 var dispatchConfig = topLevelEventsToDispatchConfig[topLevelType];
39015 if (!dispatchConfig) {
39016 return null;
39017 }
39018 var EventConstructor;
39019 switch (topLevelType) {
39020 case 'topAbort':
39021 case 'topCanPlay':
39022 case 'topCanPlayThrough':
39023 case 'topDurationChange':
39024 case 'topEmptied':
39025 case 'topEncrypted':
39026 case 'topEnded':
39027 case 'topError':
39028 case 'topInput':
39029 case 'topInvalid':
39030 case 'topLoad':
39031 case 'topLoadedData':
39032 case 'topLoadedMetadata':
39033 case 'topLoadStart':
39034 case 'topPause':
39035 case 'topPlay':
39036 case 'topPlaying':
39037 case 'topProgress':
39038 case 'topRateChange':
39039 case 'topReset':
39040 case 'topSeeked':
39041 case 'topSeeking':
39042 case 'topStalled':
39043 case 'topSubmit':
39044 case 'topSuspend':
39045 case 'topTimeUpdate':
39046 case 'topVolumeChange':
39047 case 'topWaiting':
39048 // HTML Events
39049 // @see http://www.w3.org/TR/html5/index.html#events-0
39050 EventConstructor = SyntheticEvent;
39051 break;
39052 case 'topKeyPress':
39053 // Firefox creates a keypress event for function keys too. This removes
39054 // the unwanted keypress events. Enter is however both printable and
39055 // non-printable. One would expect Tab to be as well (but it isn't).
39056 if (getEventCharCode(nativeEvent) === 0) {
39057 return null;
39058 }
39059 /* falls through */
39060 case 'topKeyDown':
39061 case 'topKeyUp':
39062 EventConstructor = SyntheticKeyboardEvent;
39063 break;
39064 case 'topBlur':
39065 case 'topFocus':
39066 EventConstructor = SyntheticFocusEvent;
39067 break;
39068 case 'topClick':
39069 // Firefox creates a click event on right mouse clicks. This removes the
39070 // unwanted click events.
39071 if (nativeEvent.button === 2) {
39072 return null;
39073 }
39074 /* falls through */
39075 case 'topDoubleClick':
39076 case 'topMouseDown':
39077 case 'topMouseMove':
39078 case 'topMouseUp':
39079 // TODO: Disabled elements should not respond to mouse events
39080 /* falls through */
39081 case 'topMouseOut':
39082 case 'topMouseOver':
39083 case 'topContextMenu':
39084 EventConstructor = SyntheticMouseEvent;
39085 break;
39086 case 'topDrag':
39087 case 'topDragEnd':
39088 case 'topDragEnter':
39089 case 'topDragExit':
39090 case 'topDragLeave':
39091 case 'topDragOver':
39092 case 'topDragStart':
39093 case 'topDrop':
39094 EventConstructor = SyntheticDragEvent;
39095 break;
39096 case 'topTouchCancel':
39097 case 'topTouchEnd':
39098 case 'topTouchMove':
39099 case 'topTouchStart':
39100 EventConstructor = SyntheticTouchEvent;
39101 break;
39102 case 'topAnimationEnd':
39103 case 'topAnimationIteration':
39104 case 'topAnimationStart':
39105 EventConstructor = SyntheticAnimationEvent;
39106 break;
39107 case 'topTransitionEnd':
39108 EventConstructor = SyntheticTransitionEvent;
39109 break;
39110 case 'topScroll':
39111 EventConstructor = SyntheticUIEvent;
39112 break;
39113 case 'topWheel':
39114 EventConstructor = SyntheticWheelEvent;
39115 break;
39116 case 'topCopy':
39117 case 'topCut':
39118 case 'topPaste':
39119 EventConstructor = SyntheticClipboardEvent;
39120 break;
39121 }
39122 !EventConstructor ? process.env.NODE_ENV !== 'production' ? invariant(false, 'SimpleEventPlugin: Unhandled event type, `%s`.', topLevelType) : _prodInvariant('86', topLevelType) : void 0;
39123 var event = EventConstructor.getPooled(dispatchConfig, targetInst, nativeEvent, nativeEventTarget);
39124 EventPropagators.accumulateTwoPhaseDispatches(event);
39125 return event;
39126 },
39127
39128 didPutListener: function (inst, registrationName, listener) {
39129 // Mobile Safari does not fire properly bubble click events on
39130 // non-interactive elements, which means delegated click listeners do not
39131 // fire. The workaround for this bug involves attaching an empty click
39132 // listener on the target node.
39133 // http://www.quirksmode.org/blog/archives/2010/09/click_event_del.html
39134 if (registrationName === 'onClick' && !isInteractive(inst._tag)) {
39135 var key = getDictionaryKey(inst);
39136 var node = ReactDOMComponentTree.getNodeFromInstance(inst);
39137 if (!onClickListeners[key]) {
39138 onClickListeners[key] = EventListener.listen(node, 'click', emptyFunction);
39139 }
39140 }
39141 },
39142
39143 willDeleteListener: function (inst, registrationName) {
39144 if (registrationName === 'onClick' && !isInteractive(inst._tag)) {
39145 var key = getDictionaryKey(inst);
39146 onClickListeners[key].remove();
39147 delete onClickListeners[key];
39148 }
39149 }
39150};
39151
39152module.exports = SimpleEventPlugin;
39153/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
39154
39155/***/ }),
39156/* 172 */
39157/***/ (function(module, exports, __webpack_require__) {
39158
39159"use strict";
39160/**
39161 * Copyright 2013-present, Facebook, Inc.
39162 * All rights reserved.
39163 *
39164 * This source code is licensed under the BSD-style license found in the
39165 * LICENSE file in the root directory of this source tree. An additional grant
39166 * of patent rights can be found in the PATENTS file in the same directory.
39167 *
39168 */
39169
39170
39171
39172var SyntheticEvent = __webpack_require__(12);
39173
39174/**
39175 * @interface Event
39176 * @see http://www.w3.org/TR/css3-animations/#AnimationEvent-interface
39177 * @see https://developer.mozilla.org/en-US/docs/Web/API/AnimationEvent
39178 */
39179var AnimationEventInterface = {
39180 animationName: null,
39181 elapsedTime: null,
39182 pseudoElement: null
39183};
39184
39185/**
39186 * @param {object} dispatchConfig Configuration used to dispatch this event.
39187 * @param {string} dispatchMarker Marker identifying the event target.
39188 * @param {object} nativeEvent Native browser event.
39189 * @extends {SyntheticEvent}
39190 */
39191function SyntheticAnimationEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
39192 return SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
39193}
39194
39195SyntheticEvent.augmentClass(SyntheticAnimationEvent, AnimationEventInterface);
39196
39197module.exports = SyntheticAnimationEvent;
39198
39199/***/ }),
39200/* 173 */
39201/***/ (function(module, exports, __webpack_require__) {
39202
39203"use strict";
39204/**
39205 * Copyright 2013-present, Facebook, Inc.
39206 * All rights reserved.
39207 *
39208 * This source code is licensed under the BSD-style license found in the
39209 * LICENSE file in the root directory of this source tree. An additional grant
39210 * of patent rights can be found in the PATENTS file in the same directory.
39211 *
39212 */
39213
39214
39215
39216var SyntheticEvent = __webpack_require__(12);
39217
39218/**
39219 * @interface Event
39220 * @see http://www.w3.org/TR/clipboard-apis/
39221 */
39222var ClipboardEventInterface = {
39223 clipboardData: function (event) {
39224 return 'clipboardData' in event ? event.clipboardData : window.clipboardData;
39225 }
39226};
39227
39228/**
39229 * @param {object} dispatchConfig Configuration used to dispatch this event.
39230 * @param {string} dispatchMarker Marker identifying the event target.
39231 * @param {object} nativeEvent Native browser event.
39232 * @extends {SyntheticUIEvent}
39233 */
39234function SyntheticClipboardEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
39235 return SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
39236}
39237
39238SyntheticEvent.augmentClass(SyntheticClipboardEvent, ClipboardEventInterface);
39239
39240module.exports = SyntheticClipboardEvent;
39241
39242/***/ }),
39243/* 174 */
39244/***/ (function(module, exports, __webpack_require__) {
39245
39246"use strict";
39247/**
39248 * Copyright 2013-present, Facebook, Inc.
39249 * All rights reserved.
39250 *
39251 * This source code is licensed under the BSD-style license found in the
39252 * LICENSE file in the root directory of this source tree. An additional grant
39253 * of patent rights can be found in the PATENTS file in the same directory.
39254 *
39255 */
39256
39257
39258
39259var SyntheticUIEvent = __webpack_require__(23);
39260
39261/**
39262 * @interface FocusEvent
39263 * @see http://www.w3.org/TR/DOM-Level-3-Events/
39264 */
39265var FocusEventInterface = {
39266 relatedTarget: null
39267};
39268
39269/**
39270 * @param {object} dispatchConfig Configuration used to dispatch this event.
39271 * @param {string} dispatchMarker Marker identifying the event target.
39272 * @param {object} nativeEvent Native browser event.
39273 * @extends {SyntheticUIEvent}
39274 */
39275function SyntheticFocusEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
39276 return SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
39277}
39278
39279SyntheticUIEvent.augmentClass(SyntheticFocusEvent, FocusEventInterface);
39280
39281module.exports = SyntheticFocusEvent;
39282
39283/***/ }),
39284/* 175 */
39285/***/ (function(module, exports, __webpack_require__) {
39286
39287"use strict";
39288/**
39289 * Copyright 2013-present, Facebook, Inc.
39290 * All rights reserved.
39291 *
39292 * This source code is licensed under the BSD-style license found in the
39293 * LICENSE file in the root directory of this source tree. An additional grant
39294 * of patent rights can be found in the PATENTS file in the same directory.
39295 *
39296 */
39297
39298
39299
39300var SyntheticUIEvent = __webpack_require__(23);
39301
39302var getEventCharCode = __webpack_require__(53);
39303var getEventKey = __webpack_require__(176);
39304var getEventModifierState = __webpack_require__(42);
39305
39306/**
39307 * @interface KeyboardEvent
39308 * @see http://www.w3.org/TR/DOM-Level-3-Events/
39309 */
39310var KeyboardEventInterface = {
39311 key: getEventKey,
39312 location: null,
39313 ctrlKey: null,
39314 shiftKey: null,
39315 altKey: null,
39316 metaKey: null,
39317 repeat: null,
39318 locale: null,
39319 getModifierState: getEventModifierState,
39320 // Legacy Interface
39321 charCode: function (event) {
39322 // `charCode` is the result of a KeyPress event and represents the value of
39323 // the actual printable character.
39324
39325 // KeyPress is deprecated, but its replacement is not yet final and not
39326 // implemented in any major browser. Only KeyPress has charCode.
39327 if (event.type === 'keypress') {
39328 return getEventCharCode(event);
39329 }
39330 return 0;
39331 },
39332 keyCode: function (event) {
39333 // `keyCode` is the result of a KeyDown/Up event and represents the value of
39334 // physical keyboard key.
39335
39336 // The actual meaning of the value depends on the users' keyboard layout
39337 // which cannot be detected. Assuming that it is a US keyboard layout
39338 // provides a surprisingly accurate mapping for US and European users.
39339 // Due to this, it is left to the user to implement at this time.
39340 if (event.type === 'keydown' || event.type === 'keyup') {
39341 return event.keyCode;
39342 }
39343 return 0;
39344 },
39345 which: function (event) {
39346 // `which` is an alias for either `keyCode` or `charCode` depending on the
39347 // type of the event.
39348 if (event.type === 'keypress') {
39349 return getEventCharCode(event);
39350 }
39351 if (event.type === 'keydown' || event.type === 'keyup') {
39352 return event.keyCode;
39353 }
39354 return 0;
39355 }
39356};
39357
39358/**
39359 * @param {object} dispatchConfig Configuration used to dispatch this event.
39360 * @param {string} dispatchMarker Marker identifying the event target.
39361 * @param {object} nativeEvent Native browser event.
39362 * @extends {SyntheticUIEvent}
39363 */
39364function SyntheticKeyboardEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
39365 return SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
39366}
39367
39368SyntheticUIEvent.augmentClass(SyntheticKeyboardEvent, KeyboardEventInterface);
39369
39370module.exports = SyntheticKeyboardEvent;
39371
39372/***/ }),
39373/* 176 */
39374/***/ (function(module, exports, __webpack_require__) {
39375
39376"use strict";
39377/**
39378 * Copyright 2013-present, Facebook, Inc.
39379 * All rights reserved.
39380 *
39381 * This source code is licensed under the BSD-style license found in the
39382 * LICENSE file in the root directory of this source tree. An additional grant
39383 * of patent rights can be found in the PATENTS file in the same directory.
39384 *
39385 */
39386
39387
39388
39389var getEventCharCode = __webpack_require__(53);
39390
39391/**
39392 * Normalization of deprecated HTML5 `key` values
39393 * @see https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent#Key_names
39394 */
39395var normalizeKey = {
39396 Esc: 'Escape',
39397 Spacebar: ' ',
39398 Left: 'ArrowLeft',
39399 Up: 'ArrowUp',
39400 Right: 'ArrowRight',
39401 Down: 'ArrowDown',
39402 Del: 'Delete',
39403 Win: 'OS',
39404 Menu: 'ContextMenu',
39405 Apps: 'ContextMenu',
39406 Scroll: 'ScrollLock',
39407 MozPrintableKey: 'Unidentified'
39408};
39409
39410/**
39411 * Translation from legacy `keyCode` to HTML5 `key`
39412 * Only special keys supported, all others depend on keyboard layout or browser
39413 * @see https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent#Key_names
39414 */
39415var translateToKey = {
39416 8: 'Backspace',
39417 9: 'Tab',
39418 12: 'Clear',
39419 13: 'Enter',
39420 16: 'Shift',
39421 17: 'Control',
39422 18: 'Alt',
39423 19: 'Pause',
39424 20: 'CapsLock',
39425 27: 'Escape',
39426 32: ' ',
39427 33: 'PageUp',
39428 34: 'PageDown',
39429 35: 'End',
39430 36: 'Home',
39431 37: 'ArrowLeft',
39432 38: 'ArrowUp',
39433 39: 'ArrowRight',
39434 40: 'ArrowDown',
39435 45: 'Insert',
39436 46: 'Delete',
39437 112: 'F1',
39438 113: 'F2',
39439 114: 'F3',
39440 115: 'F4',
39441 116: 'F5',
39442 117: 'F6',
39443 118: 'F7',
39444 119: 'F8',
39445 120: 'F9',
39446 121: 'F10',
39447 122: 'F11',
39448 123: 'F12',
39449 144: 'NumLock',
39450 145: 'ScrollLock',
39451 224: 'Meta'
39452};
39453
39454/**
39455 * @param {object} nativeEvent Native browser event.
39456 * @return {string} Normalized `key` property.
39457 */
39458function getEventKey(nativeEvent) {
39459 if (nativeEvent.key) {
39460 // Normalize inconsistent values reported by browsers due to
39461 // implementations of a working draft specification.
39462
39463 // FireFox implements `key` but returns `MozPrintableKey` for all
39464 // printable characters (normalized to `Unidentified`), ignore it.
39465 var key = normalizeKey[nativeEvent.key] || nativeEvent.key;
39466 if (key !== 'Unidentified') {
39467 return key;
39468 }
39469 }
39470
39471 // Browser does not implement `key`, polyfill as much of it as we can.
39472 if (nativeEvent.type === 'keypress') {
39473 var charCode = getEventCharCode(nativeEvent);
39474
39475 // The enter-key is technically both printable and non-printable and can
39476 // thus be captured by `keypress`, no other non-printable key should.
39477 return charCode === 13 ? 'Enter' : String.fromCharCode(charCode);
39478 }
39479 if (nativeEvent.type === 'keydown' || nativeEvent.type === 'keyup') {
39480 // While user keyboard layout determines the actual meaning of each
39481 // `keyCode` value, almost all function keys have a universal value.
39482 return translateToKey[nativeEvent.keyCode] || 'Unidentified';
39483 }
39484 return '';
39485}
39486
39487module.exports = getEventKey;
39488
39489/***/ }),
39490/* 177 */
39491/***/ (function(module, exports, __webpack_require__) {
39492
39493"use strict";
39494/**
39495 * Copyright 2013-present, Facebook, Inc.
39496 * All rights reserved.
39497 *
39498 * This source code is licensed under the BSD-style license found in the
39499 * LICENSE file in the root directory of this source tree. An additional grant
39500 * of patent rights can be found in the PATENTS file in the same directory.
39501 *
39502 */
39503
39504
39505
39506var SyntheticMouseEvent = __webpack_require__(30);
39507
39508/**
39509 * @interface DragEvent
39510 * @see http://www.w3.org/TR/DOM-Level-3-Events/
39511 */
39512var DragEventInterface = {
39513 dataTransfer: null
39514};
39515
39516/**
39517 * @param {object} dispatchConfig Configuration used to dispatch this event.
39518 * @param {string} dispatchMarker Marker identifying the event target.
39519 * @param {object} nativeEvent Native browser event.
39520 * @extends {SyntheticUIEvent}
39521 */
39522function SyntheticDragEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
39523 return SyntheticMouseEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
39524}
39525
39526SyntheticMouseEvent.augmentClass(SyntheticDragEvent, DragEventInterface);
39527
39528module.exports = SyntheticDragEvent;
39529
39530/***/ }),
39531/* 178 */
39532/***/ (function(module, exports, __webpack_require__) {
39533
39534"use strict";
39535/**
39536 * Copyright 2013-present, Facebook, Inc.
39537 * All rights reserved.
39538 *
39539 * This source code is licensed under the BSD-style license found in the
39540 * LICENSE file in the root directory of this source tree. An additional grant
39541 * of patent rights can be found in the PATENTS file in the same directory.
39542 *
39543 */
39544
39545
39546
39547var SyntheticUIEvent = __webpack_require__(23);
39548
39549var getEventModifierState = __webpack_require__(42);
39550
39551/**
39552 * @interface TouchEvent
39553 * @see http://www.w3.org/TR/touch-events/
39554 */
39555var TouchEventInterface = {
39556 touches: null,
39557 targetTouches: null,
39558 changedTouches: null,
39559 altKey: null,
39560 metaKey: null,
39561 ctrlKey: null,
39562 shiftKey: null,
39563 getModifierState: getEventModifierState
39564};
39565
39566/**
39567 * @param {object} dispatchConfig Configuration used to dispatch this event.
39568 * @param {string} dispatchMarker Marker identifying the event target.
39569 * @param {object} nativeEvent Native browser event.
39570 * @extends {SyntheticUIEvent}
39571 */
39572function SyntheticTouchEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
39573 return SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
39574}
39575
39576SyntheticUIEvent.augmentClass(SyntheticTouchEvent, TouchEventInterface);
39577
39578module.exports = SyntheticTouchEvent;
39579
39580/***/ }),
39581/* 179 */
39582/***/ (function(module, exports, __webpack_require__) {
39583
39584"use strict";
39585/**
39586 * Copyright 2013-present, Facebook, Inc.
39587 * All rights reserved.
39588 *
39589 * This source code is licensed under the BSD-style license found in the
39590 * LICENSE file in the root directory of this source tree. An additional grant
39591 * of patent rights can be found in the PATENTS file in the same directory.
39592 *
39593 */
39594
39595
39596
39597var SyntheticEvent = __webpack_require__(12);
39598
39599/**
39600 * @interface Event
39601 * @see http://www.w3.org/TR/2009/WD-css3-transitions-20090320/#transition-events-
39602 * @see https://developer.mozilla.org/en-US/docs/Web/API/TransitionEvent
39603 */
39604var TransitionEventInterface = {
39605 propertyName: null,
39606 elapsedTime: null,
39607 pseudoElement: null
39608};
39609
39610/**
39611 * @param {object} dispatchConfig Configuration used to dispatch this event.
39612 * @param {string} dispatchMarker Marker identifying the event target.
39613 * @param {object} nativeEvent Native browser event.
39614 * @extends {SyntheticEvent}
39615 */
39616function SyntheticTransitionEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
39617 return SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
39618}
39619
39620SyntheticEvent.augmentClass(SyntheticTransitionEvent, TransitionEventInterface);
39621
39622module.exports = SyntheticTransitionEvent;
39623
39624/***/ }),
39625/* 180 */
39626/***/ (function(module, exports, __webpack_require__) {
39627
39628"use strict";
39629/**
39630 * Copyright 2013-present, Facebook, Inc.
39631 * All rights reserved.
39632 *
39633 * This source code is licensed under the BSD-style license found in the
39634 * LICENSE file in the root directory of this source tree. An additional grant
39635 * of patent rights can be found in the PATENTS file in the same directory.
39636 *
39637 */
39638
39639
39640
39641var SyntheticMouseEvent = __webpack_require__(30);
39642
39643/**
39644 * @interface WheelEvent
39645 * @see http://www.w3.org/TR/DOM-Level-3-Events/
39646 */
39647var WheelEventInterface = {
39648 deltaX: function (event) {
39649 return 'deltaX' in event ? event.deltaX : // Fallback to `wheelDeltaX` for Webkit and normalize (right is positive).
39650 'wheelDeltaX' in event ? -event.wheelDeltaX : 0;
39651 },
39652 deltaY: function (event) {
39653 return 'deltaY' in event ? event.deltaY : // Fallback to `wheelDeltaY` for Webkit and normalize (down is positive).
39654 'wheelDeltaY' in event ? -event.wheelDeltaY : // Fallback to `wheelDelta` for IE<9 and normalize (down is positive).
39655 'wheelDelta' in event ? -event.wheelDelta : 0;
39656 },
39657 deltaZ: null,
39658
39659 // Browsers without "deltaMode" is reporting in raw wheel delta where one
39660 // notch on the scroll is always +/- 120, roughly equivalent to pixels.
39661 // A good approximation of DOM_DELTA_LINE (1) is 5% of viewport size or
39662 // ~40 pixels, for DOM_DELTA_SCREEN (2) it is 87.5% of viewport size.
39663 deltaMode: null
39664};
39665
39666/**
39667 * @param {object} dispatchConfig Configuration used to dispatch this event.
39668 * @param {string} dispatchMarker Marker identifying the event target.
39669 * @param {object} nativeEvent Native browser event.
39670 * @extends {SyntheticMouseEvent}
39671 */
39672function SyntheticWheelEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
39673 return SyntheticMouseEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
39674}
39675
39676SyntheticMouseEvent.augmentClass(SyntheticWheelEvent, WheelEventInterface);
39677
39678module.exports = SyntheticWheelEvent;
39679
39680/***/ }),
39681/* 181 */
39682/***/ (function(module, exports, __webpack_require__) {
39683
39684"use strict";
39685/* WEBPACK VAR INJECTION */(function(process) {/**
39686 * Copyright 2013-present, Facebook, Inc.
39687 * All rights reserved.
39688 *
39689 * This source code is licensed under the BSD-style license found in the
39690 * LICENSE file in the root directory of this source tree. An additional grant
39691 * of patent rights can be found in the PATENTS file in the same directory.
39692 *
39693 */
39694
39695
39696
39697var validateDOMNesting = __webpack_require__(52);
39698
39699var DOC_NODE_TYPE = 9;
39700
39701function ReactDOMContainerInfo(topLevelWrapper, node) {
39702 var info = {
39703 _topLevelWrapper: topLevelWrapper,
39704 _idCounter: 1,
39705 _ownerDocument: node ? node.nodeType === DOC_NODE_TYPE ? node : node.ownerDocument : null,
39706 _node: node,
39707 _tag: node ? node.nodeName.toLowerCase() : null,
39708 _namespaceURI: node ? node.namespaceURI : null
39709 };
39710 if (process.env.NODE_ENV !== 'production') {
39711 info._ancestorInfo = node ? validateDOMNesting.updatedAncestorInfo(null, info._tag, null) : null;
39712 }
39713 return info;
39714}
39715
39716module.exports = ReactDOMContainerInfo;
39717/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
39718
39719/***/ }),
39720/* 182 */
39721/***/ (function(module, exports, __webpack_require__) {
39722
39723"use strict";
39724/**
39725 * Copyright 2013-present, Facebook, Inc.
39726 * All rights reserved.
39727 *
39728 * This source code is licensed under the BSD-style license found in the
39729 * LICENSE file in the root directory of this source tree. An additional grant
39730 * of patent rights can be found in the PATENTS file in the same directory.
39731 *
39732 */
39733
39734
39735
39736var ReactDOMFeatureFlags = {
39737 useCreateElement: true,
39738 useFiber: false
39739};
39740
39741module.exports = ReactDOMFeatureFlags;
39742
39743/***/ }),
39744/* 183 */
39745/***/ (function(module, exports, __webpack_require__) {
39746
39747"use strict";
39748/**
39749 * Copyright 2013-present, Facebook, Inc.
39750 * All rights reserved.
39751 *
39752 * This source code is licensed under the BSD-style license found in the
39753 * LICENSE file in the root directory of this source tree. An additional grant
39754 * of patent rights can be found in the PATENTS file in the same directory.
39755 *
39756 */
39757
39758
39759
39760var adler32 = __webpack_require__(184);
39761
39762var TAG_END = /\/?>/;
39763var COMMENT_START = /^<\!\-\-/;
39764
39765var ReactMarkupChecksum = {
39766 CHECKSUM_ATTR_NAME: 'data-react-checksum',
39767
39768 /**
39769 * @param {string} markup Markup string
39770 * @return {string} Markup string with checksum attribute attached
39771 */
39772 addChecksumToMarkup: function (markup) {
39773 var checksum = adler32(markup);
39774
39775 // Add checksum (handle both parent tags, comments and self-closing tags)
39776 if (COMMENT_START.test(markup)) {
39777 return markup;
39778 } else {
39779 return markup.replace(TAG_END, ' ' + ReactMarkupChecksum.CHECKSUM_ATTR_NAME + '="' + checksum + '"$&');
39780 }
39781 },
39782
39783 /**
39784 * @param {string} markup to use
39785 * @param {DOMElement} element root React element
39786 * @returns {boolean} whether or not the markup is the same
39787 */
39788 canReuseMarkup: function (markup, element) {
39789 var existingChecksum = element.getAttribute(ReactMarkupChecksum.CHECKSUM_ATTR_NAME);
39790 existingChecksum = existingChecksum && parseInt(existingChecksum, 10);
39791 var markupChecksum = adler32(markup);
39792 return markupChecksum === existingChecksum;
39793 }
39794};
39795
39796module.exports = ReactMarkupChecksum;
39797
39798/***/ }),
39799/* 184 */
39800/***/ (function(module, exports, __webpack_require__) {
39801
39802"use strict";
39803/**
39804 * Copyright 2013-present, Facebook, Inc.
39805 * All rights reserved.
39806 *
39807 * This source code is licensed under the BSD-style license found in the
39808 * LICENSE file in the root directory of this source tree. An additional grant
39809 * of patent rights can be found in the PATENTS file in the same directory.
39810 *
39811 *
39812 */
39813
39814
39815
39816var MOD = 65521;
39817
39818// adler32 is not cryptographically strong, and is only used to sanity check that
39819// markup generated on the server matches the markup generated on the client.
39820// This implementation (a modified version of the SheetJS version) has been optimized
39821// for our use case, at the expense of conforming to the adler32 specification
39822// for non-ascii inputs.
39823function adler32(data) {
39824 var a = 1;
39825 var b = 0;
39826 var i = 0;
39827 var l = data.length;
39828 var m = l & ~0x3;
39829 while (i < m) {
39830 var n = Math.min(i + 4096, m);
39831 for (; i < n; i += 4) {
39832 b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));
39833 }
39834 a %= MOD;
39835 b %= MOD;
39836 }
39837 for (; i < l; i++) {
39838 b += a += data.charCodeAt(i);
39839 }
39840 a %= MOD;
39841 b %= MOD;
39842 return a | b << 16;
39843}
39844
39845module.exports = adler32;
39846
39847/***/ }),
39848/* 185 */
39849/***/ (function(module, exports, __webpack_require__) {
39850
39851"use strict";
39852/**
39853 * Copyright 2013-present, Facebook, Inc.
39854 * All rights reserved.
39855 *
39856 * This source code is licensed under the BSD-style license found in the
39857 * LICENSE file in the root directory of this source tree. An additional grant
39858 * of patent rights can be found in the PATENTS file in the same directory.
39859 *
39860 */
39861
39862
39863
39864module.exports = '15.6.1';
39865
39866/***/ }),
39867/* 186 */
39868/***/ (function(module, exports, __webpack_require__) {
39869
39870"use strict";
39871/* WEBPACK VAR INJECTION */(function(process) {/**
39872 * Copyright 2013-present, Facebook, Inc.
39873 * All rights reserved.
39874 *
39875 * This source code is licensed under the BSD-style license found in the
39876 * LICENSE file in the root directory of this source tree. An additional grant
39877 * of patent rights can be found in the PATENTS file in the same directory.
39878 *
39879 */
39880
39881
39882
39883var _prodInvariant = __webpack_require__(3);
39884
39885var ReactCurrentOwner = __webpack_require__(10);
39886var ReactDOMComponentTree = __webpack_require__(5);
39887var ReactInstanceMap = __webpack_require__(24);
39888
39889var getHostComponentFromComposite = __webpack_require__(88);
39890var invariant = __webpack_require__(1);
39891var warning = __webpack_require__(2);
39892
39893/**
39894 * Returns the DOM node rendered by this element.
39895 *
39896 * See https://facebook.github.io/react/docs/top-level-api.html#reactdom.finddomnode
39897 *
39898 * @param {ReactComponent|DOMElement} componentOrElement
39899 * @return {?DOMElement} The root node of this element.
39900 */
39901function findDOMNode(componentOrElement) {
39902 if (process.env.NODE_ENV !== 'production') {
39903 var owner = ReactCurrentOwner.current;
39904 if (owner !== null) {
39905 process.env.NODE_ENV !== 'production' ? warning(owner._warnedAboutRefsInRender, '%s is accessing findDOMNode inside its render(). ' + 'render() should be a pure function of props and state. It should ' + 'never access something that requires stale data from the previous ' + 'render, such as refs. Move this logic to componentDidMount and ' + 'componentDidUpdate instead.', owner.getName() || 'A component') : void 0;
39906 owner._warnedAboutRefsInRender = true;
39907 }
39908 }
39909 if (componentOrElement == null) {
39910 return null;
39911 }
39912 if (componentOrElement.nodeType === 1) {
39913 return componentOrElement;
39914 }
39915
39916 var inst = ReactInstanceMap.get(componentOrElement);
39917 if (inst) {
39918 inst = getHostComponentFromComposite(inst);
39919 return inst ? ReactDOMComponentTree.getNodeFromInstance(inst) : null;
39920 }
39921
39922 if (typeof componentOrElement.render === 'function') {
39923 true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'findDOMNode was called on an unmounted component.') : _prodInvariant('44') : void 0;
39924 } else {
39925 true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Element appears to be neither ReactComponent nor DOMNode (keys: %s)', Object.keys(componentOrElement)) : _prodInvariant('45', Object.keys(componentOrElement)) : void 0;
39926 }
39927}
39928
39929module.exports = findDOMNode;
39930/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
39931
39932/***/ }),
39933/* 187 */
39934/***/ (function(module, exports, __webpack_require__) {
39935
39936"use strict";
39937/**
39938 * Copyright 2013-present, Facebook, Inc.
39939 * All rights reserved.
39940 *
39941 * This source code is licensed under the BSD-style license found in the
39942 * LICENSE file in the root directory of this source tree. An additional grant
39943 * of patent rights can be found in the PATENTS file in the same directory.
39944 *
39945 */
39946
39947
39948
39949var ReactMount = __webpack_require__(87);
39950
39951module.exports = ReactMount.renderSubtreeIntoContainer;
39952
39953/***/ }),
39954/* 188 */
39955/***/ (function(module, exports, __webpack_require__) {
39956
39957"use strict";
39958/* WEBPACK VAR INJECTION */(function(process) {/**
39959 * Copyright 2013-present, Facebook, Inc.
39960 * All rights reserved.
39961 *
39962 * This source code is licensed under the BSD-style license found in the
39963 * LICENSE file in the root directory of this source tree. An additional grant
39964 * of patent rights can be found in the PATENTS file in the same directory.
39965 *
39966 */
39967
39968
39969
39970var DOMProperty = __webpack_require__(13);
39971var EventPluginRegistry = __webpack_require__(28);
39972var ReactComponentTreeHook = __webpack_require__(7);
39973
39974var warning = __webpack_require__(2);
39975
39976if (process.env.NODE_ENV !== 'production') {
39977 var reactProps = {
39978 children: true,
39979 dangerouslySetInnerHTML: true,
39980 key: true,
39981 ref: true,
39982
39983 autoFocus: true,
39984 defaultValue: true,
39985 valueLink: true,
39986 defaultChecked: true,
39987 checkedLink: true,
39988 innerHTML: true,
39989 suppressContentEditableWarning: true,
39990 onFocusIn: true,
39991 onFocusOut: true
39992 };
39993 var warnedProperties = {};
39994
39995 var validateProperty = function (tagName, name, debugID) {
39996 if (DOMProperty.properties.hasOwnProperty(name) || DOMProperty.isCustomAttribute(name)) {
39997 return true;
39998 }
39999 if (reactProps.hasOwnProperty(name) && reactProps[name] || warnedProperties.hasOwnProperty(name) && warnedProperties[name]) {
40000 return true;
40001 }
40002 if (EventPluginRegistry.registrationNameModules.hasOwnProperty(name)) {
40003 return true;
40004 }
40005 warnedProperties[name] = true;
40006 var lowerCasedName = name.toLowerCase();
40007
40008 // data-* attributes should be lowercase; suggest the lowercase version
40009 var standardName = DOMProperty.isCustomAttribute(lowerCasedName) ? lowerCasedName : DOMProperty.getPossibleStandardName.hasOwnProperty(lowerCasedName) ? DOMProperty.getPossibleStandardName[lowerCasedName] : null;
40010
40011 var registrationName = EventPluginRegistry.possibleRegistrationNames.hasOwnProperty(lowerCasedName) ? EventPluginRegistry.possibleRegistrationNames[lowerCasedName] : null;
40012
40013 if (standardName != null) {
40014 process.env.NODE_ENV !== 'production' ? warning(false, 'Unknown DOM property %s. Did you mean %s?%s', name, standardName, ReactComponentTreeHook.getStackAddendumByID(debugID)) : void 0;
40015 return true;
40016 } else if (registrationName != null) {
40017 process.env.NODE_ENV !== 'production' ? warning(false, 'Unknown event handler property %s. Did you mean `%s`?%s', name, registrationName, ReactComponentTreeHook.getStackAddendumByID(debugID)) : void 0;
40018 return true;
40019 } else {
40020 // We were unable to guess which prop the user intended.
40021 // It is likely that the user was just blindly spreading/forwarding props
40022 // Components should be careful to only render valid props/attributes.
40023 // Warning will be invoked in warnUnknownProperties to allow grouping.
40024 return false;
40025 }
40026 };
40027}
40028
40029var warnUnknownProperties = function (debugID, element) {
40030 var unknownProps = [];
40031 for (var key in element.props) {
40032 var isValid = validateProperty(element.type, key, debugID);
40033 if (!isValid) {
40034 unknownProps.push(key);
40035 }
40036 }
40037
40038 var unknownPropString = unknownProps.map(function (prop) {
40039 return '`' + prop + '`';
40040 }).join(', ');
40041
40042 if (unknownProps.length === 1) {
40043 process.env.NODE_ENV !== 'production' ? warning(false, 'Unknown prop %s on <%s> tag. Remove this prop from the element. ' + 'For details, see https://fb.me/react-unknown-prop%s', unknownPropString, element.type, ReactComponentTreeHook.getStackAddendumByID(debugID)) : void 0;
40044 } else if (unknownProps.length > 1) {
40045 process.env.NODE_ENV !== 'production' ? warning(false, 'Unknown props %s on <%s> tag. Remove these props from the element. ' + 'For details, see https://fb.me/react-unknown-prop%s', unknownPropString, element.type, ReactComponentTreeHook.getStackAddendumByID(debugID)) : void 0;
40046 }
40047};
40048
40049function handleElement(debugID, element) {
40050 if (element == null || typeof element.type !== 'string') {
40051 return;
40052 }
40053 if (element.type.indexOf('-') >= 0 || element.props.is) {
40054 return;
40055 }
40056 warnUnknownProperties(debugID, element);
40057}
40058
40059var ReactDOMUnknownPropertyHook = {
40060 onBeforeMountComponent: function (debugID, element) {
40061 handleElement(debugID, element);
40062 },
40063 onBeforeUpdateComponent: function (debugID, element) {
40064 handleElement(debugID, element);
40065 }
40066};
40067
40068module.exports = ReactDOMUnknownPropertyHook;
40069/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
40070
40071/***/ }),
40072/* 189 */
40073/***/ (function(module, exports, __webpack_require__) {
40074
40075"use strict";
40076/* WEBPACK VAR INJECTION */(function(process) {/**
40077 * Copyright 2013-present, Facebook, Inc.
40078 * All rights reserved.
40079 *
40080 * This source code is licensed under the BSD-style license found in the
40081 * LICENSE file in the root directory of this source tree. An additional grant
40082 * of patent rights can be found in the PATENTS file in the same directory.
40083 *
40084 */
40085
40086
40087
40088var ReactComponentTreeHook = __webpack_require__(7);
40089
40090var warning = __webpack_require__(2);
40091
40092var didWarnValueNull = false;
40093
40094function handleElement(debugID, element) {
40095 if (element == null) {
40096 return;
40097 }
40098 if (element.type !== 'input' && element.type !== 'textarea' && element.type !== 'select') {
40099 return;
40100 }
40101 if (element.props != null && element.props.value === null && !didWarnValueNull) {
40102 process.env.NODE_ENV !== 'production' ? warning(false, '`value` prop on `%s` should not be null. ' + 'Consider using the empty string to clear the component or `undefined` ' + 'for uncontrolled components.%s', element.type, ReactComponentTreeHook.getStackAddendumByID(debugID)) : void 0;
40103
40104 didWarnValueNull = true;
40105 }
40106}
40107
40108var ReactDOMNullInputValuePropHook = {
40109 onBeforeMountComponent: function (debugID, element) {
40110 handleElement(debugID, element);
40111 },
40112 onBeforeUpdateComponent: function (debugID, element) {
40113 handleElement(debugID, element);
40114 }
40115};
40116
40117module.exports = ReactDOMNullInputValuePropHook;
40118/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
40119
40120/***/ }),
40121/* 190 */
40122/***/ (function(module, exports, __webpack_require__) {
40123
40124"use strict";
40125/* WEBPACK VAR INJECTION */(function(process) {/**
40126 * Copyright 2013-present, Facebook, Inc.
40127 * All rights reserved.
40128 *
40129 * This source code is licensed under the BSD-style license found in the
40130 * LICENSE file in the root directory of this source tree. An additional grant
40131 * of patent rights can be found in the PATENTS file in the same directory.
40132 *
40133 */
40134
40135
40136
40137var DOMProperty = __webpack_require__(13);
40138var ReactComponentTreeHook = __webpack_require__(7);
40139
40140var warning = __webpack_require__(2);
40141
40142var warnedProperties = {};
40143var rARIA = new RegExp('^(aria)-[' + DOMProperty.ATTRIBUTE_NAME_CHAR + ']*$');
40144
40145function validateProperty(tagName, name, debugID) {
40146 if (warnedProperties.hasOwnProperty(name) && warnedProperties[name]) {
40147 return true;
40148 }
40149
40150 if (rARIA.test(name)) {
40151 var lowerCasedName = name.toLowerCase();
40152 var standardName = DOMProperty.getPossibleStandardName.hasOwnProperty(lowerCasedName) ? DOMProperty.getPossibleStandardName[lowerCasedName] : null;
40153
40154 // If this is an aria-* attribute, but is not listed in the known DOM
40155 // DOM properties, then it is an invalid aria-* attribute.
40156 if (standardName == null) {
40157 warnedProperties[name] = true;
40158 return false;
40159 }
40160 // aria-* attributes should be lowercase; suggest the lowercase version.
40161 if (name !== standardName) {
40162 process.env.NODE_ENV !== 'production' ? warning(false, 'Unknown ARIA attribute %s. Did you mean %s?%s', name, standardName, ReactComponentTreeHook.getStackAddendumByID(debugID)) : void 0;
40163 warnedProperties[name] = true;
40164 return true;
40165 }
40166 }
40167
40168 return true;
40169}
40170
40171function warnInvalidARIAProps(debugID, element) {
40172 var invalidProps = [];
40173
40174 for (var key in element.props) {
40175 var isValid = validateProperty(element.type, key, debugID);
40176 if (!isValid) {
40177 invalidProps.push(key);
40178 }
40179 }
40180
40181 var unknownPropString = invalidProps.map(function (prop) {
40182 return '`' + prop + '`';
40183 }).join(', ');
40184
40185 if (invalidProps.length === 1) {
40186 process.env.NODE_ENV !== 'production' ? warning(false, 'Invalid aria prop %s on <%s> tag. ' + 'For details, see https://fb.me/invalid-aria-prop%s', unknownPropString, element.type, ReactComponentTreeHook.getStackAddendumByID(debugID)) : void 0;
40187 } else if (invalidProps.length > 1) {
40188 process.env.NODE_ENV !== 'production' ? warning(false, 'Invalid aria props %s on <%s> tag. ' + 'For details, see https://fb.me/invalid-aria-prop%s', unknownPropString, element.type, ReactComponentTreeHook.getStackAddendumByID(debugID)) : void 0;
40189 }
40190}
40191
40192function handleElement(debugID, element) {
40193 if (element == null || typeof element.type !== 'string') {
40194 return;
40195 }
40196 if (element.type.indexOf('-') >= 0 || element.props.is) {
40197 return;
40198 }
40199
40200 warnInvalidARIAProps(debugID, element);
40201}
40202
40203var ReactDOMInvalidARIAHook = {
40204 onBeforeMountComponent: function (debugID, element) {
40205 if (process.env.NODE_ENV !== 'production') {
40206 handleElement(debugID, element);
40207 }
40208 },
40209 onBeforeUpdateComponent: function (debugID, element) {
40210 if (process.env.NODE_ENV !== 'production') {
40211 handleElement(debugID, element);
40212 }
40213 }
40214};
40215
40216module.exports = ReactDOMInvalidARIAHook;
40217/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
40218
40219/***/ }),
40220/* 191 */
40221/***/ (function(module, exports, __webpack_require__) {
40222
40223"use strict";
40224
40225
40226Object.defineProperty(exports, "__esModule", {
40227 value: true
40228});
40229
40230var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
40231
40232var _lodash = __webpack_require__(54);
40233
40234var _lodash2 = _interopRequireDefault(_lodash);
40235
40236var _react = __webpack_require__(14);
40237
40238var _react2 = _interopRequireDefault(_react);
40239
40240var _ScrollArea = __webpack_require__(194);
40241
40242var _ScrollArea2 = _interopRequireDefault(_ScrollArea);
40243
40244var _App = __webpack_require__(207);
40245
40246var _App2 = _interopRequireDefault(_App);
40247
40248var _example = __webpack_require__(209);
40249
40250var _example2 = _interopRequireDefault(_example);
40251
40252function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
40253
40254function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
40255
40256function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
40257
40258function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
40259
40260var App = function (_Component) {
40261 _inherits(App, _Component);
40262
40263 function App() {
40264 _classCallCheck(this, App);
40265
40266 return _possibleConstructorReturn(this, (App.__proto__ || Object.getPrototypeOf(App)).apply(this, arguments));
40267 }
40268
40269 _createClass(App, [{
40270 key: 'goToTop',
40271 value: function goToTop() {
40272 this.refs.scroll.goToTop(parseInt(this.refs.duration.value, 10) || 0);
40273 }
40274 }, {
40275 key: 'goToBottom',
40276 value: function goToBottom() {
40277 this.refs.scroll.goToBottom(parseInt(this.refs.duration.value, 10) || 0);
40278 }
40279 }, {
40280 key: 'goToPos',
40281 value: function goToPos() {
40282 this.refs.scroll.goToPos(this.refs.pos.value, parseInt(this.refs.duration.value, 10) || 0);
40283 }
40284 }, {
40285 key: 'render',
40286 value: function render() {
40287 return _react2.default.createElement(
40288 'div',
40289 { className: 'container' },
40290 _react2.default.createElement(
40291 'div',
40292 { className: 'columns is-multiline' },
40293 _react2.default.createElement(
40294 'div',
40295 { className: 'column' },
40296 _react2.default.createElement(
40297 'div',
40298 { className: _App2.default.example },
40299 _react2.default.createElement(
40300 'h2',
40301 { className: 'title is-5' },
40302 'Without params'
40303 ),
40304 _react2.default.createElement(
40305 'div',
40306 { className: _App2.default.preview },
40307 _react2.default.createElement(
40308 'div',
40309 { className: _App2.default.exampleContainer },
40310 _react2.default.createElement(
40311 _ScrollArea2.default,
40312 null,
40313 _react2.default.createElement(
40314 'div',
40315 { style: { minHeight: "2798px" } },
40316 _react2.default.createElement('img', { src: _example2.default, height: '2798' })
40317 )
40318 )
40319 )
40320 )
40321 )
40322 ),
40323 _react2.default.createElement(
40324 'div',
40325 { className: 'column' },
40326 _react2.default.createElement(
40327 'div',
40328 { className: _App2.default.example },
40329 _react2.default.createElement(
40330 'h2',
40331 { className: 'title is-5' },
40332 'Always visible'
40333 ),
40334 _react2.default.createElement(
40335 'div',
40336 { className: _App2.default.preview },
40337 _react2.default.createElement(
40338 'div',
40339 { className: _App2.default.exampleContainer },
40340 _react2.default.createElement(
40341 _ScrollArea2.default,
40342 { trackVisible: true },
40343 _react2.default.createElement(
40344 'div',
40345 { style: { minHeight: "2798px" } },
40346 _react2.default.createElement('img', { src: _example2.default, height: '2798' })
40347 )
40348 )
40349 )
40350 )
40351 )
40352 ),
40353 _react2.default.createElement(
40354 'div',
40355 { className: 'column' },
40356 _react2.default.createElement(
40357 'div',
40358 { className: _App2.default.example },
40359 _react2.default.createElement(
40360 'h2',
40361 { className: 'title is-5' },
40362 'Always hidden'
40363 ),
40364 _react2.default.createElement(
40365 'div',
40366 { className: _App2.default.preview },
40367 _react2.default.createElement(
40368 'div',
40369 { className: _App2.default.exampleContainer },
40370 _react2.default.createElement(
40371 _ScrollArea2.default,
40372 { trackHidden: true },
40373 _react2.default.createElement(
40374 'div',
40375 { style: { minHeight: "2798px" } },
40376 _react2.default.createElement('img', { src: _example2.default, height: '2798' })
40377 )
40378 )
40379 )
40380 )
40381 )
40382 ),
40383 _react2.default.createElement(
40384 'div',
40385 { className: 'column' },
40386 _react2.default.createElement(
40387 'div',
40388 { className: _App2.default.example },
40389 _react2.default.createElement(
40390 'h2',
40391 { className: 'title is-5' },
40392 'With min scroll handler height set to 300px'
40393 ),
40394 _react2.default.createElement(
40395 'div',
40396 { className: _App2.default.preview },
40397 _react2.default.createElement(
40398 'div',
40399 { className: _App2.default.exampleContainer },
40400 _react2.default.createElement(
40401 _ScrollArea2.default,
40402 { minHandlerHeight: 300 },
40403 _react2.default.createElement(
40404 'div',
40405 { style: { minHeight: "2798px" } },
40406 _react2.default.createElement('img', { src: _example2.default, height: '2798' })
40407 )
40408 )
40409 )
40410 )
40411 )
40412 ),
40413 _react2.default.createElement(
40414 'div',
40415 { className: 'column' },
40416 _react2.default.createElement(
40417 'div',
40418 { className: _App2.default.example },
40419 _react2.default.createElement(
40420 'h2',
40421 { className: 'title is-5' },
40422 'With hide time set to zero'
40423 ),
40424 _react2.default.createElement(
40425 'div',
40426 { className: _App2.default.preview },
40427 _react2.default.createElement(
40428 'div',
40429 { className: _App2.default.exampleContainer },
40430 _react2.default.createElement(
40431 _ScrollArea2.default,
40432 { trackHideTime: 0 },
40433 _react2.default.createElement(
40434 'div',
40435 { style: { minHeight: "2798px" } },
40436 _react2.default.createElement('img', { src: _example2.default, height: '2798' })
40437 )
40438 )
40439 )
40440 )
40441 )
40442 ),
40443 _react2.default.createElement(
40444 'div',
40445 { className: 'column' },
40446 _react2.default.createElement(
40447 'div',
40448 { className: _App2.default.example },
40449 _react2.default.createElement(
40450 'h2',
40451 { className: 'title is-5' },
40452 'With margin set to 100px'
40453 ),
40454 _react2.default.createElement(
40455 'div',
40456 { className: _App2.default.preview },
40457 _react2.default.createElement(
40458 'div',
40459 { className: _App2.default.exampleContainer },
40460 _react2.default.createElement(
40461 _ScrollArea2.default,
40462 { trackMargin: 100, trackVisible: true },
40463 _react2.default.createElement(
40464 'div',
40465 { style: { minHeight: "2798px" } },
40466 _react2.default.createElement('img', { src: _example2.default, height: '2798' })
40467 )
40468 )
40469 )
40470 )
40471 )
40472 )
40473 )
40474 );
40475 }
40476 }]);
40477
40478 return App;
40479}(_react.Component);
40480
40481exports.default = App;
40482
40483/***/ }),
40484/* 192 */
40485/***/ (function(module, exports) {
40486
40487var g;
40488
40489// This works in non-strict mode
40490g = (function() {
40491 return this;
40492})();
40493
40494try {
40495 // This works if eval is allowed (see CSP)
40496 g = g || Function("return this")() || (1,eval)("this");
40497} catch(e) {
40498 // This works if the window reference is available
40499 if(typeof window === "object")
40500 g = window;
40501}
40502
40503// g can still be undefined, but nothing to do about it...
40504// We return undefined, instead of nothing here, so it's
40505// easier to handle this case. if(!global) { ...}
40506
40507module.exports = g;
40508
40509
40510/***/ }),
40511/* 193 */
40512/***/ (function(module, exports) {
40513
40514module.exports = function(module) {
40515 if(!module.webpackPolyfill) {
40516 module.deprecate = function() {};
40517 module.paths = [];
40518 // module.parent = undefined by default
40519 if(!module.children) module.children = [];
40520 Object.defineProperty(module, "loaded", {
40521 enumerable: true,
40522 get: function() {
40523 return module.l;
40524 }
40525 });
40526 Object.defineProperty(module, "id", {
40527 enumerable: true,
40528 get: function() {
40529 return module.i;
40530 }
40531 });
40532 module.webpackPolyfill = 1;
40533 }
40534 return module;
40535};
40536
40537
40538/***/ }),
40539/* 194 */
40540/***/ (function(module, exports, __webpack_require__) {
40541
40542"use strict";
40543/* WEBPACK VAR INJECTION */(function(process) {
40544
40545Object.defineProperty(exports, "__esModule", {
40546 value: true
40547});
40548
40549var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
40550
40551var _react = __webpack_require__(14);
40552
40553var _react2 = _interopRequireDefault(_react);
40554
40555var _propTypes = __webpack_require__(25);
40556
40557var _propTypes2 = _interopRequireDefault(_propTypes);
40558
40559var _lodash = __webpack_require__(54);
40560
40561var _lodash2 = _interopRequireDefault(_lodash);
40562
40563var _classname = __webpack_require__(55);
40564
40565var _classname2 = _interopRequireDefault(_classname);
40566
40567var _DOMHelper = __webpack_require__(56);
40568
40569var _DOMHelper2 = _interopRequireDefault(_DOMHelper);
40570
40571var _ScrollArea = __webpack_require__(196);
40572
40573var _ScrollArea2 = _interopRequireDefault(_ScrollArea);
40574
40575var _Track = __webpack_require__(199);
40576
40577var _Track2 = _interopRequireDefault(_Track);
40578
40579var _Overflow = __webpack_require__(205);
40580
40581var _Overflow2 = _interopRequireDefault(_Overflow);
40582
40583var _Inner = __webpack_require__(206);
40584
40585var _Inner2 = _interopRequireDefault(_Inner);
40586
40587function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
40588
40589function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
40590
40591function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
40592
40593function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
40594
40595var ScrollArea = function (_Component) {
40596 _inherits(ScrollArea, _Component);
40597
40598 function ScrollArea(props) {
40599 _classCallCheck(this, ScrollArea);
40600
40601 var _this = _possibleConstructorReturn(this, (ScrollArea.__proto__ || Object.getPrototypeOf(ScrollArea)).call(this, props));
40602
40603 _this.state = {
40604 trackActive: props.trackVisible,
40605 innerMargin: -1,
40606 innerHeight: 0,
40607 outerHeight: 0,
40608 isDragging: false
40609 };
40610
40611 _this.references = {};
40612 return _this;
40613 }
40614
40615 _createClass(ScrollArea, [{
40616 key: 'componentDidMount',
40617 value: function componentDidMount() {
40618 this.validateProps(); //It throws
40619 this.onResize();
40620 }
40621 }, {
40622 key: 'componentDidUpdate',
40623 value: function componentDidUpdate() {
40624 if (this.getInnerHeight() !== this.state.innerHeight) {
40625 this.onResize();
40626 }
40627 }
40628 }, {
40629 key: 'componentWillUnmount',
40630 value: function componentWillUnmount() {
40631 clearTimeout(this.scrollTrackVisibleTimeout);
40632 }
40633 }, {
40634 key: 'validateProps',
40635 value: function validateProps() {
40636 if (this.props.width && !/^([0-9]+)(%|px)?$/.test(this.props.width)) {
40637 throw new TypeError('Invalid width, must be a numeric or percentage.');
40638 }
40639
40640 if (this.props.height && !/^([0-9]+)(%|px)?$/.test(this.props.height)) {
40641 throw new TypeError('Invalid height, must be a numeric or percentage.');
40642 }
40643 }
40644 }, {
40645 key: 'getOuterWidth',
40646 value: function getOuterWidth() {
40647 var width = this.props.width,
40648 isPercentage = /%/.test(width);
40649
40650 if (isPercentage) {
40651 var percentage = parseInt(width, 10) / 100;
40652
40653 return process.env.NODE_ENV === 'testing' ? this.props.testParentWidth * percentage : _DOMHelper2.default.getWidth(this.references.outer) * percentage;
40654 }
40655
40656 return parseInt(this.props.width || _DOMHelper2.default.getWidth(this.references.outer) || 0, 10);
40657 }
40658 }, {
40659 key: 'getOuterHeight',
40660 value: function getOuterHeight() {
40661 var height = this.props.height,
40662 isPercentage = /%/.test(height);
40663
40664 if (isPercentage) {
40665 var percentage = parseInt(height, 10) / 100;
40666
40667 return process.env.NODE_ENV === 'testing' ? this.props.testParentHeight * percentage : _DOMHelper2.default.getHeight(this.references.outer) * percentage;
40668 }
40669
40670 return parseInt(this.props.height || _DOMHelper2.default.getHeight(this.references.outer) || 0, 10);
40671 }
40672 }, {
40673 key: 'getInnerHeight',
40674 value: function getInnerHeight() {
40675 return process.env.NODE_ENV === 'testing' ? this.props.testInnerHeight : _DOMHelper2.default.getHeight(this.references.inner.node);
40676 }
40677 }, {
40678 key: 'getInnerMargin',
40679 value: function getInnerMargin() {
40680 var outer = this.references.outer,
40681 inner = this.references.inner.node;
40682
40683 if (!inner.offsetWidth || !outer.offsetWidth) {
40684 return -1;
40685 }
40686
40687 return inner.offsetWidth - outer.offsetWidth - 1;
40688 }
40689 }, {
40690 key: 'getScrollTop',
40691 value: function getScrollTop() {
40692 var target = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.references.overflow;
40693
40694 return target && target.node.scrollTop || 0;
40695 }
40696 }, {
40697 key: 'isTrackNeedEvents',
40698 value: function isTrackNeedEvents() {
40699 return !this.props.trackHidden && !this.props.trackVisible && this.getInnerHeight() > this.state.outerHeight;
40700 }
40701 }, {
40702 key: 'onResize',
40703 value: function onResize() {
40704 var state = {
40705 innerHeight: this.getInnerHeight(),
40706 outerHeight: this.getOuterHeight()
40707 };
40708
40709 if (this.state.innerMargin === -1) {
40710 state.innerMargin = this.getInnerMargin();
40711 }
40712
40713 this.setState(state);
40714 }
40715 }, {
40716 key: 'onWheel',
40717 value: function onWheel(event) {
40718 var scrollTop = this.getScrollTop(),
40719 innerHeight = this.getInnerHeight(),
40720 outerHeight = this.getOuterHeight();
40721
40722 if (!_DOMHelper2.default.isChildOf(event.target, this.references.outer, true)) {
40723 return;
40724 }
40725
40726 if (event.deltaY > 0 && scrollTop >= innerHeight - outerHeight || event.deltaY < 0 && scrollTop === 0) {
40727 event.stopPropagation();
40728 event.preventDefault();
40729 }
40730 }
40731 }, {
40732 key: 'onScroll',
40733 value: function onScroll() {
40734 if (!this.isTrackNeedEvents()) {
40735 this.forceUpdate();
40736 return;
40737 }
40738
40739 if (this.props.onScroll) {
40740 var data = {
40741 scrollTop: this.getScrollTop(),
40742 innerHeight: this.getInnerHeight(),
40743 outerHeight: this.getOuterHeight()
40744 };
40745 data.complete = (data.scrollTop + data.outerHeight) / data.innerHeight;
40746
40747 this.props.onScroll(data, this);
40748 }
40749
40750 this.forceUpdate();
40751 }
40752 }, {
40753 key: 'onMouseEnter',
40754 value: function onMouseEnter() {
40755 if (!this.isTrackNeedEvents()) {
40756 return;
40757 }
40758
40759 clearTimeout(this.scrollTrackVisibleTimeout);
40760 this.setState({ trackActive: true });
40761 }
40762 }, {
40763 key: 'onMouseLeave',
40764 value: function onMouseLeave() {
40765 if (!this.isTrackNeedEvents() || this.state.isDragging) {
40766 return;
40767 }
40768
40769 this.hideTrack();
40770 }
40771 }, {
40772 key: 'onMouseDown',
40773 value: function onMouseDown(event) {
40774 var offset = this.references.track.getOffset();
40775
40776 if (event.pageX < offset.left || !this.state.trackHover) {
40777 return;
40778 }
40779
40780 this.setState({
40781 isDragging: true,
40782 trackActive: !this.props.trackHidden,
40783 startY: event.pageY,
40784 originalY: this.references.track.getHeight() * (this.getScrollTop() / this.state.innerHeight)
40785 });
40786
40787 this.onMouseMoveFn = this.onMouseMove.bind(this);
40788 this.onMouseUpFn = this.onMouseUp.bind(this);
40789 window.addEventListener('mousemove', this.onMouseMoveFn, false);
40790 window.addEventListener('mouseup', this.onMouseUpFn, false);
40791 }
40792 }, {
40793 key: 'onMouseUp',
40794 value: function onMouseUp(event) {
40795 this.setState({
40796 isDragging: false,
40797 trackHover: false
40798 });
40799
40800 _DOMHelper2.default.ignoreSelection();
40801
40802 if (!_DOMHelper2.default.isChildOf(event.target, this.references.outer) && this.isTrackNeedEvents()) {
40803 this.hideTrack();
40804 }
40805
40806 window.removeEventListener('mouseup', this.onMouseUpFn);
40807 window.removeEventListener('mousemove', this.onMouseMoveFn);
40808 }
40809 }, {
40810 key: 'onMouseMove',
40811 value: function onMouseMove(event) {
40812 if (!this.state.isDragging) {
40813 return;
40814 }
40815
40816 var deltaY = event.pageY - this.state.startY,
40817 offsetY = this.state.originalY + deltaY;
40818
40819 _DOMHelper2.default.ignoreSelection();
40820
40821 this.references.overflow.node.scrollTop = Math.max(Math.min(Math.floor(offsetY * (this.state.innerHeight / (this.state.outerHeight - this.props.trackMargin))), this.state.innerHeight - this.state.outerHeight), 0);
40822 }
40823 }, {
40824 key: 'onMouseMoveHover',
40825 value: function onMouseMoveHover(event) {
40826 if (this.state.isDragging || !this.state.trackActive) {
40827 return;
40828 }
40829
40830 var offset = this.references.track.getOffset(),
40831 trackHover = event.pageX > offset.left;
40832
40833 this.setState({ trackHover: trackHover });
40834 }
40835 }, {
40836 key: 'hideTrack',
40837 value: function hideTrack() {
40838 var _this2 = this;
40839
40840 if (!this.props.trackHideTime) {
40841 this.setState({ trackActive: false });
40842 return;
40843 }
40844
40845 this.scrollTrackVisibleTimeout = _lodash2.default.delay(function () {
40846 _this2.setState({ trackActive: false });
40847 }, this.props.trackHideTime);
40848 }
40849 }, {
40850 key: 'triggerScroll',
40851 value: function triggerScroll() {
40852 this.onScroll();
40853 return this;
40854 }
40855 }, {
40856 key: 'goToPos',
40857 value: function goToPos(scrollTop) {
40858 var duration = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
40859
40860 var overflow = this.references.overflow.node;
40861
40862 duration ? _DOMHelper2.default.scrollTo(overflow, scrollTop, duration) : overflow.scrollTop = scrollTop;
40863
40864 return this;
40865 }
40866 }, {
40867 key: 'goToTop',
40868 value: function goToTop() {
40869 var duration = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
40870
40871 return this.goToPos(0, duration);
40872 }
40873 }, {
40874 key: 'goToBottom',
40875 value: function goToBottom() {
40876 var duration = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
40877
40878 return this.goToPos(this.state.innerHeight - this.state.outerHeight, duration);
40879 }
40880 }, {
40881 key: 'render',
40882 value: function render() {
40883 var _this3 = this;
40884
40885 return _react2.default.createElement(
40886 'div',
40887 {
40888 ref: function ref(r) {
40889 return _this3.references.outer = r;
40890 },
40891 style: {
40892 width: this.props.width,
40893 height: this.props.height
40894 },
40895 className: (0, _classname2.default)(_ScrollArea2.default.outer, this.props.className),
40896 onMouseEnter: this.onMouseEnter.bind(this),
40897 onMouseLeave: this.onMouseLeave.bind(this),
40898 onMouseDown: this.onMouseDown.bind(this),
40899 onMouseMove: this.onMouseMoveHover.bind(this)
40900 },
40901 _react2.default.createElement(
40902 _Overflow2.default,
40903 {
40904 ref: function ref(r) {
40905 return _this3.references.overflow = r;
40906 },
40907 className: (0, _classname2.default)(_ScrollArea2.default.overflow, this.props.overflowClassName),
40908 onScroll: this.onScroll.bind(this),
40909 onWheel: this.onWheel.bind(this)
40910 },
40911 _react2.default.createElement(
40912 _Inner2.default,
40913 {
40914 ref: function ref(r) {
40915 return _this3.references.inner = r;
40916 },
40917 className: (0, _classname2.default)(_ScrollArea2.default.inner, this.props.innerClassName),
40918 innerMargin: this.state.innerMargin
40919 },
40920 this.props.children
40921 )
40922 ),
40923 _react2.default.createElement(_Track2.default, {
40924 ref: function ref(r) {
40925 return _this3.references.track = r;
40926 },
40927
40928 className: this.props.trackClassName,
40929 handlerClassName: this.props.handlerClassName,
40930
40931 isActive: this.state.trackActive,
40932 isDragging: this.state.isDragging,
40933 isHover: this.state.trackHover,
40934 margin: this.props.trackMargin,
40935 minHandlerHeight: this.props.minHandlerHeight,
40936 scrollTop: this.getScrollTop(),
40937 outerWidth: this.getOuterWidth(),
40938 outerHeight: this.state.outerHeight,
40939 innerHeight: this.state.innerHeight
40940 })
40941 );
40942 }
40943 }]);
40944
40945 return ScrollArea;
40946}(_react.Component);
40947
40948ScrollArea.propTypes = {
40949 width: _propTypes2.default.oneOfType([_propTypes2.default.number, _propTypes2.default.string]),
40950 height: _propTypes2.default.oneOfType([_propTypes2.default.number, _propTypes2.default.string]),
40951
40952 trackVisible: _propTypes2.default.bool,
40953 trackHidden: _propTypes2.default.bool,
40954 trackHideTime: _propTypes2.default.number,
40955 minHandlerHeight: _propTypes2.default.number,
40956 trackMargin: _propTypes2.default.number,
40957 onScroll: _propTypes2.default.func,
40958 children: _propTypes2.default.node,
40959
40960 className: _propTypes2.default.string,
40961 innerClassName: _propTypes2.default.string,
40962 overflowClassName: _propTypes2.default.string,
40963 trackClassName: _propTypes2.default.string,
40964 handlerClassName: _propTypes2.default.string,
40965
40966 //for testing purpose
40967 testInnerHeight: _propTypes2.default.number,
40968 testParentWidth: _propTypes2.default.number,
40969 testParentHeight: _propTypes2.default.number
40970};
40971ScrollArea.defaultProps = {
40972 trackVisible: false,
40973 trackHidden: false,
40974 trackHideTime: 1000,
40975 minHandlerHeight: 70,
40976 trackMargin: 4,
40977
40978 className: '',
40979 innerClassName: '',
40980 overflowClassName: '',
40981 trackClassName: '',
40982 handlerClassName: '',
40983
40984 //for testing purpose
40985 testInnerHeight: 0,
40986 testParentWidth: 0,
40987 testParentHeight: 0
40988};
40989exports.default = ScrollArea;
40990/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
40991
40992/***/ }),
40993/* 195 */
40994/***/ (function(module, exports, __webpack_require__) {
40995
40996"use strict";
40997/**
40998 * Copyright 2013-present, Facebook, Inc.
40999 * All rights reserved.
41000 *
41001 * This source code is licensed under the BSD-style license found in the
41002 * LICENSE file in the root directory of this source tree. An additional grant
41003 * of patent rights can be found in the PATENTS file in the same directory.
41004 */
41005
41006
41007
41008var emptyFunction = __webpack_require__(8);
41009var invariant = __webpack_require__(1);
41010var ReactPropTypesSecret = __webpack_require__(37);
41011
41012module.exports = function() {
41013 function shim(props, propName, componentName, location, propFullName, secret) {
41014 if (secret === ReactPropTypesSecret) {
41015 // It is still safe when called from React.
41016 return;
41017 }
41018 invariant(
41019 false,
41020 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
41021 'Use PropTypes.checkPropTypes() to call them. ' +
41022 'Read more at http://fb.me/use-check-prop-types'
41023 );
41024 };
41025 shim.isRequired = shim;
41026 function getShim() {
41027 return shim;
41028 };
41029 // Important!
41030 // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
41031 var ReactPropTypes = {
41032 array: shim,
41033 bool: shim,
41034 func: shim,
41035 number: shim,
41036 object: shim,
41037 string: shim,
41038 symbol: shim,
41039
41040 any: shim,
41041 arrayOf: getShim,
41042 element: shim,
41043 instanceOf: getShim,
41044 node: shim,
41045 objectOf: getShim,
41046 oneOf: getShim,
41047 oneOfType: getShim,
41048 shape: getShim
41049 };
41050
41051 ReactPropTypes.checkPropTypes = emptyFunction;
41052 ReactPropTypes.PropTypes = ReactPropTypes;
41053
41054 return ReactPropTypes;
41055};
41056
41057
41058/***/ }),
41059/* 196 */
41060/***/ (function(module, exports, __webpack_require__) {
41061
41062// style-loader: Adds some css to the DOM by adding a <style> tag
41063
41064// load the styles
41065var content = __webpack_require__(197);
41066if(typeof content === 'string') content = [[module.i, content, '']];
41067// Prepare cssTransformation
41068var transform;
41069
41070var options = {}
41071options.transform = transform
41072// add the styles to the DOM
41073var update = __webpack_require__(35)(content, options);
41074if(content.locals) module.exports = content.locals;
41075// Hot Module Replacement
41076if(false) {
41077 // When the styles change, update the <style> tags
41078 if(!content.locals) {
41079 module.hot.accept("!!../../node_modules/css-loader/index.js?importLoaders=1&modules!./ScrollArea.css", function() {
41080 var newContent = require("!!../../node_modules/css-loader/index.js?importLoaders=1&modules!./ScrollArea.css");
41081 if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
41082 update(newContent);
41083 });
41084 }
41085 // When the module is disposed, remove the <style> tags
41086 module.hot.dispose(function() { update(); });
41087}
41088
41089/***/ }),
41090/* 197 */
41091/***/ (function(module, exports, __webpack_require__) {
41092
41093exports = module.exports = __webpack_require__(34)(undefined);
41094// imports
41095
41096
41097// module
41098exports.push([module.i, "._37v-ohCwyBfAV_UWLutqvt {\n overflow: hidden;\n position: relative;\n\n width: 100%;\n height: 100%;\n}\n\n._3EGckgmDcNF_cmTkdQxSfY {\n position: relative;\n overflow-y: scroll;\n overflow-x: hidden;\n\n height: 100%;\n\n margin-right: -30px;\n padding-right: 30px;\n}\n\n._34zZxEHnIKZuv9SFSUwueU {\n position: relative;\n}\n\n._34zZxEHnIKZuv9SFSUwueU:before,\n._34zZxEHnIKZuv9SFSUwueU:after {\n content: \" \";\n display: table;\n}\n\n ._34zZxEHnIKZuv9SFSUwueU:after {\n clear: both;\n}\n", ""]);
41099
41100// exports
41101exports.locals = {
41102 "outer": "_37v-ohCwyBfAV_UWLutqvt",
41103 "overflow": "_3EGckgmDcNF_cmTkdQxSfY",
41104 "inner": "_34zZxEHnIKZuv9SFSUwueU"
41105};
41106
41107/***/ }),
41108/* 198 */
41109/***/ (function(module, exports) {
41110
41111
41112/**
41113 * When source maps are enabled, `style-loader` uses a link element with a data-uri to
41114 * embed the css on the page. This breaks all relative urls because now they are relative to a
41115 * bundle instead of the current page.
41116 *
41117 * One solution is to only use full urls, but that may be impossible.
41118 *
41119 * Instead, this function "fixes" the relative urls to be absolute according to the current page location.
41120 *
41121 * A rudimentary test suite is located at `test/fixUrls.js` and can be run via the `npm test` command.
41122 *
41123 */
41124
41125module.exports = function (css) {
41126 // get current location
41127 var location = typeof window !== "undefined" && window.location;
41128
41129 if (!location) {
41130 throw new Error("fixUrls requires window.location");
41131 }
41132
41133 // blank or null?
41134 if (!css || typeof css !== "string") {
41135 return css;
41136 }
41137
41138 var baseUrl = location.protocol + "//" + location.host;
41139 var currentDir = baseUrl + location.pathname.replace(/\/[^\/]*$/, "/");
41140
41141 // convert each url(...)
41142 /*
41143 This regular expression is just a way to recursively match brackets within
41144 a string.
41145
41146 /url\s*\( = Match on the word "url" with any whitespace after it and then a parens
41147 ( = Start a capturing group
41148 (?: = Start a non-capturing group
41149 [^)(] = Match anything that isn't a parentheses
41150 | = OR
41151 \( = Match a start parentheses
41152 (?: = Start another non-capturing groups
41153 [^)(]+ = Match anything that isn't a parentheses
41154 | = OR
41155 \( = Match a start parentheses
41156 [^)(]* = Match anything that isn't a parentheses
41157 \) = Match a end parentheses
41158 ) = End Group
41159 *\) = Match anything and then a close parens
41160 ) = Close non-capturing group
41161 * = Match anything
41162 ) = Close capturing group
41163 \) = Match a close parens
41164
41165 /gi = Get all matches, not the first. Be case insensitive.
41166 */
41167 var fixedCss = css.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi, function(fullMatch, origUrl) {
41168 // strip quotes (if they exist)
41169 var unquotedOrigUrl = origUrl
41170 .trim()
41171 .replace(/^"(.*)"$/, function(o, $1){ return $1; })
41172 .replace(/^'(.*)'$/, function(o, $1){ return $1; });
41173
41174 // already a full url? no change
41175 if (/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/)/i.test(unquotedOrigUrl)) {
41176 return fullMatch;
41177 }
41178
41179 // convert the url to a full url
41180 var newUrl;
41181
41182 if (unquotedOrigUrl.indexOf("//") === 0) {
41183 //TODO: should we add protocol?
41184 newUrl = unquotedOrigUrl;
41185 } else if (unquotedOrigUrl.indexOf("/") === 0) {
41186 // path should be relative to the base url
41187 newUrl = baseUrl + unquotedOrigUrl; // already starts with '/'
41188 } else {
41189 // path should be relative to current directory
41190 newUrl = currentDir + unquotedOrigUrl.replace(/^\.\//, ""); // Strip leading './'
41191 }
41192
41193 // send back the fixed url(...)
41194 return "url(" + JSON.stringify(newUrl) + ")";
41195 });
41196
41197 // send back the fixed css
41198 return fixedCss;
41199};
41200
41201
41202/***/ }),
41203/* 199 */
41204/***/ (function(module, exports, __webpack_require__) {
41205
41206"use strict";
41207/* WEBPACK VAR INJECTION */(function(process) {
41208
41209Object.defineProperty(exports, "__esModule", {
41210 value: true
41211});
41212exports.style = undefined;
41213
41214var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
41215
41216var _react = __webpack_require__(14);
41217
41218var _react2 = _interopRequireDefault(_react);
41219
41220var _propTypes = __webpack_require__(25);
41221
41222var _propTypes2 = _interopRequireDefault(_propTypes);
41223
41224var _classname = __webpack_require__(55);
41225
41226var _classname2 = _interopRequireDefault(_classname);
41227
41228var _Handler = __webpack_require__(200);
41229
41230var _Handler2 = _interopRequireDefault(_Handler);
41231
41232var _Track = __webpack_require__(203);
41233
41234var _Track2 = _interopRequireDefault(_Track);
41235
41236var _DOMHelper = __webpack_require__(56);
41237
41238var _DOMHelper2 = _interopRequireDefault(_DOMHelper);
41239
41240function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
41241
41242function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
41243
41244function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
41245
41246function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
41247
41248function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
41249
41250exports.style = _Track2.default;
41251
41252var Track = function (_Component) {
41253 _inherits(Track, _Component);
41254
41255 function Track(props) {
41256 _classCallCheck(this, Track);
41257
41258 var _this = _possibleConstructorReturn(this, (Track.__proto__ || Object.getPrototypeOf(Track)).call(this, props));
41259
41260 _this.state = {};
41261 _this.references = {};
41262 return _this;
41263 }
41264
41265 _createClass(Track, [{
41266 key: 'getHeight',
41267 value: function getHeight() {
41268 return this.props.outerHeight - this.props.margin;
41269 }
41270 }, {
41271 key: 'getOffset',
41272 value: function getOffset() {
41273 var offset = _DOMHelper2.default.offset(this.references.track);
41274
41275 if (process.env.NODE_ENV === 'testing') {
41276 offset = { top: 0, left: this.props.outerWidth - 5 };
41277 }
41278
41279 return offset;
41280 }
41281 }, {
41282 key: 'render',
41283 value: function render() {
41284 var _this2 = this,
41285 _className;
41286
41287 return _react2.default.createElement(
41288 'div',
41289 {
41290 ref: function ref(r) {
41291 return _this2.references.track = r;
41292 },
41293 className: (0, _classname2.default)((_className = {}, _defineProperty(_className, _Track2.default.track, true), _defineProperty(_className, this.props.className, true), _defineProperty(_className, _Track2.default.hidden, !this.props.isActive), _className)),
41294 style: {
41295 top: this.props.margin / 2,
41296 height: this.getHeight()
41297 }
41298 },
41299 _react2.default.createElement(_Handler2.default, {
41300 ref: function ref(r) {
41301 return _this2.references.handler = r;
41302 },
41303 className: this.props.handlerClassName,
41304 scrollTop: this.props.scrollTop,
41305 outerWidth: this.props.outerWidth,
41306 outerHeight: this.getHeight(),
41307 innerHeight: this.props.innerHeight,
41308 minHeight: this.props.minHandlerHeight,
41309 isDragging: this.props.isDragging,
41310 isHover: this.props.isHover
41311 })
41312 );
41313 }
41314 }]);
41315
41316 return Track;
41317}(_react.Component);
41318
41319Track.propTypes = {
41320 className: _propTypes2.default.string,
41321 handlerClassName: _propTypes2.default.string,
41322 margin: _propTypes2.default.number,
41323 isActive: _propTypes2.default.bool,
41324 isDragging: _propTypes2.default.bool,
41325 isHover: _propTypes2.default.bool,
41326 minHandlerHeight: _propTypes2.default.number,
41327 scrollTop: _propTypes2.default.number,
41328 outerWidth: _propTypes2.default.number,
41329 outerHeight: _propTypes2.default.number,
41330 innerHeight: _propTypes2.default.number
41331};
41332Track.defaultProps = {
41333 className: ''
41334};
41335exports.default = Track;
41336/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
41337
41338/***/ }),
41339/* 200 */
41340/***/ (function(module, exports, __webpack_require__) {
41341
41342"use strict";
41343/* WEBPACK VAR INJECTION */(function(process) {
41344
41345Object.defineProperty(exports, "__esModule", {
41346 value: true
41347});
41348exports.style = undefined;
41349
41350var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
41351
41352var _react = __webpack_require__(14);
41353
41354var _react2 = _interopRequireDefault(_react);
41355
41356var _propTypes = __webpack_require__(25);
41357
41358var _propTypes2 = _interopRequireDefault(_propTypes);
41359
41360var _classname = __webpack_require__(55);
41361
41362var _classname2 = _interopRequireDefault(_classname);
41363
41364var _Handler = __webpack_require__(201);
41365
41366var _Handler2 = _interopRequireDefault(_Handler);
41367
41368var _DOMHelper = __webpack_require__(56);
41369
41370var _DOMHelper2 = _interopRequireDefault(_DOMHelper);
41371
41372function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
41373
41374function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
41375
41376function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
41377
41378function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
41379
41380function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
41381
41382exports.style = _Handler2.default;
41383
41384var Handler = function (_Component) {
41385 _inherits(Handler, _Component);
41386
41387 function Handler(props) {
41388 _classCallCheck(this, Handler);
41389
41390 var _this = _possibleConstructorReturn(this, (Handler.__proto__ || Object.getPrototypeOf(Handler)).call(this, props));
41391
41392 _this.references = {};
41393 return _this;
41394 }
41395
41396 _createClass(Handler, [{
41397 key: 'getRatio',
41398 value: function getRatio() {
41399 var innerHeight = this.props.innerHeight,
41400 outerHeight = this.props.outerHeight;
41401
41402 if (!innerHeight || !outerHeight) {
41403 return 0;
41404 }
41405
41406 return innerHeight / outerHeight;
41407 }
41408 }, {
41409 key: 'getHeight',
41410 value: function getHeight() {
41411 if (!this.props.outerHeight) {
41412 return 0;
41413 }
41414
41415 return Math.min(Math.max(this.getMinHeight(), Math.round(this.props.outerHeight / this.getRatio())), this.props.outerHeight);
41416 }
41417 }, {
41418 key: 'getMinHeight',
41419 value: function getMinHeight() {
41420 return Math.min(this.props.outerHeight, this.props.minHeight);
41421 }
41422 }, {
41423 key: 'getTop',
41424 value: function getTop() {
41425 var scrollTop = this.props.scrollTop,
41426 innerHeight = this.props.innerHeight,
41427 trackHeight = this.props.outerHeight,
41428 handlerHeight = this.getHeight();
41429
41430 if (handlerHeight === this.getMinHeight()) {
41431 if (!trackHeight) {
41432 return 0;
41433 }
41434
41435 return (trackHeight - handlerHeight) * (scrollTop / (innerHeight - trackHeight));
41436 }
41437
41438 if (!scrollTop) {
41439 return 0;
41440 }
41441
41442 return Math.round(scrollTop / this.getRatio());
41443 }
41444 }, {
41445 key: 'getOffset',
41446 value: function getOffset() {
41447 var offset = _DOMHelper2.default.offset(this.references.handler);
41448
41449 if (process.env.NODE_ENV === 'testing') {
41450 offset = { top: 0, left: this.props.outerWidth - 5 };
41451 }
41452
41453 return offset;
41454 }
41455 }, {
41456 key: 'render',
41457 value: function render() {
41458 var _this2 = this,
41459 _className;
41460
41461 return _react2.default.createElement('div', {
41462 ref: function ref(r) {
41463 return _this2.references.handler = r;
41464 },
41465 className: (0, _classname2.default)((_className = {}, _defineProperty(_className, _Handler2.default.handler, true), _defineProperty(_className, _Handler2.default.dragging, this.props.isDragging), _defineProperty(_className, _Handler2.default.hover, this.props.isHover), _defineProperty(_className, this.props.className, true), _className)),
41466 style: {
41467 height: this.getHeight(),
41468 top: this.getTop()
41469 }
41470 });
41471 }
41472 }]);
41473
41474 return Handler;
41475}(_react.Component);
41476
41477Handler.propTypes = {
41478 className: _propTypes2.default.string,
41479 isDragging: _propTypes2.default.bool,
41480 isHover: _propTypes2.default.bool,
41481 minHeight: _propTypes2.default.number,
41482
41483 scrollTop: _propTypes2.default.number,
41484 outerWidth: _propTypes2.default.number,
41485 outerHeight: _propTypes2.default.number,
41486 innerHeight: _propTypes2.default.number
41487};
41488Handler.defaultProps = {
41489 className: ''
41490};
41491exports.default = Handler;
41492/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
41493
41494/***/ }),
41495/* 201 */
41496/***/ (function(module, exports, __webpack_require__) {
41497
41498// style-loader: Adds some css to the DOM by adding a <style> tag
41499
41500// load the styles
41501var content = __webpack_require__(202);
41502if(typeof content === 'string') content = [[module.i, content, '']];
41503// Prepare cssTransformation
41504var transform;
41505
41506var options = {}
41507options.transform = transform
41508// add the styles to the DOM
41509var update = __webpack_require__(35)(content, options);
41510if(content.locals) module.exports = content.locals;
41511// Hot Module Replacement
41512if(false) {
41513 // When the styles change, update the <style> tags
41514 if(!content.locals) {
41515 module.hot.accept("!!../../node_modules/css-loader/index.js?importLoaders=1&modules!./Handler.css", function() {
41516 var newContent = require("!!../../node_modules/css-loader/index.js?importLoaders=1&modules!./Handler.css");
41517 if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
41518 update(newContent);
41519 });
41520 }
41521 // When the module is disposed, remove the <style> tags
41522 module.hot.dispose(function() { update(); });
41523}
41524
41525/***/ }),
41526/* 202 */
41527/***/ (function(module, exports, __webpack_require__) {
41528
41529exports = module.exports = __webpack_require__(34)(undefined);
41530// imports
41531
41532
41533// module
41534exports.push([module.i, "._1Y841HBakNfExDIHJer1y3 {\n position: absolute;\n top: 0px; left: -1px;\n width: 7px; height: 50px;\n\n background: #d7d7d7;\n border-radius: 4px;\n\n transition: background .2s linear;\n -webkit-transition: background .4s linear;\n -moz-transition: background .2s linear;\n -ms-transition: background .2s linear;\n -o-transition: background .2s linear;\n}\n\n._2edsf-nJOzMp_uPPUyjaas, ._3Cd157NtzF25HdI40gEa8C {\n background: #909090;\n}\n", ""]);
41535
41536// exports
41537exports.locals = {
41538 "handler": "_1Y841HBakNfExDIHJer1y3",
41539 "hover": "_2edsf-nJOzMp_uPPUyjaas",
41540 "dragging": "_3Cd157NtzF25HdI40gEa8C"
41541};
41542
41543/***/ }),
41544/* 203 */
41545/***/ (function(module, exports, __webpack_require__) {
41546
41547// style-loader: Adds some css to the DOM by adding a <style> tag
41548
41549// load the styles
41550var content = __webpack_require__(204);
41551if(typeof content === 'string') content = [[module.i, content, '']];
41552// Prepare cssTransformation
41553var transform;
41554
41555var options = {}
41556options.transform = transform
41557// add the styles to the DOM
41558var update = __webpack_require__(35)(content, options);
41559if(content.locals) module.exports = content.locals;
41560// Hot Module Replacement
41561if(false) {
41562 // When the styles change, update the <style> tags
41563 if(!content.locals) {
41564 module.hot.accept("!!../../node_modules/css-loader/index.js?importLoaders=1&modules!./Track.css", function() {
41565 var newContent = require("!!../../node_modules/css-loader/index.js?importLoaders=1&modules!./Track.css");
41566 if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
41567 update(newContent);
41568 });
41569 }
41570 // When the module is disposed, remove the <style> tags
41571 module.hot.dispose(function() { update(); });
41572}
41573
41574/***/ }),
41575/* 204 */
41576/***/ (function(module, exports, __webpack_require__) {
41577
41578exports = module.exports = __webpack_require__(34)(undefined);
41579// imports
41580
41581
41582// module
41583exports.push([module.i, ".UisIHLSNDazEJzAYBR5F3 {\n position: absolute;\n top: 0px; right: 2px;\n width: 7px;\n height: 100%;\n\n padding: 0;\n\n border-radius: 4px;\n\n opacity: 1;\n\n pointer-events: none;\n\n transition: opacity .4s linear;\n -webkit-transition: opacity .4s linear;\n -moz-transition: opacity .4s linear;\n -ms-transition: opacity .4s linear;\n -o-transition: opacity .4s linear;\n}\n\n.ZW_yWyX03kZuljUcD63zL {\n opacity: 0;\n}\n", ""]);
41584
41585// exports
41586exports.locals = {
41587 "track": "UisIHLSNDazEJzAYBR5F3",
41588 "hidden": "ZW_yWyX03kZuljUcD63zL"
41589};
41590
41591/***/ }),
41592/* 205 */
41593/***/ (function(module, exports, __webpack_require__) {
41594
41595"use strict";
41596
41597
41598Object.defineProperty(exports, "__esModule", {
41599 value: true
41600});
41601
41602var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
41603
41604var _react = __webpack_require__(14);
41605
41606var _react2 = _interopRequireDefault(_react);
41607
41608var _propTypes = __webpack_require__(25);
41609
41610var _propTypes2 = _interopRequireDefault(_propTypes);
41611
41612function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
41613
41614function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
41615
41616function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
41617
41618function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
41619
41620var Overflow = function (_Component) {
41621 _inherits(Overflow, _Component);
41622
41623 function Overflow() {
41624 _classCallCheck(this, Overflow);
41625
41626 return _possibleConstructorReturn(this, (Overflow.__proto__ || Object.getPrototypeOf(Overflow)).apply(this, arguments));
41627 }
41628
41629 _createClass(Overflow, [{
41630 key: 'render',
41631 value: function render() {
41632 var _this2 = this;
41633
41634 return _react2.default.createElement(
41635 'div',
41636 {
41637 ref: function ref(r) {
41638 return _this2.node = r;
41639 },
41640 className: this.props.className,
41641 onScroll: this.props.onScroll,
41642 onWheel: this.props.onWheel
41643 },
41644 this.props.children
41645 );
41646 }
41647 }]);
41648
41649 return Overflow;
41650}(_react.Component);
41651
41652Overflow.propTypes = {
41653 className: _propTypes2.default.string,
41654 onScroll: _propTypes2.default.func,
41655 onWheel: _propTypes2.default.func,
41656 children: _propTypes2.default.element
41657};
41658exports.default = Overflow;
41659
41660/***/ }),
41661/* 206 */
41662/***/ (function(module, exports, __webpack_require__) {
41663
41664"use strict";
41665
41666
41667Object.defineProperty(exports, "__esModule", {
41668 value: true
41669});
41670
41671var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
41672
41673var _react = __webpack_require__(14);
41674
41675var _react2 = _interopRequireDefault(_react);
41676
41677var _propTypes = __webpack_require__(25);
41678
41679var _propTypes2 = _interopRequireDefault(_propTypes);
41680
41681function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
41682
41683function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
41684
41685function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
41686
41687function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
41688
41689var Inner = function (_Component) {
41690 _inherits(Inner, _Component);
41691
41692 function Inner() {
41693 _classCallCheck(this, Inner);
41694
41695 return _possibleConstructorReturn(this, (Inner.__proto__ || Object.getPrototypeOf(Inner)).apply(this, arguments));
41696 }
41697
41698 _createClass(Inner, [{
41699 key: 'render',
41700 value: function render() {
41701 var _this2 = this;
41702
41703 return _react2.default.createElement(
41704 'div',
41705 {
41706 ref: function ref(r) {
41707 return _this2.node = r;
41708 },
41709 className: this.props.className,
41710 style: { marginRight: this.props.innerMargin }
41711 },
41712 this.props.children
41713 );
41714 }
41715 }]);
41716
41717 return Inner;
41718}(_react.Component);
41719
41720Inner.propTypes = {
41721 innerMargin: _propTypes2.default.number,
41722 className: _propTypes2.default.string,
41723 children: _propTypes2.default.node
41724};
41725exports.default = Inner;
41726
41727/***/ }),
41728/* 207 */
41729/***/ (function(module, exports, __webpack_require__) {
41730
41731// style-loader: Adds some css to the DOM by adding a <style> tag
41732
41733// load the styles
41734var content = __webpack_require__(208);
41735if(typeof content === 'string') content = [[module.i, content, '']];
41736// Prepare cssTransformation
41737var transform;
41738
41739var options = {}
41740options.transform = transform
41741// add the styles to the DOM
41742var update = __webpack_require__(35)(content, options);
41743if(content.locals) module.exports = content.locals;
41744// Hot Module Replacement
41745if(false) {
41746 // When the styles change, update the <style> tags
41747 if(!content.locals) {
41748 module.hot.accept("!!../../node_modules/css-loader/index.js?importLoaders=1&modules!./App.css", function() {
41749 var newContent = require("!!../../node_modules/css-loader/index.js?importLoaders=1&modules!./App.css");
41750 if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
41751 update(newContent);
41752 });
41753 }
41754 // When the module is disposed, remove the <style> tags
41755 module.hot.dispose(function() { update(); });
41756}
41757
41758/***/ }),
41759/* 208 */
41760/***/ (function(module, exports, __webpack_require__) {
41761
41762exports = module.exports = __webpack_require__(34)(undefined);
41763// imports
41764
41765
41766// module
41767exports.push([module.i, "._1mIKZJ1ppHXnAYj6-pmZFT {\n width: 100%; height: 100%;\n max-width: 980px;\n margin: auto;\n}\n\n._3aKkg-KkxDrpYUnnaj4t-q {\n margin-bottom: 40px;\n}\n\n._3aKkg-KkxDrpYUnnaj4t-q img {\n display: block;\n pointer-events: none;\n}\n\n._39ZFcwc_k_DRCHc2m9zYr- {\n width: 360px;\n height: 500px;\n background: #FFF;\n}\n", ""]);
41768
41769// exports
41770exports.locals = {
41771 "wrapper": "_1mIKZJ1ppHXnAYj6-pmZFT",
41772 "example": "_3aKkg-KkxDrpYUnnaj4t-q",
41773 "exampleContainer": "_39ZFcwc_k_DRCHc2m9zYr-"
41774};
41775
41776/***/ }),
41777/* 209 */
41778/***/ (function(module, exports, __webpack_require__) {
41779
41780module.exports = __webpack_require__.p + "example.png";
41781
41782/***/ }),
41783/* 210 */
41784/***/ (function(module, exports, __webpack_require__) {
41785
41786module.exports = __webpack_require__.p + "index.html";
41787
41788/***/ })
41789/******/ ]);
\No newline at end of file