UNPKG

592 kBJavaScriptView 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/******/ exports: {},
15/******/ id: moduleId,
16/******/ loaded: false
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.loaded = 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/******/ // __webpack_public_path__
37/******/ __webpack_require__.p = "";
38/******/
39/******/ // Load entry module and return exports
40/******/ return __webpack_require__(0);
41/******/ })
42/************************************************************************/
43/******/ ([
44/* 0 */
45/***/ function(module, exports, __webpack_require__) {
46
47 var React = __webpack_require__(1);
48
49 var FontAwesome = React.createClass({
50
51 propTypes: {
52 name: React.PropTypes.string.isRequired,
53 size: React.PropTypes.oneOf(['lg', '2x', '3x', '4x', '5x']),
54 spin: React.PropTypes.bool,
55 pulse: React.PropTypes.bool,
56 border: React.PropTypes.bool,
57 fixedWidth: React.PropTypes.bool,
58 inverse: React.PropTypes.bool,
59 flip: React.PropTypes.oneOf(['horizontal', 'vertical']),
60 rotate: React.PropTypes.oneOf(['90', '180', '270']),
61 stack: React.PropTypes.oneOf(['1x', '2x']),
62 },
63
64 render: function () {
65 var className = 'fa fa-' + this.props.name;
66
67 if (this.props.size) {
68 className += ' fa-' + this.props.size;
69 }
70
71 if (this.props.spin) {
72 className += ' fa-spin';
73 }
74
75 if (this.props.pulse) {
76 className += ' fa-pulse';
77 }
78
79 if (this.props.border) {
80 className += ' fa-border';
81 }
82
83 if (this.props.fixedWidth) {
84 className += ' fa-fw';
85 }
86
87 if (this.props.inverse) {
88 className += ' fa-inverse';
89 }
90
91 if (this.props.flip) {
92 className += ' fa-flip-' + this.props.flip;
93 }
94
95 if (this.props.rotate) {
96 className += ' fa-rotate-' + this.props.rotate;
97 }
98
99 if (this.props.stack) {
100 className += ' fa-stack-' + this.props.stack;
101 }
102
103 if (this.props.className) {
104 className += ' ' + this.props.className;
105 }
106
107 return React.createElement('span', { className: className });
108 }
109 });
110
111 module.exports = FontAwesome;
112
113
114/***/ },
115/* 1 */
116/***/ function(module, exports, __webpack_require__) {
117
118 module.exports = __webpack_require__(2);
119
120
121/***/ },
122/* 2 */
123/***/ function(module, exports, __webpack_require__) {
124
125 /* WEBPACK VAR INJECTION */(function(process) {/**
126 * Copyright 2013-2014, Facebook, Inc.
127 * All rights reserved.
128 *
129 * This source code is licensed under the BSD-style license found in the
130 * LICENSE file in the root directory of this source tree. An additional grant
131 * of patent rights can be found in the PATENTS file in the same directory.
132 *
133 * @providesModule React
134 */
135
136 "use strict";
137
138 var DOMPropertyOperations = __webpack_require__(3);
139 var EventPluginUtils = __webpack_require__(4);
140 var ReactChildren = __webpack_require__(5);
141 var ReactComponent = __webpack_require__(6);
142 var ReactCompositeComponent = __webpack_require__(7);
143 var ReactContext = __webpack_require__(8);
144 var ReactCurrentOwner = __webpack_require__(9);
145 var ReactElement = __webpack_require__(10);
146 var ReactElementValidator = __webpack_require__(11);
147 var ReactDOM = __webpack_require__(12);
148 var ReactDOMComponent = __webpack_require__(13);
149 var ReactDefaultInjection = __webpack_require__(14);
150 var ReactInstanceHandles = __webpack_require__(15);
151 var ReactLegacyElement = __webpack_require__(16);
152 var ReactMount = __webpack_require__(17);
153 var ReactMultiChild = __webpack_require__(18);
154 var ReactPerf = __webpack_require__(19);
155 var ReactPropTypes = __webpack_require__(20);
156 var ReactServerRendering = __webpack_require__(21);
157 var ReactTextComponent = __webpack_require__(22);
158
159 var assign = __webpack_require__(23);
160 var deprecated = __webpack_require__(24);
161 var onlyChild = __webpack_require__(25);
162
163 ReactDefaultInjection.inject();
164
165 var createElement = ReactElement.createElement;
166 var createFactory = ReactElement.createFactory;
167
168 if ("production" !== process.env.NODE_ENV) {
169 createElement = ReactElementValidator.createElement;
170 createFactory = ReactElementValidator.createFactory;
171 }
172
173 // TODO: Drop legacy elements once classes no longer export these factories
174 createElement = ReactLegacyElement.wrapCreateElement(
175 createElement
176 );
177 createFactory = ReactLegacyElement.wrapCreateFactory(
178 createFactory
179 );
180
181 var render = ReactPerf.measure('React', 'render', ReactMount.render);
182
183 var React = {
184 Children: {
185 map: ReactChildren.map,
186 forEach: ReactChildren.forEach,
187 count: ReactChildren.count,
188 only: onlyChild
189 },
190 DOM: ReactDOM,
191 PropTypes: ReactPropTypes,
192 initializeTouchEvents: function(shouldUseTouch) {
193 EventPluginUtils.useTouchEvents = shouldUseTouch;
194 },
195 createClass: ReactCompositeComponent.createClass,
196 createElement: createElement,
197 createFactory: createFactory,
198 constructAndRenderComponent: ReactMount.constructAndRenderComponent,
199 constructAndRenderComponentByID: ReactMount.constructAndRenderComponentByID,
200 render: render,
201 renderToString: ReactServerRendering.renderToString,
202 renderToStaticMarkup: ReactServerRendering.renderToStaticMarkup,
203 unmountComponentAtNode: ReactMount.unmountComponentAtNode,
204 isValidClass: ReactLegacyElement.isValidClass,
205 isValidElement: ReactElement.isValidElement,
206 withContext: ReactContext.withContext,
207
208 // Hook for JSX spread, don't use this for anything else.
209 __spread: assign,
210
211 // Deprecations (remove for 0.13)
212 renderComponent: deprecated(
213 'React',
214 'renderComponent',
215 'render',
216 this,
217 render
218 ),
219 renderComponentToString: deprecated(
220 'React',
221 'renderComponentToString',
222 'renderToString',
223 this,
224 ReactServerRendering.renderToString
225 ),
226 renderComponentToStaticMarkup: deprecated(
227 'React',
228 'renderComponentToStaticMarkup',
229 'renderToStaticMarkup',
230 this,
231 ReactServerRendering.renderToStaticMarkup
232 ),
233 isValidComponent: deprecated(
234 'React',
235 'isValidComponent',
236 'isValidElement',
237 this,
238 ReactElement.isValidElement
239 )
240 };
241
242 // Inject the runtime into a devtools global hook regardless of browser.
243 // Allows for debugging when the hook is injected on the page.
244 if (
245 typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&
246 typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.inject === 'function') {
247 __REACT_DEVTOOLS_GLOBAL_HOOK__.inject({
248 Component: ReactComponent,
249 CurrentOwner: ReactCurrentOwner,
250 DOMComponent: ReactDOMComponent,
251 DOMPropertyOperations: DOMPropertyOperations,
252 InstanceHandles: ReactInstanceHandles,
253 Mount: ReactMount,
254 MultiChild: ReactMultiChild,
255 TextComponent: ReactTextComponent
256 });
257 }
258
259 if ("production" !== process.env.NODE_ENV) {
260 var ExecutionEnvironment = __webpack_require__(26);
261 if (ExecutionEnvironment.canUseDOM && window.top === window.self) {
262
263 // If we're in Chrome, look for the devtools marker and provide a download
264 // link if not installed.
265 if (navigator.userAgent.indexOf('Chrome') > -1) {
266 if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined') {
267 console.debug(
268 'Download the React DevTools for a better development experience: ' +
269 'http://fb.me/react-devtools'
270 );
271 }
272 }
273
274 var expectedFeatures = [
275 // shims
276 Array.isArray,
277 Array.prototype.every,
278 Array.prototype.forEach,
279 Array.prototype.indexOf,
280 Array.prototype.map,
281 Date.now,
282 Function.prototype.bind,
283 Object.keys,
284 String.prototype.split,
285 String.prototype.trim,
286
287 // shams
288 Object.create,
289 Object.freeze
290 ];
291
292 for (var i = 0; i < expectedFeatures.length; i++) {
293 if (!expectedFeatures[i]) {
294 console.error(
295 'One or more ES5 shim/shams expected by React are not available: ' +
296 'http://fb.me/react-warning-polyfills'
297 );
298 break;
299 }
300 }
301 }
302 }
303
304 // Version exists only in the open-source version of React, not in Facebook's
305 // internal version.
306 React.version = '0.12.2';
307
308 module.exports = React;
309
310 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(27)))
311
312/***/ },
313/* 3 */
314/***/ function(module, exports, __webpack_require__) {
315
316 /* WEBPACK VAR INJECTION */(function(process) {/**
317 * Copyright 2013-2014, Facebook, Inc.
318 * All rights reserved.
319 *
320 * This source code is licensed under the BSD-style license found in the
321 * LICENSE file in the root directory of this source tree. An additional grant
322 * of patent rights can be found in the PATENTS file in the same directory.
323 *
324 * @providesModule DOMPropertyOperations
325 * @typechecks static-only
326 */
327
328 "use strict";
329
330 var DOMProperty = __webpack_require__(28);
331
332 var escapeTextForBrowser = __webpack_require__(29);
333 var memoizeStringOnly = __webpack_require__(30);
334 var warning = __webpack_require__(31);
335
336 function shouldIgnoreValue(name, value) {
337 return value == null ||
338 (DOMProperty.hasBooleanValue[name] && !value) ||
339 (DOMProperty.hasNumericValue[name] && isNaN(value)) ||
340 (DOMProperty.hasPositiveNumericValue[name] && (value < 1)) ||
341 (DOMProperty.hasOverloadedBooleanValue[name] && value === false);
342 }
343
344 var processAttributeNameAndPrefix = memoizeStringOnly(function(name) {
345 return escapeTextForBrowser(name) + '="';
346 });
347
348 if ("production" !== process.env.NODE_ENV) {
349 var reactProps = {
350 children: true,
351 dangerouslySetInnerHTML: true,
352 key: true,
353 ref: true
354 };
355 var warnedProperties = {};
356
357 var warnUnknownProperty = function(name) {
358 if (reactProps.hasOwnProperty(name) && reactProps[name] ||
359 warnedProperties.hasOwnProperty(name) && warnedProperties[name]) {
360 return;
361 }
362
363 warnedProperties[name] = true;
364 var lowerCasedName = name.toLowerCase();
365
366 // data-* attributes should be lowercase; suggest the lowercase version
367 var standardName = (
368 DOMProperty.isCustomAttribute(lowerCasedName) ?
369 lowerCasedName :
370 DOMProperty.getPossibleStandardName.hasOwnProperty(lowerCasedName) ?
371 DOMProperty.getPossibleStandardName[lowerCasedName] :
372 null
373 );
374
375 // For now, only warn when we have a suggested correction. This prevents
376 // logging too much when using transferPropsTo.
377 ("production" !== process.env.NODE_ENV ? warning(
378 standardName == null,
379 'Unknown DOM property ' + name + '. Did you mean ' + standardName + '?'
380 ) : null);
381
382 };
383 }
384
385 /**
386 * Operations for dealing with DOM properties.
387 */
388 var DOMPropertyOperations = {
389
390 /**
391 * Creates markup for the ID property.
392 *
393 * @param {string} id Unescaped ID.
394 * @return {string} Markup string.
395 */
396 createMarkupForID: function(id) {
397 return processAttributeNameAndPrefix(DOMProperty.ID_ATTRIBUTE_NAME) +
398 escapeTextForBrowser(id) + '"';
399 },
400
401 /**
402 * Creates markup for a property.
403 *
404 * @param {string} name
405 * @param {*} value
406 * @return {?string} Markup string, or null if the property was invalid.
407 */
408 createMarkupForProperty: function(name, value) {
409 if (DOMProperty.isStandardName.hasOwnProperty(name) &&
410 DOMProperty.isStandardName[name]) {
411 if (shouldIgnoreValue(name, value)) {
412 return '';
413 }
414 var attributeName = DOMProperty.getAttributeName[name];
415 if (DOMProperty.hasBooleanValue[name] ||
416 (DOMProperty.hasOverloadedBooleanValue[name] && value === true)) {
417 return escapeTextForBrowser(attributeName);
418 }
419 return processAttributeNameAndPrefix(attributeName) +
420 escapeTextForBrowser(value) + '"';
421 } else if (DOMProperty.isCustomAttribute(name)) {
422 if (value == null) {
423 return '';
424 }
425 return processAttributeNameAndPrefix(name) +
426 escapeTextForBrowser(value) + '"';
427 } else if ("production" !== process.env.NODE_ENV) {
428 warnUnknownProperty(name);
429 }
430 return null;
431 },
432
433 /**
434 * Sets the value for a property on a node.
435 *
436 * @param {DOMElement} node
437 * @param {string} name
438 * @param {*} value
439 */
440 setValueForProperty: function(node, name, value) {
441 if (DOMProperty.isStandardName.hasOwnProperty(name) &&
442 DOMProperty.isStandardName[name]) {
443 var mutationMethod = DOMProperty.getMutationMethod[name];
444 if (mutationMethod) {
445 mutationMethod(node, value);
446 } else if (shouldIgnoreValue(name, value)) {
447 this.deleteValueForProperty(node, name);
448 } else if (DOMProperty.mustUseAttribute[name]) {
449 // `setAttribute` with objects becomes only `[object]` in IE8/9,
450 // ('' + value) makes it output the correct toString()-value.
451 node.setAttribute(DOMProperty.getAttributeName[name], '' + value);
452 } else {
453 var propName = DOMProperty.getPropertyName[name];
454 // Must explicitly cast values for HAS_SIDE_EFFECTS-properties to the
455 // property type before comparing; only `value` does and is string.
456 if (!DOMProperty.hasSideEffects[name] ||
457 ('' + node[propName]) !== ('' + value)) {
458 // Contrary to `setAttribute`, object properties are properly
459 // `toString`ed by IE8/9.
460 node[propName] = value;
461 }
462 }
463 } else if (DOMProperty.isCustomAttribute(name)) {
464 if (value == null) {
465 node.removeAttribute(name);
466 } else {
467 node.setAttribute(name, '' + value);
468 }
469 } else if ("production" !== process.env.NODE_ENV) {
470 warnUnknownProperty(name);
471 }
472 },
473
474 /**
475 * Deletes the value for a property on a node.
476 *
477 * @param {DOMElement} node
478 * @param {string} name
479 */
480 deleteValueForProperty: function(node, name) {
481 if (DOMProperty.isStandardName.hasOwnProperty(name) &&
482 DOMProperty.isStandardName[name]) {
483 var mutationMethod = DOMProperty.getMutationMethod[name];
484 if (mutationMethod) {
485 mutationMethod(node, undefined);
486 } else if (DOMProperty.mustUseAttribute[name]) {
487 node.removeAttribute(DOMProperty.getAttributeName[name]);
488 } else {
489 var propName = DOMProperty.getPropertyName[name];
490 var defaultValue = DOMProperty.getDefaultValueForProperty(
491 node.nodeName,
492 propName
493 );
494 if (!DOMProperty.hasSideEffects[name] ||
495 ('' + node[propName]) !== defaultValue) {
496 node[propName] = defaultValue;
497 }
498 }
499 } else if (DOMProperty.isCustomAttribute(name)) {
500 node.removeAttribute(name);
501 } else if ("production" !== process.env.NODE_ENV) {
502 warnUnknownProperty(name);
503 }
504 }
505
506 };
507
508 module.exports = DOMPropertyOperations;
509
510 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(27)))
511
512/***/ },
513/* 4 */
514/***/ function(module, exports, __webpack_require__) {
515
516 /* WEBPACK VAR INJECTION */(function(process) {/**
517 * Copyright 2013-2014, Facebook, Inc.
518 * All rights reserved.
519 *
520 * This source code is licensed under the BSD-style license found in the
521 * LICENSE file in the root directory of this source tree. An additional grant
522 * of patent rights can be found in the PATENTS file in the same directory.
523 *
524 * @providesModule EventPluginUtils
525 */
526
527 "use strict";
528
529 var EventConstants = __webpack_require__(32);
530
531 var invariant = __webpack_require__(33);
532
533 /**
534 * Injected dependencies:
535 */
536
537 /**
538 * - `Mount`: [required] Module that can convert between React dom IDs and
539 * actual node references.
540 */
541 var injection = {
542 Mount: null,
543 injectMount: function(InjectedMount) {
544 injection.Mount = InjectedMount;
545 if ("production" !== process.env.NODE_ENV) {
546 ("production" !== process.env.NODE_ENV ? invariant(
547 InjectedMount && InjectedMount.getNode,
548 'EventPluginUtils.injection.injectMount(...): Injected Mount module ' +
549 'is missing getNode.'
550 ) : invariant(InjectedMount && InjectedMount.getNode));
551 }
552 }
553 };
554
555 var topLevelTypes = EventConstants.topLevelTypes;
556
557 function isEndish(topLevelType) {
558 return topLevelType === topLevelTypes.topMouseUp ||
559 topLevelType === topLevelTypes.topTouchEnd ||
560 topLevelType === topLevelTypes.topTouchCancel;
561 }
562
563 function isMoveish(topLevelType) {
564 return topLevelType === topLevelTypes.topMouseMove ||
565 topLevelType === topLevelTypes.topTouchMove;
566 }
567 function isStartish(topLevelType) {
568 return topLevelType === topLevelTypes.topMouseDown ||
569 topLevelType === topLevelTypes.topTouchStart;
570 }
571
572
573 var validateEventDispatches;
574 if ("production" !== process.env.NODE_ENV) {
575 validateEventDispatches = function(event) {
576 var dispatchListeners = event._dispatchListeners;
577 var dispatchIDs = event._dispatchIDs;
578
579 var listenersIsArr = Array.isArray(dispatchListeners);
580 var idsIsArr = Array.isArray(dispatchIDs);
581 var IDsLen = idsIsArr ? dispatchIDs.length : dispatchIDs ? 1 : 0;
582 var listenersLen = listenersIsArr ?
583 dispatchListeners.length :
584 dispatchListeners ? 1 : 0;
585
586 ("production" !== process.env.NODE_ENV ? invariant(
587 idsIsArr === listenersIsArr && IDsLen === listenersLen,
588 'EventPluginUtils: Invalid `event`.'
589 ) : invariant(idsIsArr === listenersIsArr && IDsLen === listenersLen));
590 };
591 }
592
593 /**
594 * Invokes `cb(event, listener, id)`. Avoids using call if no scope is
595 * provided. The `(listener,id)` pair effectively forms the "dispatch" but are
596 * kept separate to conserve memory.
597 */
598 function forEachEventDispatch(event, cb) {
599 var dispatchListeners = event._dispatchListeners;
600 var dispatchIDs = event._dispatchIDs;
601 if ("production" !== process.env.NODE_ENV) {
602 validateEventDispatches(event);
603 }
604 if (Array.isArray(dispatchListeners)) {
605 for (var i = 0; i < dispatchListeners.length; i++) {
606 if (event.isPropagationStopped()) {
607 break;
608 }
609 // Listeners and IDs are two parallel arrays that are always in sync.
610 cb(event, dispatchListeners[i], dispatchIDs[i]);
611 }
612 } else if (dispatchListeners) {
613 cb(event, dispatchListeners, dispatchIDs);
614 }
615 }
616
617 /**
618 * Default implementation of PluginModule.executeDispatch().
619 * @param {SyntheticEvent} SyntheticEvent to handle
620 * @param {function} Application-level callback
621 * @param {string} domID DOM id to pass to the callback.
622 */
623 function executeDispatch(event, listener, domID) {
624 event.currentTarget = injection.Mount.getNode(domID);
625 var returnValue = listener(event, domID);
626 event.currentTarget = null;
627 return returnValue;
628 }
629
630 /**
631 * Standard/simple iteration through an event's collected dispatches.
632 */
633 function executeDispatchesInOrder(event, executeDispatch) {
634 forEachEventDispatch(event, executeDispatch);
635 event._dispatchListeners = null;
636 event._dispatchIDs = null;
637 }
638
639 /**
640 * Standard/simple iteration through an event's collected dispatches, but stops
641 * at the first dispatch execution returning true, and returns that id.
642 *
643 * @return id of the first dispatch execution who's listener returns true, or
644 * null if no listener returned true.
645 */
646 function executeDispatchesInOrderStopAtTrueImpl(event) {
647 var dispatchListeners = event._dispatchListeners;
648 var dispatchIDs = event._dispatchIDs;
649 if ("production" !== process.env.NODE_ENV) {
650 validateEventDispatches(event);
651 }
652 if (Array.isArray(dispatchListeners)) {
653 for (var i = 0; i < dispatchListeners.length; i++) {
654 if (event.isPropagationStopped()) {
655 break;
656 }
657 // Listeners and IDs are two parallel arrays that are always in sync.
658 if (dispatchListeners[i](event, dispatchIDs[i])) {
659 return dispatchIDs[i];
660 }
661 }
662 } else if (dispatchListeners) {
663 if (dispatchListeners(event, dispatchIDs)) {
664 return dispatchIDs;
665 }
666 }
667 return null;
668 }
669
670 /**
671 * @see executeDispatchesInOrderStopAtTrueImpl
672 */
673 function executeDispatchesInOrderStopAtTrue(event) {
674 var ret = executeDispatchesInOrderStopAtTrueImpl(event);
675 event._dispatchIDs = null;
676 event._dispatchListeners = null;
677 return ret;
678 }
679
680 /**
681 * Execution of a "direct" dispatch - there must be at most one dispatch
682 * accumulated on the event or it is considered an error. It doesn't really make
683 * sense for an event with multiple dispatches (bubbled) to keep track of the
684 * return values at each dispatch execution, but it does tend to make sense when
685 * dealing with "direct" dispatches.
686 *
687 * @return The return value of executing the single dispatch.
688 */
689 function executeDirectDispatch(event) {
690 if ("production" !== process.env.NODE_ENV) {
691 validateEventDispatches(event);
692 }
693 var dispatchListener = event._dispatchListeners;
694 var dispatchID = event._dispatchIDs;
695 ("production" !== process.env.NODE_ENV ? invariant(
696 !Array.isArray(dispatchListener),
697 'executeDirectDispatch(...): Invalid `event`.'
698 ) : invariant(!Array.isArray(dispatchListener)));
699 var res = dispatchListener ?
700 dispatchListener(event, dispatchID) :
701 null;
702 event._dispatchListeners = null;
703 event._dispatchIDs = null;
704 return res;
705 }
706
707 /**
708 * @param {SyntheticEvent} event
709 * @return {bool} True iff number of dispatches accumulated is greater than 0.
710 */
711 function hasDispatches(event) {
712 return !!event._dispatchListeners;
713 }
714
715 /**
716 * General utilities that are useful in creating custom Event Plugins.
717 */
718 var EventPluginUtils = {
719 isEndish: isEndish,
720 isMoveish: isMoveish,
721 isStartish: isStartish,
722
723 executeDirectDispatch: executeDirectDispatch,
724 executeDispatch: executeDispatch,
725 executeDispatchesInOrder: executeDispatchesInOrder,
726 executeDispatchesInOrderStopAtTrue: executeDispatchesInOrderStopAtTrue,
727 hasDispatches: hasDispatches,
728 injection: injection,
729 useTouchEvents: false
730 };
731
732 module.exports = EventPluginUtils;
733
734 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(27)))
735
736/***/ },
737/* 5 */
738/***/ function(module, exports, __webpack_require__) {
739
740 /* WEBPACK VAR INJECTION */(function(process) {/**
741 * Copyright 2013-2014, Facebook, Inc.
742 * All rights reserved.
743 *
744 * This source code is licensed under the BSD-style license found in the
745 * LICENSE file in the root directory of this source tree. An additional grant
746 * of patent rights can be found in the PATENTS file in the same directory.
747 *
748 * @providesModule ReactChildren
749 */
750
751 "use strict";
752
753 var PooledClass = __webpack_require__(34);
754
755 var traverseAllChildren = __webpack_require__(35);
756 var warning = __webpack_require__(31);
757
758 var twoArgumentPooler = PooledClass.twoArgumentPooler;
759 var threeArgumentPooler = PooledClass.threeArgumentPooler;
760
761 /**
762 * PooledClass representing the bookkeeping associated with performing a child
763 * traversal. Allows avoiding binding callbacks.
764 *
765 * @constructor ForEachBookKeeping
766 * @param {!function} forEachFunction Function to perform traversal with.
767 * @param {?*} forEachContext Context to perform context with.
768 */
769 function ForEachBookKeeping(forEachFunction, forEachContext) {
770 this.forEachFunction = forEachFunction;
771 this.forEachContext = forEachContext;
772 }
773 PooledClass.addPoolingTo(ForEachBookKeeping, twoArgumentPooler);
774
775 function forEachSingleChild(traverseContext, child, name, i) {
776 var forEachBookKeeping = traverseContext;
777 forEachBookKeeping.forEachFunction.call(
778 forEachBookKeeping.forEachContext, child, i);
779 }
780
781 /**
782 * Iterates through children that are typically specified as `props.children`.
783 *
784 * The provided forEachFunc(child, index) will be called for each
785 * leaf child.
786 *
787 * @param {?*} children Children tree container.
788 * @param {function(*, int)} forEachFunc.
789 * @param {*} forEachContext Context for forEachContext.
790 */
791 function forEachChildren(children, forEachFunc, forEachContext) {
792 if (children == null) {
793 return children;
794 }
795
796 var traverseContext =
797 ForEachBookKeeping.getPooled(forEachFunc, forEachContext);
798 traverseAllChildren(children, forEachSingleChild, traverseContext);
799 ForEachBookKeeping.release(traverseContext);
800 }
801
802 /**
803 * PooledClass representing the bookkeeping associated with performing a child
804 * mapping. Allows avoiding binding callbacks.
805 *
806 * @constructor MapBookKeeping
807 * @param {!*} mapResult Object containing the ordered map of results.
808 * @param {!function} mapFunction Function to perform mapping with.
809 * @param {?*} mapContext Context to perform mapping with.
810 */
811 function MapBookKeeping(mapResult, mapFunction, mapContext) {
812 this.mapResult = mapResult;
813 this.mapFunction = mapFunction;
814 this.mapContext = mapContext;
815 }
816 PooledClass.addPoolingTo(MapBookKeeping, threeArgumentPooler);
817
818 function mapSingleChildIntoContext(traverseContext, child, name, i) {
819 var mapBookKeeping = traverseContext;
820 var mapResult = mapBookKeeping.mapResult;
821
822 var keyUnique = !mapResult.hasOwnProperty(name);
823 ("production" !== process.env.NODE_ENV ? warning(
824 keyUnique,
825 'ReactChildren.map(...): Encountered two children with the same key, ' +
826 '`%s`. Child keys must be unique; when two children share a key, only ' +
827 'the first child will be used.',
828 name
829 ) : null);
830
831 if (keyUnique) {
832 var mappedChild =
833 mapBookKeeping.mapFunction.call(mapBookKeeping.mapContext, child, i);
834 mapResult[name] = mappedChild;
835 }
836 }
837
838 /**
839 * Maps children that are typically specified as `props.children`.
840 *
841 * The provided mapFunction(child, key, index) will be called for each
842 * leaf child.
843 *
844 * TODO: This may likely break any calls to `ReactChildren.map` that were
845 * previously relying on the fact that we guarded against null children.
846 *
847 * @param {?*} children Children tree container.
848 * @param {function(*, int)} mapFunction.
849 * @param {*} mapContext Context for mapFunction.
850 * @return {object} Object containing the ordered map of results.
851 */
852 function mapChildren(children, func, context) {
853 if (children == null) {
854 return children;
855 }
856
857 var mapResult = {};
858 var traverseContext = MapBookKeeping.getPooled(mapResult, func, context);
859 traverseAllChildren(children, mapSingleChildIntoContext, traverseContext);
860 MapBookKeeping.release(traverseContext);
861 return mapResult;
862 }
863
864 function forEachSingleChildDummy(traverseContext, child, name, i) {
865 return null;
866 }
867
868 /**
869 * Count the number of children that are typically specified as
870 * `props.children`.
871 *
872 * @param {?*} children Children tree container.
873 * @return {number} The number of children.
874 */
875 function countChildren(children, context) {
876 return traverseAllChildren(children, forEachSingleChildDummy, null);
877 }
878
879 var ReactChildren = {
880 forEach: forEachChildren,
881 map: mapChildren,
882 count: countChildren
883 };
884
885 module.exports = ReactChildren;
886
887 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(27)))
888
889/***/ },
890/* 6 */
891/***/ function(module, exports, __webpack_require__) {
892
893 /* WEBPACK VAR INJECTION */(function(process) {/**
894 * Copyright 2013-2014, Facebook, Inc.
895 * All rights reserved.
896 *
897 * This source code is licensed under the BSD-style license found in the
898 * LICENSE file in the root directory of this source tree. An additional grant
899 * of patent rights can be found in the PATENTS file in the same directory.
900 *
901 * @providesModule ReactComponent
902 */
903
904 "use strict";
905
906 var ReactElement = __webpack_require__(10);
907 var ReactOwner = __webpack_require__(38);
908 var ReactUpdates = __webpack_require__(42);
909
910 var assign = __webpack_require__(23);
911 var invariant = __webpack_require__(33);
912 var keyMirror = __webpack_require__(44);
913
914 /**
915 * Every React component is in one of these life cycles.
916 */
917 var ComponentLifeCycle = keyMirror({
918 /**
919 * Mounted components have a DOM node representation and are capable of
920 * receiving new props.
921 */
922 MOUNTED: null,
923 /**
924 * Unmounted components are inactive and cannot receive new props.
925 */
926 UNMOUNTED: null
927 });
928
929 var injected = false;
930
931 /**
932 * Optionally injectable environment dependent cleanup hook. (server vs.
933 * browser etc). Example: A browser system caches DOM nodes based on component
934 * ID and must remove that cache entry when this instance is unmounted.
935 *
936 * @private
937 */
938 var unmountIDFromEnvironment = null;
939
940 /**
941 * The "image" of a component tree, is the platform specific (typically
942 * serialized) data that represents a tree of lower level UI building blocks.
943 * On the web, this "image" is HTML markup which describes a construction of
944 * low level `div` and `span` nodes. Other platforms may have different
945 * encoding of this "image". This must be injected.
946 *
947 * @private
948 */
949 var mountImageIntoNode = null;
950
951 /**
952 * Components are the basic units of composition in React.
953 *
954 * Every component accepts a set of keyed input parameters known as "props" that
955 * are initialized by the constructor. Once a component is mounted, the props
956 * can be mutated using `setProps` or `replaceProps`.
957 *
958 * Every component is capable of the following operations:
959 *
960 * `mountComponent`
961 * Initializes the component, renders markup, and registers event listeners.
962 *
963 * `receiveComponent`
964 * Updates the rendered DOM nodes to match the given component.
965 *
966 * `unmountComponent`
967 * Releases any resources allocated by this component.
968 *
969 * Components can also be "owned" by other components. Being owned by another
970 * component means being constructed by that component. This is different from
971 * being the child of a component, which means having a DOM representation that
972 * is a child of the DOM representation of that component.
973 *
974 * @class ReactComponent
975 */
976 var ReactComponent = {
977
978 injection: {
979 injectEnvironment: function(ReactComponentEnvironment) {
980 ("production" !== process.env.NODE_ENV ? invariant(
981 !injected,
982 'ReactComponent: injectEnvironment() can only be called once.'
983 ) : invariant(!injected));
984 mountImageIntoNode = ReactComponentEnvironment.mountImageIntoNode;
985 unmountIDFromEnvironment =
986 ReactComponentEnvironment.unmountIDFromEnvironment;
987 ReactComponent.BackendIDOperations =
988 ReactComponentEnvironment.BackendIDOperations;
989 injected = true;
990 }
991 },
992
993 /**
994 * @internal
995 */
996 LifeCycle: ComponentLifeCycle,
997
998 /**
999 * Injected module that provides ability to mutate individual properties.
1000 * Injected into the base class because many different subclasses need access
1001 * to this.
1002 *
1003 * @internal
1004 */
1005 BackendIDOperations: null,
1006
1007 /**
1008 * Base functionality for every ReactComponent constructor. Mixed into the
1009 * `ReactComponent` prototype, but exposed statically for easy access.
1010 *
1011 * @lends {ReactComponent.prototype}
1012 */
1013 Mixin: {
1014
1015 /**
1016 * Checks whether or not this component is mounted.
1017 *
1018 * @return {boolean} True if mounted, false otherwise.
1019 * @final
1020 * @protected
1021 */
1022 isMounted: function() {
1023 return this._lifeCycleState === ComponentLifeCycle.MOUNTED;
1024 },
1025
1026 /**
1027 * Sets a subset of the props.
1028 *
1029 * @param {object} partialProps Subset of the next props.
1030 * @param {?function} callback Called after props are updated.
1031 * @final
1032 * @public
1033 */
1034 setProps: function(partialProps, callback) {
1035 // Merge with the pending element if it exists, otherwise with existing
1036 // element props.
1037 var element = this._pendingElement || this._currentElement;
1038 this.replaceProps(
1039 assign({}, element.props, partialProps),
1040 callback
1041 );
1042 },
1043
1044 /**
1045 * Replaces all of the props.
1046 *
1047 * @param {object} props New props.
1048 * @param {?function} callback Called after props are updated.
1049 * @final
1050 * @public
1051 */
1052 replaceProps: function(props, callback) {
1053 ("production" !== process.env.NODE_ENV ? invariant(
1054 this.isMounted(),
1055 'replaceProps(...): Can only update a mounted component.'
1056 ) : invariant(this.isMounted()));
1057 ("production" !== process.env.NODE_ENV ? invariant(
1058 this._mountDepth === 0,
1059 'replaceProps(...): You called `setProps` or `replaceProps` on a ' +
1060 'component with a parent. This is an anti-pattern since props will ' +
1061 'get reactively updated when rendered. Instead, change the owner\'s ' +
1062 '`render` method to pass the correct value as props to the component ' +
1063 'where it is created.'
1064 ) : invariant(this._mountDepth === 0));
1065 // This is a deoptimized path. We optimize for always having a element.
1066 // This creates an extra internal element.
1067 this._pendingElement = ReactElement.cloneAndReplaceProps(
1068 this._pendingElement || this._currentElement,
1069 props
1070 );
1071 ReactUpdates.enqueueUpdate(this, callback);
1072 },
1073
1074 /**
1075 * Schedule a partial update to the props. Only used for internal testing.
1076 *
1077 * @param {object} partialProps Subset of the next props.
1078 * @param {?function} callback Called after props are updated.
1079 * @final
1080 * @internal
1081 */
1082 _setPropsInternal: function(partialProps, callback) {
1083 // This is a deoptimized path. We optimize for always having a element.
1084 // This creates an extra internal element.
1085 var element = this._pendingElement || this._currentElement;
1086 this._pendingElement = ReactElement.cloneAndReplaceProps(
1087 element,
1088 assign({}, element.props, partialProps)
1089 );
1090 ReactUpdates.enqueueUpdate(this, callback);
1091 },
1092
1093 /**
1094 * Base constructor for all React components.
1095 *
1096 * Subclasses that override this method should make sure to invoke
1097 * `ReactComponent.Mixin.construct.call(this, ...)`.
1098 *
1099 * @param {ReactElement} element
1100 * @internal
1101 */
1102 construct: function(element) {
1103 // This is the public exposed props object after it has been processed
1104 // with default props. The element's props represents the true internal
1105 // state of the props.
1106 this.props = element.props;
1107 // Record the component responsible for creating this component.
1108 // This is accessible through the element but we maintain an extra
1109 // field for compatibility with devtools and as a way to make an
1110 // incremental update. TODO: Consider deprecating this field.
1111 this._owner = element._owner;
1112
1113 // All components start unmounted.
1114 this._lifeCycleState = ComponentLifeCycle.UNMOUNTED;
1115
1116 // See ReactUpdates.
1117 this._pendingCallbacks = null;
1118
1119 // We keep the old element and a reference to the pending element
1120 // to track updates.
1121 this._currentElement = element;
1122 this._pendingElement = null;
1123 },
1124
1125 /**
1126 * Initializes the component, renders markup, and registers event listeners.
1127 *
1128 * NOTE: This does not insert any nodes into the DOM.
1129 *
1130 * Subclasses that override this method should make sure to invoke
1131 * `ReactComponent.Mixin.mountComponent.call(this, ...)`.
1132 *
1133 * @param {string} rootID DOM ID of the root node.
1134 * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
1135 * @param {number} mountDepth number of components in the owner hierarchy.
1136 * @return {?string} Rendered markup to be inserted into the DOM.
1137 * @internal
1138 */
1139 mountComponent: function(rootID, transaction, mountDepth) {
1140 ("production" !== process.env.NODE_ENV ? invariant(
1141 !this.isMounted(),
1142 'mountComponent(%s, ...): Can only mount an unmounted component. ' +
1143 'Make sure to avoid storing components between renders or reusing a ' +
1144 'single component instance in multiple places.',
1145 rootID
1146 ) : invariant(!this.isMounted()));
1147 var ref = this._currentElement.ref;
1148 if (ref != null) {
1149 var owner = this._currentElement._owner;
1150 ReactOwner.addComponentAsRefTo(this, ref, owner);
1151 }
1152 this._rootNodeID = rootID;
1153 this._lifeCycleState = ComponentLifeCycle.MOUNTED;
1154 this._mountDepth = mountDepth;
1155 // Effectively: return '';
1156 },
1157
1158 /**
1159 * Releases any resources allocated by `mountComponent`.
1160 *
1161 * NOTE: This does not remove any nodes from the DOM.
1162 *
1163 * Subclasses that override this method should make sure to invoke
1164 * `ReactComponent.Mixin.unmountComponent.call(this)`.
1165 *
1166 * @internal
1167 */
1168 unmountComponent: function() {
1169 ("production" !== process.env.NODE_ENV ? invariant(
1170 this.isMounted(),
1171 'unmountComponent(): Can only unmount a mounted component.'
1172 ) : invariant(this.isMounted()));
1173 var ref = this._currentElement.ref;
1174 if (ref != null) {
1175 ReactOwner.removeComponentAsRefFrom(this, ref, this._owner);
1176 }
1177 unmountIDFromEnvironment(this._rootNodeID);
1178 this._rootNodeID = null;
1179 this._lifeCycleState = ComponentLifeCycle.UNMOUNTED;
1180 },
1181
1182 /**
1183 * Given a new instance of this component, updates the rendered DOM nodes
1184 * as if that instance was rendered instead.
1185 *
1186 * Subclasses that override this method should make sure to invoke
1187 * `ReactComponent.Mixin.receiveComponent.call(this, ...)`.
1188 *
1189 * @param {object} nextComponent Next set of properties.
1190 * @param {ReactReconcileTransaction} transaction
1191 * @internal
1192 */
1193 receiveComponent: function(nextElement, transaction) {
1194 ("production" !== process.env.NODE_ENV ? invariant(
1195 this.isMounted(),
1196 'receiveComponent(...): Can only update a mounted component.'
1197 ) : invariant(this.isMounted()));
1198 this._pendingElement = nextElement;
1199 this.performUpdateIfNecessary(transaction);
1200 },
1201
1202 /**
1203 * If `_pendingElement` is set, update the component.
1204 *
1205 * @param {ReactReconcileTransaction} transaction
1206 * @internal
1207 */
1208 performUpdateIfNecessary: function(transaction) {
1209 if (this._pendingElement == null) {
1210 return;
1211 }
1212 var prevElement = this._currentElement;
1213 var nextElement = this._pendingElement;
1214 this._currentElement = nextElement;
1215 this.props = nextElement.props;
1216 this._owner = nextElement._owner;
1217 this._pendingElement = null;
1218 this.updateComponent(transaction, prevElement);
1219 },
1220
1221 /**
1222 * Updates the component's currently mounted representation.
1223 *
1224 * @param {ReactReconcileTransaction} transaction
1225 * @param {object} prevElement
1226 * @internal
1227 */
1228 updateComponent: function(transaction, prevElement) {
1229 var nextElement = this._currentElement;
1230
1231 // If either the owner or a `ref` has changed, make sure the newest owner
1232 // has stored a reference to `this`, and the previous owner (if different)
1233 // has forgotten the reference to `this`. We use the element instead
1234 // of the public this.props because the post processing cannot determine
1235 // a ref. The ref conceptually lives on the element.
1236
1237 // TODO: Should this even be possible? The owner cannot change because
1238 // it's forbidden by shouldUpdateReactComponent. The ref can change
1239 // if you swap the keys of but not the refs. Reconsider where this check
1240 // is made. It probably belongs where the key checking and
1241 // instantiateReactComponent is done.
1242
1243 if (nextElement._owner !== prevElement._owner ||
1244 nextElement.ref !== prevElement.ref) {
1245 if (prevElement.ref != null) {
1246 ReactOwner.removeComponentAsRefFrom(
1247 this, prevElement.ref, prevElement._owner
1248 );
1249 }
1250 // Correct, even if the owner is the same, and only the ref has changed.
1251 if (nextElement.ref != null) {
1252 ReactOwner.addComponentAsRefTo(
1253 this,
1254 nextElement.ref,
1255 nextElement._owner
1256 );
1257 }
1258 }
1259 },
1260
1261 /**
1262 * Mounts this component and inserts it into the DOM.
1263 *
1264 * @param {string} rootID DOM ID of the root node.
1265 * @param {DOMElement} container DOM element to mount into.
1266 * @param {boolean} shouldReuseMarkup If true, do not insert markup
1267 * @final
1268 * @internal
1269 * @see {ReactMount.render}
1270 */
1271 mountComponentIntoNode: function(rootID, container, shouldReuseMarkup) {
1272 var transaction = ReactUpdates.ReactReconcileTransaction.getPooled();
1273 transaction.perform(
1274 this._mountComponentIntoNode,
1275 this,
1276 rootID,
1277 container,
1278 transaction,
1279 shouldReuseMarkup
1280 );
1281 ReactUpdates.ReactReconcileTransaction.release(transaction);
1282 },
1283
1284 /**
1285 * @param {string} rootID DOM ID of the root node.
1286 * @param {DOMElement} container DOM element to mount into.
1287 * @param {ReactReconcileTransaction} transaction
1288 * @param {boolean} shouldReuseMarkup If true, do not insert markup
1289 * @final
1290 * @private
1291 */
1292 _mountComponentIntoNode: function(
1293 rootID,
1294 container,
1295 transaction,
1296 shouldReuseMarkup) {
1297 var markup = this.mountComponent(rootID, transaction, 0);
1298 mountImageIntoNode(markup, container, shouldReuseMarkup);
1299 },
1300
1301 /**
1302 * Checks if this component is owned by the supplied `owner` component.
1303 *
1304 * @param {ReactComponent} owner Component to check.
1305 * @return {boolean} True if `owners` owns this component.
1306 * @final
1307 * @internal
1308 */
1309 isOwnedBy: function(owner) {
1310 return this._owner === owner;
1311 },
1312
1313 /**
1314 * Gets another component, that shares the same owner as this one, by ref.
1315 *
1316 * @param {string} ref of a sibling Component.
1317 * @return {?ReactComponent} the actual sibling Component.
1318 * @final
1319 * @internal
1320 */
1321 getSiblingByRef: function(ref) {
1322 var owner = this._owner;
1323 if (!owner || !owner.refs) {
1324 return null;
1325 }
1326 return owner.refs[ref];
1327 }
1328 }
1329 };
1330
1331 module.exports = ReactComponent;
1332
1333 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(27)))
1334
1335/***/ },
1336/* 7 */
1337/***/ function(module, exports, __webpack_require__) {
1338
1339 /* WEBPACK VAR INJECTION */(function(process) {/**
1340 * Copyright 2013-2014, Facebook, Inc.
1341 * All rights reserved.
1342 *
1343 * This source code is licensed under the BSD-style license found in the
1344 * LICENSE file in the root directory of this source tree. An additional grant
1345 * of patent rights can be found in the PATENTS file in the same directory.
1346 *
1347 * @providesModule ReactCompositeComponent
1348 */
1349
1350 "use strict";
1351
1352 var ReactComponent = __webpack_require__(6);
1353 var ReactContext = __webpack_require__(8);
1354 var ReactCurrentOwner = __webpack_require__(9);
1355 var ReactElement = __webpack_require__(10);
1356 var ReactElementValidator = __webpack_require__(11);
1357 var ReactEmptyComponent = __webpack_require__(36);
1358 var ReactErrorUtils = __webpack_require__(37);
1359 var ReactLegacyElement = __webpack_require__(16);
1360 var ReactOwner = __webpack_require__(38);
1361 var ReactPerf = __webpack_require__(19);
1362 var ReactPropTransferer = __webpack_require__(39);
1363 var ReactPropTypeLocations = __webpack_require__(40);
1364 var ReactPropTypeLocationNames = __webpack_require__(41);
1365 var ReactUpdates = __webpack_require__(42);
1366
1367 var assign = __webpack_require__(23);
1368 var instantiateReactComponent = __webpack_require__(43);
1369 var invariant = __webpack_require__(33);
1370 var keyMirror = __webpack_require__(44);
1371 var keyOf = __webpack_require__(45);
1372 var monitorCodeUse = __webpack_require__(46);
1373 var mapObject = __webpack_require__(47);
1374 var shouldUpdateReactComponent = __webpack_require__(48);
1375 var warning = __webpack_require__(31);
1376
1377 var MIXINS_KEY = keyOf({mixins: null});
1378
1379 /**
1380 * Policies that describe methods in `ReactCompositeComponentInterface`.
1381 */
1382 var SpecPolicy = keyMirror({
1383 /**
1384 * These methods may be defined only once by the class specification or mixin.
1385 */
1386 DEFINE_ONCE: null,
1387 /**
1388 * These methods may be defined by both the class specification and mixins.
1389 * Subsequent definitions will be chained. These methods must return void.
1390 */
1391 DEFINE_MANY: null,
1392 /**
1393 * These methods are overriding the base ReactCompositeComponent class.
1394 */
1395 OVERRIDE_BASE: null,
1396 /**
1397 * These methods are similar to DEFINE_MANY, except we assume they return
1398 * objects. We try to merge the keys of the return values of all the mixed in
1399 * functions. If there is a key conflict we throw.
1400 */
1401 DEFINE_MANY_MERGED: null
1402 });
1403
1404
1405 var injectedMixins = [];
1406
1407 /**
1408 * Composite components are higher-level components that compose other composite
1409 * or native components.
1410 *
1411 * To create a new type of `ReactCompositeComponent`, pass a specification of
1412 * your new class to `React.createClass`. The only requirement of your class
1413 * specification is that you implement a `render` method.
1414 *
1415 * var MyComponent = React.createClass({
1416 * render: function() {
1417 * return <div>Hello World</div>;
1418 * }
1419 * });
1420 *
1421 * The class specification supports a specific protocol of methods that have
1422 * special meaning (e.g. `render`). See `ReactCompositeComponentInterface` for
1423 * more the comprehensive protocol. Any other properties and methods in the
1424 * class specification will available on the prototype.
1425 *
1426 * @interface ReactCompositeComponentInterface
1427 * @internal
1428 */
1429 var ReactCompositeComponentInterface = {
1430
1431 /**
1432 * An array of Mixin objects to include when defining your component.
1433 *
1434 * @type {array}
1435 * @optional
1436 */
1437 mixins: SpecPolicy.DEFINE_MANY,
1438
1439 /**
1440 * An object containing properties and methods that should be defined on
1441 * the component's constructor instead of its prototype (static methods).
1442 *
1443 * @type {object}
1444 * @optional
1445 */
1446 statics: SpecPolicy.DEFINE_MANY,
1447
1448 /**
1449 * Definition of prop types for this component.
1450 *
1451 * @type {object}
1452 * @optional
1453 */
1454 propTypes: SpecPolicy.DEFINE_MANY,
1455
1456 /**
1457 * Definition of context types for this component.
1458 *
1459 * @type {object}
1460 * @optional
1461 */
1462 contextTypes: SpecPolicy.DEFINE_MANY,
1463
1464 /**
1465 * Definition of context types this component sets for its children.
1466 *
1467 * @type {object}
1468 * @optional
1469 */
1470 childContextTypes: SpecPolicy.DEFINE_MANY,
1471
1472 // ==== Definition methods ====
1473
1474 /**
1475 * Invoked when the component is mounted. Values in the mapping will be set on
1476 * `this.props` if that prop is not specified (i.e. using an `in` check).
1477 *
1478 * This method is invoked before `getInitialState` and therefore cannot rely
1479 * on `this.state` or use `this.setState`.
1480 *
1481 * @return {object}
1482 * @optional
1483 */
1484 getDefaultProps: SpecPolicy.DEFINE_MANY_MERGED,
1485
1486 /**
1487 * Invoked once before the component is mounted. The return value will be used
1488 * as the initial value of `this.state`.
1489 *
1490 * getInitialState: function() {
1491 * return {
1492 * isOn: false,
1493 * fooBaz: new BazFoo()
1494 * }
1495 * }
1496 *
1497 * @return {object}
1498 * @optional
1499 */
1500 getInitialState: SpecPolicy.DEFINE_MANY_MERGED,
1501
1502 /**
1503 * @return {object}
1504 * @optional
1505 */
1506 getChildContext: SpecPolicy.DEFINE_MANY_MERGED,
1507
1508 /**
1509 * Uses props from `this.props` and state from `this.state` to render the
1510 * structure of the component.
1511 *
1512 * No guarantees are made about when or how often this method is invoked, so
1513 * it must not have side effects.
1514 *
1515 * render: function() {
1516 * var name = this.props.name;
1517 * return <div>Hello, {name}!</div>;
1518 * }
1519 *
1520 * @return {ReactComponent}
1521 * @nosideeffects
1522 * @required
1523 */
1524 render: SpecPolicy.DEFINE_ONCE,
1525
1526
1527
1528 // ==== Delegate methods ====
1529
1530 /**
1531 * Invoked when the component is initially created and about to be mounted.
1532 * This may have side effects, but any external subscriptions or data created
1533 * by this method must be cleaned up in `componentWillUnmount`.
1534 *
1535 * @optional
1536 */
1537 componentWillMount: SpecPolicy.DEFINE_MANY,
1538
1539 /**
1540 * Invoked when the component has been mounted and has a DOM representation.
1541 * However, there is no guarantee that the DOM node is in the document.
1542 *
1543 * Use this as an opportunity to operate on the DOM when the component has
1544 * been mounted (initialized and rendered) for the first time.
1545 *
1546 * @param {DOMElement} rootNode DOM element representing the component.
1547 * @optional
1548 */
1549 componentDidMount: SpecPolicy.DEFINE_MANY,
1550
1551 /**
1552 * Invoked before the component receives new props.
1553 *
1554 * Use this as an opportunity to react to a prop transition by updating the
1555 * state using `this.setState`. Current props are accessed via `this.props`.
1556 *
1557 * componentWillReceiveProps: function(nextProps, nextContext) {
1558 * this.setState({
1559 * likesIncreasing: nextProps.likeCount > this.props.likeCount
1560 * });
1561 * }
1562 *
1563 * NOTE: There is no equivalent `componentWillReceiveState`. An incoming prop
1564 * transition may cause a state change, but the opposite is not true. If you
1565 * need it, you are probably looking for `componentWillUpdate`.
1566 *
1567 * @param {object} nextProps
1568 * @optional
1569 */
1570 componentWillReceiveProps: SpecPolicy.DEFINE_MANY,
1571
1572 /**
1573 * Invoked while deciding if the component should be updated as a result of
1574 * receiving new props, state and/or context.
1575 *
1576 * Use this as an opportunity to `return false` when you're certain that the
1577 * transition to the new props/state/context will not require a component
1578 * update.
1579 *
1580 * shouldComponentUpdate: function(nextProps, nextState, nextContext) {
1581 * return !equal(nextProps, this.props) ||
1582 * !equal(nextState, this.state) ||
1583 * !equal(nextContext, this.context);
1584 * }
1585 *
1586 * @param {object} nextProps
1587 * @param {?object} nextState
1588 * @param {?object} nextContext
1589 * @return {boolean} True if the component should update.
1590 * @optional
1591 */
1592 shouldComponentUpdate: SpecPolicy.DEFINE_ONCE,
1593
1594 /**
1595 * Invoked when the component is about to update due to a transition from
1596 * `this.props`, `this.state` and `this.context` to `nextProps`, `nextState`
1597 * and `nextContext`.
1598 *
1599 * Use this as an opportunity to perform preparation before an update occurs.
1600 *
1601 * NOTE: You **cannot** use `this.setState()` in this method.
1602 *
1603 * @param {object} nextProps
1604 * @param {?object} nextState
1605 * @param {?object} nextContext
1606 * @param {ReactReconcileTransaction} transaction
1607 * @optional
1608 */
1609 componentWillUpdate: SpecPolicy.DEFINE_MANY,
1610
1611 /**
1612 * Invoked when the component's DOM representation has been updated.
1613 *
1614 * Use this as an opportunity to operate on the DOM when the component has
1615 * been updated.
1616 *
1617 * @param {object} prevProps
1618 * @param {?object} prevState
1619 * @param {?object} prevContext
1620 * @param {DOMElement} rootNode DOM element representing the component.
1621 * @optional
1622 */
1623 componentDidUpdate: SpecPolicy.DEFINE_MANY,
1624
1625 /**
1626 * Invoked when the component is about to be removed from its parent and have
1627 * its DOM representation destroyed.
1628 *
1629 * Use this as an opportunity to deallocate any external resources.
1630 *
1631 * NOTE: There is no `componentDidUnmount` since your component will have been
1632 * destroyed by that point.
1633 *
1634 * @optional
1635 */
1636 componentWillUnmount: SpecPolicy.DEFINE_MANY,
1637
1638
1639
1640 // ==== Advanced methods ====
1641
1642 /**
1643 * Updates the component's currently mounted DOM representation.
1644 *
1645 * By default, this implements React's rendering and reconciliation algorithm.
1646 * Sophisticated clients may wish to override this.
1647 *
1648 * @param {ReactReconcileTransaction} transaction
1649 * @internal
1650 * @overridable
1651 */
1652 updateComponent: SpecPolicy.OVERRIDE_BASE
1653
1654 };
1655
1656 /**
1657 * Mapping from class specification keys to special processing functions.
1658 *
1659 * Although these are declared like instance properties in the specification
1660 * when defining classes using `React.createClass`, they are actually static
1661 * and are accessible on the constructor instead of the prototype. Despite
1662 * being static, they must be defined outside of the "statics" key under
1663 * which all other static methods are defined.
1664 */
1665 var RESERVED_SPEC_KEYS = {
1666 displayName: function(Constructor, displayName) {
1667 Constructor.displayName = displayName;
1668 },
1669 mixins: function(Constructor, mixins) {
1670 if (mixins) {
1671 for (var i = 0; i < mixins.length; i++) {
1672 mixSpecIntoComponent(Constructor, mixins[i]);
1673 }
1674 }
1675 },
1676 childContextTypes: function(Constructor, childContextTypes) {
1677 validateTypeDef(
1678 Constructor,
1679 childContextTypes,
1680 ReactPropTypeLocations.childContext
1681 );
1682 Constructor.childContextTypes = assign(
1683 {},
1684 Constructor.childContextTypes,
1685 childContextTypes
1686 );
1687 },
1688 contextTypes: function(Constructor, contextTypes) {
1689 validateTypeDef(
1690 Constructor,
1691 contextTypes,
1692 ReactPropTypeLocations.context
1693 );
1694 Constructor.contextTypes = assign(
1695 {},
1696 Constructor.contextTypes,
1697 contextTypes
1698 );
1699 },
1700 /**
1701 * Special case getDefaultProps which should move into statics but requires
1702 * automatic merging.
1703 */
1704 getDefaultProps: function(Constructor, getDefaultProps) {
1705 if (Constructor.getDefaultProps) {
1706 Constructor.getDefaultProps = createMergedResultFunction(
1707 Constructor.getDefaultProps,
1708 getDefaultProps
1709 );
1710 } else {
1711 Constructor.getDefaultProps = getDefaultProps;
1712 }
1713 },
1714 propTypes: function(Constructor, propTypes) {
1715 validateTypeDef(
1716 Constructor,
1717 propTypes,
1718 ReactPropTypeLocations.prop
1719 );
1720 Constructor.propTypes = assign(
1721 {},
1722 Constructor.propTypes,
1723 propTypes
1724 );
1725 },
1726 statics: function(Constructor, statics) {
1727 mixStaticSpecIntoComponent(Constructor, statics);
1728 }
1729 };
1730
1731 function getDeclarationErrorAddendum(component) {
1732 var owner = component._owner || null;
1733 if (owner && owner.constructor && owner.constructor.displayName) {
1734 return ' Check the render method of `' + owner.constructor.displayName +
1735 '`.';
1736 }
1737 return '';
1738 }
1739
1740 function validateTypeDef(Constructor, typeDef, location) {
1741 for (var propName in typeDef) {
1742 if (typeDef.hasOwnProperty(propName)) {
1743 ("production" !== process.env.NODE_ENV ? invariant(
1744 typeof typeDef[propName] == 'function',
1745 '%s: %s type `%s` is invalid; it must be a function, usually from ' +
1746 'React.PropTypes.',
1747 Constructor.displayName || 'ReactCompositeComponent',
1748 ReactPropTypeLocationNames[location],
1749 propName
1750 ) : invariant(typeof typeDef[propName] == 'function'));
1751 }
1752 }
1753 }
1754
1755 function validateMethodOverride(proto, name) {
1756 var specPolicy = ReactCompositeComponentInterface.hasOwnProperty(name) ?
1757 ReactCompositeComponentInterface[name] :
1758 null;
1759
1760 // Disallow overriding of base class methods unless explicitly allowed.
1761 if (ReactCompositeComponentMixin.hasOwnProperty(name)) {
1762 ("production" !== process.env.NODE_ENV ? invariant(
1763 specPolicy === SpecPolicy.OVERRIDE_BASE,
1764 'ReactCompositeComponentInterface: You are attempting to override ' +
1765 '`%s` from your class specification. Ensure that your method names ' +
1766 'do not overlap with React methods.',
1767 name
1768 ) : invariant(specPolicy === SpecPolicy.OVERRIDE_BASE));
1769 }
1770
1771 // Disallow defining methods more than once unless explicitly allowed.
1772 if (proto.hasOwnProperty(name)) {
1773 ("production" !== process.env.NODE_ENV ? invariant(
1774 specPolicy === SpecPolicy.DEFINE_MANY ||
1775 specPolicy === SpecPolicy.DEFINE_MANY_MERGED,
1776 'ReactCompositeComponentInterface: You are attempting to define ' +
1777 '`%s` on your component more than once. This conflict may be due ' +
1778 'to a mixin.',
1779 name
1780 ) : invariant(specPolicy === SpecPolicy.DEFINE_MANY ||
1781 specPolicy === SpecPolicy.DEFINE_MANY_MERGED));
1782 }
1783 }
1784
1785 function validateLifeCycleOnReplaceState(instance) {
1786 var compositeLifeCycleState = instance._compositeLifeCycleState;
1787 ("production" !== process.env.NODE_ENV ? invariant(
1788 instance.isMounted() ||
1789 compositeLifeCycleState === CompositeLifeCycle.MOUNTING,
1790 'replaceState(...): Can only update a mounted or mounting component.'
1791 ) : invariant(instance.isMounted() ||
1792 compositeLifeCycleState === CompositeLifeCycle.MOUNTING));
1793 ("production" !== process.env.NODE_ENV ? invariant(
1794 ReactCurrentOwner.current == null,
1795 'replaceState(...): Cannot update during an existing state transition ' +
1796 '(such as within `render`). Render methods should be a pure function ' +
1797 'of props and state.'
1798 ) : invariant(ReactCurrentOwner.current == null));
1799 ("production" !== process.env.NODE_ENV ? invariant(compositeLifeCycleState !== CompositeLifeCycle.UNMOUNTING,
1800 'replaceState(...): Cannot update while unmounting component. This ' +
1801 'usually means you called setState() on an unmounted component.'
1802 ) : invariant(compositeLifeCycleState !== CompositeLifeCycle.UNMOUNTING));
1803 }
1804
1805 /**
1806 * Mixin helper which handles policy validation and reserved
1807 * specification keys when building `ReactCompositeComponent` classses.
1808 */
1809 function mixSpecIntoComponent(Constructor, spec) {
1810 if (!spec) {
1811 return;
1812 }
1813
1814 ("production" !== process.env.NODE_ENV ? invariant(
1815 !ReactLegacyElement.isValidFactory(spec),
1816 'ReactCompositeComponent: You\'re attempting to ' +
1817 'use a component class as a mixin. Instead, just use a regular object.'
1818 ) : invariant(!ReactLegacyElement.isValidFactory(spec)));
1819 ("production" !== process.env.NODE_ENV ? invariant(
1820 !ReactElement.isValidElement(spec),
1821 'ReactCompositeComponent: You\'re attempting to ' +
1822 'use a component as a mixin. Instead, just use a regular object.'
1823 ) : invariant(!ReactElement.isValidElement(spec)));
1824
1825 var proto = Constructor.prototype;
1826
1827 // By handling mixins before any other properties, we ensure the same
1828 // chaining order is applied to methods with DEFINE_MANY policy, whether
1829 // mixins are listed before or after these methods in the spec.
1830 if (spec.hasOwnProperty(MIXINS_KEY)) {
1831 RESERVED_SPEC_KEYS.mixins(Constructor, spec.mixins);
1832 }
1833
1834 for (var name in spec) {
1835 if (!spec.hasOwnProperty(name)) {
1836 continue;
1837 }
1838
1839 if (name === MIXINS_KEY) {
1840 // We have already handled mixins in a special case above
1841 continue;
1842 }
1843
1844 var property = spec[name];
1845 validateMethodOverride(proto, name);
1846
1847 if (RESERVED_SPEC_KEYS.hasOwnProperty(name)) {
1848 RESERVED_SPEC_KEYS[name](Constructor, property);
1849 } else {
1850 // Setup methods on prototype:
1851 // The following member methods should not be automatically bound:
1852 // 1. Expected ReactCompositeComponent methods (in the "interface").
1853 // 2. Overridden methods (that were mixed in).
1854 var isCompositeComponentMethod =
1855 ReactCompositeComponentInterface.hasOwnProperty(name);
1856 var isAlreadyDefined = proto.hasOwnProperty(name);
1857 var markedDontBind = property && property.__reactDontBind;
1858 var isFunction = typeof property === 'function';
1859 var shouldAutoBind =
1860 isFunction &&
1861 !isCompositeComponentMethod &&
1862 !isAlreadyDefined &&
1863 !markedDontBind;
1864
1865 if (shouldAutoBind) {
1866 if (!proto.__reactAutoBindMap) {
1867 proto.__reactAutoBindMap = {};
1868 }
1869 proto.__reactAutoBindMap[name] = property;
1870 proto[name] = property;
1871 } else {
1872 if (isAlreadyDefined) {
1873 var specPolicy = ReactCompositeComponentInterface[name];
1874
1875 // These cases should already be caught by validateMethodOverride
1876 ("production" !== process.env.NODE_ENV ? invariant(
1877 isCompositeComponentMethod && (
1878 specPolicy === SpecPolicy.DEFINE_MANY_MERGED ||
1879 specPolicy === SpecPolicy.DEFINE_MANY
1880 ),
1881 'ReactCompositeComponent: Unexpected spec policy %s for key %s ' +
1882 'when mixing in component specs.',
1883 specPolicy,
1884 name
1885 ) : invariant(isCompositeComponentMethod && (
1886 specPolicy === SpecPolicy.DEFINE_MANY_MERGED ||
1887 specPolicy === SpecPolicy.DEFINE_MANY
1888 )));
1889
1890 // For methods which are defined more than once, call the existing
1891 // methods before calling the new property, merging if appropriate.
1892 if (specPolicy === SpecPolicy.DEFINE_MANY_MERGED) {
1893 proto[name] = createMergedResultFunction(proto[name], property);
1894 } else if (specPolicy === SpecPolicy.DEFINE_MANY) {
1895 proto[name] = createChainedFunction(proto[name], property);
1896 }
1897 } else {
1898 proto[name] = property;
1899 if ("production" !== process.env.NODE_ENV) {
1900 // Add verbose displayName to the function, which helps when looking
1901 // at profiling tools.
1902 if (typeof property === 'function' && spec.displayName) {
1903 proto[name].displayName = spec.displayName + '_' + name;
1904 }
1905 }
1906 }
1907 }
1908 }
1909 }
1910 }
1911
1912 function mixStaticSpecIntoComponent(Constructor, statics) {
1913 if (!statics) {
1914 return;
1915 }
1916 for (var name in statics) {
1917 var property = statics[name];
1918 if (!statics.hasOwnProperty(name)) {
1919 continue;
1920 }
1921
1922 var isReserved = name in RESERVED_SPEC_KEYS;
1923 ("production" !== process.env.NODE_ENV ? invariant(
1924 !isReserved,
1925 'ReactCompositeComponent: You are attempting to define a reserved ' +
1926 'property, `%s`, that shouldn\'t be on the "statics" key. Define it ' +
1927 'as an instance property instead; it will still be accessible on the ' +
1928 'constructor.',
1929 name
1930 ) : invariant(!isReserved));
1931
1932 var isInherited = name in Constructor;
1933 ("production" !== process.env.NODE_ENV ? invariant(
1934 !isInherited,
1935 'ReactCompositeComponent: You are attempting to define ' +
1936 '`%s` on your component more than once. This conflict may be ' +
1937 'due to a mixin.',
1938 name
1939 ) : invariant(!isInherited));
1940 Constructor[name] = property;
1941 }
1942 }
1943
1944 /**
1945 * Merge two objects, but throw if both contain the same key.
1946 *
1947 * @param {object} one The first object, which is mutated.
1948 * @param {object} two The second object
1949 * @return {object} one after it has been mutated to contain everything in two.
1950 */
1951 function mergeObjectsWithNoDuplicateKeys(one, two) {
1952 ("production" !== process.env.NODE_ENV ? invariant(
1953 one && two && typeof one === 'object' && typeof two === 'object',
1954 'mergeObjectsWithNoDuplicateKeys(): Cannot merge non-objects'
1955 ) : invariant(one && two && typeof one === 'object' && typeof two === 'object'));
1956
1957 mapObject(two, function(value, key) {
1958 ("production" !== process.env.NODE_ENV ? invariant(
1959 one[key] === undefined,
1960 'mergeObjectsWithNoDuplicateKeys(): ' +
1961 'Tried to merge two objects with the same key: `%s`. This conflict ' +
1962 'may be due to a mixin; in particular, this may be caused by two ' +
1963 'getInitialState() or getDefaultProps() methods returning objects ' +
1964 'with clashing keys.',
1965 key
1966 ) : invariant(one[key] === undefined));
1967 one[key] = value;
1968 });
1969 return one;
1970 }
1971
1972 /**
1973 * Creates a function that invokes two functions and merges their return values.
1974 *
1975 * @param {function} one Function to invoke first.
1976 * @param {function} two Function to invoke second.
1977 * @return {function} Function that invokes the two argument functions.
1978 * @private
1979 */
1980 function createMergedResultFunction(one, two) {
1981 return function mergedResult() {
1982 var a = one.apply(this, arguments);
1983 var b = two.apply(this, arguments);
1984 if (a == null) {
1985 return b;
1986 } else if (b == null) {
1987 return a;
1988 }
1989 return mergeObjectsWithNoDuplicateKeys(a, b);
1990 };
1991 }
1992
1993 /**
1994 * Creates a function that invokes two functions and ignores their return vales.
1995 *
1996 * @param {function} one Function to invoke first.
1997 * @param {function} two Function to invoke second.
1998 * @return {function} Function that invokes the two argument functions.
1999 * @private
2000 */
2001 function createChainedFunction(one, two) {
2002 return function chainedFunction() {
2003 one.apply(this, arguments);
2004 two.apply(this, arguments);
2005 };
2006 }
2007
2008 /**
2009 * `ReactCompositeComponent` maintains an auxiliary life cycle state in
2010 * `this._compositeLifeCycleState` (which can be null).
2011 *
2012 * This is different from the life cycle state maintained by `ReactComponent` in
2013 * `this._lifeCycleState`. The following diagram shows how the states overlap in
2014 * time. There are times when the CompositeLifeCycle is null - at those times it
2015 * is only meaningful to look at ComponentLifeCycle alone.
2016 *
2017 * Top Row: ReactComponent.ComponentLifeCycle
2018 * Low Row: ReactComponent.CompositeLifeCycle
2019 *
2020 * +-------+---------------------------------+--------+
2021 * | UN | MOUNTED | UN |
2022 * |MOUNTED| | MOUNTED|
2023 * +-------+---------------------------------+--------+
2024 * | ^--------+ +-------+ +--------^ |
2025 * | | | | | | | |
2026 * | 0--|MOUNTING|-0-|RECEIVE|-0-| UN |--->0 |
2027 * | | | |PROPS | |MOUNTING| |
2028 * | | | | | | | |
2029 * | | | | | | | |
2030 * | +--------+ +-------+ +--------+ |
2031 * | | | |
2032 * +-------+---------------------------------+--------+
2033 */
2034 var CompositeLifeCycle = keyMirror({
2035 /**
2036 * Components in the process of being mounted respond to state changes
2037 * differently.
2038 */
2039 MOUNTING: null,
2040 /**
2041 * Components in the process of being unmounted are guarded against state
2042 * changes.
2043 */
2044 UNMOUNTING: null,
2045 /**
2046 * Components that are mounted and receiving new props respond to state
2047 * changes differently.
2048 */
2049 RECEIVING_PROPS: null
2050 });
2051
2052 /**
2053 * @lends {ReactCompositeComponent.prototype}
2054 */
2055 var ReactCompositeComponentMixin = {
2056
2057 /**
2058 * Base constructor for all composite component.
2059 *
2060 * @param {ReactElement} element
2061 * @final
2062 * @internal
2063 */
2064 construct: function(element) {
2065 // Children can be either an array or more than one argument
2066 ReactComponent.Mixin.construct.apply(this, arguments);
2067 ReactOwner.Mixin.construct.apply(this, arguments);
2068
2069 this.state = null;
2070 this._pendingState = null;
2071
2072 // This is the public post-processed context. The real context and pending
2073 // context lives on the element.
2074 this.context = null;
2075
2076 this._compositeLifeCycleState = null;
2077 },
2078
2079 /**
2080 * Checks whether or not this composite component is mounted.
2081 * @return {boolean} True if mounted, false otherwise.
2082 * @protected
2083 * @final
2084 */
2085 isMounted: function() {
2086 return ReactComponent.Mixin.isMounted.call(this) &&
2087 this._compositeLifeCycleState !== CompositeLifeCycle.MOUNTING;
2088 },
2089
2090 /**
2091 * Initializes the component, renders markup, and registers event listeners.
2092 *
2093 * @param {string} rootID DOM ID of the root node.
2094 * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
2095 * @param {number} mountDepth number of components in the owner hierarchy
2096 * @return {?string} Rendered markup to be inserted into the DOM.
2097 * @final
2098 * @internal
2099 */
2100 mountComponent: ReactPerf.measure(
2101 'ReactCompositeComponent',
2102 'mountComponent',
2103 function(rootID, transaction, mountDepth) {
2104 ReactComponent.Mixin.mountComponent.call(
2105 this,
2106 rootID,
2107 transaction,
2108 mountDepth
2109 );
2110 this._compositeLifeCycleState = CompositeLifeCycle.MOUNTING;
2111
2112 if (this.__reactAutoBindMap) {
2113 this._bindAutoBindMethods();
2114 }
2115
2116 this.context = this._processContext(this._currentElement._context);
2117 this.props = this._processProps(this.props);
2118
2119 this.state = this.getInitialState ? this.getInitialState() : null;
2120 ("production" !== process.env.NODE_ENV ? invariant(
2121 typeof this.state === 'object' && !Array.isArray(this.state),
2122 '%s.getInitialState(): must return an object or null',
2123 this.constructor.displayName || 'ReactCompositeComponent'
2124 ) : invariant(typeof this.state === 'object' && !Array.isArray(this.state)));
2125
2126 this._pendingState = null;
2127 this._pendingForceUpdate = false;
2128
2129 if (this.componentWillMount) {
2130 this.componentWillMount();
2131 // When mounting, calls to `setState` by `componentWillMount` will set
2132 // `this._pendingState` without triggering a re-render.
2133 if (this._pendingState) {
2134 this.state = this._pendingState;
2135 this._pendingState = null;
2136 }
2137 }
2138
2139 this._renderedComponent = instantiateReactComponent(
2140 this._renderValidatedComponent(),
2141 this._currentElement.type // The wrapping type
2142 );
2143
2144 // Done with mounting, `setState` will now trigger UI changes.
2145 this._compositeLifeCycleState = null;
2146 var markup = this._renderedComponent.mountComponent(
2147 rootID,
2148 transaction,
2149 mountDepth + 1
2150 );
2151 if (this.componentDidMount) {
2152 transaction.getReactMountReady().enqueue(this.componentDidMount, this);
2153 }
2154 return markup;
2155 }
2156 ),
2157
2158 /**
2159 * Releases any resources allocated by `mountComponent`.
2160 *
2161 * @final
2162 * @internal
2163 */
2164 unmountComponent: function() {
2165 this._compositeLifeCycleState = CompositeLifeCycle.UNMOUNTING;
2166 if (this.componentWillUnmount) {
2167 this.componentWillUnmount();
2168 }
2169 this._compositeLifeCycleState = null;
2170
2171 this._renderedComponent.unmountComponent();
2172 this._renderedComponent = null;
2173
2174 ReactComponent.Mixin.unmountComponent.call(this);
2175
2176 // Some existing components rely on this.props even after they've been
2177 // destroyed (in event handlers).
2178 // TODO: this.props = null;
2179 // TODO: this.state = null;
2180 },
2181
2182 /**
2183 * Sets a subset of the state. Always use this or `replaceState` to mutate
2184 * state. You should treat `this.state` as immutable.
2185 *
2186 * There is no guarantee that `this.state` will be immediately updated, so
2187 * accessing `this.state` after calling this method may return the old value.
2188 *
2189 * There is no guarantee that calls to `setState` will run synchronously,
2190 * as they may eventually be batched together. You can provide an optional
2191 * callback that will be executed when the call to setState is actually
2192 * completed.
2193 *
2194 * @param {object} partialState Next partial state to be merged with state.
2195 * @param {?function} callback Called after state is updated.
2196 * @final
2197 * @protected
2198 */
2199 setState: function(partialState, callback) {
2200 ("production" !== process.env.NODE_ENV ? invariant(
2201 typeof partialState === 'object' || partialState == null,
2202 'setState(...): takes an object of state variables to update.'
2203 ) : invariant(typeof partialState === 'object' || partialState == null));
2204 if ("production" !== process.env.NODE_ENV){
2205 ("production" !== process.env.NODE_ENV ? warning(
2206 partialState != null,
2207 'setState(...): You passed an undefined or null state object; ' +
2208 'instead, use forceUpdate().'
2209 ) : null);
2210 }
2211 // Merge with `_pendingState` if it exists, otherwise with existing state.
2212 this.replaceState(
2213 assign({}, this._pendingState || this.state, partialState),
2214 callback
2215 );
2216 },
2217
2218 /**
2219 * Replaces all of the state. Always use this or `setState` to mutate state.
2220 * You should treat `this.state` as immutable.
2221 *
2222 * There is no guarantee that `this.state` will be immediately updated, so
2223 * accessing `this.state` after calling this method may return the old value.
2224 *
2225 * @param {object} completeState Next state.
2226 * @param {?function} callback Called after state is updated.
2227 * @final
2228 * @protected
2229 */
2230 replaceState: function(completeState, callback) {
2231 validateLifeCycleOnReplaceState(this);
2232 this._pendingState = completeState;
2233 if (this._compositeLifeCycleState !== CompositeLifeCycle.MOUNTING) {
2234 // If we're in a componentWillMount handler, don't enqueue a rerender
2235 // because ReactUpdates assumes we're in a browser context (which is wrong
2236 // for server rendering) and we're about to do a render anyway.
2237 // TODO: The callback here is ignored when setState is called from
2238 // componentWillMount. Either fix it or disallow doing so completely in
2239 // favor of getInitialState.
2240 ReactUpdates.enqueueUpdate(this, callback);
2241 }
2242 },
2243
2244 /**
2245 * Filters the context object to only contain keys specified in
2246 * `contextTypes`, and asserts that they are valid.
2247 *
2248 * @param {object} context
2249 * @return {?object}
2250 * @private
2251 */
2252 _processContext: function(context) {
2253 var maskedContext = null;
2254 var contextTypes = this.constructor.contextTypes;
2255 if (contextTypes) {
2256 maskedContext = {};
2257 for (var contextName in contextTypes) {
2258 maskedContext[contextName] = context[contextName];
2259 }
2260 if ("production" !== process.env.NODE_ENV) {
2261 this._checkPropTypes(
2262 contextTypes,
2263 maskedContext,
2264 ReactPropTypeLocations.context
2265 );
2266 }
2267 }
2268 return maskedContext;
2269 },
2270
2271 /**
2272 * @param {object} currentContext
2273 * @return {object}
2274 * @private
2275 */
2276 _processChildContext: function(currentContext) {
2277 var childContext = this.getChildContext && this.getChildContext();
2278 var displayName = this.constructor.displayName || 'ReactCompositeComponent';
2279 if (childContext) {
2280 ("production" !== process.env.NODE_ENV ? invariant(
2281 typeof this.constructor.childContextTypes === 'object',
2282 '%s.getChildContext(): childContextTypes must be defined in order to ' +
2283 'use getChildContext().',
2284 displayName
2285 ) : invariant(typeof this.constructor.childContextTypes === 'object'));
2286 if ("production" !== process.env.NODE_ENV) {
2287 this._checkPropTypes(
2288 this.constructor.childContextTypes,
2289 childContext,
2290 ReactPropTypeLocations.childContext
2291 );
2292 }
2293 for (var name in childContext) {
2294 ("production" !== process.env.NODE_ENV ? invariant(
2295 name in this.constructor.childContextTypes,
2296 '%s.getChildContext(): key "%s" is not defined in childContextTypes.',
2297 displayName,
2298 name
2299 ) : invariant(name in this.constructor.childContextTypes));
2300 }
2301 return assign({}, currentContext, childContext);
2302 }
2303 return currentContext;
2304 },
2305
2306 /**
2307 * Processes props by setting default values for unspecified props and
2308 * asserting that the props are valid. Does not mutate its argument; returns
2309 * a new props object with defaults merged in.
2310 *
2311 * @param {object} newProps
2312 * @return {object}
2313 * @private
2314 */
2315 _processProps: function(newProps) {
2316 if ("production" !== process.env.NODE_ENV) {
2317 var propTypes = this.constructor.propTypes;
2318 if (propTypes) {
2319 this._checkPropTypes(propTypes, newProps, ReactPropTypeLocations.prop);
2320 }
2321 }
2322 return newProps;
2323 },
2324
2325 /**
2326 * Assert that the props are valid
2327 *
2328 * @param {object} propTypes Map of prop name to a ReactPropType
2329 * @param {object} props
2330 * @param {string} location e.g. "prop", "context", "child context"
2331 * @private
2332 */
2333 _checkPropTypes: function(propTypes, props, location) {
2334 // TODO: Stop validating prop types here and only use the element
2335 // validation.
2336 var componentName = this.constructor.displayName;
2337 for (var propName in propTypes) {
2338 if (propTypes.hasOwnProperty(propName)) {
2339 var error =
2340 propTypes[propName](props, propName, componentName, location);
2341 if (error instanceof Error) {
2342 // We may want to extend this logic for similar errors in
2343 // renderComponent calls, so I'm abstracting it away into
2344 // a function to minimize refactoring in the future
2345 var addendum = getDeclarationErrorAddendum(this);
2346 ("production" !== process.env.NODE_ENV ? warning(false, error.message + addendum) : null);
2347 }
2348 }
2349 }
2350 },
2351
2352 /**
2353 * If any of `_pendingElement`, `_pendingState`, or `_pendingForceUpdate`
2354 * is set, update the component.
2355 *
2356 * @param {ReactReconcileTransaction} transaction
2357 * @internal
2358 */
2359 performUpdateIfNecessary: function(transaction) {
2360 var compositeLifeCycleState = this._compositeLifeCycleState;
2361 // Do not trigger a state transition if we are in the middle of mounting or
2362 // receiving props because both of those will already be doing this.
2363 if (compositeLifeCycleState === CompositeLifeCycle.MOUNTING ||
2364 compositeLifeCycleState === CompositeLifeCycle.RECEIVING_PROPS) {
2365 return;
2366 }
2367
2368 if (this._pendingElement == null &&
2369 this._pendingState == null &&
2370 !this._pendingForceUpdate) {
2371 return;
2372 }
2373
2374 var nextContext = this.context;
2375 var nextProps = this.props;
2376 var nextElement = this._currentElement;
2377 if (this._pendingElement != null) {
2378 nextElement = this._pendingElement;
2379 nextContext = this._processContext(nextElement._context);
2380 nextProps = this._processProps(nextElement.props);
2381 this._pendingElement = null;
2382
2383 this._compositeLifeCycleState = CompositeLifeCycle.RECEIVING_PROPS;
2384 if (this.componentWillReceiveProps) {
2385 this.componentWillReceiveProps(nextProps, nextContext);
2386 }
2387 }
2388
2389 this._compositeLifeCycleState = null;
2390
2391 var nextState = this._pendingState || this.state;
2392 this._pendingState = null;
2393
2394 var shouldUpdate =
2395 this._pendingForceUpdate ||
2396 !this.shouldComponentUpdate ||
2397 this.shouldComponentUpdate(nextProps, nextState, nextContext);
2398
2399 if ("production" !== process.env.NODE_ENV) {
2400 if (typeof shouldUpdate === "undefined") {
2401 console.warn(
2402 (this.constructor.displayName || 'ReactCompositeComponent') +
2403 '.shouldComponentUpdate(): Returned undefined instead of a ' +
2404 'boolean value. Make sure to return true or false.'
2405 );
2406 }
2407 }
2408
2409 if (shouldUpdate) {
2410 this._pendingForceUpdate = false;
2411 // Will set `this.props`, `this.state` and `this.context`.
2412 this._performComponentUpdate(
2413 nextElement,
2414 nextProps,
2415 nextState,
2416 nextContext,
2417 transaction
2418 );
2419 } else {
2420 // If it's determined that a component should not update, we still want
2421 // to set props and state.
2422 this._currentElement = nextElement;
2423 this.props = nextProps;
2424 this.state = nextState;
2425 this.context = nextContext;
2426
2427 // Owner cannot change because shouldUpdateReactComponent doesn't allow
2428 // it. TODO: Remove this._owner completely.
2429 this._owner = nextElement._owner;
2430 }
2431 },
2432
2433 /**
2434 * Merges new props and state, notifies delegate methods of update and
2435 * performs update.
2436 *
2437 * @param {ReactElement} nextElement Next element
2438 * @param {object} nextProps Next public object to set as properties.
2439 * @param {?object} nextState Next object to set as state.
2440 * @param {?object} nextContext Next public object to set as context.
2441 * @param {ReactReconcileTransaction} transaction
2442 * @private
2443 */
2444 _performComponentUpdate: function(
2445 nextElement,
2446 nextProps,
2447 nextState,
2448 nextContext,
2449 transaction
2450 ) {
2451 var prevElement = this._currentElement;
2452 var prevProps = this.props;
2453 var prevState = this.state;
2454 var prevContext = this.context;
2455
2456 if (this.componentWillUpdate) {
2457 this.componentWillUpdate(nextProps, nextState, nextContext);
2458 }
2459
2460 this._currentElement = nextElement;
2461 this.props = nextProps;
2462 this.state = nextState;
2463 this.context = nextContext;
2464
2465 // Owner cannot change because shouldUpdateReactComponent doesn't allow
2466 // it. TODO: Remove this._owner completely.
2467 this._owner = nextElement._owner;
2468
2469 this.updateComponent(
2470 transaction,
2471 prevElement
2472 );
2473
2474 if (this.componentDidUpdate) {
2475 transaction.getReactMountReady().enqueue(
2476 this.componentDidUpdate.bind(this, prevProps, prevState, prevContext),
2477 this
2478 );
2479 }
2480 },
2481
2482 receiveComponent: function(nextElement, transaction) {
2483 if (nextElement === this._currentElement &&
2484 nextElement._owner != null) {
2485 // Since elements are immutable after the owner is rendered,
2486 // we can do a cheap identity compare here to determine if this is a
2487 // superfluous reconcile. It's possible for state to be mutable but such
2488 // change should trigger an update of the owner which would recreate
2489 // the element. We explicitly check for the existence of an owner since
2490 // it's possible for a element created outside a composite to be
2491 // deeply mutated and reused.
2492 return;
2493 }
2494
2495 ReactComponent.Mixin.receiveComponent.call(
2496 this,
2497 nextElement,
2498 transaction
2499 );
2500 },
2501
2502 /**
2503 * Updates the component's currently mounted DOM representation.
2504 *
2505 * By default, this implements React's rendering and reconciliation algorithm.
2506 * Sophisticated clients may wish to override this.
2507 *
2508 * @param {ReactReconcileTransaction} transaction
2509 * @param {ReactElement} prevElement
2510 * @internal
2511 * @overridable
2512 */
2513 updateComponent: ReactPerf.measure(
2514 'ReactCompositeComponent',
2515 'updateComponent',
2516 function(transaction, prevParentElement) {
2517 ReactComponent.Mixin.updateComponent.call(
2518 this,
2519 transaction,
2520 prevParentElement
2521 );
2522
2523 var prevComponentInstance = this._renderedComponent;
2524 var prevElement = prevComponentInstance._currentElement;
2525 var nextElement = this._renderValidatedComponent();
2526 if (shouldUpdateReactComponent(prevElement, nextElement)) {
2527 prevComponentInstance.receiveComponent(nextElement, transaction);
2528 } else {
2529 // These two IDs are actually the same! But nothing should rely on that.
2530 var thisID = this._rootNodeID;
2531 var prevComponentID = prevComponentInstance._rootNodeID;
2532 prevComponentInstance.unmountComponent();
2533 this._renderedComponent = instantiateReactComponent(
2534 nextElement,
2535 this._currentElement.type
2536 );
2537 var nextMarkup = this._renderedComponent.mountComponent(
2538 thisID,
2539 transaction,
2540 this._mountDepth + 1
2541 );
2542 ReactComponent.BackendIDOperations.dangerouslyReplaceNodeWithMarkupByID(
2543 prevComponentID,
2544 nextMarkup
2545 );
2546 }
2547 }
2548 ),
2549
2550 /**
2551 * Forces an update. This should only be invoked when it is known with
2552 * certainty that we are **not** in a DOM transaction.
2553 *
2554 * You may want to call this when you know that some deeper aspect of the
2555 * component's state has changed but `setState` was not called.
2556 *
2557 * This will not invoke `shouldUpdateComponent`, but it will invoke
2558 * `componentWillUpdate` and `componentDidUpdate`.
2559 *
2560 * @param {?function} callback Called after update is complete.
2561 * @final
2562 * @protected
2563 */
2564 forceUpdate: function(callback) {
2565 var compositeLifeCycleState = this._compositeLifeCycleState;
2566 ("production" !== process.env.NODE_ENV ? invariant(
2567 this.isMounted() ||
2568 compositeLifeCycleState === CompositeLifeCycle.MOUNTING,
2569 'forceUpdate(...): Can only force an update on mounted or mounting ' +
2570 'components.'
2571 ) : invariant(this.isMounted() ||
2572 compositeLifeCycleState === CompositeLifeCycle.MOUNTING));
2573 ("production" !== process.env.NODE_ENV ? invariant(
2574 compositeLifeCycleState !== CompositeLifeCycle.UNMOUNTING &&
2575 ReactCurrentOwner.current == null,
2576 'forceUpdate(...): Cannot force an update while unmounting component ' +
2577 'or within a `render` function.'
2578 ) : invariant(compositeLifeCycleState !== CompositeLifeCycle.UNMOUNTING &&
2579 ReactCurrentOwner.current == null));
2580 this._pendingForceUpdate = true;
2581 ReactUpdates.enqueueUpdate(this, callback);
2582 },
2583
2584 /**
2585 * @private
2586 */
2587 _renderValidatedComponent: ReactPerf.measure(
2588 'ReactCompositeComponent',
2589 '_renderValidatedComponent',
2590 function() {
2591 var renderedComponent;
2592 var previousContext = ReactContext.current;
2593 ReactContext.current = this._processChildContext(
2594 this._currentElement._context
2595 );
2596 ReactCurrentOwner.current = this;
2597 try {
2598 renderedComponent = this.render();
2599 if (renderedComponent === null || renderedComponent === false) {
2600 renderedComponent = ReactEmptyComponent.getEmptyComponent();
2601 ReactEmptyComponent.registerNullComponentID(this._rootNodeID);
2602 } else {
2603 ReactEmptyComponent.deregisterNullComponentID(this._rootNodeID);
2604 }
2605 } finally {
2606 ReactContext.current = previousContext;
2607 ReactCurrentOwner.current = null;
2608 }
2609 ("production" !== process.env.NODE_ENV ? invariant(
2610 ReactElement.isValidElement(renderedComponent),
2611 '%s.render(): A valid ReactComponent must be returned. You may have ' +
2612 'returned undefined, an array or some other invalid object.',
2613 this.constructor.displayName || 'ReactCompositeComponent'
2614 ) : invariant(ReactElement.isValidElement(renderedComponent)));
2615 return renderedComponent;
2616 }
2617 ),
2618
2619 /**
2620 * @private
2621 */
2622 _bindAutoBindMethods: function() {
2623 for (var autoBindKey in this.__reactAutoBindMap) {
2624 if (!this.__reactAutoBindMap.hasOwnProperty(autoBindKey)) {
2625 continue;
2626 }
2627 var method = this.__reactAutoBindMap[autoBindKey];
2628 this[autoBindKey] = this._bindAutoBindMethod(ReactErrorUtils.guard(
2629 method,
2630 this.constructor.displayName + '.' + autoBindKey
2631 ));
2632 }
2633 },
2634
2635 /**
2636 * Binds a method to the component.
2637 *
2638 * @param {function} method Method to be bound.
2639 * @private
2640 */
2641 _bindAutoBindMethod: function(method) {
2642 var component = this;
2643 var boundMethod = method.bind(component);
2644 if ("production" !== process.env.NODE_ENV) {
2645 boundMethod.__reactBoundContext = component;
2646 boundMethod.__reactBoundMethod = method;
2647 boundMethod.__reactBoundArguments = null;
2648 var componentName = component.constructor.displayName;
2649 var _bind = boundMethod.bind;
2650 boundMethod.bind = function(newThis ) {for (var args=[],$__0=1,$__1=arguments.length;$__0<$__1;$__0++) args.push(arguments[$__0]);
2651 // User is trying to bind() an autobound method; we effectively will
2652 // ignore the value of "this" that the user is trying to use, so
2653 // let's warn.
2654 if (newThis !== component && newThis !== null) {
2655 monitorCodeUse('react_bind_warning', { component: componentName });
2656 console.warn(
2657 'bind(): React component methods may only be bound to the ' +
2658 'component instance. See ' + componentName
2659 );
2660 } else if (!args.length) {
2661 monitorCodeUse('react_bind_warning', { component: componentName });
2662 console.warn(
2663 'bind(): You are binding a component method to the component. ' +
2664 'React does this for you automatically in a high-performance ' +
2665 'way, so you can safely remove this call. See ' + componentName
2666 );
2667 return boundMethod;
2668 }
2669 var reboundMethod = _bind.apply(boundMethod, arguments);
2670 reboundMethod.__reactBoundContext = component;
2671 reboundMethod.__reactBoundMethod = method;
2672 reboundMethod.__reactBoundArguments = args;
2673 return reboundMethod;
2674 };
2675 }
2676 return boundMethod;
2677 }
2678 };
2679
2680 var ReactCompositeComponentBase = function() {};
2681 assign(
2682 ReactCompositeComponentBase.prototype,
2683 ReactComponent.Mixin,
2684 ReactOwner.Mixin,
2685 ReactPropTransferer.Mixin,
2686 ReactCompositeComponentMixin
2687 );
2688
2689 /**
2690 * Module for creating composite components.
2691 *
2692 * @class ReactCompositeComponent
2693 * @extends ReactComponent
2694 * @extends ReactOwner
2695 * @extends ReactPropTransferer
2696 */
2697 var ReactCompositeComponent = {
2698
2699 LifeCycle: CompositeLifeCycle,
2700
2701 Base: ReactCompositeComponentBase,
2702
2703 /**
2704 * Creates a composite component class given a class specification.
2705 *
2706 * @param {object} spec Class specification (which must define `render`).
2707 * @return {function} Component constructor function.
2708 * @public
2709 */
2710 createClass: function(spec) {
2711 var Constructor = function(props) {
2712 // This constructor is overridden by mocks. The argument is used
2713 // by mocks to assert on what gets mounted. This will later be used
2714 // by the stand-alone class implementation.
2715 };
2716 Constructor.prototype = new ReactCompositeComponentBase();
2717 Constructor.prototype.constructor = Constructor;
2718
2719 injectedMixins.forEach(
2720 mixSpecIntoComponent.bind(null, Constructor)
2721 );
2722
2723 mixSpecIntoComponent(Constructor, spec);
2724
2725 // Initialize the defaultProps property after all mixins have been merged
2726 if (Constructor.getDefaultProps) {
2727 Constructor.defaultProps = Constructor.getDefaultProps();
2728 }
2729
2730 ("production" !== process.env.NODE_ENV ? invariant(
2731 Constructor.prototype.render,
2732 'createClass(...): Class specification must implement a `render` method.'
2733 ) : invariant(Constructor.prototype.render));
2734
2735 if ("production" !== process.env.NODE_ENV) {
2736 if (Constructor.prototype.componentShouldUpdate) {
2737 monitorCodeUse(
2738 'react_component_should_update_warning',
2739 { component: spec.displayName }
2740 );
2741 console.warn(
2742 (spec.displayName || 'A component') + ' has a method called ' +
2743 'componentShouldUpdate(). Did you mean shouldComponentUpdate()? ' +
2744 'The name is phrased as a question because the function is ' +
2745 'expected to return a value.'
2746 );
2747 }
2748 }
2749
2750 // Reduce time spent doing lookups by setting these on the prototype.
2751 for (var methodName in ReactCompositeComponentInterface) {
2752 if (!Constructor.prototype[methodName]) {
2753 Constructor.prototype[methodName] = null;
2754 }
2755 }
2756
2757 if ("production" !== process.env.NODE_ENV) {
2758 return ReactLegacyElement.wrapFactory(
2759 ReactElementValidator.createFactory(Constructor)
2760 );
2761 }
2762 return ReactLegacyElement.wrapFactory(
2763 ReactElement.createFactory(Constructor)
2764 );
2765 },
2766
2767 injection: {
2768 injectMixin: function(mixin) {
2769 injectedMixins.push(mixin);
2770 }
2771 }
2772 };
2773
2774 module.exports = ReactCompositeComponent;
2775
2776 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(27)))
2777
2778/***/ },
2779/* 8 */
2780/***/ function(module, exports, __webpack_require__) {
2781
2782 /**
2783 * Copyright 2013-2014, Facebook, Inc.
2784 * All rights reserved.
2785 *
2786 * This source code is licensed under the BSD-style license found in the
2787 * LICENSE file in the root directory of this source tree. An additional grant
2788 * of patent rights can be found in the PATENTS file in the same directory.
2789 *
2790 * @providesModule ReactContext
2791 */
2792
2793 "use strict";
2794
2795 var assign = __webpack_require__(23);
2796
2797 /**
2798 * Keeps track of the current context.
2799 *
2800 * The context is automatically passed down the component ownership hierarchy
2801 * and is accessible via `this.context` on ReactCompositeComponents.
2802 */
2803 var ReactContext = {
2804
2805 /**
2806 * @internal
2807 * @type {object}
2808 */
2809 current: {},
2810
2811 /**
2812 * Temporarily extends the current context while executing scopedCallback.
2813 *
2814 * A typical use case might look like
2815 *
2816 * render: function() {
2817 * var children = ReactContext.withContext({foo: 'foo'}, () => (
2818 *
2819 * ));
2820 * return <div>{children}</div>;
2821 * }
2822 *
2823 * @param {object} newContext New context to merge into the existing context
2824 * @param {function} scopedCallback Callback to run with the new context
2825 * @return {ReactComponent|array<ReactComponent>}
2826 */
2827 withContext: function(newContext, scopedCallback) {
2828 var result;
2829 var previousContext = ReactContext.current;
2830 ReactContext.current = assign({}, previousContext, newContext);
2831 try {
2832 result = scopedCallback();
2833 } finally {
2834 ReactContext.current = previousContext;
2835 }
2836 return result;
2837 }
2838
2839 };
2840
2841 module.exports = ReactContext;
2842
2843
2844/***/ },
2845/* 9 */
2846/***/ function(module, exports, __webpack_require__) {
2847
2848 /**
2849 * Copyright 2013-2014, Facebook, Inc.
2850 * All rights reserved.
2851 *
2852 * This source code is licensed under the BSD-style license found in the
2853 * LICENSE file in the root directory of this source tree. An additional grant
2854 * of patent rights can be found in the PATENTS file in the same directory.
2855 *
2856 * @providesModule ReactCurrentOwner
2857 */
2858
2859 "use strict";
2860
2861 /**
2862 * Keeps track of the current owner.
2863 *
2864 * The current owner is the component who should own any components that are
2865 * currently being constructed.
2866 *
2867 * The depth indicate how many composite components are above this render level.
2868 */
2869 var ReactCurrentOwner = {
2870
2871 /**
2872 * @internal
2873 * @type {ReactComponent}
2874 */
2875 current: null
2876
2877 };
2878
2879 module.exports = ReactCurrentOwner;
2880
2881
2882/***/ },
2883/* 10 */
2884/***/ function(module, exports, __webpack_require__) {
2885
2886 /* WEBPACK VAR INJECTION */(function(process) {/**
2887 * Copyright 2014, Facebook, Inc.
2888 * All rights reserved.
2889 *
2890 * This source code is licensed under the BSD-style license found in the
2891 * LICENSE file in the root directory of this source tree. An additional grant
2892 * of patent rights can be found in the PATENTS file in the same directory.
2893 *
2894 * @providesModule ReactElement
2895 */
2896
2897 "use strict";
2898
2899 var ReactContext = __webpack_require__(8);
2900 var ReactCurrentOwner = __webpack_require__(9);
2901
2902 var warning = __webpack_require__(31);
2903
2904 var RESERVED_PROPS = {
2905 key: true,
2906 ref: true
2907 };
2908
2909 /**
2910 * Warn for mutations.
2911 *
2912 * @internal
2913 * @param {object} object
2914 * @param {string} key
2915 */
2916 function defineWarningProperty(object, key) {
2917 Object.defineProperty(object, key, {
2918
2919 configurable: false,
2920 enumerable: true,
2921
2922 get: function() {
2923 if (!this._store) {
2924 return null;
2925 }
2926 return this._store[key];
2927 },
2928
2929 set: function(value) {
2930 ("production" !== process.env.NODE_ENV ? warning(
2931 false,
2932 'Don\'t set the ' + key + ' property of the component. ' +
2933 'Mutate the existing props object instead.'
2934 ) : null);
2935 this._store[key] = value;
2936 }
2937
2938 });
2939 }
2940
2941 /**
2942 * This is updated to true if the membrane is successfully created.
2943 */
2944 var useMutationMembrane = false;
2945
2946 /**
2947 * Warn for mutations.
2948 *
2949 * @internal
2950 * @param {object} element
2951 */
2952 function defineMutationMembrane(prototype) {
2953 try {
2954 var pseudoFrozenProperties = {
2955 props: true
2956 };
2957 for (var key in pseudoFrozenProperties) {
2958 defineWarningProperty(prototype, key);
2959 }
2960 useMutationMembrane = true;
2961 } catch (x) {
2962 // IE will fail on defineProperty
2963 }
2964 }
2965
2966 /**
2967 * Base constructor for all React elements. This is only used to make this
2968 * work with a dynamic instanceof check. Nothing should live on this prototype.
2969 *
2970 * @param {*} type
2971 * @param {string|object} ref
2972 * @param {*} key
2973 * @param {*} props
2974 * @internal
2975 */
2976 var ReactElement = function(type, key, ref, owner, context, props) {
2977 // Built-in properties that belong on the element
2978 this.type = type;
2979 this.key = key;
2980 this.ref = ref;
2981
2982 // Record the component responsible for creating this element.
2983 this._owner = owner;
2984
2985 // TODO: Deprecate withContext, and then the context becomes accessible
2986 // through the owner.
2987 this._context = context;
2988
2989 if ("production" !== process.env.NODE_ENV) {
2990 // The validation flag and props are currently mutative. We put them on
2991 // an external backing store so that we can freeze the whole object.
2992 // This can be replaced with a WeakMap once they are implemented in
2993 // commonly used development environments.
2994 this._store = { validated: false, props: props };
2995
2996 // We're not allowed to set props directly on the object so we early
2997 // return and rely on the prototype membrane to forward to the backing
2998 // store.
2999 if (useMutationMembrane) {
3000 Object.freeze(this);
3001 return;
3002 }
3003 }
3004
3005 this.props = props;
3006 };
3007
3008 // We intentionally don't expose the function on the constructor property.
3009 // ReactElement should be indistinguishable from a plain object.
3010 ReactElement.prototype = {
3011 _isReactElement: true
3012 };
3013
3014 if ("production" !== process.env.NODE_ENV) {
3015 defineMutationMembrane(ReactElement.prototype);
3016 }
3017
3018 ReactElement.createElement = function(type, config, children) {
3019 var propName;
3020
3021 // Reserved names are extracted
3022 var props = {};
3023
3024 var key = null;
3025 var ref = null;
3026
3027 if (config != null) {
3028 ref = config.ref === undefined ? null : config.ref;
3029 if ("production" !== process.env.NODE_ENV) {
3030 ("production" !== process.env.NODE_ENV ? warning(
3031 config.key !== null,
3032 'createElement(...): Encountered component with a `key` of null. In ' +
3033 'a future version, this will be treated as equivalent to the string ' +
3034 '\'null\'; instead, provide an explicit key or use undefined.'
3035 ) : null);
3036 }
3037 // TODO: Change this back to `config.key === undefined`
3038 key = config.key == null ? null : '' + config.key;
3039 // Remaining properties are added to a new props object
3040 for (propName in config) {
3041 if (config.hasOwnProperty(propName) &&
3042 !RESERVED_PROPS.hasOwnProperty(propName)) {
3043 props[propName] = config[propName];
3044 }
3045 }
3046 }
3047
3048 // Children can be more than one argument, and those are transferred onto
3049 // the newly allocated props object.
3050 var childrenLength = arguments.length - 2;
3051 if (childrenLength === 1) {
3052 props.children = children;
3053 } else if (childrenLength > 1) {
3054 var childArray = Array(childrenLength);
3055 for (var i = 0; i < childrenLength; i++) {
3056 childArray[i] = arguments[i + 2];
3057 }
3058 props.children = childArray;
3059 }
3060
3061 // Resolve default props
3062 if (type && type.defaultProps) {
3063 var defaultProps = type.defaultProps;
3064 for (propName in defaultProps) {
3065 if (typeof props[propName] === 'undefined') {
3066 props[propName] = defaultProps[propName];
3067 }
3068 }
3069 }
3070
3071 return new ReactElement(
3072 type,
3073 key,
3074 ref,
3075 ReactCurrentOwner.current,
3076 ReactContext.current,
3077 props
3078 );
3079 };
3080
3081 ReactElement.createFactory = function(type) {
3082 var factory = ReactElement.createElement.bind(null, type);
3083 // Expose the type on the factory and the prototype so that it can be
3084 // easily accessed on elements. E.g. <Foo />.type === Foo.type.
3085 // This should not be named `constructor` since this may not be the function
3086 // that created the element, and it may not even be a constructor.
3087 factory.type = type;
3088 return factory;
3089 };
3090
3091 ReactElement.cloneAndReplaceProps = function(oldElement, newProps) {
3092 var newElement = new ReactElement(
3093 oldElement.type,
3094 oldElement.key,
3095 oldElement.ref,
3096 oldElement._owner,
3097 oldElement._context,
3098 newProps
3099 );
3100
3101 if ("production" !== process.env.NODE_ENV) {
3102 // If the key on the original is valid, then the clone is valid
3103 newElement._store.validated = oldElement._store.validated;
3104 }
3105 return newElement;
3106 };
3107
3108 /**
3109 * @param {?object} object
3110 * @return {boolean} True if `object` is a valid component.
3111 * @final
3112 */
3113 ReactElement.isValidElement = function(object) {
3114 // ReactTestUtils is often used outside of beforeEach where as React is
3115 // within it. This leads to two different instances of React on the same
3116 // page. To identify a element from a different React instance we use
3117 // a flag instead of an instanceof check.
3118 var isElement = !!(object && object._isReactElement);
3119 // if (isElement && !(object instanceof ReactElement)) {
3120 // This is an indicator that you're using multiple versions of React at the
3121 // same time. This will screw with ownership and stuff. Fix it, please.
3122 // TODO: We could possibly warn here.
3123 // }
3124 return isElement;
3125 };
3126
3127 module.exports = ReactElement;
3128
3129 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(27)))
3130
3131/***/ },
3132/* 11 */
3133/***/ function(module, exports, __webpack_require__) {
3134
3135 /* WEBPACK VAR INJECTION */(function(process) {/**
3136 * Copyright 2014, Facebook, Inc.
3137 * All rights reserved.
3138 *
3139 * This source code is licensed under the BSD-style license found in the
3140 * LICENSE file in the root directory of this source tree. An additional grant
3141 * of patent rights can be found in the PATENTS file in the same directory.
3142 *
3143 * @providesModule ReactElementValidator
3144 */
3145
3146 /**
3147 * ReactElementValidator provides a wrapper around a element factory
3148 * which validates the props passed to the element. This is intended to be
3149 * used only in DEV and could be replaced by a static type checker for languages
3150 * that support it.
3151 */
3152
3153 "use strict";
3154
3155 var ReactElement = __webpack_require__(10);
3156 var ReactPropTypeLocations = __webpack_require__(40);
3157 var ReactCurrentOwner = __webpack_require__(9);
3158
3159 var monitorCodeUse = __webpack_require__(46);
3160 var warning = __webpack_require__(31);
3161
3162 /**
3163 * Warn if there's no key explicitly set on dynamic arrays of children or
3164 * object keys are not valid. This allows us to keep track of children between
3165 * updates.
3166 */
3167 var ownerHasKeyUseWarning = {
3168 'react_key_warning': {},
3169 'react_numeric_key_warning': {}
3170 };
3171 var ownerHasMonitoredObjectMap = {};
3172
3173 var loggedTypeFailures = {};
3174
3175 var NUMERIC_PROPERTY_REGEX = /^\d+$/;
3176
3177 /**
3178 * Gets the current owner's displayName for use in warnings.
3179 *
3180 * @internal
3181 * @return {?string} Display name or undefined
3182 */
3183 function getCurrentOwnerDisplayName() {
3184 var current = ReactCurrentOwner.current;
3185 return current && current.constructor.displayName || undefined;
3186 }
3187
3188 /**
3189 * Warn if the component doesn't have an explicit key assigned to it.
3190 * This component is in an array. The array could grow and shrink or be
3191 * reordered. All children that haven't already been validated are required to
3192 * have a "key" property assigned to it.
3193 *
3194 * @internal
3195 * @param {ReactComponent} component Component that requires a key.
3196 * @param {*} parentType component's parent's type.
3197 */
3198 function validateExplicitKey(component, parentType) {
3199 if (component._store.validated || component.key != null) {
3200 return;
3201 }
3202 component._store.validated = true;
3203
3204 warnAndMonitorForKeyUse(
3205 'react_key_warning',
3206 'Each child in an array should have a unique "key" prop.',
3207 component,
3208 parentType
3209 );
3210 }
3211
3212 /**
3213 * Warn if the key is being defined as an object property but has an incorrect
3214 * value.
3215 *
3216 * @internal
3217 * @param {string} name Property name of the key.
3218 * @param {ReactComponent} component Component that requires a key.
3219 * @param {*} parentType component's parent's type.
3220 */
3221 function validatePropertyKey(name, component, parentType) {
3222 if (!NUMERIC_PROPERTY_REGEX.test(name)) {
3223 return;
3224 }
3225 warnAndMonitorForKeyUse(
3226 'react_numeric_key_warning',
3227 'Child objects should have non-numeric keys so ordering is preserved.',
3228 component,
3229 parentType
3230 );
3231 }
3232
3233 /**
3234 * Shared warning and monitoring code for the key warnings.
3235 *
3236 * @internal
3237 * @param {string} warningID The id used when logging.
3238 * @param {string} message The base warning that gets output.
3239 * @param {ReactComponent} component Component that requires a key.
3240 * @param {*} parentType component's parent's type.
3241 */
3242 function warnAndMonitorForKeyUse(warningID, message, component, parentType) {
3243 var ownerName = getCurrentOwnerDisplayName();
3244 var parentName = parentType.displayName;
3245
3246 var useName = ownerName || parentName;
3247 var memoizer = ownerHasKeyUseWarning[warningID];
3248 if (memoizer.hasOwnProperty(useName)) {
3249 return;
3250 }
3251 memoizer[useName] = true;
3252
3253 message += ownerName ?
3254 (" Check the render method of " + ownerName + ".") :
3255 (" Check the renderComponent call using <" + parentName + ">.");
3256
3257 // Usually the current owner is the offender, but if it accepts children as a
3258 // property, it may be the creator of the child that's responsible for
3259 // assigning it a key.
3260 var childOwnerName = null;
3261 if (component._owner && component._owner !== ReactCurrentOwner.current) {
3262 // Name of the component that originally created this child.
3263 childOwnerName = component._owner.constructor.displayName;
3264
3265 message += (" It was passed a child from " + childOwnerName + ".");
3266 }
3267
3268 message += ' See http://fb.me/react-warning-keys for more information.';
3269 monitorCodeUse(warningID, {
3270 component: useName,
3271 componentOwner: childOwnerName
3272 });
3273 console.warn(message);
3274 }
3275
3276 /**
3277 * Log that we're using an object map. We're considering deprecating this
3278 * feature and replace it with proper Map and ImmutableMap data structures.
3279 *
3280 * @internal
3281 */
3282 function monitorUseOfObjectMap() {
3283 var currentName = getCurrentOwnerDisplayName() || '';
3284 if (ownerHasMonitoredObjectMap.hasOwnProperty(currentName)) {
3285 return;
3286 }
3287 ownerHasMonitoredObjectMap[currentName] = true;
3288 monitorCodeUse('react_object_map_children');
3289 }
3290
3291 /**
3292 * Ensure that every component either is passed in a static location, in an
3293 * array with an explicit keys property defined, or in an object literal
3294 * with valid key property.
3295 *
3296 * @internal
3297 * @param {*} component Statically passed child of any type.
3298 * @param {*} parentType component's parent's type.
3299 * @return {boolean}
3300 */
3301 function validateChildKeys(component, parentType) {
3302 if (Array.isArray(component)) {
3303 for (var i = 0; i < component.length; i++) {
3304 var child = component[i];
3305 if (ReactElement.isValidElement(child)) {
3306 validateExplicitKey(child, parentType);
3307 }
3308 }
3309 } else if (ReactElement.isValidElement(component)) {
3310 // This component was passed in a valid location.
3311 component._store.validated = true;
3312 } else if (component && typeof component === 'object') {
3313 monitorUseOfObjectMap();
3314 for (var name in component) {
3315 validatePropertyKey(name, component[name], parentType);
3316 }
3317 }
3318 }
3319
3320 /**
3321 * Assert that the props are valid
3322 *
3323 * @param {string} componentName Name of the component for error messages.
3324 * @param {object} propTypes Map of prop name to a ReactPropType
3325 * @param {object} props
3326 * @param {string} location e.g. "prop", "context", "child context"
3327 * @private
3328 */
3329 function checkPropTypes(componentName, propTypes, props, location) {
3330 for (var propName in propTypes) {
3331 if (propTypes.hasOwnProperty(propName)) {
3332 var error;
3333 // Prop type validation may throw. In case they do, we don't want to
3334 // fail the render phase where it didn't fail before. So we log it.
3335 // After these have been cleaned up, we'll let them throw.
3336 try {
3337 error = propTypes[propName](props, propName, componentName, location);
3338 } catch (ex) {
3339 error = ex;
3340 }
3341 if (error instanceof Error && !(error.message in loggedTypeFailures)) {
3342 // Only monitor this failure once because there tends to be a lot of the
3343 // same error.
3344 loggedTypeFailures[error.message] = true;
3345 // This will soon use the warning module
3346 monitorCodeUse(
3347 'react_failed_descriptor_type_check',
3348 { message: error.message }
3349 );
3350 }
3351 }
3352 }
3353 }
3354
3355 var ReactElementValidator = {
3356
3357 createElement: function(type, props, children) {
3358 // We warn in this case but don't throw. We expect the element creation to
3359 // succeed and there will likely be errors in render.
3360 ("production" !== process.env.NODE_ENV ? warning(
3361 type != null,
3362 'React.createElement: type should not be null or undefined. It should ' +
3363 'be a string (for DOM elements) or a ReactClass (for composite ' +
3364 'components).'
3365 ) : null);
3366
3367 var element = ReactElement.createElement.apply(this, arguments);
3368
3369 // The result can be nullish if a mock or a custom function is used.
3370 // TODO: Drop this when these are no longer allowed as the type argument.
3371 if (element == null) {
3372 return element;
3373 }
3374
3375 for (var i = 2; i < arguments.length; i++) {
3376 validateChildKeys(arguments[i], type);
3377 }
3378
3379 if (type) {
3380 var name = type.displayName;
3381 if (type.propTypes) {
3382 checkPropTypes(
3383 name,
3384 type.propTypes,
3385 element.props,
3386 ReactPropTypeLocations.prop
3387 );
3388 }
3389 if (type.contextTypes) {
3390 checkPropTypes(
3391 name,
3392 type.contextTypes,
3393 element._context,
3394 ReactPropTypeLocations.context
3395 );
3396 }
3397 }
3398 return element;
3399 },
3400
3401 createFactory: function(type) {
3402 var validatedFactory = ReactElementValidator.createElement.bind(
3403 null,
3404 type
3405 );
3406 validatedFactory.type = type;
3407 return validatedFactory;
3408 }
3409
3410 };
3411
3412 module.exports = ReactElementValidator;
3413
3414 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(27)))
3415
3416/***/ },
3417/* 12 */
3418/***/ function(module, exports, __webpack_require__) {
3419
3420 /* WEBPACK VAR INJECTION */(function(process) {/**
3421 * Copyright 2013-2014, Facebook, Inc.
3422 * All rights reserved.
3423 *
3424 * This source code is licensed under the BSD-style license found in the
3425 * LICENSE file in the root directory of this source tree. An additional grant
3426 * of patent rights can be found in the PATENTS file in the same directory.
3427 *
3428 * @providesModule ReactDOM
3429 * @typechecks static-only
3430 */
3431
3432 "use strict";
3433
3434 var ReactElement = __webpack_require__(10);
3435 var ReactElementValidator = __webpack_require__(11);
3436 var ReactLegacyElement = __webpack_require__(16);
3437
3438 var mapObject = __webpack_require__(47);
3439
3440 /**
3441 * Create a factory that creates HTML tag elements.
3442 *
3443 * @param {string} tag Tag name (e.g. `div`).
3444 * @private
3445 */
3446 function createDOMFactory(tag) {
3447 if ("production" !== process.env.NODE_ENV) {
3448 return ReactLegacyElement.markNonLegacyFactory(
3449 ReactElementValidator.createFactory(tag)
3450 );
3451 }
3452 return ReactLegacyElement.markNonLegacyFactory(
3453 ReactElement.createFactory(tag)
3454 );
3455 }
3456
3457 /**
3458 * Creates a mapping from supported HTML tags to `ReactDOMComponent` classes.
3459 * This is also accessible via `React.DOM`.
3460 *
3461 * @public
3462 */
3463 var ReactDOM = mapObject({
3464 a: 'a',
3465 abbr: 'abbr',
3466 address: 'address',
3467 area: 'area',
3468 article: 'article',
3469 aside: 'aside',
3470 audio: 'audio',
3471 b: 'b',
3472 base: 'base',
3473 bdi: 'bdi',
3474 bdo: 'bdo',
3475 big: 'big',
3476 blockquote: 'blockquote',
3477 body: 'body',
3478 br: 'br',
3479 button: 'button',
3480 canvas: 'canvas',
3481 caption: 'caption',
3482 cite: 'cite',
3483 code: 'code',
3484 col: 'col',
3485 colgroup: 'colgroup',
3486 data: 'data',
3487 datalist: 'datalist',
3488 dd: 'dd',
3489 del: 'del',
3490 details: 'details',
3491 dfn: 'dfn',
3492 dialog: 'dialog',
3493 div: 'div',
3494 dl: 'dl',
3495 dt: 'dt',
3496 em: 'em',
3497 embed: 'embed',
3498 fieldset: 'fieldset',
3499 figcaption: 'figcaption',
3500 figure: 'figure',
3501 footer: 'footer',
3502 form: 'form',
3503 h1: 'h1',
3504 h2: 'h2',
3505 h3: 'h3',
3506 h4: 'h4',
3507 h5: 'h5',
3508 h6: 'h6',
3509 head: 'head',
3510 header: 'header',
3511 hr: 'hr',
3512 html: 'html',
3513 i: 'i',
3514 iframe: 'iframe',
3515 img: 'img',
3516 input: 'input',
3517 ins: 'ins',
3518 kbd: 'kbd',
3519 keygen: 'keygen',
3520 label: 'label',
3521 legend: 'legend',
3522 li: 'li',
3523 link: 'link',
3524 main: 'main',
3525 map: 'map',
3526 mark: 'mark',
3527 menu: 'menu',
3528 menuitem: 'menuitem',
3529 meta: 'meta',
3530 meter: 'meter',
3531 nav: 'nav',
3532 noscript: 'noscript',
3533 object: 'object',
3534 ol: 'ol',
3535 optgroup: 'optgroup',
3536 option: 'option',
3537 output: 'output',
3538 p: 'p',
3539 param: 'param',
3540 picture: 'picture',
3541 pre: 'pre',
3542 progress: 'progress',
3543 q: 'q',
3544 rp: 'rp',
3545 rt: 'rt',
3546 ruby: 'ruby',
3547 s: 's',
3548 samp: 'samp',
3549 script: 'script',
3550 section: 'section',
3551 select: 'select',
3552 small: 'small',
3553 source: 'source',
3554 span: 'span',
3555 strong: 'strong',
3556 style: 'style',
3557 sub: 'sub',
3558 summary: 'summary',
3559 sup: 'sup',
3560 table: 'table',
3561 tbody: 'tbody',
3562 td: 'td',
3563 textarea: 'textarea',
3564 tfoot: 'tfoot',
3565 th: 'th',
3566 thead: 'thead',
3567 time: 'time',
3568 title: 'title',
3569 tr: 'tr',
3570 track: 'track',
3571 u: 'u',
3572 ul: 'ul',
3573 'var': 'var',
3574 video: 'video',
3575 wbr: 'wbr',
3576
3577 // SVG
3578 circle: 'circle',
3579 defs: 'defs',
3580 ellipse: 'ellipse',
3581 g: 'g',
3582 line: 'line',
3583 linearGradient: 'linearGradient',
3584 mask: 'mask',
3585 path: 'path',
3586 pattern: 'pattern',
3587 polygon: 'polygon',
3588 polyline: 'polyline',
3589 radialGradient: 'radialGradient',
3590 rect: 'rect',
3591 stop: 'stop',
3592 svg: 'svg',
3593 text: 'text',
3594 tspan: 'tspan'
3595
3596 }, createDOMFactory);
3597
3598 module.exports = ReactDOM;
3599
3600 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(27)))
3601
3602/***/ },
3603/* 13 */
3604/***/ function(module, exports, __webpack_require__) {
3605
3606 /* WEBPACK VAR INJECTION */(function(process) {/**
3607 * Copyright 2013-2014, Facebook, Inc.
3608 * All rights reserved.
3609 *
3610 * This source code is licensed under the BSD-style license found in the
3611 * LICENSE file in the root directory of this source tree. An additional grant
3612 * of patent rights can be found in the PATENTS file in the same directory.
3613 *
3614 * @providesModule ReactDOMComponent
3615 * @typechecks static-only
3616 */
3617
3618 "use strict";
3619
3620 var CSSPropertyOperations = __webpack_require__(49);
3621 var DOMProperty = __webpack_require__(28);
3622 var DOMPropertyOperations = __webpack_require__(3);
3623 var ReactBrowserComponentMixin = __webpack_require__(50);
3624 var ReactComponent = __webpack_require__(6);
3625 var ReactBrowserEventEmitter = __webpack_require__(51);
3626 var ReactMount = __webpack_require__(17);
3627 var ReactMultiChild = __webpack_require__(18);
3628 var ReactPerf = __webpack_require__(19);
3629
3630 var assign = __webpack_require__(23);
3631 var escapeTextForBrowser = __webpack_require__(29);
3632 var invariant = __webpack_require__(33);
3633 var isEventSupported = __webpack_require__(52);
3634 var keyOf = __webpack_require__(45);
3635 var monitorCodeUse = __webpack_require__(46);
3636
3637 var deleteListener = ReactBrowserEventEmitter.deleteListener;
3638 var listenTo = ReactBrowserEventEmitter.listenTo;
3639 var registrationNameModules = ReactBrowserEventEmitter.registrationNameModules;
3640
3641 // For quickly matching children type, to test if can be treated as content.
3642 var CONTENT_TYPES = {'string': true, 'number': true};
3643
3644 var STYLE = keyOf({style: null});
3645
3646 var ELEMENT_NODE_TYPE = 1;
3647
3648 /**
3649 * @param {?object} props
3650 */
3651 function assertValidProps(props) {
3652 if (!props) {
3653 return;
3654 }
3655 // Note the use of `==` which checks for null or undefined.
3656 ("production" !== process.env.NODE_ENV ? invariant(
3657 props.children == null || props.dangerouslySetInnerHTML == null,
3658 'Can only set one of `children` or `props.dangerouslySetInnerHTML`.'
3659 ) : invariant(props.children == null || props.dangerouslySetInnerHTML == null));
3660 if ("production" !== process.env.NODE_ENV) {
3661 if (props.contentEditable && props.children != null) {
3662 console.warn(
3663 'A component is `contentEditable` and contains `children` managed by ' +
3664 'React. It is now your responsibility to guarantee that none of those '+
3665 'nodes are unexpectedly modified or duplicated. This is probably not ' +
3666 'intentional.'
3667 );
3668 }
3669 }
3670 ("production" !== process.env.NODE_ENV ? invariant(
3671 props.style == null || typeof props.style === 'object',
3672 'The `style` prop expects a mapping from style properties to values, ' +
3673 'not a string.'
3674 ) : invariant(props.style == null || typeof props.style === 'object'));
3675 }
3676
3677 function putListener(id, registrationName, listener, transaction) {
3678 if ("production" !== process.env.NODE_ENV) {
3679 // IE8 has no API for event capturing and the `onScroll` event doesn't
3680 // bubble.
3681 if (registrationName === 'onScroll' &&
3682 !isEventSupported('scroll', true)) {
3683 monitorCodeUse('react_no_scroll_event');
3684 console.warn('This browser doesn\'t support the `onScroll` event');
3685 }
3686 }
3687 var container = ReactMount.findReactContainerForID(id);
3688 if (container) {
3689 var doc = container.nodeType === ELEMENT_NODE_TYPE ?
3690 container.ownerDocument :
3691 container;
3692 listenTo(registrationName, doc);
3693 }
3694 transaction.getPutListenerQueue().enqueuePutListener(
3695 id,
3696 registrationName,
3697 listener
3698 );
3699 }
3700
3701 // For HTML, certain tags should omit their close tag. We keep a whitelist for
3702 // those special cased tags.
3703
3704 var omittedCloseTags = {
3705 'area': true,
3706 'base': true,
3707 'br': true,
3708 'col': true,
3709 'embed': true,
3710 'hr': true,
3711 'img': true,
3712 'input': true,
3713 'keygen': true,
3714 'link': true,
3715 'meta': true,
3716 'param': true,
3717 'source': true,
3718 'track': true,
3719 'wbr': true
3720 // NOTE: menuitem's close tag should be omitted, but that causes problems.
3721 };
3722
3723 // We accept any tag to be rendered but since this gets injected into abitrary
3724 // HTML, we want to make sure that it's a safe tag.
3725 // http://www.w3.org/TR/REC-xml/#NT-Name
3726
3727 var VALID_TAG_REGEX = /^[a-zA-Z][a-zA-Z:_\.\-\d]*$/; // Simplified subset
3728 var validatedTagCache = {};
3729 var hasOwnProperty = {}.hasOwnProperty;
3730
3731 function validateDangerousTag(tag) {
3732 if (!hasOwnProperty.call(validatedTagCache, tag)) {
3733 ("production" !== process.env.NODE_ENV ? invariant(VALID_TAG_REGEX.test(tag), 'Invalid tag: %s', tag) : invariant(VALID_TAG_REGEX.test(tag)));
3734 validatedTagCache[tag] = true;
3735 }
3736 }
3737
3738 /**
3739 * Creates a new React class that is idempotent and capable of containing other
3740 * React components. It accepts event listeners and DOM properties that are
3741 * valid according to `DOMProperty`.
3742 *
3743 * - Event listeners: `onClick`, `onMouseDown`, etc.
3744 * - DOM properties: `className`, `name`, `title`, etc.
3745 *
3746 * The `style` property functions differently from the DOM API. It accepts an
3747 * object mapping of style properties to values.
3748 *
3749 * @constructor ReactDOMComponent
3750 * @extends ReactComponent
3751 * @extends ReactMultiChild
3752 */
3753 function ReactDOMComponent(tag) {
3754 validateDangerousTag(tag);
3755 this._tag = tag;
3756 this.tagName = tag.toUpperCase();
3757 }
3758
3759 ReactDOMComponent.displayName = 'ReactDOMComponent';
3760
3761 ReactDOMComponent.Mixin = {
3762
3763 /**
3764 * Generates root tag markup then recurses. This method has side effects and
3765 * is not idempotent.
3766 *
3767 * @internal
3768 * @param {string} rootID The root DOM ID for this node.
3769 * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
3770 * @param {number} mountDepth number of components in the owner hierarchy
3771 * @return {string} The computed markup.
3772 */
3773 mountComponent: ReactPerf.measure(
3774 'ReactDOMComponent',
3775 'mountComponent',
3776 function(rootID, transaction, mountDepth) {
3777 ReactComponent.Mixin.mountComponent.call(
3778 this,
3779 rootID,
3780 transaction,
3781 mountDepth
3782 );
3783 assertValidProps(this.props);
3784 var closeTag = omittedCloseTags[this._tag] ? '' : '</' + this._tag + '>';
3785 return (
3786 this._createOpenTagMarkupAndPutListeners(transaction) +
3787 this._createContentMarkup(transaction) +
3788 closeTag
3789 );
3790 }
3791 ),
3792
3793 /**
3794 * Creates markup for the open tag and all attributes.
3795 *
3796 * This method has side effects because events get registered.
3797 *
3798 * Iterating over object properties is faster than iterating over arrays.
3799 * @see http://jsperf.com/obj-vs-arr-iteration
3800 *
3801 * @private
3802 * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
3803 * @return {string} Markup of opening tag.
3804 */
3805 _createOpenTagMarkupAndPutListeners: function(transaction) {
3806 var props = this.props;
3807 var ret = '<' + this._tag;
3808
3809 for (var propKey in props) {
3810 if (!props.hasOwnProperty(propKey)) {
3811 continue;
3812 }
3813 var propValue = props[propKey];
3814 if (propValue == null) {
3815 continue;
3816 }
3817 if (registrationNameModules.hasOwnProperty(propKey)) {
3818 putListener(this._rootNodeID, propKey, propValue, transaction);
3819 } else {
3820 if (propKey === STYLE) {
3821 if (propValue) {
3822 propValue = props.style = assign({}, props.style);
3823 }
3824 propValue = CSSPropertyOperations.createMarkupForStyles(propValue);
3825 }
3826 var markup =
3827 DOMPropertyOperations.createMarkupForProperty(propKey, propValue);
3828 if (markup) {
3829 ret += ' ' + markup;
3830 }
3831 }
3832 }
3833
3834 // For static pages, no need to put React ID and checksum. Saves lots of
3835 // bytes.
3836 if (transaction.renderToStaticMarkup) {
3837 return ret + '>';
3838 }
3839
3840 var markupForID = DOMPropertyOperations.createMarkupForID(this._rootNodeID);
3841 return ret + ' ' + markupForID + '>';
3842 },
3843
3844 /**
3845 * Creates markup for the content between the tags.
3846 *
3847 * @private
3848 * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
3849 * @return {string} Content markup.
3850 */
3851 _createContentMarkup: function(transaction) {
3852 // Intentional use of != to avoid catching zero/false.
3853 var innerHTML = this.props.dangerouslySetInnerHTML;
3854 if (innerHTML != null) {
3855 if (innerHTML.__html != null) {
3856 return innerHTML.__html;
3857 }
3858 } else {
3859 var contentToUse =
3860 CONTENT_TYPES[typeof this.props.children] ? this.props.children : null;
3861 var childrenToUse = contentToUse != null ? null : this.props.children;
3862 if (contentToUse != null) {
3863 return escapeTextForBrowser(contentToUse);
3864 } else if (childrenToUse != null) {
3865 var mountImages = this.mountChildren(
3866 childrenToUse,
3867 transaction
3868 );
3869 return mountImages.join('');
3870 }
3871 }
3872 return '';
3873 },
3874
3875 receiveComponent: function(nextElement, transaction) {
3876 if (nextElement === this._currentElement &&
3877 nextElement._owner != null) {
3878 // Since elements are immutable after the owner is rendered,
3879 // we can do a cheap identity compare here to determine if this is a
3880 // superfluous reconcile. It's possible for state to be mutable but such
3881 // change should trigger an update of the owner which would recreate
3882 // the element. We explicitly check for the existence of an owner since
3883 // it's possible for a element created outside a composite to be
3884 // deeply mutated and reused.
3885 return;
3886 }
3887
3888 ReactComponent.Mixin.receiveComponent.call(
3889 this,
3890 nextElement,
3891 transaction
3892 );
3893 },
3894
3895 /**
3896 * Updates a native DOM component after it has already been allocated and
3897 * attached to the DOM. Reconciles the root DOM node, then recurses.
3898 *
3899 * @param {ReactReconcileTransaction} transaction
3900 * @param {ReactElement} prevElement
3901 * @internal
3902 * @overridable
3903 */
3904 updateComponent: ReactPerf.measure(
3905 'ReactDOMComponent',
3906 'updateComponent',
3907 function(transaction, prevElement) {
3908 assertValidProps(this._currentElement.props);
3909 ReactComponent.Mixin.updateComponent.call(
3910 this,
3911 transaction,
3912 prevElement
3913 );
3914 this._updateDOMProperties(prevElement.props, transaction);
3915 this._updateDOMChildren(prevElement.props, transaction);
3916 }
3917 ),
3918
3919 /**
3920 * Reconciles the properties by detecting differences in property values and
3921 * updating the DOM as necessary. This function is probably the single most
3922 * critical path for performance optimization.
3923 *
3924 * TODO: Benchmark whether checking for changed values in memory actually
3925 * improves performance (especially statically positioned elements).
3926 * TODO: Benchmark the effects of putting this at the top since 99% of props
3927 * do not change for a given reconciliation.
3928 * TODO: Benchmark areas that can be improved with caching.
3929 *
3930 * @private
3931 * @param {object} lastProps
3932 * @param {ReactReconcileTransaction} transaction
3933 */
3934 _updateDOMProperties: function(lastProps, transaction) {
3935 var nextProps = this.props;
3936 var propKey;
3937 var styleName;
3938 var styleUpdates;
3939 for (propKey in lastProps) {
3940 if (nextProps.hasOwnProperty(propKey) ||
3941 !lastProps.hasOwnProperty(propKey)) {
3942 continue;
3943 }
3944 if (propKey === STYLE) {
3945 var lastStyle = lastProps[propKey];
3946 for (styleName in lastStyle) {
3947 if (lastStyle.hasOwnProperty(styleName)) {
3948 styleUpdates = styleUpdates || {};
3949 styleUpdates[styleName] = '';
3950 }
3951 }
3952 } else if (registrationNameModules.hasOwnProperty(propKey)) {
3953 deleteListener(this._rootNodeID, propKey);
3954 } else if (
3955 DOMProperty.isStandardName[propKey] ||
3956 DOMProperty.isCustomAttribute(propKey)) {
3957 ReactComponent.BackendIDOperations.deletePropertyByID(
3958 this._rootNodeID,
3959 propKey
3960 );
3961 }
3962 }
3963 for (propKey in nextProps) {
3964 var nextProp = nextProps[propKey];
3965 var lastProp = lastProps[propKey];
3966 if (!nextProps.hasOwnProperty(propKey) || nextProp === lastProp) {
3967 continue;
3968 }
3969 if (propKey === STYLE) {
3970 if (nextProp) {
3971 nextProp = nextProps.style = assign({}, nextProp);
3972 }
3973 if (lastProp) {
3974 // Unset styles on `lastProp` but not on `nextProp`.
3975 for (styleName in lastProp) {
3976 if (lastProp.hasOwnProperty(styleName) &&
3977 (!nextProp || !nextProp.hasOwnProperty(styleName))) {
3978 styleUpdates = styleUpdates || {};
3979 styleUpdates[styleName] = '';
3980 }
3981 }
3982 // Update styles that changed since `lastProp`.
3983 for (styleName in nextProp) {
3984 if (nextProp.hasOwnProperty(styleName) &&
3985 lastProp[styleName] !== nextProp[styleName]) {
3986 styleUpdates = styleUpdates || {};
3987 styleUpdates[styleName] = nextProp[styleName];
3988 }
3989 }
3990 } else {
3991 // Relies on `updateStylesByID` not mutating `styleUpdates`.
3992 styleUpdates = nextProp;
3993 }
3994 } else if (registrationNameModules.hasOwnProperty(propKey)) {
3995 putListener(this._rootNodeID, propKey, nextProp, transaction);
3996 } else if (
3997 DOMProperty.isStandardName[propKey] ||
3998 DOMProperty.isCustomAttribute(propKey)) {
3999 ReactComponent.BackendIDOperations.updatePropertyByID(
4000 this._rootNodeID,
4001 propKey,
4002 nextProp
4003 );
4004 }
4005 }
4006 if (styleUpdates) {
4007 ReactComponent.BackendIDOperations.updateStylesByID(
4008 this._rootNodeID,
4009 styleUpdates
4010 );
4011 }
4012 },
4013
4014 /**
4015 * Reconciles the children with the various properties that affect the
4016 * children content.
4017 *
4018 * @param {object} lastProps
4019 * @param {ReactReconcileTransaction} transaction
4020 */
4021 _updateDOMChildren: function(lastProps, transaction) {
4022 var nextProps = this.props;
4023
4024 var lastContent =
4025 CONTENT_TYPES[typeof lastProps.children] ? lastProps.children : null;
4026 var nextContent =
4027 CONTENT_TYPES[typeof nextProps.children] ? nextProps.children : null;
4028
4029 var lastHtml =
4030 lastProps.dangerouslySetInnerHTML &&
4031 lastProps.dangerouslySetInnerHTML.__html;
4032 var nextHtml =
4033 nextProps.dangerouslySetInnerHTML &&
4034 nextProps.dangerouslySetInnerHTML.__html;
4035
4036 // Note the use of `!=` which checks for null or undefined.
4037 var lastChildren = lastContent != null ? null : lastProps.children;
4038 var nextChildren = nextContent != null ? null : nextProps.children;
4039
4040 // If we're switching from children to content/html or vice versa, remove
4041 // the old content
4042 var lastHasContentOrHtml = lastContent != null || lastHtml != null;
4043 var nextHasContentOrHtml = nextContent != null || nextHtml != null;
4044 if (lastChildren != null && nextChildren == null) {
4045 this.updateChildren(null, transaction);
4046 } else if (lastHasContentOrHtml && !nextHasContentOrHtml) {
4047 this.updateTextContent('');
4048 }
4049
4050 if (nextContent != null) {
4051 if (lastContent !== nextContent) {
4052 this.updateTextContent('' + nextContent);
4053 }
4054 } else if (nextHtml != null) {
4055 if (lastHtml !== nextHtml) {
4056 ReactComponent.BackendIDOperations.updateInnerHTMLByID(
4057 this._rootNodeID,
4058 nextHtml
4059 );
4060 }
4061 } else if (nextChildren != null) {
4062 this.updateChildren(nextChildren, transaction);
4063 }
4064 },
4065
4066 /**
4067 * Destroys all event registrations for this instance. Does not remove from
4068 * the DOM. That must be done by the parent.
4069 *
4070 * @internal
4071 */
4072 unmountComponent: function() {
4073 this.unmountChildren();
4074 ReactBrowserEventEmitter.deleteAllListeners(this._rootNodeID);
4075 ReactComponent.Mixin.unmountComponent.call(this);
4076 }
4077
4078 };
4079
4080 assign(
4081 ReactDOMComponent.prototype,
4082 ReactComponent.Mixin,
4083 ReactDOMComponent.Mixin,
4084 ReactMultiChild.Mixin,
4085 ReactBrowserComponentMixin
4086 );
4087
4088 module.exports = ReactDOMComponent;
4089
4090 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(27)))
4091
4092/***/ },
4093/* 14 */
4094/***/ function(module, exports, __webpack_require__) {
4095
4096 /* WEBPACK VAR INJECTION */(function(process) {/**
4097 * Copyright 2013-2014, Facebook, Inc.
4098 * All rights reserved.
4099 *
4100 * This source code is licensed under the BSD-style license found in the
4101 * LICENSE file in the root directory of this source tree. An additional grant
4102 * of patent rights can be found in the PATENTS file in the same directory.
4103 *
4104 * @providesModule ReactDefaultInjection
4105 */
4106
4107 "use strict";
4108
4109 var BeforeInputEventPlugin = __webpack_require__(53);
4110 var ChangeEventPlugin = __webpack_require__(54);
4111 var ClientReactRootIndex = __webpack_require__(55);
4112 var CompositionEventPlugin = __webpack_require__(56);
4113 var DefaultEventPluginOrder = __webpack_require__(57);
4114 var EnterLeaveEventPlugin = __webpack_require__(58);
4115 var ExecutionEnvironment = __webpack_require__(26);
4116 var HTMLDOMPropertyConfig = __webpack_require__(59);
4117 var MobileSafariClickEventPlugin = __webpack_require__(60);
4118 var ReactBrowserComponentMixin = __webpack_require__(50);
4119 var ReactComponentBrowserEnvironment =
4120 __webpack_require__(61);
4121 var ReactDefaultBatchingStrategy = __webpack_require__(62);
4122 var ReactDOMComponent = __webpack_require__(13);
4123 var ReactDOMButton = __webpack_require__(63);
4124 var ReactDOMForm = __webpack_require__(64);
4125 var ReactDOMImg = __webpack_require__(65);
4126 var ReactDOMInput = __webpack_require__(66);
4127 var ReactDOMOption = __webpack_require__(67);
4128 var ReactDOMSelect = __webpack_require__(68);
4129 var ReactDOMTextarea = __webpack_require__(69);
4130 var ReactEventListener = __webpack_require__(70);
4131 var ReactInjection = __webpack_require__(71);
4132 var ReactInstanceHandles = __webpack_require__(15);
4133 var ReactMount = __webpack_require__(17);
4134 var SelectEventPlugin = __webpack_require__(72);
4135 var ServerReactRootIndex = __webpack_require__(73);
4136 var SimpleEventPlugin = __webpack_require__(74);
4137 var SVGDOMPropertyConfig = __webpack_require__(75);
4138
4139 var createFullPageComponent = __webpack_require__(76);
4140
4141 function inject() {
4142 ReactInjection.EventEmitter.injectReactEventListener(
4143 ReactEventListener
4144 );
4145
4146 /**
4147 * Inject modules for resolving DOM hierarchy and plugin ordering.
4148 */
4149 ReactInjection.EventPluginHub.injectEventPluginOrder(DefaultEventPluginOrder);
4150 ReactInjection.EventPluginHub.injectInstanceHandle(ReactInstanceHandles);
4151 ReactInjection.EventPluginHub.injectMount(ReactMount);
4152
4153 /**
4154 * Some important event plugins included by default (without having to require
4155 * them).
4156 */
4157 ReactInjection.EventPluginHub.injectEventPluginsByName({
4158 SimpleEventPlugin: SimpleEventPlugin,
4159 EnterLeaveEventPlugin: EnterLeaveEventPlugin,
4160 ChangeEventPlugin: ChangeEventPlugin,
4161 CompositionEventPlugin: CompositionEventPlugin,
4162 MobileSafariClickEventPlugin: MobileSafariClickEventPlugin,
4163 SelectEventPlugin: SelectEventPlugin,
4164 BeforeInputEventPlugin: BeforeInputEventPlugin
4165 });
4166
4167 ReactInjection.NativeComponent.injectGenericComponentClass(
4168 ReactDOMComponent
4169 );
4170
4171 ReactInjection.NativeComponent.injectComponentClasses({
4172 'button': ReactDOMButton,
4173 'form': ReactDOMForm,
4174 'img': ReactDOMImg,
4175 'input': ReactDOMInput,
4176 'option': ReactDOMOption,
4177 'select': ReactDOMSelect,
4178 'textarea': ReactDOMTextarea,
4179
4180 'html': createFullPageComponent('html'),
4181 'head': createFullPageComponent('head'),
4182 'body': createFullPageComponent('body')
4183 });
4184
4185 // This needs to happen after createFullPageComponent() otherwise the mixin
4186 // gets double injected.
4187 ReactInjection.CompositeComponent.injectMixin(ReactBrowserComponentMixin);
4188
4189 ReactInjection.DOMProperty.injectDOMPropertyConfig(HTMLDOMPropertyConfig);
4190 ReactInjection.DOMProperty.injectDOMPropertyConfig(SVGDOMPropertyConfig);
4191
4192 ReactInjection.EmptyComponent.injectEmptyComponent('noscript');
4193
4194 ReactInjection.Updates.injectReconcileTransaction(
4195 ReactComponentBrowserEnvironment.ReactReconcileTransaction
4196 );
4197 ReactInjection.Updates.injectBatchingStrategy(
4198 ReactDefaultBatchingStrategy
4199 );
4200
4201 ReactInjection.RootIndex.injectCreateReactRootIndex(
4202 ExecutionEnvironment.canUseDOM ?
4203 ClientReactRootIndex.createReactRootIndex :
4204 ServerReactRootIndex.createReactRootIndex
4205 );
4206
4207 ReactInjection.Component.injectEnvironment(ReactComponentBrowserEnvironment);
4208
4209 if ("production" !== process.env.NODE_ENV) {
4210 var url = (ExecutionEnvironment.canUseDOM && window.location.href) || '';
4211 if ((/[?&]react_perf\b/).test(url)) {
4212 var ReactDefaultPerf = __webpack_require__(77);
4213 ReactDefaultPerf.start();
4214 }
4215 }
4216 }
4217
4218 module.exports = {
4219 inject: inject
4220 };
4221
4222 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(27)))
4223
4224/***/ },
4225/* 15 */
4226/***/ function(module, exports, __webpack_require__) {
4227
4228 /* WEBPACK VAR INJECTION */(function(process) {/**
4229 * Copyright 2013-2014, Facebook, Inc.
4230 * All rights reserved.
4231 *
4232 * This source code is licensed under the BSD-style license found in the
4233 * LICENSE file in the root directory of this source tree. An additional grant
4234 * of patent rights can be found in the PATENTS file in the same directory.
4235 *
4236 * @providesModule ReactInstanceHandles
4237 * @typechecks static-only
4238 */
4239
4240 "use strict";
4241
4242 var ReactRootIndex = __webpack_require__(78);
4243
4244 var invariant = __webpack_require__(33);
4245
4246 var SEPARATOR = '.';
4247 var SEPARATOR_LENGTH = SEPARATOR.length;
4248
4249 /**
4250 * Maximum depth of traversals before we consider the possibility of a bad ID.
4251 */
4252 var MAX_TREE_DEPTH = 100;
4253
4254 /**
4255 * Creates a DOM ID prefix to use when mounting React components.
4256 *
4257 * @param {number} index A unique integer
4258 * @return {string} React root ID.
4259 * @internal
4260 */
4261 function getReactRootIDString(index) {
4262 return SEPARATOR + index.toString(36);
4263 }
4264
4265 /**
4266 * Checks if a character in the supplied ID is a separator or the end.
4267 *
4268 * @param {string} id A React DOM ID.
4269 * @param {number} index Index of the character to check.
4270 * @return {boolean} True if the character is a separator or end of the ID.
4271 * @private
4272 */
4273 function isBoundary(id, index) {
4274 return id.charAt(index) === SEPARATOR || index === id.length;
4275 }
4276
4277 /**
4278 * Checks if the supplied string is a valid React DOM ID.
4279 *
4280 * @param {string} id A React DOM ID, maybe.
4281 * @return {boolean} True if the string is a valid React DOM ID.
4282 * @private
4283 */
4284 function isValidID(id) {
4285 return id === '' || (
4286 id.charAt(0) === SEPARATOR && id.charAt(id.length - 1) !== SEPARATOR
4287 );
4288 }
4289
4290 /**
4291 * Checks if the first ID is an ancestor of or equal to the second ID.
4292 *
4293 * @param {string} ancestorID
4294 * @param {string} descendantID
4295 * @return {boolean} True if `ancestorID` is an ancestor of `descendantID`.
4296 * @internal
4297 */
4298 function isAncestorIDOf(ancestorID, descendantID) {
4299 return (
4300 descendantID.indexOf(ancestorID) === 0 &&
4301 isBoundary(descendantID, ancestorID.length)
4302 );
4303 }
4304
4305 /**
4306 * Gets the parent ID of the supplied React DOM ID, `id`.
4307 *
4308 * @param {string} id ID of a component.
4309 * @return {string} ID of the parent, or an empty string.
4310 * @private
4311 */
4312 function getParentID(id) {
4313 return id ? id.substr(0, id.lastIndexOf(SEPARATOR)) : '';
4314 }
4315
4316 /**
4317 * Gets the next DOM ID on the tree path from the supplied `ancestorID` to the
4318 * supplied `destinationID`. If they are equal, the ID is returned.
4319 *
4320 * @param {string} ancestorID ID of an ancestor node of `destinationID`.
4321 * @param {string} destinationID ID of the destination node.
4322 * @return {string} Next ID on the path from `ancestorID` to `destinationID`.
4323 * @private
4324 */
4325 function getNextDescendantID(ancestorID, destinationID) {
4326 ("production" !== process.env.NODE_ENV ? invariant(
4327 isValidID(ancestorID) && isValidID(destinationID),
4328 'getNextDescendantID(%s, %s): Received an invalid React DOM ID.',
4329 ancestorID,
4330 destinationID
4331 ) : invariant(isValidID(ancestorID) && isValidID(destinationID)));
4332 ("production" !== process.env.NODE_ENV ? invariant(
4333 isAncestorIDOf(ancestorID, destinationID),
4334 'getNextDescendantID(...): React has made an invalid assumption about ' +
4335 'the DOM hierarchy. Expected `%s` to be an ancestor of `%s`.',
4336 ancestorID,
4337 destinationID
4338 ) : invariant(isAncestorIDOf(ancestorID, destinationID)));
4339 if (ancestorID === destinationID) {
4340 return ancestorID;
4341 }
4342 // Skip over the ancestor and the immediate separator. Traverse until we hit
4343 // another separator or we reach the end of `destinationID`.
4344 var start = ancestorID.length + SEPARATOR_LENGTH;
4345 for (var i = start; i < destinationID.length; i++) {
4346 if (isBoundary(destinationID, i)) {
4347 break;
4348 }
4349 }
4350 return destinationID.substr(0, i);
4351 }
4352
4353 /**
4354 * Gets the nearest common ancestor ID of two IDs.
4355 *
4356 * Using this ID scheme, the nearest common ancestor ID is the longest common
4357 * prefix of the two IDs that immediately preceded a "marker" in both strings.
4358 *
4359 * @param {string} oneID
4360 * @param {string} twoID
4361 * @return {string} Nearest common ancestor ID, or the empty string if none.
4362 * @private
4363 */
4364 function getFirstCommonAncestorID(oneID, twoID) {
4365 var minLength = Math.min(oneID.length, twoID.length);
4366 if (minLength === 0) {
4367 return '';
4368 }
4369 var lastCommonMarkerIndex = 0;
4370 // Use `<=` to traverse until the "EOL" of the shorter string.
4371 for (var i = 0; i <= minLength; i++) {
4372 if (isBoundary(oneID, i) && isBoundary(twoID, i)) {
4373 lastCommonMarkerIndex = i;
4374 } else if (oneID.charAt(i) !== twoID.charAt(i)) {
4375 break;
4376 }
4377 }
4378 var longestCommonID = oneID.substr(0, lastCommonMarkerIndex);
4379 ("production" !== process.env.NODE_ENV ? invariant(
4380 isValidID(longestCommonID),
4381 'getFirstCommonAncestorID(%s, %s): Expected a valid React DOM ID: %s',
4382 oneID,
4383 twoID,
4384 longestCommonID
4385 ) : invariant(isValidID(longestCommonID)));
4386 return longestCommonID;
4387 }
4388
4389 /**
4390 * Traverses the parent path between two IDs (either up or down). The IDs must
4391 * not be the same, and there must exist a parent path between them. If the
4392 * callback returns `false`, traversal is stopped.
4393 *
4394 * @param {?string} start ID at which to start traversal.
4395 * @param {?string} stop ID at which to end traversal.
4396 * @param {function} cb Callback to invoke each ID with.
4397 * @param {?boolean} skipFirst Whether or not to skip the first node.
4398 * @param {?boolean} skipLast Whether or not to skip the last node.
4399 * @private
4400 */
4401 function traverseParentPath(start, stop, cb, arg, skipFirst, skipLast) {
4402 start = start || '';
4403 stop = stop || '';
4404 ("production" !== process.env.NODE_ENV ? invariant(
4405 start !== stop,
4406 'traverseParentPath(...): Cannot traverse from and to the same ID, `%s`.',
4407 start
4408 ) : invariant(start !== stop));
4409 var traverseUp = isAncestorIDOf(stop, start);
4410 ("production" !== process.env.NODE_ENV ? invariant(
4411 traverseUp || isAncestorIDOf(start, stop),
4412 'traverseParentPath(%s, %s, ...): Cannot traverse from two IDs that do ' +
4413 'not have a parent path.',
4414 start,
4415 stop
4416 ) : invariant(traverseUp || isAncestorIDOf(start, stop)));
4417 // Traverse from `start` to `stop` one depth at a time.
4418 var depth = 0;
4419 var traverse = traverseUp ? getParentID : getNextDescendantID;
4420 for (var id = start; /* until break */; id = traverse(id, stop)) {
4421 var ret;
4422 if ((!skipFirst || id !== start) && (!skipLast || id !== stop)) {
4423 ret = cb(id, traverseUp, arg);
4424 }
4425 if (ret === false || id === stop) {
4426 // Only break //after// visiting `stop`.
4427 break;
4428 }
4429 ("production" !== process.env.NODE_ENV ? invariant(
4430 depth++ < MAX_TREE_DEPTH,
4431 'traverseParentPath(%s, %s, ...): Detected an infinite loop while ' +
4432 'traversing the React DOM ID tree. This may be due to malformed IDs: %s',
4433 start, stop
4434 ) : invariant(depth++ < MAX_TREE_DEPTH));
4435 }
4436 }
4437
4438 /**
4439 * Manages the IDs assigned to DOM representations of React components. This
4440 * uses a specific scheme in order to traverse the DOM efficiently (e.g. in
4441 * order to simulate events).
4442 *
4443 * @internal
4444 */
4445 var ReactInstanceHandles = {
4446
4447 /**
4448 * Constructs a React root ID
4449 * @return {string} A React root ID.
4450 */
4451 createReactRootID: function() {
4452 return getReactRootIDString(ReactRootIndex.createReactRootIndex());
4453 },
4454
4455 /**
4456 * Constructs a React ID by joining a root ID with a name.
4457 *
4458 * @param {string} rootID Root ID of a parent component.
4459 * @param {string} name A component's name (as flattened children).
4460 * @return {string} A React ID.
4461 * @internal
4462 */
4463 createReactID: function(rootID, name) {
4464 return rootID + name;
4465 },
4466
4467 /**
4468 * Gets the DOM ID of the React component that is the root of the tree that
4469 * contains the React component with the supplied DOM ID.
4470 *
4471 * @param {string} id DOM ID of a React component.
4472 * @return {?string} DOM ID of the React component that is the root.
4473 * @internal
4474 */
4475 getReactRootIDFromNodeID: function(id) {
4476 if (id && id.charAt(0) === SEPARATOR && id.length > 1) {
4477 var index = id.indexOf(SEPARATOR, 1);
4478 return index > -1 ? id.substr(0, index) : id;
4479 }
4480 return null;
4481 },
4482
4483 /**
4484 * Traverses the ID hierarchy and invokes the supplied `cb` on any IDs that
4485 * should would receive a `mouseEnter` or `mouseLeave` event.
4486 *
4487 * NOTE: Does not invoke the callback on the nearest common ancestor because
4488 * nothing "entered" or "left" that element.
4489 *
4490 * @param {string} leaveID ID being left.
4491 * @param {string} enterID ID being entered.
4492 * @param {function} cb Callback to invoke on each entered/left ID.
4493 * @param {*} upArg Argument to invoke the callback with on left IDs.
4494 * @param {*} downArg Argument to invoke the callback with on entered IDs.
4495 * @internal
4496 */
4497 traverseEnterLeave: function(leaveID, enterID, cb, upArg, downArg) {
4498 var ancestorID = getFirstCommonAncestorID(leaveID, enterID);
4499 if (ancestorID !== leaveID) {
4500 traverseParentPath(leaveID, ancestorID, cb, upArg, false, true);
4501 }
4502 if (ancestorID !== enterID) {
4503 traverseParentPath(ancestorID, enterID, cb, downArg, true, false);
4504 }
4505 },
4506
4507 /**
4508 * Simulates the traversal of a two-phase, capture/bubble event dispatch.
4509 *
4510 * NOTE: This traversal happens on IDs without touching the DOM.
4511 *
4512 * @param {string} targetID ID of the target node.
4513 * @param {function} cb Callback to invoke.
4514 * @param {*} arg Argument to invoke the callback with.
4515 * @internal
4516 */
4517 traverseTwoPhase: function(targetID, cb, arg) {
4518 if (targetID) {
4519 traverseParentPath('', targetID, cb, arg, true, false);
4520 traverseParentPath(targetID, '', cb, arg, false, true);
4521 }
4522 },
4523
4524 /**
4525 * Traverse a node ID, calling the supplied `cb` for each ancestor ID. For
4526 * example, passing `.0.$row-0.1` would result in `cb` getting called
4527 * with `.0`, `.0.$row-0`, and `.0.$row-0.1`.
4528 *
4529 * NOTE: This traversal happens on IDs without touching the DOM.
4530 *
4531 * @param {string} targetID ID of the target node.
4532 * @param {function} cb Callback to invoke.
4533 * @param {*} arg Argument to invoke the callback with.
4534 * @internal
4535 */
4536 traverseAncestors: function(targetID, cb, arg) {
4537 traverseParentPath('', targetID, cb, arg, true, false);
4538 },
4539
4540 /**
4541 * Exposed for unit testing.
4542 * @private
4543 */
4544 _getFirstCommonAncestorID: getFirstCommonAncestorID,
4545
4546 /**
4547 * Exposed for unit testing.
4548 * @private
4549 */
4550 _getNextDescendantID: getNextDescendantID,
4551
4552 isAncestorIDOf: isAncestorIDOf,
4553
4554 SEPARATOR: SEPARATOR
4555
4556 };
4557
4558 module.exports = ReactInstanceHandles;
4559
4560 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(27)))
4561
4562/***/ },
4563/* 16 */
4564/***/ function(module, exports, __webpack_require__) {
4565
4566 /* WEBPACK VAR INJECTION */(function(process) {/**
4567 * Copyright 2014, Facebook, Inc.
4568 * All rights reserved.
4569 *
4570 * This source code is licensed under the BSD-style license found in the
4571 * LICENSE file in the root directory of this source tree. An additional grant
4572 * of patent rights can be found in the PATENTS file in the same directory.
4573 *
4574 * @providesModule ReactLegacyElement
4575 */
4576
4577 "use strict";
4578
4579 var ReactCurrentOwner = __webpack_require__(9);
4580
4581 var invariant = __webpack_require__(33);
4582 var monitorCodeUse = __webpack_require__(46);
4583 var warning = __webpack_require__(31);
4584
4585 var legacyFactoryLogs = {};
4586 function warnForLegacyFactoryCall() {
4587 if (!ReactLegacyElementFactory._isLegacyCallWarningEnabled) {
4588 return;
4589 }
4590 var owner = ReactCurrentOwner.current;
4591 var name = owner && owner.constructor ? owner.constructor.displayName : '';
4592 if (!name) {
4593 name = 'Something';
4594 }
4595 if (legacyFactoryLogs.hasOwnProperty(name)) {
4596 return;
4597 }
4598 legacyFactoryLogs[name] = true;
4599 ("production" !== process.env.NODE_ENV ? warning(
4600 false,
4601 name + ' is calling a React component directly. ' +
4602 'Use a factory or JSX instead. See: http://fb.me/react-legacyfactory'
4603 ) : null);
4604 monitorCodeUse('react_legacy_factory_call', { version: 3, name: name });
4605 }
4606
4607 function warnForPlainFunctionType(type) {
4608 var isReactClass =
4609 type.prototype &&
4610 typeof type.prototype.mountComponent === 'function' &&
4611 typeof type.prototype.receiveComponent === 'function';
4612 if (isReactClass) {
4613 ("production" !== process.env.NODE_ENV ? warning(
4614 false,
4615 'Did not expect to get a React class here. Use `Component` instead ' +
4616 'of `Component.type` or `this.constructor`.'
4617 ) : null);
4618 } else {
4619 if (!type._reactWarnedForThisType) {
4620 try {
4621 type._reactWarnedForThisType = true;
4622 } catch (x) {
4623 // just incase this is a frozen object or some special object
4624 }
4625 monitorCodeUse(
4626 'react_non_component_in_jsx',
4627 { version: 3, name: type.name }
4628 );
4629 }
4630 ("production" !== process.env.NODE_ENV ? warning(
4631 false,
4632 'This JSX uses a plain function. Only React components are ' +
4633 'valid in React\'s JSX transform.'
4634 ) : null);
4635 }
4636 }
4637
4638 function warnForNonLegacyFactory(type) {
4639 ("production" !== process.env.NODE_ENV ? warning(
4640 false,
4641 'Do not pass React.DOM.' + type.type + ' to JSX or createFactory. ' +
4642 'Use the string "' + type.type + '" instead.'
4643 ) : null);
4644 }
4645
4646 /**
4647 * Transfer static properties from the source to the target. Functions are
4648 * rebound to have this reflect the original source.
4649 */
4650 function proxyStaticMethods(target, source) {
4651 if (typeof source !== 'function') {
4652 return;
4653 }
4654 for (var key in source) {
4655 if (source.hasOwnProperty(key)) {
4656 var value = source[key];
4657 if (typeof value === 'function') {
4658 var bound = value.bind(source);
4659 // Copy any properties defined on the function, such as `isRequired` on
4660 // a PropTypes validator.
4661 for (var k in value) {
4662 if (value.hasOwnProperty(k)) {
4663 bound[k] = value[k];
4664 }
4665 }
4666 target[key] = bound;
4667 } else {
4668 target[key] = value;
4669 }
4670 }
4671 }
4672 }
4673
4674 // We use an object instead of a boolean because booleans are ignored by our
4675 // mocking libraries when these factories gets mocked.
4676 var LEGACY_MARKER = {};
4677 var NON_LEGACY_MARKER = {};
4678
4679 var ReactLegacyElementFactory = {};
4680
4681 ReactLegacyElementFactory.wrapCreateFactory = function(createFactory) {
4682 var legacyCreateFactory = function(type) {
4683 if (typeof type !== 'function') {
4684 // Non-function types cannot be legacy factories
4685 return createFactory(type);
4686 }
4687
4688 if (type.isReactNonLegacyFactory) {
4689 // This is probably a factory created by ReactDOM we unwrap it to get to
4690 // the underlying string type. It shouldn't have been passed here so we
4691 // warn.
4692 if ("production" !== process.env.NODE_ENV) {
4693 warnForNonLegacyFactory(type);
4694 }
4695 return createFactory(type.type);
4696 }
4697
4698 if (type.isReactLegacyFactory) {
4699 // This is probably a legacy factory created by ReactCompositeComponent.
4700 // We unwrap it to get to the underlying class.
4701 return createFactory(type.type);
4702 }
4703
4704 if ("production" !== process.env.NODE_ENV) {
4705 warnForPlainFunctionType(type);
4706 }
4707
4708 // Unless it's a legacy factory, then this is probably a plain function,
4709 // that is expecting to be invoked by JSX. We can just return it as is.
4710 return type;
4711 };
4712 return legacyCreateFactory;
4713 };
4714
4715 ReactLegacyElementFactory.wrapCreateElement = function(createElement) {
4716 var legacyCreateElement = function(type, props, children) {
4717 if (typeof type !== 'function') {
4718 // Non-function types cannot be legacy factories
4719 return createElement.apply(this, arguments);
4720 }
4721
4722 var args;
4723
4724 if (type.isReactNonLegacyFactory) {
4725 // This is probably a factory created by ReactDOM we unwrap it to get to
4726 // the underlying string type. It shouldn't have been passed here so we
4727 // warn.
4728 if ("production" !== process.env.NODE_ENV) {
4729 warnForNonLegacyFactory(type);
4730 }
4731 args = Array.prototype.slice.call(arguments, 0);
4732 args[0] = type.type;
4733 return createElement.apply(this, args);
4734 }
4735
4736 if (type.isReactLegacyFactory) {
4737 // This is probably a legacy factory created by ReactCompositeComponent.
4738 // We unwrap it to get to the underlying class.
4739 if (type._isMockFunction) {
4740 // If this is a mock function, people will expect it to be called. We
4741 // will actually call the original mock factory function instead. This
4742 // future proofs unit testing that assume that these are classes.
4743 type.type._mockedReactClassConstructor = type;
4744 }
4745 args = Array.prototype.slice.call(arguments, 0);
4746 args[0] = type.type;
4747 return createElement.apply(this, args);
4748 }
4749
4750 if ("production" !== process.env.NODE_ENV) {
4751 warnForPlainFunctionType(type);
4752 }
4753
4754 // This is being called with a plain function we should invoke it
4755 // immediately as if this was used with legacy JSX.
4756 return type.apply(null, Array.prototype.slice.call(arguments, 1));
4757 };
4758 return legacyCreateElement;
4759 };
4760
4761 ReactLegacyElementFactory.wrapFactory = function(factory) {
4762 ("production" !== process.env.NODE_ENV ? invariant(
4763 typeof factory === 'function',
4764 'This is suppose to accept a element factory'
4765 ) : invariant(typeof factory === 'function'));
4766 var legacyElementFactory = function(config, children) {
4767 // This factory should not be called when JSX is used. Use JSX instead.
4768 if ("production" !== process.env.NODE_ENV) {
4769 warnForLegacyFactoryCall();
4770 }
4771 return factory.apply(this, arguments);
4772 };
4773 proxyStaticMethods(legacyElementFactory, factory.type);
4774 legacyElementFactory.isReactLegacyFactory = LEGACY_MARKER;
4775 legacyElementFactory.type = factory.type;
4776 return legacyElementFactory;
4777 };
4778
4779 // This is used to mark a factory that will remain. E.g. we're allowed to call
4780 // it as a function. However, you're not suppose to pass it to createElement
4781 // or createFactory, so it will warn you if you do.
4782 ReactLegacyElementFactory.markNonLegacyFactory = function(factory) {
4783 factory.isReactNonLegacyFactory = NON_LEGACY_MARKER;
4784 return factory;
4785 };
4786
4787 // Checks if a factory function is actually a legacy factory pretending to
4788 // be a class.
4789 ReactLegacyElementFactory.isValidFactory = function(factory) {
4790 // TODO: This will be removed and moved into a class validator or something.
4791 return typeof factory === 'function' &&
4792 factory.isReactLegacyFactory === LEGACY_MARKER;
4793 };
4794
4795 ReactLegacyElementFactory.isValidClass = function(factory) {
4796 if ("production" !== process.env.NODE_ENV) {
4797 ("production" !== process.env.NODE_ENV ? warning(
4798 false,
4799 'isValidClass is deprecated and will be removed in a future release. ' +
4800 'Use a more specific validator instead.'
4801 ) : null);
4802 }
4803 return ReactLegacyElementFactory.isValidFactory(factory);
4804 };
4805
4806 ReactLegacyElementFactory._isLegacyCallWarningEnabled = true;
4807
4808 module.exports = ReactLegacyElementFactory;
4809
4810 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(27)))
4811
4812/***/ },
4813/* 17 */
4814/***/ function(module, exports, __webpack_require__) {
4815
4816 /* WEBPACK VAR INJECTION */(function(process) {/**
4817 * Copyright 2013-2014, Facebook, Inc.
4818 * All rights reserved.
4819 *
4820 * This source code is licensed under the BSD-style license found in the
4821 * LICENSE file in the root directory of this source tree. An additional grant
4822 * of patent rights can be found in the PATENTS file in the same directory.
4823 *
4824 * @providesModule ReactMount
4825 */
4826
4827 "use strict";
4828
4829 var DOMProperty = __webpack_require__(28);
4830 var ReactBrowserEventEmitter = __webpack_require__(51);
4831 var ReactCurrentOwner = __webpack_require__(9);
4832 var ReactElement = __webpack_require__(10);
4833 var ReactLegacyElement = __webpack_require__(16);
4834 var ReactInstanceHandles = __webpack_require__(15);
4835 var ReactPerf = __webpack_require__(19);
4836
4837 var containsNode = __webpack_require__(79);
4838 var deprecated = __webpack_require__(24);
4839 var getReactRootElementInContainer = __webpack_require__(80);
4840 var instantiateReactComponent = __webpack_require__(43);
4841 var invariant = __webpack_require__(33);
4842 var shouldUpdateReactComponent = __webpack_require__(48);
4843 var warning = __webpack_require__(31);
4844
4845 var createElement = ReactLegacyElement.wrapCreateElement(
4846 ReactElement.createElement
4847 );
4848
4849 var SEPARATOR = ReactInstanceHandles.SEPARATOR;
4850
4851 var ATTR_NAME = DOMProperty.ID_ATTRIBUTE_NAME;
4852 var nodeCache = {};
4853
4854 var ELEMENT_NODE_TYPE = 1;
4855 var DOC_NODE_TYPE = 9;
4856
4857 /** Mapping from reactRootID to React component instance. */
4858 var instancesByReactRootID = {};
4859
4860 /** Mapping from reactRootID to `container` nodes. */
4861 var containersByReactRootID = {};
4862
4863 if ("production" !== process.env.NODE_ENV) {
4864 /** __DEV__-only mapping from reactRootID to root elements. */
4865 var rootElementsByReactRootID = {};
4866 }
4867
4868 // Used to store breadth-first search state in findComponentRoot.
4869 var findComponentRootReusableArray = [];
4870
4871 /**
4872 * @param {DOMElement} container DOM element that may contain a React component.
4873 * @return {?string} A "reactRoot" ID, if a React component is rendered.
4874 */
4875 function getReactRootID(container) {
4876 var rootElement = getReactRootElementInContainer(container);
4877 return rootElement && ReactMount.getID(rootElement);
4878 }
4879
4880 /**
4881 * Accessing node[ATTR_NAME] or calling getAttribute(ATTR_NAME) on a form
4882 * element can return its control whose name or ID equals ATTR_NAME. All
4883 * DOM nodes support `getAttributeNode` but this can also get called on
4884 * other objects so just return '' if we're given something other than a
4885 * DOM node (such as window).
4886 *
4887 * @param {?DOMElement|DOMWindow|DOMDocument|DOMTextNode} node DOM node.
4888 * @return {string} ID of the supplied `domNode`.
4889 */
4890 function getID(node) {
4891 var id = internalGetID(node);
4892 if (id) {
4893 if (nodeCache.hasOwnProperty(id)) {
4894 var cached = nodeCache[id];
4895 if (cached !== node) {
4896 ("production" !== process.env.NODE_ENV ? invariant(
4897 !isValid(cached, id),
4898 'ReactMount: Two valid but unequal nodes with the same `%s`: %s',
4899 ATTR_NAME, id
4900 ) : invariant(!isValid(cached, id)));
4901
4902 nodeCache[id] = node;
4903 }
4904 } else {
4905 nodeCache[id] = node;
4906 }
4907 }
4908
4909 return id;
4910 }
4911
4912 function internalGetID(node) {
4913 // If node is something like a window, document, or text node, none of
4914 // which support attributes or a .getAttribute method, gracefully return
4915 // the empty string, as if the attribute were missing.
4916 return node && node.getAttribute && node.getAttribute(ATTR_NAME) || '';
4917 }
4918
4919 /**
4920 * Sets the React-specific ID of the given node.
4921 *
4922 * @param {DOMElement} node The DOM node whose ID will be set.
4923 * @param {string} id The value of the ID attribute.
4924 */
4925 function setID(node, id) {
4926 var oldID = internalGetID(node);
4927 if (oldID !== id) {
4928 delete nodeCache[oldID];
4929 }
4930 node.setAttribute(ATTR_NAME, id);
4931 nodeCache[id] = node;
4932 }
4933
4934 /**
4935 * Finds the node with the supplied React-generated DOM ID.
4936 *
4937 * @param {string} id A React-generated DOM ID.
4938 * @return {DOMElement} DOM node with the suppled `id`.
4939 * @internal
4940 */
4941 function getNode(id) {
4942 if (!nodeCache.hasOwnProperty(id) || !isValid(nodeCache[id], id)) {
4943 nodeCache[id] = ReactMount.findReactNodeByID(id);
4944 }
4945 return nodeCache[id];
4946 }
4947
4948 /**
4949 * A node is "valid" if it is contained by a currently mounted container.
4950 *
4951 * This means that the node does not have to be contained by a document in
4952 * order to be considered valid.
4953 *
4954 * @param {?DOMElement} node The candidate DOM node.
4955 * @param {string} id The expected ID of the node.
4956 * @return {boolean} Whether the node is contained by a mounted container.
4957 */
4958 function isValid(node, id) {
4959 if (node) {
4960 ("production" !== process.env.NODE_ENV ? invariant(
4961 internalGetID(node) === id,
4962 'ReactMount: Unexpected modification of `%s`',
4963 ATTR_NAME
4964 ) : invariant(internalGetID(node) === id));
4965
4966 var container = ReactMount.findReactContainerForID(id);
4967 if (container && containsNode(container, node)) {
4968 return true;
4969 }
4970 }
4971
4972 return false;
4973 }
4974
4975 /**
4976 * Causes the cache to forget about one React-specific ID.
4977 *
4978 * @param {string} id The ID to forget.
4979 */
4980 function purgeID(id) {
4981 delete nodeCache[id];
4982 }
4983
4984 var deepestNodeSoFar = null;
4985 function findDeepestCachedAncestorImpl(ancestorID) {
4986 var ancestor = nodeCache[ancestorID];
4987 if (ancestor && isValid(ancestor, ancestorID)) {
4988 deepestNodeSoFar = ancestor;
4989 } else {
4990 // This node isn't populated in the cache, so presumably none of its
4991 // descendants are. Break out of the loop.
4992 return false;
4993 }
4994 }
4995
4996 /**
4997 * Return the deepest cached node whose ID is a prefix of `targetID`.
4998 */
4999 function findDeepestCachedAncestor(targetID) {
5000 deepestNodeSoFar = null;
5001 ReactInstanceHandles.traverseAncestors(
5002 targetID,
5003 findDeepestCachedAncestorImpl
5004 );
5005
5006 var foundNode = deepestNodeSoFar;
5007 deepestNodeSoFar = null;
5008 return foundNode;
5009 }
5010
5011 /**
5012 * Mounting is the process of initializing a React component by creatings its
5013 * representative DOM elements and inserting them into a supplied `container`.
5014 * Any prior content inside `container` is destroyed in the process.
5015 *
5016 * ReactMount.render(
5017 * component,
5018 * document.getElementById('container')
5019 * );
5020 *
5021 * <div id="container"> <-- Supplied `container`.
5022 * <div data-reactid=".3"> <-- Rendered reactRoot of React
5023 * // ... component.
5024 * </div>
5025 * </div>
5026 *
5027 * Inside of `container`, the first element rendered is the "reactRoot".
5028 */
5029 var ReactMount = {
5030 /** Exposed for debugging purposes **/
5031 _instancesByReactRootID: instancesByReactRootID,
5032
5033 /**
5034 * This is a hook provided to support rendering React components while
5035 * ensuring that the apparent scroll position of its `container` does not
5036 * change.
5037 *
5038 * @param {DOMElement} container The `container` being rendered into.
5039 * @param {function} renderCallback This must be called once to do the render.
5040 */
5041 scrollMonitor: function(container, renderCallback) {
5042 renderCallback();
5043 },
5044
5045 /**
5046 * Take a component that's already mounted into the DOM and replace its props
5047 * @param {ReactComponent} prevComponent component instance already in the DOM
5048 * @param {ReactComponent} nextComponent component instance to render
5049 * @param {DOMElement} container container to render into
5050 * @param {?function} callback function triggered on completion
5051 */
5052 _updateRootComponent: function(
5053 prevComponent,
5054 nextComponent,
5055 container,
5056 callback) {
5057 var nextProps = nextComponent.props;
5058 ReactMount.scrollMonitor(container, function() {
5059 prevComponent.replaceProps(nextProps, callback);
5060 });
5061
5062 if ("production" !== process.env.NODE_ENV) {
5063 // Record the root element in case it later gets transplanted.
5064 rootElementsByReactRootID[getReactRootID(container)] =
5065 getReactRootElementInContainer(container);
5066 }
5067
5068 return prevComponent;
5069 },
5070
5071 /**
5072 * Register a component into the instance map and starts scroll value
5073 * monitoring
5074 * @param {ReactComponent} nextComponent component instance to render
5075 * @param {DOMElement} container container to render into
5076 * @return {string} reactRoot ID prefix
5077 */
5078 _registerComponent: function(nextComponent, container) {
5079 ("production" !== process.env.NODE_ENV ? invariant(
5080 container && (
5081 container.nodeType === ELEMENT_NODE_TYPE ||
5082 container.nodeType === DOC_NODE_TYPE
5083 ),
5084 '_registerComponent(...): Target container is not a DOM element.'
5085 ) : invariant(container && (
5086 container.nodeType === ELEMENT_NODE_TYPE ||
5087 container.nodeType === DOC_NODE_TYPE
5088 )));
5089
5090 ReactBrowserEventEmitter.ensureScrollValueMonitoring();
5091
5092 var reactRootID = ReactMount.registerContainer(container);
5093 instancesByReactRootID[reactRootID] = nextComponent;
5094 return reactRootID;
5095 },
5096
5097 /**
5098 * Render a new component into the DOM.
5099 * @param {ReactComponent} nextComponent component instance to render
5100 * @param {DOMElement} container container to render into
5101 * @param {boolean} shouldReuseMarkup if we should skip the markup insertion
5102 * @return {ReactComponent} nextComponent
5103 */
5104 _renderNewRootComponent: ReactPerf.measure(
5105 'ReactMount',
5106 '_renderNewRootComponent',
5107 function(
5108 nextComponent,
5109 container,
5110 shouldReuseMarkup) {
5111 // Various parts of our code (such as ReactCompositeComponent's
5112 // _renderValidatedComponent) assume that calls to render aren't nested;
5113 // verify that that's the case.
5114 ("production" !== process.env.NODE_ENV ? warning(
5115 ReactCurrentOwner.current == null,
5116 '_renderNewRootComponent(): Render methods should be a pure function ' +
5117 'of props and state; triggering nested component updates from ' +
5118 'render is not allowed. If necessary, trigger nested updates in ' +
5119 'componentDidUpdate.'
5120 ) : null);
5121
5122 var componentInstance = instantiateReactComponent(nextComponent, null);
5123 var reactRootID = ReactMount._registerComponent(
5124 componentInstance,
5125 container
5126 );
5127 componentInstance.mountComponentIntoNode(
5128 reactRootID,
5129 container,
5130 shouldReuseMarkup
5131 );
5132
5133 if ("production" !== process.env.NODE_ENV) {
5134 // Record the root element in case it later gets transplanted.
5135 rootElementsByReactRootID[reactRootID] =
5136 getReactRootElementInContainer(container);
5137 }
5138
5139 return componentInstance;
5140 }
5141 ),
5142
5143 /**
5144 * Renders a React component into the DOM in the supplied `container`.
5145 *
5146 * If the React component was previously rendered into `container`, this will
5147 * perform an update on it and only mutate the DOM as necessary to reflect the
5148 * latest React component.
5149 *
5150 * @param {ReactElement} nextElement Component element to render.
5151 * @param {DOMElement} container DOM element to render into.
5152 * @param {?function} callback function triggered on completion
5153 * @return {ReactComponent} Component instance rendered in `container`.
5154 */
5155 render: function(nextElement, container, callback) {
5156 ("production" !== process.env.NODE_ENV ? invariant(
5157 ReactElement.isValidElement(nextElement),
5158 'renderComponent(): Invalid component element.%s',
5159 (
5160 typeof nextElement === 'string' ?
5161 ' Instead of passing an element string, make sure to instantiate ' +
5162 'it by passing it to React.createElement.' :
5163 ReactLegacyElement.isValidFactory(nextElement) ?
5164 ' Instead of passing a component class, make sure to instantiate ' +
5165 'it by passing it to React.createElement.' :
5166 // Check if it quacks like a element
5167 typeof nextElement.props !== "undefined" ?
5168 ' This may be caused by unintentionally loading two independent ' +
5169 'copies of React.' :
5170 ''
5171 )
5172 ) : invariant(ReactElement.isValidElement(nextElement)));
5173
5174 var prevComponent = instancesByReactRootID[getReactRootID(container)];
5175
5176 if (prevComponent) {
5177 var prevElement = prevComponent._currentElement;
5178 if (shouldUpdateReactComponent(prevElement, nextElement)) {
5179 return ReactMount._updateRootComponent(
5180 prevComponent,
5181 nextElement,
5182 container,
5183 callback
5184 );
5185 } else {
5186 ReactMount.unmountComponentAtNode(container);
5187 }
5188 }
5189
5190 var reactRootElement = getReactRootElementInContainer(container);
5191 var containerHasReactMarkup =
5192 reactRootElement && ReactMount.isRenderedByReact(reactRootElement);
5193
5194 var shouldReuseMarkup = containerHasReactMarkup && !prevComponent;
5195
5196 var component = ReactMount._renderNewRootComponent(
5197 nextElement,
5198 container,
5199 shouldReuseMarkup
5200 );
5201 callback && callback.call(component);
5202 return component;
5203 },
5204
5205 /**
5206 * Constructs a component instance of `constructor` with `initialProps` and
5207 * renders it into the supplied `container`.
5208 *
5209 * @param {function} constructor React component constructor.
5210 * @param {?object} props Initial props of the component instance.
5211 * @param {DOMElement} container DOM element to render into.
5212 * @return {ReactComponent} Component instance rendered in `container`.
5213 */
5214 constructAndRenderComponent: function(constructor, props, container) {
5215 var element = createElement(constructor, props);
5216 return ReactMount.render(element, container);
5217 },
5218
5219 /**
5220 * Constructs a component instance of `constructor` with `initialProps` and
5221 * renders it into a container node identified by supplied `id`.
5222 *
5223 * @param {function} componentConstructor React component constructor
5224 * @param {?object} props Initial props of the component instance.
5225 * @param {string} id ID of the DOM element to render into.
5226 * @return {ReactComponent} Component instance rendered in the container node.
5227 */
5228 constructAndRenderComponentByID: function(constructor, props, id) {
5229 var domNode = document.getElementById(id);
5230 ("production" !== process.env.NODE_ENV ? invariant(
5231 domNode,
5232 'Tried to get element with id of "%s" but it is not present on the page.',
5233 id
5234 ) : invariant(domNode));
5235 return ReactMount.constructAndRenderComponent(constructor, props, domNode);
5236 },
5237
5238 /**
5239 * Registers a container node into which React components will be rendered.
5240 * This also creates the "reactRoot" ID that will be assigned to the element
5241 * rendered within.
5242 *
5243 * @param {DOMElement} container DOM element to register as a container.
5244 * @return {string} The "reactRoot" ID of elements rendered within.
5245 */
5246 registerContainer: function(container) {
5247 var reactRootID = getReactRootID(container);
5248 if (reactRootID) {
5249 // If one exists, make sure it is a valid "reactRoot" ID.
5250 reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(reactRootID);
5251 }
5252 if (!reactRootID) {
5253 // No valid "reactRoot" ID found, create one.
5254 reactRootID = ReactInstanceHandles.createReactRootID();
5255 }
5256 containersByReactRootID[reactRootID] = container;
5257 return reactRootID;
5258 },
5259
5260 /**
5261 * Unmounts and destroys the React component rendered in the `container`.
5262 *
5263 * @param {DOMElement} container DOM element containing a React component.
5264 * @return {boolean} True if a component was found in and unmounted from
5265 * `container`
5266 */
5267 unmountComponentAtNode: function(container) {
5268 // Various parts of our code (such as ReactCompositeComponent's
5269 // _renderValidatedComponent) assume that calls to render aren't nested;
5270 // verify that that's the case. (Strictly speaking, unmounting won't cause a
5271 // render but we still don't expect to be in a render call here.)
5272 ("production" !== process.env.NODE_ENV ? warning(
5273 ReactCurrentOwner.current == null,
5274 'unmountComponentAtNode(): Render methods should be a pure function of ' +
5275 'props and state; triggering nested component updates from render is ' +
5276 'not allowed. If necessary, trigger nested updates in ' +
5277 'componentDidUpdate.'
5278 ) : null);
5279
5280 var reactRootID = getReactRootID(container);
5281 var component = instancesByReactRootID[reactRootID];
5282 if (!component) {
5283 return false;
5284 }
5285 ReactMount.unmountComponentFromNode(component, container);
5286 delete instancesByReactRootID[reactRootID];
5287 delete containersByReactRootID[reactRootID];
5288 if ("production" !== process.env.NODE_ENV) {
5289 delete rootElementsByReactRootID[reactRootID];
5290 }
5291 return true;
5292 },
5293
5294 /**
5295 * Unmounts a component and removes it from the DOM.
5296 *
5297 * @param {ReactComponent} instance React component instance.
5298 * @param {DOMElement} container DOM element to unmount from.
5299 * @final
5300 * @internal
5301 * @see {ReactMount.unmountComponentAtNode}
5302 */
5303 unmountComponentFromNode: function(instance, container) {
5304 instance.unmountComponent();
5305
5306 if (container.nodeType === DOC_NODE_TYPE) {
5307 container = container.documentElement;
5308 }
5309
5310 // http://jsperf.com/emptying-a-node
5311 while (container.lastChild) {
5312 container.removeChild(container.lastChild);
5313 }
5314 },
5315
5316 /**
5317 * Finds the container DOM element that contains React component to which the
5318 * supplied DOM `id` belongs.
5319 *
5320 * @param {string} id The ID of an element rendered by a React component.
5321 * @return {?DOMElement} DOM element that contains the `id`.
5322 */
5323 findReactContainerForID: function(id) {
5324 var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(id);
5325 var container = containersByReactRootID[reactRootID];
5326
5327 if ("production" !== process.env.NODE_ENV) {
5328 var rootElement = rootElementsByReactRootID[reactRootID];
5329 if (rootElement && rootElement.parentNode !== container) {
5330 ("production" !== process.env.NODE_ENV ? invariant(
5331 // Call internalGetID here because getID calls isValid which calls
5332 // findReactContainerForID (this function).
5333 internalGetID(rootElement) === reactRootID,
5334 'ReactMount: Root element ID differed from reactRootID.'
5335 ) : invariant(// Call internalGetID here because getID calls isValid which calls
5336 // findReactContainerForID (this function).
5337 internalGetID(rootElement) === reactRootID));
5338
5339 var containerChild = container.firstChild;
5340 if (containerChild &&
5341 reactRootID === internalGetID(containerChild)) {
5342 // If the container has a new child with the same ID as the old
5343 // root element, then rootElementsByReactRootID[reactRootID] is
5344 // just stale and needs to be updated. The case that deserves a
5345 // warning is when the container is empty.
5346 rootElementsByReactRootID[reactRootID] = containerChild;
5347 } else {
5348 console.warn(
5349 'ReactMount: Root element has been removed from its original ' +
5350 'container. New container:', rootElement.parentNode
5351 );
5352 }
5353 }
5354 }
5355
5356 return container;
5357 },
5358
5359 /**
5360 * Finds an element rendered by React with the supplied ID.
5361 *
5362 * @param {string} id ID of a DOM node in the React component.
5363 * @return {DOMElement} Root DOM node of the React component.
5364 */
5365 findReactNodeByID: function(id) {
5366 var reactRoot = ReactMount.findReactContainerForID(id);
5367 return ReactMount.findComponentRoot(reactRoot, id);
5368 },
5369
5370 /**
5371 * True if the supplied `node` is rendered by React.
5372 *
5373 * @param {*} node DOM Element to check.
5374 * @return {boolean} True if the DOM Element appears to be rendered by React.
5375 * @internal
5376 */
5377 isRenderedByReact: function(node) {
5378 if (node.nodeType !== 1) {
5379 // Not a DOMElement, therefore not a React component
5380 return false;
5381 }
5382 var id = ReactMount.getID(node);
5383 return id ? id.charAt(0) === SEPARATOR : false;
5384 },
5385
5386 /**
5387 * Traverses up the ancestors of the supplied node to find a node that is a
5388 * DOM representation of a React component.
5389 *
5390 * @param {*} node
5391 * @return {?DOMEventTarget}
5392 * @internal
5393 */
5394 getFirstReactDOM: function(node) {
5395 var current = node;
5396 while (current && current.parentNode !== current) {
5397 if (ReactMount.isRenderedByReact(current)) {
5398 return current;
5399 }
5400 current = current.parentNode;
5401 }
5402 return null;
5403 },
5404
5405 /**
5406 * Finds a node with the supplied `targetID` inside of the supplied
5407 * `ancestorNode`. Exploits the ID naming scheme to perform the search
5408 * quickly.
5409 *
5410 * @param {DOMEventTarget} ancestorNode Search from this root.
5411 * @pararm {string} targetID ID of the DOM representation of the component.
5412 * @return {DOMEventTarget} DOM node with the supplied `targetID`.
5413 * @internal
5414 */
5415 findComponentRoot: function(ancestorNode, targetID) {
5416 var firstChildren = findComponentRootReusableArray;
5417 var childIndex = 0;
5418
5419 var deepestAncestor = findDeepestCachedAncestor(targetID) || ancestorNode;
5420
5421 firstChildren[0] = deepestAncestor.firstChild;
5422 firstChildren.length = 1;
5423
5424 while (childIndex < firstChildren.length) {
5425 var child = firstChildren[childIndex++];
5426 var targetChild;
5427
5428 while (child) {
5429 var childID = ReactMount.getID(child);
5430 if (childID) {
5431 // Even if we find the node we're looking for, we finish looping
5432 // through its siblings to ensure they're cached so that we don't have
5433 // to revisit this node again. Otherwise, we make n^2 calls to getID
5434 // when visiting the many children of a single node in order.
5435
5436 if (targetID === childID) {
5437 targetChild = child;
5438 } else if (ReactInstanceHandles.isAncestorIDOf(childID, targetID)) {
5439 // If we find a child whose ID is an ancestor of the given ID,
5440 // then we can be sure that we only want to search the subtree
5441 // rooted at this child, so we can throw out the rest of the
5442 // search state.
5443 firstChildren.length = childIndex = 0;
5444 firstChildren.push(child.firstChild);
5445 }
5446
5447 } else {
5448 // If this child had no ID, then there's a chance that it was
5449 // injected automatically by the browser, as when a `<table>`
5450 // element sprouts an extra `<tbody>` child as a side effect of
5451 // `.innerHTML` parsing. Optimistically continue down this
5452 // branch, but not before examining the other siblings.
5453 firstChildren.push(child.firstChild);
5454 }
5455
5456 child = child.nextSibling;
5457 }
5458
5459 if (targetChild) {
5460 // Emptying firstChildren/findComponentRootReusableArray is
5461 // not necessary for correctness, but it helps the GC reclaim
5462 // any nodes that were left at the end of the search.
5463 firstChildren.length = 0;
5464
5465 return targetChild;
5466 }
5467 }
5468
5469 firstChildren.length = 0;
5470
5471 ("production" !== process.env.NODE_ENV ? invariant(
5472 false,
5473 'findComponentRoot(..., %s): Unable to find element. This probably ' +
5474 'means the DOM was unexpectedly mutated (e.g., by the browser), ' +
5475 'usually due to forgetting a <tbody> when using tables, nesting tags ' +
5476 'like <form>, <p>, or <a>, or using non-SVG elements in an <svg> ' +
5477 'parent. ' +
5478 'Try inspecting the child nodes of the element with React ID `%s`.',
5479 targetID,
5480 ReactMount.getID(ancestorNode)
5481 ) : invariant(false));
5482 },
5483
5484
5485 /**
5486 * React ID utilities.
5487 */
5488
5489 getReactRootID: getReactRootID,
5490
5491 getID: getID,
5492
5493 setID: setID,
5494
5495 getNode: getNode,
5496
5497 purgeID: purgeID
5498 };
5499
5500 // Deprecations (remove for 0.13)
5501 ReactMount.renderComponent = deprecated(
5502 'ReactMount',
5503 'renderComponent',
5504 'render',
5505 this,
5506 ReactMount.render
5507 );
5508
5509 module.exports = ReactMount;
5510
5511 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(27)))
5512
5513/***/ },
5514/* 18 */
5515/***/ function(module, exports, __webpack_require__) {
5516
5517 /**
5518 * Copyright 2013-2014, Facebook, Inc.
5519 * All rights reserved.
5520 *
5521 * This source code is licensed under the BSD-style license found in the
5522 * LICENSE file in the root directory of this source tree. An additional grant
5523 * of patent rights can be found in the PATENTS file in the same directory.
5524 *
5525 * @providesModule ReactMultiChild
5526 * @typechecks static-only
5527 */
5528
5529 "use strict";
5530
5531 var ReactComponent = __webpack_require__(6);
5532 var ReactMultiChildUpdateTypes = __webpack_require__(81);
5533
5534 var flattenChildren = __webpack_require__(82);
5535 var instantiateReactComponent = __webpack_require__(43);
5536 var shouldUpdateReactComponent = __webpack_require__(48);
5537
5538 /**
5539 * Updating children of a component may trigger recursive updates. The depth is
5540 * used to batch recursive updates to render markup more efficiently.
5541 *
5542 * @type {number}
5543 * @private
5544 */
5545 var updateDepth = 0;
5546
5547 /**
5548 * Queue of update configuration objects.
5549 *
5550 * Each object has a `type` property that is in `ReactMultiChildUpdateTypes`.
5551 *
5552 * @type {array<object>}
5553 * @private
5554 */
5555 var updateQueue = [];
5556
5557 /**
5558 * Queue of markup to be rendered.
5559 *
5560 * @type {array<string>}
5561 * @private
5562 */
5563 var markupQueue = [];
5564
5565 /**
5566 * Enqueues markup to be rendered and inserted at a supplied index.
5567 *
5568 * @param {string} parentID ID of the parent component.
5569 * @param {string} markup Markup that renders into an element.
5570 * @param {number} toIndex Destination index.
5571 * @private
5572 */
5573 function enqueueMarkup(parentID, markup, toIndex) {
5574 // NOTE: Null values reduce hidden classes.
5575 updateQueue.push({
5576 parentID: parentID,
5577 parentNode: null,
5578 type: ReactMultiChildUpdateTypes.INSERT_MARKUP,
5579 markupIndex: markupQueue.push(markup) - 1,
5580 textContent: null,
5581 fromIndex: null,
5582 toIndex: toIndex
5583 });
5584 }
5585
5586 /**
5587 * Enqueues moving an existing element to another index.
5588 *
5589 * @param {string} parentID ID of the parent component.
5590 * @param {number} fromIndex Source index of the existing element.
5591 * @param {number} toIndex Destination index of the element.
5592 * @private
5593 */
5594 function enqueueMove(parentID, fromIndex, toIndex) {
5595 // NOTE: Null values reduce hidden classes.
5596 updateQueue.push({
5597 parentID: parentID,
5598 parentNode: null,
5599 type: ReactMultiChildUpdateTypes.MOVE_EXISTING,
5600 markupIndex: null,
5601 textContent: null,
5602 fromIndex: fromIndex,
5603 toIndex: toIndex
5604 });
5605 }
5606
5607 /**
5608 * Enqueues removing an element at an index.
5609 *
5610 * @param {string} parentID ID of the parent component.
5611 * @param {number} fromIndex Index of the element to remove.
5612 * @private
5613 */
5614 function enqueueRemove(parentID, fromIndex) {
5615 // NOTE: Null values reduce hidden classes.
5616 updateQueue.push({
5617 parentID: parentID,
5618 parentNode: null,
5619 type: ReactMultiChildUpdateTypes.REMOVE_NODE,
5620 markupIndex: null,
5621 textContent: null,
5622 fromIndex: fromIndex,
5623 toIndex: null
5624 });
5625 }
5626
5627 /**
5628 * Enqueues setting the text content.
5629 *
5630 * @param {string} parentID ID of the parent component.
5631 * @param {string} textContent Text content to set.
5632 * @private
5633 */
5634 function enqueueTextContent(parentID, textContent) {
5635 // NOTE: Null values reduce hidden classes.
5636 updateQueue.push({
5637 parentID: parentID,
5638 parentNode: null,
5639 type: ReactMultiChildUpdateTypes.TEXT_CONTENT,
5640 markupIndex: null,
5641 textContent: textContent,
5642 fromIndex: null,
5643 toIndex: null
5644 });
5645 }
5646
5647 /**
5648 * Processes any enqueued updates.
5649 *
5650 * @private
5651 */
5652 function processQueue() {
5653 if (updateQueue.length) {
5654 ReactComponent.BackendIDOperations.dangerouslyProcessChildrenUpdates(
5655 updateQueue,
5656 markupQueue
5657 );
5658 clearQueue();
5659 }
5660 }
5661
5662 /**
5663 * Clears any enqueued updates.
5664 *
5665 * @private
5666 */
5667 function clearQueue() {
5668 updateQueue.length = 0;
5669 markupQueue.length = 0;
5670 }
5671
5672 /**
5673 * ReactMultiChild are capable of reconciling multiple children.
5674 *
5675 * @class ReactMultiChild
5676 * @internal
5677 */
5678 var ReactMultiChild = {
5679
5680 /**
5681 * Provides common functionality for components that must reconcile multiple
5682 * children. This is used by `ReactDOMComponent` to mount, update, and
5683 * unmount child components.
5684 *
5685 * @lends {ReactMultiChild.prototype}
5686 */
5687 Mixin: {
5688
5689 /**
5690 * Generates a "mount image" for each of the supplied children. In the case
5691 * of `ReactDOMComponent`, a mount image is a string of markup.
5692 *
5693 * @param {?object} nestedChildren Nested child maps.
5694 * @return {array} An array of mounted representations.
5695 * @internal
5696 */
5697 mountChildren: function(nestedChildren, transaction) {
5698 var children = flattenChildren(nestedChildren);
5699 var mountImages = [];
5700 var index = 0;
5701 this._renderedChildren = children;
5702 for (var name in children) {
5703 var child = children[name];
5704 if (children.hasOwnProperty(name)) {
5705 // The rendered children must be turned into instances as they're
5706 // mounted.
5707 var childInstance = instantiateReactComponent(child, null);
5708 children[name] = childInstance;
5709 // Inlined for performance, see `ReactInstanceHandles.createReactID`.
5710 var rootID = this._rootNodeID + name;
5711 var mountImage = childInstance.mountComponent(
5712 rootID,
5713 transaction,
5714 this._mountDepth + 1
5715 );
5716 childInstance._mountIndex = index;
5717 mountImages.push(mountImage);
5718 index++;
5719 }
5720 }
5721 return mountImages;
5722 },
5723
5724 /**
5725 * Replaces any rendered children with a text content string.
5726 *
5727 * @param {string} nextContent String of content.
5728 * @internal
5729 */
5730 updateTextContent: function(nextContent) {
5731 updateDepth++;
5732 var errorThrown = true;
5733 try {
5734 var prevChildren = this._renderedChildren;
5735 // Remove any rendered children.
5736 for (var name in prevChildren) {
5737 if (prevChildren.hasOwnProperty(name)) {
5738 this._unmountChildByName(prevChildren[name], name);
5739 }
5740 }
5741 // Set new text content.
5742 this.setTextContent(nextContent);
5743 errorThrown = false;
5744 } finally {
5745 updateDepth--;
5746 if (!updateDepth) {
5747 errorThrown ? clearQueue() : processQueue();
5748 }
5749 }
5750 },
5751
5752 /**
5753 * Updates the rendered children with new children.
5754 *
5755 * @param {?object} nextNestedChildren Nested child maps.
5756 * @param {ReactReconcileTransaction} transaction
5757 * @internal
5758 */
5759 updateChildren: function(nextNestedChildren, transaction) {
5760 updateDepth++;
5761 var errorThrown = true;
5762 try {
5763 this._updateChildren(nextNestedChildren, transaction);
5764 errorThrown = false;
5765 } finally {
5766 updateDepth--;
5767 if (!updateDepth) {
5768 errorThrown ? clearQueue() : processQueue();
5769 }
5770 }
5771 },
5772
5773 /**
5774 * Improve performance by isolating this hot code path from the try/catch
5775 * block in `updateChildren`.
5776 *
5777 * @param {?object} nextNestedChildren Nested child maps.
5778 * @param {ReactReconcileTransaction} transaction
5779 * @final
5780 * @protected
5781 */
5782 _updateChildren: function(nextNestedChildren, transaction) {
5783 var nextChildren = flattenChildren(nextNestedChildren);
5784 var prevChildren = this._renderedChildren;
5785 if (!nextChildren && !prevChildren) {
5786 return;
5787 }
5788 var name;
5789 // `nextIndex` will increment for each child in `nextChildren`, but
5790 // `lastIndex` will be the last index visited in `prevChildren`.
5791 var lastIndex = 0;
5792 var nextIndex = 0;
5793 for (name in nextChildren) {
5794 if (!nextChildren.hasOwnProperty(name)) {
5795 continue;
5796 }
5797 var prevChild = prevChildren && prevChildren[name];
5798 var prevElement = prevChild && prevChild._currentElement;
5799 var nextElement = nextChildren[name];
5800 if (shouldUpdateReactComponent(prevElement, nextElement)) {
5801 this.moveChild(prevChild, nextIndex, lastIndex);
5802 lastIndex = Math.max(prevChild._mountIndex, lastIndex);
5803 prevChild.receiveComponent(nextElement, transaction);
5804 prevChild._mountIndex = nextIndex;
5805 } else {
5806 if (prevChild) {
5807 // Update `lastIndex` before `_mountIndex` gets unset by unmounting.
5808 lastIndex = Math.max(prevChild._mountIndex, lastIndex);
5809 this._unmountChildByName(prevChild, name);
5810 }
5811 // The child must be instantiated before it's mounted.
5812 var nextChildInstance = instantiateReactComponent(
5813 nextElement,
5814 null
5815 );
5816 this._mountChildByNameAtIndex(
5817 nextChildInstance, name, nextIndex, transaction
5818 );
5819 }
5820 nextIndex++;
5821 }
5822 // Remove children that are no longer present.
5823 for (name in prevChildren) {
5824 if (prevChildren.hasOwnProperty(name) &&
5825 !(nextChildren && nextChildren[name])) {
5826 this._unmountChildByName(prevChildren[name], name);
5827 }
5828 }
5829 },
5830
5831 /**
5832 * Unmounts all rendered children. This should be used to clean up children
5833 * when this component is unmounted.
5834 *
5835 * @internal
5836 */
5837 unmountChildren: function() {
5838 var renderedChildren = this._renderedChildren;
5839 for (var name in renderedChildren) {
5840 var renderedChild = renderedChildren[name];
5841 // TODO: When is this not true?
5842 if (renderedChild.unmountComponent) {
5843 renderedChild.unmountComponent();
5844 }
5845 }
5846 this._renderedChildren = null;
5847 },
5848
5849 /**
5850 * Moves a child component to the supplied index.
5851 *
5852 * @param {ReactComponent} child Component to move.
5853 * @param {number} toIndex Destination index of the element.
5854 * @param {number} lastIndex Last index visited of the siblings of `child`.
5855 * @protected
5856 */
5857 moveChild: function(child, toIndex, lastIndex) {
5858 // If the index of `child` is less than `lastIndex`, then it needs to
5859 // be moved. Otherwise, we do not need to move it because a child will be
5860 // inserted or moved before `child`.
5861 if (child._mountIndex < lastIndex) {
5862 enqueueMove(this._rootNodeID, child._mountIndex, toIndex);
5863 }
5864 },
5865
5866 /**
5867 * Creates a child component.
5868 *
5869 * @param {ReactComponent} child Component to create.
5870 * @param {string} mountImage Markup to insert.
5871 * @protected
5872 */
5873 createChild: function(child, mountImage) {
5874 enqueueMarkup(this._rootNodeID, mountImage, child._mountIndex);
5875 },
5876
5877 /**
5878 * Removes a child component.
5879 *
5880 * @param {ReactComponent} child Child to remove.
5881 * @protected
5882 */
5883 removeChild: function(child) {
5884 enqueueRemove(this._rootNodeID, child._mountIndex);
5885 },
5886
5887 /**
5888 * Sets this text content string.
5889 *
5890 * @param {string} textContent Text content to set.
5891 * @protected
5892 */
5893 setTextContent: function(textContent) {
5894 enqueueTextContent(this._rootNodeID, textContent);
5895 },
5896
5897 /**
5898 * Mounts a child with the supplied name.
5899 *
5900 * NOTE: This is part of `updateChildren` and is here for readability.
5901 *
5902 * @param {ReactComponent} child Component to mount.
5903 * @param {string} name Name of the child.
5904 * @param {number} index Index at which to insert the child.
5905 * @param {ReactReconcileTransaction} transaction
5906 * @private
5907 */
5908 _mountChildByNameAtIndex: function(child, name, index, transaction) {
5909 // Inlined for performance, see `ReactInstanceHandles.createReactID`.
5910 var rootID = this._rootNodeID + name;
5911 var mountImage = child.mountComponent(
5912 rootID,
5913 transaction,
5914 this._mountDepth + 1
5915 );
5916 child._mountIndex = index;
5917 this.createChild(child, mountImage);
5918 this._renderedChildren = this._renderedChildren || {};
5919 this._renderedChildren[name] = child;
5920 },
5921
5922 /**
5923 * Unmounts a rendered child by name.
5924 *
5925 * NOTE: This is part of `updateChildren` and is here for readability.
5926 *
5927 * @param {ReactComponent} child Component to unmount.
5928 * @param {string} name Name of the child in `this._renderedChildren`.
5929 * @private
5930 */
5931 _unmountChildByName: function(child, name) {
5932 this.removeChild(child);
5933 child._mountIndex = null;
5934 child.unmountComponent();
5935 delete this._renderedChildren[name];
5936 }
5937
5938 }
5939
5940 };
5941
5942 module.exports = ReactMultiChild;
5943
5944
5945/***/ },
5946/* 19 */
5947/***/ function(module, exports, __webpack_require__) {
5948
5949 /* WEBPACK VAR INJECTION */(function(process) {/**
5950 * Copyright 2013-2014, Facebook, Inc.
5951 * All rights reserved.
5952 *
5953 * This source code is licensed under the BSD-style license found in the
5954 * LICENSE file in the root directory of this source tree. An additional grant
5955 * of patent rights can be found in the PATENTS file in the same directory.
5956 *
5957 * @providesModule ReactPerf
5958 * @typechecks static-only
5959 */
5960
5961 "use strict";
5962
5963 /**
5964 * ReactPerf is a general AOP system designed to measure performance. This
5965 * module only has the hooks: see ReactDefaultPerf for the analysis tool.
5966 */
5967 var ReactPerf = {
5968 /**
5969 * Boolean to enable/disable measurement. Set to false by default to prevent
5970 * accidental logging and perf loss.
5971 */
5972 enableMeasure: false,
5973
5974 /**
5975 * Holds onto the measure function in use. By default, don't measure
5976 * anything, but we'll override this if we inject a measure function.
5977 */
5978 storedMeasure: _noMeasure,
5979
5980 /**
5981 * Use this to wrap methods you want to measure. Zero overhead in production.
5982 *
5983 * @param {string} objName
5984 * @param {string} fnName
5985 * @param {function} func
5986 * @return {function}
5987 */
5988 measure: function(objName, fnName, func) {
5989 if ("production" !== process.env.NODE_ENV) {
5990 var measuredFunc = null;
5991 var wrapper = function() {
5992 if (ReactPerf.enableMeasure) {
5993 if (!measuredFunc) {
5994 measuredFunc = ReactPerf.storedMeasure(objName, fnName, func);
5995 }
5996 return measuredFunc.apply(this, arguments);
5997 }
5998 return func.apply(this, arguments);
5999 };
6000 wrapper.displayName = objName + '_' + fnName;
6001 return wrapper;
6002 }
6003 return func;
6004 },
6005
6006 injection: {
6007 /**
6008 * @param {function} measure
6009 */
6010 injectMeasure: function(measure) {
6011 ReactPerf.storedMeasure = measure;
6012 }
6013 }
6014 };
6015
6016 /**
6017 * Simply passes through the measured function, without measuring it.
6018 *
6019 * @param {string} objName
6020 * @param {string} fnName
6021 * @param {function} func
6022 * @return {function}
6023 */
6024 function _noMeasure(objName, fnName, func) {
6025 return func;
6026 }
6027
6028 module.exports = ReactPerf;
6029
6030 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(27)))
6031
6032/***/ },
6033/* 20 */
6034/***/ function(module, exports, __webpack_require__) {
6035
6036 /**
6037 * Copyright 2013-2014, Facebook, Inc.
6038 * All rights reserved.
6039 *
6040 * This source code is licensed under the BSD-style license found in the
6041 * LICENSE file in the root directory of this source tree. An additional grant
6042 * of patent rights can be found in the PATENTS file in the same directory.
6043 *
6044 * @providesModule ReactPropTypes
6045 */
6046
6047 "use strict";
6048
6049 var ReactElement = __webpack_require__(10);
6050 var ReactPropTypeLocationNames = __webpack_require__(41);
6051
6052 var deprecated = __webpack_require__(24);
6053 var emptyFunction = __webpack_require__(83);
6054
6055 /**
6056 * Collection of methods that allow declaration and validation of props that are
6057 * supplied to React components. Example usage:
6058 *
6059 * var Props = require('ReactPropTypes');
6060 * var MyArticle = React.createClass({
6061 * propTypes: {
6062 * // An optional string prop named "description".
6063 * description: Props.string,
6064 *
6065 * // A required enum prop named "category".
6066 * category: Props.oneOf(['News','Photos']).isRequired,
6067 *
6068 * // A prop named "dialog" that requires an instance of Dialog.
6069 * dialog: Props.instanceOf(Dialog).isRequired
6070 * },
6071 * render: function() { ... }
6072 * });
6073 *
6074 * A more formal specification of how these methods are used:
6075 *
6076 * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)
6077 * decl := ReactPropTypes.{type}(.isRequired)?
6078 *
6079 * Each and every declaration produces a function with the same signature. This
6080 * allows the creation of custom validation functions. For example:
6081 *
6082 * var MyLink = React.createClass({
6083 * propTypes: {
6084 * // An optional string or URI prop named "href".
6085 * href: function(props, propName, componentName) {
6086 * var propValue = props[propName];
6087 * if (propValue != null && typeof propValue !== 'string' &&
6088 * !(propValue instanceof URI)) {
6089 * return new Error(
6090 * 'Expected a string or an URI for ' + propName + ' in ' +
6091 * componentName
6092 * );
6093 * }
6094 * }
6095 * },
6096 * render: function() {...}
6097 * });
6098 *
6099 * @internal
6100 */
6101
6102 var ANONYMOUS = '<<anonymous>>';
6103
6104 var elementTypeChecker = createElementTypeChecker();
6105 var nodeTypeChecker = createNodeChecker();
6106
6107 var ReactPropTypes = {
6108 array: createPrimitiveTypeChecker('array'),
6109 bool: createPrimitiveTypeChecker('boolean'),
6110 func: createPrimitiveTypeChecker('function'),
6111 number: createPrimitiveTypeChecker('number'),
6112 object: createPrimitiveTypeChecker('object'),
6113 string: createPrimitiveTypeChecker('string'),
6114
6115 any: createAnyTypeChecker(),
6116 arrayOf: createArrayOfTypeChecker,
6117 element: elementTypeChecker,
6118 instanceOf: createInstanceTypeChecker,
6119 node: nodeTypeChecker,
6120 objectOf: createObjectOfTypeChecker,
6121 oneOf: createEnumTypeChecker,
6122 oneOfType: createUnionTypeChecker,
6123 shape: createShapeTypeChecker,
6124
6125 component: deprecated(
6126 'React.PropTypes',
6127 'component',
6128 'element',
6129 this,
6130 elementTypeChecker
6131 ),
6132 renderable: deprecated(
6133 'React.PropTypes',
6134 'renderable',
6135 'node',
6136 this,
6137 nodeTypeChecker
6138 )
6139 };
6140
6141 function createChainableTypeChecker(validate) {
6142 function checkType(isRequired, props, propName, componentName, location) {
6143 componentName = componentName || ANONYMOUS;
6144 if (props[propName] == null) {
6145 var locationName = ReactPropTypeLocationNames[location];
6146 if (isRequired) {
6147 return new Error(
6148 ("Required " + locationName + " `" + propName + "` was not specified in ")+
6149 ("`" + componentName + "`.")
6150 );
6151 }
6152 } else {
6153 return validate(props, propName, componentName, location);
6154 }
6155 }
6156
6157 var chainedCheckType = checkType.bind(null, false);
6158 chainedCheckType.isRequired = checkType.bind(null, true);
6159
6160 return chainedCheckType;
6161 }
6162
6163 function createPrimitiveTypeChecker(expectedType) {
6164 function validate(props, propName, componentName, location) {
6165 var propValue = props[propName];
6166 var propType = getPropType(propValue);
6167 if (propType !== expectedType) {
6168 var locationName = ReactPropTypeLocationNames[location];
6169 // `propValue` being instance of, say, date/regexp, pass the 'object'
6170 // check, but we can offer a more precise error message here rather than
6171 // 'of type `object`'.
6172 var preciseType = getPreciseType(propValue);
6173
6174 return new Error(
6175 ("Invalid " + locationName + " `" + propName + "` of type `" + preciseType + "` ") +
6176 ("supplied to `" + componentName + "`, expected `" + expectedType + "`.")
6177 );
6178 }
6179 }
6180 return createChainableTypeChecker(validate);
6181 }
6182
6183 function createAnyTypeChecker() {
6184 return createChainableTypeChecker(emptyFunction.thatReturns());
6185 }
6186
6187 function createArrayOfTypeChecker(typeChecker) {
6188 function validate(props, propName, componentName, location) {
6189 var propValue = props[propName];
6190 if (!Array.isArray(propValue)) {
6191 var locationName = ReactPropTypeLocationNames[location];
6192 var propType = getPropType(propValue);
6193 return new Error(
6194 ("Invalid " + locationName + " `" + propName + "` of type ") +
6195 ("`" + propType + "` supplied to `" + componentName + "`, expected an array.")
6196 );
6197 }
6198 for (var i = 0; i < propValue.length; i++) {
6199 var error = typeChecker(propValue, i, componentName, location);
6200 if (error instanceof Error) {
6201 return error;
6202 }
6203 }
6204 }
6205 return createChainableTypeChecker(validate);
6206 }
6207
6208 function createElementTypeChecker() {
6209 function validate(props, propName, componentName, location) {
6210 if (!ReactElement.isValidElement(props[propName])) {
6211 var locationName = ReactPropTypeLocationNames[location];
6212 return new Error(
6213 ("Invalid " + locationName + " `" + propName + "` supplied to ") +
6214 ("`" + componentName + "`, expected a ReactElement.")
6215 );
6216 }
6217 }
6218 return createChainableTypeChecker(validate);
6219 }
6220
6221 function createInstanceTypeChecker(expectedClass) {
6222 function validate(props, propName, componentName, location) {
6223 if (!(props[propName] instanceof expectedClass)) {
6224 var locationName = ReactPropTypeLocationNames[location];
6225 var expectedClassName = expectedClass.name || ANONYMOUS;
6226 return new Error(
6227 ("Invalid " + locationName + " `" + propName + "` supplied to ") +
6228 ("`" + componentName + "`, expected instance of `" + expectedClassName + "`.")
6229 );
6230 }
6231 }
6232 return createChainableTypeChecker(validate);
6233 }
6234
6235 function createEnumTypeChecker(expectedValues) {
6236 function validate(props, propName, componentName, location) {
6237 var propValue = props[propName];
6238 for (var i = 0; i < expectedValues.length; i++) {
6239 if (propValue === expectedValues[i]) {
6240 return;
6241 }
6242 }
6243
6244 var locationName = ReactPropTypeLocationNames[location];
6245 var valuesString = JSON.stringify(expectedValues);
6246 return new Error(
6247 ("Invalid " + locationName + " `" + propName + "` of value `" + propValue + "` ") +
6248 ("supplied to `" + componentName + "`, expected one of " + valuesString + ".")
6249 );
6250 }
6251 return createChainableTypeChecker(validate);
6252 }
6253
6254 function createObjectOfTypeChecker(typeChecker) {
6255 function validate(props, propName, componentName, location) {
6256 var propValue = props[propName];
6257 var propType = getPropType(propValue);
6258 if (propType !== 'object') {
6259 var locationName = ReactPropTypeLocationNames[location];
6260 return new Error(
6261 ("Invalid " + locationName + " `" + propName + "` of type ") +
6262 ("`" + propType + "` supplied to `" + componentName + "`, expected an object.")
6263 );
6264 }
6265 for (var key in propValue) {
6266 if (propValue.hasOwnProperty(key)) {
6267 var error = typeChecker(propValue, key, componentName, location);
6268 if (error instanceof Error) {
6269 return error;
6270 }
6271 }
6272 }
6273 }
6274 return createChainableTypeChecker(validate);
6275 }
6276
6277 function createUnionTypeChecker(arrayOfTypeCheckers) {
6278 function validate(props, propName, componentName, location) {
6279 for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
6280 var checker = arrayOfTypeCheckers[i];
6281 if (checker(props, propName, componentName, location) == null) {
6282 return;
6283 }
6284 }
6285
6286 var locationName = ReactPropTypeLocationNames[location];
6287 return new Error(
6288 ("Invalid " + locationName + " `" + propName + "` supplied to ") +
6289 ("`" + componentName + "`.")
6290 );
6291 }
6292 return createChainableTypeChecker(validate);
6293 }
6294
6295 function createNodeChecker() {
6296 function validate(props, propName, componentName, location) {
6297 if (!isNode(props[propName])) {
6298 var locationName = ReactPropTypeLocationNames[location];
6299 return new Error(
6300 ("Invalid " + locationName + " `" + propName + "` supplied to ") +
6301 ("`" + componentName + "`, expected a ReactNode.")
6302 );
6303 }
6304 }
6305 return createChainableTypeChecker(validate);
6306 }
6307
6308 function createShapeTypeChecker(shapeTypes) {
6309 function validate(props, propName, componentName, location) {
6310 var propValue = props[propName];
6311 var propType = getPropType(propValue);
6312 if (propType !== 'object') {
6313 var locationName = ReactPropTypeLocationNames[location];
6314 return new Error(
6315 ("Invalid " + locationName + " `" + propName + "` of type `" + propType + "` ") +
6316 ("supplied to `" + componentName + "`, expected `object`.")
6317 );
6318 }
6319 for (var key in shapeTypes) {
6320 var checker = shapeTypes[key];
6321 if (!checker) {
6322 continue;
6323 }
6324 var error = checker(propValue, key, componentName, location);
6325 if (error) {
6326 return error;
6327 }
6328 }
6329 }
6330 return createChainableTypeChecker(validate, 'expected `object`');
6331 }
6332
6333 function isNode(propValue) {
6334 switch(typeof propValue) {
6335 case 'number':
6336 case 'string':
6337 return true;
6338 case 'boolean':
6339 return !propValue;
6340 case 'object':
6341 if (Array.isArray(propValue)) {
6342 return propValue.every(isNode);
6343 }
6344 if (ReactElement.isValidElement(propValue)) {
6345 return true;
6346 }
6347 for (var k in propValue) {
6348 if (!isNode(propValue[k])) {
6349 return false;
6350 }
6351 }
6352 return true;
6353 default:
6354 return false;
6355 }
6356 }
6357
6358 // Equivalent of `typeof` but with special handling for array and regexp.
6359 function getPropType(propValue) {
6360 var propType = typeof propValue;
6361 if (Array.isArray(propValue)) {
6362 return 'array';
6363 }
6364 if (propValue instanceof RegExp) {
6365 // Old webkits (at least until Android 4.0) return 'function' rather than
6366 // 'object' for typeof a RegExp. We'll normalize this here so that /bla/
6367 // passes PropTypes.object.
6368 return 'object';
6369 }
6370 return propType;
6371 }
6372
6373 // This handles more types than `getPropType`. Only used for error messages.
6374 // See `createPrimitiveTypeChecker`.
6375 function getPreciseType(propValue) {
6376 var propType = getPropType(propValue);
6377 if (propType === 'object') {
6378 if (propValue instanceof Date) {
6379 return 'date';
6380 } else if (propValue instanceof RegExp) {
6381 return 'regexp';
6382 }
6383 }
6384 return propType;
6385 }
6386
6387 module.exports = ReactPropTypes;
6388
6389
6390/***/ },
6391/* 21 */
6392/***/ function(module, exports, __webpack_require__) {
6393
6394 /* WEBPACK VAR INJECTION */(function(process) {/**
6395 * Copyright 2013-2014, Facebook, Inc.
6396 * All rights reserved.
6397 *
6398 * This source code is licensed under the BSD-style license found in the
6399 * LICENSE file in the root directory of this source tree. An additional grant
6400 * of patent rights can be found in the PATENTS file in the same directory.
6401 *
6402 * @typechecks static-only
6403 * @providesModule ReactServerRendering
6404 */
6405 "use strict";
6406
6407 var ReactElement = __webpack_require__(10);
6408 var ReactInstanceHandles = __webpack_require__(15);
6409 var ReactMarkupChecksum = __webpack_require__(84);
6410 var ReactServerRenderingTransaction =
6411 __webpack_require__(85);
6412
6413 var instantiateReactComponent = __webpack_require__(43);
6414 var invariant = __webpack_require__(33);
6415
6416 /**
6417 * @param {ReactElement} element
6418 * @return {string} the HTML markup
6419 */
6420 function renderToString(element) {
6421 ("production" !== process.env.NODE_ENV ? invariant(
6422 ReactElement.isValidElement(element),
6423 'renderToString(): You must pass a valid ReactElement.'
6424 ) : invariant(ReactElement.isValidElement(element)));
6425
6426 var transaction;
6427 try {
6428 var id = ReactInstanceHandles.createReactRootID();
6429 transaction = ReactServerRenderingTransaction.getPooled(false);
6430
6431 return transaction.perform(function() {
6432 var componentInstance = instantiateReactComponent(element, null);
6433 var markup = componentInstance.mountComponent(id, transaction, 0);
6434 return ReactMarkupChecksum.addChecksumToMarkup(markup);
6435 }, null);
6436 } finally {
6437 ReactServerRenderingTransaction.release(transaction);
6438 }
6439 }
6440
6441 /**
6442 * @param {ReactElement} element
6443 * @return {string} the HTML markup, without the extra React ID and checksum
6444 * (for generating static pages)
6445 */
6446 function renderToStaticMarkup(element) {
6447 ("production" !== process.env.NODE_ENV ? invariant(
6448 ReactElement.isValidElement(element),
6449 'renderToStaticMarkup(): You must pass a valid ReactElement.'
6450 ) : invariant(ReactElement.isValidElement(element)));
6451
6452 var transaction;
6453 try {
6454 var id = ReactInstanceHandles.createReactRootID();
6455 transaction = ReactServerRenderingTransaction.getPooled(true);
6456
6457 return transaction.perform(function() {
6458 var componentInstance = instantiateReactComponent(element, null);
6459 return componentInstance.mountComponent(id, transaction, 0);
6460 }, null);
6461 } finally {
6462 ReactServerRenderingTransaction.release(transaction);
6463 }
6464 }
6465
6466 module.exports = {
6467 renderToString: renderToString,
6468 renderToStaticMarkup: renderToStaticMarkup
6469 };
6470
6471 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(27)))
6472
6473/***/ },
6474/* 22 */
6475/***/ function(module, exports, __webpack_require__) {
6476
6477 /**
6478 * Copyright 2013-2014, Facebook, Inc.
6479 * All rights reserved.
6480 *
6481 * This source code is licensed under the BSD-style license found in the
6482 * LICENSE file in the root directory of this source tree. An additional grant
6483 * of patent rights can be found in the PATENTS file in the same directory.
6484 *
6485 * @providesModule ReactTextComponent
6486 * @typechecks static-only
6487 */
6488
6489 "use strict";
6490
6491 var DOMPropertyOperations = __webpack_require__(3);
6492 var ReactComponent = __webpack_require__(6);
6493 var ReactElement = __webpack_require__(10);
6494
6495 var assign = __webpack_require__(23);
6496 var escapeTextForBrowser = __webpack_require__(29);
6497
6498 /**
6499 * Text nodes violate a couple assumptions that React makes about components:
6500 *
6501 * - When mounting text into the DOM, adjacent text nodes are merged.
6502 * - Text nodes cannot be assigned a React root ID.
6503 *
6504 * This component is used to wrap strings in elements so that they can undergo
6505 * the same reconciliation that is applied to elements.
6506 *
6507 * TODO: Investigate representing React components in the DOM with text nodes.
6508 *
6509 * @class ReactTextComponent
6510 * @extends ReactComponent
6511 * @internal
6512 */
6513 var ReactTextComponent = function(props) {
6514 // This constructor and it's argument is currently used by mocks.
6515 };
6516
6517 assign(ReactTextComponent.prototype, ReactComponent.Mixin, {
6518
6519 /**
6520 * Creates the markup for this text node. This node is not intended to have
6521 * any features besides containing text content.
6522 *
6523 * @param {string} rootID DOM ID of the root node.
6524 * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
6525 * @param {number} mountDepth number of components in the owner hierarchy
6526 * @return {string} Markup for this text node.
6527 * @internal
6528 */
6529 mountComponent: function(rootID, transaction, mountDepth) {
6530 ReactComponent.Mixin.mountComponent.call(
6531 this,
6532 rootID,
6533 transaction,
6534 mountDepth
6535 );
6536
6537 var escapedText = escapeTextForBrowser(this.props);
6538
6539 if (transaction.renderToStaticMarkup) {
6540 // Normally we'd wrap this in a `span` for the reasons stated above, but
6541 // since this is a situation where React won't take over (static pages),
6542 // we can simply return the text as it is.
6543 return escapedText;
6544 }
6545
6546 return (
6547 '<span ' + DOMPropertyOperations.createMarkupForID(rootID) + '>' +
6548 escapedText +
6549 '</span>'
6550 );
6551 },
6552
6553 /**
6554 * Updates this component by updating the text content.
6555 *
6556 * @param {object} nextComponent Contains the next text content.
6557 * @param {ReactReconcileTransaction} transaction
6558 * @internal
6559 */
6560 receiveComponent: function(nextComponent, transaction) {
6561 var nextProps = nextComponent.props;
6562 if (nextProps !== this.props) {
6563 this.props = nextProps;
6564 ReactComponent.BackendIDOperations.updateTextContentByID(
6565 this._rootNodeID,
6566 nextProps
6567 );
6568 }
6569 }
6570
6571 });
6572
6573 var ReactTextComponentFactory = function(text) {
6574 // Bypass validation and configuration
6575 return new ReactElement(ReactTextComponent, null, null, null, null, text);
6576 };
6577
6578 ReactTextComponentFactory.type = ReactTextComponent;
6579
6580 module.exports = ReactTextComponentFactory;
6581
6582
6583/***/ },
6584/* 23 */
6585/***/ function(module, exports, __webpack_require__) {
6586
6587 /**
6588 * Copyright 2014, Facebook, Inc.
6589 * All rights reserved.
6590 *
6591 * This source code is licensed under the BSD-style license found in the
6592 * LICENSE file in the root directory of this source tree. An additional grant
6593 * of patent rights can be found in the PATENTS file in the same directory.
6594 *
6595 * @providesModule Object.assign
6596 */
6597
6598 // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.assign
6599
6600 function assign(target, sources) {
6601 if (target == null) {
6602 throw new TypeError('Object.assign target cannot be null or undefined');
6603 }
6604
6605 var to = Object(target);
6606 var hasOwnProperty = Object.prototype.hasOwnProperty;
6607
6608 for (var nextIndex = 1; nextIndex < arguments.length; nextIndex++) {
6609 var nextSource = arguments[nextIndex];
6610 if (nextSource == null) {
6611 continue;
6612 }
6613
6614 var from = Object(nextSource);
6615
6616 // We don't currently support accessors nor proxies. Therefore this
6617 // copy cannot throw. If we ever supported this then we must handle
6618 // exceptions and side-effects. We don't support symbols so they won't
6619 // be transferred.
6620
6621 for (var key in from) {
6622 if (hasOwnProperty.call(from, key)) {
6623 to[key] = from[key];
6624 }
6625 }
6626 }
6627
6628 return to;
6629 };
6630
6631 module.exports = assign;
6632
6633
6634/***/ },
6635/* 24 */
6636/***/ function(module, exports, __webpack_require__) {
6637
6638 /* WEBPACK VAR INJECTION */(function(process) {/**
6639 * Copyright 2013-2014, Facebook, Inc.
6640 * All rights reserved.
6641 *
6642 * This source code is licensed under the BSD-style license found in the
6643 * LICENSE file in the root directory of this source tree. An additional grant
6644 * of patent rights can be found in the PATENTS file in the same directory.
6645 *
6646 * @providesModule deprecated
6647 */
6648
6649 var assign = __webpack_require__(23);
6650 var warning = __webpack_require__(31);
6651
6652 /**
6653 * This will log a single deprecation notice per function and forward the call
6654 * on to the new API.
6655 *
6656 * @param {string} namespace The namespace of the call, eg 'React'
6657 * @param {string} oldName The old function name, eg 'renderComponent'
6658 * @param {string} newName The new function name, eg 'render'
6659 * @param {*} ctx The context this forwarded call should run in
6660 * @param {function} fn The function to forward on to
6661 * @return {*} Will be the value as returned from `fn`
6662 */
6663 function deprecated(namespace, oldName, newName, ctx, fn) {
6664 var warned = false;
6665 if ("production" !== process.env.NODE_ENV) {
6666 var newFn = function() {
6667 ("production" !== process.env.NODE_ENV ? warning(
6668 warned,
6669 (namespace + "." + oldName + " will be deprecated in a future version. ") +
6670 ("Use " + namespace + "." + newName + " instead.")
6671 ) : null);
6672 warned = true;
6673 return fn.apply(ctx, arguments);
6674 };
6675 newFn.displayName = (namespace + "_" + oldName);
6676 // We need to make sure all properties of the original fn are copied over.
6677 // In particular, this is needed to support PropTypes
6678 return assign(newFn, fn);
6679 }
6680
6681 return fn;
6682 }
6683
6684 module.exports = deprecated;
6685
6686 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(27)))
6687
6688/***/ },
6689/* 25 */
6690/***/ function(module, exports, __webpack_require__) {
6691
6692 /* WEBPACK VAR INJECTION */(function(process) {/**
6693 * Copyright 2013-2014, Facebook, Inc.
6694 * All rights reserved.
6695 *
6696 * This source code is licensed under the BSD-style license found in the
6697 * LICENSE file in the root directory of this source tree. An additional grant
6698 * of patent rights can be found in the PATENTS file in the same directory.
6699 *
6700 * @providesModule onlyChild
6701 */
6702 "use strict";
6703
6704 var ReactElement = __webpack_require__(10);
6705
6706 var invariant = __webpack_require__(33);
6707
6708 /**
6709 * Returns the first child in a collection of children and verifies that there
6710 * is only one child in the collection. The current implementation of this
6711 * function assumes that a single child gets passed without a wrapper, but the
6712 * purpose of this helper function is to abstract away the particular structure
6713 * of children.
6714 *
6715 * @param {?object} children Child collection structure.
6716 * @return {ReactComponent} The first and only `ReactComponent` contained in the
6717 * structure.
6718 */
6719 function onlyChild(children) {
6720 ("production" !== process.env.NODE_ENV ? invariant(
6721 ReactElement.isValidElement(children),
6722 'onlyChild must be passed a children with exactly one child.'
6723 ) : invariant(ReactElement.isValidElement(children)));
6724 return children;
6725 }
6726
6727 module.exports = onlyChild;
6728
6729 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(27)))
6730
6731/***/ },
6732/* 26 */
6733/***/ function(module, exports, __webpack_require__) {
6734
6735 /**
6736 * Copyright 2013-2014, Facebook, Inc.
6737 * All rights reserved.
6738 *
6739 * This source code is licensed under the BSD-style license found in the
6740 * LICENSE file in the root directory of this source tree. An additional grant
6741 * of patent rights can be found in the PATENTS file in the same directory.
6742 *
6743 * @providesModule ExecutionEnvironment
6744 */
6745
6746 /*jslint evil: true */
6747
6748 "use strict";
6749
6750 var canUseDOM = !!(
6751 typeof window !== 'undefined' &&
6752 window.document &&
6753 window.document.createElement
6754 );
6755
6756 /**
6757 * Simple, lightweight module assisting with the detection and context of
6758 * Worker. Helps avoid circular dependencies and allows code to reason about
6759 * whether or not they are in a Worker, even if they never include the main
6760 * `ReactWorker` dependency.
6761 */
6762 var ExecutionEnvironment = {
6763
6764 canUseDOM: canUseDOM,
6765
6766 canUseWorkers: typeof Worker !== 'undefined',
6767
6768 canUseEventListeners:
6769 canUseDOM && !!(window.addEventListener || window.attachEvent),
6770
6771 canUseViewport: canUseDOM && !!window.screen,
6772
6773 isInWorker: !canUseDOM // For now, this is true - might change in the future.
6774
6775 };
6776
6777 module.exports = ExecutionEnvironment;
6778
6779
6780/***/ },
6781/* 27 */
6782/***/ function(module, exports, __webpack_require__) {
6783
6784 // shim for using process in browser
6785
6786 var process = module.exports = {};
6787
6788 process.nextTick = (function () {
6789 var canSetImmediate = typeof window !== 'undefined'
6790 && window.setImmediate;
6791 var canMutationObserver = typeof window !== 'undefined'
6792 && window.MutationObserver;
6793 var canPost = typeof window !== 'undefined'
6794 && window.postMessage && window.addEventListener
6795 ;
6796
6797 if (canSetImmediate) {
6798 return function (f) { return window.setImmediate(f) };
6799 }
6800
6801 var queue = [];
6802
6803 if (canMutationObserver) {
6804 var hiddenDiv = document.createElement("div");
6805 var observer = new MutationObserver(function () {
6806 var queueList = queue.slice();
6807 queue.length = 0;
6808 queueList.forEach(function (fn) {
6809 fn();
6810 });
6811 });
6812
6813 observer.observe(hiddenDiv, { attributes: true });
6814
6815 return function nextTick(fn) {
6816 if (!queue.length) {
6817 hiddenDiv.setAttribute('yes', 'no');
6818 }
6819 queue.push(fn);
6820 };
6821 }
6822
6823 if (canPost) {
6824 window.addEventListener('message', function (ev) {
6825 var source = ev.source;
6826 if ((source === window || source === null) && ev.data === 'process-tick') {
6827 ev.stopPropagation();
6828 if (queue.length > 0) {
6829 var fn = queue.shift();
6830 fn();
6831 }
6832 }
6833 }, true);
6834
6835 return function nextTick(fn) {
6836 queue.push(fn);
6837 window.postMessage('process-tick', '*');
6838 };
6839 }
6840
6841 return function nextTick(fn) {
6842 setTimeout(fn, 0);
6843 };
6844 })();
6845
6846 process.title = 'browser';
6847 process.browser = true;
6848 process.env = {};
6849 process.argv = [];
6850
6851 function noop() {}
6852
6853 process.on = noop;
6854 process.addListener = noop;
6855 process.once = noop;
6856 process.off = noop;
6857 process.removeListener = noop;
6858 process.removeAllListeners = noop;
6859 process.emit = noop;
6860
6861 process.binding = function (name) {
6862 throw new Error('process.binding is not supported');
6863 };
6864
6865 // TODO(shtylman)
6866 process.cwd = function () { return '/' };
6867 process.chdir = function (dir) {
6868 throw new Error('process.chdir is not supported');
6869 };
6870
6871
6872/***/ },
6873/* 28 */
6874/***/ function(module, exports, __webpack_require__) {
6875
6876 /* WEBPACK VAR INJECTION */(function(process) {/**
6877 * Copyright 2013-2014, Facebook, Inc.
6878 * All rights reserved.
6879 *
6880 * This source code is licensed under the BSD-style license found in the
6881 * LICENSE file in the root directory of this source tree. An additional grant
6882 * of patent rights can be found in the PATENTS file in the same directory.
6883 *
6884 * @providesModule DOMProperty
6885 * @typechecks static-only
6886 */
6887
6888 /*jslint bitwise: true */
6889
6890 "use strict";
6891
6892 var invariant = __webpack_require__(33);
6893
6894 function checkMask(value, bitmask) {
6895 return (value & bitmask) === bitmask;
6896 }
6897
6898 var DOMPropertyInjection = {
6899 /**
6900 * Mapping from normalized, camelcased property names to a configuration that
6901 * specifies how the associated DOM property should be accessed or rendered.
6902 */
6903 MUST_USE_ATTRIBUTE: 0x1,
6904 MUST_USE_PROPERTY: 0x2,
6905 HAS_SIDE_EFFECTS: 0x4,
6906 HAS_BOOLEAN_VALUE: 0x8,
6907 HAS_NUMERIC_VALUE: 0x10,
6908 HAS_POSITIVE_NUMERIC_VALUE: 0x20 | 0x10,
6909 HAS_OVERLOADED_BOOLEAN_VALUE: 0x40,
6910
6911 /**
6912 * Inject some specialized knowledge about the DOM. This takes a config object
6913 * with the following properties:
6914 *
6915 * isCustomAttribute: function that given an attribute name will return true
6916 * if it can be inserted into the DOM verbatim. Useful for data-* or aria-*
6917 * attributes where it's impossible to enumerate all of the possible
6918 * attribute names,
6919 *
6920 * Properties: object mapping DOM property name to one of the
6921 * DOMPropertyInjection constants or null. If your attribute isn't in here,
6922 * it won't get written to the DOM.
6923 *
6924 * DOMAttributeNames: object mapping React attribute name to the DOM
6925 * attribute name. Attribute names not specified use the **lowercase**
6926 * normalized name.
6927 *
6928 * DOMPropertyNames: similar to DOMAttributeNames but for DOM properties.
6929 * Property names not specified use the normalized name.
6930 *
6931 * DOMMutationMethods: Properties that require special mutation methods. If
6932 * `value` is undefined, the mutation method should unset the property.
6933 *
6934 * @param {object} domPropertyConfig the config as described above.
6935 */
6936 injectDOMPropertyConfig: function(domPropertyConfig) {
6937 var Properties = domPropertyConfig.Properties || {};
6938 var DOMAttributeNames = domPropertyConfig.DOMAttributeNames || {};
6939 var DOMPropertyNames = domPropertyConfig.DOMPropertyNames || {};
6940 var DOMMutationMethods = domPropertyConfig.DOMMutationMethods || {};
6941
6942 if (domPropertyConfig.isCustomAttribute) {
6943 DOMProperty._isCustomAttributeFunctions.push(
6944 domPropertyConfig.isCustomAttribute
6945 );
6946 }
6947
6948 for (var propName in Properties) {
6949 ("production" !== process.env.NODE_ENV ? invariant(
6950 !DOMProperty.isStandardName.hasOwnProperty(propName),
6951 'injectDOMPropertyConfig(...): You\'re trying to inject DOM property ' +
6952 '\'%s\' which has already been injected. You may be accidentally ' +
6953 'injecting the same DOM property config twice, or you may be ' +
6954 'injecting two configs that have conflicting property names.',
6955 propName
6956 ) : invariant(!DOMProperty.isStandardName.hasOwnProperty(propName)));
6957
6958 DOMProperty.isStandardName[propName] = true;
6959
6960 var lowerCased = propName.toLowerCase();
6961 DOMProperty.getPossibleStandardName[lowerCased] = propName;
6962
6963 if (DOMAttributeNames.hasOwnProperty(propName)) {
6964 var attributeName = DOMAttributeNames[propName];
6965 DOMProperty.getPossibleStandardName[attributeName] = propName;
6966 DOMProperty.getAttributeName[propName] = attributeName;
6967 } else {
6968 DOMProperty.getAttributeName[propName] = lowerCased;
6969 }
6970
6971 DOMProperty.getPropertyName[propName] =
6972 DOMPropertyNames.hasOwnProperty(propName) ?
6973 DOMPropertyNames[propName] :
6974 propName;
6975
6976 if (DOMMutationMethods.hasOwnProperty(propName)) {
6977 DOMProperty.getMutationMethod[propName] = DOMMutationMethods[propName];
6978 } else {
6979 DOMProperty.getMutationMethod[propName] = null;
6980 }
6981
6982 var propConfig = Properties[propName];
6983 DOMProperty.mustUseAttribute[propName] =
6984 checkMask(propConfig, DOMPropertyInjection.MUST_USE_ATTRIBUTE);
6985 DOMProperty.mustUseProperty[propName] =
6986 checkMask(propConfig, DOMPropertyInjection.MUST_USE_PROPERTY);
6987 DOMProperty.hasSideEffects[propName] =
6988 checkMask(propConfig, DOMPropertyInjection.HAS_SIDE_EFFECTS);
6989 DOMProperty.hasBooleanValue[propName] =
6990 checkMask(propConfig, DOMPropertyInjection.HAS_BOOLEAN_VALUE);
6991 DOMProperty.hasNumericValue[propName] =
6992 checkMask(propConfig, DOMPropertyInjection.HAS_NUMERIC_VALUE);
6993 DOMProperty.hasPositiveNumericValue[propName] =
6994 checkMask(propConfig, DOMPropertyInjection.HAS_POSITIVE_NUMERIC_VALUE);
6995 DOMProperty.hasOverloadedBooleanValue[propName] =
6996 checkMask(propConfig, DOMPropertyInjection.HAS_OVERLOADED_BOOLEAN_VALUE);
6997
6998 ("production" !== process.env.NODE_ENV ? invariant(
6999 !DOMProperty.mustUseAttribute[propName] ||
7000 !DOMProperty.mustUseProperty[propName],
7001 'DOMProperty: Cannot require using both attribute and property: %s',
7002 propName
7003 ) : invariant(!DOMProperty.mustUseAttribute[propName] ||
7004 !DOMProperty.mustUseProperty[propName]));
7005 ("production" !== process.env.NODE_ENV ? invariant(
7006 DOMProperty.mustUseProperty[propName] ||
7007 !DOMProperty.hasSideEffects[propName],
7008 'DOMProperty: Properties that have side effects must use property: %s',
7009 propName
7010 ) : invariant(DOMProperty.mustUseProperty[propName] ||
7011 !DOMProperty.hasSideEffects[propName]));
7012 ("production" !== process.env.NODE_ENV ? invariant(
7013 !!DOMProperty.hasBooleanValue[propName] +
7014 !!DOMProperty.hasNumericValue[propName] +
7015 !!DOMProperty.hasOverloadedBooleanValue[propName] <= 1,
7016 'DOMProperty: Value can be one of boolean, overloaded boolean, or ' +
7017 'numeric value, but not a combination: %s',
7018 propName
7019 ) : invariant(!!DOMProperty.hasBooleanValue[propName] +
7020 !!DOMProperty.hasNumericValue[propName] +
7021 !!DOMProperty.hasOverloadedBooleanValue[propName] <= 1));
7022 }
7023 }
7024 };
7025 var defaultValueCache = {};
7026
7027 /**
7028 * DOMProperty exports lookup objects that can be used like functions:
7029 *
7030 * > DOMProperty.isValid['id']
7031 * true
7032 * > DOMProperty.isValid['foobar']
7033 * undefined
7034 *
7035 * Although this may be confusing, it performs better in general.
7036 *
7037 * @see http://jsperf.com/key-exists
7038 * @see http://jsperf.com/key-missing
7039 */
7040 var DOMProperty = {
7041
7042 ID_ATTRIBUTE_NAME: 'data-reactid',
7043
7044 /**
7045 * Checks whether a property name is a standard property.
7046 * @type {Object}
7047 */
7048 isStandardName: {},
7049
7050 /**
7051 * Mapping from lowercase property names to the properly cased version, used
7052 * to warn in the case of missing properties.
7053 * @type {Object}
7054 */
7055 getPossibleStandardName: {},
7056
7057 /**
7058 * Mapping from normalized names to attribute names that differ. Attribute
7059 * names are used when rendering markup or with `*Attribute()`.
7060 * @type {Object}
7061 */
7062 getAttributeName: {},
7063
7064 /**
7065 * Mapping from normalized names to properties on DOM node instances.
7066 * (This includes properties that mutate due to external factors.)
7067 * @type {Object}
7068 */
7069 getPropertyName: {},
7070
7071 /**
7072 * Mapping from normalized names to mutation methods. This will only exist if
7073 * mutation cannot be set simply by the property or `setAttribute()`.
7074 * @type {Object}
7075 */
7076 getMutationMethod: {},
7077
7078 /**
7079 * Whether the property must be accessed and mutated as an object property.
7080 * @type {Object}
7081 */
7082 mustUseAttribute: {},
7083
7084 /**
7085 * Whether the property must be accessed and mutated using `*Attribute()`.
7086 * (This includes anything that fails `<propName> in <element>`.)
7087 * @type {Object}
7088 */
7089 mustUseProperty: {},
7090
7091 /**
7092 * Whether or not setting a value causes side effects such as triggering
7093 * resources to be loaded or text selection changes. We must ensure that
7094 * the value is only set if it has changed.
7095 * @type {Object}
7096 */
7097 hasSideEffects: {},
7098
7099 /**
7100 * Whether the property should be removed when set to a falsey value.
7101 * @type {Object}
7102 */
7103 hasBooleanValue: {},
7104
7105 /**
7106 * Whether the property must be numeric or parse as a
7107 * numeric and should be removed when set to a falsey value.
7108 * @type {Object}
7109 */
7110 hasNumericValue: {},
7111
7112 /**
7113 * Whether the property must be positive numeric or parse as a positive
7114 * numeric and should be removed when set to a falsey value.
7115 * @type {Object}
7116 */
7117 hasPositiveNumericValue: {},
7118
7119 /**
7120 * Whether the property can be used as a flag as well as with a value. Removed
7121 * when strictly equal to false; present without a value when strictly equal
7122 * to true; present with a value otherwise.
7123 * @type {Object}
7124 */
7125 hasOverloadedBooleanValue: {},
7126
7127 /**
7128 * All of the isCustomAttribute() functions that have been injected.
7129 */
7130 _isCustomAttributeFunctions: [],
7131
7132 /**
7133 * Checks whether a property name is a custom attribute.
7134 * @method
7135 */
7136 isCustomAttribute: function(attributeName) {
7137 for (var i = 0; i < DOMProperty._isCustomAttributeFunctions.length; i++) {
7138 var isCustomAttributeFn = DOMProperty._isCustomAttributeFunctions[i];
7139 if (isCustomAttributeFn(attributeName)) {
7140 return true;
7141 }
7142 }
7143 return false;
7144 },
7145
7146 /**
7147 * Returns the default property value for a DOM property (i.e., not an
7148 * attribute). Most default values are '' or false, but not all. Worse yet,
7149 * some (in particular, `type`) vary depending on the type of element.
7150 *
7151 * TODO: Is it better to grab all the possible properties when creating an
7152 * element to avoid having to create the same element twice?
7153 */
7154 getDefaultValueForProperty: function(nodeName, prop) {
7155 var nodeDefaults = defaultValueCache[nodeName];
7156 var testElement;
7157 if (!nodeDefaults) {
7158 defaultValueCache[nodeName] = nodeDefaults = {};
7159 }
7160 if (!(prop in nodeDefaults)) {
7161 testElement = document.createElement(nodeName);
7162 nodeDefaults[prop] = testElement[prop];
7163 }
7164 return nodeDefaults[prop];
7165 },
7166
7167 injection: DOMPropertyInjection
7168 };
7169
7170 module.exports = DOMProperty;
7171
7172 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(27)))
7173
7174/***/ },
7175/* 29 */
7176/***/ function(module, exports, __webpack_require__) {
7177
7178 /**
7179 * Copyright 2013-2014, Facebook, Inc.
7180 * All rights reserved.
7181 *
7182 * This source code is licensed under the BSD-style license found in the
7183 * LICENSE file in the root directory of this source tree. An additional grant
7184 * of patent rights can be found in the PATENTS file in the same directory.
7185 *
7186 * @providesModule escapeTextForBrowser
7187 * @typechecks static-only
7188 */
7189
7190 "use strict";
7191
7192 var ESCAPE_LOOKUP = {
7193 "&": "&amp;",
7194 ">": "&gt;",
7195 "<": "&lt;",
7196 "\"": "&quot;",
7197 "'": "&#x27;"
7198 };
7199
7200 var ESCAPE_REGEX = /[&><"']/g;
7201
7202 function escaper(match) {
7203 return ESCAPE_LOOKUP[match];
7204 }
7205
7206 /**
7207 * Escapes text to prevent scripting attacks.
7208 *
7209 * @param {*} text Text value to escape.
7210 * @return {string} An escaped string.
7211 */
7212 function escapeTextForBrowser(text) {
7213 return ('' + text).replace(ESCAPE_REGEX, escaper);
7214 }
7215
7216 module.exports = escapeTextForBrowser;
7217
7218
7219/***/ },
7220/* 30 */
7221/***/ function(module, exports, __webpack_require__) {
7222
7223 /**
7224 * Copyright 2013-2014, Facebook, Inc.
7225 * All rights reserved.
7226 *
7227 * This source code is licensed under the BSD-style license found in the
7228 * LICENSE file in the root directory of this source tree. An additional grant
7229 * of patent rights can be found in the PATENTS file in the same directory.
7230 *
7231 * @providesModule memoizeStringOnly
7232 * @typechecks static-only
7233 */
7234
7235 "use strict";
7236
7237 /**
7238 * Memoizes the return value of a function that accepts one string argument.
7239 *
7240 * @param {function} callback
7241 * @return {function}
7242 */
7243 function memoizeStringOnly(callback) {
7244 var cache = {};
7245 return function(string) {
7246 if (cache.hasOwnProperty(string)) {
7247 return cache[string];
7248 } else {
7249 return cache[string] = callback.call(this, string);
7250 }
7251 };
7252 }
7253
7254 module.exports = memoizeStringOnly;
7255
7256
7257/***/ },
7258/* 31 */
7259/***/ function(module, exports, __webpack_require__) {
7260
7261 /* WEBPACK VAR INJECTION */(function(process) {/**
7262 * Copyright 2014, Facebook, Inc.
7263 * All rights reserved.
7264 *
7265 * This source code is licensed under the BSD-style license found in the
7266 * LICENSE file in the root directory of this source tree. An additional grant
7267 * of patent rights can be found in the PATENTS file in the same directory.
7268 *
7269 * @providesModule warning
7270 */
7271
7272 "use strict";
7273
7274 var emptyFunction = __webpack_require__(83);
7275
7276 /**
7277 * Similar to invariant but only logs a warning if the condition is not met.
7278 * This can be used to log issues in development environments in critical
7279 * paths. Removing the logging code for production environments will keep the
7280 * same logic and follow the same code paths.
7281 */
7282
7283 var warning = emptyFunction;
7284
7285 if ("production" !== process.env.NODE_ENV) {
7286 warning = function(condition, format ) {for (var args=[],$__0=2,$__1=arguments.length;$__0<$__1;$__0++) args.push(arguments[$__0]);
7287 if (format === undefined) {
7288 throw new Error(
7289 '`warning(condition, format, ...args)` requires a warning ' +
7290 'message argument'
7291 );
7292 }
7293
7294 if (!condition) {
7295 var argIndex = 0;
7296 console.warn('Warning: ' + format.replace(/%s/g, function() {return args[argIndex++];}));
7297 }
7298 };
7299 }
7300
7301 module.exports = warning;
7302
7303 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(27)))
7304
7305/***/ },
7306/* 32 */
7307/***/ function(module, exports, __webpack_require__) {
7308
7309 /**
7310 * Copyright 2013-2014, Facebook, Inc.
7311 * All rights reserved.
7312 *
7313 * This source code is licensed under the BSD-style license found in the
7314 * LICENSE file in the root directory of this source tree. An additional grant
7315 * of patent rights can be found in the PATENTS file in the same directory.
7316 *
7317 * @providesModule EventConstants
7318 */
7319
7320 "use strict";
7321
7322 var keyMirror = __webpack_require__(44);
7323
7324 var PropagationPhases = keyMirror({bubbled: null, captured: null});
7325
7326 /**
7327 * Types of raw signals from the browser caught at the top level.
7328 */
7329 var topLevelTypes = keyMirror({
7330 topBlur: null,
7331 topChange: null,
7332 topClick: null,
7333 topCompositionEnd: null,
7334 topCompositionStart: null,
7335 topCompositionUpdate: null,
7336 topContextMenu: null,
7337 topCopy: null,
7338 topCut: null,
7339 topDoubleClick: null,
7340 topDrag: null,
7341 topDragEnd: null,
7342 topDragEnter: null,
7343 topDragExit: null,
7344 topDragLeave: null,
7345 topDragOver: null,
7346 topDragStart: null,
7347 topDrop: null,
7348 topError: null,
7349 topFocus: null,
7350 topInput: null,
7351 topKeyDown: null,
7352 topKeyPress: null,
7353 topKeyUp: null,
7354 topLoad: null,
7355 topMouseDown: null,
7356 topMouseMove: null,
7357 topMouseOut: null,
7358 topMouseOver: null,
7359 topMouseUp: null,
7360 topPaste: null,
7361 topReset: null,
7362 topScroll: null,
7363 topSelectionChange: null,
7364 topSubmit: null,
7365 topTextInput: null,
7366 topTouchCancel: null,
7367 topTouchEnd: null,
7368 topTouchMove: null,
7369 topTouchStart: null,
7370 topWheel: null
7371 });
7372
7373 var EventConstants = {
7374 topLevelTypes: topLevelTypes,
7375 PropagationPhases: PropagationPhases
7376 };
7377
7378 module.exports = EventConstants;
7379
7380
7381/***/ },
7382/* 33 */
7383/***/ function(module, exports, __webpack_require__) {
7384
7385 /* WEBPACK VAR INJECTION */(function(process) {/**
7386 * Copyright 2013-2014, Facebook, Inc.
7387 * All rights reserved.
7388 *
7389 * This source code is licensed under the BSD-style license found in the
7390 * LICENSE file in the root directory of this source tree. An additional grant
7391 * of patent rights can be found in the PATENTS file in the same directory.
7392 *
7393 * @providesModule invariant
7394 */
7395
7396 "use strict";
7397
7398 /**
7399 * Use invariant() to assert state which your program assumes to be true.
7400 *
7401 * Provide sprintf-style format (only %s is supported) and arguments
7402 * to provide information about what broke and what you were
7403 * expecting.
7404 *
7405 * The invariant message will be stripped in production, but the invariant
7406 * will remain to ensure logic does not differ in production.
7407 */
7408
7409 var invariant = function(condition, format, a, b, c, d, e, f) {
7410 if ("production" !== process.env.NODE_ENV) {
7411 if (format === undefined) {
7412 throw new Error('invariant requires an error message argument');
7413 }
7414 }
7415
7416 if (!condition) {
7417 var error;
7418 if (format === undefined) {
7419 error = new Error(
7420 'Minified exception occurred; use the non-minified dev environment ' +
7421 'for the full error message and additional helpful warnings.'
7422 );
7423 } else {
7424 var args = [a, b, c, d, e, f];
7425 var argIndex = 0;
7426 error = new Error(
7427 'Invariant Violation: ' +
7428 format.replace(/%s/g, function() { return args[argIndex++]; })
7429 );
7430 }
7431
7432 error.framesToPop = 1; // we don't care about invariant's own frame
7433 throw error;
7434 }
7435 };
7436
7437 module.exports = invariant;
7438
7439 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(27)))
7440
7441/***/ },
7442/* 34 */
7443/***/ function(module, exports, __webpack_require__) {
7444
7445 /* WEBPACK VAR INJECTION */(function(process) {/**
7446 * Copyright 2013-2014, Facebook, Inc.
7447 * All rights reserved.
7448 *
7449 * This source code is licensed under the BSD-style license found in the
7450 * LICENSE file in the root directory of this source tree. An additional grant
7451 * of patent rights can be found in the PATENTS file in the same directory.
7452 *
7453 * @providesModule PooledClass
7454 */
7455
7456 "use strict";
7457
7458 var invariant = __webpack_require__(33);
7459
7460 /**
7461 * Static poolers. Several custom versions for each potential number of
7462 * arguments. A completely generic pooler is easy to implement, but would
7463 * require accessing the `arguments` object. In each of these, `this` refers to
7464 * the Class itself, not an instance. If any others are needed, simply add them
7465 * here, or in their own files.
7466 */
7467 var oneArgumentPooler = function(copyFieldsFrom) {
7468 var Klass = this;
7469 if (Klass.instancePool.length) {
7470 var instance = Klass.instancePool.pop();
7471 Klass.call(instance, copyFieldsFrom);
7472 return instance;
7473 } else {
7474 return new Klass(copyFieldsFrom);
7475 }
7476 };
7477
7478 var twoArgumentPooler = function(a1, a2) {
7479 var Klass = this;
7480 if (Klass.instancePool.length) {
7481 var instance = Klass.instancePool.pop();
7482 Klass.call(instance, a1, a2);
7483 return instance;
7484 } else {
7485 return new Klass(a1, a2);
7486 }
7487 };
7488
7489 var threeArgumentPooler = function(a1, a2, a3) {
7490 var Klass = this;
7491 if (Klass.instancePool.length) {
7492 var instance = Klass.instancePool.pop();
7493 Klass.call(instance, a1, a2, a3);
7494 return instance;
7495 } else {
7496 return new Klass(a1, a2, a3);
7497 }
7498 };
7499
7500 var fiveArgumentPooler = function(a1, a2, a3, a4, a5) {
7501 var Klass = this;
7502 if (Klass.instancePool.length) {
7503 var instance = Klass.instancePool.pop();
7504 Klass.call(instance, a1, a2, a3, a4, a5);
7505 return instance;
7506 } else {
7507 return new Klass(a1, a2, a3, a4, a5);
7508 }
7509 };
7510
7511 var standardReleaser = function(instance) {
7512 var Klass = this;
7513 ("production" !== process.env.NODE_ENV ? invariant(
7514 instance instanceof Klass,
7515 'Trying to release an instance into a pool of a different type.'
7516 ) : invariant(instance instanceof Klass));
7517 if (instance.destructor) {
7518 instance.destructor();
7519 }
7520 if (Klass.instancePool.length < Klass.poolSize) {
7521 Klass.instancePool.push(instance);
7522 }
7523 };
7524
7525 var DEFAULT_POOL_SIZE = 10;
7526 var DEFAULT_POOLER = oneArgumentPooler;
7527
7528 /**
7529 * Augments `CopyConstructor` to be a poolable class, augmenting only the class
7530 * itself (statically) not adding any prototypical fields. Any CopyConstructor
7531 * you give this may have a `poolSize` property, and will look for a
7532 * prototypical `destructor` on instances (optional).
7533 *
7534 * @param {Function} CopyConstructor Constructor that can be used to reset.
7535 * @param {Function} pooler Customizable pooler.
7536 */
7537 var addPoolingTo = function(CopyConstructor, pooler) {
7538 var NewKlass = CopyConstructor;
7539 NewKlass.instancePool = [];
7540 NewKlass.getPooled = pooler || DEFAULT_POOLER;
7541 if (!NewKlass.poolSize) {
7542 NewKlass.poolSize = DEFAULT_POOL_SIZE;
7543 }
7544 NewKlass.release = standardReleaser;
7545 return NewKlass;
7546 };
7547
7548 var PooledClass = {
7549 addPoolingTo: addPoolingTo,
7550 oneArgumentPooler: oneArgumentPooler,
7551 twoArgumentPooler: twoArgumentPooler,
7552 threeArgumentPooler: threeArgumentPooler,
7553 fiveArgumentPooler: fiveArgumentPooler
7554 };
7555
7556 module.exports = PooledClass;
7557
7558 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(27)))
7559
7560/***/ },
7561/* 35 */
7562/***/ function(module, exports, __webpack_require__) {
7563
7564 /* WEBPACK VAR INJECTION */(function(process) {/**
7565 * Copyright 2013-2014, Facebook, Inc.
7566 * All rights reserved.
7567 *
7568 * This source code is licensed under the BSD-style license found in the
7569 * LICENSE file in the root directory of this source tree. An additional grant
7570 * of patent rights can be found in the PATENTS file in the same directory.
7571 *
7572 * @providesModule traverseAllChildren
7573 */
7574
7575 "use strict";
7576
7577 var ReactElement = __webpack_require__(10);
7578 var ReactInstanceHandles = __webpack_require__(15);
7579
7580 var invariant = __webpack_require__(33);
7581
7582 var SEPARATOR = ReactInstanceHandles.SEPARATOR;
7583 var SUBSEPARATOR = ':';
7584
7585 /**
7586 * TODO: Test that:
7587 * 1. `mapChildren` transforms strings and numbers into `ReactTextComponent`.
7588 * 2. it('should fail when supplied duplicate key', function() {
7589 * 3. That a single child and an array with one item have the same key pattern.
7590 * });
7591 */
7592
7593 var userProvidedKeyEscaperLookup = {
7594 '=': '=0',
7595 '.': '=1',
7596 ':': '=2'
7597 };
7598
7599 var userProvidedKeyEscapeRegex = /[=.:]/g;
7600
7601 function userProvidedKeyEscaper(match) {
7602 return userProvidedKeyEscaperLookup[match];
7603 }
7604
7605 /**
7606 * Generate a key string that identifies a component within a set.
7607 *
7608 * @param {*} component A component that could contain a manual key.
7609 * @param {number} index Index that is used if a manual key is not provided.
7610 * @return {string}
7611 */
7612 function getComponentKey(component, index) {
7613 if (component && component.key != null) {
7614 // Explicit key
7615 return wrapUserProvidedKey(component.key);
7616 }
7617 // Implicit key determined by the index in the set
7618 return index.toString(36);
7619 }
7620
7621 /**
7622 * Escape a component key so that it is safe to use in a reactid.
7623 *
7624 * @param {*} key Component key to be escaped.
7625 * @return {string} An escaped string.
7626 */
7627 function escapeUserProvidedKey(text) {
7628 return ('' + text).replace(
7629 userProvidedKeyEscapeRegex,
7630 userProvidedKeyEscaper
7631 );
7632 }
7633
7634 /**
7635 * Wrap a `key` value explicitly provided by the user to distinguish it from
7636 * implicitly-generated keys generated by a component's index in its parent.
7637 *
7638 * @param {string} key Value of a user-provided `key` attribute
7639 * @return {string}
7640 */
7641 function wrapUserProvidedKey(key) {
7642 return '$' + escapeUserProvidedKey(key);
7643 }
7644
7645 /**
7646 * @param {?*} children Children tree container.
7647 * @param {!string} nameSoFar Name of the key path so far.
7648 * @param {!number} indexSoFar Number of children encountered until this point.
7649 * @param {!function} callback Callback to invoke with each child found.
7650 * @param {?*} traverseContext Used to pass information throughout the traversal
7651 * process.
7652 * @return {!number} The number of children in this subtree.
7653 */
7654 var traverseAllChildrenImpl =
7655 function(children, nameSoFar, indexSoFar, callback, traverseContext) {
7656 var nextName, nextIndex;
7657 var subtreeCount = 0; // Count of children found in the current subtree.
7658 if (Array.isArray(children)) {
7659 for (var i = 0; i < children.length; i++) {
7660 var child = children[i];
7661 nextName = (
7662 nameSoFar +
7663 (nameSoFar ? SUBSEPARATOR : SEPARATOR) +
7664 getComponentKey(child, i)
7665 );
7666 nextIndex = indexSoFar + subtreeCount;
7667 subtreeCount += traverseAllChildrenImpl(
7668 child,
7669 nextName,
7670 nextIndex,
7671 callback,
7672 traverseContext
7673 );
7674 }
7675 } else {
7676 var type = typeof children;
7677 var isOnlyChild = nameSoFar === '';
7678 // If it's the only child, treat the name as if it was wrapped in an array
7679 // so that it's consistent if the number of children grows
7680 var storageName =
7681 isOnlyChild ? SEPARATOR + getComponentKey(children, 0) : nameSoFar;
7682 if (children == null || type === 'boolean') {
7683 // All of the above are perceived as null.
7684 callback(traverseContext, null, storageName, indexSoFar);
7685 subtreeCount = 1;
7686 } else if (type === 'string' || type === 'number' ||
7687 ReactElement.isValidElement(children)) {
7688 callback(traverseContext, children, storageName, indexSoFar);
7689 subtreeCount = 1;
7690 } else if (type === 'object') {
7691 ("production" !== process.env.NODE_ENV ? invariant(
7692 !children || children.nodeType !== 1,
7693 'traverseAllChildren(...): Encountered an invalid child; DOM ' +
7694 'elements are not valid children of React components.'
7695 ) : invariant(!children || children.nodeType !== 1));
7696 for (var key in children) {
7697 if (children.hasOwnProperty(key)) {
7698 nextName = (
7699 nameSoFar + (nameSoFar ? SUBSEPARATOR : SEPARATOR) +
7700 wrapUserProvidedKey(key) + SUBSEPARATOR +
7701 getComponentKey(children[key], 0)
7702 );
7703 nextIndex = indexSoFar + subtreeCount;
7704 subtreeCount += traverseAllChildrenImpl(
7705 children[key],
7706 nextName,
7707 nextIndex,
7708 callback,
7709 traverseContext
7710 );
7711 }
7712 }
7713 }
7714 }
7715 return subtreeCount;
7716 };
7717
7718 /**
7719 * Traverses children that are typically specified as `props.children`, but
7720 * might also be specified through attributes:
7721 *
7722 * - `traverseAllChildren(this.props.children, ...)`
7723 * - `traverseAllChildren(this.props.leftPanelChildren, ...)`
7724 *
7725 * The `traverseContext` is an optional argument that is passed through the
7726 * entire traversal. It can be used to store accumulations or anything else that
7727 * the callback might find relevant.
7728 *
7729 * @param {?*} children Children tree object.
7730 * @param {!function} callback To invoke upon traversing each child.
7731 * @param {?*} traverseContext Context for traversal.
7732 * @return {!number} The number of children in this subtree.
7733 */
7734 function traverseAllChildren(children, callback, traverseContext) {
7735 if (children == null) {
7736 return 0;
7737 }
7738
7739 return traverseAllChildrenImpl(children, '', 0, callback, traverseContext);
7740 }
7741
7742 module.exports = traverseAllChildren;
7743
7744 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(27)))
7745
7746/***/ },
7747/* 36 */
7748/***/ function(module, exports, __webpack_require__) {
7749
7750 /* WEBPACK VAR INJECTION */(function(process) {/**
7751 * Copyright 2014, Facebook, Inc.
7752 * All rights reserved.
7753 *
7754 * This source code is licensed under the BSD-style license found in the
7755 * LICENSE file in the root directory of this source tree. An additional grant
7756 * of patent rights can be found in the PATENTS file in the same directory.
7757 *
7758 * @providesModule ReactEmptyComponent
7759 */
7760
7761 "use strict";
7762
7763 var ReactElement = __webpack_require__(10);
7764
7765 var invariant = __webpack_require__(33);
7766
7767 var component;
7768 // This registry keeps track of the React IDs of the components that rendered to
7769 // `null` (in reality a placeholder such as `noscript`)
7770 var nullComponentIdsRegistry = {};
7771
7772 var ReactEmptyComponentInjection = {
7773 injectEmptyComponent: function(emptyComponent) {
7774 component = ReactElement.createFactory(emptyComponent);
7775 }
7776 };
7777
7778 /**
7779 * @return {ReactComponent} component The injected empty component.
7780 */
7781 function getEmptyComponent() {
7782 ("production" !== process.env.NODE_ENV ? invariant(
7783 component,
7784 'Trying to return null from a render, but no null placeholder component ' +
7785 'was injected.'
7786 ) : invariant(component));
7787 return component();
7788 }
7789
7790 /**
7791 * Mark the component as having rendered to null.
7792 * @param {string} id Component's `_rootNodeID`.
7793 */
7794 function registerNullComponentID(id) {
7795 nullComponentIdsRegistry[id] = true;
7796 }
7797
7798 /**
7799 * Unmark the component as having rendered to null: it renders to something now.
7800 * @param {string} id Component's `_rootNodeID`.
7801 */
7802 function deregisterNullComponentID(id) {
7803 delete nullComponentIdsRegistry[id];
7804 }
7805
7806 /**
7807 * @param {string} id Component's `_rootNodeID`.
7808 * @return {boolean} True if the component is rendered to null.
7809 */
7810 function isNullComponentID(id) {
7811 return nullComponentIdsRegistry[id];
7812 }
7813
7814 var ReactEmptyComponent = {
7815 deregisterNullComponentID: deregisterNullComponentID,
7816 getEmptyComponent: getEmptyComponent,
7817 injection: ReactEmptyComponentInjection,
7818 isNullComponentID: isNullComponentID,
7819 registerNullComponentID: registerNullComponentID
7820 };
7821
7822 module.exports = ReactEmptyComponent;
7823
7824 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(27)))
7825
7826/***/ },
7827/* 37 */
7828/***/ function(module, exports, __webpack_require__) {
7829
7830 /**
7831 * Copyright 2013-2014, Facebook, Inc.
7832 * All rights reserved.
7833 *
7834 * This source code is licensed under the BSD-style license found in the
7835 * LICENSE file in the root directory of this source tree. An additional grant
7836 * of patent rights can be found in the PATENTS file in the same directory.
7837 *
7838 * @providesModule ReactErrorUtils
7839 * @typechecks
7840 */
7841
7842 "use strict";
7843
7844 var ReactErrorUtils = {
7845 /**
7846 * Creates a guarded version of a function. This is supposed to make debugging
7847 * of event handlers easier. To aid debugging with the browser's debugger,
7848 * this currently simply returns the original function.
7849 *
7850 * @param {function} func Function to be executed
7851 * @param {string} name The name of the guard
7852 * @return {function}
7853 */
7854 guard: function(func, name) {
7855 return func;
7856 }
7857 };
7858
7859 module.exports = ReactErrorUtils;
7860
7861
7862/***/ },
7863/* 38 */
7864/***/ function(module, exports, __webpack_require__) {
7865
7866 /* WEBPACK VAR INJECTION */(function(process) {/**
7867 * Copyright 2013-2014, Facebook, Inc.
7868 * All rights reserved.
7869 *
7870 * This source code is licensed under the BSD-style license found in the
7871 * LICENSE file in the root directory of this source tree. An additional grant
7872 * of patent rights can be found in the PATENTS file in the same directory.
7873 *
7874 * @providesModule ReactOwner
7875 */
7876
7877 "use strict";
7878
7879 var emptyObject = __webpack_require__(86);
7880 var invariant = __webpack_require__(33);
7881
7882 /**
7883 * ReactOwners are capable of storing references to owned components.
7884 *
7885 * All components are capable of //being// referenced by owner components, but
7886 * only ReactOwner components are capable of //referencing// owned components.
7887 * The named reference is known as a "ref".
7888 *
7889 * Refs are available when mounted and updated during reconciliation.
7890 *
7891 * var MyComponent = React.createClass({
7892 * render: function() {
7893 * return (
7894 * <div onClick={this.handleClick}>
7895 * <CustomComponent ref="custom" />
7896 * </div>
7897 * );
7898 * },
7899 * handleClick: function() {
7900 * this.refs.custom.handleClick();
7901 * },
7902 * componentDidMount: function() {
7903 * this.refs.custom.initialize();
7904 * }
7905 * });
7906 *
7907 * Refs should rarely be used. When refs are used, they should only be done to
7908 * control data that is not handled by React's data flow.
7909 *
7910 * @class ReactOwner
7911 */
7912 var ReactOwner = {
7913
7914 /**
7915 * @param {?object} object
7916 * @return {boolean} True if `object` is a valid owner.
7917 * @final
7918 */
7919 isValidOwner: function(object) {
7920 return !!(
7921 object &&
7922 typeof object.attachRef === 'function' &&
7923 typeof object.detachRef === 'function'
7924 );
7925 },
7926
7927 /**
7928 * Adds a component by ref to an owner component.
7929 *
7930 * @param {ReactComponent} component Component to reference.
7931 * @param {string} ref Name by which to refer to the component.
7932 * @param {ReactOwner} owner Component on which to record the ref.
7933 * @final
7934 * @internal
7935 */
7936 addComponentAsRefTo: function(component, ref, owner) {
7937 ("production" !== process.env.NODE_ENV ? invariant(
7938 ReactOwner.isValidOwner(owner),
7939 'addComponentAsRefTo(...): Only a ReactOwner can have refs. This ' +
7940 'usually means that you\'re trying to add a ref to a component that ' +
7941 'doesn\'t have an owner (that is, was not created inside of another ' +
7942 'component\'s `render` method). Try rendering this component inside of ' +
7943 'a new top-level component which will hold the ref.'
7944 ) : invariant(ReactOwner.isValidOwner(owner)));
7945 owner.attachRef(ref, component);
7946 },
7947
7948 /**
7949 * Removes a component by ref from an owner component.
7950 *
7951 * @param {ReactComponent} component Component to dereference.
7952 * @param {string} ref Name of the ref to remove.
7953 * @param {ReactOwner} owner Component on which the ref is recorded.
7954 * @final
7955 * @internal
7956 */
7957 removeComponentAsRefFrom: function(component, ref, owner) {
7958 ("production" !== process.env.NODE_ENV ? invariant(
7959 ReactOwner.isValidOwner(owner),
7960 'removeComponentAsRefFrom(...): Only a ReactOwner can have refs. This ' +
7961 'usually means that you\'re trying to remove a ref to a component that ' +
7962 'doesn\'t have an owner (that is, was not created inside of another ' +
7963 'component\'s `render` method). Try rendering this component inside of ' +
7964 'a new top-level component which will hold the ref.'
7965 ) : invariant(ReactOwner.isValidOwner(owner)));
7966 // Check that `component` is still the current ref because we do not want to
7967 // detach the ref if another component stole it.
7968 if (owner.refs[ref] === component) {
7969 owner.detachRef(ref);
7970 }
7971 },
7972
7973 /**
7974 * A ReactComponent must mix this in to have refs.
7975 *
7976 * @lends {ReactOwner.prototype}
7977 */
7978 Mixin: {
7979
7980 construct: function() {
7981 this.refs = emptyObject;
7982 },
7983
7984 /**
7985 * Lazily allocates the refs object and stores `component` as `ref`.
7986 *
7987 * @param {string} ref Reference name.
7988 * @param {component} component Component to store as `ref`.
7989 * @final
7990 * @private
7991 */
7992 attachRef: function(ref, component) {
7993 ("production" !== process.env.NODE_ENV ? invariant(
7994 component.isOwnedBy(this),
7995 'attachRef(%s, ...): Only a component\'s owner can store a ref to it.',
7996 ref
7997 ) : invariant(component.isOwnedBy(this)));
7998 var refs = this.refs === emptyObject ? (this.refs = {}) : this.refs;
7999 refs[ref] = component;
8000 },
8001
8002 /**
8003 * Detaches a reference name.
8004 *
8005 * @param {string} ref Name to dereference.
8006 * @final
8007 * @private
8008 */
8009 detachRef: function(ref) {
8010 delete this.refs[ref];
8011 }
8012
8013 }
8014
8015 };
8016
8017 module.exports = ReactOwner;
8018
8019 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(27)))
8020
8021/***/ },
8022/* 39 */
8023/***/ function(module, exports, __webpack_require__) {
8024
8025 /* WEBPACK VAR INJECTION */(function(process) {/**
8026 * Copyright 2013-2014, Facebook, Inc.
8027 * All rights reserved.
8028 *
8029 * This source code is licensed under the BSD-style license found in the
8030 * LICENSE file in the root directory of this source tree. An additional grant
8031 * of patent rights can be found in the PATENTS file in the same directory.
8032 *
8033 * @providesModule ReactPropTransferer
8034 */
8035
8036 "use strict";
8037
8038 var assign = __webpack_require__(23);
8039 var emptyFunction = __webpack_require__(83);
8040 var invariant = __webpack_require__(33);
8041 var joinClasses = __webpack_require__(87);
8042 var warning = __webpack_require__(31);
8043
8044 var didWarn = false;
8045
8046 /**
8047 * Creates a transfer strategy that will merge prop values using the supplied
8048 * `mergeStrategy`. If a prop was previously unset, this just sets it.
8049 *
8050 * @param {function} mergeStrategy
8051 * @return {function}
8052 */
8053 function createTransferStrategy(mergeStrategy) {
8054 return function(props, key, value) {
8055 if (!props.hasOwnProperty(key)) {
8056 props[key] = value;
8057 } else {
8058 props[key] = mergeStrategy(props[key], value);
8059 }
8060 };
8061 }
8062
8063 var transferStrategyMerge = createTransferStrategy(function(a, b) {
8064 // `merge` overrides the first object's (`props[key]` above) keys using the
8065 // second object's (`value`) keys. An object's style's existing `propA` would
8066 // get overridden. Flip the order here.
8067 return assign({}, b, a);
8068 });
8069
8070 /**
8071 * Transfer strategies dictate how props are transferred by `transferPropsTo`.
8072 * NOTE: if you add any more exceptions to this list you should be sure to
8073 * update `cloneWithProps()` accordingly.
8074 */
8075 var TransferStrategies = {
8076 /**
8077 * Never transfer `children`.
8078 */
8079 children: emptyFunction,
8080 /**
8081 * Transfer the `className` prop by merging them.
8082 */
8083 className: createTransferStrategy(joinClasses),
8084 /**
8085 * Transfer the `style` prop (which is an object) by merging them.
8086 */
8087 style: transferStrategyMerge
8088 };
8089
8090 /**
8091 * Mutates the first argument by transferring the properties from the second
8092 * argument.
8093 *
8094 * @param {object} props
8095 * @param {object} newProps
8096 * @return {object}
8097 */
8098 function transferInto(props, newProps) {
8099 for (var thisKey in newProps) {
8100 if (!newProps.hasOwnProperty(thisKey)) {
8101 continue;
8102 }
8103
8104 var transferStrategy = TransferStrategies[thisKey];
8105
8106 if (transferStrategy && TransferStrategies.hasOwnProperty(thisKey)) {
8107 transferStrategy(props, thisKey, newProps[thisKey]);
8108 } else if (!props.hasOwnProperty(thisKey)) {
8109 props[thisKey] = newProps[thisKey];
8110 }
8111 }
8112 return props;
8113 }
8114
8115 /**
8116 * ReactPropTransferer are capable of transferring props to another component
8117 * using a `transferPropsTo` method.
8118 *
8119 * @class ReactPropTransferer
8120 */
8121 var ReactPropTransferer = {
8122
8123 TransferStrategies: TransferStrategies,
8124
8125 /**
8126 * Merge two props objects using TransferStrategies.
8127 *
8128 * @param {object} oldProps original props (they take precedence)
8129 * @param {object} newProps new props to merge in
8130 * @return {object} a new object containing both sets of props merged.
8131 */
8132 mergeProps: function(oldProps, newProps) {
8133 return transferInto(assign({}, oldProps), newProps);
8134 },
8135
8136 /**
8137 * @lends {ReactPropTransferer.prototype}
8138 */
8139 Mixin: {
8140
8141 /**
8142 * Transfer props from this component to a target component.
8143 *
8144 * Props that do not have an explicit transfer strategy will be transferred
8145 * only if the target component does not already have the prop set.
8146 *
8147 * This is usually used to pass down props to a returned root component.
8148 *
8149 * @param {ReactElement} element Component receiving the properties.
8150 * @return {ReactElement} The supplied `component`.
8151 * @final
8152 * @protected
8153 */
8154 transferPropsTo: function(element) {
8155 ("production" !== process.env.NODE_ENV ? invariant(
8156 element._owner === this,
8157 '%s: You can\'t call transferPropsTo() on a component that you ' +
8158 'don\'t own, %s. This usually means you are calling ' +
8159 'transferPropsTo() on a component passed in as props or children.',
8160 this.constructor.displayName,
8161 typeof element.type === 'string' ?
8162 element.type :
8163 element.type.displayName
8164 ) : invariant(element._owner === this));
8165
8166 if ("production" !== process.env.NODE_ENV) {
8167 if (!didWarn) {
8168 didWarn = true;
8169 ("production" !== process.env.NODE_ENV ? warning(
8170 false,
8171 'transferPropsTo is deprecated. ' +
8172 'See http://fb.me/react-transferpropsto for more information.'
8173 ) : null);
8174 }
8175 }
8176
8177 // Because elements are immutable we have to merge into the existing
8178 // props object rather than clone it.
8179 transferInto(element.props, this.props);
8180
8181 return element;
8182 }
8183
8184 }
8185 };
8186
8187 module.exports = ReactPropTransferer;
8188
8189 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(27)))
8190
8191/***/ },
8192/* 40 */
8193/***/ function(module, exports, __webpack_require__) {
8194
8195 /**
8196 * Copyright 2013-2014, Facebook, Inc.
8197 * All rights reserved.
8198 *
8199 * This source code is licensed under the BSD-style license found in the
8200 * LICENSE file in the root directory of this source tree. An additional grant
8201 * of patent rights can be found in the PATENTS file in the same directory.
8202 *
8203 * @providesModule ReactPropTypeLocations
8204 */
8205
8206 "use strict";
8207
8208 var keyMirror = __webpack_require__(44);
8209
8210 var ReactPropTypeLocations = keyMirror({
8211 prop: null,
8212 context: null,
8213 childContext: null
8214 });
8215
8216 module.exports = ReactPropTypeLocations;
8217
8218
8219/***/ },
8220/* 41 */
8221/***/ function(module, exports, __webpack_require__) {
8222
8223 /* WEBPACK VAR INJECTION */(function(process) {/**
8224 * Copyright 2013-2014, Facebook, Inc.
8225 * All rights reserved.
8226 *
8227 * This source code is licensed under the BSD-style license found in the
8228 * LICENSE file in the root directory of this source tree. An additional grant
8229 * of patent rights can be found in the PATENTS file in the same directory.
8230 *
8231 * @providesModule ReactPropTypeLocationNames
8232 */
8233
8234 "use strict";
8235
8236 var ReactPropTypeLocationNames = {};
8237
8238 if ("production" !== process.env.NODE_ENV) {
8239 ReactPropTypeLocationNames = {
8240 prop: 'prop',
8241 context: 'context',
8242 childContext: 'child context'
8243 };
8244 }
8245
8246 module.exports = ReactPropTypeLocationNames;
8247
8248 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(27)))
8249
8250/***/ },
8251/* 42 */
8252/***/ function(module, exports, __webpack_require__) {
8253
8254 /* WEBPACK VAR INJECTION */(function(process) {/**
8255 * Copyright 2013-2014, Facebook, Inc.
8256 * All rights reserved.
8257 *
8258 * This source code is licensed under the BSD-style license found in the
8259 * LICENSE file in the root directory of this source tree. An additional grant
8260 * of patent rights can be found in the PATENTS file in the same directory.
8261 *
8262 * @providesModule ReactUpdates
8263 */
8264
8265 "use strict";
8266
8267 var CallbackQueue = __webpack_require__(88);
8268 var PooledClass = __webpack_require__(34);
8269 var ReactCurrentOwner = __webpack_require__(9);
8270 var ReactPerf = __webpack_require__(19);
8271 var Transaction = __webpack_require__(89);
8272
8273 var assign = __webpack_require__(23);
8274 var invariant = __webpack_require__(33);
8275 var warning = __webpack_require__(31);
8276
8277 var dirtyComponents = [];
8278 var asapCallbackQueue = CallbackQueue.getPooled();
8279 var asapEnqueued = false;
8280
8281 var batchingStrategy = null;
8282
8283 function ensureInjected() {
8284 ("production" !== process.env.NODE_ENV ? invariant(
8285 ReactUpdates.ReactReconcileTransaction && batchingStrategy,
8286 'ReactUpdates: must inject a reconcile transaction class and batching ' +
8287 'strategy'
8288 ) : invariant(ReactUpdates.ReactReconcileTransaction && batchingStrategy));
8289 }
8290
8291 var NESTED_UPDATES = {
8292 initialize: function() {
8293 this.dirtyComponentsLength = dirtyComponents.length;
8294 },
8295 close: function() {
8296 if (this.dirtyComponentsLength !== dirtyComponents.length) {
8297 // Additional updates were enqueued by componentDidUpdate handlers or
8298 // similar; before our own UPDATE_QUEUEING wrapper closes, we want to run
8299 // these new updates so that if A's componentDidUpdate calls setState on
8300 // B, B will update before the callback A's updater provided when calling
8301 // setState.
8302 dirtyComponents.splice(0, this.dirtyComponentsLength);
8303 flushBatchedUpdates();
8304 } else {
8305 dirtyComponents.length = 0;
8306 }
8307 }
8308 };
8309
8310 var UPDATE_QUEUEING = {
8311 initialize: function() {
8312 this.callbackQueue.reset();
8313 },
8314 close: function() {
8315 this.callbackQueue.notifyAll();
8316 }
8317 };
8318
8319 var TRANSACTION_WRAPPERS = [NESTED_UPDATES, UPDATE_QUEUEING];
8320
8321 function ReactUpdatesFlushTransaction() {
8322 this.reinitializeTransaction();
8323 this.dirtyComponentsLength = null;
8324 this.callbackQueue = CallbackQueue.getPooled();
8325 this.reconcileTransaction =
8326 ReactUpdates.ReactReconcileTransaction.getPooled();
8327 }
8328
8329 assign(
8330 ReactUpdatesFlushTransaction.prototype,
8331 Transaction.Mixin, {
8332 getTransactionWrappers: function() {
8333 return TRANSACTION_WRAPPERS;
8334 },
8335
8336 destructor: function() {
8337 this.dirtyComponentsLength = null;
8338 CallbackQueue.release(this.callbackQueue);
8339 this.callbackQueue = null;
8340 ReactUpdates.ReactReconcileTransaction.release(this.reconcileTransaction);
8341 this.reconcileTransaction = null;
8342 },
8343
8344 perform: function(method, scope, a) {
8345 // Essentially calls `this.reconcileTransaction.perform(method, scope, a)`
8346 // with this transaction's wrappers around it.
8347 return Transaction.Mixin.perform.call(
8348 this,
8349 this.reconcileTransaction.perform,
8350 this.reconcileTransaction,
8351 method,
8352 scope,
8353 a
8354 );
8355 }
8356 });
8357
8358 PooledClass.addPoolingTo(ReactUpdatesFlushTransaction);
8359
8360 function batchedUpdates(callback, a, b) {
8361 ensureInjected();
8362 batchingStrategy.batchedUpdates(callback, a, b);
8363 }
8364
8365 /**
8366 * Array comparator for ReactComponents by owner depth
8367 *
8368 * @param {ReactComponent} c1 first component you're comparing
8369 * @param {ReactComponent} c2 second component you're comparing
8370 * @return {number} Return value usable by Array.prototype.sort().
8371 */
8372 function mountDepthComparator(c1, c2) {
8373 return c1._mountDepth - c2._mountDepth;
8374 }
8375
8376 function runBatchedUpdates(transaction) {
8377 var len = transaction.dirtyComponentsLength;
8378 ("production" !== process.env.NODE_ENV ? invariant(
8379 len === dirtyComponents.length,
8380 'Expected flush transaction\'s stored dirty-components length (%s) to ' +
8381 'match dirty-components array length (%s).',
8382 len,
8383 dirtyComponents.length
8384 ) : invariant(len === dirtyComponents.length));
8385
8386 // Since reconciling a component higher in the owner hierarchy usually (not
8387 // always -- see shouldComponentUpdate()) will reconcile children, reconcile
8388 // them before their children by sorting the array.
8389 dirtyComponents.sort(mountDepthComparator);
8390
8391 for (var i = 0; i < len; i++) {
8392 // If a component is unmounted before pending changes apply, ignore them
8393 // TODO: Queue unmounts in the same list to avoid this happening at all
8394 var component = dirtyComponents[i];
8395 if (component.isMounted()) {
8396 // If performUpdateIfNecessary happens to enqueue any new updates, we
8397 // shouldn't execute the callbacks until the next render happens, so
8398 // stash the callbacks first
8399 var callbacks = component._pendingCallbacks;
8400 component._pendingCallbacks = null;
8401 component.performUpdateIfNecessary(transaction.reconcileTransaction);
8402
8403 if (callbacks) {
8404 for (var j = 0; j < callbacks.length; j++) {
8405 transaction.callbackQueue.enqueue(
8406 callbacks[j],
8407 component
8408 );
8409 }
8410 }
8411 }
8412 }
8413 }
8414
8415 var flushBatchedUpdates = ReactPerf.measure(
8416 'ReactUpdates',
8417 'flushBatchedUpdates',
8418 function() {
8419 // ReactUpdatesFlushTransaction's wrappers will clear the dirtyComponents
8420 // array and perform any updates enqueued by mount-ready handlers (i.e.,
8421 // componentDidUpdate) but we need to check here too in order to catch
8422 // updates enqueued by setState callbacks and asap calls.
8423 while (dirtyComponents.length || asapEnqueued) {
8424 if (dirtyComponents.length) {
8425 var transaction = ReactUpdatesFlushTransaction.getPooled();
8426 transaction.perform(runBatchedUpdates, null, transaction);
8427 ReactUpdatesFlushTransaction.release(transaction);
8428 }
8429
8430 if (asapEnqueued) {
8431 asapEnqueued = false;
8432 var queue = asapCallbackQueue;
8433 asapCallbackQueue = CallbackQueue.getPooled();
8434 queue.notifyAll();
8435 CallbackQueue.release(queue);
8436 }
8437 }
8438 }
8439 );
8440
8441 /**
8442 * Mark a component as needing a rerender, adding an optional callback to a
8443 * list of functions which will be executed once the rerender occurs.
8444 */
8445 function enqueueUpdate(component, callback) {
8446 ("production" !== process.env.NODE_ENV ? invariant(
8447 !callback || typeof callback === "function",
8448 'enqueueUpdate(...): You called `setProps`, `replaceProps`, ' +
8449 '`setState`, `replaceState`, or `forceUpdate` with a callback that ' +
8450 'isn\'t callable.'
8451 ) : invariant(!callback || typeof callback === "function"));
8452 ensureInjected();
8453
8454 // Various parts of our code (such as ReactCompositeComponent's
8455 // _renderValidatedComponent) assume that calls to render aren't nested;
8456 // verify that that's the case. (This is called by each top-level update
8457 // function, like setProps, setState, forceUpdate, etc.; creation and
8458 // destruction of top-level components is guarded in ReactMount.)
8459 ("production" !== process.env.NODE_ENV ? warning(
8460 ReactCurrentOwner.current == null,
8461 'enqueueUpdate(): Render methods should be a pure function of props ' +
8462 'and state; triggering nested component updates from render is not ' +
8463 'allowed. If necessary, trigger nested updates in ' +
8464 'componentDidUpdate.'
8465 ) : null);
8466
8467 if (!batchingStrategy.isBatchingUpdates) {
8468 batchingStrategy.batchedUpdates(enqueueUpdate, component, callback);
8469 return;
8470 }
8471
8472 dirtyComponents.push(component);
8473
8474 if (callback) {
8475 if (component._pendingCallbacks) {
8476 component._pendingCallbacks.push(callback);
8477 } else {
8478 component._pendingCallbacks = [callback];
8479 }
8480 }
8481 }
8482
8483 /**
8484 * Enqueue a callback to be run at the end of the current batching cycle. Throws
8485 * if no updates are currently being performed.
8486 */
8487 function asap(callback, context) {
8488 ("production" !== process.env.NODE_ENV ? invariant(
8489 batchingStrategy.isBatchingUpdates,
8490 'ReactUpdates.asap: Can\'t enqueue an asap callback in a context where' +
8491 'updates are not being batched.'
8492 ) : invariant(batchingStrategy.isBatchingUpdates));
8493 asapCallbackQueue.enqueue(callback, context);
8494 asapEnqueued = true;
8495 }
8496
8497 var ReactUpdatesInjection = {
8498 injectReconcileTransaction: function(ReconcileTransaction) {
8499 ("production" !== process.env.NODE_ENV ? invariant(
8500 ReconcileTransaction,
8501 'ReactUpdates: must provide a reconcile transaction class'
8502 ) : invariant(ReconcileTransaction));
8503 ReactUpdates.ReactReconcileTransaction = ReconcileTransaction;
8504 },
8505
8506 injectBatchingStrategy: function(_batchingStrategy) {
8507 ("production" !== process.env.NODE_ENV ? invariant(
8508 _batchingStrategy,
8509 'ReactUpdates: must provide a batching strategy'
8510 ) : invariant(_batchingStrategy));
8511 ("production" !== process.env.NODE_ENV ? invariant(
8512 typeof _batchingStrategy.batchedUpdates === 'function',
8513 'ReactUpdates: must provide a batchedUpdates() function'
8514 ) : invariant(typeof _batchingStrategy.batchedUpdates === 'function'));
8515 ("production" !== process.env.NODE_ENV ? invariant(
8516 typeof _batchingStrategy.isBatchingUpdates === 'boolean',
8517 'ReactUpdates: must provide an isBatchingUpdates boolean attribute'
8518 ) : invariant(typeof _batchingStrategy.isBatchingUpdates === 'boolean'));
8519 batchingStrategy = _batchingStrategy;
8520 }
8521 };
8522
8523 var ReactUpdates = {
8524 /**
8525 * React references `ReactReconcileTransaction` using this property in order
8526 * to allow dependency injection.
8527 *
8528 * @internal
8529 */
8530 ReactReconcileTransaction: null,
8531
8532 batchedUpdates: batchedUpdates,
8533 enqueueUpdate: enqueueUpdate,
8534 flushBatchedUpdates: flushBatchedUpdates,
8535 injection: ReactUpdatesInjection,
8536 asap: asap
8537 };
8538
8539 module.exports = ReactUpdates;
8540
8541 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(27)))
8542
8543/***/ },
8544/* 43 */
8545/***/ function(module, exports, __webpack_require__) {
8546
8547 /* WEBPACK VAR INJECTION */(function(process) {/**
8548 * Copyright 2013-2014, Facebook, Inc.
8549 * All rights reserved.
8550 *
8551 * This source code is licensed under the BSD-style license found in the
8552 * LICENSE file in the root directory of this source tree. An additional grant
8553 * of patent rights can be found in the PATENTS file in the same directory.
8554 *
8555 * @providesModule instantiateReactComponent
8556 * @typechecks static-only
8557 */
8558
8559 "use strict";
8560
8561 var warning = __webpack_require__(31);
8562
8563 var ReactElement = __webpack_require__(10);
8564 var ReactLegacyElement = __webpack_require__(16);
8565 var ReactNativeComponent = __webpack_require__(90);
8566 var ReactEmptyComponent = __webpack_require__(36);
8567
8568 /**
8569 * Given an `element` create an instance that will actually be mounted.
8570 *
8571 * @param {object} element
8572 * @param {*} parentCompositeType The composite type that resolved this.
8573 * @return {object} A new instance of the element's constructor.
8574 * @protected
8575 */
8576 function instantiateReactComponent(element, parentCompositeType) {
8577 var instance;
8578
8579 if ("production" !== process.env.NODE_ENV) {
8580 ("production" !== process.env.NODE_ENV ? warning(
8581 element && (typeof element.type === 'function' ||
8582 typeof element.type === 'string'),
8583 'Only functions or strings can be mounted as React components.'
8584 ) : null);
8585
8586 // Resolve mock instances
8587 if (element.type._mockedReactClassConstructor) {
8588 // If this is a mocked class, we treat the legacy factory as if it was the
8589 // class constructor for future proofing unit tests. Because this might
8590 // be mocked as a legacy factory, we ignore any warnings triggerd by
8591 // this temporary hack.
8592 ReactLegacyElement._isLegacyCallWarningEnabled = false;
8593 try {
8594 instance = new element.type._mockedReactClassConstructor(
8595 element.props
8596 );
8597 } finally {
8598 ReactLegacyElement._isLegacyCallWarningEnabled = true;
8599 }
8600
8601 // If the mock implementation was a legacy factory, then it returns a
8602 // element. We need to turn this into a real component instance.
8603 if (ReactElement.isValidElement(instance)) {
8604 instance = new instance.type(instance.props);
8605 }
8606
8607 var render = instance.render;
8608 if (!render) {
8609 // For auto-mocked factories, the prototype isn't shimmed and therefore
8610 // there is no render function on the instance. We replace the whole
8611 // component with an empty component instance instead.
8612 element = ReactEmptyComponent.getEmptyComponent();
8613 } else {
8614 if (render._isMockFunction && !render._getMockImplementation()) {
8615 // Auto-mocked components may have a prototype with a mocked render
8616 // function. For those, we'll need to mock the result of the render
8617 // since we consider undefined to be invalid results from render.
8618 render.mockImplementation(
8619 ReactEmptyComponent.getEmptyComponent
8620 );
8621 }
8622 instance.construct(element);
8623 return instance;
8624 }
8625 }
8626 }
8627
8628 // Special case string values
8629 if (typeof element.type === 'string') {
8630 instance = ReactNativeComponent.createInstanceForTag(
8631 element.type,
8632 element.props,
8633 parentCompositeType
8634 );
8635 } else {
8636 // Normal case for non-mocks and non-strings
8637 instance = new element.type(element.props);
8638 }
8639
8640 if ("production" !== process.env.NODE_ENV) {
8641 ("production" !== process.env.NODE_ENV ? warning(
8642 typeof instance.construct === 'function' &&
8643 typeof instance.mountComponent === 'function' &&
8644 typeof instance.receiveComponent === 'function',
8645 'Only React Components can be mounted.'
8646 ) : null);
8647 }
8648
8649 // This actually sets up the internal instance. This will become decoupled
8650 // from the public instance in a future diff.
8651 instance.construct(element);
8652
8653 return instance;
8654 }
8655
8656 module.exports = instantiateReactComponent;
8657
8658 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(27)))
8659
8660/***/ },
8661/* 44 */
8662/***/ function(module, exports, __webpack_require__) {
8663
8664 /* WEBPACK VAR INJECTION */(function(process) {/**
8665 * Copyright 2013-2014, Facebook, Inc.
8666 * All rights reserved.
8667 *
8668 * This source code is licensed under the BSD-style license found in the
8669 * LICENSE file in the root directory of this source tree. An additional grant
8670 * of patent rights can be found in the PATENTS file in the same directory.
8671 *
8672 * @providesModule keyMirror
8673 * @typechecks static-only
8674 */
8675
8676 "use strict";
8677
8678 var invariant = __webpack_require__(33);
8679
8680 /**
8681 * Constructs an enumeration with keys equal to their value.
8682 *
8683 * For example:
8684 *
8685 * var COLORS = keyMirror({blue: null, red: null});
8686 * var myColor = COLORS.blue;
8687 * var isColorValid = !!COLORS[myColor];
8688 *
8689 * The last line could not be performed if the values of the generated enum were
8690 * not equal to their keys.
8691 *
8692 * Input: {key1: val1, key2: val2}
8693 * Output: {key1: key1, key2: key2}
8694 *
8695 * @param {object} obj
8696 * @return {object}
8697 */
8698 var keyMirror = function(obj) {
8699 var ret = {};
8700 var key;
8701 ("production" !== process.env.NODE_ENV ? invariant(
8702 obj instanceof Object && !Array.isArray(obj),
8703 'keyMirror(...): Argument must be an object.'
8704 ) : invariant(obj instanceof Object && !Array.isArray(obj)));
8705 for (key in obj) {
8706 if (!obj.hasOwnProperty(key)) {
8707 continue;
8708 }
8709 ret[key] = key;
8710 }
8711 return ret;
8712 };
8713
8714 module.exports = keyMirror;
8715
8716 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(27)))
8717
8718/***/ },
8719/* 45 */
8720/***/ function(module, exports, __webpack_require__) {
8721
8722 /**
8723 * Copyright 2013-2014, Facebook, Inc.
8724 * All rights reserved.
8725 *
8726 * This source code is licensed under the BSD-style license found in the
8727 * LICENSE file in the root directory of this source tree. An additional grant
8728 * of patent rights can be found in the PATENTS file in the same directory.
8729 *
8730 * @providesModule keyOf
8731 */
8732
8733 /**
8734 * Allows extraction of a minified key. Let's the build system minify keys
8735 * without loosing the ability to dynamically use key strings as values
8736 * themselves. Pass in an object with a single key/val pair and it will return
8737 * you the string key of that single record. Suppose you want to grab the
8738 * value for a key 'className' inside of an object. Key/val minification may
8739 * have aliased that key to be 'xa12'. keyOf({className: null}) will return
8740 * 'xa12' in that case. Resolve keys you want to use once at startup time, then
8741 * reuse those resolutions.
8742 */
8743 var keyOf = function(oneKeyObj) {
8744 var key;
8745 for (key in oneKeyObj) {
8746 if (!oneKeyObj.hasOwnProperty(key)) {
8747 continue;
8748 }
8749 return key;
8750 }
8751 return null;
8752 };
8753
8754
8755 module.exports = keyOf;
8756
8757
8758/***/ },
8759/* 46 */
8760/***/ function(module, exports, __webpack_require__) {
8761
8762 /* WEBPACK VAR INJECTION */(function(process) {/**
8763 * Copyright 2014, Facebook, Inc.
8764 * All rights reserved.
8765 *
8766 * This source code is licensed under the BSD-style license found in the
8767 * LICENSE file in the root directory of this source tree. An additional grant
8768 * of patent rights can be found in the PATENTS file in the same directory.
8769 *
8770 * @providesModule monitorCodeUse
8771 */
8772
8773 "use strict";
8774
8775 var invariant = __webpack_require__(33);
8776
8777 /**
8778 * Provides open-source compatible instrumentation for monitoring certain API
8779 * uses before we're ready to issue a warning or refactor. It accepts an event
8780 * name which may only contain the characters [a-z0-9_] and an optional data
8781 * object with further information.
8782 */
8783
8784 function monitorCodeUse(eventName, data) {
8785 ("production" !== process.env.NODE_ENV ? invariant(
8786 eventName && !/[^a-z0-9_]/.test(eventName),
8787 'You must provide an eventName using only the characters [a-z0-9_]'
8788 ) : invariant(eventName && !/[^a-z0-9_]/.test(eventName)));
8789 }
8790
8791 module.exports = monitorCodeUse;
8792
8793 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(27)))
8794
8795/***/ },
8796/* 47 */
8797/***/ function(module, exports, __webpack_require__) {
8798
8799 /**
8800 * Copyright 2013-2014, Facebook, Inc.
8801 * All rights reserved.
8802 *
8803 * This source code is licensed under the BSD-style license found in the
8804 * LICENSE file in the root directory of this source tree. An additional grant
8805 * of patent rights can be found in the PATENTS file in the same directory.
8806 *
8807 * @providesModule mapObject
8808 */
8809
8810 'use strict';
8811
8812 var hasOwnProperty = Object.prototype.hasOwnProperty;
8813
8814 /**
8815 * Executes the provided `callback` once for each enumerable own property in the
8816 * object and constructs a new object from the results. The `callback` is
8817 * invoked with three arguments:
8818 *
8819 * - the property value
8820 * - the property name
8821 * - the object being traversed
8822 *
8823 * Properties that are added after the call to `mapObject` will not be visited
8824 * by `callback`. If the values of existing properties are changed, the value
8825 * passed to `callback` will be the value at the time `mapObject` visits them.
8826 * Properties that are deleted before being visited are not visited.
8827 *
8828 * @grep function objectMap()
8829 * @grep function objMap()
8830 *
8831 * @param {?object} object
8832 * @param {function} callback
8833 * @param {*} context
8834 * @return {?object}
8835 */
8836 function mapObject(object, callback, context) {
8837 if (!object) {
8838 return null;
8839 }
8840 var result = {};
8841 for (var name in object) {
8842 if (hasOwnProperty.call(object, name)) {
8843 result[name] = callback.call(context, object[name], name, object);
8844 }
8845 }
8846 return result;
8847 }
8848
8849 module.exports = mapObject;
8850
8851
8852/***/ },
8853/* 48 */
8854/***/ function(module, exports, __webpack_require__) {
8855
8856 /**
8857 * Copyright 2013-2014, Facebook, Inc.
8858 * All rights reserved.
8859 *
8860 * This source code is licensed under the BSD-style license found in the
8861 * LICENSE file in the root directory of this source tree. An additional grant
8862 * of patent rights can be found in the PATENTS file in the same directory.
8863 *
8864 * @providesModule shouldUpdateReactComponent
8865 * @typechecks static-only
8866 */
8867
8868 "use strict";
8869
8870 /**
8871 * Given a `prevElement` and `nextElement`, determines if the existing
8872 * instance should be updated as opposed to being destroyed or replaced by a new
8873 * instance. Both arguments are elements. This ensures that this logic can
8874 * operate on stateless trees without any backing instance.
8875 *
8876 * @param {?object} prevElement
8877 * @param {?object} nextElement
8878 * @return {boolean} True if the existing instance should be updated.
8879 * @protected
8880 */
8881 function shouldUpdateReactComponent(prevElement, nextElement) {
8882 if (prevElement && nextElement &&
8883 prevElement.type === nextElement.type &&
8884 prevElement.key === nextElement.key &&
8885 prevElement._owner === nextElement._owner) {
8886 return true;
8887 }
8888 return false;
8889 }
8890
8891 module.exports = shouldUpdateReactComponent;
8892
8893
8894/***/ },
8895/* 49 */
8896/***/ function(module, exports, __webpack_require__) {
8897
8898 /* WEBPACK VAR INJECTION */(function(process) {/**
8899 * Copyright 2013-2014, Facebook, Inc.
8900 * All rights reserved.
8901 *
8902 * This source code is licensed under the BSD-style license found in the
8903 * LICENSE file in the root directory of this source tree. An additional grant
8904 * of patent rights can be found in the PATENTS file in the same directory.
8905 *
8906 * @providesModule CSSPropertyOperations
8907 * @typechecks static-only
8908 */
8909
8910 "use strict";
8911
8912 var CSSProperty = __webpack_require__(91);
8913 var ExecutionEnvironment = __webpack_require__(26);
8914
8915 var camelizeStyleName = __webpack_require__(92);
8916 var dangerousStyleValue = __webpack_require__(93);
8917 var hyphenateStyleName = __webpack_require__(94);
8918 var memoizeStringOnly = __webpack_require__(30);
8919 var warning = __webpack_require__(31);
8920
8921 var processStyleName = memoizeStringOnly(function(styleName) {
8922 return hyphenateStyleName(styleName);
8923 });
8924
8925 var styleFloatAccessor = 'cssFloat';
8926 if (ExecutionEnvironment.canUseDOM) {
8927 // IE8 only supports accessing cssFloat (standard) as styleFloat
8928 if (document.documentElement.style.cssFloat === undefined) {
8929 styleFloatAccessor = 'styleFloat';
8930 }
8931 }
8932
8933 if ("production" !== process.env.NODE_ENV) {
8934 var warnedStyleNames = {};
8935
8936 var warnHyphenatedStyleName = function(name) {
8937 if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) {
8938 return;
8939 }
8940
8941 warnedStyleNames[name] = true;
8942 ("production" !== process.env.NODE_ENV ? warning(
8943 false,
8944 'Unsupported style property ' + name + '. Did you mean ' +
8945 camelizeStyleName(name) + '?'
8946 ) : null);
8947 };
8948 }
8949
8950 /**
8951 * Operations for dealing with CSS properties.
8952 */
8953 var CSSPropertyOperations = {
8954
8955 /**
8956 * Serializes a mapping of style properties for use as inline styles:
8957 *
8958 * > createMarkupForStyles({width: '200px', height: 0})
8959 * "width:200px;height:0;"
8960 *
8961 * Undefined values are ignored so that declarative programming is easier.
8962 * The result should be HTML-escaped before insertion into the DOM.
8963 *
8964 * @param {object} styles
8965 * @return {?string}
8966 */
8967 createMarkupForStyles: function(styles) {
8968 var serialized = '';
8969 for (var styleName in styles) {
8970 if (!styles.hasOwnProperty(styleName)) {
8971 continue;
8972 }
8973 if ("production" !== process.env.NODE_ENV) {
8974 if (styleName.indexOf('-') > -1) {
8975 warnHyphenatedStyleName(styleName);
8976 }
8977 }
8978 var styleValue = styles[styleName];
8979 if (styleValue != null) {
8980 serialized += processStyleName(styleName) + ':';
8981 serialized += dangerousStyleValue(styleName, styleValue) + ';';
8982 }
8983 }
8984 return serialized || null;
8985 },
8986
8987 /**
8988 * Sets the value for multiple styles on a node. If a value is specified as
8989 * '' (empty string), the corresponding style property will be unset.
8990 *
8991 * @param {DOMElement} node
8992 * @param {object} styles
8993 */
8994 setValueForStyles: function(node, styles) {
8995 var style = node.style;
8996 for (var styleName in styles) {
8997 if (!styles.hasOwnProperty(styleName)) {
8998 continue;
8999 }
9000 if ("production" !== process.env.NODE_ENV) {
9001 if (styleName.indexOf('-') > -1) {
9002 warnHyphenatedStyleName(styleName);
9003 }
9004 }
9005 var styleValue = dangerousStyleValue(styleName, styles[styleName]);
9006 if (styleName === 'float') {
9007 styleName = styleFloatAccessor;
9008 }
9009 if (styleValue) {
9010 style[styleName] = styleValue;
9011 } else {
9012 var expansion = CSSProperty.shorthandPropertyExpansions[styleName];
9013 if (expansion) {
9014 // Shorthand property that IE8 won't like unsetting, so unset each
9015 // component to placate it
9016 for (var individualStyleName in expansion) {
9017 style[individualStyleName] = '';
9018 }
9019 } else {
9020 style[styleName] = '';
9021 }
9022 }
9023 }
9024 }
9025
9026 };
9027
9028 module.exports = CSSPropertyOperations;
9029
9030 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(27)))
9031
9032/***/ },
9033/* 50 */
9034/***/ function(module, exports, __webpack_require__) {
9035
9036 /* WEBPACK VAR INJECTION */(function(process) {/**
9037 * Copyright 2013-2014, Facebook, Inc.
9038 * All rights reserved.
9039 *
9040 * This source code is licensed under the BSD-style license found in the
9041 * LICENSE file in the root directory of this source tree. An additional grant
9042 * of patent rights can be found in the PATENTS file in the same directory.
9043 *
9044 * @providesModule ReactBrowserComponentMixin
9045 */
9046
9047 "use strict";
9048
9049 var ReactEmptyComponent = __webpack_require__(36);
9050 var ReactMount = __webpack_require__(17);
9051
9052 var invariant = __webpack_require__(33);
9053
9054 var ReactBrowserComponentMixin = {
9055 /**
9056 * Returns the DOM node rendered by this component.
9057 *
9058 * @return {DOMElement} The root node of this component.
9059 * @final
9060 * @protected
9061 */
9062 getDOMNode: function() {
9063 ("production" !== process.env.NODE_ENV ? invariant(
9064 this.isMounted(),
9065 'getDOMNode(): A component must be mounted to have a DOM node.'
9066 ) : invariant(this.isMounted()));
9067 if (ReactEmptyComponent.isNullComponentID(this._rootNodeID)) {
9068 return null;
9069 }
9070 return ReactMount.getNode(this._rootNodeID);
9071 }
9072 };
9073
9074 module.exports = ReactBrowserComponentMixin;
9075
9076 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(27)))
9077
9078/***/ },
9079/* 51 */
9080/***/ function(module, exports, __webpack_require__) {
9081
9082 /**
9083 * Copyright 2013-2014, Facebook, Inc.
9084 * All rights reserved.
9085 *
9086 * This source code is licensed under the BSD-style license found in the
9087 * LICENSE file in the root directory of this source tree. An additional grant
9088 * of patent rights can be found in the PATENTS file in the same directory.
9089 *
9090 * @providesModule ReactBrowserEventEmitter
9091 * @typechecks static-only
9092 */
9093
9094 "use strict";
9095
9096 var EventConstants = __webpack_require__(32);
9097 var EventPluginHub = __webpack_require__(95);
9098 var EventPluginRegistry = __webpack_require__(96);
9099 var ReactEventEmitterMixin = __webpack_require__(97);
9100 var ViewportMetrics = __webpack_require__(98);
9101
9102 var assign = __webpack_require__(23);
9103 var isEventSupported = __webpack_require__(52);
9104
9105 /**
9106 * Summary of `ReactBrowserEventEmitter` event handling:
9107 *
9108 * - Top-level delegation is used to trap most native browser events. This
9109 * may only occur in the main thread and is the responsibility of
9110 * ReactEventListener, which is injected and can therefore support pluggable
9111 * event sources. This is the only work that occurs in the main thread.
9112 *
9113 * - We normalize and de-duplicate events to account for browser quirks. This
9114 * may be done in the worker thread.
9115 *
9116 * - Forward these native events (with the associated top-level type used to
9117 * trap it) to `EventPluginHub`, which in turn will ask plugins if they want
9118 * to extract any synthetic events.
9119 *
9120 * - The `EventPluginHub` will then process each event by annotating them with
9121 * "dispatches", a sequence of listeners and IDs that care about that event.
9122 *
9123 * - The `EventPluginHub` then dispatches the events.
9124 *
9125 * Overview of React and the event system:
9126 *
9127 * +------------+ .
9128 * | DOM | .
9129 * +------------+ .
9130 * | .
9131 * v .
9132 * +------------+ .
9133 * | ReactEvent | .
9134 * | Listener | .
9135 * +------------+ . +-----------+
9136 * | . +--------+|SimpleEvent|
9137 * | . | |Plugin |
9138 * +-----|------+ . v +-----------+
9139 * | | | . +--------------+ +------------+
9140 * | +-----------.--->|EventPluginHub| | Event |
9141 * | | . | | +-----------+ | Propagators|
9142 * | ReactEvent | . | | |TapEvent | |------------|
9143 * | Emitter | . | |<---+|Plugin | |other plugin|
9144 * | | . | | +-----------+ | utilities |
9145 * | +-----------.--->| | +------------+
9146 * | | | . +--------------+
9147 * +-----|------+ . ^ +-----------+
9148 * | . | |Enter/Leave|
9149 * + . +-------+|Plugin |
9150 * +-------------+ . +-----------+
9151 * | application | .
9152 * |-------------| .
9153 * | | .
9154 * | | .
9155 * +-------------+ .
9156 * .
9157 * React Core . General Purpose Event Plugin System
9158 */
9159
9160 var alreadyListeningTo = {};
9161 var isMonitoringScrollValue = false;
9162 var reactTopListenersCounter = 0;
9163
9164 // For events like 'submit' which don't consistently bubble (which we trap at a
9165 // lower node than `document`), binding at `document` would cause duplicate
9166 // events so we don't include them here
9167 var topEventMapping = {
9168 topBlur: 'blur',
9169 topChange: 'change',
9170 topClick: 'click',
9171 topCompositionEnd: 'compositionend',
9172 topCompositionStart: 'compositionstart',
9173 topCompositionUpdate: 'compositionupdate',
9174 topContextMenu: 'contextmenu',
9175 topCopy: 'copy',
9176 topCut: 'cut',
9177 topDoubleClick: 'dblclick',
9178 topDrag: 'drag',
9179 topDragEnd: 'dragend',
9180 topDragEnter: 'dragenter',
9181 topDragExit: 'dragexit',
9182 topDragLeave: 'dragleave',
9183 topDragOver: 'dragover',
9184 topDragStart: 'dragstart',
9185 topDrop: 'drop',
9186 topFocus: 'focus',
9187 topInput: 'input',
9188 topKeyDown: 'keydown',
9189 topKeyPress: 'keypress',
9190 topKeyUp: 'keyup',
9191 topMouseDown: 'mousedown',
9192 topMouseMove: 'mousemove',
9193 topMouseOut: 'mouseout',
9194 topMouseOver: 'mouseover',
9195 topMouseUp: 'mouseup',
9196 topPaste: 'paste',
9197 topScroll: 'scroll',
9198 topSelectionChange: 'selectionchange',
9199 topTextInput: 'textInput',
9200 topTouchCancel: 'touchcancel',
9201 topTouchEnd: 'touchend',
9202 topTouchMove: 'touchmove',
9203 topTouchStart: 'touchstart',
9204 topWheel: 'wheel'
9205 };
9206
9207 /**
9208 * To ensure no conflicts with other potential React instances on the page
9209 */
9210 var topListenersIDKey = "_reactListenersID" + String(Math.random()).slice(2);
9211
9212 function getListeningForDocument(mountAt) {
9213 // In IE8, `mountAt` is a host object and doesn't have `hasOwnProperty`
9214 // directly.
9215 if (!Object.prototype.hasOwnProperty.call(mountAt, topListenersIDKey)) {
9216 mountAt[topListenersIDKey] = reactTopListenersCounter++;
9217 alreadyListeningTo[mountAt[topListenersIDKey]] = {};
9218 }
9219 return alreadyListeningTo[mountAt[topListenersIDKey]];
9220 }
9221
9222 /**
9223 * `ReactBrowserEventEmitter` is used to attach top-level event listeners. For
9224 * example:
9225 *
9226 * ReactBrowserEventEmitter.putListener('myID', 'onClick', myFunction);
9227 *
9228 * This would allocate a "registration" of `('onClick', myFunction)` on 'myID'.
9229 *
9230 * @internal
9231 */
9232 var ReactBrowserEventEmitter = assign({}, ReactEventEmitterMixin, {
9233
9234 /**
9235 * Injectable event backend
9236 */
9237 ReactEventListener: null,
9238
9239 injection: {
9240 /**
9241 * @param {object} ReactEventListener
9242 */
9243 injectReactEventListener: function(ReactEventListener) {
9244 ReactEventListener.setHandleTopLevel(
9245 ReactBrowserEventEmitter.handleTopLevel
9246 );
9247 ReactBrowserEventEmitter.ReactEventListener = ReactEventListener;
9248 }
9249 },
9250
9251 /**
9252 * Sets whether or not any created callbacks should be enabled.
9253 *
9254 * @param {boolean} enabled True if callbacks should be enabled.
9255 */
9256 setEnabled: function(enabled) {
9257 if (ReactBrowserEventEmitter.ReactEventListener) {
9258 ReactBrowserEventEmitter.ReactEventListener.setEnabled(enabled);
9259 }
9260 },
9261
9262 /**
9263 * @return {boolean} True if callbacks are enabled.
9264 */
9265 isEnabled: function() {
9266 return !!(
9267 ReactBrowserEventEmitter.ReactEventListener &&
9268 ReactBrowserEventEmitter.ReactEventListener.isEnabled()
9269 );
9270 },
9271
9272 /**
9273 * We listen for bubbled touch events on the document object.
9274 *
9275 * Firefox v8.01 (and possibly others) exhibited strange behavior when
9276 * mounting `onmousemove` events at some node that was not the document
9277 * element. The symptoms were that if your mouse is not moving over something
9278 * contained within that mount point (for example on the background) the
9279 * top-level listeners for `onmousemove` won't be called. However, if you
9280 * register the `mousemove` on the document object, then it will of course
9281 * catch all `mousemove`s. This along with iOS quirks, justifies restricting
9282 * top-level listeners to the document object only, at least for these
9283 * movement types of events and possibly all events.
9284 *
9285 * @see http://www.quirksmode.org/blog/archives/2010/09/click_event_del.html
9286 *
9287 * Also, `keyup`/`keypress`/`keydown` do not bubble to the window on IE, but
9288 * they bubble to document.
9289 *
9290 * @param {string} registrationName Name of listener (e.g. `onClick`).
9291 * @param {object} contentDocumentHandle Document which owns the container
9292 */
9293 listenTo: function(registrationName, contentDocumentHandle) {
9294 var mountAt = contentDocumentHandle;
9295 var isListening = getListeningForDocument(mountAt);
9296 var dependencies = EventPluginRegistry.
9297 registrationNameDependencies[registrationName];
9298
9299 var topLevelTypes = EventConstants.topLevelTypes;
9300 for (var i = 0, l = dependencies.length; i < l; i++) {
9301 var dependency = dependencies[i];
9302 if (!(
9303 isListening.hasOwnProperty(dependency) &&
9304 isListening[dependency]
9305 )) {
9306 if (dependency === topLevelTypes.topWheel) {
9307 if (isEventSupported('wheel')) {
9308 ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(
9309 topLevelTypes.topWheel,
9310 'wheel',
9311 mountAt
9312 );
9313 } else if (isEventSupported('mousewheel')) {
9314 ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(
9315 topLevelTypes.topWheel,
9316 'mousewheel',
9317 mountAt
9318 );
9319 } else {
9320 // Firefox needs to capture a different mouse scroll event.
9321 // @see http://www.quirksmode.org/dom/events/tests/scroll.html
9322 ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(
9323 topLevelTypes.topWheel,
9324 'DOMMouseScroll',
9325 mountAt
9326 );
9327 }
9328 } else if (dependency === topLevelTypes.topScroll) {
9329
9330 if (isEventSupported('scroll', true)) {
9331 ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent(
9332 topLevelTypes.topScroll,
9333 'scroll',
9334 mountAt
9335 );
9336 } else {
9337 ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(
9338 topLevelTypes.topScroll,
9339 'scroll',
9340 ReactBrowserEventEmitter.ReactEventListener.WINDOW_HANDLE
9341 );
9342 }
9343 } else if (dependency === topLevelTypes.topFocus ||
9344 dependency === topLevelTypes.topBlur) {
9345
9346 if (isEventSupported('focus', true)) {
9347 ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent(
9348 topLevelTypes.topFocus,
9349 'focus',
9350 mountAt
9351 );
9352 ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent(
9353 topLevelTypes.topBlur,
9354 'blur',
9355 mountAt
9356 );
9357 } else if (isEventSupported('focusin')) {
9358 // IE has `focusin` and `focusout` events which bubble.
9359 // @see http://www.quirksmode.org/blog/archives/2008/04/delegating_the.html
9360 ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(
9361 topLevelTypes.topFocus,
9362 'focusin',
9363 mountAt
9364 );
9365 ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(
9366 topLevelTypes.topBlur,
9367 'focusout',
9368 mountAt
9369 );
9370 }
9371
9372 // to make sure blur and focus event listeners are only attached once
9373 isListening[topLevelTypes.topBlur] = true;
9374 isListening[topLevelTypes.topFocus] = true;
9375 } else if (topEventMapping.hasOwnProperty(dependency)) {
9376 ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(
9377 dependency,
9378 topEventMapping[dependency],
9379 mountAt
9380 );
9381 }
9382
9383 isListening[dependency] = true;
9384 }
9385 }
9386 },
9387
9388 trapBubbledEvent: function(topLevelType, handlerBaseName, handle) {
9389 return ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(
9390 topLevelType,
9391 handlerBaseName,
9392 handle
9393 );
9394 },
9395
9396 trapCapturedEvent: function(topLevelType, handlerBaseName, handle) {
9397 return ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent(
9398 topLevelType,
9399 handlerBaseName,
9400 handle
9401 );
9402 },
9403
9404 /**
9405 * Listens to window scroll and resize events. We cache scroll values so that
9406 * application code can access them without triggering reflows.
9407 *
9408 * NOTE: Scroll events do not bubble.
9409 *
9410 * @see http://www.quirksmode.org/dom/events/scroll.html
9411 */
9412 ensureScrollValueMonitoring: function(){
9413 if (!isMonitoringScrollValue) {
9414 var refresh = ViewportMetrics.refreshScrollValues;
9415 ReactBrowserEventEmitter.ReactEventListener.monitorScrollValue(refresh);
9416 isMonitoringScrollValue = true;
9417 }
9418 },
9419
9420 eventNameDispatchConfigs: EventPluginHub.eventNameDispatchConfigs,
9421
9422 registrationNameModules: EventPluginHub.registrationNameModules,
9423
9424 putListener: EventPluginHub.putListener,
9425
9426 getListener: EventPluginHub.getListener,
9427
9428 deleteListener: EventPluginHub.deleteListener,
9429
9430 deleteAllListeners: EventPluginHub.deleteAllListeners
9431
9432 });
9433
9434 module.exports = ReactBrowserEventEmitter;
9435
9436
9437/***/ },
9438/* 52 */
9439/***/ function(module, exports, __webpack_require__) {
9440
9441 /**
9442 * Copyright 2013-2014, Facebook, Inc.
9443 * All rights reserved.
9444 *
9445 * This source code is licensed under the BSD-style license found in the
9446 * LICENSE file in the root directory of this source tree. An additional grant
9447 * of patent rights can be found in the PATENTS file in the same directory.
9448 *
9449 * @providesModule isEventSupported
9450 */
9451
9452 "use strict";
9453
9454 var ExecutionEnvironment = __webpack_require__(26);
9455
9456 var useHasFeature;
9457 if (ExecutionEnvironment.canUseDOM) {
9458 useHasFeature =
9459 document.implementation &&
9460 document.implementation.hasFeature &&
9461 // always returns true in newer browsers as per the standard.
9462 // @see http://dom.spec.whatwg.org/#dom-domimplementation-hasfeature
9463 document.implementation.hasFeature('', '') !== true;
9464 }
9465
9466 /**
9467 * Checks if an event is supported in the current execution environment.
9468 *
9469 * NOTE: This will not work correctly for non-generic events such as `change`,
9470 * `reset`, `load`, `error`, and `select`.
9471 *
9472 * Borrows from Modernizr.
9473 *
9474 * @param {string} eventNameSuffix Event name, e.g. "click".
9475 * @param {?boolean} capture Check if the capture phase is supported.
9476 * @return {boolean} True if the event is supported.
9477 * @internal
9478 * @license Modernizr 3.0.0pre (Custom Build) | MIT
9479 */
9480 function isEventSupported(eventNameSuffix, capture) {
9481 if (!ExecutionEnvironment.canUseDOM ||
9482 capture && !('addEventListener' in document)) {
9483 return false;
9484 }
9485
9486 var eventName = 'on' + eventNameSuffix;
9487 var isSupported = eventName in document;
9488
9489 if (!isSupported) {
9490 var element = document.createElement('div');
9491 element.setAttribute(eventName, 'return;');
9492 isSupported = typeof element[eventName] === 'function';
9493 }
9494
9495 if (!isSupported && useHasFeature && eventNameSuffix === 'wheel') {
9496 // This is the only way to test support for the `wheel` event in IE9+.
9497 isSupported = document.implementation.hasFeature('Events.wheel', '3.0');
9498 }
9499
9500 return isSupported;
9501 }
9502
9503 module.exports = isEventSupported;
9504
9505
9506/***/ },
9507/* 53 */
9508/***/ function(module, exports, __webpack_require__) {
9509
9510 /**
9511 * Copyright 2013 Facebook, Inc.
9512 * All rights reserved.
9513 *
9514 * This source code is licensed under the BSD-style license found in the
9515 * LICENSE file in the root directory of this source tree. An additional grant
9516 * of patent rights can be found in the PATENTS file in the same directory.
9517 *
9518 * @providesModule BeforeInputEventPlugin
9519 * @typechecks static-only
9520 */
9521
9522 "use strict";
9523
9524 var EventConstants = __webpack_require__(32);
9525 var EventPropagators = __webpack_require__(99);
9526 var ExecutionEnvironment = __webpack_require__(26);
9527 var SyntheticInputEvent = __webpack_require__(100);
9528
9529 var keyOf = __webpack_require__(45);
9530
9531 var canUseTextInputEvent = (
9532 ExecutionEnvironment.canUseDOM &&
9533 'TextEvent' in window &&
9534 !('documentMode' in document || isPresto())
9535 );
9536
9537 /**
9538 * Opera <= 12 includes TextEvent in window, but does not fire
9539 * text input events. Rely on keypress instead.
9540 */
9541 function isPresto() {
9542 var opera = window.opera;
9543 return (
9544 typeof opera === 'object' &&
9545 typeof opera.version === 'function' &&
9546 parseInt(opera.version(), 10) <= 12
9547 );
9548 }
9549
9550 var SPACEBAR_CODE = 32;
9551 var SPACEBAR_CHAR = String.fromCharCode(SPACEBAR_CODE);
9552
9553 var topLevelTypes = EventConstants.topLevelTypes;
9554
9555 // Events and their corresponding property names.
9556 var eventTypes = {
9557 beforeInput: {
9558 phasedRegistrationNames: {
9559 bubbled: keyOf({onBeforeInput: null}),
9560 captured: keyOf({onBeforeInputCapture: null})
9561 },
9562 dependencies: [
9563 topLevelTypes.topCompositionEnd,
9564 topLevelTypes.topKeyPress,
9565 topLevelTypes.topTextInput,
9566 topLevelTypes.topPaste
9567 ]
9568 }
9569 };
9570
9571 // Track characters inserted via keypress and composition events.
9572 var fallbackChars = null;
9573
9574 // Track whether we've ever handled a keypress on the space key.
9575 var hasSpaceKeypress = false;
9576
9577 /**
9578 * Return whether a native keypress event is assumed to be a command.
9579 * This is required because Firefox fires `keypress` events for key commands
9580 * (cut, copy, select-all, etc.) even though no character is inserted.
9581 */
9582 function isKeypressCommand(nativeEvent) {
9583 return (
9584 (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&
9585 // ctrlKey && altKey is equivalent to AltGr, and is not a command.
9586 !(nativeEvent.ctrlKey && nativeEvent.altKey)
9587 );
9588 }
9589
9590 /**
9591 * Create an `onBeforeInput` event to match
9592 * http://www.w3.org/TR/2013/WD-DOM-Level-3-Events-20131105/#events-inputevents.
9593 *
9594 * This event plugin is based on the native `textInput` event
9595 * available in Chrome, Safari, Opera, and IE. This event fires after
9596 * `onKeyPress` and `onCompositionEnd`, but before `onInput`.
9597 *
9598 * `beforeInput` is spec'd but not implemented in any browsers, and
9599 * the `input` event does not provide any useful information about what has
9600 * actually been added, contrary to the spec. Thus, `textInput` is the best
9601 * available event to identify the characters that have actually been inserted
9602 * into the target node.
9603 */
9604 var BeforeInputEventPlugin = {
9605
9606 eventTypes: eventTypes,
9607
9608 /**
9609 * @param {string} topLevelType Record from `EventConstants`.
9610 * @param {DOMEventTarget} topLevelTarget The listening component root node.
9611 * @param {string} topLevelTargetID ID of `topLevelTarget`.
9612 * @param {object} nativeEvent Native browser event.
9613 * @return {*} An accumulation of synthetic events.
9614 * @see {EventPluginHub.extractEvents}
9615 */
9616 extractEvents: function(
9617 topLevelType,
9618 topLevelTarget,
9619 topLevelTargetID,
9620 nativeEvent) {
9621
9622 var chars;
9623
9624 if (canUseTextInputEvent) {
9625 switch (topLevelType) {
9626 case topLevelTypes.topKeyPress:
9627 /**
9628 * If native `textInput` events are available, our goal is to make
9629 * use of them. However, there is a special case: the spacebar key.
9630 * In Webkit, preventing default on a spacebar `textInput` event
9631 * cancels character insertion, but it *also* causes the browser
9632 * to fall back to its default spacebar behavior of scrolling the
9633 * page.
9634 *
9635 * Tracking at:
9636 * https://code.google.com/p/chromium/issues/detail?id=355103
9637 *
9638 * To avoid this issue, use the keypress event as if no `textInput`
9639 * event is available.
9640 */
9641 var which = nativeEvent.which;
9642 if (which !== SPACEBAR_CODE) {
9643 return;
9644 }
9645
9646 hasSpaceKeypress = true;
9647 chars = SPACEBAR_CHAR;
9648 break;
9649
9650 case topLevelTypes.topTextInput:
9651 // Record the characters to be added to the DOM.
9652 chars = nativeEvent.data;
9653
9654 // If it's a spacebar character, assume that we have already handled
9655 // it at the keypress level and bail immediately. Android Chrome
9656 // doesn't give us keycodes, so we need to blacklist it.
9657 if (chars === SPACEBAR_CHAR && hasSpaceKeypress) {
9658 return;
9659 }
9660
9661 // Otherwise, carry on.
9662 break;
9663
9664 default:
9665 // For other native event types, do nothing.
9666 return;
9667 }
9668 } else {
9669 switch (topLevelType) {
9670 case topLevelTypes.topPaste:
9671 // If a paste event occurs after a keypress, throw out the input
9672 // chars. Paste events should not lead to BeforeInput events.
9673 fallbackChars = null;
9674 break;
9675 case topLevelTypes.topKeyPress:
9676 /**
9677 * As of v27, Firefox may fire keypress events even when no character
9678 * will be inserted. A few possibilities:
9679 *
9680 * - `which` is `0`. Arrow keys, Esc key, etc.
9681 *
9682 * - `which` is the pressed key code, but no char is available.
9683 * Ex: 'AltGr + d` in Polish. There is no modified character for
9684 * this key combination and no character is inserted into the
9685 * document, but FF fires the keypress for char code `100` anyway.
9686 * No `input` event will occur.
9687 *
9688 * - `which` is the pressed key code, but a command combination is
9689 * being used. Ex: `Cmd+C`. No character is inserted, and no
9690 * `input` event will occur.
9691 */
9692 if (nativeEvent.which && !isKeypressCommand(nativeEvent)) {
9693 fallbackChars = String.fromCharCode(nativeEvent.which);
9694 }
9695 break;
9696 case topLevelTypes.topCompositionEnd:
9697 fallbackChars = nativeEvent.data;
9698 break;
9699 }
9700
9701 // If no changes have occurred to the fallback string, no relevant
9702 // event has fired and we're done.
9703 if (fallbackChars === null) {
9704 return;
9705 }
9706
9707 chars = fallbackChars;
9708 }
9709
9710 // If no characters are being inserted, no BeforeInput event should
9711 // be fired.
9712 if (!chars) {
9713 return;
9714 }
9715
9716 var event = SyntheticInputEvent.getPooled(
9717 eventTypes.beforeInput,
9718 topLevelTargetID,
9719 nativeEvent
9720 );
9721
9722 event.data = chars;
9723 fallbackChars = null;
9724 EventPropagators.accumulateTwoPhaseDispatches(event);
9725 return event;
9726 }
9727 };
9728
9729 module.exports = BeforeInputEventPlugin;
9730
9731
9732/***/ },
9733/* 54 */
9734/***/ function(module, exports, __webpack_require__) {
9735
9736 /**
9737 * Copyright 2013-2014, Facebook, Inc.
9738 * All rights reserved.
9739 *
9740 * This source code is licensed under the BSD-style license found in the
9741 * LICENSE file in the root directory of this source tree. An additional grant
9742 * of patent rights can be found in the PATENTS file in the same directory.
9743 *
9744 * @providesModule ChangeEventPlugin
9745 */
9746
9747 "use strict";
9748
9749 var EventConstants = __webpack_require__(32);
9750 var EventPluginHub = __webpack_require__(95);
9751 var EventPropagators = __webpack_require__(99);
9752 var ExecutionEnvironment = __webpack_require__(26);
9753 var ReactUpdates = __webpack_require__(42);
9754 var SyntheticEvent = __webpack_require__(101);
9755
9756 var isEventSupported = __webpack_require__(52);
9757 var isTextInputElement = __webpack_require__(102);
9758 var keyOf = __webpack_require__(45);
9759
9760 var topLevelTypes = EventConstants.topLevelTypes;
9761
9762 var eventTypes = {
9763 change: {
9764 phasedRegistrationNames: {
9765 bubbled: keyOf({onChange: null}),
9766 captured: keyOf({onChangeCapture: null})
9767 },
9768 dependencies: [
9769 topLevelTypes.topBlur,
9770 topLevelTypes.topChange,
9771 topLevelTypes.topClick,
9772 topLevelTypes.topFocus,
9773 topLevelTypes.topInput,
9774 topLevelTypes.topKeyDown,
9775 topLevelTypes.topKeyUp,
9776 topLevelTypes.topSelectionChange
9777 ]
9778 }
9779 };
9780
9781 /**
9782 * For IE shims
9783 */
9784 var activeElement = null;
9785 var activeElementID = null;
9786 var activeElementValue = null;
9787 var activeElementValueProp = null;
9788
9789 /**
9790 * SECTION: handle `change` event
9791 */
9792 function shouldUseChangeEvent(elem) {
9793 return (
9794 elem.nodeName === 'SELECT' ||
9795 (elem.nodeName === 'INPUT' && elem.type === 'file')
9796 );
9797 }
9798
9799 var doesChangeEventBubble = false;
9800 if (ExecutionEnvironment.canUseDOM) {
9801 // See `handleChange` comment below
9802 doesChangeEventBubble = isEventSupported('change') && (
9803 !('documentMode' in document) || document.documentMode > 8
9804 );
9805 }
9806
9807 function manualDispatchChangeEvent(nativeEvent) {
9808 var event = SyntheticEvent.getPooled(
9809 eventTypes.change,
9810 activeElementID,
9811 nativeEvent
9812 );
9813 EventPropagators.accumulateTwoPhaseDispatches(event);
9814
9815 // If change and propertychange bubbled, we'd just bind to it like all the
9816 // other events and have it go through ReactBrowserEventEmitter. Since it
9817 // doesn't, we manually listen for the events and so we have to enqueue and
9818 // process the abstract event manually.
9819 //
9820 // Batching is necessary here in order to ensure that all event handlers run
9821 // before the next rerender (including event handlers attached to ancestor
9822 // elements instead of directly on the input). Without this, controlled
9823 // components don't work properly in conjunction with event bubbling because
9824 // the component is rerendered and the value reverted before all the event
9825 // handlers can run. See https://github.com/facebook/react/issues/708.
9826 ReactUpdates.batchedUpdates(runEventInBatch, event);
9827 }
9828
9829 function runEventInBatch(event) {
9830 EventPluginHub.enqueueEvents(event);
9831 EventPluginHub.processEventQueue();
9832 }
9833
9834 function startWatchingForChangeEventIE8(target, targetID) {
9835 activeElement = target;
9836 activeElementID = targetID;
9837 activeElement.attachEvent('onchange', manualDispatchChangeEvent);
9838 }
9839
9840 function stopWatchingForChangeEventIE8() {
9841 if (!activeElement) {
9842 return;
9843 }
9844 activeElement.detachEvent('onchange', manualDispatchChangeEvent);
9845 activeElement = null;
9846 activeElementID = null;
9847 }
9848
9849 function getTargetIDForChangeEvent(
9850 topLevelType,
9851 topLevelTarget,
9852 topLevelTargetID) {
9853 if (topLevelType === topLevelTypes.topChange) {
9854 return topLevelTargetID;
9855 }
9856 }
9857 function handleEventsForChangeEventIE8(
9858 topLevelType,
9859 topLevelTarget,
9860 topLevelTargetID) {
9861 if (topLevelType === topLevelTypes.topFocus) {
9862 // stopWatching() should be a noop here but we call it just in case we
9863 // missed a blur event somehow.
9864 stopWatchingForChangeEventIE8();
9865 startWatchingForChangeEventIE8(topLevelTarget, topLevelTargetID);
9866 } else if (topLevelType === topLevelTypes.topBlur) {
9867 stopWatchingForChangeEventIE8();
9868 }
9869 }
9870
9871
9872 /**
9873 * SECTION: handle `input` event
9874 */
9875 var isInputEventSupported = false;
9876 if (ExecutionEnvironment.canUseDOM) {
9877 // IE9 claims to support the input event but fails to trigger it when
9878 // deleting text, so we ignore its input events
9879 isInputEventSupported = isEventSupported('input') && (
9880 !('documentMode' in document) || document.documentMode > 9
9881 );
9882 }
9883
9884 /**
9885 * (For old IE.) Replacement getter/setter for the `value` property that gets
9886 * set on the active element.
9887 */
9888 var newValueProp = {
9889 get: function() {
9890 return activeElementValueProp.get.call(this);
9891 },
9892 set: function(val) {
9893 // Cast to a string so we can do equality checks.
9894 activeElementValue = '' + val;
9895 activeElementValueProp.set.call(this, val);
9896 }
9897 };
9898
9899 /**
9900 * (For old IE.) Starts tracking propertychange events on the passed-in element
9901 * and override the value property so that we can distinguish user events from
9902 * value changes in JS.
9903 */
9904 function startWatchingForValueChange(target, targetID) {
9905 activeElement = target;
9906 activeElementID = targetID;
9907 activeElementValue = target.value;
9908 activeElementValueProp = Object.getOwnPropertyDescriptor(
9909 target.constructor.prototype,
9910 'value'
9911 );
9912
9913 Object.defineProperty(activeElement, 'value', newValueProp);
9914 activeElement.attachEvent('onpropertychange', handlePropertyChange);
9915 }
9916
9917 /**
9918 * (For old IE.) Removes the event listeners from the currently-tracked element,
9919 * if any exists.
9920 */
9921 function stopWatchingForValueChange() {
9922 if (!activeElement) {
9923 return;
9924 }
9925
9926 // delete restores the original property definition
9927 delete activeElement.value;
9928 activeElement.detachEvent('onpropertychange', handlePropertyChange);
9929
9930 activeElement = null;
9931 activeElementID = null;
9932 activeElementValue = null;
9933 activeElementValueProp = null;
9934 }
9935
9936 /**
9937 * (For old IE.) Handles a propertychange event, sending a `change` event if
9938 * the value of the active element has changed.
9939 */
9940 function handlePropertyChange(nativeEvent) {
9941 if (nativeEvent.propertyName !== 'value') {
9942 return;
9943 }
9944 var value = nativeEvent.srcElement.value;
9945 if (value === activeElementValue) {
9946 return;
9947 }
9948 activeElementValue = value;
9949
9950 manualDispatchChangeEvent(nativeEvent);
9951 }
9952
9953 /**
9954 * If a `change` event should be fired, returns the target's ID.
9955 */
9956 function getTargetIDForInputEvent(
9957 topLevelType,
9958 topLevelTarget,
9959 topLevelTargetID) {
9960 if (topLevelType === topLevelTypes.topInput) {
9961 // In modern browsers (i.e., not IE8 or IE9), the input event is exactly
9962 // what we want so fall through here and trigger an abstract event
9963 return topLevelTargetID;
9964 }
9965 }
9966
9967 // For IE8 and IE9.
9968 function handleEventsForInputEventIE(
9969 topLevelType,
9970 topLevelTarget,
9971 topLevelTargetID) {
9972 if (topLevelType === topLevelTypes.topFocus) {
9973 // In IE8, we can capture almost all .value changes by adding a
9974 // propertychange handler and looking for events with propertyName
9975 // equal to 'value'
9976 // In IE9, propertychange fires for most input events but is buggy and
9977 // doesn't fire when text is deleted, but conveniently, selectionchange
9978 // appears to fire in all of the remaining cases so we catch those and
9979 // forward the event if the value has changed
9980 // In either case, we don't want to call the event handler if the value
9981 // is changed from JS so we redefine a setter for `.value` that updates
9982 // our activeElementValue variable, allowing us to ignore those changes
9983 //
9984 // stopWatching() should be a noop here but we call it just in case we
9985 // missed a blur event somehow.
9986 stopWatchingForValueChange();
9987 startWatchingForValueChange(topLevelTarget, topLevelTargetID);
9988 } else if (topLevelType === topLevelTypes.topBlur) {
9989 stopWatchingForValueChange();
9990 }
9991 }
9992
9993 // For IE8 and IE9.
9994 function getTargetIDForInputEventIE(
9995 topLevelType,
9996 topLevelTarget,
9997 topLevelTargetID) {
9998 if (topLevelType === topLevelTypes.topSelectionChange ||
9999 topLevelType === topLevelTypes.topKeyUp ||
10000 topLevelType === topLevelTypes.topKeyDown) {
10001 // On the selectionchange event, the target is just document which isn't
10002 // helpful for us so just check activeElement instead.
10003 //
10004 // 99% of the time, keydown and keyup aren't necessary. IE8 fails to fire
10005 // propertychange on the first input event after setting `value` from a
10006 // script and fires only keydown, keypress, keyup. Catching keyup usually
10007 // gets it and catching keydown lets us fire an event for the first
10008 // keystroke if user does a key repeat (it'll be a little delayed: right
10009 // before the second keystroke). Other input methods (e.g., paste) seem to
10010 // fire selectionchange normally.
10011 if (activeElement && activeElement.value !== activeElementValue) {
10012 activeElementValue = activeElement.value;
10013 return activeElementID;
10014 }
10015 }
10016 }
10017
10018
10019 /**
10020 * SECTION: handle `click` event
10021 */
10022 function shouldUseClickEvent(elem) {
10023 // Use the `click` event to detect changes to checkbox and radio inputs.
10024 // This approach works across all browsers, whereas `change` does not fire
10025 // until `blur` in IE8.
10026 return (
10027 elem.nodeName === 'INPUT' &&
10028 (elem.type === 'checkbox' || elem.type === 'radio')
10029 );
10030 }
10031
10032 function getTargetIDForClickEvent(
10033 topLevelType,
10034 topLevelTarget,
10035 topLevelTargetID) {
10036 if (topLevelType === topLevelTypes.topClick) {
10037 return topLevelTargetID;
10038 }
10039 }
10040
10041 /**
10042 * This plugin creates an `onChange` event that normalizes change events
10043 * across form elements. This event fires at a time when it's possible to
10044 * change the element's value without seeing a flicker.
10045 *
10046 * Supported elements are:
10047 * - input (see `isTextInputElement`)
10048 * - textarea
10049 * - select
10050 */
10051 var ChangeEventPlugin = {
10052
10053 eventTypes: eventTypes,
10054
10055 /**
10056 * @param {string} topLevelType Record from `EventConstants`.
10057 * @param {DOMEventTarget} topLevelTarget The listening component root node.
10058 * @param {string} topLevelTargetID ID of `topLevelTarget`.
10059 * @param {object} nativeEvent Native browser event.
10060 * @return {*} An accumulation of synthetic events.
10061 * @see {EventPluginHub.extractEvents}
10062 */
10063 extractEvents: function(
10064 topLevelType,
10065 topLevelTarget,
10066 topLevelTargetID,
10067 nativeEvent) {
10068
10069 var getTargetIDFunc, handleEventFunc;
10070 if (shouldUseChangeEvent(topLevelTarget)) {
10071 if (doesChangeEventBubble) {
10072 getTargetIDFunc = getTargetIDForChangeEvent;
10073 } else {
10074 handleEventFunc = handleEventsForChangeEventIE8;
10075 }
10076 } else if (isTextInputElement(topLevelTarget)) {
10077 if (isInputEventSupported) {
10078 getTargetIDFunc = getTargetIDForInputEvent;
10079 } else {
10080 getTargetIDFunc = getTargetIDForInputEventIE;
10081 handleEventFunc = handleEventsForInputEventIE;
10082 }
10083 } else if (shouldUseClickEvent(topLevelTarget)) {
10084 getTargetIDFunc = getTargetIDForClickEvent;
10085 }
10086
10087 if (getTargetIDFunc) {
10088 var targetID = getTargetIDFunc(
10089 topLevelType,
10090 topLevelTarget,
10091 topLevelTargetID
10092 );
10093 if (targetID) {
10094 var event = SyntheticEvent.getPooled(
10095 eventTypes.change,
10096 targetID,
10097 nativeEvent
10098 );
10099 EventPropagators.accumulateTwoPhaseDispatches(event);
10100 return event;
10101 }
10102 }
10103
10104 if (handleEventFunc) {
10105 handleEventFunc(
10106 topLevelType,
10107 topLevelTarget,
10108 topLevelTargetID
10109 );
10110 }
10111 }
10112
10113 };
10114
10115 module.exports = ChangeEventPlugin;
10116
10117
10118/***/ },
10119/* 55 */
10120/***/ function(module, exports, __webpack_require__) {
10121
10122 /**
10123 * Copyright 2013-2014, Facebook, Inc.
10124 * All rights reserved.
10125 *
10126 * This source code is licensed under the BSD-style license found in the
10127 * LICENSE file in the root directory of this source tree. An additional grant
10128 * of patent rights can be found in the PATENTS file in the same directory.
10129 *
10130 * @providesModule ClientReactRootIndex
10131 * @typechecks
10132 */
10133
10134 "use strict";
10135
10136 var nextReactRootIndex = 0;
10137
10138 var ClientReactRootIndex = {
10139 createReactRootIndex: function() {
10140 return nextReactRootIndex++;
10141 }
10142 };
10143
10144 module.exports = ClientReactRootIndex;
10145
10146
10147/***/ },
10148/* 56 */
10149/***/ function(module, exports, __webpack_require__) {
10150
10151 /**
10152 * Copyright 2013-2014, Facebook, Inc.
10153 * All rights reserved.
10154 *
10155 * This source code is licensed under the BSD-style license found in the
10156 * LICENSE file in the root directory of this source tree. An additional grant
10157 * of patent rights can be found in the PATENTS file in the same directory.
10158 *
10159 * @providesModule CompositionEventPlugin
10160 * @typechecks static-only
10161 */
10162
10163 "use strict";
10164
10165 var EventConstants = __webpack_require__(32);
10166 var EventPropagators = __webpack_require__(99);
10167 var ExecutionEnvironment = __webpack_require__(26);
10168 var ReactInputSelection = __webpack_require__(103);
10169 var SyntheticCompositionEvent = __webpack_require__(104);
10170
10171 var getTextContentAccessor = __webpack_require__(105);
10172 var keyOf = __webpack_require__(45);
10173
10174 var END_KEYCODES = [9, 13, 27, 32]; // Tab, Return, Esc, Space
10175 var START_KEYCODE = 229;
10176
10177 var useCompositionEvent = (
10178 ExecutionEnvironment.canUseDOM &&
10179 'CompositionEvent' in window
10180 );
10181
10182 // In IE9+, we have access to composition events, but the data supplied
10183 // by the native compositionend event may be incorrect. In Korean, for example,
10184 // the compositionend event contains only one character regardless of
10185 // how many characters have been composed since compositionstart.
10186 // We therefore use the fallback data while still using the native
10187 // events as triggers.
10188 var useFallbackData = (
10189 !useCompositionEvent ||
10190 (
10191 'documentMode' in document &&
10192 document.documentMode > 8 &&
10193 document.documentMode <= 11
10194 )
10195 );
10196
10197 var topLevelTypes = EventConstants.topLevelTypes;
10198 var currentComposition = null;
10199
10200 // Events and their corresponding property names.
10201 var eventTypes = {
10202 compositionEnd: {
10203 phasedRegistrationNames: {
10204 bubbled: keyOf({onCompositionEnd: null}),
10205 captured: keyOf({onCompositionEndCapture: null})
10206 },
10207 dependencies: [
10208 topLevelTypes.topBlur,
10209 topLevelTypes.topCompositionEnd,
10210 topLevelTypes.topKeyDown,
10211 topLevelTypes.topKeyPress,
10212 topLevelTypes.topKeyUp,
10213 topLevelTypes.topMouseDown
10214 ]
10215 },
10216 compositionStart: {
10217 phasedRegistrationNames: {
10218 bubbled: keyOf({onCompositionStart: null}),
10219 captured: keyOf({onCompositionStartCapture: null})
10220 },
10221 dependencies: [
10222 topLevelTypes.topBlur,
10223 topLevelTypes.topCompositionStart,
10224 topLevelTypes.topKeyDown,
10225 topLevelTypes.topKeyPress,
10226 topLevelTypes.topKeyUp,
10227 topLevelTypes.topMouseDown
10228 ]
10229 },
10230 compositionUpdate: {
10231 phasedRegistrationNames: {
10232 bubbled: keyOf({onCompositionUpdate: null}),
10233 captured: keyOf({onCompositionUpdateCapture: null})
10234 },
10235 dependencies: [
10236 topLevelTypes.topBlur,
10237 topLevelTypes.topCompositionUpdate,
10238 topLevelTypes.topKeyDown,
10239 topLevelTypes.topKeyPress,
10240 topLevelTypes.topKeyUp,
10241 topLevelTypes.topMouseDown
10242 ]
10243 }
10244 };
10245
10246 /**
10247 * Translate native top level events into event types.
10248 *
10249 * @param {string} topLevelType
10250 * @return {object}
10251 */
10252 function getCompositionEventType(topLevelType) {
10253 switch (topLevelType) {
10254 case topLevelTypes.topCompositionStart:
10255 return eventTypes.compositionStart;
10256 case topLevelTypes.topCompositionEnd:
10257 return eventTypes.compositionEnd;
10258 case topLevelTypes.topCompositionUpdate:
10259 return eventTypes.compositionUpdate;
10260 }
10261 }
10262
10263 /**
10264 * Does our fallback best-guess model think this event signifies that
10265 * composition has begun?
10266 *
10267 * @param {string} topLevelType
10268 * @param {object} nativeEvent
10269 * @return {boolean}
10270 */
10271 function isFallbackStart(topLevelType, nativeEvent) {
10272 return (
10273 topLevelType === topLevelTypes.topKeyDown &&
10274 nativeEvent.keyCode === START_KEYCODE
10275 );
10276 }
10277
10278 /**
10279 * Does our fallback mode think that this event is the end of composition?
10280 *
10281 * @param {string} topLevelType
10282 * @param {object} nativeEvent
10283 * @return {boolean}
10284 */
10285 function isFallbackEnd(topLevelType, nativeEvent) {
10286 switch (topLevelType) {
10287 case topLevelTypes.topKeyUp:
10288 // Command keys insert or clear IME input.
10289 return (END_KEYCODES.indexOf(nativeEvent.keyCode) !== -1);
10290 case topLevelTypes.topKeyDown:
10291 // Expect IME keyCode on each keydown. If we get any other
10292 // code we must have exited earlier.
10293 return (nativeEvent.keyCode !== START_KEYCODE);
10294 case topLevelTypes.topKeyPress:
10295 case topLevelTypes.topMouseDown:
10296 case topLevelTypes.topBlur:
10297 // Events are not possible without cancelling IME.
10298 return true;
10299 default:
10300 return false;
10301 }
10302 }
10303
10304 /**
10305 * Helper class stores information about selection and document state
10306 * so we can figure out what changed at a later date.
10307 *
10308 * @param {DOMEventTarget} root
10309 */
10310 function FallbackCompositionState(root) {
10311 this.root = root;
10312 this.startSelection = ReactInputSelection.getSelection(root);
10313 this.startValue = this.getText();
10314 }
10315
10316 /**
10317 * Get current text of input.
10318 *
10319 * @return {string}
10320 */
10321 FallbackCompositionState.prototype.getText = function() {
10322 return this.root.value || this.root[getTextContentAccessor()];
10323 };
10324
10325 /**
10326 * Text that has changed since the start of composition.
10327 *
10328 * @return {string}
10329 */
10330 FallbackCompositionState.prototype.getData = function() {
10331 var endValue = this.getText();
10332 var prefixLength = this.startSelection.start;
10333 var suffixLength = this.startValue.length - this.startSelection.end;
10334
10335 return endValue.substr(
10336 prefixLength,
10337 endValue.length - suffixLength - prefixLength
10338 );
10339 };
10340
10341 /**
10342 * This plugin creates `onCompositionStart`, `onCompositionUpdate` and
10343 * `onCompositionEnd` events on inputs, textareas and contentEditable
10344 * nodes.
10345 */
10346 var CompositionEventPlugin = {
10347
10348 eventTypes: eventTypes,
10349
10350 /**
10351 * @param {string} topLevelType Record from `EventConstants`.
10352 * @param {DOMEventTarget} topLevelTarget The listening component root node.
10353 * @param {string} topLevelTargetID ID of `topLevelTarget`.
10354 * @param {object} nativeEvent Native browser event.
10355 * @return {*} An accumulation of synthetic events.
10356 * @see {EventPluginHub.extractEvents}
10357 */
10358 extractEvents: function(
10359 topLevelType,
10360 topLevelTarget,
10361 topLevelTargetID,
10362 nativeEvent) {
10363
10364 var eventType;
10365 var data;
10366
10367 if (useCompositionEvent) {
10368 eventType = getCompositionEventType(topLevelType);
10369 } else if (!currentComposition) {
10370 if (isFallbackStart(topLevelType, nativeEvent)) {
10371 eventType = eventTypes.compositionStart;
10372 }
10373 } else if (isFallbackEnd(topLevelType, nativeEvent)) {
10374 eventType = eventTypes.compositionEnd;
10375 }
10376
10377 if (useFallbackData) {
10378 // The current composition is stored statically and must not be
10379 // overwritten while composition continues.
10380 if (!currentComposition && eventType === eventTypes.compositionStart) {
10381 currentComposition = new FallbackCompositionState(topLevelTarget);
10382 } else if (eventType === eventTypes.compositionEnd) {
10383 if (currentComposition) {
10384 data = currentComposition.getData();
10385 currentComposition = null;
10386 }
10387 }
10388 }
10389
10390 if (eventType) {
10391 var event = SyntheticCompositionEvent.getPooled(
10392 eventType,
10393 topLevelTargetID,
10394 nativeEvent
10395 );
10396 if (data) {
10397 // Inject data generated from fallback path into the synthetic event.
10398 // This matches the property of native CompositionEventInterface.
10399 event.data = data;
10400 }
10401 EventPropagators.accumulateTwoPhaseDispatches(event);
10402 return event;
10403 }
10404 }
10405 };
10406
10407 module.exports = CompositionEventPlugin;
10408
10409
10410/***/ },
10411/* 57 */
10412/***/ function(module, exports, __webpack_require__) {
10413
10414 /**
10415 * Copyright 2013-2014, Facebook, Inc.
10416 * All rights reserved.
10417 *
10418 * This source code is licensed under the BSD-style license found in the
10419 * LICENSE file in the root directory of this source tree. An additional grant
10420 * of patent rights can be found in the PATENTS file in the same directory.
10421 *
10422 * @providesModule DefaultEventPluginOrder
10423 */
10424
10425 "use strict";
10426
10427 var keyOf = __webpack_require__(45);
10428
10429 /**
10430 * Module that is injectable into `EventPluginHub`, that specifies a
10431 * deterministic ordering of `EventPlugin`s. A convenient way to reason about
10432 * plugins, without having to package every one of them. This is better than
10433 * having plugins be ordered in the same order that they are injected because
10434 * that ordering would be influenced by the packaging order.
10435 * `ResponderEventPlugin` must occur before `SimpleEventPlugin` so that
10436 * preventing default on events is convenient in `SimpleEventPlugin` handlers.
10437 */
10438 var DefaultEventPluginOrder = [
10439 keyOf({ResponderEventPlugin: null}),
10440 keyOf({SimpleEventPlugin: null}),
10441 keyOf({TapEventPlugin: null}),
10442 keyOf({EnterLeaveEventPlugin: null}),
10443 keyOf({ChangeEventPlugin: null}),
10444 keyOf({SelectEventPlugin: null}),
10445 keyOf({CompositionEventPlugin: null}),
10446 keyOf({BeforeInputEventPlugin: null}),
10447 keyOf({AnalyticsEventPlugin: null}),
10448 keyOf({MobileSafariClickEventPlugin: null})
10449 ];
10450
10451 module.exports = DefaultEventPluginOrder;
10452
10453
10454/***/ },
10455/* 58 */
10456/***/ function(module, exports, __webpack_require__) {
10457
10458 /**
10459 * Copyright 2013-2014, Facebook, Inc.
10460 * All rights reserved.
10461 *
10462 * This source code is licensed under the BSD-style license found in the
10463 * LICENSE file in the root directory of this source tree. An additional grant
10464 * of patent rights can be found in the PATENTS file in the same directory.
10465 *
10466 * @providesModule EnterLeaveEventPlugin
10467 * @typechecks static-only
10468 */
10469
10470 "use strict";
10471
10472 var EventConstants = __webpack_require__(32);
10473 var EventPropagators = __webpack_require__(99);
10474 var SyntheticMouseEvent = __webpack_require__(106);
10475
10476 var ReactMount = __webpack_require__(17);
10477 var keyOf = __webpack_require__(45);
10478
10479 var topLevelTypes = EventConstants.topLevelTypes;
10480 var getFirstReactDOM = ReactMount.getFirstReactDOM;
10481
10482 var eventTypes = {
10483 mouseEnter: {
10484 registrationName: keyOf({onMouseEnter: null}),
10485 dependencies: [
10486 topLevelTypes.topMouseOut,
10487 topLevelTypes.topMouseOver
10488 ]
10489 },
10490 mouseLeave: {
10491 registrationName: keyOf({onMouseLeave: null}),
10492 dependencies: [
10493 topLevelTypes.topMouseOut,
10494 topLevelTypes.topMouseOver
10495 ]
10496 }
10497 };
10498
10499 var extractedEvents = [null, null];
10500
10501 var EnterLeaveEventPlugin = {
10502
10503 eventTypes: eventTypes,
10504
10505 /**
10506 * For almost every interaction we care about, there will be both a top-level
10507 * `mouseover` and `mouseout` event that occurs. Only use `mouseout` so that
10508 * we do not extract duplicate events. However, moving the mouse into the
10509 * browser from outside will not fire a `mouseout` event. In this case, we use
10510 * the `mouseover` top-level event.
10511 *
10512 * @param {string} topLevelType Record from `EventConstants`.
10513 * @param {DOMEventTarget} topLevelTarget The listening component root node.
10514 * @param {string} topLevelTargetID ID of `topLevelTarget`.
10515 * @param {object} nativeEvent Native browser event.
10516 * @return {*} An accumulation of synthetic events.
10517 * @see {EventPluginHub.extractEvents}
10518 */
10519 extractEvents: function(
10520 topLevelType,
10521 topLevelTarget,
10522 topLevelTargetID,
10523 nativeEvent) {
10524 if (topLevelType === topLevelTypes.topMouseOver &&
10525 (nativeEvent.relatedTarget || nativeEvent.fromElement)) {
10526 return null;
10527 }
10528 if (topLevelType !== topLevelTypes.topMouseOut &&
10529 topLevelType !== topLevelTypes.topMouseOver) {
10530 // Must not be a mouse in or mouse out - ignoring.
10531 return null;
10532 }
10533
10534 var win;
10535 if (topLevelTarget.window === topLevelTarget) {
10536 // `topLevelTarget` is probably a window object.
10537 win = topLevelTarget;
10538 } else {
10539 // TODO: Figure out why `ownerDocument` is sometimes undefined in IE8.
10540 var doc = topLevelTarget.ownerDocument;
10541 if (doc) {
10542 win = doc.defaultView || doc.parentWindow;
10543 } else {
10544 win = window;
10545 }
10546 }
10547
10548 var from, to;
10549 if (topLevelType === topLevelTypes.topMouseOut) {
10550 from = topLevelTarget;
10551 to =
10552 getFirstReactDOM(nativeEvent.relatedTarget || nativeEvent.toElement) ||
10553 win;
10554 } else {
10555 from = win;
10556 to = topLevelTarget;
10557 }
10558
10559 if (from === to) {
10560 // Nothing pertains to our managed components.
10561 return null;
10562 }
10563
10564 var fromID = from ? ReactMount.getID(from) : '';
10565 var toID = to ? ReactMount.getID(to) : '';
10566
10567 var leave = SyntheticMouseEvent.getPooled(
10568 eventTypes.mouseLeave,
10569 fromID,
10570 nativeEvent
10571 );
10572 leave.type = 'mouseleave';
10573 leave.target = from;
10574 leave.relatedTarget = to;
10575
10576 var enter = SyntheticMouseEvent.getPooled(
10577 eventTypes.mouseEnter,
10578 toID,
10579 nativeEvent
10580 );
10581 enter.type = 'mouseenter';
10582 enter.target = to;
10583 enter.relatedTarget = from;
10584
10585 EventPropagators.accumulateEnterLeaveDispatches(leave, enter, fromID, toID);
10586
10587 extractedEvents[0] = leave;
10588 extractedEvents[1] = enter;
10589
10590 return extractedEvents;
10591 }
10592
10593 };
10594
10595 module.exports = EnterLeaveEventPlugin;
10596
10597
10598/***/ },
10599/* 59 */
10600/***/ function(module, exports, __webpack_require__) {
10601
10602 /**
10603 * Copyright 2013-2014, Facebook, Inc.
10604 * All rights reserved.
10605 *
10606 * This source code is licensed under the BSD-style license found in the
10607 * LICENSE file in the root directory of this source tree. An additional grant
10608 * of patent rights can be found in the PATENTS file in the same directory.
10609 *
10610 * @providesModule HTMLDOMPropertyConfig
10611 */
10612
10613 /*jslint bitwise: true*/
10614
10615 "use strict";
10616
10617 var DOMProperty = __webpack_require__(28);
10618 var ExecutionEnvironment = __webpack_require__(26);
10619
10620 var MUST_USE_ATTRIBUTE = DOMProperty.injection.MUST_USE_ATTRIBUTE;
10621 var MUST_USE_PROPERTY = DOMProperty.injection.MUST_USE_PROPERTY;
10622 var HAS_BOOLEAN_VALUE = DOMProperty.injection.HAS_BOOLEAN_VALUE;
10623 var HAS_SIDE_EFFECTS = DOMProperty.injection.HAS_SIDE_EFFECTS;
10624 var HAS_NUMERIC_VALUE = DOMProperty.injection.HAS_NUMERIC_VALUE;
10625 var HAS_POSITIVE_NUMERIC_VALUE =
10626 DOMProperty.injection.HAS_POSITIVE_NUMERIC_VALUE;
10627 var HAS_OVERLOADED_BOOLEAN_VALUE =
10628 DOMProperty.injection.HAS_OVERLOADED_BOOLEAN_VALUE;
10629
10630 var hasSVG;
10631 if (ExecutionEnvironment.canUseDOM) {
10632 var implementation = document.implementation;
10633 hasSVG = (
10634 implementation &&
10635 implementation.hasFeature &&
10636 implementation.hasFeature(
10637 'http://www.w3.org/TR/SVG11/feature#BasicStructure',
10638 '1.1'
10639 )
10640 );
10641 }
10642
10643
10644 var HTMLDOMPropertyConfig = {
10645 isCustomAttribute: RegExp.prototype.test.bind(
10646 /^(data|aria)-[a-z_][a-z\d_.\-]*$/
10647 ),
10648 Properties: {
10649 /**
10650 * Standard Properties
10651 */
10652 accept: null,
10653 acceptCharset: null,
10654 accessKey: null,
10655 action: null,
10656 allowFullScreen: MUST_USE_ATTRIBUTE | HAS_BOOLEAN_VALUE,
10657 allowTransparency: MUST_USE_ATTRIBUTE,
10658 alt: null,
10659 async: HAS_BOOLEAN_VALUE,
10660 autoComplete: null,
10661 // autoFocus is polyfilled/normalized by AutoFocusMixin
10662 // autoFocus: HAS_BOOLEAN_VALUE,
10663 autoPlay: HAS_BOOLEAN_VALUE,
10664 cellPadding: null,
10665 cellSpacing: null,
10666 charSet: MUST_USE_ATTRIBUTE,
10667 checked: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
10668 classID: MUST_USE_ATTRIBUTE,
10669 // To set className on SVG elements, it's necessary to use .setAttribute;
10670 // this works on HTML elements too in all browsers except IE8. Conveniently,
10671 // IE8 doesn't support SVG and so we can simply use the attribute in
10672 // browsers that support SVG and the property in browsers that don't,
10673 // regardless of whether the element is HTML or SVG.
10674 className: hasSVG ? MUST_USE_ATTRIBUTE : MUST_USE_PROPERTY,
10675 cols: MUST_USE_ATTRIBUTE | HAS_POSITIVE_NUMERIC_VALUE,
10676 colSpan: null,
10677 content: null,
10678 contentEditable: null,
10679 contextMenu: MUST_USE_ATTRIBUTE,
10680 controls: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
10681 coords: null,
10682 crossOrigin: null,
10683 data: null, // For `<object />` acts as `src`.
10684 dateTime: MUST_USE_ATTRIBUTE,
10685 defer: HAS_BOOLEAN_VALUE,
10686 dir: null,
10687 disabled: MUST_USE_ATTRIBUTE | HAS_BOOLEAN_VALUE,
10688 download: HAS_OVERLOADED_BOOLEAN_VALUE,
10689 draggable: null,
10690 encType: null,
10691 form: MUST_USE_ATTRIBUTE,
10692 formAction: MUST_USE_ATTRIBUTE,
10693 formEncType: MUST_USE_ATTRIBUTE,
10694 formMethod: MUST_USE_ATTRIBUTE,
10695 formNoValidate: HAS_BOOLEAN_VALUE,
10696 formTarget: MUST_USE_ATTRIBUTE,
10697 frameBorder: MUST_USE_ATTRIBUTE,
10698 height: MUST_USE_ATTRIBUTE,
10699 hidden: MUST_USE_ATTRIBUTE | HAS_BOOLEAN_VALUE,
10700 href: null,
10701 hrefLang: null,
10702 htmlFor: null,
10703 httpEquiv: null,
10704 icon: null,
10705 id: MUST_USE_PROPERTY,
10706 label: null,
10707 lang: null,
10708 list: MUST_USE_ATTRIBUTE,
10709 loop: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
10710 manifest: MUST_USE_ATTRIBUTE,
10711 marginHeight: null,
10712 marginWidth: null,
10713 max: null,
10714 maxLength: MUST_USE_ATTRIBUTE,
10715 media: MUST_USE_ATTRIBUTE,
10716 mediaGroup: null,
10717 method: null,
10718 min: null,
10719 multiple: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
10720 muted: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
10721 name: null,
10722 noValidate: HAS_BOOLEAN_VALUE,
10723 open: null,
10724 pattern: null,
10725 placeholder: null,
10726 poster: null,
10727 preload: null,
10728 radioGroup: null,
10729 readOnly: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
10730 rel: null,
10731 required: HAS_BOOLEAN_VALUE,
10732 role: MUST_USE_ATTRIBUTE,
10733 rows: MUST_USE_ATTRIBUTE | HAS_POSITIVE_NUMERIC_VALUE,
10734 rowSpan: null,
10735 sandbox: null,
10736 scope: null,
10737 scrolling: null,
10738 seamless: MUST_USE_ATTRIBUTE | HAS_BOOLEAN_VALUE,
10739 selected: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
10740 shape: null,
10741 size: MUST_USE_ATTRIBUTE | HAS_POSITIVE_NUMERIC_VALUE,
10742 sizes: MUST_USE_ATTRIBUTE,
10743 span: HAS_POSITIVE_NUMERIC_VALUE,
10744 spellCheck: null,
10745 src: null,
10746 srcDoc: MUST_USE_PROPERTY,
10747 srcSet: MUST_USE_ATTRIBUTE,
10748 start: HAS_NUMERIC_VALUE,
10749 step: null,
10750 style: null,
10751 tabIndex: null,
10752 target: null,
10753 title: null,
10754 type: null,
10755 useMap: null,
10756 value: MUST_USE_PROPERTY | HAS_SIDE_EFFECTS,
10757 width: MUST_USE_ATTRIBUTE,
10758 wmode: MUST_USE_ATTRIBUTE,
10759
10760 /**
10761 * Non-standard Properties
10762 */
10763 autoCapitalize: null, // Supported in Mobile Safari for keyboard hints
10764 autoCorrect: null, // Supported in Mobile Safari for keyboard hints
10765 itemProp: MUST_USE_ATTRIBUTE, // Microdata: http://schema.org/docs/gs.html
10766 itemScope: MUST_USE_ATTRIBUTE | HAS_BOOLEAN_VALUE, // Microdata: http://schema.org/docs/gs.html
10767 itemType: MUST_USE_ATTRIBUTE, // Microdata: http://schema.org/docs/gs.html
10768 property: null // Supports OG in meta tags
10769 },
10770 DOMAttributeNames: {
10771 acceptCharset: 'accept-charset',
10772 className: 'class',
10773 htmlFor: 'for',
10774 httpEquiv: 'http-equiv'
10775 },
10776 DOMPropertyNames: {
10777 autoCapitalize: 'autocapitalize',
10778 autoComplete: 'autocomplete',
10779 autoCorrect: 'autocorrect',
10780 autoFocus: 'autofocus',
10781 autoPlay: 'autoplay',
10782 encType: 'enctype',
10783 hrefLang: 'hreflang',
10784 radioGroup: 'radiogroup',
10785 spellCheck: 'spellcheck',
10786 srcDoc: 'srcdoc',
10787 srcSet: 'srcset'
10788 }
10789 };
10790
10791 module.exports = HTMLDOMPropertyConfig;
10792
10793
10794/***/ },
10795/* 60 */
10796/***/ function(module, exports, __webpack_require__) {
10797
10798 /**
10799 * Copyright 2013-2014, Facebook, Inc.
10800 * All rights reserved.
10801 *
10802 * This source code is licensed under the BSD-style license found in the
10803 * LICENSE file in the root directory of this source tree. An additional grant
10804 * of patent rights can be found in the PATENTS file in the same directory.
10805 *
10806 * @providesModule MobileSafariClickEventPlugin
10807 * @typechecks static-only
10808 */
10809
10810 "use strict";
10811
10812 var EventConstants = __webpack_require__(32);
10813
10814 var emptyFunction = __webpack_require__(83);
10815
10816 var topLevelTypes = EventConstants.topLevelTypes;
10817
10818 /**
10819 * Mobile Safari does not fire properly bubble click events on non-interactive
10820 * elements, which means delegated click listeners do not fire. The workaround
10821 * for this bug involves attaching an empty click listener on the target node.
10822 *
10823 * This particular plugin works around the bug by attaching an empty click
10824 * listener on `touchstart` (which does fire on every element).
10825 */
10826 var MobileSafariClickEventPlugin = {
10827
10828 eventTypes: null,
10829
10830 /**
10831 * @param {string} topLevelType Record from `EventConstants`.
10832 * @param {DOMEventTarget} topLevelTarget The listening component root node.
10833 * @param {string} topLevelTargetID ID of `topLevelTarget`.
10834 * @param {object} nativeEvent Native browser event.
10835 * @return {*} An accumulation of synthetic events.
10836 * @see {EventPluginHub.extractEvents}
10837 */
10838 extractEvents: function(
10839 topLevelType,
10840 topLevelTarget,
10841 topLevelTargetID,
10842 nativeEvent) {
10843 if (topLevelType === topLevelTypes.topTouchStart) {
10844 var target = nativeEvent.target;
10845 if (target && !target.onclick) {
10846 target.onclick = emptyFunction;
10847 }
10848 }
10849 }
10850
10851 };
10852
10853 module.exports = MobileSafariClickEventPlugin;
10854
10855
10856/***/ },
10857/* 61 */
10858/***/ function(module, exports, __webpack_require__) {
10859
10860 /* WEBPACK VAR INJECTION */(function(process) {/**
10861 * Copyright 2013-2014, Facebook, Inc.
10862 * All rights reserved.
10863 *
10864 * This source code is licensed under the BSD-style license found in the
10865 * LICENSE file in the root directory of this source tree. An additional grant
10866 * of patent rights can be found in the PATENTS file in the same directory.
10867 *
10868 * @providesModule ReactComponentBrowserEnvironment
10869 */
10870
10871 /*jslint evil: true */
10872
10873 "use strict";
10874
10875 var ReactDOMIDOperations = __webpack_require__(107);
10876 var ReactMarkupChecksum = __webpack_require__(84);
10877 var ReactMount = __webpack_require__(17);
10878 var ReactPerf = __webpack_require__(19);
10879 var ReactReconcileTransaction = __webpack_require__(108);
10880
10881 var getReactRootElementInContainer = __webpack_require__(80);
10882 var invariant = __webpack_require__(33);
10883 var setInnerHTML = __webpack_require__(109);
10884
10885
10886 var ELEMENT_NODE_TYPE = 1;
10887 var DOC_NODE_TYPE = 9;
10888
10889
10890 /**
10891 * Abstracts away all functionality of `ReactComponent` requires knowledge of
10892 * the browser context.
10893 */
10894 var ReactComponentBrowserEnvironment = {
10895 ReactReconcileTransaction: ReactReconcileTransaction,
10896
10897 BackendIDOperations: ReactDOMIDOperations,
10898
10899 /**
10900 * If a particular environment requires that some resources be cleaned up,
10901 * specify this in the injected Mixin. In the DOM, we would likely want to
10902 * purge any cached node ID lookups.
10903 *
10904 * @private
10905 */
10906 unmountIDFromEnvironment: function(rootNodeID) {
10907 ReactMount.purgeID(rootNodeID);
10908 },
10909
10910 /**
10911 * @param {string} markup Markup string to place into the DOM Element.
10912 * @param {DOMElement} container DOM Element to insert markup into.
10913 * @param {boolean} shouldReuseMarkup Should reuse the existing markup in the
10914 * container if possible.
10915 */
10916 mountImageIntoNode: ReactPerf.measure(
10917 'ReactComponentBrowserEnvironment',
10918 'mountImageIntoNode',
10919 function(markup, container, shouldReuseMarkup) {
10920 ("production" !== process.env.NODE_ENV ? invariant(
10921 container && (
10922 container.nodeType === ELEMENT_NODE_TYPE ||
10923 container.nodeType === DOC_NODE_TYPE
10924 ),
10925 'mountComponentIntoNode(...): Target container is not valid.'
10926 ) : invariant(container && (
10927 container.nodeType === ELEMENT_NODE_TYPE ||
10928 container.nodeType === DOC_NODE_TYPE
10929 )));
10930
10931 if (shouldReuseMarkup) {
10932 if (ReactMarkupChecksum.canReuseMarkup(
10933 markup,
10934 getReactRootElementInContainer(container))) {
10935 return;
10936 } else {
10937 ("production" !== process.env.NODE_ENV ? invariant(
10938 container.nodeType !== DOC_NODE_TYPE,
10939 'You\'re trying to render a component to the document using ' +
10940 'server rendering but the checksum was invalid. This usually ' +
10941 'means you rendered a different component type or props on ' +
10942 'the client from the one on the server, or your render() ' +
10943 'methods are impure. React cannot handle this case due to ' +
10944 'cross-browser quirks by rendering at the document root. You ' +
10945 'should look for environment dependent code in your components ' +
10946 'and ensure the props are the same client and server side.'
10947 ) : invariant(container.nodeType !== DOC_NODE_TYPE));
10948
10949 if ("production" !== process.env.NODE_ENV) {
10950 console.warn(
10951 'React attempted to use reuse markup in a container but the ' +
10952 'checksum was invalid. This generally means that you are ' +
10953 'using server rendering and the markup generated on the ' +
10954 'server was not what the client was expecting. React injected ' +
10955 'new markup to compensate which works but you have lost many ' +
10956 'of the benefits of server rendering. Instead, figure out ' +
10957 'why the markup being generated is different on the client ' +
10958 'or server.'
10959 );
10960 }
10961 }
10962 }
10963
10964 ("production" !== process.env.NODE_ENV ? invariant(
10965 container.nodeType !== DOC_NODE_TYPE,
10966 'You\'re trying to render a component to the document but ' +
10967 'you didn\'t use server rendering. We can\'t do this ' +
10968 'without using server rendering due to cross-browser quirks. ' +
10969 'See renderComponentToString() for server rendering.'
10970 ) : invariant(container.nodeType !== DOC_NODE_TYPE));
10971
10972 setInnerHTML(container, markup);
10973 }
10974 )
10975 };
10976
10977 module.exports = ReactComponentBrowserEnvironment;
10978
10979 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(27)))
10980
10981/***/ },
10982/* 62 */
10983/***/ function(module, exports, __webpack_require__) {
10984
10985 /**
10986 * Copyright 2013-2014, Facebook, Inc.
10987 * All rights reserved.
10988 *
10989 * This source code is licensed under the BSD-style license found in the
10990 * LICENSE file in the root directory of this source tree. An additional grant
10991 * of patent rights can be found in the PATENTS file in the same directory.
10992 *
10993 * @providesModule ReactDefaultBatchingStrategy
10994 */
10995
10996 "use strict";
10997
10998 var ReactUpdates = __webpack_require__(42);
10999 var Transaction = __webpack_require__(89);
11000
11001 var assign = __webpack_require__(23);
11002 var emptyFunction = __webpack_require__(83);
11003
11004 var RESET_BATCHED_UPDATES = {
11005 initialize: emptyFunction,
11006 close: function() {
11007 ReactDefaultBatchingStrategy.isBatchingUpdates = false;
11008 }
11009 };
11010
11011 var FLUSH_BATCHED_UPDATES = {
11012 initialize: emptyFunction,
11013 close: ReactUpdates.flushBatchedUpdates.bind(ReactUpdates)
11014 };
11015
11016 var TRANSACTION_WRAPPERS = [FLUSH_BATCHED_UPDATES, RESET_BATCHED_UPDATES];
11017
11018 function ReactDefaultBatchingStrategyTransaction() {
11019 this.reinitializeTransaction();
11020 }
11021
11022 assign(
11023 ReactDefaultBatchingStrategyTransaction.prototype,
11024 Transaction.Mixin,
11025 {
11026 getTransactionWrappers: function() {
11027 return TRANSACTION_WRAPPERS;
11028 }
11029 }
11030 );
11031
11032 var transaction = new ReactDefaultBatchingStrategyTransaction();
11033
11034 var ReactDefaultBatchingStrategy = {
11035 isBatchingUpdates: false,
11036
11037 /**
11038 * Call the provided function in a context within which calls to `setState`
11039 * and friends are batched such that components aren't updated unnecessarily.
11040 */
11041 batchedUpdates: function(callback, a, b) {
11042 var alreadyBatchingUpdates = ReactDefaultBatchingStrategy.isBatchingUpdates;
11043
11044 ReactDefaultBatchingStrategy.isBatchingUpdates = true;
11045
11046 // The code is written this way to avoid extra allocations
11047 if (alreadyBatchingUpdates) {
11048 callback(a, b);
11049 } else {
11050 transaction.perform(callback, null, a, b);
11051 }
11052 }
11053 };
11054
11055 module.exports = ReactDefaultBatchingStrategy;
11056
11057
11058/***/ },
11059/* 63 */
11060/***/ function(module, exports, __webpack_require__) {
11061
11062 /**
11063 * Copyright 2013-2014, Facebook, Inc.
11064 * All rights reserved.
11065 *
11066 * This source code is licensed under the BSD-style license found in the
11067 * LICENSE file in the root directory of this source tree. An additional grant
11068 * of patent rights can be found in the PATENTS file in the same directory.
11069 *
11070 * @providesModule ReactDOMButton
11071 */
11072
11073 "use strict";
11074
11075 var AutoFocusMixin = __webpack_require__(110);
11076 var ReactBrowserComponentMixin = __webpack_require__(50);
11077 var ReactCompositeComponent = __webpack_require__(7);
11078 var ReactElement = __webpack_require__(10);
11079 var ReactDOM = __webpack_require__(12);
11080
11081 var keyMirror = __webpack_require__(44);
11082
11083 // Store a reference to the <button> `ReactDOMComponent`. TODO: use string
11084 var button = ReactElement.createFactory(ReactDOM.button.type);
11085
11086 var mouseListenerNames = keyMirror({
11087 onClick: true,
11088 onDoubleClick: true,
11089 onMouseDown: true,
11090 onMouseMove: true,
11091 onMouseUp: true,
11092 onClickCapture: true,
11093 onDoubleClickCapture: true,
11094 onMouseDownCapture: true,
11095 onMouseMoveCapture: true,
11096 onMouseUpCapture: true
11097 });
11098
11099 /**
11100 * Implements a <button> native component that does not receive mouse events
11101 * when `disabled` is set.
11102 */
11103 var ReactDOMButton = ReactCompositeComponent.createClass({
11104 displayName: 'ReactDOMButton',
11105
11106 mixins: [AutoFocusMixin, ReactBrowserComponentMixin],
11107
11108 render: function() {
11109 var props = {};
11110
11111 // Copy the props; except the mouse listeners if we're disabled
11112 for (var key in this.props) {
11113 if (this.props.hasOwnProperty(key) &&
11114 (!this.props.disabled || !mouseListenerNames[key])) {
11115 props[key] = this.props[key];
11116 }
11117 }
11118
11119 return button(props, this.props.children);
11120 }
11121
11122 });
11123
11124 module.exports = ReactDOMButton;
11125
11126
11127/***/ },
11128/* 64 */
11129/***/ function(module, exports, __webpack_require__) {
11130
11131 /**
11132 * Copyright 2013-2014, Facebook, Inc.
11133 * All rights reserved.
11134 *
11135 * This source code is licensed under the BSD-style license found in the
11136 * LICENSE file in the root directory of this source tree. An additional grant
11137 * of patent rights can be found in the PATENTS file in the same directory.
11138 *
11139 * @providesModule ReactDOMForm
11140 */
11141
11142 "use strict";
11143
11144 var EventConstants = __webpack_require__(32);
11145 var LocalEventTrapMixin = __webpack_require__(111);
11146 var ReactBrowserComponentMixin = __webpack_require__(50);
11147 var ReactCompositeComponent = __webpack_require__(7);
11148 var ReactElement = __webpack_require__(10);
11149 var ReactDOM = __webpack_require__(12);
11150
11151 // Store a reference to the <form> `ReactDOMComponent`. TODO: use string
11152 var form = ReactElement.createFactory(ReactDOM.form.type);
11153
11154 /**
11155 * Since onSubmit doesn't bubble OR capture on the top level in IE8, we need
11156 * to capture it on the <form> element itself. There are lots of hacks we could
11157 * do to accomplish this, but the most reliable is to make <form> a
11158 * composite component and use `componentDidMount` to attach the event handlers.
11159 */
11160 var ReactDOMForm = ReactCompositeComponent.createClass({
11161 displayName: 'ReactDOMForm',
11162
11163 mixins: [ReactBrowserComponentMixin, LocalEventTrapMixin],
11164
11165 render: function() {
11166 // TODO: Instead of using `ReactDOM` directly, we should use JSX. However,
11167 // `jshint` fails to parse JSX so in order for linting to work in the open
11168 // source repo, we need to just use `ReactDOM.form`.
11169 return form(this.props);
11170 },
11171
11172 componentDidMount: function() {
11173 this.trapBubbledEvent(EventConstants.topLevelTypes.topReset, 'reset');
11174 this.trapBubbledEvent(EventConstants.topLevelTypes.topSubmit, 'submit');
11175 }
11176 });
11177
11178 module.exports = ReactDOMForm;
11179
11180
11181/***/ },
11182/* 65 */
11183/***/ function(module, exports, __webpack_require__) {
11184
11185 /**
11186 * Copyright 2013-2014, Facebook, Inc.
11187 * All rights reserved.
11188 *
11189 * This source code is licensed under the BSD-style license found in the
11190 * LICENSE file in the root directory of this source tree. An additional grant
11191 * of patent rights can be found in the PATENTS file in the same directory.
11192 *
11193 * @providesModule ReactDOMImg
11194 */
11195
11196 "use strict";
11197
11198 var EventConstants = __webpack_require__(32);
11199 var LocalEventTrapMixin = __webpack_require__(111);
11200 var ReactBrowserComponentMixin = __webpack_require__(50);
11201 var ReactCompositeComponent = __webpack_require__(7);
11202 var ReactElement = __webpack_require__(10);
11203 var ReactDOM = __webpack_require__(12);
11204
11205 // Store a reference to the <img> `ReactDOMComponent`. TODO: use string
11206 var img = ReactElement.createFactory(ReactDOM.img.type);
11207
11208 /**
11209 * Since onLoad doesn't bubble OR capture on the top level in IE8, we need to
11210 * capture it on the <img> element itself. There are lots of hacks we could do
11211 * to accomplish this, but the most reliable is to make <img> a composite
11212 * component and use `componentDidMount` to attach the event handlers.
11213 */
11214 var ReactDOMImg = ReactCompositeComponent.createClass({
11215 displayName: 'ReactDOMImg',
11216 tagName: 'IMG',
11217
11218 mixins: [ReactBrowserComponentMixin, LocalEventTrapMixin],
11219
11220 render: function() {
11221 return img(this.props);
11222 },
11223
11224 componentDidMount: function() {
11225 this.trapBubbledEvent(EventConstants.topLevelTypes.topLoad, 'load');
11226 this.trapBubbledEvent(EventConstants.topLevelTypes.topError, 'error');
11227 }
11228 });
11229
11230 module.exports = ReactDOMImg;
11231
11232
11233/***/ },
11234/* 66 */
11235/***/ function(module, exports, __webpack_require__) {
11236
11237 /* WEBPACK VAR INJECTION */(function(process) {/**
11238 * Copyright 2013-2014, Facebook, Inc.
11239 * All rights reserved.
11240 *
11241 * This source code is licensed under the BSD-style license found in the
11242 * LICENSE file in the root directory of this source tree. An additional grant
11243 * of patent rights can be found in the PATENTS file in the same directory.
11244 *
11245 * @providesModule ReactDOMInput
11246 */
11247
11248 "use strict";
11249
11250 var AutoFocusMixin = __webpack_require__(110);
11251 var DOMPropertyOperations = __webpack_require__(3);
11252 var LinkedValueUtils = __webpack_require__(112);
11253 var ReactBrowserComponentMixin = __webpack_require__(50);
11254 var ReactCompositeComponent = __webpack_require__(7);
11255 var ReactElement = __webpack_require__(10);
11256 var ReactDOM = __webpack_require__(12);
11257 var ReactMount = __webpack_require__(17);
11258 var ReactUpdates = __webpack_require__(42);
11259
11260 var assign = __webpack_require__(23);
11261 var invariant = __webpack_require__(33);
11262
11263 // Store a reference to the <input> `ReactDOMComponent`. TODO: use string
11264 var input = ReactElement.createFactory(ReactDOM.input.type);
11265
11266 var instancesByReactID = {};
11267
11268 function forceUpdateIfMounted() {
11269 /*jshint validthis:true */
11270 if (this.isMounted()) {
11271 this.forceUpdate();
11272 }
11273 }
11274
11275 /**
11276 * Implements an <input> native component that allows setting these optional
11277 * props: `checked`, `value`, `defaultChecked`, and `defaultValue`.
11278 *
11279 * If `checked` or `value` are not supplied (or null/undefined), user actions
11280 * that affect the checked state or value will trigger updates to the element.
11281 *
11282 * If they are supplied (and not null/undefined), the rendered element will not
11283 * trigger updates to the element. Instead, the props must change in order for
11284 * the rendered element to be updated.
11285 *
11286 * The rendered element will be initialized as unchecked (or `defaultChecked`)
11287 * with an empty value (or `defaultValue`).
11288 *
11289 * @see http://www.w3.org/TR/2012/WD-html5-20121025/the-input-element.html
11290 */
11291 var ReactDOMInput = ReactCompositeComponent.createClass({
11292 displayName: 'ReactDOMInput',
11293
11294 mixins: [AutoFocusMixin, LinkedValueUtils.Mixin, ReactBrowserComponentMixin],
11295
11296 getInitialState: function() {
11297 var defaultValue = this.props.defaultValue;
11298 return {
11299 initialChecked: this.props.defaultChecked || false,
11300 initialValue: defaultValue != null ? defaultValue : null
11301 };
11302 },
11303
11304 render: function() {
11305 // Clone `this.props` so we don't mutate the input.
11306 var props = assign({}, this.props);
11307
11308 props.defaultChecked = null;
11309 props.defaultValue = null;
11310
11311 var value = LinkedValueUtils.getValue(this);
11312 props.value = value != null ? value : this.state.initialValue;
11313
11314 var checked = LinkedValueUtils.getChecked(this);
11315 props.checked = checked != null ? checked : this.state.initialChecked;
11316
11317 props.onChange = this._handleChange;
11318
11319 return input(props, this.props.children);
11320 },
11321
11322 componentDidMount: function() {
11323 var id = ReactMount.getID(this.getDOMNode());
11324 instancesByReactID[id] = this;
11325 },
11326
11327 componentWillUnmount: function() {
11328 var rootNode = this.getDOMNode();
11329 var id = ReactMount.getID(rootNode);
11330 delete instancesByReactID[id];
11331 },
11332
11333 componentDidUpdate: function(prevProps, prevState, prevContext) {
11334 var rootNode = this.getDOMNode();
11335 if (this.props.checked != null) {
11336 DOMPropertyOperations.setValueForProperty(
11337 rootNode,
11338 'checked',
11339 this.props.checked || false
11340 );
11341 }
11342
11343 var value = LinkedValueUtils.getValue(this);
11344 if (value != null) {
11345 // Cast `value` to a string to ensure the value is set correctly. While
11346 // browsers typically do this as necessary, jsdom doesn't.
11347 DOMPropertyOperations.setValueForProperty(rootNode, 'value', '' + value);
11348 }
11349 },
11350
11351 _handleChange: function(event) {
11352 var returnValue;
11353 var onChange = LinkedValueUtils.getOnChange(this);
11354 if (onChange) {
11355 returnValue = onChange.call(this, event);
11356 }
11357 // Here we use asap to wait until all updates have propagated, which
11358 // is important when using controlled components within layers:
11359 // https://github.com/facebook/react/issues/1698
11360 ReactUpdates.asap(forceUpdateIfMounted, this);
11361
11362 var name = this.props.name;
11363 if (this.props.type === 'radio' && name != null) {
11364 var rootNode = this.getDOMNode();
11365 var queryRoot = rootNode;
11366
11367 while (queryRoot.parentNode) {
11368 queryRoot = queryRoot.parentNode;
11369 }
11370
11371 // If `rootNode.form` was non-null, then we could try `form.elements`,
11372 // but that sometimes behaves strangely in IE8. We could also try using
11373 // `form.getElementsByName`, but that will only return direct children
11374 // and won't include inputs that use the HTML5 `form=` attribute. Since
11375 // the input might not even be in a form, let's just use the global
11376 // `querySelectorAll` to ensure we don't miss anything.
11377 var group = queryRoot.querySelectorAll(
11378 'input[name=' + JSON.stringify('' + name) + '][type="radio"]');
11379
11380 for (var i = 0, groupLen = group.length; i < groupLen; i++) {
11381 var otherNode = group[i];
11382 if (otherNode === rootNode ||
11383 otherNode.form !== rootNode.form) {
11384 continue;
11385 }
11386 var otherID = ReactMount.getID(otherNode);
11387 ("production" !== process.env.NODE_ENV ? invariant(
11388 otherID,
11389 'ReactDOMInput: Mixing React and non-React radio inputs with the ' +
11390 'same `name` is not supported.'
11391 ) : invariant(otherID));
11392 var otherInstance = instancesByReactID[otherID];
11393 ("production" !== process.env.NODE_ENV ? invariant(
11394 otherInstance,
11395 'ReactDOMInput: Unknown radio button ID %s.',
11396 otherID
11397 ) : invariant(otherInstance));
11398 // If this is a controlled radio button group, forcing the input that
11399 // was previously checked to update will cause it to be come re-checked
11400 // as appropriate.
11401 ReactUpdates.asap(forceUpdateIfMounted, otherInstance);
11402 }
11403 }
11404
11405 return returnValue;
11406 }
11407
11408 });
11409
11410 module.exports = ReactDOMInput;
11411
11412 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(27)))
11413
11414/***/ },
11415/* 67 */
11416/***/ function(module, exports, __webpack_require__) {
11417
11418 /* WEBPACK VAR INJECTION */(function(process) {/**
11419 * Copyright 2013-2014, Facebook, Inc.
11420 * All rights reserved.
11421 *
11422 * This source code is licensed under the BSD-style license found in the
11423 * LICENSE file in the root directory of this source tree. An additional grant
11424 * of patent rights can be found in the PATENTS file in the same directory.
11425 *
11426 * @providesModule ReactDOMOption
11427 */
11428
11429 "use strict";
11430
11431 var ReactBrowserComponentMixin = __webpack_require__(50);
11432 var ReactCompositeComponent = __webpack_require__(7);
11433 var ReactElement = __webpack_require__(10);
11434 var ReactDOM = __webpack_require__(12);
11435
11436 var warning = __webpack_require__(31);
11437
11438 // Store a reference to the <option> `ReactDOMComponent`. TODO: use string
11439 var option = ReactElement.createFactory(ReactDOM.option.type);
11440
11441 /**
11442 * Implements an <option> native component that warns when `selected` is set.
11443 */
11444 var ReactDOMOption = ReactCompositeComponent.createClass({
11445 displayName: 'ReactDOMOption',
11446
11447 mixins: [ReactBrowserComponentMixin],
11448
11449 componentWillMount: function() {
11450 // TODO (yungsters): Remove support for `selected` in <option>.
11451 if ("production" !== process.env.NODE_ENV) {
11452 ("production" !== process.env.NODE_ENV ? warning(
11453 this.props.selected == null,
11454 'Use the `defaultValue` or `value` props on <select> instead of ' +
11455 'setting `selected` on <option>.'
11456 ) : null);
11457 }
11458 },
11459
11460 render: function() {
11461 return option(this.props, this.props.children);
11462 }
11463
11464 });
11465
11466 module.exports = ReactDOMOption;
11467
11468 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(27)))
11469
11470/***/ },
11471/* 68 */
11472/***/ function(module, exports, __webpack_require__) {
11473
11474 /**
11475 * Copyright 2013-2014, Facebook, Inc.
11476 * All rights reserved.
11477 *
11478 * This source code is licensed under the BSD-style license found in the
11479 * LICENSE file in the root directory of this source tree. An additional grant
11480 * of patent rights can be found in the PATENTS file in the same directory.
11481 *
11482 * @providesModule ReactDOMSelect
11483 */
11484
11485 "use strict";
11486
11487 var AutoFocusMixin = __webpack_require__(110);
11488 var LinkedValueUtils = __webpack_require__(112);
11489 var ReactBrowserComponentMixin = __webpack_require__(50);
11490 var ReactCompositeComponent = __webpack_require__(7);
11491 var ReactElement = __webpack_require__(10);
11492 var ReactDOM = __webpack_require__(12);
11493 var ReactUpdates = __webpack_require__(42);
11494
11495 var assign = __webpack_require__(23);
11496
11497 // Store a reference to the <select> `ReactDOMComponent`. TODO: use string
11498 var select = ReactElement.createFactory(ReactDOM.select.type);
11499
11500 function updateWithPendingValueIfMounted() {
11501 /*jshint validthis:true */
11502 if (this.isMounted()) {
11503 this.setState({value: this._pendingValue});
11504 this._pendingValue = 0;
11505 }
11506 }
11507
11508 /**
11509 * Validation function for `value` and `defaultValue`.
11510 * @private
11511 */
11512 function selectValueType(props, propName, componentName) {
11513 if (props[propName] == null) {
11514 return;
11515 }
11516 if (props.multiple) {
11517 if (!Array.isArray(props[propName])) {
11518 return new Error(
11519 ("The `" + propName + "` prop supplied to <select> must be an array if ") +
11520 ("`multiple` is true.")
11521 );
11522 }
11523 } else {
11524 if (Array.isArray(props[propName])) {
11525 return new Error(
11526 ("The `" + propName + "` prop supplied to <select> must be a scalar ") +
11527 ("value if `multiple` is false.")
11528 );
11529 }
11530 }
11531 }
11532
11533 /**
11534 * If `value` is supplied, updates <option> elements on mount and update.
11535 * @param {ReactComponent} component Instance of ReactDOMSelect
11536 * @param {?*} propValue For uncontrolled components, null/undefined. For
11537 * controlled components, a string (or with `multiple`, a list of strings).
11538 * @private
11539 */
11540 function updateOptions(component, propValue) {
11541 var multiple = component.props.multiple;
11542 var value = propValue != null ? propValue : component.state.value;
11543 var options = component.getDOMNode().options;
11544 var selectedValue, i, l;
11545 if (multiple) {
11546 selectedValue = {};
11547 for (i = 0, l = value.length; i < l; ++i) {
11548 selectedValue['' + value[i]] = true;
11549 }
11550 } else {
11551 selectedValue = '' + value;
11552 }
11553 for (i = 0, l = options.length; i < l; i++) {
11554 var selected = multiple ?
11555 selectedValue.hasOwnProperty(options[i].value) :
11556 options[i].value === selectedValue;
11557
11558 if (selected !== options[i].selected) {
11559 options[i].selected = selected;
11560 }
11561 }
11562 }
11563
11564 /**
11565 * Implements a <select> native component that allows optionally setting the
11566 * props `value` and `defaultValue`. If `multiple` is false, the prop must be a
11567 * string. If `multiple` is true, the prop must be an array of strings.
11568 *
11569 * If `value` is not supplied (or null/undefined), user actions that change the
11570 * selected option will trigger updates to the rendered options.
11571 *
11572 * If it is supplied (and not null/undefined), the rendered options will not
11573 * update in response to user actions. Instead, the `value` prop must change in
11574 * order for the rendered options to update.
11575 *
11576 * If `defaultValue` is provided, any options with the supplied values will be
11577 * selected.
11578 */
11579 var ReactDOMSelect = ReactCompositeComponent.createClass({
11580 displayName: 'ReactDOMSelect',
11581
11582 mixins: [AutoFocusMixin, LinkedValueUtils.Mixin, ReactBrowserComponentMixin],
11583
11584 propTypes: {
11585 defaultValue: selectValueType,
11586 value: selectValueType
11587 },
11588
11589 getInitialState: function() {
11590 return {value: this.props.defaultValue || (this.props.multiple ? [] : '')};
11591 },
11592
11593 componentWillMount: function() {
11594 this._pendingValue = null;
11595 },
11596
11597 componentWillReceiveProps: function(nextProps) {
11598 if (!this.props.multiple && nextProps.multiple) {
11599 this.setState({value: [this.state.value]});
11600 } else if (this.props.multiple && !nextProps.multiple) {
11601 this.setState({value: this.state.value[0]});
11602 }
11603 },
11604
11605 render: function() {
11606 // Clone `this.props` so we don't mutate the input.
11607 var props = assign({}, this.props);
11608
11609 props.onChange = this._handleChange;
11610 props.value = null;
11611
11612 return select(props, this.props.children);
11613 },
11614
11615 componentDidMount: function() {
11616 updateOptions(this, LinkedValueUtils.getValue(this));
11617 },
11618
11619 componentDidUpdate: function(prevProps) {
11620 var value = LinkedValueUtils.getValue(this);
11621 var prevMultiple = !!prevProps.multiple;
11622 var multiple = !!this.props.multiple;
11623 if (value != null || prevMultiple !== multiple) {
11624 updateOptions(this, value);
11625 }
11626 },
11627
11628 _handleChange: function(event) {
11629 var returnValue;
11630 var onChange = LinkedValueUtils.getOnChange(this);
11631 if (onChange) {
11632 returnValue = onChange.call(this, event);
11633 }
11634
11635 var selectedValue;
11636 if (this.props.multiple) {
11637 selectedValue = [];
11638 var options = event.target.options;
11639 for (var i = 0, l = options.length; i < l; i++) {
11640 if (options[i].selected) {
11641 selectedValue.push(options[i].value);
11642 }
11643 }
11644 } else {
11645 selectedValue = event.target.value;
11646 }
11647
11648 this._pendingValue = selectedValue;
11649 ReactUpdates.asap(updateWithPendingValueIfMounted, this);
11650 return returnValue;
11651 }
11652
11653 });
11654
11655 module.exports = ReactDOMSelect;
11656
11657
11658/***/ },
11659/* 69 */
11660/***/ function(module, exports, __webpack_require__) {
11661
11662 /* WEBPACK VAR INJECTION */(function(process) {/**
11663 * Copyright 2013-2014, Facebook, Inc.
11664 * All rights reserved.
11665 *
11666 * This source code is licensed under the BSD-style license found in the
11667 * LICENSE file in the root directory of this source tree. An additional grant
11668 * of patent rights can be found in the PATENTS file in the same directory.
11669 *
11670 * @providesModule ReactDOMTextarea
11671 */
11672
11673 "use strict";
11674
11675 var AutoFocusMixin = __webpack_require__(110);
11676 var DOMPropertyOperations = __webpack_require__(3);
11677 var LinkedValueUtils = __webpack_require__(112);
11678 var ReactBrowserComponentMixin = __webpack_require__(50);
11679 var ReactCompositeComponent = __webpack_require__(7);
11680 var ReactElement = __webpack_require__(10);
11681 var ReactDOM = __webpack_require__(12);
11682 var ReactUpdates = __webpack_require__(42);
11683
11684 var assign = __webpack_require__(23);
11685 var invariant = __webpack_require__(33);
11686
11687 var warning = __webpack_require__(31);
11688
11689 // Store a reference to the <textarea> `ReactDOMComponent`. TODO: use string
11690 var textarea = ReactElement.createFactory(ReactDOM.textarea.type);
11691
11692 function forceUpdateIfMounted() {
11693 /*jshint validthis:true */
11694 if (this.isMounted()) {
11695 this.forceUpdate();
11696 }
11697 }
11698
11699 /**
11700 * Implements a <textarea> native component that allows setting `value`, and
11701 * `defaultValue`. This differs from the traditional DOM API because value is
11702 * usually set as PCDATA children.
11703 *
11704 * If `value` is not supplied (or null/undefined), user actions that affect the
11705 * value will trigger updates to the element.
11706 *
11707 * If `value` is supplied (and not null/undefined), the rendered element will
11708 * not trigger updates to the element. Instead, the `value` prop must change in
11709 * order for the rendered element to be updated.
11710 *
11711 * The rendered element will be initialized with an empty value, the prop
11712 * `defaultValue` if specified, or the children content (deprecated).
11713 */
11714 var ReactDOMTextarea = ReactCompositeComponent.createClass({
11715 displayName: 'ReactDOMTextarea',
11716
11717 mixins: [AutoFocusMixin, LinkedValueUtils.Mixin, ReactBrowserComponentMixin],
11718
11719 getInitialState: function() {
11720 var defaultValue = this.props.defaultValue;
11721 // TODO (yungsters): Remove support for children content in <textarea>.
11722 var children = this.props.children;
11723 if (children != null) {
11724 if ("production" !== process.env.NODE_ENV) {
11725 ("production" !== process.env.NODE_ENV ? warning(
11726 false,
11727 'Use the `defaultValue` or `value` props instead of setting ' +
11728 'children on <textarea>.'
11729 ) : null);
11730 }
11731 ("production" !== process.env.NODE_ENV ? invariant(
11732 defaultValue == null,
11733 'If you supply `defaultValue` on a <textarea>, do not pass children.'
11734 ) : invariant(defaultValue == null));
11735 if (Array.isArray(children)) {
11736 ("production" !== process.env.NODE_ENV ? invariant(
11737 children.length <= 1,
11738 '<textarea> can only have at most one child.'
11739 ) : invariant(children.length <= 1));
11740 children = children[0];
11741 }
11742
11743 defaultValue = '' + children;
11744 }
11745 if (defaultValue == null) {
11746 defaultValue = '';
11747 }
11748 var value = LinkedValueUtils.getValue(this);
11749 return {
11750 // We save the initial value so that `ReactDOMComponent` doesn't update
11751 // `textContent` (unnecessary since we update value).
11752 // The initial value can be a boolean or object so that's why it's
11753 // forced to be a string.
11754 initialValue: '' + (value != null ? value : defaultValue)
11755 };
11756 },
11757
11758 render: function() {
11759 // Clone `this.props` so we don't mutate the input.
11760 var props = assign({}, this.props);
11761
11762 ("production" !== process.env.NODE_ENV ? invariant(
11763 props.dangerouslySetInnerHTML == null,
11764 '`dangerouslySetInnerHTML` does not make sense on <textarea>.'
11765 ) : invariant(props.dangerouslySetInnerHTML == null));
11766
11767 props.defaultValue = null;
11768 props.value = null;
11769 props.onChange = this._handleChange;
11770
11771 // Always set children to the same thing. In IE9, the selection range will
11772 // get reset if `textContent` is mutated.
11773 return textarea(props, this.state.initialValue);
11774 },
11775
11776 componentDidUpdate: function(prevProps, prevState, prevContext) {
11777 var value = LinkedValueUtils.getValue(this);
11778 if (value != null) {
11779 var rootNode = this.getDOMNode();
11780 // Cast `value` to a string to ensure the value is set correctly. While
11781 // browsers typically do this as necessary, jsdom doesn't.
11782 DOMPropertyOperations.setValueForProperty(rootNode, 'value', '' + value);
11783 }
11784 },
11785
11786 _handleChange: function(event) {
11787 var returnValue;
11788 var onChange = LinkedValueUtils.getOnChange(this);
11789 if (onChange) {
11790 returnValue = onChange.call(this, event);
11791 }
11792 ReactUpdates.asap(forceUpdateIfMounted, this);
11793 return returnValue;
11794 }
11795
11796 });
11797
11798 module.exports = ReactDOMTextarea;
11799
11800 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(27)))
11801
11802/***/ },
11803/* 70 */
11804/***/ function(module, exports, __webpack_require__) {
11805
11806 /**
11807 * Copyright 2013-2014, Facebook, Inc.
11808 * All rights reserved.
11809 *
11810 * This source code is licensed under the BSD-style license found in the
11811 * LICENSE file in the root directory of this source tree. An additional grant
11812 * of patent rights can be found in the PATENTS file in the same directory.
11813 *
11814 * @providesModule ReactEventListener
11815 * @typechecks static-only
11816 */
11817
11818 "use strict";
11819
11820 var EventListener = __webpack_require__(113);
11821 var ExecutionEnvironment = __webpack_require__(26);
11822 var PooledClass = __webpack_require__(34);
11823 var ReactInstanceHandles = __webpack_require__(15);
11824 var ReactMount = __webpack_require__(17);
11825 var ReactUpdates = __webpack_require__(42);
11826
11827 var assign = __webpack_require__(23);
11828 var getEventTarget = __webpack_require__(114);
11829 var getUnboundedScrollPosition = __webpack_require__(115);
11830
11831 /**
11832 * Finds the parent React component of `node`.
11833 *
11834 * @param {*} node
11835 * @return {?DOMEventTarget} Parent container, or `null` if the specified node
11836 * is not nested.
11837 */
11838 function findParent(node) {
11839 // TODO: It may be a good idea to cache this to prevent unnecessary DOM
11840 // traversal, but caching is difficult to do correctly without using a
11841 // mutation observer to listen for all DOM changes.
11842 var nodeID = ReactMount.getID(node);
11843 var rootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);
11844 var container = ReactMount.findReactContainerForID(rootID);
11845 var parent = ReactMount.getFirstReactDOM(container);
11846 return parent;
11847 }
11848
11849 // Used to store ancestor hierarchy in top level callback
11850 function TopLevelCallbackBookKeeping(topLevelType, nativeEvent) {
11851 this.topLevelType = topLevelType;
11852 this.nativeEvent = nativeEvent;
11853 this.ancestors = [];
11854 }
11855 assign(TopLevelCallbackBookKeeping.prototype, {
11856 destructor: function() {
11857 this.topLevelType = null;
11858 this.nativeEvent = null;
11859 this.ancestors.length = 0;
11860 }
11861 });
11862 PooledClass.addPoolingTo(
11863 TopLevelCallbackBookKeeping,
11864 PooledClass.twoArgumentPooler
11865 );
11866
11867 function handleTopLevelImpl(bookKeeping) {
11868 var topLevelTarget = ReactMount.getFirstReactDOM(
11869 getEventTarget(bookKeeping.nativeEvent)
11870 ) || window;
11871
11872 // Loop through the hierarchy, in case there's any nested components.
11873 // It's important that we build the array of ancestors before calling any
11874 // event handlers, because event handlers can modify the DOM, leading to
11875 // inconsistencies with ReactMount's node cache. See #1105.
11876 var ancestor = topLevelTarget;
11877 while (ancestor) {
11878 bookKeeping.ancestors.push(ancestor);
11879 ancestor = findParent(ancestor);
11880 }
11881
11882 for (var i = 0, l = bookKeeping.ancestors.length; i < l; i++) {
11883 topLevelTarget = bookKeeping.ancestors[i];
11884 var topLevelTargetID = ReactMount.getID(topLevelTarget) || '';
11885 ReactEventListener._handleTopLevel(
11886 bookKeeping.topLevelType,
11887 topLevelTarget,
11888 topLevelTargetID,
11889 bookKeeping.nativeEvent
11890 );
11891 }
11892 }
11893
11894 function scrollValueMonitor(cb) {
11895 var scrollPosition = getUnboundedScrollPosition(window);
11896 cb(scrollPosition);
11897 }
11898
11899 var ReactEventListener = {
11900 _enabled: true,
11901 _handleTopLevel: null,
11902
11903 WINDOW_HANDLE: ExecutionEnvironment.canUseDOM ? window : null,
11904
11905 setHandleTopLevel: function(handleTopLevel) {
11906 ReactEventListener._handleTopLevel = handleTopLevel;
11907 },
11908
11909 setEnabled: function(enabled) {
11910 ReactEventListener._enabled = !!enabled;
11911 },
11912
11913 isEnabled: function() {
11914 return ReactEventListener._enabled;
11915 },
11916
11917
11918 /**
11919 * Traps top-level events by using event bubbling.
11920 *
11921 * @param {string} topLevelType Record from `EventConstants`.
11922 * @param {string} handlerBaseName Event name (e.g. "click").
11923 * @param {object} handle Element on which to attach listener.
11924 * @return {object} An object with a remove function which will forcefully
11925 * remove the listener.
11926 * @internal
11927 */
11928 trapBubbledEvent: function(topLevelType, handlerBaseName, handle) {
11929 var element = handle;
11930 if (!element) {
11931 return;
11932 }
11933 return EventListener.listen(
11934 element,
11935 handlerBaseName,
11936 ReactEventListener.dispatchEvent.bind(null, topLevelType)
11937 );
11938 },
11939
11940 /**
11941 * Traps a top-level event by using event capturing.
11942 *
11943 * @param {string} topLevelType Record from `EventConstants`.
11944 * @param {string} handlerBaseName Event name (e.g. "click").
11945 * @param {object} handle Element on which to attach listener.
11946 * @return {object} An object with a remove function which will forcefully
11947 * remove the listener.
11948 * @internal
11949 */
11950 trapCapturedEvent: function(topLevelType, handlerBaseName, handle) {
11951 var element = handle;
11952 if (!element) {
11953 return;
11954 }
11955 return EventListener.capture(
11956 element,
11957 handlerBaseName,
11958 ReactEventListener.dispatchEvent.bind(null, topLevelType)
11959 );
11960 },
11961
11962 monitorScrollValue: function(refresh) {
11963 var callback = scrollValueMonitor.bind(null, refresh);
11964 EventListener.listen(window, 'scroll', callback);
11965 EventListener.listen(window, 'resize', callback);
11966 },
11967
11968 dispatchEvent: function(topLevelType, nativeEvent) {
11969 if (!ReactEventListener._enabled) {
11970 return;
11971 }
11972
11973 var bookKeeping = TopLevelCallbackBookKeeping.getPooled(
11974 topLevelType,
11975 nativeEvent
11976 );
11977 try {
11978 // Event queue being processed in the same cycle allows
11979 // `preventDefault`.
11980 ReactUpdates.batchedUpdates(handleTopLevelImpl, bookKeeping);
11981 } finally {
11982 TopLevelCallbackBookKeeping.release(bookKeeping);
11983 }
11984 }
11985 };
11986
11987 module.exports = ReactEventListener;
11988
11989
11990/***/ },
11991/* 71 */
11992/***/ function(module, exports, __webpack_require__) {
11993
11994 /**
11995 * Copyright 2013-2014, Facebook, Inc.
11996 * All rights reserved.
11997 *
11998 * This source code is licensed under the BSD-style license found in the
11999 * LICENSE file in the root directory of this source tree. An additional grant
12000 * of patent rights can be found in the PATENTS file in the same directory.
12001 *
12002 * @providesModule ReactInjection
12003 */
12004
12005 "use strict";
12006
12007 var DOMProperty = __webpack_require__(28);
12008 var EventPluginHub = __webpack_require__(95);
12009 var ReactComponent = __webpack_require__(6);
12010 var ReactCompositeComponent = __webpack_require__(7);
12011 var ReactEmptyComponent = __webpack_require__(36);
12012 var ReactBrowserEventEmitter = __webpack_require__(51);
12013 var ReactNativeComponent = __webpack_require__(90);
12014 var ReactPerf = __webpack_require__(19);
12015 var ReactRootIndex = __webpack_require__(78);
12016 var ReactUpdates = __webpack_require__(42);
12017
12018 var ReactInjection = {
12019 Component: ReactComponent.injection,
12020 CompositeComponent: ReactCompositeComponent.injection,
12021 DOMProperty: DOMProperty.injection,
12022 EmptyComponent: ReactEmptyComponent.injection,
12023 EventPluginHub: EventPluginHub.injection,
12024 EventEmitter: ReactBrowserEventEmitter.injection,
12025 NativeComponent: ReactNativeComponent.injection,
12026 Perf: ReactPerf.injection,
12027 RootIndex: ReactRootIndex.injection,
12028 Updates: ReactUpdates.injection
12029 };
12030
12031 module.exports = ReactInjection;
12032
12033
12034/***/ },
12035/* 72 */
12036/***/ function(module, exports, __webpack_require__) {
12037
12038 /**
12039 * Copyright 2013-2014, Facebook, Inc.
12040 * All rights reserved.
12041 *
12042 * This source code is licensed under the BSD-style license found in the
12043 * LICENSE file in the root directory of this source tree. An additional grant
12044 * of patent rights can be found in the PATENTS file in the same directory.
12045 *
12046 * @providesModule SelectEventPlugin
12047 */
12048
12049 "use strict";
12050
12051 var EventConstants = __webpack_require__(32);
12052 var EventPropagators = __webpack_require__(99);
12053 var ReactInputSelection = __webpack_require__(103);
12054 var SyntheticEvent = __webpack_require__(101);
12055
12056 var getActiveElement = __webpack_require__(116);
12057 var isTextInputElement = __webpack_require__(102);
12058 var keyOf = __webpack_require__(45);
12059 var shallowEqual = __webpack_require__(117);
12060
12061 var topLevelTypes = EventConstants.topLevelTypes;
12062
12063 var eventTypes = {
12064 select: {
12065 phasedRegistrationNames: {
12066 bubbled: keyOf({onSelect: null}),
12067 captured: keyOf({onSelectCapture: null})
12068 },
12069 dependencies: [
12070 topLevelTypes.topBlur,
12071 topLevelTypes.topContextMenu,
12072 topLevelTypes.topFocus,
12073 topLevelTypes.topKeyDown,
12074 topLevelTypes.topMouseDown,
12075 topLevelTypes.topMouseUp,
12076 topLevelTypes.topSelectionChange
12077 ]
12078 }
12079 };
12080
12081 var activeElement = null;
12082 var activeElementID = null;
12083 var lastSelection = null;
12084 var mouseDown = false;
12085
12086 /**
12087 * Get an object which is a unique representation of the current selection.
12088 *
12089 * The return value will not be consistent across nodes or browsers, but
12090 * two identical selections on the same node will return identical objects.
12091 *
12092 * @param {DOMElement} node
12093 * @param {object}
12094 */
12095 function getSelection(node) {
12096 if ('selectionStart' in node &&
12097 ReactInputSelection.hasSelectionCapabilities(node)) {
12098 return {
12099 start: node.selectionStart,
12100 end: node.selectionEnd
12101 };
12102 } else if (window.getSelection) {
12103 var selection = window.getSelection();
12104 return {
12105 anchorNode: selection.anchorNode,
12106 anchorOffset: selection.anchorOffset,
12107 focusNode: selection.focusNode,
12108 focusOffset: selection.focusOffset
12109 };
12110 } else if (document.selection) {
12111 var range = document.selection.createRange();
12112 return {
12113 parentElement: range.parentElement(),
12114 text: range.text,
12115 top: range.boundingTop,
12116 left: range.boundingLeft
12117 };
12118 }
12119 }
12120
12121 /**
12122 * Poll selection to see whether it's changed.
12123 *
12124 * @param {object} nativeEvent
12125 * @return {?SyntheticEvent}
12126 */
12127 function constructSelectEvent(nativeEvent) {
12128 // Ensure we have the right element, and that the user is not dragging a
12129 // selection (this matches native `select` event behavior). In HTML5, select
12130 // fires only on input and textarea thus if there's no focused element we
12131 // won't dispatch.
12132 if (mouseDown ||
12133 activeElement == null ||
12134 activeElement != getActiveElement()) {
12135 return;
12136 }
12137
12138 // Only fire when selection has actually changed.
12139 var currentSelection = getSelection(activeElement);
12140 if (!lastSelection || !shallowEqual(lastSelection, currentSelection)) {
12141 lastSelection = currentSelection;
12142
12143 var syntheticEvent = SyntheticEvent.getPooled(
12144 eventTypes.select,
12145 activeElementID,
12146 nativeEvent
12147 );
12148
12149 syntheticEvent.type = 'select';
12150 syntheticEvent.target = activeElement;
12151
12152 EventPropagators.accumulateTwoPhaseDispatches(syntheticEvent);
12153
12154 return syntheticEvent;
12155 }
12156 }
12157
12158 /**
12159 * This plugin creates an `onSelect` event that normalizes select events
12160 * across form elements.
12161 *
12162 * Supported elements are:
12163 * - input (see `isTextInputElement`)
12164 * - textarea
12165 * - contentEditable
12166 *
12167 * This differs from native browser implementations in the following ways:
12168 * - Fires on contentEditable fields as well as inputs.
12169 * - Fires for collapsed selection.
12170 * - Fires after user input.
12171 */
12172 var SelectEventPlugin = {
12173
12174 eventTypes: eventTypes,
12175
12176 /**
12177 * @param {string} topLevelType Record from `EventConstants`.
12178 * @param {DOMEventTarget} topLevelTarget The listening component root node.
12179 * @param {string} topLevelTargetID ID of `topLevelTarget`.
12180 * @param {object} nativeEvent Native browser event.
12181 * @return {*} An accumulation of synthetic events.
12182 * @see {EventPluginHub.extractEvents}
12183 */
12184 extractEvents: function(
12185 topLevelType,
12186 topLevelTarget,
12187 topLevelTargetID,
12188 nativeEvent) {
12189
12190 switch (topLevelType) {
12191 // Track the input node that has focus.
12192 case topLevelTypes.topFocus:
12193 if (isTextInputElement(topLevelTarget) ||
12194 topLevelTarget.contentEditable === 'true') {
12195 activeElement = topLevelTarget;
12196 activeElementID = topLevelTargetID;
12197 lastSelection = null;
12198 }
12199 break;
12200 case topLevelTypes.topBlur:
12201 activeElement = null;
12202 activeElementID = null;
12203 lastSelection = null;
12204 break;
12205
12206 // Don't fire the event while the user is dragging. This matches the
12207 // semantics of the native select event.
12208 case topLevelTypes.topMouseDown:
12209 mouseDown = true;
12210 break;
12211 case topLevelTypes.topContextMenu:
12212 case topLevelTypes.topMouseUp:
12213 mouseDown = false;
12214 return constructSelectEvent(nativeEvent);
12215
12216 // Chrome and IE fire non-standard event when selection is changed (and
12217 // sometimes when it hasn't).
12218 // Firefox doesn't support selectionchange, so check selection status
12219 // after each key entry. The selection changes after keydown and before
12220 // keyup, but we check on keydown as well in the case of holding down a
12221 // key, when multiple keydown events are fired but only one keyup is.
12222 case topLevelTypes.topSelectionChange:
12223 case topLevelTypes.topKeyDown:
12224 case topLevelTypes.topKeyUp:
12225 return constructSelectEvent(nativeEvent);
12226 }
12227 }
12228 };
12229
12230 module.exports = SelectEventPlugin;
12231
12232
12233/***/ },
12234/* 73 */
12235/***/ function(module, exports, __webpack_require__) {
12236
12237 /**
12238 * Copyright 2013-2014, Facebook, Inc.
12239 * All rights reserved.
12240 *
12241 * This source code is licensed under the BSD-style license found in the
12242 * LICENSE file in the root directory of this source tree. An additional grant
12243 * of patent rights can be found in the PATENTS file in the same directory.
12244 *
12245 * @providesModule ServerReactRootIndex
12246 * @typechecks
12247 */
12248
12249 "use strict";
12250
12251 /**
12252 * Size of the reactRoot ID space. We generate random numbers for React root
12253 * IDs and if there's a collision the events and DOM update system will
12254 * get confused. In the future we need a way to generate GUIDs but for
12255 * now this will work on a smaller scale.
12256 */
12257 var GLOBAL_MOUNT_POINT_MAX = Math.pow(2, 53);
12258
12259 var ServerReactRootIndex = {
12260 createReactRootIndex: function() {
12261 return Math.ceil(Math.random() * GLOBAL_MOUNT_POINT_MAX);
12262 }
12263 };
12264
12265 module.exports = ServerReactRootIndex;
12266
12267
12268/***/ },
12269/* 74 */
12270/***/ function(module, exports, __webpack_require__) {
12271
12272 /* WEBPACK VAR INJECTION */(function(process) {/**
12273 * Copyright 2013-2014, Facebook, Inc.
12274 * All rights reserved.
12275 *
12276 * This source code is licensed under the BSD-style license found in the
12277 * LICENSE file in the root directory of this source tree. An additional grant
12278 * of patent rights can be found in the PATENTS file in the same directory.
12279 *
12280 * @providesModule SimpleEventPlugin
12281 */
12282
12283 "use strict";
12284
12285 var EventConstants = __webpack_require__(32);
12286 var EventPluginUtils = __webpack_require__(4);
12287 var EventPropagators = __webpack_require__(99);
12288 var SyntheticClipboardEvent = __webpack_require__(118);
12289 var SyntheticEvent = __webpack_require__(101);
12290 var SyntheticFocusEvent = __webpack_require__(119);
12291 var SyntheticKeyboardEvent = __webpack_require__(120);
12292 var SyntheticMouseEvent = __webpack_require__(106);
12293 var SyntheticDragEvent = __webpack_require__(121);
12294 var SyntheticTouchEvent = __webpack_require__(122);
12295 var SyntheticUIEvent = __webpack_require__(123);
12296 var SyntheticWheelEvent = __webpack_require__(124);
12297
12298 var getEventCharCode = __webpack_require__(125);
12299
12300 var invariant = __webpack_require__(33);
12301 var keyOf = __webpack_require__(45);
12302 var warning = __webpack_require__(31);
12303
12304 var topLevelTypes = EventConstants.topLevelTypes;
12305
12306 var eventTypes = {
12307 blur: {
12308 phasedRegistrationNames: {
12309 bubbled: keyOf({onBlur: true}),
12310 captured: keyOf({onBlurCapture: true})
12311 }
12312 },
12313 click: {
12314 phasedRegistrationNames: {
12315 bubbled: keyOf({onClick: true}),
12316 captured: keyOf({onClickCapture: true})
12317 }
12318 },
12319 contextMenu: {
12320 phasedRegistrationNames: {
12321 bubbled: keyOf({onContextMenu: true}),
12322 captured: keyOf({onContextMenuCapture: true})
12323 }
12324 },
12325 copy: {
12326 phasedRegistrationNames: {
12327 bubbled: keyOf({onCopy: true}),
12328 captured: keyOf({onCopyCapture: true})
12329 }
12330 },
12331 cut: {
12332 phasedRegistrationNames: {
12333 bubbled: keyOf({onCut: true}),
12334 captured: keyOf({onCutCapture: true})
12335 }
12336 },
12337 doubleClick: {
12338 phasedRegistrationNames: {
12339 bubbled: keyOf({onDoubleClick: true}),
12340 captured: keyOf({onDoubleClickCapture: true})
12341 }
12342 },
12343 drag: {
12344 phasedRegistrationNames: {
12345 bubbled: keyOf({onDrag: true}),
12346 captured: keyOf({onDragCapture: true})
12347 }
12348 },
12349 dragEnd: {
12350 phasedRegistrationNames: {
12351 bubbled: keyOf({onDragEnd: true}),
12352 captured: keyOf({onDragEndCapture: true})
12353 }
12354 },
12355 dragEnter: {
12356 phasedRegistrationNames: {
12357 bubbled: keyOf({onDragEnter: true}),
12358 captured: keyOf({onDragEnterCapture: true})
12359 }
12360 },
12361 dragExit: {
12362 phasedRegistrationNames: {
12363 bubbled: keyOf({onDragExit: true}),
12364 captured: keyOf({onDragExitCapture: true})
12365 }
12366 },
12367 dragLeave: {
12368 phasedRegistrationNames: {
12369 bubbled: keyOf({onDragLeave: true}),
12370 captured: keyOf({onDragLeaveCapture: true})
12371 }
12372 },
12373 dragOver: {
12374 phasedRegistrationNames: {
12375 bubbled: keyOf({onDragOver: true}),
12376 captured: keyOf({onDragOverCapture: true})
12377 }
12378 },
12379 dragStart: {
12380 phasedRegistrationNames: {
12381 bubbled: keyOf({onDragStart: true}),
12382 captured: keyOf({onDragStartCapture: true})
12383 }
12384 },
12385 drop: {
12386 phasedRegistrationNames: {
12387 bubbled: keyOf({onDrop: true}),
12388 captured: keyOf({onDropCapture: true})
12389 }
12390 },
12391 focus: {
12392 phasedRegistrationNames: {
12393 bubbled: keyOf({onFocus: true}),
12394 captured: keyOf({onFocusCapture: true})
12395 }
12396 },
12397 input: {
12398 phasedRegistrationNames: {
12399 bubbled: keyOf({onInput: true}),
12400 captured: keyOf({onInputCapture: true})
12401 }
12402 },
12403 keyDown: {
12404 phasedRegistrationNames: {
12405 bubbled: keyOf({onKeyDown: true}),
12406 captured: keyOf({onKeyDownCapture: true})
12407 }
12408 },
12409 keyPress: {
12410 phasedRegistrationNames: {
12411 bubbled: keyOf({onKeyPress: true}),
12412 captured: keyOf({onKeyPressCapture: true})
12413 }
12414 },
12415 keyUp: {
12416 phasedRegistrationNames: {
12417 bubbled: keyOf({onKeyUp: true}),
12418 captured: keyOf({onKeyUpCapture: true})
12419 }
12420 },
12421 load: {
12422 phasedRegistrationNames: {
12423 bubbled: keyOf({onLoad: true}),
12424 captured: keyOf({onLoadCapture: true})
12425 }
12426 },
12427 error: {
12428 phasedRegistrationNames: {
12429 bubbled: keyOf({onError: true}),
12430 captured: keyOf({onErrorCapture: true})
12431 }
12432 },
12433 // Note: We do not allow listening to mouseOver events. Instead, use the
12434 // onMouseEnter/onMouseLeave created by `EnterLeaveEventPlugin`.
12435 mouseDown: {
12436 phasedRegistrationNames: {
12437 bubbled: keyOf({onMouseDown: true}),
12438 captured: keyOf({onMouseDownCapture: true})
12439 }
12440 },
12441 mouseMove: {
12442 phasedRegistrationNames: {
12443 bubbled: keyOf({onMouseMove: true}),
12444 captured: keyOf({onMouseMoveCapture: true})
12445 }
12446 },
12447 mouseOut: {
12448 phasedRegistrationNames: {
12449 bubbled: keyOf({onMouseOut: true}),
12450 captured: keyOf({onMouseOutCapture: true})
12451 }
12452 },
12453 mouseOver: {
12454 phasedRegistrationNames: {
12455 bubbled: keyOf({onMouseOver: true}),
12456 captured: keyOf({onMouseOverCapture: true})
12457 }
12458 },
12459 mouseUp: {
12460 phasedRegistrationNames: {
12461 bubbled: keyOf({onMouseUp: true}),
12462 captured: keyOf({onMouseUpCapture: true})
12463 }
12464 },
12465 paste: {
12466 phasedRegistrationNames: {
12467 bubbled: keyOf({onPaste: true}),
12468 captured: keyOf({onPasteCapture: true})
12469 }
12470 },
12471 reset: {
12472 phasedRegistrationNames: {
12473 bubbled: keyOf({onReset: true}),
12474 captured: keyOf({onResetCapture: true})
12475 }
12476 },
12477 scroll: {
12478 phasedRegistrationNames: {
12479 bubbled: keyOf({onScroll: true}),
12480 captured: keyOf({onScrollCapture: true})
12481 }
12482 },
12483 submit: {
12484 phasedRegistrationNames: {
12485 bubbled: keyOf({onSubmit: true}),
12486 captured: keyOf({onSubmitCapture: true})
12487 }
12488 },
12489 touchCancel: {
12490 phasedRegistrationNames: {
12491 bubbled: keyOf({onTouchCancel: true}),
12492 captured: keyOf({onTouchCancelCapture: true})
12493 }
12494 },
12495 touchEnd: {
12496 phasedRegistrationNames: {
12497 bubbled: keyOf({onTouchEnd: true}),
12498 captured: keyOf({onTouchEndCapture: true})
12499 }
12500 },
12501 touchMove: {
12502 phasedRegistrationNames: {
12503 bubbled: keyOf({onTouchMove: true}),
12504 captured: keyOf({onTouchMoveCapture: true})
12505 }
12506 },
12507 touchStart: {
12508 phasedRegistrationNames: {
12509 bubbled: keyOf({onTouchStart: true}),
12510 captured: keyOf({onTouchStartCapture: true})
12511 }
12512 },
12513 wheel: {
12514 phasedRegistrationNames: {
12515 bubbled: keyOf({onWheel: true}),
12516 captured: keyOf({onWheelCapture: true})
12517 }
12518 }
12519 };
12520
12521 var topLevelEventsToDispatchConfig = {
12522 topBlur: eventTypes.blur,
12523 topClick: eventTypes.click,
12524 topContextMenu: eventTypes.contextMenu,
12525 topCopy: eventTypes.copy,
12526 topCut: eventTypes.cut,
12527 topDoubleClick: eventTypes.doubleClick,
12528 topDrag: eventTypes.drag,
12529 topDragEnd: eventTypes.dragEnd,
12530 topDragEnter: eventTypes.dragEnter,
12531 topDragExit: eventTypes.dragExit,
12532 topDragLeave: eventTypes.dragLeave,
12533 topDragOver: eventTypes.dragOver,
12534 topDragStart: eventTypes.dragStart,
12535 topDrop: eventTypes.drop,
12536 topError: eventTypes.error,
12537 topFocus: eventTypes.focus,
12538 topInput: eventTypes.input,
12539 topKeyDown: eventTypes.keyDown,
12540 topKeyPress: eventTypes.keyPress,
12541 topKeyUp: eventTypes.keyUp,
12542 topLoad: eventTypes.load,
12543 topMouseDown: eventTypes.mouseDown,
12544 topMouseMove: eventTypes.mouseMove,
12545 topMouseOut: eventTypes.mouseOut,
12546 topMouseOver: eventTypes.mouseOver,
12547 topMouseUp: eventTypes.mouseUp,
12548 topPaste: eventTypes.paste,
12549 topReset: eventTypes.reset,
12550 topScroll: eventTypes.scroll,
12551 topSubmit: eventTypes.submit,
12552 topTouchCancel: eventTypes.touchCancel,
12553 topTouchEnd: eventTypes.touchEnd,
12554 topTouchMove: eventTypes.touchMove,
12555 topTouchStart: eventTypes.touchStart,
12556 topWheel: eventTypes.wheel
12557 };
12558
12559 for (var topLevelType in topLevelEventsToDispatchConfig) {
12560 topLevelEventsToDispatchConfig[topLevelType].dependencies = [topLevelType];
12561 }
12562
12563 var SimpleEventPlugin = {
12564
12565 eventTypes: eventTypes,
12566
12567 /**
12568 * Same as the default implementation, except cancels the event when return
12569 * value is false. This behavior will be disabled in a future release.
12570 *
12571 * @param {object} Event to be dispatched.
12572 * @param {function} Application-level callback.
12573 * @param {string} domID DOM ID to pass to the callback.
12574 */
12575 executeDispatch: function(event, listener, domID) {
12576 var returnValue = EventPluginUtils.executeDispatch(event, listener, domID);
12577
12578 ("production" !== process.env.NODE_ENV ? warning(
12579 typeof returnValue !== 'boolean',
12580 'Returning `false` from an event handler is deprecated and will be ' +
12581 'ignored in a future release. Instead, manually call ' +
12582 'e.stopPropagation() or e.preventDefault(), as appropriate.'
12583 ) : null);
12584
12585 if (returnValue === false) {
12586 event.stopPropagation();
12587 event.preventDefault();
12588 }
12589 },
12590
12591 /**
12592 * @param {string} topLevelType Record from `EventConstants`.
12593 * @param {DOMEventTarget} topLevelTarget The listening component root node.
12594 * @param {string} topLevelTargetID ID of `topLevelTarget`.
12595 * @param {object} nativeEvent Native browser event.
12596 * @return {*} An accumulation of synthetic events.
12597 * @see {EventPluginHub.extractEvents}
12598 */
12599 extractEvents: function(
12600 topLevelType,
12601 topLevelTarget,
12602 topLevelTargetID,
12603 nativeEvent) {
12604 var dispatchConfig = topLevelEventsToDispatchConfig[topLevelType];
12605 if (!dispatchConfig) {
12606 return null;
12607 }
12608 var EventConstructor;
12609 switch (topLevelType) {
12610 case topLevelTypes.topInput:
12611 case topLevelTypes.topLoad:
12612 case topLevelTypes.topError:
12613 case topLevelTypes.topReset:
12614 case topLevelTypes.topSubmit:
12615 // HTML Events
12616 // @see http://www.w3.org/TR/html5/index.html#events-0
12617 EventConstructor = SyntheticEvent;
12618 break;
12619 case topLevelTypes.topKeyPress:
12620 // FireFox creates a keypress event for function keys too. This removes
12621 // the unwanted keypress events. Enter is however both printable and
12622 // non-printable. One would expect Tab to be as well (but it isn't).
12623 if (getEventCharCode(nativeEvent) === 0) {
12624 return null;
12625 }
12626 /* falls through */
12627 case topLevelTypes.topKeyDown:
12628 case topLevelTypes.topKeyUp:
12629 EventConstructor = SyntheticKeyboardEvent;
12630 break;
12631 case topLevelTypes.topBlur:
12632 case topLevelTypes.topFocus:
12633 EventConstructor = SyntheticFocusEvent;
12634 break;
12635 case topLevelTypes.topClick:
12636 // Firefox creates a click event on right mouse clicks. This removes the
12637 // unwanted click events.
12638 if (nativeEvent.button === 2) {
12639 return null;
12640 }
12641 /* falls through */
12642 case topLevelTypes.topContextMenu:
12643 case topLevelTypes.topDoubleClick:
12644 case topLevelTypes.topMouseDown:
12645 case topLevelTypes.topMouseMove:
12646 case topLevelTypes.topMouseOut:
12647 case topLevelTypes.topMouseOver:
12648 case topLevelTypes.topMouseUp:
12649 EventConstructor = SyntheticMouseEvent;
12650 break;
12651 case topLevelTypes.topDrag:
12652 case topLevelTypes.topDragEnd:
12653 case topLevelTypes.topDragEnter:
12654 case topLevelTypes.topDragExit:
12655 case topLevelTypes.topDragLeave:
12656 case topLevelTypes.topDragOver:
12657 case topLevelTypes.topDragStart:
12658 case topLevelTypes.topDrop:
12659 EventConstructor = SyntheticDragEvent;
12660 break;
12661 case topLevelTypes.topTouchCancel:
12662 case topLevelTypes.topTouchEnd:
12663 case topLevelTypes.topTouchMove:
12664 case topLevelTypes.topTouchStart:
12665 EventConstructor = SyntheticTouchEvent;
12666 break;
12667 case topLevelTypes.topScroll:
12668 EventConstructor = SyntheticUIEvent;
12669 break;
12670 case topLevelTypes.topWheel:
12671 EventConstructor = SyntheticWheelEvent;
12672 break;
12673 case topLevelTypes.topCopy:
12674 case topLevelTypes.topCut:
12675 case topLevelTypes.topPaste:
12676 EventConstructor = SyntheticClipboardEvent;
12677 break;
12678 }
12679 ("production" !== process.env.NODE_ENV ? invariant(
12680 EventConstructor,
12681 'SimpleEventPlugin: Unhandled event type, `%s`.',
12682 topLevelType
12683 ) : invariant(EventConstructor));
12684 var event = EventConstructor.getPooled(
12685 dispatchConfig,
12686 topLevelTargetID,
12687 nativeEvent
12688 );
12689 EventPropagators.accumulateTwoPhaseDispatches(event);
12690 return event;
12691 }
12692
12693 };
12694
12695 module.exports = SimpleEventPlugin;
12696
12697 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(27)))
12698
12699/***/ },
12700/* 75 */
12701/***/ function(module, exports, __webpack_require__) {
12702
12703 /**
12704 * Copyright 2013-2014, Facebook, Inc.
12705 * All rights reserved.
12706 *
12707 * This source code is licensed under the BSD-style license found in the
12708 * LICENSE file in the root directory of this source tree. An additional grant
12709 * of patent rights can be found in the PATENTS file in the same directory.
12710 *
12711 * @providesModule SVGDOMPropertyConfig
12712 */
12713
12714 /*jslint bitwise: true*/
12715
12716 "use strict";
12717
12718 var DOMProperty = __webpack_require__(28);
12719
12720 var MUST_USE_ATTRIBUTE = DOMProperty.injection.MUST_USE_ATTRIBUTE;
12721
12722 var SVGDOMPropertyConfig = {
12723 Properties: {
12724 cx: MUST_USE_ATTRIBUTE,
12725 cy: MUST_USE_ATTRIBUTE,
12726 d: MUST_USE_ATTRIBUTE,
12727 dx: MUST_USE_ATTRIBUTE,
12728 dy: MUST_USE_ATTRIBUTE,
12729 fill: MUST_USE_ATTRIBUTE,
12730 fillOpacity: MUST_USE_ATTRIBUTE,
12731 fontFamily: MUST_USE_ATTRIBUTE,
12732 fontSize: MUST_USE_ATTRIBUTE,
12733 fx: MUST_USE_ATTRIBUTE,
12734 fy: MUST_USE_ATTRIBUTE,
12735 gradientTransform: MUST_USE_ATTRIBUTE,
12736 gradientUnits: MUST_USE_ATTRIBUTE,
12737 markerEnd: MUST_USE_ATTRIBUTE,
12738 markerMid: MUST_USE_ATTRIBUTE,
12739 markerStart: MUST_USE_ATTRIBUTE,
12740 offset: MUST_USE_ATTRIBUTE,
12741 opacity: MUST_USE_ATTRIBUTE,
12742 patternContentUnits: MUST_USE_ATTRIBUTE,
12743 patternUnits: MUST_USE_ATTRIBUTE,
12744 points: MUST_USE_ATTRIBUTE,
12745 preserveAspectRatio: MUST_USE_ATTRIBUTE,
12746 r: MUST_USE_ATTRIBUTE,
12747 rx: MUST_USE_ATTRIBUTE,
12748 ry: MUST_USE_ATTRIBUTE,
12749 spreadMethod: MUST_USE_ATTRIBUTE,
12750 stopColor: MUST_USE_ATTRIBUTE,
12751 stopOpacity: MUST_USE_ATTRIBUTE,
12752 stroke: MUST_USE_ATTRIBUTE,
12753 strokeDasharray: MUST_USE_ATTRIBUTE,
12754 strokeLinecap: MUST_USE_ATTRIBUTE,
12755 strokeOpacity: MUST_USE_ATTRIBUTE,
12756 strokeWidth: MUST_USE_ATTRIBUTE,
12757 textAnchor: MUST_USE_ATTRIBUTE,
12758 transform: MUST_USE_ATTRIBUTE,
12759 version: MUST_USE_ATTRIBUTE,
12760 viewBox: MUST_USE_ATTRIBUTE,
12761 x1: MUST_USE_ATTRIBUTE,
12762 x2: MUST_USE_ATTRIBUTE,
12763 x: MUST_USE_ATTRIBUTE,
12764 y1: MUST_USE_ATTRIBUTE,
12765 y2: MUST_USE_ATTRIBUTE,
12766 y: MUST_USE_ATTRIBUTE
12767 },
12768 DOMAttributeNames: {
12769 fillOpacity: 'fill-opacity',
12770 fontFamily: 'font-family',
12771 fontSize: 'font-size',
12772 gradientTransform: 'gradientTransform',
12773 gradientUnits: 'gradientUnits',
12774 markerEnd: 'marker-end',
12775 markerMid: 'marker-mid',
12776 markerStart: 'marker-start',
12777 patternContentUnits: 'patternContentUnits',
12778 patternUnits: 'patternUnits',
12779 preserveAspectRatio: 'preserveAspectRatio',
12780 spreadMethod: 'spreadMethod',
12781 stopColor: 'stop-color',
12782 stopOpacity: 'stop-opacity',
12783 strokeDasharray: 'stroke-dasharray',
12784 strokeLinecap: 'stroke-linecap',
12785 strokeOpacity: 'stroke-opacity',
12786 strokeWidth: 'stroke-width',
12787 textAnchor: 'text-anchor',
12788 viewBox: 'viewBox'
12789 }
12790 };
12791
12792 module.exports = SVGDOMPropertyConfig;
12793
12794
12795/***/ },
12796/* 76 */
12797/***/ function(module, exports, __webpack_require__) {
12798
12799 /* WEBPACK VAR INJECTION */(function(process) {/**
12800 * Copyright 2013-2014, Facebook, Inc.
12801 * All rights reserved.
12802 *
12803 * This source code is licensed under the BSD-style license found in the
12804 * LICENSE file in the root directory of this source tree. An additional grant
12805 * of patent rights can be found in the PATENTS file in the same directory.
12806 *
12807 * @providesModule createFullPageComponent
12808 * @typechecks
12809 */
12810
12811 "use strict";
12812
12813 // Defeat circular references by requiring this directly.
12814 var ReactCompositeComponent = __webpack_require__(7);
12815 var ReactElement = __webpack_require__(10);
12816
12817 var invariant = __webpack_require__(33);
12818
12819 /**
12820 * Create a component that will throw an exception when unmounted.
12821 *
12822 * Components like <html> <head> and <body> can't be removed or added
12823 * easily in a cross-browser way, however it's valuable to be able to
12824 * take advantage of React's reconciliation for styling and <title>
12825 * management. So we just document it and throw in dangerous cases.
12826 *
12827 * @param {string} tag The tag to wrap
12828 * @return {function} convenience constructor of new component
12829 */
12830 function createFullPageComponent(tag) {
12831 var elementFactory = ReactElement.createFactory(tag);
12832
12833 var FullPageComponent = ReactCompositeComponent.createClass({
12834 displayName: 'ReactFullPageComponent' + tag,
12835
12836 componentWillUnmount: function() {
12837 ("production" !== process.env.NODE_ENV ? invariant(
12838 false,
12839 '%s tried to unmount. Because of cross-browser quirks it is ' +
12840 'impossible to unmount some top-level components (eg <html>, <head>, ' +
12841 'and <body>) reliably and efficiently. To fix this, have a single ' +
12842 'top-level component that never unmounts render these elements.',
12843 this.constructor.displayName
12844 ) : invariant(false));
12845 },
12846
12847 render: function() {
12848 return elementFactory(this.props);
12849 }
12850 });
12851
12852 return FullPageComponent;
12853 }
12854
12855 module.exports = createFullPageComponent;
12856
12857 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(27)))
12858
12859/***/ },
12860/* 77 */
12861/***/ function(module, exports, __webpack_require__) {
12862
12863 /**
12864 * Copyright 2013-2014, Facebook, Inc.
12865 * All rights reserved.
12866 *
12867 * This source code is licensed under the BSD-style license found in the
12868 * LICENSE file in the root directory of this source tree. An additional grant
12869 * of patent rights can be found in the PATENTS file in the same directory.
12870 *
12871 * @providesModule ReactDefaultPerf
12872 * @typechecks static-only
12873 */
12874
12875 "use strict";
12876
12877 var DOMProperty = __webpack_require__(28);
12878 var ReactDefaultPerfAnalysis = __webpack_require__(126);
12879 var ReactMount = __webpack_require__(17);
12880 var ReactPerf = __webpack_require__(19);
12881
12882 var performanceNow = __webpack_require__(127);
12883
12884 function roundFloat(val) {
12885 return Math.floor(val * 100) / 100;
12886 }
12887
12888 function addValue(obj, key, val) {
12889 obj[key] = (obj[key] || 0) + val;
12890 }
12891
12892 var ReactDefaultPerf = {
12893 _allMeasurements: [], // last item in the list is the current one
12894 _mountStack: [0],
12895 _injected: false,
12896
12897 start: function() {
12898 if (!ReactDefaultPerf._injected) {
12899 ReactPerf.injection.injectMeasure(ReactDefaultPerf.measure);
12900 }
12901
12902 ReactDefaultPerf._allMeasurements.length = 0;
12903 ReactPerf.enableMeasure = true;
12904 },
12905
12906 stop: function() {
12907 ReactPerf.enableMeasure = false;
12908 },
12909
12910 getLastMeasurements: function() {
12911 return ReactDefaultPerf._allMeasurements;
12912 },
12913
12914 printExclusive: function(measurements) {
12915 measurements = measurements || ReactDefaultPerf._allMeasurements;
12916 var summary = ReactDefaultPerfAnalysis.getExclusiveSummary(measurements);
12917 console.table(summary.map(function(item) {
12918 return {
12919 'Component class name': item.componentName,
12920 'Total inclusive time (ms)': roundFloat(item.inclusive),
12921 'Exclusive mount time (ms)': roundFloat(item.exclusive),
12922 'Exclusive render time (ms)': roundFloat(item.render),
12923 'Mount time per instance (ms)': roundFloat(item.exclusive / item.count),
12924 'Render time per instance (ms)': roundFloat(item.render / item.count),
12925 'Instances': item.count
12926 };
12927 }));
12928 // TODO: ReactDefaultPerfAnalysis.getTotalTime() does not return the correct
12929 // number.
12930 },
12931
12932 printInclusive: function(measurements) {
12933 measurements = measurements || ReactDefaultPerf._allMeasurements;
12934 var summary = ReactDefaultPerfAnalysis.getInclusiveSummary(measurements);
12935 console.table(summary.map(function(item) {
12936 return {
12937 'Owner > component': item.componentName,
12938 'Inclusive time (ms)': roundFloat(item.time),
12939 'Instances': item.count
12940 };
12941 }));
12942 console.log(
12943 'Total time:',
12944 ReactDefaultPerfAnalysis.getTotalTime(measurements).toFixed(2) + ' ms'
12945 );
12946 },
12947
12948 getMeasurementsSummaryMap: function(measurements) {
12949 var summary = ReactDefaultPerfAnalysis.getInclusiveSummary(
12950 measurements,
12951 true
12952 );
12953 return summary.map(function(item) {
12954 return {
12955 'Owner > component': item.componentName,
12956 'Wasted time (ms)': item.time,
12957 'Instances': item.count
12958 };
12959 });
12960 },
12961
12962 printWasted: function(measurements) {
12963 measurements = measurements || ReactDefaultPerf._allMeasurements;
12964 console.table(ReactDefaultPerf.getMeasurementsSummaryMap(measurements));
12965 console.log(
12966 'Total time:',
12967 ReactDefaultPerfAnalysis.getTotalTime(measurements).toFixed(2) + ' ms'
12968 );
12969 },
12970
12971 printDOM: function(measurements) {
12972 measurements = measurements || ReactDefaultPerf._allMeasurements;
12973 var summary = ReactDefaultPerfAnalysis.getDOMSummary(measurements);
12974 console.table(summary.map(function(item) {
12975 var result = {};
12976 result[DOMProperty.ID_ATTRIBUTE_NAME] = item.id;
12977 result['type'] = item.type;
12978 result['args'] = JSON.stringify(item.args);
12979 return result;
12980 }));
12981 console.log(
12982 'Total time:',
12983 ReactDefaultPerfAnalysis.getTotalTime(measurements).toFixed(2) + ' ms'
12984 );
12985 },
12986
12987 _recordWrite: function(id, fnName, totalTime, args) {
12988 // TODO: totalTime isn't that useful since it doesn't count paints/reflows
12989 var writes =
12990 ReactDefaultPerf
12991 ._allMeasurements[ReactDefaultPerf._allMeasurements.length - 1]
12992 .writes;
12993 writes[id] = writes[id] || [];
12994 writes[id].push({
12995 type: fnName,
12996 time: totalTime,
12997 args: args
12998 });
12999 },
13000
13001 measure: function(moduleName, fnName, func) {
13002 return function() {for (var args=[],$__0=0,$__1=arguments.length;$__0<$__1;$__0++) args.push(arguments[$__0]);
13003 var totalTime;
13004 var rv;
13005 var start;
13006
13007 if (fnName === '_renderNewRootComponent' ||
13008 fnName === 'flushBatchedUpdates') {
13009 // A "measurement" is a set of metrics recorded for each flush. We want
13010 // to group the metrics for a given flush together so we can look at the
13011 // components that rendered and the DOM operations that actually
13012 // happened to determine the amount of "wasted work" performed.
13013 ReactDefaultPerf._allMeasurements.push({
13014 exclusive: {},
13015 inclusive: {},
13016 render: {},
13017 counts: {},
13018 writes: {},
13019 displayNames: {},
13020 totalTime: 0
13021 });
13022 start = performanceNow();
13023 rv = func.apply(this, args);
13024 ReactDefaultPerf._allMeasurements[
13025 ReactDefaultPerf._allMeasurements.length - 1
13026 ].totalTime = performanceNow() - start;
13027 return rv;
13028 } else if (moduleName === 'ReactDOMIDOperations' ||
13029 moduleName === 'ReactComponentBrowserEnvironment') {
13030 start = performanceNow();
13031 rv = func.apply(this, args);
13032 totalTime = performanceNow() - start;
13033
13034 if (fnName === 'mountImageIntoNode') {
13035 var mountID = ReactMount.getID(args[1]);
13036 ReactDefaultPerf._recordWrite(mountID, fnName, totalTime, args[0]);
13037 } else if (fnName === 'dangerouslyProcessChildrenUpdates') {
13038 // special format
13039 args[0].forEach(function(update) {
13040 var writeArgs = {};
13041 if (update.fromIndex !== null) {
13042 writeArgs.fromIndex = update.fromIndex;
13043 }
13044 if (update.toIndex !== null) {
13045 writeArgs.toIndex = update.toIndex;
13046 }
13047 if (update.textContent !== null) {
13048 writeArgs.textContent = update.textContent;
13049 }
13050 if (update.markupIndex !== null) {
13051 writeArgs.markup = args[1][update.markupIndex];
13052 }
13053 ReactDefaultPerf._recordWrite(
13054 update.parentID,
13055 update.type,
13056 totalTime,
13057 writeArgs
13058 );
13059 });
13060 } else {
13061 // basic format
13062 ReactDefaultPerf._recordWrite(
13063 args[0],
13064 fnName,
13065 totalTime,
13066 Array.prototype.slice.call(args, 1)
13067 );
13068 }
13069 return rv;
13070 } else if (moduleName === 'ReactCompositeComponent' && (
13071 fnName === 'mountComponent' ||
13072 fnName === 'updateComponent' || // TODO: receiveComponent()?
13073 fnName === '_renderValidatedComponent')) {
13074
13075 var rootNodeID = fnName === 'mountComponent' ?
13076 args[0] :
13077 this._rootNodeID;
13078 var isRender = fnName === '_renderValidatedComponent';
13079 var isMount = fnName === 'mountComponent';
13080
13081 var mountStack = ReactDefaultPerf._mountStack;
13082 var entry = ReactDefaultPerf._allMeasurements[
13083 ReactDefaultPerf._allMeasurements.length - 1
13084 ];
13085
13086 if (isRender) {
13087 addValue(entry.counts, rootNodeID, 1);
13088 } else if (isMount) {
13089 mountStack.push(0);
13090 }
13091
13092 start = performanceNow();
13093 rv = func.apply(this, args);
13094 totalTime = performanceNow() - start;
13095
13096 if (isRender) {
13097 addValue(entry.render, rootNodeID, totalTime);
13098 } else if (isMount) {
13099 var subMountTime = mountStack.pop();
13100 mountStack[mountStack.length - 1] += totalTime;
13101 addValue(entry.exclusive, rootNodeID, totalTime - subMountTime);
13102 addValue(entry.inclusive, rootNodeID, totalTime);
13103 } else {
13104 addValue(entry.inclusive, rootNodeID, totalTime);
13105 }
13106
13107 entry.displayNames[rootNodeID] = {
13108 current: this.constructor.displayName,
13109 owner: this._owner ? this._owner.constructor.displayName : '<root>'
13110 };
13111
13112 return rv;
13113 } else {
13114 return func.apply(this, args);
13115 }
13116 };
13117 }
13118 };
13119
13120 module.exports = ReactDefaultPerf;
13121
13122
13123/***/ },
13124/* 78 */
13125/***/ function(module, exports, __webpack_require__) {
13126
13127 /**
13128 * Copyright 2013-2014, Facebook, Inc.
13129 * All rights reserved.
13130 *
13131 * This source code is licensed under the BSD-style license found in the
13132 * LICENSE file in the root directory of this source tree. An additional grant
13133 * of patent rights can be found in the PATENTS file in the same directory.
13134 *
13135 * @providesModule ReactRootIndex
13136 * @typechecks
13137 */
13138
13139 "use strict";
13140
13141 var ReactRootIndexInjection = {
13142 /**
13143 * @param {function} _createReactRootIndex
13144 */
13145 injectCreateReactRootIndex: function(_createReactRootIndex) {
13146 ReactRootIndex.createReactRootIndex = _createReactRootIndex;
13147 }
13148 };
13149
13150 var ReactRootIndex = {
13151 createReactRootIndex: null,
13152 injection: ReactRootIndexInjection
13153 };
13154
13155 module.exports = ReactRootIndex;
13156
13157
13158/***/ },
13159/* 79 */
13160/***/ function(module, exports, __webpack_require__) {
13161
13162 /**
13163 * Copyright 2013-2014, Facebook, Inc.
13164 * All rights reserved.
13165 *
13166 * This source code is licensed under the BSD-style license found in the
13167 * LICENSE file in the root directory of this source tree. An additional grant
13168 * of patent rights can be found in the PATENTS file in the same directory.
13169 *
13170 * @providesModule containsNode
13171 * @typechecks
13172 */
13173
13174 var isTextNode = __webpack_require__(128);
13175
13176 /*jslint bitwise:true */
13177
13178 /**
13179 * Checks if a given DOM node contains or is another DOM node.
13180 *
13181 * @param {?DOMNode} outerNode Outer DOM node.
13182 * @param {?DOMNode} innerNode Inner DOM node.
13183 * @return {boolean} True if `outerNode` contains or is `innerNode`.
13184 */
13185 function containsNode(outerNode, innerNode) {
13186 if (!outerNode || !innerNode) {
13187 return false;
13188 } else if (outerNode === innerNode) {
13189 return true;
13190 } else if (isTextNode(outerNode)) {
13191 return false;
13192 } else if (isTextNode(innerNode)) {
13193 return containsNode(outerNode, innerNode.parentNode);
13194 } else if (outerNode.contains) {
13195 return outerNode.contains(innerNode);
13196 } else if (outerNode.compareDocumentPosition) {
13197 return !!(outerNode.compareDocumentPosition(innerNode) & 16);
13198 } else {
13199 return false;
13200 }
13201 }
13202
13203 module.exports = containsNode;
13204
13205
13206/***/ },
13207/* 80 */
13208/***/ function(module, exports, __webpack_require__) {
13209
13210 /**
13211 * Copyright 2013-2014, Facebook, Inc.
13212 * All rights reserved.
13213 *
13214 * This source code is licensed under the BSD-style license found in the
13215 * LICENSE file in the root directory of this source tree. An additional grant
13216 * of patent rights can be found in the PATENTS file in the same directory.
13217 *
13218 * @providesModule getReactRootElementInContainer
13219 */
13220
13221 "use strict";
13222
13223 var DOC_NODE_TYPE = 9;
13224
13225 /**
13226 * @param {DOMElement|DOMDocument} container DOM element that may contain
13227 * a React component
13228 * @return {?*} DOM element that may have the reactRoot ID, or null.
13229 */
13230 function getReactRootElementInContainer(container) {
13231 if (!container) {
13232 return null;
13233 }
13234
13235 if (container.nodeType === DOC_NODE_TYPE) {
13236 return container.documentElement;
13237 } else {
13238 return container.firstChild;
13239 }
13240 }
13241
13242 module.exports = getReactRootElementInContainer;
13243
13244
13245/***/ },
13246/* 81 */
13247/***/ function(module, exports, __webpack_require__) {
13248
13249 /**
13250 * Copyright 2013-2014, Facebook, Inc.
13251 * All rights reserved.
13252 *
13253 * This source code is licensed under the BSD-style license found in the
13254 * LICENSE file in the root directory of this source tree. An additional grant
13255 * of patent rights can be found in the PATENTS file in the same directory.
13256 *
13257 * @providesModule ReactMultiChildUpdateTypes
13258 */
13259
13260 "use strict";
13261
13262 var keyMirror = __webpack_require__(44);
13263
13264 /**
13265 * When a component's children are updated, a series of update configuration
13266 * objects are created in order to batch and serialize the required changes.
13267 *
13268 * Enumerates all the possible types of update configurations.
13269 *
13270 * @internal
13271 */
13272 var ReactMultiChildUpdateTypes = keyMirror({
13273 INSERT_MARKUP: null,
13274 MOVE_EXISTING: null,
13275 REMOVE_NODE: null,
13276 TEXT_CONTENT: null
13277 });
13278
13279 module.exports = ReactMultiChildUpdateTypes;
13280
13281
13282/***/ },
13283/* 82 */
13284/***/ function(module, exports, __webpack_require__) {
13285
13286 /* WEBPACK VAR INJECTION */(function(process) {/**
13287 * Copyright 2013-2014, Facebook, Inc.
13288 * All rights reserved.
13289 *
13290 * This source code is licensed under the BSD-style license found in the
13291 * LICENSE file in the root directory of this source tree. An additional grant
13292 * of patent rights can be found in the PATENTS file in the same directory.
13293 *
13294 * @providesModule flattenChildren
13295 */
13296
13297 "use strict";
13298
13299 var ReactTextComponent = __webpack_require__(22);
13300
13301 var traverseAllChildren = __webpack_require__(35);
13302 var warning = __webpack_require__(31);
13303
13304 /**
13305 * @param {function} traverseContext Context passed through traversal.
13306 * @param {?ReactComponent} child React child component.
13307 * @param {!string} name String name of key path to child.
13308 */
13309 function flattenSingleChildIntoContext(traverseContext, child, name) {
13310 // We found a component instance.
13311 var result = traverseContext;
13312 var keyUnique = !result.hasOwnProperty(name);
13313 ("production" !== process.env.NODE_ENV ? warning(
13314 keyUnique,
13315 'flattenChildren(...): Encountered two children with the same key, ' +
13316 '`%s`. Child keys must be unique; when two children share a key, only ' +
13317 'the first child will be used.',
13318 name
13319 ) : null);
13320 if (keyUnique && child != null) {
13321 var type = typeof child;
13322 var normalizedValue;
13323
13324 if (type === 'string') {
13325 normalizedValue = ReactTextComponent(child);
13326 } else if (type === 'number') {
13327 normalizedValue = ReactTextComponent('' + child);
13328 } else {
13329 normalizedValue = child;
13330 }
13331
13332 result[name] = normalizedValue;
13333 }
13334 }
13335
13336 /**
13337 * Flattens children that are typically specified as `props.children`. Any null
13338 * children will not be included in the resulting object.
13339 * @return {!object} flattened children keyed by name.
13340 */
13341 function flattenChildren(children) {
13342 if (children == null) {
13343 return children;
13344 }
13345 var result = {};
13346 traverseAllChildren(children, flattenSingleChildIntoContext, result);
13347 return result;
13348 }
13349
13350 module.exports = flattenChildren;
13351
13352 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(27)))
13353
13354/***/ },
13355/* 83 */
13356/***/ function(module, exports, __webpack_require__) {
13357
13358 /**
13359 * Copyright 2013-2014, Facebook, Inc.
13360 * All rights reserved.
13361 *
13362 * This source code is licensed under the BSD-style license found in the
13363 * LICENSE file in the root directory of this source tree. An additional grant
13364 * of patent rights can be found in the PATENTS file in the same directory.
13365 *
13366 * @providesModule emptyFunction
13367 */
13368
13369 function makeEmptyFunction(arg) {
13370 return function() {
13371 return arg;
13372 };
13373 }
13374
13375 /**
13376 * This function accepts and discards inputs; it has no side effects. This is
13377 * primarily useful idiomatically for overridable function endpoints which
13378 * always need to be callable, since JS lacks a null-call idiom ala Cocoa.
13379 */
13380 function emptyFunction() {}
13381
13382 emptyFunction.thatReturns = makeEmptyFunction;
13383 emptyFunction.thatReturnsFalse = makeEmptyFunction(false);
13384 emptyFunction.thatReturnsTrue = makeEmptyFunction(true);
13385 emptyFunction.thatReturnsNull = makeEmptyFunction(null);
13386 emptyFunction.thatReturnsThis = function() { return this; };
13387 emptyFunction.thatReturnsArgument = function(arg) { return arg; };
13388
13389 module.exports = emptyFunction;
13390
13391
13392/***/ },
13393/* 84 */
13394/***/ function(module, exports, __webpack_require__) {
13395
13396 /**
13397 * Copyright 2013-2014, Facebook, Inc.
13398 * All rights reserved.
13399 *
13400 * This source code is licensed under the BSD-style license found in the
13401 * LICENSE file in the root directory of this source tree. An additional grant
13402 * of patent rights can be found in the PATENTS file in the same directory.
13403 *
13404 * @providesModule ReactMarkupChecksum
13405 */
13406
13407 "use strict";
13408
13409 var adler32 = __webpack_require__(129);
13410
13411 var ReactMarkupChecksum = {
13412 CHECKSUM_ATTR_NAME: 'data-react-checksum',
13413
13414 /**
13415 * @param {string} markup Markup string
13416 * @return {string} Markup string with checksum attribute attached
13417 */
13418 addChecksumToMarkup: function(markup) {
13419 var checksum = adler32(markup);
13420 return markup.replace(
13421 '>',
13422 ' ' + ReactMarkupChecksum.CHECKSUM_ATTR_NAME + '="' + checksum + '">'
13423 );
13424 },
13425
13426 /**
13427 * @param {string} markup to use
13428 * @param {DOMElement} element root React element
13429 * @returns {boolean} whether or not the markup is the same
13430 */
13431 canReuseMarkup: function(markup, element) {
13432 var existingChecksum = element.getAttribute(
13433 ReactMarkupChecksum.CHECKSUM_ATTR_NAME
13434 );
13435 existingChecksum = existingChecksum && parseInt(existingChecksum, 10);
13436 var markupChecksum = adler32(markup);
13437 return markupChecksum === existingChecksum;
13438 }
13439 };
13440
13441 module.exports = ReactMarkupChecksum;
13442
13443
13444/***/ },
13445/* 85 */
13446/***/ function(module, exports, __webpack_require__) {
13447
13448 /**
13449 * Copyright 2014, Facebook, Inc.
13450 * All rights reserved.
13451 *
13452 * This source code is licensed under the BSD-style license found in the
13453 * LICENSE file in the root directory of this source tree. An additional grant
13454 * of patent rights can be found in the PATENTS file in the same directory.
13455 *
13456 * @providesModule ReactServerRenderingTransaction
13457 * @typechecks
13458 */
13459
13460 "use strict";
13461
13462 var PooledClass = __webpack_require__(34);
13463 var CallbackQueue = __webpack_require__(88);
13464 var ReactPutListenerQueue = __webpack_require__(130);
13465 var Transaction = __webpack_require__(89);
13466
13467 var assign = __webpack_require__(23);
13468 var emptyFunction = __webpack_require__(83);
13469
13470 /**
13471 * Provides a `CallbackQueue` queue for collecting `onDOMReady` callbacks
13472 * during the performing of the transaction.
13473 */
13474 var ON_DOM_READY_QUEUEING = {
13475 /**
13476 * Initializes the internal `onDOMReady` queue.
13477 */
13478 initialize: function() {
13479 this.reactMountReady.reset();
13480 },
13481
13482 close: emptyFunction
13483 };
13484
13485 var PUT_LISTENER_QUEUEING = {
13486 initialize: function() {
13487 this.putListenerQueue.reset();
13488 },
13489
13490 close: emptyFunction
13491 };
13492
13493 /**
13494 * Executed within the scope of the `Transaction` instance. Consider these as
13495 * being member methods, but with an implied ordering while being isolated from
13496 * each other.
13497 */
13498 var TRANSACTION_WRAPPERS = [
13499 PUT_LISTENER_QUEUEING,
13500 ON_DOM_READY_QUEUEING
13501 ];
13502
13503 /**
13504 * @class ReactServerRenderingTransaction
13505 * @param {boolean} renderToStaticMarkup
13506 */
13507 function ReactServerRenderingTransaction(renderToStaticMarkup) {
13508 this.reinitializeTransaction();
13509 this.renderToStaticMarkup = renderToStaticMarkup;
13510 this.reactMountReady = CallbackQueue.getPooled(null);
13511 this.putListenerQueue = ReactPutListenerQueue.getPooled();
13512 }
13513
13514 var Mixin = {
13515 /**
13516 * @see Transaction
13517 * @abstract
13518 * @final
13519 * @return {array} Empty list of operation wrap proceedures.
13520 */
13521 getTransactionWrappers: function() {
13522 return TRANSACTION_WRAPPERS;
13523 },
13524
13525 /**
13526 * @return {object} The queue to collect `onDOMReady` callbacks with.
13527 */
13528 getReactMountReady: function() {
13529 return this.reactMountReady;
13530 },
13531
13532 getPutListenerQueue: function() {
13533 return this.putListenerQueue;
13534 },
13535
13536 /**
13537 * `PooledClass` looks for this, and will invoke this before allowing this
13538 * instance to be resused.
13539 */
13540 destructor: function() {
13541 CallbackQueue.release(this.reactMountReady);
13542 this.reactMountReady = null;
13543
13544 ReactPutListenerQueue.release(this.putListenerQueue);
13545 this.putListenerQueue = null;
13546 }
13547 };
13548
13549
13550 assign(
13551 ReactServerRenderingTransaction.prototype,
13552 Transaction.Mixin,
13553 Mixin
13554 );
13555
13556 PooledClass.addPoolingTo(ReactServerRenderingTransaction);
13557
13558 module.exports = ReactServerRenderingTransaction;
13559
13560
13561/***/ },
13562/* 86 */
13563/***/ function(module, exports, __webpack_require__) {
13564
13565 /* WEBPACK VAR INJECTION */(function(process) {/**
13566 * Copyright 2013-2014, Facebook, Inc.
13567 * All rights reserved.
13568 *
13569 * This source code is licensed under the BSD-style license found in the
13570 * LICENSE file in the root directory of this source tree. An additional grant
13571 * of patent rights can be found in the PATENTS file in the same directory.
13572 *
13573 * @providesModule emptyObject
13574 */
13575
13576 "use strict";
13577
13578 var emptyObject = {};
13579
13580 if ("production" !== process.env.NODE_ENV) {
13581 Object.freeze(emptyObject);
13582 }
13583
13584 module.exports = emptyObject;
13585
13586 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(27)))
13587
13588/***/ },
13589/* 87 */
13590/***/ function(module, exports, __webpack_require__) {
13591
13592 /**
13593 * Copyright 2013-2014, Facebook, Inc.
13594 * All rights reserved.
13595 *
13596 * This source code is licensed under the BSD-style license found in the
13597 * LICENSE file in the root directory of this source tree. An additional grant
13598 * of patent rights can be found in the PATENTS file in the same directory.
13599 *
13600 * @providesModule joinClasses
13601 * @typechecks static-only
13602 */
13603
13604 "use strict";
13605
13606 /**
13607 * Combines multiple className strings into one.
13608 * http://jsperf.com/joinclasses-args-vs-array
13609 *
13610 * @param {...?string} classes
13611 * @return {string}
13612 */
13613 function joinClasses(className/*, ... */) {
13614 if (!className) {
13615 className = '';
13616 }
13617 var nextClass;
13618 var argLength = arguments.length;
13619 if (argLength > 1) {
13620 for (var ii = 1; ii < argLength; ii++) {
13621 nextClass = arguments[ii];
13622 if (nextClass) {
13623 className = (className ? className + ' ' : '') + nextClass;
13624 }
13625 }
13626 }
13627 return className;
13628 }
13629
13630 module.exports = joinClasses;
13631
13632
13633/***/ },
13634/* 88 */
13635/***/ function(module, exports, __webpack_require__) {
13636
13637 /* WEBPACK VAR INJECTION */(function(process) {/**
13638 * Copyright 2013-2014, Facebook, Inc.
13639 * All rights reserved.
13640 *
13641 * This source code is licensed under the BSD-style license found in the
13642 * LICENSE file in the root directory of this source tree. An additional grant
13643 * of patent rights can be found in the PATENTS file in the same directory.
13644 *
13645 * @providesModule CallbackQueue
13646 */
13647
13648 "use strict";
13649
13650 var PooledClass = __webpack_require__(34);
13651
13652 var assign = __webpack_require__(23);
13653 var invariant = __webpack_require__(33);
13654
13655 /**
13656 * A specialized pseudo-event module to help keep track of components waiting to
13657 * be notified when their DOM representations are available for use.
13658 *
13659 * This implements `PooledClass`, so you should never need to instantiate this.
13660 * Instead, use `CallbackQueue.getPooled()`.
13661 *
13662 * @class ReactMountReady
13663 * @implements PooledClass
13664 * @internal
13665 */
13666 function CallbackQueue() {
13667 this._callbacks = null;
13668 this._contexts = null;
13669 }
13670
13671 assign(CallbackQueue.prototype, {
13672
13673 /**
13674 * Enqueues a callback to be invoked when `notifyAll` is invoked.
13675 *
13676 * @param {function} callback Invoked when `notifyAll` is invoked.
13677 * @param {?object} context Context to call `callback` with.
13678 * @internal
13679 */
13680 enqueue: function(callback, context) {
13681 this._callbacks = this._callbacks || [];
13682 this._contexts = this._contexts || [];
13683 this._callbacks.push(callback);
13684 this._contexts.push(context);
13685 },
13686
13687 /**
13688 * Invokes all enqueued callbacks and clears the queue. This is invoked after
13689 * the DOM representation of a component has been created or updated.
13690 *
13691 * @internal
13692 */
13693 notifyAll: function() {
13694 var callbacks = this._callbacks;
13695 var contexts = this._contexts;
13696 if (callbacks) {
13697 ("production" !== process.env.NODE_ENV ? invariant(
13698 callbacks.length === contexts.length,
13699 "Mismatched list of contexts in callback queue"
13700 ) : invariant(callbacks.length === contexts.length));
13701 this._callbacks = null;
13702 this._contexts = null;
13703 for (var i = 0, l = callbacks.length; i < l; i++) {
13704 callbacks[i].call(contexts[i]);
13705 }
13706 callbacks.length = 0;
13707 contexts.length = 0;
13708 }
13709 },
13710
13711 /**
13712 * Resets the internal queue.
13713 *
13714 * @internal
13715 */
13716 reset: function() {
13717 this._callbacks = null;
13718 this._contexts = null;
13719 },
13720
13721 /**
13722 * `PooledClass` looks for this.
13723 */
13724 destructor: function() {
13725 this.reset();
13726 }
13727
13728 });
13729
13730 PooledClass.addPoolingTo(CallbackQueue);
13731
13732 module.exports = CallbackQueue;
13733
13734 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(27)))
13735
13736/***/ },
13737/* 89 */
13738/***/ function(module, exports, __webpack_require__) {
13739
13740 /* WEBPACK VAR INJECTION */(function(process) {/**
13741 * Copyright 2013-2014, Facebook, Inc.
13742 * All rights reserved.
13743 *
13744 * This source code is licensed under the BSD-style license found in the
13745 * LICENSE file in the root directory of this source tree. An additional grant
13746 * of patent rights can be found in the PATENTS file in the same directory.
13747 *
13748 * @providesModule Transaction
13749 */
13750
13751 "use strict";
13752
13753 var invariant = __webpack_require__(33);
13754
13755 /**
13756 * `Transaction` creates a black box that is able to wrap any method such that
13757 * certain invariants are maintained before and after the method is invoked
13758 * (Even if an exception is thrown while invoking the wrapped method). Whoever
13759 * instantiates a transaction can provide enforcers of the invariants at
13760 * creation time. The `Transaction` class itself will supply one additional
13761 * automatic invariant for you - the invariant that any transaction instance
13762 * should not be run while it is already being run. You would typically create a
13763 * single instance of a `Transaction` for reuse multiple times, that potentially
13764 * is used to wrap several different methods. Wrappers are extremely simple -
13765 * they only require implementing two methods.
13766 *
13767 * <pre>
13768 * wrappers (injected at creation time)
13769 * + +
13770 * | |
13771 * +-----------------|--------|--------------+
13772 * | v | |
13773 * | +---------------+ | |
13774 * | +--| wrapper1 |---|----+ |
13775 * | | +---------------+ v | |
13776 * | | +-------------+ | |
13777 * | | +----| wrapper2 |--------+ |
13778 * | | | +-------------+ | | |
13779 * | | | | | |
13780 * | v v v v | wrapper
13781 * | +---+ +---+ +---------+ +---+ +---+ | invariants
13782 * perform(anyMethod) | | | | | | | | | | | | maintained
13783 * +----------------->|-|---|-|---|-->|anyMethod|---|---|-|---|-|-------->
13784 * | | | | | | | | | | | |
13785 * | | | | | | | | | | | |
13786 * | | | | | | | | | | | |
13787 * | +---+ +---+ +---------+ +---+ +---+ |
13788 * | initialize close |
13789 * +-----------------------------------------+
13790 * </pre>
13791 *
13792 * Use cases:
13793 * - Preserving the input selection ranges before/after reconciliation.
13794 * Restoring selection even in the event of an unexpected error.
13795 * - Deactivating events while rearranging the DOM, preventing blurs/focuses,
13796 * while guaranteeing that afterwards, the event system is reactivated.
13797 * - Flushing a queue of collected DOM mutations to the main UI thread after a
13798 * reconciliation takes place in a worker thread.
13799 * - Invoking any collected `componentDidUpdate` callbacks after rendering new
13800 * content.
13801 * - (Future use case): Wrapping particular flushes of the `ReactWorker` queue
13802 * to preserve the `scrollTop` (an automatic scroll aware DOM).
13803 * - (Future use case): Layout calculations before and after DOM upates.
13804 *
13805 * Transactional plugin API:
13806 * - A module that has an `initialize` method that returns any precomputation.
13807 * - and a `close` method that accepts the precomputation. `close` is invoked
13808 * when the wrapped process is completed, or has failed.
13809 *
13810 * @param {Array<TransactionalWrapper>} transactionWrapper Wrapper modules
13811 * that implement `initialize` and `close`.
13812 * @return {Transaction} Single transaction for reuse in thread.
13813 *
13814 * @class Transaction
13815 */
13816 var Mixin = {
13817 /**
13818 * Sets up this instance so that it is prepared for collecting metrics. Does
13819 * so such that this setup method may be used on an instance that is already
13820 * initialized, in a way that does not consume additional memory upon reuse.
13821 * That can be useful if you decide to make your subclass of this mixin a
13822 * "PooledClass".
13823 */
13824 reinitializeTransaction: function() {
13825 this.transactionWrappers = this.getTransactionWrappers();
13826 if (!this.wrapperInitData) {
13827 this.wrapperInitData = [];
13828 } else {
13829 this.wrapperInitData.length = 0;
13830 }
13831 this._isInTransaction = false;
13832 },
13833
13834 _isInTransaction: false,
13835
13836 /**
13837 * @abstract
13838 * @return {Array<TransactionWrapper>} Array of transaction wrappers.
13839 */
13840 getTransactionWrappers: null,
13841
13842 isInTransaction: function() {
13843 return !!this._isInTransaction;
13844 },
13845
13846 /**
13847 * Executes the function within a safety window. Use this for the top level
13848 * methods that result in large amounts of computation/mutations that would
13849 * need to be safety checked.
13850 *
13851 * @param {function} method Member of scope to call.
13852 * @param {Object} scope Scope to invoke from.
13853 * @param {Object?=} args... Arguments to pass to the method (optional).
13854 * Helps prevent need to bind in many cases.
13855 * @return Return value from `method`.
13856 */
13857 perform: function(method, scope, a, b, c, d, e, f) {
13858 ("production" !== process.env.NODE_ENV ? invariant(
13859 !this.isInTransaction(),
13860 'Transaction.perform(...): Cannot initialize a transaction when there ' +
13861 'is already an outstanding transaction.'
13862 ) : invariant(!this.isInTransaction()));
13863 var errorThrown;
13864 var ret;
13865 try {
13866 this._isInTransaction = true;
13867 // Catching errors makes debugging more difficult, so we start with
13868 // errorThrown set to true before setting it to false after calling
13869 // close -- if it's still set to true in the finally block, it means
13870 // one of these calls threw.
13871 errorThrown = true;
13872 this.initializeAll(0);
13873 ret = method.call(scope, a, b, c, d, e, f);
13874 errorThrown = false;
13875 } finally {
13876 try {
13877 if (errorThrown) {
13878 // If `method` throws, prefer to show that stack trace over any thrown
13879 // by invoking `closeAll`.
13880 try {
13881 this.closeAll(0);
13882 } catch (err) {
13883 }
13884 } else {
13885 // Since `method` didn't throw, we don't want to silence the exception
13886 // here.
13887 this.closeAll(0);
13888 }
13889 } finally {
13890 this._isInTransaction = false;
13891 }
13892 }
13893 return ret;
13894 },
13895
13896 initializeAll: function(startIndex) {
13897 var transactionWrappers = this.transactionWrappers;
13898 for (var i = startIndex; i < transactionWrappers.length; i++) {
13899 var wrapper = transactionWrappers[i];
13900 try {
13901 // Catching errors makes debugging more difficult, so we start with the
13902 // OBSERVED_ERROR state before overwriting it with the real return value
13903 // of initialize -- if it's still set to OBSERVED_ERROR in the finally
13904 // block, it means wrapper.initialize threw.
13905 this.wrapperInitData[i] = Transaction.OBSERVED_ERROR;
13906 this.wrapperInitData[i] = wrapper.initialize ?
13907 wrapper.initialize.call(this) :
13908 null;
13909 } finally {
13910 if (this.wrapperInitData[i] === Transaction.OBSERVED_ERROR) {
13911 // The initializer for wrapper i threw an error; initialize the
13912 // remaining wrappers but silence any exceptions from them to ensure
13913 // that the first error is the one to bubble up.
13914 try {
13915 this.initializeAll(i + 1);
13916 } catch (err) {
13917 }
13918 }
13919 }
13920 }
13921 },
13922
13923 /**
13924 * Invokes each of `this.transactionWrappers.close[i]` functions, passing into
13925 * them the respective return values of `this.transactionWrappers.init[i]`
13926 * (`close`rs that correspond to initializers that failed will not be
13927 * invoked).
13928 */
13929 closeAll: function(startIndex) {
13930 ("production" !== process.env.NODE_ENV ? invariant(
13931 this.isInTransaction(),
13932 'Transaction.closeAll(): Cannot close transaction when none are open.'
13933 ) : invariant(this.isInTransaction()));
13934 var transactionWrappers = this.transactionWrappers;
13935 for (var i = startIndex; i < transactionWrappers.length; i++) {
13936 var wrapper = transactionWrappers[i];
13937 var initData = this.wrapperInitData[i];
13938 var errorThrown;
13939 try {
13940 // Catching errors makes debugging more difficult, so we start with
13941 // errorThrown set to true before setting it to false after calling
13942 // close -- if it's still set to true in the finally block, it means
13943 // wrapper.close threw.
13944 errorThrown = true;
13945 if (initData !== Transaction.OBSERVED_ERROR) {
13946 wrapper.close && wrapper.close.call(this, initData);
13947 }
13948 errorThrown = false;
13949 } finally {
13950 if (errorThrown) {
13951 // The closer for wrapper i threw an error; close the remaining
13952 // wrappers but silence any exceptions from them to ensure that the
13953 // first error is the one to bubble up.
13954 try {
13955 this.closeAll(i + 1);
13956 } catch (e) {
13957 }
13958 }
13959 }
13960 }
13961 this.wrapperInitData.length = 0;
13962 }
13963 };
13964
13965 var Transaction = {
13966
13967 Mixin: Mixin,
13968
13969 /**
13970 * Token to look for to determine if an error occured.
13971 */
13972 OBSERVED_ERROR: {}
13973
13974 };
13975
13976 module.exports = Transaction;
13977
13978 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(27)))
13979
13980/***/ },
13981/* 90 */
13982/***/ function(module, exports, __webpack_require__) {
13983
13984 /* WEBPACK VAR INJECTION */(function(process) {/**
13985 * Copyright 2014, Facebook, Inc.
13986 * All rights reserved.
13987 *
13988 * This source code is licensed under the BSD-style license found in the
13989 * LICENSE file in the root directory of this source tree. An additional grant
13990 * of patent rights can be found in the PATENTS file in the same directory.
13991 *
13992 * @providesModule ReactNativeComponent
13993 */
13994
13995 "use strict";
13996
13997 var assign = __webpack_require__(23);
13998 var invariant = __webpack_require__(33);
13999
14000 var genericComponentClass = null;
14001 // This registry keeps track of wrapper classes around native tags
14002 var tagToComponentClass = {};
14003
14004 var ReactNativeComponentInjection = {
14005 // This accepts a class that receives the tag string. This is a catch all
14006 // that can render any kind of tag.
14007 injectGenericComponentClass: function(componentClass) {
14008 genericComponentClass = componentClass;
14009 },
14010 // This accepts a keyed object with classes as values. Each key represents a
14011 // tag. That particular tag will use this class instead of the generic one.
14012 injectComponentClasses: function(componentClasses) {
14013 assign(tagToComponentClass, componentClasses);
14014 }
14015 };
14016
14017 /**
14018 * Create an internal class for a specific tag.
14019 *
14020 * @param {string} tag The tag for which to create an internal instance.
14021 * @param {any} props The props passed to the instance constructor.
14022 * @return {ReactComponent} component The injected empty component.
14023 */
14024 function createInstanceForTag(tag, props, parentType) {
14025 var componentClass = tagToComponentClass[tag];
14026 if (componentClass == null) {
14027 ("production" !== process.env.NODE_ENV ? invariant(
14028 genericComponentClass,
14029 'There is no registered component for the tag %s',
14030 tag
14031 ) : invariant(genericComponentClass));
14032 return new genericComponentClass(tag, props);
14033 }
14034 if (parentType === tag) {
14035 // Avoid recursion
14036 ("production" !== process.env.NODE_ENV ? invariant(
14037 genericComponentClass,
14038 'There is no registered component for the tag %s',
14039 tag
14040 ) : invariant(genericComponentClass));
14041 return new genericComponentClass(tag, props);
14042 }
14043 // Unwrap legacy factories
14044 return new componentClass.type(props);
14045 }
14046
14047 var ReactNativeComponent = {
14048 createInstanceForTag: createInstanceForTag,
14049 injection: ReactNativeComponentInjection
14050 };
14051
14052 module.exports = ReactNativeComponent;
14053
14054 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(27)))
14055
14056/***/ },
14057/* 91 */
14058/***/ function(module, exports, __webpack_require__) {
14059
14060 /**
14061 * Copyright 2013-2014, Facebook, Inc.
14062 * All rights reserved.
14063 *
14064 * This source code is licensed under the BSD-style license found in the
14065 * LICENSE file in the root directory of this source tree. An additional grant
14066 * of patent rights can be found in the PATENTS file in the same directory.
14067 *
14068 * @providesModule CSSProperty
14069 */
14070
14071 "use strict";
14072
14073 /**
14074 * CSS properties which accept numbers but are not in units of "px".
14075 */
14076 var isUnitlessNumber = {
14077 columnCount: true,
14078 flex: true,
14079 flexGrow: true,
14080 flexShrink: true,
14081 fontWeight: true,
14082 lineClamp: true,
14083 lineHeight: true,
14084 opacity: true,
14085 order: true,
14086 orphans: true,
14087 widows: true,
14088 zIndex: true,
14089 zoom: true,
14090
14091 // SVG-related properties
14092 fillOpacity: true,
14093 strokeOpacity: true
14094 };
14095
14096 /**
14097 * @param {string} prefix vendor-specific prefix, eg: Webkit
14098 * @param {string} key style name, eg: transitionDuration
14099 * @return {string} style name prefixed with `prefix`, properly camelCased, eg:
14100 * WebkitTransitionDuration
14101 */
14102 function prefixKey(prefix, key) {
14103 return prefix + key.charAt(0).toUpperCase() + key.substring(1);
14104 }
14105
14106 /**
14107 * Support style names that may come passed in prefixed by adding permutations
14108 * of vendor prefixes.
14109 */
14110 var prefixes = ['Webkit', 'ms', 'Moz', 'O'];
14111
14112 // Using Object.keys here, or else the vanilla for-in loop makes IE8 go into an
14113 // infinite loop, because it iterates over the newly added props too.
14114 Object.keys(isUnitlessNumber).forEach(function(prop) {
14115 prefixes.forEach(function(prefix) {
14116 isUnitlessNumber[prefixKey(prefix, prop)] = isUnitlessNumber[prop];
14117 });
14118 });
14119
14120 /**
14121 * Most style properties can be unset by doing .style[prop] = '' but IE8
14122 * doesn't like doing that with shorthand properties so for the properties that
14123 * IE8 breaks on, which are listed here, we instead unset each of the
14124 * individual properties. See http://bugs.jquery.com/ticket/12385.
14125 * The 4-value 'clock' properties like margin, padding, border-width seem to
14126 * behave without any problems. Curiously, list-style works too without any
14127 * special prodding.
14128 */
14129 var shorthandPropertyExpansions = {
14130 background: {
14131 backgroundImage: true,
14132 backgroundPosition: true,
14133 backgroundRepeat: true,
14134 backgroundColor: true
14135 },
14136 border: {
14137 borderWidth: true,
14138 borderStyle: true,
14139 borderColor: true
14140 },
14141 borderBottom: {
14142 borderBottomWidth: true,
14143 borderBottomStyle: true,
14144 borderBottomColor: true
14145 },
14146 borderLeft: {
14147 borderLeftWidth: true,
14148 borderLeftStyle: true,
14149 borderLeftColor: true
14150 },
14151 borderRight: {
14152 borderRightWidth: true,
14153 borderRightStyle: true,
14154 borderRightColor: true
14155 },
14156 borderTop: {
14157 borderTopWidth: true,
14158 borderTopStyle: true,
14159 borderTopColor: true
14160 },
14161 font: {
14162 fontStyle: true,
14163 fontVariant: true,
14164 fontWeight: true,
14165 fontSize: true,
14166 lineHeight: true,
14167 fontFamily: true
14168 }
14169 };
14170
14171 var CSSProperty = {
14172 isUnitlessNumber: isUnitlessNumber,
14173 shorthandPropertyExpansions: shorthandPropertyExpansions
14174 };
14175
14176 module.exports = CSSProperty;
14177
14178
14179/***/ },
14180/* 92 */
14181/***/ function(module, exports, __webpack_require__) {
14182
14183 /**
14184 * Copyright 2014, Facebook, Inc.
14185 * All rights reserved.
14186 *
14187 * This source code is licensed under the BSD-style license found in the
14188 * LICENSE file in the root directory of this source tree. An additional grant
14189 * of patent rights can be found in the PATENTS file in the same directory.
14190 *
14191 * @providesModule camelizeStyleName
14192 * @typechecks
14193 */
14194
14195 "use strict";
14196
14197 var camelize = __webpack_require__(131);
14198
14199 var msPattern = /^-ms-/;
14200
14201 /**
14202 * Camelcases a hyphenated CSS property name, for example:
14203 *
14204 * > camelizeStyleName('background-color')
14205 * < "backgroundColor"
14206 * > camelizeStyleName('-moz-transition')
14207 * < "MozTransition"
14208 * > camelizeStyleName('-ms-transition')
14209 * < "msTransition"
14210 *
14211 * As Andi Smith suggests
14212 * (http://www.andismith.com/blog/2012/02/modernizr-prefixed/), an `-ms` prefix
14213 * is converted to lowercase `ms`.
14214 *
14215 * @param {string} string
14216 * @return {string}
14217 */
14218 function camelizeStyleName(string) {
14219 return camelize(string.replace(msPattern, 'ms-'));
14220 }
14221
14222 module.exports = camelizeStyleName;
14223
14224
14225/***/ },
14226/* 93 */
14227/***/ function(module, exports, __webpack_require__) {
14228
14229 /**
14230 * Copyright 2013-2014, Facebook, Inc.
14231 * All rights reserved.
14232 *
14233 * This source code is licensed under the BSD-style license found in the
14234 * LICENSE file in the root directory of this source tree. An additional grant
14235 * of patent rights can be found in the PATENTS file in the same directory.
14236 *
14237 * @providesModule dangerousStyleValue
14238 * @typechecks static-only
14239 */
14240
14241 "use strict";
14242
14243 var CSSProperty = __webpack_require__(91);
14244
14245 var isUnitlessNumber = CSSProperty.isUnitlessNumber;
14246
14247 /**
14248 * Convert a value into the proper css writable value. The style name `name`
14249 * should be logical (no hyphens), as specified
14250 * in `CSSProperty.isUnitlessNumber`.
14251 *
14252 * @param {string} name CSS property name such as `topMargin`.
14253 * @param {*} value CSS property value such as `10px`.
14254 * @return {string} Normalized style value with dimensions applied.
14255 */
14256 function dangerousStyleValue(name, value) {
14257 // Note that we've removed escapeTextForBrowser() calls here since the
14258 // whole string will be escaped when the attribute is injected into
14259 // the markup. If you provide unsafe user data here they can inject
14260 // arbitrary CSS which may be problematic (I couldn't repro this):
14261 // https://www.owasp.org/index.php/XSS_Filter_Evasion_Cheat_Sheet
14262 // http://www.thespanner.co.uk/2007/11/26/ultimate-xss-css-injection/
14263 // This is not an XSS hole but instead a potential CSS injection issue
14264 // which has lead to a greater discussion about how we're going to
14265 // trust URLs moving forward. See #2115901
14266
14267 var isEmpty = value == null || typeof value === 'boolean' || value === '';
14268 if (isEmpty) {
14269 return '';
14270 }
14271
14272 var isNonNumeric = isNaN(value);
14273 if (isNonNumeric || value === 0 ||
14274 isUnitlessNumber.hasOwnProperty(name) && isUnitlessNumber[name]) {
14275 return '' + value; // cast to string
14276 }
14277
14278 if (typeof value === 'string') {
14279 value = value.trim();
14280 }
14281 return value + 'px';
14282 }
14283
14284 module.exports = dangerousStyleValue;
14285
14286
14287/***/ },
14288/* 94 */
14289/***/ function(module, exports, __webpack_require__) {
14290
14291 /**
14292 * Copyright 2013-2014, Facebook, Inc.
14293 * All rights reserved.
14294 *
14295 * This source code is licensed under the BSD-style license found in the
14296 * LICENSE file in the root directory of this source tree. An additional grant
14297 * of patent rights can be found in the PATENTS file in the same directory.
14298 *
14299 * @providesModule hyphenateStyleName
14300 * @typechecks
14301 */
14302
14303 "use strict";
14304
14305 var hyphenate = __webpack_require__(134);
14306
14307 var msPattern = /^ms-/;
14308
14309 /**
14310 * Hyphenates a camelcased CSS property name, for example:
14311 *
14312 * > hyphenateStyleName('backgroundColor')
14313 * < "background-color"
14314 * > hyphenateStyleName('MozTransition')
14315 * < "-moz-transition"
14316 * > hyphenateStyleName('msTransition')
14317 * < "-ms-transition"
14318 *
14319 * As Modernizr suggests (http://modernizr.com/docs/#prefixed), an `ms` prefix
14320 * is converted to `-ms-`.
14321 *
14322 * @param {string} string
14323 * @return {string}
14324 */
14325 function hyphenateStyleName(string) {
14326 return hyphenate(string).replace(msPattern, '-ms-');
14327 }
14328
14329 module.exports = hyphenateStyleName;
14330
14331
14332/***/ },
14333/* 95 */
14334/***/ function(module, exports, __webpack_require__) {
14335
14336 /* WEBPACK VAR INJECTION */(function(process) {/**
14337 * Copyright 2013-2014, Facebook, Inc.
14338 * All rights reserved.
14339 *
14340 * This source code is licensed under the BSD-style license found in the
14341 * LICENSE file in the root directory of this source tree. An additional grant
14342 * of patent rights can be found in the PATENTS file in the same directory.
14343 *
14344 * @providesModule EventPluginHub
14345 */
14346
14347 "use strict";
14348
14349 var EventPluginRegistry = __webpack_require__(96);
14350 var EventPluginUtils = __webpack_require__(4);
14351
14352 var accumulateInto = __webpack_require__(132);
14353 var forEachAccumulated = __webpack_require__(133);
14354 var invariant = __webpack_require__(33);
14355
14356 /**
14357 * Internal store for event listeners
14358 */
14359 var listenerBank = {};
14360
14361 /**
14362 * Internal queue of events that have accumulated their dispatches and are
14363 * waiting to have their dispatches executed.
14364 */
14365 var eventQueue = null;
14366
14367 /**
14368 * Dispatches an event and releases it back into the pool, unless persistent.
14369 *
14370 * @param {?object} event Synthetic event to be dispatched.
14371 * @private
14372 */
14373 var executeDispatchesAndRelease = function(event) {
14374 if (event) {
14375 var executeDispatch = EventPluginUtils.executeDispatch;
14376 // Plugins can provide custom behavior when dispatching events.
14377 var PluginModule = EventPluginRegistry.getPluginModuleForEvent(event);
14378 if (PluginModule && PluginModule.executeDispatch) {
14379 executeDispatch = PluginModule.executeDispatch;
14380 }
14381 EventPluginUtils.executeDispatchesInOrder(event, executeDispatch);
14382
14383 if (!event.isPersistent()) {
14384 event.constructor.release(event);
14385 }
14386 }
14387 };
14388
14389 /**
14390 * - `InstanceHandle`: [required] Module that performs logical traversals of DOM
14391 * hierarchy given ids of the logical DOM elements involved.
14392 */
14393 var InstanceHandle = null;
14394
14395 function validateInstanceHandle() {
14396 var invalid = !InstanceHandle||
14397 !InstanceHandle.traverseTwoPhase ||
14398 !InstanceHandle.traverseEnterLeave;
14399 if (invalid) {
14400 throw new Error('InstanceHandle not injected before use!');
14401 }
14402 }
14403
14404 /**
14405 * This is a unified interface for event plugins to be installed and configured.
14406 *
14407 * Event plugins can implement the following properties:
14408 *
14409 * `extractEvents` {function(string, DOMEventTarget, string, object): *}
14410 * Required. When a top-level event is fired, this method is expected to
14411 * extract synthetic events that will in turn be queued and dispatched.
14412 *
14413 * `eventTypes` {object}
14414 * Optional, plugins that fire events must publish a mapping of registration
14415 * names that are used to register listeners. Values of this mapping must
14416 * be objects that contain `registrationName` or `phasedRegistrationNames`.
14417 *
14418 * `executeDispatch` {function(object, function, string)}
14419 * Optional, allows plugins to override how an event gets dispatched. By
14420 * default, the listener is simply invoked.
14421 *
14422 * Each plugin that is injected into `EventsPluginHub` is immediately operable.
14423 *
14424 * @public
14425 */
14426 var EventPluginHub = {
14427
14428 /**
14429 * Methods for injecting dependencies.
14430 */
14431 injection: {
14432
14433 /**
14434 * @param {object} InjectedMount
14435 * @public
14436 */
14437 injectMount: EventPluginUtils.injection.injectMount,
14438
14439 /**
14440 * @param {object} InjectedInstanceHandle
14441 * @public
14442 */
14443 injectInstanceHandle: function(InjectedInstanceHandle) {
14444 InstanceHandle = InjectedInstanceHandle;
14445 if ("production" !== process.env.NODE_ENV) {
14446 validateInstanceHandle();
14447 }
14448 },
14449
14450 getInstanceHandle: function() {
14451 if ("production" !== process.env.NODE_ENV) {
14452 validateInstanceHandle();
14453 }
14454 return InstanceHandle;
14455 },
14456
14457 /**
14458 * @param {array} InjectedEventPluginOrder
14459 * @public
14460 */
14461 injectEventPluginOrder: EventPluginRegistry.injectEventPluginOrder,
14462
14463 /**
14464 * @param {object} injectedNamesToPlugins Map from names to plugin modules.
14465 */
14466 injectEventPluginsByName: EventPluginRegistry.injectEventPluginsByName
14467
14468 },
14469
14470 eventNameDispatchConfigs: EventPluginRegistry.eventNameDispatchConfigs,
14471
14472 registrationNameModules: EventPluginRegistry.registrationNameModules,
14473
14474 /**
14475 * Stores `listener` at `listenerBank[registrationName][id]`. Is idempotent.
14476 *
14477 * @param {string} id ID of the DOM element.
14478 * @param {string} registrationName Name of listener (e.g. `onClick`).
14479 * @param {?function} listener The callback to store.
14480 */
14481 putListener: function(id, registrationName, listener) {
14482 ("production" !== process.env.NODE_ENV ? invariant(
14483 !listener || typeof listener === 'function',
14484 'Expected %s listener to be a function, instead got type %s',
14485 registrationName, typeof listener
14486 ) : invariant(!listener || typeof listener === 'function'));
14487
14488 var bankForRegistrationName =
14489 listenerBank[registrationName] || (listenerBank[registrationName] = {});
14490 bankForRegistrationName[id] = listener;
14491 },
14492
14493 /**
14494 * @param {string} id ID of the DOM element.
14495 * @param {string} registrationName Name of listener (e.g. `onClick`).
14496 * @return {?function} The stored callback.
14497 */
14498 getListener: function(id, registrationName) {
14499 var bankForRegistrationName = listenerBank[registrationName];
14500 return bankForRegistrationName && bankForRegistrationName[id];
14501 },
14502
14503 /**
14504 * Deletes a listener from the registration bank.
14505 *
14506 * @param {string} id ID of the DOM element.
14507 * @param {string} registrationName Name of listener (e.g. `onClick`).
14508 */
14509 deleteListener: function(id, registrationName) {
14510 var bankForRegistrationName = listenerBank[registrationName];
14511 if (bankForRegistrationName) {
14512 delete bankForRegistrationName[id];
14513 }
14514 },
14515
14516 /**
14517 * Deletes all listeners for the DOM element with the supplied ID.
14518 *
14519 * @param {string} id ID of the DOM element.
14520 */
14521 deleteAllListeners: function(id) {
14522 for (var registrationName in listenerBank) {
14523 delete listenerBank[registrationName][id];
14524 }
14525 },
14526
14527 /**
14528 * Allows registered plugins an opportunity to extract events from top-level
14529 * native browser events.
14530 *
14531 * @param {string} topLevelType Record from `EventConstants`.
14532 * @param {DOMEventTarget} topLevelTarget The listening component root node.
14533 * @param {string} topLevelTargetID ID of `topLevelTarget`.
14534 * @param {object} nativeEvent Native browser event.
14535 * @return {*} An accumulation of synthetic events.
14536 * @internal
14537 */
14538 extractEvents: function(
14539 topLevelType,
14540 topLevelTarget,
14541 topLevelTargetID,
14542 nativeEvent) {
14543 var events;
14544 var plugins = EventPluginRegistry.plugins;
14545 for (var i = 0, l = plugins.length; i < l; i++) {
14546 // Not every plugin in the ordering may be loaded at runtime.
14547 var possiblePlugin = plugins[i];
14548 if (possiblePlugin) {
14549 var extractedEvents = possiblePlugin.extractEvents(
14550 topLevelType,
14551 topLevelTarget,
14552 topLevelTargetID,
14553 nativeEvent
14554 );
14555 if (extractedEvents) {
14556 events = accumulateInto(events, extractedEvents);
14557 }
14558 }
14559 }
14560 return events;
14561 },
14562
14563 /**
14564 * Enqueues a synthetic event that should be dispatched when
14565 * `processEventQueue` is invoked.
14566 *
14567 * @param {*} events An accumulation of synthetic events.
14568 * @internal
14569 */
14570 enqueueEvents: function(events) {
14571 if (events) {
14572 eventQueue = accumulateInto(eventQueue, events);
14573 }
14574 },
14575
14576 /**
14577 * Dispatches all synthetic events on the event queue.
14578 *
14579 * @internal
14580 */
14581 processEventQueue: function() {
14582 // Set `eventQueue` to null before processing it so that we can tell if more
14583 // events get enqueued while processing.
14584 var processingEventQueue = eventQueue;
14585 eventQueue = null;
14586 forEachAccumulated(processingEventQueue, executeDispatchesAndRelease);
14587 ("production" !== process.env.NODE_ENV ? invariant(
14588 !eventQueue,
14589 'processEventQueue(): Additional events were enqueued while processing ' +
14590 'an event queue. Support for this has not yet been implemented.'
14591 ) : invariant(!eventQueue));
14592 },
14593
14594 /**
14595 * These are needed for tests only. Do not use!
14596 */
14597 __purge: function() {
14598 listenerBank = {};
14599 },
14600
14601 __getListenerBank: function() {
14602 return listenerBank;
14603 }
14604
14605 };
14606
14607 module.exports = EventPluginHub;
14608
14609 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(27)))
14610
14611/***/ },
14612/* 96 */
14613/***/ function(module, exports, __webpack_require__) {
14614
14615 /* WEBPACK VAR INJECTION */(function(process) {/**
14616 * Copyright 2013-2014, Facebook, Inc.
14617 * All rights reserved.
14618 *
14619 * This source code is licensed under the BSD-style license found in the
14620 * LICENSE file in the root directory of this source tree. An additional grant
14621 * of patent rights can be found in the PATENTS file in the same directory.
14622 *
14623 * @providesModule EventPluginRegistry
14624 * @typechecks static-only
14625 */
14626
14627 "use strict";
14628
14629 var invariant = __webpack_require__(33);
14630
14631 /**
14632 * Injectable ordering of event plugins.
14633 */
14634 var EventPluginOrder = null;
14635
14636 /**
14637 * Injectable mapping from names to event plugin modules.
14638 */
14639 var namesToPlugins = {};
14640
14641 /**
14642 * Recomputes the plugin list using the injected plugins and plugin ordering.
14643 *
14644 * @private
14645 */
14646 function recomputePluginOrdering() {
14647 if (!EventPluginOrder) {
14648 // Wait until an `EventPluginOrder` is injected.
14649 return;
14650 }
14651 for (var pluginName in namesToPlugins) {
14652 var PluginModule = namesToPlugins[pluginName];
14653 var pluginIndex = EventPluginOrder.indexOf(pluginName);
14654 ("production" !== process.env.NODE_ENV ? invariant(
14655 pluginIndex > -1,
14656 'EventPluginRegistry: Cannot inject event plugins that do not exist in ' +
14657 'the plugin ordering, `%s`.',
14658 pluginName
14659 ) : invariant(pluginIndex > -1));
14660 if (EventPluginRegistry.plugins[pluginIndex]) {
14661 continue;
14662 }
14663 ("production" !== process.env.NODE_ENV ? invariant(
14664 PluginModule.extractEvents,
14665 'EventPluginRegistry: Event plugins must implement an `extractEvents` ' +
14666 'method, but `%s` does not.',
14667 pluginName
14668 ) : invariant(PluginModule.extractEvents));
14669 EventPluginRegistry.plugins[pluginIndex] = PluginModule;
14670 var publishedEvents = PluginModule.eventTypes;
14671 for (var eventName in publishedEvents) {
14672 ("production" !== process.env.NODE_ENV ? invariant(
14673 publishEventForPlugin(
14674 publishedEvents[eventName],
14675 PluginModule,
14676 eventName
14677 ),
14678 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.',
14679 eventName,
14680 pluginName
14681 ) : invariant(publishEventForPlugin(
14682 publishedEvents[eventName],
14683 PluginModule,
14684 eventName
14685 )));
14686 }
14687 }
14688 }
14689
14690 /**
14691 * Publishes an event so that it can be dispatched by the supplied plugin.
14692 *
14693 * @param {object} dispatchConfig Dispatch configuration for the event.
14694 * @param {object} PluginModule Plugin publishing the event.
14695 * @return {boolean} True if the event was successfully published.
14696 * @private
14697 */
14698 function publishEventForPlugin(dispatchConfig, PluginModule, eventName) {
14699 ("production" !== process.env.NODE_ENV ? invariant(
14700 !EventPluginRegistry.eventNameDispatchConfigs.hasOwnProperty(eventName),
14701 'EventPluginHub: More than one plugin attempted to publish the same ' +
14702 'event name, `%s`.',
14703 eventName
14704 ) : invariant(!EventPluginRegistry.eventNameDispatchConfigs.hasOwnProperty(eventName)));
14705 EventPluginRegistry.eventNameDispatchConfigs[eventName] = dispatchConfig;
14706
14707 var phasedRegistrationNames = dispatchConfig.phasedRegistrationNames;
14708 if (phasedRegistrationNames) {
14709 for (var phaseName in phasedRegistrationNames) {
14710 if (phasedRegistrationNames.hasOwnProperty(phaseName)) {
14711 var phasedRegistrationName = phasedRegistrationNames[phaseName];
14712 publishRegistrationName(
14713 phasedRegistrationName,
14714 PluginModule,
14715 eventName
14716 );
14717 }
14718 }
14719 return true;
14720 } else if (dispatchConfig.registrationName) {
14721 publishRegistrationName(
14722 dispatchConfig.registrationName,
14723 PluginModule,
14724 eventName
14725 );
14726 return true;
14727 }
14728 return false;
14729 }
14730
14731 /**
14732 * Publishes a registration name that is used to identify dispatched events and
14733 * can be used with `EventPluginHub.putListener` to register listeners.
14734 *
14735 * @param {string} registrationName Registration name to add.
14736 * @param {object} PluginModule Plugin publishing the event.
14737 * @private
14738 */
14739 function publishRegistrationName(registrationName, PluginModule, eventName) {
14740 ("production" !== process.env.NODE_ENV ? invariant(
14741 !EventPluginRegistry.registrationNameModules[registrationName],
14742 'EventPluginHub: More than one plugin attempted to publish the same ' +
14743 'registration name, `%s`.',
14744 registrationName
14745 ) : invariant(!EventPluginRegistry.registrationNameModules[registrationName]));
14746 EventPluginRegistry.registrationNameModules[registrationName] = PluginModule;
14747 EventPluginRegistry.registrationNameDependencies[registrationName] =
14748 PluginModule.eventTypes[eventName].dependencies;
14749 }
14750
14751 /**
14752 * Registers plugins so that they can extract and dispatch events.
14753 *
14754 * @see {EventPluginHub}
14755 */
14756 var EventPluginRegistry = {
14757
14758 /**
14759 * Ordered list of injected plugins.
14760 */
14761 plugins: [],
14762
14763 /**
14764 * Mapping from event name to dispatch config
14765 */
14766 eventNameDispatchConfigs: {},
14767
14768 /**
14769 * Mapping from registration name to plugin module
14770 */
14771 registrationNameModules: {},
14772
14773 /**
14774 * Mapping from registration name to event name
14775 */
14776 registrationNameDependencies: {},
14777
14778 /**
14779 * Injects an ordering of plugins (by plugin name). This allows the ordering
14780 * to be decoupled from injection of the actual plugins so that ordering is
14781 * always deterministic regardless of packaging, on-the-fly injection, etc.
14782 *
14783 * @param {array} InjectedEventPluginOrder
14784 * @internal
14785 * @see {EventPluginHub.injection.injectEventPluginOrder}
14786 */
14787 injectEventPluginOrder: function(InjectedEventPluginOrder) {
14788 ("production" !== process.env.NODE_ENV ? invariant(
14789 !EventPluginOrder,
14790 'EventPluginRegistry: Cannot inject event plugin ordering more than ' +
14791 'once. You are likely trying to load more than one copy of React.'
14792 ) : invariant(!EventPluginOrder));
14793 // Clone the ordering so it cannot be dynamically mutated.
14794 EventPluginOrder = Array.prototype.slice.call(InjectedEventPluginOrder);
14795 recomputePluginOrdering();
14796 },
14797
14798 /**
14799 * Injects plugins to be used by `EventPluginHub`. The plugin names must be
14800 * in the ordering injected by `injectEventPluginOrder`.
14801 *
14802 * Plugins can be injected as part of page initialization or on-the-fly.
14803 *
14804 * @param {object} injectedNamesToPlugins Map from names to plugin modules.
14805 * @internal
14806 * @see {EventPluginHub.injection.injectEventPluginsByName}
14807 */
14808 injectEventPluginsByName: function(injectedNamesToPlugins) {
14809 var isOrderingDirty = false;
14810 for (var pluginName in injectedNamesToPlugins) {
14811 if (!injectedNamesToPlugins.hasOwnProperty(pluginName)) {
14812 continue;
14813 }
14814 var PluginModule = injectedNamesToPlugins[pluginName];
14815 if (!namesToPlugins.hasOwnProperty(pluginName) ||
14816 namesToPlugins[pluginName] !== PluginModule) {
14817 ("production" !== process.env.NODE_ENV ? invariant(
14818 !namesToPlugins[pluginName],
14819 'EventPluginRegistry: Cannot inject two different event plugins ' +
14820 'using the same name, `%s`.',
14821 pluginName
14822 ) : invariant(!namesToPlugins[pluginName]));
14823 namesToPlugins[pluginName] = PluginModule;
14824 isOrderingDirty = true;
14825 }
14826 }
14827 if (isOrderingDirty) {
14828 recomputePluginOrdering();
14829 }
14830 },
14831
14832 /**
14833 * Looks up the plugin for the supplied event.
14834 *
14835 * @param {object} event A synthetic event.
14836 * @return {?object} The plugin that created the supplied event.
14837 * @internal
14838 */
14839 getPluginModuleForEvent: function(event) {
14840 var dispatchConfig = event.dispatchConfig;
14841 if (dispatchConfig.registrationName) {
14842 return EventPluginRegistry.registrationNameModules[
14843 dispatchConfig.registrationName
14844 ] || null;
14845 }
14846 for (var phase in dispatchConfig.phasedRegistrationNames) {
14847 if (!dispatchConfig.phasedRegistrationNames.hasOwnProperty(phase)) {
14848 continue;
14849 }
14850 var PluginModule = EventPluginRegistry.registrationNameModules[
14851 dispatchConfig.phasedRegistrationNames[phase]
14852 ];
14853 if (PluginModule) {
14854 return PluginModule;
14855 }
14856 }
14857 return null;
14858 },
14859
14860 /**
14861 * Exposed for unit testing.
14862 * @private
14863 */
14864 _resetEventPlugins: function() {
14865 EventPluginOrder = null;
14866 for (var pluginName in namesToPlugins) {
14867 if (namesToPlugins.hasOwnProperty(pluginName)) {
14868 delete namesToPlugins[pluginName];
14869 }
14870 }
14871 EventPluginRegistry.plugins.length = 0;
14872
14873 var eventNameDispatchConfigs = EventPluginRegistry.eventNameDispatchConfigs;
14874 for (var eventName in eventNameDispatchConfigs) {
14875 if (eventNameDispatchConfigs.hasOwnProperty(eventName)) {
14876 delete eventNameDispatchConfigs[eventName];
14877 }
14878 }
14879
14880 var registrationNameModules = EventPluginRegistry.registrationNameModules;
14881 for (var registrationName in registrationNameModules) {
14882 if (registrationNameModules.hasOwnProperty(registrationName)) {
14883 delete registrationNameModules[registrationName];
14884 }
14885 }
14886 }
14887
14888 };
14889
14890 module.exports = EventPluginRegistry;
14891
14892 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(27)))
14893
14894/***/ },
14895/* 97 */
14896/***/ function(module, exports, __webpack_require__) {
14897
14898 /**
14899 * Copyright 2013-2014, Facebook, Inc.
14900 * All rights reserved.
14901 *
14902 * This source code is licensed under the BSD-style license found in the
14903 * LICENSE file in the root directory of this source tree. An additional grant
14904 * of patent rights can be found in the PATENTS file in the same directory.
14905 *
14906 * @providesModule ReactEventEmitterMixin
14907 */
14908
14909 "use strict";
14910
14911 var EventPluginHub = __webpack_require__(95);
14912
14913 function runEventQueueInBatch(events) {
14914 EventPluginHub.enqueueEvents(events);
14915 EventPluginHub.processEventQueue();
14916 }
14917
14918 var ReactEventEmitterMixin = {
14919
14920 /**
14921 * Streams a fired top-level event to `EventPluginHub` where plugins have the
14922 * opportunity to create `ReactEvent`s to be dispatched.
14923 *
14924 * @param {string} topLevelType Record from `EventConstants`.
14925 * @param {object} topLevelTarget The listening component root node.
14926 * @param {string} topLevelTargetID ID of `topLevelTarget`.
14927 * @param {object} nativeEvent Native environment event.
14928 */
14929 handleTopLevel: function(
14930 topLevelType,
14931 topLevelTarget,
14932 topLevelTargetID,
14933 nativeEvent) {
14934 var events = EventPluginHub.extractEvents(
14935 topLevelType,
14936 topLevelTarget,
14937 topLevelTargetID,
14938 nativeEvent
14939 );
14940
14941 runEventQueueInBatch(events);
14942 }
14943 };
14944
14945 module.exports = ReactEventEmitterMixin;
14946
14947
14948/***/ },
14949/* 98 */
14950/***/ function(module, exports, __webpack_require__) {
14951
14952 /**
14953 * Copyright 2013-2014, Facebook, Inc.
14954 * All rights reserved.
14955 *
14956 * This source code is licensed under the BSD-style license found in the
14957 * LICENSE file in the root directory of this source tree. An additional grant
14958 * of patent rights can be found in the PATENTS file in the same directory.
14959 *
14960 * @providesModule ViewportMetrics
14961 */
14962
14963 "use strict";
14964
14965 var getUnboundedScrollPosition = __webpack_require__(115);
14966
14967 var ViewportMetrics = {
14968
14969 currentScrollLeft: 0,
14970
14971 currentScrollTop: 0,
14972
14973 refreshScrollValues: function() {
14974 var scrollPosition = getUnboundedScrollPosition(window);
14975 ViewportMetrics.currentScrollLeft = scrollPosition.x;
14976 ViewportMetrics.currentScrollTop = scrollPosition.y;
14977 }
14978
14979 };
14980
14981 module.exports = ViewportMetrics;
14982
14983
14984/***/ },
14985/* 99 */
14986/***/ function(module, exports, __webpack_require__) {
14987
14988 /* WEBPACK VAR INJECTION */(function(process) {/**
14989 * Copyright 2013-2014, Facebook, Inc.
14990 * All rights reserved.
14991 *
14992 * This source code is licensed under the BSD-style license found in the
14993 * LICENSE file in the root directory of this source tree. An additional grant
14994 * of patent rights can be found in the PATENTS file in the same directory.
14995 *
14996 * @providesModule EventPropagators
14997 */
14998
14999 "use strict";
15000
15001 var EventConstants = __webpack_require__(32);
15002 var EventPluginHub = __webpack_require__(95);
15003
15004 var accumulateInto = __webpack_require__(132);
15005 var forEachAccumulated = __webpack_require__(133);
15006
15007 var PropagationPhases = EventConstants.PropagationPhases;
15008 var getListener = EventPluginHub.getListener;
15009
15010 /**
15011 * Some event types have a notion of different registration names for different
15012 * "phases" of propagation. This finds listeners by a given phase.
15013 */
15014 function listenerAtPhase(id, event, propagationPhase) {
15015 var registrationName =
15016 event.dispatchConfig.phasedRegistrationNames[propagationPhase];
15017 return getListener(id, registrationName);
15018 }
15019
15020 /**
15021 * Tags a `SyntheticEvent` with dispatched listeners. Creating this function
15022 * here, allows us to not have to bind or create functions for each event.
15023 * Mutating the event's members allows us to not have to create a wrapping
15024 * "dispatch" object that pairs the event with the listener.
15025 */
15026 function accumulateDirectionalDispatches(domID, upwards, event) {
15027 if ("production" !== process.env.NODE_ENV) {
15028 if (!domID) {
15029 throw new Error('Dispatching id must not be null');
15030 }
15031 }
15032 var phase = upwards ? PropagationPhases.bubbled : PropagationPhases.captured;
15033 var listener = listenerAtPhase(domID, event, phase);
15034 if (listener) {
15035 event._dispatchListeners =
15036 accumulateInto(event._dispatchListeners, listener);
15037 event._dispatchIDs = accumulateInto(event._dispatchIDs, domID);
15038 }
15039 }
15040
15041 /**
15042 * Collect dispatches (must be entirely collected before dispatching - see unit
15043 * tests). Lazily allocate the array to conserve memory. We must loop through
15044 * each event and perform the traversal for each one. We can not perform a
15045 * single traversal for the entire collection of events because each event may
15046 * have a different target.
15047 */
15048 function accumulateTwoPhaseDispatchesSingle(event) {
15049 if (event && event.dispatchConfig.phasedRegistrationNames) {
15050 EventPluginHub.injection.getInstanceHandle().traverseTwoPhase(
15051 event.dispatchMarker,
15052 accumulateDirectionalDispatches,
15053 event
15054 );
15055 }
15056 }
15057
15058
15059 /**
15060 * Accumulates without regard to direction, does not look for phased
15061 * registration names. Same as `accumulateDirectDispatchesSingle` but without
15062 * requiring that the `dispatchMarker` be the same as the dispatched ID.
15063 */
15064 function accumulateDispatches(id, ignoredDirection, event) {
15065 if (event && event.dispatchConfig.registrationName) {
15066 var registrationName = event.dispatchConfig.registrationName;
15067 var listener = getListener(id, registrationName);
15068 if (listener) {
15069 event._dispatchListeners =
15070 accumulateInto(event._dispatchListeners, listener);
15071 event._dispatchIDs = accumulateInto(event._dispatchIDs, id);
15072 }
15073 }
15074 }
15075
15076 /**
15077 * Accumulates dispatches on an `SyntheticEvent`, but only for the
15078 * `dispatchMarker`.
15079 * @param {SyntheticEvent} event
15080 */
15081 function accumulateDirectDispatchesSingle(event) {
15082 if (event && event.dispatchConfig.registrationName) {
15083 accumulateDispatches(event.dispatchMarker, null, event);
15084 }
15085 }
15086
15087 function accumulateTwoPhaseDispatches(events) {
15088 forEachAccumulated(events, accumulateTwoPhaseDispatchesSingle);
15089 }
15090
15091 function accumulateEnterLeaveDispatches(leave, enter, fromID, toID) {
15092 EventPluginHub.injection.getInstanceHandle().traverseEnterLeave(
15093 fromID,
15094 toID,
15095 accumulateDispatches,
15096 leave,
15097 enter
15098 );
15099 }
15100
15101
15102 function accumulateDirectDispatches(events) {
15103 forEachAccumulated(events, accumulateDirectDispatchesSingle);
15104 }
15105
15106
15107
15108 /**
15109 * A small set of propagation patterns, each of which will accept a small amount
15110 * of information, and generate a set of "dispatch ready event objects" - which
15111 * are sets of events that have already been annotated with a set of dispatched
15112 * listener functions/ids. The API is designed this way to discourage these
15113 * propagation strategies from actually executing the dispatches, since we
15114 * always want to collect the entire set of dispatches before executing event a
15115 * single one.
15116 *
15117 * @constructor EventPropagators
15118 */
15119 var EventPropagators = {
15120 accumulateTwoPhaseDispatches: accumulateTwoPhaseDispatches,
15121 accumulateDirectDispatches: accumulateDirectDispatches,
15122 accumulateEnterLeaveDispatches: accumulateEnterLeaveDispatches
15123 };
15124
15125 module.exports = EventPropagators;
15126
15127 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(27)))
15128
15129/***/ },
15130/* 100 */
15131/***/ function(module, exports, __webpack_require__) {
15132
15133 /**
15134 * Copyright 2013 Facebook, Inc.
15135 * All rights reserved.
15136 *
15137 * This source code is licensed under the BSD-style license found in the
15138 * LICENSE file in the root directory of this source tree. An additional grant
15139 * of patent rights can be found in the PATENTS file in the same directory.
15140 *
15141 * @providesModule SyntheticInputEvent
15142 * @typechecks static-only
15143 */
15144
15145 "use strict";
15146
15147 var SyntheticEvent = __webpack_require__(101);
15148
15149 /**
15150 * @interface Event
15151 * @see http://www.w3.org/TR/2013/WD-DOM-Level-3-Events-20131105
15152 * /#events-inputevents
15153 */
15154 var InputEventInterface = {
15155 data: null
15156 };
15157
15158 /**
15159 * @param {object} dispatchConfig Configuration used to dispatch this event.
15160 * @param {string} dispatchMarker Marker identifying the event target.
15161 * @param {object} nativeEvent Native browser event.
15162 * @extends {SyntheticUIEvent}
15163 */
15164 function SyntheticInputEvent(
15165 dispatchConfig,
15166 dispatchMarker,
15167 nativeEvent) {
15168 SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent);
15169 }
15170
15171 SyntheticEvent.augmentClass(
15172 SyntheticInputEvent,
15173 InputEventInterface
15174 );
15175
15176 module.exports = SyntheticInputEvent;
15177
15178
15179
15180/***/ },
15181/* 101 */
15182/***/ function(module, exports, __webpack_require__) {
15183
15184 /**
15185 * Copyright 2013-2014, Facebook, Inc.
15186 * All rights reserved.
15187 *
15188 * This source code is licensed under the BSD-style license found in the
15189 * LICENSE file in the root directory of this source tree. An additional grant
15190 * of patent rights can be found in the PATENTS file in the same directory.
15191 *
15192 * @providesModule SyntheticEvent
15193 * @typechecks static-only
15194 */
15195
15196 "use strict";
15197
15198 var PooledClass = __webpack_require__(34);
15199
15200 var assign = __webpack_require__(23);
15201 var emptyFunction = __webpack_require__(83);
15202 var getEventTarget = __webpack_require__(114);
15203
15204 /**
15205 * @interface Event
15206 * @see http://www.w3.org/TR/DOM-Level-3-Events/
15207 */
15208 var EventInterface = {
15209 type: null,
15210 target: getEventTarget,
15211 // currentTarget is set when dispatching; no use in copying it here
15212 currentTarget: emptyFunction.thatReturnsNull,
15213 eventPhase: null,
15214 bubbles: null,
15215 cancelable: null,
15216 timeStamp: function(event) {
15217 return event.timeStamp || Date.now();
15218 },
15219 defaultPrevented: null,
15220 isTrusted: null
15221 };
15222
15223 /**
15224 * Synthetic events are dispatched by event plugins, typically in response to a
15225 * top-level event delegation handler.
15226 *
15227 * These systems should generally use pooling to reduce the frequency of garbage
15228 * collection. The system should check `isPersistent` to determine whether the
15229 * event should be released into the pool after being dispatched. Users that
15230 * need a persisted event should invoke `persist`.
15231 *
15232 * Synthetic events (and subclasses) implement the DOM Level 3 Events API by
15233 * normalizing browser quirks. Subclasses do not necessarily have to implement a
15234 * DOM interface; custom application-specific events can also subclass this.
15235 *
15236 * @param {object} dispatchConfig Configuration used to dispatch this event.
15237 * @param {string} dispatchMarker Marker identifying the event target.
15238 * @param {object} nativeEvent Native browser event.
15239 */
15240 function SyntheticEvent(dispatchConfig, dispatchMarker, nativeEvent) {
15241 this.dispatchConfig = dispatchConfig;
15242 this.dispatchMarker = dispatchMarker;
15243 this.nativeEvent = nativeEvent;
15244
15245 var Interface = this.constructor.Interface;
15246 for (var propName in Interface) {
15247 if (!Interface.hasOwnProperty(propName)) {
15248 continue;
15249 }
15250 var normalize = Interface[propName];
15251 if (normalize) {
15252 this[propName] = normalize(nativeEvent);
15253 } else {
15254 this[propName] = nativeEvent[propName];
15255 }
15256 }
15257
15258 var defaultPrevented = nativeEvent.defaultPrevented != null ?
15259 nativeEvent.defaultPrevented :
15260 nativeEvent.returnValue === false;
15261 if (defaultPrevented) {
15262 this.isDefaultPrevented = emptyFunction.thatReturnsTrue;
15263 } else {
15264 this.isDefaultPrevented = emptyFunction.thatReturnsFalse;
15265 }
15266 this.isPropagationStopped = emptyFunction.thatReturnsFalse;
15267 }
15268
15269 assign(SyntheticEvent.prototype, {
15270
15271 preventDefault: function() {
15272 this.defaultPrevented = true;
15273 var event = this.nativeEvent;
15274 event.preventDefault ? event.preventDefault() : event.returnValue = false;
15275 this.isDefaultPrevented = emptyFunction.thatReturnsTrue;
15276 },
15277
15278 stopPropagation: function() {
15279 var event = this.nativeEvent;
15280 event.stopPropagation ? event.stopPropagation() : event.cancelBubble = true;
15281 this.isPropagationStopped = emptyFunction.thatReturnsTrue;
15282 },
15283
15284 /**
15285 * We release all dispatched `SyntheticEvent`s after each event loop, adding
15286 * them back into the pool. This allows a way to hold onto a reference that
15287 * won't be added back into the pool.
15288 */
15289 persist: function() {
15290 this.isPersistent = emptyFunction.thatReturnsTrue;
15291 },
15292
15293 /**
15294 * Checks if this event should be released back into the pool.
15295 *
15296 * @return {boolean} True if this should not be released, false otherwise.
15297 */
15298 isPersistent: emptyFunction.thatReturnsFalse,
15299
15300 /**
15301 * `PooledClass` looks for `destructor` on each instance it releases.
15302 */
15303 destructor: function() {
15304 var Interface = this.constructor.Interface;
15305 for (var propName in Interface) {
15306 this[propName] = null;
15307 }
15308 this.dispatchConfig = null;
15309 this.dispatchMarker = null;
15310 this.nativeEvent = null;
15311 }
15312
15313 });
15314
15315 SyntheticEvent.Interface = EventInterface;
15316
15317 /**
15318 * Helper to reduce boilerplate when creating subclasses.
15319 *
15320 * @param {function} Class
15321 * @param {?object} Interface
15322 */
15323 SyntheticEvent.augmentClass = function(Class, Interface) {
15324 var Super = this;
15325
15326 var prototype = Object.create(Super.prototype);
15327 assign(prototype, Class.prototype);
15328 Class.prototype = prototype;
15329 Class.prototype.constructor = Class;
15330
15331 Class.Interface = assign({}, Super.Interface, Interface);
15332 Class.augmentClass = Super.augmentClass;
15333
15334 PooledClass.addPoolingTo(Class, PooledClass.threeArgumentPooler);
15335 };
15336
15337 PooledClass.addPoolingTo(SyntheticEvent, PooledClass.threeArgumentPooler);
15338
15339 module.exports = SyntheticEvent;
15340
15341
15342/***/ },
15343/* 102 */
15344/***/ function(module, exports, __webpack_require__) {
15345
15346 /**
15347 * Copyright 2013-2014, Facebook, Inc.
15348 * All rights reserved.
15349 *
15350 * This source code is licensed under the BSD-style license found in the
15351 * LICENSE file in the root directory of this source tree. An additional grant
15352 * of patent rights can be found in the PATENTS file in the same directory.
15353 *
15354 * @providesModule isTextInputElement
15355 */
15356
15357 "use strict";
15358
15359 /**
15360 * @see http://www.whatwg.org/specs/web-apps/current-work/multipage/the-input-element.html#input-type-attr-summary
15361 */
15362 var supportedInputTypes = {
15363 'color': true,
15364 'date': true,
15365 'datetime': true,
15366 'datetime-local': true,
15367 'email': true,
15368 'month': true,
15369 'number': true,
15370 'password': true,
15371 'range': true,
15372 'search': true,
15373 'tel': true,
15374 'text': true,
15375 'time': true,
15376 'url': true,
15377 'week': true
15378 };
15379
15380 function isTextInputElement(elem) {
15381 return elem && (
15382 (elem.nodeName === 'INPUT' && supportedInputTypes[elem.type]) ||
15383 elem.nodeName === 'TEXTAREA'
15384 );
15385 }
15386
15387 module.exports = isTextInputElement;
15388
15389
15390/***/ },
15391/* 103 */
15392/***/ function(module, exports, __webpack_require__) {
15393
15394 /**
15395 * Copyright 2013-2014, Facebook, Inc.
15396 * All rights reserved.
15397 *
15398 * This source code is licensed under the BSD-style license found in the
15399 * LICENSE file in the root directory of this source tree. An additional grant
15400 * of patent rights can be found in the PATENTS file in the same directory.
15401 *
15402 * @providesModule ReactInputSelection
15403 */
15404
15405 "use strict";
15406
15407 var ReactDOMSelection = __webpack_require__(135);
15408
15409 var containsNode = __webpack_require__(79);
15410 var focusNode = __webpack_require__(136);
15411 var getActiveElement = __webpack_require__(116);
15412
15413 function isInDocument(node) {
15414 return containsNode(document.documentElement, node);
15415 }
15416
15417 /**
15418 * @ReactInputSelection: React input selection module. Based on Selection.js,
15419 * but modified to be suitable for react and has a couple of bug fixes (doesn't
15420 * assume buttons have range selections allowed).
15421 * Input selection module for React.
15422 */
15423 var ReactInputSelection = {
15424
15425 hasSelectionCapabilities: function(elem) {
15426 return elem && (
15427 (elem.nodeName === 'INPUT' && elem.type === 'text') ||
15428 elem.nodeName === 'TEXTAREA' ||
15429 elem.contentEditable === 'true'
15430 );
15431 },
15432
15433 getSelectionInformation: function() {
15434 var focusedElem = getActiveElement();
15435 return {
15436 focusedElem: focusedElem,
15437 selectionRange:
15438 ReactInputSelection.hasSelectionCapabilities(focusedElem) ?
15439 ReactInputSelection.getSelection(focusedElem) :
15440 null
15441 };
15442 },
15443
15444 /**
15445 * @restoreSelection: If any selection information was potentially lost,
15446 * restore it. This is useful when performing operations that could remove dom
15447 * nodes and place them back in, resulting in focus being lost.
15448 */
15449 restoreSelection: function(priorSelectionInformation) {
15450 var curFocusedElem = getActiveElement();
15451 var priorFocusedElem = priorSelectionInformation.focusedElem;
15452 var priorSelectionRange = priorSelectionInformation.selectionRange;
15453 if (curFocusedElem !== priorFocusedElem &&
15454 isInDocument(priorFocusedElem)) {
15455 if (ReactInputSelection.hasSelectionCapabilities(priorFocusedElem)) {
15456 ReactInputSelection.setSelection(
15457 priorFocusedElem,
15458 priorSelectionRange
15459 );
15460 }
15461 focusNode(priorFocusedElem);
15462 }
15463 },
15464
15465 /**
15466 * @getSelection: Gets the selection bounds of a focused textarea, input or
15467 * contentEditable node.
15468 * -@input: Look up selection bounds of this input
15469 * -@return {start: selectionStart, end: selectionEnd}
15470 */
15471 getSelection: function(input) {
15472 var selection;
15473
15474 if ('selectionStart' in input) {
15475 // Modern browser with input or textarea.
15476 selection = {
15477 start: input.selectionStart,
15478 end: input.selectionEnd
15479 };
15480 } else if (document.selection && input.nodeName === 'INPUT') {
15481 // IE8 input.
15482 var range = document.selection.createRange();
15483 // There can only be one selection per document in IE, so it must
15484 // be in our element.
15485 if (range.parentElement() === input) {
15486 selection = {
15487 start: -range.moveStart('character', -input.value.length),
15488 end: -range.moveEnd('character', -input.value.length)
15489 };
15490 }
15491 } else {
15492 // Content editable or old IE textarea.
15493 selection = ReactDOMSelection.getOffsets(input);
15494 }
15495
15496 return selection || {start: 0, end: 0};
15497 },
15498
15499 /**
15500 * @setSelection: Sets the selection bounds of a textarea or input and focuses
15501 * the input.
15502 * -@input Set selection bounds of this input or textarea
15503 * -@offsets Object of same form that is returned from get*
15504 */
15505 setSelection: function(input, offsets) {
15506 var start = offsets.start;
15507 var end = offsets.end;
15508 if (typeof end === 'undefined') {
15509 end = start;
15510 }
15511
15512 if ('selectionStart' in input) {
15513 input.selectionStart = start;
15514 input.selectionEnd = Math.min(end, input.value.length);
15515 } else if (document.selection && input.nodeName === 'INPUT') {
15516 var range = input.createTextRange();
15517 range.collapse(true);
15518 range.moveStart('character', start);
15519 range.moveEnd('character', end - start);
15520 range.select();
15521 } else {
15522 ReactDOMSelection.setOffsets(input, offsets);
15523 }
15524 }
15525 };
15526
15527 module.exports = ReactInputSelection;
15528
15529
15530/***/ },
15531/* 104 */
15532/***/ function(module, exports, __webpack_require__) {
15533
15534 /**
15535 * Copyright 2013-2014, Facebook, Inc.
15536 * All rights reserved.
15537 *
15538 * This source code is licensed under the BSD-style license found in the
15539 * LICENSE file in the root directory of this source tree. An additional grant
15540 * of patent rights can be found in the PATENTS file in the same directory.
15541 *
15542 * @providesModule SyntheticCompositionEvent
15543 * @typechecks static-only
15544 */
15545
15546 "use strict";
15547
15548 var SyntheticEvent = __webpack_require__(101);
15549
15550 /**
15551 * @interface Event
15552 * @see http://www.w3.org/TR/DOM-Level-3-Events/#events-compositionevents
15553 */
15554 var CompositionEventInterface = {
15555 data: null
15556 };
15557
15558 /**
15559 * @param {object} dispatchConfig Configuration used to dispatch this event.
15560 * @param {string} dispatchMarker Marker identifying the event target.
15561 * @param {object} nativeEvent Native browser event.
15562 * @extends {SyntheticUIEvent}
15563 */
15564 function SyntheticCompositionEvent(
15565 dispatchConfig,
15566 dispatchMarker,
15567 nativeEvent) {
15568 SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent);
15569 }
15570
15571 SyntheticEvent.augmentClass(
15572 SyntheticCompositionEvent,
15573 CompositionEventInterface
15574 );
15575
15576 module.exports = SyntheticCompositionEvent;
15577
15578
15579
15580/***/ },
15581/* 105 */
15582/***/ function(module, exports, __webpack_require__) {
15583
15584 /**
15585 * Copyright 2013-2014, Facebook, Inc.
15586 * All rights reserved.
15587 *
15588 * This source code is licensed under the BSD-style license found in the
15589 * LICENSE file in the root directory of this source tree. An additional grant
15590 * of patent rights can be found in the PATENTS file in the same directory.
15591 *
15592 * @providesModule getTextContentAccessor
15593 */
15594
15595 "use strict";
15596
15597 var ExecutionEnvironment = __webpack_require__(26);
15598
15599 var contentKey = null;
15600
15601 /**
15602 * Gets the key used to access text content on a DOM node.
15603 *
15604 * @return {?string} Key used to access text content.
15605 * @internal
15606 */
15607 function getTextContentAccessor() {
15608 if (!contentKey && ExecutionEnvironment.canUseDOM) {
15609 // Prefer textContent to innerText because many browsers support both but
15610 // SVG <text> elements don't support innerText even when <div> does.
15611 contentKey = 'textContent' in document.documentElement ?
15612 'textContent' :
15613 'innerText';
15614 }
15615 return contentKey;
15616 }
15617
15618 module.exports = getTextContentAccessor;
15619
15620
15621/***/ },
15622/* 106 */
15623/***/ function(module, exports, __webpack_require__) {
15624
15625 /**
15626 * Copyright 2013-2014, Facebook, Inc.
15627 * All rights reserved.
15628 *
15629 * This source code is licensed under the BSD-style license found in the
15630 * LICENSE file in the root directory of this source tree. An additional grant
15631 * of patent rights can be found in the PATENTS file in the same directory.
15632 *
15633 * @providesModule SyntheticMouseEvent
15634 * @typechecks static-only
15635 */
15636
15637 "use strict";
15638
15639 var SyntheticUIEvent = __webpack_require__(123);
15640 var ViewportMetrics = __webpack_require__(98);
15641
15642 var getEventModifierState = __webpack_require__(137);
15643
15644 /**
15645 * @interface MouseEvent
15646 * @see http://www.w3.org/TR/DOM-Level-3-Events/
15647 */
15648 var MouseEventInterface = {
15649 screenX: null,
15650 screenY: null,
15651 clientX: null,
15652 clientY: null,
15653 ctrlKey: null,
15654 shiftKey: null,
15655 altKey: null,
15656 metaKey: null,
15657 getModifierState: getEventModifierState,
15658 button: function(event) {
15659 // Webkit, Firefox, IE9+
15660 // which: 1 2 3
15661 // button: 0 1 2 (standard)
15662 var button = event.button;
15663 if ('which' in event) {
15664 return button;
15665 }
15666 // IE<9
15667 // which: undefined
15668 // button: 0 0 0
15669 // button: 1 4 2 (onmouseup)
15670 return button === 2 ? 2 : button === 4 ? 1 : 0;
15671 },
15672 buttons: null,
15673 relatedTarget: function(event) {
15674 return event.relatedTarget || (
15675 event.fromElement === event.srcElement ?
15676 event.toElement :
15677 event.fromElement
15678 );
15679 },
15680 // "Proprietary" Interface.
15681 pageX: function(event) {
15682 return 'pageX' in event ?
15683 event.pageX :
15684 event.clientX + ViewportMetrics.currentScrollLeft;
15685 },
15686 pageY: function(event) {
15687 return 'pageY' in event ?
15688 event.pageY :
15689 event.clientY + ViewportMetrics.currentScrollTop;
15690 }
15691 };
15692
15693 /**
15694 * @param {object} dispatchConfig Configuration used to dispatch this event.
15695 * @param {string} dispatchMarker Marker identifying the event target.
15696 * @param {object} nativeEvent Native browser event.
15697 * @extends {SyntheticUIEvent}
15698 */
15699 function SyntheticMouseEvent(dispatchConfig, dispatchMarker, nativeEvent) {
15700 SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent);
15701 }
15702
15703 SyntheticUIEvent.augmentClass(SyntheticMouseEvent, MouseEventInterface);
15704
15705 module.exports = SyntheticMouseEvent;
15706
15707
15708/***/ },
15709/* 107 */
15710/***/ function(module, exports, __webpack_require__) {
15711
15712 /* WEBPACK VAR INJECTION */(function(process) {/**
15713 * Copyright 2013-2014, Facebook, Inc.
15714 * All rights reserved.
15715 *
15716 * This source code is licensed under the BSD-style license found in the
15717 * LICENSE file in the root directory of this source tree. An additional grant
15718 * of patent rights can be found in the PATENTS file in the same directory.
15719 *
15720 * @providesModule ReactDOMIDOperations
15721 * @typechecks static-only
15722 */
15723
15724 /*jslint evil: true */
15725
15726 "use strict";
15727
15728 var CSSPropertyOperations = __webpack_require__(49);
15729 var DOMChildrenOperations = __webpack_require__(138);
15730 var DOMPropertyOperations = __webpack_require__(3);
15731 var ReactMount = __webpack_require__(17);
15732 var ReactPerf = __webpack_require__(19);
15733
15734 var invariant = __webpack_require__(33);
15735 var setInnerHTML = __webpack_require__(109);
15736
15737 /**
15738 * Errors for properties that should not be updated with `updatePropertyById()`.
15739 *
15740 * @type {object}
15741 * @private
15742 */
15743 var INVALID_PROPERTY_ERRORS = {
15744 dangerouslySetInnerHTML:
15745 '`dangerouslySetInnerHTML` must be set using `updateInnerHTMLByID()`.',
15746 style: '`style` must be set using `updateStylesByID()`.'
15747 };
15748
15749 /**
15750 * Operations used to process updates to DOM nodes. This is made injectable via
15751 * `ReactComponent.BackendIDOperations`.
15752 */
15753 var ReactDOMIDOperations = {
15754
15755 /**
15756 * Updates a DOM node with new property values. This should only be used to
15757 * update DOM properties in `DOMProperty`.
15758 *
15759 * @param {string} id ID of the node to update.
15760 * @param {string} name A valid property name, see `DOMProperty`.
15761 * @param {*} value New value of the property.
15762 * @internal
15763 */
15764 updatePropertyByID: ReactPerf.measure(
15765 'ReactDOMIDOperations',
15766 'updatePropertyByID',
15767 function(id, name, value) {
15768 var node = ReactMount.getNode(id);
15769 ("production" !== process.env.NODE_ENV ? invariant(
15770 !INVALID_PROPERTY_ERRORS.hasOwnProperty(name),
15771 'updatePropertyByID(...): %s',
15772 INVALID_PROPERTY_ERRORS[name]
15773 ) : invariant(!INVALID_PROPERTY_ERRORS.hasOwnProperty(name)));
15774
15775 // If we're updating to null or undefined, we should remove the property
15776 // from the DOM node instead of inadvertantly setting to a string. This
15777 // brings us in line with the same behavior we have on initial render.
15778 if (value != null) {
15779 DOMPropertyOperations.setValueForProperty(node, name, value);
15780 } else {
15781 DOMPropertyOperations.deleteValueForProperty(node, name);
15782 }
15783 }
15784 ),
15785
15786 /**
15787 * Updates a DOM node to remove a property. This should only be used to remove
15788 * DOM properties in `DOMProperty`.
15789 *
15790 * @param {string} id ID of the node to update.
15791 * @param {string} name A property name to remove, see `DOMProperty`.
15792 * @internal
15793 */
15794 deletePropertyByID: ReactPerf.measure(
15795 'ReactDOMIDOperations',
15796 'deletePropertyByID',
15797 function(id, name, value) {
15798 var node = ReactMount.getNode(id);
15799 ("production" !== process.env.NODE_ENV ? invariant(
15800 !INVALID_PROPERTY_ERRORS.hasOwnProperty(name),
15801 'updatePropertyByID(...): %s',
15802 INVALID_PROPERTY_ERRORS[name]
15803 ) : invariant(!INVALID_PROPERTY_ERRORS.hasOwnProperty(name)));
15804 DOMPropertyOperations.deleteValueForProperty(node, name, value);
15805 }
15806 ),
15807
15808 /**
15809 * Updates a DOM node with new style values. If a value is specified as '',
15810 * the corresponding style property will be unset.
15811 *
15812 * @param {string} id ID of the node to update.
15813 * @param {object} styles Mapping from styles to values.
15814 * @internal
15815 */
15816 updateStylesByID: ReactPerf.measure(
15817 'ReactDOMIDOperations',
15818 'updateStylesByID',
15819 function(id, styles) {
15820 var node = ReactMount.getNode(id);
15821 CSSPropertyOperations.setValueForStyles(node, styles);
15822 }
15823 ),
15824
15825 /**
15826 * Updates a DOM node's innerHTML.
15827 *
15828 * @param {string} id ID of the node to update.
15829 * @param {string} html An HTML string.
15830 * @internal
15831 */
15832 updateInnerHTMLByID: ReactPerf.measure(
15833 'ReactDOMIDOperations',
15834 'updateInnerHTMLByID',
15835 function(id, html) {
15836 var node = ReactMount.getNode(id);
15837 setInnerHTML(node, html);
15838 }
15839 ),
15840
15841 /**
15842 * Updates a DOM node's text content set by `props.content`.
15843 *
15844 * @param {string} id ID of the node to update.
15845 * @param {string} content Text content.
15846 * @internal
15847 */
15848 updateTextContentByID: ReactPerf.measure(
15849 'ReactDOMIDOperations',
15850 'updateTextContentByID',
15851 function(id, content) {
15852 var node = ReactMount.getNode(id);
15853 DOMChildrenOperations.updateTextContent(node, content);
15854 }
15855 ),
15856
15857 /**
15858 * Replaces a DOM node that exists in the document with markup.
15859 *
15860 * @param {string} id ID of child to be replaced.
15861 * @param {string} markup Dangerous markup to inject in place of child.
15862 * @internal
15863 * @see {Danger.dangerouslyReplaceNodeWithMarkup}
15864 */
15865 dangerouslyReplaceNodeWithMarkupByID: ReactPerf.measure(
15866 'ReactDOMIDOperations',
15867 'dangerouslyReplaceNodeWithMarkupByID',
15868 function(id, markup) {
15869 var node = ReactMount.getNode(id);
15870 DOMChildrenOperations.dangerouslyReplaceNodeWithMarkup(node, markup);
15871 }
15872 ),
15873
15874 /**
15875 * Updates a component's children by processing a series of updates.
15876 *
15877 * @param {array<object>} updates List of update configurations.
15878 * @param {array<string>} markup List of markup strings.
15879 * @internal
15880 */
15881 dangerouslyProcessChildrenUpdates: ReactPerf.measure(
15882 'ReactDOMIDOperations',
15883 'dangerouslyProcessChildrenUpdates',
15884 function(updates, markup) {
15885 for (var i = 0; i < updates.length; i++) {
15886 updates[i].parentNode = ReactMount.getNode(updates[i].parentID);
15887 }
15888 DOMChildrenOperations.processUpdates(updates, markup);
15889 }
15890 )
15891 };
15892
15893 module.exports = ReactDOMIDOperations;
15894
15895 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(27)))
15896
15897/***/ },
15898/* 108 */
15899/***/ function(module, exports, __webpack_require__) {
15900
15901 /**
15902 * Copyright 2013-2014, Facebook, Inc.
15903 * All rights reserved.
15904 *
15905 * This source code is licensed under the BSD-style license found in the
15906 * LICENSE file in the root directory of this source tree. An additional grant
15907 * of patent rights can be found in the PATENTS file in the same directory.
15908 *
15909 * @providesModule ReactReconcileTransaction
15910 * @typechecks static-only
15911 */
15912
15913 "use strict";
15914
15915 var CallbackQueue = __webpack_require__(88);
15916 var PooledClass = __webpack_require__(34);
15917 var ReactBrowserEventEmitter = __webpack_require__(51);
15918 var ReactInputSelection = __webpack_require__(103);
15919 var ReactPutListenerQueue = __webpack_require__(130);
15920 var Transaction = __webpack_require__(89);
15921
15922 var assign = __webpack_require__(23);
15923
15924 /**
15925 * Ensures that, when possible, the selection range (currently selected text
15926 * input) is not disturbed by performing the transaction.
15927 */
15928 var SELECTION_RESTORATION = {
15929 /**
15930 * @return {Selection} Selection information.
15931 */
15932 initialize: ReactInputSelection.getSelectionInformation,
15933 /**
15934 * @param {Selection} sel Selection information returned from `initialize`.
15935 */
15936 close: ReactInputSelection.restoreSelection
15937 };
15938
15939 /**
15940 * Suppresses events (blur/focus) that could be inadvertently dispatched due to
15941 * high level DOM manipulations (like temporarily removing a text input from the
15942 * DOM).
15943 */
15944 var EVENT_SUPPRESSION = {
15945 /**
15946 * @return {boolean} The enabled status of `ReactBrowserEventEmitter` before
15947 * the reconciliation.
15948 */
15949 initialize: function() {
15950 var currentlyEnabled = ReactBrowserEventEmitter.isEnabled();
15951 ReactBrowserEventEmitter.setEnabled(false);
15952 return currentlyEnabled;
15953 },
15954
15955 /**
15956 * @param {boolean} previouslyEnabled Enabled status of
15957 * `ReactBrowserEventEmitter` before the reconciliation occured. `close`
15958 * restores the previous value.
15959 */
15960 close: function(previouslyEnabled) {
15961 ReactBrowserEventEmitter.setEnabled(previouslyEnabled);
15962 }
15963 };
15964
15965 /**
15966 * Provides a queue for collecting `componentDidMount` and
15967 * `componentDidUpdate` callbacks during the the transaction.
15968 */
15969 var ON_DOM_READY_QUEUEING = {
15970 /**
15971 * Initializes the internal `onDOMReady` queue.
15972 */
15973 initialize: function() {
15974 this.reactMountReady.reset();
15975 },
15976
15977 /**
15978 * After DOM is flushed, invoke all registered `onDOMReady` callbacks.
15979 */
15980 close: function() {
15981 this.reactMountReady.notifyAll();
15982 }
15983 };
15984
15985 var PUT_LISTENER_QUEUEING = {
15986 initialize: function() {
15987 this.putListenerQueue.reset();
15988 },
15989
15990 close: function() {
15991 this.putListenerQueue.putListeners();
15992 }
15993 };
15994
15995 /**
15996 * Executed within the scope of the `Transaction` instance. Consider these as
15997 * being member methods, but with an implied ordering while being isolated from
15998 * each other.
15999 */
16000 var TRANSACTION_WRAPPERS = [
16001 PUT_LISTENER_QUEUEING,
16002 SELECTION_RESTORATION,
16003 EVENT_SUPPRESSION,
16004 ON_DOM_READY_QUEUEING
16005 ];
16006
16007 /**
16008 * Currently:
16009 * - The order that these are listed in the transaction is critical:
16010 * - Suppresses events.
16011 * - Restores selection range.
16012 *
16013 * Future:
16014 * - Restore document/overflow scroll positions that were unintentionally
16015 * modified via DOM insertions above the top viewport boundary.
16016 * - Implement/integrate with customized constraint based layout system and keep
16017 * track of which dimensions must be remeasured.
16018 *
16019 * @class ReactReconcileTransaction
16020 */
16021 function ReactReconcileTransaction() {
16022 this.reinitializeTransaction();
16023 // Only server-side rendering really needs this option (see
16024 // `ReactServerRendering`), but server-side uses
16025 // `ReactServerRenderingTransaction` instead. This option is here so that it's
16026 // accessible and defaults to false when `ReactDOMComponent` and
16027 // `ReactTextComponent` checks it in `mountComponent`.`
16028 this.renderToStaticMarkup = false;
16029 this.reactMountReady = CallbackQueue.getPooled(null);
16030 this.putListenerQueue = ReactPutListenerQueue.getPooled();
16031 }
16032
16033 var Mixin = {
16034 /**
16035 * @see Transaction
16036 * @abstract
16037 * @final
16038 * @return {array<object>} List of operation wrap proceedures.
16039 * TODO: convert to array<TransactionWrapper>
16040 */
16041 getTransactionWrappers: function() {
16042 return TRANSACTION_WRAPPERS;
16043 },
16044
16045 /**
16046 * @return {object} The queue to collect `onDOMReady` callbacks with.
16047 */
16048 getReactMountReady: function() {
16049 return this.reactMountReady;
16050 },
16051
16052 getPutListenerQueue: function() {
16053 return this.putListenerQueue;
16054 },
16055
16056 /**
16057 * `PooledClass` looks for this, and will invoke this before allowing this
16058 * instance to be resused.
16059 */
16060 destructor: function() {
16061 CallbackQueue.release(this.reactMountReady);
16062 this.reactMountReady = null;
16063
16064 ReactPutListenerQueue.release(this.putListenerQueue);
16065 this.putListenerQueue = null;
16066 }
16067 };
16068
16069
16070 assign(ReactReconcileTransaction.prototype, Transaction.Mixin, Mixin);
16071
16072 PooledClass.addPoolingTo(ReactReconcileTransaction);
16073
16074 module.exports = ReactReconcileTransaction;
16075
16076
16077/***/ },
16078/* 109 */
16079/***/ function(module, exports, __webpack_require__) {
16080
16081 /**
16082 * Copyright 2013-2014, Facebook, Inc.
16083 * All rights reserved.
16084 *
16085 * This source code is licensed under the BSD-style license found in the
16086 * LICENSE file in the root directory of this source tree. An additional grant
16087 * of patent rights can be found in the PATENTS file in the same directory.
16088 *
16089 * @providesModule setInnerHTML
16090 */
16091
16092 "use strict";
16093
16094 var ExecutionEnvironment = __webpack_require__(26);
16095
16096 var WHITESPACE_TEST = /^[ \r\n\t\f]/;
16097 var NONVISIBLE_TEST = /<(!--|link|noscript|meta|script|style)[ \r\n\t\f\/>]/;
16098
16099 /**
16100 * Set the innerHTML property of a node, ensuring that whitespace is preserved
16101 * even in IE8.
16102 *
16103 * @param {DOMElement} node
16104 * @param {string} html
16105 * @internal
16106 */
16107 var setInnerHTML = function(node, html) {
16108 node.innerHTML = html;
16109 };
16110
16111 if (ExecutionEnvironment.canUseDOM) {
16112 // IE8: When updating a just created node with innerHTML only leading
16113 // whitespace is removed. When updating an existing node with innerHTML
16114 // whitespace in root TextNodes is also collapsed.
16115 // @see quirksmode.org/bugreports/archives/2004/11/innerhtml_and_t.html
16116
16117 // Feature detection; only IE8 is known to behave improperly like this.
16118 var testElement = document.createElement('div');
16119 testElement.innerHTML = ' ';
16120 if (testElement.innerHTML === '') {
16121 setInnerHTML = function(node, html) {
16122 // Magic theory: IE8 supposedly differentiates between added and updated
16123 // nodes when processing innerHTML, innerHTML on updated nodes suffers
16124 // from worse whitespace behavior. Re-adding a node like this triggers
16125 // the initial and more favorable whitespace behavior.
16126 // TODO: What to do on a detached node?
16127 if (node.parentNode) {
16128 node.parentNode.replaceChild(node, node);
16129 }
16130
16131 // We also implement a workaround for non-visible tags disappearing into
16132 // thin air on IE8, this only happens if there is no visible text
16133 // in-front of the non-visible tags. Piggyback on the whitespace fix
16134 // and simply check if any non-visible tags appear in the source.
16135 if (WHITESPACE_TEST.test(html) ||
16136 html[0] === '<' && NONVISIBLE_TEST.test(html)) {
16137 // Recover leading whitespace by temporarily prepending any character.
16138 // \uFEFF has the potential advantage of being zero-width/invisible.
16139 node.innerHTML = '\uFEFF' + html;
16140
16141 // deleteData leaves an empty `TextNode` which offsets the index of all
16142 // children. Definitely want to avoid this.
16143 var textNode = node.firstChild;
16144 if (textNode.data.length === 1) {
16145 node.removeChild(textNode);
16146 } else {
16147 textNode.deleteData(0, 1);
16148 }
16149 } else {
16150 node.innerHTML = html;
16151 }
16152 };
16153 }
16154 }
16155
16156 module.exports = setInnerHTML;
16157
16158
16159/***/ },
16160/* 110 */
16161/***/ function(module, exports, __webpack_require__) {
16162
16163 /**
16164 * Copyright 2013-2014, Facebook, Inc.
16165 * All rights reserved.
16166 *
16167 * This source code is licensed under the BSD-style license found in the
16168 * LICENSE file in the root directory of this source tree. An additional grant
16169 * of patent rights can be found in the PATENTS file in the same directory.
16170 *
16171 * @providesModule AutoFocusMixin
16172 * @typechecks static-only
16173 */
16174
16175 "use strict";
16176
16177 var focusNode = __webpack_require__(136);
16178
16179 var AutoFocusMixin = {
16180 componentDidMount: function() {
16181 if (this.props.autoFocus) {
16182 focusNode(this.getDOMNode());
16183 }
16184 }
16185 };
16186
16187 module.exports = AutoFocusMixin;
16188
16189
16190/***/ },
16191/* 111 */
16192/***/ function(module, exports, __webpack_require__) {
16193
16194 /* WEBPACK VAR INJECTION */(function(process) {/**
16195 * Copyright 2014, Facebook, Inc.
16196 * All rights reserved.
16197 *
16198 * This source code is licensed under the BSD-style license found in the
16199 * LICENSE file in the root directory of this source tree. An additional grant
16200 * of patent rights can be found in the PATENTS file in the same directory.
16201 *
16202 * @providesModule LocalEventTrapMixin
16203 */
16204
16205 "use strict";
16206
16207 var ReactBrowserEventEmitter = __webpack_require__(51);
16208
16209 var accumulateInto = __webpack_require__(132);
16210 var forEachAccumulated = __webpack_require__(133);
16211 var invariant = __webpack_require__(33);
16212
16213 function remove(event) {
16214 event.remove();
16215 }
16216
16217 var LocalEventTrapMixin = {
16218 trapBubbledEvent:function(topLevelType, handlerBaseName) {
16219 ("production" !== process.env.NODE_ENV ? invariant(this.isMounted(), 'Must be mounted to trap events') : invariant(this.isMounted()));
16220 var listener = ReactBrowserEventEmitter.trapBubbledEvent(
16221 topLevelType,
16222 handlerBaseName,
16223 this.getDOMNode()
16224 );
16225 this._localEventListeners =
16226 accumulateInto(this._localEventListeners, listener);
16227 },
16228
16229 // trapCapturedEvent would look nearly identical. We don't implement that
16230 // method because it isn't currently needed.
16231
16232 componentWillUnmount:function() {
16233 if (this._localEventListeners) {
16234 forEachAccumulated(this._localEventListeners, remove);
16235 }
16236 }
16237 };
16238
16239 module.exports = LocalEventTrapMixin;
16240
16241 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(27)))
16242
16243/***/ },
16244/* 112 */
16245/***/ function(module, exports, __webpack_require__) {
16246
16247 /* WEBPACK VAR INJECTION */(function(process) {/**
16248 * Copyright 2013-2014, Facebook, Inc.
16249 * All rights reserved.
16250 *
16251 * This source code is licensed under the BSD-style license found in the
16252 * LICENSE file in the root directory of this source tree. An additional grant
16253 * of patent rights can be found in the PATENTS file in the same directory.
16254 *
16255 * @providesModule LinkedValueUtils
16256 * @typechecks static-only
16257 */
16258
16259 "use strict";
16260
16261 var ReactPropTypes = __webpack_require__(20);
16262
16263 var invariant = __webpack_require__(33);
16264
16265 var hasReadOnlyValue = {
16266 'button': true,
16267 'checkbox': true,
16268 'image': true,
16269 'hidden': true,
16270 'radio': true,
16271 'reset': true,
16272 'submit': true
16273 };
16274
16275 function _assertSingleLink(input) {
16276 ("production" !== process.env.NODE_ENV ? invariant(
16277 input.props.checkedLink == null || input.props.valueLink == null,
16278 'Cannot provide a checkedLink and a valueLink. If you want to use ' +
16279 'checkedLink, you probably don\'t want to use valueLink and vice versa.'
16280 ) : invariant(input.props.checkedLink == null || input.props.valueLink == null));
16281 }
16282 function _assertValueLink(input) {
16283 _assertSingleLink(input);
16284 ("production" !== process.env.NODE_ENV ? invariant(
16285 input.props.value == null && input.props.onChange == null,
16286 'Cannot provide a valueLink and a value or onChange event. If you want ' +
16287 'to use value or onChange, you probably don\'t want to use valueLink.'
16288 ) : invariant(input.props.value == null && input.props.onChange == null));
16289 }
16290
16291 function _assertCheckedLink(input) {
16292 _assertSingleLink(input);
16293 ("production" !== process.env.NODE_ENV ? invariant(
16294 input.props.checked == null && input.props.onChange == null,
16295 'Cannot provide a checkedLink and a checked property or onChange event. ' +
16296 'If you want to use checked or onChange, you probably don\'t want to ' +
16297 'use checkedLink'
16298 ) : invariant(input.props.checked == null && input.props.onChange == null));
16299 }
16300
16301 /**
16302 * @param {SyntheticEvent} e change event to handle
16303 */
16304 function _handleLinkedValueChange(e) {
16305 /*jshint validthis:true */
16306 this.props.valueLink.requestChange(e.target.value);
16307 }
16308
16309 /**
16310 * @param {SyntheticEvent} e change event to handle
16311 */
16312 function _handleLinkedCheckChange(e) {
16313 /*jshint validthis:true */
16314 this.props.checkedLink.requestChange(e.target.checked);
16315 }
16316
16317 /**
16318 * Provide a linked `value` attribute for controlled forms. You should not use
16319 * this outside of the ReactDOM controlled form components.
16320 */
16321 var LinkedValueUtils = {
16322 Mixin: {
16323 propTypes: {
16324 value: function(props, propName, componentName) {
16325 if (!props[propName] ||
16326 hasReadOnlyValue[props.type] ||
16327 props.onChange ||
16328 props.readOnly ||
16329 props.disabled) {
16330 return;
16331 }
16332 return new Error(
16333 'You provided a `value` prop to a form field without an ' +
16334 '`onChange` handler. This will render a read-only field. If ' +
16335 'the field should be mutable use `defaultValue`. Otherwise, ' +
16336 'set either `onChange` or `readOnly`.'
16337 );
16338 },
16339 checked: function(props, propName, componentName) {
16340 if (!props[propName] ||
16341 props.onChange ||
16342 props.readOnly ||
16343 props.disabled) {
16344 return;
16345 }
16346 return new Error(
16347 'You provided a `checked` prop to a form field without an ' +
16348 '`onChange` handler. This will render a read-only field. If ' +
16349 'the field should be mutable use `defaultChecked`. Otherwise, ' +
16350 'set either `onChange` or `readOnly`.'
16351 );
16352 },
16353 onChange: ReactPropTypes.func
16354 }
16355 },
16356
16357 /**
16358 * @param {ReactComponent} input Form component
16359 * @return {*} current value of the input either from value prop or link.
16360 */
16361 getValue: function(input) {
16362 if (input.props.valueLink) {
16363 _assertValueLink(input);
16364 return input.props.valueLink.value;
16365 }
16366 return input.props.value;
16367 },
16368
16369 /**
16370 * @param {ReactComponent} input Form component
16371 * @return {*} current checked status of the input either from checked prop
16372 * or link.
16373 */
16374 getChecked: function(input) {
16375 if (input.props.checkedLink) {
16376 _assertCheckedLink(input);
16377 return input.props.checkedLink.value;
16378 }
16379 return input.props.checked;
16380 },
16381
16382 /**
16383 * @param {ReactComponent} input Form component
16384 * @return {function} change callback either from onChange prop or link.
16385 */
16386 getOnChange: function(input) {
16387 if (input.props.valueLink) {
16388 _assertValueLink(input);
16389 return _handleLinkedValueChange;
16390 } else if (input.props.checkedLink) {
16391 _assertCheckedLink(input);
16392 return _handleLinkedCheckChange;
16393 }
16394 return input.props.onChange;
16395 }
16396 };
16397
16398 module.exports = LinkedValueUtils;
16399
16400 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(27)))
16401
16402/***/ },
16403/* 113 */
16404/***/ function(module, exports, __webpack_require__) {
16405
16406 /* WEBPACK VAR INJECTION */(function(process) {/**
16407 * Copyright 2013-2014 Facebook, Inc.
16408 *
16409 * Licensed under the Apache License, Version 2.0 (the "License");
16410 * you may not use this file except in compliance with the License.
16411 * You may obtain a copy of the License at
16412 *
16413 * http://www.apache.org/licenses/LICENSE-2.0
16414 *
16415 * Unless required by applicable law or agreed to in writing, software
16416 * distributed under the License is distributed on an "AS IS" BASIS,
16417 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16418 * See the License for the specific language governing permissions and
16419 * limitations under the License.
16420 *
16421 * @providesModule EventListener
16422 * @typechecks
16423 */
16424
16425 var emptyFunction = __webpack_require__(83);
16426
16427 /**
16428 * Upstream version of event listener. Does not take into account specific
16429 * nature of platform.
16430 */
16431 var EventListener = {
16432 /**
16433 * Listen to DOM events during the bubble phase.
16434 *
16435 * @param {DOMEventTarget} target DOM element to register listener on.
16436 * @param {string} eventType Event type, e.g. 'click' or 'mouseover'.
16437 * @param {function} callback Callback function.
16438 * @return {object} Object with a `remove` method.
16439 */
16440 listen: function(target, eventType, callback) {
16441 if (target.addEventListener) {
16442 target.addEventListener(eventType, callback, false);
16443 return {
16444 remove: function() {
16445 target.removeEventListener(eventType, callback, false);
16446 }
16447 };
16448 } else if (target.attachEvent) {
16449 target.attachEvent('on' + eventType, callback);
16450 return {
16451 remove: function() {
16452 target.detachEvent('on' + eventType, callback);
16453 }
16454 };
16455 }
16456 },
16457
16458 /**
16459 * Listen to DOM events during the capture phase.
16460 *
16461 * @param {DOMEventTarget} target DOM element to register listener on.
16462 * @param {string} eventType Event type, e.g. 'click' or 'mouseover'.
16463 * @param {function} callback Callback function.
16464 * @return {object} Object with a `remove` method.
16465 */
16466 capture: function(target, eventType, callback) {
16467 if (!target.addEventListener) {
16468 if ("production" !== process.env.NODE_ENV) {
16469 console.error(
16470 'Attempted to listen to events during the capture phase on a ' +
16471 'browser that does not support the capture phase. Your application ' +
16472 'will not receive some events.'
16473 );
16474 }
16475 return {
16476 remove: emptyFunction
16477 };
16478 } else {
16479 target.addEventListener(eventType, callback, true);
16480 return {
16481 remove: function() {
16482 target.removeEventListener(eventType, callback, true);
16483 }
16484 };
16485 }
16486 },
16487
16488 registerDefault: function() {}
16489 };
16490
16491 module.exports = EventListener;
16492
16493 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(27)))
16494
16495/***/ },
16496/* 114 */
16497/***/ function(module, exports, __webpack_require__) {
16498
16499 /**
16500 * Copyright 2013-2014, Facebook, Inc.
16501 * All rights reserved.
16502 *
16503 * This source code is licensed under the BSD-style license found in the
16504 * LICENSE file in the root directory of this source tree. An additional grant
16505 * of patent rights can be found in the PATENTS file in the same directory.
16506 *
16507 * @providesModule getEventTarget
16508 * @typechecks static-only
16509 */
16510
16511 "use strict";
16512
16513 /**
16514 * Gets the target node from a native browser event by accounting for
16515 * inconsistencies in browser DOM APIs.
16516 *
16517 * @param {object} nativeEvent Native browser event.
16518 * @return {DOMEventTarget} Target node.
16519 */
16520 function getEventTarget(nativeEvent) {
16521 var target = nativeEvent.target || nativeEvent.srcElement || window;
16522 // Safari may fire events on text nodes (Node.TEXT_NODE is 3).
16523 // @see http://www.quirksmode.org/js/events_properties.html
16524 return target.nodeType === 3 ? target.parentNode : target;
16525 }
16526
16527 module.exports = getEventTarget;
16528
16529
16530/***/ },
16531/* 115 */
16532/***/ function(module, exports, __webpack_require__) {
16533
16534 /**
16535 * Copyright 2013-2014, Facebook, Inc.
16536 * All rights reserved.
16537 *
16538 * This source code is licensed under the BSD-style license found in the
16539 * LICENSE file in the root directory of this source tree. An additional grant
16540 * of patent rights can be found in the PATENTS file in the same directory.
16541 *
16542 * @providesModule getUnboundedScrollPosition
16543 * @typechecks
16544 */
16545
16546 "use strict";
16547
16548 /**
16549 * Gets the scroll position of the supplied element or window.
16550 *
16551 * The return values are unbounded, unlike `getScrollPosition`. This means they
16552 * may be negative or exceed the element boundaries (which is possible using
16553 * inertial scrolling).
16554 *
16555 * @param {DOMWindow|DOMElement} scrollable
16556 * @return {object} Map with `x` and `y` keys.
16557 */
16558 function getUnboundedScrollPosition(scrollable) {
16559 if (scrollable === window) {
16560 return {
16561 x: window.pageXOffset || document.documentElement.scrollLeft,
16562 y: window.pageYOffset || document.documentElement.scrollTop
16563 };
16564 }
16565 return {
16566 x: scrollable.scrollLeft,
16567 y: scrollable.scrollTop
16568 };
16569 }
16570
16571 module.exports = getUnboundedScrollPosition;
16572
16573
16574/***/ },
16575/* 116 */
16576/***/ function(module, exports, __webpack_require__) {
16577
16578 /**
16579 * Copyright 2013-2014, Facebook, Inc.
16580 * All rights reserved.
16581 *
16582 * This source code is licensed under the BSD-style license found in the
16583 * LICENSE file in the root directory of this source tree. An additional grant
16584 * of patent rights can be found in the PATENTS file in the same directory.
16585 *
16586 * @providesModule getActiveElement
16587 * @typechecks
16588 */
16589
16590 /**
16591 * Same as document.activeElement but wraps in a try-catch block. In IE it is
16592 * not safe to call document.activeElement if there is nothing focused.
16593 *
16594 * The activeElement will be null only if the document body is not yet defined.
16595 */
16596 function getActiveElement() /*?DOMElement*/ {
16597 try {
16598 return document.activeElement || document.body;
16599 } catch (e) {
16600 return document.body;
16601 }
16602 }
16603
16604 module.exports = getActiveElement;
16605
16606
16607/***/ },
16608/* 117 */
16609/***/ function(module, exports, __webpack_require__) {
16610
16611 /**
16612 * Copyright 2013-2014, Facebook, Inc.
16613 * All rights reserved.
16614 *
16615 * This source code is licensed under the BSD-style license found in the
16616 * LICENSE file in the root directory of this source tree. An additional grant
16617 * of patent rights can be found in the PATENTS file in the same directory.
16618 *
16619 * @providesModule shallowEqual
16620 */
16621
16622 "use strict";
16623
16624 /**
16625 * Performs equality by iterating through keys on an object and returning
16626 * false when any key has values which are not strictly equal between
16627 * objA and objB. Returns true when the values of all keys are strictly equal.
16628 *
16629 * @return {boolean}
16630 */
16631 function shallowEqual(objA, objB) {
16632 if (objA === objB) {
16633 return true;
16634 }
16635 var key;
16636 // Test for A's keys different from B.
16637 for (key in objA) {
16638 if (objA.hasOwnProperty(key) &&
16639 (!objB.hasOwnProperty(key) || objA[key] !== objB[key])) {
16640 return false;
16641 }
16642 }
16643 // Test for B's keys missing from A.
16644 for (key in objB) {
16645 if (objB.hasOwnProperty(key) && !objA.hasOwnProperty(key)) {
16646 return false;
16647 }
16648 }
16649 return true;
16650 }
16651
16652 module.exports = shallowEqual;
16653
16654
16655/***/ },
16656/* 118 */
16657/***/ function(module, exports, __webpack_require__) {
16658
16659 /**
16660 * Copyright 2013-2014, Facebook, Inc.
16661 * All rights reserved.
16662 *
16663 * This source code is licensed under the BSD-style license found in the
16664 * LICENSE file in the root directory of this source tree. An additional grant
16665 * of patent rights can be found in the PATENTS file in the same directory.
16666 *
16667 * @providesModule SyntheticClipboardEvent
16668 * @typechecks static-only
16669 */
16670
16671 "use strict";
16672
16673 var SyntheticEvent = __webpack_require__(101);
16674
16675 /**
16676 * @interface Event
16677 * @see http://www.w3.org/TR/clipboard-apis/
16678 */
16679 var ClipboardEventInterface = {
16680 clipboardData: function(event) {
16681 return (
16682 'clipboardData' in event ?
16683 event.clipboardData :
16684 window.clipboardData
16685 );
16686 }
16687 };
16688
16689 /**
16690 * @param {object} dispatchConfig Configuration used to dispatch this event.
16691 * @param {string} dispatchMarker Marker identifying the event target.
16692 * @param {object} nativeEvent Native browser event.
16693 * @extends {SyntheticUIEvent}
16694 */
16695 function SyntheticClipboardEvent(dispatchConfig, dispatchMarker, nativeEvent) {
16696 SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent);
16697 }
16698
16699 SyntheticEvent.augmentClass(SyntheticClipboardEvent, ClipboardEventInterface);
16700
16701 module.exports = SyntheticClipboardEvent;
16702
16703
16704
16705/***/ },
16706/* 119 */
16707/***/ function(module, exports, __webpack_require__) {
16708
16709 /**
16710 * Copyright 2013-2014, Facebook, Inc.
16711 * All rights reserved.
16712 *
16713 * This source code is licensed under the BSD-style license found in the
16714 * LICENSE file in the root directory of this source tree. An additional grant
16715 * of patent rights can be found in the PATENTS file in the same directory.
16716 *
16717 * @providesModule SyntheticFocusEvent
16718 * @typechecks static-only
16719 */
16720
16721 "use strict";
16722
16723 var SyntheticUIEvent = __webpack_require__(123);
16724
16725 /**
16726 * @interface FocusEvent
16727 * @see http://www.w3.org/TR/DOM-Level-3-Events/
16728 */
16729 var FocusEventInterface = {
16730 relatedTarget: null
16731 };
16732
16733 /**
16734 * @param {object} dispatchConfig Configuration used to dispatch this event.
16735 * @param {string} dispatchMarker Marker identifying the event target.
16736 * @param {object} nativeEvent Native browser event.
16737 * @extends {SyntheticUIEvent}
16738 */
16739 function SyntheticFocusEvent(dispatchConfig, dispatchMarker, nativeEvent) {
16740 SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent);
16741 }
16742
16743 SyntheticUIEvent.augmentClass(SyntheticFocusEvent, FocusEventInterface);
16744
16745 module.exports = SyntheticFocusEvent;
16746
16747
16748/***/ },
16749/* 120 */
16750/***/ function(module, exports, __webpack_require__) {
16751
16752 /**
16753 * Copyright 2013-2014, Facebook, Inc.
16754 * All rights reserved.
16755 *
16756 * This source code is licensed under the BSD-style license found in the
16757 * LICENSE file in the root directory of this source tree. An additional grant
16758 * of patent rights can be found in the PATENTS file in the same directory.
16759 *
16760 * @providesModule SyntheticKeyboardEvent
16761 * @typechecks static-only
16762 */
16763
16764 "use strict";
16765
16766 var SyntheticUIEvent = __webpack_require__(123);
16767
16768 var getEventCharCode = __webpack_require__(125);
16769 var getEventKey = __webpack_require__(139);
16770 var getEventModifierState = __webpack_require__(137);
16771
16772 /**
16773 * @interface KeyboardEvent
16774 * @see http://www.w3.org/TR/DOM-Level-3-Events/
16775 */
16776 var KeyboardEventInterface = {
16777 key: getEventKey,
16778 location: null,
16779 ctrlKey: null,
16780 shiftKey: null,
16781 altKey: null,
16782 metaKey: null,
16783 repeat: null,
16784 locale: null,
16785 getModifierState: getEventModifierState,
16786 // Legacy Interface
16787 charCode: function(event) {
16788 // `charCode` is the result of a KeyPress event and represents the value of
16789 // the actual printable character.
16790
16791 // KeyPress is deprecated, but its replacement is not yet final and not
16792 // implemented in any major browser. Only KeyPress has charCode.
16793 if (event.type === 'keypress') {
16794 return getEventCharCode(event);
16795 }
16796 return 0;
16797 },
16798 keyCode: function(event) {
16799 // `keyCode` is the result of a KeyDown/Up event and represents the value of
16800 // physical keyboard key.
16801
16802 // The actual meaning of the value depends on the users' keyboard layout
16803 // which cannot be detected. Assuming that it is a US keyboard layout
16804 // provides a surprisingly accurate mapping for US and European users.
16805 // Due to this, it is left to the user to implement at this time.
16806 if (event.type === 'keydown' || event.type === 'keyup') {
16807 return event.keyCode;
16808 }
16809 return 0;
16810 },
16811 which: function(event) {
16812 // `which` is an alias for either `keyCode` or `charCode` depending on the
16813 // type of the event.
16814 if (event.type === 'keypress') {
16815 return getEventCharCode(event);
16816 }
16817 if (event.type === 'keydown' || event.type === 'keyup') {
16818 return event.keyCode;
16819 }
16820 return 0;
16821 }
16822 };
16823
16824 /**
16825 * @param {object} dispatchConfig Configuration used to dispatch this event.
16826 * @param {string} dispatchMarker Marker identifying the event target.
16827 * @param {object} nativeEvent Native browser event.
16828 * @extends {SyntheticUIEvent}
16829 */
16830 function SyntheticKeyboardEvent(dispatchConfig, dispatchMarker, nativeEvent) {
16831 SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent);
16832 }
16833
16834 SyntheticUIEvent.augmentClass(SyntheticKeyboardEvent, KeyboardEventInterface);
16835
16836 module.exports = SyntheticKeyboardEvent;
16837
16838
16839/***/ },
16840/* 121 */
16841/***/ function(module, exports, __webpack_require__) {
16842
16843 /**
16844 * Copyright 2013-2014, Facebook, Inc.
16845 * All rights reserved.
16846 *
16847 * This source code is licensed under the BSD-style license found in the
16848 * LICENSE file in the root directory of this source tree. An additional grant
16849 * of patent rights can be found in the PATENTS file in the same directory.
16850 *
16851 * @providesModule SyntheticDragEvent
16852 * @typechecks static-only
16853 */
16854
16855 "use strict";
16856
16857 var SyntheticMouseEvent = __webpack_require__(106);
16858
16859 /**
16860 * @interface DragEvent
16861 * @see http://www.w3.org/TR/DOM-Level-3-Events/
16862 */
16863 var DragEventInterface = {
16864 dataTransfer: null
16865 };
16866
16867 /**
16868 * @param {object} dispatchConfig Configuration used to dispatch this event.
16869 * @param {string} dispatchMarker Marker identifying the event target.
16870 * @param {object} nativeEvent Native browser event.
16871 * @extends {SyntheticUIEvent}
16872 */
16873 function SyntheticDragEvent(dispatchConfig, dispatchMarker, nativeEvent) {
16874 SyntheticMouseEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent);
16875 }
16876
16877 SyntheticMouseEvent.augmentClass(SyntheticDragEvent, DragEventInterface);
16878
16879 module.exports = SyntheticDragEvent;
16880
16881
16882/***/ },
16883/* 122 */
16884/***/ function(module, exports, __webpack_require__) {
16885
16886 /**
16887 * Copyright 2013-2014, Facebook, Inc.
16888 * All rights reserved.
16889 *
16890 * This source code is licensed under the BSD-style license found in the
16891 * LICENSE file in the root directory of this source tree. An additional grant
16892 * of patent rights can be found in the PATENTS file in the same directory.
16893 *
16894 * @providesModule SyntheticTouchEvent
16895 * @typechecks static-only
16896 */
16897
16898 "use strict";
16899
16900 var SyntheticUIEvent = __webpack_require__(123);
16901
16902 var getEventModifierState = __webpack_require__(137);
16903
16904 /**
16905 * @interface TouchEvent
16906 * @see http://www.w3.org/TR/touch-events/
16907 */
16908 var TouchEventInterface = {
16909 touches: null,
16910 targetTouches: null,
16911 changedTouches: null,
16912 altKey: null,
16913 metaKey: null,
16914 ctrlKey: null,
16915 shiftKey: null,
16916 getModifierState: getEventModifierState
16917 };
16918
16919 /**
16920 * @param {object} dispatchConfig Configuration used to dispatch this event.
16921 * @param {string} dispatchMarker Marker identifying the event target.
16922 * @param {object} nativeEvent Native browser event.
16923 * @extends {SyntheticUIEvent}
16924 */
16925 function SyntheticTouchEvent(dispatchConfig, dispatchMarker, nativeEvent) {
16926 SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent);
16927 }
16928
16929 SyntheticUIEvent.augmentClass(SyntheticTouchEvent, TouchEventInterface);
16930
16931 module.exports = SyntheticTouchEvent;
16932
16933
16934/***/ },
16935/* 123 */
16936/***/ function(module, exports, __webpack_require__) {
16937
16938 /**
16939 * Copyright 2013-2014, Facebook, Inc.
16940 * All rights reserved.
16941 *
16942 * This source code is licensed under the BSD-style license found in the
16943 * LICENSE file in the root directory of this source tree. An additional grant
16944 * of patent rights can be found in the PATENTS file in the same directory.
16945 *
16946 * @providesModule SyntheticUIEvent
16947 * @typechecks static-only
16948 */
16949
16950 "use strict";
16951
16952 var SyntheticEvent = __webpack_require__(101);
16953
16954 var getEventTarget = __webpack_require__(114);
16955
16956 /**
16957 * @interface UIEvent
16958 * @see http://www.w3.org/TR/DOM-Level-3-Events/
16959 */
16960 var UIEventInterface = {
16961 view: function(event) {
16962 if (event.view) {
16963 return event.view;
16964 }
16965
16966 var target = getEventTarget(event);
16967 if (target != null && target.window === target) {
16968 // target is a window object
16969 return target;
16970 }
16971
16972 var doc = target.ownerDocument;
16973 // TODO: Figure out why `ownerDocument` is sometimes undefined in IE8.
16974 if (doc) {
16975 return doc.defaultView || doc.parentWindow;
16976 } else {
16977 return window;
16978 }
16979 },
16980 detail: function(event) {
16981 return event.detail || 0;
16982 }
16983 };
16984
16985 /**
16986 * @param {object} dispatchConfig Configuration used to dispatch this event.
16987 * @param {string} dispatchMarker Marker identifying the event target.
16988 * @param {object} nativeEvent Native browser event.
16989 * @extends {SyntheticEvent}
16990 */
16991 function SyntheticUIEvent(dispatchConfig, dispatchMarker, nativeEvent) {
16992 SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent);
16993 }
16994
16995 SyntheticEvent.augmentClass(SyntheticUIEvent, UIEventInterface);
16996
16997 module.exports = SyntheticUIEvent;
16998
16999
17000/***/ },
17001/* 124 */
17002/***/ function(module, exports, __webpack_require__) {
17003
17004 /**
17005 * Copyright 2013-2014, Facebook, Inc.
17006 * All rights reserved.
17007 *
17008 * This source code is licensed under the BSD-style license found in the
17009 * LICENSE file in the root directory of this source tree. An additional grant
17010 * of patent rights can be found in the PATENTS file in the same directory.
17011 *
17012 * @providesModule SyntheticWheelEvent
17013 * @typechecks static-only
17014 */
17015
17016 "use strict";
17017
17018 var SyntheticMouseEvent = __webpack_require__(106);
17019
17020 /**
17021 * @interface WheelEvent
17022 * @see http://www.w3.org/TR/DOM-Level-3-Events/
17023 */
17024 var WheelEventInterface = {
17025 deltaX: function(event) {
17026 return (
17027 'deltaX' in event ? event.deltaX :
17028 // Fallback to `wheelDeltaX` for Webkit and normalize (right is positive).
17029 'wheelDeltaX' in event ? -event.wheelDeltaX : 0
17030 );
17031 },
17032 deltaY: function(event) {
17033 return (
17034 'deltaY' in event ? event.deltaY :
17035 // Fallback to `wheelDeltaY` for Webkit and normalize (down is positive).
17036 'wheelDeltaY' in event ? -event.wheelDeltaY :
17037 // Fallback to `wheelDelta` for IE<9 and normalize (down is positive).
17038 'wheelDelta' in event ? -event.wheelDelta : 0
17039 );
17040 },
17041 deltaZ: null,
17042
17043 // Browsers without "deltaMode" is reporting in raw wheel delta where one
17044 // notch on the scroll is always +/- 120, roughly equivalent to pixels.
17045 // A good approximation of DOM_DELTA_LINE (1) is 5% of viewport size or
17046 // ~40 pixels, for DOM_DELTA_SCREEN (2) it is 87.5% of viewport size.
17047 deltaMode: null
17048 };
17049
17050 /**
17051 * @param {object} dispatchConfig Configuration used to dispatch this event.
17052 * @param {string} dispatchMarker Marker identifying the event target.
17053 * @param {object} nativeEvent Native browser event.
17054 * @extends {SyntheticMouseEvent}
17055 */
17056 function SyntheticWheelEvent(dispatchConfig, dispatchMarker, nativeEvent) {
17057 SyntheticMouseEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent);
17058 }
17059
17060 SyntheticMouseEvent.augmentClass(SyntheticWheelEvent, WheelEventInterface);
17061
17062 module.exports = SyntheticWheelEvent;
17063
17064
17065/***/ },
17066/* 125 */
17067/***/ function(module, exports, __webpack_require__) {
17068
17069 /**
17070 * Copyright 2013-2014, Facebook, Inc.
17071 * All rights reserved.
17072 *
17073 * This source code is licensed under the BSD-style license found in the
17074 * LICENSE file in the root directory of this source tree. An additional grant
17075 * of patent rights can be found in the PATENTS file in the same directory.
17076 *
17077 * @providesModule getEventCharCode
17078 * @typechecks static-only
17079 */
17080
17081 "use strict";
17082
17083 /**
17084 * `charCode` represents the actual "character code" and is safe to use with
17085 * `String.fromCharCode`. As such, only keys that correspond to printable
17086 * characters produce a valid `charCode`, the only exception to this is Enter.
17087 * The Tab-key is considered non-printable and does not have a `charCode`,
17088 * presumably because it does not produce a tab-character in browsers.
17089 *
17090 * @param {object} nativeEvent Native browser event.
17091 * @return {string} Normalized `charCode` property.
17092 */
17093 function getEventCharCode(nativeEvent) {
17094 var charCode;
17095 var keyCode = nativeEvent.keyCode;
17096
17097 if ('charCode' in nativeEvent) {
17098 charCode = nativeEvent.charCode;
17099
17100 // FF does not set `charCode` for the Enter-key, check against `keyCode`.
17101 if (charCode === 0 && keyCode === 13) {
17102 charCode = 13;
17103 }
17104 } else {
17105 // IE8 does not implement `charCode`, but `keyCode` has the correct value.
17106 charCode = keyCode;
17107 }
17108
17109 // Some non-printable keys are reported in `charCode`/`keyCode`, discard them.
17110 // Must not discard the (non-)printable Enter-key.
17111 if (charCode >= 32 || charCode === 13) {
17112 return charCode;
17113 }
17114
17115 return 0;
17116 }
17117
17118 module.exports = getEventCharCode;
17119
17120
17121/***/ },
17122/* 126 */
17123/***/ function(module, exports, __webpack_require__) {
17124
17125 /**
17126 * Copyright 2013-2014, Facebook, Inc.
17127 * All rights reserved.
17128 *
17129 * This source code is licensed under the BSD-style license found in the
17130 * LICENSE file in the root directory of this source tree. An additional grant
17131 * of patent rights can be found in the PATENTS file in the same directory.
17132 *
17133 * @providesModule ReactDefaultPerfAnalysis
17134 */
17135
17136 var assign = __webpack_require__(23);
17137
17138 // Don't try to save users less than 1.2ms (a number I made up)
17139 var DONT_CARE_THRESHOLD = 1.2;
17140 var DOM_OPERATION_TYPES = {
17141 'mountImageIntoNode': 'set innerHTML',
17142 INSERT_MARKUP: 'set innerHTML',
17143 MOVE_EXISTING: 'move',
17144 REMOVE_NODE: 'remove',
17145 TEXT_CONTENT: 'set textContent',
17146 'updatePropertyByID': 'update attribute',
17147 'deletePropertyByID': 'delete attribute',
17148 'updateStylesByID': 'update styles',
17149 'updateInnerHTMLByID': 'set innerHTML',
17150 'dangerouslyReplaceNodeWithMarkupByID': 'replace'
17151 };
17152
17153 function getTotalTime(measurements) {
17154 // TODO: return number of DOM ops? could be misleading.
17155 // TODO: measure dropped frames after reconcile?
17156 // TODO: log total time of each reconcile and the top-level component
17157 // class that triggered it.
17158 var totalTime = 0;
17159 for (var i = 0; i < measurements.length; i++) {
17160 var measurement = measurements[i];
17161 totalTime += measurement.totalTime;
17162 }
17163 return totalTime;
17164 }
17165
17166 function getDOMSummary(measurements) {
17167 var items = [];
17168 for (var i = 0; i < measurements.length; i++) {
17169 var measurement = measurements[i];
17170 var id;
17171
17172 for (id in measurement.writes) {
17173 measurement.writes[id].forEach(function(write) {
17174 items.push({
17175 id: id,
17176 type: DOM_OPERATION_TYPES[write.type] || write.type,
17177 args: write.args
17178 });
17179 });
17180 }
17181 }
17182 return items;
17183 }
17184
17185 function getExclusiveSummary(measurements) {
17186 var candidates = {};
17187 var displayName;
17188
17189 for (var i = 0; i < measurements.length; i++) {
17190 var measurement = measurements[i];
17191 var allIDs = assign(
17192 {},
17193 measurement.exclusive,
17194 measurement.inclusive
17195 );
17196
17197 for (var id in allIDs) {
17198 displayName = measurement.displayNames[id].current;
17199
17200 candidates[displayName] = candidates[displayName] || {
17201 componentName: displayName,
17202 inclusive: 0,
17203 exclusive: 0,
17204 render: 0,
17205 count: 0
17206 };
17207 if (measurement.render[id]) {
17208 candidates[displayName].render += measurement.render[id];
17209 }
17210 if (measurement.exclusive[id]) {
17211 candidates[displayName].exclusive += measurement.exclusive[id];
17212 }
17213 if (measurement.inclusive[id]) {
17214 candidates[displayName].inclusive += measurement.inclusive[id];
17215 }
17216 if (measurement.counts[id]) {
17217 candidates[displayName].count += measurement.counts[id];
17218 }
17219 }
17220 }
17221
17222 // Now make a sorted array with the results.
17223 var arr = [];
17224 for (displayName in candidates) {
17225 if (candidates[displayName].exclusive >= DONT_CARE_THRESHOLD) {
17226 arr.push(candidates[displayName]);
17227 }
17228 }
17229
17230 arr.sort(function(a, b) {
17231 return b.exclusive - a.exclusive;
17232 });
17233
17234 return arr;
17235 }
17236
17237 function getInclusiveSummary(measurements, onlyClean) {
17238 var candidates = {};
17239 var inclusiveKey;
17240
17241 for (var i = 0; i < measurements.length; i++) {
17242 var measurement = measurements[i];
17243 var allIDs = assign(
17244 {},
17245 measurement.exclusive,
17246 measurement.inclusive
17247 );
17248 var cleanComponents;
17249
17250 if (onlyClean) {
17251 cleanComponents = getUnchangedComponents(measurement);
17252 }
17253
17254 for (var id in allIDs) {
17255 if (onlyClean && !cleanComponents[id]) {
17256 continue;
17257 }
17258
17259 var displayName = measurement.displayNames[id];
17260
17261 // Inclusive time is not useful for many components without knowing where
17262 // they are instantiated. So we aggregate inclusive time with both the
17263 // owner and current displayName as the key.
17264 inclusiveKey = displayName.owner + ' > ' + displayName.current;
17265
17266 candidates[inclusiveKey] = candidates[inclusiveKey] || {
17267 componentName: inclusiveKey,
17268 time: 0,
17269 count: 0
17270 };
17271
17272 if (measurement.inclusive[id]) {
17273 candidates[inclusiveKey].time += measurement.inclusive[id];
17274 }
17275 if (measurement.counts[id]) {
17276 candidates[inclusiveKey].count += measurement.counts[id];
17277 }
17278 }
17279 }
17280
17281 // Now make a sorted array with the results.
17282 var arr = [];
17283 for (inclusiveKey in candidates) {
17284 if (candidates[inclusiveKey].time >= DONT_CARE_THRESHOLD) {
17285 arr.push(candidates[inclusiveKey]);
17286 }
17287 }
17288
17289 arr.sort(function(a, b) {
17290 return b.time - a.time;
17291 });
17292
17293 return arr;
17294 }
17295
17296 function getUnchangedComponents(measurement) {
17297 // For a given reconcile, look at which components did not actually
17298 // render anything to the DOM and return a mapping of their ID to
17299 // the amount of time it took to render the entire subtree.
17300 var cleanComponents = {};
17301 var dirtyLeafIDs = Object.keys(measurement.writes);
17302 var allIDs = assign({}, measurement.exclusive, measurement.inclusive);
17303
17304 for (var id in allIDs) {
17305 var isDirty = false;
17306 // For each component that rendered, see if a component that triggered
17307 // a DOM op is in its subtree.
17308 for (var i = 0; i < dirtyLeafIDs.length; i++) {
17309 if (dirtyLeafIDs[i].indexOf(id) === 0) {
17310 isDirty = true;
17311 break;
17312 }
17313 }
17314 if (!isDirty && measurement.counts[id] > 0) {
17315 cleanComponents[id] = true;
17316 }
17317 }
17318 return cleanComponents;
17319 }
17320
17321 var ReactDefaultPerfAnalysis = {
17322 getExclusiveSummary: getExclusiveSummary,
17323 getInclusiveSummary: getInclusiveSummary,
17324 getDOMSummary: getDOMSummary,
17325 getTotalTime: getTotalTime
17326 };
17327
17328 module.exports = ReactDefaultPerfAnalysis;
17329
17330
17331/***/ },
17332/* 127 */
17333/***/ function(module, exports, __webpack_require__) {
17334
17335 /**
17336 * Copyright 2013-2014, Facebook, Inc.
17337 * All rights reserved.
17338 *
17339 * This source code is licensed under the BSD-style license found in the
17340 * LICENSE file in the root directory of this source tree. An additional grant
17341 * of patent rights can be found in the PATENTS file in the same directory.
17342 *
17343 * @providesModule performanceNow
17344 * @typechecks
17345 */
17346
17347 var performance = __webpack_require__(140);
17348
17349 /**
17350 * Detect if we can use `window.performance.now()` and gracefully fallback to
17351 * `Date.now()` if it doesn't exist. We need to support Firefox < 15 for now
17352 * because of Facebook's testing infrastructure.
17353 */
17354 if (!performance || !performance.now) {
17355 performance = Date;
17356 }
17357
17358 var performanceNow = performance.now.bind(performance);
17359
17360 module.exports = performanceNow;
17361
17362
17363/***/ },
17364/* 128 */
17365/***/ function(module, exports, __webpack_require__) {
17366
17367 /**
17368 * Copyright 2013-2014, Facebook, Inc.
17369 * All rights reserved.
17370 *
17371 * This source code is licensed under the BSD-style license found in the
17372 * LICENSE file in the root directory of this source tree. An additional grant
17373 * of patent rights can be found in the PATENTS file in the same directory.
17374 *
17375 * @providesModule isTextNode
17376 * @typechecks
17377 */
17378
17379 var isNode = __webpack_require__(141);
17380
17381 /**
17382 * @param {*} object The object to check.
17383 * @return {boolean} Whether or not the object is a DOM text node.
17384 */
17385 function isTextNode(object) {
17386 return isNode(object) && object.nodeType == 3;
17387 }
17388
17389 module.exports = isTextNode;
17390
17391
17392/***/ },
17393/* 129 */
17394/***/ function(module, exports, __webpack_require__) {
17395
17396 /**
17397 * Copyright 2013-2014, Facebook, Inc.
17398 * All rights reserved.
17399 *
17400 * This source code is licensed under the BSD-style license found in the
17401 * LICENSE file in the root directory of this source tree. An additional grant
17402 * of patent rights can be found in the PATENTS file in the same directory.
17403 *
17404 * @providesModule adler32
17405 */
17406
17407 /* jslint bitwise:true */
17408
17409 "use strict";
17410
17411 var MOD = 65521;
17412
17413 // This is a clean-room implementation of adler32 designed for detecting
17414 // if markup is not what we expect it to be. It does not need to be
17415 // cryptographically strong, only reasonably good at detecting if markup
17416 // generated on the server is different than that on the client.
17417 function adler32(data) {
17418 var a = 1;
17419 var b = 0;
17420 for (var i = 0; i < data.length; i++) {
17421 a = (a + data.charCodeAt(i)) % MOD;
17422 b = (b + a) % MOD;
17423 }
17424 return a | (b << 16);
17425 }
17426
17427 module.exports = adler32;
17428
17429
17430/***/ },
17431/* 130 */
17432/***/ function(module, exports, __webpack_require__) {
17433
17434 /**
17435 * Copyright 2013-2014, Facebook, Inc.
17436 * All rights reserved.
17437 *
17438 * This source code is licensed under the BSD-style license found in the
17439 * LICENSE file in the root directory of this source tree. An additional grant
17440 * of patent rights can be found in the PATENTS file in the same directory.
17441 *
17442 * @providesModule ReactPutListenerQueue
17443 */
17444
17445 "use strict";
17446
17447 var PooledClass = __webpack_require__(34);
17448 var ReactBrowserEventEmitter = __webpack_require__(51);
17449
17450 var assign = __webpack_require__(23);
17451
17452 function ReactPutListenerQueue() {
17453 this.listenersToPut = [];
17454 }
17455
17456 assign(ReactPutListenerQueue.prototype, {
17457 enqueuePutListener: function(rootNodeID, propKey, propValue) {
17458 this.listenersToPut.push({
17459 rootNodeID: rootNodeID,
17460 propKey: propKey,
17461 propValue: propValue
17462 });
17463 },
17464
17465 putListeners: function() {
17466 for (var i = 0; i < this.listenersToPut.length; i++) {
17467 var listenerToPut = this.listenersToPut[i];
17468 ReactBrowserEventEmitter.putListener(
17469 listenerToPut.rootNodeID,
17470 listenerToPut.propKey,
17471 listenerToPut.propValue
17472 );
17473 }
17474 },
17475
17476 reset: function() {
17477 this.listenersToPut.length = 0;
17478 },
17479
17480 destructor: function() {
17481 this.reset();
17482 }
17483 });
17484
17485 PooledClass.addPoolingTo(ReactPutListenerQueue);
17486
17487 module.exports = ReactPutListenerQueue;
17488
17489
17490/***/ },
17491/* 131 */
17492/***/ function(module, exports, __webpack_require__) {
17493
17494 /**
17495 * Copyright 2013-2014, Facebook, Inc.
17496 * All rights reserved.
17497 *
17498 * This source code is licensed under the BSD-style license found in the
17499 * LICENSE file in the root directory of this source tree. An additional grant
17500 * of patent rights can be found in the PATENTS file in the same directory.
17501 *
17502 * @providesModule camelize
17503 * @typechecks
17504 */
17505
17506 var _hyphenPattern = /-(.)/g;
17507
17508 /**
17509 * Camelcases a hyphenated string, for example:
17510 *
17511 * > camelize('background-color')
17512 * < "backgroundColor"
17513 *
17514 * @param {string} string
17515 * @return {string}
17516 */
17517 function camelize(string) {
17518 return string.replace(_hyphenPattern, function(_, character) {
17519 return character.toUpperCase();
17520 });
17521 }
17522
17523 module.exports = camelize;
17524
17525
17526/***/ },
17527/* 132 */
17528/***/ function(module, exports, __webpack_require__) {
17529
17530 /* WEBPACK VAR INJECTION */(function(process) {/**
17531 * Copyright 2014, Facebook, Inc.
17532 * All rights reserved.
17533 *
17534 * This source code is licensed under the BSD-style license found in the
17535 * LICENSE file in the root directory of this source tree. An additional grant
17536 * of patent rights can be found in the PATENTS file in the same directory.
17537 *
17538 * @providesModule accumulateInto
17539 */
17540
17541 "use strict";
17542
17543 var invariant = __webpack_require__(33);
17544
17545 /**
17546 *
17547 * Accumulates items that must not be null or undefined into the first one. This
17548 * is used to conserve memory by avoiding array allocations, and thus sacrifices
17549 * API cleanness. Since `current` can be null before being passed in and not
17550 * null after this function, make sure to assign it back to `current`:
17551 *
17552 * `a = accumulateInto(a, b);`
17553 *
17554 * This API should be sparingly used. Try `accumulate` for something cleaner.
17555 *
17556 * @return {*|array<*>} An accumulation of items.
17557 */
17558
17559 function accumulateInto(current, next) {
17560 ("production" !== process.env.NODE_ENV ? invariant(
17561 next != null,
17562 'accumulateInto(...): Accumulated items must not be null or undefined.'
17563 ) : invariant(next != null));
17564 if (current == null) {
17565 return next;
17566 }
17567
17568 // Both are not empty. Warning: Never call x.concat(y) when you are not
17569 // certain that x is an Array (x could be a string with concat method).
17570 var currentIsArray = Array.isArray(current);
17571 var nextIsArray = Array.isArray(next);
17572
17573 if (currentIsArray && nextIsArray) {
17574 current.push.apply(current, next);
17575 return current;
17576 }
17577
17578 if (currentIsArray) {
17579 current.push(next);
17580 return current;
17581 }
17582
17583 if (nextIsArray) {
17584 // A bit too dangerous to mutate `next`.
17585 return [current].concat(next);
17586 }
17587
17588 return [current, next];
17589 }
17590
17591 module.exports = accumulateInto;
17592
17593 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(27)))
17594
17595/***/ },
17596/* 133 */
17597/***/ function(module, exports, __webpack_require__) {
17598
17599 /**
17600 * Copyright 2013-2014, Facebook, Inc.
17601 * All rights reserved.
17602 *
17603 * This source code is licensed under the BSD-style license found in the
17604 * LICENSE file in the root directory of this source tree. An additional grant
17605 * of patent rights can be found in the PATENTS file in the same directory.
17606 *
17607 * @providesModule forEachAccumulated
17608 */
17609
17610 "use strict";
17611
17612 /**
17613 * @param {array} an "accumulation" of items which is either an Array or
17614 * a single item. Useful when paired with the `accumulate` module. This is a
17615 * simple utility that allows us to reason about a collection of items, but
17616 * handling the case when there is exactly one item (and we do not need to
17617 * allocate an array).
17618 */
17619 var forEachAccumulated = function(arr, cb, scope) {
17620 if (Array.isArray(arr)) {
17621 arr.forEach(cb, scope);
17622 } else if (arr) {
17623 cb.call(scope, arr);
17624 }
17625 };
17626
17627 module.exports = forEachAccumulated;
17628
17629
17630/***/ },
17631/* 134 */
17632/***/ function(module, exports, __webpack_require__) {
17633
17634 /**
17635 * Copyright 2013-2014, Facebook, Inc.
17636 * All rights reserved.
17637 *
17638 * This source code is licensed under the BSD-style license found in the
17639 * LICENSE file in the root directory of this source tree. An additional grant
17640 * of patent rights can be found in the PATENTS file in the same directory.
17641 *
17642 * @providesModule hyphenate
17643 * @typechecks
17644 */
17645
17646 var _uppercasePattern = /([A-Z])/g;
17647
17648 /**
17649 * Hyphenates a camelcased string, for example:
17650 *
17651 * > hyphenate('backgroundColor')
17652 * < "background-color"
17653 *
17654 * For CSS style names, use `hyphenateStyleName` instead which works properly
17655 * with all vendor prefixes, including `ms`.
17656 *
17657 * @param {string} string
17658 * @return {string}
17659 */
17660 function hyphenate(string) {
17661 return string.replace(_uppercasePattern, '-$1').toLowerCase();
17662 }
17663
17664 module.exports = hyphenate;
17665
17666
17667/***/ },
17668/* 135 */
17669/***/ function(module, exports, __webpack_require__) {
17670
17671 /**
17672 * Copyright 2013-2014, Facebook, Inc.
17673 * All rights reserved.
17674 *
17675 * This source code is licensed under the BSD-style license found in the
17676 * LICENSE file in the root directory of this source tree. An additional grant
17677 * of patent rights can be found in the PATENTS file in the same directory.
17678 *
17679 * @providesModule ReactDOMSelection
17680 */
17681
17682 "use strict";
17683
17684 var ExecutionEnvironment = __webpack_require__(26);
17685
17686 var getNodeForCharacterOffset = __webpack_require__(142);
17687 var getTextContentAccessor = __webpack_require__(105);
17688
17689 /**
17690 * While `isCollapsed` is available on the Selection object and `collapsed`
17691 * is available on the Range object, IE11 sometimes gets them wrong.
17692 * If the anchor/focus nodes and offsets are the same, the range is collapsed.
17693 */
17694 function isCollapsed(anchorNode, anchorOffset, focusNode, focusOffset) {
17695 return anchorNode === focusNode && anchorOffset === focusOffset;
17696 }
17697
17698 /**
17699 * Get the appropriate anchor and focus node/offset pairs for IE.
17700 *
17701 * The catch here is that IE's selection API doesn't provide information
17702 * about whether the selection is forward or backward, so we have to
17703 * behave as though it's always forward.
17704 *
17705 * IE text differs from modern selection in that it behaves as though
17706 * block elements end with a new line. This means character offsets will
17707 * differ between the two APIs.
17708 *
17709 * @param {DOMElement} node
17710 * @return {object}
17711 */
17712 function getIEOffsets(node) {
17713 var selection = document.selection;
17714 var selectedRange = selection.createRange();
17715 var selectedLength = selectedRange.text.length;
17716
17717 // Duplicate selection so we can move range without breaking user selection.
17718 var fromStart = selectedRange.duplicate();
17719 fromStart.moveToElementText(node);
17720 fromStart.setEndPoint('EndToStart', selectedRange);
17721
17722 var startOffset = fromStart.text.length;
17723 var endOffset = startOffset + selectedLength;
17724
17725 return {
17726 start: startOffset,
17727 end: endOffset
17728 };
17729 }
17730
17731 /**
17732 * @param {DOMElement} node
17733 * @return {?object}
17734 */
17735 function getModernOffsets(node) {
17736 var selection = window.getSelection && window.getSelection();
17737
17738 if (!selection || selection.rangeCount === 0) {
17739 return null;
17740 }
17741
17742 var anchorNode = selection.anchorNode;
17743 var anchorOffset = selection.anchorOffset;
17744 var focusNode = selection.focusNode;
17745 var focusOffset = selection.focusOffset;
17746
17747 var currentRange = selection.getRangeAt(0);
17748
17749 // If the node and offset values are the same, the selection is collapsed.
17750 // `Selection.isCollapsed` is available natively, but IE sometimes gets
17751 // this value wrong.
17752 var isSelectionCollapsed = isCollapsed(
17753 selection.anchorNode,
17754 selection.anchorOffset,
17755 selection.focusNode,
17756 selection.focusOffset
17757 );
17758
17759 var rangeLength = isSelectionCollapsed ? 0 : currentRange.toString().length;
17760
17761 var tempRange = currentRange.cloneRange();
17762 tempRange.selectNodeContents(node);
17763 tempRange.setEnd(currentRange.startContainer, currentRange.startOffset);
17764
17765 var isTempRangeCollapsed = isCollapsed(
17766 tempRange.startContainer,
17767 tempRange.startOffset,
17768 tempRange.endContainer,
17769 tempRange.endOffset
17770 );
17771
17772 var start = isTempRangeCollapsed ? 0 : tempRange.toString().length;
17773 var end = start + rangeLength;
17774
17775 // Detect whether the selection is backward.
17776 var detectionRange = document.createRange();
17777 detectionRange.setStart(anchorNode, anchorOffset);
17778 detectionRange.setEnd(focusNode, focusOffset);
17779 var isBackward = detectionRange.collapsed;
17780
17781 return {
17782 start: isBackward ? end : start,
17783 end: isBackward ? start : end
17784 };
17785 }
17786
17787 /**
17788 * @param {DOMElement|DOMTextNode} node
17789 * @param {object} offsets
17790 */
17791 function setIEOffsets(node, offsets) {
17792 var range = document.selection.createRange().duplicate();
17793 var start, end;
17794
17795 if (typeof offsets.end === 'undefined') {
17796 start = offsets.start;
17797 end = start;
17798 } else if (offsets.start > offsets.end) {
17799 start = offsets.end;
17800 end = offsets.start;
17801 } else {
17802 start = offsets.start;
17803 end = offsets.end;
17804 }
17805
17806 range.moveToElementText(node);
17807 range.moveStart('character', start);
17808 range.setEndPoint('EndToStart', range);
17809 range.moveEnd('character', end - start);
17810 range.select();
17811 }
17812
17813 /**
17814 * In modern non-IE browsers, we can support both forward and backward
17815 * selections.
17816 *
17817 * Note: IE10+ supports the Selection object, but it does not support
17818 * the `extend` method, which means that even in modern IE, it's not possible
17819 * to programatically create a backward selection. Thus, for all IE
17820 * versions, we use the old IE API to create our selections.
17821 *
17822 * @param {DOMElement|DOMTextNode} node
17823 * @param {object} offsets
17824 */
17825 function setModernOffsets(node, offsets) {
17826 if (!window.getSelection) {
17827 return;
17828 }
17829
17830 var selection = window.getSelection();
17831 var length = node[getTextContentAccessor()].length;
17832 var start = Math.min(offsets.start, length);
17833 var end = typeof offsets.end === 'undefined' ?
17834 start : Math.min(offsets.end, length);
17835
17836 // IE 11 uses modern selection, but doesn't support the extend method.
17837 // Flip backward selections, so we can set with a single range.
17838 if (!selection.extend && start > end) {
17839 var temp = end;
17840 end = start;
17841 start = temp;
17842 }
17843
17844 var startMarker = getNodeForCharacterOffset(node, start);
17845 var endMarker = getNodeForCharacterOffset(node, end);
17846
17847 if (startMarker && endMarker) {
17848 var range = document.createRange();
17849 range.setStart(startMarker.node, startMarker.offset);
17850 selection.removeAllRanges();
17851
17852 if (start > end) {
17853 selection.addRange(range);
17854 selection.extend(endMarker.node, endMarker.offset);
17855 } else {
17856 range.setEnd(endMarker.node, endMarker.offset);
17857 selection.addRange(range);
17858 }
17859 }
17860 }
17861
17862 var useIEOffsets = ExecutionEnvironment.canUseDOM && document.selection;
17863
17864 var ReactDOMSelection = {
17865 /**
17866 * @param {DOMElement} node
17867 */
17868 getOffsets: useIEOffsets ? getIEOffsets : getModernOffsets,
17869
17870 /**
17871 * @param {DOMElement|DOMTextNode} node
17872 * @param {object} offsets
17873 */
17874 setOffsets: useIEOffsets ? setIEOffsets : setModernOffsets
17875 };
17876
17877 module.exports = ReactDOMSelection;
17878
17879
17880/***/ },
17881/* 136 */
17882/***/ function(module, exports, __webpack_require__) {
17883
17884 /**
17885 * Copyright 2014, Facebook, Inc.
17886 * All rights reserved.
17887 *
17888 * This source code is licensed under the BSD-style license found in the
17889 * LICENSE file in the root directory of this source tree. An additional grant
17890 * of patent rights can be found in the PATENTS file in the same directory.
17891 *
17892 * @providesModule focusNode
17893 */
17894
17895 "use strict";
17896
17897 /**
17898 * @param {DOMElement} node input/textarea to focus
17899 */
17900 function focusNode(node) {
17901 // IE8 can throw "Can't move focus to the control because it is invisible,
17902 // not enabled, or of a type that does not accept the focus." for all kinds of
17903 // reasons that are too expensive and fragile to test.
17904 try {
17905 node.focus();
17906 } catch(e) {
17907 }
17908 }
17909
17910 module.exports = focusNode;
17911
17912
17913/***/ },
17914/* 137 */
17915/***/ function(module, exports, __webpack_require__) {
17916
17917 /**
17918 * Copyright 2013 Facebook, Inc.
17919 * All rights reserved.
17920 *
17921 * This source code is licensed under the BSD-style license found in the
17922 * LICENSE file in the root directory of this source tree. An additional grant
17923 * of patent rights can be found in the PATENTS file in the same directory.
17924 *
17925 * @providesModule getEventModifierState
17926 * @typechecks static-only
17927 */
17928
17929 "use strict";
17930
17931 /**
17932 * Translation from modifier key to the associated property in the event.
17933 * @see http://www.w3.org/TR/DOM-Level-3-Events/#keys-Modifiers
17934 */
17935
17936 var modifierKeyToProp = {
17937 'Alt': 'altKey',
17938 'Control': 'ctrlKey',
17939 'Meta': 'metaKey',
17940 'Shift': 'shiftKey'
17941 };
17942
17943 // IE8 does not implement getModifierState so we simply map it to the only
17944 // modifier keys exposed by the event itself, does not support Lock-keys.
17945 // Currently, all major browsers except Chrome seems to support Lock-keys.
17946 function modifierStateGetter(keyArg) {
17947 /*jshint validthis:true */
17948 var syntheticEvent = this;
17949 var nativeEvent = syntheticEvent.nativeEvent;
17950 if (nativeEvent.getModifierState) {
17951 return nativeEvent.getModifierState(keyArg);
17952 }
17953 var keyProp = modifierKeyToProp[keyArg];
17954 return keyProp ? !!nativeEvent[keyProp] : false;
17955 }
17956
17957 function getEventModifierState(nativeEvent) {
17958 return modifierStateGetter;
17959 }
17960
17961 module.exports = getEventModifierState;
17962
17963
17964/***/ },
17965/* 138 */
17966/***/ function(module, exports, __webpack_require__) {
17967
17968 /* WEBPACK VAR INJECTION */(function(process) {/**
17969 * Copyright 2013-2014, Facebook, Inc.
17970 * All rights reserved.
17971 *
17972 * This source code is licensed under the BSD-style license found in the
17973 * LICENSE file in the root directory of this source tree. An additional grant
17974 * of patent rights can be found in the PATENTS file in the same directory.
17975 *
17976 * @providesModule DOMChildrenOperations
17977 * @typechecks static-only
17978 */
17979
17980 "use strict";
17981
17982 var Danger = __webpack_require__(143);
17983 var ReactMultiChildUpdateTypes = __webpack_require__(81);
17984
17985 var getTextContentAccessor = __webpack_require__(105);
17986 var invariant = __webpack_require__(33);
17987
17988 /**
17989 * The DOM property to use when setting text content.
17990 *
17991 * @type {string}
17992 * @private
17993 */
17994 var textContentAccessor = getTextContentAccessor();
17995
17996 /**
17997 * Inserts `childNode` as a child of `parentNode` at the `index`.
17998 *
17999 * @param {DOMElement} parentNode Parent node in which to insert.
18000 * @param {DOMElement} childNode Child node to insert.
18001 * @param {number} index Index at which to insert the child.
18002 * @internal
18003 */
18004 function insertChildAt(parentNode, childNode, index) {
18005 // By exploiting arrays returning `undefined` for an undefined index, we can
18006 // rely exclusively on `insertBefore(node, null)` instead of also using
18007 // `appendChild(node)`. However, using `undefined` is not allowed by all
18008 // browsers so we must replace it with `null`.
18009 parentNode.insertBefore(
18010 childNode,
18011 parentNode.childNodes[index] || null
18012 );
18013 }
18014
18015 var updateTextContent;
18016 if (textContentAccessor === 'textContent') {
18017 /**
18018 * Sets the text content of `node` to `text`.
18019 *
18020 * @param {DOMElement} node Node to change
18021 * @param {string} text New text content
18022 */
18023 updateTextContent = function(node, text) {
18024 node.textContent = text;
18025 };
18026 } else {
18027 /**
18028 * Sets the text content of `node` to `text`.
18029 *
18030 * @param {DOMElement} node Node to change
18031 * @param {string} text New text content
18032 */
18033 updateTextContent = function(node, text) {
18034 // In order to preserve newlines correctly, we can't use .innerText to set
18035 // the contents (see #1080), so we empty the element then append a text node
18036 while (node.firstChild) {
18037 node.removeChild(node.firstChild);
18038 }
18039 if (text) {
18040 var doc = node.ownerDocument || document;
18041 node.appendChild(doc.createTextNode(text));
18042 }
18043 };
18044 }
18045
18046 /**
18047 * Operations for updating with DOM children.
18048 */
18049 var DOMChildrenOperations = {
18050
18051 dangerouslyReplaceNodeWithMarkup: Danger.dangerouslyReplaceNodeWithMarkup,
18052
18053 updateTextContent: updateTextContent,
18054
18055 /**
18056 * Updates a component's children by processing a series of updates. The
18057 * update configurations are each expected to have a `parentNode` property.
18058 *
18059 * @param {array<object>} updates List of update configurations.
18060 * @param {array<string>} markupList List of markup strings.
18061 * @internal
18062 */
18063 processUpdates: function(updates, markupList) {
18064 var update;
18065 // Mapping from parent IDs to initial child orderings.
18066 var initialChildren = null;
18067 // List of children that will be moved or removed.
18068 var updatedChildren = null;
18069
18070 for (var i = 0; update = updates[i]; i++) {
18071 if (update.type === ReactMultiChildUpdateTypes.MOVE_EXISTING ||
18072 update.type === ReactMultiChildUpdateTypes.REMOVE_NODE) {
18073 var updatedIndex = update.fromIndex;
18074 var updatedChild = update.parentNode.childNodes[updatedIndex];
18075 var parentID = update.parentID;
18076
18077 ("production" !== process.env.NODE_ENV ? invariant(
18078 updatedChild,
18079 'processUpdates(): Unable to find child %s of element. This ' +
18080 'probably means the DOM was unexpectedly mutated (e.g., by the ' +
18081 'browser), usually due to forgetting a <tbody> when using tables, ' +
18082 'nesting tags like <form>, <p>, or <a>, or using non-SVG elements '+
18083 'in an <svg> parent. Try inspecting the child nodes of the element ' +
18084 'with React ID `%s`.',
18085 updatedIndex,
18086 parentID
18087 ) : invariant(updatedChild));
18088
18089 initialChildren = initialChildren || {};
18090 initialChildren[parentID] = initialChildren[parentID] || [];
18091 initialChildren[parentID][updatedIndex] = updatedChild;
18092
18093 updatedChildren = updatedChildren || [];
18094 updatedChildren.push(updatedChild);
18095 }
18096 }
18097
18098 var renderedMarkup = Danger.dangerouslyRenderMarkup(markupList);
18099
18100 // Remove updated children first so that `toIndex` is consistent.
18101 if (updatedChildren) {
18102 for (var j = 0; j < updatedChildren.length; j++) {
18103 updatedChildren[j].parentNode.removeChild(updatedChildren[j]);
18104 }
18105 }
18106
18107 for (var k = 0; update = updates[k]; k++) {
18108 switch (update.type) {
18109 case ReactMultiChildUpdateTypes.INSERT_MARKUP:
18110 insertChildAt(
18111 update.parentNode,
18112 renderedMarkup[update.markupIndex],
18113 update.toIndex
18114 );
18115 break;
18116 case ReactMultiChildUpdateTypes.MOVE_EXISTING:
18117 insertChildAt(
18118 update.parentNode,
18119 initialChildren[update.parentID][update.fromIndex],
18120 update.toIndex
18121 );
18122 break;
18123 case ReactMultiChildUpdateTypes.TEXT_CONTENT:
18124 updateTextContent(
18125 update.parentNode,
18126 update.textContent
18127 );
18128 break;
18129 case ReactMultiChildUpdateTypes.REMOVE_NODE:
18130 // Already removed by the for-loop above.
18131 break;
18132 }
18133 }
18134 }
18135
18136 };
18137
18138 module.exports = DOMChildrenOperations;
18139
18140 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(27)))
18141
18142/***/ },
18143/* 139 */
18144/***/ function(module, exports, __webpack_require__) {
18145
18146 /**
18147 * Copyright 2013-2014, Facebook, Inc.
18148 * All rights reserved.
18149 *
18150 * This source code is licensed under the BSD-style license found in the
18151 * LICENSE file in the root directory of this source tree. An additional grant
18152 * of patent rights can be found in the PATENTS file in the same directory.
18153 *
18154 * @providesModule getEventKey
18155 * @typechecks static-only
18156 */
18157
18158 "use strict";
18159
18160 var getEventCharCode = __webpack_require__(125);
18161
18162 /**
18163 * Normalization of deprecated HTML5 `key` values
18164 * @see https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent#Key_names
18165 */
18166 var normalizeKey = {
18167 'Esc': 'Escape',
18168 'Spacebar': ' ',
18169 'Left': 'ArrowLeft',
18170 'Up': 'ArrowUp',
18171 'Right': 'ArrowRight',
18172 'Down': 'ArrowDown',
18173 'Del': 'Delete',
18174 'Win': 'OS',
18175 'Menu': 'ContextMenu',
18176 'Apps': 'ContextMenu',
18177 'Scroll': 'ScrollLock',
18178 'MozPrintableKey': 'Unidentified'
18179 };
18180
18181 /**
18182 * Translation from legacy `keyCode` to HTML5 `key`
18183 * Only special keys supported, all others depend on keyboard layout or browser
18184 * @see https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent#Key_names
18185 */
18186 var translateToKey = {
18187 8: 'Backspace',
18188 9: 'Tab',
18189 12: 'Clear',
18190 13: 'Enter',
18191 16: 'Shift',
18192 17: 'Control',
18193 18: 'Alt',
18194 19: 'Pause',
18195 20: 'CapsLock',
18196 27: 'Escape',
18197 32: ' ',
18198 33: 'PageUp',
18199 34: 'PageDown',
18200 35: 'End',
18201 36: 'Home',
18202 37: 'ArrowLeft',
18203 38: 'ArrowUp',
18204 39: 'ArrowRight',
18205 40: 'ArrowDown',
18206 45: 'Insert',
18207 46: 'Delete',
18208 112: 'F1', 113: 'F2', 114: 'F3', 115: 'F4', 116: 'F5', 117: 'F6',
18209 118: 'F7', 119: 'F8', 120: 'F9', 121: 'F10', 122: 'F11', 123: 'F12',
18210 144: 'NumLock',
18211 145: 'ScrollLock',
18212 224: 'Meta'
18213 };
18214
18215 /**
18216 * @param {object} nativeEvent Native browser event.
18217 * @return {string} Normalized `key` property.
18218 */
18219 function getEventKey(nativeEvent) {
18220 if (nativeEvent.key) {
18221 // Normalize inconsistent values reported by browsers due to
18222 // implementations of a working draft specification.
18223
18224 // FireFox implements `key` but returns `MozPrintableKey` for all
18225 // printable characters (normalized to `Unidentified`), ignore it.
18226 var key = normalizeKey[nativeEvent.key] || nativeEvent.key;
18227 if (key !== 'Unidentified') {
18228 return key;
18229 }
18230 }
18231
18232 // Browser does not implement `key`, polyfill as much of it as we can.
18233 if (nativeEvent.type === 'keypress') {
18234 var charCode = getEventCharCode(nativeEvent);
18235
18236 // The enter-key is technically both printable and non-printable and can
18237 // thus be captured by `keypress`, no other non-printable key should.
18238 return charCode === 13 ? 'Enter' : String.fromCharCode(charCode);
18239 }
18240 if (nativeEvent.type === 'keydown' || nativeEvent.type === 'keyup') {
18241 // While user keyboard layout determines the actual meaning of each
18242 // `keyCode` value, almost all function keys have a universal value.
18243 return translateToKey[nativeEvent.keyCode] || 'Unidentified';
18244 }
18245 return '';
18246 }
18247
18248 module.exports = getEventKey;
18249
18250
18251/***/ },
18252/* 140 */
18253/***/ function(module, exports, __webpack_require__) {
18254
18255 /**
18256 * Copyright 2013-2014, Facebook, Inc.
18257 * All rights reserved.
18258 *
18259 * This source code is licensed under the BSD-style license found in the
18260 * LICENSE file in the root directory of this source tree. An additional grant
18261 * of patent rights can be found in the PATENTS file in the same directory.
18262 *
18263 * @providesModule performance
18264 * @typechecks
18265 */
18266
18267 "use strict";
18268
18269 var ExecutionEnvironment = __webpack_require__(26);
18270
18271 var performance;
18272
18273 if (ExecutionEnvironment.canUseDOM) {
18274 performance =
18275 window.performance ||
18276 window.msPerformance ||
18277 window.webkitPerformance;
18278 }
18279
18280 module.exports = performance || {};
18281
18282
18283/***/ },
18284/* 141 */
18285/***/ function(module, exports, __webpack_require__) {
18286
18287 /**
18288 * Copyright 2013-2014, Facebook, Inc.
18289 * All rights reserved.
18290 *
18291 * This source code is licensed under the BSD-style license found in the
18292 * LICENSE file in the root directory of this source tree. An additional grant
18293 * of patent rights can be found in the PATENTS file in the same directory.
18294 *
18295 * @providesModule isNode
18296 * @typechecks
18297 */
18298
18299 /**
18300 * @param {*} object The object to check.
18301 * @return {boolean} Whether or not the object is a DOM node.
18302 */
18303 function isNode(object) {
18304 return !!(object && (
18305 typeof Node === 'function' ? object instanceof Node :
18306 typeof object === 'object' &&
18307 typeof object.nodeType === 'number' &&
18308 typeof object.nodeName === 'string'
18309 ));
18310 }
18311
18312 module.exports = isNode;
18313
18314
18315/***/ },
18316/* 142 */
18317/***/ function(module, exports, __webpack_require__) {
18318
18319 /**
18320 * Copyright 2013-2014, Facebook, Inc.
18321 * All rights reserved.
18322 *
18323 * This source code is licensed under the BSD-style license found in the
18324 * LICENSE file in the root directory of this source tree. An additional grant
18325 * of patent rights can be found in the PATENTS file in the same directory.
18326 *
18327 * @providesModule getNodeForCharacterOffset
18328 */
18329
18330 "use strict";
18331
18332 /**
18333 * Given any node return the first leaf node without children.
18334 *
18335 * @param {DOMElement|DOMTextNode} node
18336 * @return {DOMElement|DOMTextNode}
18337 */
18338 function getLeafNode(node) {
18339 while (node && node.firstChild) {
18340 node = node.firstChild;
18341 }
18342 return node;
18343 }
18344
18345 /**
18346 * Get the next sibling within a container. This will walk up the
18347 * DOM if a node's siblings have been exhausted.
18348 *
18349 * @param {DOMElement|DOMTextNode} node
18350 * @return {?DOMElement|DOMTextNode}
18351 */
18352 function getSiblingNode(node) {
18353 while (node) {
18354 if (node.nextSibling) {
18355 return node.nextSibling;
18356 }
18357 node = node.parentNode;
18358 }
18359 }
18360
18361 /**
18362 * Get object describing the nodes which contain characters at offset.
18363 *
18364 * @param {DOMElement|DOMTextNode} root
18365 * @param {number} offset
18366 * @return {?object}
18367 */
18368 function getNodeForCharacterOffset(root, offset) {
18369 var node = getLeafNode(root);
18370 var nodeStart = 0;
18371 var nodeEnd = 0;
18372
18373 while (node) {
18374 if (node.nodeType == 3) {
18375 nodeEnd = nodeStart + node.textContent.length;
18376
18377 if (nodeStart <= offset && nodeEnd >= offset) {
18378 return {
18379 node: node,
18380 offset: offset - nodeStart
18381 };
18382 }
18383
18384 nodeStart = nodeEnd;
18385 }
18386
18387 node = getLeafNode(getSiblingNode(node));
18388 }
18389 }
18390
18391 module.exports = getNodeForCharacterOffset;
18392
18393
18394/***/ },
18395/* 143 */
18396/***/ function(module, exports, __webpack_require__) {
18397
18398 /* WEBPACK VAR INJECTION */(function(process) {/**
18399 * Copyright 2013-2014, Facebook, Inc.
18400 * All rights reserved.
18401 *
18402 * This source code is licensed under the BSD-style license found in the
18403 * LICENSE file in the root directory of this source tree. An additional grant
18404 * of patent rights can be found in the PATENTS file in the same directory.
18405 *
18406 * @providesModule Danger
18407 * @typechecks static-only
18408 */
18409
18410 /*jslint evil: true, sub: true */
18411
18412 "use strict";
18413
18414 var ExecutionEnvironment = __webpack_require__(26);
18415
18416 var createNodesFromMarkup = __webpack_require__(144);
18417 var emptyFunction = __webpack_require__(83);
18418 var getMarkupWrap = __webpack_require__(145);
18419 var invariant = __webpack_require__(33);
18420
18421 var OPEN_TAG_NAME_EXP = /^(<[^ \/>]+)/;
18422 var RESULT_INDEX_ATTR = 'data-danger-index';
18423
18424 /**
18425 * Extracts the `nodeName` from a string of markup.
18426 *
18427 * NOTE: Extracting the `nodeName` does not require a regular expression match
18428 * because we make assumptions about React-generated markup (i.e. there are no
18429 * spaces surrounding the opening tag and there is at least one attribute).
18430 *
18431 * @param {string} markup String of markup.
18432 * @return {string} Node name of the supplied markup.
18433 * @see http://jsperf.com/extract-nodename
18434 */
18435 function getNodeName(markup) {
18436 return markup.substring(1, markup.indexOf(' '));
18437 }
18438
18439 var Danger = {
18440
18441 /**
18442 * Renders markup into an array of nodes. The markup is expected to render
18443 * into a list of root nodes. Also, the length of `resultList` and
18444 * `markupList` should be the same.
18445 *
18446 * @param {array<string>} markupList List of markup strings to render.
18447 * @return {array<DOMElement>} List of rendered nodes.
18448 * @internal
18449 */
18450 dangerouslyRenderMarkup: function(markupList) {
18451 ("production" !== process.env.NODE_ENV ? invariant(
18452 ExecutionEnvironment.canUseDOM,
18453 'dangerouslyRenderMarkup(...): Cannot render markup in a worker ' +
18454 'thread. Make sure `window` and `document` are available globally ' +
18455 'before requiring React when unit testing or use ' +
18456 'React.renderToString for server rendering.'
18457 ) : invariant(ExecutionEnvironment.canUseDOM));
18458 var nodeName;
18459 var markupByNodeName = {};
18460 // Group markup by `nodeName` if a wrap is necessary, else by '*'.
18461 for (var i = 0; i < markupList.length; i++) {
18462 ("production" !== process.env.NODE_ENV ? invariant(
18463 markupList[i],
18464 'dangerouslyRenderMarkup(...): Missing markup.'
18465 ) : invariant(markupList[i]));
18466 nodeName = getNodeName(markupList[i]);
18467 nodeName = getMarkupWrap(nodeName) ? nodeName : '*';
18468 markupByNodeName[nodeName] = markupByNodeName[nodeName] || [];
18469 markupByNodeName[nodeName][i] = markupList[i];
18470 }
18471 var resultList = [];
18472 var resultListAssignmentCount = 0;
18473 for (nodeName in markupByNodeName) {
18474 if (!markupByNodeName.hasOwnProperty(nodeName)) {
18475 continue;
18476 }
18477 var markupListByNodeName = markupByNodeName[nodeName];
18478
18479 // This for-in loop skips the holes of the sparse array. The order of
18480 // iteration should follow the order of assignment, which happens to match
18481 // numerical index order, but we don't rely on that.
18482 for (var resultIndex in markupListByNodeName) {
18483 if (markupListByNodeName.hasOwnProperty(resultIndex)) {
18484 var markup = markupListByNodeName[resultIndex];
18485
18486 // Push the requested markup with an additional RESULT_INDEX_ATTR
18487 // attribute. If the markup does not start with a < character, it
18488 // will be discarded below (with an appropriate console.error).
18489 markupListByNodeName[resultIndex] = markup.replace(
18490 OPEN_TAG_NAME_EXP,
18491 // This index will be parsed back out below.
18492 '$1 ' + RESULT_INDEX_ATTR + '="' + resultIndex + '" '
18493 );
18494 }
18495 }
18496
18497 // Render each group of markup with similar wrapping `nodeName`.
18498 var renderNodes = createNodesFromMarkup(
18499 markupListByNodeName.join(''),
18500 emptyFunction // Do nothing special with <script> tags.
18501 );
18502
18503 for (i = 0; i < renderNodes.length; ++i) {
18504 var renderNode = renderNodes[i];
18505 if (renderNode.hasAttribute &&
18506 renderNode.hasAttribute(RESULT_INDEX_ATTR)) {
18507
18508 resultIndex = +renderNode.getAttribute(RESULT_INDEX_ATTR);
18509 renderNode.removeAttribute(RESULT_INDEX_ATTR);
18510
18511 ("production" !== process.env.NODE_ENV ? invariant(
18512 !resultList.hasOwnProperty(resultIndex),
18513 'Danger: Assigning to an already-occupied result index.'
18514 ) : invariant(!resultList.hasOwnProperty(resultIndex)));
18515
18516 resultList[resultIndex] = renderNode;
18517
18518 // This should match resultList.length and markupList.length when
18519 // we're done.
18520 resultListAssignmentCount += 1;
18521
18522 } else if ("production" !== process.env.NODE_ENV) {
18523 console.error(
18524 "Danger: Discarding unexpected node:",
18525 renderNode
18526 );
18527 }
18528 }
18529 }
18530
18531 // Although resultList was populated out of order, it should now be a dense
18532 // array.
18533 ("production" !== process.env.NODE_ENV ? invariant(
18534 resultListAssignmentCount === resultList.length,
18535 'Danger: Did not assign to every index of resultList.'
18536 ) : invariant(resultListAssignmentCount === resultList.length));
18537
18538 ("production" !== process.env.NODE_ENV ? invariant(
18539 resultList.length === markupList.length,
18540 'Danger: Expected markup to render %s nodes, but rendered %s.',
18541 markupList.length,
18542 resultList.length
18543 ) : invariant(resultList.length === markupList.length));
18544
18545 return resultList;
18546 },
18547
18548 /**
18549 * Replaces a node with a string of markup at its current position within its
18550 * parent. The markup must render into a single root node.
18551 *
18552 * @param {DOMElement} oldChild Child node to replace.
18553 * @param {string} markup Markup to render in place of the child node.
18554 * @internal
18555 */
18556 dangerouslyReplaceNodeWithMarkup: function(oldChild, markup) {
18557 ("production" !== process.env.NODE_ENV ? invariant(
18558 ExecutionEnvironment.canUseDOM,
18559 'dangerouslyReplaceNodeWithMarkup(...): Cannot render markup in a ' +
18560 'worker thread. Make sure `window` and `document` are available ' +
18561 'globally before requiring React when unit testing or use ' +
18562 'React.renderToString for server rendering.'
18563 ) : invariant(ExecutionEnvironment.canUseDOM));
18564 ("production" !== process.env.NODE_ENV ? invariant(markup, 'dangerouslyReplaceNodeWithMarkup(...): Missing markup.') : invariant(markup));
18565 ("production" !== process.env.NODE_ENV ? invariant(
18566 oldChild.tagName.toLowerCase() !== 'html',
18567 'dangerouslyReplaceNodeWithMarkup(...): Cannot replace markup of the ' +
18568 '<html> node. This is because browser quirks make this unreliable ' +
18569 'and/or slow. If you want to render to the root you must use ' +
18570 'server rendering. See renderComponentToString().'
18571 ) : invariant(oldChild.tagName.toLowerCase() !== 'html'));
18572
18573 var newChild = createNodesFromMarkup(markup, emptyFunction)[0];
18574 oldChild.parentNode.replaceChild(newChild, oldChild);
18575 }
18576
18577 };
18578
18579 module.exports = Danger;
18580
18581 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(27)))
18582
18583/***/ },
18584/* 144 */
18585/***/ function(module, exports, __webpack_require__) {
18586
18587 /* WEBPACK VAR INJECTION */(function(process) {/**
18588 * Copyright 2013-2014, Facebook, Inc.
18589 * All rights reserved.
18590 *
18591 * This source code is licensed under the BSD-style license found in the
18592 * LICENSE file in the root directory of this source tree. An additional grant
18593 * of patent rights can be found in the PATENTS file in the same directory.
18594 *
18595 * @providesModule createNodesFromMarkup
18596 * @typechecks
18597 */
18598
18599 /*jslint evil: true, sub: true */
18600
18601 var ExecutionEnvironment = __webpack_require__(26);
18602
18603 var createArrayFrom = __webpack_require__(146);
18604 var getMarkupWrap = __webpack_require__(145);
18605 var invariant = __webpack_require__(33);
18606
18607 /**
18608 * Dummy container used to render all markup.
18609 */
18610 var dummyNode =
18611 ExecutionEnvironment.canUseDOM ? document.createElement('div') : null;
18612
18613 /**
18614 * Pattern used by `getNodeName`.
18615 */
18616 var nodeNamePattern = /^\s*<(\w+)/;
18617
18618 /**
18619 * Extracts the `nodeName` of the first element in a string of markup.
18620 *
18621 * @param {string} markup String of markup.
18622 * @return {?string} Node name of the supplied markup.
18623 */
18624 function getNodeName(markup) {
18625 var nodeNameMatch = markup.match(nodeNamePattern);
18626 return nodeNameMatch && nodeNameMatch[1].toLowerCase();
18627 }
18628
18629 /**
18630 * Creates an array containing the nodes rendered from the supplied markup. The
18631 * optionally supplied `handleScript` function will be invoked once for each
18632 * <script> element that is rendered. If no `handleScript` function is supplied,
18633 * an exception is thrown if any <script> elements are rendered.
18634 *
18635 * @param {string} markup A string of valid HTML markup.
18636 * @param {?function} handleScript Invoked once for each rendered <script>.
18637 * @return {array<DOMElement|DOMTextNode>} An array of rendered nodes.
18638 */
18639 function createNodesFromMarkup(markup, handleScript) {
18640 var node = dummyNode;
18641 ("production" !== process.env.NODE_ENV ? invariant(!!dummyNode, 'createNodesFromMarkup dummy not initialized') : invariant(!!dummyNode));
18642 var nodeName = getNodeName(markup);
18643
18644 var wrap = nodeName && getMarkupWrap(nodeName);
18645 if (wrap) {
18646 node.innerHTML = wrap[1] + markup + wrap[2];
18647
18648 var wrapDepth = wrap[0];
18649 while (wrapDepth--) {
18650 node = node.lastChild;
18651 }
18652 } else {
18653 node.innerHTML = markup;
18654 }
18655
18656 var scripts = node.getElementsByTagName('script');
18657 if (scripts.length) {
18658 ("production" !== process.env.NODE_ENV ? invariant(
18659 handleScript,
18660 'createNodesFromMarkup(...): Unexpected <script> element rendered.'
18661 ) : invariant(handleScript));
18662 createArrayFrom(scripts).forEach(handleScript);
18663 }
18664
18665 var nodes = createArrayFrom(node.childNodes);
18666 while (node.lastChild) {
18667 node.removeChild(node.lastChild);
18668 }
18669 return nodes;
18670 }
18671
18672 module.exports = createNodesFromMarkup;
18673
18674 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(27)))
18675
18676/***/ },
18677/* 145 */
18678/***/ function(module, exports, __webpack_require__) {
18679
18680 /* WEBPACK VAR INJECTION */(function(process) {/**
18681 * Copyright 2013-2014, Facebook, Inc.
18682 * All rights reserved.
18683 *
18684 * This source code is licensed under the BSD-style license found in the
18685 * LICENSE file in the root directory of this source tree. An additional grant
18686 * of patent rights can be found in the PATENTS file in the same directory.
18687 *
18688 * @providesModule getMarkupWrap
18689 */
18690
18691 var ExecutionEnvironment = __webpack_require__(26);
18692
18693 var invariant = __webpack_require__(33);
18694
18695 /**
18696 * Dummy container used to detect which wraps are necessary.
18697 */
18698 var dummyNode =
18699 ExecutionEnvironment.canUseDOM ? document.createElement('div') : null;
18700
18701 /**
18702 * Some browsers cannot use `innerHTML` to render certain elements standalone,
18703 * so we wrap them, render the wrapped nodes, then extract the desired node.
18704 *
18705 * In IE8, certain elements cannot render alone, so wrap all elements ('*').
18706 */
18707 var shouldWrap = {
18708 // Force wrapping for SVG elements because if they get created inside a <div>,
18709 // they will be initialized in the wrong namespace (and will not display).
18710 'circle': true,
18711 'defs': true,
18712 'ellipse': true,
18713 'g': true,
18714 'line': true,
18715 'linearGradient': true,
18716 'path': true,
18717 'polygon': true,
18718 'polyline': true,
18719 'radialGradient': true,
18720 'rect': true,
18721 'stop': true,
18722 'text': true
18723 };
18724
18725 var selectWrap = [1, '<select multiple="true">', '</select>'];
18726 var tableWrap = [1, '<table>', '</table>'];
18727 var trWrap = [3, '<table><tbody><tr>', '</tr></tbody></table>'];
18728
18729 var svgWrap = [1, '<svg>', '</svg>'];
18730
18731 var markupWrap = {
18732 '*': [1, '?<div>', '</div>'],
18733
18734 'area': [1, '<map>', '</map>'],
18735 'col': [2, '<table><tbody></tbody><colgroup>', '</colgroup></table>'],
18736 'legend': [1, '<fieldset>', '</fieldset>'],
18737 'param': [1, '<object>', '</object>'],
18738 'tr': [2, '<table><tbody>', '</tbody></table>'],
18739
18740 'optgroup': selectWrap,
18741 'option': selectWrap,
18742
18743 'caption': tableWrap,
18744 'colgroup': tableWrap,
18745 'tbody': tableWrap,
18746 'tfoot': tableWrap,
18747 'thead': tableWrap,
18748
18749 'td': trWrap,
18750 'th': trWrap,
18751
18752 'circle': svgWrap,
18753 'defs': svgWrap,
18754 'ellipse': svgWrap,
18755 'g': svgWrap,
18756 'line': svgWrap,
18757 'linearGradient': svgWrap,
18758 'path': svgWrap,
18759 'polygon': svgWrap,
18760 'polyline': svgWrap,
18761 'radialGradient': svgWrap,
18762 'rect': svgWrap,
18763 'stop': svgWrap,
18764 'text': svgWrap
18765 };
18766
18767 /**
18768 * Gets the markup wrap configuration for the supplied `nodeName`.
18769 *
18770 * NOTE: This lazily detects which wraps are necessary for the current browser.
18771 *
18772 * @param {string} nodeName Lowercase `nodeName`.
18773 * @return {?array} Markup wrap configuration, if applicable.
18774 */
18775 function getMarkupWrap(nodeName) {
18776 ("production" !== process.env.NODE_ENV ? invariant(!!dummyNode, 'Markup wrapping node not initialized') : invariant(!!dummyNode));
18777 if (!markupWrap.hasOwnProperty(nodeName)) {
18778 nodeName = '*';
18779 }
18780 if (!shouldWrap.hasOwnProperty(nodeName)) {
18781 if (nodeName === '*') {
18782 dummyNode.innerHTML = '<link />';
18783 } else {
18784 dummyNode.innerHTML = '<' + nodeName + '></' + nodeName + '>';
18785 }
18786 shouldWrap[nodeName] = !dummyNode.firstChild;
18787 }
18788 return shouldWrap[nodeName] ? markupWrap[nodeName] : null;
18789 }
18790
18791
18792 module.exports = getMarkupWrap;
18793
18794 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(27)))
18795
18796/***/ },
18797/* 146 */
18798/***/ function(module, exports, __webpack_require__) {
18799
18800 /**
18801 * Copyright 2013-2014, Facebook, Inc.
18802 * All rights reserved.
18803 *
18804 * This source code is licensed under the BSD-style license found in the
18805 * LICENSE file in the root directory of this source tree. An additional grant
18806 * of patent rights can be found in the PATENTS file in the same directory.
18807 *
18808 * @providesModule createArrayFrom
18809 * @typechecks
18810 */
18811
18812 var toArray = __webpack_require__(147);
18813
18814 /**
18815 * Perform a heuristic test to determine if an object is "array-like".
18816 *
18817 * A monk asked Joshu, a Zen master, "Has a dog Buddha nature?"
18818 * Joshu replied: "Mu."
18819 *
18820 * This function determines if its argument has "array nature": it returns
18821 * true if the argument is an actual array, an `arguments' object, or an
18822 * HTMLCollection (e.g. node.childNodes or node.getElementsByTagName()).
18823 *
18824 * It will return false for other array-like objects like Filelist.
18825 *
18826 * @param {*} obj
18827 * @return {boolean}
18828 */
18829 function hasArrayNature(obj) {
18830 return (
18831 // not null/false
18832 !!obj &&
18833 // arrays are objects, NodeLists are functions in Safari
18834 (typeof obj == 'object' || typeof obj == 'function') &&
18835 // quacks like an array
18836 ('length' in obj) &&
18837 // not window
18838 !('setInterval' in obj) &&
18839 // no DOM node should be considered an array-like
18840 // a 'select' element has 'length' and 'item' properties on IE8
18841 (typeof obj.nodeType != 'number') &&
18842 (
18843 // a real array
18844 (// HTMLCollection/NodeList
18845 (Array.isArray(obj) ||
18846 // arguments
18847 ('callee' in obj) || 'item' in obj))
18848 )
18849 );
18850 }
18851
18852 /**
18853 * Ensure that the argument is an array by wrapping it in an array if it is not.
18854 * Creates a copy of the argument if it is already an array.
18855 *
18856 * This is mostly useful idiomatically:
18857 *
18858 * var createArrayFrom = require('createArrayFrom');
18859 *
18860 * function takesOneOrMoreThings(things) {
18861 * things = createArrayFrom(things);
18862 * ...
18863 * }
18864 *
18865 * This allows you to treat `things' as an array, but accept scalars in the API.
18866 *
18867 * If you need to convert an array-like object, like `arguments`, into an array
18868 * use toArray instead.
18869 *
18870 * @param {*} obj
18871 * @return {array}
18872 */
18873 function createArrayFrom(obj) {
18874 if (!hasArrayNature(obj)) {
18875 return [obj];
18876 } else if (Array.isArray(obj)) {
18877 return obj.slice();
18878 } else {
18879 return toArray(obj);
18880 }
18881 }
18882
18883 module.exports = createArrayFrom;
18884
18885
18886/***/ },
18887/* 147 */
18888/***/ function(module, exports, __webpack_require__) {
18889
18890 /* WEBPACK VAR INJECTION */(function(process) {/**
18891 * Copyright 2014, Facebook, Inc.
18892 * All rights reserved.
18893 *
18894 * This source code is licensed under the BSD-style license found in the
18895 * LICENSE file in the root directory of this source tree. An additional grant
18896 * of patent rights can be found in the PATENTS file in the same directory.
18897 *
18898 * @providesModule toArray
18899 * @typechecks
18900 */
18901
18902 var invariant = __webpack_require__(33);
18903
18904 /**
18905 * Convert array-like objects to arrays.
18906 *
18907 * This API assumes the caller knows the contents of the data type. For less
18908 * well defined inputs use createArrayFrom.
18909 *
18910 * @param {object|function|filelist} obj
18911 * @return {array}
18912 */
18913 function toArray(obj) {
18914 var length = obj.length;
18915
18916 // Some browse builtin objects can report typeof 'function' (e.g. NodeList in
18917 // old versions of Safari).
18918 ("production" !== process.env.NODE_ENV ? invariant(
18919 !Array.isArray(obj) &&
18920 (typeof obj === 'object' || typeof obj === 'function'),
18921 'toArray: Array-like object expected'
18922 ) : invariant(!Array.isArray(obj) &&
18923 (typeof obj === 'object' || typeof obj === 'function')));
18924
18925 ("production" !== process.env.NODE_ENV ? invariant(
18926 typeof length === 'number',
18927 'toArray: Object needs a length property'
18928 ) : invariant(typeof length === 'number'));
18929
18930 ("production" !== process.env.NODE_ENV ? invariant(
18931 length === 0 ||
18932 (length - 1) in obj,
18933 'toArray: Object should have keys for indices'
18934 ) : invariant(length === 0 ||
18935 (length - 1) in obj));
18936
18937 // Old IE doesn't give collections access to hasOwnProperty. Assume inputs
18938 // without method will throw during the slice call and skip straight to the
18939 // fallback.
18940 if (obj.hasOwnProperty) {
18941 try {
18942 return Array.prototype.slice.call(obj);
18943 } catch (e) {
18944 // IE < 9 does not support Array#slice on collections objects
18945 }
18946 }
18947
18948 // Fall back to copying key by key. This assumes all keys have a value,
18949 // so will not preserve sparsely populated inputs.
18950 var ret = Array(length);
18951 for (var ii = 0; ii < length; ii++) {
18952 ret[ii] = obj[ii];
18953 }
18954 return ret;
18955 }
18956
18957 module.exports = toArray;
18958
18959 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(27)))
18960
18961/***/ }
18962/******/ ])
\No newline at end of file