2 * React (with addons) v15.1.0
4 (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.React = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){
6 * Copyright 2013-present, Facebook, Inc.
9 * This source code is licensed under the BSD-style license found in the
10 * LICENSE file in the root directory of this source tree. An additional grant
11 * of patent rights can be found in the PATENTS file in the same directory.
13 * @providesModule AutoFocusUtils
18 var ReactDOMComponentTree = _dereq_(45);
20 var focusNode = _dereq_(167);
22 var AutoFocusUtils = {
23 focusDOMComponent: function () {
24 focusNode(ReactDOMComponentTree.getNodeFromInstance(this));
28 module.exports = AutoFocusUtils;
29 },{"167":167,"45":45}],2:[function(_dereq_,module,exports){
31 * Copyright 2013-present Facebook, Inc.
32 * All rights reserved.
34 * This source code is licensed under the BSD-style license found in the
35 * LICENSE file in the root directory of this source tree. An additional grant
36 * of patent rights can be found in the PATENTS file in the same directory.
38 * @providesModule BeforeInputEventPlugin
43 var EventConstants = _dereq_(16);
44 var EventPropagators = _dereq_(20);
45 var ExecutionEnvironment = _dereq_(159);
46 var FallbackCompositionState = _dereq_(21);
47 var SyntheticCompositionEvent = _dereq_(113);
48 var SyntheticInputEvent = _dereq_(117);
50 var keyOf = _dereq_(177);
52 var END_KEYCODES = [9, 13, 27, 32]; // Tab, Return, Esc, Space
53 var START_KEYCODE = 229;
55 var canUseCompositionEvent = ExecutionEnvironment.canUseDOM && 'CompositionEvent' in window;
57 var documentMode = null;
58 if (ExecutionEnvironment.canUseDOM && 'documentMode' in document) {
59 documentMode = document.documentMode;
62 // Webkit offers a very useful `textInput` event that can be used to
63 // directly represent `beforeInput`. The IE `textinput` event is not as
64 // useful, so we don't use it.
65 var canUseTextInputEvent = ExecutionEnvironment.canUseDOM && 'TextEvent' in window && !documentMode && !isPresto();
67 // In IE9+, we have access to composition events, but the data supplied
68 // by the native compositionend event may be incorrect. Japanese ideographic
69 // spaces, for instance (\u3000) are not recorded correctly.
70 var useFallbackCompositionData = ExecutionEnvironment.canUseDOM && (!canUseCompositionEvent || documentMode && documentMode > 8 && documentMode <= 11);
73 * Opera <= 12 includes TextEvent in window, but does not fire
74 * text input events. Rely on keypress instead.
77 var opera = window.opera;
78 return typeof opera === 'object' && typeof opera.version === 'function' && parseInt(opera.version(), 10) <= 12;
81 var SPACEBAR_CODE = 32;
82 var SPACEBAR_CHAR = String.fromCharCode(SPACEBAR_CODE);
84 var topLevelTypes = EventConstants.topLevelTypes;
86 // Events and their corresponding property names.
89 phasedRegistrationNames: {
90 bubbled: keyOf({ onBeforeInput: null }),
91 captured: keyOf({ onBeforeInputCapture: null })
93 dependencies: [topLevelTypes.topCompositionEnd, topLevelTypes.topKeyPress, topLevelTypes.topTextInput, topLevelTypes.topPaste]
96 phasedRegistrationNames: {
97 bubbled: keyOf({ onCompositionEnd: null }),
98 captured: keyOf({ onCompositionEndCapture: null })
100 dependencies: [topLevelTypes.topBlur, topLevelTypes.topCompositionEnd, topLevelTypes.topKeyDown, topLevelTypes.topKeyPress, topLevelTypes.topKeyUp, topLevelTypes.topMouseDown]
103 phasedRegistrationNames: {
104 bubbled: keyOf({ onCompositionStart: null }),
105 captured: keyOf({ onCompositionStartCapture: null })
107 dependencies: [topLevelTypes.topBlur, topLevelTypes.topCompositionStart, topLevelTypes.topKeyDown, topLevelTypes.topKeyPress, topLevelTypes.topKeyUp, topLevelTypes.topMouseDown]
110 phasedRegistrationNames: {
111 bubbled: keyOf({ onCompositionUpdate: null }),
112 captured: keyOf({ onCompositionUpdateCapture: null })
114 dependencies: [topLevelTypes.topBlur, topLevelTypes.topCompositionUpdate, topLevelTypes.topKeyDown, topLevelTypes.topKeyPress, topLevelTypes.topKeyUp, topLevelTypes.topMouseDown]
118 // Track whether we've ever handled a keypress on the space key.
119 var hasSpaceKeypress = false;
122 * Return whether a native keypress event is assumed to be a command.
123 * This is required because Firefox fires `keypress` events for key commands
124 * (cut, copy, select-all, etc.) even though no character is inserted.
126 function isKeypressCommand(nativeEvent) {
127 return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&
128 // ctrlKey && altKey is equivalent to AltGr, and is not a command.
129 !(nativeEvent.ctrlKey && nativeEvent.altKey);
133 * Translate native top level events into event types.
135 * @param {string} topLevelType
138 function getCompositionEventType(topLevelType) {
139 switch (topLevelType) {
140 case topLevelTypes.topCompositionStart:
141 return eventTypes.compositionStart;
142 case topLevelTypes.topCompositionEnd:
143 return eventTypes.compositionEnd;
144 case topLevelTypes.topCompositionUpdate:
145 return eventTypes.compositionUpdate;
150 * Does our fallback best-guess model think this event signifies that
151 * composition has begun?
153 * @param {string} topLevelType
154 * @param {object} nativeEvent
157 function isFallbackCompositionStart(topLevelType, nativeEvent) {
158 return topLevelType === topLevelTypes.topKeyDown && nativeEvent.keyCode === START_KEYCODE;
162 * Does our fallback mode think that this event is the end of composition?
164 * @param {string} topLevelType
165 * @param {object} nativeEvent
168 function isFallbackCompositionEnd(topLevelType, nativeEvent) {
169 switch (topLevelType) {
170 case topLevelTypes.topKeyUp:
171 // Command keys insert or clear IME input.
172 return END_KEYCODES.indexOf(nativeEvent.keyCode) !== -1;
173 case topLevelTypes.topKeyDown:
174 // Expect IME keyCode on each keydown. If we get any other
175 // code we must have exited earlier.
176 return nativeEvent.keyCode !== START_KEYCODE;
177 case topLevelTypes.topKeyPress:
178 case topLevelTypes.topMouseDown:
179 case topLevelTypes.topBlur:
180 // Events are not possible without cancelling IME.
188 * Google Input Tools provides composition data via a CustomEvent,
189 * with the `data` property populated in the `detail` object. If this
190 * is available on the event object, use it. If not, this is a plain
191 * composition event and we have nothing special to extract.
193 * @param {object} nativeEvent
196 function getDataFromCustomEvent(nativeEvent) {
197 var detail = nativeEvent.detail;
198 if (typeof detail === 'object' && 'data' in detail) {
204 // Track the current IME composition fallback object, if any.
205 var currentComposition = null;
208 * @return {?object} A SyntheticCompositionEvent.
210 function extractCompositionEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget) {
214 if (canUseCompositionEvent) {
215 eventType = getCompositionEventType(topLevelType);
216 } else if (!currentComposition) {
217 if (isFallbackCompositionStart(topLevelType, nativeEvent)) {
218 eventType = eventTypes.compositionStart;
220 } else if (isFallbackCompositionEnd(topLevelType, nativeEvent)) {
221 eventType = eventTypes.compositionEnd;
228 if (useFallbackCompositionData) {
229 // The current composition is stored statically and must not be
230 // overwritten while composition continues.
231 if (!currentComposition && eventType === eventTypes.compositionStart) {
232 currentComposition = FallbackCompositionState.getPooled(nativeEventTarget);
233 } else if (eventType === eventTypes.compositionEnd) {
234 if (currentComposition) {
235 fallbackData = currentComposition.getData();
240 var event = SyntheticCompositionEvent.getPooled(eventType, targetInst, nativeEvent, nativeEventTarget);
243 // Inject data generated from fallback path into the synthetic event.
244 // This matches the property of native CompositionEventInterface.
245 event.data = fallbackData;
247 var customData = getDataFromCustomEvent(nativeEvent);
248 if (customData !== null) {
249 event.data = customData;
253 EventPropagators.accumulateTwoPhaseDispatches(event);
258 * @param {string} topLevelType Record from `EventConstants`.
259 * @param {object} nativeEvent Native browser event.
260 * @return {?string} The string corresponding to this `beforeInput` event.
262 function getNativeBeforeInputChars(topLevelType, nativeEvent) {
263 switch (topLevelType) {
264 case topLevelTypes.topCompositionEnd:
265 return getDataFromCustomEvent(nativeEvent);
266 case topLevelTypes.topKeyPress:
268 * If native `textInput` events are available, our goal is to make
269 * use of them. However, there is a special case: the spacebar key.
270 * In Webkit, preventing default on a spacebar `textInput` event
271 * cancels character insertion, but it *also* causes the browser
272 * to fall back to its default spacebar behavior of scrolling the
276 * https://code.google.com/p/chromium/issues/detail?id=355103
278 * To avoid this issue, use the keypress event as if no `textInput`
279 * event is available.
281 var which = nativeEvent.which;
282 if (which !== SPACEBAR_CODE) {
286 hasSpaceKeypress = true;
287 return SPACEBAR_CHAR;
289 case topLevelTypes.topTextInput:
290 // Record the characters to be added to the DOM.
291 var chars = nativeEvent.data;
293 // If it's a spacebar character, assume that we have already handled
294 // it at the keypress level and bail immediately. Android Chrome
295 // doesn't give us keycodes, so we need to blacklist it.
296 if (chars === SPACEBAR_CHAR && hasSpaceKeypress) {
303 // For other native event types, do nothing.
309 * For browsers that do not provide the `textInput` event, extract the
310 * appropriate string to use for SyntheticInputEvent.
312 * @param {string} topLevelType Record from `EventConstants`.
313 * @param {object} nativeEvent Native browser event.
314 * @return {?string} The fallback string for this `beforeInput` event.
316 function getFallbackBeforeInputChars(topLevelType, nativeEvent) {
317 // If we are currently composing (IME) and using a fallback to do so,
318 // try to extract the composed characters from the fallback object.
319 if (currentComposition) {
320 if (topLevelType === topLevelTypes.topCompositionEnd || isFallbackCompositionEnd(topLevelType, nativeEvent)) {
321 var chars = currentComposition.getData();
322 FallbackCompositionState.release(currentComposition);
323 currentComposition = null;
329 switch (topLevelType) {
330 case topLevelTypes.topPaste:
331 // If a paste event occurs after a keypress, throw out the input
332 // chars. Paste events should not lead to BeforeInput events.
334 case topLevelTypes.topKeyPress:
336 * As of v27, Firefox may fire keypress events even when no character
337 * will be inserted. A few possibilities:
339 * - `which` is `0`. Arrow keys, Esc key, etc.
341 * - `which` is the pressed key code, but no char is available.
342 * Ex: 'AltGr + d` in Polish. There is no modified character for
343 * this key combination and no character is inserted into the
344 * document, but FF fires the keypress for char code `100` anyway.
345 * No `input` event will occur.
347 * - `which` is the pressed key code, but a command combination is
348 * being used. Ex: `Cmd+C`. No character is inserted, and no
349 * `input` event will occur.
351 if (nativeEvent.which && !isKeypressCommand(nativeEvent)) {
352 return String.fromCharCode(nativeEvent.which);
355 case topLevelTypes.topCompositionEnd:
356 return useFallbackCompositionData ? null : nativeEvent.data;
363 * Extract a SyntheticInputEvent for `beforeInput`, based on either native
364 * `textInput` or fallback behavior.
366 * @return {?object} A SyntheticInputEvent.
368 function extractBeforeInputEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget) {
371 if (canUseTextInputEvent) {
372 chars = getNativeBeforeInputChars(topLevelType, nativeEvent);
374 chars = getFallbackBeforeInputChars(topLevelType, nativeEvent);
377 // If no characters are being inserted, no BeforeInput event should
383 var event = SyntheticInputEvent.getPooled(eventTypes.beforeInput, targetInst, nativeEvent, nativeEventTarget);
386 EventPropagators.accumulateTwoPhaseDispatches(event);
391 * Create an `onBeforeInput` event to match
392 * http://www.w3.org/TR/2013/WD-DOM-Level-3-Events-20131105/#events-inputevents.
394 * This event plugin is based on the native `textInput` event
395 * available in Chrome, Safari, Opera, and IE. This event fires after
396 * `onKeyPress` and `onCompositionEnd`, but before `onInput`.
398 * `beforeInput` is spec'd but not implemented in any browsers, and
399 * the `input` event does not provide any useful information about what has
400 * actually been added, contrary to the spec. Thus, `textInput` is the best
401 * available event to identify the characters that have actually been inserted
402 * into the target node.
404 * This plugin is also responsible for emitting `composition` events, thus
405 * allowing us to share composition fallback code for both `beforeInput` and
406 * `composition` event types.
408 var BeforeInputEventPlugin = {
410 eventTypes: eventTypes,
412 extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
413 return [extractCompositionEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget), extractBeforeInputEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget)];
417 module.exports = BeforeInputEventPlugin;
418 },{"113":113,"117":117,"159":159,"16":16,"177":177,"20":20,"21":21}],3:[function(_dereq_,module,exports){
420 * Copyright 2013-present, Facebook, Inc.
421 * All rights reserved.
423 * This source code is licensed under the BSD-style license found in the
424 * LICENSE file in the root directory of this source tree. An additional grant
425 * of patent rights can be found in the PATENTS file in the same directory.
427 * @providesModule CSSProperty
433 * CSS properties which accept numbers but are not in units of "px".
436 var isUnitlessNumber = {
437 animationIterationCount: true,
438 borderImageOutset: true,
439 borderImageSlice: true,
440 borderImageWidth: true,
443 boxOrdinalGroup: true,
464 // SVG-related properties
468 strokeDasharray: true,
469 strokeDashoffset: true,
470 strokeMiterlimit: true,
476 * @param {string} prefix vendor-specific prefix, eg: Webkit
477 * @param {string} key style name, eg: transitionDuration
478 * @return {string} style name prefixed with `prefix`, properly camelCased, eg:
479 * WebkitTransitionDuration
481 function prefixKey(prefix, key) {
482 return prefix + key.charAt(0).toUpperCase() + key.substring(1);
486 * Support style names that may come passed in prefixed by adding permutations
487 * of vendor prefixes.
489 var prefixes = ['Webkit', 'ms', 'Moz', 'O'];
491 // Using Object.keys here, or else the vanilla for-in loop makes IE8 go into an
492 // infinite loop, because it iterates over the newly added props too.
493 Object.keys(isUnitlessNumber).forEach(function (prop) {
494 prefixes.forEach(function (prefix) {
495 isUnitlessNumber[prefixKey(prefix, prop)] = isUnitlessNumber[prop];
500 * Most style properties can be unset by doing .style[prop] = '' but IE8
501 * doesn't like doing that with shorthand properties so for the properties that
502 * IE8 breaks on, which are listed here, we instead unset each of the
503 * individual properties. See http://bugs.jquery.com/ticket/12385.
504 * The 4-value 'clock' properties like margin, padding, border-width seem to
505 * behave without any problems. Curiously, list-style works too without any
508 var shorthandPropertyExpansions = {
510 backgroundAttachment: true,
511 backgroundColor: true,
512 backgroundImage: true,
513 backgroundPositionX: true,
514 backgroundPositionY: true,
515 backgroundRepeat: true
517 backgroundPosition: {
518 backgroundPositionX: true,
519 backgroundPositionY: true
527 borderBottomWidth: true,
528 borderBottomStyle: true,
529 borderBottomColor: true
532 borderLeftWidth: true,
533 borderLeftStyle: true,
534 borderLeftColor: true
537 borderRightWidth: true,
538 borderRightStyle: true,
539 borderRightColor: true
542 borderTopWidth: true,
543 borderTopStyle: true,
562 isUnitlessNumber: isUnitlessNumber,
563 shorthandPropertyExpansions: shorthandPropertyExpansions
566 module.exports = CSSProperty;
567 },{}],4:[function(_dereq_,module,exports){
569 * Copyright 2013-present, Facebook, Inc.
570 * All rights reserved.
572 * This source code is licensed under the BSD-style license found in the
573 * LICENSE file in the root directory of this source tree. An additional grant
574 * of patent rights can be found in the PATENTS file in the same directory.
576 * @providesModule CSSPropertyOperations
581 var CSSProperty = _dereq_(3);
582 var ExecutionEnvironment = _dereq_(159);
583 var ReactInstrumentation = _dereq_(76);
585 var camelizeStyleName = _dereq_(161);
586 var dangerousStyleValue = _dereq_(130);
587 var hyphenateStyleName = _dereq_(172);
588 var memoizeStringOnly = _dereq_(179);
589 var warning = _dereq_(183);
591 var processStyleName = memoizeStringOnly(function (styleName) {
592 return hyphenateStyleName(styleName);
595 var hasShorthandPropertyBug = false;
596 var styleFloatAccessor = 'cssFloat';
597 if (ExecutionEnvironment.canUseDOM) {
598 var tempStyle = document.createElement('div').style;
600 // IE8 throws "Invalid argument." if resetting shorthand style properties.
603 hasShorthandPropertyBug = true;
605 // IE8 only supports accessing cssFloat (standard) as styleFloat
606 if (document.documentElement.style.cssFloat === undefined) {
607 styleFloatAccessor = 'styleFloat';
611 if ("development" !== 'production') {
612 // 'msTransform' is correct, but the other prefixes should be capitalized
613 var badVendoredStyleNamePattern = /^(?:webkit|moz|o)[A-Z]/;
615 // style values shouldn't contain a semicolon
616 var badStyleValueWithSemicolonPattern = /;\s*$/;
618 var warnedStyleNames = {};
619 var warnedStyleValues = {};
620 var warnedForNaNValue = false;
622 var warnHyphenatedStyleName = function (name, owner) {
623 if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) {
627 warnedStyleNames[name] = true;
628 "development" !== 'production' ? warning(false, 'Unsupported style property %s. Did you mean %s?%s', name, camelizeStyleName(name), checkRenderMessage(owner)) : void 0;
631 var warnBadVendoredStyleName = function (name, owner) {
632 if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) {
636 warnedStyleNames[name] = true;
637 "development" !== 'production' ? warning(false, 'Unsupported vendor-prefixed style property %s. Did you mean %s?%s', name, name.charAt(0).toUpperCase() + name.slice(1), checkRenderMessage(owner)) : void 0;
640 var warnStyleValueWithSemicolon = function (name, value, owner) {
641 if (warnedStyleValues.hasOwnProperty(value) && warnedStyleValues[value]) {
645 warnedStyleValues[value] = true;
646 "development" !== 'production' ? warning(false, 'Style property values shouldn\'t contain a semicolon.%s ' + 'Try "%s: %s" instead.', checkRenderMessage(owner), name, value.replace(badStyleValueWithSemicolonPattern, '')) : void 0;
649 var warnStyleValueIsNaN = function (name, value, owner) {
650 if (warnedForNaNValue) {
654 warnedForNaNValue = true;
655 "development" !== 'production' ? warning(false, '`NaN` is an invalid value for the `%s` css style property.%s', name, checkRenderMessage(owner)) : void 0;
658 var checkRenderMessage = function (owner) {
660 var name = owner.getName();
662 return ' Check the render method of `' + name + '`.';
669 * @param {string} name
671 * @param {ReactDOMComponent} component
673 var warnValidStyle = function (name, value, component) {
676 owner = component._currentElement._owner;
678 if (name.indexOf('-') > -1) {
679 warnHyphenatedStyleName(name, owner);
680 } else if (badVendoredStyleNamePattern.test(name)) {
681 warnBadVendoredStyleName(name, owner);
682 } else if (badStyleValueWithSemicolonPattern.test(value)) {
683 warnStyleValueWithSemicolon(name, value, owner);
686 if (typeof value === 'number' && isNaN(value)) {
687 warnStyleValueIsNaN(name, value, owner);
693 * Operations for dealing with CSS properties.
695 var CSSPropertyOperations = {
698 * Serializes a mapping of style properties for use as inline styles:
700 * > createMarkupForStyles({width: '200px', height: 0})
701 * "width:200px;height:0;"
703 * Undefined values are ignored so that declarative programming is easier.
704 * The result should be HTML-escaped before insertion into the DOM.
706 * @param {object} styles
707 * @param {ReactDOMComponent} component
710 createMarkupForStyles: function (styles, component) {
712 for (var styleName in styles) {
713 if (!styles.hasOwnProperty(styleName)) {
716 var styleValue = styles[styleName];
717 if ("development" !== 'production') {
718 warnValidStyle(styleName, styleValue, component);
720 if (styleValue != null) {
721 serialized += processStyleName(styleName) + ':';
722 serialized += dangerousStyleValue(styleName, styleValue, component) + ';';
725 return serialized || null;
729 * Sets the value for multiple styles on a node. If a value is specified as
730 * '' (empty string), the corresponding style property will be unset.
732 * @param {DOMElement} node
733 * @param {object} styles
734 * @param {ReactDOMComponent} component
736 setValueForStyles: function (node, styles, component) {
737 if ("development" !== 'production') {
738 ReactInstrumentation.debugTool.onNativeOperation(component._debugID, 'update styles', styles);
741 var style = node.style;
742 for (var styleName in styles) {
743 if (!styles.hasOwnProperty(styleName)) {
746 if ("development" !== 'production') {
747 warnValidStyle(styleName, styles[styleName], component);
749 var styleValue = dangerousStyleValue(styleName, styles[styleName], component);
750 if (styleName === 'float' || styleName === 'cssFloat') {
751 styleName = styleFloatAccessor;
754 style[styleName] = styleValue;
756 var expansion = hasShorthandPropertyBug && CSSProperty.shorthandPropertyExpansions[styleName];
758 // Shorthand property that IE8 won't like unsetting, so unset each
759 // component to placate it
760 for (var individualStyleName in expansion) {
761 style[individualStyleName] = '';
764 style[styleName] = '';
772 module.exports = CSSPropertyOperations;
773 },{"130":130,"159":159,"161":161,"172":172,"179":179,"183":183,"3":3,"76":76}],5:[function(_dereq_,module,exports){
775 * Copyright 2013-present, Facebook, Inc.
776 * All rights reserved.
778 * This source code is licensed under the BSD-style license found in the
779 * LICENSE file in the root directory of this source tree. An additional grant
780 * of patent rights can be found in the PATENTS file in the same directory.
782 * @providesModule CallbackQueue
787 var _assign = _dereq_(184);
789 var PooledClass = _dereq_(26);
791 var invariant = _dereq_(173);
794 * A specialized pseudo-event module to help keep track of components waiting to
795 * be notified when their DOM representations are available for use.
797 * This implements `PooledClass`, so you should never need to instantiate this.
798 * Instead, use `CallbackQueue.getPooled()`.
800 * @class ReactMountReady
801 * @implements PooledClass
804 function CallbackQueue() {
805 this._callbacks = null;
806 this._contexts = null;
809 _assign(CallbackQueue.prototype, {
812 * Enqueues a callback to be invoked when `notifyAll` is invoked.
814 * @param {function} callback Invoked when `notifyAll` is invoked.
815 * @param {?object} context Context to call `callback` with.
818 enqueue: function (callback, context) {
819 this._callbacks = this._callbacks || [];
820 this._contexts = this._contexts || [];
821 this._callbacks.push(callback);
822 this._contexts.push(context);
826 * Invokes all enqueued callbacks and clears the queue. This is invoked after
827 * the DOM representation of a component has been created or updated.
831 notifyAll: function () {
832 var callbacks = this._callbacks;
833 var contexts = this._contexts;
835 !(callbacks.length === contexts.length) ? "development" !== 'production' ? invariant(false, 'Mismatched list of contexts in callback queue') : invariant(false) : void 0;
836 this._callbacks = null;
837 this._contexts = null;
838 for (var i = 0; i < callbacks.length; i++) {
839 callbacks[i].call(contexts[i]);
841 callbacks.length = 0;
846 checkpoint: function () {
847 return this._callbacks ? this._callbacks.length : 0;
850 rollback: function (len) {
851 if (this._callbacks) {
852 this._callbacks.length = len;
853 this._contexts.length = len;
858 * Resets the internal queue.
863 this._callbacks = null;
864 this._contexts = null;
868 * `PooledClass` looks for this.
870 destructor: function () {
876 PooledClass.addPoolingTo(CallbackQueue);
878 module.exports = CallbackQueue;
879 },{"173":173,"184":184,"26":26}],6:[function(_dereq_,module,exports){
881 * Copyright 2013-present, Facebook, Inc.
882 * All rights reserved.
884 * This source code is licensed under the BSD-style license found in the
885 * LICENSE file in the root directory of this source tree. An additional grant
886 * of patent rights can be found in the PATENTS file in the same directory.
888 * @providesModule ChangeEventPlugin
893 var EventConstants = _dereq_(16);
894 var EventPluginHub = _dereq_(17);
895 var EventPropagators = _dereq_(20);
896 var ExecutionEnvironment = _dereq_(159);
897 var ReactDOMComponentTree = _dereq_(45);
898 var ReactUpdates = _dereq_(104);
899 var SyntheticEvent = _dereq_(115);
901 var getEventTarget = _dereq_(138);
902 var isEventSupported = _dereq_(145);
903 var isTextInputElement = _dereq_(146);
904 var keyOf = _dereq_(177);
906 var topLevelTypes = EventConstants.topLevelTypes;
910 phasedRegistrationNames: {
911 bubbled: keyOf({ onChange: null }),
912 captured: keyOf({ onChangeCapture: null })
914 dependencies: [topLevelTypes.topBlur, topLevelTypes.topChange, topLevelTypes.topClick, topLevelTypes.topFocus, topLevelTypes.topInput, topLevelTypes.topKeyDown, topLevelTypes.topKeyUp, topLevelTypes.topSelectionChange]
921 var activeElement = null;
922 var activeElementInst = null;
923 var activeElementValue = null;
924 var activeElementValueProp = null;
927 * SECTION: handle `change` event
929 function shouldUseChangeEvent(elem) {
930 var nodeName = elem.nodeName && elem.nodeName.toLowerCase();
931 return nodeName === 'select' || nodeName === 'input' && elem.type === 'file';
934 var doesChangeEventBubble = false;
935 if (ExecutionEnvironment.canUseDOM) {
936 // See `handleChange` comment below
937 doesChangeEventBubble = isEventSupported('change') && (!('documentMode' in document) || document.documentMode > 8);
940 function manualDispatchChangeEvent(nativeEvent) {
941 var event = SyntheticEvent.getPooled(eventTypes.change, activeElementInst, nativeEvent, getEventTarget(nativeEvent));
942 EventPropagators.accumulateTwoPhaseDispatches(event);
944 // If change and propertychange bubbled, we'd just bind to it like all the
945 // other events and have it go through ReactBrowserEventEmitter. Since it
946 // doesn't, we manually listen for the events and so we have to enqueue and
947 // process the abstract event manually.
949 // Batching is necessary here in order to ensure that all event handlers run
950 // before the next rerender (including event handlers attached to ancestor
951 // elements instead of directly on the input). Without this, controlled
952 // components don't work properly in conjunction with event bubbling because
953 // the component is rerendered and the value reverted before all the event
954 // handlers can run. See https://github.com/facebook/react/issues/708.
955 ReactUpdates.batchedUpdates(runEventInBatch, event);
958 function runEventInBatch(event) {
959 EventPluginHub.enqueueEvents(event);
960 EventPluginHub.processEventQueue(false);
963 function startWatchingForChangeEventIE8(target, targetInst) {
964 activeElement = target;
965 activeElementInst = targetInst;
966 activeElement.attachEvent('onchange', manualDispatchChangeEvent);
969 function stopWatchingForChangeEventIE8() {
970 if (!activeElement) {
973 activeElement.detachEvent('onchange', manualDispatchChangeEvent);
974 activeElement = null;
975 activeElementInst = null;
978 function getTargetInstForChangeEvent(topLevelType, targetInst) {
979 if (topLevelType === topLevelTypes.topChange) {
983 function handleEventsForChangeEventIE8(topLevelType, target, targetInst) {
984 if (topLevelType === topLevelTypes.topFocus) {
985 // stopWatching() should be a noop here but we call it just in case we
986 // missed a blur event somehow.
987 stopWatchingForChangeEventIE8();
988 startWatchingForChangeEventIE8(target, targetInst);
989 } else if (topLevelType === topLevelTypes.topBlur) {
990 stopWatchingForChangeEventIE8();
995 * SECTION: handle `input` event
997 var isInputEventSupported = false;
998 if (ExecutionEnvironment.canUseDOM) {
999 // IE9 claims to support the input event but fails to trigger it when
1000 // deleting text, so we ignore its input events.
1001 // IE10+ fire input events to often, such when a placeholder
1002 // changes or when an input with a placeholder is focused.
1003 isInputEventSupported = isEventSupported('input') && (!('documentMode' in document) || document.documentMode > 11);
1007 * (For IE <=11) Replacement getter/setter for the `value` property that gets
1008 * set on the active element.
1010 var newValueProp = {
1012 return activeElementValueProp.get.call(this);
1014 set: function (val) {
1015 // Cast to a string so we can do equality checks.
1016 activeElementValue = '' + val;
1017 activeElementValueProp.set.call(this, val);
1022 * (For IE <=11) Starts tracking propertychange events on the passed-in element
1023 * and override the value property so that we can distinguish user events from
1024 * value changes in JS.
1026 function startWatchingForValueChange(target, targetInst) {
1027 activeElement = target;
1028 activeElementInst = targetInst;
1029 activeElementValue = target.value;
1030 activeElementValueProp = Object.getOwnPropertyDescriptor(target.constructor.prototype, 'value');
1032 // Not guarded in a canDefineProperty check: IE8 supports defineProperty only
1034 Object.defineProperty(activeElement, 'value', newValueProp);
1035 if (activeElement.attachEvent) {
1036 activeElement.attachEvent('onpropertychange', handlePropertyChange);
1038 activeElement.addEventListener('propertychange', handlePropertyChange, false);
1043 * (For IE <=11) Removes the event listeners from the currently-tracked element,
1046 function stopWatchingForValueChange() {
1047 if (!activeElement) {
1051 // delete restores the original property definition
1052 delete activeElement.value;
1054 if (activeElement.detachEvent) {
1055 activeElement.detachEvent('onpropertychange', handlePropertyChange);
1057 activeElement.removeEventListener('propertychange', handlePropertyChange, false);
1060 activeElement = null;
1061 activeElementInst = null;
1062 activeElementValue = null;
1063 activeElementValueProp = null;
1067 * (For IE <=11) Handles a propertychange event, sending a `change` event if
1068 * the value of the active element has changed.
1070 function handlePropertyChange(nativeEvent) {
1071 if (nativeEvent.propertyName !== 'value') {
1074 var value = nativeEvent.srcElement.value;
1075 if (value === activeElementValue) {
1078 activeElementValue = value;
1080 manualDispatchChangeEvent(nativeEvent);
1084 * If a `change` event should be fired, returns the target's ID.
1086 function getTargetInstForInputEvent(topLevelType, targetInst) {
1087 if (topLevelType === topLevelTypes.topInput) {
1088 // In modern browsers (i.e., not IE8 or IE9), the input event is exactly
1089 // what we want so fall through here and trigger an abstract event
1094 function handleEventsForInputEventIE(topLevelType, target, targetInst) {
1095 if (topLevelType === topLevelTypes.topFocus) {
1096 // In IE8, we can capture almost all .value changes by adding a
1097 // propertychange handler and looking for events with propertyName
1099 // In IE9-11, propertychange fires for most input events but is buggy and
1100 // doesn't fire when text is deleted, but conveniently, selectionchange
1101 // appears to fire in all of the remaining cases so we catch those and
1102 // forward the event if the value has changed
1103 // In either case, we don't want to call the event handler if the value
1104 // is changed from JS so we redefine a setter for `.value` that updates
1105 // our activeElementValue variable, allowing us to ignore those changes
1107 // stopWatching() should be a noop here but we call it just in case we
1108 // missed a blur event somehow.
1109 stopWatchingForValueChange();
1110 startWatchingForValueChange(target, targetInst);
1111 } else if (topLevelType === topLevelTypes.topBlur) {
1112 stopWatchingForValueChange();
1117 function getTargetInstForInputEventIE(topLevelType, targetInst) {
1118 if (topLevelType === topLevelTypes.topSelectionChange || topLevelType === topLevelTypes.topKeyUp || topLevelType === topLevelTypes.topKeyDown) {
1119 // On the selectionchange event, the target is just document which isn't
1120 // helpful for us so just check activeElement instead.
1122 // 99% of the time, keydown and keyup aren't necessary. IE8 fails to fire
1123 // propertychange on the first input event after setting `value` from a
1124 // script and fires only keydown, keypress, keyup. Catching keyup usually
1125 // gets it and catching keydown lets us fire an event for the first
1126 // keystroke if user does a key repeat (it'll be a little delayed: right
1127 // before the second keystroke). Other input methods (e.g., paste) seem to
1128 // fire selectionchange normally.
1129 if (activeElement && activeElement.value !== activeElementValue) {
1130 activeElementValue = activeElement.value;
1131 return activeElementInst;
1137 * SECTION: handle `click` event
1139 function shouldUseClickEvent(elem) {
1140 // Use the `click` event to detect changes to checkbox and radio inputs.
1141 // This approach works across all browsers, whereas `change` does not fire
1142 // until `blur` in IE8.
1143 return elem.nodeName && elem.nodeName.toLowerCase() === 'input' && (elem.type === 'checkbox' || elem.type === 'radio');
1146 function getTargetInstForClickEvent(topLevelType, targetInst) {
1147 if (topLevelType === topLevelTypes.topClick) {
1153 * This plugin creates an `onChange` event that normalizes change events
1154 * across form elements. This event fires at a time when it's possible to
1155 * change the element's value without seeing a flicker.
1157 * Supported elements are:
1158 * - input (see `isTextInputElement`)
1162 var ChangeEventPlugin = {
1164 eventTypes: eventTypes,
1166 extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
1167 var targetNode = targetInst ? ReactDOMComponentTree.getNodeFromInstance(targetInst) : window;
1169 var getTargetInstFunc, handleEventFunc;
1170 if (shouldUseChangeEvent(targetNode)) {
1171 if (doesChangeEventBubble) {
1172 getTargetInstFunc = getTargetInstForChangeEvent;
1174 handleEventFunc = handleEventsForChangeEventIE8;
1176 } else if (isTextInputElement(targetNode)) {
1177 if (isInputEventSupported) {
1178 getTargetInstFunc = getTargetInstForInputEvent;
1180 getTargetInstFunc = getTargetInstForInputEventIE;
1181 handleEventFunc = handleEventsForInputEventIE;
1183 } else if (shouldUseClickEvent(targetNode)) {
1184 getTargetInstFunc = getTargetInstForClickEvent;
1187 if (getTargetInstFunc) {
1188 var inst = getTargetInstFunc(topLevelType, targetInst);
1190 var event = SyntheticEvent.getPooled(eventTypes.change, inst, nativeEvent, nativeEventTarget);
1191 event.type = 'change';
1192 EventPropagators.accumulateTwoPhaseDispatches(event);
1197 if (handleEventFunc) {
1198 handleEventFunc(topLevelType, targetNode, targetInst);
1204 module.exports = ChangeEventPlugin;
1205 },{"104":104,"115":115,"138":138,"145":145,"146":146,"159":159,"16":16,"17":17,"177":177,"20":20,"45":45}],7:[function(_dereq_,module,exports){
1207 * Copyright 2013-present, Facebook, Inc.
1208 * All rights reserved.
1210 * This source code is licensed under the BSD-style license found in the
1211 * LICENSE file in the root directory of this source tree. An additional grant
1212 * of patent rights can be found in the PATENTS file in the same directory.
1214 * @providesModule DOMChildrenOperations
1219 var DOMLazyTree = _dereq_(8);
1220 var Danger = _dereq_(12);
1221 var ReactMultiChildUpdateTypes = _dereq_(82);
1222 var ReactDOMComponentTree = _dereq_(45);
1223 var ReactInstrumentation = _dereq_(76);
1225 var createMicrosoftUnsafeLocalFunction = _dereq_(129);
1226 var setInnerHTML = _dereq_(150);
1227 var setTextContent = _dereq_(151);
1229 function getNodeAfter(parentNode, node) {
1230 // Special case for text components, which return [open, close] comments
1231 // from getNativeNode.
1232 if (Array.isArray(node)) {
1235 return node ? node.nextSibling : parentNode.firstChild;
1239 * Inserts `childNode` as a child of `parentNode` at the `index`.
1241 * @param {DOMElement} parentNode Parent node in which to insert.
1242 * @param {DOMElement} childNode Child node to insert.
1243 * @param {number} index Index at which to insert the child.
1246 var insertChildAt = createMicrosoftUnsafeLocalFunction(function (parentNode, childNode, referenceNode) {
1247 // We rely exclusively on `insertBefore(node, null)` instead of also using
1248 // `appendChild(node)`. (Using `undefined` is not allowed by all browsers so
1249 // we are careful to use `null`.)
1250 parentNode.insertBefore(childNode, referenceNode);
1253 function insertLazyTreeChildAt(parentNode, childTree, referenceNode) {
1254 DOMLazyTree.insertTreeBefore(parentNode, childTree, referenceNode);
1257 function moveChild(parentNode, childNode, referenceNode) {
1258 if (Array.isArray(childNode)) {
1259 moveDelimitedText(parentNode, childNode[0], childNode[1], referenceNode);
1261 insertChildAt(parentNode, childNode, referenceNode);
1265 function removeChild(parentNode, childNode) {
1266 if (Array.isArray(childNode)) {
1267 var closingComment = childNode[1];
1268 childNode = childNode[0];
1269 removeDelimitedText(parentNode, childNode, closingComment);
1270 parentNode.removeChild(closingComment);
1272 parentNode.removeChild(childNode);
1275 function moveDelimitedText(parentNode, openingComment, closingComment, referenceNode) {
1276 var node = openingComment;
1278 var nextNode = node.nextSibling;
1279 insertChildAt(parentNode, node, referenceNode);
1280 if (node === closingComment) {
1287 function removeDelimitedText(parentNode, startNode, closingComment) {
1289 var node = startNode.nextSibling;
1290 if (node === closingComment) {
1291 // The closing comment is removed by ReactMultiChild.
1294 parentNode.removeChild(node);
1299 function replaceDelimitedText(openingComment, closingComment, stringText) {
1300 var parentNode = openingComment.parentNode;
1301 var nodeAfterComment = openingComment.nextSibling;
1302 if (nodeAfterComment === closingComment) {
1303 // There are no text nodes between the opening and closing comments; insert
1304 // a new one if stringText isn't empty.
1306 insertChildAt(parentNode, document.createTextNode(stringText), nodeAfterComment);
1310 // Set the text content of the first node after the opening comment, and
1311 // remove all following nodes up until the closing comment.
1312 setTextContent(nodeAfterComment, stringText);
1313 removeDelimitedText(parentNode, nodeAfterComment, closingComment);
1315 removeDelimitedText(parentNode, openingComment, closingComment);
1319 if ("development" !== 'production') {
1320 ReactInstrumentation.debugTool.onNativeOperation(ReactDOMComponentTree.getInstanceFromNode(openingComment)._debugID, 'replace text', stringText);
1324 var dangerouslyReplaceNodeWithMarkup = Danger.dangerouslyReplaceNodeWithMarkup;
1325 if ("development" !== 'production') {
1326 dangerouslyReplaceNodeWithMarkup = function (oldChild, markup, prevInstance) {
1327 Danger.dangerouslyReplaceNodeWithMarkup(oldChild, markup);
1328 if (prevInstance._debugID !== 0) {
1329 ReactInstrumentation.debugTool.onNativeOperation(prevInstance._debugID, 'replace with', markup.toString());
1331 var nextInstance = ReactDOMComponentTree.getInstanceFromNode(markup.node);
1332 if (nextInstance._debugID !== 0) {
1333 ReactInstrumentation.debugTool.onNativeOperation(nextInstance._debugID, 'mount', markup.toString());
1340 * Operations for updating with DOM children.
1342 var DOMChildrenOperations = {
1344 dangerouslyReplaceNodeWithMarkup: dangerouslyReplaceNodeWithMarkup,
1346 replaceDelimitedText: replaceDelimitedText,
1349 * Updates a component's children by processing a series of updates. The
1350 * update configurations are each expected to have a `parentNode` property.
1352 * @param {array<object>} updates List of update configurations.
1355 processUpdates: function (parentNode, updates) {
1356 if ("development" !== 'production') {
1357 var parentNodeDebugID = ReactDOMComponentTree.getInstanceFromNode(parentNode)._debugID;
1360 for (var k = 0; k < updates.length; k++) {
1361 var update = updates[k];
1362 switch (update.type) {
1363 case ReactMultiChildUpdateTypes.INSERT_MARKUP:
1364 insertLazyTreeChildAt(parentNode, update.content, getNodeAfter(parentNode, update.afterNode));
1365 if ("development" !== 'production') {
1366 ReactInstrumentation.debugTool.onNativeOperation(parentNodeDebugID, 'insert child', { toIndex: update.toIndex, content: update.content.toString() });
1369 case ReactMultiChildUpdateTypes.MOVE_EXISTING:
1370 moveChild(parentNode, update.fromNode, getNodeAfter(parentNode, update.afterNode));
1371 if ("development" !== 'production') {
1372 ReactInstrumentation.debugTool.onNativeOperation(parentNodeDebugID, 'move child', { fromIndex: update.fromIndex, toIndex: update.toIndex });
1375 case ReactMultiChildUpdateTypes.SET_MARKUP:
1376 setInnerHTML(parentNode, update.content);
1377 if ("development" !== 'production') {
1378 ReactInstrumentation.debugTool.onNativeOperation(parentNodeDebugID, 'replace children', update.content.toString());
1381 case ReactMultiChildUpdateTypes.TEXT_CONTENT:
1382 setTextContent(parentNode, update.content);
1383 if ("development" !== 'production') {
1384 ReactInstrumentation.debugTool.onNativeOperation(parentNodeDebugID, 'replace text', update.content.toString());
1387 case ReactMultiChildUpdateTypes.REMOVE_NODE:
1388 removeChild(parentNode, update.fromNode);
1389 if ("development" !== 'production') {
1390 ReactInstrumentation.debugTool.onNativeOperation(parentNodeDebugID, 'remove child', { fromIndex: update.fromIndex });
1399 module.exports = DOMChildrenOperations;
1400 },{"12":12,"129":129,"150":150,"151":151,"45":45,"76":76,"8":8,"82":82}],8:[function(_dereq_,module,exports){
1402 * Copyright 2015-present, Facebook, Inc.
1403 * All rights reserved.
1405 * This source code is licensed under the BSD-style license found in the
1406 * LICENSE file in the root directory of this source tree. An additional grant
1407 * of patent rights can be found in the PATENTS file in the same directory.
1409 * @providesModule DOMLazyTree
1414 var DOMNamespaces = _dereq_(9);
1416 var createMicrosoftUnsafeLocalFunction = _dereq_(129);
1417 var setTextContent = _dereq_(151);
1419 var ELEMENT_NODE_TYPE = 1;
1420 var DOCUMENT_FRAGMENT_NODE_TYPE = 11;
1423 * In IE (8-11) and Edge, appending nodes with no children is dramatically
1424 * faster than appending a full subtree, so we essentially queue up the
1425 * .appendChild calls here and apply them so each node is added to its parent
1426 * before any children are added.
1428 * In other browsers, doing so is slower or neutral compared to the other order
1429 * (in Firefox, twice as slow) so we only do this inversion in IE.
1431 * See https://github.com/spicyj/innerhtml-vs-createelement-vs-clonenode.
1433 var enableLazy = typeof document !== 'undefined' && typeof document.documentMode === 'number' || typeof navigator !== 'undefined' && typeof navigator.userAgent === 'string' && /\bEdge\/\d/.test(navigator.userAgent);
1435 function insertTreeChildren(tree) {
1439 var node = tree.node;
1440 var children = tree.children;
1441 if (children.length) {
1442 for (var i = 0; i < children.length; i++) {
1443 insertTreeBefore(node, children[i], null);
1445 } else if (tree.html != null) {
1446 node.innerHTML = tree.html;
1447 } else if (tree.text != null) {
1448 setTextContent(node, tree.text);
1452 var insertTreeBefore = createMicrosoftUnsafeLocalFunction(function (parentNode, tree, referenceNode) {
1453 // DocumentFragments aren't actually part of the DOM after insertion so
1454 // appending children won't update the DOM. We need to ensure the fragment
1455 // is properly populated first, breaking out of our lazy approach for just
1456 // this level. Also, some <object> plugins (like Flash Player) will read
1457 // <param> nodes immediately upon insertion into the DOM, so <object>
1458 // must also be populated prior to insertion into the DOM.
1459 if (tree.node.nodeType === DOCUMENT_FRAGMENT_NODE_TYPE || tree.node.nodeType === ELEMENT_NODE_TYPE && tree.node.nodeName.toLowerCase() === 'object' && (tree.node.namespaceURI == null || tree.node.namespaceURI === DOMNamespaces.html)) {
1460 insertTreeChildren(tree);
1461 parentNode.insertBefore(tree.node, referenceNode);
1463 parentNode.insertBefore(tree.node, referenceNode);
1464 insertTreeChildren(tree);
1468 function replaceChildWithTree(oldNode, newTree) {
1469 oldNode.parentNode.replaceChild(newTree.node, oldNode);
1470 insertTreeChildren(newTree);
1473 function queueChild(parentTree, childTree) {
1475 parentTree.children.push(childTree);
1477 parentTree.node.appendChild(childTree.node);
1481 function queueHTML(tree, html) {
1485 tree.node.innerHTML = html;
1489 function queueText(tree, text) {
1493 setTextContent(tree.node, text);
1497 function toString() {
1498 return this.node.nodeName;
1501 function DOMLazyTree(node) {
1511 DOMLazyTree.insertTreeBefore = insertTreeBefore;
1512 DOMLazyTree.replaceChildWithTree = replaceChildWithTree;
1513 DOMLazyTree.queueChild = queueChild;
1514 DOMLazyTree.queueHTML = queueHTML;
1515 DOMLazyTree.queueText = queueText;
1517 module.exports = DOMLazyTree;
1518 },{"129":129,"151":151,"9":9}],9:[function(_dereq_,module,exports){
1520 * Copyright 2013-present, Facebook, Inc.
1521 * All rights reserved.
1523 * This source code is licensed under the BSD-style license found in the
1524 * LICENSE file in the root directory of this source tree. An additional grant
1525 * of patent rights can be found in the PATENTS file in the same directory.
1527 * @providesModule DOMNamespaces
1532 var DOMNamespaces = {
1533 html: 'http://www.w3.org/1999/xhtml',
1534 mathml: 'http://www.w3.org/1998/Math/MathML',
1535 svg: 'http://www.w3.org/2000/svg'
1538 module.exports = DOMNamespaces;
1539 },{}],10:[function(_dereq_,module,exports){
1541 * Copyright 2013-present, Facebook, Inc.
1542 * All rights reserved.
1544 * This source code is licensed under the BSD-style license found in the
1545 * LICENSE file in the root directory of this source tree. An additional grant
1546 * of patent rights can be found in the PATENTS file in the same directory.
1548 * @providesModule DOMProperty
1553 var invariant = _dereq_(173);
1555 function checkMask(value, bitmask) {
1556 return (value & bitmask) === bitmask;
1559 var DOMPropertyInjection = {
1561 * Mapping from normalized, camelcased property names to a configuration that
1562 * specifies how the associated DOM property should be accessed or rendered.
1564 MUST_USE_PROPERTY: 0x1,
1565 HAS_SIDE_EFFECTS: 0x2,
1566 HAS_BOOLEAN_VALUE: 0x4,
1567 HAS_NUMERIC_VALUE: 0x8,
1568 HAS_POSITIVE_NUMERIC_VALUE: 0x10 | 0x8,
1569 HAS_OVERLOADED_BOOLEAN_VALUE: 0x20,
1572 * Inject some specialized knowledge about the DOM. This takes a config object
1573 * with the following properties:
1575 * isCustomAttribute: function that given an attribute name will return true
1576 * if it can be inserted into the DOM verbatim. Useful for data-* or aria-*
1577 * attributes where it's impossible to enumerate all of the possible
1580 * Properties: object mapping DOM property name to one of the
1581 * DOMPropertyInjection constants or null. If your attribute isn't in here,
1582 * it won't get written to the DOM.
1584 * DOMAttributeNames: object mapping React attribute name to the DOM
1585 * attribute name. Attribute names not specified use the **lowercase**
1588 * DOMAttributeNamespaces: object mapping React attribute name to the DOM
1589 * attribute namespace URL. (Attribute names not specified use no namespace.)
1591 * DOMPropertyNames: similar to DOMAttributeNames but for DOM properties.
1592 * Property names not specified use the normalized name.
1594 * DOMMutationMethods: Properties that require special mutation methods. If
1595 * `value` is undefined, the mutation method should unset the property.
1597 * @param {object} domPropertyConfig the config as described above.
1599 injectDOMPropertyConfig: function (domPropertyConfig) {
1600 var Injection = DOMPropertyInjection;
1601 var Properties = domPropertyConfig.Properties || {};
1602 var DOMAttributeNamespaces = domPropertyConfig.DOMAttributeNamespaces || {};
1603 var DOMAttributeNames = domPropertyConfig.DOMAttributeNames || {};
1604 var DOMPropertyNames = domPropertyConfig.DOMPropertyNames || {};
1605 var DOMMutationMethods = domPropertyConfig.DOMMutationMethods || {};
1607 if (domPropertyConfig.isCustomAttribute) {
1608 DOMProperty._isCustomAttributeFunctions.push(domPropertyConfig.isCustomAttribute);
1611 for (var propName in Properties) {
1612 !!DOMProperty.properties.hasOwnProperty(propName) ? "development" !== 'production' ? invariant(false, 'injectDOMPropertyConfig(...): You\'re trying to inject DOM property ' + '\'%s\' which has already been injected. You may be accidentally ' + 'injecting the same DOM property config twice, or you may be ' + 'injecting two configs that have conflicting property names.', propName) : invariant(false) : void 0;
1614 var lowerCased = propName.toLowerCase();
1615 var propConfig = Properties[propName];
1617 var propertyInfo = {
1618 attributeName: lowerCased,
1619 attributeNamespace: null,
1620 propertyName: propName,
1621 mutationMethod: null,
1623 mustUseProperty: checkMask(propConfig, Injection.MUST_USE_PROPERTY),
1624 hasSideEffects: checkMask(propConfig, Injection.HAS_SIDE_EFFECTS),
1625 hasBooleanValue: checkMask(propConfig, Injection.HAS_BOOLEAN_VALUE),
1626 hasNumericValue: checkMask(propConfig, Injection.HAS_NUMERIC_VALUE),
1627 hasPositiveNumericValue: checkMask(propConfig, Injection.HAS_POSITIVE_NUMERIC_VALUE),
1628 hasOverloadedBooleanValue: checkMask(propConfig, Injection.HAS_OVERLOADED_BOOLEAN_VALUE)
1631 !(propertyInfo.mustUseProperty || !propertyInfo.hasSideEffects) ? "development" !== 'production' ? invariant(false, 'DOMProperty: Properties that have side effects must use property: %s', propName) : invariant(false) : void 0;
1632 !(propertyInfo.hasBooleanValue + propertyInfo.hasNumericValue + propertyInfo.hasOverloadedBooleanValue <= 1) ? "development" !== 'production' ? invariant(false, 'DOMProperty: Value can be one of boolean, overloaded boolean, or ' + 'numeric value, but not a combination: %s', propName) : invariant(false) : void 0;
1634 if ("development" !== 'production') {
1635 DOMProperty.getPossibleStandardName[lowerCased] = propName;
1638 if (DOMAttributeNames.hasOwnProperty(propName)) {
1639 var attributeName = DOMAttributeNames[propName];
1640 propertyInfo.attributeName = attributeName;
1641 if ("development" !== 'production') {
1642 DOMProperty.getPossibleStandardName[attributeName] = propName;
1646 if (DOMAttributeNamespaces.hasOwnProperty(propName)) {
1647 propertyInfo.attributeNamespace = DOMAttributeNamespaces[propName];
1650 if (DOMPropertyNames.hasOwnProperty(propName)) {
1651 propertyInfo.propertyName = DOMPropertyNames[propName];
1654 if (DOMMutationMethods.hasOwnProperty(propName)) {
1655 propertyInfo.mutationMethod = DOMMutationMethods[propName];
1658 DOMProperty.properties[propName] = propertyInfo;
1663 /* eslint-disable max-len */
1664 var ATTRIBUTE_NAME_START_CHAR = ':A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD';
1665 /* eslint-enable max-len */
1668 * DOMProperty exports lookup objects that can be used like functions:
1670 * > DOMProperty.isValid['id']
1672 * > DOMProperty.isValid['foobar']
1675 * Although this may be confusing, it performs better in general.
1677 * @see http://jsperf.com/key-exists
1678 * @see http://jsperf.com/key-missing
1682 ID_ATTRIBUTE_NAME: 'data-reactid',
1683 ROOT_ATTRIBUTE_NAME: 'data-reactroot',
1685 ATTRIBUTE_NAME_START_CHAR: ATTRIBUTE_NAME_START_CHAR,
1686 ATTRIBUTE_NAME_CHAR: ATTRIBUTE_NAME_START_CHAR + '\\-.0-9\\uB7\\u0300-\\u036F\\u203F-\\u2040',
1689 * Map from property "standard name" to an object with info about how to set
1690 * the property in the DOM. Each object contains:
1693 * Used when rendering markup or with `*Attribute()`.
1694 * attributeNamespace
1696 * Used on DOM node instances. (This includes properties that mutate due to
1697 * external factors.)
1699 * If non-null, used instead of the property or `setAttribute()` after
1702 * Whether the property must be accessed and mutated as an object property.
1704 * Whether or not setting a value causes side effects such as triggering
1705 * resources to be loaded or text selection changes. If true, we read from
1706 * the DOM before updating to ensure that the value is only set if it has
1709 * Whether the property should be removed when set to a falsey value.
1711 * Whether the property must be numeric or parse as a numeric and should be
1712 * removed when set to a falsey value.
1713 * hasPositiveNumericValue:
1714 * Whether the property must be positive numeric or parse as a positive
1715 * numeric and should be removed when set to a falsey value.
1716 * hasOverloadedBooleanValue:
1717 * Whether the property can be used as a flag as well as with a value.
1718 * Removed when strictly equal to false; present without a value when
1719 * strictly equal to true; present with a value otherwise.
1724 * Mapping from lowercase property names to the properly cased version, used
1725 * to warn in the case of missing properties. Available only in __DEV__.
1728 getPossibleStandardName: "development" !== 'production' ? {} : null,
1731 * All of the isCustomAttribute() functions that have been injected.
1733 _isCustomAttributeFunctions: [],
1736 * Checks whether a property name is a custom attribute.
1739 isCustomAttribute: function (attributeName) {
1740 for (var i = 0; i < DOMProperty._isCustomAttributeFunctions.length; i++) {
1741 var isCustomAttributeFn = DOMProperty._isCustomAttributeFunctions[i];
1742 if (isCustomAttributeFn(attributeName)) {
1749 injection: DOMPropertyInjection
1752 module.exports = DOMProperty;
1753 },{"173":173}],11:[function(_dereq_,module,exports){
1755 * Copyright 2013-present, Facebook, Inc.
1756 * All rights reserved.
1758 * This source code is licensed under the BSD-style license found in the
1759 * LICENSE file in the root directory of this source tree. An additional grant
1760 * of patent rights can be found in the PATENTS file in the same directory.
1762 * @providesModule DOMPropertyOperations
1767 var DOMProperty = _dereq_(10);
1768 var ReactDOMComponentTree = _dereq_(45);
1769 var ReactDOMInstrumentation = _dereq_(53);
1770 var ReactInstrumentation = _dereq_(76);
1772 var quoteAttributeValueForBrowser = _dereq_(148);
1773 var warning = _dereq_(183);
1775 var VALID_ATTRIBUTE_NAME_REGEX = new RegExp('^[' + DOMProperty.ATTRIBUTE_NAME_START_CHAR + '][' + DOMProperty.ATTRIBUTE_NAME_CHAR + ']*$');
1776 var illegalAttributeNameCache = {};
1777 var validatedAttributeNameCache = {};
1779 function isAttributeNameSafe(attributeName) {
1780 if (validatedAttributeNameCache.hasOwnProperty(attributeName)) {
1783 if (illegalAttributeNameCache.hasOwnProperty(attributeName)) {
1786 if (VALID_ATTRIBUTE_NAME_REGEX.test(attributeName)) {
1787 validatedAttributeNameCache[attributeName] = true;
1790 illegalAttributeNameCache[attributeName] = true;
1791 "development" !== 'production' ? warning(false, 'Invalid attribute name: `%s`', attributeName) : void 0;
1795 function shouldIgnoreValue(propertyInfo, value) {
1796 return value == null || propertyInfo.hasBooleanValue && !value || propertyInfo.hasNumericValue && isNaN(value) || propertyInfo.hasPositiveNumericValue && value < 1 || propertyInfo.hasOverloadedBooleanValue && value === false;
1800 * Operations for dealing with DOM properties.
1802 var DOMPropertyOperations = {
1805 * Creates markup for the ID property.
1807 * @param {string} id Unescaped ID.
1808 * @return {string} Markup string.
1810 createMarkupForID: function (id) {
1811 return DOMProperty.ID_ATTRIBUTE_NAME + '=' + quoteAttributeValueForBrowser(id);
1814 setAttributeForID: function (node, id) {
1815 node.setAttribute(DOMProperty.ID_ATTRIBUTE_NAME, id);
1818 createMarkupForRoot: function () {
1819 return DOMProperty.ROOT_ATTRIBUTE_NAME + '=""';
1822 setAttributeForRoot: function (node) {
1823 node.setAttribute(DOMProperty.ROOT_ATTRIBUTE_NAME, '');
1827 * Creates markup for a property.
1829 * @param {string} name
1831 * @return {?string} Markup string, or null if the property was invalid.
1833 createMarkupForProperty: function (name, value) {
1834 if ("development" !== 'production') {
1835 ReactDOMInstrumentation.debugTool.onCreateMarkupForProperty(name, value);
1837 var propertyInfo = DOMProperty.properties.hasOwnProperty(name) ? DOMProperty.properties[name] : null;
1839 if (shouldIgnoreValue(propertyInfo, value)) {
1842 var attributeName = propertyInfo.attributeName;
1843 if (propertyInfo.hasBooleanValue || propertyInfo.hasOverloadedBooleanValue && value === true) {
1844 return attributeName + '=""';
1846 return attributeName + '=' + quoteAttributeValueForBrowser(value);
1847 } else if (DOMProperty.isCustomAttribute(name)) {
1848 if (value == null) {
1851 return name + '=' + quoteAttributeValueForBrowser(value);
1857 * Creates markup for a custom property.
1859 * @param {string} name
1861 * @return {string} Markup string, or empty string if the property was invalid.
1863 createMarkupForCustomAttribute: function (name, value) {
1864 if (!isAttributeNameSafe(name) || value == null) {
1867 return name + '=' + quoteAttributeValueForBrowser(value);
1871 * Sets the value for a property on a node.
1873 * @param {DOMElement} node
1874 * @param {string} name
1877 setValueForProperty: function (node, name, value) {
1878 var propertyInfo = DOMProperty.properties.hasOwnProperty(name) ? DOMProperty.properties[name] : null;
1880 var mutationMethod = propertyInfo.mutationMethod;
1881 if (mutationMethod) {
1882 mutationMethod(node, value);
1883 } else if (shouldIgnoreValue(propertyInfo, value)) {
1884 this.deleteValueForProperty(node, name);
1886 } else if (propertyInfo.mustUseProperty) {
1887 var propName = propertyInfo.propertyName;
1888 // Must explicitly cast values for HAS_SIDE_EFFECTS-properties to the
1889 // property type before comparing; only `value` does and is string.
1890 if (!propertyInfo.hasSideEffects || '' + node[propName] !== '' + value) {
1891 // Contrary to `setAttribute`, object properties are properly
1892 // `toString`ed by IE8/9.
1893 node[propName] = value;
1896 var attributeName = propertyInfo.attributeName;
1897 var namespace = propertyInfo.attributeNamespace;
1898 // `setAttribute` with objects becomes only `[object]` in IE8/9,
1899 // ('' + value) makes it output the correct toString()-value.
1901 node.setAttributeNS(namespace, attributeName, '' + value);
1902 } else if (propertyInfo.hasBooleanValue || propertyInfo.hasOverloadedBooleanValue && value === true) {
1903 node.setAttribute(attributeName, '');
1905 node.setAttribute(attributeName, '' + value);
1908 } else if (DOMProperty.isCustomAttribute(name)) {
1909 DOMPropertyOperations.setValueForAttribute(node, name, value);
1913 if ("development" !== 'production') {
1914 ReactDOMInstrumentation.debugTool.onSetValueForProperty(node, name, value);
1916 payload[name] = value;
1917 ReactInstrumentation.debugTool.onNativeOperation(ReactDOMComponentTree.getInstanceFromNode(node)._debugID, 'update attribute', payload);
1921 setValueForAttribute: function (node, name, value) {
1922 if (!isAttributeNameSafe(name)) {
1925 if (value == null) {
1926 node.removeAttribute(name);
1928 node.setAttribute(name, '' + value);
1931 if ("development" !== 'production') {
1933 payload[name] = value;
1934 ReactInstrumentation.debugTool.onNativeOperation(ReactDOMComponentTree.getInstanceFromNode(node)._debugID, 'update attribute', payload);
1939 * Deletes the value for a property on a node.
1941 * @param {DOMElement} node
1942 * @param {string} name
1944 deleteValueForProperty: function (node, name) {
1945 var propertyInfo = DOMProperty.properties.hasOwnProperty(name) ? DOMProperty.properties[name] : null;
1947 var mutationMethod = propertyInfo.mutationMethod;
1948 if (mutationMethod) {
1949 mutationMethod(node, undefined);
1950 } else if (propertyInfo.mustUseProperty) {
1951 var propName = propertyInfo.propertyName;
1952 if (propertyInfo.hasBooleanValue) {
1953 // No HAS_SIDE_EFFECTS logic here, only `value` has it and is string.
1954 node[propName] = false;
1956 if (!propertyInfo.hasSideEffects || '' + node[propName] !== '') {
1957 node[propName] = '';
1961 node.removeAttribute(propertyInfo.attributeName);
1963 } else if (DOMProperty.isCustomAttribute(name)) {
1964 node.removeAttribute(name);
1967 if ("development" !== 'production') {
1968 ReactDOMInstrumentation.debugTool.onDeleteValueForProperty(node, name);
1969 ReactInstrumentation.debugTool.onNativeOperation(ReactDOMComponentTree.getInstanceFromNode(node)._debugID, 'remove attribute', name);
1975 module.exports = DOMPropertyOperations;
1976 },{"10":10,"148":148,"183":183,"45":45,"53":53,"76":76}],12:[function(_dereq_,module,exports){
1978 * Copyright 2013-present, Facebook, Inc.
1979 * All rights reserved.
1981 * This source code is licensed under the BSD-style license found in the
1982 * LICENSE file in the root directory of this source tree. An additional grant
1983 * of patent rights can be found in the PATENTS file in the same directory.
1985 * @providesModule Danger
1990 var DOMLazyTree = _dereq_(8);
1991 var ExecutionEnvironment = _dereq_(159);
1993 var createNodesFromMarkup = _dereq_(164);
1994 var emptyFunction = _dereq_(165);
1995 var getMarkupWrap = _dereq_(169);
1996 var invariant = _dereq_(173);
1998 var OPEN_TAG_NAME_EXP = /^(<[^ \/>]+)/;
1999 var RESULT_INDEX_ATTR = 'data-danger-index';
2002 * Extracts the `nodeName` from a string of markup.
2004 * NOTE: Extracting the `nodeName` does not require a regular expression match
2005 * because we make assumptions about React-generated markup (i.e. there are no
2006 * spaces surrounding the opening tag and there is at least one attribute).
2008 * @param {string} markup String of markup.
2009 * @return {string} Node name of the supplied markup.
2010 * @see http://jsperf.com/extract-nodename
2012 function getNodeName(markup) {
2013 return markup.substring(1, markup.indexOf(' '));
2019 * Renders markup into an array of nodes. The markup is expected to render
2020 * into a list of root nodes. Also, the length of `resultList` and
2021 * `markupList` should be the same.
2023 * @param {array<string>} markupList List of markup strings to render.
2024 * @return {array<DOMElement>} List of rendered nodes.
2027 dangerouslyRenderMarkup: function (markupList) {
2028 !ExecutionEnvironment.canUseDOM ? "development" !== 'production' ? invariant(false, 'dangerouslyRenderMarkup(...): Cannot render markup in a worker ' + 'thread. Make sure `window` and `document` are available globally ' + 'before requiring React when unit testing or use ' + 'ReactDOMServer.renderToString for server rendering.') : invariant(false) : void 0;
2030 var markupByNodeName = {};
2031 // Group markup by `nodeName` if a wrap is necessary, else by '*'.
2032 for (var i = 0; i < markupList.length; i++) {
2033 !markupList[i] ? "development" !== 'production' ? invariant(false, 'dangerouslyRenderMarkup(...): Missing markup.') : invariant(false) : void 0;
2034 nodeName = getNodeName(markupList[i]);
2035 nodeName = getMarkupWrap(nodeName) ? nodeName : '*';
2036 markupByNodeName[nodeName] = markupByNodeName[nodeName] || [];
2037 markupByNodeName[nodeName][i] = markupList[i];
2039 var resultList = [];
2040 var resultListAssignmentCount = 0;
2041 for (nodeName in markupByNodeName) {
2042 if (!markupByNodeName.hasOwnProperty(nodeName)) {
2045 var markupListByNodeName = markupByNodeName[nodeName];
2047 // This for-in loop skips the holes of the sparse array. The order of
2048 // iteration should follow the order of assignment, which happens to match
2049 // numerical index order, but we don't rely on that.
2051 for (resultIndex in markupListByNodeName) {
2052 if (markupListByNodeName.hasOwnProperty(resultIndex)) {
2053 var markup = markupListByNodeName[resultIndex];
2055 // Push the requested markup with an additional RESULT_INDEX_ATTR
2056 // attribute. If the markup does not start with a < character, it
2057 // will be discarded below (with an appropriate console.error).
2058 markupListByNodeName[resultIndex] = markup.replace(OPEN_TAG_NAME_EXP,
2059 // This index will be parsed back out below.
2060 '$1 ' + RESULT_INDEX_ATTR + '="' + resultIndex + '" ');
2064 // Render each group of markup with similar wrapping `nodeName`.
2065 var renderNodes = createNodesFromMarkup(markupListByNodeName.join(''), emptyFunction // Do nothing special with <script> tags.
2068 for (var j = 0; j < renderNodes.length; ++j) {
2069 var renderNode = renderNodes[j];
2070 if (renderNode.hasAttribute && renderNode.hasAttribute(RESULT_INDEX_ATTR)) {
2072 resultIndex = +renderNode.getAttribute(RESULT_INDEX_ATTR);
2073 renderNode.removeAttribute(RESULT_INDEX_ATTR);
2075 !!resultList.hasOwnProperty(resultIndex) ? "development" !== 'production' ? invariant(false, 'Danger: Assigning to an already-occupied result index.') : invariant(false) : void 0;
2077 resultList[resultIndex] = renderNode;
2079 // This should match resultList.length and markupList.length when
2081 resultListAssignmentCount += 1;
2082 } else if ("development" !== 'production') {
2083 console.error('Danger: Discarding unexpected node:', renderNode);
2088 // Although resultList was populated out of order, it should now be a dense
2090 !(resultListAssignmentCount === resultList.length) ? "development" !== 'production' ? invariant(false, 'Danger: Did not assign to every index of resultList.') : invariant(false) : void 0;
2092 !(resultList.length === markupList.length) ? "development" !== 'production' ? invariant(false, 'Danger: Expected markup to render %s nodes, but rendered %s.', markupList.length, resultList.length) : invariant(false) : void 0;
2098 * Replaces a node with a string of markup at its current position within its
2099 * parent. The markup must render into a single root node.
2101 * @param {DOMElement} oldChild Child node to replace.
2102 * @param {string} markup Markup to render in place of the child node.
2105 dangerouslyReplaceNodeWithMarkup: function (oldChild, markup) {
2106 !ExecutionEnvironment.canUseDOM ? "development" !== 'production' ? invariant(false, 'dangerouslyReplaceNodeWithMarkup(...): Cannot render markup in a ' + 'worker thread. Make sure `window` and `document` are available ' + 'globally before requiring React when unit testing or use ' + 'ReactDOMServer.renderToString() for server rendering.') : invariant(false) : void 0;
2107 !markup ? "development" !== 'production' ? invariant(false, 'dangerouslyReplaceNodeWithMarkup(...): Missing markup.') : invariant(false) : void 0;
2108 !(oldChild.nodeName !== 'HTML') ? "development" !== 'production' ? invariant(false, 'dangerouslyReplaceNodeWithMarkup(...): Cannot replace markup of the ' + '<html> node. This is because browser quirks make this unreliable ' + 'and/or slow. If you want to render to the root you must use ' + 'server rendering. See ReactDOMServer.renderToString().') : invariant(false) : void 0;
2110 if (typeof markup === 'string') {
2111 var newChild = createNodesFromMarkup(markup, emptyFunction)[0];
2112 oldChild.parentNode.replaceChild(newChild, oldChild);
2114 DOMLazyTree.replaceChildWithTree(oldChild, markup);
2120 module.exports = Danger;
2121 },{"159":159,"164":164,"165":165,"169":169,"173":173,"8":8}],13:[function(_dereq_,module,exports){
2123 * Copyright 2013-present, Facebook, Inc.
2124 * All rights reserved.
2126 * This source code is licensed under the BSD-style license found in the
2127 * LICENSE file in the root directory of this source tree. An additional grant
2128 * of patent rights can be found in the PATENTS file in the same directory.
2130 * @providesModule DefaultEventPluginOrder
2135 var keyOf = _dereq_(177);
2138 * Module that is injectable into `EventPluginHub`, that specifies a
2139 * deterministic ordering of `EventPlugin`s. A convenient way to reason about
2140 * plugins, without having to package every one of them. This is better than
2141 * having plugins be ordered in the same order that they are injected because
2142 * that ordering would be influenced by the packaging order.
2143 * `ResponderEventPlugin` must occur before `SimpleEventPlugin` so that
2144 * preventing default on events is convenient in `SimpleEventPlugin` handlers.
2146 var DefaultEventPluginOrder = [keyOf({ ResponderEventPlugin: null }), keyOf({ SimpleEventPlugin: null }), keyOf({ TapEventPlugin: null }), keyOf({ EnterLeaveEventPlugin: null }), keyOf({ ChangeEventPlugin: null }), keyOf({ SelectEventPlugin: null }), keyOf({ BeforeInputEventPlugin: null })];
2148 module.exports = DefaultEventPluginOrder;
2149 },{"177":177}],14:[function(_dereq_,module,exports){
2151 * Copyright 2013-present, Facebook, Inc.
2152 * All rights reserved.
2154 * This source code is licensed under the BSD-style license found in the
2155 * LICENSE file in the root directory of this source tree. An additional grant
2156 * of patent rights can be found in the PATENTS file in the same directory.
2158 * @providesModule DisabledInputUtils
2163 var disableableMouseListenerNames = {
2165 onDoubleClick: true,
2170 onClickCapture: true,
2171 onDoubleClickCapture: true,
2172 onMouseDownCapture: true,
2173 onMouseMoveCapture: true,
2174 onMouseUpCapture: true
2178 * Implements a native component that does not receive mouse events
2179 * when `disabled` is set.
2181 var DisabledInputUtils = {
2182 getNativeProps: function (inst, props) {
2183 if (!props.disabled) {
2187 // Copy the props, except the mouse listeners
2188 var nativeProps = {};
2189 for (var key in props) {
2190 if (!disableableMouseListenerNames[key] && props.hasOwnProperty(key)) {
2191 nativeProps[key] = props[key];
2199 module.exports = DisabledInputUtils;
2200 },{}],15:[function(_dereq_,module,exports){
2202 * Copyright 2013-present, Facebook, Inc.
2203 * All rights reserved.
2205 * This source code is licensed under the BSD-style license found in the
2206 * LICENSE file in the root directory of this source tree. An additional grant
2207 * of patent rights can be found in the PATENTS file in the same directory.
2209 * @providesModule EnterLeaveEventPlugin
2214 var EventConstants = _dereq_(16);
2215 var EventPropagators = _dereq_(20);
2216 var ReactDOMComponentTree = _dereq_(45);
2217 var SyntheticMouseEvent = _dereq_(119);
2219 var keyOf = _dereq_(177);
2221 var topLevelTypes = EventConstants.topLevelTypes;
2225 registrationName: keyOf({ onMouseEnter: null }),
2226 dependencies: [topLevelTypes.topMouseOut, topLevelTypes.topMouseOver]
2229 registrationName: keyOf({ onMouseLeave: null }),
2230 dependencies: [topLevelTypes.topMouseOut, topLevelTypes.topMouseOver]
2234 var EnterLeaveEventPlugin = {
2236 eventTypes: eventTypes,
2239 * For almost every interaction we care about, there will be both a top-level
2240 * `mouseover` and `mouseout` event that occurs. Only use `mouseout` so that
2241 * we do not extract duplicate events. However, moving the mouse into the
2242 * browser from outside will not fire a `mouseout` event. In this case, we use
2243 * the `mouseover` top-level event.
2245 extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
2246 if (topLevelType === topLevelTypes.topMouseOver && (nativeEvent.relatedTarget || nativeEvent.fromElement)) {
2249 if (topLevelType !== topLevelTypes.topMouseOut && topLevelType !== topLevelTypes.topMouseOver) {
2250 // Must not be a mouse in or mouse out - ignoring.
2255 if (nativeEventTarget.window === nativeEventTarget) {
2256 // `nativeEventTarget` is probably a window object.
2257 win = nativeEventTarget;
2259 // TODO: Figure out why `ownerDocument` is sometimes undefined in IE8.
2260 var doc = nativeEventTarget.ownerDocument;
2262 win = doc.defaultView || doc.parentWindow;
2270 if (topLevelType === topLevelTypes.topMouseOut) {
2272 var related = nativeEvent.relatedTarget || nativeEvent.toElement;
2273 to = related ? ReactDOMComponentTree.getClosestInstanceFromNode(related) : null;
2275 // Moving to a node from outside the window.
2281 // Nothing pertains to our managed components.
2285 var fromNode = from == null ? win : ReactDOMComponentTree.getNodeFromInstance(from);
2286 var toNode = to == null ? win : ReactDOMComponentTree.getNodeFromInstance(to);
2288 var leave = SyntheticMouseEvent.getPooled(eventTypes.mouseLeave, from, nativeEvent, nativeEventTarget);
2289 leave.type = 'mouseleave';
2290 leave.target = fromNode;
2291 leave.relatedTarget = toNode;
2293 var enter = SyntheticMouseEvent.getPooled(eventTypes.mouseEnter, to, nativeEvent, nativeEventTarget);
2294 enter.type = 'mouseenter';
2295 enter.target = toNode;
2296 enter.relatedTarget = fromNode;
2298 EventPropagators.accumulateEnterLeaveDispatches(leave, enter, from, to);
2300 return [leave, enter];
2305 module.exports = EnterLeaveEventPlugin;
2306 },{"119":119,"16":16,"177":177,"20":20,"45":45}],16:[function(_dereq_,module,exports){
2308 * Copyright 2013-present, Facebook, Inc.
2309 * All rights reserved.
2311 * This source code is licensed under the BSD-style license found in the
2312 * LICENSE file in the root directory of this source tree. An additional grant
2313 * of patent rights can be found in the PATENTS file in the same directory.
2315 * @providesModule EventConstants
2320 var keyMirror = _dereq_(176);
2322 var PropagationPhases = keyMirror({ bubbled: null, captured: null });
2325 * Types of raw signals from the browser caught at the top level.
2327 var topLevelTypes = keyMirror({
2329 topAnimationEnd: null,
2330 topAnimationIteration: null,
2331 topAnimationStart: null,
2334 topCanPlayThrough: null,
2337 topCompositionEnd: null,
2338 topCompositionStart: null,
2339 topCompositionUpdate: null,
2340 topContextMenu: null,
2343 topDoubleClick: null,
2352 topDurationChange: null,
2364 topLoadedData: null,
2365 topLoadedMetadata: null,
2377 topRateChange: null,
2382 topSelectionChange: null,
2387 topTimeUpdate: null,
2388 topTouchCancel: null,
2391 topTouchStart: null,
2392 topTransitionEnd: null,
2393 topVolumeChange: null,
2398 var EventConstants = {
2399 topLevelTypes: topLevelTypes,
2400 PropagationPhases: PropagationPhases
2403 module.exports = EventConstants;
2404 },{"176":176}],17:[function(_dereq_,module,exports){
2406 * Copyright 2013-present, Facebook, Inc.
2407 * All rights reserved.
2409 * This source code is licensed under the BSD-style license found in the
2410 * LICENSE file in the root directory of this source tree. An additional grant
2411 * of patent rights can be found in the PATENTS file in the same directory.
2413 * @providesModule EventPluginHub
2418 var EventPluginRegistry = _dereq_(18);
2419 var EventPluginUtils = _dereq_(19);
2420 var ReactErrorUtils = _dereq_(68);
2422 var accumulateInto = _dereq_(126);
2423 var forEachAccumulated = _dereq_(134);
2424 var invariant = _dereq_(173);
2427 * Internal store for event listeners
2429 var listenerBank = {};
2432 * Internal queue of events that have accumulated their dispatches and are
2433 * waiting to have their dispatches executed.
2435 var eventQueue = null;
2438 * Dispatches an event and releases it back into the pool, unless persistent.
2440 * @param {?object} event Synthetic event to be dispatched.
2441 * @param {boolean} simulated If the event is simulated (changes exn behavior)
2444 var executeDispatchesAndRelease = function (event, simulated) {
2446 EventPluginUtils.executeDispatchesInOrder(event, simulated);
2448 if (!event.isPersistent()) {
2449 event.constructor.release(event);
2453 var executeDispatchesAndReleaseSimulated = function (e) {
2454 return executeDispatchesAndRelease(e, true);
2456 var executeDispatchesAndReleaseTopLevel = function (e) {
2457 return executeDispatchesAndRelease(e, false);
2461 * This is a unified interface for event plugins to be installed and configured.
2463 * Event plugins can implement the following properties:
2465 * `extractEvents` {function(string, DOMEventTarget, string, object): *}
2466 * Required. When a top-level event is fired, this method is expected to
2467 * extract synthetic events that will in turn be queued and dispatched.
2469 * `eventTypes` {object}
2470 * Optional, plugins that fire events must publish a mapping of registration
2471 * names that are used to register listeners. Values of this mapping must
2472 * be objects that contain `registrationName` or `phasedRegistrationNames`.
2474 * `executeDispatch` {function(object, function, string)}
2475 * Optional, allows plugins to override how an event gets dispatched. By
2476 * default, the listener is simply invoked.
2478 * Each plugin that is injected into `EventsPluginHub` is immediately operable.
2482 var EventPluginHub = {
2485 * Methods for injecting dependencies.
2490 * @param {array} InjectedEventPluginOrder
2493 injectEventPluginOrder: EventPluginRegistry.injectEventPluginOrder,
2496 * @param {object} injectedNamesToPlugins Map from names to plugin modules.
2498 injectEventPluginsByName: EventPluginRegistry.injectEventPluginsByName
2503 * Stores `listener` at `listenerBank[registrationName][id]`. Is idempotent.
2505 * @param {object} inst The instance, which is the source of events.
2506 * @param {string} registrationName Name of listener (e.g. `onClick`).
2507 * @param {function} listener The callback to store.
2509 putListener: function (inst, registrationName, listener) {
2510 !(typeof listener === 'function') ? "development" !== 'production' ? invariant(false, 'Expected %s listener to be a function, instead got type %s', registrationName, typeof listener) : invariant(false) : void 0;
2512 var bankForRegistrationName = listenerBank[registrationName] || (listenerBank[registrationName] = {});
2513 bankForRegistrationName[inst._rootNodeID] = listener;
2515 var PluginModule = EventPluginRegistry.registrationNameModules[registrationName];
2516 if (PluginModule && PluginModule.didPutListener) {
2517 PluginModule.didPutListener(inst, registrationName, listener);
2522 * @param {object} inst The instance, which is the source of events.
2523 * @param {string} registrationName Name of listener (e.g. `onClick`).
2524 * @return {?function} The stored callback.
2526 getListener: function (inst, registrationName) {
2527 var bankForRegistrationName = listenerBank[registrationName];
2528 return bankForRegistrationName && bankForRegistrationName[inst._rootNodeID];
2532 * Deletes a listener from the registration bank.
2534 * @param {object} inst The instance, which is the source of events.
2535 * @param {string} registrationName Name of listener (e.g. `onClick`).
2537 deleteListener: function (inst, registrationName) {
2538 var PluginModule = EventPluginRegistry.registrationNameModules[registrationName];
2539 if (PluginModule && PluginModule.willDeleteListener) {
2540 PluginModule.willDeleteListener(inst, registrationName);
2543 var bankForRegistrationName = listenerBank[registrationName];
2544 // TODO: This should never be null -- when is it?
2545 if (bankForRegistrationName) {
2546 delete bankForRegistrationName[inst._rootNodeID];
2551 * Deletes all listeners for the DOM element with the supplied ID.
2553 * @param {object} inst The instance, which is the source of events.
2555 deleteAllListeners: function (inst) {
2556 for (var registrationName in listenerBank) {
2557 if (!listenerBank[registrationName][inst._rootNodeID]) {
2561 var PluginModule = EventPluginRegistry.registrationNameModules[registrationName];
2562 if (PluginModule && PluginModule.willDeleteListener) {
2563 PluginModule.willDeleteListener(inst, registrationName);
2566 delete listenerBank[registrationName][inst._rootNodeID];
2571 * Allows registered plugins an opportunity to extract events from top-level
2572 * native browser events.
2574 * @return {*} An accumulation of synthetic events.
2577 extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
2579 var plugins = EventPluginRegistry.plugins;
2580 for (var i = 0; i < plugins.length; i++) {
2581 // Not every plugin in the ordering may be loaded at runtime.
2582 var possiblePlugin = plugins[i];
2583 if (possiblePlugin) {
2584 var extractedEvents = possiblePlugin.extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget);
2585 if (extractedEvents) {
2586 events = accumulateInto(events, extractedEvents);
2594 * Enqueues a synthetic event that should be dispatched when
2595 * `processEventQueue` is invoked.
2597 * @param {*} events An accumulation of synthetic events.
2600 enqueueEvents: function (events) {
2602 eventQueue = accumulateInto(eventQueue, events);
2607 * Dispatches all synthetic events on the event queue.
2611 processEventQueue: function (simulated) {
2612 // Set `eventQueue` to null before processing it so that we can tell if more
2613 // events get enqueued while processing.
2614 var processingEventQueue = eventQueue;
2617 forEachAccumulated(processingEventQueue, executeDispatchesAndReleaseSimulated);
2619 forEachAccumulated(processingEventQueue, executeDispatchesAndReleaseTopLevel);
2621 !!eventQueue ? "development" !== 'production' ? invariant(false, 'processEventQueue(): Additional events were enqueued while processing ' + 'an event queue. Support for this has not yet been implemented.') : invariant(false) : void 0;
2622 // This would be a good time to rethrow if any of the event handlers threw.
2623 ReactErrorUtils.rethrowCaughtError();
2627 * These are needed for tests only. Do not use!
2629 __purge: function () {
2633 __getListenerBank: function () {
2634 return listenerBank;
2639 module.exports = EventPluginHub;
2640 },{"126":126,"134":134,"173":173,"18":18,"19":19,"68":68}],18:[function(_dereq_,module,exports){
2642 * Copyright 2013-present, Facebook, Inc.
2643 * All rights reserved.
2645 * This source code is licensed under the BSD-style license found in the
2646 * LICENSE file in the root directory of this source tree. An additional grant
2647 * of patent rights can be found in the PATENTS file in the same directory.
2649 * @providesModule EventPluginRegistry
2654 var invariant = _dereq_(173);
2657 * Injectable ordering of event plugins.
2659 var EventPluginOrder = null;
2662 * Injectable mapping from names to event plugin modules.
2664 var namesToPlugins = {};
2667 * Recomputes the plugin list using the injected plugins and plugin ordering.
2671 function recomputePluginOrdering() {
2672 if (!EventPluginOrder) {
2673 // Wait until an `EventPluginOrder` is injected.
2676 for (var pluginName in namesToPlugins) {
2677 var PluginModule = namesToPlugins[pluginName];
2678 var pluginIndex = EventPluginOrder.indexOf(pluginName);
2679 !(pluginIndex > -1) ? "development" !== 'production' ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in ' + 'the plugin ordering, `%s`.', pluginName) : invariant(false) : void 0;
2680 if (EventPluginRegistry.plugins[pluginIndex]) {
2683 !PluginModule.extractEvents ? "development" !== 'production' ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` ' + 'method, but `%s` does not.', pluginName) : invariant(false) : void 0;
2684 EventPluginRegistry.plugins[pluginIndex] = PluginModule;
2685 var publishedEvents = PluginModule.eventTypes;
2686 for (var eventName in publishedEvents) {
2687 !publishEventForPlugin(publishedEvents[eventName], PluginModule, eventName) ? "development" !== 'production' ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : invariant(false) : void 0;
2693 * Publishes an event so that it can be dispatched by the supplied plugin.
2695 * @param {object} dispatchConfig Dispatch configuration for the event.
2696 * @param {object} PluginModule Plugin publishing the event.
2697 * @return {boolean} True if the event was successfully published.
2700 function publishEventForPlugin(dispatchConfig, PluginModule, eventName) {
2701 !!EventPluginRegistry.eventNameDispatchConfigs.hasOwnProperty(eventName) ? "development" !== 'production' ? invariant(false, 'EventPluginHub: More than one plugin attempted to publish the same ' + 'event name, `%s`.', eventName) : invariant(false) : void 0;
2702 EventPluginRegistry.eventNameDispatchConfigs[eventName] = dispatchConfig;
2704 var phasedRegistrationNames = dispatchConfig.phasedRegistrationNames;
2705 if (phasedRegistrationNames) {
2706 for (var phaseName in phasedRegistrationNames) {
2707 if (phasedRegistrationNames.hasOwnProperty(phaseName)) {
2708 var phasedRegistrationName = phasedRegistrationNames[phaseName];
2709 publishRegistrationName(phasedRegistrationName, PluginModule, eventName);
2713 } else if (dispatchConfig.registrationName) {
2714 publishRegistrationName(dispatchConfig.registrationName, PluginModule, eventName);
2721 * Publishes a registration name that is used to identify dispatched events and
2722 * can be used with `EventPluginHub.putListener` to register listeners.
2724 * @param {string} registrationName Registration name to add.
2725 * @param {object} PluginModule Plugin publishing the event.
2728 function publishRegistrationName(registrationName, PluginModule, eventName) {
2729 !!EventPluginRegistry.registrationNameModules[registrationName] ? "development" !== 'production' ? invariant(false, 'EventPluginHub: More than one plugin attempted to publish the same ' + 'registration name, `%s`.', registrationName) : invariant(false) : void 0;
2730 EventPluginRegistry.registrationNameModules[registrationName] = PluginModule;
2731 EventPluginRegistry.registrationNameDependencies[registrationName] = PluginModule.eventTypes[eventName].dependencies;
2733 if ("development" !== 'production') {
2734 var lowerCasedName = registrationName.toLowerCase();
2735 EventPluginRegistry.possibleRegistrationNames[lowerCasedName] = registrationName;
2740 * Registers plugins so that they can extract and dispatch events.
2742 * @see {EventPluginHub}
2744 var EventPluginRegistry = {
2747 * Ordered list of injected plugins.
2752 * Mapping from event name to dispatch config
2754 eventNameDispatchConfigs: {},
2757 * Mapping from registration name to plugin module
2759 registrationNameModules: {},
2762 * Mapping from registration name to event name
2764 registrationNameDependencies: {},
2767 * Mapping from lowercase registration names to the properly cased version,
2768 * used to warn in the case of missing event handlers. Available
2772 possibleRegistrationNames: "development" !== 'production' ? {} : null,
2775 * Injects an ordering of plugins (by plugin name). This allows the ordering
2776 * to be decoupled from injection of the actual plugins so that ordering is
2777 * always deterministic regardless of packaging, on-the-fly injection, etc.
2779 * @param {array} InjectedEventPluginOrder
2781 * @see {EventPluginHub.injection.injectEventPluginOrder}
2783 injectEventPluginOrder: function (InjectedEventPluginOrder) {
2784 !!EventPluginOrder ? "development" !== 'production' ? invariant(false, 'EventPluginRegistry: Cannot inject event plugin ordering more than ' + 'once. You are likely trying to load more than one copy of React.') : invariant(false) : void 0;
2785 // Clone the ordering so it cannot be dynamically mutated.
2786 EventPluginOrder = Array.prototype.slice.call(InjectedEventPluginOrder);
2787 recomputePluginOrdering();
2791 * Injects plugins to be used by `EventPluginHub`. The plugin names must be
2792 * in the ordering injected by `injectEventPluginOrder`.
2794 * Plugins can be injected as part of page initialization or on-the-fly.
2796 * @param {object} injectedNamesToPlugins Map from names to plugin modules.
2798 * @see {EventPluginHub.injection.injectEventPluginsByName}
2800 injectEventPluginsByName: function (injectedNamesToPlugins) {
2801 var isOrderingDirty = false;
2802 for (var pluginName in injectedNamesToPlugins) {
2803 if (!injectedNamesToPlugins.hasOwnProperty(pluginName)) {
2806 var PluginModule = injectedNamesToPlugins[pluginName];
2807 if (!namesToPlugins.hasOwnProperty(pluginName) || namesToPlugins[pluginName] !== PluginModule) {
2808 !!namesToPlugins[pluginName] ? "development" !== 'production' ? invariant(false, 'EventPluginRegistry: Cannot inject two different event plugins ' + 'using the same name, `%s`.', pluginName) : invariant(false) : void 0;
2809 namesToPlugins[pluginName] = PluginModule;
2810 isOrderingDirty = true;
2813 if (isOrderingDirty) {
2814 recomputePluginOrdering();
2819 * Looks up the plugin for the supplied event.
2821 * @param {object} event A synthetic event.
2822 * @return {?object} The plugin that created the supplied event.
2825 getPluginModuleForEvent: function (event) {
2826 var dispatchConfig = event.dispatchConfig;
2827 if (dispatchConfig.registrationName) {
2828 return EventPluginRegistry.registrationNameModules[dispatchConfig.registrationName] || null;
2830 for (var phase in dispatchConfig.phasedRegistrationNames) {
2831 if (!dispatchConfig.phasedRegistrationNames.hasOwnProperty(phase)) {
2834 var PluginModule = EventPluginRegistry.registrationNameModules[dispatchConfig.phasedRegistrationNames[phase]];
2836 return PluginModule;
2843 * Exposed for unit testing.
2846 _resetEventPlugins: function () {
2847 EventPluginOrder = null;
2848 for (var pluginName in namesToPlugins) {
2849 if (namesToPlugins.hasOwnProperty(pluginName)) {
2850 delete namesToPlugins[pluginName];
2853 EventPluginRegistry.plugins.length = 0;
2855 var eventNameDispatchConfigs = EventPluginRegistry.eventNameDispatchConfigs;
2856 for (var eventName in eventNameDispatchConfigs) {
2857 if (eventNameDispatchConfigs.hasOwnProperty(eventName)) {
2858 delete eventNameDispatchConfigs[eventName];
2862 var registrationNameModules = EventPluginRegistry.registrationNameModules;
2863 for (var registrationName in registrationNameModules) {
2864 if (registrationNameModules.hasOwnProperty(registrationName)) {
2865 delete registrationNameModules[registrationName];
2869 if ("development" !== 'production') {
2870 var possibleRegistrationNames = EventPluginRegistry.possibleRegistrationNames;
2871 for (var lowerCasedName in possibleRegistrationNames) {
2872 if (possibleRegistrationNames.hasOwnProperty(lowerCasedName)) {
2873 delete possibleRegistrationNames[lowerCasedName];
2881 module.exports = EventPluginRegistry;
2882 },{"173":173}],19:[function(_dereq_,module,exports){
2884 * Copyright 2013-present, Facebook, Inc.
2885 * All rights reserved.
2887 * This source code is licensed under the BSD-style license found in the
2888 * LICENSE file in the root directory of this source tree. An additional grant
2889 * of patent rights can be found in the PATENTS file in the same directory.
2891 * @providesModule EventPluginUtils
2896 var EventConstants = _dereq_(16);
2897 var ReactErrorUtils = _dereq_(68);
2899 var invariant = _dereq_(173);
2900 var warning = _dereq_(183);
2903 * Injected dependencies:
2907 * - `ComponentTree`: [required] Module that can convert between React instances
2908 * and actual node references.
2913 injectComponentTree: function (Injected) {
2914 ComponentTree = Injected;
2915 if ("development" !== 'production') {
2916 "development" !== 'production' ? warning(Injected && Injected.getNodeFromInstance && Injected.getInstanceFromNode, 'EventPluginUtils.injection.injectComponentTree(...): Injected ' + 'module is missing getNodeFromInstance or getInstanceFromNode.') : void 0;
2919 injectTreeTraversal: function (Injected) {
2920 TreeTraversal = Injected;
2921 if ("development" !== 'production') {
2922 "development" !== 'production' ? warning(Injected && Injected.isAncestor && Injected.getLowestCommonAncestor, 'EventPluginUtils.injection.injectTreeTraversal(...): Injected ' + 'module is missing isAncestor or getLowestCommonAncestor.') : void 0;
2927 var topLevelTypes = EventConstants.topLevelTypes;
2929 function isEndish(topLevelType) {
2930 return topLevelType === topLevelTypes.topMouseUp || topLevelType === topLevelTypes.topTouchEnd || topLevelType === topLevelTypes.topTouchCancel;
2933 function isMoveish(topLevelType) {
2934 return topLevelType === topLevelTypes.topMouseMove || topLevelType === topLevelTypes.topTouchMove;
2936 function isStartish(topLevelType) {
2937 return topLevelType === topLevelTypes.topMouseDown || topLevelType === topLevelTypes.topTouchStart;
2940 var validateEventDispatches;
2941 if ("development" !== 'production') {
2942 validateEventDispatches = function (event) {
2943 var dispatchListeners = event._dispatchListeners;
2944 var dispatchInstances = event._dispatchInstances;
2946 var listenersIsArr = Array.isArray(dispatchListeners);
2947 var listenersLen = listenersIsArr ? dispatchListeners.length : dispatchListeners ? 1 : 0;
2949 var instancesIsArr = Array.isArray(dispatchInstances);
2950 var instancesLen = instancesIsArr ? dispatchInstances.length : dispatchInstances ? 1 : 0;
2952 "development" !== 'production' ? warning(instancesIsArr === listenersIsArr && instancesLen === listenersLen, 'EventPluginUtils: Invalid `event`.') : void 0;
2957 * Dispatch the event to the listener.
2958 * @param {SyntheticEvent} event SyntheticEvent to handle
2959 * @param {boolean} simulated If the event is simulated (changes exn behavior)
2960 * @param {function} listener Application-level callback
2961 * @param {*} inst Internal component instance
2963 function executeDispatch(event, simulated, listener, inst) {
2964 var type = event.type || 'unknown-event';
2965 event.currentTarget = EventPluginUtils.getNodeFromInstance(inst);
2967 ReactErrorUtils.invokeGuardedCallbackWithCatch(type, listener, event);
2969 ReactErrorUtils.invokeGuardedCallback(type, listener, event);
2971 event.currentTarget = null;
2975 * Standard/simple iteration through an event's collected dispatches.
2977 function executeDispatchesInOrder(event, simulated) {
2978 var dispatchListeners = event._dispatchListeners;
2979 var dispatchInstances = event._dispatchInstances;
2980 if ("development" !== 'production') {
2981 validateEventDispatches(event);
2983 if (Array.isArray(dispatchListeners)) {
2984 for (var i = 0; i < dispatchListeners.length; i++) {
2985 if (event.isPropagationStopped()) {
2988 // Listeners and Instances are two parallel arrays that are always in sync.
2989 executeDispatch(event, simulated, dispatchListeners[i], dispatchInstances[i]);
2991 } else if (dispatchListeners) {
2992 executeDispatch(event, simulated, dispatchListeners, dispatchInstances);
2994 event._dispatchListeners = null;
2995 event._dispatchInstances = null;
2999 * Standard/simple iteration through an event's collected dispatches, but stops
3000 * at the first dispatch execution returning true, and returns that id.
3002 * @return {?string} id of the first dispatch execution who's listener returns
3003 * true, or null if no listener returned true.
3005 function executeDispatchesInOrderStopAtTrueImpl(event) {
3006 var dispatchListeners = event._dispatchListeners;
3007 var dispatchInstances = event._dispatchInstances;
3008 if ("development" !== 'production') {
3009 validateEventDispatches(event);
3011 if (Array.isArray(dispatchListeners)) {
3012 for (var i = 0; i < dispatchListeners.length; i++) {
3013 if (event.isPropagationStopped()) {
3016 // Listeners and Instances are two parallel arrays that are always in sync.
3017 if (dispatchListeners[i](event, dispatchInstances[i])) {
3018 return dispatchInstances[i];
3021 } else if (dispatchListeners) {
3022 if (dispatchListeners(event, dispatchInstances)) {
3023 return dispatchInstances;
3030 * @see executeDispatchesInOrderStopAtTrueImpl
3032 function executeDispatchesInOrderStopAtTrue(event) {
3033 var ret = executeDispatchesInOrderStopAtTrueImpl(event);
3034 event._dispatchInstances = null;
3035 event._dispatchListeners = null;
3040 * Execution of a "direct" dispatch - there must be at most one dispatch
3041 * accumulated on the event or it is considered an error. It doesn't really make
3042 * sense for an event with multiple dispatches (bubbled) to keep track of the
3043 * return values at each dispatch execution, but it does tend to make sense when
3044 * dealing with "direct" dispatches.
3046 * @return {*} The return value of executing the single dispatch.
3048 function executeDirectDispatch(event) {
3049 if ("development" !== 'production') {
3050 validateEventDispatches(event);
3052 var dispatchListener = event._dispatchListeners;
3053 var dispatchInstance = event._dispatchInstances;
3054 !!Array.isArray(dispatchListener) ? "development" !== 'production' ? invariant(false, 'executeDirectDispatch(...): Invalid `event`.') : invariant(false) : void 0;
3055 event.currentTarget = dispatchListener ? EventPluginUtils.getNodeFromInstance(dispatchInstance) : null;
3056 var res = dispatchListener ? dispatchListener(event) : null;
3057 event.currentTarget = null;
3058 event._dispatchListeners = null;
3059 event._dispatchInstances = null;
3064 * @param {SyntheticEvent} event
3065 * @return {boolean} True iff number of dispatches accumulated is greater than 0.
3067 function hasDispatches(event) {
3068 return !!event._dispatchListeners;
3072 * General utilities that are useful in creating custom Event Plugins.
3074 var EventPluginUtils = {
3076 isMoveish: isMoveish,
3077 isStartish: isStartish,
3079 executeDirectDispatch: executeDirectDispatch,
3080 executeDispatchesInOrder: executeDispatchesInOrder,
3081 executeDispatchesInOrderStopAtTrue: executeDispatchesInOrderStopAtTrue,
3082 hasDispatches: hasDispatches,
3084 getInstanceFromNode: function (node) {
3085 return ComponentTree.getInstanceFromNode(node);
3087 getNodeFromInstance: function (node) {
3088 return ComponentTree.getNodeFromInstance(node);
3090 isAncestor: function (a, b) {
3091 return TreeTraversal.isAncestor(a, b);
3093 getLowestCommonAncestor: function (a, b) {
3094 return TreeTraversal.getLowestCommonAncestor(a, b);
3096 getParentInstance: function (inst) {
3097 return TreeTraversal.getParentInstance(inst);
3099 traverseTwoPhase: function (target, fn, arg) {
3100 return TreeTraversal.traverseTwoPhase(target, fn, arg);
3102 traverseEnterLeave: function (from, to, fn, argFrom, argTo) {
3103 return TreeTraversal.traverseEnterLeave(from, to, fn, argFrom, argTo);
3106 injection: injection
3109 module.exports = EventPluginUtils;
3110 },{"16":16,"173":173,"183":183,"68":68}],20:[function(_dereq_,module,exports){
3112 * Copyright 2013-present, Facebook, Inc.
3113 * All rights reserved.
3115 * This source code is licensed under the BSD-style license found in the
3116 * LICENSE file in the root directory of this source tree. An additional grant
3117 * of patent rights can be found in the PATENTS file in the same directory.
3119 * @providesModule EventPropagators
3124 var EventConstants = _dereq_(16);
3125 var EventPluginHub = _dereq_(17);
3126 var EventPluginUtils = _dereq_(19);
3128 var accumulateInto = _dereq_(126);
3129 var forEachAccumulated = _dereq_(134);
3130 var warning = _dereq_(183);
3132 var PropagationPhases = EventConstants.PropagationPhases;
3133 var getListener = EventPluginHub.getListener;
3136 * Some event types have a notion of different registration names for different
3137 * "phases" of propagation. This finds listeners by a given phase.
3139 function listenerAtPhase(inst, event, propagationPhase) {
3140 var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];
3141 return getListener(inst, registrationName);
3145 * Tags a `SyntheticEvent` with dispatched listeners. Creating this function
3146 * here, allows us to not have to bind or create functions for each event.
3147 * Mutating the event's members allows us to not have to create a wrapping
3148 * "dispatch" object that pairs the event with the listener.
3150 function accumulateDirectionalDispatches(inst, upwards, event) {
3151 if ("development" !== 'production') {
3152 "development" !== 'production' ? warning(inst, 'Dispatching inst must not be null') : void 0;
3154 var phase = upwards ? PropagationPhases.bubbled : PropagationPhases.captured;
3155 var listener = listenerAtPhase(inst, event, phase);
3157 event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);
3158 event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);
3163 * Collect dispatches (must be entirely collected before dispatching - see unit
3164 * tests). Lazily allocate the array to conserve memory. We must loop through
3165 * each event and perform the traversal for each one. We cannot perform a
3166 * single traversal for the entire collection of events because each event may
3167 * have a different target.
3169 function accumulateTwoPhaseDispatchesSingle(event) {
3170 if (event && event.dispatchConfig.phasedRegistrationNames) {
3171 EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);
3176 * Same as `accumulateTwoPhaseDispatchesSingle`, but skips over the targetID.
3178 function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {
3179 if (event && event.dispatchConfig.phasedRegistrationNames) {
3180 var targetInst = event._targetInst;
3181 var parentInst = targetInst ? EventPluginUtils.getParentInstance(targetInst) : null;
3182 EventPluginUtils.traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);
3187 * Accumulates without regard to direction, does not look for phased
3188 * registration names. Same as `accumulateDirectDispatchesSingle` but without
3189 * requiring that the `dispatchMarker` be the same as the dispatched ID.
3191 function accumulateDispatches(inst, ignoredDirection, event) {
3192 if (event && event.dispatchConfig.registrationName) {
3193 var registrationName = event.dispatchConfig.registrationName;
3194 var listener = getListener(inst, registrationName);
3196 event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);
3197 event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);
3203 * Accumulates dispatches on an `SyntheticEvent`, but only for the
3205 * @param {SyntheticEvent} event
3207 function accumulateDirectDispatchesSingle(event) {
3208 if (event && event.dispatchConfig.registrationName) {
3209 accumulateDispatches(event._targetInst, null, event);
3213 function accumulateTwoPhaseDispatches(events) {
3214 forEachAccumulated(events, accumulateTwoPhaseDispatchesSingle);
3217 function accumulateTwoPhaseDispatchesSkipTarget(events) {
3218 forEachAccumulated(events, accumulateTwoPhaseDispatchesSingleSkipTarget);
3221 function accumulateEnterLeaveDispatches(leave, enter, from, to) {
3222 EventPluginUtils.traverseEnterLeave(from, to, accumulateDispatches, leave, enter);
3225 function accumulateDirectDispatches(events) {
3226 forEachAccumulated(events, accumulateDirectDispatchesSingle);
3230 * A small set of propagation patterns, each of which will accept a small amount
3231 * of information, and generate a set of "dispatch ready event objects" - which
3232 * are sets of events that have already been annotated with a set of dispatched
3233 * listener functions/ids. The API is designed this way to discourage these
3234 * propagation strategies from actually executing the dispatches, since we
3235 * always want to collect the entire set of dispatches before executing event a
3238 * @constructor EventPropagators
3240 var EventPropagators = {
3241 accumulateTwoPhaseDispatches: accumulateTwoPhaseDispatches,
3242 accumulateTwoPhaseDispatchesSkipTarget: accumulateTwoPhaseDispatchesSkipTarget,
3243 accumulateDirectDispatches: accumulateDirectDispatches,
3244 accumulateEnterLeaveDispatches: accumulateEnterLeaveDispatches
3247 module.exports = EventPropagators;
3248 },{"126":126,"134":134,"16":16,"17":17,"183":183,"19":19}],21:[function(_dereq_,module,exports){
3250 * Copyright 2013-present, Facebook, Inc.
3251 * All rights reserved.
3253 * This source code is licensed under the BSD-style license found in the
3254 * LICENSE file in the root directory of this source tree. An additional grant
3255 * of patent rights can be found in the PATENTS file in the same directory.
3257 * @providesModule FallbackCompositionState
3262 var _assign = _dereq_(184);
3264 var PooledClass = _dereq_(26);
3266 var getTextContentAccessor = _dereq_(142);
3269 * This helper class stores information about text content of a target node,
3270 * allowing comparison of content before and after a given event.
3272 * Identify the node where selection currently begins, then observe
3273 * both its text content and its current position in the DOM. Since the
3274 * browser may natively replace the target node during composition, we can
3275 * use its position to find its replacement.
3277 * @param {DOMEventTarget} root
3279 function FallbackCompositionState(root) {
3281 this._startText = this.getText();
3282 this._fallbackText = null;
3285 _assign(FallbackCompositionState.prototype, {
3286 destructor: function () {
3288 this._startText = null;
3289 this._fallbackText = null;
3293 * Get current text of input.
3297 getText: function () {
3298 if ('value' in this._root) {
3299 return this._root.value;
3301 return this._root[getTextContentAccessor()];
3305 * Determine the differing substring between the initially stored
3306 * text content and the current content.
3310 getData: function () {
3311 if (this._fallbackText) {
3312 return this._fallbackText;
3316 var startValue = this._startText;
3317 var startLength = startValue.length;
3319 var endValue = this.getText();
3320 var endLength = endValue.length;
3322 for (start = 0; start < startLength; start++) {
3323 if (startValue[start] !== endValue[start]) {
3328 var minEnd = startLength - start;
3329 for (end = 1; end <= minEnd; end++) {
3330 if (startValue[startLength - end] !== endValue[endLength - end]) {
3335 var sliceTail = end > 1 ? 1 - end : undefined;
3336 this._fallbackText = endValue.slice(start, sliceTail);
3337 return this._fallbackText;
3341 PooledClass.addPoolingTo(FallbackCompositionState);
3343 module.exports = FallbackCompositionState;
3344 },{"142":142,"184":184,"26":26}],22:[function(_dereq_,module,exports){
3346 * Copyright 2013-present, Facebook, Inc.
3347 * All rights reserved.
3349 * This source code is licensed under the BSD-style license found in the
3350 * LICENSE file in the root directory of this source tree. An additional grant
3351 * of patent rights can be found in the PATENTS file in the same directory.
3353 * @providesModule HTMLDOMPropertyConfig
3358 var DOMProperty = _dereq_(10);
3360 var MUST_USE_PROPERTY = DOMProperty.injection.MUST_USE_PROPERTY;
3361 var HAS_BOOLEAN_VALUE = DOMProperty.injection.HAS_BOOLEAN_VALUE;
3362 var HAS_SIDE_EFFECTS = DOMProperty.injection.HAS_SIDE_EFFECTS;
3363 var HAS_NUMERIC_VALUE = DOMProperty.injection.HAS_NUMERIC_VALUE;
3364 var HAS_POSITIVE_NUMERIC_VALUE = DOMProperty.injection.HAS_POSITIVE_NUMERIC_VALUE;
3365 var HAS_OVERLOADED_BOOLEAN_VALUE = DOMProperty.injection.HAS_OVERLOADED_BOOLEAN_VALUE;
3367 var HTMLDOMPropertyConfig = {
3368 isCustomAttribute: RegExp.prototype.test.bind(new RegExp('^(data|aria)-[' + DOMProperty.ATTRIBUTE_NAME_CHAR + ']*$')),
3371 * Standard Properties
3377 allowFullScreen: HAS_BOOLEAN_VALUE,
3378 allowTransparency: 0,
3380 async: HAS_BOOLEAN_VALUE,
3382 // autoFocus is polyfilled/normalized by AutoFocusUtils
3383 // autoFocus: HAS_BOOLEAN_VALUE,
3384 autoPlay: HAS_BOOLEAN_VALUE,
3385 capture: HAS_BOOLEAN_VALUE,
3390 checked: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
3394 cols: HAS_POSITIVE_NUMERIC_VALUE,
3399 controls: HAS_BOOLEAN_VALUE,
3402 data: 0, // For `<object />` acts as `src`.
3404 'default': HAS_BOOLEAN_VALUE,
3405 defer: HAS_BOOLEAN_VALUE,
3407 disabled: HAS_BOOLEAN_VALUE,
3408 download: HAS_OVERLOADED_BOOLEAN_VALUE,
3415 formNoValidate: HAS_BOOLEAN_VALUE,
3420 hidden: HAS_BOOLEAN_VALUE,
3437 loop: HAS_BOOLEAN_VALUE,
3449 // Caution; `option.selected` is not updated if `select.multiple` is
3450 // disabled with `removeAttribute`.
3451 multiple: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
3452 muted: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
3455 noValidate: HAS_BOOLEAN_VALUE,
3456 open: HAS_BOOLEAN_VALUE,
3464 readOnly: HAS_BOOLEAN_VALUE,
3466 required: HAS_BOOLEAN_VALUE,
3467 reversed: HAS_BOOLEAN_VALUE,
3469 rows: HAS_POSITIVE_NUMERIC_VALUE,
3470 rowSpan: HAS_NUMERIC_VALUE,
3473 scoped: HAS_BOOLEAN_VALUE,
3475 seamless: HAS_BOOLEAN_VALUE,
3476 selected: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
3478 size: HAS_POSITIVE_NUMERIC_VALUE,
3480 span: HAS_POSITIVE_NUMERIC_VALUE,
3486 start: HAS_NUMERIC_VALUE,
3493 // Setting .type throws on non-<input> tags
3496 value: MUST_USE_PROPERTY | HAS_SIDE_EFFECTS,
3508 // property is also supported for OpenGraph in meta tags.
3515 * Non-standard Properties
3517 // autoCapitalize and autoCorrect are supported in Mobile Safari for
3521 // autoSave allows WebKit/Blink to persist values of input fields on page reloads
3523 // color is for Safari mask-icon link
3525 // itemProp, itemScope, itemType are for
3526 // Microdata support. See http://schema.org/docs/gs.html
3528 itemScope: HAS_BOOLEAN_VALUE,
3530 // itemID and itemRef are for Microdata support as well but
3531 // only specified in the WHATWG spec document. See
3532 // https://html.spec.whatwg.org/multipage/microdata.html#microdata-dom-api
3535 // results show looking glass icon and recent searches on input
3536 // search fields in WebKit/Blink
3538 // IE-only attribute that specifies security restrictions on an iframe
3539 // as an alternative to the sandbox attribute on IE<10
3541 // IE-only attribute that controls focus behavior
3544 DOMAttributeNames: {
3545 acceptCharset: 'accept-charset',
3548 httpEquiv: 'http-equiv'
3550 DOMPropertyNames: {}
3553 module.exports = HTMLDOMPropertyConfig;
3554 },{"10":10}],23:[function(_dereq_,module,exports){
3556 * Copyright 2013-present, Facebook, Inc.
3557 * All rights reserved.
3559 * This source code is licensed under the BSD-style license found in the
3560 * LICENSE file in the root directory of this source tree. An additional grant
3561 * of patent rights can be found in the PATENTS file in the same directory.
3563 * @providesModule KeyEscapeUtils
3569 * Escape and wrap key so it is safe to use as a reactid
3571 * @param {*} key to be escaped.
3572 * @return {string} the escaped key.
3575 function escape(key) {
3576 var escapeRegex = /[=:]/g;
3577 var escaperLookup = {
3581 var escapedString = ('' + key).replace(escapeRegex, function (match) {
3582 return escaperLookup[match];
3585 return '$' + escapedString;
3589 * Unescape and unwrap key for human-readable display
3591 * @param {string} key to unescape.
3592 * @return {string} the unescaped key.
3594 function unescape(key) {
3595 var unescapeRegex = /(=0|=2)/g;
3596 var unescaperLookup = {
3600 var keySubstring = key[0] === '.' && key[1] === '$' ? key.substring(2) : key.substring(1);
3602 return ('' + keySubstring).replace(unescapeRegex, function (match) {
3603 return unescaperLookup[match];
3607 var KeyEscapeUtils = {
3612 module.exports = KeyEscapeUtils;
3613 },{}],24:[function(_dereq_,module,exports){
3615 * Copyright 2013-present, Facebook, Inc.
3616 * All rights reserved.
3618 * This source code is licensed under the BSD-style license found in the
3619 * LICENSE file in the root directory of this source tree. An additional grant
3620 * of patent rights can be found in the PATENTS file in the same directory.
3622 * @providesModule LinkedStateMixin
3627 var ReactLink = _dereq_(78);
3628 var ReactStateSetters = _dereq_(98);
3631 * A simple mixin around ReactLink.forState().
3632 * See https://facebook.github.io/react/docs/two-way-binding-helpers.html
3634 var LinkedStateMixin = {
3636 * Create a ReactLink that's linked to part of this component's state. The
3637 * ReactLink will have the current value of this.state[key] and will call
3638 * setState() when a change is requested.
3640 * @param {string} key state key to update. Note: you may want to use keyOf()
3641 * if you're using Google Closure Compiler advanced mode.
3642 * @return {ReactLink} ReactLink instance linking to the state.
3644 linkState: function (key) {
3645 return new ReactLink(this.state[key], ReactStateSetters.createStateKeySetter(this, key));
3649 module.exports = LinkedStateMixin;
3650 },{"78":78,"98":98}],25:[function(_dereq_,module,exports){
3652 * Copyright 2013-present, Facebook, Inc.
3653 * All rights reserved.
3655 * This source code is licensed under the BSD-style license found in the
3656 * LICENSE file in the root directory of this source tree. An additional grant
3657 * of patent rights can be found in the PATENTS file in the same directory.
3659 * @providesModule LinkedValueUtils
3664 var ReactPropTypes = _dereq_(91);
3665 var ReactPropTypeLocations = _dereq_(90);
3667 var invariant = _dereq_(173);
3668 var warning = _dereq_(183);
3670 var hasReadOnlyValue = {
3680 function _assertSingleLink(inputProps) {
3681 !(inputProps.checkedLink == null || inputProps.valueLink == null) ? "development" !== 'production' ? invariant(false, 'Cannot provide a checkedLink and a valueLink. If you want to use ' + 'checkedLink, you probably don\'t want to use valueLink and vice versa.') : invariant(false) : void 0;
3683 function _assertValueLink(inputProps) {
3684 _assertSingleLink(inputProps);
3685 !(inputProps.value == null && inputProps.onChange == null) ? "development" !== 'production' ? invariant(false, 'Cannot provide a valueLink and a value or onChange event. If you want ' + 'to use value or onChange, you probably don\'t want to use valueLink.') : invariant(false) : void 0;
3688 function _assertCheckedLink(inputProps) {
3689 _assertSingleLink(inputProps);
3690 !(inputProps.checked == null && inputProps.onChange == null) ? "development" !== 'production' ? invariant(false, 'Cannot provide a checkedLink and a checked property or onChange event. ' + 'If you want to use checked or onChange, you probably don\'t want to ' + 'use checkedLink') : invariant(false) : void 0;
3694 value: function (props, propName, componentName) {
3695 if (!props[propName] || hasReadOnlyValue[props.type] || props.onChange || props.readOnly || props.disabled) {
3698 return new Error('You provided a `value` prop to a form field without an ' + '`onChange` handler. This will render a read-only field. If ' + 'the field should be mutable use `defaultValue`. Otherwise, ' + 'set either `onChange` or `readOnly`.');
3700 checked: function (props, propName, componentName) {
3701 if (!props[propName] || props.onChange || props.readOnly || props.disabled) {
3704 return new Error('You provided a `checked` prop to a form field without an ' + '`onChange` handler. This will render a read-only field. If ' + 'the field should be mutable use `defaultChecked`. Otherwise, ' + 'set either `onChange` or `readOnly`.');
3706 onChange: ReactPropTypes.func
3709 var loggedTypeFailures = {};
3710 function getDeclarationErrorAddendum(owner) {
3712 var name = owner.getName();
3714 return ' Check the render method of `' + name + '`.';
3721 * Provide a linked `value` attribute for controlled forms. You should not use
3722 * this outside of the ReactDOM controlled form components.
3724 var LinkedValueUtils = {
3725 checkPropTypes: function (tagName, props, owner) {
3726 for (var propName in propTypes) {
3727 if (propTypes.hasOwnProperty(propName)) {
3728 var error = propTypes[propName](props, propName, tagName, ReactPropTypeLocations.prop);
3730 if (error instanceof Error && !(error.message in loggedTypeFailures)) {
3731 // Only monitor this failure once because there tends to be a lot of the
3733 loggedTypeFailures[error.message] = true;
3735 var addendum = getDeclarationErrorAddendum(owner);
3736 "development" !== 'production' ? warning(false, 'Failed form propType: %s%s', error.message, addendum) : void 0;
3742 * @param {object} inputProps Props for form component
3743 * @return {*} current value of the input either from value prop or link.
3745 getValue: function (inputProps) {
3746 if (inputProps.valueLink) {
3747 _assertValueLink(inputProps);
3748 return inputProps.valueLink.value;
3750 return inputProps.value;
3754 * @param {object} inputProps Props for form component
3755 * @return {*} current checked status of the input either from checked prop
3758 getChecked: function (inputProps) {
3759 if (inputProps.checkedLink) {
3760 _assertCheckedLink(inputProps);
3761 return inputProps.checkedLink.value;
3763 return inputProps.checked;
3767 * @param {object} inputProps Props for form component
3768 * @param {SyntheticEvent} event change event to handle
3770 executeOnChange: function (inputProps, event) {
3771 if (inputProps.valueLink) {
3772 _assertValueLink(inputProps);
3773 return inputProps.valueLink.requestChange(event.target.value);
3774 } else if (inputProps.checkedLink) {
3775 _assertCheckedLink(inputProps);
3776 return inputProps.checkedLink.requestChange(event.target.checked);
3777 } else if (inputProps.onChange) {
3778 return inputProps.onChange.call(undefined, event);
3783 module.exports = LinkedValueUtils;
3784 },{"173":173,"183":183,"90":90,"91":91}],26:[function(_dereq_,module,exports){
3786 * Copyright 2013-present, Facebook, Inc.
3787 * All rights reserved.
3789 * This source code is licensed under the BSD-style license found in the
3790 * LICENSE file in the root directory of this source tree. An additional grant
3791 * of patent rights can be found in the PATENTS file in the same directory.
3793 * @providesModule PooledClass
3798 var invariant = _dereq_(173);
3801 * Static poolers. Several custom versions for each potential number of
3802 * arguments. A completely generic pooler is easy to implement, but would
3803 * require accessing the `arguments` object. In each of these, `this` refers to
3804 * the Class itself, not an instance. If any others are needed, simply add them
3805 * here, or in their own files.
3807 var oneArgumentPooler = function (copyFieldsFrom) {
3809 if (Klass.instancePool.length) {
3810 var instance = Klass.instancePool.pop();
3811 Klass.call(instance, copyFieldsFrom);
3814 return new Klass(copyFieldsFrom);
3818 var twoArgumentPooler = function (a1, a2) {
3820 if (Klass.instancePool.length) {
3821 var instance = Klass.instancePool.pop();
3822 Klass.call(instance, a1, a2);
3825 return new Klass(a1, a2);
3829 var threeArgumentPooler = function (a1, a2, a3) {
3831 if (Klass.instancePool.length) {
3832 var instance = Klass.instancePool.pop();
3833 Klass.call(instance, a1, a2, a3);
3836 return new Klass(a1, a2, a3);
3840 var fourArgumentPooler = function (a1, a2, a3, a4) {
3842 if (Klass.instancePool.length) {
3843 var instance = Klass.instancePool.pop();
3844 Klass.call(instance, a1, a2, a3, a4);
3847 return new Klass(a1, a2, a3, a4);
3851 var fiveArgumentPooler = function (a1, a2, a3, a4, a5) {
3853 if (Klass.instancePool.length) {
3854 var instance = Klass.instancePool.pop();
3855 Klass.call(instance, a1, a2, a3, a4, a5);
3858 return new Klass(a1, a2, a3, a4, a5);
3862 var standardReleaser = function (instance) {
3864 !(instance instanceof Klass) ? "development" !== 'production' ? invariant(false, 'Trying to release an instance into a pool of a different type.') : invariant(false) : void 0;
3865 instance.destructor();
3866 if (Klass.instancePool.length < Klass.poolSize) {
3867 Klass.instancePool.push(instance);
3871 var DEFAULT_POOL_SIZE = 10;
3872 var DEFAULT_POOLER = oneArgumentPooler;
3875 * Augments `CopyConstructor` to be a poolable class, augmenting only the class
3876 * itself (statically) not adding any prototypical fields. Any CopyConstructor
3877 * you give this may have a `poolSize` property, and will look for a
3878 * prototypical `destructor` on instances (optional).
3880 * @param {Function} CopyConstructor Constructor that can be used to reset.
3881 * @param {Function} pooler Customizable pooler.
3883 var addPoolingTo = function (CopyConstructor, pooler) {
3884 var NewKlass = CopyConstructor;
3885 NewKlass.instancePool = [];
3886 NewKlass.getPooled = pooler || DEFAULT_POOLER;
3887 if (!NewKlass.poolSize) {
3888 NewKlass.poolSize = DEFAULT_POOL_SIZE;
3890 NewKlass.release = standardReleaser;
3895 addPoolingTo: addPoolingTo,
3896 oneArgumentPooler: oneArgumentPooler,
3897 twoArgumentPooler: twoArgumentPooler,
3898 threeArgumentPooler: threeArgumentPooler,
3899 fourArgumentPooler: fourArgumentPooler,
3900 fiveArgumentPooler: fiveArgumentPooler
3903 module.exports = PooledClass;
3904 },{"173":173}],27:[function(_dereq_,module,exports){
3906 * Copyright 2013-present, Facebook, Inc.
3907 * All rights reserved.
3909 * This source code is licensed under the BSD-style license found in the
3910 * LICENSE file in the root directory of this source tree. An additional grant
3911 * of patent rights can be found in the PATENTS file in the same directory.
3913 * @providesModule React
3918 var _assign = _dereq_(184);
3920 var ReactChildren = _dereq_(32);
3921 var ReactComponent = _dereq_(34);
3922 var ReactClass = _dereq_(33);
3923 var ReactDOMFactories = _dereq_(49);
3924 var ReactElement = _dereq_(65);
3925 var ReactElementValidator = _dereq_(66);
3926 var ReactPropTypes = _dereq_(91);
3927 var ReactVersion = _dereq_(105);
3929 var onlyChild = _dereq_(147);
3930 var warning = _dereq_(183);
3932 var createElement = ReactElement.createElement;
3933 var createFactory = ReactElement.createFactory;
3934 var cloneElement = ReactElement.cloneElement;
3936 if ("development" !== 'production') {
3937 createElement = ReactElementValidator.createElement;
3938 createFactory = ReactElementValidator.createFactory;
3939 cloneElement = ReactElementValidator.cloneElement;
3942 var __spread = _assign;
3944 if ("development" !== 'production') {
3946 __spread = function () {
3947 "development" !== 'production' ? warning(warned, 'React.__spread is deprecated and should not be used. Use ' + 'Object.assign directly or another helper function with similar ' + 'semantics. You may be seeing this warning due to your compiler. ' + 'See https://fb.me/react-spread-deprecation for more details.') : void 0;
3949 return _assign.apply(null, arguments);
3958 map: ReactChildren.map,
3959 forEach: ReactChildren.forEach,
3960 count: ReactChildren.count,
3961 toArray: ReactChildren.toArray,
3965 Component: ReactComponent,
3967 createElement: createElement,
3968 cloneElement: cloneElement,
3969 isValidElement: ReactElement.isValidElement,
3973 PropTypes: ReactPropTypes,
3974 createClass: ReactClass.createClass,
3975 createFactory: createFactory,
3976 createMixin: function (mixin) {
3977 // Currently a noop. Will be used to validate and trace mixins.
3981 // This looks DOM specific but these are actually isomorphic helpers
3982 // since they are just generating DOM strings.
3983 DOM: ReactDOMFactories,
3985 version: ReactVersion,
3987 // Deprecated hook for JSX spread, don't use this for anything.
3991 module.exports = React;
3992 },{"105":105,"147":147,"183":183,"184":184,"32":32,"33":33,"34":34,"49":49,"65":65,"66":66,"91":91}],28:[function(_dereq_,module,exports){
3994 * Copyright 2013-present, Facebook, Inc.
3995 * All rights reserved.
3997 * This source code is licensed under the BSD-style license found in the
3998 * LICENSE file in the root directory of this source tree. An additional grant
3999 * of patent rights can be found in the PATENTS file in the same directory.
4001 * @providesModule ReactBrowserEventEmitter
4006 var _assign = _dereq_(184);
4008 var EventConstants = _dereq_(16);
4009 var EventPluginRegistry = _dereq_(18);
4010 var ReactEventEmitterMixin = _dereq_(69);
4011 var ViewportMetrics = _dereq_(125);
4013 var getVendorPrefixedEventName = _dereq_(143);
4014 var isEventSupported = _dereq_(145);
4017 * Summary of `ReactBrowserEventEmitter` event handling:
4019 * - Top-level delegation is used to trap most native browser events. This
4020 * may only occur in the main thread and is the responsibility of
4021 * ReactEventListener, which is injected and can therefore support pluggable
4022 * event sources. This is the only work that occurs in the main thread.
4024 * - We normalize and de-duplicate events to account for browser quirks. This
4025 * may be done in the worker thread.
4027 * - Forward these native events (with the associated top-level type used to
4028 * trap it) to `EventPluginHub`, which in turn will ask plugins if they want
4029 * to extract any synthetic events.
4031 * - The `EventPluginHub` will then process each event by annotating them with
4032 * "dispatches", a sequence of listeners and IDs that care about that event.
4034 * - The `EventPluginHub` then dispatches the events.
4036 * Overview of React and the event system:
4046 * +------------+ . +-----------+
4047 * | . +--------+|SimpleEvent|
4049 * +-----|------+ . v +-----------+
4050 * | | | . +--------------+ +------------+
4051 * | +-----------.--->|EventPluginHub| | Event |
4052 * | | . | | +-----------+ | Propagators|
4053 * | ReactEvent | . | | |TapEvent | |------------|
4054 * | Emitter | . | |<---+|Plugin | |other plugin|
4055 * | | . | | +-----------+ | utilities |
4056 * | +-----------.--->| | +------------+
4057 * | | | . +--------------+
4058 * +-----|------+ . ^ +-----------+
4059 * | . | |Enter/Leave|
4060 * + . +-------+|Plugin |
4061 * +-------------+ . +-----------+
4068 * React Core . General Purpose Event Plugin System
4072 var alreadyListeningTo = {};
4073 var isMonitoringScrollValue = false;
4074 var reactTopListenersCounter = 0;
4076 // For events like 'submit' which don't consistently bubble (which we trap at a
4077 // lower node than `document`), binding at `document` would cause duplicate
4078 // events so we don't include them here
4079 var topEventMapping = {
4081 topAnimationEnd: getVendorPrefixedEventName('animationend') || 'animationend',
4082 topAnimationIteration: getVendorPrefixedEventName('animationiteration') || 'animationiteration',
4083 topAnimationStart: getVendorPrefixedEventName('animationstart') || 'animationstart',
4085 topCanPlay: 'canplay',
4086 topCanPlayThrough: 'canplaythrough',
4087 topChange: 'change',
4089 topCompositionEnd: 'compositionend',
4090 topCompositionStart: 'compositionstart',
4091 topCompositionUpdate: 'compositionupdate',
4092 topContextMenu: 'contextmenu',
4095 topDoubleClick: 'dblclick',
4097 topDragEnd: 'dragend',
4098 topDragEnter: 'dragenter',
4099 topDragExit: 'dragexit',
4100 topDragLeave: 'dragleave',
4101 topDragOver: 'dragover',
4102 topDragStart: 'dragstart',
4104 topDurationChange: 'durationchange',
4105 topEmptied: 'emptied',
4106 topEncrypted: 'encrypted',
4111 topKeyDown: 'keydown',
4112 topKeyPress: 'keypress',
4114 topLoadedData: 'loadeddata',
4115 topLoadedMetadata: 'loadedmetadata',
4116 topLoadStart: 'loadstart',
4117 topMouseDown: 'mousedown',
4118 topMouseMove: 'mousemove',
4119 topMouseOut: 'mouseout',
4120 topMouseOver: 'mouseover',
4121 topMouseUp: 'mouseup',
4125 topPlaying: 'playing',
4126 topProgress: 'progress',
4127 topRateChange: 'ratechange',
4128 topScroll: 'scroll',
4129 topSeeked: 'seeked',
4130 topSeeking: 'seeking',
4131 topSelectionChange: 'selectionchange',
4132 topStalled: 'stalled',
4133 topSuspend: 'suspend',
4134 topTextInput: 'textInput',
4135 topTimeUpdate: 'timeupdate',
4136 topTouchCancel: 'touchcancel',
4137 topTouchEnd: 'touchend',
4138 topTouchMove: 'touchmove',
4139 topTouchStart: 'touchstart',
4140 topTransitionEnd: getVendorPrefixedEventName('transitionend') || 'transitionend',
4141 topVolumeChange: 'volumechange',
4142 topWaiting: 'waiting',
4147 * To ensure no conflicts with other potential React instances on the page
4149 var topListenersIDKey = '_reactListenersID' + String(Math.random()).slice(2);
4151 function getListeningForDocument(mountAt) {
4152 // In IE8, `mountAt` is a host object and doesn't have `hasOwnProperty`
4154 if (!Object.prototype.hasOwnProperty.call(mountAt, topListenersIDKey)) {
4155 mountAt[topListenersIDKey] = reactTopListenersCounter++;
4156 alreadyListeningTo[mountAt[topListenersIDKey]] = {};
4158 return alreadyListeningTo[mountAt[topListenersIDKey]];
4162 * `ReactBrowserEventEmitter` is used to attach top-level event listeners. For
4165 * EventPluginHub.putListener('myID', 'onClick', myFunction);
4167 * This would allocate a "registration" of `('onClick', myFunction)` on 'myID'.
4171 var ReactBrowserEventEmitter = _assign({}, ReactEventEmitterMixin, {
4174 * Injectable event backend
4176 ReactEventListener: null,
4180 * @param {object} ReactEventListener
4182 injectReactEventListener: function (ReactEventListener) {
4183 ReactEventListener.setHandleTopLevel(ReactBrowserEventEmitter.handleTopLevel);
4184 ReactBrowserEventEmitter.ReactEventListener = ReactEventListener;
4189 * Sets whether or not any created callbacks should be enabled.
4191 * @param {boolean} enabled True if callbacks should be enabled.
4193 setEnabled: function (enabled) {
4194 if (ReactBrowserEventEmitter.ReactEventListener) {
4195 ReactBrowserEventEmitter.ReactEventListener.setEnabled(enabled);
4200 * @return {boolean} True if callbacks are enabled.
4202 isEnabled: function () {
4203 return !!(ReactBrowserEventEmitter.ReactEventListener && ReactBrowserEventEmitter.ReactEventListener.isEnabled());
4207 * We listen for bubbled touch events on the document object.
4209 * Firefox v8.01 (and possibly others) exhibited strange behavior when
4210 * mounting `onmousemove` events at some node that was not the document
4211 * element. The symptoms were that if your mouse is not moving over something
4212 * contained within that mount point (for example on the background) the
4213 * top-level listeners for `onmousemove` won't be called. However, if you
4214 * register the `mousemove` on the document object, then it will of course
4215 * catch all `mousemove`s. This along with iOS quirks, justifies restricting
4216 * top-level listeners to the document object only, at least for these
4217 * movement types of events and possibly all events.
4219 * @see http://www.quirksmode.org/blog/archives/2010/09/click_event_del.html
4221 * Also, `keyup`/`keypress`/`keydown` do not bubble to the window on IE, but
4222 * they bubble to document.
4224 * @param {string} registrationName Name of listener (e.g. `onClick`).
4225 * @param {object} contentDocumentHandle Document which owns the container
4227 listenTo: function (registrationName, contentDocumentHandle) {
4228 var mountAt = contentDocumentHandle;
4229 var isListening = getListeningForDocument(mountAt);
4230 var dependencies = EventPluginRegistry.registrationNameDependencies[registrationName];
4232 var topLevelTypes = EventConstants.topLevelTypes;
4233 for (var i = 0; i < dependencies.length; i++) {
4234 var dependency = dependencies[i];
4235 if (!(isListening.hasOwnProperty(dependency) && isListening[dependency])) {
4236 if (dependency === topLevelTypes.topWheel) {
4237 if (isEventSupported('wheel')) {
4238 ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(topLevelTypes.topWheel, 'wheel', mountAt);
4239 } else if (isEventSupported('mousewheel')) {
4240 ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(topLevelTypes.topWheel, 'mousewheel', mountAt);
4242 // Firefox needs to capture a different mouse scroll event.
4243 // @see http://www.quirksmode.org/dom/events/tests/scroll.html
4244 ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(topLevelTypes.topWheel, 'DOMMouseScroll', mountAt);
4246 } else if (dependency === topLevelTypes.topScroll) {
4248 if (isEventSupported('scroll', true)) {
4249 ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent(topLevelTypes.topScroll, 'scroll', mountAt);
4251 ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(topLevelTypes.topScroll, 'scroll', ReactBrowserEventEmitter.ReactEventListener.WINDOW_HANDLE);
4253 } else if (dependency === topLevelTypes.topFocus || dependency === topLevelTypes.topBlur) {
4255 if (isEventSupported('focus', true)) {
4256 ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent(topLevelTypes.topFocus, 'focus', mountAt);
4257 ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent(topLevelTypes.topBlur, 'blur', mountAt);
4258 } else if (isEventSupported('focusin')) {
4259 // IE has `focusin` and `focusout` events which bubble.
4260 // @see http://www.quirksmode.org/blog/archives/2008/04/delegating_the.html
4261 ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(topLevelTypes.topFocus, 'focusin', mountAt);
4262 ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(topLevelTypes.topBlur, 'focusout', mountAt);
4265 // to make sure blur and focus event listeners are only attached once
4266 isListening[topLevelTypes.topBlur] = true;
4267 isListening[topLevelTypes.topFocus] = true;
4268 } else if (topEventMapping.hasOwnProperty(dependency)) {
4269 ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(dependency, topEventMapping[dependency], mountAt);
4272 isListening[dependency] = true;
4277 trapBubbledEvent: function (topLevelType, handlerBaseName, handle) {
4278 return ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(topLevelType, handlerBaseName, handle);
4281 trapCapturedEvent: function (topLevelType, handlerBaseName, handle) {
4282 return ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent(topLevelType, handlerBaseName, handle);
4286 * Listens to window scroll and resize events. We cache scroll values so that
4287 * application code can access them without triggering reflows.
4289 * ViewportMetrics is only used by SyntheticMouse/TouchEvent and only when
4290 * pageX/pageY isn't supported (legacy browsers).
4292 * NOTE: Scroll events do not bubble.
4294 * @see http://www.quirksmode.org/dom/events/scroll.html
4296 ensureScrollValueMonitoring: function () {
4297 if (hasEventPageXY === undefined) {
4298 hasEventPageXY = document.createEvent && 'pageX' in document.createEvent('MouseEvent');
4300 if (!hasEventPageXY && !isMonitoringScrollValue) {
4301 var refresh = ViewportMetrics.refreshScrollValues;
4302 ReactBrowserEventEmitter.ReactEventListener.monitorScrollValue(refresh);
4303 isMonitoringScrollValue = true;
4309 module.exports = ReactBrowserEventEmitter;
4310 },{"125":125,"143":143,"145":145,"16":16,"18":18,"184":184,"69":69}],29:[function(_dereq_,module,exports){
4312 * Copyright 2013-present, Facebook, Inc.
4313 * All rights reserved.
4315 * This source code is licensed under the BSD-style license found in the
4316 * LICENSE file in the root directory of this source tree. An additional grant
4317 * of patent rights can be found in the PATENTS file in the same directory.
4319 * @providesModule ReactCSSTransitionGroup
4324 var _assign = _dereq_(184);
4326 var React = _dereq_(27);
4328 var ReactTransitionGroup = _dereq_(102);
4329 var ReactCSSTransitionGroupChild = _dereq_(30);
4331 function createTransitionTimeoutPropValidator(transitionType) {
4332 var timeoutPropName = 'transition' + transitionType + 'Timeout';
4333 var enabledPropName = 'transition' + transitionType;
4335 return function (props) {
4336 // If the transition is enabled
4337 if (props[enabledPropName]) {
4338 // If no timeout duration is provided
4339 if (props[timeoutPropName] == null) {
4340 return new Error(timeoutPropName + ' wasn\'t supplied to ReactCSSTransitionGroup: ' + 'this can cause unreliable animations and won\'t be supported in ' + 'a future version of React. See ' + 'https://fb.me/react-animation-transition-group-timeout for more ' + 'information.');
4342 // If the duration isn't a number
4343 } else if (typeof props[timeoutPropName] !== 'number') {
4344 return new Error(timeoutPropName + ' must be a number (in milliseconds)');
4351 * An easy way to perform CSS transitions and animations when a React component
4352 * enters or leaves the DOM.
4353 * See https://facebook.github.io/react/docs/animation.html#high-level-api-reactcsstransitiongroup
4355 var ReactCSSTransitionGroup = React.createClass({
4356 displayName: 'ReactCSSTransitionGroup',
4359 transitionName: ReactCSSTransitionGroupChild.propTypes.name,
4361 transitionAppear: React.PropTypes.bool,
4362 transitionEnter: React.PropTypes.bool,
4363 transitionLeave: React.PropTypes.bool,
4364 transitionAppearTimeout: createTransitionTimeoutPropValidator('Appear'),
4365 transitionEnterTimeout: createTransitionTimeoutPropValidator('Enter'),
4366 transitionLeaveTimeout: createTransitionTimeoutPropValidator('Leave')
4369 getDefaultProps: function () {
4371 transitionAppear: false,
4372 transitionEnter: true,
4373 transitionLeave: true
4377 _wrapChild: function (child) {
4378 // We need to provide this childFactory so that
4379 // ReactCSSTransitionGroupChild can receive updates to name, enter, and
4380 // leave while it is leaving.
4381 return React.createElement(ReactCSSTransitionGroupChild, {
4382 name: this.props.transitionName,
4383 appear: this.props.transitionAppear,
4384 enter: this.props.transitionEnter,
4385 leave: this.props.transitionLeave,
4386 appearTimeout: this.props.transitionAppearTimeout,
4387 enterTimeout: this.props.transitionEnterTimeout,
4388 leaveTimeout: this.props.transitionLeaveTimeout
4392 render: function () {
4393 return React.createElement(ReactTransitionGroup, _assign({}, this.props, { childFactory: this._wrapChild }));
4397 module.exports = ReactCSSTransitionGroup;
4398 },{"102":102,"184":184,"27":27,"30":30}],30:[function(_dereq_,module,exports){
4400 * Copyright 2013-present, Facebook, Inc.
4401 * All rights reserved.
4403 * This source code is licensed under the BSD-style license found in the
4404 * LICENSE file in the root directory of this source tree. An additional grant
4405 * of patent rights can be found in the PATENTS file in the same directory.
4407 * @providesModule ReactCSSTransitionGroupChild
4412 var React = _dereq_(27);
4413 var ReactDOM = _dereq_(41);
4415 var CSSCore = _dereq_(157);
4416 var ReactTransitionEvents = _dereq_(101);
4418 var onlyChild = _dereq_(147);
4422 var ReactCSSTransitionGroupChild = React.createClass({
4423 displayName: 'ReactCSSTransitionGroupChild',
4426 name: React.PropTypes.oneOfType([React.PropTypes.string, React.PropTypes.shape({
4427 enter: React.PropTypes.string,
4428 leave: React.PropTypes.string,
4429 active: React.PropTypes.string
4430 }), React.PropTypes.shape({
4431 enter: React.PropTypes.string,
4432 enterActive: React.PropTypes.string,
4433 leave: React.PropTypes.string,
4434 leaveActive: React.PropTypes.string,
4435 appear: React.PropTypes.string,
4436 appearActive: React.PropTypes.string
4439 // Once we require timeouts to be specified, we can remove the
4440 // boolean flags (appear etc.) and just accept a number
4441 // or a bool for the timeout flags (appearTimeout etc.)
4442 appear: React.PropTypes.bool,
4443 enter: React.PropTypes.bool,
4444 leave: React.PropTypes.bool,
4445 appearTimeout: React.PropTypes.number,
4446 enterTimeout: React.PropTypes.number,
4447 leaveTimeout: React.PropTypes.number
4450 transition: function (animationType, finishCallback, userSpecifiedDelay) {
4451 var node = ReactDOM.findDOMNode(this);
4454 if (finishCallback) {
4460 var className = this.props.name[animationType] || this.props.name + '-' + animationType;
4461 var activeClassName = this.props.name[animationType + 'Active'] || className + '-active';
4464 var endListener = function (e) {
4465 if (e && e.target !== node) {
4469 clearTimeout(timeout);
4471 CSSCore.removeClass(node, className);
4472 CSSCore.removeClass(node, activeClassName);
4474 ReactTransitionEvents.removeEndEventListener(node, endListener);
4476 // Usually this optional callback is used for informing an owner of
4477 // a leave animation and telling it to remove the child.
4478 if (finishCallback) {
4483 CSSCore.addClass(node, className);
4485 // Need to do this to actually trigger a transition.
4486 this.queueClass(activeClassName);
4488 // If the user specified a timeout delay.
4489 if (userSpecifiedDelay) {
4490 // Clean-up the animation after the specified delay
4491 timeout = setTimeout(endListener, userSpecifiedDelay);
4492 this.transitionTimeouts.push(timeout);
4494 // DEPRECATED: this listener will be removed in a future version of react
4495 ReactTransitionEvents.addEndEventListener(node, endListener);
4499 queueClass: function (className) {
4500 this.classNameQueue.push(className);
4502 if (!this.timeout) {
4503 this.timeout = setTimeout(this.flushClassNameQueue, TICK);
4507 flushClassNameQueue: function () {
4508 if (this.isMounted()) {
4509 this.classNameQueue.forEach(CSSCore.addClass.bind(CSSCore, ReactDOM.findDOMNode(this)));
4511 this.classNameQueue.length = 0;
4512 this.timeout = null;
4515 componentWillMount: function () {
4516 this.classNameQueue = [];
4517 this.transitionTimeouts = [];
4520 componentWillUnmount: function () {
4522 clearTimeout(this.timeout);
4524 this.transitionTimeouts.forEach(function (timeout) {
4525 clearTimeout(timeout);
4529 componentWillAppear: function (done) {
4530 if (this.props.appear) {
4531 this.transition('appear', done, this.props.appearTimeout);
4537 componentWillEnter: function (done) {
4538 if (this.props.enter) {
4539 this.transition('enter', done, this.props.enterTimeout);
4545 componentWillLeave: function (done) {
4546 if (this.props.leave) {
4547 this.transition('leave', done, this.props.leaveTimeout);
4553 render: function () {
4554 return onlyChild(this.props.children);
4558 module.exports = ReactCSSTransitionGroupChild;
4559 },{"101":101,"147":147,"157":157,"27":27,"41":41}],31:[function(_dereq_,module,exports){
4561 * Copyright 2014-present, Facebook, Inc.
4562 * All rights reserved.
4564 * This source code is licensed under the BSD-style license found in the
4565 * LICENSE file in the root directory of this source tree. An additional grant
4566 * of patent rights can be found in the PATENTS file in the same directory.
4568 * @providesModule ReactChildReconciler
4573 var ReactReconciler = _dereq_(93);
4575 var instantiateReactComponent = _dereq_(144);
4576 var KeyEscapeUtils = _dereq_(23);
4577 var shouldUpdateReactComponent = _dereq_(153);
4578 var traverseAllChildren = _dereq_(154);
4579 var warning = _dereq_(183);
4581 function instantiateChild(childInstances, child, name) {
4582 // We found a component instance.
4583 var keyUnique = childInstances[name] === undefined;
4584 if ("development" !== 'production') {
4585 "development" !== 'production' ? warning(keyUnique, 'flattenChildren(...): Encountered two children with the same key, ' + '`%s`. Child keys must be unique; when two children share a key, only ' + 'the first child will be used.', KeyEscapeUtils.unescape(name)) : void 0;
4587 if (child != null && keyUnique) {
4588 childInstances[name] = instantiateReactComponent(child);
4593 * ReactChildReconciler provides helpers for initializing or updating a set of
4594 * children. Its output is suitable for passing it onto ReactMultiChild which
4595 * does diffed reordering and insertion.
4597 var ReactChildReconciler = {
4599 * Generates a "mount image" for each of the supplied children. In the case
4600 * of `ReactDOMComponent`, a mount image is a string of markup.
4602 * @param {?object} nestedChildNodes Nested child maps.
4603 * @return {?object} A set of child instances.
4606 instantiateChildren: function (nestedChildNodes, transaction, context) {
4607 if (nestedChildNodes == null) {
4610 var childInstances = {};
4611 traverseAllChildren(nestedChildNodes, instantiateChild, childInstances);
4612 return childInstances;
4616 * Updates the rendered children and returns a new set of children.
4618 * @param {?object} prevChildren Previously initialized set of children.
4619 * @param {?object} nextChildren Flat child element maps.
4620 * @param {ReactReconcileTransaction} transaction
4621 * @param {object} context
4622 * @return {?object} A new set of child instances.
4625 updateChildren: function (prevChildren, nextChildren, removedNodes, transaction, context) {
4626 // We currently don't have a way to track moves here but if we use iterators
4627 // instead of for..in we can zip the iterators and check if an item has
4629 // TODO: If nothing has changed, return the prevChildren object so that we
4630 // can quickly bailout if nothing has changed.
4631 if (!nextChildren && !prevChildren) {
4636 for (name in nextChildren) {
4637 if (!nextChildren.hasOwnProperty(name)) {
4640 prevChild = prevChildren && prevChildren[name];
4641 var prevElement = prevChild && prevChild._currentElement;
4642 var nextElement = nextChildren[name];
4643 if (prevChild != null && shouldUpdateReactComponent(prevElement, nextElement)) {
4644 ReactReconciler.receiveComponent(prevChild, nextElement, transaction, context);
4645 nextChildren[name] = prevChild;
4648 removedNodes[name] = ReactReconciler.getNativeNode(prevChild);
4649 ReactReconciler.unmountComponent(prevChild, false);
4651 // The child must be instantiated before it's mounted.
4652 var nextChildInstance = instantiateReactComponent(nextElement);
4653 nextChildren[name] = nextChildInstance;
4656 // Unmount children that are no longer present.
4657 for (name in prevChildren) {
4658 if (prevChildren.hasOwnProperty(name) && !(nextChildren && nextChildren.hasOwnProperty(name))) {
4659 prevChild = prevChildren[name];
4660 removedNodes[name] = ReactReconciler.getNativeNode(prevChild);
4661 ReactReconciler.unmountComponent(prevChild, false);
4667 * Unmounts all rendered children. This should be used to clean up children
4668 * when this component is unmounted.
4670 * @param {?object} renderedChildren Previously initialized set of children.
4673 unmountChildren: function (renderedChildren, safely) {
4674 for (var name in renderedChildren) {
4675 if (renderedChildren.hasOwnProperty(name)) {
4676 var renderedChild = renderedChildren[name];
4677 ReactReconciler.unmountComponent(renderedChild, safely);
4684 module.exports = ReactChildReconciler;
4685 },{"144":144,"153":153,"154":154,"183":183,"23":23,"93":93}],32:[function(_dereq_,module,exports){
4687 * Copyright 2013-present, Facebook, Inc.
4688 * All rights reserved.
4690 * This source code is licensed under the BSD-style license found in the
4691 * LICENSE file in the root directory of this source tree. An additional grant
4692 * of patent rights can be found in the PATENTS file in the same directory.
4694 * @providesModule ReactChildren
4699 var PooledClass = _dereq_(26);
4700 var ReactElement = _dereq_(65);
4702 var emptyFunction = _dereq_(165);
4703 var traverseAllChildren = _dereq_(154);
4705 var twoArgumentPooler = PooledClass.twoArgumentPooler;
4706 var fourArgumentPooler = PooledClass.fourArgumentPooler;
4708 var userProvidedKeyEscapeRegex = /\/+/g;
4709 function escapeUserProvidedKey(text) {
4710 return ('' + text).replace(userProvidedKeyEscapeRegex, '$&/');
4714 * PooledClass representing the bookkeeping associated with performing a child
4715 * traversal. Allows avoiding binding callbacks.
4717 * @constructor ForEachBookKeeping
4718 * @param {!function} forEachFunction Function to perform traversal with.
4719 * @param {?*} forEachContext Context to perform context with.
4721 function ForEachBookKeeping(forEachFunction, forEachContext) {
4722 this.func = forEachFunction;
4723 this.context = forEachContext;
4726 ForEachBookKeeping.prototype.destructor = function () {
4728 this.context = null;
4731 PooledClass.addPoolingTo(ForEachBookKeeping, twoArgumentPooler);
4733 function forEachSingleChild(bookKeeping, child, name) {
4734 var func = bookKeeping.func;
4735 var context = bookKeeping.context;
4737 func.call(context, child, bookKeeping.count++);
4741 * Iterates through children that are typically specified as `props.children`.
4743 * See https://facebook.github.io/react/docs/top-level-api.html#react.children.foreach
4745 * The provided forEachFunc(child, index) will be called for each
4748 * @param {?*} children Children tree container.
4749 * @param {function(*, int)} forEachFunc
4750 * @param {*} forEachContext Context for forEachContext.
4752 function forEachChildren(children, forEachFunc, forEachContext) {
4753 if (children == null) {
4756 var traverseContext = ForEachBookKeeping.getPooled(forEachFunc, forEachContext);
4757 traverseAllChildren(children, forEachSingleChild, traverseContext);
4758 ForEachBookKeeping.release(traverseContext);
4762 * PooledClass representing the bookkeeping associated with performing a child
4763 * mapping. Allows avoiding binding callbacks.
4765 * @constructor MapBookKeeping
4766 * @param {!*} mapResult Object containing the ordered map of results.
4767 * @param {!function} mapFunction Function to perform mapping with.
4768 * @param {?*} mapContext Context to perform mapping with.
4770 function MapBookKeeping(mapResult, keyPrefix, mapFunction, mapContext) {
4771 this.result = mapResult;
4772 this.keyPrefix = keyPrefix;
4773 this.func = mapFunction;
4774 this.context = mapContext;
4777 MapBookKeeping.prototype.destructor = function () {
4779 this.keyPrefix = null;
4781 this.context = null;
4784 PooledClass.addPoolingTo(MapBookKeeping, fourArgumentPooler);
4786 function mapSingleChildIntoContext(bookKeeping, child, childKey) {
4787 var result = bookKeeping.result;
4788 var keyPrefix = bookKeeping.keyPrefix;
4789 var func = bookKeeping.func;
4790 var context = bookKeeping.context;
4793 var mappedChild = func.call(context, child, bookKeeping.count++);
4794 if (Array.isArray(mappedChild)) {
4795 mapIntoWithKeyPrefixInternal(mappedChild, result, childKey, emptyFunction.thatReturnsArgument);
4796 } else if (mappedChild != null) {
4797 if (ReactElement.isValidElement(mappedChild)) {
4798 mappedChild = ReactElement.cloneAndReplaceKey(mappedChild,
4799 // Keep both the (mapped) and old keys if they differ, just as
4800 // traverseAllChildren used to do for objects as children
4801 keyPrefix + (mappedChild.key && (!child || child.key !== mappedChild.key) ? escapeUserProvidedKey(mappedChild.key) + '/' : '') + childKey);
4803 result.push(mappedChild);
4807 function mapIntoWithKeyPrefixInternal(children, array, prefix, func, context) {
4808 var escapedPrefix = '';
4809 if (prefix != null) {
4810 escapedPrefix = escapeUserProvidedKey(prefix) + '/';
4812 var traverseContext = MapBookKeeping.getPooled(array, escapedPrefix, func, context);
4813 traverseAllChildren(children, mapSingleChildIntoContext, traverseContext);
4814 MapBookKeeping.release(traverseContext);
4818 * Maps children that are typically specified as `props.children`.
4820 * See https://facebook.github.io/react/docs/top-level-api.html#react.children.map
4822 * The provided mapFunction(child, key, index) will be called for each
4825 * @param {?*} children Children tree container.
4826 * @param {function(*, int)} func The map function.
4827 * @param {*} context Context for mapFunction.
4828 * @return {object} Object containing the ordered map of results.
4830 function mapChildren(children, func, context) {
4831 if (children == null) {
4835 mapIntoWithKeyPrefixInternal(children, result, null, func, context);
4839 function forEachSingleChildDummy(traverseContext, child, name) {
4844 * Count the number of children that are typically specified as
4847 * See https://facebook.github.io/react/docs/top-level-api.html#react.children.count
4849 * @param {?*} children Children tree container.
4850 * @return {number} The number of children.
4852 function countChildren(children, context) {
4853 return traverseAllChildren(children, forEachSingleChildDummy, null);
4857 * Flatten a children object (typically specified as `props.children`) and
4858 * return an array with appropriately re-keyed children.
4860 * See https://facebook.github.io/react/docs/top-level-api.html#react.children.toarray
4862 function toArray(children) {
4864 mapIntoWithKeyPrefixInternal(children, result, null, emptyFunction.thatReturnsArgument);
4868 var ReactChildren = {
4869 forEach: forEachChildren,
4871 mapIntoWithKeyPrefixInternal: mapIntoWithKeyPrefixInternal,
4872 count: countChildren,
4876 module.exports = ReactChildren;
4877 },{"154":154,"165":165,"26":26,"65":65}],33:[function(_dereq_,module,exports){
4879 * Copyright 2013-present, Facebook, Inc.
4880 * All rights reserved.
4882 * This source code is licensed under the BSD-style license found in the
4883 * LICENSE file in the root directory of this source tree. An additional grant
4884 * of patent rights can be found in the PATENTS file in the same directory.
4886 * @providesModule ReactClass
4891 var _assign = _dereq_(184);
4893 var ReactComponent = _dereq_(34);
4894 var ReactElement = _dereq_(65);
4895 var ReactPropTypeLocations = _dereq_(90);
4896 var ReactPropTypeLocationNames = _dereq_(89);
4897 var ReactNoopUpdateQueue = _dereq_(86);
4899 var emptyObject = _dereq_(166);
4900 var invariant = _dereq_(173);
4901 var keyMirror = _dereq_(176);
4902 var keyOf = _dereq_(177);
4903 var warning = _dereq_(183);
4905 var MIXINS_KEY = keyOf({ mixins: null });
4908 * Policies that describe methods in `ReactClassInterface`.
4910 var SpecPolicy = keyMirror({
4912 * These methods may be defined only once by the class specification or mixin.
4916 * These methods may be defined by both the class specification and mixins.
4917 * Subsequent definitions will be chained. These methods must return void.
4921 * These methods are overriding the base class.
4923 OVERRIDE_BASE: null,
4925 * These methods are similar to DEFINE_MANY, except we assume they return
4926 * objects. We try to merge the keys of the return values of all the mixed in
4927 * functions. If there is a key conflict we throw.
4929 DEFINE_MANY_MERGED: null
4932 var injectedMixins = [];
4935 * Composite components are higher-level components that compose other composite
4936 * or native components.
4938 * To create a new type of `ReactClass`, pass a specification of
4939 * your new class to `React.createClass`. The only requirement of your class
4940 * specification is that you implement a `render` method.
4942 * var MyComponent = React.createClass({
4943 * render: function() {
4944 * return <div>Hello World</div>;
4948 * The class specification supports a specific protocol of methods that have
4949 * special meaning (e.g. `render`). See `ReactClassInterface` for
4950 * more the comprehensive protocol. Any other properties and methods in the
4951 * class specification will be available on the prototype.
4953 * @interface ReactClassInterface
4956 var ReactClassInterface = {
4959 * An array of Mixin objects to include when defining your component.
4964 mixins: SpecPolicy.DEFINE_MANY,
4967 * An object containing properties and methods that should be defined on
4968 * the component's constructor instead of its prototype (static methods).
4973 statics: SpecPolicy.DEFINE_MANY,
4976 * Definition of prop types for this component.
4981 propTypes: SpecPolicy.DEFINE_MANY,
4984 * Definition of context types for this component.
4989 contextTypes: SpecPolicy.DEFINE_MANY,
4992 * Definition of context types this component sets for its children.
4997 childContextTypes: SpecPolicy.DEFINE_MANY,
4999 // ==== Definition methods ====
5002 * Invoked when the component is mounted. Values in the mapping will be set on
5003 * `this.props` if that prop is not specified (i.e. using an `in` check).
5005 * This method is invoked before `getInitialState` and therefore cannot rely
5006 * on `this.state` or use `this.setState`.
5011 getDefaultProps: SpecPolicy.DEFINE_MANY_MERGED,
5014 * Invoked once before the component is mounted. The return value will be used
5015 * as the initial value of `this.state`.
5017 * getInitialState: function() {
5020 * fooBaz: new BazFoo()
5027 getInitialState: SpecPolicy.DEFINE_MANY_MERGED,
5033 getChildContext: SpecPolicy.DEFINE_MANY_MERGED,
5036 * Uses props from `this.props` and state from `this.state` to render the
5037 * structure of the component.
5039 * No guarantees are made about when or how often this method is invoked, so
5040 * it must not have side effects.
5042 * render: function() {
5043 * var name = this.props.name;
5044 * return <div>Hello, {name}!</div>;
5047 * @return {ReactComponent}
5051 render: SpecPolicy.DEFINE_ONCE,
5053 // ==== Delegate methods ====
5056 * Invoked when the component is initially created and about to be mounted.
5057 * This may have side effects, but any external subscriptions or data created
5058 * by this method must be cleaned up in `componentWillUnmount`.
5062 componentWillMount: SpecPolicy.DEFINE_MANY,
5065 * Invoked when the component has been mounted and has a DOM representation.
5066 * However, there is no guarantee that the DOM node is in the document.
5068 * Use this as an opportunity to operate on the DOM when the component has
5069 * been mounted (initialized and rendered) for the first time.
5071 * @param {DOMElement} rootNode DOM element representing the component.
5074 componentDidMount: SpecPolicy.DEFINE_MANY,
5077 * Invoked before the component receives new props.
5079 * Use this as an opportunity to react to a prop transition by updating the
5080 * state using `this.setState`. Current props are accessed via `this.props`.
5082 * componentWillReceiveProps: function(nextProps, nextContext) {
5084 * likesIncreasing: nextProps.likeCount > this.props.likeCount
5088 * NOTE: There is no equivalent `componentWillReceiveState`. An incoming prop
5089 * transition may cause a state change, but the opposite is not true. If you
5090 * need it, you are probably looking for `componentWillUpdate`.
5092 * @param {object} nextProps
5095 componentWillReceiveProps: SpecPolicy.DEFINE_MANY,
5098 * Invoked while deciding if the component should be updated as a result of
5099 * receiving new props, state and/or context.
5101 * Use this as an opportunity to `return false` when you're certain that the
5102 * transition to the new props/state/context will not require a component
5105 * shouldComponentUpdate: function(nextProps, nextState, nextContext) {
5106 * return !equal(nextProps, this.props) ||
5107 * !equal(nextState, this.state) ||
5108 * !equal(nextContext, this.context);
5111 * @param {object} nextProps
5112 * @param {?object} nextState
5113 * @param {?object} nextContext
5114 * @return {boolean} True if the component should update.
5117 shouldComponentUpdate: SpecPolicy.DEFINE_ONCE,
5120 * Invoked when the component is about to update due to a transition from
5121 * `this.props`, `this.state` and `this.context` to `nextProps`, `nextState`
5122 * and `nextContext`.
5124 * Use this as an opportunity to perform preparation before an update occurs.
5126 * NOTE: You **cannot** use `this.setState()` in this method.
5128 * @param {object} nextProps
5129 * @param {?object} nextState
5130 * @param {?object} nextContext
5131 * @param {ReactReconcileTransaction} transaction
5134 componentWillUpdate: SpecPolicy.DEFINE_MANY,
5137 * Invoked when the component's DOM representation has been updated.
5139 * Use this as an opportunity to operate on the DOM when the component has
5142 * @param {object} prevProps
5143 * @param {?object} prevState
5144 * @param {?object} prevContext
5145 * @param {DOMElement} rootNode DOM element representing the component.
5148 componentDidUpdate: SpecPolicy.DEFINE_MANY,
5151 * Invoked when the component is about to be removed from its parent and have
5152 * its DOM representation destroyed.
5154 * Use this as an opportunity to deallocate any external resources.
5156 * NOTE: There is no `componentDidUnmount` since your component will have been
5157 * destroyed by that point.
5161 componentWillUnmount: SpecPolicy.DEFINE_MANY,
5163 // ==== Advanced methods ====
5166 * Updates the component's currently mounted DOM representation.
5168 * By default, this implements React's rendering and reconciliation algorithm.
5169 * Sophisticated clients may wish to override this.
5171 * @param {ReactReconcileTransaction} transaction
5175 updateComponent: SpecPolicy.OVERRIDE_BASE
5180 * Mapping from class specification keys to special processing functions.
5182 * Although these are declared like instance properties in the specification
5183 * when defining classes using `React.createClass`, they are actually static
5184 * and are accessible on the constructor instead of the prototype. Despite
5185 * being static, they must be defined outside of the "statics" key under
5186 * which all other static methods are defined.
5188 var RESERVED_SPEC_KEYS = {
5189 displayName: function (Constructor, displayName) {
5190 Constructor.displayName = displayName;
5192 mixins: function (Constructor, mixins) {
5194 for (var i = 0; i < mixins.length; i++) {
5195 mixSpecIntoComponent(Constructor, mixins[i]);
5199 childContextTypes: function (Constructor, childContextTypes) {
5200 if ("development" !== 'production') {
5201 validateTypeDef(Constructor, childContextTypes, ReactPropTypeLocations.childContext);
5203 Constructor.childContextTypes = _assign({}, Constructor.childContextTypes, childContextTypes);
5205 contextTypes: function (Constructor, contextTypes) {
5206 if ("development" !== 'production') {
5207 validateTypeDef(Constructor, contextTypes, ReactPropTypeLocations.context);
5209 Constructor.contextTypes = _assign({}, Constructor.contextTypes, contextTypes);
5212 * Special case getDefaultProps which should move into statics but requires
5213 * automatic merging.
5215 getDefaultProps: function (Constructor, getDefaultProps) {
5216 if (Constructor.getDefaultProps) {
5217 Constructor.getDefaultProps = createMergedResultFunction(Constructor.getDefaultProps, getDefaultProps);
5219 Constructor.getDefaultProps = getDefaultProps;
5222 propTypes: function (Constructor, propTypes) {
5223 if ("development" !== 'production') {
5224 validateTypeDef(Constructor, propTypes, ReactPropTypeLocations.prop);
5226 Constructor.propTypes = _assign({}, Constructor.propTypes, propTypes);
5228 statics: function (Constructor, statics) {
5229 mixStaticSpecIntoComponent(Constructor, statics);
5231 autobind: function () {} };
5234 function validateTypeDef(Constructor, typeDef, location) {
5235 for (var propName in typeDef) {
5236 if (typeDef.hasOwnProperty(propName)) {
5237 // use a warning instead of an invariant so components
5238 // don't show up in prod but only in __DEV__
5239 "development" !== 'production' ? warning(typeof typeDef[propName] === 'function', '%s: %s type `%s` is invalid; it must be a function, usually from ' + 'React.PropTypes.', Constructor.displayName || 'ReactClass', ReactPropTypeLocationNames[location], propName) : void 0;
5244 function validateMethodOverride(isAlreadyDefined, name) {
5245 var specPolicy = ReactClassInterface.hasOwnProperty(name) ? ReactClassInterface[name] : null;
5247 // Disallow overriding of base class methods unless explicitly allowed.
5248 if (ReactClassMixin.hasOwnProperty(name)) {
5249 !(specPolicy === SpecPolicy.OVERRIDE_BASE) ? "development" !== 'production' ? invariant(false, 'ReactClassInterface: You are attempting to override ' + '`%s` from your class specification. Ensure that your method names ' + 'do not overlap with React methods.', name) : invariant(false) : void 0;
5252 // Disallow defining methods more than once unless explicitly allowed.
5253 if (isAlreadyDefined) {
5254 !(specPolicy === SpecPolicy.DEFINE_MANY || specPolicy === SpecPolicy.DEFINE_MANY_MERGED) ? "development" !== 'production' ? invariant(false, 'ReactClassInterface: You are attempting to define ' + '`%s` on your component more than once. This conflict may be due ' + 'to a mixin.', name) : invariant(false) : void 0;
5259 * Mixin helper which handles policy validation and reserved
5260 * specification keys when building React classes.
5262 function mixSpecIntoComponent(Constructor, spec) {
5267 !(typeof spec !== 'function') ? "development" !== 'production' ? invariant(false, 'ReactClass: You\'re attempting to ' + 'use a component class or function as a mixin. Instead, just use a ' + 'regular object.') : invariant(false) : void 0;
5268 !!ReactElement.isValidElement(spec) ? "development" !== 'production' ? invariant(false, 'ReactClass: You\'re attempting to ' + 'use a component as a mixin. Instead, just use a regular object.') : invariant(false) : void 0;
5270 var proto = Constructor.prototype;
5271 var autoBindPairs = proto.__reactAutoBindPairs;
5273 // By handling mixins before any other properties, we ensure the same
5274 // chaining order is applied to methods with DEFINE_MANY policy, whether
5275 // mixins are listed before or after these methods in the spec.
5276 if (spec.hasOwnProperty(MIXINS_KEY)) {
5277 RESERVED_SPEC_KEYS.mixins(Constructor, spec.mixins);
5280 for (var name in spec) {
5281 if (!spec.hasOwnProperty(name)) {
5285 if (name === MIXINS_KEY) {
5286 // We have already handled mixins in a special case above.
5290 var property = spec[name];
5291 var isAlreadyDefined = proto.hasOwnProperty(name);
5292 validateMethodOverride(isAlreadyDefined, name);
5294 if (RESERVED_SPEC_KEYS.hasOwnProperty(name)) {
5295 RESERVED_SPEC_KEYS[name](Constructor, property);
5297 // Setup methods on prototype:
5298 // The following member methods should not be automatically bound:
5299 // 1. Expected ReactClass methods (in the "interface").
5300 // 2. Overridden methods (that were mixed in).
5301 var isReactClassMethod = ReactClassInterface.hasOwnProperty(name);
5302 var isFunction = typeof property === 'function';
5303 var shouldAutoBind = isFunction && !isReactClassMethod && !isAlreadyDefined && spec.autobind !== false;
5305 if (shouldAutoBind) {
5306 autoBindPairs.push(name, property);
5307 proto[name] = property;
5309 if (isAlreadyDefined) {
5310 var specPolicy = ReactClassInterface[name];
5312 // These cases should already be caught by validateMethodOverride.
5313 !(isReactClassMethod && (specPolicy === SpecPolicy.DEFINE_MANY_MERGED || specPolicy === SpecPolicy.DEFINE_MANY)) ? "development" !== 'production' ? invariant(false, 'ReactClass: Unexpected spec policy %s for key %s ' + 'when mixing in component specs.', specPolicy, name) : invariant(false) : void 0;
5315 // For methods which are defined more than once, call the existing
5316 // methods before calling the new property, merging if appropriate.
5317 if (specPolicy === SpecPolicy.DEFINE_MANY_MERGED) {
5318 proto[name] = createMergedResultFunction(proto[name], property);
5319 } else if (specPolicy === SpecPolicy.DEFINE_MANY) {
5320 proto[name] = createChainedFunction(proto[name], property);
5323 proto[name] = property;
5324 if ("development" !== 'production') {
5325 // Add verbose displayName to the function, which helps when looking
5326 // at profiling tools.
5327 if (typeof property === 'function' && spec.displayName) {
5328 proto[name].displayName = spec.displayName + '_' + name;
5337 function mixStaticSpecIntoComponent(Constructor, statics) {
5341 for (var name in statics) {
5342 var property = statics[name];
5343 if (!statics.hasOwnProperty(name)) {
5347 var isReserved = name in RESERVED_SPEC_KEYS;
5348 !!isReserved ? "development" !== 'production' ? invariant(false, 'ReactClass: You are attempting to define a reserved ' + 'property, `%s`, that shouldn\'t be on the "statics" key. Define it ' + 'as an instance property instead; it will still be accessible on the ' + 'constructor.', name) : invariant(false) : void 0;
5350 var isInherited = name in Constructor;
5351 !!isInherited ? "development" !== 'production' ? invariant(false, 'ReactClass: You are attempting to define ' + '`%s` on your component more than once. This conflict may be ' + 'due to a mixin.', name) : invariant(false) : void 0;
5352 Constructor[name] = property;
5357 * Merge two objects, but throw if both contain the same key.
5359 * @param {object} one The first object, which is mutated.
5360 * @param {object} two The second object
5361 * @return {object} one after it has been mutated to contain everything in two.
5363 function mergeIntoWithNoDuplicateKeys(one, two) {
5364 !(one && two && typeof one === 'object' && typeof two === 'object') ? "development" !== 'production' ? invariant(false, 'mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects.') : invariant(false) : void 0;
5366 for (var key in two) {
5367 if (two.hasOwnProperty(key)) {
5368 !(one[key] === undefined) ? "development" !== 'production' ? invariant(false, 'mergeIntoWithNoDuplicateKeys(): ' + 'Tried to merge two objects with the same key: `%s`. This conflict ' + 'may be due to a mixin; in particular, this may be caused by two ' + 'getInitialState() or getDefaultProps() methods returning objects ' + 'with clashing keys.', key) : invariant(false) : void 0;
5369 one[key] = two[key];
5376 * Creates a function that invokes two functions and merges their return values.
5378 * @param {function} one Function to invoke first.
5379 * @param {function} two Function to invoke second.
5380 * @return {function} Function that invokes the two argument functions.
5383 function createMergedResultFunction(one, two) {
5384 return function mergedResult() {
5385 var a = one.apply(this, arguments);
5386 var b = two.apply(this, arguments);
5389 } else if (b == null) {
5393 mergeIntoWithNoDuplicateKeys(c, a);
5394 mergeIntoWithNoDuplicateKeys(c, b);
5400 * Creates a function that invokes two functions and ignores their return vales.
5402 * @param {function} one Function to invoke first.
5403 * @param {function} two Function to invoke second.
5404 * @return {function} Function that invokes the two argument functions.
5407 function createChainedFunction(one, two) {
5408 return function chainedFunction() {
5409 one.apply(this, arguments);
5410 two.apply(this, arguments);
5415 * Binds a method to the component.
5417 * @param {object} component Component whose method is going to be bound.
5418 * @param {function} method Method to be bound.
5419 * @return {function} The bound method.
5421 function bindAutoBindMethod(component, method) {
5422 var boundMethod = method.bind(component);
5423 if ("development" !== 'production') {
5424 boundMethod.__reactBoundContext = component;
5425 boundMethod.__reactBoundMethod = method;
5426 boundMethod.__reactBoundArguments = null;
5427 var componentName = component.constructor.displayName;
5428 var _bind = boundMethod.bind;
5429 boundMethod.bind = function (newThis) {
5430 for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
5431 args[_key - 1] = arguments[_key];
5434 // User is trying to bind() an autobound method; we effectively will
5435 // ignore the value of "this" that the user is trying to use, so
5437 if (newThis !== component && newThis !== null) {
5438 "development" !== 'production' ? warning(false, 'bind(): React component methods may only be bound to the ' + 'component instance. See %s', componentName) : void 0;
5439 } else if (!args.length) {
5440 "development" !== 'production' ? warning(false, 'bind(): You are binding a component method to the component. ' + 'React does this for you automatically in a high-performance ' + 'way, so you can safely remove this call. See %s', componentName) : void 0;
5443 var reboundMethod = _bind.apply(boundMethod, arguments);
5444 reboundMethod.__reactBoundContext = component;
5445 reboundMethod.__reactBoundMethod = method;
5446 reboundMethod.__reactBoundArguments = args;
5447 return reboundMethod;
5454 * Binds all auto-bound methods in a component.
5456 * @param {object} component Component whose method is going to be bound.
5458 function bindAutoBindMethods(component) {
5459 var pairs = component.__reactAutoBindPairs;
5460 for (var i = 0; i < pairs.length; i += 2) {
5461 var autoBindKey = pairs[i];
5462 var method = pairs[i + 1];
5463 component[autoBindKey] = bindAutoBindMethod(component, method);
5468 * Add more to the ReactClass base class. These are all legacy features and
5469 * therefore not already part of the modern ReactComponent.
5471 var ReactClassMixin = {
5474 * TODO: This will be deprecated because state should always keep a consistent
5475 * type signature and the only use case for this, is to avoid that.
5477 replaceState: function (newState, callback) {
5478 this.updater.enqueueReplaceState(this, newState);
5480 this.updater.enqueueCallback(this, callback, 'replaceState');
5485 * Checks whether or not this composite component is mounted.
5486 * @return {boolean} True if mounted, false otherwise.
5490 isMounted: function () {
5491 return this.updater.isMounted(this);
5495 var ReactClassComponent = function () {};
5496 _assign(ReactClassComponent.prototype, ReactComponent.prototype, ReactClassMixin);
5499 * Module for creating composite components.
5506 * Creates a composite component class given a class specification.
5507 * See https://facebook.github.io/react/docs/top-level-api.html#react.createclass
5509 * @param {object} spec Class specification (which must define `render`).
5510 * @return {function} Component constructor function.
5513 createClass: function (spec) {
5514 var Constructor = function (props, context, updater) {
5515 // This constructor gets overridden by mocks. The argument is used
5516 // by mocks to assert on what gets mounted.
5518 if ("development" !== 'production') {
5519 "development" !== 'production' ? warning(this instanceof Constructor, 'Something is calling a React component directly. Use a factory or ' + 'JSX instead. See: https://fb.me/react-legacyfactory') : void 0;
5522 // Wire up auto-binding
5523 if (this.__reactAutoBindPairs.length) {
5524 bindAutoBindMethods(this);
5528 this.context = context;
5529 this.refs = emptyObject;
5530 this.updater = updater || ReactNoopUpdateQueue;
5534 // ReactClasses doesn't have constructors. Instead, they use the
5535 // getInitialState and componentWillMount methods for initialization.
5537 var initialState = this.getInitialState ? this.getInitialState() : null;
5538 if ("development" !== 'production') {
5539 // We allow auto-mocks to proceed as if they're returning null.
5540 if (initialState === undefined && this.getInitialState._isMockFunction) {
5541 // This is probably bad practice. Consider warning here and
5542 // deprecating this convenience.
5543 initialState = null;
5546 !(typeof initialState === 'object' && !Array.isArray(initialState)) ? "development" !== 'production' ? invariant(false, '%s.getInitialState(): must return an object or null', Constructor.displayName || 'ReactCompositeComponent') : invariant(false) : void 0;
5548 this.state = initialState;
5550 Constructor.prototype = new ReactClassComponent();
5551 Constructor.prototype.constructor = Constructor;
5552 Constructor.prototype.__reactAutoBindPairs = [];
5554 injectedMixins.forEach(mixSpecIntoComponent.bind(null, Constructor));
5556 mixSpecIntoComponent(Constructor, spec);
5558 // Initialize the defaultProps property after all mixins have been merged.
5559 if (Constructor.getDefaultProps) {
5560 Constructor.defaultProps = Constructor.getDefaultProps();
5563 if ("development" !== 'production') {
5564 // This is a tag to indicate that the use of these method names is ok,
5565 // since it's used with createClass. If it's not, then it's likely a
5566 // mistake so we'll warn you to use the static property, property
5567 // initializer or constructor respectively.
5568 if (Constructor.getDefaultProps) {
5569 Constructor.getDefaultProps.isReactClassApproved = {};
5571 if (Constructor.prototype.getInitialState) {
5572 Constructor.prototype.getInitialState.isReactClassApproved = {};
5576 !Constructor.prototype.render ? "development" !== 'production' ? invariant(false, 'createClass(...): Class specification must implement a `render` method.') : invariant(false) : void 0;
5578 if ("development" !== 'production') {
5579 "development" !== 'production' ? warning(!Constructor.prototype.componentShouldUpdate, '%s has a method called ' + 'componentShouldUpdate(). Did you mean shouldComponentUpdate()? ' + 'The name is phrased as a question because the function is ' + 'expected to return a value.', spec.displayName || 'A component') : void 0;
5580 "development" !== 'production' ? warning(!Constructor.prototype.componentWillRecieveProps, '%s has a method called ' + 'componentWillRecieveProps(). Did you mean componentWillReceiveProps()?', spec.displayName || 'A component') : void 0;
5583 // Reduce time spent doing lookups by setting these on the prototype.
5584 for (var methodName in ReactClassInterface) {
5585 if (!Constructor.prototype[methodName]) {
5586 Constructor.prototype[methodName] = null;
5594 injectMixin: function (mixin) {
5595 injectedMixins.push(mixin);
5601 module.exports = ReactClass;
5602 },{"166":166,"173":173,"176":176,"177":177,"183":183,"184":184,"34":34,"65":65,"86":86,"89":89,"90":90}],34:[function(_dereq_,module,exports){
5604 * Copyright 2013-present, Facebook, Inc.
5605 * All rights reserved.
5607 * This source code is licensed under the BSD-style license found in the
5608 * LICENSE file in the root directory of this source tree. An additional grant
5609 * of patent rights can be found in the PATENTS file in the same directory.
5611 * @providesModule ReactComponent
5616 var ReactNoopUpdateQueue = _dereq_(86);
5617 var ReactInstrumentation = _dereq_(76);
5619 var canDefineProperty = _dereq_(128);
5620 var emptyObject = _dereq_(166);
5621 var invariant = _dereq_(173);
5622 var warning = _dereq_(183);
5625 * Base class helpers for the updating state of a component.
5627 function ReactComponent(props, context, updater) {
5629 this.context = context;
5630 this.refs = emptyObject;
5631 // We initialize the default updater but the real one gets injected by the
5633 this.updater = updater || ReactNoopUpdateQueue;
5636 ReactComponent.prototype.isReactComponent = {};
5639 * Sets a subset of the state. Always use this to mutate
5640 * state. You should treat `this.state` as immutable.
5642 * There is no guarantee that `this.state` will be immediately updated, so
5643 * accessing `this.state` after calling this method may return the old value.
5645 * There is no guarantee that calls to `setState` will run synchronously,
5646 * as they may eventually be batched together. You can provide an optional
5647 * callback that will be executed when the call to setState is actually
5650 * When a function is provided to setState, it will be called at some point in
5651 * the future (not synchronously). It will be called with the up to date
5652 * component arguments (state, props, context). These values can be different
5653 * from this.* because your function may be called after receiveProps but before
5654 * shouldComponentUpdate, and this new state, props, and context will not yet be
5657 * @param {object|function} partialState Next partial state or function to
5658 * produce next partial state to be merged with current state.
5659 * @param {?function} callback Called after state is updated.
5663 ReactComponent.prototype.setState = function (partialState, callback) {
5664 !(typeof partialState === 'object' || typeof partialState === 'function' || partialState == null) ? "development" !== 'production' ? invariant(false, 'setState(...): takes an object of state variables to update or a ' + 'function which returns an object of state variables.') : invariant(false) : void 0;
5665 if ("development" !== 'production') {
5666 ReactInstrumentation.debugTool.onSetState();
5667 "development" !== 'production' ? warning(partialState != null, 'setState(...): You passed an undefined or null state object; ' + 'instead, use forceUpdate().') : void 0;
5669 this.updater.enqueueSetState(this, partialState);
5671 this.updater.enqueueCallback(this, callback, 'setState');
5676 * Forces an update. This should only be invoked when it is known with
5677 * certainty that we are **not** in a DOM transaction.
5679 * You may want to call this when you know that some deeper aspect of the
5680 * component's state has changed but `setState` was not called.
5682 * This will not invoke `shouldComponentUpdate`, but it will invoke
5683 * `componentWillUpdate` and `componentDidUpdate`.
5685 * @param {?function} callback Called after update is complete.
5689 ReactComponent.prototype.forceUpdate = function (callback) {
5690 this.updater.enqueueForceUpdate(this);
5692 this.updater.enqueueCallback(this, callback, 'forceUpdate');
5697 * Deprecated APIs. These APIs used to exist on classic React classes but since
5698 * we would like to deprecate them, we're not going to move them over to this
5699 * modern base class. Instead, we define a getter that warns if it's accessed.
5701 if ("development" !== 'production') {
5702 var deprecatedAPIs = {
5703 isMounted: ['isMounted', 'Instead, make sure to clean up subscriptions and pending requests in ' + 'componentWillUnmount to prevent memory leaks.'],
5704 replaceState: ['replaceState', 'Refactor your code to use setState instead (see ' + 'https://github.com/facebook/react/issues/3236).']
5706 var defineDeprecationWarning = function (methodName, info) {
5707 if (canDefineProperty) {
5708 Object.defineProperty(ReactComponent.prototype, methodName, {
5710 "development" !== 'production' ? warning(false, '%s(...) is deprecated in plain JavaScript React classes. %s', info[0], info[1]) : void 0;
5716 for (var fnName in deprecatedAPIs) {
5717 if (deprecatedAPIs.hasOwnProperty(fnName)) {
5718 defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);
5723 module.exports = ReactComponent;
5724 },{"128":128,"166":166,"173":173,"183":183,"76":76,"86":86}],35:[function(_dereq_,module,exports){
5726 * Copyright 2013-present, Facebook, Inc.
5727 * All rights reserved.
5729 * This source code is licensed under the BSD-style license found in the
5730 * LICENSE file in the root directory of this source tree. An additional grant
5731 * of patent rights can be found in the PATENTS file in the same directory.
5733 * @providesModule ReactComponentBrowserEnvironment
5738 var DOMChildrenOperations = _dereq_(7);
5739 var ReactDOMIDOperations = _dereq_(51);
5742 * Abstracts away all functionality of the reconciler that requires knowledge of
5743 * the browser context. TODO: These callers should be refactored to avoid the
5744 * need for this injection.
5746 var ReactComponentBrowserEnvironment = {
5748 processChildrenUpdates: ReactDOMIDOperations.dangerouslyProcessChildrenUpdates,
5750 replaceNodeWithMarkup: DOMChildrenOperations.dangerouslyReplaceNodeWithMarkup,
5753 * If a particular environment requires that some resources be cleaned up,
5754 * specify this in the injected Mixin. In the DOM, we would likely want to
5755 * purge any cached node ID lookups.
5759 unmountIDFromEnvironment: function (rootNodeID) {}
5763 module.exports = ReactComponentBrowserEnvironment;
5764 },{"51":51,"7":7}],36:[function(_dereq_,module,exports){
5766 * Copyright 2014-present, Facebook, Inc.
5767 * All rights reserved.
5769 * This source code is licensed under the BSD-style license found in the
5770 * LICENSE file in the root directory of this source tree. An additional grant
5771 * of patent rights can be found in the PATENTS file in the same directory.
5773 * @providesModule ReactComponentEnvironment
5778 var invariant = _dereq_(173);
5780 var injected = false;
5782 var ReactComponentEnvironment = {
5785 * Optionally injectable environment dependent cleanup hook. (server vs.
5786 * browser etc). Example: A browser system caches DOM nodes based on component
5787 * ID and must remove that cache entry when this instance is unmounted.
5789 unmountIDFromEnvironment: null,
5792 * Optionally injectable hook for swapping out mount images in the middle of
5795 replaceNodeWithMarkup: null,
5798 * Optionally injectable hook for processing a queue of child updates. Will
5799 * later move into MultiChildComponents.
5801 processChildrenUpdates: null,
5804 injectEnvironment: function (environment) {
5805 !!injected ? "development" !== 'production' ? invariant(false, 'ReactCompositeComponent: injectEnvironment() can only be called once.') : invariant(false) : void 0;
5806 ReactComponentEnvironment.unmountIDFromEnvironment = environment.unmountIDFromEnvironment;
5807 ReactComponentEnvironment.replaceNodeWithMarkup = environment.replaceNodeWithMarkup;
5808 ReactComponentEnvironment.processChildrenUpdates = environment.processChildrenUpdates;
5815 module.exports = ReactComponentEnvironment;
5816 },{"173":173}],37:[function(_dereq_,module,exports){
5818 * Copyright 2016-present, Facebook, Inc.
5819 * All rights reserved.
5821 * This source code is licensed under the BSD-style license found in the
5822 * LICENSE file in the root directory of this source tree. An additional grant
5823 * of patent rights can be found in the PATENTS file in the same directory.
5825 * @providesModule ReactComponentTreeDevtool
5830 var invariant = _dereq_(173);
5835 function updateTree(id, update) {
5842 displayName: 'Unknown',
5850 function purgeDeep(id) {
5851 var item = tree[id];
5853 var childIDs = item.childIDs;
5856 childIDs.forEach(purgeDeep);
5860 var ReactComponentTreeDevtool = {
5861 onSetDisplayName: function (id, displayName) {
5862 updateTree(id, function (item) {
5863 return item.displayName = displayName;
5866 onSetChildren: function (id, nextChildIDs) {
5867 updateTree(id, function (item) {
5868 var prevChildIDs = item.childIDs;
5869 item.childIDs = nextChildIDs;
5871 nextChildIDs.forEach(function (nextChildID) {
5872 var nextChild = tree[nextChildID];
5873 !nextChild ? "development" !== 'production' ? invariant(false, 'Expected devtool events to fire for the child ' + 'before its parent includes it in onSetChildren().') : invariant(false) : void 0;
5874 !(nextChild.displayName != null) ? "development" !== 'production' ? invariant(false, 'Expected onSetDisplayName() to fire for the child ' + 'before its parent includes it in onSetChildren().') : invariant(false) : void 0;
5875 !(nextChild.childIDs != null || nextChild.text != null) ? "development" !== 'production' ? invariant(false, 'Expected onSetChildren() or onSetText() to fire for the child ' + 'before its parent includes it in onSetChildren().') : invariant(false) : void 0;
5876 !nextChild.isMounted ? "development" !== 'production' ? invariant(false, 'Expected onMountComponent() to fire for the child ' + 'before its parent includes it in onSetChildren().') : invariant(false) : void 0;
5878 if (prevChildIDs.indexOf(nextChildID) === -1) {
5879 nextChild.parentID = id;
5884 onSetOwner: function (id, ownerID) {
5885 updateTree(id, function (item) {
5886 return item.ownerID = ownerID;
5889 onSetText: function (id, text) {
5890 updateTree(id, function (item) {
5891 return item.text = text;
5894 onMountComponent: function (id) {
5895 updateTree(id, function (item) {
5896 return item.isMounted = true;
5899 onMountRootComponent: function (id) {
5902 onUpdateComponent: function (id) {
5903 updateTree(id, function (item) {
5904 return item.updateCount++;
5907 onUnmountComponent: function (id) {
5908 updateTree(id, function (item) {
5909 return item.isMounted = false;
5911 rootIDs = rootIDs.filter(function (rootID) {
5912 return rootID !== id;
5915 purgeUnmountedComponents: function () {
5916 if (ReactComponentTreeDevtool._preventPurging) {
5917 // Should only be used for testing.
5921 Object.keys(tree).filter(function (id) {
5922 return !tree[id].isMounted;
5923 }).forEach(purgeDeep);
5925 isMounted: function (id) {
5926 var item = tree[id];
5927 return item ? item.isMounted : false;
5929 getChildIDs: function (id) {
5930 var item = tree[id];
5931 return item ? item.childIDs : [];
5933 getDisplayName: function (id) {
5934 var item = tree[id];
5935 return item ? item.displayName : 'Unknown';
5937 getOwnerID: function (id) {
5938 var item = tree[id];
5939 return item ? item.ownerID : null;
5941 getParentID: function (id) {
5942 var item = tree[id];
5943 return item ? item.parentID : null;
5945 getText: function (id) {
5946 var item = tree[id];
5947 return item ? item.text : null;
5949 getUpdateCount: function (id) {
5950 var item = tree[id];
5951 return item ? item.updateCount : 0;
5953 getRootIDs: function () {
5956 getRegisteredIDs: function () {
5957 return Object.keys(tree);
5961 module.exports = ReactComponentTreeDevtool;
5962 },{"173":173}],38:[function(_dereq_,module,exports){
5964 * Copyright 2013-present, Facebook, Inc.
5965 * All rights reserved.
5967 * This source code is licensed under the BSD-style license found in the
5968 * LICENSE file in the root directory of this source tree. An additional grant
5969 * of patent rights can be found in the PATENTS file in the same directory.
5971 * @providesModule ReactComponentWithPureRenderMixin
5976 var shallowCompare = _dereq_(152);
5979 * If your React component's render function is "pure", e.g. it will render the
5980 * same result given the same props and state, provide this mixin for a
5981 * considerable performance boost.
5983 * Most React components have pure render functions.
5987 * var ReactComponentWithPureRenderMixin =
5988 * require('ReactComponentWithPureRenderMixin');
5989 * React.createClass({
5990 * mixins: [ReactComponentWithPureRenderMixin],
5992 * render: function() {
5993 * return <div className={this.props.className}>foo</div>;
5997 * Note: This only checks shallow equality for props and state. If these contain
5998 * complex data structures this mixin may have false-negatives for deeper
5999 * differences. Only mixin to components which have simple props and state, or
6000 * use `forceUpdate()` when you know deep data structures have changed.
6002 * See https://facebook.github.io/react/docs/pure-render-mixin.html
6004 var ReactComponentWithPureRenderMixin = {
6005 shouldComponentUpdate: function (nextProps, nextState) {
6006 return shallowCompare(this, nextProps, nextState);
6010 module.exports = ReactComponentWithPureRenderMixin;
6011 },{"152":152}],39:[function(_dereq_,module,exports){
6013 * Copyright 2013-present, Facebook, Inc.
6014 * All rights reserved.
6016 * This source code is licensed under the BSD-style license found in the
6017 * LICENSE file in the root directory of this source tree. An additional grant
6018 * of patent rights can be found in the PATENTS file in the same directory.
6020 * @providesModule ReactCompositeComponent
6025 var _assign = _dereq_(184);
6027 var ReactComponentEnvironment = _dereq_(36);
6028 var ReactCurrentOwner = _dereq_(40);
6029 var ReactElement = _dereq_(65);
6030 var ReactErrorUtils = _dereq_(68);
6031 var ReactInstanceMap = _dereq_(75);
6032 var ReactInstrumentation = _dereq_(76);
6033 var ReactNodeTypes = _dereq_(85);
6034 var ReactPropTypeLocations = _dereq_(90);
6035 var ReactPropTypeLocationNames = _dereq_(89);
6036 var ReactReconciler = _dereq_(93);
6037 var ReactUpdateQueue = _dereq_(103);
6039 var emptyObject = _dereq_(166);
6040 var invariant = _dereq_(173);
6041 var shouldUpdateReactComponent = _dereq_(153);
6042 var warning = _dereq_(183);
6044 function getDeclarationErrorAddendum(component) {
6045 var owner = component._currentElement._owner || null;
6047 var name = owner.getName();
6049 return ' Check the render method of `' + name + '`.';
6055 function StatelessComponent(Component) {}
6056 StatelessComponent.prototype.render = function () {
6057 var Component = ReactInstanceMap.get(this)._currentElement.type;
6058 var element = Component(this.props, this.context, this.updater);
6059 warnIfInvalidElement(Component, element);
6063 function warnIfInvalidElement(Component, element) {
6064 if ("development" !== 'production') {
6065 "development" !== 'production' ? warning(element === null || element === false || ReactElement.isValidElement(element), '%s(...): A valid React element (or null) must be returned. You may have ' + 'returned undefined, an array or some other invalid object.', Component.displayName || Component.name || 'Component') : void 0;
6069 function invokeComponentDidMountWithTimer() {
6070 var publicInstance = this._instance;
6071 if (this._debugID !== 0) {
6072 ReactInstrumentation.debugTool.onBeginLifeCycleTimer(this._debugID, 'componentDidMount');
6074 publicInstance.componentDidMount();
6075 if (this._debugID !== 0) {
6076 ReactInstrumentation.debugTool.onEndLifeCycleTimer(this._debugID, 'componentDidMount');
6080 function invokeComponentDidUpdateWithTimer(prevProps, prevState, prevContext) {
6081 var publicInstance = this._instance;
6082 if (this._debugID !== 0) {
6083 ReactInstrumentation.debugTool.onBeginLifeCycleTimer(this._debugID, 'componentDidUpdate');
6085 publicInstance.componentDidUpdate(prevProps, prevState, prevContext);
6086 if (this._debugID !== 0) {
6087 ReactInstrumentation.debugTool.onEndLifeCycleTimer(this._debugID, 'componentDidUpdate');
6091 function shouldConstruct(Component) {
6092 return Component.prototype && Component.prototype.isReactComponent;
6096 * ------------------ The Life-Cycle of a Composite Component ------------------
6098 * - constructor: Initialization of state. The instance is now retained.
6099 * - componentWillMount
6101 * - [children's constructors]
6102 * - [children's componentWillMount and render]
6103 * - [children's componentDidMount]
6104 * - componentDidMount
6107 * - componentWillReceiveProps (only called if parent updated)
6108 * - shouldComponentUpdate
6109 * - componentWillUpdate
6111 * - [children's constructors or receive props phases]
6112 * - componentDidUpdate
6114 * - componentWillUnmount
6115 * - [children's componentWillUnmount]
6116 * - [children destroyed]
6117 * - (destroyed): The instance is now blank, released by React and ready for GC.
6119 * -----------------------------------------------------------------------------
6123 * An incrementing ID assigned to each component when it is mounted. This is
6124 * used to enforce the order in which `ReactUpdates` updates dirty components.
6128 var nextMountID = 1;
6131 * @lends {ReactCompositeComponent.prototype}
6133 var ReactCompositeComponentMixin = {
6136 * Base constructor for all composite component.
6138 * @param {ReactElement} element
6142 construct: function (element) {
6143 this._currentElement = element;
6144 this._rootNodeID = null;
6145 this._instance = null;
6146 this._nativeParent = null;
6147 this._nativeContainerInfo = null;
6149 // See ReactUpdateQueue
6150 this._updateBatchNumber = null;
6151 this._pendingElement = null;
6152 this._pendingStateQueue = null;
6153 this._pendingReplaceState = false;
6154 this._pendingForceUpdate = false;
6156 this._renderedNodeType = null;
6157 this._renderedComponent = null;
6158 this._context = null;
6159 this._mountOrder = 0;
6160 this._topLevelWrapper = null;
6162 // See ReactUpdates and ReactUpdateQueue.
6163 this._pendingCallbacks = null;
6165 // ComponentWillUnmount shall only be called once
6166 this._calledComponentWillUnmount = false;
6170 * Initializes the component, renders markup, and registers event listeners.
6172 * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
6173 * @param {?object} nativeParent
6174 * @param {?object} nativeContainerInfo
6175 * @param {?object} context
6176 * @return {?string} Rendered markup to be inserted into the DOM.
6180 mountComponent: function (transaction, nativeParent, nativeContainerInfo, context) {
6181 this._context = context;
6182 this._mountOrder = nextMountID++;
6183 this._nativeParent = nativeParent;
6184 this._nativeContainerInfo = nativeContainerInfo;
6186 var publicProps = this._processProps(this._currentElement.props);
6187 var publicContext = this._processContext(context);
6189 var Component = this._currentElement.type;
6191 // Initialize the public class
6192 var inst = this._constructComponent(publicProps, publicContext);
6193 var renderedElement;
6195 // Support functional components
6196 if (!shouldConstruct(Component) && (inst == null || inst.render == null)) {
6197 renderedElement = inst;
6198 warnIfInvalidElement(Component, renderedElement);
6199 !(inst === null || inst === false || ReactElement.isValidElement(inst)) ? "development" !== 'production' ? invariant(false, '%s(...): A valid React element (or null) must be returned. You may have ' + 'returned undefined, an array or some other invalid object.', Component.displayName || Component.name || 'Component') : invariant(false) : void 0;
6200 inst = new StatelessComponent(Component);
6203 if ("development" !== 'production') {
6204 // This will throw later in _renderValidatedComponent, but add an early
6205 // warning now to help debugging
6206 if (inst.render == null) {
6207 "development" !== 'production' ? warning(false, '%s(...): No `render` method found on the returned component ' + 'instance: you may have forgotten to define `render`.', Component.displayName || Component.name || 'Component') : void 0;
6210 var propsMutated = inst.props !== publicProps;
6211 var componentName = Component.displayName || Component.name || 'Component';
6213 "development" !== 'production' ? warning(inst.props === undefined || !propsMutated, '%s(...): When calling super() in `%s`, make sure to pass ' + 'up the same props that your component\'s constructor was passed.', componentName, componentName) : void 0;
6216 // These should be set up in the constructor, but as a convenience for
6217 // simpler class abstractions, we set them up after the fact.
6218 inst.props = publicProps;
6219 inst.context = publicContext;
6220 inst.refs = emptyObject;
6221 inst.updater = ReactUpdateQueue;
6223 this._instance = inst;
6225 // Store a reference from the instance back to the internal representation
6226 ReactInstanceMap.set(inst, this);
6228 if ("development" !== 'production') {
6229 // Since plain JS classes are defined without any special initialization
6230 // logic, we can not catch common errors early. Therefore, we have to
6231 // catch them here, at initialization time, instead.
6232 "development" !== 'production' ? warning(!inst.getInitialState || inst.getInitialState.isReactClassApproved, 'getInitialState was defined on %s, a plain JavaScript class. ' + 'This is only supported for classes created using React.createClass. ' + 'Did you mean to define a state property instead?', this.getName() || 'a component') : void 0;
6233 "development" !== 'production' ? warning(!inst.getDefaultProps || inst.getDefaultProps.isReactClassApproved, 'getDefaultProps was defined on %s, a plain JavaScript class. ' + 'This is only supported for classes created using React.createClass. ' + 'Use a static property to define defaultProps instead.', this.getName() || 'a component') : void 0;
6234 "development" !== 'production' ? warning(!inst.propTypes, 'propTypes was defined as an instance property on %s. Use a static ' + 'property to define propTypes instead.', this.getName() || 'a component') : void 0;
6235 "development" !== 'production' ? warning(!inst.contextTypes, 'contextTypes was defined as an instance property on %s. Use a ' + 'static property to define contextTypes instead.', this.getName() || 'a component') : void 0;
6236 "development" !== 'production' ? warning(typeof inst.componentShouldUpdate !== 'function', '%s has a method called ' + 'componentShouldUpdate(). Did you mean shouldComponentUpdate()? ' + 'The name is phrased as a question because the function is ' + 'expected to return a value.', this.getName() || 'A component') : void 0;
6237 "development" !== 'production' ? warning(typeof inst.componentDidUnmount !== 'function', '%s has a method called ' + 'componentDidUnmount(). But there is no such lifecycle method. ' + 'Did you mean componentWillUnmount()?', this.getName() || 'A component') : void 0;
6238 "development" !== 'production' ? warning(typeof inst.componentWillRecieveProps !== 'function', '%s has a method called ' + 'componentWillRecieveProps(). Did you mean componentWillReceiveProps()?', this.getName() || 'A component') : void 0;
6241 var initialState = inst.state;
6242 if (initialState === undefined) {
6243 inst.state = initialState = null;
6245 !(typeof initialState === 'object' && !Array.isArray(initialState)) ? "development" !== 'production' ? invariant(false, '%s.state: must be set to an object or null', this.getName() || 'ReactCompositeComponent') : invariant(false) : void 0;
6247 this._pendingStateQueue = null;
6248 this._pendingReplaceState = false;
6249 this._pendingForceUpdate = false;
6252 if (inst.unstable_handleError) {
6253 markup = this.performInitialMountWithErrorHandling(renderedElement, nativeParent, nativeContainerInfo, transaction, context);
6255 markup = this.performInitialMount(renderedElement, nativeParent, nativeContainerInfo, transaction, context);
6258 if (inst.componentDidMount) {
6259 if ("development" !== 'production') {
6260 transaction.getReactMountReady().enqueue(invokeComponentDidMountWithTimer, this);
6262 transaction.getReactMountReady().enqueue(inst.componentDidMount, inst);
6269 _constructComponent: function (publicProps, publicContext) {
6270 if ("development" !== 'production') {
6271 ReactCurrentOwner.current = this;
6273 return this._constructComponentWithoutOwner(publicProps, publicContext);
6275 ReactCurrentOwner.current = null;
6278 return this._constructComponentWithoutOwner(publicProps, publicContext);
6282 _constructComponentWithoutOwner: function (publicProps, publicContext) {
6283 var Component = this._currentElement.type;
6284 var instanceOrElement;
6285 if (shouldConstruct(Component)) {
6286 if ("development" !== 'production') {
6287 if (this._debugID !== 0) {
6288 ReactInstrumentation.debugTool.onBeginLifeCycleTimer(this._debugID, 'ctor');
6291 instanceOrElement = new Component(publicProps, publicContext, ReactUpdateQueue);
6292 if ("development" !== 'production') {
6293 if (this._debugID !== 0) {
6294 ReactInstrumentation.debugTool.onEndLifeCycleTimer(this._debugID, 'ctor');
6298 // This can still be an instance in case of factory components
6299 // but we'll count this as time spent rendering as the more common case.
6300 if ("development" !== 'production') {
6301 if (this._debugID !== 0) {
6302 ReactInstrumentation.debugTool.onBeginLifeCycleTimer(this._debugID, 'render');
6305 instanceOrElement = Component(publicProps, publicContext, ReactUpdateQueue);
6306 if ("development" !== 'production') {
6307 if (this._debugID !== 0) {
6308 ReactInstrumentation.debugTool.onEndLifeCycleTimer(this._debugID, 'render');
6312 return instanceOrElement;
6315 performInitialMountWithErrorHandling: function (renderedElement, nativeParent, nativeContainerInfo, transaction, context) {
6317 var checkpoint = transaction.checkpoint();
6319 markup = this.performInitialMount(renderedElement, nativeParent, nativeContainerInfo, transaction, context);
6321 // Roll back to checkpoint, handle error (which may add items to the transaction), and take a new checkpoint
6322 transaction.rollback(checkpoint);
6323 this._instance.unstable_handleError(e);
6324 if (this._pendingStateQueue) {
6325 this._instance.state = this._processPendingState(this._instance.props, this._instance.context);
6327 checkpoint = transaction.checkpoint();
6329 this._renderedComponent.unmountComponent(true);
6330 transaction.rollback(checkpoint);
6332 // Try again - we've informed the component about the error, so they can render an error message this time.
6333 // If this throws again, the error will bubble up (and can be caught by a higher error boundary).
6334 markup = this.performInitialMount(renderedElement, nativeParent, nativeContainerInfo, transaction, context);
6339 performInitialMount: function (renderedElement, nativeParent, nativeContainerInfo, transaction, context) {
6340 var inst = this._instance;
6341 if (inst.componentWillMount) {
6342 if ("development" !== 'production') {
6343 if (this._debugID !== 0) {
6344 ReactInstrumentation.debugTool.onBeginLifeCycleTimer(this._debugID, 'componentWillMount');
6347 inst.componentWillMount();
6348 if ("development" !== 'production') {
6349 if (this._debugID !== 0) {
6350 ReactInstrumentation.debugTool.onEndLifeCycleTimer(this._debugID, 'componentWillMount');
6353 // When mounting, calls to `setState` by `componentWillMount` will set
6354 // `this._pendingStateQueue` without triggering a re-render.
6355 if (this._pendingStateQueue) {
6356 inst.state = this._processPendingState(inst.props, inst.context);
6360 // If not a stateless component, we now render
6361 if (renderedElement === undefined) {
6362 renderedElement = this._renderValidatedComponent();
6365 this._renderedNodeType = ReactNodeTypes.getType(renderedElement);
6366 this._renderedComponent = this._instantiateReactComponent(renderedElement);
6368 var markup = ReactReconciler.mountComponent(this._renderedComponent, transaction, nativeParent, nativeContainerInfo, this._processChildContext(context));
6370 if ("development" !== 'production') {
6371 if (this._debugID !== 0) {
6372 ReactInstrumentation.debugTool.onSetChildren(this._debugID, this._renderedComponent._debugID !== 0 ? [this._renderedComponent._debugID] : []);
6379 getNativeNode: function () {
6380 return ReactReconciler.getNativeNode(this._renderedComponent);
6384 * Releases any resources allocated by `mountComponent`.
6389 unmountComponent: function (safely) {
6390 if (!this._renderedComponent) {
6393 var inst = this._instance;
6395 if (inst.componentWillUnmount && !inst._calledComponentWillUnmount) {
6396 inst._calledComponentWillUnmount = true;
6397 if ("development" !== 'production') {
6398 if (this._debugID !== 0) {
6399 ReactInstrumentation.debugTool.onBeginLifeCycleTimer(this._debugID, 'componentWillUnmount');
6403 var name = this.getName() + '.componentWillUnmount()';
6404 ReactErrorUtils.invokeGuardedCallback(name, inst.componentWillUnmount.bind(inst));
6406 inst.componentWillUnmount();
6408 if ("development" !== 'production') {
6409 if (this._debugID !== 0) {
6410 ReactInstrumentation.debugTool.onEndLifeCycleTimer(this._debugID, 'componentWillUnmount');
6415 if (this._renderedComponent) {
6416 ReactReconciler.unmountComponent(this._renderedComponent, safely);
6417 this._renderedNodeType = null;
6418 this._renderedComponent = null;
6419 this._instance = null;
6422 // Reset pending fields
6423 // Even if this component is scheduled for another update in ReactUpdates,
6424 // it would still be ignored because these fields are reset.
6425 this._pendingStateQueue = null;
6426 this._pendingReplaceState = false;
6427 this._pendingForceUpdate = false;
6428 this._pendingCallbacks = null;
6429 this._pendingElement = null;
6431 // These fields do not really need to be reset since this object is no
6432 // longer accessible.
6433 this._context = null;
6434 this._rootNodeID = null;
6435 this._topLevelWrapper = null;
6437 // Delete the reference from the instance to this internal representation
6438 // which allow the internals to be properly cleaned up even if the user
6439 // leaks a reference to the public instance.
6440 ReactInstanceMap.remove(inst);
6442 // Some existing components rely on inst.props even after they've been
6443 // destroyed (in event handlers).
6444 // TODO: inst.props = null;
6445 // TODO: inst.state = null;
6446 // TODO: inst.context = null;
6450 * Filters the context object to only contain keys specified in
6453 * @param {object} context
6457 _maskContext: function (context) {
6458 var Component = this._currentElement.type;
6459 var contextTypes = Component.contextTypes;
6460 if (!contextTypes) {
6463 var maskedContext = {};
6464 for (var contextName in contextTypes) {
6465 maskedContext[contextName] = context[contextName];
6467 return maskedContext;
6471 * Filters the context object to only contain keys specified in
6472 * `contextTypes`, and asserts that they are valid.
6474 * @param {object} context
6478 _processContext: function (context) {
6479 var maskedContext = this._maskContext(context);
6480 if ("development" !== 'production') {
6481 var Component = this._currentElement.type;
6482 if (Component.contextTypes) {
6483 this._checkPropTypes(Component.contextTypes, maskedContext, ReactPropTypeLocations.context);
6486 return maskedContext;
6490 * @param {object} currentContext
6494 _processChildContext: function (currentContext) {
6495 var Component = this._currentElement.type;
6496 var inst = this._instance;
6497 if ("development" !== 'production') {
6498 ReactInstrumentation.debugTool.onBeginProcessingChildContext();
6500 var childContext = inst.getChildContext && inst.getChildContext();
6501 if ("development" !== 'production') {
6502 ReactInstrumentation.debugTool.onEndProcessingChildContext();
6505 !(typeof Component.childContextTypes === 'object') ? "development" !== 'production' ? invariant(false, '%s.getChildContext(): childContextTypes must be defined in order to ' + 'use getChildContext().', this.getName() || 'ReactCompositeComponent') : invariant(false) : void 0;
6506 if ("development" !== 'production') {
6507 this._checkPropTypes(Component.childContextTypes, childContext, ReactPropTypeLocations.childContext);
6509 for (var name in childContext) {
6510 !(name in Component.childContextTypes) ? "development" !== 'production' ? invariant(false, '%s.getChildContext(): key "%s" is not defined in childContextTypes.', this.getName() || 'ReactCompositeComponent', name) : invariant(false) : void 0;
6512 return _assign({}, currentContext, childContext);
6514 return currentContext;
6518 * Processes props by setting default values for unspecified props and
6519 * asserting that the props are valid. Does not mutate its argument; returns
6520 * a new props object with defaults merged in.
6522 * @param {object} newProps
6526 _processProps: function (newProps) {
6527 if ("development" !== 'production') {
6528 var Component = this._currentElement.type;
6529 if (Component.propTypes) {
6530 this._checkPropTypes(Component.propTypes, newProps, ReactPropTypeLocations.prop);
6537 * Assert that the props are valid
6539 * @param {object} propTypes Map of prop name to a ReactPropType
6540 * @param {object} props
6541 * @param {string} location e.g. "prop", "context", "child context"
6544 _checkPropTypes: function (propTypes, props, location) {
6545 // TODO: Stop validating prop types here and only use the element
6547 var componentName = this.getName();
6548 for (var propName in propTypes) {
6549 if (propTypes.hasOwnProperty(propName)) {
6552 // This is intentionally an invariant that gets caught. It's the same
6553 // behavior as without this statement except with a better message.
6554 !(typeof propTypes[propName] === 'function') ? "development" !== 'production' ? invariant(false, '%s: %s type `%s` is invalid; it must be a function, usually ' + 'from React.PropTypes.', componentName || 'React class', ReactPropTypeLocationNames[location], propName) : invariant(false) : void 0;
6555 error = propTypes[propName](props, propName, componentName, location);
6559 if (error instanceof Error) {
6560 // We may want to extend this logic for similar errors in
6561 // top-level render calls, so I'm abstracting it away into
6562 // a function to minimize refactoring in the future
6563 var addendum = getDeclarationErrorAddendum(this);
6565 if (location === ReactPropTypeLocations.prop) {
6566 // Preface gives us something to blacklist in warning module
6567 "development" !== 'production' ? warning(false, 'Failed Composite propType: %s%s', error.message, addendum) : void 0;
6569 "development" !== 'production' ? warning(false, 'Failed Context Types: %s%s', error.message, addendum) : void 0;
6576 receiveComponent: function (nextElement, transaction, nextContext) {
6577 var prevElement = this._currentElement;
6578 var prevContext = this._context;
6580 this._pendingElement = null;
6582 this.updateComponent(transaction, prevElement, nextElement, prevContext, nextContext);
6586 * If any of `_pendingElement`, `_pendingStateQueue`, or `_pendingForceUpdate`
6587 * is set, update the component.
6589 * @param {ReactReconcileTransaction} transaction
6592 performUpdateIfNecessary: function (transaction) {
6593 if (this._pendingElement != null) {
6594 ReactReconciler.receiveComponent(this, this._pendingElement, transaction, this._context);
6595 } else if (this._pendingStateQueue !== null || this._pendingForceUpdate) {
6596 this.updateComponent(transaction, this._currentElement, this._currentElement, this._context, this._context);
6598 this._updateBatchNumber = null;
6603 * Perform an update to a mounted component. The componentWillReceiveProps and
6604 * shouldComponentUpdate methods are called, then (assuming the update isn't
6605 * skipped) the remaining update lifecycle methods are called and the DOM
6606 * representation is updated.
6608 * By default, this implements React's rendering and reconciliation algorithm.
6609 * Sophisticated clients may wish to override this.
6611 * @param {ReactReconcileTransaction} transaction
6612 * @param {ReactElement} prevParentElement
6613 * @param {ReactElement} nextParentElement
6617 updateComponent: function (transaction, prevParentElement, nextParentElement, prevUnmaskedContext, nextUnmaskedContext) {
6618 var inst = this._instance;
6619 var willReceive = false;
6623 // Determine if the context has changed or not
6624 if (this._context === nextUnmaskedContext) {
6625 nextContext = inst.context;
6627 nextContext = this._processContext(nextUnmaskedContext);
6631 // Distinguish between a props update versus a simple state update
6632 if (prevParentElement === nextParentElement) {
6633 // Skip checking prop types again -- we don't read inst.props to avoid
6634 // warning for DOM component props in this upgrade
6635 nextProps = nextParentElement.props;
6637 nextProps = this._processProps(nextParentElement.props);
6641 // An update here will schedule an update but immediately set
6642 // _pendingStateQueue which will ensure that any state updates gets
6643 // immediately reconciled instead of waiting for the next batch.
6644 if (willReceive && inst.componentWillReceiveProps) {
6645 if ("development" !== 'production') {
6646 if (this._debugID !== 0) {
6647 ReactInstrumentation.debugTool.onBeginLifeCycleTimer(this._debugID, 'componentWillReceiveProps');
6650 inst.componentWillReceiveProps(nextProps, nextContext);
6651 if ("development" !== 'production') {
6652 if (this._debugID !== 0) {
6653 ReactInstrumentation.debugTool.onEndLifeCycleTimer(this._debugID, 'componentWillReceiveProps');
6658 var nextState = this._processPendingState(nextProps, nextContext);
6659 var shouldUpdate = true;
6661 if (!this._pendingForceUpdate && inst.shouldComponentUpdate) {
6662 if ("development" !== 'production') {
6663 if (this._debugID !== 0) {
6664 ReactInstrumentation.debugTool.onBeginLifeCycleTimer(this._debugID, 'shouldComponentUpdate');
6667 shouldUpdate = inst.shouldComponentUpdate(nextProps, nextState, nextContext);
6668 if ("development" !== 'production') {
6669 if (this._debugID !== 0) {
6670 ReactInstrumentation.debugTool.onEndLifeCycleTimer(this._debugID, 'shouldComponentUpdate');
6675 if ("development" !== 'production') {
6676 "development" !== 'production' ? warning(shouldUpdate !== undefined, '%s.shouldComponentUpdate(): Returned undefined instead of a ' + 'boolean value. Make sure to return true or false.', this.getName() || 'ReactCompositeComponent') : void 0;
6679 this._updateBatchNumber = null;
6681 this._pendingForceUpdate = false;
6682 // Will set `this.props`, `this.state` and `this.context`.
6683 this._performComponentUpdate(nextParentElement, nextProps, nextState, nextContext, transaction, nextUnmaskedContext);
6685 // If it's determined that a component should not update, we still want
6686 // to set props and state but we shortcut the rest of the update.
6687 this._currentElement = nextParentElement;
6688 this._context = nextUnmaskedContext;
6689 inst.props = nextProps;
6690 inst.state = nextState;
6691 inst.context = nextContext;
6695 _processPendingState: function (props, context) {
6696 var inst = this._instance;
6697 var queue = this._pendingStateQueue;
6698 var replace = this._pendingReplaceState;
6699 this._pendingReplaceState = false;
6700 this._pendingStateQueue = null;
6706 if (replace && queue.length === 1) {
6710 var nextState = _assign({}, replace ? queue[0] : inst.state);
6711 for (var i = replace ? 1 : 0; i < queue.length; i++) {
6712 var partial = queue[i];
6713 _assign(nextState, typeof partial === 'function' ? partial.call(inst, nextState, props, context) : partial);
6720 * Merges new props and state, notifies delegate methods of update and
6723 * @param {ReactElement} nextElement Next element
6724 * @param {object} nextProps Next public object to set as properties.
6725 * @param {?object} nextState Next object to set as state.
6726 * @param {?object} nextContext Next public object to set as context.
6727 * @param {ReactReconcileTransaction} transaction
6728 * @param {?object} unmaskedContext
6731 _performComponentUpdate: function (nextElement, nextProps, nextState, nextContext, transaction, unmaskedContext) {
6732 var inst = this._instance;
6734 var hasComponentDidUpdate = Boolean(inst.componentDidUpdate);
6738 if (hasComponentDidUpdate) {
6739 prevProps = inst.props;
6740 prevState = inst.state;
6741 prevContext = inst.context;
6744 if (inst.componentWillUpdate) {
6745 if ("development" !== 'production') {
6746 if (this._debugID !== 0) {
6747 ReactInstrumentation.debugTool.onBeginLifeCycleTimer(this._debugID, 'componentWillUpdate');
6750 inst.componentWillUpdate(nextProps, nextState, nextContext);
6751 if ("development" !== 'production') {
6752 if (this._debugID !== 0) {
6753 ReactInstrumentation.debugTool.onEndLifeCycleTimer(this._debugID, 'componentWillUpdate');
6758 this._currentElement = nextElement;
6759 this._context = unmaskedContext;
6760 inst.props = nextProps;
6761 inst.state = nextState;
6762 inst.context = nextContext;
6764 this._updateRenderedComponent(transaction, unmaskedContext);
6766 if (hasComponentDidUpdate) {
6767 if ("development" !== 'production') {
6768 transaction.getReactMountReady().enqueue(invokeComponentDidUpdateWithTimer.bind(this, prevProps, prevState, prevContext), this);
6770 transaction.getReactMountReady().enqueue(inst.componentDidUpdate.bind(inst, prevProps, prevState, prevContext), inst);
6776 * Call the component's `render` method and update the DOM accordingly.
6778 * @param {ReactReconcileTransaction} transaction
6781 _updateRenderedComponent: function (transaction, context) {
6782 var prevComponentInstance = this._renderedComponent;
6783 var prevRenderedElement = prevComponentInstance._currentElement;
6784 var nextRenderedElement = this._renderValidatedComponent();
6785 if (shouldUpdateReactComponent(prevRenderedElement, nextRenderedElement)) {
6786 ReactReconciler.receiveComponent(prevComponentInstance, nextRenderedElement, transaction, this._processChildContext(context));
6788 var oldNativeNode = ReactReconciler.getNativeNode(prevComponentInstance);
6789 ReactReconciler.unmountComponent(prevComponentInstance, false);
6791 this._renderedNodeType = ReactNodeTypes.getType(nextRenderedElement);
6792 this._renderedComponent = this._instantiateReactComponent(nextRenderedElement);
6794 var nextMarkup = ReactReconciler.mountComponent(this._renderedComponent, transaction, this._nativeParent, this._nativeContainerInfo, this._processChildContext(context));
6796 if ("development" !== 'production') {
6797 if (this._debugID !== 0) {
6798 ReactInstrumentation.debugTool.onSetChildren(this._debugID, this._renderedComponent._debugID !== 0 ? [this._renderedComponent._debugID] : []);
6802 this._replaceNodeWithMarkup(oldNativeNode, nextMarkup, prevComponentInstance);
6807 * Overridden in shallow rendering.
6811 _replaceNodeWithMarkup: function (oldNativeNode, nextMarkup, prevInstance) {
6812 ReactComponentEnvironment.replaceNodeWithMarkup(oldNativeNode, nextMarkup, prevInstance);
6818 _renderValidatedComponentWithoutOwnerOrContext: function () {
6819 var inst = this._instance;
6821 if ("development" !== 'production') {
6822 if (this._debugID !== 0) {
6823 ReactInstrumentation.debugTool.onBeginLifeCycleTimer(this._debugID, 'render');
6826 var renderedComponent = inst.render();
6827 if ("development" !== 'production') {
6828 if (this._debugID !== 0) {
6829 ReactInstrumentation.debugTool.onEndLifeCycleTimer(this._debugID, 'render');
6833 if ("development" !== 'production') {
6834 // We allow auto-mocks to proceed as if they're returning null.
6835 if (renderedComponent === undefined && inst.render._isMockFunction) {
6836 // This is probably bad practice. Consider warning here and
6837 // deprecating this convenience.
6838 renderedComponent = null;
6842 return renderedComponent;
6848 _renderValidatedComponent: function () {
6849 var renderedComponent;
6850 ReactCurrentOwner.current = this;
6852 renderedComponent = this._renderValidatedComponentWithoutOwnerOrContext();
6854 ReactCurrentOwner.current = null;
6857 // TODO: An `isValidNode` function would probably be more appropriate
6858 renderedComponent === null || renderedComponent === false || ReactElement.isValidElement(renderedComponent)) ? "development" !== 'production' ? invariant(false, '%s.render(): A valid React element (or null) must be returned. You may have ' + 'returned undefined, an array or some other invalid object.', this.getName() || 'ReactCompositeComponent') : invariant(false) : void 0;
6860 return renderedComponent;
6864 * Lazily allocates the refs object and stores `component` as `ref`.
6866 * @param {string} ref Reference name.
6867 * @param {component} component Component to store as `ref`.
6871 attachRef: function (ref, component) {
6872 var inst = this.getPublicInstance();
6873 !(inst != null) ? "development" !== 'production' ? invariant(false, 'Stateless function components cannot have refs.') : invariant(false) : void 0;
6874 var publicComponentInstance = component.getPublicInstance();
6875 if ("development" !== 'production') {
6876 var componentName = component && component.getName ? component.getName() : 'a component';
6877 "development" !== 'production' ? warning(publicComponentInstance != null, 'Stateless function components cannot be given refs ' + '(See ref "%s" in %s created by %s). ' + 'Attempts to access this ref will fail.', ref, componentName, this.getName()) : void 0;
6879 var refs = inst.refs === emptyObject ? inst.refs = {} : inst.refs;
6880 refs[ref] = publicComponentInstance;
6884 * Detaches a reference name.
6886 * @param {string} ref Name to dereference.
6890 detachRef: function (ref) {
6891 var refs = this.getPublicInstance().refs;
6896 * Get a text description of the component that can be used to identify it
6897 * in error messages.
6898 * @return {string} The name or null.
6901 getName: function () {
6902 var type = this._currentElement.type;
6903 var constructor = this._instance && this._instance.constructor;
6904 return type.displayName || constructor && constructor.displayName || type.name || constructor && constructor.name || null;
6908 * Get the publicly accessible representation of this component - i.e. what
6909 * is exposed by refs and returned by render. Can be null for stateless
6912 * @return {ReactComponent} the public component instance.
6915 getPublicInstance: function () {
6916 var inst = this._instance;
6917 if (inst instanceof StatelessComponent) {
6924 _instantiateReactComponent: null
6928 var ReactCompositeComponent = {
6930 Mixin: ReactCompositeComponentMixin
6934 module.exports = ReactCompositeComponent;
6935 },{"103":103,"153":153,"166":166,"173":173,"183":183,"184":184,"36":36,"40":40,"65":65,"68":68,"75":75,"76":76,"85":85,"89":89,"90":90,"93":93}],40:[function(_dereq_,module,exports){
6937 * Copyright 2013-present, Facebook, Inc.
6938 * All rights reserved.
6940 * This source code is licensed under the BSD-style license found in the
6941 * LICENSE file in the root directory of this source tree. An additional grant
6942 * of patent rights can be found in the PATENTS file in the same directory.
6944 * @providesModule ReactCurrentOwner
6950 * Keeps track of the current owner.
6952 * The current owner is the component who should own any components that are
6953 * currently being constructed.
6956 var ReactCurrentOwner = {
6960 * @type {ReactComponent}
6966 module.exports = ReactCurrentOwner;
6967 },{}],41:[function(_dereq_,module,exports){
6969 * Copyright 2013-present, Facebook, Inc.
6970 * All rights reserved.
6972 * This source code is licensed under the BSD-style license found in the
6973 * LICENSE file in the root directory of this source tree. An additional grant
6974 * of patent rights can be found in the PATENTS file in the same directory.
6976 * @providesModule ReactDOM
6979 /* globals __REACT_DEVTOOLS_GLOBAL_HOOK__*/
6983 var ReactDOMComponentTree = _dereq_(45);
6984 var ReactDefaultInjection = _dereq_(64);
6985 var ReactMount = _dereq_(80);
6986 var ReactReconciler = _dereq_(93);
6987 var ReactUpdates = _dereq_(104);
6988 var ReactVersion = _dereq_(105);
6990 var findDOMNode = _dereq_(132);
6991 var getNativeComponentFromComposite = _dereq_(140);
6992 var renderSubtreeIntoContainer = _dereq_(149);
6993 var warning = _dereq_(183);
6995 ReactDefaultInjection.inject();
6998 findDOMNode: findDOMNode,
6999 render: ReactMount.render,
7000 unmountComponentAtNode: ReactMount.unmountComponentAtNode,
7001 version: ReactVersion,
7003 /* eslint-disable camelcase */
7004 unstable_batchedUpdates: ReactUpdates.batchedUpdates,
7005 unstable_renderSubtreeIntoContainer: renderSubtreeIntoContainer
7008 // Inject the runtime into a devtools global hook regardless of browser.
7009 // Allows for debugging when the hook is injected on the page.
7010 /* eslint-enable camelcase */
7011 if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.inject === 'function') {
7012 __REACT_DEVTOOLS_GLOBAL_HOOK__.inject({
7014 getClosestInstanceFromNode: ReactDOMComponentTree.getClosestInstanceFromNode,
7015 getNodeFromInstance: function (inst) {
7016 // inst is an internal instance (but could be a composite)
7017 if (inst._renderedComponent) {
7018 inst = getNativeComponentFromComposite(inst);
7021 return ReactDOMComponentTree.getNodeFromInstance(inst);
7028 Reconciler: ReactReconciler
7032 if ("development" !== 'production') {
7033 var ExecutionEnvironment = _dereq_(159);
7034 if (ExecutionEnvironment.canUseDOM && window.top === window.self) {
7036 // First check if devtools is not installed
7037 if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined') {
7038 // If we're in Chrome or Firefox, provide a download link if not installed.
7039 if (navigator.userAgent.indexOf('Chrome') > -1 && navigator.userAgent.indexOf('Edge') === -1 || navigator.userAgent.indexOf('Firefox') > -1) {
7040 // Firefox does not have the issue with devtools loaded over file://
7041 var showFileUrlMessage = window.location.protocol.indexOf('http') === -1 && navigator.userAgent.indexOf('Firefox') === -1;
7042 console.debug('Download the React DevTools ' + (showFileUrlMessage ? 'and use an HTTP server (instead of a file: URL) ' : '') + 'for a better development experience: ' + 'https://fb.me/react-devtools');
7046 var testFunc = function testFn() {};
7047 "development" !== 'production' ? warning((testFunc.name || testFunc.toString()).indexOf('testFn') !== -1, 'It looks like you\'re using a minified copy of the development build ' + 'of React. When deploying React apps to production, make sure to use ' + 'the production build which skips development warnings and is faster. ' + 'See https://fb.me/react-minification for more details.') : void 0;
7049 // If we're in IE8, check to see if we are in compatibility mode and provide
7050 // information on preventing compatibility mode
7051 var ieCompatibilityMode = document.documentMode && document.documentMode < 8;
7053 "development" !== 'production' ? warning(!ieCompatibilityMode, 'Internet Explorer is running in compatibility mode; please add the ' + 'following tag to your HTML to prevent this from happening: ' + '<meta http-equiv="X-UA-Compatible" content="IE=edge" />') : void 0;
7055 var expectedFeatures = [
7057 Array.isArray, Array.prototype.every, Array.prototype.forEach, Array.prototype.indexOf, Array.prototype.map, Date.now, Function.prototype.bind, Object.keys, String.prototype.split, String.prototype.trim];
7059 for (var i = 0; i < expectedFeatures.length; i++) {
7060 if (!expectedFeatures[i]) {
7061 "development" !== 'production' ? warning(false, 'One or more ES5 shims expected by React are not available: ' + 'https://fb.me/react-warning-polyfills') : void 0;
7068 module.exports = React;
7069 },{"104":104,"105":105,"132":132,"140":140,"149":149,"159":159,"183":183,"45":45,"64":64,"80":80,"93":93}],42:[function(_dereq_,module,exports){
7071 * Copyright 2013-present, Facebook, Inc.
7072 * All rights reserved.
7074 * This source code is licensed under the BSD-style license found in the
7075 * LICENSE file in the root directory of this source tree. An additional grant
7076 * of patent rights can be found in the PATENTS file in the same directory.
7078 * @providesModule ReactDOMButton
7083 var DisabledInputUtils = _dereq_(14);
7086 * Implements a <button> native component that does not receive mouse events
7087 * when `disabled` is set.
7089 var ReactDOMButton = {
7090 getNativeProps: DisabledInputUtils.getNativeProps
7093 module.exports = ReactDOMButton;
7094 },{"14":14}],43:[function(_dereq_,module,exports){
7096 * Copyright 2013-present, Facebook, Inc.
7097 * All rights reserved.
7099 * This source code is licensed under the BSD-style license found in the
7100 * LICENSE file in the root directory of this source tree. An additional grant
7101 * of patent rights can be found in the PATENTS file in the same directory.
7103 * @providesModule ReactDOMComponent
7106 /* global hasOwnProperty:true */
7110 var _assign = _dereq_(184);
7112 var AutoFocusUtils = _dereq_(1);
7113 var CSSPropertyOperations = _dereq_(4);
7114 var DOMLazyTree = _dereq_(8);
7115 var DOMNamespaces = _dereq_(9);
7116 var DOMProperty = _dereq_(10);
7117 var DOMPropertyOperations = _dereq_(11);
7118 var EventConstants = _dereq_(16);
7119 var EventPluginHub = _dereq_(17);
7120 var EventPluginRegistry = _dereq_(18);
7121 var ReactBrowserEventEmitter = _dereq_(28);
7122 var ReactComponentBrowserEnvironment = _dereq_(35);
7123 var ReactDOMButton = _dereq_(42);
7124 var ReactDOMComponentFlags = _dereq_(44);
7125 var ReactDOMComponentTree = _dereq_(45);
7126 var ReactDOMInput = _dereq_(52);
7127 var ReactDOMOption = _dereq_(54);
7128 var ReactDOMSelect = _dereq_(55);
7129 var ReactDOMTextarea = _dereq_(59);
7130 var ReactInstrumentation = _dereq_(76);
7131 var ReactMultiChild = _dereq_(81);
7132 var ReactServerRenderingTransaction = _dereq_(97);
7134 var emptyFunction = _dereq_(165);
7135 var escapeTextContentForBrowser = _dereq_(131);
7136 var invariant = _dereq_(173);
7137 var isEventSupported = _dereq_(145);
7138 var keyOf = _dereq_(177);
7139 var shallowEqual = _dereq_(182);
7140 var validateDOMNesting = _dereq_(156);
7141 var warning = _dereq_(183);
7143 var Flags = ReactDOMComponentFlags;
7144 var deleteListener = EventPluginHub.deleteListener;
7145 var getNode = ReactDOMComponentTree.getNodeFromInstance;
7146 var listenTo = ReactBrowserEventEmitter.listenTo;
7147 var registrationNameModules = EventPluginRegistry.registrationNameModules;
7149 // For quickly matching children type, to test if can be treated as content.
7150 var CONTENT_TYPES = { 'string': true, 'number': true };
7152 var STYLE = keyOf({ style: null });
7153 var HTML = keyOf({ __html: null });
7154 var RESERVED_PROPS = {
7156 dangerouslySetInnerHTML: null,
7157 suppressContentEditableWarning: null
7160 // Node type for document fragments (Node.DOCUMENT_FRAGMENT_NODE).
7161 var DOC_FRAGMENT_TYPE = 11;
7163 function getDeclarationErrorAddendum(internalInstance) {
7164 if (internalInstance) {
7165 var owner = internalInstance._currentElement._owner || null;
7167 var name = owner.getName();
7169 return ' This DOM node was rendered by `' + name + '`.';
7176 function friendlyStringify(obj) {
7177 if (typeof obj === 'object') {
7178 if (Array.isArray(obj)) {
7179 return '[' + obj.map(friendlyStringify).join(', ') + ']';
7182 for (var key in obj) {
7183 if (Object.prototype.hasOwnProperty.call(obj, key)) {
7184 var keyEscaped = /^[a-z$_][\w$_]*$/i.test(key) ? key : JSON.stringify(key);
7185 pairs.push(keyEscaped + ': ' + friendlyStringify(obj[key]));
7188 return '{' + pairs.join(', ') + '}';
7190 } else if (typeof obj === 'string') {
7191 return JSON.stringify(obj);
7192 } else if (typeof obj === 'function') {
7193 return '[function object]';
7195 // Differs from JSON.stringify in that undefined because undefined and that
7196 // inf and nan don't become null
7200 var styleMutationWarning = {};
7202 function checkAndWarnForMutatedStyle(style1, style2, component) {
7203 if (style1 == null || style2 == null) {
7206 if (shallowEqual(style1, style2)) {
7210 var componentName = component._tag;
7211 var owner = component._currentElement._owner;
7214 ownerName = owner.getName();
7217 var hash = ownerName + '|' + componentName;
7219 if (styleMutationWarning.hasOwnProperty(hash)) {
7223 styleMutationWarning[hash] = true;
7225 "development" !== 'production' ? warning(false, '`%s` was passed a style object that has previously been mutated. ' + 'Mutating `style` is deprecated. Consider cloning it beforehand. Check ' + 'the `render` %s. Previous style: %s. Mutated style: %s.', componentName, owner ? 'of `' + ownerName + '`' : 'using <' + componentName + '>', friendlyStringify(style1), friendlyStringify(style2)) : void 0;
7229 * @param {object} component
7230 * @param {?object} props
7232 function assertValidProps(component, props) {
7236 // Note the use of `==` which checks for null or undefined.
7237 if (voidElementTags[component._tag]) {
7238 !(props.children == null && props.dangerouslySetInnerHTML == null) ? "development" !== 'production' ? invariant(false, '%s is a void element tag and must not have `children` or ' + 'use `props.dangerouslySetInnerHTML`.%s', component._tag, component._currentElement._owner ? ' Check the render method of ' + component._currentElement._owner.getName() + '.' : '') : invariant(false) : void 0;
7240 if (props.dangerouslySetInnerHTML != null) {
7241 !(props.children == null) ? "development" !== 'production' ? invariant(false, 'Can only set one of `children` or `props.dangerouslySetInnerHTML`.') : invariant(false) : void 0;
7242 !(typeof props.dangerouslySetInnerHTML === 'object' && HTML in props.dangerouslySetInnerHTML) ? "development" !== 'production' ? invariant(false, '`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. ' + 'Please visit https://fb.me/react-invariant-dangerously-set-inner-html ' + 'for more information.') : invariant(false) : void 0;
7244 if ("development" !== 'production') {
7245 "development" !== 'production' ? warning(props.innerHTML == null, 'Directly setting property `innerHTML` is not permitted. ' + 'For more information, lookup documentation on `dangerouslySetInnerHTML`.') : void 0;
7246 "development" !== 'production' ? warning(props.suppressContentEditableWarning || !props.contentEditable || props.children == null, 'A component is `contentEditable` and contains `children` managed by ' + 'React. It is now your responsibility to guarantee that none of ' + 'those nodes are unexpectedly modified or duplicated. This is ' + 'probably not intentional.') : void 0;
7247 "development" !== 'production' ? warning(props.onFocusIn == null && props.onFocusOut == null, 'React uses onFocus and onBlur instead of onFocusIn and onFocusOut. ' + 'All React events are normalized to bubble, so onFocusIn and onFocusOut ' + 'are not needed/supported by React.') : void 0;
7249 !(props.style == null || typeof props.style === 'object') ? "development" !== 'production' ? invariant(false, 'The `style` prop expects a mapping from style properties to values, ' + 'not a string. For example, style={{marginRight: spacing + \'em\'}} when ' + 'using JSX.%s', getDeclarationErrorAddendum(component)) : invariant(false) : void 0;
7252 function enqueuePutListener(inst, registrationName, listener, transaction) {
7253 if (transaction instanceof ReactServerRenderingTransaction) {
7256 if ("development" !== 'production') {
7257 // IE8 has no API for event capturing and the `onScroll` event doesn't
7259 "development" !== 'production' ? warning(registrationName !== 'onScroll' || isEventSupported('scroll', true), 'This browser doesn\'t support the `onScroll` event') : void 0;
7261 var containerInfo = inst._nativeContainerInfo;
7262 var isDocumentFragment = containerInfo._node && containerInfo._node.nodeType === DOC_FRAGMENT_TYPE;
7263 var doc = isDocumentFragment ? containerInfo._node : containerInfo._ownerDocument;
7264 listenTo(registrationName, doc);
7265 transaction.getReactMountReady().enqueue(putListener, {
7267 registrationName: registrationName,
7272 function putListener() {
7273 var listenerToPut = this;
7274 EventPluginHub.putListener(listenerToPut.inst, listenerToPut.registrationName, listenerToPut.listener);
7277 function optionPostMount() {
7279 ReactDOMOption.postMountWrapper(inst);
7282 var setContentChildForInstrumentation = emptyFunction;
7283 if ("development" !== 'production') {
7284 setContentChildForInstrumentation = function (contentToUse) {
7285 var debugID = this._debugID;
7286 var contentDebugID = debugID + '#text';
7287 this._contentDebugID = contentDebugID;
7288 ReactInstrumentation.debugTool.onSetDisplayName(contentDebugID, '#text');
7289 ReactInstrumentation.debugTool.onSetText(contentDebugID, '' + contentToUse);
7290 ReactInstrumentation.debugTool.onMountComponent(contentDebugID);
7291 ReactInstrumentation.debugTool.onSetChildren(debugID, [contentDebugID]);
7295 // There are so many media events, it makes sense to just
7296 // maintain a list rather than create a `trapBubbledEvent` for each
7299 topCanPlay: 'canplay',
7300 topCanPlayThrough: 'canplaythrough',
7301 topDurationChange: 'durationchange',
7302 topEmptied: 'emptied',
7303 topEncrypted: 'encrypted',
7306 topLoadedData: 'loadeddata',
7307 topLoadedMetadata: 'loadedmetadata',
7308 topLoadStart: 'loadstart',
7311 topPlaying: 'playing',
7312 topProgress: 'progress',
7313 topRateChange: 'ratechange',
7314 topSeeked: 'seeked',
7315 topSeeking: 'seeking',
7316 topStalled: 'stalled',
7317 topSuspend: 'suspend',
7318 topTimeUpdate: 'timeupdate',
7319 topVolumeChange: 'volumechange',
7320 topWaiting: 'waiting'
7323 function trapBubbledEventsLocal() {
7325 // If a component renders to null or if another component fatals and causes
7326 // the state of the tree to be corrupted, `node` here can be null.
7327 !inst._rootNodeID ? "development" !== 'production' ? invariant(false, 'Must be mounted to trap events') : invariant(false) : void 0;
7328 var node = getNode(inst);
7329 !node ? "development" !== 'production' ? invariant(false, 'trapBubbledEvent(...): Requires node to be rendered.') : invariant(false) : void 0;
7331 switch (inst._tag) {
7334 inst._wrapperState.listeners = [ReactBrowserEventEmitter.trapBubbledEvent(EventConstants.topLevelTypes.topLoad, 'load', node)];
7339 inst._wrapperState.listeners = [];
7340 // Create listener for each media event
7341 for (var event in mediaEvents) {
7342 if (mediaEvents.hasOwnProperty(event)) {
7343 inst._wrapperState.listeners.push(ReactBrowserEventEmitter.trapBubbledEvent(EventConstants.topLevelTypes[event], mediaEvents[event], node));
7349 inst._wrapperState.listeners = [ReactBrowserEventEmitter.trapBubbledEvent(EventConstants.topLevelTypes.topError, 'error', node), ReactBrowserEventEmitter.trapBubbledEvent(EventConstants.topLevelTypes.topLoad, 'load', node)];
7352 inst._wrapperState.listeners = [ReactBrowserEventEmitter.trapBubbledEvent(EventConstants.topLevelTypes.topReset, 'reset', node), ReactBrowserEventEmitter.trapBubbledEvent(EventConstants.topLevelTypes.topSubmit, 'submit', node)];
7357 inst._wrapperState.listeners = [ReactBrowserEventEmitter.trapBubbledEvent(EventConstants.topLevelTypes.topInvalid, 'invalid', node)];
7362 function postUpdateSelectWrapper() {
7363 ReactDOMSelect.postUpdateWrapper(this);
7366 // For HTML, certain tags should omit their close tag. We keep a whitelist for
7367 // those special-case tags.
7369 var omittedCloseTags = {
7387 // NOTE: menuitem's close tag should be omitted, but that causes problems.
7388 var newlineEatingTags = {
7394 // For HTML, certain tags cannot have children. This has the same purpose as
7395 // `omittedCloseTags` except that `menuitem` should still have its closing tag.
7397 var voidElementTags = _assign({
7399 }, omittedCloseTags);
7401 // We accept any tag to be rendered but since this gets injected into arbitrary
7402 // HTML, we want to make sure that it's a safe tag.
7403 // http://www.w3.org/TR/REC-xml/#NT-Name
7405 var VALID_TAG_REGEX = /^[a-zA-Z][a-zA-Z:_\.\-\d]*$/; // Simplified subset
7406 var validatedTagCache = {};
7407 var hasOwnProperty = {}.hasOwnProperty;
7409 function validateDangerousTag(tag) {
7410 if (!hasOwnProperty.call(validatedTagCache, tag)) {
7411 !VALID_TAG_REGEX.test(tag) ? "development" !== 'production' ? invariant(false, 'Invalid tag: %s', tag) : invariant(false) : void 0;
7412 validatedTagCache[tag] = true;
7416 function isCustomComponent(tagName, props) {
7417 return tagName.indexOf('-') >= 0 || props.is != null;
7420 var globalIdCounter = 1;
7423 * Creates a new React class that is idempotent and capable of containing other
7424 * React components. It accepts event listeners and DOM properties that are
7425 * valid according to `DOMProperty`.
7427 * - Event listeners: `onClick`, `onMouseDown`, etc.
7428 * - DOM properties: `className`, `name`, `title`, etc.
7430 * The `style` property functions differently from the DOM API. It accepts an
7431 * object mapping of style properties to values.
7433 * @constructor ReactDOMComponent
7434 * @extends ReactMultiChild
7436 function ReactDOMComponent(element) {
7437 var tag = element.type;
7438 validateDangerousTag(tag);
7439 this._currentElement = element;
7440 this._tag = tag.toLowerCase();
7441 this._namespaceURI = null;
7442 this._renderedChildren = null;
7443 this._previousStyle = null;
7444 this._previousStyleCopy = null;
7445 this._nativeNode = null;
7446 this._nativeParent = null;
7447 this._rootNodeID = null;
7449 this._nativeContainerInfo = null;
7450 this._wrapperState = null;
7451 this._topLevelWrapper = null;
7453 if ("development" !== 'production') {
7454 this._ancestorInfo = null;
7455 this._contentDebugID = null;
7459 ReactDOMComponent.displayName = 'ReactDOMComponent';
7461 ReactDOMComponent.Mixin = {
7464 * Generates root tag markup then recurses. This method has side effects and
7465 * is not idempotent.
7468 * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
7469 * @param {?ReactDOMComponent} the containing DOM component instance
7470 * @param {?object} info about the native container
7471 * @param {object} context
7472 * @return {string} The computed markup.
7474 mountComponent: function (transaction, nativeParent, nativeContainerInfo, context) {
7475 this._rootNodeID = globalIdCounter++;
7476 this._domID = nativeContainerInfo._idCounter++;
7477 this._nativeParent = nativeParent;
7478 this._nativeContainerInfo = nativeContainerInfo;
7480 var props = this._currentElement.props;
7482 switch (this._tag) {
7489 this._wrapperState = {
7492 transaction.getReactMountReady().enqueue(trapBubbledEventsLocal, this);
7495 props = ReactDOMButton.getNativeProps(this, props, nativeParent);
7498 ReactDOMInput.mountWrapper(this, props, nativeParent);
7499 props = ReactDOMInput.getNativeProps(this, props);
7500 transaction.getReactMountReady().enqueue(trapBubbledEventsLocal, this);
7503 ReactDOMOption.mountWrapper(this, props, nativeParent);
7504 props = ReactDOMOption.getNativeProps(this, props);
7507 ReactDOMSelect.mountWrapper(this, props, nativeParent);
7508 props = ReactDOMSelect.getNativeProps(this, props);
7509 transaction.getReactMountReady().enqueue(trapBubbledEventsLocal, this);
7512 ReactDOMTextarea.mountWrapper(this, props, nativeParent);
7513 props = ReactDOMTextarea.getNativeProps(this, props);
7514 transaction.getReactMountReady().enqueue(trapBubbledEventsLocal, this);
7518 assertValidProps(this, props);
7520 // We create tags in the namespace of their parent container, except HTML
7521 // tags get no namespace.
7524 if (nativeParent != null) {
7525 namespaceURI = nativeParent._namespaceURI;
7526 parentTag = nativeParent._tag;
7527 } else if (nativeContainerInfo._tag) {
7528 namespaceURI = nativeContainerInfo._namespaceURI;
7529 parentTag = nativeContainerInfo._tag;
7531 if (namespaceURI == null || namespaceURI === DOMNamespaces.svg && parentTag === 'foreignobject') {
7532 namespaceURI = DOMNamespaces.html;
7534 if (namespaceURI === DOMNamespaces.html) {
7535 if (this._tag === 'svg') {
7536 namespaceURI = DOMNamespaces.svg;
7537 } else if (this._tag === 'math') {
7538 namespaceURI = DOMNamespaces.mathml;
7541 this._namespaceURI = namespaceURI;
7543 if ("development" !== 'production') {
7545 if (nativeParent != null) {
7546 parentInfo = nativeParent._ancestorInfo;
7547 } else if (nativeContainerInfo._tag) {
7548 parentInfo = nativeContainerInfo._ancestorInfo;
7551 // parentInfo should always be present except for the top-level
7552 // component when server rendering
7553 validateDOMNesting(this._tag, this, parentInfo);
7555 this._ancestorInfo = validateDOMNesting.updatedAncestorInfo(parentInfo, this._tag, this);
7559 if (transaction.useCreateElement) {
7560 var ownerDocument = nativeContainerInfo._ownerDocument;
7562 if (namespaceURI === DOMNamespaces.html) {
7563 if (this._tag === 'script') {
7564 // Create the script via .innerHTML so its "parser-inserted" flag is
7565 // set to true and it does not execute
7566 var div = ownerDocument.createElement('div');
7567 var type = this._currentElement.type;
7568 div.innerHTML = '<' + type + '></' + type + '>';
7569 el = div.removeChild(div.firstChild);
7571 el = ownerDocument.createElement(this._currentElement.type, props.is || null);
7574 el = ownerDocument.createElementNS(namespaceURI, this._currentElement.type);
7576 ReactDOMComponentTree.precacheNode(this, el);
7577 this._flags |= Flags.hasCachedChildNodes;
7578 if (!this._nativeParent) {
7579 DOMPropertyOperations.setAttributeForRoot(el);
7581 this._updateDOMProperties(null, props, transaction);
7582 var lazyTree = DOMLazyTree(el);
7583 this._createInitialChildren(transaction, props, context, lazyTree);
7584 mountImage = lazyTree;
7586 var tagOpen = this._createOpenTagMarkupAndPutListeners(transaction, props);
7587 var tagContent = this._createContentMarkup(transaction, props, context);
7588 if (!tagContent && omittedCloseTags[this._tag]) {
7589 mountImage = tagOpen + '/>';
7591 mountImage = tagOpen + '>' + tagContent + '</' + this._currentElement.type + '>';
7595 switch (this._tag) {
7600 if (props.autoFocus) {
7601 transaction.getReactMountReady().enqueue(AutoFocusUtils.focusDOMComponent, this);
7605 transaction.getReactMountReady().enqueue(optionPostMount, this);
7612 * Creates markup for the open tag and all attributes.
7614 * This method has side effects because events get registered.
7616 * Iterating over object properties is faster than iterating over arrays.
7617 * @see http://jsperf.com/obj-vs-arr-iteration
7620 * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
7621 * @param {object} props
7622 * @return {string} Markup of opening tag.
7624 _createOpenTagMarkupAndPutListeners: function (transaction, props) {
7625 var ret = '<' + this._currentElement.type;
7627 for (var propKey in props) {
7628 if (!props.hasOwnProperty(propKey)) {
7631 var propValue = props[propKey];
7632 if (propValue == null) {
7635 if (registrationNameModules.hasOwnProperty(propKey)) {
7637 enqueuePutListener(this, propKey, propValue, transaction);
7640 if (propKey === STYLE) {
7642 if ("development" !== 'production') {
7643 // See `_updateDOMProperties`. style block
7644 this._previousStyle = propValue;
7646 propValue = this._previousStyleCopy = _assign({}, props.style);
7648 propValue = CSSPropertyOperations.createMarkupForStyles(propValue, this);
7651 if (this._tag != null && isCustomComponent(this._tag, props)) {
7652 if (!RESERVED_PROPS.hasOwnProperty(propKey)) {
7653 markup = DOMPropertyOperations.createMarkupForCustomAttribute(propKey, propValue);
7656 markup = DOMPropertyOperations.createMarkupForProperty(propKey, propValue);
7659 ret += ' ' + markup;
7664 // For static pages, no need to put React ID and checksum. Saves lots of
7666 if (transaction.renderToStaticMarkup) {
7670 if (!this._nativeParent) {
7671 ret += ' ' + DOMPropertyOperations.createMarkupForRoot();
7673 ret += ' ' + DOMPropertyOperations.createMarkupForID(this._domID);
7678 * Creates markup for the content between the tags.
7681 * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
7682 * @param {object} props
7683 * @param {object} context
7684 * @return {string} Content markup.
7686 _createContentMarkup: function (transaction, props, context) {
7689 // Intentional use of != to avoid catching zero/false.
7690 var innerHTML = props.dangerouslySetInnerHTML;
7691 if (innerHTML != null) {
7692 if (innerHTML.__html != null) {
7693 ret = innerHTML.__html;
7696 var contentToUse = CONTENT_TYPES[typeof props.children] ? props.children : null;
7697 var childrenToUse = contentToUse != null ? null : props.children;
7698 if (contentToUse != null) {
7699 // TODO: Validate that text is allowed as a child of this node
7700 ret = escapeTextContentForBrowser(contentToUse);
7701 if ("development" !== 'production') {
7702 setContentChildForInstrumentation.call(this, contentToUse);
7704 } else if (childrenToUse != null) {
7705 var mountImages = this.mountChildren(childrenToUse, transaction, context);
7706 ret = mountImages.join('');
7709 if (newlineEatingTags[this._tag] && ret.charAt(0) === '\n') {
7710 // text/html ignores the first character in these tags if it's a newline
7711 // Prefer to break application/xml over text/html (for now) by adding
7712 // a newline specifically to get eaten by the parser. (Alternately for
7713 // textareas, replacing "^\n" with "\r\n" doesn't get eaten, and the first
7714 // \r is normalized out by HTMLTextAreaElement#value.)
7715 // See: <http://www.w3.org/TR/html-polyglot/#newlines-in-textarea-and-pre>
7716 // See: <http://www.w3.org/TR/html5/syntax.html#element-restrictions>
7717 // See: <http://www.w3.org/TR/html5/syntax.html#newlines>
7718 // See: Parsing of "textarea" "listing" and "pre" elements
7719 // from <http://www.w3.org/TR/html5/syntax.html#parsing-main-inbody>
7726 _createInitialChildren: function (transaction, props, context, lazyTree) {
7727 // Intentional use of != to avoid catching zero/false.
7728 var innerHTML = props.dangerouslySetInnerHTML;
7729 if (innerHTML != null) {
7730 if (innerHTML.__html != null) {
7731 DOMLazyTree.queueHTML(lazyTree, innerHTML.__html);
7734 var contentToUse = CONTENT_TYPES[typeof props.children] ? props.children : null;
7735 var childrenToUse = contentToUse != null ? null : props.children;
7736 if (contentToUse != null) {
7737 // TODO: Validate that text is allowed as a child of this node
7738 if ("development" !== 'production') {
7739 setContentChildForInstrumentation.call(this, contentToUse);
7741 DOMLazyTree.queueText(lazyTree, contentToUse);
7742 } else if (childrenToUse != null) {
7743 var mountImages = this.mountChildren(childrenToUse, transaction, context);
7744 for (var i = 0; i < mountImages.length; i++) {
7745 DOMLazyTree.queueChild(lazyTree, mountImages[i]);
7752 * Receives a next element and updates the component.
7755 * @param {ReactElement} nextElement
7756 * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
7757 * @param {object} context
7759 receiveComponent: function (nextElement, transaction, context) {
7760 var prevElement = this._currentElement;
7761 this._currentElement = nextElement;
7762 this.updateComponent(transaction, prevElement, nextElement, context);
7766 * Updates a native DOM component after it has already been allocated and
7767 * attached to the DOM. Reconciles the root DOM node, then recurses.
7769 * @param {ReactReconcileTransaction} transaction
7770 * @param {ReactElement} prevElement
7771 * @param {ReactElement} nextElement
7775 updateComponent: function (transaction, prevElement, nextElement, context) {
7776 var lastProps = prevElement.props;
7777 var nextProps = this._currentElement.props;
7779 switch (this._tag) {
7781 lastProps = ReactDOMButton.getNativeProps(this, lastProps);
7782 nextProps = ReactDOMButton.getNativeProps(this, nextProps);
7785 ReactDOMInput.updateWrapper(this);
7786 lastProps = ReactDOMInput.getNativeProps(this, lastProps);
7787 nextProps = ReactDOMInput.getNativeProps(this, nextProps);
7790 lastProps = ReactDOMOption.getNativeProps(this, lastProps);
7791 nextProps = ReactDOMOption.getNativeProps(this, nextProps);
7794 lastProps = ReactDOMSelect.getNativeProps(this, lastProps);
7795 nextProps = ReactDOMSelect.getNativeProps(this, nextProps);
7798 ReactDOMTextarea.updateWrapper(this);
7799 lastProps = ReactDOMTextarea.getNativeProps(this, lastProps);
7800 nextProps = ReactDOMTextarea.getNativeProps(this, nextProps);
7804 assertValidProps(this, nextProps);
7805 this._updateDOMProperties(lastProps, nextProps, transaction);
7806 this._updateDOMChildren(lastProps, nextProps, transaction, context);
7808 if (this._tag === 'select') {
7809 // <select> value update needs to occur after <option> children
7811 transaction.getReactMountReady().enqueue(postUpdateSelectWrapper, this);
7816 * Reconciles the properties by detecting differences in property values and
7817 * updating the DOM as necessary. This function is probably the single most
7818 * critical path for performance optimization.
7820 * TODO: Benchmark whether checking for changed values in memory actually
7821 * improves performance (especially statically positioned elements).
7822 * TODO: Benchmark the effects of putting this at the top since 99% of props
7823 * do not change for a given reconciliation.
7824 * TODO: Benchmark areas that can be improved with caching.
7827 * @param {object} lastProps
7828 * @param {object} nextProps
7829 * @param {?DOMElement} node
7831 _updateDOMProperties: function (lastProps, nextProps, transaction) {
7835 for (propKey in lastProps) {
7836 if (nextProps.hasOwnProperty(propKey) || !lastProps.hasOwnProperty(propKey) || lastProps[propKey] == null) {
7839 if (propKey === STYLE) {
7840 var lastStyle = this._previousStyleCopy;
7841 for (styleName in lastStyle) {
7842 if (lastStyle.hasOwnProperty(styleName)) {
7843 styleUpdates = styleUpdates || {};
7844 styleUpdates[styleName] = '';
7847 this._previousStyleCopy = null;
7848 } else if (registrationNameModules.hasOwnProperty(propKey)) {
7849 if (lastProps[propKey]) {
7850 // Only call deleteListener if there was a listener previously or
7851 // else willDeleteListener gets called when there wasn't actually a
7852 // listener (e.g., onClick={null})
7853 deleteListener(this, propKey);
7855 } else if (DOMProperty.properties[propKey] || DOMProperty.isCustomAttribute(propKey)) {
7856 DOMPropertyOperations.deleteValueForProperty(getNode(this), propKey);
7859 for (propKey in nextProps) {
7860 var nextProp = nextProps[propKey];
7861 var lastProp = propKey === STYLE ? this._previousStyleCopy : lastProps != null ? lastProps[propKey] : undefined;
7862 if (!nextProps.hasOwnProperty(propKey) || nextProp === lastProp || nextProp == null && lastProp == null) {
7865 if (propKey === STYLE) {
7867 if ("development" !== 'production') {
7868 checkAndWarnForMutatedStyle(this._previousStyleCopy, this._previousStyle, this);
7869 this._previousStyle = nextProp;
7871 nextProp = this._previousStyleCopy = _assign({}, nextProp);
7873 this._previousStyleCopy = null;
7876 // Unset styles on `lastProp` but not on `nextProp`.
7877 for (styleName in lastProp) {
7878 if (lastProp.hasOwnProperty(styleName) && (!nextProp || !nextProp.hasOwnProperty(styleName))) {
7879 styleUpdates = styleUpdates || {};
7880 styleUpdates[styleName] = '';
7883 // Update styles that changed since `lastProp`.
7884 for (styleName in nextProp) {
7885 if (nextProp.hasOwnProperty(styleName) && lastProp[styleName] !== nextProp[styleName]) {
7886 styleUpdates = styleUpdates || {};
7887 styleUpdates[styleName] = nextProp[styleName];
7891 // Relies on `updateStylesByID` not mutating `styleUpdates`.
7892 styleUpdates = nextProp;
7894 } else if (registrationNameModules.hasOwnProperty(propKey)) {
7896 enqueuePutListener(this, propKey, nextProp, transaction);
7897 } else if (lastProp) {
7898 deleteListener(this, propKey);
7900 } else if (isCustomComponent(this._tag, nextProps)) {
7901 if (!RESERVED_PROPS.hasOwnProperty(propKey)) {
7902 DOMPropertyOperations.setValueForAttribute(getNode(this), propKey, nextProp);
7904 } else if (DOMProperty.properties[propKey] || DOMProperty.isCustomAttribute(propKey)) {
7905 var node = getNode(this);
7906 // If we're updating to null or undefined, we should remove the property
7907 // from the DOM node instead of inadvertently setting to a string. This
7908 // brings us in line with the same behavior we have on initial render.
7909 if (nextProp != null) {
7910 DOMPropertyOperations.setValueForProperty(node, propKey, nextProp);
7912 DOMPropertyOperations.deleteValueForProperty(node, propKey);
7917 CSSPropertyOperations.setValueForStyles(getNode(this), styleUpdates, this);
7922 * Reconciles the children with the various properties that affect the
7925 * @param {object} lastProps
7926 * @param {object} nextProps
7927 * @param {ReactReconcileTransaction} transaction
7928 * @param {object} context
7930 _updateDOMChildren: function (lastProps, nextProps, transaction, context) {
7931 var lastContent = CONTENT_TYPES[typeof lastProps.children] ? lastProps.children : null;
7932 var nextContent = CONTENT_TYPES[typeof nextProps.children] ? nextProps.children : null;
7934 var lastHtml = lastProps.dangerouslySetInnerHTML && lastProps.dangerouslySetInnerHTML.__html;
7935 var nextHtml = nextProps.dangerouslySetInnerHTML && nextProps.dangerouslySetInnerHTML.__html;
7937 // Note the use of `!=` which checks for null or undefined.
7938 var lastChildren = lastContent != null ? null : lastProps.children;
7939 var nextChildren = nextContent != null ? null : nextProps.children;
7941 // If we're switching from children to content/html or vice versa, remove
7943 var lastHasContentOrHtml = lastContent != null || lastHtml != null;
7944 var nextHasContentOrHtml = nextContent != null || nextHtml != null;
7945 if (lastChildren != null && nextChildren == null) {
7946 this.updateChildren(null, transaction, context);
7947 } else if (lastHasContentOrHtml && !nextHasContentOrHtml) {
7948 this.updateTextContent('');
7949 if ("development" !== 'production') {
7950 ReactInstrumentation.debugTool.onSetChildren(this._debugID, []);
7954 if (nextContent != null) {
7955 if (lastContent !== nextContent) {
7956 this.updateTextContent('' + nextContent);
7957 if ("development" !== 'production') {
7958 this._contentDebugID = this._debugID + '#text';
7959 setContentChildForInstrumentation.call(this, nextContent);
7962 } else if (nextHtml != null) {
7963 if (lastHtml !== nextHtml) {
7964 this.updateMarkup('' + nextHtml);
7966 if ("development" !== 'production') {
7967 ReactInstrumentation.debugTool.onSetChildren(this._debugID, []);
7969 } else if (nextChildren != null) {
7970 if ("development" !== 'production') {
7971 if (this._contentDebugID) {
7972 ReactInstrumentation.debugTool.onUnmountComponent(this._contentDebugID);
7973 this._contentDebugID = null;
7977 this.updateChildren(nextChildren, transaction, context);
7981 getNativeNode: function () {
7982 return getNode(this);
7986 * Destroys all event registrations for this instance. Does not remove from
7987 * the DOM. That must be done by the parent.
7991 unmountComponent: function (safely) {
7992 switch (this._tag) {
7999 var listeners = this._wrapperState.listeners;
8001 for (var i = 0; i < listeners.length; i++) {
8002 listeners[i].remove();
8010 * Components like <html> <head> and <body> can't be removed or added
8011 * easily in a cross-browser way, however it's valuable to be able to
8012 * take advantage of React's reconciliation for styling and <title>
8013 * management. So we just document it and throw in dangerous cases.
8015 !false ? "development" !== 'production' ? invariant(false, '<%s> tried to unmount. Because of cross-browser quirks it is ' + 'impossible to unmount some top-level components (eg <html>, ' + '<head>, and <body>) reliably and efficiently. To fix this, have a ' + 'single top-level component that never unmounts render these ' + 'elements.', this._tag) : invariant(false) : void 0;
8019 this.unmountChildren(safely);
8020 ReactDOMComponentTree.uncacheNode(this);
8021 EventPluginHub.deleteAllListeners(this);
8022 ReactComponentBrowserEnvironment.unmountIDFromEnvironment(this._rootNodeID);
8023 this._rootNodeID = null;
8025 this._wrapperState = null;
8027 if ("development" !== 'production') {
8028 if (this._contentDebugID) {
8029 ReactInstrumentation.debugTool.onUnmountComponent(this._contentDebugID);
8030 this._contentDebugID = null;
8035 getPublicInstance: function () {
8036 return getNode(this);
8041 _assign(ReactDOMComponent.prototype, ReactDOMComponent.Mixin, ReactMultiChild.Mixin);
8043 module.exports = ReactDOMComponent;
8044 },{"1":1,"10":10,"11":11,"131":131,"145":145,"156":156,"16":16,"165":165,"17":17,"173":173,"177":177,"18":18,"182":182,"183":183,"184":184,"28":28,"35":35,"4":4,"42":42,"44":44,"45":45,"52":52,"54":54,"55":55,"59":59,"76":76,"8":8,"81":81,"9":9,"97":97}],44:[function(_dereq_,module,exports){
8046 * Copyright 2015-present, Facebook, Inc.
8047 * All rights reserved.
8049 * This source code is licensed under the BSD-style license found in the
8050 * LICENSE file in the root directory of this source tree. An additional grant
8051 * of patent rights can be found in the PATENTS file in the same directory.
8053 * @providesModule ReactDOMComponentFlags
8058 var ReactDOMComponentFlags = {
8059 hasCachedChildNodes: 1 << 0
8062 module.exports = ReactDOMComponentFlags;
8063 },{}],45:[function(_dereq_,module,exports){
8065 * Copyright 2013-present, Facebook, Inc.
8066 * All rights reserved.
8068 * This source code is licensed under the BSD-style license found in the
8069 * LICENSE file in the root directory of this source tree. An additional grant
8070 * of patent rights can be found in the PATENTS file in the same directory.
8072 * @providesModule ReactDOMComponentTree
8077 var DOMProperty = _dereq_(10);
8078 var ReactDOMComponentFlags = _dereq_(44);
8080 var invariant = _dereq_(173);
8082 var ATTR_NAME = DOMProperty.ID_ATTRIBUTE_NAME;
8083 var Flags = ReactDOMComponentFlags;
8085 var internalInstanceKey = '__reactInternalInstance$' + Math.random().toString(36).slice(2);
8088 * Drill down (through composites and empty components) until we get a native or
8089 * native text component.
8091 * This is pretty polymorphic but unavoidable with the current structure we have
8092 * for `_renderedChildren`.
8094 function getRenderedNativeOrTextFromComponent(component) {
8096 while (rendered = component._renderedComponent) {
8097 component = rendered;
8103 * Populate `_nativeNode` on the rendered native/text component with the given
8104 * DOM node. The passed `inst` can be a composite.
8106 function precacheNode(inst, node) {
8107 var nativeInst = getRenderedNativeOrTextFromComponent(inst);
8108 nativeInst._nativeNode = node;
8109 node[internalInstanceKey] = nativeInst;
8112 function uncacheNode(inst) {
8113 var node = inst._nativeNode;
8115 delete node[internalInstanceKey];
8116 inst._nativeNode = null;
8121 * Populate `_nativeNode` on each child of `inst`, assuming that the children
8122 * match up with the DOM (element) children of `node`.
8124 * We cache entire levels at once to avoid an n^2 problem where we access the
8125 * children of a node sequentially and have to walk from the start to our target
8128 * Since we update `_renderedChildren` and the actual DOM at (slightly)
8129 * different times, we could race here and see a newer `_renderedChildren` than
8130 * the DOM nodes we see. To avoid this, ReactMultiChild calls
8131 * `prepareToManageChildren` before we change `_renderedChildren`, at which
8132 * time the container's child nodes are always cached (until it unmounts).
8134 function precacheChildNodes(inst, node) {
8135 if (inst._flags & Flags.hasCachedChildNodes) {
8138 var children = inst._renderedChildren;
8139 var childNode = node.firstChild;
8140 outer: for (var name in children) {
8141 if (!children.hasOwnProperty(name)) {
8144 var childInst = children[name];
8145 var childID = getRenderedNativeOrTextFromComponent(childInst)._domID;
8146 if (childID == null) {
8147 // We're currently unmounting this child in ReactMultiChild; skip it.
8150 // We assume the child nodes are in the same order as the child instances.
8151 for (; childNode !== null; childNode = childNode.nextSibling) {
8152 if (childNode.nodeType === 1 && childNode.getAttribute(ATTR_NAME) === String(childID) || childNode.nodeType === 8 && childNode.nodeValue === ' react-text: ' + childID + ' ' || childNode.nodeType === 8 && childNode.nodeValue === ' react-empty: ' + childID + ' ') {
8153 precacheNode(childInst, childNode);
8157 // We reached the end of the DOM children without finding an ID match.
8158 !false ? "development" !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : invariant(false) : void 0;
8160 inst._flags |= Flags.hasCachedChildNodes;
8164 * Given a DOM node, return the closest ReactDOMComponent or
8165 * ReactDOMTextComponent instance ancestor.
8167 function getClosestInstanceFromNode(node) {
8168 if (node[internalInstanceKey]) {
8169 return node[internalInstanceKey];
8172 // Walk up the tree until we find an ancestor whose instance we have cached.
8174 while (!node[internalInstanceKey]) {
8176 if (node.parentNode) {
8177 node = node.parentNode;
8179 // Top of the tree. This node must not be part of a React tree (or is
8180 // unmounted, potentially).
8187 for (; node && (inst = node[internalInstanceKey]); node = parents.pop()) {
8189 if (parents.length) {
8190 precacheChildNodes(inst, node);
8198 * Given a DOM node, return the ReactDOMComponent or ReactDOMTextComponent
8199 * instance, or null if the node was not rendered by this React.
8201 function getInstanceFromNode(node) {
8202 var inst = getClosestInstanceFromNode(node);
8203 if (inst != null && inst._nativeNode === node) {
8211 * Given a ReactDOMComponent or ReactDOMTextComponent, return the corresponding
8214 function getNodeFromInstance(inst) {
8215 // Without this first invariant, passing a non-DOM-component triggers the next
8216 // invariant for a missing parent, which is super confusing.
8217 !(inst._nativeNode !== undefined) ? "development" !== 'production' ? invariant(false, 'getNodeFromInstance: Invalid argument.') : invariant(false) : void 0;
8219 if (inst._nativeNode) {
8220 return inst._nativeNode;
8223 // Walk up the tree until we find an ancestor whose DOM node we have cached.
8225 while (!inst._nativeNode) {
8227 !inst._nativeParent ? "development" !== 'production' ? invariant(false, 'React DOM tree root should always have a node reference.') : invariant(false) : void 0;
8228 inst = inst._nativeParent;
8231 // Now parents contains each ancestor that does *not* have a cached native
8232 // node, and `inst` is the deepest ancestor that does.
8233 for (; parents.length; inst = parents.pop()) {
8234 precacheChildNodes(inst, inst._nativeNode);
8237 return inst._nativeNode;
8240 var ReactDOMComponentTree = {
8241 getClosestInstanceFromNode: getClosestInstanceFromNode,
8242 getInstanceFromNode: getInstanceFromNode,
8243 getNodeFromInstance: getNodeFromInstance,
8244 precacheChildNodes: precacheChildNodes,
8245 precacheNode: precacheNode,
8246 uncacheNode: uncacheNode
8249 module.exports = ReactDOMComponentTree;
8250 },{"10":10,"173":173,"44":44}],46:[function(_dereq_,module,exports){
8252 * Copyright 2013-present, Facebook, Inc.
8253 * All rights reserved.
8255 * This source code is licensed under the BSD-style license found in the
8256 * LICENSE file in the root directory of this source tree. An additional grant
8257 * of patent rights can be found in the PATENTS file in the same directory.
8259 * @providesModule ReactDOMContainerInfo
8264 var validateDOMNesting = _dereq_(156);
8266 var DOC_NODE_TYPE = 9;
8268 function ReactDOMContainerInfo(topLevelWrapper, node) {
8270 _topLevelWrapper: topLevelWrapper,
8272 _ownerDocument: node ? node.nodeType === DOC_NODE_TYPE ? node : node.ownerDocument : null,
8274 _tag: node ? node.nodeName.toLowerCase() : null,
8275 _namespaceURI: node ? node.namespaceURI : null
8277 if ("development" !== 'production') {
8278 info._ancestorInfo = node ? validateDOMNesting.updatedAncestorInfo(null, info._tag, null) : null;
8283 module.exports = ReactDOMContainerInfo;
8284 },{"156":156}],47:[function(_dereq_,module,exports){
8286 * Copyright 2013-present, Facebook, Inc.
8287 * All rights reserved.
8289 * This source code is licensed under the BSD-style license found in the
8290 * LICENSE file in the root directory of this source tree. An additional grant
8291 * of patent rights can be found in the PATENTS file in the same directory.
8293 * @providesModule ReactDOMDebugTool
8298 var ReactDOMUnknownPropertyDevtool = _dereq_(61);
8300 var warning = _dereq_(183);
8302 var eventHandlers = [];
8303 var handlerDoesThrowForEvent = {};
8305 function emitEvent(handlerFunctionName, arg1, arg2, arg3, arg4, arg5) {
8306 if ("development" !== 'production') {
8307 eventHandlers.forEach(function (handler) {
8309 if (handler[handlerFunctionName]) {
8310 handler[handlerFunctionName](arg1, arg2, arg3, arg4, arg5);
8313 "development" !== 'production' ? warning(!handlerDoesThrowForEvent[handlerFunctionName], 'exception thrown by devtool while handling %s: %s', handlerFunctionName, e.message) : void 0;
8314 handlerDoesThrowForEvent[handlerFunctionName] = true;
8320 var ReactDOMDebugTool = {
8321 addDevtool: function (devtool) {
8322 eventHandlers.push(devtool);
8324 removeDevtool: function (devtool) {
8325 for (var i = 0; i < eventHandlers.length; i++) {
8326 if (eventHandlers[i] === devtool) {
8327 eventHandlers.splice(i, 1);
8332 onCreateMarkupForProperty: function (name, value) {
8333 emitEvent('onCreateMarkupForProperty', name, value);
8335 onSetValueForProperty: function (node, name, value) {
8336 emitEvent('onSetValueForProperty', node, name, value);
8338 onDeleteValueForProperty: function (node, name) {
8339 emitEvent('onDeleteValueForProperty', node, name);
8343 ReactDOMDebugTool.addDevtool(ReactDOMUnknownPropertyDevtool);
8345 module.exports = ReactDOMDebugTool;
8346 },{"183":183,"61":61}],48:[function(_dereq_,module,exports){
8348 * Copyright 2014-present, Facebook, Inc.
8349 * All rights reserved.
8351 * This source code is licensed under the BSD-style license found in the
8352 * LICENSE file in the root directory of this source tree. An additional grant
8353 * of patent rights can be found in the PATENTS file in the same directory.
8355 * @providesModule ReactDOMEmptyComponent
8360 var _assign = _dereq_(184);
8362 var DOMLazyTree = _dereq_(8);
8363 var ReactDOMComponentTree = _dereq_(45);
8365 var ReactDOMEmptyComponent = function (instantiate) {
8366 // ReactCompositeComponent uses this:
8367 this._currentElement = null;
8368 // ReactDOMComponentTree uses these:
8369 this._nativeNode = null;
8370 this._nativeParent = null;
8371 this._nativeContainerInfo = null;
8374 _assign(ReactDOMEmptyComponent.prototype, {
8375 mountComponent: function (transaction, nativeParent, nativeContainerInfo, context) {
8376 var domID = nativeContainerInfo._idCounter++;
8377 this._domID = domID;
8378 this._nativeParent = nativeParent;
8379 this._nativeContainerInfo = nativeContainerInfo;
8381 var nodeValue = ' react-empty: ' + this._domID + ' ';
8382 if (transaction.useCreateElement) {
8383 var ownerDocument = nativeContainerInfo._ownerDocument;
8384 var node = ownerDocument.createComment(nodeValue);
8385 ReactDOMComponentTree.precacheNode(this, node);
8386 return DOMLazyTree(node);
8388 if (transaction.renderToStaticMarkup) {
8389 // Normally we'd insert a comment node, but since this is a situation
8390 // where React won't take over (static pages), we can simply return
8394 return '<!--' + nodeValue + '-->';
8397 receiveComponent: function () {},
8398 getNativeNode: function () {
8399 return ReactDOMComponentTree.getNodeFromInstance(this);
8401 unmountComponent: function () {
8402 ReactDOMComponentTree.uncacheNode(this);
8406 module.exports = ReactDOMEmptyComponent;
8407 },{"184":184,"45":45,"8":8}],49:[function(_dereq_,module,exports){
8409 * Copyright 2013-present, Facebook, Inc.
8410 * All rights reserved.
8412 * This source code is licensed under the BSD-style license found in the
8413 * LICENSE file in the root directory of this source tree. An additional grant
8414 * of patent rights can be found in the PATENTS file in the same directory.
8416 * @providesModule ReactDOMFactories
8421 var ReactElement = _dereq_(65);
8422 var ReactElementValidator = _dereq_(66);
8424 var mapObject = _dereq_(178);
8427 * Create a factory that creates HTML tag elements.
8429 * @param {string} tag Tag name (e.g. `div`).
8432 function createDOMFactory(tag) {
8433 if ("development" !== 'production') {
8434 return ReactElementValidator.createFactory(tag);
8436 return ReactElement.createFactory(tag);
8440 * Creates a mapping from supported HTML tags to `ReactDOMComponent` classes.
8441 * This is also accessible via `React.DOM`.
8445 var ReactDOMFactories = mapObject({
8458 blockquote: 'blockquote',
8467 colgroup: 'colgroup',
8469 datalist: 'datalist',
8480 fieldset: 'fieldset',
8481 figcaption: 'figcaption',
8511 menuitem: 'menuitem',
8515 noscript: 'noscript',
8518 optgroup: 'optgroup',
8525 progress: 'progress',
8546 textarea: 'textarea',
8562 clipPath: 'clipPath',
8568 linearGradient: 'linearGradient',
8573 polyline: 'polyline',
8574 radialGradient: 'radialGradient',
8581 }, createDOMFactory);
8583 module.exports = ReactDOMFactories;
8584 },{"178":178,"65":65,"66":66}],50:[function(_dereq_,module,exports){
8586 * Copyright 2013-present, Facebook, Inc.
8587 * All rights reserved.
8589 * This source code is licensed under the BSD-style license found in the
8590 * LICENSE file in the root directory of this source tree. An additional grant
8591 * of patent rights can be found in the PATENTS file in the same directory.
8593 * @providesModule ReactDOMFeatureFlags
8598 var ReactDOMFeatureFlags = {
8599 useCreateElement: true
8602 module.exports = ReactDOMFeatureFlags;
8603 },{}],51:[function(_dereq_,module,exports){
8605 * Copyright 2013-present, Facebook, Inc.
8606 * All rights reserved.
8608 * This source code is licensed under the BSD-style license found in the
8609 * LICENSE file in the root directory of this source tree. An additional grant
8610 * of patent rights can be found in the PATENTS file in the same directory.
8612 * @providesModule ReactDOMIDOperations
8617 var DOMChildrenOperations = _dereq_(7);
8618 var ReactDOMComponentTree = _dereq_(45);
8621 * Operations used to process updates to DOM nodes.
8623 var ReactDOMIDOperations = {
8626 * Updates a component's children by processing a series of updates.
8628 * @param {array<object>} updates List of update configurations.
8631 dangerouslyProcessChildrenUpdates: function (parentInst, updates) {
8632 var node = ReactDOMComponentTree.getNodeFromInstance(parentInst);
8633 DOMChildrenOperations.processUpdates(node, updates);
8637 module.exports = ReactDOMIDOperations;
8638 },{"45":45,"7":7}],52:[function(_dereq_,module,exports){
8640 * Copyright 2013-present, Facebook, Inc.
8641 * All rights reserved.
8643 * This source code is licensed under the BSD-style license found in the
8644 * LICENSE file in the root directory of this source tree. An additional grant
8645 * of patent rights can be found in the PATENTS file in the same directory.
8647 * @providesModule ReactDOMInput
8652 var _assign = _dereq_(184);
8654 var DisabledInputUtils = _dereq_(14);
8655 var DOMPropertyOperations = _dereq_(11);
8656 var LinkedValueUtils = _dereq_(25);
8657 var ReactDOMComponentTree = _dereq_(45);
8658 var ReactUpdates = _dereq_(104);
8660 var invariant = _dereq_(173);
8661 var warning = _dereq_(183);
8663 var didWarnValueLink = false;
8664 var didWarnCheckedLink = false;
8665 var didWarnValueNull = false;
8666 var didWarnValueDefaultValue = false;
8667 var didWarnCheckedDefaultChecked = false;
8668 var didWarnControlledToUncontrolled = false;
8669 var didWarnUncontrolledToControlled = false;
8671 function forceUpdateIfMounted() {
8672 if (this._rootNodeID) {
8673 // DOM component is still mounted; update
8674 ReactDOMInput.updateWrapper(this);
8678 function warnIfValueIsNull(props) {
8679 if (props != null && props.value === null && !didWarnValueNull) {
8680 "development" !== 'production' ? warning(false, '`value` prop on `input` should not be null. ' + 'Consider using the empty string to clear the component or `undefined` ' + 'for uncontrolled components.') : void 0;
8682 didWarnValueNull = true;
8687 * Implements an <input> native component that allows setting these optional
8688 * props: `checked`, `value`, `defaultChecked`, and `defaultValue`.
8690 * If `checked` or `value` are not supplied (or null/undefined), user actions
8691 * that affect the checked state or value will trigger updates to the element.
8693 * If they are supplied (and not null/undefined), the rendered element will not
8694 * trigger updates to the element. Instead, the props must change in order for
8695 * the rendered element to be updated.
8697 * The rendered element will be initialized as unchecked (or `defaultChecked`)
8698 * with an empty value (or `defaultValue`).
8700 * @see http://www.w3.org/TR/2012/WD-html5-20121025/the-input-element.html
8702 var ReactDOMInput = {
8703 getNativeProps: function (inst, props) {
8704 var value = LinkedValueUtils.getValue(props);
8705 var checked = LinkedValueUtils.getChecked(props);
8707 var nativeProps = _assign({
8708 // Make sure we set .type before any other properties (setting .value
8709 // before .type means .value is lost in IE11 and below)
8711 }, DisabledInputUtils.getNativeProps(inst, props), {
8712 defaultChecked: undefined,
8713 defaultValue: undefined,
8714 value: value != null ? value : inst._wrapperState.initialValue,
8715 checked: checked != null ? checked : inst._wrapperState.initialChecked,
8716 onChange: inst._wrapperState.onChange
8722 mountWrapper: function (inst, props) {
8723 if ("development" !== 'production') {
8724 LinkedValueUtils.checkPropTypes('input', props, inst._currentElement._owner);
8726 var owner = inst._currentElement._owner;
8728 if (props.valueLink !== undefined && !didWarnValueLink) {
8729 "development" !== 'production' ? warning(false, '`valueLink` prop on `input` is deprecated; set `value` and `onChange` instead.') : void 0;
8730 didWarnValueLink = true;
8732 if (props.checkedLink !== undefined && !didWarnCheckedLink) {
8733 "development" !== 'production' ? warning(false, '`checkedLink` prop on `input` is deprecated; set `value` and `onChange` instead.') : void 0;
8734 didWarnCheckedLink = true;
8736 if (props.checked !== undefined && props.defaultChecked !== undefined && !didWarnCheckedDefaultChecked) {
8737 "development" !== 'production' ? warning(false, '%s contains an input of type %s with both checked and defaultChecked props. ' + 'Input elements must be either controlled or uncontrolled ' + '(specify either the checked prop, or the defaultChecked prop, but not ' + 'both). Decide between using a controlled or uncontrolled input ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components', owner && owner.getName() || 'A component', props.type) : void 0;
8738 didWarnCheckedDefaultChecked = true;
8740 if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValueDefaultValue) {
8741 "development" !== 'production' ? warning(false, '%s contains an input of type %s with both value and defaultValue props. ' + 'Input elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled input ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components', owner && owner.getName() || 'A component', props.type) : void 0;
8742 didWarnValueDefaultValue = true;
8744 warnIfValueIsNull(props);
8747 var defaultValue = props.defaultValue;
8748 inst._wrapperState = {
8749 initialChecked: props.defaultChecked || false,
8750 initialValue: defaultValue != null ? defaultValue : null,
8752 onChange: _handleChange.bind(inst)
8755 if ("development" !== 'production') {
8756 inst._wrapperState.controlled = props.checked !== undefined || props.value !== undefined;
8760 updateWrapper: function (inst) {
8761 var props = inst._currentElement.props;
8763 if ("development" !== 'production') {
8764 warnIfValueIsNull(props);
8766 var initialValue = inst._wrapperState.initialChecked || inst._wrapperState.initialValue;
8767 var defaultValue = props.defaultChecked || props.defaultValue;
8768 var controlled = props.checked !== undefined || props.value !== undefined;
8769 var owner = inst._currentElement._owner;
8771 if ((initialValue || !inst._wrapperState.controlled) && controlled && !didWarnUncontrolledToControlled) {
8772 "development" !== 'production' ? warning(false, '%s is changing an uncontrolled input of type %s to be controlled. ' + 'Input elements should not switch from uncontrolled to controlled (or vice versa). ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://fb.me/react-controlled-components', owner && owner.getName() || 'A component', props.type) : void 0;
8773 didWarnUncontrolledToControlled = true;
8775 if (inst._wrapperState.controlled && (defaultValue || !controlled) && !didWarnControlledToUncontrolled) {
8776 "development" !== 'production' ? warning(false, '%s is changing a controlled input of type %s to be uncontrolled. ' + 'Input elements should not switch from controlled to uncontrolled (or vice versa). ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://fb.me/react-controlled-components', owner && owner.getName() || 'A component', props.type) : void 0;
8777 didWarnControlledToUncontrolled = true;
8781 // TODO: Shouldn't this be getChecked(props)?
8782 var checked = props.checked;
8783 if (checked != null) {
8784 DOMPropertyOperations.setValueForProperty(ReactDOMComponentTree.getNodeFromInstance(inst), 'checked', checked || false);
8787 var value = LinkedValueUtils.getValue(props);
8788 if (value != null) {
8789 // Cast `value` to a string to ensure the value is set correctly. While
8790 // browsers typically do this as necessary, jsdom doesn't.
8791 DOMPropertyOperations.setValueForProperty(ReactDOMComponentTree.getNodeFromInstance(inst), 'value', '' + value);
8796 function _handleChange(event) {
8797 var props = this._currentElement.props;
8799 var returnValue = LinkedValueUtils.executeOnChange(props, event);
8801 // Here we use asap to wait until all updates have propagated, which
8802 // is important when using controlled components within layers:
8803 // https://github.com/facebook/react/issues/1698
8804 ReactUpdates.asap(forceUpdateIfMounted, this);
8806 var name = props.name;
8807 if (props.type === 'radio' && name != null) {
8808 var rootNode = ReactDOMComponentTree.getNodeFromInstance(this);
8809 var queryRoot = rootNode;
8811 while (queryRoot.parentNode) {
8812 queryRoot = queryRoot.parentNode;
8815 // If `rootNode.form` was non-null, then we could try `form.elements`,
8816 // but that sometimes behaves strangely in IE8. We could also try using
8817 // `form.getElementsByName`, but that will only return direct children
8818 // and won't include inputs that use the HTML5 `form=` attribute. Since
8819 // the input might not even be in a form, let's just use the global
8820 // `querySelectorAll` to ensure we don't miss anything.
8821 var group = queryRoot.querySelectorAll('input[name=' + JSON.stringify('' + name) + '][type="radio"]');
8823 for (var i = 0; i < group.length; i++) {
8824 var otherNode = group[i];
8825 if (otherNode === rootNode || otherNode.form !== rootNode.form) {
8828 // This will throw if radio buttons rendered by different copies of React
8829 // and the same name are rendered into the same form (same as #1939).
8830 // That's probably okay; we don't support it just as we don't support
8831 // mixing React radio buttons with non-React ones.
8832 var otherInstance = ReactDOMComponentTree.getInstanceFromNode(otherNode);
8833 !otherInstance ? "development" !== 'production' ? invariant(false, 'ReactDOMInput: Mixing React and non-React radio inputs with the ' + 'same `name` is not supported.') : invariant(false) : void 0;
8834 // If this is a controlled radio button group, forcing the input that
8835 // was previously checked to update will cause it to be come re-checked
8837 ReactUpdates.asap(forceUpdateIfMounted, otherInstance);
8844 module.exports = ReactDOMInput;
8845 },{"104":104,"11":11,"14":14,"173":173,"183":183,"184":184,"25":25,"45":45}],53:[function(_dereq_,module,exports){
8847 * Copyright 2013-present, Facebook, Inc.
8848 * All rights reserved.
8850 * This source code is licensed under the BSD-style license found in the
8851 * LICENSE file in the root directory of this source tree. An additional grant
8852 * of patent rights can be found in the PATENTS file in the same directory.
8854 * @providesModule ReactDOMInstrumentation
8859 var ReactDOMDebugTool = _dereq_(47);
8861 module.exports = { debugTool: ReactDOMDebugTool };
8862 },{"47":47}],54:[function(_dereq_,module,exports){
8864 * Copyright 2013-present, Facebook, Inc.
8865 * All rights reserved.
8867 * This source code is licensed under the BSD-style license found in the
8868 * LICENSE file in the root directory of this source tree. An additional grant
8869 * of patent rights can be found in the PATENTS file in the same directory.
8871 * @providesModule ReactDOMOption
8876 var _assign = _dereq_(184);
8878 var ReactChildren = _dereq_(32);
8879 var ReactDOMComponentTree = _dereq_(45);
8880 var ReactDOMSelect = _dereq_(55);
8882 var warning = _dereq_(183);
8885 * Implements an <option> native component that warns when `selected` is set.
8887 var ReactDOMOption = {
8888 mountWrapper: function (inst, props, nativeParent) {
8889 // TODO (yungsters): Remove support for `selected` in <option>.
8890 if ("development" !== 'production') {
8891 "development" !== 'production' ? warning(props.selected == null, 'Use the `defaultValue` or `value` props on <select> instead of ' + 'setting `selected` on <option>.') : void 0;
8894 // Look up whether this option is 'selected'
8895 var selectValue = null;
8896 if (nativeParent != null) {
8897 var selectParent = nativeParent;
8899 if (selectParent._tag === 'optgroup') {
8900 selectParent = selectParent._nativeParent;
8903 if (selectParent != null && selectParent._tag === 'select') {
8904 selectValue = ReactDOMSelect.getSelectValueContext(selectParent);
8908 // If the value is null (e.g., no specified value or after initial mount)
8909 // or missing (e.g., for <datalist>), we don't change props.selected
8910 var selected = null;
8911 if (selectValue != null) {
8913 if (Array.isArray(selectValue)) {
8915 for (var i = 0; i < selectValue.length; i++) {
8916 if ('' + selectValue[i] === '' + props.value) {
8922 selected = '' + selectValue === '' + props.value;
8926 inst._wrapperState = { selected: selected };
8929 postMountWrapper: function (inst) {
8930 // value="" should make a value attribute (#6219)
8931 var props = inst._currentElement.props;
8932 if (props.value != null) {
8933 var node = ReactDOMComponentTree.getNodeFromInstance(inst);
8934 node.setAttribute('value', props.value);
8938 getNativeProps: function (inst, props) {
8939 var nativeProps = _assign({ selected: undefined, children: undefined }, props);
8941 // Read state only from initial mount because <select> updates value
8942 // manually; we need the initial state only for server rendering
8943 if (inst._wrapperState.selected != null) {
8944 nativeProps.selected = inst._wrapperState.selected;
8949 // Flatten children and warn if they aren't strings or numbers;
8950 // invalid types are ignored.
8951 ReactChildren.forEach(props.children, function (child) {
8952 if (child == null) {
8955 if (typeof child === 'string' || typeof child === 'number') {
8958 "development" !== 'production' ? warning(false, 'Only strings and numbers are supported as <option> children.') : void 0;
8963 nativeProps.children = content;
8971 module.exports = ReactDOMOption;
8972 },{"183":183,"184":184,"32":32,"45":45,"55":55}],55:[function(_dereq_,module,exports){
8974 * Copyright 2013-present, Facebook, Inc.
8975 * All rights reserved.
8977 * This source code is licensed under the BSD-style license found in the
8978 * LICENSE file in the root directory of this source tree. An additional grant
8979 * of patent rights can be found in the PATENTS file in the same directory.
8981 * @providesModule ReactDOMSelect
8986 var _assign = _dereq_(184);
8988 var DisabledInputUtils = _dereq_(14);
8989 var LinkedValueUtils = _dereq_(25);
8990 var ReactDOMComponentTree = _dereq_(45);
8991 var ReactUpdates = _dereq_(104);
8993 var warning = _dereq_(183);
8995 var didWarnValueLink = false;
8996 var didWarnValueNull = false;
8997 var didWarnValueDefaultValue = false;
8999 function updateOptionsIfPendingUpdateAndMounted() {
9000 if (this._rootNodeID && this._wrapperState.pendingUpdate) {
9001 this._wrapperState.pendingUpdate = false;
9003 var props = this._currentElement.props;
9004 var value = LinkedValueUtils.getValue(props);
9006 if (value != null) {
9007 updateOptions(this, Boolean(props.multiple), value);
9012 function getDeclarationErrorAddendum(owner) {
9014 var name = owner.getName();
9016 return ' Check the render method of `' + name + '`.';
9022 function warnIfValueIsNull(props) {
9023 if (props != null && props.value === null && !didWarnValueNull) {
9024 "development" !== 'production' ? warning(false, '`value` prop on `select` should not be null. ' + 'Consider using the empty string to clear the component or `undefined` ' + 'for uncontrolled components.') : void 0;
9026 didWarnValueNull = true;
9030 var valuePropNames = ['value', 'defaultValue'];
9033 * Validation function for `value` and `defaultValue`.
9036 function checkSelectPropTypes(inst, props) {
9037 var owner = inst._currentElement._owner;
9038 LinkedValueUtils.checkPropTypes('select', props, owner);
9040 if (props.valueLink !== undefined && !didWarnValueLink) {
9041 "development" !== 'production' ? warning(false, '`valueLink` prop on `select` is deprecated; set `value` and `onChange` instead.') : void 0;
9042 didWarnValueLink = true;
9045 for (var i = 0; i < valuePropNames.length; i++) {
9046 var propName = valuePropNames[i];
9047 if (props[propName] == null) {
9050 if (props.multiple) {
9051 "development" !== 'production' ? warning(Array.isArray(props[propName]), 'The `%s` prop supplied to <select> must be an array if ' + '`multiple` is true.%s', propName, getDeclarationErrorAddendum(owner)) : void 0;
9053 "development" !== 'production' ? warning(!Array.isArray(props[propName]), 'The `%s` prop supplied to <select> must be a scalar ' + 'value if `multiple` is false.%s', propName, getDeclarationErrorAddendum(owner)) : void 0;
9059 * @param {ReactDOMComponent} inst
9060 * @param {boolean} multiple
9061 * @param {*} propValue A stringable (with `multiple`, a list of stringables).
9064 function updateOptions(inst, multiple, propValue) {
9065 var selectedValue, i;
9066 var options = ReactDOMComponentTree.getNodeFromInstance(inst).options;
9070 for (i = 0; i < propValue.length; i++) {
9071 selectedValue['' + propValue[i]] = true;
9073 for (i = 0; i < options.length; i++) {
9074 var selected = selectedValue.hasOwnProperty(options[i].value);
9075 if (options[i].selected !== selected) {
9076 options[i].selected = selected;
9080 // Do not set `select.value` as exact behavior isn't consistent across all
9081 // browsers for all cases.
9082 selectedValue = '' + propValue;
9083 for (i = 0; i < options.length; i++) {
9084 if (options[i].value === selectedValue) {
9085 options[i].selected = true;
9089 if (options.length) {
9090 options[0].selected = true;
9096 * Implements a <select> native component that allows optionally setting the
9097 * props `value` and `defaultValue`. If `multiple` is false, the prop must be a
9098 * stringable. If `multiple` is true, the prop must be an array of stringables.
9100 * If `value` is not supplied (or null/undefined), user actions that change the
9101 * selected option will trigger updates to the rendered options.
9103 * If it is supplied (and not null/undefined), the rendered options will not
9104 * update in response to user actions. Instead, the `value` prop must change in
9105 * order for the rendered options to update.
9107 * If `defaultValue` is provided, any options with the supplied values will be
9110 var ReactDOMSelect = {
9111 getNativeProps: function (inst, props) {
9112 return _assign({}, DisabledInputUtils.getNativeProps(inst, props), {
9113 onChange: inst._wrapperState.onChange,
9118 mountWrapper: function (inst, props) {
9119 if ("development" !== 'production') {
9120 checkSelectPropTypes(inst, props);
9121 warnIfValueIsNull(props);
9124 var value = LinkedValueUtils.getValue(props);
9125 inst._wrapperState = {
9126 pendingUpdate: false,
9127 initialValue: value != null ? value : props.defaultValue,
9129 onChange: _handleChange.bind(inst),
9130 wasMultiple: Boolean(props.multiple)
9133 if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValueDefaultValue) {
9134 "development" !== 'production' ? warning(false, 'Select elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled select ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components') : void 0;
9135 didWarnValueDefaultValue = true;
9139 getSelectValueContext: function (inst) {
9140 // ReactDOMOption looks at this initial value so the initial generated
9141 // markup has correct `selected` attributes
9142 return inst._wrapperState.initialValue;
9145 postUpdateWrapper: function (inst) {
9146 var props = inst._currentElement.props;
9147 if ("development" !== 'production') {
9148 warnIfValueIsNull(props);
9151 // After the initial mount, we control selected-ness manually so don't pass
9153 inst._wrapperState.initialValue = undefined;
9155 var wasMultiple = inst._wrapperState.wasMultiple;
9156 inst._wrapperState.wasMultiple = Boolean(props.multiple);
9158 var value = LinkedValueUtils.getValue(props);
9159 if (value != null) {
9160 inst._wrapperState.pendingUpdate = false;
9161 updateOptions(inst, Boolean(props.multiple), value);
9162 } else if (wasMultiple !== Boolean(props.multiple)) {
9163 // For simplicity, reapply `defaultValue` if `multiple` is toggled.
9164 if (props.defaultValue != null) {
9165 updateOptions(inst, Boolean(props.multiple), props.defaultValue);
9167 // Revert the select back to its default unselected state.
9168 updateOptions(inst, Boolean(props.multiple), props.multiple ? [] : '');
9174 function _handleChange(event) {
9175 var props = this._currentElement.props;
9176 var returnValue = LinkedValueUtils.executeOnChange(props, event);
9178 if (this._rootNodeID) {
9179 this._wrapperState.pendingUpdate = true;
9181 ReactUpdates.asap(updateOptionsIfPendingUpdateAndMounted, this);
9185 module.exports = ReactDOMSelect;
9186 },{"104":104,"14":14,"183":183,"184":184,"25":25,"45":45}],56:[function(_dereq_,module,exports){
9188 * Copyright 2013-present, Facebook, Inc.
9189 * All rights reserved.
9191 * This source code is licensed under the BSD-style license found in the
9192 * LICENSE file in the root directory of this source tree. An additional grant
9193 * of patent rights can be found in the PATENTS file in the same directory.
9195 * @providesModule ReactDOMSelection
9200 var ExecutionEnvironment = _dereq_(159);
9202 var getNodeForCharacterOffset = _dereq_(141);
9203 var getTextContentAccessor = _dereq_(142);
9206 * While `isCollapsed` is available on the Selection object and `collapsed`
9207 * is available on the Range object, IE11 sometimes gets them wrong.
9208 * If the anchor/focus nodes and offsets are the same, the range is collapsed.
9210 function isCollapsed(anchorNode, anchorOffset, focusNode, focusOffset) {
9211 return anchorNode === focusNode && anchorOffset === focusOffset;
9215 * Get the appropriate anchor and focus node/offset pairs for IE.
9217 * The catch here is that IE's selection API doesn't provide information
9218 * about whether the selection is forward or backward, so we have to
9219 * behave as though it's always forward.
9221 * IE text differs from modern selection in that it behaves as though
9222 * block elements end with a new line. This means character offsets will
9223 * differ between the two APIs.
9225 * @param {DOMElement} node
9228 function getIEOffsets(node) {
9229 var selection = document.selection;
9230 var selectedRange = selection.createRange();
9231 var selectedLength = selectedRange.text.length;
9233 // Duplicate selection so we can move range without breaking user selection.
9234 var fromStart = selectedRange.duplicate();
9235 fromStart.moveToElementText(node);
9236 fromStart.setEndPoint('EndToStart', selectedRange);
9238 var startOffset = fromStart.text.length;
9239 var endOffset = startOffset + selectedLength;
9248 * @param {DOMElement} node
9251 function getModernOffsets(node) {
9252 var selection = window.getSelection && window.getSelection();
9254 if (!selection || selection.rangeCount === 0) {
9258 var anchorNode = selection.anchorNode;
9259 var anchorOffset = selection.anchorOffset;
9260 var focusNode = selection.focusNode;
9261 var focusOffset = selection.focusOffset;
9263 var currentRange = selection.getRangeAt(0);
9265 // In Firefox, range.startContainer and range.endContainer can be "anonymous
9266 // divs", e.g. the up/down buttons on an <input type="number">. Anonymous
9267 // divs do not seem to expose properties, triggering a "Permission denied
9268 // error" if any of its properties are accessed. The only seemingly possible
9269 // way to avoid erroring is to access a property that typically works for
9270 // non-anonymous divs and catch any error that may otherwise arise. See
9271 // https://bugzilla.mozilla.org/show_bug.cgi?id=208427
9273 /* eslint-disable no-unused-expressions */
9274 currentRange.startContainer.nodeType;
9275 currentRange.endContainer.nodeType;
9276 /* eslint-enable no-unused-expressions */
9281 // If the node and offset values are the same, the selection is collapsed.
9282 // `Selection.isCollapsed` is available natively, but IE sometimes gets
9283 // this value wrong.
9284 var isSelectionCollapsed = isCollapsed(selection.anchorNode, selection.anchorOffset, selection.focusNode, selection.focusOffset);
9286 var rangeLength = isSelectionCollapsed ? 0 : currentRange.toString().length;
9288 var tempRange = currentRange.cloneRange();
9289 tempRange.selectNodeContents(node);
9290 tempRange.setEnd(currentRange.startContainer, currentRange.startOffset);
9292 var isTempRangeCollapsed = isCollapsed(tempRange.startContainer, tempRange.startOffset, tempRange.endContainer, tempRange.endOffset);
9294 var start = isTempRangeCollapsed ? 0 : tempRange.toString().length;
9295 var end = start + rangeLength;
9297 // Detect whether the selection is backward.
9298 var detectionRange = document.createRange();
9299 detectionRange.setStart(anchorNode, anchorOffset);
9300 detectionRange.setEnd(focusNode, focusOffset);
9301 var isBackward = detectionRange.collapsed;
9304 start: isBackward ? end : start,
9305 end: isBackward ? start : end
9310 * @param {DOMElement|DOMTextNode} node
9311 * @param {object} offsets
9313 function setIEOffsets(node, offsets) {
9314 var range = document.selection.createRange().duplicate();
9317 if (offsets.end === undefined) {
9318 start = offsets.start;
9320 } else if (offsets.start > offsets.end) {
9321 start = offsets.end;
9322 end = offsets.start;
9324 start = offsets.start;
9328 range.moveToElementText(node);
9329 range.moveStart('character', start);
9330 range.setEndPoint('EndToStart', range);
9331 range.moveEnd('character', end - start);
9336 * In modern non-IE browsers, we can support both forward and backward
9339 * Note: IE10+ supports the Selection object, but it does not support
9340 * the `extend` method, which means that even in modern IE, it's not possible
9341 * to programmatically create a backward selection. Thus, for all IE
9342 * versions, we use the old IE API to create our selections.
9344 * @param {DOMElement|DOMTextNode} node
9345 * @param {object} offsets
9347 function setModernOffsets(node, offsets) {
9348 if (!window.getSelection) {
9352 var selection = window.getSelection();
9353 var length = node[getTextContentAccessor()].length;
9354 var start = Math.min(offsets.start, length);
9355 var end = offsets.end === undefined ? start : Math.min(offsets.end, length);
9357 // IE 11 uses modern selection, but doesn't support the extend method.
9358 // Flip backward selections, so we can set with a single range.
9359 if (!selection.extend && start > end) {
9365 var startMarker = getNodeForCharacterOffset(node, start);
9366 var endMarker = getNodeForCharacterOffset(node, end);
9368 if (startMarker && endMarker) {
9369 var range = document.createRange();
9370 range.setStart(startMarker.node, startMarker.offset);
9371 selection.removeAllRanges();
9374 selection.addRange(range);
9375 selection.extend(endMarker.node, endMarker.offset);
9377 range.setEnd(endMarker.node, endMarker.offset);
9378 selection.addRange(range);
9383 var useIEOffsets = ExecutionEnvironment.canUseDOM && 'selection' in document && !('getSelection' in window);
9385 var ReactDOMSelection = {
9387 * @param {DOMElement} node
9389 getOffsets: useIEOffsets ? getIEOffsets : getModernOffsets,
9392 * @param {DOMElement|DOMTextNode} node
9393 * @param {object} offsets
9395 setOffsets: useIEOffsets ? setIEOffsets : setModernOffsets
9398 module.exports = ReactDOMSelection;
9399 },{"141":141,"142":142,"159":159}],57:[function(_dereq_,module,exports){
9401 * Copyright 2013-present, Facebook, Inc.
9402 * All rights reserved.
9404 * This source code is licensed under the BSD-style license found in the
9405 * LICENSE file in the root directory of this source tree. An additional grant
9406 * of patent rights can be found in the PATENTS file in the same directory.
9408 * @providesModule ReactDOMServer
9413 var ReactDefaultInjection = _dereq_(64);
9414 var ReactServerRendering = _dereq_(96);
9415 var ReactVersion = _dereq_(105);
9417 ReactDefaultInjection.inject();
9419 var ReactDOMServer = {
9420 renderToString: ReactServerRendering.renderToString,
9421 renderToStaticMarkup: ReactServerRendering.renderToStaticMarkup,
9422 version: ReactVersion
9425 module.exports = ReactDOMServer;
9426 },{"105":105,"64":64,"96":96}],58:[function(_dereq_,module,exports){
9428 * Copyright 2013-present, Facebook, Inc.
9429 * All rights reserved.
9431 * This source code is licensed under the BSD-style license found in the
9432 * LICENSE file in the root directory of this source tree. An additional grant
9433 * of patent rights can be found in the PATENTS file in the same directory.
9435 * @providesModule ReactDOMTextComponent
9440 var _assign = _dereq_(184);
9442 var DOMChildrenOperations = _dereq_(7);
9443 var DOMLazyTree = _dereq_(8);
9444 var ReactDOMComponentTree = _dereq_(45);
9445 var ReactInstrumentation = _dereq_(76);
9447 var escapeTextContentForBrowser = _dereq_(131);
9448 var invariant = _dereq_(173);
9449 var validateDOMNesting = _dereq_(156);
9452 * Text nodes violate a couple assumptions that React makes about components:
9454 * - When mounting text into the DOM, adjacent text nodes are merged.
9455 * - Text nodes cannot be assigned a React root ID.
9457 * This component is used to wrap strings between comment nodes so that they
9458 * can undergo the same reconciliation that is applied to elements.
9460 * TODO: Investigate representing React components in the DOM with text nodes.
9462 * @class ReactDOMTextComponent
9463 * @extends ReactComponent
9466 var ReactDOMTextComponent = function (text) {
9467 // TODO: This is really a ReactText (ReactNode), not a ReactElement
9468 this._currentElement = text;
9469 this._stringText = '' + text;
9470 // ReactDOMComponentTree uses these:
9471 this._nativeNode = null;
9472 this._nativeParent = null;
9476 this._mountIndex = 0;
9477 this._closingComment = null;
9478 this._commentNodes = null;
9481 _assign(ReactDOMTextComponent.prototype, {
9484 * Creates the markup for this text node. This node is not intended to have
9485 * any features besides containing text content.
9487 * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
9488 * @return {string} Markup for this text node.
9491 mountComponent: function (transaction, nativeParent, nativeContainerInfo, context) {
9492 if ("development" !== 'production') {
9493 ReactInstrumentation.debugTool.onSetText(this._debugID, this._stringText);
9496 if (nativeParent != null) {
9497 parentInfo = nativeParent._ancestorInfo;
9498 } else if (nativeContainerInfo != null) {
9499 parentInfo = nativeContainerInfo._ancestorInfo;
9502 // parentInfo should always be present except for the top-level
9503 // component when server rendering
9504 validateDOMNesting('#text', this, parentInfo);
9508 var domID = nativeContainerInfo._idCounter++;
9509 var openingValue = ' react-text: ' + domID + ' ';
9510 var closingValue = ' /react-text ';
9511 this._domID = domID;
9512 this._nativeParent = nativeParent;
9513 if (transaction.useCreateElement) {
9514 var ownerDocument = nativeContainerInfo._ownerDocument;
9515 var openingComment = ownerDocument.createComment(openingValue);
9516 var closingComment = ownerDocument.createComment(closingValue);
9517 var lazyTree = DOMLazyTree(ownerDocument.createDocumentFragment());
9518 DOMLazyTree.queueChild(lazyTree, DOMLazyTree(openingComment));
9519 if (this._stringText) {
9520 DOMLazyTree.queueChild(lazyTree, DOMLazyTree(ownerDocument.createTextNode(this._stringText)));
9522 DOMLazyTree.queueChild(lazyTree, DOMLazyTree(closingComment));
9523 ReactDOMComponentTree.precacheNode(this, openingComment);
9524 this._closingComment = closingComment;
9527 var escapedText = escapeTextContentForBrowser(this._stringText);
9529 if (transaction.renderToStaticMarkup) {
9530 // Normally we'd wrap this between comment nodes for the reasons stated
9531 // above, but since this is a situation where React won't take over
9532 // (static pages), we can simply return the text as it is.
9536 return '<!--' + openingValue + '-->' + escapedText + '<!--' + closingValue + '-->';
9541 * Updates this component by updating the text content.
9543 * @param {ReactText} nextText The next text content
9544 * @param {ReactReconcileTransaction} transaction
9547 receiveComponent: function (nextText, transaction) {
9548 if (nextText !== this._currentElement) {
9549 this._currentElement = nextText;
9550 var nextStringText = '' + nextText;
9551 if (nextStringText !== this._stringText) {
9552 // TODO: Save this as pending props and use performUpdateIfNecessary
9553 // and/or updateComponent to do the actual update for consistency with
9554 // other component types?
9555 this._stringText = nextStringText;
9556 var commentNodes = this.getNativeNode();
9557 DOMChildrenOperations.replaceDelimitedText(commentNodes[0], commentNodes[1], nextStringText);
9559 if ("development" !== 'production') {
9560 ReactInstrumentation.debugTool.onSetText(this._debugID, nextStringText);
9566 getNativeNode: function () {
9567 var nativeNode = this._commentNodes;
9571 if (!this._closingComment) {
9572 var openingComment = ReactDOMComponentTree.getNodeFromInstance(this);
9573 var node = openingComment.nextSibling;
9575 !(node != null) ? "development" !== 'production' ? invariant(false, 'Missing closing comment for text component %s', this._domID) : invariant(false) : void 0;
9576 if (node.nodeType === 8 && node.nodeValue === ' /react-text ') {
9577 this._closingComment = node;
9580 node = node.nextSibling;
9583 nativeNode = [this._nativeNode, this._closingComment];
9584 this._commentNodes = nativeNode;
9588 unmountComponent: function () {
9589 this._closingComment = null;
9590 this._commentNodes = null;
9591 ReactDOMComponentTree.uncacheNode(this);
9596 module.exports = ReactDOMTextComponent;
9597 },{"131":131,"156":156,"173":173,"184":184,"45":45,"7":7,"76":76,"8":8}],59:[function(_dereq_,module,exports){
9599 * Copyright 2013-present, Facebook, Inc.
9600 * All rights reserved.
9602 * This source code is licensed under the BSD-style license found in the
9603 * LICENSE file in the root directory of this source tree. An additional grant
9604 * of patent rights can be found in the PATENTS file in the same directory.
9606 * @providesModule ReactDOMTextarea
9611 var _assign = _dereq_(184);
9613 var DisabledInputUtils = _dereq_(14);
9614 var DOMPropertyOperations = _dereq_(11);
9615 var LinkedValueUtils = _dereq_(25);
9616 var ReactDOMComponentTree = _dereq_(45);
9617 var ReactUpdates = _dereq_(104);
9619 var invariant = _dereq_(173);
9620 var warning = _dereq_(183);
9622 var didWarnValueLink = false;
9623 var didWarnValueNull = false;
9624 var didWarnValDefaultVal = false;
9626 function forceUpdateIfMounted() {
9627 if (this._rootNodeID) {
9628 // DOM component is still mounted; update
9629 ReactDOMTextarea.updateWrapper(this);
9633 function warnIfValueIsNull(props) {
9634 if (props != null && props.value === null && !didWarnValueNull) {
9635 "development" !== 'production' ? warning(false, '`value` prop on `textarea` should not be null. ' + 'Consider using the empty string to clear the component or `undefined` ' + 'for uncontrolled components.') : void 0;
9637 didWarnValueNull = true;
9642 * Implements a <textarea> native component that allows setting `value`, and
9643 * `defaultValue`. This differs from the traditional DOM API because value is
9644 * usually set as PCDATA children.
9646 * If `value` is not supplied (or null/undefined), user actions that affect the
9647 * value will trigger updates to the element.
9649 * If `value` is supplied (and not null/undefined), the rendered element will
9650 * not trigger updates to the element. Instead, the `value` prop must change in
9651 * order for the rendered element to be updated.
9653 * The rendered element will be initialized with an empty value, the prop
9654 * `defaultValue` if specified, or the children content (deprecated).
9656 var ReactDOMTextarea = {
9657 getNativeProps: function (inst, props) {
9658 !(props.dangerouslySetInnerHTML == null) ? "development" !== 'production' ? invariant(false, '`dangerouslySetInnerHTML` does not make sense on <textarea>.') : invariant(false) : void 0;
9660 // Always set children to the same thing. In IE9, the selection range will
9661 // get reset if `textContent` is mutated.
9662 var nativeProps = _assign({}, DisabledInputUtils.getNativeProps(inst, props), {
9663 defaultValue: undefined,
9665 children: inst._wrapperState.initialValue,
9666 onChange: inst._wrapperState.onChange
9672 mountWrapper: function (inst, props) {
9673 if ("development" !== 'production') {
9674 LinkedValueUtils.checkPropTypes('textarea', props, inst._currentElement._owner);
9675 if (props.valueLink !== undefined && !didWarnValueLink) {
9676 "development" !== 'production' ? warning(false, '`valueLink` prop on `textarea` is deprecated; set `value` and `onChange` instead.') : void 0;
9677 didWarnValueLink = true;
9679 if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValDefaultVal) {
9680 "development" !== 'production' ? warning(false, 'Textarea elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled textarea ' + 'and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components') : void 0;
9681 didWarnValDefaultVal = true;
9683 warnIfValueIsNull(props);
9686 var defaultValue = props.defaultValue;
9687 // TODO (yungsters): Remove support for children content in <textarea>.
9688 var children = props.children;
9689 if (children != null) {
9690 if ("development" !== 'production') {
9691 "development" !== 'production' ? warning(false, 'Use the `defaultValue` or `value` props instead of setting ' + 'children on <textarea>.') : void 0;
9693 !(defaultValue == null) ? "development" !== 'production' ? invariant(false, 'If you supply `defaultValue` on a <textarea>, do not pass children.') : invariant(false) : void 0;
9694 if (Array.isArray(children)) {
9695 !(children.length <= 1) ? "development" !== 'production' ? invariant(false, '<textarea> can only have at most one child.') : invariant(false) : void 0;
9696 children = children[0];
9699 defaultValue = '' + children;
9701 if (defaultValue == null) {
9704 var value = LinkedValueUtils.getValue(props);
9705 inst._wrapperState = {
9706 // We save the initial value so that `ReactDOMComponent` doesn't update
9707 // `textContent` (unnecessary since we update value).
9708 // The initial value can be a boolean or object so that's why it's
9709 // forced to be a string.
9710 initialValue: '' + (value != null ? value : defaultValue),
9712 onChange: _handleChange.bind(inst)
9716 updateWrapper: function (inst) {
9717 var props = inst._currentElement.props;
9719 if ("development" !== 'production') {
9720 warnIfValueIsNull(props);
9723 var value = LinkedValueUtils.getValue(props);
9724 if (value != null) {
9725 // Cast `value` to a string to ensure the value is set correctly. While
9726 // browsers typically do this as necessary, jsdom doesn't.
9727 DOMPropertyOperations.setValueForProperty(ReactDOMComponentTree.getNodeFromInstance(inst), 'value', '' + value);
9732 function _handleChange(event) {
9733 var props = this._currentElement.props;
9734 var returnValue = LinkedValueUtils.executeOnChange(props, event);
9735 ReactUpdates.asap(forceUpdateIfMounted, this);
9739 module.exports = ReactDOMTextarea;
9740 },{"104":104,"11":11,"14":14,"173":173,"183":183,"184":184,"25":25,"45":45}],60:[function(_dereq_,module,exports){
9742 * Copyright 2015-present, Facebook, Inc.
9743 * All rights reserved.
9745 * This source code is licensed under the BSD-style license found in the
9746 * LICENSE file in the root directory of this source tree. An additional grant
9747 * of patent rights can be found in the PATENTS file in the same directory.
9749 * @providesModule ReactDOMTreeTraversal
9754 var invariant = _dereq_(173);
9757 * Return the lowest common ancestor of A and B, or null if they are in
9760 function getLowestCommonAncestor(instA, instB) {
9761 !('_nativeNode' in instA) ? "development" !== 'production' ? invariant(false, 'getNodeFromInstance: Invalid argument.') : invariant(false) : void 0;
9762 !('_nativeNode' in instB) ? "development" !== 'production' ? invariant(false, 'getNodeFromInstance: Invalid argument.') : invariant(false) : void 0;
9765 for (var tempA = instA; tempA; tempA = tempA._nativeParent) {
9769 for (var tempB = instB; tempB; tempB = tempB._nativeParent) {
9773 // If A is deeper, crawl up.
9774 while (depthA - depthB > 0) {
9775 instA = instA._nativeParent;
9779 // If B is deeper, crawl up.
9780 while (depthB - depthA > 0) {
9781 instB = instB._nativeParent;
9785 // Walk in lockstep until we find a match.
9788 if (instA === instB) {
9791 instA = instA._nativeParent;
9792 instB = instB._nativeParent;
9798 * Return if A is an ancestor of B.
9800 function isAncestor(instA, instB) {
9801 !('_nativeNode' in instA) ? "development" !== 'production' ? invariant(false, 'isAncestor: Invalid argument.') : invariant(false) : void 0;
9802 !('_nativeNode' in instB) ? "development" !== 'production' ? invariant(false, 'isAncestor: Invalid argument.') : invariant(false) : void 0;
9805 if (instB === instA) {
9808 instB = instB._nativeParent;
9814 * Return the parent instance of the passed-in instance.
9816 function getParentInstance(inst) {
9817 !('_nativeNode' in inst) ? "development" !== 'production' ? invariant(false, 'getParentInstance: Invalid argument.') : invariant(false) : void 0;
9819 return inst._nativeParent;
9823 * Simulates the traversal of a two-phase, capture/bubble event dispatch.
9825 function traverseTwoPhase(inst, fn, arg) {
9829 inst = inst._nativeParent;
9832 for (i = path.length; i-- > 0;) {
9833 fn(path[i], false, arg);
9835 for (i = 0; i < path.length; i++) {
9836 fn(path[i], true, arg);
9841 * Traverses the ID hierarchy and invokes the supplied `cb` on any IDs that
9842 * should would receive a `mouseEnter` or `mouseLeave` event.
9844 * Does not invoke the callback on the nearest common ancestor because nothing
9845 * "entered" or "left" that element.
9847 function traverseEnterLeave(from, to, fn, argFrom, argTo) {
9848 var common = from && to ? getLowestCommonAncestor(from, to) : null;
9850 while (from && from !== common) {
9851 pathFrom.push(from);
9852 from = from._nativeParent;
9855 while (to && to !== common) {
9857 to = to._nativeParent;
9860 for (i = 0; i < pathFrom.length; i++) {
9861 fn(pathFrom[i], true, argFrom);
9863 for (i = pathTo.length; i-- > 0;) {
9864 fn(pathTo[i], false, argTo);
9869 isAncestor: isAncestor,
9870 getLowestCommonAncestor: getLowestCommonAncestor,
9871 getParentInstance: getParentInstance,
9872 traverseTwoPhase: traverseTwoPhase,
9873 traverseEnterLeave: traverseEnterLeave
9875 },{"173":173}],61:[function(_dereq_,module,exports){
9877 * Copyright 2013-present, Facebook, Inc.
9878 * All rights reserved.
9880 * This source code is licensed under the BSD-style license found in the
9881 * LICENSE file in the root directory of this source tree. An additional grant
9882 * of patent rights can be found in the PATENTS file in the same directory.
9884 * @providesModule ReactDOMUnknownPropertyDevtool
9889 var DOMProperty = _dereq_(10);
9890 var EventPluginRegistry = _dereq_(18);
9892 var warning = _dereq_(183);
9894 if ("development" !== 'production') {
9897 dangerouslySetInnerHTML: true,
9901 var warnedProperties = {};
9903 var warnUnknownProperty = function (name) {
9904 if (DOMProperty.properties.hasOwnProperty(name) || DOMProperty.isCustomAttribute(name)) {
9907 if (reactProps.hasOwnProperty(name) && reactProps[name] || warnedProperties.hasOwnProperty(name) && warnedProperties[name]) {
9911 warnedProperties[name] = true;
9912 var lowerCasedName = name.toLowerCase();
9914 // data-* attributes should be lowercase; suggest the lowercase version
9915 var standardName = DOMProperty.isCustomAttribute(lowerCasedName) ? lowerCasedName : DOMProperty.getPossibleStandardName.hasOwnProperty(lowerCasedName) ? DOMProperty.getPossibleStandardName[lowerCasedName] : null;
9917 // For now, only warn when we have a suggested correction. This prevents
9918 // logging too much when using transferPropsTo.
9919 "development" !== 'production' ? warning(standardName == null, 'Unknown DOM property %s. Did you mean %s?', name, standardName) : void 0;
9921 var registrationName = EventPluginRegistry.possibleRegistrationNames.hasOwnProperty(lowerCasedName) ? EventPluginRegistry.possibleRegistrationNames[lowerCasedName] : null;
9923 "development" !== 'production' ? warning(registrationName == null, 'Unknown event handler property %s. Did you mean `%s`?', name, registrationName) : void 0;
9927 var ReactDOMUnknownPropertyDevtool = {
9928 onCreateMarkupForProperty: function (name, value) {
9929 warnUnknownProperty(name);
9931 onSetValueForProperty: function (node, name, value) {
9932 warnUnknownProperty(name);
9934 onDeleteValueForProperty: function (node, name) {
9935 warnUnknownProperty(name);
9939 module.exports = ReactDOMUnknownPropertyDevtool;
9940 },{"10":10,"18":18,"183":183}],62:[function(_dereq_,module,exports){
9942 * Copyright 2016-present, Facebook, Inc.
9943 * All rights reserved.
9945 * This source code is licensed under the BSD-style license found in the
9946 * LICENSE file in the root directory of this source tree. An additional grant
9947 * of patent rights can be found in the PATENTS file in the same directory.
9949 * @providesModule ReactDebugTool
9954 var ExecutionEnvironment = _dereq_(159);
9956 var performanceNow = _dereq_(181);
9957 var warning = _dereq_(183);
9959 var eventHandlers = [];
9960 var handlerDoesThrowForEvent = {};
9962 function emitEvent(handlerFunctionName, arg1, arg2, arg3, arg4, arg5) {
9963 if ("development" !== 'production') {
9964 eventHandlers.forEach(function (handler) {
9966 if (handler[handlerFunctionName]) {
9967 handler[handlerFunctionName](arg1, arg2, arg3, arg4, arg5);
9970 "development" !== 'production' ? warning(!handlerDoesThrowForEvent[handlerFunctionName], 'exception thrown by devtool while handling %s: %s', handlerFunctionName, e.message) : void 0;
9971 handlerDoesThrowForEvent[handlerFunctionName] = true;
9977 var isProfiling = false;
9978 var flushHistory = [];
9979 var currentFlushNesting = 0;
9980 var currentFlushMeasurements = null;
9981 var currentFlushStartTime = null;
9982 var currentTimerDebugID = null;
9983 var currentTimerStartTime = null;
9984 var currentTimerType = null;
9986 function clearHistory() {
9987 ReactComponentTreeDevtool.purgeUnmountedComponents();
9988 ReactNativeOperationHistoryDevtool.clearHistory();
9991 function getTreeSnapshot(registeredIDs) {
9992 return registeredIDs.reduce(function (tree, id) {
9993 var ownerID = ReactComponentTreeDevtool.getOwnerID(id);
9994 var parentID = ReactComponentTreeDevtool.getParentID(id);
9996 displayName: ReactComponentTreeDevtool.getDisplayName(id),
9997 text: ReactComponentTreeDevtool.getText(id),
9998 updateCount: ReactComponentTreeDevtool.getUpdateCount(id),
9999 childIDs: ReactComponentTreeDevtool.getChildIDs(id),
10000 // Text nodes don't have owners but this is close enough.
10001 ownerID: ownerID || ReactComponentTreeDevtool.getOwnerID(parentID),
10008 function resetMeasurements() {
10009 if ("development" !== 'production') {
10010 var previousStartTime = currentFlushStartTime;
10011 var previousMeasurements = currentFlushMeasurements || [];
10012 var previousOperations = ReactNativeOperationHistoryDevtool.getHistory();
10014 if (!isProfiling || currentFlushNesting === 0) {
10015 currentFlushStartTime = null;
10016 currentFlushMeasurements = null;
10021 if (previousMeasurements.length || previousOperations.length) {
10022 var registeredIDs = ReactComponentTreeDevtool.getRegisteredIDs();
10023 flushHistory.push({
10024 duration: performanceNow() - previousStartTime,
10025 measurements: previousMeasurements || [],
10026 operations: previousOperations || [],
10027 treeSnapshot: getTreeSnapshot(registeredIDs)
10032 currentFlushStartTime = performanceNow();
10033 currentFlushMeasurements = [];
10037 function checkDebugID(debugID) {
10038 "development" !== 'production' ? warning(debugID, 'ReactDebugTool: debugID may not be empty.') : void 0;
10041 var ReactDebugTool = {
10042 addDevtool: function (devtool) {
10043 eventHandlers.push(devtool);
10045 removeDevtool: function (devtool) {
10046 for (var i = 0; i < eventHandlers.length; i++) {
10047 if (eventHandlers[i] === devtool) {
10048 eventHandlers.splice(i, 1);
10053 beginProfiling: function () {
10054 if ("development" !== 'production') {
10059 isProfiling = true;
10060 flushHistory.length = 0;
10061 resetMeasurements();
10064 endProfiling: function () {
10065 if ("development" !== 'production') {
10066 if (!isProfiling) {
10070 isProfiling = false;
10071 resetMeasurements();
10074 getFlushHistory: function () {
10075 if ("development" !== 'production') {
10076 return flushHistory;
10079 onBeginFlush: function () {
10080 if ("development" !== 'production') {
10081 currentFlushNesting++;
10082 resetMeasurements();
10084 emitEvent('onBeginFlush');
10086 onEndFlush: function () {
10087 if ("development" !== 'production') {
10088 resetMeasurements();
10089 currentFlushNesting--;
10091 emitEvent('onEndFlush');
10093 onBeginLifeCycleTimer: function (debugID, timerType) {
10094 checkDebugID(debugID);
10095 emitEvent('onBeginLifeCycleTimer', debugID, timerType);
10096 if ("development" !== 'production') {
10097 if (isProfiling && currentFlushNesting > 0) {
10098 "development" !== 'production' ? warning(!currentTimerType, 'There is an internal error in the React performance measurement code. ' + 'Did not expect %s timer to start while %s timer is still in ' + 'progress for %s instance.', timerType, currentTimerType || 'no', debugID === currentTimerDebugID ? 'the same' : 'another') : void 0;
10099 currentTimerStartTime = performanceNow();
10100 currentTimerDebugID = debugID;
10101 currentTimerType = timerType;
10105 onEndLifeCycleTimer: function (debugID, timerType) {
10106 checkDebugID(debugID);
10107 if ("development" !== 'production') {
10108 if (isProfiling && currentFlushNesting > 0) {
10109 "development" !== 'production' ? warning(currentTimerType === timerType, 'There is an internal error in the React performance measurement code. ' + 'We did not expect %s timer to stop while %s timer is still in ' + 'progress for %s instance. Please report this as a bug in React.', timerType, currentTimerType || 'no', debugID === currentTimerDebugID ? 'the same' : 'another') : void 0;
10110 currentFlushMeasurements.push({
10111 timerType: timerType,
10112 instanceID: debugID,
10113 duration: performanceNow() - currentTimerStartTime
10115 currentTimerStartTime = null;
10116 currentTimerDebugID = null;
10117 currentTimerType = null;
10120 emitEvent('onEndLifeCycleTimer', debugID, timerType);
10122 onBeginReconcilerTimer: function (debugID, timerType) {
10123 checkDebugID(debugID);
10124 emitEvent('onBeginReconcilerTimer', debugID, timerType);
10126 onEndReconcilerTimer: function (debugID, timerType) {
10127 checkDebugID(debugID);
10128 emitEvent('onEndReconcilerTimer', debugID, timerType);
10130 onBeginProcessingChildContext: function () {
10131 emitEvent('onBeginProcessingChildContext');
10133 onEndProcessingChildContext: function () {
10134 emitEvent('onEndProcessingChildContext');
10136 onNativeOperation: function (debugID, type, payload) {
10137 checkDebugID(debugID);
10138 emitEvent('onNativeOperation', debugID, type, payload);
10140 onSetState: function () {
10141 emitEvent('onSetState');
10143 onSetDisplayName: function (debugID, displayName) {
10144 checkDebugID(debugID);
10145 emitEvent('onSetDisplayName', debugID, displayName);
10147 onSetChildren: function (debugID, childDebugIDs) {
10148 checkDebugID(debugID);
10149 emitEvent('onSetChildren', debugID, childDebugIDs);
10151 onSetOwner: function (debugID, ownerDebugID) {
10152 checkDebugID(debugID);
10153 emitEvent('onSetOwner', debugID, ownerDebugID);
10155 onSetText: function (debugID, text) {
10156 checkDebugID(debugID);
10157 emitEvent('onSetText', debugID, text);
10159 onMountRootComponent: function (debugID) {
10160 checkDebugID(debugID);
10161 emitEvent('onMountRootComponent', debugID);
10163 onMountComponent: function (debugID) {
10164 checkDebugID(debugID);
10165 emitEvent('onMountComponent', debugID);
10167 onUpdateComponent: function (debugID) {
10168 checkDebugID(debugID);
10169 emitEvent('onUpdateComponent', debugID);
10171 onUnmountComponent: function (debugID) {
10172 checkDebugID(debugID);
10173 emitEvent('onUnmountComponent', debugID);
10177 if ("development" !== 'production') {
10178 var ReactInvalidSetStateWarningDevTool = _dereq_(77);
10179 var ReactNativeOperationHistoryDevtool = _dereq_(84);
10180 var ReactComponentTreeDevtool = _dereq_(37);
10181 ReactDebugTool.addDevtool(ReactInvalidSetStateWarningDevTool);
10182 ReactDebugTool.addDevtool(ReactComponentTreeDevtool);
10183 ReactDebugTool.addDevtool(ReactNativeOperationHistoryDevtool);
10184 var url = ExecutionEnvironment.canUseDOM && window.location.href || '';
10185 if (/[?&]react_perf\b/.test(url)) {
10186 ReactDebugTool.beginProfiling();
10190 module.exports = ReactDebugTool;
10191 },{"159":159,"181":181,"183":183,"37":37,"77":77,"84":84}],63:[function(_dereq_,module,exports){
10193 * Copyright 2013-present, Facebook, Inc.
10194 * All rights reserved.
10196 * This source code is licensed under the BSD-style license found in the
10197 * LICENSE file in the root directory of this source tree. An additional grant
10198 * of patent rights can be found in the PATENTS file in the same directory.
10200 * @providesModule ReactDefaultBatchingStrategy
10205 var _assign = _dereq_(184);
10207 var ReactUpdates = _dereq_(104);
10208 var Transaction = _dereq_(124);
10210 var emptyFunction = _dereq_(165);
10212 var RESET_BATCHED_UPDATES = {
10213 initialize: emptyFunction,
10214 close: function () {
10215 ReactDefaultBatchingStrategy.isBatchingUpdates = false;
10219 var FLUSH_BATCHED_UPDATES = {
10220 initialize: emptyFunction,
10221 close: ReactUpdates.flushBatchedUpdates.bind(ReactUpdates)
10224 var TRANSACTION_WRAPPERS = [FLUSH_BATCHED_UPDATES, RESET_BATCHED_UPDATES];
10226 function ReactDefaultBatchingStrategyTransaction() {
10227 this.reinitializeTransaction();
10230 _assign(ReactDefaultBatchingStrategyTransaction.prototype, Transaction.Mixin, {
10231 getTransactionWrappers: function () {
10232 return TRANSACTION_WRAPPERS;
10236 var transaction = new ReactDefaultBatchingStrategyTransaction();
10238 var ReactDefaultBatchingStrategy = {
10239 isBatchingUpdates: false,
10242 * Call the provided function in a context within which calls to `setState`
10243 * and friends are batched such that components aren't updated unnecessarily.
10245 batchedUpdates: function (callback, a, b, c, d, e) {
10246 var alreadyBatchingUpdates = ReactDefaultBatchingStrategy.isBatchingUpdates;
10248 ReactDefaultBatchingStrategy.isBatchingUpdates = true;
10250 // The code is written this way to avoid extra allocations
10251 if (alreadyBatchingUpdates) {
10252 callback(a, b, c, d, e);
10254 transaction.perform(callback, null, a, b, c, d, e);
10259 module.exports = ReactDefaultBatchingStrategy;
10260 },{"104":104,"124":124,"165":165,"184":184}],64:[function(_dereq_,module,exports){
10262 * Copyright 2013-present, Facebook, Inc.
10263 * All rights reserved.
10265 * This source code is licensed under the BSD-style license found in the
10266 * LICENSE file in the root directory of this source tree. An additional grant
10267 * of patent rights can be found in the PATENTS file in the same directory.
10269 * @providesModule ReactDefaultInjection
10274 var BeforeInputEventPlugin = _dereq_(2);
10275 var ChangeEventPlugin = _dereq_(6);
10276 var DefaultEventPluginOrder = _dereq_(13);
10277 var EnterLeaveEventPlugin = _dereq_(15);
10278 var HTMLDOMPropertyConfig = _dereq_(22);
10279 var ReactComponentBrowserEnvironment = _dereq_(35);
10280 var ReactDOMComponent = _dereq_(43);
10281 var ReactDOMComponentTree = _dereq_(45);
10282 var ReactDOMEmptyComponent = _dereq_(48);
10283 var ReactDOMTreeTraversal = _dereq_(60);
10284 var ReactDOMTextComponent = _dereq_(58);
10285 var ReactDefaultBatchingStrategy = _dereq_(63);
10286 var ReactEventListener = _dereq_(70);
10287 var ReactInjection = _dereq_(73);
10288 var ReactReconcileTransaction = _dereq_(92);
10289 var SVGDOMPropertyConfig = _dereq_(108);
10290 var SelectEventPlugin = _dereq_(109);
10291 var SimpleEventPlugin = _dereq_(110);
10293 var alreadyInjected = false;
10295 function inject() {
10296 if (alreadyInjected) {
10297 // TODO: This is currently true because these injections are shared between
10298 // the client and the server package. They should be built independently
10299 // and not share any injection state. Then this problem will be solved.
10302 alreadyInjected = true;
10304 ReactInjection.EventEmitter.injectReactEventListener(ReactEventListener);
10307 * Inject modules for resolving DOM hierarchy and plugin ordering.
10309 ReactInjection.EventPluginHub.injectEventPluginOrder(DefaultEventPluginOrder);
10310 ReactInjection.EventPluginUtils.injectComponentTree(ReactDOMComponentTree);
10311 ReactInjection.EventPluginUtils.injectTreeTraversal(ReactDOMTreeTraversal);
10314 * Some important event plugins included by default (without having to require
10317 ReactInjection.EventPluginHub.injectEventPluginsByName({
10318 SimpleEventPlugin: SimpleEventPlugin,
10319 EnterLeaveEventPlugin: EnterLeaveEventPlugin,
10320 ChangeEventPlugin: ChangeEventPlugin,
10321 SelectEventPlugin: SelectEventPlugin,
10322 BeforeInputEventPlugin: BeforeInputEventPlugin
10325 ReactInjection.NativeComponent.injectGenericComponentClass(ReactDOMComponent);
10327 ReactInjection.NativeComponent.injectTextComponentClass(ReactDOMTextComponent);
10329 ReactInjection.DOMProperty.injectDOMPropertyConfig(HTMLDOMPropertyConfig);
10330 ReactInjection.DOMProperty.injectDOMPropertyConfig(SVGDOMPropertyConfig);
10332 ReactInjection.EmptyComponent.injectEmptyComponentFactory(function (instantiate) {
10333 return new ReactDOMEmptyComponent(instantiate);
10336 ReactInjection.Updates.injectReconcileTransaction(ReactReconcileTransaction);
10337 ReactInjection.Updates.injectBatchingStrategy(ReactDefaultBatchingStrategy);
10339 ReactInjection.Component.injectEnvironment(ReactComponentBrowserEnvironment);
10345 },{"108":108,"109":109,"110":110,"13":13,"15":15,"2":2,"22":22,"35":35,"43":43,"45":45,"48":48,"58":58,"6":6,"60":60,"63":63,"70":70,"73":73,"92":92}],65:[function(_dereq_,module,exports){
10347 * Copyright 2014-present, Facebook, Inc.
10348 * All rights reserved.
10350 * This source code is licensed under the BSD-style license found in the
10351 * LICENSE file in the root directory of this source tree. An additional grant
10352 * of patent rights can be found in the PATENTS file in the same directory.
10354 * @providesModule ReactElement
10359 var _assign = _dereq_(184);
10361 var ReactCurrentOwner = _dereq_(40);
10363 var warning = _dereq_(183);
10364 var canDefineProperty = _dereq_(128);
10366 // The Symbol used to tag the ReactElement type. If there is no native Symbol
10367 // nor polyfill, then a plain number is used for performance.
10368 var REACT_ELEMENT_TYPE = typeof Symbol === 'function' && Symbol['for'] && Symbol['for']('react.element') || 0xeac7;
10370 var RESERVED_PROPS = {
10377 var specialPropKeyWarningShown, specialPropRefWarningShown;
10380 * Factory method to create a new React element. This no longer adheres to
10381 * the class pattern, so do not use new to call it. Also, no instanceof check
10382 * will work. Instead test $$typeof field against Symbol.for('react.element') to check
10383 * if something is a React Element.
10387 * @param {string|object} ref
10388 * @param {*} self A *temporary* helper to detect places where `this` is
10389 * different from the `owner` when React.createElement is called, so that we
10390 * can warn. We want to get rid of owner and replace string `ref`s with arrow
10391 * functions, and as long as `this` and owner are the same, there will be no
10392 * change in behavior.
10393 * @param {*} source An annotation object (added by a transpiler or otherwise)
10394 * indicating filename, line number, and/or other information.
10399 var ReactElement = function (type, key, ref, self, source, owner, props) {
10401 // This tag allow us to uniquely identify this as a React Element
10402 $$typeof: REACT_ELEMENT_TYPE,
10404 // Built-in properties that belong on the element
10410 // Record the component responsible for creating this element.
10414 if ("development" !== 'production') {
10415 // The validation flag is currently mutative. We put it on
10416 // an external backing store so that we can freeze the whole object.
10417 // This can be replaced with a WeakMap once they are implemented in
10418 // commonly used development environments.
10419 element._store = {};
10421 // To make comparing ReactElements easier for testing purposes, we make
10422 // the validation flag non-enumerable (where possible, which should
10423 // include every environment we run tests in), so the test framework
10425 if (canDefineProperty) {
10426 Object.defineProperty(element._store, 'validated', {
10427 configurable: false,
10432 // self and source are DEV only properties.
10433 Object.defineProperty(element, '_self', {
10434 configurable: false,
10439 // Two elements created in two different places should be considered
10440 // equal for testing purposes and therefore we hide it from enumeration.
10441 Object.defineProperty(element, '_source', {
10442 configurable: false,
10448 element._store.validated = false;
10449 element._self = self;
10450 element._source = source;
10452 if (Object.freeze) {
10453 Object.freeze(element.props);
10454 Object.freeze(element);
10462 * Create and return a new ReactElement of the given type.
10463 * See https://facebook.github.io/react/docs/top-level-api.html#react.createelement
10465 ReactElement.createElement = function (type, config, children) {
10468 // Reserved names are extracted
10476 if (config != null) {
10477 if ("development" !== 'production') {
10478 "development" !== 'production' ? warning(
10479 /* eslint-disable no-proto */
10480 config.__proto__ == null || config.__proto__ === Object.prototype,
10481 /* eslint-enable no-proto */
10482 'React.createElement(...): Expected props argument to be a plain object. ' + 'Properties defined in its prototype chain will be ignored.') : void 0;
10483 ref = !config.hasOwnProperty('ref') || Object.getOwnPropertyDescriptor(config, 'ref').get ? null : config.ref;
10484 key = !config.hasOwnProperty('key') || Object.getOwnPropertyDescriptor(config, 'key').get ? null : '' + config.key;
10486 ref = config.ref === undefined ? null : config.ref;
10487 key = config.key === undefined ? null : '' + config.key;
10489 self = config.__self === undefined ? null : config.__self;
10490 source = config.__source === undefined ? null : config.__source;
10491 // Remaining properties are added to a new props object
10492 for (propName in config) {
10493 if (config.hasOwnProperty(propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
10494 props[propName] = config[propName];
10499 // Children can be more than one argument, and those are transferred onto
10500 // the newly allocated props object.
10501 var childrenLength = arguments.length - 2;
10502 if (childrenLength === 1) {
10503 props.children = children;
10504 } else if (childrenLength > 1) {
10505 var childArray = Array(childrenLength);
10506 for (var i = 0; i < childrenLength; i++) {
10507 childArray[i] = arguments[i + 2];
10509 props.children = childArray;
10512 // Resolve default props
10513 if (type && type.defaultProps) {
10514 var defaultProps = type.defaultProps;
10515 for (propName in defaultProps) {
10516 if (props[propName] === undefined) {
10517 props[propName] = defaultProps[propName];
10521 if ("development" !== 'production') {
10522 // Create dummy `key` and `ref` property to `props` to warn users
10524 if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {
10525 if (!props.hasOwnProperty('key')) {
10526 Object.defineProperty(props, 'key', {
10528 if (!specialPropKeyWarningShown) {
10529 specialPropKeyWarningShown = true;
10530 "development" !== 'production' ? warning(false, '%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://fb.me/react-special-props)', typeof type === 'function' && 'displayName' in type ? type.displayName : 'Element') : void 0;
10537 if (!props.hasOwnProperty('ref')) {
10538 Object.defineProperty(props, 'ref', {
10540 if (!specialPropRefWarningShown) {
10541 specialPropRefWarningShown = true;
10542 "development" !== 'production' ? warning(false, '%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://fb.me/react-special-props)', typeof type === 'function' && 'displayName' in type ? type.displayName : 'Element') : void 0;
10551 return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
10555 * Return a function that produces ReactElements of a given type.
10556 * See https://facebook.github.io/react/docs/top-level-api.html#react.createfactory
10558 ReactElement.createFactory = function (type) {
10559 var factory = ReactElement.createElement.bind(null, type);
10560 // Expose the type on the factory and the prototype so that it can be
10561 // easily accessed on elements. E.g. `<Foo />.type === Foo`.
10562 // This should not be named `constructor` since this may not be the function
10563 // that created the element, and it may not even be a constructor.
10564 // Legacy hook TODO: Warn if this is accessed
10565 factory.type = type;
10569 ReactElement.cloneAndReplaceKey = function (oldElement, newKey) {
10570 var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props);
10576 * Clone and return a new ReactElement using element as the starting point.
10577 * See https://facebook.github.io/react/docs/top-level-api.html#react.cloneelement
10579 ReactElement.cloneElement = function (element, config, children) {
10582 // Original props are copied
10583 var props = _assign({}, element.props);
10585 // Reserved names are extracted
10586 var key = element.key;
10587 var ref = element.ref;
10588 // Self is preserved since the owner is preserved.
10589 var self = element._self;
10590 // Source is preserved since cloneElement is unlikely to be targeted by a
10591 // transpiler, and the original source is probably a better indicator of the
10593 var source = element._source;
10595 // Owner will be preserved, unless ref is overridden
10596 var owner = element._owner;
10598 if (config != null) {
10599 if ("development" !== 'production') {
10600 "development" !== 'production' ? warning(
10601 /* eslint-disable no-proto */
10602 config.__proto__ == null || config.__proto__ === Object.prototype,
10603 /* eslint-enable no-proto */
10604 'React.cloneElement(...): Expected props argument to be a plain object. ' + 'Properties defined in its prototype chain will be ignored.') : void 0;
10606 if (config.ref !== undefined) {
10607 // Silently steal the ref from the parent.
10609 owner = ReactCurrentOwner.current;
10611 if (config.key !== undefined) {
10612 key = '' + config.key;
10614 // Remaining properties override existing props
10616 if (element.type && element.type.defaultProps) {
10617 defaultProps = element.type.defaultProps;
10619 for (propName in config) {
10620 if (config.hasOwnProperty(propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
10621 if (config[propName] === undefined && defaultProps !== undefined) {
10622 // Resolve default props
10623 props[propName] = defaultProps[propName];
10625 props[propName] = config[propName];
10631 // Children can be more than one argument, and those are transferred onto
10632 // the newly allocated props object.
10633 var childrenLength = arguments.length - 2;
10634 if (childrenLength === 1) {
10635 props.children = children;
10636 } else if (childrenLength > 1) {
10637 var childArray = Array(childrenLength);
10638 for (var i = 0; i < childrenLength; i++) {
10639 childArray[i] = arguments[i + 2];
10641 props.children = childArray;
10644 return ReactElement(element.type, key, ref, self, source, owner, props);
10648 * Verifies the object is a ReactElement.
10649 * See https://facebook.github.io/react/docs/top-level-api.html#react.isvalidelement
10650 * @param {?object} object
10651 * @return {boolean} True if `object` is a valid component.
10654 ReactElement.isValidElement = function (object) {
10655 return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
10658 module.exports = ReactElement;
10659 },{"128":128,"183":183,"184":184,"40":40}],66:[function(_dereq_,module,exports){
10661 * Copyright 2014-present, Facebook, Inc.
10662 * All rights reserved.
10664 * This source code is licensed under the BSD-style license found in the
10665 * LICENSE file in the root directory of this source tree. An additional grant
10666 * of patent rights can be found in the PATENTS file in the same directory.
10668 * @providesModule ReactElementValidator
10672 * ReactElementValidator provides a wrapper around a element factory
10673 * which validates the props passed to the element. This is intended to be
10674 * used only in DEV and could be replaced by a static type checker for languages
10680 var ReactElement = _dereq_(65);
10681 var ReactPropTypeLocations = _dereq_(90);
10682 var ReactPropTypeLocationNames = _dereq_(89);
10683 var ReactCurrentOwner = _dereq_(40);
10685 var canDefineProperty = _dereq_(128);
10686 var getIteratorFn = _dereq_(139);
10687 var invariant = _dereq_(173);
10688 var warning = _dereq_(183);
10690 function getDeclarationErrorAddendum() {
10691 if (ReactCurrentOwner.current) {
10692 var name = ReactCurrentOwner.current.getName();
10694 return ' Check the render method of `' + name + '`.';
10701 * Warn if there's no key explicitly set on dynamic arrays of children or
10702 * object keys are not valid. This allows us to keep track of children between
10705 var ownerHasKeyUseWarning = {};
10707 var loggedTypeFailures = {};
10710 * Warn if the element doesn't have an explicit key assigned to it.
10711 * This element is in an array. The array could grow and shrink or be
10712 * reordered. All children that haven't already been validated are required to
10713 * have a "key" property assigned to it.
10716 * @param {ReactElement} element Element that requires a key.
10717 * @param {*} parentType element's parent's type.
10719 function validateExplicitKey(element, parentType) {
10720 if (!element._store || element._store.validated || element.key != null) {
10723 element._store.validated = true;
10725 var addenda = getAddendaForKeyUse('uniqueKey', element, parentType);
10726 if (addenda === null) {
10727 // we already showed the warning
10730 "development" !== 'production' ? warning(false, 'Each child in an array or iterator should have a unique "key" prop.' + '%s%s%s', addenda.parentOrOwner || '', addenda.childOwner || '', addenda.url || '') : void 0;
10734 * Shared warning and monitoring code for the key warnings.
10737 * @param {string} messageType A key used for de-duping warnings.
10738 * @param {ReactElement} element Component that requires a key.
10739 * @param {*} parentType element's parent's type.
10740 * @returns {?object} A set of addenda to use in the warning message, or null
10741 * if the warning has already been shown before (and shouldn't be shown again).
10743 function getAddendaForKeyUse(messageType, element, parentType) {
10744 var addendum = getDeclarationErrorAddendum();
10746 var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;
10748 addendum = ' Check the top-level render call using <' + parentName + '>.';
10752 var memoizer = ownerHasKeyUseWarning[messageType] || (ownerHasKeyUseWarning[messageType] = {});
10753 if (memoizer[addendum]) {
10756 memoizer[addendum] = true;
10759 parentOrOwner: addendum,
10760 url: ' See https://fb.me/react-warning-keys for more information.',
10764 // Usually the current owner is the offender, but if it accepts children as a
10765 // property, it may be the creator of the child that's responsible for
10766 // assigning it a key.
10767 if (element && element._owner && element._owner !== ReactCurrentOwner.current) {
10768 // Give the component that originally created this child.
10769 addenda.childOwner = ' It was passed a child from ' + element._owner.getName() + '.';
10776 * Ensure that every element either is passed in a static location, in an
10777 * array with an explicit keys property defined, or in an object literal
10778 * with valid key property.
10781 * @param {ReactNode} node Statically passed child of any type.
10782 * @param {*} parentType node's parent's type.
10784 function validateChildKeys(node, parentType) {
10785 if (typeof node !== 'object') {
10788 if (Array.isArray(node)) {
10789 for (var i = 0; i < node.length; i++) {
10790 var child = node[i];
10791 if (ReactElement.isValidElement(child)) {
10792 validateExplicitKey(child, parentType);
10795 } else if (ReactElement.isValidElement(node)) {
10796 // This element was passed in a valid location.
10798 node._store.validated = true;
10801 var iteratorFn = getIteratorFn(node);
10802 // Entry iterators provide implicit keys.
10804 if (iteratorFn !== node.entries) {
10805 var iterator = iteratorFn.call(node);
10807 while (!(step = iterator.next()).done) {
10808 if (ReactElement.isValidElement(step.value)) {
10809 validateExplicitKey(step.value, parentType);
10818 * Assert that the props are valid
10820 * @param {string} componentName Name of the component for error messages.
10821 * @param {object} propTypes Map of prop name to a ReactPropType
10822 * @param {object} props
10823 * @param {string} location e.g. "prop", "context", "child context"
10826 function checkPropTypes(componentName, propTypes, props, location) {
10827 for (var propName in propTypes) {
10828 if (propTypes.hasOwnProperty(propName)) {
10830 // Prop type validation may throw. In case they do, we don't want to
10831 // fail the render phase where it didn't fail before. So we log it.
10832 // After these have been cleaned up, we'll let them throw.
10834 // This is intentionally an invariant that gets caught. It's the same
10835 // behavior as without this statement except with a better message.
10836 !(typeof propTypes[propName] === 'function') ? "development" !== 'production' ? invariant(false, '%s: %s type `%s` is invalid; it must be a function, usually from ' + 'React.PropTypes.', componentName || 'React class', ReactPropTypeLocationNames[location], propName) : invariant(false) : void 0;
10837 error = propTypes[propName](props, propName, componentName, location);
10841 "development" !== 'production' ? warning(!error || error instanceof Error, '%s: type specification of %s `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', ReactPropTypeLocationNames[location], propName, typeof error) : void 0;
10842 if (error instanceof Error && !(error.message in loggedTypeFailures)) {
10843 // Only monitor this failure once because there tends to be a lot of the
10845 loggedTypeFailures[error.message] = true;
10847 var addendum = getDeclarationErrorAddendum();
10848 "development" !== 'production' ? warning(false, 'Failed propType: %s%s', error.message, addendum) : void 0;
10855 * Given an element, validate that its props follow the propTypes definition,
10856 * provided by the type.
10858 * @param {ReactElement} element
10860 function validatePropTypes(element) {
10861 var componentClass = element.type;
10862 if (typeof componentClass !== 'function') {
10865 var name = componentClass.displayName || componentClass.name;
10866 if (componentClass.propTypes) {
10867 checkPropTypes(name, componentClass.propTypes, element.props, ReactPropTypeLocations.prop);
10869 if (typeof componentClass.getDefaultProps === 'function') {
10870 "development" !== 'production' ? warning(componentClass.getDefaultProps.isReactClassApproved, 'getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.') : void 0;
10874 var ReactElementValidator = {
10876 createElement: function (type, props, children) {
10877 var validType = typeof type === 'string' || typeof type === 'function';
10878 // We warn in this case but don't throw. We expect the element creation to
10879 // succeed and there will likely be errors in render.
10880 "development" !== 'production' ? warning(validType, 'React.createElement: type should not be null, undefined, boolean, or ' + 'number. It should be a string (for DOM elements) or a ReactClass ' + '(for composite components).%s', getDeclarationErrorAddendum()) : void 0;
10882 var element = ReactElement.createElement.apply(this, arguments);
10884 // The result can be nullish if a mock or a custom function is used.
10885 // TODO: Drop this when these are no longer allowed as the type argument.
10886 if (element == null) {
10890 // Skip key warning if the type isn't valid since our key validation logic
10891 // doesn't expect a non-string/function type and can throw confusing errors.
10892 // We don't want exception behavior to differ between dev and prod.
10893 // (Rendering will throw with a helpful message and as soon as the type is
10894 // fixed, the key warnings will appear.)
10896 for (var i = 2; i < arguments.length; i++) {
10897 validateChildKeys(arguments[i], type);
10901 validatePropTypes(element);
10906 createFactory: function (type) {
10907 var validatedFactory = ReactElementValidator.createElement.bind(null, type);
10908 // Legacy hook TODO: Warn if this is accessed
10909 validatedFactory.type = type;
10911 if ("development" !== 'production') {
10912 if (canDefineProperty) {
10913 Object.defineProperty(validatedFactory, 'type', {
10916 "development" !== 'production' ? warning(false, 'Factory.type is deprecated. Access the class directly ' + 'before passing it to createFactory.') : void 0;
10917 Object.defineProperty(this, 'type', {
10926 return validatedFactory;
10929 cloneElement: function (element, props, children) {
10930 var newElement = ReactElement.cloneElement.apply(this, arguments);
10931 for (var i = 2; i < arguments.length; i++) {
10932 validateChildKeys(arguments[i], newElement.type);
10934 validatePropTypes(newElement);
10940 module.exports = ReactElementValidator;
10941 },{"128":128,"139":139,"173":173,"183":183,"40":40,"65":65,"89":89,"90":90}],67:[function(_dereq_,module,exports){
10943 * Copyright 2014-present, Facebook, Inc.
10944 * All rights reserved.
10946 * This source code is licensed under the BSD-style license found in the
10947 * LICENSE file in the root directory of this source tree. An additional grant
10948 * of patent rights can be found in the PATENTS file in the same directory.
10950 * @providesModule ReactEmptyComponent
10955 var emptyComponentFactory;
10957 var ReactEmptyComponentInjection = {
10958 injectEmptyComponentFactory: function (factory) {
10959 emptyComponentFactory = factory;
10963 var ReactEmptyComponent = {
10964 create: function (instantiate) {
10965 return emptyComponentFactory(instantiate);
10969 ReactEmptyComponent.injection = ReactEmptyComponentInjection;
10971 module.exports = ReactEmptyComponent;
10972 },{}],68:[function(_dereq_,module,exports){
10974 * Copyright 2013-present, Facebook, Inc.
10975 * All rights reserved.
10977 * This source code is licensed under the BSD-style license found in the
10978 * LICENSE file in the root directory of this source tree. An additional grant
10979 * of patent rights can be found in the PATENTS file in the same directory.
10981 * @providesModule ReactErrorUtils
10986 var caughtError = null;
10989 * Call a function while guarding against errors that happens within it.
10991 * @param {?String} name of the guard to use for logging or debugging
10992 * @param {Function} func The function to invoke
10993 * @param {*} a First argument
10994 * @param {*} b Second argument
10996 function invokeGuardedCallback(name, func, a, b) {
11000 if (caughtError === null) {
11007 var ReactErrorUtils = {
11008 invokeGuardedCallback: invokeGuardedCallback,
11011 * Invoked by ReactTestUtils.Simulate so that any errors thrown by the event
11012 * handler are sure to be rethrown by rethrowCaughtError.
11014 invokeGuardedCallbackWithCatch: invokeGuardedCallback,
11017 * During execution of guarded functions we will capture the first error which
11018 * we will rethrow to be handled by the top level error handler.
11020 rethrowCaughtError: function () {
11022 var error = caughtError;
11023 caughtError = null;
11029 if ("development" !== 'production') {
11031 * To help development we can get better devtools integration by simulating a
11032 * real browser event.
11034 if (typeof window !== 'undefined' && typeof window.dispatchEvent === 'function' && typeof document !== 'undefined' && typeof document.createEvent === 'function') {
11035 var fakeNode = document.createElement('react');
11036 ReactErrorUtils.invokeGuardedCallback = function (name, func, a, b) {
11037 var boundFunc = func.bind(null, a, b);
11038 var evtType = 'react-' + name;
11039 fakeNode.addEventListener(evtType, boundFunc, false);
11040 var evt = document.createEvent('Event');
11041 evt.initEvent(evtType, false, false);
11042 fakeNode.dispatchEvent(evt);
11043 fakeNode.removeEventListener(evtType, boundFunc, false);
11048 module.exports = ReactErrorUtils;
11049 },{}],69:[function(_dereq_,module,exports){
11051 * Copyright 2013-present, Facebook, Inc.
11052 * All rights reserved.
11054 * This source code is licensed under the BSD-style license found in the
11055 * LICENSE file in the root directory of this source tree. An additional grant
11056 * of patent rights can be found in the PATENTS file in the same directory.
11058 * @providesModule ReactEventEmitterMixin
11063 var EventPluginHub = _dereq_(17);
11065 function runEventQueueInBatch(events) {
11066 EventPluginHub.enqueueEvents(events);
11067 EventPluginHub.processEventQueue(false);
11070 var ReactEventEmitterMixin = {
11073 * Streams a fired top-level event to `EventPluginHub` where plugins have the
11074 * opportunity to create `ReactEvent`s to be dispatched.
11076 handleTopLevel: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
11077 var events = EventPluginHub.extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget);
11078 runEventQueueInBatch(events);
11082 module.exports = ReactEventEmitterMixin;
11083 },{"17":17}],70:[function(_dereq_,module,exports){
11085 * Copyright 2013-present, Facebook, Inc.
11086 * All rights reserved.
11088 * This source code is licensed under the BSD-style license found in the
11089 * LICENSE file in the root directory of this source tree. An additional grant
11090 * of patent rights can be found in the PATENTS file in the same directory.
11092 * @providesModule ReactEventListener
11097 var _assign = _dereq_(184);
11099 var EventListener = _dereq_(158);
11100 var ExecutionEnvironment = _dereq_(159);
11101 var PooledClass = _dereq_(26);
11102 var ReactDOMComponentTree = _dereq_(45);
11103 var ReactUpdates = _dereq_(104);
11105 var getEventTarget = _dereq_(138);
11106 var getUnboundedScrollPosition = _dereq_(170);
11109 * Find the deepest React component completely containing the root of the
11110 * passed-in instance (for use when entire React trees are nested within each
11111 * other). If React trees are not nested, returns null.
11113 function findParent(inst) {
11114 // TODO: It may be a good idea to cache this to prevent unnecessary DOM
11115 // traversal, but caching is difficult to do correctly without using a
11116 // mutation observer to listen for all DOM changes.
11117 while (inst._nativeParent) {
11118 inst = inst._nativeParent;
11120 var rootNode = ReactDOMComponentTree.getNodeFromInstance(inst);
11121 var container = rootNode.parentNode;
11122 return ReactDOMComponentTree.getClosestInstanceFromNode(container);
11125 // Used to store ancestor hierarchy in top level callback
11126 function TopLevelCallbackBookKeeping(topLevelType, nativeEvent) {
11127 this.topLevelType = topLevelType;
11128 this.nativeEvent = nativeEvent;
11129 this.ancestors = [];
11131 _assign(TopLevelCallbackBookKeeping.prototype, {
11132 destructor: function () {
11133 this.topLevelType = null;
11134 this.nativeEvent = null;
11135 this.ancestors.length = 0;
11138 PooledClass.addPoolingTo(TopLevelCallbackBookKeeping, PooledClass.twoArgumentPooler);
11140 function handleTopLevelImpl(bookKeeping) {
11141 var nativeEventTarget = getEventTarget(bookKeeping.nativeEvent);
11142 var targetInst = ReactDOMComponentTree.getClosestInstanceFromNode(nativeEventTarget);
11144 // Loop through the hierarchy, in case there's any nested components.
11145 // It's important that we build the array of ancestors before calling any
11146 // event handlers, because event handlers can modify the DOM, leading to
11147 // inconsistencies with ReactMount's node cache. See #1105.
11148 var ancestor = targetInst;
11150 bookKeeping.ancestors.push(ancestor);
11151 ancestor = ancestor && findParent(ancestor);
11152 } while (ancestor);
11154 for (var i = 0; i < bookKeeping.ancestors.length; i++) {
11155 targetInst = bookKeeping.ancestors[i];
11156 ReactEventListener._handleTopLevel(bookKeeping.topLevelType, targetInst, bookKeeping.nativeEvent, getEventTarget(bookKeeping.nativeEvent));
11160 function scrollValueMonitor(cb) {
11161 var scrollPosition = getUnboundedScrollPosition(window);
11162 cb(scrollPosition);
11165 var ReactEventListener = {
11167 _handleTopLevel: null,
11169 WINDOW_HANDLE: ExecutionEnvironment.canUseDOM ? window : null,
11171 setHandleTopLevel: function (handleTopLevel) {
11172 ReactEventListener._handleTopLevel = handleTopLevel;
11175 setEnabled: function (enabled) {
11176 ReactEventListener._enabled = !!enabled;
11179 isEnabled: function () {
11180 return ReactEventListener._enabled;
11184 * Traps top-level events by using event bubbling.
11186 * @param {string} topLevelType Record from `EventConstants`.
11187 * @param {string} handlerBaseName Event name (e.g. "click").
11188 * @param {object} handle Element on which to attach listener.
11189 * @return {?object} An object with a remove function which will forcefully
11190 * remove the listener.
11193 trapBubbledEvent: function (topLevelType, handlerBaseName, handle) {
11194 var element = handle;
11198 return EventListener.listen(element, handlerBaseName, ReactEventListener.dispatchEvent.bind(null, topLevelType));
11202 * Traps a top-level event by using event capturing.
11204 * @param {string} topLevelType Record from `EventConstants`.
11205 * @param {string} handlerBaseName Event name (e.g. "click").
11206 * @param {object} handle Element on which to attach listener.
11207 * @return {?object} An object with a remove function which will forcefully
11208 * remove the listener.
11211 trapCapturedEvent: function (topLevelType, handlerBaseName, handle) {
11212 var element = handle;
11216 return EventListener.capture(element, handlerBaseName, ReactEventListener.dispatchEvent.bind(null, topLevelType));
11219 monitorScrollValue: function (refresh) {
11220 var callback = scrollValueMonitor.bind(null, refresh);
11221 EventListener.listen(window, 'scroll', callback);
11224 dispatchEvent: function (topLevelType, nativeEvent) {
11225 if (!ReactEventListener._enabled) {
11229 var bookKeeping = TopLevelCallbackBookKeeping.getPooled(topLevelType, nativeEvent);
11231 // Event queue being processed in the same cycle allows
11232 // `preventDefault`.
11233 ReactUpdates.batchedUpdates(handleTopLevelImpl, bookKeeping);
11235 TopLevelCallbackBookKeeping.release(bookKeeping);
11240 module.exports = ReactEventListener;
11241 },{"104":104,"138":138,"158":158,"159":159,"170":170,"184":184,"26":26,"45":45}],71:[function(_dereq_,module,exports){
11243 * Copyright 2013-present, Facebook, Inc.
11244 * All rights reserved.
11246 * This source code is licensed under the BSD-style license found in the
11247 * LICENSE file in the root directory of this source tree. An additional grant
11248 * of patent rights can be found in the PATENTS file in the same directory.
11250 * @providesModule ReactFeatureFlags
11255 var ReactFeatureFlags = {
11256 // When true, call console.time() before and .timeEnd() after each top-level
11257 // render (both initial renders and updates). Useful when looking at prod-mode
11258 // timeline profiles in Chrome, for example.
11259 logTopLevelRenders: false
11262 module.exports = ReactFeatureFlags;
11263 },{}],72:[function(_dereq_,module,exports){
11265 * Copyright 2015-present, Facebook, Inc.
11266 * All rights reserved.
11268 * This source code is licensed under the BSD-style license found in the
11269 * LICENSE file in the root directory of this source tree. An additional grant
11270 * of patent rights can be found in the PATENTS file in the same directory.
11272 * @providesModule ReactFragment
11277 var ReactChildren = _dereq_(32);
11278 var ReactElement = _dereq_(65);
11280 var emptyFunction = _dereq_(165);
11281 var invariant = _dereq_(173);
11282 var warning = _dereq_(183);
11285 * We used to allow keyed objects to serve as a collection of ReactElements,
11286 * or nested sets. This allowed us a way to explicitly key a set or fragment of
11287 * components. This is now being replaced with an opaque data structure.
11288 * The upgrade path is to call React.addons.createFragment({ key: value }) to
11289 * create a keyed fragment. The resulting data structure is an array.
11292 var numericPropertyRegex = /^\d+$/;
11294 var warnedAboutNumeric = false;
11296 var ReactFragment = {
11298 * Wrap a keyed object in an opaque proxy that warns you if you access any
11299 * of its properties.
11300 * See https://facebook.github.io/react/docs/create-fragment.html
11302 create: function (object) {
11303 if (typeof object !== 'object' || !object || Array.isArray(object)) {
11304 "development" !== 'production' ? warning(false, 'React.addons.createFragment only accepts a single object. Got: %s', object) : void 0;
11307 if (ReactElement.isValidElement(object)) {
11308 "development" !== 'production' ? warning(false, 'React.addons.createFragment does not accept a ReactElement ' + 'without a wrapper object.') : void 0;
11312 !(object.nodeType !== 1) ? "development" !== 'production' ? invariant(false, 'React.addons.createFragment(...): Encountered an invalid child; DOM ' + 'elements are not valid children of React components.') : invariant(false) : void 0;
11316 for (var key in object) {
11317 if ("development" !== 'production') {
11318 if (!warnedAboutNumeric && numericPropertyRegex.test(key)) {
11319 "development" !== 'production' ? warning(false, 'React.addons.createFragment(...): Child objects should have ' + 'non-numeric keys so ordering is preserved.') : void 0;
11320 warnedAboutNumeric = true;
11323 ReactChildren.mapIntoWithKeyPrefixInternal(object[key], result, key, emptyFunction.thatReturnsArgument);
11330 module.exports = ReactFragment;
11331 },{"165":165,"173":173,"183":183,"32":32,"65":65}],73:[function(_dereq_,module,exports){
11333 * Copyright 2013-present, Facebook, Inc.
11334 * All rights reserved.
11336 * This source code is licensed under the BSD-style license found in the
11337 * LICENSE file in the root directory of this source tree. An additional grant
11338 * of patent rights can be found in the PATENTS file in the same directory.
11340 * @providesModule ReactInjection
11345 var DOMProperty = _dereq_(10);
11346 var EventPluginHub = _dereq_(17);
11347 var EventPluginUtils = _dereq_(19);
11348 var ReactComponentEnvironment = _dereq_(36);
11349 var ReactClass = _dereq_(33);
11350 var ReactEmptyComponent = _dereq_(67);
11351 var ReactBrowserEventEmitter = _dereq_(28);
11352 var ReactNativeComponent = _dereq_(83);
11353 var ReactUpdates = _dereq_(104);
11355 var ReactInjection = {
11356 Component: ReactComponentEnvironment.injection,
11357 Class: ReactClass.injection,
11358 DOMProperty: DOMProperty.injection,
11359 EmptyComponent: ReactEmptyComponent.injection,
11360 EventPluginHub: EventPluginHub.injection,
11361 EventPluginUtils: EventPluginUtils.injection,
11362 EventEmitter: ReactBrowserEventEmitter.injection,
11363 NativeComponent: ReactNativeComponent.injection,
11364 Updates: ReactUpdates.injection
11367 module.exports = ReactInjection;
11368 },{"10":10,"104":104,"17":17,"19":19,"28":28,"33":33,"36":36,"67":67,"83":83}],74:[function(_dereq_,module,exports){
11370 * Copyright 2013-present, Facebook, Inc.
11371 * All rights reserved.
11373 * This source code is licensed under the BSD-style license found in the
11374 * LICENSE file in the root directory of this source tree. An additional grant
11375 * of patent rights can be found in the PATENTS file in the same directory.
11377 * @providesModule ReactInputSelection
11382 var ReactDOMSelection = _dereq_(56);
11384 var containsNode = _dereq_(162);
11385 var focusNode = _dereq_(167);
11386 var getActiveElement = _dereq_(168);
11388 function isInDocument(node) {
11389 return containsNode(document.documentElement, node);
11393 * @ReactInputSelection: React input selection module. Based on Selection.js,
11394 * but modified to be suitable for react and has a couple of bug fixes (doesn't
11395 * assume buttons have range selections allowed).
11396 * Input selection module for React.
11398 var ReactInputSelection = {
11400 hasSelectionCapabilities: function (elem) {
11401 var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase();
11402 return nodeName && (nodeName === 'input' && elem.type === 'text' || nodeName === 'textarea' || elem.contentEditable === 'true');
11405 getSelectionInformation: function () {
11406 var focusedElem = getActiveElement();
11408 focusedElem: focusedElem,
11409 selectionRange: ReactInputSelection.hasSelectionCapabilities(focusedElem) ? ReactInputSelection.getSelection(focusedElem) : null
11414 * @restoreSelection: If any selection information was potentially lost,
11415 * restore it. This is useful when performing operations that could remove dom
11416 * nodes and place them back in, resulting in focus being lost.
11418 restoreSelection: function (priorSelectionInformation) {
11419 var curFocusedElem = getActiveElement();
11420 var priorFocusedElem = priorSelectionInformation.focusedElem;
11421 var priorSelectionRange = priorSelectionInformation.selectionRange;
11422 if (curFocusedElem !== priorFocusedElem && isInDocument(priorFocusedElem)) {
11423 if (ReactInputSelection.hasSelectionCapabilities(priorFocusedElem)) {
11424 ReactInputSelection.setSelection(priorFocusedElem, priorSelectionRange);
11426 focusNode(priorFocusedElem);
11431 * @getSelection: Gets the selection bounds of a focused textarea, input or
11432 * contentEditable node.
11433 * -@input: Look up selection bounds of this input
11434 * -@return {start: selectionStart, end: selectionEnd}
11436 getSelection: function (input) {
11439 if ('selectionStart' in input) {
11440 // Modern browser with input or textarea.
11442 start: input.selectionStart,
11443 end: input.selectionEnd
11445 } else if (document.selection && input.nodeName && input.nodeName.toLowerCase() === 'input') {
11447 var range = document.selection.createRange();
11448 // There can only be one selection per document in IE, so it must
11449 // be in our element.
11450 if (range.parentElement() === input) {
11452 start: -range.moveStart('character', -input.value.length),
11453 end: -range.moveEnd('character', -input.value.length)
11457 // Content editable or old IE textarea.
11458 selection = ReactDOMSelection.getOffsets(input);
11461 return selection || { start: 0, end: 0 };
11465 * @setSelection: Sets the selection bounds of a textarea or input and focuses
11467 * -@input Set selection bounds of this input or textarea
11468 * -@offsets Object of same form that is returned from get*
11470 setSelection: function (input, offsets) {
11471 var start = offsets.start;
11472 var end = offsets.end;
11473 if (end === undefined) {
11477 if ('selectionStart' in input) {
11478 input.selectionStart = start;
11479 input.selectionEnd = Math.min(end, input.value.length);
11480 } else if (document.selection && input.nodeName && input.nodeName.toLowerCase() === 'input') {
11481 var range = input.createTextRange();
11482 range.collapse(true);
11483 range.moveStart('character', start);
11484 range.moveEnd('character', end - start);
11487 ReactDOMSelection.setOffsets(input, offsets);
11492 module.exports = ReactInputSelection;
11493 },{"162":162,"167":167,"168":168,"56":56}],75:[function(_dereq_,module,exports){
11495 * Copyright 2013-present, Facebook, Inc.
11496 * All rights reserved.
11498 * This source code is licensed under the BSD-style license found in the
11499 * LICENSE file in the root directory of this source tree. An additional grant
11500 * of patent rights can be found in the PATENTS file in the same directory.
11502 * @providesModule ReactInstanceMap
11508 * `ReactInstanceMap` maintains a mapping from a public facing stateful
11509 * instance (key) and the internal representation (value). This allows public
11510 * methods to accept the user facing instance as an argument and map them back
11511 * to internal methods.
11514 // TODO: Replace this with ES6: var ReactInstanceMap = new Map();
11516 var ReactInstanceMap = {
11519 * This API should be called `delete` but we'd have to make sure to always
11520 * transform these to strings for IE support. When this transform is fully
11521 * supported we can rename it.
11523 remove: function (key) {
11524 key._reactInternalInstance = undefined;
11527 get: function (key) {
11528 return key._reactInternalInstance;
11531 has: function (key) {
11532 return key._reactInternalInstance !== undefined;
11535 set: function (key, value) {
11536 key._reactInternalInstance = value;
11541 module.exports = ReactInstanceMap;
11542 },{}],76:[function(_dereq_,module,exports){
11544 * Copyright 2016-present, Facebook, Inc.
11545 * All rights reserved.
11547 * This source code is licensed under the BSD-style license found in the
11548 * LICENSE file in the root directory of this source tree. An additional grant
11549 * of patent rights can be found in the PATENTS file in the same directory.
11551 * @providesModule ReactInstrumentation
11556 var ReactDebugTool = _dereq_(62);
11558 module.exports = { debugTool: ReactDebugTool };
11559 },{"62":62}],77:[function(_dereq_,module,exports){
11561 * Copyright 2016-present, Facebook, Inc.
11562 * All rights reserved.
11564 * This source code is licensed under the BSD-style license found in the
11565 * LICENSE file in the root directory of this source tree. An additional grant
11566 * of patent rights can be found in the PATENTS file in the same directory.
11568 * @providesModule ReactInvalidSetStateWarningDevTool
11573 var warning = _dereq_(183);
11575 if ("development" !== 'production') {
11576 var processingChildContext = false;
11578 var warnInvalidSetState = function () {
11579 "development" !== 'production' ? warning(!processingChildContext, 'setState(...): Cannot call setState() inside getChildContext()') : void 0;
11583 var ReactInvalidSetStateWarningDevTool = {
11584 onBeginProcessingChildContext: function () {
11585 processingChildContext = true;
11587 onEndProcessingChildContext: function () {
11588 processingChildContext = false;
11590 onSetState: function () {
11591 warnInvalidSetState();
11595 module.exports = ReactInvalidSetStateWarningDevTool;
11596 },{"183":183}],78:[function(_dereq_,module,exports){
11598 * Copyright 2013-present, Facebook, Inc.
11599 * All rights reserved.
11601 * This source code is licensed under the BSD-style license found in the
11602 * LICENSE file in the root directory of this source tree. An additional grant
11603 * of patent rights can be found in the PATENTS file in the same directory.
11605 * @providesModule ReactLink
11611 * ReactLink encapsulates a common pattern in which a component wants to modify
11612 * a prop received from its parent. ReactLink allows the parent to pass down a
11613 * value coupled with a callback that, when invoked, expresses an intent to
11614 * modify that value. For example:
11616 * React.createClass({
11617 * getInitialState: function() {
11618 * return {value: ''};
11620 * render: function() {
11621 * var valueLink = new ReactLink(this.state.value, this._handleValueChange);
11622 * return <input valueLink={valueLink} />;
11624 * _handleValueChange: function(newValue) {
11625 * this.setState({value: newValue});
11629 * We have provided some sugary mixins to make the creation and
11630 * consumption of ReactLink easier; see LinkedValueUtils and LinkedStateMixin.
11633 var React = _dereq_(27);
11636 * Deprecated: An an easy way to express two-way binding with React.
11637 * See https://facebook.github.io/react/docs/two-way-binding-helpers.html
11639 * @param {*} value current value of the link
11640 * @param {function} requestChange callback to request a change
11642 function ReactLink(value, requestChange) {
11643 this.value = value;
11644 this.requestChange = requestChange;
11648 * Creates a PropType that enforces the ReactLink API and optionally checks the
11649 * type of the value being passed inside the link. Example:
11651 * MyComponent.propTypes = {
11652 * tabIndexLink: ReactLink.PropTypes.link(React.PropTypes.number)
11655 function createLinkTypeChecker(linkType) {
11657 value: linkType === undefined ? React.PropTypes.any.isRequired : linkType.isRequired,
11658 requestChange: React.PropTypes.func.isRequired
11660 return React.PropTypes.shape(shapes);
11663 ReactLink.PropTypes = {
11664 link: createLinkTypeChecker
11667 module.exports = ReactLink;
11668 },{"27":27}],79:[function(_dereq_,module,exports){
11670 * Copyright 2013-present, Facebook, Inc.
11671 * All rights reserved.
11673 * This source code is licensed under the BSD-style license found in the
11674 * LICENSE file in the root directory of this source tree. An additional grant
11675 * of patent rights can be found in the PATENTS file in the same directory.
11677 * @providesModule ReactMarkupChecksum
11682 var adler32 = _dereq_(127);
11684 var TAG_END = /\/?>/;
11685 var COMMENT_START = /^<\!\-\-/;
11687 var ReactMarkupChecksum = {
11688 CHECKSUM_ATTR_NAME: 'data-react-checksum',
11691 * @param {string} markup Markup string
11692 * @return {string} Markup string with checksum attribute attached
11694 addChecksumToMarkup: function (markup) {
11695 var checksum = adler32(markup);
11697 // Add checksum (handle both parent tags, comments and self-closing tags)
11698 if (COMMENT_START.test(markup)) {
11701 return markup.replace(TAG_END, ' ' + ReactMarkupChecksum.CHECKSUM_ATTR_NAME + '="' + checksum + '"$&');
11706 * @param {string} markup to use
11707 * @param {DOMElement} element root React element
11708 * @returns {boolean} whether or not the markup is the same
11710 canReuseMarkup: function (markup, element) {
11711 var existingChecksum = element.getAttribute(ReactMarkupChecksum.CHECKSUM_ATTR_NAME);
11712 existingChecksum = existingChecksum && parseInt(existingChecksum, 10);
11713 var markupChecksum = adler32(markup);
11714 return markupChecksum === existingChecksum;
11718 module.exports = ReactMarkupChecksum;
11719 },{"127":127}],80:[function(_dereq_,module,exports){
11721 * Copyright 2013-present, Facebook, Inc.
11722 * All rights reserved.
11724 * This source code is licensed under the BSD-style license found in the
11725 * LICENSE file in the root directory of this source tree. An additional grant
11726 * of patent rights can be found in the PATENTS file in the same directory.
11728 * @providesModule ReactMount
11733 var DOMLazyTree = _dereq_(8);
11734 var DOMProperty = _dereq_(10);
11735 var ReactBrowserEventEmitter = _dereq_(28);
11736 var ReactCurrentOwner = _dereq_(40);
11737 var ReactDOMComponentTree = _dereq_(45);
11738 var ReactDOMContainerInfo = _dereq_(46);
11739 var ReactDOMFeatureFlags = _dereq_(50);
11740 var ReactElement = _dereq_(65);
11741 var ReactFeatureFlags = _dereq_(71);
11742 var ReactInstrumentation = _dereq_(76);
11743 var ReactMarkupChecksum = _dereq_(79);
11744 var ReactReconciler = _dereq_(93);
11745 var ReactUpdateQueue = _dereq_(103);
11746 var ReactUpdates = _dereq_(104);
11748 var emptyObject = _dereq_(166);
11749 var instantiateReactComponent = _dereq_(144);
11750 var invariant = _dereq_(173);
11751 var setInnerHTML = _dereq_(150);
11752 var shouldUpdateReactComponent = _dereq_(153);
11753 var warning = _dereq_(183);
11755 var ATTR_NAME = DOMProperty.ID_ATTRIBUTE_NAME;
11756 var ROOT_ATTR_NAME = DOMProperty.ROOT_ATTRIBUTE_NAME;
11758 var ELEMENT_NODE_TYPE = 1;
11759 var DOC_NODE_TYPE = 9;
11760 var DOCUMENT_FRAGMENT_NODE_TYPE = 11;
11762 var instancesByReactRootID = {};
11765 * Finds the index of the first character
11766 * that's not common between the two given strings.
11768 * @return {number} the index of the character where the strings diverge
11770 function firstDifferenceIndex(string1, string2) {
11771 var minLen = Math.min(string1.length, string2.length);
11772 for (var i = 0; i < minLen; i++) {
11773 if (string1.charAt(i) !== string2.charAt(i)) {
11777 return string1.length === string2.length ? -1 : minLen;
11781 * @param {DOMElement|DOMDocument} container DOM element that may contain
11782 * a React component
11783 * @return {?*} DOM element that may have the reactRoot ID, or null.
11785 function getReactRootElementInContainer(container) {
11790 if (container.nodeType === DOC_NODE_TYPE) {
11791 return container.documentElement;
11793 return container.firstChild;
11797 function internalGetID(node) {
11798 // If node is something like a window, document, or text node, none of
11799 // which support attributes or a .getAttribute method, gracefully return
11800 // the empty string, as if the attribute were missing.
11801 return node.getAttribute && node.getAttribute(ATTR_NAME) || '';
11805 * Mounts this component and inserts it into the DOM.
11807 * @param {ReactComponent} componentInstance The instance to mount.
11808 * @param {DOMElement} container DOM element to mount into.
11809 * @param {ReactReconcileTransaction} transaction
11810 * @param {boolean} shouldReuseMarkup If true, do not insert markup
11812 function mountComponentIntoNode(wrapperInstance, container, transaction, shouldReuseMarkup, context) {
11814 if (ReactFeatureFlags.logTopLevelRenders) {
11815 var wrappedElement = wrapperInstance._currentElement.props;
11816 var type = wrappedElement.type;
11817 markerName = 'React mount: ' + (typeof type === 'string' ? type : type.displayName || type.name);
11818 console.time(markerName);
11821 var markup = ReactReconciler.mountComponent(wrapperInstance, transaction, null, ReactDOMContainerInfo(wrapperInstance, container), context);
11824 console.timeEnd(markerName);
11827 wrapperInstance._renderedComponent._topLevelWrapper = wrapperInstance;
11828 ReactMount._mountImageIntoNode(markup, container, wrapperInstance, shouldReuseMarkup, transaction);
11834 * @param {ReactComponent} componentInstance The instance to mount.
11835 * @param {DOMElement} container DOM element to mount into.
11836 * @param {boolean} shouldReuseMarkup If true, do not insert markup
11838 function batchedMountComponentIntoNode(componentInstance, container, shouldReuseMarkup, context) {
11839 var transaction = ReactUpdates.ReactReconcileTransaction.getPooled(
11840 /* useCreateElement */
11841 !shouldReuseMarkup && ReactDOMFeatureFlags.useCreateElement);
11842 transaction.perform(mountComponentIntoNode, null, componentInstance, container, transaction, shouldReuseMarkup, context);
11843 ReactUpdates.ReactReconcileTransaction.release(transaction);
11847 * Unmounts a component and removes it from the DOM.
11849 * @param {ReactComponent} instance React component instance.
11850 * @param {DOMElement} container DOM element to unmount from.
11853 * @see {ReactMount.unmountComponentAtNode}
11855 function unmountComponentFromNode(instance, container, safely) {
11856 ReactReconciler.unmountComponent(instance, safely);
11858 if (container.nodeType === DOC_NODE_TYPE) {
11859 container = container.documentElement;
11862 // http://jsperf.com/emptying-a-node
11863 while (container.lastChild) {
11864 container.removeChild(container.lastChild);
11869 * True if the supplied DOM node has a direct React-rendered child that is
11870 * not a React root element. Useful for warning in `render`,
11871 * `unmountComponentAtNode`, etc.
11873 * @param {?DOMElement} node The candidate DOM node.
11874 * @return {boolean} True if the DOM element contains a direct child that was
11875 * rendered by React but is not a root element.
11878 function hasNonRootReactChild(container) {
11879 var rootEl = getReactRootElementInContainer(container);
11881 var inst = ReactDOMComponentTree.getInstanceFromNode(rootEl);
11882 return !!(inst && inst._nativeParent);
11886 function getNativeRootInstanceInContainer(container) {
11887 var rootEl = getReactRootElementInContainer(container);
11888 var prevNativeInstance = rootEl && ReactDOMComponentTree.getInstanceFromNode(rootEl);
11889 return prevNativeInstance && !prevNativeInstance._nativeParent ? prevNativeInstance : null;
11892 function getTopLevelWrapperInContainer(container) {
11893 var root = getNativeRootInstanceInContainer(container);
11894 return root ? root._nativeContainerInfo._topLevelWrapper : null;
11898 * Temporary (?) hack so that we can store all top-level pending updates on
11899 * composites instead of having to worry about different types of components
11902 var topLevelRootCounter = 1;
11903 var TopLevelWrapper = function () {
11904 this.rootID = topLevelRootCounter++;
11906 TopLevelWrapper.prototype.isReactComponent = {};
11907 if ("development" !== 'production') {
11908 TopLevelWrapper.displayName = 'TopLevelWrapper';
11910 TopLevelWrapper.prototype.render = function () {
11911 // this.props is actually a ReactElement
11916 * Mounting is the process of initializing a React component by creating its
11917 * representative DOM elements and inserting them into a supplied `container`.
11918 * Any prior content inside `container` is destroyed in the process.
11920 * ReactMount.render(
11922 * document.getElementById('container')
11925 * <div id="container"> <-- Supplied `container`.
11926 * <div data-reactid=".3"> <-- Rendered reactRoot of React
11927 * // ... component.
11931 * Inside of `container`, the first element rendered is the "reactRoot".
11935 TopLevelWrapper: TopLevelWrapper,
11938 * Used by devtools. The keys are not important.
11940 _instancesByReactRootID: instancesByReactRootID,
11943 * This is a hook provided to support rendering React components while
11944 * ensuring that the apparent scroll position of its `container` does not
11947 * @param {DOMElement} container The `container` being rendered into.
11948 * @param {function} renderCallback This must be called once to do the render.
11950 scrollMonitor: function (container, renderCallback) {
11955 * Take a component that's already mounted into the DOM and replace its props
11956 * @param {ReactComponent} prevComponent component instance already in the DOM
11957 * @param {ReactElement} nextElement component instance to render
11958 * @param {DOMElement} container container to render into
11959 * @param {?function} callback function triggered on completion
11961 _updateRootComponent: function (prevComponent, nextElement, container, callback) {
11962 ReactMount.scrollMonitor(container, function () {
11963 ReactUpdateQueue.enqueueElementInternal(prevComponent, nextElement);
11965 ReactUpdateQueue.enqueueCallbackInternal(prevComponent, callback);
11969 return prevComponent;
11973 * Render a new component into the DOM. Hooked by devtools!
11975 * @param {ReactElement} nextElement element to render
11976 * @param {DOMElement} container container to render into
11977 * @param {boolean} shouldReuseMarkup if we should skip the markup insertion
11978 * @return {ReactComponent} nextComponent
11980 _renderNewRootComponent: function (nextElement, container, shouldReuseMarkup, context) {
11981 if ("development" !== 'production') {
11982 ReactInstrumentation.debugTool.onBeginFlush();
11985 // Various parts of our code (such as ReactCompositeComponent's
11986 // _renderValidatedComponent) assume that calls to render aren't nested;
11987 // verify that that's the case.
11988 "development" !== 'production' ? warning(ReactCurrentOwner.current == null, '_renderNewRootComponent(): Render methods should be a pure function ' + 'of props and state; triggering nested component updates from ' + 'render is not allowed. If necessary, trigger nested updates in ' + 'componentDidUpdate. Check the render method of %s.', ReactCurrentOwner.current && ReactCurrentOwner.current.getName() || 'ReactCompositeComponent') : void 0;
11990 !(container && (container.nodeType === ELEMENT_NODE_TYPE || container.nodeType === DOC_NODE_TYPE || container.nodeType === DOCUMENT_FRAGMENT_NODE_TYPE)) ? "development" !== 'production' ? invariant(false, '_registerComponent(...): Target container is not a DOM element.') : invariant(false) : void 0;
11992 ReactBrowserEventEmitter.ensureScrollValueMonitoring();
11993 var componentInstance = instantiateReactComponent(nextElement);
11995 if ("development" !== 'production') {
11996 // Mute future events from the top level wrapper.
11997 // It is an implementation detail that devtools should not know about.
11998 componentInstance._debugID = 0;
12001 // The initial render is synchronous but any updates that happen during
12002 // rendering, in componentWillMount or componentDidMount, will be batched
12003 // according to the current batching strategy.
12005 ReactUpdates.batchedUpdates(batchedMountComponentIntoNode, componentInstance, container, shouldReuseMarkup, context);
12007 var wrapperID = componentInstance._instance.rootID;
12008 instancesByReactRootID[wrapperID] = componentInstance;
12010 if ("development" !== 'production') {
12011 // The instance here is TopLevelWrapper so we report mount for its child.
12012 ReactInstrumentation.debugTool.onMountRootComponent(componentInstance._renderedComponent._debugID);
12013 ReactInstrumentation.debugTool.onEndFlush();
12016 return componentInstance;
12020 * Renders a React component into the DOM in the supplied `container`.
12022 * If the React component was previously rendered into `container`, this will
12023 * perform an update on it and only mutate the DOM as necessary to reflect the
12024 * latest React component.
12026 * @param {ReactComponent} parentComponent The conceptual parent of this render tree.
12027 * @param {ReactElement} nextElement Component element to render.
12028 * @param {DOMElement} container DOM element to render into.
12029 * @param {?function} callback function triggered on completion
12030 * @return {ReactComponent} Component instance rendered in `container`.
12032 renderSubtreeIntoContainer: function (parentComponent, nextElement, container, callback) {
12033 !(parentComponent != null && parentComponent._reactInternalInstance != null) ? "development" !== 'production' ? invariant(false, 'parentComponent must be a valid React Component') : invariant(false) : void 0;
12034 return ReactMount._renderSubtreeIntoContainer(parentComponent, nextElement, container, callback);
12037 _renderSubtreeIntoContainer: function (parentComponent, nextElement, container, callback) {
12038 ReactUpdateQueue.validateCallback(callback, 'ReactDOM.render');
12039 !ReactElement.isValidElement(nextElement) ? "development" !== 'production' ? invariant(false, 'ReactDOM.render(): Invalid component element.%s', typeof nextElement === 'string' ? ' Instead of passing a string like \'div\', pass ' + 'React.createElement(\'div\') or <div />.' : typeof nextElement === 'function' ? ' Instead of passing a class like Foo, pass ' + 'React.createElement(Foo) or <Foo />.' :
12040 // Check if it quacks like an element
12041 nextElement != null && nextElement.props !== undefined ? ' This may be caused by unintentionally loading two independent ' + 'copies of React.' : '') : invariant(false) : void 0;
12043 "development" !== 'production' ? warning(!container || !container.tagName || container.tagName.toUpperCase() !== 'BODY', 'render(): Rendering components directly into document.body is ' + 'discouraged, since its children are often manipulated by third-party ' + 'scripts and browser extensions. This may lead to subtle ' + 'reconciliation issues. Try rendering into a container element created ' + 'for your app.') : void 0;
12045 var nextWrappedElement = ReactElement(TopLevelWrapper, null, null, null, null, null, nextElement);
12047 var prevComponent = getTopLevelWrapperInContainer(container);
12049 if (prevComponent) {
12050 var prevWrappedElement = prevComponent._currentElement;
12051 var prevElement = prevWrappedElement.props;
12052 if (shouldUpdateReactComponent(prevElement, nextElement)) {
12053 var publicInst = prevComponent._renderedComponent.getPublicInstance();
12054 var updatedCallback = callback && function () {
12055 callback.call(publicInst);
12057 ReactMount._updateRootComponent(prevComponent, nextWrappedElement, container, updatedCallback);
12060 ReactMount.unmountComponentAtNode(container);
12064 var reactRootElement = getReactRootElementInContainer(container);
12065 var containerHasReactMarkup = reactRootElement && !!internalGetID(reactRootElement);
12066 var containerHasNonRootReactChild = hasNonRootReactChild(container);
12068 if ("development" !== 'production') {
12069 "development" !== 'production' ? warning(!containerHasNonRootReactChild, 'render(...): Replacing React-rendered children with a new root ' + 'component. If you intended to update the children of this node, ' + 'you should instead have the existing children update their state ' + 'and render the new components instead of calling ReactDOM.render.') : void 0;
12071 if (!containerHasReactMarkup || reactRootElement.nextSibling) {
12072 var rootElementSibling = reactRootElement;
12073 while (rootElementSibling) {
12074 if (internalGetID(rootElementSibling)) {
12075 "development" !== 'production' ? warning(false, 'render(): Target node has markup rendered by React, but there ' + 'are unrelated nodes as well. This is most commonly caused by ' + 'white-space inserted around server-rendered markup.') : void 0;
12078 rootElementSibling = rootElementSibling.nextSibling;
12083 var shouldReuseMarkup = containerHasReactMarkup && !prevComponent && !containerHasNonRootReactChild;
12084 var component = ReactMount._renderNewRootComponent(nextWrappedElement, container, shouldReuseMarkup, parentComponent != null ? parentComponent._reactInternalInstance._processChildContext(parentComponent._reactInternalInstance._context) : emptyObject)._renderedComponent.getPublicInstance();
12086 callback.call(component);
12092 * Renders a React component into the DOM in the supplied `container`.
12093 * See https://facebook.github.io/react/docs/top-level-api.html#reactdom.render
12095 * If the React component was previously rendered into `container`, this will
12096 * perform an update on it and only mutate the DOM as necessary to reflect the
12097 * latest React component.
12099 * @param {ReactElement} nextElement Component element to render.
12100 * @param {DOMElement} container DOM element to render into.
12101 * @param {?function} callback function triggered on completion
12102 * @return {ReactComponent} Component instance rendered in `container`.
12104 render: function (nextElement, container, callback) {
12105 return ReactMount._renderSubtreeIntoContainer(null, nextElement, container, callback);
12109 * Unmounts and destroys the React component rendered in the `container`.
12110 * See https://facebook.github.io/react/docs/top-level-api.html#reactdom.unmountcomponentatnode
12112 * @param {DOMElement} container DOM element containing a React component.
12113 * @return {boolean} True if a component was found in and unmounted from
12116 unmountComponentAtNode: function (container) {
12117 // Various parts of our code (such as ReactCompositeComponent's
12118 // _renderValidatedComponent) assume that calls to render aren't nested;
12119 // verify that that's the case. (Strictly speaking, unmounting won't cause a
12120 // render but we still don't expect to be in a render call here.)
12121 "development" !== 'production' ? warning(ReactCurrentOwner.current == null, 'unmountComponentAtNode(): Render methods should be a pure function ' + 'of props and state; triggering nested component updates from render ' + 'is not allowed. If necessary, trigger nested updates in ' + 'componentDidUpdate. Check the render method of %s.', ReactCurrentOwner.current && ReactCurrentOwner.current.getName() || 'ReactCompositeComponent') : void 0;
12123 !(container && (container.nodeType === ELEMENT_NODE_TYPE || container.nodeType === DOC_NODE_TYPE || container.nodeType === DOCUMENT_FRAGMENT_NODE_TYPE)) ? "development" !== 'production' ? invariant(false, 'unmountComponentAtNode(...): Target container is not a DOM element.') : invariant(false) : void 0;
12125 var prevComponent = getTopLevelWrapperInContainer(container);
12126 if (!prevComponent) {
12127 // Check if the node being unmounted was rendered by React, but isn't a
12129 var containerHasNonRootReactChild = hasNonRootReactChild(container);
12131 // Check if the container itself is a React root node.
12132 var isContainerReactRoot = container.nodeType === 1 && container.hasAttribute(ROOT_ATTR_NAME);
12134 if ("development" !== 'production') {
12135 "development" !== 'production' ? warning(!containerHasNonRootReactChild, 'unmountComponentAtNode(): The node you\'re attempting to unmount ' + 'was rendered by React and is not a top-level container. %s', isContainerReactRoot ? 'You may have accidentally passed in a React root node instead ' + 'of its container.' : 'Instead, have the parent component update its state and ' + 'rerender in order to remove this component.') : void 0;
12140 delete instancesByReactRootID[prevComponent._instance.rootID];
12141 ReactUpdates.batchedUpdates(unmountComponentFromNode, prevComponent, container, false);
12145 _mountImageIntoNode: function (markup, container, instance, shouldReuseMarkup, transaction) {
12146 !(container && (container.nodeType === ELEMENT_NODE_TYPE || container.nodeType === DOC_NODE_TYPE || container.nodeType === DOCUMENT_FRAGMENT_NODE_TYPE)) ? "development" !== 'production' ? invariant(false, 'mountComponentIntoNode(...): Target container is not valid.') : invariant(false) : void 0;
12148 if (shouldReuseMarkup) {
12149 var rootElement = getReactRootElementInContainer(container);
12150 if (ReactMarkupChecksum.canReuseMarkup(markup, rootElement)) {
12151 ReactDOMComponentTree.precacheNode(instance, rootElement);
12154 var checksum = rootElement.getAttribute(ReactMarkupChecksum.CHECKSUM_ATTR_NAME);
12155 rootElement.removeAttribute(ReactMarkupChecksum.CHECKSUM_ATTR_NAME);
12157 var rootMarkup = rootElement.outerHTML;
12158 rootElement.setAttribute(ReactMarkupChecksum.CHECKSUM_ATTR_NAME, checksum);
12160 var normalizedMarkup = markup;
12161 if ("development" !== 'production') {
12162 // because rootMarkup is retrieved from the DOM, various normalizations
12163 // will have occurred which will not be present in `markup`. Here,
12164 // insert markup into a <div> or <iframe> depending on the container
12165 // type to perform the same normalizations before comparing.
12167 if (container.nodeType === ELEMENT_NODE_TYPE) {
12168 normalizer = document.createElement('div');
12169 normalizer.innerHTML = markup;
12170 normalizedMarkup = normalizer.innerHTML;
12172 normalizer = document.createElement('iframe');
12173 document.body.appendChild(normalizer);
12174 normalizer.contentDocument.write(markup);
12175 normalizedMarkup = normalizer.contentDocument.documentElement.outerHTML;
12176 document.body.removeChild(normalizer);
12180 var diffIndex = firstDifferenceIndex(normalizedMarkup, rootMarkup);
12181 var difference = ' (client) ' + normalizedMarkup.substring(diffIndex - 20, diffIndex + 20) + '\n (server) ' + rootMarkup.substring(diffIndex - 20, diffIndex + 20);
12183 !(container.nodeType !== DOC_NODE_TYPE) ? "development" !== 'production' ? invariant(false, 'You\'re trying to render a component to the document using ' + 'server rendering but the checksum was invalid. This usually ' + 'means you rendered a different component type or props on ' + 'the client from the one on the server, or your render() ' + 'methods are impure. React cannot handle this case due to ' + 'cross-browser quirks by rendering at the document root. You ' + 'should look for environment dependent code in your components ' + 'and ensure the props are the same client and server side:\n%s', difference) : invariant(false) : void 0;
12185 if ("development" !== 'production') {
12186 "development" !== 'production' ? warning(false, 'React attempted to reuse markup in a container but the ' + 'checksum was invalid. This generally means that you are ' + 'using server rendering and the markup generated on the ' + 'server was not what the client was expecting. React injected ' + 'new markup to compensate which works but you have lost many ' + 'of the benefits of server rendering. Instead, figure out ' + 'why the markup being generated is different on the client ' + 'or server:\n%s', difference) : void 0;
12191 !(container.nodeType !== DOC_NODE_TYPE) ? "development" !== 'production' ? invariant(false, 'You\'re trying to render a component to the document but ' + 'you didn\'t use server rendering. We can\'t do this ' + 'without using server rendering due to cross-browser quirks. ' + 'See ReactDOMServer.renderToString() for server rendering.') : invariant(false) : void 0;
12193 if (transaction.useCreateElement) {
12194 while (container.lastChild) {
12195 container.removeChild(container.lastChild);
12197 DOMLazyTree.insertTreeBefore(container, markup, null);
12199 setInnerHTML(container, markup);
12200 ReactDOMComponentTree.precacheNode(instance, container.firstChild);
12203 if ("development" !== 'production') {
12204 var nativeNode = ReactDOMComponentTree.getInstanceFromNode(container.firstChild);
12205 if (nativeNode._debugID !== 0) {
12206 ReactInstrumentation.debugTool.onNativeOperation(nativeNode._debugID, 'mount', markup.toString());
12212 module.exports = ReactMount;
12213 },{"10":10,"103":103,"104":104,"144":144,"150":150,"153":153,"166":166,"173":173,"183":183,"28":28,"40":40,"45":45,"46":46,"50":50,"65":65,"71":71,"76":76,"79":79,"8":8,"93":93}],81:[function(_dereq_,module,exports){
12215 * Copyright 2013-present, Facebook, Inc.
12216 * All rights reserved.
12218 * This source code is licensed under the BSD-style license found in the
12219 * LICENSE file in the root directory of this source tree. An additional grant
12220 * of patent rights can be found in the PATENTS file in the same directory.
12222 * @providesModule ReactMultiChild
12227 var ReactComponentEnvironment = _dereq_(36);
12228 var ReactInstrumentation = _dereq_(76);
12229 var ReactMultiChildUpdateTypes = _dereq_(82);
12231 var ReactCurrentOwner = _dereq_(40);
12232 var ReactReconciler = _dereq_(93);
12233 var ReactChildReconciler = _dereq_(31);
12235 var emptyFunction = _dereq_(165);
12236 var flattenChildren = _dereq_(133);
12237 var invariant = _dereq_(173);
12240 * Make an update for markup to be rendered and inserted at a supplied index.
12242 * @param {string} markup Markup that renders into an element.
12243 * @param {number} toIndex Destination index.
12246 function makeInsertMarkup(markup, afterNode, toIndex) {
12247 // NOTE: Null values reduce hidden classes.
12249 type: ReactMultiChildUpdateTypes.INSERT_MARKUP,
12254 afterNode: afterNode
12259 * Make an update for moving an existing element to another index.
12261 * @param {number} fromIndex Source index of the existing element.
12262 * @param {number} toIndex Destination index of the element.
12265 function makeMove(child, afterNode, toIndex) {
12266 // NOTE: Null values reduce hidden classes.
12268 type: ReactMultiChildUpdateTypes.MOVE_EXISTING,
12270 fromIndex: child._mountIndex,
12271 fromNode: ReactReconciler.getNativeNode(child),
12273 afterNode: afterNode
12278 * Make an update for removing an element at an index.
12280 * @param {number} fromIndex Index of the element to remove.
12283 function makeRemove(child, node) {
12284 // NOTE: Null values reduce hidden classes.
12286 type: ReactMultiChildUpdateTypes.REMOVE_NODE,
12288 fromIndex: child._mountIndex,
12296 * Make an update for setting the markup of a node.
12298 * @param {string} markup Markup that renders into an element.
12301 function makeSetMarkup(markup) {
12302 // NOTE: Null values reduce hidden classes.
12304 type: ReactMultiChildUpdateTypes.SET_MARKUP,
12314 * Make an update for setting the text content.
12316 * @param {string} textContent Text content to set.
12319 function makeTextContent(textContent) {
12320 // NOTE: Null values reduce hidden classes.
12322 type: ReactMultiChildUpdateTypes.TEXT_CONTENT,
12323 content: textContent,
12332 * Push an update, if any, onto the queue. Creates a new queue if none is
12333 * passed and always returns the queue. Mutative.
12335 function enqueue(queue, update) {
12337 queue = queue || [];
12338 queue.push(update);
12344 * Processes any enqueued updates.
12348 function processQueue(inst, updateQueue) {
12349 ReactComponentEnvironment.processChildrenUpdates(inst, updateQueue);
12352 var setChildrenForInstrumentation = emptyFunction;
12353 if ("development" !== 'production') {
12354 setChildrenForInstrumentation = function (children) {
12355 ReactInstrumentation.debugTool.onSetChildren(this._debugID, children ? Object.keys(children).map(function (key) {
12356 return children[key]._debugID;
12362 * ReactMultiChild are capable of reconciling multiple children.
12364 * @class ReactMultiChild
12367 var ReactMultiChild = {
12370 * Provides common functionality for components that must reconcile multiple
12371 * children. This is used by `ReactDOMComponent` to mount, update, and
12372 * unmount child components.
12374 * @lends {ReactMultiChild.prototype}
12378 _reconcilerInstantiateChildren: function (nestedChildren, transaction, context) {
12379 if ("development" !== 'production') {
12380 if (this._currentElement) {
12382 ReactCurrentOwner.current = this._currentElement._owner;
12383 return ReactChildReconciler.instantiateChildren(nestedChildren, transaction, context);
12385 ReactCurrentOwner.current = null;
12389 return ReactChildReconciler.instantiateChildren(nestedChildren, transaction, context);
12392 _reconcilerUpdateChildren: function (prevChildren, nextNestedChildrenElements, removedNodes, transaction, context) {
12394 if ("development" !== 'production') {
12395 if (this._currentElement) {
12397 ReactCurrentOwner.current = this._currentElement._owner;
12398 nextChildren = flattenChildren(nextNestedChildrenElements);
12400 ReactCurrentOwner.current = null;
12402 ReactChildReconciler.updateChildren(prevChildren, nextChildren, removedNodes, transaction, context);
12403 return nextChildren;
12406 nextChildren = flattenChildren(nextNestedChildrenElements);
12407 ReactChildReconciler.updateChildren(prevChildren, nextChildren, removedNodes, transaction, context);
12408 return nextChildren;
12412 * Generates a "mount image" for each of the supplied children. In the case
12413 * of `ReactDOMComponent`, a mount image is a string of markup.
12415 * @param {?object} nestedChildren Nested child maps.
12416 * @return {array} An array of mounted representations.
12419 mountChildren: function (nestedChildren, transaction, context) {
12420 var children = this._reconcilerInstantiateChildren(nestedChildren, transaction, context);
12421 this._renderedChildren = children;
12423 var mountImages = [];
12425 for (var name in children) {
12426 if (children.hasOwnProperty(name)) {
12427 var child = children[name];
12428 var mountImage = ReactReconciler.mountComponent(child, transaction, this, this._nativeContainerInfo, context);
12429 child._mountIndex = index++;
12430 mountImages.push(mountImage);
12434 if ("development" !== 'production') {
12435 setChildrenForInstrumentation.call(this, children);
12438 return mountImages;
12442 * Replaces any rendered children with a text content string.
12444 * @param {string} nextContent String of content.
12447 updateTextContent: function (nextContent) {
12448 var prevChildren = this._renderedChildren;
12449 // Remove any rendered children.
12450 ReactChildReconciler.unmountChildren(prevChildren, false);
12451 for (var name in prevChildren) {
12452 if (prevChildren.hasOwnProperty(name)) {
12453 !false ? "development" !== 'production' ? invariant(false, 'updateTextContent called on non-empty component.') : invariant(false) : void 0;
12456 // Set new text content.
12457 var updates = [makeTextContent(nextContent)];
12458 processQueue(this, updates);
12462 * Replaces any rendered children with a markup string.
12464 * @param {string} nextMarkup String of markup.
12467 updateMarkup: function (nextMarkup) {
12468 var prevChildren = this._renderedChildren;
12469 // Remove any rendered children.
12470 ReactChildReconciler.unmountChildren(prevChildren, false);
12471 for (var name in prevChildren) {
12472 if (prevChildren.hasOwnProperty(name)) {
12473 !false ? "development" !== 'production' ? invariant(false, 'updateTextContent called on non-empty component.') : invariant(false) : void 0;
12476 var updates = [makeSetMarkup(nextMarkup)];
12477 processQueue(this, updates);
12481 * Updates the rendered children with new children.
12483 * @param {?object} nextNestedChildrenElements Nested child element maps.
12484 * @param {ReactReconcileTransaction} transaction
12487 updateChildren: function (nextNestedChildrenElements, transaction, context) {
12488 // Hook used by React ART
12489 this._updateChildren(nextNestedChildrenElements, transaction, context);
12493 * @param {?object} nextNestedChildrenElements Nested child element maps.
12494 * @param {ReactReconcileTransaction} transaction
12498 _updateChildren: function (nextNestedChildrenElements, transaction, context) {
12499 var prevChildren = this._renderedChildren;
12500 var removedNodes = {};
12501 var nextChildren = this._reconcilerUpdateChildren(prevChildren, nextNestedChildrenElements, removedNodes, transaction, context);
12502 if (!nextChildren && !prevChildren) {
12505 var updates = null;
12507 // `nextIndex` will increment for each child in `nextChildren`, but
12508 // `lastIndex` will be the last index visited in `prevChildren`.
12511 var lastPlacedNode = null;
12512 for (name in nextChildren) {
12513 if (!nextChildren.hasOwnProperty(name)) {
12516 var prevChild = prevChildren && prevChildren[name];
12517 var nextChild = nextChildren[name];
12518 if (prevChild === nextChild) {
12519 updates = enqueue(updates, this.moveChild(prevChild, lastPlacedNode, nextIndex, lastIndex));
12520 lastIndex = Math.max(prevChild._mountIndex, lastIndex);
12521 prevChild._mountIndex = nextIndex;
12524 // Update `lastIndex` before `_mountIndex` gets unset by unmounting.
12525 lastIndex = Math.max(prevChild._mountIndex, lastIndex);
12526 // The `removedNodes` loop below will actually remove the child.
12528 // The child must be instantiated before it's mounted.
12529 updates = enqueue(updates, this._mountChildAtIndex(nextChild, lastPlacedNode, nextIndex, transaction, context));
12532 lastPlacedNode = ReactReconciler.getNativeNode(nextChild);
12534 // Remove children that are no longer present.
12535 for (name in removedNodes) {
12536 if (removedNodes.hasOwnProperty(name)) {
12537 updates = enqueue(updates, this._unmountChild(prevChildren[name], removedNodes[name]));
12541 processQueue(this, updates);
12543 this._renderedChildren = nextChildren;
12545 if ("development" !== 'production') {
12546 setChildrenForInstrumentation.call(this, nextChildren);
12551 * Unmounts all rendered children. This should be used to clean up children
12552 * when this component is unmounted. It does not actually perform any
12553 * backend operations.
12557 unmountChildren: function (safely) {
12558 var renderedChildren = this._renderedChildren;
12559 ReactChildReconciler.unmountChildren(renderedChildren, safely);
12560 this._renderedChildren = null;
12564 * Moves a child component to the supplied index.
12566 * @param {ReactComponent} child Component to move.
12567 * @param {number} toIndex Destination index of the element.
12568 * @param {number} lastIndex Last index visited of the siblings of `child`.
12571 moveChild: function (child, afterNode, toIndex, lastIndex) {
12572 // If the index of `child` is less than `lastIndex`, then it needs to
12573 // be moved. Otherwise, we do not need to move it because a child will be
12574 // inserted or moved before `child`.
12575 if (child._mountIndex < lastIndex) {
12576 return makeMove(child, afterNode, toIndex);
12581 * Creates a child component.
12583 * @param {ReactComponent} child Component to create.
12584 * @param {string} mountImage Markup to insert.
12587 createChild: function (child, afterNode, mountImage) {
12588 return makeInsertMarkup(mountImage, afterNode, child._mountIndex);
12592 * Removes a child component.
12594 * @param {ReactComponent} child Child to remove.
12597 removeChild: function (child, node) {
12598 return makeRemove(child, node);
12602 * Mounts a child with the supplied name.
12604 * NOTE: This is part of `updateChildren` and is here for readability.
12606 * @param {ReactComponent} child Component to mount.
12607 * @param {string} name Name of the child.
12608 * @param {number} index Index at which to insert the child.
12609 * @param {ReactReconcileTransaction} transaction
12612 _mountChildAtIndex: function (child, afterNode, index, transaction, context) {
12613 var mountImage = ReactReconciler.mountComponent(child, transaction, this, this._nativeContainerInfo, context);
12614 child._mountIndex = index;
12615 return this.createChild(child, afterNode, mountImage);
12619 * Unmounts a rendered child.
12621 * NOTE: This is part of `updateChildren` and is here for readability.
12623 * @param {ReactComponent} child Component to unmount.
12626 _unmountChild: function (child, node) {
12627 var update = this.removeChild(child, node);
12628 child._mountIndex = null;
12636 module.exports = ReactMultiChild;
12637 },{"133":133,"165":165,"173":173,"31":31,"36":36,"40":40,"76":76,"82":82,"93":93}],82:[function(_dereq_,module,exports){
12639 * Copyright 2013-present, Facebook, Inc.
12640 * All rights reserved.
12642 * This source code is licensed under the BSD-style license found in the
12643 * LICENSE file in the root directory of this source tree. An additional grant
12644 * of patent rights can be found in the PATENTS file in the same directory.
12646 * @providesModule ReactMultiChildUpdateTypes
12651 var keyMirror = _dereq_(176);
12654 * When a component's children are updated, a series of update configuration
12655 * objects are created in order to batch and serialize the required changes.
12657 * Enumerates all the possible types of update configurations.
12661 var ReactMultiChildUpdateTypes = keyMirror({
12662 INSERT_MARKUP: null,
12663 MOVE_EXISTING: null,
12669 module.exports = ReactMultiChildUpdateTypes;
12670 },{"176":176}],83:[function(_dereq_,module,exports){
12672 * Copyright 2014-present, Facebook, Inc.
12673 * All rights reserved.
12675 * This source code is licensed under the BSD-style license found in the
12676 * LICENSE file in the root directory of this source tree. An additional grant
12677 * of patent rights can be found in the PATENTS file in the same directory.
12679 * @providesModule ReactNativeComponent
12684 var _assign = _dereq_(184);
12686 var invariant = _dereq_(173);
12688 var autoGenerateWrapperClass = null;
12689 var genericComponentClass = null;
12690 // This registry keeps track of wrapper classes around native tags.
12691 var tagToComponentClass = {};
12692 var textComponentClass = null;
12694 var ReactNativeComponentInjection = {
12695 // This accepts a class that receives the tag string. This is a catch all
12696 // that can render any kind of tag.
12697 injectGenericComponentClass: function (componentClass) {
12698 genericComponentClass = componentClass;
12700 // This accepts a text component class that takes the text string to be
12701 // rendered as props.
12702 injectTextComponentClass: function (componentClass) {
12703 textComponentClass = componentClass;
12705 // This accepts a keyed object with classes as values. Each key represents a
12706 // tag. That particular tag will use this class instead of the generic one.
12707 injectComponentClasses: function (componentClasses) {
12708 _assign(tagToComponentClass, componentClasses);
12713 * Get a composite component wrapper class for a specific tag.
12715 * @param {ReactElement} element The tag for which to get the class.
12716 * @return {function} The React class constructor function.
12718 function getComponentClassForElement(element) {
12719 if (typeof element.type === 'function') {
12720 return element.type;
12722 var tag = element.type;
12723 var componentClass = tagToComponentClass[tag];
12724 if (componentClass == null) {
12725 tagToComponentClass[tag] = componentClass = autoGenerateWrapperClass(tag);
12727 return componentClass;
12731 * Get a native internal component class for a specific tag.
12733 * @param {ReactElement} element The element to create.
12734 * @return {function} The internal class constructor function.
12736 function createInternalComponent(element) {
12737 !genericComponentClass ? "development" !== 'production' ? invariant(false, 'There is no registered component for the tag %s', element.type) : invariant(false) : void 0;
12738 return new genericComponentClass(element);
12742 * @param {ReactText} text
12743 * @return {ReactComponent}
12745 function createInstanceForText(text) {
12746 return new textComponentClass(text);
12750 * @param {ReactComponent} component
12751 * @return {boolean}
12753 function isTextComponent(component) {
12754 return component instanceof textComponentClass;
12757 var ReactNativeComponent = {
12758 getComponentClassForElement: getComponentClassForElement,
12759 createInternalComponent: createInternalComponent,
12760 createInstanceForText: createInstanceForText,
12761 isTextComponent: isTextComponent,
12762 injection: ReactNativeComponentInjection
12765 module.exports = ReactNativeComponent;
12766 },{"173":173,"184":184}],84:[function(_dereq_,module,exports){
12768 * Copyright 2016-present, Facebook, Inc.
12769 * All rights reserved.
12771 * This source code is licensed under the BSD-style license found in the
12772 * LICENSE file in the root directory of this source tree. An additional grant
12773 * of patent rights can be found in the PATENTS file in the same directory.
12775 * @providesModule ReactNativeOperationHistoryDevtool
12782 var ReactNativeOperationHistoryDevtool = {
12783 onNativeOperation: function (debugID, type, payload) {
12785 instanceID: debugID,
12790 clearHistory: function () {
12791 if (ReactNativeOperationHistoryDevtool._preventClearing) {
12792 // Should only be used for tests.
12798 getHistory: function () {
12803 module.exports = ReactNativeOperationHistoryDevtool;
12804 },{}],85:[function(_dereq_,module,exports){
12806 * Copyright 2013-present, Facebook, Inc.
12807 * All rights reserved.
12809 * This source code is licensed under the BSD-style license found in the
12810 * LICENSE file in the root directory of this source tree. An additional grant
12811 * of patent rights can be found in the PATENTS file in the same directory.
12813 * @providesModule ReactNodeTypes
12818 var ReactElement = _dereq_(65);
12820 var invariant = _dereq_(173);
12822 var ReactNodeTypes = {
12827 getType: function (node) {
12828 if (node === null || node === false) {
12829 return ReactNodeTypes.EMPTY;
12830 } else if (ReactElement.isValidElement(node)) {
12831 if (typeof node.type === 'function') {
12832 return ReactNodeTypes.COMPOSITE;
12834 return ReactNodeTypes.NATIVE;
12837 !false ? "development" !== 'production' ? invariant(false, 'Unexpected node: %s', node) : invariant(false) : void 0;
12841 module.exports = ReactNodeTypes;
12842 },{"173":173,"65":65}],86:[function(_dereq_,module,exports){
12844 * Copyright 2015-present, Facebook, Inc.
12845 * All rights reserved.
12847 * This source code is licensed under the BSD-style license found in the
12848 * LICENSE file in the root directory of this source tree. An additional grant
12849 * of patent rights can be found in the PATENTS file in the same directory.
12851 * @providesModule ReactNoopUpdateQueue
12856 var warning = _dereq_(183);
12858 function warnTDZ(publicInstance, callerName) {
12859 if ("development" !== 'production') {
12860 "development" !== 'production' ? warning(false, '%s(...): Can only update a mounted or mounting component. ' + 'This usually means you called %s() on an unmounted component. ' + 'This is a no-op. Please check the code for the %s component.', callerName, callerName, publicInstance.constructor && publicInstance.constructor.displayName || '') : void 0;
12865 * This is the abstract API for an update queue.
12867 var ReactNoopUpdateQueue = {
12870 * Checks whether or not this composite component is mounted.
12871 * @param {ReactClass} publicInstance The instance we want to test.
12872 * @return {boolean} True if mounted, false otherwise.
12876 isMounted: function (publicInstance) {
12881 * Enqueue a callback that will be executed after all the pending updates
12884 * @param {ReactClass} publicInstance The instance to use as `this` context.
12885 * @param {?function} callback Called after state is updated.
12888 enqueueCallback: function (publicInstance, callback) {},
12891 * Forces an update. This should only be invoked when it is known with
12892 * certainty that we are **not** in a DOM transaction.
12894 * You may want to call this when you know that some deeper aspect of the
12895 * component's state has changed but `setState` was not called.
12897 * This will not invoke `shouldComponentUpdate`, but it will invoke
12898 * `componentWillUpdate` and `componentDidUpdate`.
12900 * @param {ReactClass} publicInstance The instance that should rerender.
12903 enqueueForceUpdate: function (publicInstance) {
12904 warnTDZ(publicInstance, 'forceUpdate');
12908 * Replaces all of the state. Always use this or `setState` to mutate state.
12909 * You should treat `this.state` as immutable.
12911 * There is no guarantee that `this.state` will be immediately updated, so
12912 * accessing `this.state` after calling this method may return the old value.
12914 * @param {ReactClass} publicInstance The instance that should rerender.
12915 * @param {object} completeState Next state.
12918 enqueueReplaceState: function (publicInstance, completeState) {
12919 warnTDZ(publicInstance, 'replaceState');
12923 * Sets a subset of the state. This only exists because _pendingState is
12924 * internal. This provides a merging strategy that is not available to deep
12925 * properties which is confusing. TODO: Expose pendingState or don't use it
12926 * during the merge.
12928 * @param {ReactClass} publicInstance The instance that should rerender.
12929 * @param {object} partialState Next partial state to be merged with state.
12932 enqueueSetState: function (publicInstance, partialState) {
12933 warnTDZ(publicInstance, 'setState');
12937 module.exports = ReactNoopUpdateQueue;
12938 },{"183":183}],87:[function(_dereq_,module,exports){
12940 * Copyright 2013-present, Facebook, Inc.
12941 * All rights reserved.
12943 * This source code is licensed under the BSD-style license found in the
12944 * LICENSE file in the root directory of this source tree. An additional grant
12945 * of patent rights can be found in the PATENTS file in the same directory.
12947 * @providesModule ReactOwner
12952 var invariant = _dereq_(173);
12955 * ReactOwners are capable of storing references to owned components.
12957 * All components are capable of //being// referenced by owner components, but
12958 * only ReactOwner components are capable of //referencing// owned components.
12959 * The named reference is known as a "ref".
12961 * Refs are available when mounted and updated during reconciliation.
12963 * var MyComponent = React.createClass({
12964 * render: function() {
12966 * <div onClick={this.handleClick}>
12967 * <CustomComponent ref="custom" />
12971 * handleClick: function() {
12972 * this.refs.custom.handleClick();
12974 * componentDidMount: function() {
12975 * this.refs.custom.initialize();
12979 * Refs should rarely be used. When refs are used, they should only be done to
12980 * control data that is not handled by React's data flow.
12982 * @class ReactOwner
12987 * @param {?object} object
12988 * @return {boolean} True if `object` is a valid owner.
12991 isValidOwner: function (object) {
12992 return !!(object && typeof object.attachRef === 'function' && typeof object.detachRef === 'function');
12996 * Adds a component by ref to an owner component.
12998 * @param {ReactComponent} component Component to reference.
12999 * @param {string} ref Name by which to refer to the component.
13000 * @param {ReactOwner} owner Component on which to record the ref.
13004 addComponentAsRefTo: function (component, ref, owner) {
13005 !ReactOwner.isValidOwner(owner) ? "development" !== 'production' ? invariant(false, 'addComponentAsRefTo(...): Only a ReactOwner can have refs. You might ' + 'be adding a ref to a component that was not created inside a component\'s ' + '`render` method, or you have multiple copies of React loaded ' + '(details: https://fb.me/react-refs-must-have-owner).') : invariant(false) : void 0;
13006 owner.attachRef(ref, component);
13010 * Removes a component by ref from an owner component.
13012 * @param {ReactComponent} component Component to dereference.
13013 * @param {string} ref Name of the ref to remove.
13014 * @param {ReactOwner} owner Component on which the ref is recorded.
13018 removeComponentAsRefFrom: function (component, ref, owner) {
13019 !ReactOwner.isValidOwner(owner) ? "development" !== 'production' ? invariant(false, 'removeComponentAsRefFrom(...): Only a ReactOwner can have refs. You might ' + 'be removing a ref to a component that was not created inside a component\'s ' + '`render` method, or you have multiple copies of React loaded ' + '(details: https://fb.me/react-refs-must-have-owner).') : invariant(false) : void 0;
13020 var ownerPublicInstance = owner.getPublicInstance();
13021 // Check that `component`'s owner is still alive and that `component` is still the current ref
13022 // because we do not want to detach the ref if another component stole it.
13023 if (ownerPublicInstance && ownerPublicInstance.refs[ref] === component.getPublicInstance()) {
13024 owner.detachRef(ref);
13030 module.exports = ReactOwner;
13031 },{"173":173}],88:[function(_dereq_,module,exports){
13033 * Copyright 2016-present, Facebook, Inc.
13034 * All rights reserved.
13036 * This source code is licensed under the BSD-style license found in the
13037 * LICENSE file in the root directory of this source tree. An additional grant
13038 * of patent rights can be found in the PATENTS file in the same directory.
13040 * @providesModule ReactPerf
13045 var _assign = _dereq_(184);
13047 var _extends = _assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
13049 var ReactDebugTool = _dereq_(62);
13050 var warning = _dereq_(183);
13052 function roundFloat(val) {
13053 var base = arguments.length <= 1 || arguments[1] === undefined ? 2 : arguments[1];
13055 var n = Math.pow(10, base);
13056 return Math.floor(val * n) / n;
13059 function getFlushHistory() {
13060 return ReactDebugTool.getFlushHistory();
13063 function getExclusive() {
13064 var flushHistory = arguments.length <= 0 || arguments[0] === undefined ? getFlushHistory() : arguments[0];
13066 var aggregatedStats = {};
13067 var affectedIDs = {};
13069 function updateAggregatedStats(treeSnapshot, instanceID, timerType, applyUpdate) {
13070 var displayName = treeSnapshot[instanceID].displayName;
13072 var key = displayName;
13073 var stats = aggregatedStats[key];
13075 affectedIDs[key] = {};
13076 stats = aggregatedStats[key] = {
13084 if (!stats.durations[timerType]) {
13085 stats.durations[timerType] = 0;
13087 if (!stats.counts[timerType]) {
13088 stats.counts[timerType] = 0;
13090 affectedIDs[key][instanceID] = true;
13091 applyUpdate(stats);
13094 flushHistory.forEach(function (flush) {
13095 var measurements = flush.measurements;
13096 var treeSnapshot = flush.treeSnapshot;
13098 measurements.forEach(function (measurement) {
13099 var duration = measurement.duration;
13100 var instanceID = measurement.instanceID;
13101 var timerType = measurement.timerType;
13103 updateAggregatedStats(treeSnapshot, instanceID, timerType, function (stats) {
13104 stats.totalDuration += duration;
13105 stats.durations[timerType] += duration;
13106 stats.counts[timerType]++;
13111 return Object.keys(aggregatedStats).map(function (key) {
13112 return _extends({}, aggregatedStats[key], {
13113 instanceCount: Object.keys(affectedIDs[key]).length
13115 }).sort(function (a, b) {
13116 return b.totalDuration - a.totalDuration;
13120 function getInclusive() {
13121 var flushHistory = arguments.length <= 0 || arguments[0] === undefined ? getFlushHistory() : arguments[0];
13123 var aggregatedStats = {};
13124 var affectedIDs = {};
13126 function updateAggregatedStats(treeSnapshot, instanceID, applyUpdate) {
13127 var _treeSnapshot$instanc = treeSnapshot[instanceID];
13128 var displayName = _treeSnapshot$instanc.displayName;
13129 var ownerID = _treeSnapshot$instanc.ownerID;
13131 var owner = treeSnapshot[ownerID];
13132 var key = (owner ? owner.displayName + ' > ' : '') + displayName;
13133 var stats = aggregatedStats[key];
13135 affectedIDs[key] = {};
13136 stats = aggregatedStats[key] = {
13139 inclusiveRenderDuration: 0,
13143 affectedIDs[key][instanceID] = true;
13144 applyUpdate(stats);
13147 var isCompositeByID = {};
13148 flushHistory.forEach(function (flush) {
13149 var measurements = flush.measurements;
13151 measurements.forEach(function (measurement) {
13152 var instanceID = measurement.instanceID;
13153 var timerType = measurement.timerType;
13155 if (timerType !== 'render') {
13158 isCompositeByID[instanceID] = true;
13162 flushHistory.forEach(function (flush) {
13163 var measurements = flush.measurements;
13164 var treeSnapshot = flush.treeSnapshot;
13166 measurements.forEach(function (measurement) {
13167 var duration = measurement.duration;
13168 var instanceID = measurement.instanceID;
13169 var timerType = measurement.timerType;
13171 if (timerType !== 'render') {
13174 updateAggregatedStats(treeSnapshot, instanceID, function (stats) {
13175 stats.renderCount++;
13177 var nextParentID = instanceID;
13178 while (nextParentID) {
13179 // As we traverse parents, only count inclusive time towards composites.
13180 // We know something is a composite if its render() was called.
13181 if (isCompositeByID[nextParentID]) {
13182 updateAggregatedStats(treeSnapshot, nextParentID, function (stats) {
13183 stats.inclusiveRenderDuration += duration;
13186 nextParentID = treeSnapshot[nextParentID].parentID;
13191 return Object.keys(aggregatedStats).map(function (key) {
13192 return _extends({}, aggregatedStats[key], {
13193 instanceCount: Object.keys(affectedIDs[key]).length
13195 }).sort(function (a, b) {
13196 return b.inclusiveRenderDuration - a.inclusiveRenderDuration;
13200 function getWasted() {
13201 var flushHistory = arguments.length <= 0 || arguments[0] === undefined ? getFlushHistory() : arguments[0];
13203 var aggregatedStats = {};
13204 var affectedIDs = {};
13206 function updateAggregatedStats(treeSnapshot, instanceID, applyUpdate) {
13207 var _treeSnapshot$instanc2 = treeSnapshot[instanceID];
13208 var displayName = _treeSnapshot$instanc2.displayName;
13209 var ownerID = _treeSnapshot$instanc2.ownerID;
13211 var owner = treeSnapshot[ownerID];
13212 var key = (owner ? owner.displayName + ' > ' : '') + displayName;
13213 var stats = aggregatedStats[key];
13215 affectedIDs[key] = {};
13216 stats = aggregatedStats[key] = {
13219 inclusiveRenderDuration: 0,
13223 affectedIDs[key][instanceID] = true;
13224 applyUpdate(stats);
13227 flushHistory.forEach(function (flush) {
13228 var measurements = flush.measurements;
13229 var treeSnapshot = flush.treeSnapshot;
13230 var operations = flush.operations;
13232 var isDefinitelyNotWastedByID = {};
13234 // Find native components associated with an operation in this batch.
13235 // Mark all components in their parent tree as definitely not wasted.
13236 operations.forEach(function (operation) {
13237 var instanceID = operation.instanceID;
13239 var nextParentID = instanceID;
13240 while (nextParentID) {
13241 isDefinitelyNotWastedByID[nextParentID] = true;
13242 nextParentID = treeSnapshot[nextParentID].parentID;
13246 // Find composite components that rendered in this batch.
13247 // These are potential candidates for being wasted renders.
13248 var renderedCompositeIDs = {};
13249 measurements.forEach(function (measurement) {
13250 var instanceID = measurement.instanceID;
13251 var timerType = measurement.timerType;
13253 if (timerType !== 'render') {
13256 renderedCompositeIDs[instanceID] = true;
13259 measurements.forEach(function (measurement) {
13260 var duration = measurement.duration;
13261 var instanceID = measurement.instanceID;
13262 var timerType = measurement.timerType;
13264 if (timerType !== 'render') {
13268 // If there was a DOM update below this component, or it has just been
13269 // mounted, its render() is not considered wasted.
13270 var updateCount = treeSnapshot[instanceID].updateCount;
13272 if (isDefinitelyNotWastedByID[instanceID] || updateCount === 0) {
13276 // We consider this render() wasted.
13277 updateAggregatedStats(treeSnapshot, instanceID, function (stats) {
13278 stats.renderCount++;
13281 var nextParentID = instanceID;
13282 while (nextParentID) {
13283 // Any parents rendered during this batch are considered wasted
13284 // unless we previously marked them as dirty.
13285 var isWasted = renderedCompositeIDs[nextParentID] && !isDefinitelyNotWastedByID[nextParentID];
13287 updateAggregatedStats(treeSnapshot, nextParentID, function (stats) {
13288 stats.inclusiveRenderDuration += duration;
13291 nextParentID = treeSnapshot[nextParentID].parentID;
13296 return Object.keys(aggregatedStats).map(function (key) {
13297 return _extends({}, aggregatedStats[key], {
13298 instanceCount: Object.keys(affectedIDs[key]).length
13300 }).sort(function (a, b) {
13301 return b.inclusiveRenderDuration - a.inclusiveRenderDuration;
13305 function getOperations() {
13306 var flushHistory = arguments.length <= 0 || arguments[0] === undefined ? getFlushHistory() : arguments[0];
13309 flushHistory.forEach(function (flush, flushIndex) {
13310 var operations = flush.operations;
13311 var treeSnapshot = flush.treeSnapshot;
13313 operations.forEach(function (operation) {
13314 var instanceID = operation.instanceID;
13315 var type = operation.type;
13316 var payload = operation.payload;
13317 var _treeSnapshot$instanc3 = treeSnapshot[instanceID];
13318 var displayName = _treeSnapshot$instanc3.displayName;
13319 var ownerID = _treeSnapshot$instanc3.ownerID;
13321 var owner = treeSnapshot[ownerID];
13322 var key = (owner ? owner.displayName + ' > ' : '') + displayName;
13325 flushIndex: flushIndex,
13326 instanceID: instanceID,
13337 function printExclusive(flushHistory) {
13338 var stats = getExclusive(flushHistory);
13339 var table = stats.map(function (item) {
13340 var key = item.key;
13341 var instanceCount = item.instanceCount;
13342 var totalDuration = item.totalDuration;
13344 var renderCount = item.counts.render || 0;
13345 var renderDuration = item.durations.render || 0;
13348 'Total time (ms)': roundFloat(totalDuration),
13349 'Instance count': instanceCount,
13350 'Total render time (ms)': roundFloat(renderDuration),
13351 'Average render time (ms)': renderCount ? roundFloat(renderDuration / renderCount) : undefined,
13352 'Render count': renderCount,
13353 'Total lifecycle time (ms)': roundFloat(totalDuration - renderDuration)
13356 console.table(table);
13359 function printInclusive(flushHistory) {
13360 var stats = getInclusive(flushHistory);
13361 var table = stats.map(function (item) {
13362 var key = item.key;
13363 var instanceCount = item.instanceCount;
13364 var inclusiveRenderDuration = item.inclusiveRenderDuration;
13365 var renderCount = item.renderCount;
13368 'Owner > Component': key,
13369 'Inclusive render time (ms)': roundFloat(inclusiveRenderDuration),
13370 'Instance count': instanceCount,
13371 'Render count': renderCount
13374 console.table(table);
13377 function printWasted(flushHistory) {
13378 var stats = getWasted(flushHistory);
13379 var table = stats.map(function (item) {
13380 var key = item.key;
13381 var instanceCount = item.instanceCount;
13382 var inclusiveRenderDuration = item.inclusiveRenderDuration;
13383 var renderCount = item.renderCount;
13386 'Owner > Component': key,
13387 'Inclusive wasted time (ms)': roundFloat(inclusiveRenderDuration),
13388 'Instance count': instanceCount,
13389 'Render count': renderCount
13392 console.table(table);
13395 function printOperations(flushHistory) {
13396 var stats = getOperations(flushHistory);
13397 var table = stats.map(function (stat) {
13399 'Owner > Node': stat.key,
13400 'Operation': stat.type,
13401 'Payload': typeof stat.payload === 'object' ? JSON.stringify(stat.payload) : stat.payload,
13402 'Flush index': stat.flushIndex,
13403 'Owner Component ID': stat.ownerID,
13404 'DOM Component ID': stat.instanceID
13407 console.table(table);
13410 var warnedAboutPrintDOM = false;
13411 function printDOM(measurements) {
13412 "development" !== 'production' ? warning(warnedAboutPrintDOM, '`ReactPerf.printDOM(...)` is deprecated. Use ' + '`ReactPerf.printOperations(...)` instead.') : void 0;
13413 warnedAboutPrintDOM = true;
13414 return printOperations(measurements);
13417 var warnedAboutGetMeasurementsSummaryMap = false;
13418 function getMeasurementsSummaryMap(measurements) {
13419 "development" !== 'production' ? warning(warnedAboutGetMeasurementsSummaryMap, '`ReactPerf.getMeasurementsSummaryMap(...)` is deprecated. Use ' + '`ReactPerf.getWasted(...)` instead.') : void 0;
13420 warnedAboutGetMeasurementsSummaryMap = true;
13421 return getWasted(measurements);
13425 ReactDebugTool.beginProfiling();
13429 ReactDebugTool.endProfiling();
13432 var ReactPerfAnalysis = {
13433 getLastMeasurements: getFlushHistory,
13434 getExclusive: getExclusive,
13435 getInclusive: getInclusive,
13436 getWasted: getWasted,
13437 getOperations: getOperations,
13438 printExclusive: printExclusive,
13439 printInclusive: printInclusive,
13440 printWasted: printWasted,
13441 printOperations: printOperations,
13445 printDOM: printDOM,
13446 getMeasurementsSummaryMap: getMeasurementsSummaryMap
13449 module.exports = ReactPerfAnalysis;
13450 },{"183":183,"184":184,"62":62}],89:[function(_dereq_,module,exports){
13452 * Copyright 2013-present, Facebook, Inc.
13453 * All rights reserved.
13455 * This source code is licensed under the BSD-style license found in the
13456 * LICENSE file in the root directory of this source tree. An additional grant
13457 * of patent rights can be found in the PATENTS file in the same directory.
13459 * @providesModule ReactPropTypeLocationNames
13464 var ReactPropTypeLocationNames = {};
13466 if ("development" !== 'production') {
13467 ReactPropTypeLocationNames = {
13469 context: 'context',
13470 childContext: 'child context'
13474 module.exports = ReactPropTypeLocationNames;
13475 },{}],90:[function(_dereq_,module,exports){
13477 * Copyright 2013-present, Facebook, Inc.
13478 * All rights reserved.
13480 * This source code is licensed under the BSD-style license found in the
13481 * LICENSE file in the root directory of this source tree. An additional grant
13482 * of patent rights can be found in the PATENTS file in the same directory.
13484 * @providesModule ReactPropTypeLocations
13489 var keyMirror = _dereq_(176);
13491 var ReactPropTypeLocations = keyMirror({
13497 module.exports = ReactPropTypeLocations;
13498 },{"176":176}],91:[function(_dereq_,module,exports){
13500 * Copyright 2013-present, Facebook, Inc.
13501 * All rights reserved.
13503 * This source code is licensed under the BSD-style license found in the
13504 * LICENSE file in the root directory of this source tree. An additional grant
13505 * of patent rights can be found in the PATENTS file in the same directory.
13507 * @providesModule ReactPropTypes
13512 var ReactElement = _dereq_(65);
13513 var ReactPropTypeLocationNames = _dereq_(89);
13515 var emptyFunction = _dereq_(165);
13516 var getIteratorFn = _dereq_(139);
13519 * Collection of methods that allow declaration and validation of props that are
13520 * supplied to React components. Example usage:
13522 * var Props = require('ReactPropTypes');
13523 * var MyArticle = React.createClass({
13525 * // An optional string prop named "description".
13526 * description: Props.string,
13528 * // A required enum prop named "category".
13529 * category: Props.oneOf(['News','Photos']).isRequired,
13531 * // A prop named "dialog" that requires an instance of Dialog.
13532 * dialog: Props.instanceOf(Dialog).isRequired
13534 * render: function() { ... }
13537 * A more formal specification of how these methods are used:
13539 * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)
13540 * decl := ReactPropTypes.{type}(.isRequired)?
13542 * Each and every declaration produces a function with the same signature. This
13543 * allows the creation of custom validation functions. For example:
13545 * var MyLink = React.createClass({
13547 * // An optional string or URI prop named "href".
13548 * href: function(props, propName, componentName) {
13549 * var propValue = props[propName];
13550 * if (propValue != null && typeof propValue !== 'string' &&
13551 * !(propValue instanceof URI)) {
13552 * return new Error(
13553 * 'Expected a string or an URI for ' + propName + ' in ' +
13559 * render: function() {...}
13565 var ANONYMOUS = '<<anonymous>>';
13567 var ReactPropTypes = {
13568 array: createPrimitiveTypeChecker('array'),
13569 bool: createPrimitiveTypeChecker('boolean'),
13570 func: createPrimitiveTypeChecker('function'),
13571 number: createPrimitiveTypeChecker('number'),
13572 object: createPrimitiveTypeChecker('object'),
13573 string: createPrimitiveTypeChecker('string'),
13575 any: createAnyTypeChecker(),
13576 arrayOf: createArrayOfTypeChecker,
13577 element: createElementTypeChecker(),
13578 instanceOf: createInstanceTypeChecker,
13579 node: createNodeChecker(),
13580 objectOf: createObjectOfTypeChecker,
13581 oneOf: createEnumTypeChecker,
13582 oneOfType: createUnionTypeChecker,
13583 shape: createShapeTypeChecker
13587 * inlined Object.is polyfill to avoid requiring consumers ship their own
13588 * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
13590 /*eslint-disable no-self-compare*/
13591 function is(x, y) {
13592 // SameValue algorithm
13595 // Steps 6.b-6.e: +0 != -0
13596 return x !== 0 || 1 / x === 1 / y;
13598 // Step 6.a: NaN == NaN
13599 return x !== x && y !== y;
13602 /*eslint-enable no-self-compare*/
13604 function createChainableTypeChecker(validate) {
13605 function checkType(isRequired, props, propName, componentName, location, propFullName) {
13606 componentName = componentName || ANONYMOUS;
13607 propFullName = propFullName || propName;
13608 if (props[propName] == null) {
13609 var locationName = ReactPropTypeLocationNames[location];
13611 return new Error('Required ' + locationName + ' `' + propFullName + '` was not specified in ' + ('`' + componentName + '`.'));
13615 return validate(props, propName, componentName, location, propFullName);
13619 var chainedCheckType = checkType.bind(null, false);
13620 chainedCheckType.isRequired = checkType.bind(null, true);
13622 return chainedCheckType;
13625 function createPrimitiveTypeChecker(expectedType) {
13626 function validate(props, propName, componentName, location, propFullName) {
13627 var propValue = props[propName];
13628 var propType = getPropType(propValue);
13629 if (propType !== expectedType) {
13630 var locationName = ReactPropTypeLocationNames[location];
13631 // `propValue` being instance of, say, date/regexp, pass the 'object'
13632 // check, but we can offer a more precise error message here rather than
13633 // 'of type `object`'.
13634 var preciseType = getPreciseType(propValue);
13636 return new Error('Invalid ' + locationName + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'));
13640 return createChainableTypeChecker(validate);
13643 function createAnyTypeChecker() {
13644 return createChainableTypeChecker(emptyFunction.thatReturns(null));
13647 function createArrayOfTypeChecker(typeChecker) {
13648 function validate(props, propName, componentName, location, propFullName) {
13649 if (typeof typeChecker !== 'function') {
13650 return new Error('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');
13652 var propValue = props[propName];
13653 if (!Array.isArray(propValue)) {
13654 var locationName = ReactPropTypeLocationNames[location];
13655 var propType = getPropType(propValue);
13656 return new Error('Invalid ' + locationName + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));
13658 for (var i = 0; i < propValue.length; i++) {
13659 var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']');
13660 if (error instanceof Error) {
13666 return createChainableTypeChecker(validate);
13669 function createElementTypeChecker() {
13670 function validate(props, propName, componentName, location, propFullName) {
13671 if (!ReactElement.isValidElement(props[propName])) {
13672 var locationName = ReactPropTypeLocationNames[location];
13673 return new Error('Invalid ' + locationName + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a single ReactElement.'));
13677 return createChainableTypeChecker(validate);
13680 function createInstanceTypeChecker(expectedClass) {
13681 function validate(props, propName, componentName, location, propFullName) {
13682 if (!(props[propName] instanceof expectedClass)) {
13683 var locationName = ReactPropTypeLocationNames[location];
13684 var expectedClassName = expectedClass.name || ANONYMOUS;
13685 var actualClassName = getClassName(props[propName]);
13686 return new Error('Invalid ' + locationName + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));
13690 return createChainableTypeChecker(validate);
13693 function createEnumTypeChecker(expectedValues) {
13694 if (!Array.isArray(expectedValues)) {
13695 return createChainableTypeChecker(function () {
13696 return new Error('Invalid argument supplied to oneOf, expected an instance of array.');
13700 function validate(props, propName, componentName, location, propFullName) {
13701 var propValue = props[propName];
13702 for (var i = 0; i < expectedValues.length; i++) {
13703 if (is(propValue, expectedValues[i])) {
13708 var locationName = ReactPropTypeLocationNames[location];
13709 var valuesString = JSON.stringify(expectedValues);
13710 return new Error('Invalid ' + locationName + ' `' + propFullName + '` of value `' + propValue + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));
13712 return createChainableTypeChecker(validate);
13715 function createObjectOfTypeChecker(typeChecker) {
13716 function validate(props, propName, componentName, location, propFullName) {
13717 if (typeof typeChecker !== 'function') {
13718 return new Error('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');
13720 var propValue = props[propName];
13721 var propType = getPropType(propValue);
13722 if (propType !== 'object') {
13723 var locationName = ReactPropTypeLocationNames[location];
13724 return new Error('Invalid ' + locationName + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
13726 for (var key in propValue) {
13727 if (propValue.hasOwnProperty(key)) {
13728 var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key);
13729 if (error instanceof Error) {
13736 return createChainableTypeChecker(validate);
13739 function createUnionTypeChecker(arrayOfTypeCheckers) {
13740 if (!Array.isArray(arrayOfTypeCheckers)) {
13741 return createChainableTypeChecker(function () {
13742 return new Error('Invalid argument supplied to oneOfType, expected an instance of array.');
13746 function validate(props, propName, componentName, location, propFullName) {
13747 for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
13748 var checker = arrayOfTypeCheckers[i];
13749 if (checker(props, propName, componentName, location, propFullName) == null) {
13754 var locationName = ReactPropTypeLocationNames[location];
13755 return new Error('Invalid ' + locationName + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.'));
13757 return createChainableTypeChecker(validate);
13760 function createNodeChecker() {
13761 function validate(props, propName, componentName, location, propFullName) {
13762 if (!isNode(props[propName])) {
13763 var locationName = ReactPropTypeLocationNames[location];
13764 return new Error('Invalid ' + locationName + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));
13768 return createChainableTypeChecker(validate);
13771 function createShapeTypeChecker(shapeTypes) {
13772 function validate(props, propName, componentName, location, propFullName) {
13773 var propValue = props[propName];
13774 var propType = getPropType(propValue);
13775 if (propType !== 'object') {
13776 var locationName = ReactPropTypeLocationNames[location];
13777 return new Error('Invalid ' + locationName + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
13779 for (var key in shapeTypes) {
13780 var checker = shapeTypes[key];
13784 var error = checker(propValue, key, componentName, location, propFullName + '.' + key);
13791 return createChainableTypeChecker(validate);
13794 function isNode(propValue) {
13795 switch (typeof propValue) {
13803 if (Array.isArray(propValue)) {
13804 return propValue.every(isNode);
13806 if (propValue === null || ReactElement.isValidElement(propValue)) {
13810 var iteratorFn = getIteratorFn(propValue);
13812 var iterator = iteratorFn.call(propValue);
13814 if (iteratorFn !== propValue.entries) {
13815 while (!(step = iterator.next()).done) {
13816 if (!isNode(step.value)) {
13821 // Iterator will provide entry [k,v] tuples rather than values.
13822 while (!(step = iterator.next()).done) {
13823 var entry = step.value;
13825 if (!isNode(entry[1])) {
13841 // Equivalent of `typeof` but with special handling for array and regexp.
13842 function getPropType(propValue) {
13843 var propType = typeof propValue;
13844 if (Array.isArray(propValue)) {
13847 if (propValue instanceof RegExp) {
13848 // Old webkits (at least until Android 4.0) return 'function' rather than
13849 // 'object' for typeof a RegExp. We'll normalize this here so that /bla/
13850 // passes PropTypes.object.
13856 // This handles more types than `getPropType`. Only used for error messages.
13857 // See `createPrimitiveTypeChecker`.
13858 function getPreciseType(propValue) {
13859 var propType = getPropType(propValue);
13860 if (propType === 'object') {
13861 if (propValue instanceof Date) {
13863 } else if (propValue instanceof RegExp) {
13870 // Returns class name of the object, if any.
13871 function getClassName(propValue) {
13872 if (!propValue.constructor || !propValue.constructor.name) {
13875 return propValue.constructor.name;
13878 module.exports = ReactPropTypes;
13879 },{"139":139,"165":165,"65":65,"89":89}],92:[function(_dereq_,module,exports){
13881 * Copyright 2013-present, Facebook, Inc.
13882 * All rights reserved.
13884 * This source code is licensed under the BSD-style license found in the
13885 * LICENSE file in the root directory of this source tree. An additional grant
13886 * of patent rights can be found in the PATENTS file in the same directory.
13888 * @providesModule ReactReconcileTransaction
13893 var _assign = _dereq_(184);
13895 var CallbackQueue = _dereq_(5);
13896 var PooledClass = _dereq_(26);
13897 var ReactBrowserEventEmitter = _dereq_(28);
13898 var ReactInputSelection = _dereq_(74);
13899 var Transaction = _dereq_(124);
13902 * Ensures that, when possible, the selection range (currently selected text
13903 * input) is not disturbed by performing the transaction.
13905 var SELECTION_RESTORATION = {
13907 * @return {Selection} Selection information.
13909 initialize: ReactInputSelection.getSelectionInformation,
13911 * @param {Selection} sel Selection information returned from `initialize`.
13913 close: ReactInputSelection.restoreSelection
13917 * Suppresses events (blur/focus) that could be inadvertently dispatched due to
13918 * high level DOM manipulations (like temporarily removing a text input from the
13921 var EVENT_SUPPRESSION = {
13923 * @return {boolean} The enabled status of `ReactBrowserEventEmitter` before
13924 * the reconciliation.
13926 initialize: function () {
13927 var currentlyEnabled = ReactBrowserEventEmitter.isEnabled();
13928 ReactBrowserEventEmitter.setEnabled(false);
13929 return currentlyEnabled;
13933 * @param {boolean} previouslyEnabled Enabled status of
13934 * `ReactBrowserEventEmitter` before the reconciliation occurred. `close`
13935 * restores the previous value.
13937 close: function (previouslyEnabled) {
13938 ReactBrowserEventEmitter.setEnabled(previouslyEnabled);
13943 * Provides a queue for collecting `componentDidMount` and
13944 * `componentDidUpdate` callbacks during the transaction.
13946 var ON_DOM_READY_QUEUEING = {
13948 * Initializes the internal `onDOMReady` queue.
13950 initialize: function () {
13951 this.reactMountReady.reset();
13955 * After DOM is flushed, invoke all registered `onDOMReady` callbacks.
13957 close: function () {
13958 this.reactMountReady.notifyAll();
13963 * Executed within the scope of the `Transaction` instance. Consider these as
13964 * being member methods, but with an implied ordering while being isolated from
13967 var TRANSACTION_WRAPPERS = [SELECTION_RESTORATION, EVENT_SUPPRESSION, ON_DOM_READY_QUEUEING];
13971 * - The order that these are listed in the transaction is critical:
13972 * - Suppresses events.
13973 * - Restores selection range.
13976 * - Restore document/overflow scroll positions that were unintentionally
13977 * modified via DOM insertions above the top viewport boundary.
13978 * - Implement/integrate with customized constraint based layout system and keep
13979 * track of which dimensions must be remeasured.
13981 * @class ReactReconcileTransaction
13983 function ReactReconcileTransaction(useCreateElement) {
13984 this.reinitializeTransaction();
13985 // Only server-side rendering really needs this option (see
13986 // `ReactServerRendering`), but server-side uses
13987 // `ReactServerRenderingTransaction` instead. This option is here so that it's
13988 // accessible and defaults to false when `ReactDOMComponent` and
13989 // `ReactTextComponent` checks it in `mountComponent`.`
13990 this.renderToStaticMarkup = false;
13991 this.reactMountReady = CallbackQueue.getPooled(null);
13992 this.useCreateElement = useCreateElement;
14000 * @return {array<object>} List of operation wrap procedures.
14001 * TODO: convert to array<TransactionWrapper>
14003 getTransactionWrappers: function () {
14004 return TRANSACTION_WRAPPERS;
14008 * @return {object} The queue to collect `onDOMReady` callbacks with.
14010 getReactMountReady: function () {
14011 return this.reactMountReady;
14015 * Save current transaction state -- if the return value from this method is
14016 * passed to `rollback`, the transaction will be reset to that state.
14018 checkpoint: function () {
14019 // reactMountReady is the our only stateful wrapper
14020 return this.reactMountReady.checkpoint();
14023 rollback: function (checkpoint) {
14024 this.reactMountReady.rollback(checkpoint);
14028 * `PooledClass` looks for this, and will invoke this before allowing this
14029 * instance to be reused.
14031 destructor: function () {
14032 CallbackQueue.release(this.reactMountReady);
14033 this.reactMountReady = null;
14037 _assign(ReactReconcileTransaction.prototype, Transaction.Mixin, Mixin);
14039 PooledClass.addPoolingTo(ReactReconcileTransaction);
14041 module.exports = ReactReconcileTransaction;
14042 },{"124":124,"184":184,"26":26,"28":28,"5":5,"74":74}],93:[function(_dereq_,module,exports){
14044 * Copyright 2013-present, Facebook, Inc.
14045 * All rights reserved.
14047 * This source code is licensed under the BSD-style license found in the
14048 * LICENSE file in the root directory of this source tree. An additional grant
14049 * of patent rights can be found in the PATENTS file in the same directory.
14051 * @providesModule ReactReconciler
14056 var ReactRef = _dereq_(94);
14057 var ReactInstrumentation = _dereq_(76);
14059 var invariant = _dereq_(173);
14062 * Helper to call ReactRef.attachRefs with this composite component, split out
14063 * to avoid allocations in the transaction mount-ready queue.
14065 function attachRefs() {
14066 ReactRef.attachRefs(this, this._currentElement);
14069 var ReactReconciler = {
14072 * Initializes the component, renders markup, and registers event listeners.
14074 * @param {ReactComponent} internalInstance
14075 * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
14076 * @param {?object} the containing native component instance
14077 * @param {?object} info about the native container
14078 * @return {?string} Rendered markup to be inserted into the DOM.
14082 mountComponent: function (internalInstance, transaction, nativeParent, nativeContainerInfo, context) {
14083 if ("development" !== 'production') {
14084 if (internalInstance._debugID !== 0) {
14085 ReactInstrumentation.debugTool.onBeginReconcilerTimer(internalInstance._debugID, 'mountComponent');
14088 var markup = internalInstance.mountComponent(transaction, nativeParent, nativeContainerInfo, context);
14089 if (internalInstance._currentElement && internalInstance._currentElement.ref != null) {
14090 transaction.getReactMountReady().enqueue(attachRefs, internalInstance);
14092 if ("development" !== 'production') {
14093 if (internalInstance._debugID !== 0) {
14094 ReactInstrumentation.debugTool.onEndReconcilerTimer(internalInstance._debugID, 'mountComponent');
14095 ReactInstrumentation.debugTool.onMountComponent(internalInstance._debugID);
14102 * Returns a value that can be passed to
14103 * ReactComponentEnvironment.replaceNodeWithMarkup.
14105 getNativeNode: function (internalInstance) {
14106 return internalInstance.getNativeNode();
14110 * Releases any resources allocated by `mountComponent`.
14115 unmountComponent: function (internalInstance, safely) {
14116 if ("development" !== 'production') {
14117 if (internalInstance._debugID !== 0) {
14118 ReactInstrumentation.debugTool.onBeginReconcilerTimer(internalInstance._debugID, 'unmountComponent');
14121 ReactRef.detachRefs(internalInstance, internalInstance._currentElement);
14122 internalInstance.unmountComponent(safely);
14123 if ("development" !== 'production') {
14124 if (internalInstance._debugID !== 0) {
14125 ReactInstrumentation.debugTool.onEndReconcilerTimer(internalInstance._debugID, 'unmountComponent');
14126 ReactInstrumentation.debugTool.onUnmountComponent(internalInstance._debugID);
14132 * Update a component using a new element.
14134 * @param {ReactComponent} internalInstance
14135 * @param {ReactElement} nextElement
14136 * @param {ReactReconcileTransaction} transaction
14137 * @param {object} context
14140 receiveComponent: function (internalInstance, nextElement, transaction, context) {
14141 var prevElement = internalInstance._currentElement;
14143 if (nextElement === prevElement && context === internalInstance._context) {
14144 // Since elements are immutable after the owner is rendered,
14145 // we can do a cheap identity compare here to determine if this is a
14146 // superfluous reconcile. It's possible for state to be mutable but such
14147 // change should trigger an update of the owner which would recreate
14148 // the element. We explicitly check for the existence of an owner since
14149 // it's possible for an element created outside a composite to be
14150 // deeply mutated and reused.
14152 // TODO: Bailing out early is just a perf optimization right?
14153 // TODO: Removing the return statement should affect correctness?
14157 if ("development" !== 'production') {
14158 if (internalInstance._debugID !== 0) {
14159 ReactInstrumentation.debugTool.onBeginReconcilerTimer(internalInstance._debugID, 'receiveComponent');
14163 var refsChanged = ReactRef.shouldUpdateRefs(prevElement, nextElement);
14166 ReactRef.detachRefs(internalInstance, prevElement);
14169 internalInstance.receiveComponent(nextElement, transaction, context);
14171 if (refsChanged && internalInstance._currentElement && internalInstance._currentElement.ref != null) {
14172 transaction.getReactMountReady().enqueue(attachRefs, internalInstance);
14175 if ("development" !== 'production') {
14176 if (internalInstance._debugID !== 0) {
14177 ReactInstrumentation.debugTool.onEndReconcilerTimer(internalInstance._debugID, 'receiveComponent');
14178 ReactInstrumentation.debugTool.onUpdateComponent(internalInstance._debugID);
14184 * Flush any dirty changes in a component.
14186 * @param {ReactComponent} internalInstance
14187 * @param {ReactReconcileTransaction} transaction
14190 performUpdateIfNecessary: function (internalInstance, transaction, updateBatchNumber) {
14191 if (internalInstance._updateBatchNumber !== updateBatchNumber) {
14192 // The component's enqueued batch number should always be the current
14193 // batch or the following one.
14194 !(internalInstance._updateBatchNumber == null || internalInstance._updateBatchNumber === updateBatchNumber + 1) ? "development" !== 'production' ? invariant(false, 'performUpdateIfNecessary: Unexpected batch number (current %s, ' + 'pending %s)', updateBatchNumber, internalInstance._updateBatchNumber) : invariant(false) : void 0;
14197 if ("development" !== 'production') {
14198 if (internalInstance._debugID !== 0) {
14199 ReactInstrumentation.debugTool.onBeginReconcilerTimer(internalInstance._debugID, 'performUpdateIfNecessary');
14202 internalInstance.performUpdateIfNecessary(transaction);
14203 if ("development" !== 'production') {
14204 if (internalInstance._debugID !== 0) {
14205 ReactInstrumentation.debugTool.onEndReconcilerTimer(internalInstance._debugID, 'performUpdateIfNecessary');
14206 ReactInstrumentation.debugTool.onUpdateComponent(internalInstance._debugID);
14213 module.exports = ReactReconciler;
14214 },{"173":173,"76":76,"94":94}],94:[function(_dereq_,module,exports){
14216 * Copyright 2013-present, Facebook, Inc.
14217 * All rights reserved.
14219 * This source code is licensed under the BSD-style license found in the
14220 * LICENSE file in the root directory of this source tree. An additional grant
14221 * of patent rights can be found in the PATENTS file in the same directory.
14223 * @providesModule ReactRef
14228 var ReactOwner = _dereq_(87);
14232 function attachRef(ref, component, owner) {
14233 if (typeof ref === 'function') {
14234 ref(component.getPublicInstance());
14237 ReactOwner.addComponentAsRefTo(component, ref, owner);
14241 function detachRef(ref, component, owner) {
14242 if (typeof ref === 'function') {
14246 ReactOwner.removeComponentAsRefFrom(component, ref, owner);
14250 ReactRef.attachRefs = function (instance, element) {
14251 if (element === null || element === false) {
14254 var ref = element.ref;
14256 attachRef(ref, instance, element._owner);
14260 ReactRef.shouldUpdateRefs = function (prevElement, nextElement) {
14261 // If either the owner or a `ref` has changed, make sure the newest owner
14262 // has stored a reference to `this`, and the previous owner (if different)
14263 // has forgotten the reference to `this`. We use the element instead
14264 // of the public this.props because the post processing cannot determine
14265 // a ref. The ref conceptually lives on the element.
14267 // TODO: Should this even be possible? The owner cannot change because
14268 // it's forbidden by shouldUpdateReactComponent. The ref can change
14269 // if you swap the keys of but not the refs. Reconsider where this check
14270 // is made. It probably belongs where the key checking and
14271 // instantiateReactComponent is done.
14273 var prevEmpty = prevElement === null || prevElement === false;
14274 var nextEmpty = nextElement === null || nextElement === false;
14277 // This has a few false positives w/r/t empty components.
14278 prevEmpty || nextEmpty || nextElement._owner !== prevElement._owner || nextElement.ref !== prevElement.ref
14282 ReactRef.detachRefs = function (instance, element) {
14283 if (element === null || element === false) {
14286 var ref = element.ref;
14288 detachRef(ref, instance, element._owner);
14292 module.exports = ReactRef;
14293 },{"87":87}],95:[function(_dereq_,module,exports){
14295 * Copyright 2014-present, Facebook, Inc.
14296 * All rights reserved.
14298 * This source code is licensed under the BSD-style license found in the
14299 * LICENSE file in the root directory of this source tree. An additional grant
14300 * of patent rights can be found in the PATENTS file in the same directory.
14302 * @providesModule ReactServerBatchingStrategy
14307 var ReactServerBatchingStrategy = {
14308 isBatchingUpdates: false,
14309 batchedUpdates: function (callback) {
14310 // Don't do anything here. During the server rendering we don't want to
14311 // schedule any updates. We will simply ignore them.
14315 module.exports = ReactServerBatchingStrategy;
14316 },{}],96:[function(_dereq_,module,exports){
14318 * Copyright 2013-present, Facebook, Inc.
14319 * All rights reserved.
14321 * This source code is licensed under the BSD-style license found in the
14322 * LICENSE file in the root directory of this source tree. An additional grant
14323 * of patent rights can be found in the PATENTS file in the same directory.
14325 * @providesModule ReactServerRendering
14329 var ReactDOMContainerInfo = _dereq_(46);
14330 var ReactDefaultBatchingStrategy = _dereq_(63);
14331 var ReactElement = _dereq_(65);
14332 var ReactInstrumentation = _dereq_(76);
14333 var ReactMarkupChecksum = _dereq_(79);
14334 var ReactReconciler = _dereq_(93);
14335 var ReactServerBatchingStrategy = _dereq_(95);
14336 var ReactServerRenderingTransaction = _dereq_(97);
14337 var ReactUpdates = _dereq_(104);
14339 var emptyObject = _dereq_(166);
14340 var instantiateReactComponent = _dereq_(144);
14341 var invariant = _dereq_(173);
14344 * @param {ReactElement} element
14345 * @return {string} the HTML markup
14347 function renderToStringImpl(element, makeStaticMarkup) {
14350 ReactUpdates.injection.injectBatchingStrategy(ReactServerBatchingStrategy);
14352 transaction = ReactServerRenderingTransaction.getPooled(makeStaticMarkup);
14354 return transaction.perform(function () {
14355 if ("development" !== 'production') {
14356 ReactInstrumentation.debugTool.onBeginFlush();
14358 var componentInstance = instantiateReactComponent(element);
14359 var markup = ReactReconciler.mountComponent(componentInstance, transaction, null, ReactDOMContainerInfo(), emptyObject);
14360 if ("development" !== 'production') {
14361 ReactInstrumentation.debugTool.onUnmountComponent(componentInstance._debugID);
14362 ReactInstrumentation.debugTool.onEndFlush();
14364 if (!makeStaticMarkup) {
14365 markup = ReactMarkupChecksum.addChecksumToMarkup(markup);
14370 ReactServerRenderingTransaction.release(transaction);
14371 // Revert to the DOM batching strategy since these two renderers
14372 // currently share these stateful modules.
14373 ReactUpdates.injection.injectBatchingStrategy(ReactDefaultBatchingStrategy);
14378 * Render a ReactElement to its initial HTML. This should only be used on the
14380 * See https://facebook.github.io/react/docs/top-level-api.html#reactdomserver.rendertostring
14382 function renderToString(element) {
14383 !ReactElement.isValidElement(element) ? "development" !== 'production' ? invariant(false, 'renderToString(): You must pass a valid ReactElement.') : invariant(false) : void 0;
14384 return renderToStringImpl(element, false);
14388 * Similar to renderToString, except this doesn't create extra DOM attributes
14389 * such as data-react-id that React uses internally.
14390 * See https://facebook.github.io/react/docs/top-level-api.html#reactdomserver.rendertostaticmarkup
14392 function renderToStaticMarkup(element) {
14393 !ReactElement.isValidElement(element) ? "development" !== 'production' ? invariant(false, 'renderToStaticMarkup(): You must pass a valid ReactElement.') : invariant(false) : void 0;
14394 return renderToStringImpl(element, true);
14398 renderToString: renderToString,
14399 renderToStaticMarkup: renderToStaticMarkup
14401 },{"104":104,"144":144,"166":166,"173":173,"46":46,"63":63,"65":65,"76":76,"79":79,"93":93,"95":95,"97":97}],97:[function(_dereq_,module,exports){
14403 * Copyright 2014-present, Facebook, Inc.
14404 * All rights reserved.
14406 * This source code is licensed under the BSD-style license found in the
14407 * LICENSE file in the root directory of this source tree. An additional grant
14408 * of patent rights can be found in the PATENTS file in the same directory.
14410 * @providesModule ReactServerRenderingTransaction
14415 var _assign = _dereq_(184);
14417 var PooledClass = _dereq_(26);
14418 var Transaction = _dereq_(124);
14421 * Executed within the scope of the `Transaction` instance. Consider these as
14422 * being member methods, but with an implied ordering while being isolated from
14425 var TRANSACTION_WRAPPERS = [];
14427 var noopCallbackQueue = {
14428 enqueue: function () {}
14432 * @class ReactServerRenderingTransaction
14433 * @param {boolean} renderToStaticMarkup
14435 function ReactServerRenderingTransaction(renderToStaticMarkup) {
14436 this.reinitializeTransaction();
14437 this.renderToStaticMarkup = renderToStaticMarkup;
14438 this.useCreateElement = false;
14446 * @return {array} Empty list of operation wrap procedures.
14448 getTransactionWrappers: function () {
14449 return TRANSACTION_WRAPPERS;
14453 * @return {object} The queue to collect `onDOMReady` callbacks with.
14455 getReactMountReady: function () {
14456 return noopCallbackQueue;
14460 * `PooledClass` looks for this, and will invoke this before allowing this
14461 * instance to be reused.
14463 destructor: function () {},
14465 checkpoint: function () {},
14467 rollback: function () {}
14470 _assign(ReactServerRenderingTransaction.prototype, Transaction.Mixin, Mixin);
14472 PooledClass.addPoolingTo(ReactServerRenderingTransaction);
14474 module.exports = ReactServerRenderingTransaction;
14475 },{"124":124,"184":184,"26":26}],98:[function(_dereq_,module,exports){
14477 * Copyright 2013-present, Facebook, Inc.
14478 * All rights reserved.
14480 * This source code is licensed under the BSD-style license found in the
14481 * LICENSE file in the root directory of this source tree. An additional grant
14482 * of patent rights can be found in the PATENTS file in the same directory.
14484 * @providesModule ReactStateSetters
14489 var ReactStateSetters = {
14491 * Returns a function that calls the provided function, and uses the result
14492 * of that to set the component's state.
14494 * @param {ReactCompositeComponent} component
14495 * @param {function} funcReturningState Returned callback uses this to
14496 * determine how to update state.
14497 * @return {function} callback that when invoked uses funcReturningState to
14498 * determined the object literal to setState.
14500 createStateSetter: function (component, funcReturningState) {
14501 return function (a, b, c, d, e, f) {
14502 var partialState = funcReturningState.call(component, a, b, c, d, e, f);
14503 if (partialState) {
14504 component.setState(partialState);
14510 * Returns a single-argument callback that can be used to update a single
14511 * key in the component's state.
14513 * Note: this is memoized function, which makes it inexpensive to call.
14515 * @param {ReactCompositeComponent} component
14516 * @param {string} key The key in the state that you should update.
14517 * @return {function} callback of 1 argument which calls setState() with
14518 * the provided keyName and callback argument.
14520 createStateKeySetter: function (component, key) {
14521 // Memoize the setters.
14522 var cache = component.__keySetters || (component.__keySetters = {});
14523 return cache[key] || (cache[key] = createStateKeySetter(component, key));
14527 function createStateKeySetter(component, key) {
14528 // Partial state is allocated outside of the function closure so it can be
14529 // reused with every call, avoiding memory allocation when this function
14531 var partialState = {};
14532 return function stateKeySetter(value) {
14533 partialState[key] = value;
14534 component.setState(partialState);
14538 ReactStateSetters.Mixin = {
14540 * Returns a function that calls the provided function, and uses the result
14541 * of that to set the component's state.
14543 * For example, these statements are equivalent:
14545 * this.setState({x: 1});
14546 * this.createStateSetter(function(xValue) {
14547 * return {x: xValue};
14550 * @param {function} funcReturningState Returned callback uses this to
14551 * determine how to update state.
14552 * @return {function} callback that when invoked uses funcReturningState to
14553 * determined the object literal to setState.
14555 createStateSetter: function (funcReturningState) {
14556 return ReactStateSetters.createStateSetter(this, funcReturningState);
14560 * Returns a single-argument callback that can be used to update a single
14561 * key in the component's state.
14563 * For example, these statements are equivalent:
14565 * this.setState({x: 1});
14566 * this.createStateKeySetter('x')(1);
14568 * Note: this is memoized function, which makes it inexpensive to call.
14570 * @param {string} key The key in the state that you should update.
14571 * @return {function} callback of 1 argument which calls setState() with
14572 * the provided keyName and callback argument.
14574 createStateKeySetter: function (key) {
14575 return ReactStateSetters.createStateKeySetter(this, key);
14579 module.exports = ReactStateSetters;
14580 },{}],99:[function(_dereq_,module,exports){
14582 * Copyright 2013-present, Facebook, Inc.
14583 * All rights reserved.
14585 * This source code is licensed under the BSD-style license found in the
14586 * LICENSE file in the root directory of this source tree. An additional grant
14587 * of patent rights can be found in the PATENTS file in the same directory.
14589 * @providesModule ReactTestUtils
14594 var _assign = _dereq_(184);
14596 var EventConstants = _dereq_(16);
14597 var EventPluginHub = _dereq_(17);
14598 var EventPluginRegistry = _dereq_(18);
14599 var EventPropagators = _dereq_(20);
14600 var React = _dereq_(27);
14601 var ReactDefaultInjection = _dereq_(64);
14602 var ReactDOM = _dereq_(41);
14603 var ReactDOMComponentTree = _dereq_(45);
14604 var ReactElement = _dereq_(65);
14605 var ReactBrowserEventEmitter = _dereq_(28);
14606 var ReactCompositeComponent = _dereq_(39);
14607 var ReactInstanceMap = _dereq_(75);
14608 var ReactUpdates = _dereq_(104);
14609 var SyntheticEvent = _dereq_(115);
14611 var emptyObject = _dereq_(166);
14612 var findDOMNode = _dereq_(132);
14613 var invariant = _dereq_(173);
14615 var topLevelTypes = EventConstants.topLevelTypes;
14617 function Event(suffix) {}
14620 * @class ReactTestUtils
14623 function findAllInRenderedTreeInternal(inst, test) {
14624 if (!inst || !inst.getPublicInstance) {
14627 var publicInst = inst.getPublicInstance();
14628 var ret = test(publicInst) ? [publicInst] : [];
14629 var currentElement = inst._currentElement;
14630 if (ReactTestUtils.isDOMComponent(publicInst)) {
14631 var renderedChildren = inst._renderedChildren;
14633 for (key in renderedChildren) {
14634 if (!renderedChildren.hasOwnProperty(key)) {
14637 ret = ret.concat(findAllInRenderedTreeInternal(renderedChildren[key], test));
14639 } else if (ReactElement.isValidElement(currentElement) && typeof currentElement.type === 'function') {
14640 ret = ret.concat(findAllInRenderedTreeInternal(inst._renderedComponent, test));
14646 * Utilities for making it easy to test React components.
14648 * See https://facebook.github.io/react/docs/test-utils.html
14650 * Todo: Support the entire DOM.scry query syntax. For now, these simple
14651 * utilities will suffice for testing purposes.
14652 * @lends ReactTestUtils
14654 var ReactTestUtils = {
14655 renderIntoDocument: function (instance) {
14656 var div = document.createElement('div');
14657 // None of our tests actually require attaching the container to the
14658 // DOM, and doing so creates a mess that we rely on test isolation to
14659 // clean up, so we're going to stop honoring the name of this method
14660 // (and probably rename it eventually) if no problems arise.
14661 // document.documentElement.appendChild(div);
14662 return ReactDOM.render(instance, div);
14665 isElement: function (element) {
14666 return ReactElement.isValidElement(element);
14669 isElementOfType: function (inst, convenienceConstructor) {
14670 return ReactElement.isValidElement(inst) && inst.type === convenienceConstructor;
14673 isDOMComponent: function (inst) {
14674 return !!(inst && inst.nodeType === 1 && inst.tagName);
14677 isDOMComponentElement: function (inst) {
14678 return !!(inst && ReactElement.isValidElement(inst) && !!inst.tagName);
14681 isCompositeComponent: function (inst) {
14682 if (ReactTestUtils.isDOMComponent(inst)) {
14683 // Accessing inst.setState warns; just return false as that'll be what
14684 // this returns when we have DOM nodes as refs directly
14687 return inst != null && typeof inst.render === 'function' && typeof inst.setState === 'function';
14690 isCompositeComponentWithType: function (inst, type) {
14691 if (!ReactTestUtils.isCompositeComponent(inst)) {
14694 var internalInstance = ReactInstanceMap.get(inst);
14695 var constructor = internalInstance._currentElement.type;
14697 return constructor === type;
14700 isCompositeComponentElement: function (inst) {
14701 if (!ReactElement.isValidElement(inst)) {
14704 // We check the prototype of the type that will get mounted, not the
14705 // instance itself. This is a future proof way of duck typing.
14706 var prototype = inst.type.prototype;
14707 return typeof prototype.render === 'function' && typeof prototype.setState === 'function';
14710 isCompositeComponentElementWithType: function (inst, type) {
14711 var internalInstance = ReactInstanceMap.get(inst);
14712 var constructor = internalInstance._currentElement.type;
14714 return !!(ReactTestUtils.isCompositeComponentElement(inst) && constructor === type);
14717 getRenderedChildOfCompositeComponent: function (inst) {
14718 if (!ReactTestUtils.isCompositeComponent(inst)) {
14721 var internalInstance = ReactInstanceMap.get(inst);
14722 return internalInstance._renderedComponent.getPublicInstance();
14725 findAllInRenderedTree: function (inst, test) {
14729 !ReactTestUtils.isCompositeComponent(inst) ? "development" !== 'production' ? invariant(false, 'findAllInRenderedTree(...): instance must be a composite component') : invariant(false) : void 0;
14730 return findAllInRenderedTreeInternal(ReactInstanceMap.get(inst), test);
14734 * Finds all instance of components in the rendered tree that are DOM
14735 * components with the class name matching `className`.
14736 * @return {array} an array of all the matches.
14738 scryRenderedDOMComponentsWithClass: function (root, classNames) {
14739 return ReactTestUtils.findAllInRenderedTree(root, function (inst) {
14740 if (ReactTestUtils.isDOMComponent(inst)) {
14741 var className = inst.className;
14742 if (typeof className !== 'string') {
14744 className = inst.getAttribute('class') || '';
14746 var classList = className.split(/\s+/);
14748 if (!Array.isArray(classNames)) {
14749 !(classNames !== undefined) ? "development" !== 'production' ? invariant(false, 'TestUtils.scryRenderedDOMComponentsWithClass expects a ' + 'className as a second argument.') : invariant(false) : void 0;
14750 classNames = classNames.split(/\s+/);
14752 return classNames.every(function (name) {
14753 return classList.indexOf(name) !== -1;
14761 * Like scryRenderedDOMComponentsWithClass but expects there to be one result,
14762 * and returns that one result, or throws exception if there is any other
14763 * number of matches besides one.
14764 * @return {!ReactDOMComponent} The one match.
14766 findRenderedDOMComponentWithClass: function (root, className) {
14767 var all = ReactTestUtils.scryRenderedDOMComponentsWithClass(root, className);
14768 if (all.length !== 1) {
14769 throw new Error('Did not find exactly one match (found: ' + all.length + ') ' + 'for class:' + className);
14775 * Finds all instance of components in the rendered tree that are DOM
14776 * components with the tag name matching `tagName`.
14777 * @return {array} an array of all the matches.
14779 scryRenderedDOMComponentsWithTag: function (root, tagName) {
14780 return ReactTestUtils.findAllInRenderedTree(root, function (inst) {
14781 return ReactTestUtils.isDOMComponent(inst) && inst.tagName.toUpperCase() === tagName.toUpperCase();
14786 * Like scryRenderedDOMComponentsWithTag but expects there to be one result,
14787 * and returns that one result, or throws exception if there is any other
14788 * number of matches besides one.
14789 * @return {!ReactDOMComponent} The one match.
14791 findRenderedDOMComponentWithTag: function (root, tagName) {
14792 var all = ReactTestUtils.scryRenderedDOMComponentsWithTag(root, tagName);
14793 if (all.length !== 1) {
14794 throw new Error('Did not find exactly one match (found: ' + all.length + ') ' + 'for tag:' + tagName);
14800 * Finds all instances of components with type equal to `componentType`.
14801 * @return {array} an array of all the matches.
14803 scryRenderedComponentsWithType: function (root, componentType) {
14804 return ReactTestUtils.findAllInRenderedTree(root, function (inst) {
14805 return ReactTestUtils.isCompositeComponentWithType(inst, componentType);
14810 * Same as `scryRenderedComponentsWithType` but expects there to be one result
14811 * and returns that one result, or throws exception if there is any other
14812 * number of matches besides one.
14813 * @return {!ReactComponent} The one match.
14815 findRenderedComponentWithType: function (root, componentType) {
14816 var all = ReactTestUtils.scryRenderedComponentsWithType(root, componentType);
14817 if (all.length !== 1) {
14818 throw new Error('Did not find exactly one match (found: ' + all.length + ') ' + 'for componentType:' + componentType);
14824 * Pass a mocked component module to this method to augment it with
14825 * useful methods that allow it to be used as a dummy React component.
14826 * Instead of rendering as usual, the component will become a simple
14827 * <div> containing any provided children.
14829 * @param {object} module the mock function object exported from a
14830 * module that defines the component to be mocked
14831 * @param {?string} mockTagName optional dummy root tag name to return
14832 * from render method (overrides
14833 * module.mockTagName if provided)
14834 * @return {object} the ReactTestUtils object (for chaining)
14836 mockComponent: function (module, mockTagName) {
14837 mockTagName = mockTagName || module.mockTagName || 'div';
14839 module.prototype.render.mockImplementation(function () {
14840 return React.createElement(mockTagName, null, this.props.children);
14847 * Simulates a top level event being dispatched from a raw event that occurred
14848 * on an `Element` node.
14849 * @param {Object} topLevelType A type from `EventConstants.topLevelTypes`
14850 * @param {!Element} node The dom to simulate an event occurring on.
14851 * @param {?Event} fakeNativeEvent Fake native event to use in SyntheticEvent.
14853 simulateNativeEventOnNode: function (topLevelType, node, fakeNativeEvent) {
14854 fakeNativeEvent.target = node;
14855 ReactBrowserEventEmitter.ReactEventListener.dispatchEvent(topLevelType, fakeNativeEvent);
14859 * Simulates a top level event being dispatched from a raw event that occurred
14860 * on the `ReactDOMComponent` `comp`.
14861 * @param {Object} topLevelType A type from `EventConstants.topLevelTypes`.
14862 * @param {!ReactDOMComponent} comp
14863 * @param {?Event} fakeNativeEvent Fake native event to use in SyntheticEvent.
14865 simulateNativeEventOnDOMComponent: function (topLevelType, comp, fakeNativeEvent) {
14866 ReactTestUtils.simulateNativeEventOnNode(topLevelType, findDOMNode(comp), fakeNativeEvent);
14869 nativeTouchData: function (x, y) {
14871 touches: [{ pageX: x, pageY: y }]
14875 createRenderer: function () {
14876 return new ReactShallowRenderer();
14884 * @class ReactShallowRenderer
14886 var ReactShallowRenderer = function () {
14887 this._instance = null;
14890 ReactShallowRenderer.prototype.getMountedInstance = function () {
14891 return this._instance ? this._instance._instance : null;
14894 var nextDebugID = 1;
14896 var NoopInternalComponent = function (element) {
14897 this._renderedOutput = element;
14898 this._currentElement = element;
14899 this._debugID = nextDebugID++;
14902 NoopInternalComponent.prototype = {
14904 mountComponent: function () {},
14906 receiveComponent: function (element) {
14907 this._renderedOutput = element;
14908 this._currentElement = element;
14911 getNativeNode: function () {
14915 unmountComponent: function () {},
14917 getPublicInstance: function () {
14922 var ShallowComponentWrapper = function (element) {
14923 this._debugID = nextDebugID++;
14924 this.construct(element);
14926 _assign(ShallowComponentWrapper.prototype, ReactCompositeComponent.Mixin, {
14927 _constructComponent: ReactCompositeComponent.Mixin._constructComponentWithoutOwner,
14928 _instantiateReactComponent: function (element) {
14929 return new NoopInternalComponent(element);
14931 _replaceNodeWithMarkup: function () {},
14932 _renderValidatedComponent: ReactCompositeComponent.Mixin._renderValidatedComponentWithoutOwnerOrContext
14935 ReactShallowRenderer.prototype.render = function (element, context) {
14936 // Ensure we've done the default injections. This might not be true in the
14937 // case of a simple test that only requires React and the TestUtils in
14938 // conjunction with an inline-requires transform.
14939 ReactDefaultInjection.inject();
14941 !ReactElement.isValidElement(element) ? "development" !== 'production' ? invariant(false, 'ReactShallowRenderer render(): Invalid component element.%s', typeof element === 'function' ? ' Instead of passing a component class, make sure to instantiate ' + 'it by passing it to React.createElement.' : '') : invariant(false) : void 0;
14942 !(typeof element.type !== 'string') ? "development" !== 'production' ? invariant(false, 'ReactShallowRenderer render(): Shallow rendering works only with custom ' + 'components, not primitives (%s). Instead of calling `.render(el)` and ' + 'inspecting the rendered output, look at `el.props` directly instead.', element.type) : invariant(false) : void 0;
14945 context = emptyObject;
14947 ReactUpdates.batchedUpdates(_batchedRender, this, element, context);
14949 return this.getRenderOutput();
14952 function _batchedRender(renderer, element, context) {
14953 var transaction = ReactUpdates.ReactReconcileTransaction.getPooled(true);
14954 renderer._render(element, transaction, context);
14955 ReactUpdates.ReactReconcileTransaction.release(transaction);
14958 ReactShallowRenderer.prototype.getRenderOutput = function () {
14959 return this._instance && this._instance._renderedComponent && this._instance._renderedComponent._renderedOutput || null;
14962 ReactShallowRenderer.prototype.unmount = function () {
14963 if (this._instance) {
14964 this._instance.unmountComponent(false);
14968 ReactShallowRenderer.prototype._render = function (element, transaction, context) {
14969 if (this._instance) {
14970 this._instance.receiveComponent(element, transaction, context);
14972 var instance = new ShallowComponentWrapper(element);
14973 instance.mountComponent(transaction, null, null, context);
14974 this._instance = instance;
14981 * - `ReactTestUtils.Simulate.click(Element/ReactDOMComponent)`
14982 * - `ReactTestUtils.Simulate.mouseMove(Element/ReactDOMComponent)`
14983 * - `ReactTestUtils.Simulate.change(Element/ReactDOMComponent)`
14984 * - ... (All keys from event plugin `eventTypes` objects)
14986 function makeSimulator(eventType) {
14987 return function (domComponentOrNode, eventData) {
14989 !!React.isValidElement(domComponentOrNode) ? "development" !== 'production' ? invariant(false, 'TestUtils.Simulate expects a component instance and not a ReactElement.' + 'TestUtils.Simulate will not work if you are using shallow rendering.') : invariant(false) : void 0;
14990 if (ReactTestUtils.isDOMComponent(domComponentOrNode)) {
14991 node = findDOMNode(domComponentOrNode);
14992 } else if (domComponentOrNode.tagName) {
14993 node = domComponentOrNode;
14996 var dispatchConfig = EventPluginRegistry.eventNameDispatchConfigs[eventType];
14998 var fakeNativeEvent = new Event();
14999 fakeNativeEvent.target = node;
15000 // We don't use SyntheticEvent.getPooled in order to not have to worry about
15001 // properly destroying any properties assigned from `eventData` upon release
15002 var event = new SyntheticEvent(dispatchConfig, ReactDOMComponentTree.getInstanceFromNode(node), fakeNativeEvent, node);
15003 // Since we aren't using pooling, always persist the event. This will make
15004 // sure it's marked and won't warn when setting additional properties.
15006 _assign(event, eventData);
15008 if (dispatchConfig.phasedRegistrationNames) {
15009 EventPropagators.accumulateTwoPhaseDispatches(event);
15011 EventPropagators.accumulateDirectDispatches(event);
15014 ReactUpdates.batchedUpdates(function () {
15015 EventPluginHub.enqueueEvents(event);
15016 EventPluginHub.processEventQueue(true);
15021 function buildSimulators() {
15022 ReactTestUtils.Simulate = {};
15025 for (eventType in EventPluginRegistry.eventNameDispatchConfigs) {
15027 * @param {!Element|ReactDOMComponent} domComponentOrNode
15028 * @param {?object} eventData Fake event data to use in SyntheticEvent.
15030 ReactTestUtils.Simulate[eventType] = makeSimulator(eventType);
15034 // Rebuild ReactTestUtils.Simulate whenever event plugins are injected
15035 var oldInjectEventPluginOrder = EventPluginHub.injection.injectEventPluginOrder;
15036 EventPluginHub.injection.injectEventPluginOrder = function () {
15037 oldInjectEventPluginOrder.apply(this, arguments);
15040 var oldInjectEventPlugins = EventPluginHub.injection.injectEventPluginsByName;
15041 EventPluginHub.injection.injectEventPluginsByName = function () {
15042 oldInjectEventPlugins.apply(this, arguments);
15051 * - `ReactTestUtils.SimulateNative.click(Element/ReactDOMComponent)`
15052 * - `ReactTestUtils.SimulateNative.mouseMove(Element/ReactDOMComponent)`
15053 * - `ReactTestUtils.SimulateNative.mouseIn/ReactDOMComponent)`
15054 * - `ReactTestUtils.SimulateNative.mouseOut(Element/ReactDOMComponent)`
15055 * - ... (All keys from `EventConstants.topLevelTypes`)
15057 * Note: Top level event types are a subset of the entire set of handler types
15058 * (which include a broader set of "synthetic" events). For example, onDragDone
15059 * is a synthetic event. Except when testing an event plugin or React's event
15060 * handling code specifically, you probably want to use ReactTestUtils.Simulate
15061 * to dispatch synthetic events.
15064 function makeNativeSimulator(eventType) {
15065 return function (domComponentOrNode, nativeEventData) {
15066 var fakeNativeEvent = new Event(eventType);
15067 _assign(fakeNativeEvent, nativeEventData);
15068 if (ReactTestUtils.isDOMComponent(domComponentOrNode)) {
15069 ReactTestUtils.simulateNativeEventOnDOMComponent(eventType, domComponentOrNode, fakeNativeEvent);
15070 } else if (domComponentOrNode.tagName) {
15071 // Will allow on actual dom nodes.
15072 ReactTestUtils.simulateNativeEventOnNode(eventType, domComponentOrNode, fakeNativeEvent);
15077 Object.keys(topLevelTypes).forEach(function (eventType) {
15078 // Event type is stored as 'topClick' - we transform that to 'click'
15079 var convenienceName = eventType.indexOf('top') === 0 ? eventType.charAt(3).toLowerCase() + eventType.substr(4) : eventType;
15081 * @param {!Element|ReactDOMComponent} domComponentOrNode
15082 * @param {?Event} nativeEventData Fake native event to use in SyntheticEvent.
15084 ReactTestUtils.SimulateNative[convenienceName] = makeNativeSimulator(eventType);
15087 module.exports = ReactTestUtils;
15088 },{"104":104,"115":115,"132":132,"16":16,"166":166,"17":17,"173":173,"18":18,"184":184,"20":20,"27":27,"28":28,"39":39,"41":41,"45":45,"64":64,"65":65,"75":75}],100:[function(_dereq_,module,exports){
15090 * Copyright 2013-present, Facebook, Inc.
15091 * All rights reserved.
15093 * This source code is licensed under the BSD-style license found in the
15094 * LICENSE file in the root directory of this source tree. An additional grant
15095 * of patent rights can be found in the PATENTS file in the same directory.
15097 * @providesModule ReactTransitionChildMapping
15102 var flattenChildren = _dereq_(133);
15104 var ReactTransitionChildMapping = {
15106 * Given `this.props.children`, return an object mapping key to child. Just
15107 * simple syntactic sugar around flattenChildren().
15109 * @param {*} children `this.props.children`
15110 * @return {object} Mapping of key to child
15112 getChildMapping: function (children) {
15116 return flattenChildren(children);
15120 * When you're adding or removing children some may be added or removed in the
15121 * same render pass. We want to show *both* since we want to simultaneously
15122 * animate elements in and out. This function takes a previous set of keys
15123 * and a new set of keys and merges them with its best guess of the correct
15124 * ordering. In the future we may expose some of the utilities in
15125 * ReactMultiChild to make this easy, but for now React itself does not
15126 * directly have this concept of the union of prevChildren and nextChildren
15127 * so we implement it here.
15129 * @param {object} prev prev children as returned from
15130 * `ReactTransitionChildMapping.getChildMapping()`.
15131 * @param {object} next next children as returned from
15132 * `ReactTransitionChildMapping.getChildMapping()`.
15133 * @return {object} a key set that contains all keys in `prev` and all keys
15134 * in `next` in a reasonable order.
15136 mergeChildMappings: function (prev, next) {
15140 function getValueForKey(key) {
15141 if (next.hasOwnProperty(key)) {
15148 // For each key of `next`, the list of keys to insert before that key in
15149 // the combined list
15150 var nextKeysPending = {};
15152 var pendingKeys = [];
15153 for (var prevKey in prev) {
15154 if (next.hasOwnProperty(prevKey)) {
15155 if (pendingKeys.length) {
15156 nextKeysPending[prevKey] = pendingKeys;
15160 pendingKeys.push(prevKey);
15165 var childMapping = {};
15166 for (var nextKey in next) {
15167 if (nextKeysPending.hasOwnProperty(nextKey)) {
15168 for (i = 0; i < nextKeysPending[nextKey].length; i++) {
15169 var pendingNextKey = nextKeysPending[nextKey][i];
15170 childMapping[nextKeysPending[nextKey][i]] = getValueForKey(pendingNextKey);
15173 childMapping[nextKey] = getValueForKey(nextKey);
15176 // Finally, add the keys which didn't appear before any key in `next`
15177 for (i = 0; i < pendingKeys.length; i++) {
15178 childMapping[pendingKeys[i]] = getValueForKey(pendingKeys[i]);
15181 return childMapping;
15185 module.exports = ReactTransitionChildMapping;
15186 },{"133":133}],101:[function(_dereq_,module,exports){
15188 * Copyright 2013-present, Facebook, Inc.
15189 * All rights reserved.
15191 * This source code is licensed under the BSD-style license found in the
15192 * LICENSE file in the root directory of this source tree. An additional grant
15193 * of patent rights can be found in the PATENTS file in the same directory.
15195 * @providesModule ReactTransitionEvents
15200 var ExecutionEnvironment = _dereq_(159);
15202 var getVendorPrefixedEventName = _dereq_(143);
15204 var endEvents = [];
15206 function detectEvents() {
15207 var animEnd = getVendorPrefixedEventName('animationend');
15208 var transEnd = getVendorPrefixedEventName('transitionend');
15211 endEvents.push(animEnd);
15215 endEvents.push(transEnd);
15219 if (ExecutionEnvironment.canUseDOM) {
15223 // We use the raw {add|remove}EventListener() call because EventListener
15224 // does not know how to remove event listeners and we really should
15225 // clean up. Also, these events are not triggered in older browsers
15226 // so we should be A-OK here.
15228 function addEventListener(node, eventName, eventListener) {
15229 node.addEventListener(eventName, eventListener, false);
15232 function removeEventListener(node, eventName, eventListener) {
15233 node.removeEventListener(eventName, eventListener, false);
15236 var ReactTransitionEvents = {
15237 addEndEventListener: function (node, eventListener) {
15238 if (endEvents.length === 0) {
15239 // If CSS transitions are not supported, trigger an "end animation"
15240 // event immediately.
15241 window.setTimeout(eventListener, 0);
15244 endEvents.forEach(function (endEvent) {
15245 addEventListener(node, endEvent, eventListener);
15249 removeEndEventListener: function (node, eventListener) {
15250 if (endEvents.length === 0) {
15253 endEvents.forEach(function (endEvent) {
15254 removeEventListener(node, endEvent, eventListener);
15259 module.exports = ReactTransitionEvents;
15260 },{"143":143,"159":159}],102:[function(_dereq_,module,exports){
15262 * Copyright 2013-present, Facebook, Inc.
15263 * All rights reserved.
15265 * This source code is licensed under the BSD-style license found in the
15266 * LICENSE file in the root directory of this source tree. An additional grant
15267 * of patent rights can be found in the PATENTS file in the same directory.
15269 * @providesModule ReactTransitionGroup
15274 var _assign = _dereq_(184);
15276 var React = _dereq_(27);
15277 var ReactTransitionChildMapping = _dereq_(100);
15279 var emptyFunction = _dereq_(165);
15282 * A basis for animatins. When children are declaratively added or removed,
15283 * special lifecycle hooks are called.
15284 * See https://facebook.github.io/react/docs/animation.html#low-level-api-reacttransitiongroup
15286 var ReactTransitionGroup = React.createClass({
15287 displayName: 'ReactTransitionGroup',
15290 component: React.PropTypes.any,
15291 childFactory: React.PropTypes.func
15294 getDefaultProps: function () {
15297 childFactory: emptyFunction.thatReturnsArgument
15301 getInitialState: function () {
15303 children: ReactTransitionChildMapping.getChildMapping(this.props.children)
15307 componentWillMount: function () {
15308 this.currentlyTransitioningKeys = {};
15309 this.keysToEnter = [];
15310 this.keysToLeave = [];
15313 componentDidMount: function () {
15314 var initialChildMapping = this.state.children;
15315 for (var key in initialChildMapping) {
15316 if (initialChildMapping[key]) {
15317 this.performAppear(key);
15322 componentWillReceiveProps: function (nextProps) {
15323 var nextChildMapping = ReactTransitionChildMapping.getChildMapping(nextProps.children);
15324 var prevChildMapping = this.state.children;
15327 children: ReactTransitionChildMapping.mergeChildMappings(prevChildMapping, nextChildMapping)
15332 for (key in nextChildMapping) {
15333 var hasPrev = prevChildMapping && prevChildMapping.hasOwnProperty(key);
15334 if (nextChildMapping[key] && !hasPrev && !this.currentlyTransitioningKeys[key]) {
15335 this.keysToEnter.push(key);
15339 for (key in prevChildMapping) {
15340 var hasNext = nextChildMapping && nextChildMapping.hasOwnProperty(key);
15341 if (prevChildMapping[key] && !hasNext && !this.currentlyTransitioningKeys[key]) {
15342 this.keysToLeave.push(key);
15346 // If we want to someday check for reordering, we could do it here.
15349 componentDidUpdate: function () {
15350 var keysToEnter = this.keysToEnter;
15351 this.keysToEnter = [];
15352 keysToEnter.forEach(this.performEnter);
15354 var keysToLeave = this.keysToLeave;
15355 this.keysToLeave = [];
15356 keysToLeave.forEach(this.performLeave);
15359 performAppear: function (key) {
15360 this.currentlyTransitioningKeys[key] = true;
15362 var component = this.refs[key];
15364 if (component.componentWillAppear) {
15365 component.componentWillAppear(this._handleDoneAppearing.bind(this, key));
15367 this._handleDoneAppearing(key);
15371 _handleDoneAppearing: function (key) {
15372 var component = this.refs[key];
15373 if (component.componentDidAppear) {
15374 component.componentDidAppear();
15377 delete this.currentlyTransitioningKeys[key];
15379 var currentChildMapping = ReactTransitionChildMapping.getChildMapping(this.props.children);
15381 if (!currentChildMapping || !currentChildMapping.hasOwnProperty(key)) {
15382 // This was removed before it had fully appeared. Remove it.
15383 this.performLeave(key);
15387 performEnter: function (key) {
15388 this.currentlyTransitioningKeys[key] = true;
15390 var component = this.refs[key];
15392 if (component.componentWillEnter) {
15393 component.componentWillEnter(this._handleDoneEntering.bind(this, key));
15395 this._handleDoneEntering(key);
15399 _handleDoneEntering: function (key) {
15400 var component = this.refs[key];
15401 if (component.componentDidEnter) {
15402 component.componentDidEnter();
15405 delete this.currentlyTransitioningKeys[key];
15407 var currentChildMapping = ReactTransitionChildMapping.getChildMapping(this.props.children);
15409 if (!currentChildMapping || !currentChildMapping.hasOwnProperty(key)) {
15410 // This was removed before it had fully entered. Remove it.
15411 this.performLeave(key);
15415 performLeave: function (key) {
15416 this.currentlyTransitioningKeys[key] = true;
15418 var component = this.refs[key];
15419 if (component.componentWillLeave) {
15420 component.componentWillLeave(this._handleDoneLeaving.bind(this, key));
15422 // Note that this is somewhat dangerous b/c it calls setState()
15423 // again, effectively mutating the component before all the work
15425 this._handleDoneLeaving(key);
15429 _handleDoneLeaving: function (key) {
15430 var component = this.refs[key];
15432 if (component.componentDidLeave) {
15433 component.componentDidLeave();
15436 delete this.currentlyTransitioningKeys[key];
15438 var currentChildMapping = ReactTransitionChildMapping.getChildMapping(this.props.children);
15440 if (currentChildMapping && currentChildMapping.hasOwnProperty(key)) {
15441 // This entered again before it fully left. Add it again.
15442 this.performEnter(key);
15444 this.setState(function (state) {
15445 var newChildren = _assign({}, state.children);
15446 delete newChildren[key];
15447 return { children: newChildren };
15452 render: function () {
15453 // TODO: we could get rid of the need for the wrapper node
15454 // by cloning a single child
15455 var childrenToRender = [];
15456 for (var key in this.state.children) {
15457 var child = this.state.children[key];
15459 // You may need to apply reactive updates to a child as it is leaving.
15460 // The normal React way to do it won't work since the child will have
15461 // already been removed. In case you need this behavior you can provide
15462 // a childFactory function to wrap every child, even the ones that are
15464 childrenToRender.push(React.cloneElement(this.props.childFactory(child), { ref: key, key: key }));
15467 return React.createElement(this.props.component, this.props, childrenToRender);
15471 module.exports = ReactTransitionGroup;
15472 },{"100":100,"165":165,"184":184,"27":27}],103:[function(_dereq_,module,exports){
15474 * Copyright 2015-present, Facebook, Inc.
15475 * All rights reserved.
15477 * This source code is licensed under the BSD-style license found in the
15478 * LICENSE file in the root directory of this source tree. An additional grant
15479 * of patent rights can be found in the PATENTS file in the same directory.
15481 * @providesModule ReactUpdateQueue
15486 var ReactCurrentOwner = _dereq_(40);
15487 var ReactInstanceMap = _dereq_(75);
15488 var ReactUpdates = _dereq_(104);
15490 var invariant = _dereq_(173);
15491 var warning = _dereq_(183);
15493 function enqueueUpdate(internalInstance) {
15494 ReactUpdates.enqueueUpdate(internalInstance);
15497 function formatUnexpectedArgument(arg) {
15498 var type = typeof arg;
15499 if (type !== 'object') {
15502 var displayName = arg.constructor && arg.constructor.name || type;
15503 var keys = Object.keys(arg);
15504 if (keys.length > 0 && keys.length < 20) {
15505 return displayName + ' (keys: ' + keys.join(', ') + ')';
15507 return displayName;
15510 function getInternalInstanceReadyForUpdate(publicInstance, callerName) {
15511 var internalInstance = ReactInstanceMap.get(publicInstance);
15512 if (!internalInstance) {
15513 if ("development" !== 'production') {
15514 // Only warn when we have a callerName. Otherwise we should be silent.
15515 // We're probably calling from enqueueCallback. We don't want to warn
15516 // there because we already warned for the corresponding lifecycle method.
15517 "development" !== 'production' ? warning(!callerName, '%s(...): Can only update a mounted or mounting component. ' + 'This usually means you called %s() on an unmounted component. ' + 'This is a no-op. Please check the code for the %s component.', callerName, callerName, publicInstance.constructor.displayName) : void 0;
15522 if ("development" !== 'production') {
15523 "development" !== 'production' ? warning(ReactCurrentOwner.current == null, '%s(...): Cannot update during an existing state transition (such as ' + 'within `render` or another component\'s constructor). Render methods ' + 'should be a pure function of props and state; constructor ' + 'side-effects are an anti-pattern, but can be moved to ' + '`componentWillMount`.', callerName) : void 0;
15526 return internalInstance;
15530 * ReactUpdateQueue allows for state updates to be scheduled into a later
15531 * reconciliation step.
15533 var ReactUpdateQueue = {
15536 * Checks whether or not this composite component is mounted.
15537 * @param {ReactClass} publicInstance The instance we want to test.
15538 * @return {boolean} True if mounted, false otherwise.
15542 isMounted: function (publicInstance) {
15543 if ("development" !== 'production') {
15544 var owner = ReactCurrentOwner.current;
15545 if (owner !== null) {
15546 "development" !== 'production' ? warning(owner._warnedAboutRefsInRender, '%s is accessing isMounted inside its render() function. ' + 'render() should be a pure function of props and state. It should ' + 'never access something that requires stale data from the previous ' + 'render, such as refs. Move this logic to componentDidMount and ' + 'componentDidUpdate instead.', owner.getName() || 'A component') : void 0;
15547 owner._warnedAboutRefsInRender = true;
15550 var internalInstance = ReactInstanceMap.get(publicInstance);
15551 if (internalInstance) {
15552 // During componentWillMount and render this will still be null but after
15553 // that will always render to something. At least for now. So we can use
15555 return !!internalInstance._renderedComponent;
15562 * Enqueue a callback that will be executed after all the pending updates
15565 * @param {ReactClass} publicInstance The instance to use as `this` context.
15566 * @param {?function} callback Called after state is updated.
15567 * @param {string} callerName Name of the calling function in the public API.
15570 enqueueCallback: function (publicInstance, callback, callerName) {
15571 ReactUpdateQueue.validateCallback(callback, callerName);
15572 var internalInstance = getInternalInstanceReadyForUpdate(publicInstance);
15574 // Previously we would throw an error if we didn't have an internal
15575 // instance. Since we want to make it a no-op instead, we mirror the same
15576 // behavior we have in other enqueue* methods.
15577 // We also need to ignore callbacks in componentWillMount. See
15579 if (!internalInstance) {
15583 if (internalInstance._pendingCallbacks) {
15584 internalInstance._pendingCallbacks.push(callback);
15586 internalInstance._pendingCallbacks = [callback];
15588 // TODO: The callback here is ignored when setState is called from
15589 // componentWillMount. Either fix it or disallow doing so completely in
15590 // favor of getInitialState. Alternatively, we can disallow
15591 // componentWillMount during server-side rendering.
15592 enqueueUpdate(internalInstance);
15595 enqueueCallbackInternal: function (internalInstance, callback) {
15596 if (internalInstance._pendingCallbacks) {
15597 internalInstance._pendingCallbacks.push(callback);
15599 internalInstance._pendingCallbacks = [callback];
15601 enqueueUpdate(internalInstance);
15605 * Forces an update. This should only be invoked when it is known with
15606 * certainty that we are **not** in a DOM transaction.
15608 * You may want to call this when you know that some deeper aspect of the
15609 * component's state has changed but `setState` was not called.
15611 * This will not invoke `shouldComponentUpdate`, but it will invoke
15612 * `componentWillUpdate` and `componentDidUpdate`.
15614 * @param {ReactClass} publicInstance The instance that should rerender.
15617 enqueueForceUpdate: function (publicInstance) {
15618 var internalInstance = getInternalInstanceReadyForUpdate(publicInstance, 'forceUpdate');
15620 if (!internalInstance) {
15624 internalInstance._pendingForceUpdate = true;
15626 enqueueUpdate(internalInstance);
15630 * Replaces all of the state. Always use this or `setState` to mutate state.
15631 * You should treat `this.state` as immutable.
15633 * There is no guarantee that `this.state` will be immediately updated, so
15634 * accessing `this.state` after calling this method may return the old value.
15636 * @param {ReactClass} publicInstance The instance that should rerender.
15637 * @param {object} completeState Next state.
15640 enqueueReplaceState: function (publicInstance, completeState) {
15641 var internalInstance = getInternalInstanceReadyForUpdate(publicInstance, 'replaceState');
15643 if (!internalInstance) {
15647 internalInstance._pendingStateQueue = [completeState];
15648 internalInstance._pendingReplaceState = true;
15650 enqueueUpdate(internalInstance);
15654 * Sets a subset of the state. This only exists because _pendingState is
15655 * internal. This provides a merging strategy that is not available to deep
15656 * properties which is confusing. TODO: Expose pendingState or don't use it
15657 * during the merge.
15659 * @param {ReactClass} publicInstance The instance that should rerender.
15660 * @param {object} partialState Next partial state to be merged with state.
15663 enqueueSetState: function (publicInstance, partialState) {
15664 var internalInstance = getInternalInstanceReadyForUpdate(publicInstance, 'setState');
15666 if (!internalInstance) {
15670 var queue = internalInstance._pendingStateQueue || (internalInstance._pendingStateQueue = []);
15671 queue.push(partialState);
15673 enqueueUpdate(internalInstance);
15676 enqueueElementInternal: function (internalInstance, newElement) {
15677 internalInstance._pendingElement = newElement;
15678 enqueueUpdate(internalInstance);
15681 validateCallback: function (callback, callerName) {
15682 !(!callback || typeof callback === 'function') ? "development" !== 'production' ? invariant(false, '%s(...): Expected the last optional `callback` argument to be a ' + 'function. Instead received: %s.', callerName, formatUnexpectedArgument(callback)) : invariant(false) : void 0;
15687 module.exports = ReactUpdateQueue;
15688 },{"104":104,"173":173,"183":183,"40":40,"75":75}],104:[function(_dereq_,module,exports){
15690 * Copyright 2013-present, Facebook, Inc.
15691 * All rights reserved.
15693 * This source code is licensed under the BSD-style license found in the
15694 * LICENSE file in the root directory of this source tree. An additional grant
15695 * of patent rights can be found in the PATENTS file in the same directory.
15697 * @providesModule ReactUpdates
15702 var _assign = _dereq_(184);
15704 var CallbackQueue = _dereq_(5);
15705 var PooledClass = _dereq_(26);
15706 var ReactFeatureFlags = _dereq_(71);
15707 var ReactInstrumentation = _dereq_(76);
15708 var ReactReconciler = _dereq_(93);
15709 var Transaction = _dereq_(124);
15711 var invariant = _dereq_(173);
15713 var dirtyComponents = [];
15714 var updateBatchNumber = 0;
15715 var asapCallbackQueue = CallbackQueue.getPooled();
15716 var asapEnqueued = false;
15718 var batchingStrategy = null;
15720 function ensureInjected() {
15721 !(ReactUpdates.ReactReconcileTransaction && batchingStrategy) ? "development" !== 'production' ? invariant(false, 'ReactUpdates: must inject a reconcile transaction class and batching ' + 'strategy') : invariant(false) : void 0;
15724 var NESTED_UPDATES = {
15725 initialize: function () {
15726 this.dirtyComponentsLength = dirtyComponents.length;
15728 close: function () {
15729 if (this.dirtyComponentsLength !== dirtyComponents.length) {
15730 // Additional updates were enqueued by componentDidUpdate handlers or
15731 // similar; before our own UPDATE_QUEUEING wrapper closes, we want to run
15732 // these new updates so that if A's componentDidUpdate calls setState on
15733 // B, B will update before the callback A's updater provided when calling
15735 dirtyComponents.splice(0, this.dirtyComponentsLength);
15736 flushBatchedUpdates();
15738 dirtyComponents.length = 0;
15743 var UPDATE_QUEUEING = {
15744 initialize: function () {
15745 this.callbackQueue.reset();
15747 close: function () {
15748 this.callbackQueue.notifyAll();
15752 var TRANSACTION_WRAPPERS = [NESTED_UPDATES, UPDATE_QUEUEING];
15754 function ReactUpdatesFlushTransaction() {
15755 this.reinitializeTransaction();
15756 this.dirtyComponentsLength = null;
15757 this.callbackQueue = CallbackQueue.getPooled();
15758 this.reconcileTransaction = ReactUpdates.ReactReconcileTransaction.getPooled(
15759 /* useCreateElement */true);
15762 _assign(ReactUpdatesFlushTransaction.prototype, Transaction.Mixin, {
15763 getTransactionWrappers: function () {
15764 return TRANSACTION_WRAPPERS;
15767 destructor: function () {
15768 this.dirtyComponentsLength = null;
15769 CallbackQueue.release(this.callbackQueue);
15770 this.callbackQueue = null;
15771 ReactUpdates.ReactReconcileTransaction.release(this.reconcileTransaction);
15772 this.reconcileTransaction = null;
15775 perform: function (method, scope, a) {
15776 // Essentially calls `this.reconcileTransaction.perform(method, scope, a)`
15777 // with this transaction's wrappers around it.
15778 return Transaction.Mixin.perform.call(this, this.reconcileTransaction.perform, this.reconcileTransaction, method, scope, a);
15782 PooledClass.addPoolingTo(ReactUpdatesFlushTransaction);
15784 function batchedUpdates(callback, a, b, c, d, e) {
15786 batchingStrategy.batchedUpdates(callback, a, b, c, d, e);
15790 * Array comparator for ReactComponents by mount ordering.
15792 * @param {ReactComponent} c1 first component you're comparing
15793 * @param {ReactComponent} c2 second component you're comparing
15794 * @return {number} Return value usable by Array.prototype.sort().
15796 function mountOrderComparator(c1, c2) {
15797 return c1._mountOrder - c2._mountOrder;
15800 function runBatchedUpdates(transaction) {
15801 var len = transaction.dirtyComponentsLength;
15802 !(len === dirtyComponents.length) ? "development" !== 'production' ? invariant(false, 'Expected flush transaction\'s stored dirty-components length (%s) to ' + 'match dirty-components array length (%s).', len, dirtyComponents.length) : invariant(false) : void 0;
15804 // Since reconciling a component higher in the owner hierarchy usually (not
15805 // always -- see shouldComponentUpdate()) will reconcile children, reconcile
15806 // them before their children by sorting the array.
15807 dirtyComponents.sort(mountOrderComparator);
15809 // Any updates enqueued while reconciling must be performed after this entire
15810 // batch. Otherwise, if dirtyComponents is [A, B] where A has children B and
15811 // C, B could update twice in a single batch if C's render enqueues an update
15812 // to B (since B would have already updated, we should skip it, and the only
15813 // way we can know to do so is by checking the batch counter).
15814 updateBatchNumber++;
15816 for (var i = 0; i < len; i++) {
15817 // If a component is unmounted before pending changes apply, it will still
15818 // be here, but we assume that it has cleared its _pendingCallbacks and
15819 // that performUpdateIfNecessary is a noop.
15820 var component = dirtyComponents[i];
15822 // If performUpdateIfNecessary happens to enqueue any new updates, we
15823 // shouldn't execute the callbacks until the next render happens, so
15824 // stash the callbacks first
15825 var callbacks = component._pendingCallbacks;
15826 component._pendingCallbacks = null;
15829 if (ReactFeatureFlags.logTopLevelRenders) {
15830 var namedComponent = component;
15831 // Duck type TopLevelWrapper. This is probably always true.
15832 if (component._currentElement.props === component._renderedComponent._currentElement) {
15833 namedComponent = component._renderedComponent;
15835 markerName = 'React update: ' + namedComponent.getName();
15836 console.time(markerName);
15839 ReactReconciler.performUpdateIfNecessary(component, transaction.reconcileTransaction, updateBatchNumber);
15842 console.timeEnd(markerName);
15846 for (var j = 0; j < callbacks.length; j++) {
15847 transaction.callbackQueue.enqueue(callbacks[j], component.getPublicInstance());
15853 var flushBatchedUpdates = function () {
15854 if ("development" !== 'production') {
15855 ReactInstrumentation.debugTool.onBeginFlush();
15858 // ReactUpdatesFlushTransaction's wrappers will clear the dirtyComponents
15859 // array and perform any updates enqueued by mount-ready handlers (i.e.,
15860 // componentDidUpdate) but we need to check here too in order to catch
15861 // updates enqueued by setState callbacks and asap calls.
15862 while (dirtyComponents.length || asapEnqueued) {
15863 if (dirtyComponents.length) {
15864 var transaction = ReactUpdatesFlushTransaction.getPooled();
15865 transaction.perform(runBatchedUpdates, null, transaction);
15866 ReactUpdatesFlushTransaction.release(transaction);
15869 if (asapEnqueued) {
15870 asapEnqueued = false;
15871 var queue = asapCallbackQueue;
15872 asapCallbackQueue = CallbackQueue.getPooled();
15874 CallbackQueue.release(queue);
15878 if ("development" !== 'production') {
15879 ReactInstrumentation.debugTool.onEndFlush();
15884 * Mark a component as needing a rerender, adding an optional callback to a
15885 * list of functions which will be executed once the rerender occurs.
15887 function enqueueUpdate(component) {
15890 // Various parts of our code (such as ReactCompositeComponent's
15891 // _renderValidatedComponent) assume that calls to render aren't nested;
15892 // verify that that's the case. (This is called by each top-level update
15893 // function, like setProps, setState, forceUpdate, etc.; creation and
15894 // destruction of top-level components is guarded in ReactMount.)
15896 if (!batchingStrategy.isBatchingUpdates) {
15897 batchingStrategy.batchedUpdates(enqueueUpdate, component);
15901 dirtyComponents.push(component);
15902 if (component._updateBatchNumber == null) {
15903 component._updateBatchNumber = updateBatchNumber + 1;
15908 * Enqueue a callback to be run at the end of the current batching cycle. Throws
15909 * if no updates are currently being performed.
15911 function asap(callback, context) {
15912 !batchingStrategy.isBatchingUpdates ? "development" !== 'production' ? invariant(false, 'ReactUpdates.asap: Can\'t enqueue an asap callback in a context where' + 'updates are not being batched.') : invariant(false) : void 0;
15913 asapCallbackQueue.enqueue(callback, context);
15914 asapEnqueued = true;
15917 var ReactUpdatesInjection = {
15918 injectReconcileTransaction: function (ReconcileTransaction) {
15919 !ReconcileTransaction ? "development" !== 'production' ? invariant(false, 'ReactUpdates: must provide a reconcile transaction class') : invariant(false) : void 0;
15920 ReactUpdates.ReactReconcileTransaction = ReconcileTransaction;
15923 injectBatchingStrategy: function (_batchingStrategy) {
15924 !_batchingStrategy ? "development" !== 'production' ? invariant(false, 'ReactUpdates: must provide a batching strategy') : invariant(false) : void 0;
15925 !(typeof _batchingStrategy.batchedUpdates === 'function') ? "development" !== 'production' ? invariant(false, 'ReactUpdates: must provide a batchedUpdates() function') : invariant(false) : void 0;
15926 !(typeof _batchingStrategy.isBatchingUpdates === 'boolean') ? "development" !== 'production' ? invariant(false, 'ReactUpdates: must provide an isBatchingUpdates boolean attribute') : invariant(false) : void 0;
15927 batchingStrategy = _batchingStrategy;
15931 var ReactUpdates = {
15933 * React references `ReactReconcileTransaction` using this property in order
15934 * to allow dependency injection.
15938 ReactReconcileTransaction: null,
15940 batchedUpdates: batchedUpdates,
15941 enqueueUpdate: enqueueUpdate,
15942 flushBatchedUpdates: flushBatchedUpdates,
15943 injection: ReactUpdatesInjection,
15947 module.exports = ReactUpdates;
15948 },{"124":124,"173":173,"184":184,"26":26,"5":5,"71":71,"76":76,"93":93}],105:[function(_dereq_,module,exports){
15950 * Copyright 2013-present, Facebook, Inc.
15951 * All rights reserved.
15953 * This source code is licensed under the BSD-style license found in the
15954 * LICENSE file in the root directory of this source tree. An additional grant
15955 * of patent rights can be found in the PATENTS file in the same directory.
15957 * @providesModule ReactVersion
15962 module.exports = '15.1.0';
15963 },{}],106:[function(_dereq_,module,exports){
15965 * Copyright 2013-present, Facebook, Inc.
15966 * All rights reserved.
15968 * This source code is licensed under the BSD-style license found in the
15969 * LICENSE file in the root directory of this source tree. An additional grant
15970 * of patent rights can be found in the PATENTS file in the same directory.
15972 * @providesModule ReactWithAddons
15977 var LinkedStateMixin = _dereq_(24);
15978 var React = _dereq_(27);
15979 var ReactComponentWithPureRenderMixin = _dereq_(38);
15980 var ReactCSSTransitionGroup = _dereq_(29);
15981 var ReactFragment = _dereq_(72);
15982 var ReactTransitionGroup = _dereq_(102);
15984 var shallowCompare = _dereq_(152);
15985 var update = _dereq_(155);
15988 CSSTransitionGroup: ReactCSSTransitionGroup,
15989 LinkedStateMixin: LinkedStateMixin,
15990 PureRenderMixin: ReactComponentWithPureRenderMixin,
15991 TransitionGroup: ReactTransitionGroup,
15993 createFragment: ReactFragment.create,
15994 shallowCompare: shallowCompare,
15998 if ("development" !== 'production') {
15999 React.addons.Perf = _dereq_(88);
16000 React.addons.TestUtils = _dereq_(99);
16003 module.exports = React;
16004 },{"102":102,"152":152,"155":155,"24":24,"27":27,"29":29,"38":38,"72":72,"88":88,"99":99}],107:[function(_dereq_,module,exports){
16006 * Copyright 2013-present, Facebook, Inc.
16007 * All rights reserved.
16009 * This source code is licensed under the BSD-style license found in the
16010 * LICENSE file in the root directory of this source tree. An additional grant
16011 * of patent rights can be found in the PATENTS file in the same directory.
16013 * @providesModule ReactWithAddonsUMDEntry
16018 var _assign = _dereq_(184);
16020 var ReactDOM = _dereq_(41);
16021 var ReactDOMServer = _dereq_(57);
16022 var ReactWithAddons = _dereq_(106);
16024 // `version` will be added here by ReactIsomorphic.
16025 var ReactWithAddonsUMDEntry = _assign({
16026 __SECRET_DOM_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: ReactDOM,
16027 __SECRET_DOM_SERVER_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: ReactDOMServer
16028 }, ReactWithAddons);
16030 module.exports = ReactWithAddonsUMDEntry;
16031 },{"106":106,"184":184,"41":41,"57":57}],108:[function(_dereq_,module,exports){
16033 * Copyright 2013-present, Facebook, Inc.
16034 * All rights reserved.
16036 * This source code is licensed under the BSD-style license found in the
16037 * LICENSE file in the root directory of this source tree. An additional grant
16038 * of patent rights can be found in the PATENTS file in the same directory.
16040 * @providesModule SVGDOMPropertyConfig
16046 xlink: 'http://www.w3.org/1999/xlink',
16047 xml: 'http://www.w3.org/XML/1998/namespace'
16050 // We use attributes for everything SVG so let's avoid some duplication and run
16052 // The following are all specified in the HTML config already so we exclude here.
16053 // - class (as className)
16068 accentHeight: 'accent-height',
16071 alignmentBaseline: 'alignment-baseline',
16072 allowReorder: 'allowReorder',
16075 arabicForm: 'arabic-form',
16077 attributeName: 'attributeName',
16078 attributeType: 'attributeType',
16079 autoReverse: 'autoReverse',
16081 baseFrequency: 'baseFrequency',
16082 baseProfile: 'baseProfile',
16083 baselineShift: 'baseline-shift',
16088 calcMode: 'calcMode',
16089 capHeight: 'cap-height',
16091 clipPath: 'clip-path',
16092 clipRule: 'clip-rule',
16093 clipPathUnits: 'clipPathUnits',
16094 colorInterpolation: 'color-interpolation',
16095 colorInterpolationFilters: 'color-interpolation-filters',
16096 colorProfile: 'color-profile',
16097 colorRendering: 'color-rendering',
16098 contentScriptType: 'contentScriptType',
16099 contentStyleType: 'contentStyleType',
16106 diffuseConstant: 'diffuseConstant',
16110 dominantBaseline: 'dominant-baseline',
16114 edgeMode: 'edgeMode',
16116 enableBackground: 'enable-background',
16119 externalResourcesRequired: 'externalResourcesRequired',
16121 fillOpacity: 'fill-opacity',
16122 fillRule: 'fill-rule',
16124 filterRes: 'filterRes',
16125 filterUnits: 'filterUnits',
16126 floodColor: 'flood-color',
16127 floodOpacity: 'flood-opacity',
16129 fontFamily: 'font-family',
16130 fontSize: 'font-size',
16131 fontSizeAdjust: 'font-size-adjust',
16132 fontStretch: 'font-stretch',
16133 fontStyle: 'font-style',
16134 fontVariant: 'font-variant',
16135 fontWeight: 'font-weight',
16142 glyphName: 'glyph-name',
16143 glyphOrientationHorizontal: 'glyph-orientation-horizontal',
16144 glyphOrientationVertical: 'glyph-orientation-vertical',
16145 glyphRef: 'glyphRef',
16146 gradientTransform: 'gradientTransform',
16147 gradientUnits: 'gradientUnits',
16149 horizAdvX: 'horiz-adv-x',
16150 horizOriginX: 'horiz-origin-x',
16152 imageRendering: 'image-rendering',
16161 kernelMatrix: 'kernelMatrix',
16162 kernelUnitLength: 'kernelUnitLength',
16164 keyPoints: 'keyPoints',
16165 keySplines: 'keySplines',
16166 keyTimes: 'keyTimes',
16167 lengthAdjust: 'lengthAdjust',
16168 letterSpacing: 'letter-spacing',
16169 lightingColor: 'lighting-color',
16170 limitingConeAngle: 'limitingConeAngle',
16172 markerEnd: 'marker-end',
16173 markerMid: 'marker-mid',
16174 markerStart: 'marker-start',
16175 markerHeight: 'markerHeight',
16176 markerUnits: 'markerUnits',
16177 markerWidth: 'markerWidth',
16179 maskContentUnits: 'maskContentUnits',
16180 maskUnits: 'maskUnits',
16183 numOctaves: 'numOctaves',
16192 overlinePosition: 'overline-position',
16193 overlineThickness: 'overline-thickness',
16194 paintOrder: 'paint-order',
16195 panose1: 'panose-1',
16196 pathLength: 'pathLength',
16197 patternContentUnits: 'patternContentUnits',
16198 patternTransform: 'patternTransform',
16199 patternUnits: 'patternUnits',
16200 pointerEvents: 'pointer-events',
16202 pointsAtX: 'pointsAtX',
16203 pointsAtY: 'pointsAtY',
16204 pointsAtZ: 'pointsAtZ',
16205 preserveAlpha: 'preserveAlpha',
16206 preserveAspectRatio: 'preserveAspectRatio',
16207 primitiveUnits: 'primitiveUnits',
16212 renderingIntent: 'rendering-intent',
16213 repeatCount: 'repeatCount',
16214 repeatDur: 'repeatDur',
16215 requiredExtensions: 'requiredExtensions',
16216 requiredFeatures: 'requiredFeatures',
16224 shapeRendering: 'shape-rendering',
16227 specularConstant: 'specularConstant',
16228 specularExponent: 'specularExponent',
16230 spreadMethod: 'spreadMethod',
16231 startOffset: 'startOffset',
16232 stdDeviation: 'stdDeviation',
16235 stitchTiles: 'stitchTiles',
16236 stopColor: 'stop-color',
16237 stopOpacity: 'stop-opacity',
16238 strikethroughPosition: 'strikethrough-position',
16239 strikethroughThickness: 'strikethrough-thickness',
16242 strokeDasharray: 'stroke-dasharray',
16243 strokeDashoffset: 'stroke-dashoffset',
16244 strokeLinecap: 'stroke-linecap',
16245 strokeLinejoin: 'stroke-linejoin',
16246 strokeMiterlimit: 'stroke-miterlimit',
16247 strokeOpacity: 'stroke-opacity',
16248 strokeWidth: 'stroke-width',
16249 surfaceScale: 'surfaceScale',
16250 systemLanguage: 'systemLanguage',
16251 tableValues: 'tableValues',
16252 targetX: 'targetX',
16253 targetY: 'targetY',
16254 textAnchor: 'text-anchor',
16255 textDecoration: 'text-decoration',
16256 textRendering: 'text-rendering',
16257 textLength: 'textLength',
16262 underlinePosition: 'underline-position',
16263 underlineThickness: 'underline-thickness',
16265 unicodeBidi: 'unicode-bidi',
16266 unicodeRange: 'unicode-range',
16267 unitsPerEm: 'units-per-em',
16268 vAlphabetic: 'v-alphabetic',
16269 vHanging: 'v-hanging',
16270 vIdeographic: 'v-ideographic',
16271 vMathematical: 'v-mathematical',
16273 vectorEffect: 'vector-effect',
16275 vertAdvY: 'vert-adv-y',
16276 vertOriginX: 'vert-origin-x',
16277 vertOriginY: 'vert-origin-y',
16278 viewBox: 'viewBox',
16279 viewTarget: 'viewTarget',
16282 wordSpacing: 'word-spacing',
16283 writingMode: 'writing-mode',
16285 xHeight: 'x-height',
16288 xChannelSelector: 'xChannelSelector',
16289 xlinkActuate: 'xlink:actuate',
16290 xlinkArcrole: 'xlink:arcrole',
16291 xlinkHref: 'xlink:href',
16292 xlinkRole: 'xlink:role',
16293 xlinkShow: 'xlink:show',
16294 xlinkTitle: 'xlink:title',
16295 xlinkType: 'xlink:type',
16296 xmlBase: 'xml:base',
16297 xmlLang: 'xml:lang',
16298 xmlSpace: 'xml:space',
16302 yChannelSelector: 'yChannelSelector',
16304 zoomAndPan: 'zoomAndPan'
16307 var SVGDOMPropertyConfig = {
16309 DOMAttributeNamespaces: {
16310 xlinkActuate: NS.xlink,
16311 xlinkArcrole: NS.xlink,
16312 xlinkHref: NS.xlink,
16313 xlinkRole: NS.xlink,
16314 xlinkShow: NS.xlink,
16315 xlinkTitle: NS.xlink,
16316 xlinkType: NS.xlink,
16321 DOMAttributeNames: {}
16324 Object.keys(ATTRS).forEach(function (key) {
16325 SVGDOMPropertyConfig.Properties[key] = 0;
16327 SVGDOMPropertyConfig.DOMAttributeNames[key] = ATTRS[key];
16331 module.exports = SVGDOMPropertyConfig;
16332 },{}],109:[function(_dereq_,module,exports){
16334 * Copyright 2013-present, Facebook, Inc.
16335 * All rights reserved.
16337 * This source code is licensed under the BSD-style license found in the
16338 * LICENSE file in the root directory of this source tree. An additional grant
16339 * of patent rights can be found in the PATENTS file in the same directory.
16341 * @providesModule SelectEventPlugin
16346 var EventConstants = _dereq_(16);
16347 var EventPropagators = _dereq_(20);
16348 var ExecutionEnvironment = _dereq_(159);
16349 var ReactDOMComponentTree = _dereq_(45);
16350 var ReactInputSelection = _dereq_(74);
16351 var SyntheticEvent = _dereq_(115);
16353 var getActiveElement = _dereq_(168);
16354 var isTextInputElement = _dereq_(146);
16355 var keyOf = _dereq_(177);
16356 var shallowEqual = _dereq_(182);
16358 var topLevelTypes = EventConstants.topLevelTypes;
16360 var skipSelectionChangeEvent = ExecutionEnvironment.canUseDOM && 'documentMode' in document && document.documentMode <= 11;
16364 phasedRegistrationNames: {
16365 bubbled: keyOf({ onSelect: null }),
16366 captured: keyOf({ onSelectCapture: null })
16368 dependencies: [topLevelTypes.topBlur, topLevelTypes.topContextMenu, topLevelTypes.topFocus, topLevelTypes.topKeyDown, topLevelTypes.topMouseDown, topLevelTypes.topMouseUp, topLevelTypes.topSelectionChange]
16372 var activeElement = null;
16373 var activeElementInst = null;
16374 var lastSelection = null;
16375 var mouseDown = false;
16377 // Track whether a listener exists for this plugin. If none exist, we do
16378 // not extract events. See #3639.
16379 var hasListener = false;
16380 var ON_SELECT_KEY = keyOf({ onSelect: null });
16383 * Get an object which is a unique representation of the current selection.
16385 * The return value will not be consistent across nodes or browsers, but
16386 * two identical selections on the same node will return identical objects.
16388 * @param {DOMElement} node
16391 function getSelection(node) {
16392 if ('selectionStart' in node && ReactInputSelection.hasSelectionCapabilities(node)) {
16394 start: node.selectionStart,
16395 end: node.selectionEnd
16397 } else if (window.getSelection) {
16398 var selection = window.getSelection();
16400 anchorNode: selection.anchorNode,
16401 anchorOffset: selection.anchorOffset,
16402 focusNode: selection.focusNode,
16403 focusOffset: selection.focusOffset
16405 } else if (document.selection) {
16406 var range = document.selection.createRange();
16408 parentElement: range.parentElement(),
16410 top: range.boundingTop,
16411 left: range.boundingLeft
16417 * Poll selection to see whether it's changed.
16419 * @param {object} nativeEvent
16420 * @return {?SyntheticEvent}
16422 function constructSelectEvent(nativeEvent, nativeEventTarget) {
16423 // Ensure we have the right element, and that the user is not dragging a
16424 // selection (this matches native `select` event behavior). In HTML5, select
16425 // fires only on input and textarea thus if there's no focused element we
16427 if (mouseDown || activeElement == null || activeElement !== getActiveElement()) {
16431 // Only fire when selection has actually changed.
16432 var currentSelection = getSelection(activeElement);
16433 if (!lastSelection || !shallowEqual(lastSelection, currentSelection)) {
16434 lastSelection = currentSelection;
16436 var syntheticEvent = SyntheticEvent.getPooled(eventTypes.select, activeElementInst, nativeEvent, nativeEventTarget);
16438 syntheticEvent.type = 'select';
16439 syntheticEvent.target = activeElement;
16441 EventPropagators.accumulateTwoPhaseDispatches(syntheticEvent);
16443 return syntheticEvent;
16450 * This plugin creates an `onSelect` event that normalizes select events
16451 * across form elements.
16453 * Supported elements are:
16454 * - input (see `isTextInputElement`)
16456 * - contentEditable
16458 * This differs from native browser implementations in the following ways:
16459 * - Fires on contentEditable fields as well as inputs.
16460 * - Fires for collapsed selection.
16461 * - Fires after user input.
16463 var SelectEventPlugin = {
16465 eventTypes: eventTypes,
16467 extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
16468 if (!hasListener) {
16472 var targetNode = targetInst ? ReactDOMComponentTree.getNodeFromInstance(targetInst) : window;
16474 switch (topLevelType) {
16475 // Track the input node that has focus.
16476 case topLevelTypes.topFocus:
16477 if (isTextInputElement(targetNode) || targetNode.contentEditable === 'true') {
16478 activeElement = targetNode;
16479 activeElementInst = targetInst;
16480 lastSelection = null;
16483 case topLevelTypes.topBlur:
16484 activeElement = null;
16485 activeElementInst = null;
16486 lastSelection = null;
16489 // Don't fire the event while the user is dragging. This matches the
16490 // semantics of the native select event.
16491 case topLevelTypes.topMouseDown:
16494 case topLevelTypes.topContextMenu:
16495 case topLevelTypes.topMouseUp:
16497 return constructSelectEvent(nativeEvent, nativeEventTarget);
16499 // Chrome and IE fire non-standard event when selection is changed (and
16500 // sometimes when it hasn't). IE's event fires out of order with respect
16501 // to key and input events on deletion, so we discard it.
16503 // Firefox doesn't support selectionchange, so check selection status
16504 // after each key entry. The selection changes after keydown and before
16505 // keyup, but we check on keydown as well in the case of holding down a
16506 // key, when multiple keydown events are fired but only one keyup is.
16507 // This is also our approach for IE handling, for the reason above.
16508 case topLevelTypes.topSelectionChange:
16509 if (skipSelectionChangeEvent) {
16513 case topLevelTypes.topKeyDown:
16514 case topLevelTypes.topKeyUp:
16515 return constructSelectEvent(nativeEvent, nativeEventTarget);
16521 didPutListener: function (inst, registrationName, listener) {
16522 if (registrationName === ON_SELECT_KEY) {
16523 hasListener = true;
16528 module.exports = SelectEventPlugin;
16529 },{"115":115,"146":146,"159":159,"16":16,"168":168,"177":177,"182":182,"20":20,"45":45,"74":74}],110:[function(_dereq_,module,exports){
16531 * Copyright 2013-present, Facebook, Inc.
16532 * All rights reserved.
16534 * This source code is licensed under the BSD-style license found in the
16535 * LICENSE file in the root directory of this source tree. An additional grant
16536 * of patent rights can be found in the PATENTS file in the same directory.
16538 * @providesModule SimpleEventPlugin
16543 var EventConstants = _dereq_(16);
16544 var EventListener = _dereq_(158);
16545 var EventPropagators = _dereq_(20);
16546 var ReactDOMComponentTree = _dereq_(45);
16547 var SyntheticAnimationEvent = _dereq_(111);
16548 var SyntheticClipboardEvent = _dereq_(112);
16549 var SyntheticEvent = _dereq_(115);
16550 var SyntheticFocusEvent = _dereq_(116);
16551 var SyntheticKeyboardEvent = _dereq_(118);
16552 var SyntheticMouseEvent = _dereq_(119);
16553 var SyntheticDragEvent = _dereq_(114);
16554 var SyntheticTouchEvent = _dereq_(120);
16555 var SyntheticTransitionEvent = _dereq_(121);
16556 var SyntheticUIEvent = _dereq_(122);
16557 var SyntheticWheelEvent = _dereq_(123);
16559 var emptyFunction = _dereq_(165);
16560 var getEventCharCode = _dereq_(135);
16561 var invariant = _dereq_(173);
16562 var keyOf = _dereq_(177);
16564 var topLevelTypes = EventConstants.topLevelTypes;
16568 phasedRegistrationNames: {
16569 bubbled: keyOf({ onAbort: true }),
16570 captured: keyOf({ onAbortCapture: true })
16574 phasedRegistrationNames: {
16575 bubbled: keyOf({ onAnimationEnd: true }),
16576 captured: keyOf({ onAnimationEndCapture: true })
16579 animationIteration: {
16580 phasedRegistrationNames: {
16581 bubbled: keyOf({ onAnimationIteration: true }),
16582 captured: keyOf({ onAnimationIterationCapture: true })
16586 phasedRegistrationNames: {
16587 bubbled: keyOf({ onAnimationStart: true }),
16588 captured: keyOf({ onAnimationStartCapture: true })
16592 phasedRegistrationNames: {
16593 bubbled: keyOf({ onBlur: true }),
16594 captured: keyOf({ onBlurCapture: true })
16598 phasedRegistrationNames: {
16599 bubbled: keyOf({ onCanPlay: true }),
16600 captured: keyOf({ onCanPlayCapture: true })
16604 phasedRegistrationNames: {
16605 bubbled: keyOf({ onCanPlayThrough: true }),
16606 captured: keyOf({ onCanPlayThroughCapture: true })
16610 phasedRegistrationNames: {
16611 bubbled: keyOf({ onClick: true }),
16612 captured: keyOf({ onClickCapture: true })
16616 phasedRegistrationNames: {
16617 bubbled: keyOf({ onContextMenu: true }),
16618 captured: keyOf({ onContextMenuCapture: true })
16622 phasedRegistrationNames: {
16623 bubbled: keyOf({ onCopy: true }),
16624 captured: keyOf({ onCopyCapture: true })
16628 phasedRegistrationNames: {
16629 bubbled: keyOf({ onCut: true }),
16630 captured: keyOf({ onCutCapture: true })
16634 phasedRegistrationNames: {
16635 bubbled: keyOf({ onDoubleClick: true }),
16636 captured: keyOf({ onDoubleClickCapture: true })
16640 phasedRegistrationNames: {
16641 bubbled: keyOf({ onDrag: true }),
16642 captured: keyOf({ onDragCapture: true })
16646 phasedRegistrationNames: {
16647 bubbled: keyOf({ onDragEnd: true }),
16648 captured: keyOf({ onDragEndCapture: true })
16652 phasedRegistrationNames: {
16653 bubbled: keyOf({ onDragEnter: true }),
16654 captured: keyOf({ onDragEnterCapture: true })
16658 phasedRegistrationNames: {
16659 bubbled: keyOf({ onDragExit: true }),
16660 captured: keyOf({ onDragExitCapture: true })
16664 phasedRegistrationNames: {
16665 bubbled: keyOf({ onDragLeave: true }),
16666 captured: keyOf({ onDragLeaveCapture: true })
16670 phasedRegistrationNames: {
16671 bubbled: keyOf({ onDragOver: true }),
16672 captured: keyOf({ onDragOverCapture: true })
16676 phasedRegistrationNames: {
16677 bubbled: keyOf({ onDragStart: true }),
16678 captured: keyOf({ onDragStartCapture: true })
16682 phasedRegistrationNames: {
16683 bubbled: keyOf({ onDrop: true }),
16684 captured: keyOf({ onDropCapture: true })
16688 phasedRegistrationNames: {
16689 bubbled: keyOf({ onDurationChange: true }),
16690 captured: keyOf({ onDurationChangeCapture: true })
16694 phasedRegistrationNames: {
16695 bubbled: keyOf({ onEmptied: true }),
16696 captured: keyOf({ onEmptiedCapture: true })
16700 phasedRegistrationNames: {
16701 bubbled: keyOf({ onEncrypted: true }),
16702 captured: keyOf({ onEncryptedCapture: true })
16706 phasedRegistrationNames: {
16707 bubbled: keyOf({ onEnded: true }),
16708 captured: keyOf({ onEndedCapture: true })
16712 phasedRegistrationNames: {
16713 bubbled: keyOf({ onError: true }),
16714 captured: keyOf({ onErrorCapture: true })
16718 phasedRegistrationNames: {
16719 bubbled: keyOf({ onFocus: true }),
16720 captured: keyOf({ onFocusCapture: true })
16724 phasedRegistrationNames: {
16725 bubbled: keyOf({ onInput: true }),
16726 captured: keyOf({ onInputCapture: true })
16730 phasedRegistrationNames: {
16731 bubbled: keyOf({ onInvalid: true }),
16732 captured: keyOf({ onInvalidCapture: true })
16736 phasedRegistrationNames: {
16737 bubbled: keyOf({ onKeyDown: true }),
16738 captured: keyOf({ onKeyDownCapture: true })
16742 phasedRegistrationNames: {
16743 bubbled: keyOf({ onKeyPress: true }),
16744 captured: keyOf({ onKeyPressCapture: true })
16748 phasedRegistrationNames: {
16749 bubbled: keyOf({ onKeyUp: true }),
16750 captured: keyOf({ onKeyUpCapture: true })
16754 phasedRegistrationNames: {
16755 bubbled: keyOf({ onLoad: true }),
16756 captured: keyOf({ onLoadCapture: true })
16760 phasedRegistrationNames: {
16761 bubbled: keyOf({ onLoadedData: true }),
16762 captured: keyOf({ onLoadedDataCapture: true })
16766 phasedRegistrationNames: {
16767 bubbled: keyOf({ onLoadedMetadata: true }),
16768 captured: keyOf({ onLoadedMetadataCapture: true })
16772 phasedRegistrationNames: {
16773 bubbled: keyOf({ onLoadStart: true }),
16774 captured: keyOf({ onLoadStartCapture: true })
16777 // Note: We do not allow listening to mouseOver events. Instead, use the
16778 // onMouseEnter/onMouseLeave created by `EnterLeaveEventPlugin`.
16780 phasedRegistrationNames: {
16781 bubbled: keyOf({ onMouseDown: true }),
16782 captured: keyOf({ onMouseDownCapture: true })
16786 phasedRegistrationNames: {
16787 bubbled: keyOf({ onMouseMove: true }),
16788 captured: keyOf({ onMouseMoveCapture: true })
16792 phasedRegistrationNames: {
16793 bubbled: keyOf({ onMouseOut: true }),
16794 captured: keyOf({ onMouseOutCapture: true })
16798 phasedRegistrationNames: {
16799 bubbled: keyOf({ onMouseOver: true }),
16800 captured: keyOf({ onMouseOverCapture: true })
16804 phasedRegistrationNames: {
16805 bubbled: keyOf({ onMouseUp: true }),
16806 captured: keyOf({ onMouseUpCapture: true })
16810 phasedRegistrationNames: {
16811 bubbled: keyOf({ onPaste: true }),
16812 captured: keyOf({ onPasteCapture: true })
16816 phasedRegistrationNames: {
16817 bubbled: keyOf({ onPause: true }),
16818 captured: keyOf({ onPauseCapture: true })
16822 phasedRegistrationNames: {
16823 bubbled: keyOf({ onPlay: true }),
16824 captured: keyOf({ onPlayCapture: true })
16828 phasedRegistrationNames: {
16829 bubbled: keyOf({ onPlaying: true }),
16830 captured: keyOf({ onPlayingCapture: true })
16834 phasedRegistrationNames: {
16835 bubbled: keyOf({ onProgress: true }),
16836 captured: keyOf({ onProgressCapture: true })
16840 phasedRegistrationNames: {
16841 bubbled: keyOf({ onRateChange: true }),
16842 captured: keyOf({ onRateChangeCapture: true })
16846 phasedRegistrationNames: {
16847 bubbled: keyOf({ onReset: true }),
16848 captured: keyOf({ onResetCapture: true })
16852 phasedRegistrationNames: {
16853 bubbled: keyOf({ onScroll: true }),
16854 captured: keyOf({ onScrollCapture: true })
16858 phasedRegistrationNames: {
16859 bubbled: keyOf({ onSeeked: true }),
16860 captured: keyOf({ onSeekedCapture: true })
16864 phasedRegistrationNames: {
16865 bubbled: keyOf({ onSeeking: true }),
16866 captured: keyOf({ onSeekingCapture: true })
16870 phasedRegistrationNames: {
16871 bubbled: keyOf({ onStalled: true }),
16872 captured: keyOf({ onStalledCapture: true })
16876 phasedRegistrationNames: {
16877 bubbled: keyOf({ onSubmit: true }),
16878 captured: keyOf({ onSubmitCapture: true })
16882 phasedRegistrationNames: {
16883 bubbled: keyOf({ onSuspend: true }),
16884 captured: keyOf({ onSuspendCapture: true })
16888 phasedRegistrationNames: {
16889 bubbled: keyOf({ onTimeUpdate: true }),
16890 captured: keyOf({ onTimeUpdateCapture: true })
16894 phasedRegistrationNames: {
16895 bubbled: keyOf({ onTouchCancel: true }),
16896 captured: keyOf({ onTouchCancelCapture: true })
16900 phasedRegistrationNames: {
16901 bubbled: keyOf({ onTouchEnd: true }),
16902 captured: keyOf({ onTouchEndCapture: true })
16906 phasedRegistrationNames: {
16907 bubbled: keyOf({ onTouchMove: true }),
16908 captured: keyOf({ onTouchMoveCapture: true })
16912 phasedRegistrationNames: {
16913 bubbled: keyOf({ onTouchStart: true }),
16914 captured: keyOf({ onTouchStartCapture: true })
16918 phasedRegistrationNames: {
16919 bubbled: keyOf({ onTransitionEnd: true }),
16920 captured: keyOf({ onTransitionEndCapture: true })
16924 phasedRegistrationNames: {
16925 bubbled: keyOf({ onVolumeChange: true }),
16926 captured: keyOf({ onVolumeChangeCapture: true })
16930 phasedRegistrationNames: {
16931 bubbled: keyOf({ onWaiting: true }),
16932 captured: keyOf({ onWaitingCapture: true })
16936 phasedRegistrationNames: {
16937 bubbled: keyOf({ onWheel: true }),
16938 captured: keyOf({ onWheelCapture: true })
16943 var topLevelEventsToDispatchConfig = {
16944 topAbort: eventTypes.abort,
16945 topAnimationEnd: eventTypes.animationEnd,
16946 topAnimationIteration: eventTypes.animationIteration,
16947 topAnimationStart: eventTypes.animationStart,
16948 topBlur: eventTypes.blur,
16949 topCanPlay: eventTypes.canPlay,
16950 topCanPlayThrough: eventTypes.canPlayThrough,
16951 topClick: eventTypes.click,
16952 topContextMenu: eventTypes.contextMenu,
16953 topCopy: eventTypes.copy,
16954 topCut: eventTypes.cut,
16955 topDoubleClick: eventTypes.doubleClick,
16956 topDrag: eventTypes.drag,
16957 topDragEnd: eventTypes.dragEnd,
16958 topDragEnter: eventTypes.dragEnter,
16959 topDragExit: eventTypes.dragExit,
16960 topDragLeave: eventTypes.dragLeave,
16961 topDragOver: eventTypes.dragOver,
16962 topDragStart: eventTypes.dragStart,
16963 topDrop: eventTypes.drop,
16964 topDurationChange: eventTypes.durationChange,
16965 topEmptied: eventTypes.emptied,
16966 topEncrypted: eventTypes.encrypted,
16967 topEnded: eventTypes.ended,
16968 topError: eventTypes.error,
16969 topFocus: eventTypes.focus,
16970 topInput: eventTypes.input,
16971 topInvalid: eventTypes.invalid,
16972 topKeyDown: eventTypes.keyDown,
16973 topKeyPress: eventTypes.keyPress,
16974 topKeyUp: eventTypes.keyUp,
16975 topLoad: eventTypes.load,
16976 topLoadedData: eventTypes.loadedData,
16977 topLoadedMetadata: eventTypes.loadedMetadata,
16978 topLoadStart: eventTypes.loadStart,
16979 topMouseDown: eventTypes.mouseDown,
16980 topMouseMove: eventTypes.mouseMove,
16981 topMouseOut: eventTypes.mouseOut,
16982 topMouseOver: eventTypes.mouseOver,
16983 topMouseUp: eventTypes.mouseUp,
16984 topPaste: eventTypes.paste,
16985 topPause: eventTypes.pause,
16986 topPlay: eventTypes.play,
16987 topPlaying: eventTypes.playing,
16988 topProgress: eventTypes.progress,
16989 topRateChange: eventTypes.rateChange,
16990 topReset: eventTypes.reset,
16991 topScroll: eventTypes.scroll,
16992 topSeeked: eventTypes.seeked,
16993 topSeeking: eventTypes.seeking,
16994 topStalled: eventTypes.stalled,
16995 topSubmit: eventTypes.submit,
16996 topSuspend: eventTypes.suspend,
16997 topTimeUpdate: eventTypes.timeUpdate,
16998 topTouchCancel: eventTypes.touchCancel,
16999 topTouchEnd: eventTypes.touchEnd,
17000 topTouchMove: eventTypes.touchMove,
17001 topTouchStart: eventTypes.touchStart,
17002 topTransitionEnd: eventTypes.transitionEnd,
17003 topVolumeChange: eventTypes.volumeChange,
17004 topWaiting: eventTypes.waiting,
17005 topWheel: eventTypes.wheel
17008 for (var type in topLevelEventsToDispatchConfig) {
17009 topLevelEventsToDispatchConfig[type].dependencies = [type];
17012 var ON_CLICK_KEY = keyOf({ onClick: null });
17013 var onClickListeners = {};
17015 var SimpleEventPlugin = {
17017 eventTypes: eventTypes,
17019 extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
17020 var dispatchConfig = topLevelEventsToDispatchConfig[topLevelType];
17021 if (!dispatchConfig) {
17024 var EventConstructor;
17025 switch (topLevelType) {
17026 case topLevelTypes.topAbort:
17027 case topLevelTypes.topCanPlay:
17028 case topLevelTypes.topCanPlayThrough:
17029 case topLevelTypes.topDurationChange:
17030 case topLevelTypes.topEmptied:
17031 case topLevelTypes.topEncrypted:
17032 case topLevelTypes.topEnded:
17033 case topLevelTypes.topError:
17034 case topLevelTypes.topInput:
17035 case topLevelTypes.topInvalid:
17036 case topLevelTypes.topLoad:
17037 case topLevelTypes.topLoadedData:
17038 case topLevelTypes.topLoadedMetadata:
17039 case topLevelTypes.topLoadStart:
17040 case topLevelTypes.topPause:
17041 case topLevelTypes.topPlay:
17042 case topLevelTypes.topPlaying:
17043 case topLevelTypes.topProgress:
17044 case topLevelTypes.topRateChange:
17045 case topLevelTypes.topReset:
17046 case topLevelTypes.topSeeked:
17047 case topLevelTypes.topSeeking:
17048 case topLevelTypes.topStalled:
17049 case topLevelTypes.topSubmit:
17050 case topLevelTypes.topSuspend:
17051 case topLevelTypes.topTimeUpdate:
17052 case topLevelTypes.topVolumeChange:
17053 case topLevelTypes.topWaiting:
17055 // @see http://www.w3.org/TR/html5/index.html#events-0
17056 EventConstructor = SyntheticEvent;
17058 case topLevelTypes.topKeyPress:
17059 // Firefox creates a keypress event for function keys too. This removes
17060 // the unwanted keypress events. Enter is however both printable and
17061 // non-printable. One would expect Tab to be as well (but it isn't).
17062 if (getEventCharCode(nativeEvent) === 0) {
17065 /* falls through */
17066 case topLevelTypes.topKeyDown:
17067 case topLevelTypes.topKeyUp:
17068 EventConstructor = SyntheticKeyboardEvent;
17070 case topLevelTypes.topBlur:
17071 case topLevelTypes.topFocus:
17072 EventConstructor = SyntheticFocusEvent;
17074 case topLevelTypes.topClick:
17075 // Firefox creates a click event on right mouse clicks. This removes the
17076 // unwanted click events.
17077 if (nativeEvent.button === 2) {
17080 /* falls through */
17081 case topLevelTypes.topContextMenu:
17082 case topLevelTypes.topDoubleClick:
17083 case topLevelTypes.topMouseDown:
17084 case topLevelTypes.topMouseMove:
17085 case topLevelTypes.topMouseOut:
17086 case topLevelTypes.topMouseOver:
17087 case topLevelTypes.topMouseUp:
17088 EventConstructor = SyntheticMouseEvent;
17090 case topLevelTypes.topDrag:
17091 case topLevelTypes.topDragEnd:
17092 case topLevelTypes.topDragEnter:
17093 case topLevelTypes.topDragExit:
17094 case topLevelTypes.topDragLeave:
17095 case topLevelTypes.topDragOver:
17096 case topLevelTypes.topDragStart:
17097 case topLevelTypes.topDrop:
17098 EventConstructor = SyntheticDragEvent;
17100 case topLevelTypes.topTouchCancel:
17101 case topLevelTypes.topTouchEnd:
17102 case topLevelTypes.topTouchMove:
17103 case topLevelTypes.topTouchStart:
17104 EventConstructor = SyntheticTouchEvent;
17106 case topLevelTypes.topAnimationEnd:
17107 case topLevelTypes.topAnimationIteration:
17108 case topLevelTypes.topAnimationStart:
17109 EventConstructor = SyntheticAnimationEvent;
17111 case topLevelTypes.topTransitionEnd:
17112 EventConstructor = SyntheticTransitionEvent;
17114 case topLevelTypes.topScroll:
17115 EventConstructor = SyntheticUIEvent;
17117 case topLevelTypes.topWheel:
17118 EventConstructor = SyntheticWheelEvent;
17120 case topLevelTypes.topCopy:
17121 case topLevelTypes.topCut:
17122 case topLevelTypes.topPaste:
17123 EventConstructor = SyntheticClipboardEvent;
17126 !EventConstructor ? "development" !== 'production' ? invariant(false, 'SimpleEventPlugin: Unhandled event type, `%s`.', topLevelType) : invariant(false) : void 0;
17127 var event = EventConstructor.getPooled(dispatchConfig, targetInst, nativeEvent, nativeEventTarget);
17128 EventPropagators.accumulateTwoPhaseDispatches(event);
17132 didPutListener: function (inst, registrationName, listener) {
17133 // Mobile Safari does not fire properly bubble click events on
17134 // non-interactive elements, which means delegated click listeners do not
17135 // fire. The workaround for this bug involves attaching an empty click
17136 // listener on the target node.
17137 if (registrationName === ON_CLICK_KEY) {
17138 var id = inst._rootNodeID;
17139 var node = ReactDOMComponentTree.getNodeFromInstance(inst);
17140 if (!onClickListeners[id]) {
17141 onClickListeners[id] = EventListener.listen(node, 'click', emptyFunction);
17146 willDeleteListener: function (inst, registrationName) {
17147 if (registrationName === ON_CLICK_KEY) {
17148 var id = inst._rootNodeID;
17149 onClickListeners[id].remove();
17150 delete onClickListeners[id];
17156 module.exports = SimpleEventPlugin;
17157 },{"111":111,"112":112,"114":114,"115":115,"116":116,"118":118,"119":119,"120":120,"121":121,"122":122,"123":123,"135":135,"158":158,"16":16,"165":165,"173":173,"177":177,"20":20,"45":45}],111:[function(_dereq_,module,exports){
17159 * Copyright 2013-present, Facebook, Inc.
17160 * All rights reserved.
17162 * This source code is licensed under the BSD-style license found in the
17163 * LICENSE file in the root directory of this source tree. An additional grant
17164 * of patent rights can be found in the PATENTS file in the same directory.
17166 * @providesModule SyntheticAnimationEvent
17171 var SyntheticEvent = _dereq_(115);
17175 * @see http://www.w3.org/TR/css3-animations/#AnimationEvent-interface
17176 * @see https://developer.mozilla.org/en-US/docs/Web/API/AnimationEvent
17178 var AnimationEventInterface = {
17179 animationName: null,
17181 pseudoElement: null
17185 * @param {object} dispatchConfig Configuration used to dispatch this event.
17186 * @param {string} dispatchMarker Marker identifying the event target.
17187 * @param {object} nativeEvent Native browser event.
17188 * @extends {SyntheticEvent}
17190 function SyntheticAnimationEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
17191 return SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
17194 SyntheticEvent.augmentClass(SyntheticAnimationEvent, AnimationEventInterface);
17196 module.exports = SyntheticAnimationEvent;
17197 },{"115":115}],112:[function(_dereq_,module,exports){
17199 * Copyright 2013-present, Facebook, Inc.
17200 * All rights reserved.
17202 * This source code is licensed under the BSD-style license found in the
17203 * LICENSE file in the root directory of this source tree. An additional grant
17204 * of patent rights can be found in the PATENTS file in the same directory.
17206 * @providesModule SyntheticClipboardEvent
17211 var SyntheticEvent = _dereq_(115);
17215 * @see http://www.w3.org/TR/clipboard-apis/
17217 var ClipboardEventInterface = {
17218 clipboardData: function (event) {
17219 return 'clipboardData' in event ? event.clipboardData : window.clipboardData;
17224 * @param {object} dispatchConfig Configuration used to dispatch this event.
17225 * @param {string} dispatchMarker Marker identifying the event target.
17226 * @param {object} nativeEvent Native browser event.
17227 * @extends {SyntheticUIEvent}
17229 function SyntheticClipboardEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
17230 return SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
17233 SyntheticEvent.augmentClass(SyntheticClipboardEvent, ClipboardEventInterface);
17235 module.exports = SyntheticClipboardEvent;
17236 },{"115":115}],113:[function(_dereq_,module,exports){
17238 * Copyright 2013-present, Facebook, Inc.
17239 * All rights reserved.
17241 * This source code is licensed under the BSD-style license found in the
17242 * LICENSE file in the root directory of this source tree. An additional grant
17243 * of patent rights can be found in the PATENTS file in the same directory.
17245 * @providesModule SyntheticCompositionEvent
17250 var SyntheticEvent = _dereq_(115);
17254 * @see http://www.w3.org/TR/DOM-Level-3-Events/#events-compositionevents
17256 var CompositionEventInterface = {
17261 * @param {object} dispatchConfig Configuration used to dispatch this event.
17262 * @param {string} dispatchMarker Marker identifying the event target.
17263 * @param {object} nativeEvent Native browser event.
17264 * @extends {SyntheticUIEvent}
17266 function SyntheticCompositionEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
17267 return SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
17270 SyntheticEvent.augmentClass(SyntheticCompositionEvent, CompositionEventInterface);
17272 module.exports = SyntheticCompositionEvent;
17273 },{"115":115}],114:[function(_dereq_,module,exports){
17275 * Copyright 2013-present, Facebook, Inc.
17276 * All rights reserved.
17278 * This source code is licensed under the BSD-style license found in the
17279 * LICENSE file in the root directory of this source tree. An additional grant
17280 * of patent rights can be found in the PATENTS file in the same directory.
17282 * @providesModule SyntheticDragEvent
17287 var SyntheticMouseEvent = _dereq_(119);
17290 * @interface DragEvent
17291 * @see http://www.w3.org/TR/DOM-Level-3-Events/
17293 var DragEventInterface = {
17298 * @param {object} dispatchConfig Configuration used to dispatch this event.
17299 * @param {string} dispatchMarker Marker identifying the event target.
17300 * @param {object} nativeEvent Native browser event.
17301 * @extends {SyntheticUIEvent}
17303 function SyntheticDragEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
17304 return SyntheticMouseEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
17307 SyntheticMouseEvent.augmentClass(SyntheticDragEvent, DragEventInterface);
17309 module.exports = SyntheticDragEvent;
17310 },{"119":119}],115:[function(_dereq_,module,exports){
17312 * Copyright 2013-present, Facebook, Inc.
17313 * All rights reserved.
17315 * This source code is licensed under the BSD-style license found in the
17316 * LICENSE file in the root directory of this source tree. An additional grant
17317 * of patent rights can be found in the PATENTS file in the same directory.
17319 * @providesModule SyntheticEvent
17324 var _assign = _dereq_(184);
17326 var PooledClass = _dereq_(26);
17328 var emptyFunction = _dereq_(165);
17329 var warning = _dereq_(183);
17331 var didWarnForAddedNewProperty = false;
17332 var isProxySupported = typeof Proxy === 'function';
17334 var shouldBeReleasedProperties = ['dispatchConfig', '_targetInst', 'nativeEvent', 'isDefaultPrevented', 'isPropagationStopped', '_dispatchListeners', '_dispatchInstances'];
17338 * @see http://www.w3.org/TR/DOM-Level-3-Events/
17340 var EventInterface = {
17343 // currentTarget is set when dispatching; no use in copying it here
17344 currentTarget: emptyFunction.thatReturnsNull,
17348 timeStamp: function (event) {
17349 return event.timeStamp || Date.now();
17351 defaultPrevented: null,
17356 * Synthetic events are dispatched by event plugins, typically in response to a
17357 * top-level event delegation handler.
17359 * These systems should generally use pooling to reduce the frequency of garbage
17360 * collection. The system should check `isPersistent` to determine whether the
17361 * event should be released into the pool after being dispatched. Users that
17362 * need a persisted event should invoke `persist`.
17364 * Synthetic events (and subclasses) implement the DOM Level 3 Events API by
17365 * normalizing browser quirks. Subclasses do not necessarily have to implement a
17366 * DOM interface; custom application-specific events can also subclass this.
17368 * @param {object} dispatchConfig Configuration used to dispatch this event.
17369 * @param {*} targetInst Marker identifying the event target.
17370 * @param {object} nativeEvent Native browser event.
17371 * @param {DOMEventTarget} nativeEventTarget Target node.
17373 function SyntheticEvent(dispatchConfig, targetInst, nativeEvent, nativeEventTarget) {
17374 if ("development" !== 'production') {
17375 // these have a getter/setter for warnings
17376 delete this.nativeEvent;
17377 delete this.preventDefault;
17378 delete this.stopPropagation;
17381 this.dispatchConfig = dispatchConfig;
17382 this._targetInst = targetInst;
17383 this.nativeEvent = nativeEvent;
17385 var Interface = this.constructor.Interface;
17386 for (var propName in Interface) {
17387 if (!Interface.hasOwnProperty(propName)) {
17390 if ("development" !== 'production') {
17391 delete this[propName]; // this has a getter/setter for warnings
17393 var normalize = Interface[propName];
17395 this[propName] = normalize(nativeEvent);
17397 if (propName === 'target') {
17398 this.target = nativeEventTarget;
17400 this[propName] = nativeEvent[propName];
17405 var defaultPrevented = nativeEvent.defaultPrevented != null ? nativeEvent.defaultPrevented : nativeEvent.returnValue === false;
17406 if (defaultPrevented) {
17407 this.isDefaultPrevented = emptyFunction.thatReturnsTrue;
17409 this.isDefaultPrevented = emptyFunction.thatReturnsFalse;
17411 this.isPropagationStopped = emptyFunction.thatReturnsFalse;
17415 _assign(SyntheticEvent.prototype, {
17417 preventDefault: function () {
17418 this.defaultPrevented = true;
17419 var event = this.nativeEvent;
17424 if (event.preventDefault) {
17425 event.preventDefault();
17427 event.returnValue = false;
17429 this.isDefaultPrevented = emptyFunction.thatReturnsTrue;
17432 stopPropagation: function () {
17433 var event = this.nativeEvent;
17438 if (event.stopPropagation) {
17439 event.stopPropagation();
17441 event.cancelBubble = true;
17443 this.isPropagationStopped = emptyFunction.thatReturnsTrue;
17447 * We release all dispatched `SyntheticEvent`s after each event loop, adding
17448 * them back into the pool. This allows a way to hold onto a reference that
17449 * won't be added back into the pool.
17451 persist: function () {
17452 this.isPersistent = emptyFunction.thatReturnsTrue;
17456 * Checks if this event should be released back into the pool.
17458 * @return {boolean} True if this should not be released, false otherwise.
17460 isPersistent: emptyFunction.thatReturnsFalse,
17463 * `PooledClass` looks for `destructor` on each instance it releases.
17465 destructor: function () {
17466 var Interface = this.constructor.Interface;
17467 for (var propName in Interface) {
17468 if ("development" !== 'production') {
17469 Object.defineProperty(this, propName, getPooledWarningPropertyDefinition(propName, Interface[propName]));
17471 this[propName] = null;
17474 for (var i = 0; i < shouldBeReleasedProperties.length; i++) {
17475 this[shouldBeReleasedProperties[i]] = null;
17477 if ("development" !== 'production') {
17478 var noop = _dereq_(165);
17479 Object.defineProperty(this, 'nativeEvent', getPooledWarningPropertyDefinition('nativeEvent', null));
17480 Object.defineProperty(this, 'preventDefault', getPooledWarningPropertyDefinition('preventDefault', noop));
17481 Object.defineProperty(this, 'stopPropagation', getPooledWarningPropertyDefinition('stopPropagation', noop));
17487 SyntheticEvent.Interface = EventInterface;
17489 if ("development" !== 'production') {
17490 if (isProxySupported) {
17491 /*eslint-disable no-func-assign */
17492 SyntheticEvent = new Proxy(SyntheticEvent, {
17493 construct: function (target, args) {
17494 return this.apply(target, Object.create(target.prototype), args);
17496 apply: function (constructor, that, args) {
17497 return new Proxy(constructor.apply(that, args), {
17498 set: function (target, prop, value) {
17499 if (prop !== 'isPersistent' && !target.constructor.Interface.hasOwnProperty(prop) && shouldBeReleasedProperties.indexOf(prop) === -1) {
17500 "development" !== 'production' ? warning(didWarnForAddedNewProperty || target.isPersistent(), 'This synthetic event is reused for performance reasons. If you\'re ' + 'seeing this, you\'re adding a new property in the synthetic event object. ' + 'The property is never released. See ' + 'https://fb.me/react-event-pooling for more information.') : void 0;
17501 didWarnForAddedNewProperty = true;
17503 target[prop] = value;
17509 /*eslint-enable no-func-assign */
17513 * Helper to reduce boilerplate when creating subclasses.
17515 * @param {function} Class
17516 * @param {?object} Interface
17518 SyntheticEvent.augmentClass = function (Class, Interface) {
17521 var E = function () {};
17522 E.prototype = Super.prototype;
17523 var prototype = new E();
17525 _assign(prototype, Class.prototype);
17526 Class.prototype = prototype;
17527 Class.prototype.constructor = Class;
17529 Class.Interface = _assign({}, Super.Interface, Interface);
17530 Class.augmentClass = Super.augmentClass;
17532 PooledClass.addPoolingTo(Class, PooledClass.fourArgumentPooler);
17535 PooledClass.addPoolingTo(SyntheticEvent, PooledClass.fourArgumentPooler);
17537 module.exports = SyntheticEvent;
17540 * Helper to nullify syntheticEvent instance properties when destructing
17542 * @param {object} SyntheticEvent
17543 * @param {String} propName
17544 * @return {object} defineProperty object
17546 function getPooledWarningPropertyDefinition(propName, getVal) {
17547 var isFunction = typeof getVal === 'function';
17549 configurable: true,
17554 function set(val) {
17555 var action = isFunction ? 'setting the method' : 'setting the property';
17556 warn(action, 'This is effectively a no-op');
17561 var action = isFunction ? 'accessing the method' : 'accessing the property';
17562 var result = isFunction ? 'This is a no-op function' : 'This is set to null';
17563 warn(action, result);
17567 function warn(action, result) {
17568 var warningCondition = false;
17569 "development" !== 'production' ? warning(warningCondition, 'This synthetic event is reused for performance reasons. If you\'re seeing this, ' + 'you\'re %s `%s` on a released/nullified synthetic event. %s. ' + 'If you must keep the original synthetic event around, use event.persist(). ' + 'See https://fb.me/react-event-pooling for more information.', action, propName, result) : void 0;
17572 },{"165":165,"183":183,"184":184,"26":26}],116:[function(_dereq_,module,exports){
17574 * Copyright 2013-present, Facebook, Inc.
17575 * All rights reserved.
17577 * This source code is licensed under the BSD-style license found in the
17578 * LICENSE file in the root directory of this source tree. An additional grant
17579 * of patent rights can be found in the PATENTS file in the same directory.
17581 * @providesModule SyntheticFocusEvent
17586 var SyntheticUIEvent = _dereq_(122);
17589 * @interface FocusEvent
17590 * @see http://www.w3.org/TR/DOM-Level-3-Events/
17592 var FocusEventInterface = {
17593 relatedTarget: null
17597 * @param {object} dispatchConfig Configuration used to dispatch this event.
17598 * @param {string} dispatchMarker Marker identifying the event target.
17599 * @param {object} nativeEvent Native browser event.
17600 * @extends {SyntheticUIEvent}
17602 function SyntheticFocusEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
17603 return SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
17606 SyntheticUIEvent.augmentClass(SyntheticFocusEvent, FocusEventInterface);
17608 module.exports = SyntheticFocusEvent;
17609 },{"122":122}],117:[function(_dereq_,module,exports){
17611 * Copyright 2013-present, Facebook, Inc.
17612 * All rights reserved.
17614 * This source code is licensed under the BSD-style license found in the
17615 * LICENSE file in the root directory of this source tree. An additional grant
17616 * of patent rights can be found in the PATENTS file in the same directory.
17618 * @providesModule SyntheticInputEvent
17623 var SyntheticEvent = _dereq_(115);
17627 * @see http://www.w3.org/TR/2013/WD-DOM-Level-3-Events-20131105
17628 * /#events-inputevents
17630 var InputEventInterface = {
17635 * @param {object} dispatchConfig Configuration used to dispatch this event.
17636 * @param {string} dispatchMarker Marker identifying the event target.
17637 * @param {object} nativeEvent Native browser event.
17638 * @extends {SyntheticUIEvent}
17640 function SyntheticInputEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
17641 return SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
17644 SyntheticEvent.augmentClass(SyntheticInputEvent, InputEventInterface);
17646 module.exports = SyntheticInputEvent;
17647 },{"115":115}],118:[function(_dereq_,module,exports){
17649 * Copyright 2013-present, Facebook, Inc.
17650 * All rights reserved.
17652 * This source code is licensed under the BSD-style license found in the
17653 * LICENSE file in the root directory of this source tree. An additional grant
17654 * of patent rights can be found in the PATENTS file in the same directory.
17656 * @providesModule SyntheticKeyboardEvent
17661 var SyntheticUIEvent = _dereq_(122);
17663 var getEventCharCode = _dereq_(135);
17664 var getEventKey = _dereq_(136);
17665 var getEventModifierState = _dereq_(137);
17668 * @interface KeyboardEvent
17669 * @see http://www.w3.org/TR/DOM-Level-3-Events/
17671 var KeyboardEventInterface = {
17680 getModifierState: getEventModifierState,
17681 // Legacy Interface
17682 charCode: function (event) {
17683 // `charCode` is the result of a KeyPress event and represents the value of
17684 // the actual printable character.
17686 // KeyPress is deprecated, but its replacement is not yet final and not
17687 // implemented in any major browser. Only KeyPress has charCode.
17688 if (event.type === 'keypress') {
17689 return getEventCharCode(event);
17693 keyCode: function (event) {
17694 // `keyCode` is the result of a KeyDown/Up event and represents the value of
17695 // physical keyboard key.
17697 // The actual meaning of the value depends on the users' keyboard layout
17698 // which cannot be detected. Assuming that it is a US keyboard layout
17699 // provides a surprisingly accurate mapping for US and European users.
17700 // Due to this, it is left to the user to implement at this time.
17701 if (event.type === 'keydown' || event.type === 'keyup') {
17702 return event.keyCode;
17706 which: function (event) {
17707 // `which` is an alias for either `keyCode` or `charCode` depending on the
17708 // type of the event.
17709 if (event.type === 'keypress') {
17710 return getEventCharCode(event);
17712 if (event.type === 'keydown' || event.type === 'keyup') {
17713 return event.keyCode;
17720 * @param {object} dispatchConfig Configuration used to dispatch this event.
17721 * @param {string} dispatchMarker Marker identifying the event target.
17722 * @param {object} nativeEvent Native browser event.
17723 * @extends {SyntheticUIEvent}
17725 function SyntheticKeyboardEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
17726 return SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
17729 SyntheticUIEvent.augmentClass(SyntheticKeyboardEvent, KeyboardEventInterface);
17731 module.exports = SyntheticKeyboardEvent;
17732 },{"122":122,"135":135,"136":136,"137":137}],119:[function(_dereq_,module,exports){
17734 * Copyright 2013-present, Facebook, Inc.
17735 * All rights reserved.
17737 * This source code is licensed under the BSD-style license found in the
17738 * LICENSE file in the root directory of this source tree. An additional grant
17739 * of patent rights can be found in the PATENTS file in the same directory.
17741 * @providesModule SyntheticMouseEvent
17746 var SyntheticUIEvent = _dereq_(122);
17747 var ViewportMetrics = _dereq_(125);
17749 var getEventModifierState = _dereq_(137);
17752 * @interface MouseEvent
17753 * @see http://www.w3.org/TR/DOM-Level-3-Events/
17755 var MouseEventInterface = {
17764 getModifierState: getEventModifierState,
17765 button: function (event) {
17766 // Webkit, Firefox, IE9+
17768 // button: 0 1 2 (standard)
17769 var button = event.button;
17770 if ('which' in event) {
17774 // which: undefined
17776 // button: 1 4 2 (onmouseup)
17777 return button === 2 ? 2 : button === 4 ? 1 : 0;
17780 relatedTarget: function (event) {
17781 return event.relatedTarget || (event.fromElement === event.srcElement ? event.toElement : event.fromElement);
17783 // "Proprietary" Interface.
17784 pageX: function (event) {
17785 return 'pageX' in event ? event.pageX : event.clientX + ViewportMetrics.currentScrollLeft;
17787 pageY: function (event) {
17788 return 'pageY' in event ? event.pageY : event.clientY + ViewportMetrics.currentScrollTop;
17793 * @param {object} dispatchConfig Configuration used to dispatch this event.
17794 * @param {string} dispatchMarker Marker identifying the event target.
17795 * @param {object} nativeEvent Native browser event.
17796 * @extends {SyntheticUIEvent}
17798 function SyntheticMouseEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
17799 return SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
17802 SyntheticUIEvent.augmentClass(SyntheticMouseEvent, MouseEventInterface);
17804 module.exports = SyntheticMouseEvent;
17805 },{"122":122,"125":125,"137":137}],120:[function(_dereq_,module,exports){
17807 * Copyright 2013-present, Facebook, Inc.
17808 * All rights reserved.
17810 * This source code is licensed under the BSD-style license found in the
17811 * LICENSE file in the root directory of this source tree. An additional grant
17812 * of patent rights can be found in the PATENTS file in the same directory.
17814 * @providesModule SyntheticTouchEvent
17819 var SyntheticUIEvent = _dereq_(122);
17821 var getEventModifierState = _dereq_(137);
17824 * @interface TouchEvent
17825 * @see http://www.w3.org/TR/touch-events/
17827 var TouchEventInterface = {
17829 targetTouches: null,
17830 changedTouches: null,
17835 getModifierState: getEventModifierState
17839 * @param {object} dispatchConfig Configuration used to dispatch this event.
17840 * @param {string} dispatchMarker Marker identifying the event target.
17841 * @param {object} nativeEvent Native browser event.
17842 * @extends {SyntheticUIEvent}
17844 function SyntheticTouchEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
17845 return SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
17848 SyntheticUIEvent.augmentClass(SyntheticTouchEvent, TouchEventInterface);
17850 module.exports = SyntheticTouchEvent;
17851 },{"122":122,"137":137}],121:[function(_dereq_,module,exports){
17853 * Copyright 2013-present, Facebook, Inc.
17854 * All rights reserved.
17856 * This source code is licensed under the BSD-style license found in the
17857 * LICENSE file in the root directory of this source tree. An additional grant
17858 * of patent rights can be found in the PATENTS file in the same directory.
17860 * @providesModule SyntheticTransitionEvent
17865 var SyntheticEvent = _dereq_(115);
17869 * @see http://www.w3.org/TR/2009/WD-css3-transitions-20090320/#transition-events-
17870 * @see https://developer.mozilla.org/en-US/docs/Web/API/TransitionEvent
17872 var TransitionEventInterface = {
17873 propertyName: null,
17875 pseudoElement: null
17879 * @param {object} dispatchConfig Configuration used to dispatch this event.
17880 * @param {string} dispatchMarker Marker identifying the event target.
17881 * @param {object} nativeEvent Native browser event.
17882 * @extends {SyntheticEvent}
17884 function SyntheticTransitionEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
17885 return SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
17888 SyntheticEvent.augmentClass(SyntheticTransitionEvent, TransitionEventInterface);
17890 module.exports = SyntheticTransitionEvent;
17891 },{"115":115}],122:[function(_dereq_,module,exports){
17893 * Copyright 2013-present, Facebook, Inc.
17894 * All rights reserved.
17896 * This source code is licensed under the BSD-style license found in the
17897 * LICENSE file in the root directory of this source tree. An additional grant
17898 * of patent rights can be found in the PATENTS file in the same directory.
17900 * @providesModule SyntheticUIEvent
17905 var SyntheticEvent = _dereq_(115);
17907 var getEventTarget = _dereq_(138);
17910 * @interface UIEvent
17911 * @see http://www.w3.org/TR/DOM-Level-3-Events/
17913 var UIEventInterface = {
17914 view: function (event) {
17919 var target = getEventTarget(event);
17920 if (target != null && target.window === target) {
17921 // target is a window object
17925 var doc = target.ownerDocument;
17926 // TODO: Figure out why `ownerDocument` is sometimes undefined in IE8.
17928 return doc.defaultView || doc.parentWindow;
17933 detail: function (event) {
17934 return event.detail || 0;
17939 * @param {object} dispatchConfig Configuration used to dispatch this event.
17940 * @param {string} dispatchMarker Marker identifying the event target.
17941 * @param {object} nativeEvent Native browser event.
17942 * @extends {SyntheticEvent}
17944 function SyntheticUIEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
17945 return SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
17948 SyntheticEvent.augmentClass(SyntheticUIEvent, UIEventInterface);
17950 module.exports = SyntheticUIEvent;
17951 },{"115":115,"138":138}],123:[function(_dereq_,module,exports){
17953 * Copyright 2013-present, Facebook, Inc.
17954 * All rights reserved.
17956 * This source code is licensed under the BSD-style license found in the
17957 * LICENSE file in the root directory of this source tree. An additional grant
17958 * of patent rights can be found in the PATENTS file in the same directory.
17960 * @providesModule SyntheticWheelEvent
17965 var SyntheticMouseEvent = _dereq_(119);
17968 * @interface WheelEvent
17969 * @see http://www.w3.org/TR/DOM-Level-3-Events/
17971 var WheelEventInterface = {
17972 deltaX: function (event) {
17973 return 'deltaX' in event ? event.deltaX :
17974 // Fallback to `wheelDeltaX` for Webkit and normalize (right is positive).
17975 'wheelDeltaX' in event ? -event.wheelDeltaX : 0;
17977 deltaY: function (event) {
17978 return 'deltaY' in event ? event.deltaY :
17979 // Fallback to `wheelDeltaY` for Webkit and normalize (down is positive).
17980 'wheelDeltaY' in event ? -event.wheelDeltaY :
17981 // Fallback to `wheelDelta` for IE<9 and normalize (down is positive).
17982 'wheelDelta' in event ? -event.wheelDelta : 0;
17986 // Browsers without "deltaMode" is reporting in raw wheel delta where one
17987 // notch on the scroll is always +/- 120, roughly equivalent to pixels.
17988 // A good approximation of DOM_DELTA_LINE (1) is 5% of viewport size or
17989 // ~40 pixels, for DOM_DELTA_SCREEN (2) it is 87.5% of viewport size.
17994 * @param {object} dispatchConfig Configuration used to dispatch this event.
17995 * @param {string} dispatchMarker Marker identifying the event target.
17996 * @param {object} nativeEvent Native browser event.
17997 * @extends {SyntheticMouseEvent}
17999 function SyntheticWheelEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
18000 return SyntheticMouseEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
18003 SyntheticMouseEvent.augmentClass(SyntheticWheelEvent, WheelEventInterface);
18005 module.exports = SyntheticWheelEvent;
18006 },{"119":119}],124:[function(_dereq_,module,exports){
18008 * Copyright 2013-present, Facebook, Inc.
18009 * All rights reserved.
18011 * This source code is licensed under the BSD-style license found in the
18012 * LICENSE file in the root directory of this source tree. An additional grant
18013 * of patent rights can be found in the PATENTS file in the same directory.
18015 * @providesModule Transaction
18020 var invariant = _dereq_(173);
18023 * `Transaction` creates a black box that is able to wrap any method such that
18024 * certain invariants are maintained before and after the method is invoked
18025 * (Even if an exception is thrown while invoking the wrapped method). Whoever
18026 * instantiates a transaction can provide enforcers of the invariants at
18027 * creation time. The `Transaction` class itself will supply one additional
18028 * automatic invariant for you - the invariant that any transaction instance
18029 * should not be run while it is already being run. You would typically create a
18030 * single instance of a `Transaction` for reuse multiple times, that potentially
18031 * is used to wrap several different methods. Wrappers are extremely simple -
18032 * they only require implementing two methods.
18035 * wrappers (injected at creation time)
18038 * +-----------------|--------|--------------+
18040 * | +---------------+ | |
18041 * | +--| wrapper1 |---|----+ |
18042 * | | +---------------+ v | |
18043 * | | +-------------+ | |
18044 * | | +----| wrapper2 |--------+ |
18045 * | | | +-------------+ | | |
18047 * | v v v v | wrapper
18048 * | +---+ +---+ +---------+ +---+ +---+ | invariants
18049 * perform(anyMethod) | | | | | | | | | | | | maintained
18050 * +----------------->|-|---|-|---|-->|anyMethod|---|---|-|---|-|-------->
18051 * | | | | | | | | | | | |
18052 * | | | | | | | | | | | |
18053 * | | | | | | | | | | | |
18054 * | +---+ +---+ +---------+ +---+ +---+ |
18055 * | initialize close |
18056 * +-----------------------------------------+
18060 * - Preserving the input selection ranges before/after reconciliation.
18061 * Restoring selection even in the event of an unexpected error.
18062 * - Deactivating events while rearranging the DOM, preventing blurs/focuses,
18063 * while guaranteeing that afterwards, the event system is reactivated.
18064 * - Flushing a queue of collected DOM mutations to the main UI thread after a
18065 * reconciliation takes place in a worker thread.
18066 * - Invoking any collected `componentDidUpdate` callbacks after rendering new
18068 * - (Future use case): Wrapping particular flushes of the `ReactWorker` queue
18069 * to preserve the `scrollTop` (an automatic scroll aware DOM).
18070 * - (Future use case): Layout calculations before and after DOM updates.
18072 * Transactional plugin API:
18073 * - A module that has an `initialize` method that returns any precomputation.
18074 * - and a `close` method that accepts the precomputation. `close` is invoked
18075 * when the wrapped process is completed, or has failed.
18077 * @param {Array<TransactionalWrapper>} transactionWrapper Wrapper modules
18078 * that implement `initialize` and `close`.
18079 * @return {Transaction} Single transaction for reuse in thread.
18081 * @class Transaction
18085 * Sets up this instance so that it is prepared for collecting metrics. Does
18086 * so such that this setup method may be used on an instance that is already
18087 * initialized, in a way that does not consume additional memory upon reuse.
18088 * That can be useful if you decide to make your subclass of this mixin a
18091 reinitializeTransaction: function () {
18092 this.transactionWrappers = this.getTransactionWrappers();
18093 if (this.wrapperInitData) {
18094 this.wrapperInitData.length = 0;
18096 this.wrapperInitData = [];
18098 this._isInTransaction = false;
18101 _isInTransaction: false,
18105 * @return {Array<TransactionWrapper>} Array of transaction wrappers.
18107 getTransactionWrappers: null,
18109 isInTransaction: function () {
18110 return !!this._isInTransaction;
18114 * Executes the function within a safety window. Use this for the top level
18115 * methods that result in large amounts of computation/mutations that would
18116 * need to be safety checked. The optional arguments helps prevent the need
18117 * to bind in many cases.
18119 * @param {function} method Member of scope to call.
18120 * @param {Object} scope Scope to invoke from.
18121 * @param {Object?=} a Argument to pass to the method.
18122 * @param {Object?=} b Argument to pass to the method.
18123 * @param {Object?=} c Argument to pass to the method.
18124 * @param {Object?=} d Argument to pass to the method.
18125 * @param {Object?=} e Argument to pass to the method.
18126 * @param {Object?=} f Argument to pass to the method.
18128 * @return {*} Return value from `method`.
18130 perform: function (method, scope, a, b, c, d, e, f) {
18131 !!this.isInTransaction() ? "development" !== 'production' ? invariant(false, 'Transaction.perform(...): Cannot initialize a transaction when there ' + 'is already an outstanding transaction.') : invariant(false) : void 0;
18135 this._isInTransaction = true;
18136 // Catching errors makes debugging more difficult, so we start with
18137 // errorThrown set to true before setting it to false after calling
18138 // close -- if it's still set to true in the finally block, it means
18139 // one of these calls threw.
18140 errorThrown = true;
18141 this.initializeAll(0);
18142 ret = method.call(scope, a, b, c, d, e, f);
18143 errorThrown = false;
18147 // If `method` throws, prefer to show that stack trace over any thrown
18148 // by invoking `closeAll`.
18153 // Since `method` didn't throw, we don't want to silence the exception
18158 this._isInTransaction = false;
18164 initializeAll: function (startIndex) {
18165 var transactionWrappers = this.transactionWrappers;
18166 for (var i = startIndex; i < transactionWrappers.length; i++) {
18167 var wrapper = transactionWrappers[i];
18169 // Catching errors makes debugging more difficult, so we start with the
18170 // OBSERVED_ERROR state before overwriting it with the real return value
18171 // of initialize -- if it's still set to OBSERVED_ERROR in the finally
18172 // block, it means wrapper.initialize threw.
18173 this.wrapperInitData[i] = Transaction.OBSERVED_ERROR;
18174 this.wrapperInitData[i] = wrapper.initialize ? wrapper.initialize.call(this) : null;
18176 if (this.wrapperInitData[i] === Transaction.OBSERVED_ERROR) {
18177 // The initializer for wrapper i threw an error; initialize the
18178 // remaining wrappers but silence any exceptions from them to ensure
18179 // that the first error is the one to bubble up.
18181 this.initializeAll(i + 1);
18189 * Invokes each of `this.transactionWrappers.close[i]` functions, passing into
18190 * them the respective return values of `this.transactionWrappers.init[i]`
18191 * (`close`rs that correspond to initializers that failed will not be
18194 closeAll: function (startIndex) {
18195 !this.isInTransaction() ? "development" !== 'production' ? invariant(false, 'Transaction.closeAll(): Cannot close transaction when none are open.') : invariant(false) : void 0;
18196 var transactionWrappers = this.transactionWrappers;
18197 for (var i = startIndex; i < transactionWrappers.length; i++) {
18198 var wrapper = transactionWrappers[i];
18199 var initData = this.wrapperInitData[i];
18202 // Catching errors makes debugging more difficult, so we start with
18203 // errorThrown set to true before setting it to false after calling
18204 // close -- if it's still set to true in the finally block, it means
18205 // wrapper.close threw.
18206 errorThrown = true;
18207 if (initData !== Transaction.OBSERVED_ERROR && wrapper.close) {
18208 wrapper.close.call(this, initData);
18210 errorThrown = false;
18213 // The closer for wrapper i threw an error; close the remaining
18214 // wrappers but silence any exceptions from them to ensure that the
18215 // first error is the one to bubble up.
18217 this.closeAll(i + 1);
18222 this.wrapperInitData.length = 0;
18226 var Transaction = {
18231 * Token to look for to determine if an error occurred.
18237 module.exports = Transaction;
18238 },{"173":173}],125:[function(_dereq_,module,exports){
18240 * Copyright 2013-present, Facebook, Inc.
18241 * All rights reserved.
18243 * This source code is licensed under the BSD-style license found in the
18244 * LICENSE file in the root directory of this source tree. An additional grant
18245 * of patent rights can be found in the PATENTS file in the same directory.
18247 * @providesModule ViewportMetrics
18252 var ViewportMetrics = {
18254 currentScrollLeft: 0,
18256 currentScrollTop: 0,
18258 refreshScrollValues: function (scrollPosition) {
18259 ViewportMetrics.currentScrollLeft = scrollPosition.x;
18260 ViewportMetrics.currentScrollTop = scrollPosition.y;
18265 module.exports = ViewportMetrics;
18266 },{}],126:[function(_dereq_,module,exports){
18268 * Copyright 2014-present, Facebook, Inc.
18269 * All rights reserved.
18271 * This source code is licensed under the BSD-style license found in the
18272 * LICENSE file in the root directory of this source tree. An additional grant
18273 * of patent rights can be found in the PATENTS file in the same directory.
18275 * @providesModule accumulateInto
18280 var invariant = _dereq_(173);
18284 * Accumulates items that must not be null or undefined into the first one. This
18285 * is used to conserve memory by avoiding array allocations, and thus sacrifices
18286 * API cleanness. Since `current` can be null before being passed in and not
18287 * null after this function, make sure to assign it back to `current`:
18289 * `a = accumulateInto(a, b);`
18291 * This API should be sparingly used. Try `accumulate` for something cleaner.
18293 * @return {*|array<*>} An accumulation of items.
18296 function accumulateInto(current, next) {
18297 !(next != null) ? "development" !== 'production' ? invariant(false, 'accumulateInto(...): Accumulated items must not be null or undefined.') : invariant(false) : void 0;
18298 if (current == null) {
18302 // Both are not empty. Warning: Never call x.concat(y) when you are not
18303 // certain that x is an Array (x could be a string with concat method).
18304 var currentIsArray = Array.isArray(current);
18305 var nextIsArray = Array.isArray(next);
18307 if (currentIsArray && nextIsArray) {
18308 current.push.apply(current, next);
18312 if (currentIsArray) {
18313 current.push(next);
18318 // A bit too dangerous to mutate `next`.
18319 return [current].concat(next);
18322 return [current, next];
18325 module.exports = accumulateInto;
18326 },{"173":173}],127:[function(_dereq_,module,exports){
18328 * Copyright 2013-present, Facebook, Inc.
18329 * All rights reserved.
18331 * This source code is licensed under the BSD-style license found in the
18332 * LICENSE file in the root directory of this source tree. An additional grant
18333 * of patent rights can be found in the PATENTS file in the same directory.
18335 * @providesModule adler32
18342 // adler32 is not cryptographically strong, and is only used to sanity check that
18343 // markup generated on the server matches the markup generated on the client.
18344 // This implementation (a modified version of the SheetJS version) has been optimized
18345 // for our use case, at the expense of conforming to the adler32 specification
18346 // for non-ascii inputs.
18347 function adler32(data) {
18351 var l = data.length;
18354 var n = Math.min(i + 4096, m);
18355 for (; i < n; i += 4) {
18356 b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));
18361 for (; i < l; i++) {
18362 b += a += data.charCodeAt(i);
18366 return a | b << 16;
18369 module.exports = adler32;
18370 },{}],128:[function(_dereq_,module,exports){
18372 * Copyright 2013-present, Facebook, Inc.
18373 * All rights reserved.
18375 * This source code is licensed under the BSD-style license found in the
18376 * LICENSE file in the root directory of this source tree. An additional grant
18377 * of patent rights can be found in the PATENTS file in the same directory.
18379 * @providesModule canDefineProperty
18384 var canDefineProperty = false;
18385 if ("development" !== 'production') {
18387 Object.defineProperty({}, 'x', { get: function () {} });
18388 canDefineProperty = true;
18390 // IE will fail on defineProperty
18394 module.exports = canDefineProperty;
18395 },{}],129:[function(_dereq_,module,exports){
18397 * Copyright 2013-present, Facebook, Inc.
18398 * All rights reserved.
18400 * This source code is licensed under the BSD-style license found in the
18401 * LICENSE file in the root directory of this source tree. An additional grant
18402 * of patent rights can be found in the PATENTS file in the same directory.
18404 * @providesModule createMicrosoftUnsafeLocalFunction
18407 /* globals MSApp */
18412 * Create a function which has 'unsafe' privileges (required by windows8 apps)
18415 var createMicrosoftUnsafeLocalFunction = function (func) {
18416 if (typeof MSApp !== 'undefined' && MSApp.execUnsafeLocalFunction) {
18417 return function (arg0, arg1, arg2, arg3) {
18418 MSApp.execUnsafeLocalFunction(function () {
18419 return func(arg0, arg1, arg2, arg3);
18427 module.exports = createMicrosoftUnsafeLocalFunction;
18428 },{}],130:[function(_dereq_,module,exports){
18430 * Copyright 2013-present, Facebook, Inc.
18431 * All rights reserved.
18433 * This source code is licensed under the BSD-style license found in the
18434 * LICENSE file in the root directory of this source tree. An additional grant
18435 * of patent rights can be found in the PATENTS file in the same directory.
18437 * @providesModule dangerousStyleValue
18442 var CSSProperty = _dereq_(3);
18443 var warning = _dereq_(183);
18445 var isUnitlessNumber = CSSProperty.isUnitlessNumber;
18446 var styleWarnings = {};
18449 * Convert a value into the proper css writable value. The style name `name`
18450 * should be logical (no hyphens), as specified
18451 * in `CSSProperty.isUnitlessNumber`.
18453 * @param {string} name CSS property name such as `topMargin`.
18454 * @param {*} value CSS property value such as `10px`.
18455 * @param {ReactDOMComponent} component
18456 * @return {string} Normalized style value with dimensions applied.
18458 function dangerousStyleValue(name, value, component) {
18459 // Note that we've removed escapeTextForBrowser() calls here since the
18460 // whole string will be escaped when the attribute is injected into
18461 // the markup. If you provide unsafe user data here they can inject
18462 // arbitrary CSS which may be problematic (I couldn't repro this):
18463 // https://www.owasp.org/index.php/XSS_Filter_Evasion_Cheat_Sheet
18464 // http://www.thespanner.co.uk/2007/11/26/ultimate-xss-css-injection/
18465 // This is not an XSS hole but instead a potential CSS injection issue
18466 // which has lead to a greater discussion about how we're going to
18467 // trust URLs moving forward. See #2115901
18469 var isEmpty = value == null || typeof value === 'boolean' || value === '';
18474 var isNonNumeric = isNaN(value);
18475 if (isNonNumeric || value === 0 || isUnitlessNumber.hasOwnProperty(name) && isUnitlessNumber[name]) {
18476 return '' + value; // cast to string
18479 if (typeof value === 'string') {
18480 if ("development" !== 'production') {
18482 var owner = component._currentElement._owner;
18483 var ownerName = owner ? owner.getName() : null;
18484 if (ownerName && !styleWarnings[ownerName]) {
18485 styleWarnings[ownerName] = {};
18487 var warned = false;
18489 var warnings = styleWarnings[ownerName];
18490 warned = warnings[name];
18492 warnings[name] = true;
18496 "development" !== 'production' ? warning(false, 'a `%s` tag (owner: `%s`) was passed a numeric string value ' + 'for CSS property `%s` (value: `%s`) which will be treated ' + 'as a unitless number in a future version of React.', component._currentElement.type, ownerName || 'unknown', name, value) : void 0;
18500 value = value.trim();
18502 return value + 'px';
18505 module.exports = dangerousStyleValue;
18506 },{"183":183,"3":3}],131:[function(_dereq_,module,exports){
18508 * Copyright 2013-present, Facebook, Inc.
18509 * All rights reserved.
18511 * This source code is licensed under the BSD-style license found in the
18512 * LICENSE file in the root directory of this source tree. An additional grant
18513 * of patent rights can be found in the PATENTS file in the same directory.
18515 * @providesModule escapeTextContentForBrowser
18520 var ESCAPE_LOOKUP = {
18528 var ESCAPE_REGEX = /[&><"']/g;
18530 function escaper(match) {
18531 return ESCAPE_LOOKUP[match];
18535 * Escapes text to prevent scripting attacks.
18537 * @param {*} text Text value to escape.
18538 * @return {string} An escaped string.
18540 function escapeTextContentForBrowser(text) {
18541 return ('' + text).replace(ESCAPE_REGEX, escaper);
18544 module.exports = escapeTextContentForBrowser;
18545 },{}],132:[function(_dereq_,module,exports){
18547 * Copyright 2013-present, Facebook, Inc.
18548 * All rights reserved.
18550 * This source code is licensed under the BSD-style license found in the
18551 * LICENSE file in the root directory of this source tree. An additional grant
18552 * of patent rights can be found in the PATENTS file in the same directory.
18554 * @providesModule findDOMNode
18559 var ReactCurrentOwner = _dereq_(40);
18560 var ReactDOMComponentTree = _dereq_(45);
18561 var ReactInstanceMap = _dereq_(75);
18563 var getNativeComponentFromComposite = _dereq_(140);
18564 var invariant = _dereq_(173);
18565 var warning = _dereq_(183);
18568 * Returns the DOM node rendered by this element.
18570 * See https://facebook.github.io/react/docs/top-level-api.html#reactdom.finddomnode
18572 * @param {ReactComponent|DOMElement} componentOrElement
18573 * @return {?DOMElement} The root node of this element.
18575 function findDOMNode(componentOrElement) {
18576 if ("development" !== 'production') {
18577 var owner = ReactCurrentOwner.current;
18578 if (owner !== null) {
18579 "development" !== 'production' ? warning(owner._warnedAboutRefsInRender, '%s is accessing findDOMNode inside its render(). ' + 'render() should be a pure function of props and state. It should ' + 'never access something that requires stale data from the previous ' + 'render, such as refs. Move this logic to componentDidMount and ' + 'componentDidUpdate instead.', owner.getName() || 'A component') : void 0;
18580 owner._warnedAboutRefsInRender = true;
18583 if (componentOrElement == null) {
18586 if (componentOrElement.nodeType === 1) {
18587 return componentOrElement;
18590 var inst = ReactInstanceMap.get(componentOrElement);
18592 inst = getNativeComponentFromComposite(inst);
18593 return inst ? ReactDOMComponentTree.getNodeFromInstance(inst) : null;
18596 if (typeof componentOrElement.render === 'function') {
18597 !false ? "development" !== 'production' ? invariant(false, 'findDOMNode was called on an unmounted component.') : invariant(false) : void 0;
18599 !false ? "development" !== 'production' ? invariant(false, 'Element appears to be neither ReactComponent nor DOMNode (keys: %s)', Object.keys(componentOrElement)) : invariant(false) : void 0;
18603 module.exports = findDOMNode;
18604 },{"140":140,"173":173,"183":183,"40":40,"45":45,"75":75}],133:[function(_dereq_,module,exports){
18606 * Copyright 2013-present, Facebook, Inc.
18607 * All rights reserved.
18609 * This source code is licensed under the BSD-style license found in the
18610 * LICENSE file in the root directory of this source tree. An additional grant
18611 * of patent rights can be found in the PATENTS file in the same directory.
18613 * @providesModule flattenChildren
18618 var KeyEscapeUtils = _dereq_(23);
18619 var traverseAllChildren = _dereq_(154);
18620 var warning = _dereq_(183);
18623 * @param {function} traverseContext Context passed through traversal.
18624 * @param {?ReactComponent} child React child component.
18625 * @param {!string} name String name of key path to child.
18627 function flattenSingleChildIntoContext(traverseContext, child, name) {
18628 // We found a component instance.
18629 var result = traverseContext;
18630 var keyUnique = result[name] === undefined;
18631 if ("development" !== 'production') {
18632 "development" !== 'production' ? warning(keyUnique, 'flattenChildren(...): Encountered two children with the same key, ' + '`%s`. Child keys must be unique; when two children share a key, only ' + 'the first child will be used.', KeyEscapeUtils.unescape(name)) : void 0;
18634 if (keyUnique && child != null) {
18635 result[name] = child;
18640 * Flattens children that are typically specified as `props.children`. Any null
18641 * children will not be included in the resulting object.
18642 * @return {!object} flattened children keyed by name.
18644 function flattenChildren(children) {
18645 if (children == null) {
18649 traverseAllChildren(children, flattenSingleChildIntoContext, result);
18653 module.exports = flattenChildren;
18654 },{"154":154,"183":183,"23":23}],134:[function(_dereq_,module,exports){
18656 * Copyright 2013-present, Facebook, Inc.
18657 * All rights reserved.
18659 * This source code is licensed under the BSD-style license found in the
18660 * LICENSE file in the root directory of this source tree. An additional grant
18661 * of patent rights can be found in the PATENTS file in the same directory.
18663 * @providesModule forEachAccumulated
18669 * @param {array} arr an "accumulation" of items which is either an Array or
18670 * a single item. Useful when paired with the `accumulate` module. This is a
18671 * simple utility that allows us to reason about a collection of items, but
18672 * handling the case when there is exactly one item (and we do not need to
18673 * allocate an array).
18676 var forEachAccumulated = function (arr, cb, scope) {
18677 if (Array.isArray(arr)) {
18678 arr.forEach(cb, scope);
18680 cb.call(scope, arr);
18684 module.exports = forEachAccumulated;
18685 },{}],135:[function(_dereq_,module,exports){
18687 * Copyright 2013-present, Facebook, Inc.
18688 * All rights reserved.
18690 * This source code is licensed under the BSD-style license found in the
18691 * LICENSE file in the root directory of this source tree. An additional grant
18692 * of patent rights can be found in the PATENTS file in the same directory.
18694 * @providesModule getEventCharCode
18700 * `charCode` represents the actual "character code" and is safe to use with
18701 * `String.fromCharCode`. As such, only keys that correspond to printable
18702 * characters produce a valid `charCode`, the only exception to this is Enter.
18703 * The Tab-key is considered non-printable and does not have a `charCode`,
18704 * presumably because it does not produce a tab-character in browsers.
18706 * @param {object} nativeEvent Native browser event.
18707 * @return {number} Normalized `charCode` property.
18710 function getEventCharCode(nativeEvent) {
18712 var keyCode = nativeEvent.keyCode;
18714 if ('charCode' in nativeEvent) {
18715 charCode = nativeEvent.charCode;
18717 // FF does not set `charCode` for the Enter-key, check against `keyCode`.
18718 if (charCode === 0 && keyCode === 13) {
18722 // IE8 does not implement `charCode`, but `keyCode` has the correct value.
18723 charCode = keyCode;
18726 // Some non-printable keys are reported in `charCode`/`keyCode`, discard them.
18727 // Must not discard the (non-)printable Enter-key.
18728 if (charCode >= 32 || charCode === 13) {
18735 module.exports = getEventCharCode;
18736 },{}],136:[function(_dereq_,module,exports){
18738 * Copyright 2013-present, Facebook, Inc.
18739 * All rights reserved.
18741 * This source code is licensed under the BSD-style license found in the
18742 * LICENSE file in the root directory of this source tree. An additional grant
18743 * of patent rights can be found in the PATENTS file in the same directory.
18745 * @providesModule getEventKey
18750 var getEventCharCode = _dereq_(135);
18753 * Normalization of deprecated HTML5 `key` values
18754 * @see https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent#Key_names
18756 var normalizeKey = {
18759 'Left': 'ArrowLeft',
18761 'Right': 'ArrowRight',
18762 'Down': 'ArrowDown',
18765 'Menu': 'ContextMenu',
18766 'Apps': 'ContextMenu',
18767 'Scroll': 'ScrollLock',
18768 'MozPrintableKey': 'Unidentified'
18772 * Translation from legacy `keyCode` to HTML5 `key`
18773 * Only special keys supported, all others depend on keyboard layout or browser
18774 * @see https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent#Key_names
18776 var translateToKey = {
18798 112: 'F1', 113: 'F2', 114: 'F3', 115: 'F4', 116: 'F5', 117: 'F6',
18799 118: 'F7', 119: 'F8', 120: 'F9', 121: 'F10', 122: 'F11', 123: 'F12',
18806 * @param {object} nativeEvent Native browser event.
18807 * @return {string} Normalized `key` property.
18809 function getEventKey(nativeEvent) {
18810 if (nativeEvent.key) {
18811 // Normalize inconsistent values reported by browsers due to
18812 // implementations of a working draft specification.
18814 // FireFox implements `key` but returns `MozPrintableKey` for all
18815 // printable characters (normalized to `Unidentified`), ignore it.
18816 var key = normalizeKey[nativeEvent.key] || nativeEvent.key;
18817 if (key !== 'Unidentified') {
18822 // Browser does not implement `key`, polyfill as much of it as we can.
18823 if (nativeEvent.type === 'keypress') {
18824 var charCode = getEventCharCode(nativeEvent);
18826 // The enter-key is technically both printable and non-printable and can
18827 // thus be captured by `keypress`, no other non-printable key should.
18828 return charCode === 13 ? 'Enter' : String.fromCharCode(charCode);
18830 if (nativeEvent.type === 'keydown' || nativeEvent.type === 'keyup') {
18831 // While user keyboard layout determines the actual meaning of each
18832 // `keyCode` value, almost all function keys have a universal value.
18833 return translateToKey[nativeEvent.keyCode] || 'Unidentified';
18838 module.exports = getEventKey;
18839 },{"135":135}],137:[function(_dereq_,module,exports){
18841 * Copyright 2013-present, Facebook, Inc.
18842 * All rights reserved.
18844 * This source code is licensed under the BSD-style license found in the
18845 * LICENSE file in the root directory of this source tree. An additional grant
18846 * of patent rights can be found in the PATENTS file in the same directory.
18848 * @providesModule getEventModifierState
18854 * Translation from modifier key to the associated property in the event.
18855 * @see http://www.w3.org/TR/DOM-Level-3-Events/#keys-Modifiers
18858 var modifierKeyToProp = {
18860 'Control': 'ctrlKey',
18862 'Shift': 'shiftKey'
18865 // IE8 does not implement getModifierState so we simply map it to the only
18866 // modifier keys exposed by the event itself, does not support Lock-keys.
18867 // Currently, all major browsers except Chrome seems to support Lock-keys.
18868 function modifierStateGetter(keyArg) {
18869 var syntheticEvent = this;
18870 var nativeEvent = syntheticEvent.nativeEvent;
18871 if (nativeEvent.getModifierState) {
18872 return nativeEvent.getModifierState(keyArg);
18874 var keyProp = modifierKeyToProp[keyArg];
18875 return keyProp ? !!nativeEvent[keyProp] : false;
18878 function getEventModifierState(nativeEvent) {
18879 return modifierStateGetter;
18882 module.exports = getEventModifierState;
18883 },{}],138:[function(_dereq_,module,exports){
18885 * Copyright 2013-present, Facebook, Inc.
18886 * All rights reserved.
18888 * This source code is licensed under the BSD-style license found in the
18889 * LICENSE file in the root directory of this source tree. An additional grant
18890 * of patent rights can be found in the PATENTS file in the same directory.
18892 * @providesModule getEventTarget
18898 * Gets the target node from a native browser event by accounting for
18899 * inconsistencies in browser DOM APIs.
18901 * @param {object} nativeEvent Native browser event.
18902 * @return {DOMEventTarget} Target node.
18905 function getEventTarget(nativeEvent) {
18906 var target = nativeEvent.target || nativeEvent.srcElement || window;
18908 // Normalize SVG <use> element events #4963
18909 if (target.correspondingUseElement) {
18910 target = target.correspondingUseElement;
18913 // Safari may fire events on text nodes (Node.TEXT_NODE is 3).
18914 // @see http://www.quirksmode.org/js/events_properties.html
18915 return target.nodeType === 3 ? target.parentNode : target;
18918 module.exports = getEventTarget;
18919 },{}],139:[function(_dereq_,module,exports){
18921 * Copyright 2013-present, Facebook, Inc.
18922 * All rights reserved.
18924 * This source code is licensed under the BSD-style license found in the
18925 * LICENSE file in the root directory of this source tree. An additional grant
18926 * of patent rights can be found in the PATENTS file in the same directory.
18928 * @providesModule getIteratorFn
18933 /* global Symbol */
18935 var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
18936 var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
18939 * Returns the iterator method function contained on the iterable object.
18941 * Be sure to invoke the function with the iterable as context:
18943 * var iteratorFn = getIteratorFn(myIterable);
18944 * if (iteratorFn) {
18945 * var iterator = iteratorFn.call(myIterable);
18949 * @param {?object} maybeIterable
18950 * @return {?function}
18952 function getIteratorFn(maybeIterable) {
18953 var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
18954 if (typeof iteratorFn === 'function') {
18959 module.exports = getIteratorFn;
18960 },{}],140:[function(_dereq_,module,exports){
18962 * Copyright 2013-present, Facebook, Inc.
18963 * All rights reserved.
18965 * This source code is licensed under the BSD-style license found in the
18966 * LICENSE file in the root directory of this source tree. An additional grant
18967 * of patent rights can be found in the PATENTS file in the same directory.
18969 * @providesModule getNativeComponentFromComposite
18974 var ReactNodeTypes = _dereq_(85);
18976 function getNativeComponentFromComposite(inst) {
18979 while ((type = inst._renderedNodeType) === ReactNodeTypes.COMPOSITE) {
18980 inst = inst._renderedComponent;
18983 if (type === ReactNodeTypes.NATIVE) {
18984 return inst._renderedComponent;
18985 } else if (type === ReactNodeTypes.EMPTY) {
18990 module.exports = getNativeComponentFromComposite;
18991 },{"85":85}],141:[function(_dereq_,module,exports){
18993 * Copyright 2013-present, Facebook, Inc.
18994 * All rights reserved.
18996 * This source code is licensed under the BSD-style license found in the
18997 * LICENSE file in the root directory of this source tree. An additional grant
18998 * of patent rights can be found in the PATENTS file in the same directory.
19000 * @providesModule getNodeForCharacterOffset
19006 * Given any node return the first leaf node without children.
19008 * @param {DOMElement|DOMTextNode} node
19009 * @return {DOMElement|DOMTextNode}
19012 function getLeafNode(node) {
19013 while (node && node.firstChild) {
19014 node = node.firstChild;
19020 * Get the next sibling within a container. This will walk up the
19021 * DOM if a node's siblings have been exhausted.
19023 * @param {DOMElement|DOMTextNode} node
19024 * @return {?DOMElement|DOMTextNode}
19026 function getSiblingNode(node) {
19028 if (node.nextSibling) {
19029 return node.nextSibling;
19031 node = node.parentNode;
19036 * Get object describing the nodes which contain characters at offset.
19038 * @param {DOMElement|DOMTextNode} root
19039 * @param {number} offset
19040 * @return {?object}
19042 function getNodeForCharacterOffset(root, offset) {
19043 var node = getLeafNode(root);
19048 if (node.nodeType === 3) {
19049 nodeEnd = nodeStart + node.textContent.length;
19051 if (nodeStart <= offset && nodeEnd >= offset) {
19054 offset: offset - nodeStart
19058 nodeStart = nodeEnd;
19061 node = getLeafNode(getSiblingNode(node));
19065 module.exports = getNodeForCharacterOffset;
19066 },{}],142:[function(_dereq_,module,exports){
19068 * Copyright 2013-present, Facebook, Inc.
19069 * All rights reserved.
19071 * This source code is licensed under the BSD-style license found in the
19072 * LICENSE file in the root directory of this source tree. An additional grant
19073 * of patent rights can be found in the PATENTS file in the same directory.
19075 * @providesModule getTextContentAccessor
19080 var ExecutionEnvironment = _dereq_(159);
19082 var contentKey = null;
19085 * Gets the key used to access text content on a DOM node.
19087 * @return {?string} Key used to access text content.
19090 function getTextContentAccessor() {
19091 if (!contentKey && ExecutionEnvironment.canUseDOM) {
19092 // Prefer textContent to innerText because many browsers support both but
19093 // SVG <text> elements don't support innerText even when <div> does.
19094 contentKey = 'textContent' in document.documentElement ? 'textContent' : 'innerText';
19099 module.exports = getTextContentAccessor;
19100 },{"159":159}],143:[function(_dereq_,module,exports){
19102 * Copyright 2013-present, Facebook, Inc.
19103 * All rights reserved.
19105 * This source code is licensed under the BSD-style license found in the
19106 * LICENSE file in the root directory of this source tree. An additional grant
19107 * of patent rights can be found in the PATENTS file in the same directory.
19109 * @providesModule getVendorPrefixedEventName
19114 var ExecutionEnvironment = _dereq_(159);
19117 * Generate a mapping of standard vendor prefixes using the defined style property and event name.
19119 * @param {string} styleProp
19120 * @param {string} eventName
19121 * @returns {object}
19123 function makePrefixMap(styleProp, eventName) {
19126 prefixes[styleProp.toLowerCase()] = eventName.toLowerCase();
19127 prefixes['Webkit' + styleProp] = 'webkit' + eventName;
19128 prefixes['Moz' + styleProp] = 'moz' + eventName;
19129 prefixes['ms' + styleProp] = 'MS' + eventName;
19130 prefixes['O' + styleProp] = 'o' + eventName.toLowerCase();
19136 * A list of event names to a configurable list of vendor prefixes.
19138 var vendorPrefixes = {
19139 animationend: makePrefixMap('Animation', 'AnimationEnd'),
19140 animationiteration: makePrefixMap('Animation', 'AnimationIteration'),
19141 animationstart: makePrefixMap('Animation', 'AnimationStart'),
19142 transitionend: makePrefixMap('Transition', 'TransitionEnd')
19146 * Event names that have already been detected and prefixed (if applicable).
19148 var prefixedEventNames = {};
19151 * Element to check for prefixes on.
19156 * Bootstrap if a DOM exists.
19158 if (ExecutionEnvironment.canUseDOM) {
19159 style = document.createElement('div').style;
19161 // On some platforms, in particular some releases of Android 4.x,
19162 // the un-prefixed "animation" and "transition" properties are defined on the
19163 // style object but the events that fire will still be prefixed, so we need
19164 // to check if the un-prefixed events are usable, and if not remove them from the map.
19165 if (!('AnimationEvent' in window)) {
19166 delete vendorPrefixes.animationend.animation;
19167 delete vendorPrefixes.animationiteration.animation;
19168 delete vendorPrefixes.animationstart.animation;
19172 if (!('TransitionEvent' in window)) {
19173 delete vendorPrefixes.transitionend.transition;
19178 * Attempts to determine the correct vendor prefixed event name.
19180 * @param {string} eventName
19181 * @returns {string}
19183 function getVendorPrefixedEventName(eventName) {
19184 if (prefixedEventNames[eventName]) {
19185 return prefixedEventNames[eventName];
19186 } else if (!vendorPrefixes[eventName]) {
19190 var prefixMap = vendorPrefixes[eventName];
19192 for (var styleProp in prefixMap) {
19193 if (prefixMap.hasOwnProperty(styleProp) && styleProp in style) {
19194 return prefixedEventNames[eventName] = prefixMap[styleProp];
19201 module.exports = getVendorPrefixedEventName;
19202 },{"159":159}],144:[function(_dereq_,module,exports){
19204 * Copyright 2013-present, Facebook, Inc.
19205 * All rights reserved.
19207 * This source code is licensed under the BSD-style license found in the
19208 * LICENSE file in the root directory of this source tree. An additional grant
19209 * of patent rights can be found in the PATENTS file in the same directory.
19211 * @providesModule instantiateReactComponent
19216 var _assign = _dereq_(184);
19218 var ReactCompositeComponent = _dereq_(39);
19219 var ReactEmptyComponent = _dereq_(67);
19220 var ReactNativeComponent = _dereq_(83);
19221 var ReactInstrumentation = _dereq_(76);
19223 var invariant = _dereq_(173);
19224 var warning = _dereq_(183);
19226 // To avoid a cyclic dependency, we create the final class in this module
19227 var ReactCompositeComponentWrapper = function (element) {
19228 this.construct(element);
19230 _assign(ReactCompositeComponentWrapper.prototype, ReactCompositeComponent.Mixin, {
19231 _instantiateReactComponent: instantiateReactComponent
19234 function getDeclarationErrorAddendum(owner) {
19236 var name = owner.getName();
19238 return ' Check the render method of `' + name + '`.';
19244 function getDisplayName(instance) {
19245 var element = instance._currentElement;
19246 if (element == null) {
19248 } else if (typeof element === 'string' || typeof element === 'number') {
19250 } else if (typeof element.type === 'string') {
19251 return element.type;
19252 } else if (instance.getName) {
19253 return instance.getName() || 'Unknown';
19255 return element.type.displayName || element.type.name || 'Unknown';
19260 * Check if the type reference is a known internal type. I.e. not a user
19261 * provided composite type.
19263 * @param {function} type
19264 * @return {boolean} Returns true if this is a valid internal type.
19266 function isInternalComponentType(type) {
19267 return typeof type === 'function' && typeof type.prototype !== 'undefined' && typeof type.prototype.mountComponent === 'function' && typeof type.prototype.receiveComponent === 'function';
19270 var nextDebugID = 1;
19273 * Given a ReactNode, create an instance that will actually be mounted.
19275 * @param {ReactNode} node
19276 * @return {object} A new instance of the element's constructor.
19279 function instantiateReactComponent(node) {
19282 var isEmpty = node === null || node === false;
19284 instance = ReactEmptyComponent.create(instantiateReactComponent);
19285 } else if (typeof node === 'object') {
19286 var element = node;
19287 !(element && (typeof element.type === 'function' || typeof element.type === 'string')) ? "development" !== 'production' ? invariant(false, 'Element type is invalid: expected a string (for built-in components) ' + 'or a class/function (for composite components) but got: %s.%s', element.type == null ? element.type : typeof element.type, getDeclarationErrorAddendum(element._owner)) : invariant(false) : void 0;
19289 // Special case string values
19290 if (typeof element.type === 'string') {
19291 instance = ReactNativeComponent.createInternalComponent(element);
19292 } else if (isInternalComponentType(element.type)) {
19293 // This is temporarily available for custom components that are not string
19294 // representations. I.e. ART. Once those are updated to use the string
19295 // representation, we can drop this code path.
19296 instance = new element.type(element);
19298 instance = new ReactCompositeComponentWrapper(element);
19300 } else if (typeof node === 'string' || typeof node === 'number') {
19301 instance = ReactNativeComponent.createInstanceForText(node);
19303 !false ? "development" !== 'production' ? invariant(false, 'Encountered invalid React node of type %s', typeof node) : invariant(false) : void 0;
19306 if ("development" !== 'production') {
19307 "development" !== 'production' ? warning(typeof instance.mountComponent === 'function' && typeof instance.receiveComponent === 'function' && typeof instance.getNativeNode === 'function' && typeof instance.unmountComponent === 'function', 'Only React Components can be mounted.') : void 0;
19310 // These two fields are used by the DOM and ART diffing algorithms
19311 // respectively. Instead of using expandos on components, we should be
19312 // storing the state needed by the diffing algorithms elsewhere.
19313 instance._mountIndex = 0;
19314 instance._mountImage = null;
19316 if ("development" !== 'production') {
19317 instance._isOwnerNecessary = false;
19318 instance._warnedAboutRefsInRender = false;
19321 if ("development" !== 'production') {
19322 var debugID = isEmpty ? 0 : nextDebugID++;
19323 instance._debugID = debugID;
19325 if (debugID !== 0) {
19326 var displayName = getDisplayName(instance);
19327 ReactInstrumentation.debugTool.onSetDisplayName(debugID, displayName);
19328 var owner = node && node._owner;
19330 ReactInstrumentation.debugTool.onSetOwner(debugID, owner._debugID);
19335 // Internal instances should fully constructed at this point, so they should
19336 // not get any new fields added to them at this point.
19337 if ("development" !== 'production') {
19338 if (Object.preventExtensions) {
19339 Object.preventExtensions(instance);
19346 module.exports = instantiateReactComponent;
19347 },{"173":173,"183":183,"184":184,"39":39,"67":67,"76":76,"83":83}],145:[function(_dereq_,module,exports){
19349 * Copyright 2013-present, Facebook, Inc.
19350 * All rights reserved.
19352 * This source code is licensed under the BSD-style license found in the
19353 * LICENSE file in the root directory of this source tree. An additional grant
19354 * of patent rights can be found in the PATENTS file in the same directory.
19356 * @providesModule isEventSupported
19361 var ExecutionEnvironment = _dereq_(159);
19364 if (ExecutionEnvironment.canUseDOM) {
19365 useHasFeature = document.implementation && document.implementation.hasFeature &&
19366 // always returns true in newer browsers as per the standard.
19367 // @see http://dom.spec.whatwg.org/#dom-domimplementation-hasfeature
19368 document.implementation.hasFeature('', '') !== true;
19372 * Checks if an event is supported in the current execution environment.
19374 * NOTE: This will not work correctly for non-generic events such as `change`,
19375 * `reset`, `load`, `error`, and `select`.
19377 * Borrows from Modernizr.
19379 * @param {string} eventNameSuffix Event name, e.g. "click".
19380 * @param {?boolean} capture Check if the capture phase is supported.
19381 * @return {boolean} True if the event is supported.
19383 * @license Modernizr 3.0.0pre (Custom Build) | MIT
19385 function isEventSupported(eventNameSuffix, capture) {
19386 if (!ExecutionEnvironment.canUseDOM || capture && !('addEventListener' in document)) {
19390 var eventName = 'on' + eventNameSuffix;
19391 var isSupported = eventName in document;
19393 if (!isSupported) {
19394 var element = document.createElement('div');
19395 element.setAttribute(eventName, 'return;');
19396 isSupported = typeof element[eventName] === 'function';
19399 if (!isSupported && useHasFeature && eventNameSuffix === 'wheel') {
19400 // This is the only way to test support for the `wheel` event in IE9+.
19401 isSupported = document.implementation.hasFeature('Events.wheel', '3.0');
19404 return isSupported;
19407 module.exports = isEventSupported;
19408 },{"159":159}],146:[function(_dereq_,module,exports){
19410 * Copyright 2013-present, Facebook, Inc.
19411 * All rights reserved.
19413 * This source code is licensed under the BSD-style license found in the
19414 * LICENSE file in the root directory of this source tree. An additional grant
19415 * of patent rights can be found in the PATENTS file in the same directory.
19417 * @providesModule isTextInputElement
19423 * @see http://www.whatwg.org/specs/web-apps/current-work/multipage/the-input-element.html#input-type-attr-summary
19426 var supportedInputTypes = {
19430 'datetime-local': true,
19444 function isTextInputElement(elem) {
19445 var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase();
19446 return nodeName && (nodeName === 'input' && supportedInputTypes[elem.type] || nodeName === 'textarea');
19449 module.exports = isTextInputElement;
19450 },{}],147:[function(_dereq_,module,exports){
19452 * Copyright 2013-present, Facebook, Inc.
19453 * All rights reserved.
19455 * This source code is licensed under the BSD-style license found in the
19456 * LICENSE file in the root directory of this source tree. An additional grant
19457 * of patent rights can be found in the PATENTS file in the same directory.
19459 * @providesModule onlyChild
19463 var ReactElement = _dereq_(65);
19465 var invariant = _dereq_(173);
19468 * Returns the first child in a collection of children and verifies that there
19469 * is only one child in the collection.
19471 * See https://facebook.github.io/react/docs/top-level-api.html#react.children.only
19473 * The current implementation of this function assumes that a single child gets
19474 * passed without a wrapper, but the purpose of this helper function is to
19475 * abstract away the particular structure of children.
19477 * @param {?object} children Child collection structure.
19478 * @return {ReactElement} The first and only `ReactElement` contained in the
19481 function onlyChild(children) {
19482 !ReactElement.isValidElement(children) ? "development" !== 'production' ? invariant(false, 'onlyChild must be passed a children with exactly one child.') : invariant(false) : void 0;
19486 module.exports = onlyChild;
19487 },{"173":173,"65":65}],148:[function(_dereq_,module,exports){
19489 * Copyright 2013-present, Facebook, Inc.
19490 * All rights reserved.
19492 * This source code is licensed under the BSD-style license found in the
19493 * LICENSE file in the root directory of this source tree. An additional grant
19494 * of patent rights can be found in the PATENTS file in the same directory.
19496 * @providesModule quoteAttributeValueForBrowser
19501 var escapeTextContentForBrowser = _dereq_(131);
19504 * Escapes attribute value to prevent scripting attacks.
19506 * @param {*} value Value to escape.
19507 * @return {string} An escaped string.
19509 function quoteAttributeValueForBrowser(value) {
19510 return '"' + escapeTextContentForBrowser(value) + '"';
19513 module.exports = quoteAttributeValueForBrowser;
19514 },{"131":131}],149:[function(_dereq_,module,exports){
19516 * Copyright 2013-present, Facebook, Inc.
19517 * All rights reserved.
19519 * This source code is licensed under the BSD-style license found in the
19520 * LICENSE file in the root directory of this source tree. An additional grant
19521 * of patent rights can be found in the PATENTS file in the same directory.
19523 * @providesModule renderSubtreeIntoContainer
19528 var ReactMount = _dereq_(80);
19530 module.exports = ReactMount.renderSubtreeIntoContainer;
19531 },{"80":80}],150:[function(_dereq_,module,exports){
19533 * Copyright 2013-present, Facebook, Inc.
19534 * All rights reserved.
19536 * This source code is licensed under the BSD-style license found in the
19537 * LICENSE file in the root directory of this source tree. An additional grant
19538 * of patent rights can be found in the PATENTS file in the same directory.
19540 * @providesModule setInnerHTML
19545 var ExecutionEnvironment = _dereq_(159);
19547 var WHITESPACE_TEST = /^[ \r\n\t\f]/;
19548 var NONVISIBLE_TEST = /<(!--|link|noscript|meta|script|style)[ \r\n\t\f\/>]/;
19550 var createMicrosoftUnsafeLocalFunction = _dereq_(129);
19553 * Set the innerHTML property of a node, ensuring that whitespace is preserved
19556 * @param {DOMElement} node
19557 * @param {string} html
19560 var setInnerHTML = createMicrosoftUnsafeLocalFunction(function (node, html) {
19561 node.innerHTML = html;
19564 if (ExecutionEnvironment.canUseDOM) {
19565 // IE8: When updating a just created node with innerHTML only leading
19566 // whitespace is removed. When updating an existing node with innerHTML
19567 // whitespace in root TextNodes is also collapsed.
19568 // @see quirksmode.org/bugreports/archives/2004/11/innerhtml_and_t.html
19570 // Feature detection; only IE8 is known to behave improperly like this.
19571 var testElement = document.createElement('div');
19572 testElement.innerHTML = ' ';
19573 if (testElement.innerHTML === '') {
19574 setInnerHTML = function (node, html) {
19575 // Magic theory: IE8 supposedly differentiates between added and updated
19576 // nodes when processing innerHTML, innerHTML on updated nodes suffers
19577 // from worse whitespace behavior. Re-adding a node like this triggers
19578 // the initial and more favorable whitespace behavior.
19579 // TODO: What to do on a detached node?
19580 if (node.parentNode) {
19581 node.parentNode.replaceChild(node, node);
19584 // We also implement a workaround for non-visible tags disappearing into
19585 // thin air on IE8, this only happens if there is no visible text
19586 // in-front of the non-visible tags. Piggyback on the whitespace fix
19587 // and simply check if any non-visible tags appear in the source.
19588 if (WHITESPACE_TEST.test(html) || html[0] === '<' && NONVISIBLE_TEST.test(html)) {
19589 // Recover leading whitespace by temporarily prepending any character.
19590 // \uFEFF has the potential advantage of being zero-width/invisible.
19591 // UglifyJS drops U+FEFF chars when parsing, so use String.fromCharCode
19592 // in hopes that this is preserved even if "\uFEFF" is transformed to
19593 // the actual Unicode character (by Babel, for example).
19594 // https://github.com/mishoo/UglifyJS2/blob/v2.4.20/lib/parse.js#L216
19595 node.innerHTML = String.fromCharCode(0xFEFF) + html;
19597 // deleteData leaves an empty `TextNode` which offsets the index of all
19598 // children. Definitely want to avoid this.
19599 var textNode = node.firstChild;
19600 if (textNode.data.length === 1) {
19601 node.removeChild(textNode);
19603 textNode.deleteData(0, 1);
19606 node.innerHTML = html;
19610 testElement = null;
19613 module.exports = setInnerHTML;
19614 },{"129":129,"159":159}],151:[function(_dereq_,module,exports){
19616 * Copyright 2013-present, Facebook, Inc.
19617 * All rights reserved.
19619 * This source code is licensed under the BSD-style license found in the
19620 * LICENSE file in the root directory of this source tree. An additional grant
19621 * of patent rights can be found in the PATENTS file in the same directory.
19623 * @providesModule setTextContent
19628 var ExecutionEnvironment = _dereq_(159);
19629 var escapeTextContentForBrowser = _dereq_(131);
19630 var setInnerHTML = _dereq_(150);
19633 * Set the textContent property of a node, ensuring that whitespace is preserved
19634 * even in IE8. innerText is a poor substitute for textContent and, among many
19635 * issues, inserts <br> instead of the literal newline chars. innerHTML behaves
19638 * @param {DOMElement} node
19639 * @param {string} text
19642 var setTextContent = function (node, text) {
19643 node.textContent = text;
19646 if (ExecutionEnvironment.canUseDOM) {
19647 if (!('textContent' in document.documentElement)) {
19648 setTextContent = function (node, text) {
19649 setInnerHTML(node, escapeTextContentForBrowser(text));
19654 module.exports = setTextContent;
19655 },{"131":131,"150":150,"159":159}],152:[function(_dereq_,module,exports){
19657 * Copyright 2013-present, Facebook, Inc.
19658 * All rights reserved.
19660 * This source code is licensed under the BSD-style license found in the
19661 * LICENSE file in the root directory of this source tree. An additional grant
19662 * of patent rights can be found in the PATENTS file in the same directory.
19664 * @providesModule shallowCompare
19669 var shallowEqual = _dereq_(182);
19672 * Does a shallow comparison for props and state.
19673 * See ReactComponentWithPureRenderMixin
19674 * See also https://facebook.github.io/react/docs/shallow-compare.html
19676 function shallowCompare(instance, nextProps, nextState) {
19677 return !shallowEqual(instance.props, nextProps) || !shallowEqual(instance.state, nextState);
19680 module.exports = shallowCompare;
19681 },{"182":182}],153:[function(_dereq_,module,exports){
19683 * Copyright 2013-present, Facebook, Inc.
19684 * All rights reserved.
19686 * This source code is licensed under the BSD-style license found in the
19687 * LICENSE file in the root directory of this source tree. An additional grant
19688 * of patent rights can be found in the PATENTS file in the same directory.
19690 * @providesModule shouldUpdateReactComponent
19696 * Given a `prevElement` and `nextElement`, determines if the existing
19697 * instance should be updated as opposed to being destroyed or replaced by a new
19698 * instance. Both arguments are elements. This ensures that this logic can
19699 * operate on stateless trees without any backing instance.
19701 * @param {?object} prevElement
19702 * @param {?object} nextElement
19703 * @return {boolean} True if the existing instance should be updated.
19707 function shouldUpdateReactComponent(prevElement, nextElement) {
19708 var prevEmpty = prevElement === null || prevElement === false;
19709 var nextEmpty = nextElement === null || nextElement === false;
19710 if (prevEmpty || nextEmpty) {
19711 return prevEmpty === nextEmpty;
19714 var prevType = typeof prevElement;
19715 var nextType = typeof nextElement;
19716 if (prevType === 'string' || prevType === 'number') {
19717 return nextType === 'string' || nextType === 'number';
19719 return nextType === 'object' && prevElement.type === nextElement.type && prevElement.key === nextElement.key;
19723 module.exports = shouldUpdateReactComponent;
19724 },{}],154:[function(_dereq_,module,exports){
19726 * Copyright 2013-present, Facebook, Inc.
19727 * All rights reserved.
19729 * This source code is licensed under the BSD-style license found in the
19730 * LICENSE file in the root directory of this source tree. An additional grant
19731 * of patent rights can be found in the PATENTS file in the same directory.
19733 * @providesModule traverseAllChildren
19738 var ReactCurrentOwner = _dereq_(40);
19739 var ReactElement = _dereq_(65);
19741 var getIteratorFn = _dereq_(139);
19742 var invariant = _dereq_(173);
19743 var KeyEscapeUtils = _dereq_(23);
19744 var warning = _dereq_(183);
19746 var SEPARATOR = '.';
19747 var SUBSEPARATOR = ':';
19750 * TODO: Test that a single child and an array with one item have the same key
19754 var didWarnAboutMaps = false;
19757 * Generate a key string that identifies a component within a set.
19759 * @param {*} component A component that could contain a manual key.
19760 * @param {number} index Index that is used if a manual key is not provided.
19763 function getComponentKey(component, index) {
19764 // Do some typechecking here since we call this blindly. We want to ensure
19765 // that we don't block potential future ES APIs.
19766 if (component && typeof component === 'object' && component.key != null) {
19768 return KeyEscapeUtils.escape(component.key);
19770 // Implicit key determined by the index in the set
19771 return index.toString(36);
19775 * @param {?*} children Children tree container.
19776 * @param {!string} nameSoFar Name of the key path so far.
19777 * @param {!function} callback Callback to invoke with each child found.
19778 * @param {?*} traverseContext Used to pass information throughout the traversal
19780 * @return {!number} The number of children in this subtree.
19782 function traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext) {
19783 var type = typeof children;
19785 if (type === 'undefined' || type === 'boolean') {
19786 // All of the above are perceived as null.
19790 if (children === null || type === 'string' || type === 'number' || ReactElement.isValidElement(children)) {
19791 callback(traverseContext, children,
19792 // If it's the only child, treat the name as if it was wrapped in an array
19793 // so that it's consistent if the number of children grows.
19794 nameSoFar === '' ? SEPARATOR + getComponentKey(children, 0) : nameSoFar);
19800 var subtreeCount = 0; // Count of children found in the current subtree.
19801 var nextNamePrefix = nameSoFar === '' ? SEPARATOR : nameSoFar + SUBSEPARATOR;
19803 if (Array.isArray(children)) {
19804 for (var i = 0; i < children.length; i++) {
19805 child = children[i];
19806 nextName = nextNamePrefix + getComponentKey(child, i);
19807 subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
19810 var iteratorFn = getIteratorFn(children);
19812 var iterator = iteratorFn.call(children);
19814 if (iteratorFn !== children.entries) {
19816 while (!(step = iterator.next()).done) {
19817 child = step.value;
19818 nextName = nextNamePrefix + getComponentKey(child, ii++);
19819 subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
19822 if ("development" !== 'production') {
19823 "development" !== 'production' ? warning(didWarnAboutMaps, 'Using Maps as children is not yet fully supported. It is an ' + 'experimental feature that might be removed. Convert it to a ' + 'sequence / iterable of keyed ReactElements instead.') : void 0;
19824 didWarnAboutMaps = true;
19826 // Iterator will provide entry [k,v] tuples rather than values.
19827 while (!(step = iterator.next()).done) {
19828 var entry = step.value;
19831 nextName = nextNamePrefix + KeyEscapeUtils.escape(entry[0]) + SUBSEPARATOR + getComponentKey(child, 0);
19832 subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
19836 } else if (type === 'object') {
19838 if ("development" !== 'production') {
19839 addendum = ' If you meant to render a collection of children, use an array ' + 'instead or wrap the object using createFragment(object) from the ' + 'React add-ons.';
19840 if (children._isReactElement) {
19841 addendum = ' It looks like you\'re using an element created by a different ' + 'version of React. Make sure to use only one copy of React.';
19843 if (ReactCurrentOwner.current) {
19844 var name = ReactCurrentOwner.current.getName();
19846 addendum += ' Check the render method of `' + name + '`.';
19850 var childrenString = String(children);
19851 !false ? "development" !== 'production' ? invariant(false, 'Objects are not valid as a React child (found: %s).%s', childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString, addendum) : invariant(false) : void 0;
19855 return subtreeCount;
19859 * Traverses children that are typically specified as `props.children`, but
19860 * might also be specified through attributes:
19862 * - `traverseAllChildren(this.props.children, ...)`
19863 * - `traverseAllChildren(this.props.leftPanelChildren, ...)`
19865 * The `traverseContext` is an optional argument that is passed through the
19866 * entire traversal. It can be used to store accumulations or anything else that
19867 * the callback might find relevant.
19869 * @param {?*} children Children tree object.
19870 * @param {!function} callback To invoke upon traversing each child.
19871 * @param {?*} traverseContext Context for traversal.
19872 * @return {!number} The number of children in this subtree.
19874 function traverseAllChildren(children, callback, traverseContext) {
19875 if (children == null) {
19879 return traverseAllChildrenImpl(children, '', callback, traverseContext);
19882 module.exports = traverseAllChildren;
19883 },{"139":139,"173":173,"183":183,"23":23,"40":40,"65":65}],155:[function(_dereq_,module,exports){
19885 * Copyright 2013-present, Facebook, Inc.
19886 * All rights reserved.
19888 * This source code is licensed under the BSD-style license found in the
19889 * LICENSE file in the root directory of this source tree. An additional grant
19890 * of patent rights can be found in the PATENTS file in the same directory.
19892 * @providesModule update
19895 /* global hasOwnProperty:true */
19899 var _assign = _dereq_(184);
19901 var keyOf = _dereq_(177);
19902 var invariant = _dereq_(173);
19903 var hasOwnProperty = {}.hasOwnProperty;
19905 function shallowCopy(x) {
19906 if (Array.isArray(x)) {
19908 } else if (x && typeof x === 'object') {
19909 return _assign(new x.constructor(), x);
19915 var COMMAND_PUSH = keyOf({ $push: null });
19916 var COMMAND_UNSHIFT = keyOf({ $unshift: null });
19917 var COMMAND_SPLICE = keyOf({ $splice: null });
19918 var COMMAND_SET = keyOf({ $set: null });
19919 var COMMAND_MERGE = keyOf({ $merge: null });
19920 var COMMAND_APPLY = keyOf({ $apply: null });
19922 var ALL_COMMANDS_LIST = [COMMAND_PUSH, COMMAND_UNSHIFT, COMMAND_SPLICE, COMMAND_SET, COMMAND_MERGE, COMMAND_APPLY];
19924 var ALL_COMMANDS_SET = {};
19926 ALL_COMMANDS_LIST.forEach(function (command) {
19927 ALL_COMMANDS_SET[command] = true;
19930 function invariantArrayCase(value, spec, command) {
19931 !Array.isArray(value) ? "development" !== 'production' ? invariant(false, 'update(): expected target of %s to be an array; got %s.', command, value) : invariant(false) : void 0;
19932 var specValue = spec[command];
19933 !Array.isArray(specValue) ? "development" !== 'production' ? invariant(false, 'update(): expected spec of %s to be an array; got %s. ' + 'Did you forget to wrap your parameter in an array?', command, specValue) : invariant(false) : void 0;
19937 * Returns a updated shallow copy of an object without mutating the original.
19938 * See https://facebook.github.io/react/docs/update.html for details.
19940 function update(value, spec) {
19941 !(typeof spec === 'object') ? "development" !== 'production' ? invariant(false, 'update(): You provided a key path to update() that did not contain one ' + 'of %s. Did you forget to include {%s: ...}?', ALL_COMMANDS_LIST.join(', '), COMMAND_SET) : invariant(false) : void 0;
19943 if (hasOwnProperty.call(spec, COMMAND_SET)) {
19944 !(Object.keys(spec).length === 1) ? "development" !== 'production' ? invariant(false, 'Cannot have more than one key in an object with %s', COMMAND_SET) : invariant(false) : void 0;
19946 return spec[COMMAND_SET];
19949 var nextValue = shallowCopy(value);
19951 if (hasOwnProperty.call(spec, COMMAND_MERGE)) {
19952 var mergeObj = spec[COMMAND_MERGE];
19953 !(mergeObj && typeof mergeObj === 'object') ? "development" !== 'production' ? invariant(false, 'update(): %s expects a spec of type \'object\'; got %s', COMMAND_MERGE, mergeObj) : invariant(false) : void 0;
19954 !(nextValue && typeof nextValue === 'object') ? "development" !== 'production' ? invariant(false, 'update(): %s expects a target of type \'object\'; got %s', COMMAND_MERGE, nextValue) : invariant(false) : void 0;
19955 _assign(nextValue, spec[COMMAND_MERGE]);
19958 if (hasOwnProperty.call(spec, COMMAND_PUSH)) {
19959 invariantArrayCase(value, spec, COMMAND_PUSH);
19960 spec[COMMAND_PUSH].forEach(function (item) {
19961 nextValue.push(item);
19965 if (hasOwnProperty.call(spec, COMMAND_UNSHIFT)) {
19966 invariantArrayCase(value, spec, COMMAND_UNSHIFT);
19967 spec[COMMAND_UNSHIFT].forEach(function (item) {
19968 nextValue.unshift(item);
19972 if (hasOwnProperty.call(spec, COMMAND_SPLICE)) {
19973 !Array.isArray(value) ? "development" !== 'production' ? invariant(false, 'Expected %s target to be an array; got %s', COMMAND_SPLICE, value) : invariant(false) : void 0;
19974 !Array.isArray(spec[COMMAND_SPLICE]) ? "development" !== 'production' ? invariant(false, 'update(): expected spec of %s to be an array of arrays; got %s. ' + 'Did you forget to wrap your parameters in an array?', COMMAND_SPLICE, spec[COMMAND_SPLICE]) : invariant(false) : void 0;
19975 spec[COMMAND_SPLICE].forEach(function (args) {
19976 !Array.isArray(args) ? "development" !== 'production' ? invariant(false, 'update(): expected spec of %s to be an array of arrays; got %s. ' + 'Did you forget to wrap your parameters in an array?', COMMAND_SPLICE, spec[COMMAND_SPLICE]) : invariant(false) : void 0;
19977 nextValue.splice.apply(nextValue, args);
19981 if (hasOwnProperty.call(spec, COMMAND_APPLY)) {
19982 !(typeof spec[COMMAND_APPLY] === 'function') ? "development" !== 'production' ? invariant(false, 'update(): expected spec of %s to be a function; got %s.', COMMAND_APPLY, spec[COMMAND_APPLY]) : invariant(false) : void 0;
19983 nextValue = spec[COMMAND_APPLY](nextValue);
19986 for (var k in spec) {
19987 if (!(ALL_COMMANDS_SET.hasOwnProperty(k) && ALL_COMMANDS_SET[k])) {
19988 nextValue[k] = update(value[k], spec[k]);
19995 module.exports = update;
19996 },{"173":173,"177":177,"184":184}],156:[function(_dereq_,module,exports){
19998 * Copyright 2015-present, Facebook, Inc.
19999 * All rights reserved.
20001 * This source code is licensed under the BSD-style license found in the
20002 * LICENSE file in the root directory of this source tree. An additional grant
20003 * of patent rights can be found in the PATENTS file in the same directory.
20005 * @providesModule validateDOMNesting
20010 var _assign = _dereq_(184);
20012 var emptyFunction = _dereq_(165);
20013 var warning = _dereq_(183);
20015 var validateDOMNesting = emptyFunction;
20017 if ("development" !== 'production') {
20018 // This validation code was written based on the HTML5 parsing spec:
20019 // https://html.spec.whatwg.org/multipage/syntax.html#has-an-element-in-scope
20021 // Note: this does not catch all invalid nesting, nor does it try to (as it's
20022 // not clear what practical benefit doing so provides); instead, we warn only
20023 // for cases where the parser will give a parse tree differing from what React
20024 // intended. For example, <b><div></div></b> is invalid but we don't warn
20025 // because it still parses correctly; we do warn for other cases like nested
20026 // <p> tags where the beginning of the second element implicitly closes the
20027 // first, causing a confusing mess.
20029 // https://html.spec.whatwg.org/multipage/syntax.html#special
20030 var specialTags = ['address', 'applet', 'area', 'article', 'aside', 'base', 'basefont', 'bgsound', 'blockquote', 'body', 'br', 'button', 'caption', 'center', 'col', 'colgroup', 'dd', 'details', 'dir', 'div', 'dl', 'dt', 'embed', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'frame', 'frameset', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'iframe', 'img', 'input', 'isindex', 'li', 'link', 'listing', 'main', 'marquee', 'menu', 'menuitem', 'meta', 'nav', 'noembed', 'noframes', 'noscript', 'object', 'ol', 'p', 'param', 'plaintext', 'pre', 'script', 'section', 'select', 'source', 'style', 'summary', 'table', 'tbody', 'td', 'template', 'textarea', 'tfoot', 'th', 'thead', 'title', 'tr', 'track', 'ul', 'wbr', 'xmp'];
20032 // https://html.spec.whatwg.org/multipage/syntax.html#has-an-element-in-scope
20033 var inScopeTags = ['applet', 'caption', 'html', 'table', 'td', 'th', 'marquee', 'object', 'template',
20035 // https://html.spec.whatwg.org/multipage/syntax.html#html-integration-point
20036 // TODO: Distinguish by namespace here -- for <title>, including it here
20037 // errs on the side of fewer warnings
20038 'foreignObject', 'desc', 'title'];
20040 // https://html.spec.whatwg.org/multipage/syntax.html#has-an-element-in-button-scope
20041 var buttonScopeTags = inScopeTags.concat(['button']);
20043 // https://html.spec.whatwg.org/multipage/syntax.html#generate-implied-end-tags
20044 var impliedEndTags = ['dd', 'dt', 'li', 'option', 'optgroup', 'p', 'rp', 'rt'];
20046 var emptyAncestorInfo = {
20051 buttonTagInScope: null,
20052 nobrTagInScope: null,
20053 pTagInButtonScope: null,
20055 listItemTagAutoclosing: null,
20056 dlItemTagAutoclosing: null
20059 var updatedAncestorInfo = function (oldInfo, tag, instance) {
20060 var ancestorInfo = _assign({}, oldInfo || emptyAncestorInfo);
20061 var info = { tag: tag, instance: instance };
20063 if (inScopeTags.indexOf(tag) !== -1) {
20064 ancestorInfo.aTagInScope = null;
20065 ancestorInfo.buttonTagInScope = null;
20066 ancestorInfo.nobrTagInScope = null;
20068 if (buttonScopeTags.indexOf(tag) !== -1) {
20069 ancestorInfo.pTagInButtonScope = null;
20072 // See rules for 'li', 'dd', 'dt' start tags in
20073 // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inbody
20074 if (specialTags.indexOf(tag) !== -1 && tag !== 'address' && tag !== 'div' && tag !== 'p') {
20075 ancestorInfo.listItemTagAutoclosing = null;
20076 ancestorInfo.dlItemTagAutoclosing = null;
20079 ancestorInfo.current = info;
20081 if (tag === 'form') {
20082 ancestorInfo.formTag = info;
20085 ancestorInfo.aTagInScope = info;
20087 if (tag === 'button') {
20088 ancestorInfo.buttonTagInScope = info;
20090 if (tag === 'nobr') {
20091 ancestorInfo.nobrTagInScope = info;
20094 ancestorInfo.pTagInButtonScope = info;
20096 if (tag === 'li') {
20097 ancestorInfo.listItemTagAutoclosing = info;
20099 if (tag === 'dd' || tag === 'dt') {
20100 ancestorInfo.dlItemTagAutoclosing = info;
20103 return ancestorInfo;
20109 var isTagValidWithParent = function (tag, parentTag) {
20110 // First, let's check if we're in an unusual parsing mode...
20111 switch (parentTag) {
20112 // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inselect
20114 return tag === 'option' || tag === 'optgroup' || tag === '#text';
20116 return tag === 'option' || tag === '#text';
20117 // Strictly speaking, seeing an <option> doesn't mean we're in a <select>
20120 return tag === '#text';
20122 // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intd
20123 // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-incaption
20124 // No special behavior since these rules fall back to "in body" mode for
20125 // all except special table nodes which cause bad parsing behavior anyway.
20127 // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intr
20129 return tag === 'th' || tag === 'td' || tag === 'style' || tag === 'script' || tag === 'template';
20131 // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intbody
20135 return tag === 'tr' || tag === 'style' || tag === 'script' || tag === 'template';
20137 // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-incolgroup
20139 return tag === 'col' || tag === 'template';
20141 // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intable
20143 return tag === 'caption' || tag === 'colgroup' || tag === 'tbody' || tag === 'tfoot' || tag === 'thead' || tag === 'style' || tag === 'script' || tag === 'template';
20145 // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inhead
20147 return tag === 'base' || tag === 'basefont' || tag === 'bgsound' || tag === 'link' || tag === 'meta' || tag === 'title' || tag === 'noscript' || tag === 'noframes' || tag === 'style' || tag === 'script' || tag === 'template';
20149 // https://html.spec.whatwg.org/multipage/semantics.html#the-html-element
20151 return tag === 'head' || tag === 'body';
20153 return tag === 'html';
20156 // Probably in the "in body" parsing mode, so we outlaw only tag combos
20157 // where the parsing rules cause implicit opens or closes to be added.
20158 // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inbody
20166 return parentTag !== 'h1' && parentTag !== 'h2' && parentTag !== 'h3' && parentTag !== 'h4' && parentTag !== 'h5' && parentTag !== 'h6';
20170 return impliedEndTags.indexOf(parentTag) === -1;
20185 // These tags are only valid with a few parents that have special child
20186 // parsing rules -- if we're down here, then none of those matched and
20187 // so we allow it only if we don't know what the parent is, as all other
20188 // cases are invalid.
20189 return parentTag == null;
20198 var findInvalidAncestorForTag = function (tag, ancestorInfo) {
20240 return ancestorInfo.pTagInButtonScope;
20243 return ancestorInfo.formTag || ancestorInfo.pTagInButtonScope;
20246 return ancestorInfo.listItemTagAutoclosing;
20250 return ancestorInfo.dlItemTagAutoclosing;
20253 return ancestorInfo.buttonTagInScope;
20256 // Spec says something about storing a list of markers, but it sounds
20257 // equivalent to this check.
20258 return ancestorInfo.aTagInScope;
20261 return ancestorInfo.nobrTagInScope;
20268 * Given a ReactCompositeComponent instance, return a list of its recursive
20269 * owners, starting at the root and ending with the instance itself.
20271 var findOwnerStack = function (instance) {
20278 stack.push(instance);
20279 } while (instance = instance._currentElement._owner);
20286 validateDOMNesting = function (childTag, childInstance, ancestorInfo) {
20287 ancestorInfo = ancestorInfo || emptyAncestorInfo;
20288 var parentInfo = ancestorInfo.current;
20289 var parentTag = parentInfo && parentInfo.tag;
20291 var invalidParent = isTagValidWithParent(childTag, parentTag) ? null : parentInfo;
20292 var invalidAncestor = invalidParent ? null : findInvalidAncestorForTag(childTag, ancestorInfo);
20293 var problematic = invalidParent || invalidAncestor;
20296 var ancestorTag = problematic.tag;
20297 var ancestorInstance = problematic.instance;
20299 var childOwner = childInstance && childInstance._currentElement._owner;
20300 var ancestorOwner = ancestorInstance && ancestorInstance._currentElement._owner;
20302 var childOwners = findOwnerStack(childOwner);
20303 var ancestorOwners = findOwnerStack(ancestorOwner);
20305 var minStackLen = Math.min(childOwners.length, ancestorOwners.length);
20308 var deepestCommon = -1;
20309 for (i = 0; i < minStackLen; i++) {
20310 if (childOwners[i] === ancestorOwners[i]) {
20317 var UNKNOWN = '(unknown)';
20318 var childOwnerNames = childOwners.slice(deepestCommon + 1).map(function (inst) {
20319 return inst.getName() || UNKNOWN;
20321 var ancestorOwnerNames = ancestorOwners.slice(deepestCommon + 1).map(function (inst) {
20322 return inst.getName() || UNKNOWN;
20324 var ownerInfo = [].concat(
20325 // If the parent and child instances have a common owner ancestor, start
20326 // with that -- otherwise we just start with the parent's owners.
20327 deepestCommon !== -1 ? childOwners[deepestCommon].getName() || UNKNOWN : [], ancestorOwnerNames, ancestorTag,
20328 // If we're warning about an invalid (non-parent) ancestry, add '...'
20329 invalidAncestor ? ['...'] : [], childOwnerNames, childTag).join(' > ');
20331 var warnKey = !!invalidParent + '|' + childTag + '|' + ancestorTag + '|' + ownerInfo;
20332 if (didWarn[warnKey]) {
20335 didWarn[warnKey] = true;
20337 var tagDisplayName = childTag;
20338 if (childTag !== '#text') {
20339 tagDisplayName = '<' + childTag + '>';
20342 if (invalidParent) {
20344 if (ancestorTag === 'table' && childTag === 'tr') {
20345 info += ' Add a <tbody> to your code to match the DOM tree generated by ' + 'the browser.';
20347 "development" !== 'production' ? warning(false, 'validateDOMNesting(...): %s cannot appear as a child of <%s>. ' + 'See %s.%s', tagDisplayName, ancestorTag, ownerInfo, info) : void 0;
20349 "development" !== 'production' ? warning(false, 'validateDOMNesting(...): %s cannot appear as a descendant of ' + '<%s>. See %s.', tagDisplayName, ancestorTag, ownerInfo) : void 0;
20354 validateDOMNesting.updatedAncestorInfo = updatedAncestorInfo;
20357 validateDOMNesting.isTagValidInContext = function (tag, ancestorInfo) {
20358 ancestorInfo = ancestorInfo || emptyAncestorInfo;
20359 var parentInfo = ancestorInfo.current;
20360 var parentTag = parentInfo && parentInfo.tag;
20361 return isTagValidWithParent(tag, parentTag) && !findInvalidAncestorForTag(tag, ancestorInfo);
20365 module.exports = validateDOMNesting;
20366 },{"165":165,"183":183,"184":184}],157:[function(_dereq_,module,exports){
20370 * Copyright (c) 2013-present, Facebook, Inc.
20371 * All rights reserved.
20373 * This source code is licensed under the BSD-style license found in the
20374 * LICENSE file in the root directory of this source tree. An additional grant
20375 * of patent rights can be found in the PATENTS file in the same directory.
20380 var invariant = _dereq_(173);
20383 * The CSSCore module specifies the API (and implements most of the methods)
20384 * that should be used when dealing with the display of elements (via their
20385 * CSS classes and visibility on screen. It is an API focused on mutating the
20386 * display and not reading it as no logical state should be encoded in the
20387 * display of elements.
20390 /* Slow implementation for browsers that don't natively support .matches() */
20391 function matchesSelector_SLOW(element, selector) {
20392 var root = element;
20393 while (root.parentNode) {
20394 root = root.parentNode;
20397 var all = root.querySelectorAll(selector);
20398 return Array.prototype.indexOf.call(all, element) !== -1;
20404 * Adds the class passed in to the element if it doesn't already have it.
20406 * @param {DOMElement} element the element to set the class on
20407 * @param {string} className the CSS className
20408 * @return {DOMElement} the element passed in
20410 addClass: function (element, className) {
20411 !!/\s/.test(className) ? "development" !== 'production' ? invariant(false, 'CSSCore.addClass takes only a single class name. "%s" contains ' + 'multiple classes.', className) : invariant(false) : void 0;
20414 if (element.classList) {
20415 element.classList.add(className);
20416 } else if (!CSSCore.hasClass(element, className)) {
20417 element.className = element.className + ' ' + className;
20424 * Removes the class passed in from the element
20426 * @param {DOMElement} element the element to set the class on
20427 * @param {string} className the CSS className
20428 * @return {DOMElement} the element passed in
20430 removeClass: function (element, className) {
20431 !!/\s/.test(className) ? "development" !== 'production' ? invariant(false, 'CSSCore.removeClass takes only a single class name. "%s" contains ' + 'multiple classes.', className) : invariant(false) : void 0;
20434 if (element.classList) {
20435 element.classList.remove(className);
20436 } else if (CSSCore.hasClass(element, className)) {
20437 element.className = element.className.replace(new RegExp('(^|\\s)' + className + '(?:\\s|$)', 'g'), '$1').replace(/\s+/g, ' ') // multiple spaces to one
20438 .replace(/^\s*|\s*$/g, ''); // trim the ends
20445 * Helper to add or remove a class from an element based on a condition.
20447 * @param {DOMElement} element the element to set the class on
20448 * @param {string} className the CSS className
20449 * @param {*} bool condition to whether to add or remove the class
20450 * @return {DOMElement} the element passed in
20452 conditionClass: function (element, className, bool) {
20453 return (bool ? CSSCore.addClass : CSSCore.removeClass)(element, className);
20457 * Tests whether the element has the class specified.
20459 * @param {DOMNode|DOMWindow} element the element to check the class on
20460 * @param {string} className the CSS className
20461 * @return {boolean} true if the element has the class, false if not
20463 hasClass: function (element, className) {
20464 !!/\s/.test(className) ? "development" !== 'production' ? invariant(false, 'CSS.hasClass takes only a single class name.') : invariant(false) : void 0;
20465 if (element.classList) {
20466 return !!className && element.classList.contains(className);
20468 return (' ' + element.className + ' ').indexOf(' ' + className + ' ') > -1;
20472 * Tests whether the element matches the selector specified
20474 * @param {DOMNode|DOMWindow} element the element that we are querying
20475 * @param {string} selector the CSS selector
20476 * @return {boolean} true if the element matches the selector, false if not
20478 matchesSelector: function (element, selector) {
20479 var matchesImpl = element.matches || element.webkitMatchesSelector || element.mozMatchesSelector || element.msMatchesSelector || function (s) {
20480 return matchesSelector_SLOW(element, s);
20482 return matchesImpl.call(element, selector);
20487 module.exports = CSSCore;
20488 },{"173":173}],158:[function(_dereq_,module,exports){
20492 * Copyright (c) 2013-present, Facebook, Inc.
20494 * Licensed under the Apache License, Version 2.0 (the "License");
20495 * you may not use this file except in compliance with the License.
20496 * You may obtain a copy of the License at
20498 * http://www.apache.org/licenses/LICENSE-2.0
20500 * Unless required by applicable law or agreed to in writing, software
20501 * distributed under the License is distributed on an "AS IS" BASIS,
20502 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20503 * See the License for the specific language governing permissions and
20504 * limitations under the License.
20509 var emptyFunction = _dereq_(165);
20512 * Upstream version of event listener. Does not take into account specific
20513 * nature of platform.
20515 var EventListener = {
20517 * Listen to DOM events during the bubble phase.
20519 * @param {DOMEventTarget} target DOM element to register listener on.
20520 * @param {string} eventType Event type, e.g. 'click' or 'mouseover'.
20521 * @param {function} callback Callback function.
20522 * @return {object} Object with a `remove` method.
20524 listen: function (target, eventType, callback) {
20525 if (target.addEventListener) {
20526 target.addEventListener(eventType, callback, false);
20528 remove: function () {
20529 target.removeEventListener(eventType, callback, false);
20532 } else if (target.attachEvent) {
20533 target.attachEvent('on' + eventType, callback);
20535 remove: function () {
20536 target.detachEvent('on' + eventType, callback);
20543 * Listen to DOM events during the capture phase.
20545 * @param {DOMEventTarget} target DOM element to register listener on.
20546 * @param {string} eventType Event type, e.g. 'click' or 'mouseover'.
20547 * @param {function} callback Callback function.
20548 * @return {object} Object with a `remove` method.
20550 capture: function (target, eventType, callback) {
20551 if (target.addEventListener) {
20552 target.addEventListener(eventType, callback, true);
20554 remove: function () {
20555 target.removeEventListener(eventType, callback, true);
20559 if ("development" !== 'production') {
20560 console.error('Attempted to listen to events during the capture phase on a ' + 'browser that does not support the capture phase. Your application ' + 'will not receive some events.');
20563 remove: emptyFunction
20568 registerDefault: function () {}
20571 module.exports = EventListener;
20572 },{"165":165}],159:[function(_dereq_,module,exports){
20574 * Copyright (c) 2013-present, Facebook, Inc.
20575 * All rights reserved.
20577 * This source code is licensed under the BSD-style license found in the
20578 * LICENSE file in the root directory of this source tree. An additional grant
20579 * of patent rights can be found in the PATENTS file in the same directory.
20585 var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);
20588 * Simple, lightweight module assisting with the detection and context of
20589 * Worker. Helps avoid circular dependencies and allows code to reason about
20590 * whether or not they are in a Worker, even if they never include the main
20591 * `ReactWorker` dependency.
20593 var ExecutionEnvironment = {
20595 canUseDOM: canUseDOM,
20597 canUseWorkers: typeof Worker !== 'undefined',
20599 canUseEventListeners: canUseDOM && !!(window.addEventListener || window.attachEvent),
20601 canUseViewport: canUseDOM && !!window.screen,
20603 isInWorker: !canUseDOM // For now, this is true - might change in the future.
20607 module.exports = ExecutionEnvironment;
20608 },{}],160:[function(_dereq_,module,exports){
20612 * Copyright (c) 2013-present, Facebook, Inc.
20613 * All rights reserved.
20615 * This source code is licensed under the BSD-style license found in the
20616 * LICENSE file in the root directory of this source tree. An additional grant
20617 * of patent rights can be found in the PATENTS file in the same directory.
20622 var _hyphenPattern = /-(.)/g;
20625 * Camelcases a hyphenated string, for example:
20627 * > camelize('background-color')
20628 * < "backgroundColor"
20630 * @param {string} string
20633 function camelize(string) {
20634 return string.replace(_hyphenPattern, function (_, character) {
20635 return character.toUpperCase();
20639 module.exports = camelize;
20640 },{}],161:[function(_dereq_,module,exports){
20642 * Copyright (c) 2013-present, Facebook, Inc.
20643 * All rights reserved.
20645 * This source code is licensed under the BSD-style license found in the
20646 * LICENSE file in the root directory of this source tree. An additional grant
20647 * of patent rights can be found in the PATENTS file in the same directory.
20654 var camelize = _dereq_(160);
20656 var msPattern = /^-ms-/;
20659 * Camelcases a hyphenated CSS property name, for example:
20661 * > camelizeStyleName('background-color')
20662 * < "backgroundColor"
20663 * > camelizeStyleName('-moz-transition')
20664 * < "MozTransition"
20665 * > camelizeStyleName('-ms-transition')
20668 * As Andi Smith suggests
20669 * (http://www.andismith.com/blog/2012/02/modernizr-prefixed/), an `-ms` prefix
20670 * is converted to lowercase `ms`.
20672 * @param {string} string
20675 function camelizeStyleName(string) {
20676 return camelize(string.replace(msPattern, 'ms-'));
20679 module.exports = camelizeStyleName;
20680 },{"160":160}],162:[function(_dereq_,module,exports){
20684 * Copyright (c) 2013-present, Facebook, Inc.
20685 * All rights reserved.
20687 * This source code is licensed under the BSD-style license found in the
20688 * LICENSE file in the root directory of this source tree. An additional grant
20689 * of patent rights can be found in the PATENTS file in the same directory.
20694 var isTextNode = _dereq_(175);
20696 /*eslint-disable no-bitwise */
20699 * Checks if a given DOM node contains or is another DOM node.
20701 * @param {?DOMNode} outerNode Outer DOM node.
20702 * @param {?DOMNode} innerNode Inner DOM node.
20703 * @return {boolean} True if `outerNode` contains or is `innerNode`.
20705 function containsNode(outerNode, innerNode) {
20706 if (!outerNode || !innerNode) {
20708 } else if (outerNode === innerNode) {
20710 } else if (isTextNode(outerNode)) {
20712 } else if (isTextNode(innerNode)) {
20713 return containsNode(outerNode, innerNode.parentNode);
20714 } else if (outerNode.contains) {
20715 return outerNode.contains(innerNode);
20716 } else if (outerNode.compareDocumentPosition) {
20717 return !!(outerNode.compareDocumentPosition(innerNode) & 16);
20723 module.exports = containsNode;
20724 },{"175":175}],163:[function(_dereq_,module,exports){
20728 * Copyright (c) 2013-present, Facebook, Inc.
20729 * All rights reserved.
20731 * This source code is licensed under the BSD-style license found in the
20732 * LICENSE file in the root directory of this source tree. An additional grant
20733 * of patent rights can be found in the PATENTS file in the same directory.
20738 var invariant = _dereq_(173);
20741 * Convert array-like objects to arrays.
20743 * This API assumes the caller knows the contents of the data type. For less
20744 * well defined inputs use createArrayFromMixed.
20746 * @param {object|function|filelist} obj
20749 function toArray(obj) {
20750 var length = obj.length;
20752 // Some browsers builtin objects can report typeof 'function' (e.g. NodeList
20753 // in old versions of Safari).
20754 !(!Array.isArray(obj) && (typeof obj === 'object' || typeof obj === 'function')) ? "development" !== 'production' ? invariant(false, 'toArray: Array-like object expected') : invariant(false) : void 0;
20756 !(typeof length === 'number') ? "development" !== 'production' ? invariant(false, 'toArray: Object needs a length property') : invariant(false) : void 0;
20758 !(length === 0 || length - 1 in obj) ? "development" !== 'production' ? invariant(false, 'toArray: Object should have keys for indices') : invariant(false) : void 0;
20760 !(typeof obj.callee !== 'function') ? "development" !== 'production' ? invariant(false, 'toArray: Object can\'t be `arguments`. Use rest params ' + '(function(...args) {}) or Array.from() instead.') : invariant(false) : void 0;
20762 // Old IE doesn't give collections access to hasOwnProperty. Assume inputs
20763 // without method will throw during the slice call and skip straight to the
20765 if (obj.hasOwnProperty) {
20767 return Array.prototype.slice.call(obj);
20769 // IE < 9 does not support Array#slice on collections objects
20773 // Fall back to copying key by key. This assumes all keys have a value,
20774 // so will not preserve sparsely populated inputs.
20775 var ret = Array(length);
20776 for (var ii = 0; ii < length; ii++) {
20783 * Perform a heuristic test to determine if an object is "array-like".
20785 * A monk asked Joshu, a Zen master, "Has a dog Buddha nature?"
20786 * Joshu replied: "Mu."
20788 * This function determines if its argument has "array nature": it returns
20789 * true if the argument is an actual array, an `arguments' object, or an
20790 * HTMLCollection (e.g. node.childNodes or node.getElementsByTagName()).
20792 * It will return false for other array-like objects like Filelist.
20795 * @return {boolean}
20797 function hasArrayNature(obj) {
20801 // arrays are objects, NodeLists are functions in Safari
20802 typeof obj == 'object' || typeof obj == 'function') &&
20803 // quacks like an array
20806 !('setInterval' in obj) &&
20807 // no DOM node should be considered an array-like
20808 // a 'select' element has 'length' and 'item' properties on IE8
20809 typeof obj.nodeType != 'number' && (
20811 Array.isArray(obj) ||
20814 // HTMLCollection/NodeList
20820 * Ensure that the argument is an array by wrapping it in an array if it is not.
20821 * Creates a copy of the argument if it is already an array.
20823 * This is mostly useful idiomatically:
20825 * var createArrayFromMixed = require('createArrayFromMixed');
20827 * function takesOneOrMoreThings(things) {
20828 * things = createArrayFromMixed(things);
20832 * This allows you to treat `things' as an array, but accept scalars in the API.
20834 * If you need to convert an array-like object, like `arguments`, into an array
20835 * use toArray instead.
20840 function createArrayFromMixed(obj) {
20841 if (!hasArrayNature(obj)) {
20843 } else if (Array.isArray(obj)) {
20844 return obj.slice();
20846 return toArray(obj);
20850 module.exports = createArrayFromMixed;
20851 },{"173":173}],164:[function(_dereq_,module,exports){
20855 * Copyright (c) 2013-present, Facebook, Inc.
20856 * All rights reserved.
20858 * This source code is licensed under the BSD-style license found in the
20859 * LICENSE file in the root directory of this source tree. An additional grant
20860 * of patent rights can be found in the PATENTS file in the same directory.
20865 /*eslint-disable fb-www/unsafe-html*/
20867 var ExecutionEnvironment = _dereq_(159);
20869 var createArrayFromMixed = _dereq_(163);
20870 var getMarkupWrap = _dereq_(169);
20871 var invariant = _dereq_(173);
20874 * Dummy container used to render all markup.
20876 var dummyNode = ExecutionEnvironment.canUseDOM ? document.createElement('div') : null;
20879 * Pattern used by `getNodeName`.
20881 var nodeNamePattern = /^\s*<(\w+)/;
20884 * Extracts the `nodeName` of the first element in a string of markup.
20886 * @param {string} markup String of markup.
20887 * @return {?string} Node name of the supplied markup.
20889 function getNodeName(markup) {
20890 var nodeNameMatch = markup.match(nodeNamePattern);
20891 return nodeNameMatch && nodeNameMatch[1].toLowerCase();
20895 * Creates an array containing the nodes rendered from the supplied markup. The
20896 * optionally supplied `handleScript` function will be invoked once for each
20897 * <script> element that is rendered. If no `handleScript` function is supplied,
20898 * an exception is thrown if any <script> elements are rendered.
20900 * @param {string} markup A string of valid HTML markup.
20901 * @param {?function} handleScript Invoked once for each rendered <script>.
20902 * @return {array<DOMElement|DOMTextNode>} An array of rendered nodes.
20904 function createNodesFromMarkup(markup, handleScript) {
20905 var node = dummyNode;
20906 !!!dummyNode ? "development" !== 'production' ? invariant(false, 'createNodesFromMarkup dummy not initialized') : invariant(false) : void 0;
20907 var nodeName = getNodeName(markup);
20909 var wrap = nodeName && getMarkupWrap(nodeName);
20911 node.innerHTML = wrap[1] + markup + wrap[2];
20913 var wrapDepth = wrap[0];
20914 while (wrapDepth--) {
20915 node = node.lastChild;
20918 node.innerHTML = markup;
20921 var scripts = node.getElementsByTagName('script');
20922 if (scripts.length) {
20923 !handleScript ? "development" !== 'production' ? invariant(false, 'createNodesFromMarkup(...): Unexpected <script> element rendered.') : invariant(false) : void 0;
20924 createArrayFromMixed(scripts).forEach(handleScript);
20927 var nodes = Array.from(node.childNodes);
20928 while (node.lastChild) {
20929 node.removeChild(node.lastChild);
20934 module.exports = createNodesFromMarkup;
20935 },{"159":159,"163":163,"169":169,"173":173}],165:[function(_dereq_,module,exports){
20939 * Copyright (c) 2013-present, Facebook, Inc.
20940 * All rights reserved.
20942 * This source code is licensed under the BSD-style license found in the
20943 * LICENSE file in the root directory of this source tree. An additional grant
20944 * of patent rights can be found in the PATENTS file in the same directory.
20948 function makeEmptyFunction(arg) {
20949 return function () {
20955 * This function accepts and discards inputs; it has no side effects. This is
20956 * primarily useful idiomatically for overridable function endpoints which
20957 * always need to be callable, since JS lacks a null-call idiom ala Cocoa.
20959 function emptyFunction() {}
20961 emptyFunction.thatReturns = makeEmptyFunction;
20962 emptyFunction.thatReturnsFalse = makeEmptyFunction(false);
20963 emptyFunction.thatReturnsTrue = makeEmptyFunction(true);
20964 emptyFunction.thatReturnsNull = makeEmptyFunction(null);
20965 emptyFunction.thatReturnsThis = function () {
20968 emptyFunction.thatReturnsArgument = function (arg) {
20972 module.exports = emptyFunction;
20973 },{}],166:[function(_dereq_,module,exports){
20975 * Copyright (c) 2013-present, Facebook, Inc.
20976 * All rights reserved.
20978 * This source code is licensed under the BSD-style license found in the
20979 * LICENSE file in the root directory of this source tree. An additional grant
20980 * of patent rights can be found in the PATENTS file in the same directory.
20986 var emptyObject = {};
20988 if ("development" !== 'production') {
20989 Object.freeze(emptyObject);
20992 module.exports = emptyObject;
20993 },{}],167:[function(_dereq_,module,exports){
20995 * Copyright (c) 2013-present, Facebook, Inc.
20996 * All rights reserved.
20998 * This source code is licensed under the BSD-style license found in the
20999 * LICENSE file in the root directory of this source tree. An additional grant
21000 * of patent rights can be found in the PATENTS file in the same directory.
21007 * @param {DOMElement} node input/textarea to focus
21010 function focusNode(node) {
21011 // IE8 can throw "Can't move focus to the control because it is invisible,
21012 // not enabled, or of a type that does not accept the focus." for all kinds of
21013 // reasons that are too expensive and fragile to test.
21019 module.exports = focusNode;
21020 },{}],168:[function(_dereq_,module,exports){
21024 * Copyright (c) 2013-present, Facebook, Inc.
21025 * All rights reserved.
21027 * This source code is licensed under the BSD-style license found in the
21028 * LICENSE file in the root directory of this source tree. An additional grant
21029 * of patent rights can be found in the PATENTS file in the same directory.
21034 /* eslint-disable fb-www/typeof-undefined */
21037 * Same as document.activeElement but wraps in a try-catch block. In IE it is
21038 * not safe to call document.activeElement if there is nothing focused.
21040 * The activeElement will be null only if the document or document body is not
21043 function getActiveElement() /*?DOMElement*/{
21044 if (typeof document === 'undefined') {
21048 return document.activeElement || document.body;
21050 return document.body;
21054 module.exports = getActiveElement;
21055 },{}],169:[function(_dereq_,module,exports){
21059 * Copyright (c) 2013-present, Facebook, Inc.
21060 * All rights reserved.
21062 * This source code is licensed under the BSD-style license found in the
21063 * LICENSE file in the root directory of this source tree. An additional grant
21064 * of patent rights can be found in the PATENTS file in the same directory.
21068 /*eslint-disable fb-www/unsafe-html */
21070 var ExecutionEnvironment = _dereq_(159);
21072 var invariant = _dereq_(173);
21075 * Dummy container used to detect which wraps are necessary.
21077 var dummyNode = ExecutionEnvironment.canUseDOM ? document.createElement('div') : null;
21080 * Some browsers cannot use `innerHTML` to render certain elements standalone,
21081 * so we wrap them, render the wrapped nodes, then extract the desired node.
21083 * In IE8, certain elements cannot render alone, so wrap all elements ('*').
21086 var shouldWrap = {};
21088 var selectWrap = [1, '<select multiple="true">', '</select>'];
21089 var tableWrap = [1, '<table>', '</table>'];
21090 var trWrap = [3, '<table><tbody><tr>', '</tr></tbody></table>'];
21092 var svgWrap = [1, '<svg xmlns="http://www.w3.org/2000/svg">', '</svg>'];
21095 '*': [1, '?<div>', '</div>'],
21097 'area': [1, '<map>', '</map>'],
21098 'col': [2, '<table><tbody></tbody><colgroup>', '</colgroup></table>'],
21099 'legend': [1, '<fieldset>', '</fieldset>'],
21100 'param': [1, '<object>', '</object>'],
21101 'tr': [2, '<table><tbody>', '</tbody></table>'],
21103 'optgroup': selectWrap,
21104 'option': selectWrap,
21106 'caption': tableWrap,
21107 'colgroup': tableWrap,
21108 'tbody': tableWrap,
21109 'tfoot': tableWrap,
21110 'thead': tableWrap,
21116 // Initialize the SVG elements since we know they'll always need to be wrapped
21117 // consistently. If they are created inside a <div> they will be initialized in
21118 // the wrong namespace (and will not display).
21119 var svgElements = ['circle', 'clipPath', 'defs', 'ellipse', 'g', 'image', 'line', 'linearGradient', 'mask', 'path', 'pattern', 'polygon', 'polyline', 'radialGradient', 'rect', 'stop', 'text', 'tspan'];
21120 svgElements.forEach(function (nodeName) {
21121 markupWrap[nodeName] = svgWrap;
21122 shouldWrap[nodeName] = true;
21126 * Gets the markup wrap configuration for the supplied `nodeName`.
21128 * NOTE: This lazily detects which wraps are necessary for the current browser.
21130 * @param {string} nodeName Lowercase `nodeName`.
21131 * @return {?array} Markup wrap configuration, if applicable.
21133 function getMarkupWrap(nodeName) {
21134 !!!dummyNode ? "development" !== 'production' ? invariant(false, 'Markup wrapping node not initialized') : invariant(false) : void 0;
21135 if (!markupWrap.hasOwnProperty(nodeName)) {
21138 if (!shouldWrap.hasOwnProperty(nodeName)) {
21139 if (nodeName === '*') {
21140 dummyNode.innerHTML = '<link />';
21142 dummyNode.innerHTML = '<' + nodeName + '></' + nodeName + '>';
21144 shouldWrap[nodeName] = !dummyNode.firstChild;
21146 return shouldWrap[nodeName] ? markupWrap[nodeName] : null;
21149 module.exports = getMarkupWrap;
21150 },{"159":159,"173":173}],170:[function(_dereq_,module,exports){
21152 * Copyright (c) 2013-present, Facebook, Inc.
21153 * All rights reserved.
21155 * This source code is licensed under the BSD-style license found in the
21156 * LICENSE file in the root directory of this source tree. An additional grant
21157 * of patent rights can be found in the PATENTS file in the same directory.
21165 * Gets the scroll position of the supplied element or window.
21167 * The return values are unbounded, unlike `getScrollPosition`. This means they
21168 * may be negative or exceed the element boundaries (which is possible using
21169 * inertial scrolling).
21171 * @param {DOMWindow|DOMElement} scrollable
21172 * @return {object} Map with `x` and `y` keys.
21175 function getUnboundedScrollPosition(scrollable) {
21176 if (scrollable === window) {
21178 x: window.pageXOffset || document.documentElement.scrollLeft,
21179 y: window.pageYOffset || document.documentElement.scrollTop
21183 x: scrollable.scrollLeft,
21184 y: scrollable.scrollTop
21188 module.exports = getUnboundedScrollPosition;
21189 },{}],171:[function(_dereq_,module,exports){
21193 * Copyright (c) 2013-present, Facebook, Inc.
21194 * All rights reserved.
21196 * This source code is licensed under the BSD-style license found in the
21197 * LICENSE file in the root directory of this source tree. An additional grant
21198 * of patent rights can be found in the PATENTS file in the same directory.
21203 var _uppercasePattern = /([A-Z])/g;
21206 * Hyphenates a camelcased string, for example:
21208 * > hyphenate('backgroundColor')
21209 * < "background-color"
21211 * For CSS style names, use `hyphenateStyleName` instead which works properly
21212 * with all vendor prefixes, including `ms`.
21214 * @param {string} string
21217 function hyphenate(string) {
21218 return string.replace(_uppercasePattern, '-$1').toLowerCase();
21221 module.exports = hyphenate;
21222 },{}],172:[function(_dereq_,module,exports){
21224 * Copyright (c) 2013-present, Facebook, Inc.
21225 * All rights reserved.
21227 * This source code is licensed under the BSD-style license found in the
21228 * LICENSE file in the root directory of this source tree. An additional grant
21229 * of patent rights can be found in the PATENTS file in the same directory.
21236 var hyphenate = _dereq_(171);
21238 var msPattern = /^ms-/;
21241 * Hyphenates a camelcased CSS property name, for example:
21243 * > hyphenateStyleName('backgroundColor')
21244 * < "background-color"
21245 * > hyphenateStyleName('MozTransition')
21246 * < "-moz-transition"
21247 * > hyphenateStyleName('msTransition')
21248 * < "-ms-transition"
21250 * As Modernizr suggests (http://modernizr.com/docs/#prefixed), an `ms` prefix
21251 * is converted to `-ms-`.
21253 * @param {string} string
21256 function hyphenateStyleName(string) {
21257 return hyphenate(string).replace(msPattern, '-ms-');
21260 module.exports = hyphenateStyleName;
21261 },{"171":171}],173:[function(_dereq_,module,exports){
21263 * Copyright (c) 2013-present, Facebook, Inc.
21264 * All rights reserved.
21266 * This source code is licensed under the BSD-style license found in the
21267 * LICENSE file in the root directory of this source tree. An additional grant
21268 * of patent rights can be found in the PATENTS file in the same directory.
21275 * Use invariant() to assert state which your program assumes to be true.
21277 * Provide sprintf-style format (only %s is supported) and arguments
21278 * to provide information about what broke and what you were
21281 * The invariant message will be stripped in production, but the invariant
21282 * will remain to ensure logic does not differ in production.
21285 function invariant(condition, format, a, b, c, d, e, f) {
21286 if ("development" !== 'production') {
21287 if (format === undefined) {
21288 throw new Error('invariant requires an error message argument');
21294 if (format === undefined) {
21295 error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');
21297 var args = [a, b, c, d, e, f];
21299 error = new Error(format.replace(/%s/g, function () {
21300 return args[argIndex++];
21302 error.name = 'Invariant Violation';
21305 error.framesToPop = 1; // we don't care about invariant's own frame
21310 module.exports = invariant;
21311 },{}],174:[function(_dereq_,module,exports){
21315 * Copyright (c) 2013-present, Facebook, Inc.
21316 * All rights reserved.
21318 * This source code is licensed under the BSD-style license found in the
21319 * LICENSE file in the root directory of this source tree. An additional grant
21320 * of patent rights can be found in the PATENTS file in the same directory.
21326 * @param {*} object The object to check.
21327 * @return {boolean} Whether or not the object is a DOM node.
21329 function isNode(object) {
21330 return !!(object && (typeof Node === 'function' ? object instanceof Node : typeof object === 'object' && typeof object.nodeType === 'number' && typeof object.nodeName === 'string'));
21333 module.exports = isNode;
21334 },{}],175:[function(_dereq_,module,exports){
21338 * Copyright (c) 2013-present, Facebook, Inc.
21339 * All rights reserved.
21341 * This source code is licensed under the BSD-style license found in the
21342 * LICENSE file in the root directory of this source tree. An additional grant
21343 * of patent rights can be found in the PATENTS file in the same directory.
21348 var isNode = _dereq_(174);
21351 * @param {*} object The object to check.
21352 * @return {boolean} Whether or not the object is a DOM text node.
21354 function isTextNode(object) {
21355 return isNode(object) && object.nodeType == 3;
21358 module.exports = isTextNode;
21359 },{"174":174}],176:[function(_dereq_,module,exports){
21361 * Copyright (c) 2013-present, Facebook, Inc.
21362 * All rights reserved.
21364 * This source code is licensed under the BSD-style license found in the
21365 * LICENSE file in the root directory of this source tree. An additional grant
21366 * of patent rights can be found in the PATENTS file in the same directory.
21368 * @typechecks static-only
21373 var invariant = _dereq_(173);
21376 * Constructs an enumeration with keys equal to their value.
21380 * var COLORS = keyMirror({blue: null, red: null});
21381 * var myColor = COLORS.blue;
21382 * var isColorValid = !!COLORS[myColor];
21384 * The last line could not be performed if the values of the generated enum were
21385 * not equal to their keys.
21387 * Input: {key1: val1, key2: val2}
21388 * Output: {key1: key1, key2: key2}
21390 * @param {object} obj
21393 var keyMirror = function (obj) {
21396 !(obj instanceof Object && !Array.isArray(obj)) ? "development" !== 'production' ? invariant(false, 'keyMirror(...): Argument must be an object.') : invariant(false) : void 0;
21398 if (!obj.hasOwnProperty(key)) {
21406 module.exports = keyMirror;
21407 },{"173":173}],177:[function(_dereq_,module,exports){
21411 * Copyright (c) 2013-present, Facebook, Inc.
21412 * All rights reserved.
21414 * This source code is licensed under the BSD-style license found in the
21415 * LICENSE file in the root directory of this source tree. An additional grant
21416 * of patent rights can be found in the PATENTS file in the same directory.
21421 * Allows extraction of a minified key. Let's the build system minify keys
21422 * without losing the ability to dynamically use key strings as values
21423 * themselves. Pass in an object with a single key/val pair and it will return
21424 * you the string key of that single record. Suppose you want to grab the
21425 * value for a key 'className' inside of an object. Key/val minification may
21426 * have aliased that key to be 'xa12'. keyOf({className: null}) will return
21427 * 'xa12' in that case. Resolve keys you want to use once at startup time, then
21428 * reuse those resolutions.
21430 var keyOf = function (oneKeyObj) {
21432 for (key in oneKeyObj) {
21433 if (!oneKeyObj.hasOwnProperty(key)) {
21441 module.exports = keyOf;
21442 },{}],178:[function(_dereq_,module,exports){
21444 * Copyright (c) 2013-present, Facebook, Inc.
21445 * All rights reserved.
21447 * This source code is licensed under the BSD-style license found in the
21448 * LICENSE file in the root directory of this source tree. An additional grant
21449 * of patent rights can be found in the PATENTS file in the same directory.
21455 var hasOwnProperty = Object.prototype.hasOwnProperty;
21458 * Executes the provided `callback` once for each enumerable own property in the
21459 * object and constructs a new object from the results. The `callback` is
21460 * invoked with three arguments:
21462 * - the property value
21463 * - the property name
21464 * - the object being traversed
21466 * Properties that are added after the call to `mapObject` will not be visited
21467 * by `callback`. If the values of existing properties are changed, the value
21468 * passed to `callback` will be the value at the time `mapObject` visits them.
21469 * Properties that are deleted before being visited are not visited.
21471 * @grep function objectMap()
21472 * @grep function objMap()
21474 * @param {?object} object
21475 * @param {function} callback
21476 * @param {*} context
21477 * @return {?object}
21479 function mapObject(object, callback, context) {
21484 for (var name in object) {
21485 if (hasOwnProperty.call(object, name)) {
21486 result[name] = callback.call(context, object[name], name, object);
21492 module.exports = mapObject;
21493 },{}],179:[function(_dereq_,module,exports){
21495 * Copyright (c) 2013-present, Facebook, Inc.
21496 * All rights reserved.
21498 * This source code is licensed under the BSD-style license found in the
21499 * LICENSE file in the root directory of this source tree. An additional grant
21500 * of patent rights can be found in the PATENTS file in the same directory.
21502 * @typechecks static-only
21508 * Memoizes the return value of a function that accepts one string argument.
21510 * @param {function} callback
21511 * @return {function}
21514 function memoizeStringOnly(callback) {
21516 return function (string) {
21517 if (!cache.hasOwnProperty(string)) {
21518 cache[string] = callback.call(this, string);
21520 return cache[string];
21524 module.exports = memoizeStringOnly;
21525 },{}],180:[function(_dereq_,module,exports){
21527 * Copyright (c) 2013-present, Facebook, Inc.
21528 * All rights reserved.
21530 * This source code is licensed under the BSD-style license found in the
21531 * LICENSE file in the root directory of this source tree. An additional grant
21532 * of patent rights can be found in the PATENTS file in the same directory.
21539 var ExecutionEnvironment = _dereq_(159);
21543 if (ExecutionEnvironment.canUseDOM) {
21544 performance = window.performance || window.msPerformance || window.webkitPerformance;
21547 module.exports = performance || {};
21548 },{"159":159}],181:[function(_dereq_,module,exports){
21552 * Copyright (c) 2013-present, Facebook, Inc.
21553 * All rights reserved.
21555 * This source code is licensed under the BSD-style license found in the
21556 * LICENSE file in the root directory of this source tree. An additional grant
21557 * of patent rights can be found in the PATENTS file in the same directory.
21562 var performance = _dereq_(180);
21564 var performanceNow;
21567 * Detect if we can use `window.performance.now()` and gracefully fallback to
21568 * `Date.now()` if it doesn't exist. We need to support Firefox < 15 for now
21569 * because of Facebook's testing infrastructure.
21571 if (performance.now) {
21572 performanceNow = function () {
21573 return performance.now();
21576 performanceNow = function () {
21581 module.exports = performanceNow;
21582 },{"180":180}],182:[function(_dereq_,module,exports){
21584 * Copyright (c) 2013-present, Facebook, Inc.
21585 * All rights reserved.
21587 * This source code is licensed under the BSD-style license found in the
21588 * LICENSE file in the root directory of this source tree. An additional grant
21589 * of patent rights can be found in the PATENTS file in the same directory.
21595 /*eslint-disable no-self-compare */
21599 var hasOwnProperty = Object.prototype.hasOwnProperty;
21602 * inlined Object.is polyfill to avoid requiring consumers ship their own
21603 * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
21605 function is(x, y) {
21606 // SameValue algorithm
21609 // Steps 6.b-6.e: +0 != -0
21610 return x !== 0 || 1 / x === 1 / y;
21612 // Step 6.a: NaN == NaN
21613 return x !== x && y !== y;
21618 * Performs equality by iterating through keys on an object and returning false
21619 * when any key has values which are not strictly equal between the arguments.
21620 * Returns true when the values of all keys are strictly equal.
21622 function shallowEqual(objA, objB) {
21623 if (is(objA, objB)) {
21627 if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {
21631 var keysA = Object.keys(objA);
21632 var keysB = Object.keys(objB);
21634 if (keysA.length !== keysB.length) {
21638 // Test for A's keys different from B.
21639 for (var i = 0; i < keysA.length; i++) {
21640 if (!hasOwnProperty.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) {
21648 module.exports = shallowEqual;
21649 },{}],183:[function(_dereq_,module,exports){
21651 * Copyright 2014-2015, Facebook, Inc.
21652 * All rights reserved.
21654 * This source code is licensed under the BSD-style license found in the
21655 * LICENSE file in the root directory of this source tree. An additional grant
21656 * of patent rights can be found in the PATENTS file in the same directory.
21662 var emptyFunction = _dereq_(165);
21665 * Similar to invariant but only logs a warning if the condition is not met.
21666 * This can be used to log issues in development environments in critical
21667 * paths. Removing the logging code for production environments will keep the
21668 * same logic and follow the same code paths.
21671 var warning = emptyFunction;
21673 if ("development" !== 'production') {
21674 warning = function (condition, format) {
21675 for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
21676 args[_key - 2] = arguments[_key];
21679 if (format === undefined) {
21680 throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument');
21683 if (format.indexOf('Failed Composite propType: ') === 0) {
21684 return; // Ignore CompositeComponent proptype check.
21689 var message = 'Warning: ' + format.replace(/%s/g, function () {
21690 return args[argIndex++];
21692 if (typeof console !== 'undefined') {
21693 console.error(message);
21696 // --- Welcome to debugging React ---
21697 // This error was thrown as a convenience so that you can use this stack
21698 // to find the callsite that caused this warning to fire.
21699 throw new Error(message);
21705 module.exports = warning;
21706 },{"165":165}],184:[function(_dereq_,module,exports){
21708 /* eslint-disable no-unused-vars */
21709 var hasOwnProperty = Object.prototype.hasOwnProperty;
21710 var propIsEnumerable = Object.prototype.propertyIsEnumerable;
21712 function toObject(val) {
21713 if (val === null || val === undefined) {
21714 throw new TypeError('Object.assign cannot be called with null or undefined');
21717 return Object(val);
21720 function shouldUseNative() {
21722 if (!Object.assign) {
21726 // Detect buggy property enumeration order in older V8 versions.
21728 // https://bugs.chromium.org/p/v8/issues/detail?id=4118
21729 var test1 = new String('abc'); // eslint-disable-line
21731 if (Object.getOwnPropertyNames(test1)[0] === '5') {
21735 // https://bugs.chromium.org/p/v8/issues/detail?id=3056
21737 for (var i = 0; i < 10; i++) {
21738 test2['_' + String.fromCharCode(i)] = i;
21740 var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
21743 if (order2.join('') !== '0123456789') {
21747 // https://bugs.chromium.org/p/v8/issues/detail?id=3056
21749 'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
21750 test3[letter] = letter;
21752 if (Object.keys(Object.assign({}, test3)).join('') !==
21753 'abcdefghijklmnopqrst') {
21759 // We don't expect any of the above to throw, but better to be safe.
21764 module.exports = shouldUseNative() ? Object.assign : function (target, source) {
21766 var to = toObject(target);
21769 for (var s = 1; s < arguments.length; s++) {
21770 from = Object(arguments[s]);
21772 for (var key in from) {
21773 if (hasOwnProperty.call(from, key)) {
21774 to[key] = from[key];
21778 if (Object.getOwnPropertySymbols) {
21779 symbols = Object.getOwnPropertySymbols(from);
21780 for (var i = 0; i < symbols.length; i++) {
21781 if (propIsEnumerable.call(from, symbols[i])) {
21782 to[symbols[i]] = from[symbols[i]];
21791 },{}]},{},[107])(107)