From d41c578aadbdb9301dd98f779a40f59c540b09e1 Mon Sep 17 00:00:00 2001 From: Luke Sanwick Date: Thu, 22 Mar 2018 10:03:04 -0700 Subject: [PATCH 1/5] Broaden React dependencies for development, add Prettier and format command --- .prettierrc.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.prettierrc.yml b/.prettierrc.yml index 07a3d61..1099a00 100644 --- a/.prettierrc.yml +++ b/.prettierrc.yml @@ -3,7 +3,7 @@ tabWidth: 2 useTabs: false semi: true singleQuote: true -trailingComma: "es5" +trailingComma: 'es5' bracketSpacing: false jsxBracketSameLine: false -arrowParens: "avoid" +arrowParens: 'avoid' From 69f920967c3fca6bc7126430cb833a44c7ca6ab7 Mon Sep 17 00:00:00 2001 From: Luke Sanwick Date: Thu, 22 Mar 2018 10:08:28 -0700 Subject: [PATCH 2/5] [Prettier] Format codebase --- .prettierrc.yml | 2 +- src/index.js | 2 +- test/spec.js | 12 ++++++------ 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.prettierrc.yml b/.prettierrc.yml index 1099a00..8c06be3 100644 --- a/.prettierrc.yml +++ b/.prettierrc.yml @@ -4,6 +4,6 @@ useTabs: false semi: true singleQuote: true trailingComma: 'es5' -bracketSpacing: false +bracketSpacing: true jsxBracketSameLine: false arrowParens: 'avoid' diff --git a/src/index.js b/src/index.js index 69bfc98..1a9ec67 100644 --- a/src/index.js +++ b/src/index.js @@ -27,7 +27,7 @@ class Progress extends React.Component { } render() { - const {color, completed, animation, height, className, children, ...rest} = this.props; + const { color, completed, animation, height, className, children, ...rest } = this.props; const style = { backgroundColor: color, width: completed + '%', diff --git a/test/spec.js b/test/spec.js index 25bed70..dec9d15 100644 --- a/test/spec.js +++ b/test/spec.js @@ -1,6 +1,6 @@ import 'jsdom-global/register'; import React from 'react'; -import {mount, shallow} from 'enzyme'; +import { mount, shallow } from 'enzyme'; import expect from 'expect'; import sinon from 'sinon'; @@ -18,11 +18,11 @@ const noCase = string => string.toLowerCase(); const getRange = (from, to) => { if (from === to) return [from]; if (from > to) return getRange(to, from); - return Array.from({length: to - from + 1}, (v, k) => k + from); + return Array.from({ length: to - from + 1 }, (v, k) => k + from); }; -const getRanges = function() { +const getRanges = function () { return Array.from(arguments) - .map(({from, to}) => getRange(from, to)) + .map(({ from, to }) => getRange(from, to)) .reduce((a, b) => [...a, ...b], []); }; @@ -49,14 +49,14 @@ describe(`Progress`, () => { }); it(`does not accept completeness not a number`, () => { const spy = sinon.stub(Progress, 'throwError').returns(false), - anyThingNotNumber = ['100', '54', [43], new Object(), {something: '3'}, new Date()]; + anyThingNotNumber = ['100', '54', [43], new Object(), { something: '3' }, new Date()]; anyThingNotNumber.forEach(value => ); expect(spy.callCount).toEqual(anyThingNotNumber.length); spy.restore(); }); it(`does not accept completeness ∉ [0,100]`, () => { const spy = sinon.stub(Progress, 'throwError').returns(false); - const rangesOutOf_0_100 = getRanges({from: 101, to: 250}, {from: -1, to: -100}); + const rangesOutOf_0_100 = getRanges({ from: 101, to: 250 }, { from: -1, to: -100 }); rangesOutOf_0_100.forEach(value => ); From 5b4e239faf5292f5ded3a9a2fc4a22a032366283 Mon Sep 17 00:00:00 2001 From: Luke Sanwick Date: Thu, 22 Mar 2018 10:24:07 -0700 Subject: [PATCH 3/5] [Bugfix] Animation will now render correctly on initial mount. --- package.json | 1 + src/index.js | 21 ++++++++++++++++++++- test/spec.js | 15 ++++++++++----- yarn.lock | 11 +++++++++++ 4 files changed, 42 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index d65535a..b60664f 100644 --- a/package.json +++ b/package.json @@ -23,6 +23,7 @@ "babel-preset-stage-1": "^6.16.0", "coveralls": "^2.11.15", "enzyme": "^2.9.1", + "enzyme-wait": "^1.0.9", "expect": "^1.20.2", "jsdom": "^9.8.3", "jsdom-global": "^2.1.0", diff --git a/src/index.js b/src/index.js index 1a9ec67..f038b95 100644 --- a/src/index.js +++ b/src/index.js @@ -2,6 +2,10 @@ import React from 'react'; import PropTypes from 'prop-types'; class Progress extends React.Component { + state = { + completed: 0, // Animation should always start from 0 + }; + static propTypes = { completed: (props, propName) => { if (typeof props[propName] !== 'number') @@ -26,8 +30,23 @@ class Progress extends React.Component { return new Error(...arguments); } + componentDidMount() { + this.updateCompletedDelayed(this.props.completed, this.props.animation); + } + + componentWillReceiveProps(props) { + if (props.completed !== this.state.completed) { + this.updateCompletedDelayed(props.completed, props.animation); + } + } + + updateCompletedDelayed(completed, animationDelay) { + setTimeout(() => this.setState({ completed }), animationDelay); + } + render() { - const { color, completed, animation, height, className, children, ...rest } = this.props; + const { color, animation, height, completed: _, className, children, ...rest } = this.props; + const { completed } = this.state; const style = { backgroundColor: color, width: completed + '%', diff --git a/test/spec.js b/test/spec.js index dec9d15..d5e68f2 100644 --- a/test/spec.js +++ b/test/spec.js @@ -1,11 +1,14 @@ import 'jsdom-global/register'; import React from 'react'; -import { mount, shallow } from 'enzyme'; +import { mount, render, shallow } from 'enzyme'; +import { createWaitForElement } from 'enzyme-wait'; import expect from 'expect'; import sinon from 'sinon'; import Progress from '../src'; +const DEFAULT_ANIMATION = 200; + const rgb2hex = rgb => { if (rgb.search('rgb') === -1) return rgb; rgb = rgb.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+))?\)$/); @@ -65,11 +68,13 @@ describe(`Progress`, () => { }); it(`reflects completeness on the width of UI`, () => { - const anyPercentage = 50; - let wrapper; getRange(0, 100).forEach(value => { - wrapper = mount(); - expect(wrapper.find('.progressbar-progress').get(0).style.width).toEqual(value + '%'); + const sampleId = `#progressbar-${value}`; + const waitForSample = createWaitForElement(sampleId); + const wrapper = mount(); + waitForSample(wrapper, DEFAULT_ANIMATION).then(component => + expect(component.find('.progressbar-progress').get(0).style.width).toEqual(`${value}%`) + ); }); }); }); diff --git a/yarn.lock b/yarn.lock index 0435f8c..da97b70 100644 --- a/yarn.lock +++ b/yarn.lock @@ -122,6 +122,11 @@ assert-plus@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-0.2.0.tgz#d74e1b87e7affc0db8aadb7021f3fe48101ab234" + +assertion-error@^1.0.2: + version "1.1.0" + resolved "https://registry.yarnpkg.com/assertion-error/-/assertion-error-1.1.0.tgz#e60b6b0e8f301bd97e5375215bda406c85118c0b" + async-each@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/async-each/-/async-each-1.0.1.tgz#19d386a1d9edc6e7c1c85d388aedbcc56d33602d" @@ -1189,6 +1194,12 @@ entities@^1.1.1, entities@~1.1.1: enzyme@^2.9.1: version "2.9.1" resolved "https://registry.yarnpkg.com/enzyme/-/enzyme-2.9.1.tgz#07d5ce691241240fb817bf2c4b18d6e530240df6" +enzyme-wait@^1.0.9: + version "1.0.9" + resolved "https://registry.yarnpkg.com/enzyme-wait/-/enzyme-wait-1.0.9.tgz#f7a08bf49c7047358fa03e1f411a565c3a15101a" + dependencies: + assertion-error "^1.0.2" + dependencies: cheerio "^0.22.0" function.prototype.name "^1.0.0" From 9131b4a0e9f56add2d9b92a5ad2fd1125b841e64 Mon Sep 17 00:00:00 2001 From: Luke Sanwick Date: Thu, 22 Mar 2018 11:43:22 -0700 Subject: [PATCH 4/5] [Demo] Update demo with build script and modernized code. --- demo-src/index.html | 14 + demo-src/index.js | 38 + demo/250d9d033e637f0ffb8b901316720c75.js | 355 + demo/browser.js | 43 - demo/index.html | 11 +- demo/script.js | 18373 --------------------- package.json | 23 +- yarn.lock | 2365 ++- 8 files changed, 2715 insertions(+), 18507 deletions(-) create mode 100644 demo-src/index.html create mode 100644 demo-src/index.js create mode 100644 demo/250d9d033e637f0ffb8b901316720c75.js delete mode 100644 demo/browser.js delete mode 100644 demo/script.js diff --git a/demo-src/index.html b/demo-src/index.html new file mode 100644 index 0000000..fd81304 --- /dev/null +++ b/demo-src/index.html @@ -0,0 +1,14 @@ + + + + + + react-progressbar + + + +
+ + + + diff --git a/demo-src/index.js b/demo-src/index.js new file mode 100644 index 0000000..97347a3 --- /dev/null +++ b/demo-src/index.js @@ -0,0 +1,38 @@ +import React from 'react'; +import ReactDOM from 'react-dom'; +import ProgressBar from '../'; + +class ProgressBarDemo extends React.Component { + constructor(props) { + super(props); + this.state = { + completed: 0, + }; + } + + componentDidMount() { + var id = window.setInterval(() => { + var diff = Math.random() * 10; + + this.setState({ + completed: Math.min(this.state.completed + diff, 100), + }); + + if (this.state.completed >= 100) { + window.clearInterval(id); + } + }, 1000); + } + + render() { + return ( +
+

react-progressbar

+
+
+ +
+ ); + } +} +ReactDOM.render(, document.getElementById('demo')); diff --git a/demo/250d9d033e637f0ffb8b901316720c75.js b/demo/250d9d033e637f0ffb8b901316720c75.js new file mode 100644 index 0000000..057e7f2 --- /dev/null +++ b/demo/250d9d033e637f0ffb8b901316720c75.js @@ -0,0 +1,355 @@ +require=function(r,e,n){function t(n,o){function i(r){return t(i.resolve(r))}function f(e){return r[n][1][e]||e}if(!e[n]){if(!r[n]){var c="function"==typeof require&&require;if(!o&&c)return c(n,!0);if(u)return u(n,!0);var l=new Error("Cannot find module '"+n+"'");throw l.code="MODULE_NOT_FOUND",l}i.resolve=f;var s=e[n]=new t.Module(n);r[n][0].call(s.exports,i,s,s.exports)}return e[n].exports}function o(r){this.id=r,this.bundle=t,this.exports={}}var u="function"==typeof require&&require;t.isParcelRequire=!0,t.Module=o,t.modules=r,t.cache=e,t.parent=u;for(var i=0;i1){for(var _=Array(v),b=0;b1){for(var P=Array(g),h=0;h1)for(var n=1;n.")}return r}function s(r,t){if(r._store&&!r._store.validated&&null==r.key){r._store.validated=!0;var n=f.uniqueKey||(f.uniqueKey={}),o=p(t);if(!n[o]){n[o]=!0;r&&r._owner&&r._owner!==e.current&&" It was passed a child from "+r._owner.getName()+"."}}}function d(e,r){if("object"==typeof e)if(Array.isArray(e))for(var n=0;n-1||e("96",r),!o.plugins[s]){t.extractEvents||e("97",r),o.plugins[s]=t;var u=t.eventTypes;for(var l in u)a(u[l],t,l)||e("98",l,r)}}}function a(r,n,i){o.eventNameDispatchConfigs.hasOwnProperty(i)&&e("99",i),o.eventNameDispatchConfigs[i]=r;var t=r.phasedRegistrationNames;if(t){for(var a in t){if(t.hasOwnProperty(a))s(t[a],n,i)}return!0}return!!r.registrationName&&(s(r.registrationName,n,i),!0)}function s(r,n,i){o.registrationNameModules[r]&&e("100",r),o.registrationNameModules[r]=n,o.registrationNameDependencies[r]=n.eventTypes[i].dependencies}var o={plugins:[],eventNameDispatchConfigs:{},registrationNameModules:{},registrationNameDependencies:{},possibleRegistrationNames:null,injectEventPluginOrder:function(r){n&&e("101"),n=Array.prototype.slice.call(r),t()},injectEventPluginsByName:function(r){var n=!1;for(var a in r)if(r.hasOwnProperty(a)){var s=r[a];i.hasOwnProperty(a)&&i[a]===s||(i[a]&&e("102",a),i[a]=s,n=!0)}n&&t()},getPluginModuleForEvent:function(e){var r=e.dispatchConfig;if(r.registrationName)return o.registrationNameModules[r.registrationName]||null;if(void 0!==r.phasedRegistrationNames){var n=r.phasedRegistrationNames;for(var i in n)if(n.hasOwnProperty(i)){var t=o.registrationNameModules[n[i]];if(t)return t}}return null},_resetEventPlugins:function(){for(var e in n=null,i)i.hasOwnProperty(e)&&delete i[e];o.plugins.length=0;var r=o.eventNameDispatchConfigs;for(var t in r)r.hasOwnProperty(t)&&delete r[t];var a=o.registrationNameModules;for(var s in a)a.hasOwnProperty(s)&&delete a[s]}};module.exports=o; +},{"./reactProdInvariant":108,"fbjs/lib/invariant":180}],182:[function(require,module,exports) { +"use strict";var r=null;function a(a,t,l){try{t(l)}catch(a){null===r&&(r=a)}}var t,l={invokeGuardedCallback:a,invokeGuardedCallbackWithCatch:a,rethrowCaughtError:function(){if(r){var a=r;throw r=null,a}}};module.exports=l; +},{}],139:[function(require,module,exports) { +"use strict";var e,t,n,r=require("./reactProdInvariant"),s=require("./ReactErrorUtils"),a=require("fbjs/lib/invariant"),i=require("fbjs/lib/warning"),o={injectComponentTree:function(t){e=t},injectTreeTraversal:function(e){t=e}};function c(e){return"topMouseUp"===e||"topTouchEnd"===e||"topTouchCancel"===e}function u(e){return"topMouseMove"===e||"topTouchMove"===e}function l(e){return"topMouseDown"===e||"topTouchStart"===e}function p(e,t,n,r){var a=e.type||"unknown-event";e.currentTarget=I.getNodeFromInstance(r),t?s.invokeGuardedCallbackWithCatch(a,n,e):s.invokeGuardedCallback(a,n,e),e.currentTarget=null}function d(e,t){var n=e._dispatchListeners,r=e._dispatchInstances;if(Array.isArray(n))for(var s=0;s1?1-e:void 0;return this._fallbackText=o.slice(t,a),this._fallbackText}}),e.addPoolingTo(i),module.exports=i; +},{"object-assign":162,"./PooledClass":110,"./getTextContentAccessor":186}],141:[function(require,module,exports) { +"use strict";var t=require("object-assign"),e=require("./PooledClass"),n=require("fbjs/lib/emptyFunction"),r=require("fbjs/lib/warning"),s=!1,i="function"==typeof Proxy,a=["dispatchConfig","_targetInst","nativeEvent","isDefaultPrevented","isPropagationStopped","_dispatchListeners","_dispatchInstances"],o={type:null,target:null,currentTarget:n.thatReturnsNull,eventPhase:null,bubbles:null,cancelable:null,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:null,isTrusted:null};function u(t,e,r,s){this.dispatchConfig=t,this._targetInst=e,this.nativeEvent=r;var i=this.constructor.Interface;for(var a in i)if(i.hasOwnProperty(a)){0;var o=i[a];o?this[a]=o(r):"target"===a?this.target=s:this[a]=r[a]}var u=null!=r.defaultPrevented?r.defaultPrevented:!1===r.returnValue;return this.isDefaultPrevented=u?n.thatReturnsTrue:n.thatReturnsFalse,this.isPropagationStopped=n.thatReturnsFalse,this}function l(t,e){var n="function"==typeof e;return{configurable:!0,set:function(t){return r(n?"setting the method":"setting the property","This is effectively a no-op"),t},get:function(){return r(n?"accessing the method":"accessing the property",n?"This is a no-op function":"This is set to null"),e}};function r(t,e){}}t(u.prototype,{preventDefault:function(){this.defaultPrevented=!0;var t=this.nativeEvent;t&&(t.preventDefault?t.preventDefault():"unknown"!=typeof t.returnValue&&(t.returnValue=!1),this.isDefaultPrevented=n.thatReturnsTrue)},stopPropagation:function(){var t=this.nativeEvent;t&&(t.stopPropagation?t.stopPropagation():"unknown"!=typeof t.cancelBubble&&(t.cancelBubble=!0),this.isPropagationStopped=n.thatReturnsTrue)},persist:function(){this.isPersistent=n.thatReturnsTrue},isPersistent:n.thatReturnsFalse,destructor:function(){var t=this.constructor.Interface;for(var e in t)this[e]=null;for(var n=0;n8&&s<=11);function d(){var t=window.opera;return"object"==typeof t&&"function"==typeof t.version&&parseInt(t.version(),10)<=12}var l=32,m=String.fromCharCode(l),f={beforeInput:{phasedRegistrationNames:{bubbled:"onBeforeInput",captured:"onBeforeInputCapture"},dependencies:["topCompositionEnd","topKeyPress","topTextInput","topPaste"]},compositionEnd:{phasedRegistrationNames:{bubbled:"onCompositionEnd",captured:"onCompositionEndCapture"},dependencies:["topBlur","topCompositionEnd","topKeyDown","topKeyPress","topKeyUp","topMouseDown"]},compositionStart:{phasedRegistrationNames:{bubbled:"onCompositionStart",captured:"onCompositionStartCapture"},dependencies:["topBlur","topCompositionStart","topKeyDown","topKeyPress","topKeyUp","topMouseDown"]},compositionUpdate:{phasedRegistrationNames:{bubbled:"onCompositionUpdate",captured:"onCompositionUpdateCapture"},dependencies:["topBlur","topCompositionUpdate","topKeyDown","topKeyPress","topKeyUp","topMouseDown"]}},y=!1;function C(t){return(t.ctrlKey||t.altKey||t.metaKey)&&!(t.ctrlKey&&t.altKey)}function v(t){switch(t){case"topCompositionStart":return f.compositionStart;case"topCompositionEnd":return f.compositionEnd;case"topCompositionUpdate":return f.compositionUpdate}}function w(t,e){return"topKeyDown"===t&&e.keyCode===a}function h(t,e){switch(t){case"topKeyUp":return-1!==i.indexOf(e.keyCode);case"topKeyDown":return e.keyCode!==a;case"topKeyPress":case"topMouseDown":case"topBlur":return!0;default:return!1}}function K(t){var e=t.detail;return"object"==typeof e&&"data"in e?e.data:null}var E=null;function b(e,r,i,a){var s,u;if(p?s=v(e):E?h(e,i)&&(s=f.compositionEnd):w(e,i)&&(s=f.compositionStart),!s)return null;c&&(E||s!==f.compositionStart?s===f.compositionEnd&&E&&(u=E.getData()):E=o.getPooled(a));var d=n.getPooled(s,r,i,a);if(u)d.data=u;else{var l=K(i);null!==l&&(d.data=l)}return t.accumulateTwoPhaseDispatches(d),d}function D(t,e){switch(t){case"topCompositionEnd":return K(e);case"topKeyPress":return e.which!==l?null:(y=!0,m);case"topTextInput":var o=e.data;return o===m&&y?null:o;default:return null}}function P(t,e){if(E){if("topCompositionEnd"===t||!p&&h(t,e)){var n=E.getData();return o.release(E),E=null,n}return null}switch(t){case"topPaste":return null;case"topKeyPress":return e.which&&!C(e)?String.fromCharCode(e.which):null;case"topCompositionEnd":return c?null:e.data;default:return null}}function U(e,o,n,i){var a;if(!(a=u?D(e,n):P(e,n)))return null;var p=r.getPooled(f.beforeInput,o,n,i);return p.data=a,t.accumulateTwoPhaseDispatches(p),p}var S={eventTypes:f,extractEvents:function(t,e,o,n){return[b(t,e,o,n),U(t,e,o,n)]}};module.exports=S; +},{"./EventPropagators":132,"fbjs/lib/ExecutionEnvironment":197,"./FallbackCompositionState":135,"./SyntheticCompositionEvent":136,"./SyntheticInputEvent":136}],101:[function(require,module,exports) { +"use strict";var t=require("./reactProdInvariant");function s(t,s){if(!(t instanceof s))throw new TypeError("Cannot call a class as a function")}var n=require("./PooledClass"),l=require("fbjs/lib/invariant"),c=function(){function n(t){s(this,n),this._callbacks=null,this._contexts=null,this._arg=t}return n.prototype.enqueue=function(t,s){this._callbacks=this._callbacks||[],this._callbacks.push(t),this._contexts=this._contexts||[],this._contexts.push(s)},n.prototype.notifyAll=function(){var s=this._callbacks,n=this._contexts,l=this._arg;if(s&&n){s.length!==n.length&&t("24"),this._callbacks=null,this._contexts=null;for(var c=0;c1&&void 0!==arguments[1]&&arguments[1]}function I(n,e){0!==m&&(y&&!H&&(H=!0),h=r(),v=0,C=n,y=e)}function B(n,e){0!==m&&(y===e||H||(H=!0),s&&d.push({timerType:e,instanceID:n,duration:r()-h-v}),h=0,v=0,C=null,y=null)}function E(){var n={startTime:h,nestedFlushStartTime:r(),debugID:C,timerType:y};p.push(n),h=0,v=0,C=null,y=null}function U(){var n=p.pop(),e=n.startTime,o=n.nestedFlushStartTime,t=n.debugID,i=n.timerType,u=r()-o;h=e,v+=u,C=t,y=i}var S=0,M="undefined"!=typeof performance&&"function"==typeof performance.mark&&"function"==typeof performance.clearMarks&&"function"==typeof performance.measure&&"function"==typeof performance.clearMeasures;function P(n){if(!s||!M)return!1;var e=o.getElement(n);return null!=e&&"object"==typeof e&&!("string"==typeof e.type)}function w(n,e){if(P(n)){var o=n+"::"+e;S=r(),performance.mark(o)}}function x(n,e){if(P(n)){var t=n+"::"+e,i=o.getDisplayName(n)||"Unknown";if(r()-S>.1){var u=i+" ["+e+"]";performance.measure(u,t)}performance.clearMarks(t),u&&performance.clearMeasures(u)}}var F={addHook:function(n){u.push(n)},removeHook:function(n){for(var e=0;e8));var w=!1;function S(e,t){v=t,(s=e).attachEvent("onpropertychange",M)}function T(){s&&(s.detachEvent("onpropertychange",M),s=null,v=null)}function M(e){"value"===e.propertyName&&C(v,e)&&g(e)}function D(e,t,n){"topFocus"===e?(T(),S(t,n)):"topBlur"===e&&T()}function I(e,t,n){if("topSelectionChange"===e||"topKeyUp"===e||"topKeyDown"===e)return C(v,n)}function N(e){var t=e.nodeName;return t&&"input"===t.toLowerCase()&&("checkbox"===e.type||"radio"===e.type)}function P(e,t,n){if("topClick"===e)return C(t,n)}function U(e,t,n){if("topInput"===e||"topChange"===e)return C(t,n)}function x(e,t){if(null!=e){var n=e._wrapperState||t._wrapperState;if(n&&n.controlled&&"number"===t.type){var o=""+t.value;t.getAttribute("value")!==o&&t.setAttribute("value",o)}}}n.canUseDOM&&(w=c("input")&&(!document.documentMode||document.documentMode>9));var _={eventTypes:l,_allowSimulatedPassThrough:!0,_isInputEventSupported:w,extractEvents:function(e,t,n,u){var r,a,i=t?o.getNodeFromInstance(t):window;if(f(i)?h?r=b:a=q:p(i)?w?r=U:(r=I,a=D):N(i)&&(r=P),r){var c=r(e,t,n);if(c)return d(c,n,u)}a&&a(e,i,t),"topBlur"===e&&x(t,i)}};module.exports=_; +},{"./EventPluginHub":138,"./EventPropagators":132,"fbjs/lib/ExecutionEnvironment":197,"./ReactDOMComponentTree":18,"./ReactUpdates":22,"./SyntheticEvent":141,"./inputValueTracking":142,"./getEventTarget":134,"./isEventSupported":129,"./isTextInputElement":143}],86:[function(require,module,exports) { +"use strict";var e=["ResponderEventPlugin","SimpleEventPlugin","TapEventPlugin","EnterLeaveEventPlugin","ChangeEventPlugin","SelectEventPlugin","BeforeInputEventPlugin"];module.exports=e; +},{}],155:[function(require,module,exports) { +"use strict";var e=require("./SyntheticEvent"),t=require("./getEventTarget"),r={view:function(e){if(e.view)return e.view;var r=t(e);if(r.window===r)return r;var n=r.ownerDocument;return n?n.defaultView||n.parentWindow:window},detail:function(e){return e.detail||0}};function n(t,r,n,i){return e.call(this,t,r,n,i)}e.augmentClass(n,r),module.exports=n; +},{"./SyntheticEvent":141,"./getEventTarget":134}],127:[function(require,module,exports) { +"use strict";var r={currentScrollLeft:0,currentScrollTop:0,refreshScrollValues:function(e){r.currentScrollLeft=e.x,r.currentScrollTop=e.y}};module.exports=r; +},{}],161:[function(require,module,exports) { +"use strict";var t={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function e(e){var r=this.nativeEvent;if(r.getModifierState)return r.getModifierState(e);var i=t[e];return!!i&&!!r[i]}function r(t){return e}module.exports=r; +},{}],133:[function(require,module,exports) { +"use strict";var e=require("./SyntheticUIEvent"),t=require("./ViewportMetrics"),n=require("./getEventModifierState"),r={screenX:null,screenY:null,clientX:null,clientY:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,getModifierState:n,button:function(e){var t=e.button;return"which"in e?t:2===t?2:4===t?1:0},buttons:null,relatedTarget:function(e){return e.relatedTarget||(e.fromElement===e.srcElement?e.toElement:e.fromElement)},pageX:function(e){return"pageX"in e?e.pageX:e.clientX+t.currentScrollLeft},pageY:function(e){return"pageY"in e?e.pageY:e.clientY+t.currentScrollTop}};function l(t,n,r,l){return e.call(this,t,n,r,l)}e.augmentClass(l,r),module.exports=l; +},{"./SyntheticUIEvent":155,"./ViewportMetrics":127,"./getEventModifierState":161}],87:[function(require,module,exports) { +"use strict";var e=require("./EventPropagators"),t=require("./ReactDOMComponentTree"),r=require("./SyntheticMouseEvent"),o={mouseEnter:{registrationName:"onMouseEnter",dependencies:["topMouseOut","topMouseOver"]},mouseLeave:{registrationName:"onMouseLeave",dependencies:["topMouseOut","topMouseOver"]}},n={eventTypes:o,extractEvents:function(n,u,a,s){if("topMouseOver"===n&&(a.relatedTarget||a.fromElement))return null;if("topMouseOut"!==n&&"topMouseOver"!==n)return null;var l,i,v;if(s.window===s)l=s;else{var d=s.ownerDocument;l=d?d.defaultView||d.parentWindow:window}if("topMouseOut"===n){i=u;var m=a.relatedTarget||a.toElement;v=m?t.getClosestInstanceFromNode(m):null}else i=null,v=u;if(i===v)return null;var p=null==i?l:t.getNodeFromInstance(i),c=null==v?l:t.getNodeFromInstance(v),g=r.getPooled(o.mouseLeave,i,a,s);g.type="mouseleave",g.target=p,g.relatedTarget=c;var M=r.getPooled(o.mouseEnter,v,a,s);return M.type="mouseenter",M.target=c,M.relatedTarget=p,e.accumulateEnterLeaveDispatches(g,M,i,v),[g,M]}};module.exports=n; +},{"./EventPropagators":132,"./ReactDOMComponentTree":18,"./SyntheticMouseEvent":133}],88:[function(require,module,exports) { +"use strict";var e=require("./DOMProperty"),t=e.injection.MUST_USE_PROPERTY,a=e.injection.HAS_BOOLEAN_VALUE,r=e.injection.HAS_NUMERIC_VALUE,o=e.injection.HAS_POSITIVE_NUMERIC_VALUE,i=e.injection.HAS_OVERLOADED_BOOLEAN_VALUE,l={isCustomAttribute:RegExp.prototype.test.bind(new RegExp("^(data|aria)-["+e.ATTRIBUTE_NAME_CHAR+"]*$")),Properties:{accept:0,acceptCharset:0,accessKey:0,action:0,allowFullScreen:a,allowTransparency:0,alt:0,as:0,async:a,autoComplete:0,autoPlay:a,capture:a,cellPadding:0,cellSpacing:0,charSet:0,challenge:0,checked:t|a,cite:0,classID:0,className:0,cols:o,colSpan:0,content:0,contentEditable:0,contextMenu:0,controls:a,controlsList:0,coords:0,crossOrigin:0,data:0,dateTime:0,default:a,defer:a,dir:0,disabled:a,download:i,draggable:0,encType:0,form:0,formAction:0,formEncType:0,formMethod:0,formNoValidate:a,formTarget:0,frameBorder:0,headers:0,height:0,hidden:a,high:0,href:0,hrefLang:0,htmlFor:0,httpEquiv:0,icon:0,id:0,inputMode:0,integrity:0,is:0,keyParams:0,keyType:0,kind:0,label:0,lang:0,list:0,loop:a,low:0,manifest:0,marginHeight:0,marginWidth:0,max:0,maxLength:0,media:0,mediaGroup:0,method:0,min:0,minLength:0,multiple:t|a,muted:t|a,name:0,nonce:0,noValidate:a,open:a,optimum:0,pattern:0,placeholder:0,playsInline:a,poster:0,preload:0,profile:0,radioGroup:0,readOnly:a,referrerPolicy:0,rel:0,required:a,reversed:a,role:0,rows:o,rowSpan:r,sandbox:0,scope:0,scoped:a,scrolling:0,seamless:a,selected:t|a,shape:0,size:o,sizes:0,span:o,spellCheck:0,src:0,srcDoc:0,srcLang:0,srcSet:0,start:r,step:0,style:0,summary:0,tabIndex:0,target:0,title:0,type:0,useMap:0,value:0,width:0,wmode:0,wrap:0,about:0,datatype:0,inlist:0,prefix:0,property:0,resource:0,typeof:0,vocab:0,autoCapitalize:0,autoCorrect:0,autoSave:0,color:0,itemProp:0,itemScope:a,itemType:0,itemID:0,itemRef:0,results:0,security:0,unselectable:0},DOMAttributeNames:{acceptCharset:"accept-charset",className:"class",htmlFor:"for",httpEquiv:"http-equiv"},DOMPropertyNames:{},DOMMutationMethods:{value:function(e,t){if(null==t)return e.removeAttribute("value");"number"!==e.type||!1===e.hasAttribute("value")?e.setAttribute("value",""+t):e.validity&&!e.validity.badInput&&e.ownerDocument.activeElement!==e&&e.setAttribute("value",""+t)}}};module.exports=l; +},{"./DOMProperty":72}],120:[function(require,module,exports) { +"use strict";var t={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg"};module.exports=t; +},{}],121:[function(require,module,exports) { +"use strict";var n=function(n){return"undefined"!=typeof MSApp&&MSApp.execUnsafeLocalFunction?function(e,t,c,o){MSApp.execUnsafeLocalFunction(function(){return n(e,t,c,o)})}:n};module.exports=n; +},{}],81:[function(require,module,exports) { +"use strict";var e,n=require("fbjs/lib/ExecutionEnvironment"),r=require("./DOMNamespaces"),i=/^[ \r\n\t\f]/,t=/<(!--|link|noscript|meta|script|style)[ \r\n\t\f\/>]/,a=require("./createMicrosoftUnsafeLocalFunction"),s=a(function(n,i){if(n.namespaceURI!==r.svg||"innerHTML"in n)n.innerHTML=i;else{(e=e||document.createElement("div")).innerHTML=""+i+"";for(var t=e.firstChild;t.firstChild;)n.appendChild(t.firstChild)}});if(n.canUseDOM){var l=document.createElement("div");l.innerHTML=" ",""===l.innerHTML&&(s=function(e,n){if(e.parentNode&&e.parentNode.replaceChild(e,e),i.test(n)||"<"===n[0]&&t.test(n)){e.innerHTML=String.fromCharCode(65279)+n;var r=e.firstChild;1===r.data.length?e.removeChild(r):r.deleteData(0,1)}else e.innerHTML=n}),l=null}module.exports=s; +},{"fbjs/lib/ExecutionEnvironment":197,"./DOMNamespaces":120,"./createMicrosoftUnsafeLocalFunction":121}],146:[function(require,module,exports) { +"use strict";var e=/["'&<>]/;function r(r){var t,a=""+r,n=e.exec(a);if(!n)return a;var s="",u=0,c=0;for(u=n.index;u',""],a=[1,"","
"],n=[3,"","
"],i=[1,'',""],p={"*":[1,"?
","
"],area:[1,"",""],col:[2,"","
"],legend:[1,"
","
"],param:[1,"",""],tr:[2,"","
"],optgroup:r,option:r,caption:a,colgroup:a,tbody:a,tfoot:a,thead:a,td:n,th:n},d=["circle","clipPath","defs","ellipse","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","text","tspan"];function c(t){return l||e(!1),p.hasOwnProperty(t)||(t="*"),o.hasOwnProperty(t)||(l.innerHTML="*"===t?"":"<"+t+">",o[t]=!l.firstChild),o[t]?p[t]:null}d.forEach(function(t){p[t]=i,o[t]=!0}),module.exports=c; +},{"./ExecutionEnvironment":197,"./invariant":180}],219:[function(require,module,exports) { +"use strict";var r=require("./ExecutionEnvironment"),e=require("./createArrayFromMixed"),a=require("./getMarkupWrap"),t=require("./invariant"),i=r.canUseDOM?document.createElement("div"):null,n=/^\s*<(\w+)/;function o(r){var e=r.match(n);return e&&e[1].toLowerCase()}function l(r,n){var l=i;i||t(!1);var u=o(r),s=u&&a(u);if(s){l.innerHTML=s[1]+r+s[2];for(var c=s[0];c--;)l=l.lastChild}else l.innerHTML=r;var v=l.getElementsByTagName("script");v.length&&(n||t(!1),e(v).forEach(n));for(var d=Array.from(l.childNodes);l.lastChild;)l.removeChild(l.lastChild);return d}module.exports=l; +},{"./ExecutionEnvironment":197,"./createArrayFromMixed":222,"./getMarkupWrap":223,"./invariant":180}],176:[function(require,module,exports) { +"use strict";var e=require("./reactProdInvariant"),r=require("./DOMLazyTree"),i=require("fbjs/lib/ExecutionEnvironment"),a=require("fbjs/lib/createNodesFromMarkup"),n=require("fbjs/lib/emptyFunction"),t=require("fbjs/lib/invariant"),o={dangerouslyReplaceNodeWithMarkup:function(t,o){if(i.canUseDOM||e("56"),o||e("57"),"HTML"===t.nodeName&&e("58"),"string"==typeof o){var u=a(o,n)[0];t.parentNode.replaceChild(u,t)}else r.replaceChildWithTree(t,o)}};module.exports=o; +},{"./reactProdInvariant":108,"./DOMLazyTree":71,"fbjs/lib/ExecutionEnvironment":197,"fbjs/lib/createNodesFromMarkup":219,"fbjs/lib/emptyFunction":181,"fbjs/lib/invariant":180}],144:[function(require,module,exports) { +"use strict";var e=require("./DOMLazyTree"),r=require("./Danger"),t=require("./ReactDOMComponentTree"),n=require("./ReactInstrumentation"),a=require("./createMicrosoftUnsafeLocalFunction"),i=require("./setInnerHTML"),o=require("./setTextContent");function c(e,r){return Array.isArray(r)&&(r=r[1]),r?r.nextSibling:e.firstChild}var u=a(function(e,r,t){e.insertBefore(r,t)});function s(r,t,n){e.insertTreeBefore(r,t,n)}function f(e,r,t){Array.isArray(r)?l(e,r[0],r[1],t):u(e,r,t)}function d(e,r){if(Array.isArray(r)){var t=r[1];v(e,r=r[0],t),e.removeChild(t)}e.removeChild(r)}function l(e,r,t,n){for(var a=r;;){var i=a.nextSibling;if(u(e,a,n),a===t)break;a=i}}function v(e,r,t){for(;;){var n=r.nextSibling;if(n===t)break;e.removeChild(n)}}function T(e,r,t){var n=e.parentNode,a=e.nextSibling;a===r?t&&u(n,document.createTextNode(t),a):t?(o(a,t),v(n,a,r)):v(n,e,r)}var N=r.dangerouslyReplaceNodeWithMarkup;var p={dangerouslyReplaceNodeWithMarkup:N,replaceDelimitedText:T,processUpdates:function(e,r){for(var t=0;t0&&a.length<20?t+" (keys: "+a.join(", ")+")":t}function p(e,n){var a=t.get(e);return a||null}var o={isMounted:function(e){var n=t.get(e);return!!n&&!!n._renderedComponent},enqueueCallback:function(e,n,t){o.validateCallback(n,t);var a=p(e);if(!a)return null;a._pendingCallbacks?a._pendingCallbacks.push(n):a._pendingCallbacks=[n],l(a)},enqueueCallbackInternal:function(e,n){e._pendingCallbacks?e._pendingCallbacks.push(n):e._pendingCallbacks=[n],l(e)},enqueueForceUpdate:function(e){var n=p(e,"forceUpdate");n&&(n._pendingForceUpdate=!0,l(n))},enqueueReplaceState:function(e,n,t){var a=p(e,"replaceState");a&&(a._pendingStateQueue=[n],a._pendingReplaceState=!0,void 0!==t&&null!==t&&(o.validateCallback(t,"replaceState"),a._pendingCallbacks?a._pendingCallbacks.push(t):a._pendingCallbacks=[t]),l(a))},enqueueSetState:function(e,n){var t=p(e,"setState");t&&((t._pendingStateQueue||(t._pendingStateQueue=[])).push(n),l(t))},enqueueElementInternal:function(e,n,t){e._pendingElement=n,e._context=t,l(e)},validateCallback:function(n,t){n&&"function"!=typeof n&&e("122",t,c(n))}};module.exports=o; +},{"./reactProdInvariant":108,"react/lib/ReactCurrentOwner":112,"./ReactInstanceMap":77,"./ReactInstrumentation":27,"./ReactUpdates":22,"fbjs/lib/invariant":180,"fbjs/lib/warning":183}],194:[function(require,module,exports) { +"use strict";function t(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var e=require("./ReactUpdateQueue"),n=require("fbjs/lib/warning");function a(t,e){}var o=function(){function n(e){t(this,n),this.transaction=e}return n.prototype.isMounted=function(t){return!1},n.prototype.enqueueCallback=function(t,n,a){this.transaction.isInTransaction()&&e.enqueueCallback(t,n,a)},n.prototype.enqueueForceUpdate=function(t){this.transaction.isInTransaction()?e.enqueueForceUpdate(t):a(t,"forceUpdate")},n.prototype.enqueueReplaceState=function(t,n){this.transaction.isInTransaction()?e.enqueueReplaceState(t,n):a(t,"replaceState")},n.prototype.enqueueSetState=function(t,n){this.transaction.isInTransaction()?e.enqueueSetState(t,n):a(t,"setState")},n}();module.exports=o; +},{"./ReactUpdateQueue":79,"fbjs/lib/warning":183}],171:[function(require,module,exports) { +"use strict";var e=require("object-assign"),t=require("./PooledClass"),r=require("./Transaction"),n=require("./ReactInstrumentation"),u=require("./ReactServerUpdateQueue"),i=[];var a={enqueue:function(){}};function o(e){this.reinitializeTransaction(),this.renderToStaticMarkup=e,this.useCreateElement=!1,this.updateQueue=new u(this)}var c={getTransactionWrappers:function(){return i},getReactMountReady:function(){return a},getUpdateQueue:function(){return this.updateQueue},destructor:function(){},checkpoint:function(){},rollback:function(){}};e(o.prototype,r,c),t.addPoolingTo(o),module.exports=o; +},{"object-assign":162,"./PooledClass":110,"./Transaction":103,"./ReactInstrumentation":27,"./ReactServerUpdateQueue":194}],130:[function(require,module,exports) { +"use strict";var e,r,i,s,t,u,b,n,o,a,c=require("object-assign"),j=require("fbjs/lib/emptyFunction"),l=require("fbjs/lib/warning"),q=j;module.exports=q; +},{"object-assign":162,"fbjs/lib/emptyFunction":181,"fbjs/lib/warning":183}],90:[function(require,module,exports) { +"use strict";var e=require("./reactProdInvariant"),t=require("object-assign"),r=require("./AutoFocusUtils"),n=require("./CSSPropertyOperations"),a=require("./DOMLazyTree"),i=require("./DOMNamespaces"),s=require("./DOMProperty"),o=require("./DOMPropertyOperations"),u=require("./EventPluginHub"),l=require("./EventPluginRegistry"),p=require("./ReactBrowserEventEmitter"),h=require("./ReactDOMComponentFlags"),c=require("./ReactDOMComponentTree"),d=require("./ReactDOMInput"),_=require("./ReactDOMOption"),g=require("./ReactDOMSelect"),y=require("./ReactDOMTextarea"),m=require("./ReactInstrumentation"),f=require("./ReactMultiChild"),v=require("./ReactServerRenderingTransaction"),b=require("fbjs/lib/emptyFunction"),M=require("./escapeTextContentForBrowser"),C=require("fbjs/lib/invariant"),P=require("./isEventSupported"),w=require("fbjs/lib/shallowEqual"),R=require("./inputValueTracking"),O=require("./validateDOMNesting"),S=require("fbjs/lib/warning"),q=h,k=u.deleteListener,E=c.getNodeFromInstance,I=p.listenTo,D=l.registrationNameModules,T={string:!0,number:!0},H="style",L="__html",N={children:null,dangerouslySetInnerHTML:null,suppressContentEditableWarning:null},F=11;function j(e){if(e){var t=e._currentElement._owner||null;if(t){var r=t.getName();if(r)return" This DOM node was rendered by `"+r+"`."}}return""}function x(e){if("object"==typeof e){if(Array.isArray(e))return"["+e.map(x).join(", ")+"]";var t=[];for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){var n=/^[a-z$_][\w$_]*$/i.test(r)?r:JSON.stringify(r);t.push(n+": "+x(e[r]))}return"{"+t.join(", ")+"}"}return"string"==typeof e?JSON.stringify(e):"function"==typeof e?"[function object]":String(e)}var A={};function W(e,t,r){if(null!=e&&null!=t&&!w(e,t)){var n,a=r._tag,i=r._currentElement._owner;i&&(n=i.getName());var s=n+"|"+a;A.hasOwnProperty(s)||(A[s]=!0)}}function B(t,r){r&&(te[t._tag]&&(null!=r.children||null!=r.dangerouslySetInnerHTML)&&e("137",t._tag,t._currentElement._owner?" Check the render method of "+t._currentElement._owner.getName()+".":""),null!=r.dangerouslySetInnerHTML&&(null!=r.children&&e("60"),"object"==typeof r.dangerouslySetInnerHTML&&L in r.dangerouslySetInnerHTML||e("61")),null!=r.style&&"object"!=typeof r.style&&e("62",j(t)))}function V(e,t,r,n){if(!(n instanceof v)){0;var a=e._hostContainerInfo,i=a._node&&a._node.nodeType===F?a._node:a._ownerDocument;I(t,i),n.getReactMountReady().enqueue(U,{inst:e,registrationName:t,listener:r})}}function U(){u.putListener(this.inst,this.registrationName,this.listener)}function z(){d.postMountWrapper(this)}function $(){y.postMountWrapper(this)}function J(){_.postMountWrapper(this)}var Z=b;var G={topAbort:"abort",topCanPlay:"canplay",topCanPlayThrough:"canplaythrough",topDurationChange:"durationchange",topEmptied:"emptied",topEncrypted:"encrypted",topEnded:"ended",topError:"error",topLoadedData:"loadeddata",topLoadedMetadata:"loadedmetadata",topLoadStart:"loadstart",topPause:"pause",topPlay:"play",topPlaying:"playing",topProgress:"progress",topRateChange:"ratechange",topSeeked:"seeked",topSeeking:"seeking",topStalled:"stalled",topSuspend:"suspend",topTimeUpdate:"timeupdate",topVolumeChange:"volumechange",topWaiting:"waiting"};function K(){R.track(this)}function Q(){this._rootNodeID||e("63");var t=E(this);switch(t||e("64"),this._tag){case"iframe":case"object":this._wrapperState.listeners=[p.trapBubbledEvent("topLoad","load",t)];break;case"video":case"audio":for(var r in this._wrapperState.listeners=[],G)G.hasOwnProperty(r)&&this._wrapperState.listeners.push(p.trapBubbledEvent(r,G[r],t));break;case"source":this._wrapperState.listeners=[p.trapBubbledEvent("topError","error",t)];break;case"img":this._wrapperState.listeners=[p.trapBubbledEvent("topError","error",t),p.trapBubbledEvent("topLoad","load",t)];break;case"form":this._wrapperState.listeners=[p.trapBubbledEvent("topReset","reset",t),p.trapBubbledEvent("topSubmit","submit",t)];break;case"input":case"select":case"textarea":this._wrapperState.listeners=[p.trapBubbledEvent("topInvalid","invalid",t)]}}function X(){g.postUpdateWrapper(this)}var Y={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},ee={listing:!0,pre:!0,textarea:!0},te=t({menuitem:!0},Y),re=/^[a-zA-Z][a-zA-Z:_\.\-\d]*$/,ne={},ae={}.hasOwnProperty;function ie(t){ae.call(ne,t)||(re.test(t)||e("65",t),ne[t]=!0)}function se(e,t){return e.indexOf("-")>=0||null!=t.is}var oe=1;function ue(e){var t=e.type;ie(t),this._currentElement=e,this._tag=t.toLowerCase(),this._namespaceURI=null,this._renderedChildren=null,this._previousStyle=null,this._previousStyleCopy=null,this._hostNode=null,this._hostParent=null,this._rootNodeID=0,this._domID=0,this._hostContainerInfo=null,this._wrapperState=null,this._topLevelWrapper=null,this._flags=0}ue.displayName="ReactDOMComponent",ue.Mixin={mountComponent:function(e,t,n,s){this._rootNodeID=oe++,this._domID=n._idCounter++,this._hostParent=t,this._hostContainerInfo=n;var u,l,p,h=this._currentElement.props;switch(this._tag){case"audio":case"form":case"iframe":case"img":case"link":case"object":case"source":case"video":this._wrapperState={listeners:null},e.getReactMountReady().enqueue(Q,this);break;case"input":d.mountWrapper(this,h,t),h=d.getHostProps(this,h),e.getReactMountReady().enqueue(K,this),e.getReactMountReady().enqueue(Q,this);break;case"option":_.mountWrapper(this,h,t),h=_.getHostProps(this,h);break;case"select":g.mountWrapper(this,h,t),h=g.getHostProps(this,h),e.getReactMountReady().enqueue(Q,this);break;case"textarea":y.mountWrapper(this,h,t),h=y.getHostProps(this,h),e.getReactMountReady().enqueue(K,this),e.getReactMountReady().enqueue(Q,this)}if(B(this,h),null!=t?(u=t._namespaceURI,l=t._tag):n._tag&&(u=n._namespaceURI,l=n._tag),(null==u||u===i.svg&&"foreignobject"===l)&&(u=i.html),u===i.html&&("svg"===this._tag?u=i.svg:"math"===this._tag&&(u=i.mathml)),this._namespaceURI=u,e.useCreateElement){var m,f=n._ownerDocument;if(u===i.html)if("script"===this._tag){var v=f.createElement("div"),b=this._currentElement.type;v.innerHTML="<"+b+">",m=v.removeChild(v.firstChild)}else m=h.is?f.createElement(this._currentElement.type,h.is):f.createElement(this._currentElement.type);else m=f.createElementNS(u,this._currentElement.type);c.precacheNode(this,m),this._flags|=q.hasCachedChildNodes,this._hostParent||o.setAttributeForRoot(m),this._updateDOMProperties(null,h,e);var M=a(m);this._createInitialChildren(e,h,s,M),p=M}else{var C=this._createOpenTagMarkupAndPutListeners(e,h),P=this._createContentMarkup(e,h,s);p=!P&&Y[this._tag]?C+"/>":C+">"+P+""}switch(this._tag){case"input":e.getReactMountReady().enqueue(z,this),h.autoFocus&&e.getReactMountReady().enqueue(r.focusDOMComponent,this);break;case"textarea":e.getReactMountReady().enqueue($,this),h.autoFocus&&e.getReactMountReady().enqueue(r.focusDOMComponent,this);break;case"select":case"button":h.autoFocus&&e.getReactMountReady().enqueue(r.focusDOMComponent,this);break;case"option":e.getReactMountReady().enqueue(J,this)}return p},_createOpenTagMarkupAndPutListeners:function(e,r){var a="<"+this._currentElement.type;for(var i in r)if(r.hasOwnProperty(i)){var s=r[i];if(null!=s)if(D.hasOwnProperty(i))s&&V(this,i,s,e);else{i===H&&(s&&(s=this._previousStyleCopy=t({},r.style)),s=n.createMarkupForStyles(s,this));var u=null;null!=this._tag&&se(this._tag,r)?N.hasOwnProperty(i)||(u=o.createMarkupForCustomAttribute(i,s)):u=o.createMarkupForProperty(i,s),u&&(a+=" "+u)}}return e.renderToStaticMarkup?a:(this._hostParent||(a+=" "+o.createMarkupForRoot()),a+=" "+o.createMarkupForID(this._domID))},_createContentMarkup:function(e,t,r){var n="",a=t.dangerouslySetInnerHTML;if(null!=a)null!=a.__html&&(n=a.__html);else{var i=T[typeof t.children]?t.children:null,s=null!=i?null:t.children;if(null!=i)n=M(i);else if(null!=s){n=this.mountChildren(s,e,r).join("")}}return ee[this._tag]&&"\n"===n.charAt(0)?"\n"+n:n},_createInitialChildren:function(e,t,r,n){var i=t.dangerouslySetInnerHTML;if(null!=i)null!=i.__html&&a.queueHTML(n,i.__html);else{var s=T[typeof t.children]?t.children:null,o=null!=s?null:t.children;if(null!=s)""!==s&&a.queueText(n,s);else if(null!=o)for(var u=this.mountChildren(o,e,r),l=0;l0;)t=t._hostParent,n--;for(;a-n>0;)e=e._hostParent,a--;for(var h=n;h--;){if(t===e)return t;t=t._hostParent,e=e._hostParent}return null}function n(t,e){"_hostNode"in t||r("35"),"_hostNode"in e||r("35");for(;e;){if(e===t)return!0;e=e._hostParent}return!1}function o(t){return"_hostNode"in t||r("36"),t._hostParent}function a(r,t,e){for(var n,o=[];r;)o.push(r),r=r._hostParent;for(n=o.length;n-- >0;)t(o[n],"captured",e);for(n=0;n0;)n(f[u],"captured",a)}module.exports={isAncestor:n,getLowestCommonAncestor:e,getParentInstance:o,traverseTwoPhase:a,traverseEnterLeave:s}; +},{"./reactProdInvariant":108,"fbjs/lib/invariant":180}],93:[function(require,module,exports) { +"use strict";var e=require("./reactProdInvariant"),t=require("object-assign"),n=require("./DOMChildrenOperations"),i=require("./DOMLazyTree"),r=require("./ReactDOMComponentTree"),o=require("./escapeTextContentForBrowser"),s=require("fbjs/lib/invariant"),u=require("./validateDOMNesting"),m=function(e){this._currentElement=e,this._stringText=""+e,this._hostNode=null,this._hostParent=null,this._domID=0,this._mountIndex=0,this._closingComment=null,this._commentNodes=null};t(m.prototype,{mountComponent:function(e,t,n,s){var u=n._idCounter++,m=" react-text: "+u+" ";if(this._domID=u,this._hostParent=t,e.useCreateElement){var c=n._ownerDocument,h=c.createComment(m),a=c.createComment(" /react-text "),l=i(c.createDocumentFragment());return i.queueChild(l,i(h)),this._stringText&&i.queueChild(l,i(c.createTextNode(this._stringText))),i.queueChild(l,i(a)),r.precacheNode(this,h),this._closingComment=a,l}var _=o(this._stringText);return e.renderToStaticMarkup?_:"\x3c!--"+m+"--\x3e"+_+"\x3c!-- /react-text --\x3e"},receiveComponent:function(e,t){if(e!==this._currentElement){this._currentElement=e;var i=""+e;if(i!==this._stringText){this._stringText=i;var r=this.getHostNode();n.replaceDelimitedText(r[0],r[1],i)}}},getHostNode:function(){var t=this._commentNodes;if(t)return t;if(!this._closingComment)for(var n=r.getNodeFromInstance(this).nextSibling;;){if(null==n&&e("67",this._domID),8===n.nodeType&&" /react-text "===n.nodeValue){this._closingComment=n;break}n=n.nextSibling}return t=[this._hostNode,this._closingComment],this._commentNodes=t,t},unmountComponent:function(){this._closingComment=null,this._commentNodes=null,r.uncacheNode(this)}}),module.exports=m; +},{"./reactProdInvariant":108,"object-assign":162,"./DOMChildrenOperations":144,"./DOMLazyTree":71,"./ReactDOMComponentTree":18,"./escapeTextContentForBrowser":146,"fbjs/lib/invariant":180,"./validateDOMNesting":130}],94:[function(require,module,exports) { +"use strict";var i=require("object-assign"),e=require("./ReactUpdates"),t=require("./Transaction"),n=require("fbjs/lib/emptyFunction"),a={initialize:n,close:function(){u.isBatchingUpdates=!1}},r={initialize:n,close:e.flushBatchedUpdates.bind(e)},s=[r,a];function c(){this.reinitializeTransaction()}i(c.prototype,t,{getTransactionWrappers:function(){return s}});var o=new c,u={isBatchingUpdates:!1,batchedUpdates:function(i,e,t,n,a,r){var s=u.isBatchingUpdates;return u.isBatchingUpdates=!0,s?i(e,t,n,a,r):o.perform(i,null,e,t,n,a,r)}};module.exports=u; +},{"object-assign":162,"./ReactUpdates":22,"./Transaction":103,"fbjs/lib/emptyFunction":181}],205:[function(require,module,exports) { +"use strict";var e=require("./emptyFunction"),t={listen:function(e,t,n){return e.addEventListener?(e.addEventListener(t,n,!1),{remove:function(){e.removeEventListener(t,n,!1)}}):e.attachEvent?(e.attachEvent("on"+t,n),{remove:function(){e.detachEvent("on"+t,n)}}):void 0},capture:function(t,n,r){return t.addEventListener?(t.addEventListener(n,r,!0),{remove:function(){t.removeEventListener(n,r,!0)}}):{remove:e}},registerDefault:function(){}};module.exports=t; +},{"./emptyFunction":181}],204:[function(require,module,exports) { +"use strict";function e(e){return e.Window&&e instanceof e.Window?{x:e.pageXOffset||e.document.documentElement.scrollLeft,y:e.pageYOffset||e.document.documentElement.scrollTop}:{x:e.scrollLeft,y:e.scrollTop}}module.exports=e; +},{}],95:[function(require,module,exports) { +"use strict";var e=require("object-assign"),n=require("fbjs/lib/EventListener"),t=require("fbjs/lib/ExecutionEnvironment"),o=require("./PooledClass"),r=require("./ReactDOMComponentTree"),l=require("./ReactUpdates"),i=require("./getEventTarget"),a=require("fbjs/lib/getUnboundedScrollPosition");function s(e){for(;e._hostParent;)e=e._hostParent;var n=r.getNodeFromInstance(e).parentNode;return r.getClosestInstanceFromNode(n)}function u(e,n){this.topLevelType=e,this.nativeEvent=n,this.ancestors=[]}function d(e){var n=i(e.nativeEvent),t=r.getClosestInstanceFromNode(n),o=t;do{e.ancestors.push(o),o=o&&s(o)}while(o);for(var l=0;l=i)return{node:r,offset:i-f};f=o}r=t(n(r))}}module.exports=e; +},{}],179:[function(require,module,exports) { +"use strict";var e=require("fbjs/lib/ExecutionEnvironment"),t=require("./getNodeForCharacterOffset"),n=require("./getTextContentAccessor");function o(e,t,n,o){return e===n&&t===o}function r(e){var t=document.selection.createRange(),n=t.text.length,o=t.duplicate();o.moveToElementText(e),o.setEndPoint("EndToStart",t);var r=o.text.length;return{start:r,end:r+n}}function a(e){var t=window.getSelection&&window.getSelection();if(!t||0===t.rangeCount)return null;var n=t.anchorNode,r=t.anchorOffset,a=t.focusNode,s=t.focusOffset,d=t.getRangeAt(0);try{d.startContainer.nodeType,d.endContainer.nodeType}catch(e){return null}var c=o(t.anchorNode,t.anchorOffset,t.focusNode,t.focusOffset)?0:d.toString().length,i=d.cloneRange();i.selectNodeContents(e),i.setEnd(d.startContainer,d.startOffset);var f=o(i.startContainer,i.startOffset,i.endContainer,i.endOffset)?0:i.toString().length,l=f+c,u=document.createRange();u.setStart(n,r),u.setEnd(a,s);var g=u.collapsed;return{start:g?l:f,end:g?f:l}}function s(e,t){var n,o,r=document.selection.createRange().duplicate();void 0===t.end?o=n=t.start:t.start>t.end?(n=t.end,o=t.start):(n=t.start,o=t.end),r.moveToElementText(e),r.moveStart("character",n),r.setEndPoint("EndToStart",r),r.moveEnd("character",o-n),r.select()}function d(e,o){if(window.getSelection){var r=window.getSelection(),a=e[n()].length,s=Math.min(o.start,a),d=void 0===o.end?s:Math.min(o.end,a);if(!r.extend&&s>d){var c=d;d=s,s=c}var i=t(e,s),f=t(e,d);if(i&&f){var l=document.createRange();l.setStart(i.node,i.offset),r.removeAllRanges(),s>d?(r.addRange(l),r.extend(f.node,f.offset)):(l.setEnd(f.node,f.offset),r.addRange(l))}}}var c=e.canUseDOM&&"selection"in document&&!("getSelection"in window),i={getOffsets:c?r:a,setOffsets:c?s:d};module.exports=i; +},{"fbjs/lib/ExecutionEnvironment":197,"./getNodeForCharacterOffset":193,"./getTextContentAccessor":186}],215:[function(require,module,exports) { +"use strict";function e(e){var o=(e?e.ownerDocument||e:document).defaultView||window;return!(!e||!("function"==typeof o.Node?e instanceof o.Node:"object"==typeof e&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName))}module.exports=e; +},{}],214:[function(require,module,exports) { +"use strict";var e=require("./isNode");function r(r){return e(r)&&3==r.nodeType}module.exports=r; +},{"./isNode":215}],213:[function(require,module,exports) { +"use strict";var o=require("./isTextNode");function e(n,t){return!(!n||!t)&&(n===t||!o(n)&&(o(t)?e(n,t.parentNode):"contains"in n?n.contains(t):!!n.compareDocumentPosition&&!!(16&n.compareDocumentPosition(t))))}module.exports=e; +},{"./isTextNode":214}],206:[function(require,module,exports) { +"use strict";function e(e){if(void 0===(e=e||("undefined"!=typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}module.exports=e; +},{}],147:[function(require,module,exports) { +"use strict";var e=require("./ReactDOMSelection"),t=require("fbjs/lib/containsNode"),n=require("fbjs/lib/focusNode"),a=require("fbjs/lib/getActiveElement");function o(e){return t(document.documentElement,e)}var i={hasSelectionCapabilities:function(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&"text"===e.type||"textarea"===t||"true"===e.contentEditable)},getSelectionInformation:function(){var e=a();return{focusedElem:e,selectionRange:i.hasSelectionCapabilities(e)?i.getSelection(e):null}},restoreSelection:function(e){var t=a(),r=e.focusedElem,c=e.selectionRange;t!==r&&o(r)&&(i.hasSelectionCapabilities(r)&&i.setSelection(r,c),n(r))},getSelection:function(t){var n;if("selectionStart"in t)n={start:t.selectionStart,end:t.selectionEnd};else if(document.selection&&t.nodeName&&"input"===t.nodeName.toLowerCase()){var a=document.selection.createRange();a.parentElement()===t&&(n={start:-a.moveStart("character",-t.value.length),end:-a.moveEnd("character",-t.value.length)})}else n=e.getOffsets(t);return n||{start:0,end:0}},setSelection:function(t,n){var a=n.start,o=n.end;if(void 0===o&&(o=a),"selectionStart"in t)t.selectionStart=a,t.selectionEnd=Math.min(o,t.value.length);else if(document.selection&&t.nodeName&&"input"===t.nodeName.toLowerCase()){var i=t.createTextRange();i.collapse(!0),i.moveStart("character",a),i.moveEnd("character",o-a),i.select()}else e.setOffsets(t,n)}};module.exports=i; +},{"./ReactDOMSelection":179,"fbjs/lib/containsNode":213,"fbjs/lib/focusNode":212,"fbjs/lib/getActiveElement":206}],97:[function(require,module,exports) { +"use strict";var e=require("object-assign"),t=require("./CallbackQueue"),n=require("./PooledClass"),i=require("./ReactBrowserEventEmitter"),r=require("./ReactInputSelection"),a=require("./ReactInstrumentation"),o=require("./Transaction"),u=require("./ReactUpdateQueue"),c={initialize:r.getSelectionInformation,close:r.restoreSelection},s={initialize:function(){var e=i.isEnabled();return i.setEnabled(!1),e},close:function(e){i.setEnabled(e)}},l={initialize:function(){this.reactMountReady.reset()},close:function(){this.reactMountReady.notifyAll()}},d=[c,s,l];function R(e){this.reinitializeTransaction(),this.renderToStaticMarkup=!1,this.reactMountReady=t.getPooled(null),this.useCreateElement=e}var f={getTransactionWrappers:function(){return d},getReactMountReady:function(){return this.reactMountReady},getUpdateQueue:function(){return u},checkpoint:function(){return this.reactMountReady.checkpoint()},rollback:function(e){this.reactMountReady.rollback(e)},destructor:function(){t.release(this.reactMountReady),this.reactMountReady=null}};e(R.prototype,o,f),n.addPoolingTo(R),module.exports=R; +},{"object-assign":162,"./CallbackQueue":101,"./PooledClass":110,"./ReactBrowserEventEmitter":73,"./ReactInputSelection":147,"./ReactInstrumentation":27,"./Transaction":103,"./ReactUpdateQueue":79}],98:[function(require,module,exports) { +"use strict";var e={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"},t={accentHeight:"accent-height",accumulate:0,additive:0,alignmentBaseline:"alignment-baseline",allowReorder:"allowReorder",alphabetic:0,amplitude:0,arabicForm:"arabic-form",ascent:0,attributeName:"attributeName",attributeType:"attributeType",autoReverse:"autoReverse",azimuth:0,baseFrequency:"baseFrequency",baseProfile:"baseProfile",baselineShift:"baseline-shift",bbox:0,begin:0,bias:0,by:0,calcMode:"calcMode",capHeight:"cap-height",clip:0,clipPath:"clip-path",clipRule:"clip-rule",clipPathUnits:"clipPathUnits",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",contentScriptType:"contentScriptType",contentStyleType:"contentStyleType",cursor:0,cx:0,cy:0,d:0,decelerate:0,descent:0,diffuseConstant:"diffuseConstant",direction:0,display:0,divisor:0,dominantBaseline:"dominant-baseline",dur:0,dx:0,dy:0,edgeMode:"edgeMode",elevation:0,enableBackground:"enable-background",end:0,exponent:0,externalResourcesRequired:"externalResourcesRequired",fill:0,fillOpacity:"fill-opacity",fillRule:"fill-rule",filter:0,filterRes:"filterRes",filterUnits:"filterUnits",floodColor:"flood-color",floodOpacity:"flood-opacity",focusable:0,fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",format:0,from:0,fx:0,fy:0,g1:0,g2:0,glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",glyphRef:"glyphRef",gradientTransform:"gradientTransform",gradientUnits:"gradientUnits",hanging:0,horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",ideographic:0,imageRendering:"image-rendering",in:0,in2:0,intercept:0,k:0,k1:0,k2:0,k3:0,k4:0,kernelMatrix:"kernelMatrix",kernelUnitLength:"kernelUnitLength",kerning:0,keyPoints:"keyPoints",keySplines:"keySplines",keyTimes:"keyTimes",lengthAdjust:"lengthAdjust",letterSpacing:"letter-spacing",lightingColor:"lighting-color",limitingConeAngle:"limitingConeAngle",local:0,markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",markerHeight:"markerHeight",markerUnits:"markerUnits",markerWidth:"markerWidth",mask:0,maskContentUnits:"maskContentUnits",maskUnits:"maskUnits",mathematical:0,mode:0,numOctaves:"numOctaves",offset:0,opacity:0,operator:0,order:0,orient:0,orientation:0,origin:0,overflow:0,overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pathLength:"pathLength",patternContentUnits:"patternContentUnits",patternTransform:"patternTransform",patternUnits:"patternUnits",pointerEvents:"pointer-events",points:0,pointsAtX:"pointsAtX",pointsAtY:"pointsAtY",pointsAtZ:"pointsAtZ",preserveAlpha:"preserveAlpha",preserveAspectRatio:"preserveAspectRatio",primitiveUnits:"primitiveUnits",r:0,radius:0,refX:"refX",refY:"refY",renderingIntent:"rendering-intent",repeatCount:"repeatCount",repeatDur:"repeatDur",requiredExtensions:"requiredExtensions",requiredFeatures:"requiredFeatures",restart:0,result:0,rotate:0,rx:0,ry:0,scale:0,seed:0,shapeRendering:"shape-rendering",slope:0,spacing:0,specularConstant:"specularConstant",specularExponent:"specularExponent",speed:0,spreadMethod:"spreadMethod",startOffset:"startOffset",stdDeviation:"stdDeviation",stemh:0,stemv:0,stitchTiles:"stitchTiles",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",string:0,stroke:0,strokeDasharray:"stroke-dasharray",strokeDashoffset:"stroke-dashoffset",strokeLinecap:"stroke-linecap",strokeLinejoin:"stroke-linejoin",strokeMiterlimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",surfaceScale:"surfaceScale",systemLanguage:"systemLanguage",tableValues:"tableValues",targetX:"targetX",targetY:"targetY",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",textLength:"textLength",to:0,transform:0,u1:0,u2:0,underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicode:0,unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",values:0,vectorEffect:"vector-effect",version:0,vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",viewBox:"viewBox",viewTarget:"viewTarget",visibility:0,widths:0,wordSpacing:"word-spacing",writingMode:"writing-mode",x:0,xHeight:"x-height",x1:0,x2:0,xChannelSelector:"xChannelSelector",xlinkActuate:"xlink:actuate",xlinkArcrole:"xlink:arcrole",xlinkHref:"xlink:href",xlinkRole:"xlink:role",xlinkShow:"xlink:show",xlinkTitle:"xlink:title",xlinkType:"xlink:type",xmlBase:"xml:base",xmlns:0,xmlnsXlink:"xmlns:xlink",xmlLang:"xml:lang",xmlSpace:"xml:space",y:0,y1:0,y2:0,yChannelSelector:"yChannelSelector",z:0,zoomAndPan:"zoomAndPan"},i={Properties:{},DOMAttributeNamespaces:{xlinkActuate:e.xlink,xlinkArcrole:e.xlink,xlinkHref:e.xlink,xlinkRole:e.xlink,xlinkShow:e.xlink,xlinkTitle:e.xlink,xlinkType:e.xlink,xmlBase:e.xml,xmlLang:e.xml,xmlSpace:e.xml},DOMAttributeNames:{}};Object.keys(t).forEach(function(e){i.Properties[e]=0,t[e]&&(i.DOMAttributeNames[e]=t[e])}),module.exports=i; +},{}],99:[function(require,module,exports) { +"use strict";var e=require("./EventPropagators"),t=require("fbjs/lib/ExecutionEnvironment"),n=require("./ReactDOMComponentTree"),o=require("./ReactInputSelection"),r=require("./SyntheticEvent"),u=require("fbjs/lib/getActiveElement"),c=require("./isTextInputElement"),l=require("fbjs/lib/shallowEqual"),i=t.canUseDOM&&"documentMode"in document&&document.documentMode<=11,a={select:{phasedRegistrationNames:{bubbled:"onSelect",captured:"onSelectCapture"},dependencies:["topBlur","topContextMenu","topFocus","topKeyDown","topKeyUp","topMouseDown","topMouseUp","topSelectionChange"]}},s=null,p=null,d=null,f=!1,b=!1;function m(e){if("selectionStart"in e&&o.hasSelectionCapabilities(e))return{start:e.selectionStart,end:e.selectionEnd};if(window.getSelection){var t=window.getSelection();return{anchorNode:t.anchorNode,anchorOffset:t.anchorOffset,focusNode:t.focusNode,focusOffset:t.focusOffset}}if(document.selection){var n=document.selection.createRange();return{parentElement:n.parentElement(),text:n.text,top:n.boundingTop,left:n.boundingLeft}}}function g(t,n){if(f||null==s||s!==u())return null;var o=m(s);if(!d||!l(d,o)){d=o;var c=r.getPooled(a.select,p,t,n);return c.type="select",c.target=s,e.accumulateTwoPhaseDispatches(c),c}return null}var h={eventTypes:a,extractEvents:function(e,t,o,r){if(!b)return null;var u=t?n.getNodeFromInstance(t):window;switch(e){case"topFocus":(c(u)||"true"===u.contentEditable)&&(s=u,p=t,d=null);break;case"topBlur":s=null,p=null,d=null;break;case"topMouseDown":f=!0;break;case"topContextMenu":case"topMouseUp":return f=!1,g(o,r);case"topSelectionChange":if(i)break;case"topKeyDown":case"topKeyUp":return g(o,r)}return null},didPutListener:function(e,t,n){"onSelect"===t&&(b=!0)}};module.exports=h; +},{"./EventPropagators":132,"fbjs/lib/ExecutionEnvironment":197,"./ReactDOMComponentTree":18,"./ReactInputSelection":147,"./SyntheticEvent":141,"fbjs/lib/getActiveElement":206,"./isTextInputElement":143,"fbjs/lib/shallowEqual":207}],148:[function(require,module,exports) { +"use strict";var e=require("./SyntheticEvent"),l={animationName:null,elapsedTime:null,pseudoElement:null};function n(l,n,t,u){return e.call(this,l,n,t,u)}e.augmentClass(n,l),module.exports=n; +},{"./SyntheticEvent":141}],149:[function(require,module,exports) { +"use strict";var a=require("./SyntheticEvent"),t={clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}};function r(t,r,i,n){return a.call(this,t,r,i,n)}a.augmentClass(r,t),module.exports=r; +},{"./SyntheticEvent":141}],150:[function(require,module,exports) { +"use strict";var e=require("./SyntheticUIEvent"),t={relatedTarget:null};function r(t,r,l,n){return e.call(this,t,r,l,n)}e.augmentClass(r,t),module.exports=r; +},{"./SyntheticUIEvent":155}],157:[function(require,module,exports) { +"use strict";function e(e){var r,o=e.keyCode;return"charCode"in e?0===(r=e.charCode)&&13===o&&(r=13):r=o,r>=32||13===r?r:0}module.exports=e; +},{}],190:[function(require,module,exports) { +"use strict";var e=require("./getEventCharCode"),r={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},t={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"};function o(o){if(o.key){var n=r[o.key]||o.key;if("Unidentified"!==n)return n}if("keypress"===o.type){var i=e(o);return 13===i?"Enter":String.fromCharCode(i)}return"keydown"===o.type||"keyup"===o.type?t[o.keyCode]||"Unidentified":""}module.exports=o; +},{"./getEventCharCode":157}],151:[function(require,module,exports) { +"use strict";var e=require("./SyntheticUIEvent"),t=require("./getEventCharCode"),n=require("./getEventKey"),r=require("./getEventModifierState"),u={key:n,location:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,repeat:null,locale:null,getModifierState:r,charCode:function(e){return"keypress"===e.type?t(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?t(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}};function l(t,n,r,u){return e.call(this,t,n,r,u)}e.augmentClass(l,u),module.exports=l; +},{"./SyntheticUIEvent":155,"./getEventCharCode":157,"./getEventKey":190,"./getEventModifierState":161}],152:[function(require,module,exports) { +"use strict";var e=require("./SyntheticMouseEvent"),t={dataTransfer:null};function r(t,r,n,s){return e.call(this,t,r,n,s)}e.augmentClass(r,t),module.exports=r; +},{"./SyntheticMouseEvent":133}],153:[function(require,module,exports) { +"use strict";var e=require("./SyntheticUIEvent"),t=require("./getEventModifierState"),l={touches:null,targetTouches:null,changedTouches:null,altKey:null,metaKey:null,ctrlKey:null,shiftKey:null,getModifierState:t};function u(t,l,u,n){return e.call(this,t,l,u,n)}e.augmentClass(u,l),module.exports=u; +},{"./SyntheticUIEvent":155,"./getEventModifierState":161}],154:[function(require,module,exports) { +"use strict";var e=require("./SyntheticEvent"),l={propertyName:null,elapsedTime:null,pseudoElement:null};function t(l,t,n,u){return e.call(this,l,t,n,u)}e.augmentClass(t,l),module.exports=t; +},{"./SyntheticEvent":141}],156:[function(require,module,exports) { +"use strict";var e=require("./SyntheticMouseEvent"),l={deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:null,deltaMode:null};function t(l,t,n,a){return e.call(this,l,t,n,a)}e.augmentClass(t,l),module.exports=t; +},{"./SyntheticMouseEvent":133}],100:[function(require,module,exports) { +"use strict";var e=require("./reactProdInvariant"),t=require("fbjs/lib/EventListener"),a=require("./EventPropagators"),o=require("./ReactDOMComponentTree"),r=require("./SyntheticAnimationEvent"),n=require("./SyntheticClipboardEvent"),c=require("./SyntheticEvent"),s=require("./SyntheticFocusEvent"),i=require("./SyntheticKeyboardEvent"),p=require("./SyntheticMouseEvent"),u=require("./SyntheticDragEvent"),d=require("./SyntheticTouchEvent"),l=require("./SyntheticTransitionEvent"),v=require("./SyntheticUIEvent"),h=require("./SyntheticWheelEvent"),g=require("fbjs/lib/emptyFunction"),y=require("./getEventCharCode"),E=require("fbjs/lib/invariant"),b={},m={};["abort","animationEnd","animationIteration","animationStart","blur","canPlay","canPlayThrough","click","contextMenu","copy","cut","doubleClick","drag","dragEnd","dragEnter","dragExit","dragLeave","dragOver","dragStart","drop","durationChange","emptied","encrypted","ended","error","focus","input","invalid","keyDown","keyPress","keyUp","load","loadedData","loadedMetadata","loadStart","mouseDown","mouseMove","mouseOut","mouseOver","mouseUp","paste","pause","play","playing","progress","rateChange","reset","scroll","seeked","seeking","stalled","submit","suspend","timeUpdate","touchCancel","touchEnd","touchMove","touchStart","transitionEnd","volumeChange","waiting","wheel"].forEach(function(e){var t=e[0].toUpperCase()+e.slice(1),a="on"+t,o="top"+t,r={phasedRegistrationNames:{bubbled:a,captured:a+"Capture"},dependencies:[o]};b[e]=r,m[o]=r});var S={};function k(e){return"."+e._rootNodeID}function C(e){return"button"===e||"input"===e||"select"===e||"textarea"===e}var D={eventTypes:b,extractEvents:function(t,o,g,E){var b,S=m[t];if(!S)return null;switch(t){case"topAbort":case"topCanPlay":case"topCanPlayThrough":case"topDurationChange":case"topEmptied":case"topEncrypted":case"topEnded":case"topError":case"topInput":case"topInvalid":case"topLoad":case"topLoadedData":case"topLoadedMetadata":case"topLoadStart":case"topPause":case"topPlay":case"topPlaying":case"topProgress":case"topRateChange":case"topReset":case"topSeeked":case"topSeeking":case"topStalled":case"topSubmit":case"topSuspend":case"topTimeUpdate":case"topVolumeChange":case"topWaiting":b=c;break;case"topKeyPress":if(0===y(g))return null;case"topKeyDown":case"topKeyUp":b=i;break;case"topBlur":case"topFocus":b=s;break;case"topClick":if(2===g.button)return null;case"topDoubleClick":case"topMouseDown":case"topMouseMove":case"topMouseUp":case"topMouseOut":case"topMouseOver":case"topContextMenu":b=p;break;case"topDrag":case"topDragEnd":case"topDragEnter":case"topDragExit":case"topDragLeave":case"topDragOver":case"topDragStart":case"topDrop":b=u;break;case"topTouchCancel":case"topTouchEnd":case"topTouchMove":case"topTouchStart":b=d;break;case"topAnimationEnd":case"topAnimationIteration":case"topAnimationStart":b=r;break;case"topTransitionEnd":b=l;break;case"topScroll":b=v;break;case"topWheel":b=h;break;case"topCopy":case"topCut":case"topPaste":b=n}b||e("86",t);var k=b.getPooled(S,o,g,E);return a.accumulateTwoPhaseDispatches(k),k},didPutListener:function(e,a,r){if("onClick"===a&&!C(e._tag)){var n=k(e),c=o.getNodeFromInstance(e);S[n]||(S[n]=t.listen(c,"click",g))}},willDeleteListener:function(e,t){if("onClick"===t&&!C(e._tag)){var a=k(e);S[a].remove(),delete S[a]}}};module.exports=D; +},{"./reactProdInvariant":108,"fbjs/lib/EventListener":205,"./EventPropagators":132,"./ReactDOMComponentTree":18,"./SyntheticAnimationEvent":148,"./SyntheticClipboardEvent":149,"./SyntheticEvent":141,"./SyntheticFocusEvent":150,"./SyntheticKeyboardEvent":151,"./SyntheticMouseEvent":133,"./SyntheticDragEvent":152,"./SyntheticTouchEvent":153,"./SyntheticTransitionEvent":154,"./SyntheticUIEvent":155,"./SyntheticWheelEvent":156,"fbjs/lib/emptyFunction":181,"./getEventCharCode":157,"fbjs/lib/invariant":180}],19:[function(require,module,exports) { +"use strict";var e=require("./ARIADOMPropertyConfig"),n=require("./BeforeInputEventPlugin"),t=require("./ChangeEventPlugin"),r=require("./DefaultEventPluginOrder"),i=require("./EnterLeaveEventPlugin"),o=require("./HTMLDOMPropertyConfig"),u=require("./ReactComponentBrowserEnvironment"),c=require("./ReactDOMComponent"),a=require("./ReactDOMComponentTree"),l=require("./ReactDOMEmptyComponent"),p=require("./ReactDOMTreeTraversal"),g=require("./ReactDOMTextComponent"),E=require("./ReactDefaultBatchingStrategy"),v=require("./ReactEventListener"),P=require("./ReactInjection"),m=require("./ReactReconcileTransaction"),C=require("./SVGDOMPropertyConfig"),s=require("./SelectEventPlugin"),q=require("./SimpleEventPlugin"),j=!1;function y(){j||(j=!0,P.EventEmitter.injectReactEventListener(v),P.EventPluginHub.injectEventPluginOrder(r),P.EventPluginUtils.injectComponentTree(a),P.EventPluginUtils.injectTreeTraversal(p),P.EventPluginHub.injectEventPluginsByName({SimpleEventPlugin:q,EnterLeaveEventPlugin:i,ChangeEventPlugin:t,SelectEventPlugin:s,BeforeInputEventPlugin:n}),P.HostComponent.injectGenericComponentClass(c),P.HostComponent.injectTextComponentClass(g),P.DOMProperty.injectDOMPropertyConfig(e),P.DOMProperty.injectDOMPropertyConfig(o),P.DOMProperty.injectDOMPropertyConfig(C),P.EmptyComponent.injectEmptyComponentFactory(function(e){return new l(e)}),P.Updates.injectReconcileTransaction(m),P.Updates.injectBatchingStrategy(E),P.Component.injectEnvironment(u))}module.exports={inject:y}; +},{"./ARIADOMPropertyConfig":83,"./BeforeInputEventPlugin":84,"./ChangeEventPlugin":85,"./DefaultEventPluginOrder":86,"./EnterLeaveEventPlugin":87,"./HTMLDOMPropertyConfig":88,"./ReactComponentBrowserEnvironment":89,"./ReactDOMComponent":90,"./ReactDOMComponentTree":18,"./ReactDOMEmptyComponent":92,"./ReactDOMTreeTraversal":91,"./ReactDOMTextComponent":93,"./ReactDefaultBatchingStrategy":94,"./ReactEventListener":95,"./ReactInjection":96,"./ReactReconcileTransaction":97,"./SVGDOMPropertyConfig":98,"./SelectEventPlugin":99,"./SimpleEventPlugin":100}],74:[function(require,module,exports) { +"use strict";var e=require("./validateDOMNesting"),n=9;function o(e,o){var r={_topLevelWrapper:e,_idCounter:1,_ownerDocument:o?o.nodeType===n?o:o.ownerDocument:null,_node:o,_tag:o?o.nodeName.toLowerCase():null,_namespaceURI:o?o.namespaceURI:null};return r}module.exports=o; +},{"./validateDOMNesting":130}],75:[function(require,module,exports) { +"use strict";var e={useCreateElement:!0,useFiber:!1};module.exports=e; +},{}],131:[function(require,module,exports) { +"use strict";var r=65521;function t(t){for(var o=1,e=0,a=0,c=t.length,h=-4&c;a/,t=/^<\!\-\-/,a={CHECKSUM_ATTR_NAME:"data-react-checksum",addChecksumToMarkup:function(u){var c=e(u);return t.test(u)?u:u.replace(r," "+a.CHECKSUM_ATTR_NAME+'="'+c+'"$&')},canReuseMarkup:function(r,t){var u=t.getAttribute(a.CHECKSUM_ATTR_NAME);return u=u&&parseInt(u,10),e(r)===u}};module.exports=a; +},{"./adler32":131}],20:[function(require,module,exports) { +"use strict";var e=require("./reactProdInvariant"),t=require("./DOMLazyTree"),n=require("./DOMProperty"),r=require("react/lib/React"),o=require("./ReactBrowserEventEmitter"),a=require("react/lib/ReactCurrentOwner"),i=require("./ReactDOMComponentTree"),u=require("./ReactDOMContainerInfo"),c=require("./ReactDOMFeatureFlags"),l=require("./ReactFeatureFlags"),s=require("./ReactInstanceMap"),d=require("./ReactInstrumentation"),p=require("./ReactMarkupChecksum"),m=require("./ReactReconciler"),f=require("./ReactUpdateQueue"),v=require("./ReactUpdates"),C=require("fbjs/lib/emptyObject"),R=require("./instantiateReactComponent"),h=require("fbjs/lib/invariant"),_=require("./setInnerHTML"),T=require("./shouldUpdateReactComponent"),b=require("fbjs/lib/warning"),I=n.ID_ATTRIBUTE_NAME,g=n.ROOT_ATTRIBUTE_NAME,q=1,E=9,M=11,y={};function A(e,t){for(var n=Math.min(e.length,t.length),r=0;r.":"function"==typeof n?" Instead of passing a class like Foo, pass React.createElement(Foo) or .":null!=n&&void 0!==n.props?" This may be caused by unintentionally loading two independent copies of React.":"");var i,u=r.createElement(j,{child:n});if(t){var c=s.get(t);i=c._processChildContext(c._context)}else i=C;var l=B(o);if(l){var d=l._currentElement.props.child;if(T(d,n)){var p=l._renderedComponent.getPublicInstance(),m=a&&function(){a.call(p)};return W._updateRootComponent(l,u,i,o,m),p}W.unmountComponentAtNode(o)}var v=N(o),R=v&&!!D(v),h=L(o),_=R&&!l&&!h,b=W._renderNewRootComponent(u,o,_,i)._renderedComponent.getPublicInstance();return a&&a.call(b),b},render:function(e,t,n){return W._renderSubtreeIntoContainer(null,e,t,n)},unmountComponentAtNode:function(t){k(t)||e("40");var n=B(t);if(!n){L(t),1===t.nodeType&&t.hasAttribute(g);return!1}return delete y[n._instance.rootID],v.batchedUpdates(U,n,t,!1),!0},_mountImageIntoNode:function(n,r,o,a,u){if(k(r)||e("41"),a){var c=N(r);if(p.canReuseMarkup(n,c))return void i.precacheNode(o,c);var l=c.getAttribute(p.CHECKSUM_ATTR_NAME);c.removeAttribute(p.CHECKSUM_ATTR_NAME);var s=c.outerHTML;c.setAttribute(p.CHECKSUM_ATTR_NAME,l);var d=n,m=A(d,s),f=" (client) "+d.substring(m-20,m+20)+"\n (server) "+s.substring(m-20,m+20);r.nodeType===E&&e("42",f)}if(r.nodeType===E&&e("43"),u.useCreateElement){for(;r.lastChild;)r.removeChild(r.lastChild);t.insertTreeBefore(r,n,null)}else _(r,n),i.precacheNode(o,r.firstChild)}};module.exports=W; +},{"./reactProdInvariant":108,"./DOMLazyTree":71,"./DOMProperty":72,"react/lib/React":13,"./ReactBrowserEventEmitter":73,"react/lib/ReactCurrentOwner":112,"./ReactDOMComponentTree":18,"./ReactDOMContainerInfo":74,"./ReactDOMFeatureFlags":75,"./ReactFeatureFlags":76,"./ReactInstanceMap":77,"./ReactInstrumentation":27,"./ReactMarkupChecksum":78,"./ReactReconciler":21,"./ReactUpdateQueue":79,"./ReactUpdates":22,"fbjs/lib/emptyObject":202,"./instantiateReactComponent":80,"fbjs/lib/invariant":180,"./setInnerHTML":81,"./shouldUpdateReactComponent":82,"fbjs/lib/warning":183}],25:[function(require,module,exports) { +"use strict";var e=require("./ReactNodeTypes");function r(r){for(var n;(n=r._renderedNodeType)===e.COMPOSITE;)r=r._renderedComponent;return n===e.HOST?r._renderedComponent:n===e.EMPTY?null:void 0}module.exports=r; +},{"./ReactNodeTypes":106}],24:[function(require,module,exports) { +"use strict";var e=require("./reactProdInvariant"),r=require("react/lib/ReactCurrentOwner"),n=require("./ReactDOMComponentTree"),t=require("./ReactInstanceMap"),i=require("./getHostComponentFromComposite"),u=require("fbjs/lib/invariant"),o=require("fbjs/lib/warning");function a(r){if(null==r)return null;if(1===r.nodeType)return r;var u=t.get(r);if(u)return(u=i(u))?n.getNodeFromInstance(u):null;"function"==typeof r.render?e("44"):e("45",Object.keys(r))}module.exports=a; +},{"./reactProdInvariant":108,"react/lib/ReactCurrentOwner":112,"./ReactDOMComponentTree":18,"./ReactInstanceMap":77,"./getHostComponentFromComposite":25,"fbjs/lib/invariant":180,"fbjs/lib/warning":183}],26:[function(require,module,exports) { +"use strict";var e=require("./ReactMount");module.exports=e.renderSubtreeIntoContainer; +},{"./ReactMount":20}],28:[function(require,module,exports) { +"use strict";var e,n,r,o=require("./DOMProperty"),t=require("./EventPluginRegistry"),i=require("react/lib/ReactComponentTreeHook"),p=require("fbjs/lib/warning"),u=function(e,n){var o=[];for(var t in n.props){r(n.type,t,e)||o.push(t)}o.map(function(e){return"`"+e+"`"}).join(", ");1===o.length||o.length};function f(e,n){null!=n&&"string"==typeof n.type&&(n.type.indexOf("-")>=0||n.props.is||u(e,n))}var s={onBeforeMountComponent:function(e,n){f(e,n)},onBeforeUpdateComponent:function(e,n){f(e,n)}};module.exports=s; +},{"./DOMProperty":72,"./EventPluginRegistry":107,"react/lib/ReactComponentTreeHook":115,"fbjs/lib/warning":183}],29:[function(require,module,exports) { +"use strict";var e=require("react/lib/ReactComponentTreeHook"),n=require("fbjs/lib/warning"),o=!1;function t(e,n){null!=n&&("input"!==n.type&&"textarea"!==n.type&&"select"!==n.type||null==n.props||null!==n.props.value||o||(o=!0))}var r={onBeforeMountComponent:function(e,n){t(e,n)},onBeforeUpdateComponent:function(e,n){t(e,n)}};module.exports=r; +},{"react/lib/ReactComponentTreeHook":115,"fbjs/lib/warning":183}],30:[function(require,module,exports) { +"use strict";var e=require("./DOMProperty"),n=require("react/lib/ReactComponentTreeHook"),r=require("fbjs/lib/warning"),t={},o=new RegExp("^(aria)-["+e.ATTRIBUTE_NAME_CHAR+"]*$");function i(n,r,i){if(t.hasOwnProperty(r)&&t[r])return!0;if(o.test(r)){var a=r.toLowerCase(),u=e.getPossibleStandardName.hasOwnProperty(a)?e.getPossibleStandardName[a]:null;if(null==u)return t[r]=!0,!1;if(r!==u)return t[r]=!0,!0}return!0}function a(e,n){var r=[];for(var t in n.props){i(n.type,t,e)||r.push(t)}r.map(function(e){return"`"+e+"`"}).join(", ");1===r.length||r.length}function u(e,n){null!=n&&"string"==typeof n.type&&(n.type.indexOf("-")>=0||n.props.is||a(e,n))}var p={onBeforeMountComponent:function(e,n){0},onBeforeUpdateComponent:function(e,n){0}};module.exports=p; +},{"./DOMProperty":72,"react/lib/ReactComponentTreeHook":115,"fbjs/lib/warning":183}],12:[function(require,module,exports) { +"use strict";var e=require("./ReactDOMComponentTree"),n=require("./ReactDefaultInjection"),t=require("./ReactMount"),r=require("./ReactReconciler"),o=require("./ReactUpdates"),i=require("./ReactVersion"),u=require("./findDOMNode"),d=require("./getHostComponentFromComposite"),_=require("./renderSubtreeIntoContainer"),a=require("fbjs/lib/warning");n.inject();var c,s,O,m,C,p,l,R,q,f,L={findDOMNode:u,render:t.render,unmountComponentAtNode:t.unmountComponentAtNode,version:i,unstable_batchedUpdates:o.batchedUpdates,unstable_renderSubtreeIntoContainer:_};"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.inject&&__REACT_DEVTOOLS_GLOBAL_HOOK__.inject({ComponentTree:{getClosestInstanceFromNode:e.getClosestInstanceFromNode,getNodeFromInstance:function(n){return n._renderedComponent&&(n=d(n)),n?e.getNodeFromInstance(n):null}},Mount:t,Reconciler:r}),module.exports=L; +},{"./ReactDOMComponentTree":18,"./ReactDefaultInjection":19,"./ReactMount":20,"./ReactReconciler":21,"./ReactUpdates":22,"./ReactVersion":36,"./findDOMNode":24,"./getHostComponentFromComposite":25,"./renderSubtreeIntoContainer":26,"fbjs/lib/warning":183,"fbjs/lib/ExecutionEnvironment":197,"./ReactInstrumentation":27,"./ReactDOMUnknownPropertyHook":28,"./ReactDOMNullInputValuePropHook":29,"./ReactDOMInvalidARIAHook":30}],9:[function(require,module,exports) { +"use strict";module.exports=require("./lib/ReactDOM"); +},{"./lib/ReactDOM":12}],67:[function(require,module,exports) { +"use strict";var e=require("fbjs/lib/emptyFunction"),r=require("fbjs/lib/invariant"),t=require("./lib/ReactPropTypesSecret");module.exports=function(){function o(e,o,p,n,s,a){a!==t&&r(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types")}function p(){return o}o.isRequired=o;var n={array:o,bool:o,func:o,number:o,object:o,string:o,symbol:o,any:o,arrayOf:p,element:o,instanceOf:p,node:o,objectOf:p,oneOf:p,oneOfType:p,shape:p,exact:p};return n.checkPropTypes=e,n.PropTypes=n,n}; +},{"fbjs/lib/emptyFunction":181,"fbjs/lib/invariant":180,"./lib/ReactPropTypesSecret":175}],16:[function(require,module,exports) { +var r,e,i;module.exports=require("./factoryWithThrowingShims")(); +},{"./factoryWithTypeCheckers":66,"./factoryWithThrowingShims":67}],6:[function(require,module,exports) { +"use strict";var e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};Object.defineProperty(exports,"__esModule",{value:!0});var t=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(o[r]=e[r]);return o}function c(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function p(t,o){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!o||"object"!==(void 0===o?"undefined":e(o))&&"function"!=typeof o?t:o}function s(t,o){if("function"!=typeof o&&null!==o)throw new TypeError("Super expression must either be null or a function, not "+(void 0===o?"undefined":e(o)));t.prototype=Object.create(o&&o.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),o&&(Object.setPrototypeOf?Object.setPrototypeOf(t,o):t.__proto__=o)}var f=function(e){function r(){var e,t,o;c(this,r);for(var n=arguments.length,a=Array(n),i=0;i100?f.throwError('Invalid Props: "completed" should be between 0 and 100'):void 0},color:i.default.string,animation:i.default.number,height:i.default.oneOfType([i.default.string,i.default.number])},f.defaultProps={completed:0,color:"#0BD318",animation:200,height:10},exports.default=f; +},{"react":8,"prop-types":16}],4:[function(require,module,exports) { +"use strict";var e=function(){function e(e,t){for(var r=0;r 100) { - window.clearInterval(id); - }; - }, 1000); - }, - - render: function () { - return ( - - ); - } -}); - -React.render(, document.body); - -module.exports = ProgressBarDemo; \ No newline at end of file diff --git a/demo/index.html b/demo/index.html index 4055a6a..56bf1f1 100644 --- a/demo/index.html +++ b/demo/index.html @@ -1,10 +1 @@ - - - - - react-progressbar - - - - - + react-progressbar
\ No newline at end of file diff --git a/demo/script.js b/demo/script.js deleted file mode 100644 index 516fca4..0000000 --- a/demo/script.js +++ /dev/null @@ -1,18373 +0,0 @@ -(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 100) { - window.clearInterval(id); - }; - }, 1000); - }, - - render: function () { - return ( - React.createElement("div", null, - React.createElement("h1", null, "react-progressbar"), - React.createElement("a", {href: "http://paramaggarwal.github.io/react-progressbar/"}, 'http://paramaggarwal.github.io/react-progressbar/'), - React.createElement("br", null), React.createElement("br", null), - - React.createElement(ProgressBar, {completed: this.state.completed}) - ) - ); - } -}); - -React.render(React.createElement(ProgressBarDemo, null), document.body); - -module.exports = ProgressBarDemo; - -},{"../":2,"react":148}],2:[function(require,module,exports){ -/** - * @jsx React.DOM - */ -'use strict'; - -var React = require('react'); - -var component = React.createClass({displayName: "component", - - render: function() { - - var completed = +this.props.completed; - if (completed < 0) {completed = 0}; - if (completed > 100) {completed = 100}; - - var style = { - backgroundColor: this.props.color || '#0BD318', - width: completed + '%', - transition: "width 200ms", - height: 10 - }; - - return ( - React.createElement("div", {className: "progressbar-container"}, - React.createElement("div", {className: "progressbar-progress", style: style} - ) - ) - ); - } -}); - -module.exports = component; - -},{"react":148}],3:[function(require,module,exports){ -/** - * Copyright 2013-2014, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * @providesModule AutoFocusMixin - * @typechecks static-only - */ - -"use strict"; - -var focusNode = require("./focusNode"); - -var AutoFocusMixin = { - componentDidMount: function() { - if (this.props.autoFocus) { - focusNode(this.getDOMNode()); - } - } -}; - -module.exports = AutoFocusMixin; - -},{"./focusNode":113}],4:[function(require,module,exports){ -/** - * Copyright 2013 Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * @providesModule BeforeInputEventPlugin - * @typechecks static-only - */ - -"use strict"; - -var EventConstants = require("./EventConstants"); -var EventPropagators = require("./EventPropagators"); -var ExecutionEnvironment = require("./ExecutionEnvironment"); -var SyntheticInputEvent = require("./SyntheticInputEvent"); - -var keyOf = require("./keyOf"); - -var canUseTextInputEvent = ( - ExecutionEnvironment.canUseDOM && - 'TextEvent' in window && - !('documentMode' in document || isPresto()) -); - -/** - * Opera <= 12 includes TextEvent in window, but does not fire - * text input events. Rely on keypress instead. - */ -function isPresto() { - var opera = window.opera; - return ( - typeof opera === 'object' && - typeof opera.version === 'function' && - parseInt(opera.version(), 10) <= 12 - ); -} - -var SPACEBAR_CODE = 32; -var SPACEBAR_CHAR = String.fromCharCode(SPACEBAR_CODE); - -var topLevelTypes = EventConstants.topLevelTypes; - -// Events and their corresponding property names. -var eventTypes = { - beforeInput: { - phasedRegistrationNames: { - bubbled: keyOf({onBeforeInput: null}), - captured: keyOf({onBeforeInputCapture: null}) - }, - dependencies: [ - topLevelTypes.topCompositionEnd, - topLevelTypes.topKeyPress, - topLevelTypes.topTextInput, - topLevelTypes.topPaste - ] - } -}; - -// Track characters inserted via keypress and composition events. -var fallbackChars = null; - -// Track whether we've ever handled a keypress on the space key. -var hasSpaceKeypress = false; - -/** - * Return whether a native keypress event is assumed to be a command. - * This is required because Firefox fires `keypress` events for key commands - * (cut, copy, select-all, etc.) even though no character is inserted. - */ -function isKeypressCommand(nativeEvent) { - return ( - (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) && - // ctrlKey && altKey is equivalent to AltGr, and is not a command. - !(nativeEvent.ctrlKey && nativeEvent.altKey) - ); -} - -/** - * Create an `onBeforeInput` event to match - * http://www.w3.org/TR/2013/WD-DOM-Level-3-Events-20131105/#events-inputevents. - * - * This event plugin is based on the native `textInput` event - * available in Chrome, Safari, Opera, and IE. This event fires after - * `onKeyPress` and `onCompositionEnd`, but before `onInput`. - * - * `beforeInput` is spec'd but not implemented in any browsers, and - * the `input` event does not provide any useful information about what has - * actually been added, contrary to the spec. Thus, `textInput` is the best - * available event to identify the characters that have actually been inserted - * into the target node. - */ -var BeforeInputEventPlugin = { - - eventTypes: eventTypes, - - /** - * @param {string} topLevelType Record from `EventConstants`. - * @param {DOMEventTarget} topLevelTarget The listening component root node. - * @param {string} topLevelTargetID ID of `topLevelTarget`. - * @param {object} nativeEvent Native browser event. - * @return {*} An accumulation of synthetic events. - * @see {EventPluginHub.extractEvents} - */ - extractEvents: function( - topLevelType, - topLevelTarget, - topLevelTargetID, - nativeEvent) { - - var chars; - - if (canUseTextInputEvent) { - switch (topLevelType) { - case topLevelTypes.topKeyPress: - /** - * If native `textInput` events are available, our goal is to make - * use of them. However, there is a special case: the spacebar key. - * In Webkit, preventing default on a spacebar `textInput` event - * cancels character insertion, but it *also* causes the browser - * to fall back to its default spacebar behavior of scrolling the - * page. - * - * Tracking at: - * https://code.google.com/p/chromium/issues/detail?id=355103 - * - * To avoid this issue, use the keypress event as if no `textInput` - * event is available. - */ - var which = nativeEvent.which; - if (which !== SPACEBAR_CODE) { - return; - } - - hasSpaceKeypress = true; - chars = SPACEBAR_CHAR; - break; - - case topLevelTypes.topTextInput: - // Record the characters to be added to the DOM. - chars = nativeEvent.data; - - // If it's a spacebar character, assume that we have already handled - // it at the keypress level and bail immediately. Android Chrome - // doesn't give us keycodes, so we need to blacklist it. - if (chars === SPACEBAR_CHAR && hasSpaceKeypress) { - return; - } - - // Otherwise, carry on. - break; - - default: - // For other native event types, do nothing. - return; - } - } else { - switch (topLevelType) { - case topLevelTypes.topPaste: - // If a paste event occurs after a keypress, throw out the input - // chars. Paste events should not lead to BeforeInput events. - fallbackChars = null; - break; - case topLevelTypes.topKeyPress: - /** - * As of v27, Firefox may fire keypress events even when no character - * will be inserted. A few possibilities: - * - * - `which` is `0`. Arrow keys, Esc key, etc. - * - * - `which` is the pressed key code, but no char is available. - * Ex: 'AltGr + d` in Polish. There is no modified character for - * this key combination and no character is inserted into the - * document, but FF fires the keypress for char code `100` anyway. - * No `input` event will occur. - * - * - `which` is the pressed key code, but a command combination is - * being used. Ex: `Cmd+C`. No character is inserted, and no - * `input` event will occur. - */ - if (nativeEvent.which && !isKeypressCommand(nativeEvent)) { - fallbackChars = String.fromCharCode(nativeEvent.which); - } - break; - case topLevelTypes.topCompositionEnd: - fallbackChars = nativeEvent.data; - break; - } - - // If no changes have occurred to the fallback string, no relevant - // event has fired and we're done. - if (fallbackChars === null) { - return; - } - - chars = fallbackChars; - } - - // If no characters are being inserted, no BeforeInput event should - // be fired. - if (!chars) { - return; - } - - var event = SyntheticInputEvent.getPooled( - eventTypes.beforeInput, - topLevelTargetID, - nativeEvent - ); - - event.data = chars; - fallbackChars = null; - EventPropagators.accumulateTwoPhaseDispatches(event); - return event; - } -}; - -module.exports = BeforeInputEventPlugin; - -},{"./EventConstants":17,"./EventPropagators":22,"./ExecutionEnvironment":23,"./SyntheticInputEvent":91,"./keyOf":135}],5:[function(require,module,exports){ -/** - * Copyright 2013-2014, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * @providesModule CSSProperty - */ - -"use strict"; - -/** - * CSS properties which accept numbers but are not in units of "px". - */ -var isUnitlessNumber = { - columnCount: true, - flex: true, - flexGrow: true, - flexShrink: true, - fontWeight: true, - lineClamp: true, - lineHeight: true, - opacity: true, - order: true, - orphans: true, - widows: true, - zIndex: true, - zoom: true, - - // SVG-related properties - fillOpacity: true, - strokeOpacity: true -}; - -/** - * @param {string} prefix vendor-specific prefix, eg: Webkit - * @param {string} key style name, eg: transitionDuration - * @return {string} style name prefixed with `prefix`, properly camelCased, eg: - * WebkitTransitionDuration - */ -function prefixKey(prefix, key) { - return prefix + key.charAt(0).toUpperCase() + key.substring(1); -} - -/** - * Support style names that may come passed in prefixed by adding permutations - * of vendor prefixes. - */ -var prefixes = ['Webkit', 'ms', 'Moz', 'O']; - -// Using Object.keys here, or else the vanilla for-in loop makes IE8 go into an -// infinite loop, because it iterates over the newly added props too. -Object.keys(isUnitlessNumber).forEach(function(prop) { - prefixes.forEach(function(prefix) { - isUnitlessNumber[prefixKey(prefix, prop)] = isUnitlessNumber[prop]; - }); -}); - -/** - * Most style properties can be unset by doing .style[prop] = '' but IE8 - * doesn't like doing that with shorthand properties so for the properties that - * IE8 breaks on, which are listed here, we instead unset each of the - * individual properties. See http://bugs.jquery.com/ticket/12385. - * The 4-value 'clock' properties like margin, padding, border-width seem to - * behave without any problems. Curiously, list-style works too without any - * special prodding. - */ -var shorthandPropertyExpansions = { - background: { - backgroundImage: true, - backgroundPosition: true, - backgroundRepeat: true, - backgroundColor: true - }, - border: { - borderWidth: true, - borderStyle: true, - borderColor: true - }, - borderBottom: { - borderBottomWidth: true, - borderBottomStyle: true, - borderBottomColor: true - }, - borderLeft: { - borderLeftWidth: true, - borderLeftStyle: true, - borderLeftColor: true - }, - borderRight: { - borderRightWidth: true, - borderRightStyle: true, - borderRightColor: true - }, - borderTop: { - borderTopWidth: true, - borderTopStyle: true, - borderTopColor: true - }, - font: { - fontStyle: true, - fontVariant: true, - fontWeight: true, - fontSize: true, - lineHeight: true, - fontFamily: true - } -}; - -var CSSProperty = { - isUnitlessNumber: isUnitlessNumber, - shorthandPropertyExpansions: shorthandPropertyExpansions -}; - -module.exports = CSSProperty; - -},{}],6:[function(require,module,exports){ -(function (process){ -/** - * Copyright 2013-2014, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * @providesModule CSSPropertyOperations - * @typechecks static-only - */ - -"use strict"; - -var CSSProperty = require("./CSSProperty"); -var ExecutionEnvironment = require("./ExecutionEnvironment"); - -var camelizeStyleName = require("./camelizeStyleName"); -var dangerousStyleValue = require("./dangerousStyleValue"); -var hyphenateStyleName = require("./hyphenateStyleName"); -var memoizeStringOnly = require("./memoizeStringOnly"); -var warning = require("./warning"); - -var processStyleName = memoizeStringOnly(function(styleName) { - return hyphenateStyleName(styleName); -}); - -var styleFloatAccessor = 'cssFloat'; -if (ExecutionEnvironment.canUseDOM) { - // IE8 only supports accessing cssFloat (standard) as styleFloat - if (document.documentElement.style.cssFloat === undefined) { - styleFloatAccessor = 'styleFloat'; - } -} - -if ("production" !== process.env.NODE_ENV) { - var warnedStyleNames = {}; - - var warnHyphenatedStyleName = function(name) { - if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) { - return; - } - - warnedStyleNames[name] = true; - ("production" !== process.env.NODE_ENV ? warning( - false, - 'Unsupported style property ' + name + '. Did you mean ' + - camelizeStyleName(name) + '?' - ) : null); - }; -} - -/** - * Operations for dealing with CSS properties. - */ -var CSSPropertyOperations = { - - /** - * Serializes a mapping of style properties for use as inline styles: - * - * > createMarkupForStyles({width: '200px', height: 0}) - * "width:200px;height:0;" - * - * Undefined values are ignored so that declarative programming is easier. - * The result should be HTML-escaped before insertion into the DOM. - * - * @param {object} styles - * @return {?string} - */ - createMarkupForStyles: function(styles) { - var serialized = ''; - for (var styleName in styles) { - if (!styles.hasOwnProperty(styleName)) { - continue; - } - if ("production" !== process.env.NODE_ENV) { - if (styleName.indexOf('-') > -1) { - warnHyphenatedStyleName(styleName); - } - } - var styleValue = styles[styleName]; - if (styleValue != null) { - serialized += processStyleName(styleName) + ':'; - serialized += dangerousStyleValue(styleName, styleValue) + ';'; - } - } - return serialized || null; - }, - - /** - * Sets the value for multiple styles on a node. If a value is specified as - * '' (empty string), the corresponding style property will be unset. - * - * @param {DOMElement} node - * @param {object} styles - */ - setValueForStyles: function(node, styles) { - var style = node.style; - for (var styleName in styles) { - if (!styles.hasOwnProperty(styleName)) { - continue; - } - if ("production" !== process.env.NODE_ENV) { - if (styleName.indexOf('-') > -1) { - warnHyphenatedStyleName(styleName); - } - } - var styleValue = dangerousStyleValue(styleName, styles[styleName]); - if (styleName === 'float') { - styleName = styleFloatAccessor; - } - if (styleValue) { - style[styleName] = styleValue; - } else { - var expansion = CSSProperty.shorthandPropertyExpansions[styleName]; - if (expansion) { - // Shorthand property that IE8 won't like unsetting, so unset each - // component to placate it - for (var individualStyleName in expansion) { - style[individualStyleName] = ''; - } - } else { - style[styleName] = ''; - } - } - } - } - -}; - -module.exports = CSSPropertyOperations; - -}).call(this,require('_process')) -},{"./CSSProperty":5,"./ExecutionEnvironment":23,"./camelizeStyleName":102,"./dangerousStyleValue":107,"./hyphenateStyleName":126,"./memoizeStringOnly":137,"./warning":147,"_process":149}],7:[function(require,module,exports){ -(function (process){ -/** - * Copyright 2013-2014, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * @providesModule CallbackQueue - */ - -"use strict"; - -var PooledClass = require("./PooledClass"); - -var assign = require("./Object.assign"); -var invariant = require("./invariant"); - -/** - * A specialized pseudo-event module to help keep track of components waiting to - * be notified when their DOM representations are available for use. - * - * This implements `PooledClass`, so you should never need to instantiate this. - * Instead, use `CallbackQueue.getPooled()`. - * - * @class ReactMountReady - * @implements PooledClass - * @internal - */ -function CallbackQueue() { - this._callbacks = null; - this._contexts = null; -} - -assign(CallbackQueue.prototype, { - - /** - * Enqueues a callback to be invoked when `notifyAll` is invoked. - * - * @param {function} callback Invoked when `notifyAll` is invoked. - * @param {?object} context Context to call `callback` with. - * @internal - */ - enqueue: function(callback, context) { - this._callbacks = this._callbacks || []; - this._contexts = this._contexts || []; - this._callbacks.push(callback); - this._contexts.push(context); - }, - - /** - * Invokes all enqueued callbacks and clears the queue. This is invoked after - * the DOM representation of a component has been created or updated. - * - * @internal - */ - notifyAll: function() { - var callbacks = this._callbacks; - var contexts = this._contexts; - if (callbacks) { - ("production" !== process.env.NODE_ENV ? invariant( - callbacks.length === contexts.length, - "Mismatched list of contexts in callback queue" - ) : invariant(callbacks.length === contexts.length)); - this._callbacks = null; - this._contexts = null; - for (var i = 0, l = callbacks.length; i < l; i++) { - callbacks[i].call(contexts[i]); - } - callbacks.length = 0; - contexts.length = 0; - } - }, - - /** - * Resets the internal queue. - * - * @internal - */ - reset: function() { - this._callbacks = null; - this._contexts = null; - }, - - /** - * `PooledClass` looks for this. - */ - destructor: function() { - this.reset(); - } - -}); - -PooledClass.addPoolingTo(CallbackQueue); - -module.exports = CallbackQueue; - -}).call(this,require('_process')) -},{"./Object.assign":28,"./PooledClass":29,"./invariant":128,"_process":149}],8:[function(require,module,exports){ -/** - * Copyright 2013-2014, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * @providesModule ChangeEventPlugin - */ - -"use strict"; - -var EventConstants = require("./EventConstants"); -var EventPluginHub = require("./EventPluginHub"); -var EventPropagators = require("./EventPropagators"); -var ExecutionEnvironment = require("./ExecutionEnvironment"); -var ReactUpdates = require("./ReactUpdates"); -var SyntheticEvent = require("./SyntheticEvent"); - -var isEventSupported = require("./isEventSupported"); -var isTextInputElement = require("./isTextInputElement"); -var keyOf = require("./keyOf"); - -var topLevelTypes = EventConstants.topLevelTypes; - -var eventTypes = { - change: { - phasedRegistrationNames: { - bubbled: keyOf({onChange: null}), - captured: keyOf({onChangeCapture: null}) - }, - dependencies: [ - topLevelTypes.topBlur, - topLevelTypes.topChange, - topLevelTypes.topClick, - topLevelTypes.topFocus, - topLevelTypes.topInput, - topLevelTypes.topKeyDown, - topLevelTypes.topKeyUp, - topLevelTypes.topSelectionChange - ] - } -}; - -/** - * For IE shims - */ -var activeElement = null; -var activeElementID = null; -var activeElementValue = null; -var activeElementValueProp = null; - -/** - * SECTION: handle `change` event - */ -function shouldUseChangeEvent(elem) { - return ( - elem.nodeName === 'SELECT' || - (elem.nodeName === 'INPUT' && elem.type === 'file') - ); -} - -var doesChangeEventBubble = false; -if (ExecutionEnvironment.canUseDOM) { - // See `handleChange` comment below - doesChangeEventBubble = isEventSupported('change') && ( - !('documentMode' in document) || document.documentMode > 8 - ); -} - -function manualDispatchChangeEvent(nativeEvent) { - var event = SyntheticEvent.getPooled( - eventTypes.change, - activeElementID, - nativeEvent - ); - EventPropagators.accumulateTwoPhaseDispatches(event); - - // If change and propertychange bubbled, we'd just bind to it like all the - // other events and have it go through ReactBrowserEventEmitter. Since it - // doesn't, we manually listen for the events and so we have to enqueue and - // process the abstract event manually. - // - // Batching is necessary here in order to ensure that all event handlers run - // before the next rerender (including event handlers attached to ancestor - // elements instead of directly on the input). Without this, controlled - // components don't work properly in conjunction with event bubbling because - // the component is rerendered and the value reverted before all the event - // handlers can run. See https://github.com/facebook/react/issues/708. - ReactUpdates.batchedUpdates(runEventInBatch, event); -} - -function runEventInBatch(event) { - EventPluginHub.enqueueEvents(event); - EventPluginHub.processEventQueue(); -} - -function startWatchingForChangeEventIE8(target, targetID) { - activeElement = target; - activeElementID = targetID; - activeElement.attachEvent('onchange', manualDispatchChangeEvent); -} - -function stopWatchingForChangeEventIE8() { - if (!activeElement) { - return; - } - activeElement.detachEvent('onchange', manualDispatchChangeEvent); - activeElement = null; - activeElementID = null; -} - -function getTargetIDForChangeEvent( - topLevelType, - topLevelTarget, - topLevelTargetID) { - if (topLevelType === topLevelTypes.topChange) { - return topLevelTargetID; - } -} -function handleEventsForChangeEventIE8( - topLevelType, - topLevelTarget, - topLevelTargetID) { - if (topLevelType === topLevelTypes.topFocus) { - // stopWatching() should be a noop here but we call it just in case we - // missed a blur event somehow. - stopWatchingForChangeEventIE8(); - startWatchingForChangeEventIE8(topLevelTarget, topLevelTargetID); - } else if (topLevelType === topLevelTypes.topBlur) { - stopWatchingForChangeEventIE8(); - } -} - - -/** - * SECTION: handle `input` event - */ -var isInputEventSupported = false; -if (ExecutionEnvironment.canUseDOM) { - // IE9 claims to support the input event but fails to trigger it when - // deleting text, so we ignore its input events - isInputEventSupported = isEventSupported('input') && ( - !('documentMode' in document) || document.documentMode > 9 - ); -} - -/** - * (For old IE.) Replacement getter/setter for the `value` property that gets - * set on the active element. - */ -var newValueProp = { - get: function() { - return activeElementValueProp.get.call(this); - }, - set: function(val) { - // Cast to a string so we can do equality checks. - activeElementValue = '' + val; - activeElementValueProp.set.call(this, val); - } -}; - -/** - * (For old IE.) Starts tracking propertychange events on the passed-in element - * and override the value property so that we can distinguish user events from - * value changes in JS. - */ -function startWatchingForValueChange(target, targetID) { - activeElement = target; - activeElementID = targetID; - activeElementValue = target.value; - activeElementValueProp = Object.getOwnPropertyDescriptor( - target.constructor.prototype, - 'value' - ); - - Object.defineProperty(activeElement, 'value', newValueProp); - activeElement.attachEvent('onpropertychange', handlePropertyChange); -} - -/** - * (For old IE.) Removes the event listeners from the currently-tracked element, - * if any exists. - */ -function stopWatchingForValueChange() { - if (!activeElement) { - return; - } - - // delete restores the original property definition - delete activeElement.value; - activeElement.detachEvent('onpropertychange', handlePropertyChange); - - activeElement = null; - activeElementID = null; - activeElementValue = null; - activeElementValueProp = null; -} - -/** - * (For old IE.) Handles a propertychange event, sending a `change` event if - * the value of the active element has changed. - */ -function handlePropertyChange(nativeEvent) { - if (nativeEvent.propertyName !== 'value') { - return; - } - var value = nativeEvent.srcElement.value; - if (value === activeElementValue) { - return; - } - activeElementValue = value; - - manualDispatchChangeEvent(nativeEvent); -} - -/** - * If a `change` event should be fired, returns the target's ID. - */ -function getTargetIDForInputEvent( - topLevelType, - topLevelTarget, - topLevelTargetID) { - if (topLevelType === topLevelTypes.topInput) { - // In modern browsers (i.e., not IE8 or IE9), the input event is exactly - // what we want so fall through here and trigger an abstract event - return topLevelTargetID; - } -} - -// For IE8 and IE9. -function handleEventsForInputEventIE( - topLevelType, - topLevelTarget, - topLevelTargetID) { - if (topLevelType === topLevelTypes.topFocus) { - // In IE8, we can capture almost all .value changes by adding a - // propertychange handler and looking for events with propertyName - // equal to 'value' - // In IE9, propertychange fires for most input events but is buggy and - // doesn't fire when text is deleted, but conveniently, selectionchange - // appears to fire in all of the remaining cases so we catch those and - // forward the event if the value has changed - // In either case, we don't want to call the event handler if the value - // is changed from JS so we redefine a setter for `.value` that updates - // our activeElementValue variable, allowing us to ignore those changes - // - // stopWatching() should be a noop here but we call it just in case we - // missed a blur event somehow. - stopWatchingForValueChange(); - startWatchingForValueChange(topLevelTarget, topLevelTargetID); - } else if (topLevelType === topLevelTypes.topBlur) { - stopWatchingForValueChange(); - } -} - -// For IE8 and IE9. -function getTargetIDForInputEventIE( - topLevelType, - topLevelTarget, - topLevelTargetID) { - if (topLevelType === topLevelTypes.topSelectionChange || - topLevelType === topLevelTypes.topKeyUp || - topLevelType === topLevelTypes.topKeyDown) { - // On the selectionchange event, the target is just document which isn't - // helpful for us so just check activeElement instead. - // - // 99% of the time, keydown and keyup aren't necessary. IE8 fails to fire - // propertychange on the first input event after setting `value` from a - // script and fires only keydown, keypress, keyup. Catching keyup usually - // gets it and catching keydown lets us fire an event for the first - // keystroke if user does a key repeat (it'll be a little delayed: right - // before the second keystroke). Other input methods (e.g., paste) seem to - // fire selectionchange normally. - if (activeElement && activeElement.value !== activeElementValue) { - activeElementValue = activeElement.value; - return activeElementID; - } - } -} - - -/** - * SECTION: handle `click` event - */ -function shouldUseClickEvent(elem) { - // Use the `click` event to detect changes to checkbox and radio inputs. - // This approach works across all browsers, whereas `change` does not fire - // until `blur` in IE8. - return ( - elem.nodeName === 'INPUT' && - (elem.type === 'checkbox' || elem.type === 'radio') - ); -} - -function getTargetIDForClickEvent( - topLevelType, - topLevelTarget, - topLevelTargetID) { - if (topLevelType === topLevelTypes.topClick) { - return topLevelTargetID; - } -} - -/** - * This plugin creates an `onChange` event that normalizes change events - * across form elements. This event fires at a time when it's possible to - * change the element's value without seeing a flicker. - * - * Supported elements are: - * - input (see `isTextInputElement`) - * - textarea - * - select - */ -var ChangeEventPlugin = { - - eventTypes: eventTypes, - - /** - * @param {string} topLevelType Record from `EventConstants`. - * @param {DOMEventTarget} topLevelTarget The listening component root node. - * @param {string} topLevelTargetID ID of `topLevelTarget`. - * @param {object} nativeEvent Native browser event. - * @return {*} An accumulation of synthetic events. - * @see {EventPluginHub.extractEvents} - */ - extractEvents: function( - topLevelType, - topLevelTarget, - topLevelTargetID, - nativeEvent) { - - var getTargetIDFunc, handleEventFunc; - if (shouldUseChangeEvent(topLevelTarget)) { - if (doesChangeEventBubble) { - getTargetIDFunc = getTargetIDForChangeEvent; - } else { - handleEventFunc = handleEventsForChangeEventIE8; - } - } else if (isTextInputElement(topLevelTarget)) { - if (isInputEventSupported) { - getTargetIDFunc = getTargetIDForInputEvent; - } else { - getTargetIDFunc = getTargetIDForInputEventIE; - handleEventFunc = handleEventsForInputEventIE; - } - } else if (shouldUseClickEvent(topLevelTarget)) { - getTargetIDFunc = getTargetIDForClickEvent; - } - - if (getTargetIDFunc) { - var targetID = getTargetIDFunc( - topLevelType, - topLevelTarget, - topLevelTargetID - ); - if (targetID) { - var event = SyntheticEvent.getPooled( - eventTypes.change, - targetID, - nativeEvent - ); - EventPropagators.accumulateTwoPhaseDispatches(event); - return event; - } - } - - if (handleEventFunc) { - handleEventFunc( - topLevelType, - topLevelTarget, - topLevelTargetID - ); - } - } - -}; - -module.exports = ChangeEventPlugin; - -},{"./EventConstants":17,"./EventPluginHub":19,"./EventPropagators":22,"./ExecutionEnvironment":23,"./ReactUpdates":81,"./SyntheticEvent":89,"./isEventSupported":129,"./isTextInputElement":131,"./keyOf":135}],9:[function(require,module,exports){ -/** - * Copyright 2013-2014, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * @providesModule ClientReactRootIndex - * @typechecks - */ - -"use strict"; - -var nextReactRootIndex = 0; - -var ClientReactRootIndex = { - createReactRootIndex: function() { - return nextReactRootIndex++; - } -}; - -module.exports = ClientReactRootIndex; - -},{}],10:[function(require,module,exports){ -/** - * Copyright 2013-2014, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * @providesModule CompositionEventPlugin - * @typechecks static-only - */ - -"use strict"; - -var EventConstants = require("./EventConstants"); -var EventPropagators = require("./EventPropagators"); -var ExecutionEnvironment = require("./ExecutionEnvironment"); -var ReactInputSelection = require("./ReactInputSelection"); -var SyntheticCompositionEvent = require("./SyntheticCompositionEvent"); - -var getTextContentAccessor = require("./getTextContentAccessor"); -var keyOf = require("./keyOf"); - -var END_KEYCODES = [9, 13, 27, 32]; // Tab, Return, Esc, Space -var START_KEYCODE = 229; - -var useCompositionEvent = ( - ExecutionEnvironment.canUseDOM && - 'CompositionEvent' in window -); - -// In IE9+, we have access to composition events, but the data supplied -// by the native compositionend event may be incorrect. In Korean, for example, -// the compositionend event contains only one character regardless of -// how many characters have been composed since compositionstart. -// We therefore use the fallback data while still using the native -// events as triggers. -var useFallbackData = ( - !useCompositionEvent || - ( - 'documentMode' in document && - document.documentMode > 8 && - document.documentMode <= 11 - ) -); - -var topLevelTypes = EventConstants.topLevelTypes; -var currentComposition = null; - -// Events and their corresponding property names. -var eventTypes = { - compositionEnd: { - phasedRegistrationNames: { - bubbled: keyOf({onCompositionEnd: null}), - captured: keyOf({onCompositionEndCapture: null}) - }, - dependencies: [ - topLevelTypes.topBlur, - topLevelTypes.topCompositionEnd, - topLevelTypes.topKeyDown, - topLevelTypes.topKeyPress, - topLevelTypes.topKeyUp, - topLevelTypes.topMouseDown - ] - }, - compositionStart: { - phasedRegistrationNames: { - bubbled: keyOf({onCompositionStart: null}), - captured: keyOf({onCompositionStartCapture: null}) - }, - dependencies: [ - topLevelTypes.topBlur, - topLevelTypes.topCompositionStart, - topLevelTypes.topKeyDown, - topLevelTypes.topKeyPress, - topLevelTypes.topKeyUp, - topLevelTypes.topMouseDown - ] - }, - compositionUpdate: { - phasedRegistrationNames: { - bubbled: keyOf({onCompositionUpdate: null}), - captured: keyOf({onCompositionUpdateCapture: null}) - }, - dependencies: [ - topLevelTypes.topBlur, - topLevelTypes.topCompositionUpdate, - topLevelTypes.topKeyDown, - topLevelTypes.topKeyPress, - topLevelTypes.topKeyUp, - topLevelTypes.topMouseDown - ] - } -}; - -/** - * Translate native top level events into event types. - * - * @param {string} topLevelType - * @return {object} - */ -function getCompositionEventType(topLevelType) { - switch (topLevelType) { - case topLevelTypes.topCompositionStart: - return eventTypes.compositionStart; - case topLevelTypes.topCompositionEnd: - return eventTypes.compositionEnd; - case topLevelTypes.topCompositionUpdate: - return eventTypes.compositionUpdate; - } -} - -/** - * Does our fallback best-guess model think this event signifies that - * composition has begun? - * - * @param {string} topLevelType - * @param {object} nativeEvent - * @return {boolean} - */ -function isFallbackStart(topLevelType, nativeEvent) { - return ( - topLevelType === topLevelTypes.topKeyDown && - nativeEvent.keyCode === START_KEYCODE - ); -} - -/** - * Does our fallback mode think that this event is the end of composition? - * - * @param {string} topLevelType - * @param {object} nativeEvent - * @return {boolean} - */ -function isFallbackEnd(topLevelType, nativeEvent) { - switch (topLevelType) { - case topLevelTypes.topKeyUp: - // Command keys insert or clear IME input. - return (END_KEYCODES.indexOf(nativeEvent.keyCode) !== -1); - case topLevelTypes.topKeyDown: - // Expect IME keyCode on each keydown. If we get any other - // code we must have exited earlier. - return (nativeEvent.keyCode !== START_KEYCODE); - case topLevelTypes.topKeyPress: - case topLevelTypes.topMouseDown: - case topLevelTypes.topBlur: - // Events are not possible without cancelling IME. - return true; - default: - return false; - } -} - -/** - * Helper class stores information about selection and document state - * so we can figure out what changed at a later date. - * - * @param {DOMEventTarget} root - */ -function FallbackCompositionState(root) { - this.root = root; - this.startSelection = ReactInputSelection.getSelection(root); - this.startValue = this.getText(); -} - -/** - * Get current text of input. - * - * @return {string} - */ -FallbackCompositionState.prototype.getText = function() { - return this.root.value || this.root[getTextContentAccessor()]; -}; - -/** - * Text that has changed since the start of composition. - * - * @return {string} - */ -FallbackCompositionState.prototype.getData = function() { - var endValue = this.getText(); - var prefixLength = this.startSelection.start; - var suffixLength = this.startValue.length - this.startSelection.end; - - return endValue.substr( - prefixLength, - endValue.length - suffixLength - prefixLength - ); -}; - -/** - * This plugin creates `onCompositionStart`, `onCompositionUpdate` and - * `onCompositionEnd` events on inputs, textareas and contentEditable - * nodes. - */ -var CompositionEventPlugin = { - - eventTypes: eventTypes, - - /** - * @param {string} topLevelType Record from `EventConstants`. - * @param {DOMEventTarget} topLevelTarget The listening component root node. - * @param {string} topLevelTargetID ID of `topLevelTarget`. - * @param {object} nativeEvent Native browser event. - * @return {*} An accumulation of synthetic events. - * @see {EventPluginHub.extractEvents} - */ - extractEvents: function( - topLevelType, - topLevelTarget, - topLevelTargetID, - nativeEvent) { - - var eventType; - var data; - - if (useCompositionEvent) { - eventType = getCompositionEventType(topLevelType); - } else if (!currentComposition) { - if (isFallbackStart(topLevelType, nativeEvent)) { - eventType = eventTypes.compositionStart; - } - } else if (isFallbackEnd(topLevelType, nativeEvent)) { - eventType = eventTypes.compositionEnd; - } - - if (useFallbackData) { - // The current composition is stored statically and must not be - // overwritten while composition continues. - if (!currentComposition && eventType === eventTypes.compositionStart) { - currentComposition = new FallbackCompositionState(topLevelTarget); - } else if (eventType === eventTypes.compositionEnd) { - if (currentComposition) { - data = currentComposition.getData(); - currentComposition = null; - } - } - } - - if (eventType) { - var event = SyntheticCompositionEvent.getPooled( - eventType, - topLevelTargetID, - nativeEvent - ); - if (data) { - // Inject data generated from fallback path into the synthetic event. - // This matches the property of native CompositionEventInterface. - event.data = data; - } - EventPropagators.accumulateTwoPhaseDispatches(event); - return event; - } - } -}; - -module.exports = CompositionEventPlugin; - -},{"./EventConstants":17,"./EventPropagators":22,"./ExecutionEnvironment":23,"./ReactInputSelection":61,"./SyntheticCompositionEvent":87,"./getTextContentAccessor":123,"./keyOf":135}],11:[function(require,module,exports){ -(function (process){ -/** - * Copyright 2013-2014, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * @providesModule DOMChildrenOperations - * @typechecks static-only - */ - -"use strict"; - -var Danger = require("./Danger"); -var ReactMultiChildUpdateTypes = require("./ReactMultiChildUpdateTypes"); - -var getTextContentAccessor = require("./getTextContentAccessor"); -var invariant = require("./invariant"); - -/** - * The DOM property to use when setting text content. - * - * @type {string} - * @private - */ -var textContentAccessor = getTextContentAccessor(); - -/** - * Inserts `childNode` as a child of `parentNode` at the `index`. - * - * @param {DOMElement} parentNode Parent node in which to insert. - * @param {DOMElement} childNode Child node to insert. - * @param {number} index Index at which to insert the child. - * @internal - */ -function insertChildAt(parentNode, childNode, index) { - // By exploiting arrays returning `undefined` for an undefined index, we can - // rely exclusively on `insertBefore(node, null)` instead of also using - // `appendChild(node)`. However, using `undefined` is not allowed by all - // browsers so we must replace it with `null`. - parentNode.insertBefore( - childNode, - parentNode.childNodes[index] || null - ); -} - -var updateTextContent; -if (textContentAccessor === 'textContent') { - /** - * Sets the text content of `node` to `text`. - * - * @param {DOMElement} node Node to change - * @param {string} text New text content - */ - updateTextContent = function(node, text) { - node.textContent = text; - }; -} else { - /** - * Sets the text content of `node` to `text`. - * - * @param {DOMElement} node Node to change - * @param {string} text New text content - */ - updateTextContent = function(node, text) { - // In order to preserve newlines correctly, we can't use .innerText to set - // the contents (see #1080), so we empty the element then append a text node - while (node.firstChild) { - node.removeChild(node.firstChild); - } - if (text) { - var doc = node.ownerDocument || document; - node.appendChild(doc.createTextNode(text)); - } - }; -} - -/** - * Operations for updating with DOM children. - */ -var DOMChildrenOperations = { - - dangerouslyReplaceNodeWithMarkup: Danger.dangerouslyReplaceNodeWithMarkup, - - updateTextContent: updateTextContent, - - /** - * Updates a component's children by processing a series of updates. The - * update configurations are each expected to have a `parentNode` property. - * - * @param {array} updates List of update configurations. - * @param {array} markupList List of markup strings. - * @internal - */ - processUpdates: function(updates, markupList) { - var update; - // Mapping from parent IDs to initial child orderings. - var initialChildren = null; - // List of children that will be moved or removed. - var updatedChildren = null; - - for (var i = 0; update = updates[i]; i++) { - if (update.type === ReactMultiChildUpdateTypes.MOVE_EXISTING || - update.type === ReactMultiChildUpdateTypes.REMOVE_NODE) { - var updatedIndex = update.fromIndex; - var updatedChild = update.parentNode.childNodes[updatedIndex]; - var parentID = update.parentID; - - ("production" !== process.env.NODE_ENV ? invariant( - updatedChild, - 'processUpdates(): Unable to find child %s of element. This ' + - 'probably means the DOM was unexpectedly mutated (e.g., by the ' + - 'browser), usually due to forgetting a when using tables, ' + - 'nesting tags like
,

, or , or using non-SVG elements '+ - 'in an parent. Try inspecting the child nodes of the element ' + - 'with React ID `%s`.', - updatedIndex, - parentID - ) : invariant(updatedChild)); - - initialChildren = initialChildren || {}; - initialChildren[parentID] = initialChildren[parentID] || []; - initialChildren[parentID][updatedIndex] = updatedChild; - - updatedChildren = updatedChildren || []; - updatedChildren.push(updatedChild); - } - } - - var renderedMarkup = Danger.dangerouslyRenderMarkup(markupList); - - // Remove updated children first so that `toIndex` is consistent. - if (updatedChildren) { - for (var j = 0; j < updatedChildren.length; j++) { - updatedChildren[j].parentNode.removeChild(updatedChildren[j]); - } - } - - for (var k = 0; update = updates[k]; k++) { - switch (update.type) { - case ReactMultiChildUpdateTypes.INSERT_MARKUP: - insertChildAt( - update.parentNode, - renderedMarkup[update.markupIndex], - update.toIndex - ); - break; - case ReactMultiChildUpdateTypes.MOVE_EXISTING: - insertChildAt( - update.parentNode, - initialChildren[update.parentID][update.fromIndex], - update.toIndex - ); - break; - case ReactMultiChildUpdateTypes.TEXT_CONTENT: - updateTextContent( - update.parentNode, - update.textContent - ); - break; - case ReactMultiChildUpdateTypes.REMOVE_NODE: - // Already removed by the for-loop above. - break; - } - } - } - -}; - -module.exports = DOMChildrenOperations; - -}).call(this,require('_process')) -},{"./Danger":14,"./ReactMultiChildUpdateTypes":67,"./getTextContentAccessor":123,"./invariant":128,"_process":149}],12:[function(require,module,exports){ -(function (process){ -/** - * Copyright 2013-2014, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * @providesModule DOMProperty - * @typechecks static-only - */ - -/*jslint bitwise: true */ - -"use strict"; - -var invariant = require("./invariant"); - -function checkMask(value, bitmask) { - return (value & bitmask) === bitmask; -} - -var DOMPropertyInjection = { - /** - * Mapping from normalized, camelcased property names to a configuration that - * specifies how the associated DOM property should be accessed or rendered. - */ - MUST_USE_ATTRIBUTE: 0x1, - MUST_USE_PROPERTY: 0x2, - HAS_SIDE_EFFECTS: 0x4, - HAS_BOOLEAN_VALUE: 0x8, - HAS_NUMERIC_VALUE: 0x10, - HAS_POSITIVE_NUMERIC_VALUE: 0x20 | 0x10, - HAS_OVERLOADED_BOOLEAN_VALUE: 0x40, - - /** - * Inject some specialized knowledge about the DOM. This takes a config object - * with the following properties: - * - * isCustomAttribute: function that given an attribute name will return true - * if it can be inserted into the DOM verbatim. Useful for data-* or aria-* - * attributes where it's impossible to enumerate all of the possible - * attribute names, - * - * Properties: object mapping DOM property name to one of the - * DOMPropertyInjection constants or null. If your attribute isn't in here, - * it won't get written to the DOM. - * - * DOMAttributeNames: object mapping React attribute name to the DOM - * attribute name. Attribute names not specified use the **lowercase** - * normalized name. - * - * DOMPropertyNames: similar to DOMAttributeNames but for DOM properties. - * Property names not specified use the normalized name. - * - * DOMMutationMethods: Properties that require special mutation methods. If - * `value` is undefined, the mutation method should unset the property. - * - * @param {object} domPropertyConfig the config as described above. - */ - injectDOMPropertyConfig: function(domPropertyConfig) { - var Properties = domPropertyConfig.Properties || {}; - var DOMAttributeNames = domPropertyConfig.DOMAttributeNames || {}; - var DOMPropertyNames = domPropertyConfig.DOMPropertyNames || {}; - var DOMMutationMethods = domPropertyConfig.DOMMutationMethods || {}; - - if (domPropertyConfig.isCustomAttribute) { - DOMProperty._isCustomAttributeFunctions.push( - domPropertyConfig.isCustomAttribute - ); - } - - for (var propName in Properties) { - ("production" !== process.env.NODE_ENV ? invariant( - !DOMProperty.isStandardName.hasOwnProperty(propName), - '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(!DOMProperty.isStandardName.hasOwnProperty(propName))); - - DOMProperty.isStandardName[propName] = true; - - var lowerCased = propName.toLowerCase(); - DOMProperty.getPossibleStandardName[lowerCased] = propName; - - if (DOMAttributeNames.hasOwnProperty(propName)) { - var attributeName = DOMAttributeNames[propName]; - DOMProperty.getPossibleStandardName[attributeName] = propName; - DOMProperty.getAttributeName[propName] = attributeName; - } else { - DOMProperty.getAttributeName[propName] = lowerCased; - } - - DOMProperty.getPropertyName[propName] = - DOMPropertyNames.hasOwnProperty(propName) ? - DOMPropertyNames[propName] : - propName; - - if (DOMMutationMethods.hasOwnProperty(propName)) { - DOMProperty.getMutationMethod[propName] = DOMMutationMethods[propName]; - } else { - DOMProperty.getMutationMethod[propName] = null; - } - - var propConfig = Properties[propName]; - DOMProperty.mustUseAttribute[propName] = - checkMask(propConfig, DOMPropertyInjection.MUST_USE_ATTRIBUTE); - DOMProperty.mustUseProperty[propName] = - checkMask(propConfig, DOMPropertyInjection.MUST_USE_PROPERTY); - DOMProperty.hasSideEffects[propName] = - checkMask(propConfig, DOMPropertyInjection.HAS_SIDE_EFFECTS); - DOMProperty.hasBooleanValue[propName] = - checkMask(propConfig, DOMPropertyInjection.HAS_BOOLEAN_VALUE); - DOMProperty.hasNumericValue[propName] = - checkMask(propConfig, DOMPropertyInjection.HAS_NUMERIC_VALUE); - DOMProperty.hasPositiveNumericValue[propName] = - checkMask(propConfig, DOMPropertyInjection.HAS_POSITIVE_NUMERIC_VALUE); - DOMProperty.hasOverloadedBooleanValue[propName] = - checkMask(propConfig, DOMPropertyInjection.HAS_OVERLOADED_BOOLEAN_VALUE); - - ("production" !== process.env.NODE_ENV ? invariant( - !DOMProperty.mustUseAttribute[propName] || - !DOMProperty.mustUseProperty[propName], - 'DOMProperty: Cannot require using both attribute and property: %s', - propName - ) : invariant(!DOMProperty.mustUseAttribute[propName] || - !DOMProperty.mustUseProperty[propName])); - ("production" !== process.env.NODE_ENV ? invariant( - DOMProperty.mustUseProperty[propName] || - !DOMProperty.hasSideEffects[propName], - 'DOMProperty: Properties that have side effects must use property: %s', - propName - ) : invariant(DOMProperty.mustUseProperty[propName] || - !DOMProperty.hasSideEffects[propName])); - ("production" !== process.env.NODE_ENV ? invariant( - !!DOMProperty.hasBooleanValue[propName] + - !!DOMProperty.hasNumericValue[propName] + - !!DOMProperty.hasOverloadedBooleanValue[propName] <= 1, - 'DOMProperty: Value can be one of boolean, overloaded boolean, or ' + - 'numeric value, but not a combination: %s', - propName - ) : invariant(!!DOMProperty.hasBooleanValue[propName] + - !!DOMProperty.hasNumericValue[propName] + - !!DOMProperty.hasOverloadedBooleanValue[propName] <= 1)); - } - } -}; -var defaultValueCache = {}; - -/** - * DOMProperty exports lookup objects that can be used like functions: - * - * > DOMProperty.isValid['id'] - * true - * > DOMProperty.isValid['foobar'] - * undefined - * - * Although this may be confusing, it performs better in general. - * - * @see http://jsperf.com/key-exists - * @see http://jsperf.com/key-missing - */ -var DOMProperty = { - - ID_ATTRIBUTE_NAME: 'data-reactid', - - /** - * Checks whether a property name is a standard property. - * @type {Object} - */ - isStandardName: {}, - - /** - * Mapping from lowercase property names to the properly cased version, used - * to warn in the case of missing properties. - * @type {Object} - */ - getPossibleStandardName: {}, - - /** - * Mapping from normalized names to attribute names that differ. Attribute - * names are used when rendering markup or with `*Attribute()`. - * @type {Object} - */ - getAttributeName: {}, - - /** - * Mapping from normalized names to properties on DOM node instances. - * (This includes properties that mutate due to external factors.) - * @type {Object} - */ - getPropertyName: {}, - - /** - * Mapping from normalized names to mutation methods. This will only exist if - * mutation cannot be set simply by the property or `setAttribute()`. - * @type {Object} - */ - getMutationMethod: {}, - - /** - * Whether the property must be accessed and mutated as an object property. - * @type {Object} - */ - mustUseAttribute: {}, - - /** - * Whether the property must be accessed and mutated using `*Attribute()`. - * (This includes anything that fails ` in `.) - * @type {Object} - */ - mustUseProperty: {}, - - /** - * Whether or not setting a value causes side effects such as triggering - * resources to be loaded or text selection changes. We must ensure that - * the value is only set if it has changed. - * @type {Object} - */ - hasSideEffects: {}, - - /** - * Whether the property should be removed when set to a falsey value. - * @type {Object} - */ - hasBooleanValue: {}, - - /** - * Whether the property must be numeric or parse as a - * numeric and should be removed when set to a falsey value. - * @type {Object} - */ - hasNumericValue: {}, - - /** - * Whether the property must be positive numeric or parse as a positive - * numeric and should be removed when set to a falsey value. - * @type {Object} - */ - hasPositiveNumericValue: {}, - - /** - * Whether the property can be used as a flag as well as with a value. Removed - * when strictly equal to false; present without a value when strictly equal - * to true; present with a value otherwise. - * @type {Object} - */ - hasOverloadedBooleanValue: {}, - - /** - * All of the isCustomAttribute() functions that have been injected. - */ - _isCustomAttributeFunctions: [], - - /** - * Checks whether a property name is a custom attribute. - * @method - */ - isCustomAttribute: function(attributeName) { - for (var i = 0; i < DOMProperty._isCustomAttributeFunctions.length; i++) { - var isCustomAttributeFn = DOMProperty._isCustomAttributeFunctions[i]; - if (isCustomAttributeFn(attributeName)) { - return true; - } - } - return false; - }, - - /** - * Returns the default property value for a DOM property (i.e., not an - * attribute). Most default values are '' or false, but not all. Worse yet, - * some (in particular, `type`) vary depending on the type of element. - * - * TODO: Is it better to grab all the possible properties when creating an - * element to avoid having to create the same element twice? - */ - getDefaultValueForProperty: function(nodeName, prop) { - var nodeDefaults = defaultValueCache[nodeName]; - var testElement; - if (!nodeDefaults) { - defaultValueCache[nodeName] = nodeDefaults = {}; - } - if (!(prop in nodeDefaults)) { - testElement = document.createElement(nodeName); - nodeDefaults[prop] = testElement[prop]; - } - return nodeDefaults[prop]; - }, - - injection: DOMPropertyInjection -}; - -module.exports = DOMProperty; - -}).call(this,require('_process')) -},{"./invariant":128,"_process":149}],13:[function(require,module,exports){ -(function (process){ -/** - * Copyright 2013-2014, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * @providesModule DOMPropertyOperations - * @typechecks static-only - */ - -"use strict"; - -var DOMProperty = require("./DOMProperty"); - -var escapeTextForBrowser = require("./escapeTextForBrowser"); -var memoizeStringOnly = require("./memoizeStringOnly"); -var warning = require("./warning"); - -function shouldIgnoreValue(name, value) { - return value == null || - (DOMProperty.hasBooleanValue[name] && !value) || - (DOMProperty.hasNumericValue[name] && isNaN(value)) || - (DOMProperty.hasPositiveNumericValue[name] && (value < 1)) || - (DOMProperty.hasOverloadedBooleanValue[name] && value === false); -} - -var processAttributeNameAndPrefix = memoizeStringOnly(function(name) { - return escapeTextForBrowser(name) + '="'; -}); - -if ("production" !== process.env.NODE_ENV) { - var reactProps = { - children: true, - dangerouslySetInnerHTML: true, - key: true, - ref: true - }; - var warnedProperties = {}; - - var warnUnknownProperty = function(name) { - if (reactProps.hasOwnProperty(name) && reactProps[name] || - warnedProperties.hasOwnProperty(name) && warnedProperties[name]) { - return; - } - - warnedProperties[name] = true; - var lowerCasedName = name.toLowerCase(); - - // data-* attributes should be lowercase; suggest the lowercase version - var standardName = ( - DOMProperty.isCustomAttribute(lowerCasedName) ? - lowerCasedName : - DOMProperty.getPossibleStandardName.hasOwnProperty(lowerCasedName) ? - DOMProperty.getPossibleStandardName[lowerCasedName] : - null - ); - - // For now, only warn when we have a suggested correction. This prevents - // logging too much when using transferPropsTo. - ("production" !== process.env.NODE_ENV ? warning( - standardName == null, - 'Unknown DOM property ' + name + '. Did you mean ' + standardName + '?' - ) : null); - - }; -} - -/** - * Operations for dealing with DOM properties. - */ -var DOMPropertyOperations = { - - /** - * Creates markup for the ID property. - * - * @param {string} id Unescaped ID. - * @return {string} Markup string. - */ - createMarkupForID: function(id) { - return processAttributeNameAndPrefix(DOMProperty.ID_ATTRIBUTE_NAME) + - escapeTextForBrowser(id) + '"'; - }, - - /** - * Creates markup for a property. - * - * @param {string} name - * @param {*} value - * @return {?string} Markup string, or null if the property was invalid. - */ - createMarkupForProperty: function(name, value) { - if (DOMProperty.isStandardName.hasOwnProperty(name) && - DOMProperty.isStandardName[name]) { - if (shouldIgnoreValue(name, value)) { - return ''; - } - var attributeName = DOMProperty.getAttributeName[name]; - if (DOMProperty.hasBooleanValue[name] || - (DOMProperty.hasOverloadedBooleanValue[name] && value === true)) { - return escapeTextForBrowser(attributeName); - } - return processAttributeNameAndPrefix(attributeName) + - escapeTextForBrowser(value) + '"'; - } else if (DOMProperty.isCustomAttribute(name)) { - if (value == null) { - return ''; - } - return processAttributeNameAndPrefix(name) + - escapeTextForBrowser(value) + '"'; - } else if ("production" !== process.env.NODE_ENV) { - warnUnknownProperty(name); - } - return null; - }, - - /** - * Sets the value for a property on a node. - * - * @param {DOMElement} node - * @param {string} name - * @param {*} value - */ - setValueForProperty: function(node, name, value) { - if (DOMProperty.isStandardName.hasOwnProperty(name) && - DOMProperty.isStandardName[name]) { - var mutationMethod = DOMProperty.getMutationMethod[name]; - if (mutationMethod) { - mutationMethod(node, value); - } else if (shouldIgnoreValue(name, value)) { - this.deleteValueForProperty(node, name); - } else if (DOMProperty.mustUseAttribute[name]) { - // `setAttribute` with objects becomes only `[object]` in IE8/9, - // ('' + value) makes it output the correct toString()-value. - node.setAttribute(DOMProperty.getAttributeName[name], '' + value); - } else { - var propName = DOMProperty.getPropertyName[name]; - // Must explicitly cast values for HAS_SIDE_EFFECTS-properties to the - // property type before comparing; only `value` does and is string. - if (!DOMProperty.hasSideEffects[name] || - ('' + node[propName]) !== ('' + value)) { - // Contrary to `setAttribute`, object properties are properly - // `toString`ed by IE8/9. - node[propName] = value; - } - } - } else if (DOMProperty.isCustomAttribute(name)) { - if (value == null) { - node.removeAttribute(name); - } else { - node.setAttribute(name, '' + value); - } - } else if ("production" !== process.env.NODE_ENV) { - warnUnknownProperty(name); - } - }, - - /** - * Deletes the value for a property on a node. - * - * @param {DOMElement} node - * @param {string} name - */ - deleteValueForProperty: function(node, name) { - if (DOMProperty.isStandardName.hasOwnProperty(name) && - DOMProperty.isStandardName[name]) { - var mutationMethod = DOMProperty.getMutationMethod[name]; - if (mutationMethod) { - mutationMethod(node, undefined); - } else if (DOMProperty.mustUseAttribute[name]) { - node.removeAttribute(DOMProperty.getAttributeName[name]); - } else { - var propName = DOMProperty.getPropertyName[name]; - var defaultValue = DOMProperty.getDefaultValueForProperty( - node.nodeName, - propName - ); - if (!DOMProperty.hasSideEffects[name] || - ('' + node[propName]) !== defaultValue) { - node[propName] = defaultValue; - } - } - } else if (DOMProperty.isCustomAttribute(name)) { - node.removeAttribute(name); - } else if ("production" !== process.env.NODE_ENV) { - warnUnknownProperty(name); - } - } - -}; - -module.exports = DOMPropertyOperations; - -}).call(this,require('_process')) -},{"./DOMProperty":12,"./escapeTextForBrowser":111,"./memoizeStringOnly":137,"./warning":147,"_process":149}],14:[function(require,module,exports){ -(function (process){ -/** - * Copyright 2013-2014, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * @providesModule Danger - * @typechecks static-only - */ - -/*jslint evil: true, sub: true */ - -"use strict"; - -var ExecutionEnvironment = require("./ExecutionEnvironment"); - -var createNodesFromMarkup = require("./createNodesFromMarkup"); -var emptyFunction = require("./emptyFunction"); -var getMarkupWrap = require("./getMarkupWrap"); -var invariant = require("./invariant"); - -var OPEN_TAG_NAME_EXP = /^(<[^ \/>]+)/; -var RESULT_INDEX_ATTR = 'data-danger-index'; - -/** - * Extracts the `nodeName` from a string of markup. - * - * NOTE: Extracting the `nodeName` does not require a regular expression match - * because we make assumptions about React-generated markup (i.e. there are no - * spaces surrounding the opening tag and there is at least one attribute). - * - * @param {string} markup String of markup. - * @return {string} Node name of the supplied markup. - * @see http://jsperf.com/extract-nodename - */ -function getNodeName(markup) { - return markup.substring(1, markup.indexOf(' ')); -} - -var Danger = { - - /** - * Renders markup into an array of nodes. The markup is expected to render - * into a list of root nodes. Also, the length of `resultList` and - * `markupList` should be the same. - * - * @param {array} markupList List of markup strings to render. - * @return {array} List of rendered nodes. - * @internal - */ - dangerouslyRenderMarkup: function(markupList) { - ("production" !== process.env.NODE_ENV ? invariant( - ExecutionEnvironment.canUseDOM, - 'dangerouslyRenderMarkup(...): Cannot render markup in a worker ' + - 'thread. Make sure `window` and `document` are available globally ' + - 'before requiring React when unit testing or use ' + - 'React.renderToString for server rendering.' - ) : invariant(ExecutionEnvironment.canUseDOM)); - var nodeName; - var markupByNodeName = {}; - // Group markup by `nodeName` if a wrap is necessary, else by '*'. - for (var i = 0; i < markupList.length; i++) { - ("production" !== process.env.NODE_ENV ? invariant( - markupList[i], - 'dangerouslyRenderMarkup(...): Missing markup.' - ) : invariant(markupList[i])); - nodeName = getNodeName(markupList[i]); - nodeName = getMarkupWrap(nodeName) ? nodeName : '*'; - markupByNodeName[nodeName] = markupByNodeName[nodeName] || []; - markupByNodeName[nodeName][i] = markupList[i]; - } - var resultList = []; - var resultListAssignmentCount = 0; - for (nodeName in markupByNodeName) { - if (!markupByNodeName.hasOwnProperty(nodeName)) { - continue; - } - var markupListByNodeName = markupByNodeName[nodeName]; - - // This for-in loop skips the holes of the sparse array. The order of - // iteration should follow the order of assignment, which happens to match - // numerical index order, but we don't rely on that. - for (var resultIndex in markupListByNodeName) { - if (markupListByNodeName.hasOwnProperty(resultIndex)) { - var markup = markupListByNodeName[resultIndex]; - - // Push the requested markup with an additional RESULT_INDEX_ATTR - // attribute. If the markup does not start with a < character, it - // will be discarded below (with an appropriate console.error). - markupListByNodeName[resultIndex] = markup.replace( - OPEN_TAG_NAME_EXP, - // This index will be parsed back out below. - '$1 ' + RESULT_INDEX_ATTR + '="' + resultIndex + '" ' - ); - } - } - - // Render each group of markup with similar wrapping `nodeName`. - var renderNodes = createNodesFromMarkup( - markupListByNodeName.join(''), - emptyFunction // Do nothing special with

; - * } - * }); - * - * The class specification supports a specific protocol of methods that have - * special meaning (e.g. `render`). See `ReactCompositeComponentInterface` for - * more the comprehensive protocol. Any other properties and methods in the - * class specification will available on the prototype. - * - * @interface ReactCompositeComponentInterface - * @internal - */ -var ReactCompositeComponentInterface = { - - /** - * An array of Mixin objects to include when defining your component. - * - * @type {array} - * @optional - */ - mixins: SpecPolicy.DEFINE_MANY, - - /** - * An object containing properties and methods that should be defined on - * the component's constructor instead of its prototype (static methods). - * - * @type {object} - * @optional - */ - statics: SpecPolicy.DEFINE_MANY, - - /** - * Definition of prop types for this component. - * - * @type {object} - * @optional - */ - propTypes: SpecPolicy.DEFINE_MANY, - - /** - * Definition of context types for this component. - * - * @type {object} - * @optional - */ - contextTypes: SpecPolicy.DEFINE_MANY, - - /** - * Definition of context types this component sets for its children. - * - * @type {object} - * @optional - */ - childContextTypes: SpecPolicy.DEFINE_MANY, - - // ==== Definition methods ==== - - /** - * Invoked when the component is mounted. Values in the mapping will be set on - * `this.props` if that prop is not specified (i.e. using an `in` check). - * - * This method is invoked before `getInitialState` and therefore cannot rely - * on `this.state` or use `this.setState`. - * - * @return {object} - * @optional - */ - getDefaultProps: SpecPolicy.DEFINE_MANY_MERGED, - - /** - * Invoked once before the component is mounted. The return value will be used - * as the initial value of `this.state`. - * - * getInitialState: function() { - * return { - * isOn: false, - * fooBaz: new BazFoo() - * } - * } - * - * @return {object} - * @optional - */ - getInitialState: SpecPolicy.DEFINE_MANY_MERGED, - - /** - * @return {object} - * @optional - */ - getChildContext: SpecPolicy.DEFINE_MANY_MERGED, - - /** - * Uses props from `this.props` and state from `this.state` to render the - * structure of the component. - * - * No guarantees are made about when or how often this method is invoked, so - * it must not have side effects. - * - * render: function() { - * var name = this.props.name; - * return
Hello, {name}!
; - * } - * - * @return {ReactComponent} - * @nosideeffects - * @required - */ - render: SpecPolicy.DEFINE_ONCE, - - - - // ==== Delegate methods ==== - - /** - * Invoked when the component is initially created and about to be mounted. - * This may have side effects, but any external subscriptions or data created - * by this method must be cleaned up in `componentWillUnmount`. - * - * @optional - */ - componentWillMount: SpecPolicy.DEFINE_MANY, - - /** - * Invoked when the component has been mounted and has a DOM representation. - * However, there is no guarantee that the DOM node is in the document. - * - * Use this as an opportunity to operate on the DOM when the component has - * been mounted (initialized and rendered) for the first time. - * - * @param {DOMElement} rootNode DOM element representing the component. - * @optional - */ - componentDidMount: SpecPolicy.DEFINE_MANY, - - /** - * Invoked before the component receives new props. - * - * Use this as an opportunity to react to a prop transition by updating the - * state using `this.setState`. Current props are accessed via `this.props`. - * - * componentWillReceiveProps: function(nextProps, nextContext) { - * this.setState({ - * likesIncreasing: nextProps.likeCount > this.props.likeCount - * }); - * } - * - * NOTE: There is no equivalent `componentWillReceiveState`. An incoming prop - * transition may cause a state change, but the opposite is not true. If you - * need it, you are probably looking for `componentWillUpdate`. - * - * @param {object} nextProps - * @optional - */ - componentWillReceiveProps: SpecPolicy.DEFINE_MANY, - - /** - * Invoked while deciding if the component should be updated as a result of - * receiving new props, state and/or context. - * - * Use this as an opportunity to `return false` when you're certain that the - * transition to the new props/state/context will not require a component - * update. - * - * shouldComponentUpdate: function(nextProps, nextState, nextContext) { - * return !equal(nextProps, this.props) || - * !equal(nextState, this.state) || - * !equal(nextContext, this.context); - * } - * - * @param {object} nextProps - * @param {?object} nextState - * @param {?object} nextContext - * @return {boolean} True if the component should update. - * @optional - */ - shouldComponentUpdate: SpecPolicy.DEFINE_ONCE, - - /** - * Invoked when the component is about to update due to a transition from - * `this.props`, `this.state` and `this.context` to `nextProps`, `nextState` - * and `nextContext`. - * - * Use this as an opportunity to perform preparation before an update occurs. - * - * NOTE: You **cannot** use `this.setState()` in this method. - * - * @param {object} nextProps - * @param {?object} nextState - * @param {?object} nextContext - * @param {ReactReconcileTransaction} transaction - * @optional - */ - componentWillUpdate: SpecPolicy.DEFINE_MANY, - - /** - * Invoked when the component's DOM representation has been updated. - * - * Use this as an opportunity to operate on the DOM when the component has - * been updated. - * - * @param {object} prevProps - * @param {?object} prevState - * @param {?object} prevContext - * @param {DOMElement} rootNode DOM element representing the component. - * @optional - */ - componentDidUpdate: SpecPolicy.DEFINE_MANY, - - /** - * Invoked when the component is about to be removed from its parent and have - * its DOM representation destroyed. - * - * Use this as an opportunity to deallocate any external resources. - * - * NOTE: There is no `componentDidUnmount` since your component will have been - * destroyed by that point. - * - * @optional - */ - componentWillUnmount: SpecPolicy.DEFINE_MANY, - - - - // ==== Advanced methods ==== - - /** - * Updates the component's currently mounted DOM representation. - * - * By default, this implements React's rendering and reconciliation algorithm. - * Sophisticated clients may wish to override this. - * - * @param {ReactReconcileTransaction} transaction - * @internal - * @overridable - */ - updateComponent: SpecPolicy.OVERRIDE_BASE - -}; - -/** - * Mapping from class specification keys to special processing functions. - * - * Although these are declared like instance properties in the specification - * when defining classes using `React.createClass`, they are actually static - * and are accessible on the constructor instead of the prototype. Despite - * being static, they must be defined outside of the "statics" key under - * which all other static methods are defined. - */ -var RESERVED_SPEC_KEYS = { - displayName: function(Constructor, displayName) { - Constructor.displayName = displayName; - }, - mixins: function(Constructor, mixins) { - if (mixins) { - for (var i = 0; i < mixins.length; i++) { - mixSpecIntoComponent(Constructor, mixins[i]); - } - } - }, - childContextTypes: function(Constructor, childContextTypes) { - validateTypeDef( - Constructor, - childContextTypes, - ReactPropTypeLocations.childContext - ); - Constructor.childContextTypes = assign( - {}, - Constructor.childContextTypes, - childContextTypes - ); - }, - contextTypes: function(Constructor, contextTypes) { - validateTypeDef( - Constructor, - contextTypes, - ReactPropTypeLocations.context - ); - Constructor.contextTypes = assign( - {}, - Constructor.contextTypes, - contextTypes - ); - }, - /** - * Special case getDefaultProps which should move into statics but requires - * automatic merging. - */ - getDefaultProps: function(Constructor, getDefaultProps) { - if (Constructor.getDefaultProps) { - Constructor.getDefaultProps = createMergedResultFunction( - Constructor.getDefaultProps, - getDefaultProps - ); - } else { - Constructor.getDefaultProps = getDefaultProps; - } - }, - propTypes: function(Constructor, propTypes) { - validateTypeDef( - Constructor, - propTypes, - ReactPropTypeLocations.prop - ); - Constructor.propTypes = assign( - {}, - Constructor.propTypes, - propTypes - ); - }, - statics: function(Constructor, statics) { - mixStaticSpecIntoComponent(Constructor, statics); - } -}; - -function getDeclarationErrorAddendum(component) { - var owner = component._owner || null; - if (owner && owner.constructor && owner.constructor.displayName) { - return ' Check the render method of `' + owner.constructor.displayName + - '`.'; - } - return ''; -} - -function validateTypeDef(Constructor, typeDef, location) { - for (var propName in typeDef) { - if (typeDef.hasOwnProperty(propName)) { - ("production" !== process.env.NODE_ENV ? invariant( - typeof typeDef[propName] == 'function', - '%s: %s type `%s` is invalid; it must be a function, usually from ' + - 'React.PropTypes.', - Constructor.displayName || 'ReactCompositeComponent', - ReactPropTypeLocationNames[location], - propName - ) : invariant(typeof typeDef[propName] == 'function')); - } - } -} - -function validateMethodOverride(proto, name) { - var specPolicy = ReactCompositeComponentInterface.hasOwnProperty(name) ? - ReactCompositeComponentInterface[name] : - null; - - // Disallow overriding of base class methods unless explicitly allowed. - if (ReactCompositeComponentMixin.hasOwnProperty(name)) { - ("production" !== process.env.NODE_ENV ? invariant( - specPolicy === SpecPolicy.OVERRIDE_BASE, - 'ReactCompositeComponentInterface: You are attempting to override ' + - '`%s` from your class specification. Ensure that your method names ' + - 'do not overlap with React methods.', - name - ) : invariant(specPolicy === SpecPolicy.OVERRIDE_BASE)); - } - - // Disallow defining methods more than once unless explicitly allowed. - if (proto.hasOwnProperty(name)) { - ("production" !== process.env.NODE_ENV ? invariant( - specPolicy === SpecPolicy.DEFINE_MANY || - specPolicy === SpecPolicy.DEFINE_MANY_MERGED, - 'ReactCompositeComponentInterface: You are attempting to define ' + - '`%s` on your component more than once. This conflict may be due ' + - 'to a mixin.', - name - ) : invariant(specPolicy === SpecPolicy.DEFINE_MANY || - specPolicy === SpecPolicy.DEFINE_MANY_MERGED)); - } -} - -function validateLifeCycleOnReplaceState(instance) { - var compositeLifeCycleState = instance._compositeLifeCycleState; - ("production" !== process.env.NODE_ENV ? invariant( - instance.isMounted() || - compositeLifeCycleState === CompositeLifeCycle.MOUNTING, - 'replaceState(...): Can only update a mounted or mounting component.' - ) : invariant(instance.isMounted() || - compositeLifeCycleState === CompositeLifeCycle.MOUNTING)); - ("production" !== process.env.NODE_ENV ? invariant( - ReactCurrentOwner.current == null, - 'replaceState(...): Cannot update during an existing state transition ' + - '(such as within `render`). Render methods should be a pure function ' + - 'of props and state.' - ) : invariant(ReactCurrentOwner.current == null)); - ("production" !== process.env.NODE_ENV ? invariant(compositeLifeCycleState !== CompositeLifeCycle.UNMOUNTING, - 'replaceState(...): Cannot update while unmounting component. This ' + - 'usually means you called setState() on an unmounted component.' - ) : invariant(compositeLifeCycleState !== CompositeLifeCycle.UNMOUNTING)); -} - -/** - * Mixin helper which handles policy validation and reserved - * specification keys when building `ReactCompositeComponent` classses. - */ -function mixSpecIntoComponent(Constructor, spec) { - if (!spec) { - return; - } - - ("production" !== process.env.NODE_ENV ? invariant( - !ReactLegacyElement.isValidFactory(spec), - 'ReactCompositeComponent: You\'re attempting to ' + - 'use a component class as a mixin. Instead, just use a regular object.' - ) : invariant(!ReactLegacyElement.isValidFactory(spec))); - ("production" !== process.env.NODE_ENV ? invariant( - !ReactElement.isValidElement(spec), - 'ReactCompositeComponent: You\'re attempting to ' + - 'use a component as a mixin. Instead, just use a regular object.' - ) : invariant(!ReactElement.isValidElement(spec))); - - var proto = Constructor.prototype; - - // By handling mixins before any other properties, we ensure the same - // chaining order is applied to methods with DEFINE_MANY policy, whether - // mixins are listed before or after these methods in the spec. - if (spec.hasOwnProperty(MIXINS_KEY)) { - RESERVED_SPEC_KEYS.mixins(Constructor, spec.mixins); - } - - for (var name in spec) { - if (!spec.hasOwnProperty(name)) { - continue; - } - - if (name === MIXINS_KEY) { - // We have already handled mixins in a special case above - continue; - } - - var property = spec[name]; - validateMethodOverride(proto, name); - - if (RESERVED_SPEC_KEYS.hasOwnProperty(name)) { - RESERVED_SPEC_KEYS[name](Constructor, property); - } else { - // Setup methods on prototype: - // The following member methods should not be automatically bound: - // 1. Expected ReactCompositeComponent methods (in the "interface"). - // 2. Overridden methods (that were mixed in). - var isCompositeComponentMethod = - ReactCompositeComponentInterface.hasOwnProperty(name); - var isAlreadyDefined = proto.hasOwnProperty(name); - var markedDontBind = property && property.__reactDontBind; - var isFunction = typeof property === 'function'; - var shouldAutoBind = - isFunction && - !isCompositeComponentMethod && - !isAlreadyDefined && - !markedDontBind; - - if (shouldAutoBind) { - if (!proto.__reactAutoBindMap) { - proto.__reactAutoBindMap = {}; - } - proto.__reactAutoBindMap[name] = property; - proto[name] = property; - } else { - if (isAlreadyDefined) { - var specPolicy = ReactCompositeComponentInterface[name]; - - // These cases should already be caught by validateMethodOverride - ("production" !== process.env.NODE_ENV ? invariant( - isCompositeComponentMethod && ( - specPolicy === SpecPolicy.DEFINE_MANY_MERGED || - specPolicy === SpecPolicy.DEFINE_MANY - ), - 'ReactCompositeComponent: Unexpected spec policy %s for key %s ' + - 'when mixing in component specs.', - specPolicy, - name - ) : invariant(isCompositeComponentMethod && ( - specPolicy === SpecPolicy.DEFINE_MANY_MERGED || - specPolicy === SpecPolicy.DEFINE_MANY - ))); - - // For methods which are defined more than once, call the existing - // methods before calling the new property, merging if appropriate. - if (specPolicy === SpecPolicy.DEFINE_MANY_MERGED) { - proto[name] = createMergedResultFunction(proto[name], property); - } else if (specPolicy === SpecPolicy.DEFINE_MANY) { - proto[name] = createChainedFunction(proto[name], property); - } - } else { - proto[name] = property; - if ("production" !== process.env.NODE_ENV) { - // Add verbose displayName to the function, which helps when looking - // at profiling tools. - if (typeof property === 'function' && spec.displayName) { - proto[name].displayName = spec.displayName + '_' + name; - } - } - } - } - } - } -} - -function mixStaticSpecIntoComponent(Constructor, statics) { - if (!statics) { - return; - } - for (var name in statics) { - var property = statics[name]; - if (!statics.hasOwnProperty(name)) { - continue; - } - - var isReserved = name in RESERVED_SPEC_KEYS; - ("production" !== process.env.NODE_ENV ? invariant( - !isReserved, - 'ReactCompositeComponent: 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(!isReserved)); - - var isInherited = name in Constructor; - ("production" !== process.env.NODE_ENV ? invariant( - !isInherited, - 'ReactCompositeComponent: You are attempting to define ' + - '`%s` on your component more than once. This conflict may be ' + - 'due to a mixin.', - name - ) : invariant(!isInherited)); - Constructor[name] = property; - } -} - -/** - * Merge two objects, but throw if both contain the same key. - * - * @param {object} one The first object, which is mutated. - * @param {object} two The second object - * @return {object} one after it has been mutated to contain everything in two. - */ -function mergeObjectsWithNoDuplicateKeys(one, two) { - ("production" !== process.env.NODE_ENV ? invariant( - one && two && typeof one === 'object' && typeof two === 'object', - 'mergeObjectsWithNoDuplicateKeys(): Cannot merge non-objects' - ) : invariant(one && two && typeof one === 'object' && typeof two === 'object')); - - mapObject(two, function(value, key) { - ("production" !== process.env.NODE_ENV ? invariant( - one[key] === undefined, - 'mergeObjectsWithNoDuplicateKeys(): ' + - '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(one[key] === undefined)); - one[key] = value; - }); - return one; -} - -/** - * Creates a function that invokes two functions and merges their return values. - * - * @param {function} one Function to invoke first. - * @param {function} two Function to invoke second. - * @return {function} Function that invokes the two argument functions. - * @private - */ -function createMergedResultFunction(one, two) { - return function mergedResult() { - var a = one.apply(this, arguments); - var b = two.apply(this, arguments); - if (a == null) { - return b; - } else if (b == null) { - return a; - } - return mergeObjectsWithNoDuplicateKeys(a, b); - }; -} - -/** - * Creates a function that invokes two functions and ignores their return vales. - * - * @param {function} one Function to invoke first. - * @param {function} two Function to invoke second. - * @return {function} Function that invokes the two argument functions. - * @private - */ -function createChainedFunction(one, two) { - return function chainedFunction() { - one.apply(this, arguments); - two.apply(this, arguments); - }; -} - -/** - * `ReactCompositeComponent` maintains an auxiliary life cycle state in - * `this._compositeLifeCycleState` (which can be null). - * - * This is different from the life cycle state maintained by `ReactComponent` in - * `this._lifeCycleState`. The following diagram shows how the states overlap in - * time. There are times when the CompositeLifeCycle is null - at those times it - * is only meaningful to look at ComponentLifeCycle alone. - * - * Top Row: ReactComponent.ComponentLifeCycle - * Low Row: ReactComponent.CompositeLifeCycle - * - * +-------+---------------------------------+--------+ - * | UN | MOUNTED | UN | - * |MOUNTED| | MOUNTED| - * +-------+---------------------------------+--------+ - * | ^--------+ +-------+ +--------^ | - * | | | | | | | | - * | 0--|MOUNTING|-0-|RECEIVE|-0-| UN |--->0 | - * | | | |PROPS | |MOUNTING| | - * | | | | | | | | - * | | | | | | | | - * | +--------+ +-------+ +--------+ | - * | | | | - * +-------+---------------------------------+--------+ - */ -var CompositeLifeCycle = keyMirror({ - /** - * Components in the process of being mounted respond to state changes - * differently. - */ - MOUNTING: null, - /** - * Components in the process of being unmounted are guarded against state - * changes. - */ - UNMOUNTING: null, - /** - * Components that are mounted and receiving new props respond to state - * changes differently. - */ - RECEIVING_PROPS: null -}); - -/** - * @lends {ReactCompositeComponent.prototype} - */ -var ReactCompositeComponentMixin = { - - /** - * Base constructor for all composite component. - * - * @param {ReactElement} element - * @final - * @internal - */ - construct: function(element) { - // Children can be either an array or more than one argument - ReactComponent.Mixin.construct.apply(this, arguments); - ReactOwner.Mixin.construct.apply(this, arguments); - - this.state = null; - this._pendingState = null; - - // This is the public post-processed context. The real context and pending - // context lives on the element. - this.context = null; - - this._compositeLifeCycleState = null; - }, - - /** - * Checks whether or not this composite component is mounted. - * @return {boolean} True if mounted, false otherwise. - * @protected - * @final - */ - isMounted: function() { - return ReactComponent.Mixin.isMounted.call(this) && - this._compositeLifeCycleState !== CompositeLifeCycle.MOUNTING; - }, - - /** - * Initializes the component, renders markup, and registers event listeners. - * - * @param {string} rootID DOM ID of the root node. - * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction - * @param {number} mountDepth number of components in the owner hierarchy - * @return {?string} Rendered markup to be inserted into the DOM. - * @final - * @internal - */ - mountComponent: ReactPerf.measure( - 'ReactCompositeComponent', - 'mountComponent', - function(rootID, transaction, mountDepth) { - ReactComponent.Mixin.mountComponent.call( - this, - rootID, - transaction, - mountDepth - ); - this._compositeLifeCycleState = CompositeLifeCycle.MOUNTING; - - if (this.__reactAutoBindMap) { - this._bindAutoBindMethods(); - } - - this.context = this._processContext(this._currentElement._context); - this.props = this._processProps(this.props); - - this.state = this.getInitialState ? this.getInitialState() : null; - ("production" !== process.env.NODE_ENV ? invariant( - typeof this.state === 'object' && !Array.isArray(this.state), - '%s.getInitialState(): must return an object or null', - this.constructor.displayName || 'ReactCompositeComponent' - ) : invariant(typeof this.state === 'object' && !Array.isArray(this.state))); - - this._pendingState = null; - this._pendingForceUpdate = false; - - if (this.componentWillMount) { - this.componentWillMount(); - // When mounting, calls to `setState` by `componentWillMount` will set - // `this._pendingState` without triggering a re-render. - if (this._pendingState) { - this.state = this._pendingState; - this._pendingState = null; - } - } - - this._renderedComponent = instantiateReactComponent( - this._renderValidatedComponent(), - this._currentElement.type // The wrapping type - ); - - // Done with mounting, `setState` will now trigger UI changes. - this._compositeLifeCycleState = null; - var markup = this._renderedComponent.mountComponent( - rootID, - transaction, - mountDepth + 1 - ); - if (this.componentDidMount) { - transaction.getReactMountReady().enqueue(this.componentDidMount, this); - } - return markup; - } - ), - - /** - * Releases any resources allocated by `mountComponent`. - * - * @final - * @internal - */ - unmountComponent: function() { - this._compositeLifeCycleState = CompositeLifeCycle.UNMOUNTING; - if (this.componentWillUnmount) { - this.componentWillUnmount(); - } - this._compositeLifeCycleState = null; - - this._renderedComponent.unmountComponent(); - this._renderedComponent = null; - - ReactComponent.Mixin.unmountComponent.call(this); - - // Some existing components rely on this.props even after they've been - // destroyed (in event handlers). - // TODO: this.props = null; - // TODO: this.state = null; - }, - - /** - * Sets a subset of the state. Always use this or `replaceState` to mutate - * state. You should treat `this.state` as immutable. - * - * There is no guarantee that `this.state` will be immediately updated, so - * accessing `this.state` after calling this method may return the old value. - * - * There is no guarantee that calls to `setState` will run synchronously, - * as they may eventually be batched together. You can provide an optional - * callback that will be executed when the call to setState is actually - * completed. - * - * @param {object} partialState Next partial state to be merged with state. - * @param {?function} callback Called after state is updated. - * @final - * @protected - */ - setState: function(partialState, callback) { - ("production" !== process.env.NODE_ENV ? invariant( - typeof partialState === 'object' || partialState == null, - 'setState(...): takes an object of state variables to update.' - ) : invariant(typeof partialState === 'object' || partialState == null)); - if ("production" !== process.env.NODE_ENV){ - ("production" !== process.env.NODE_ENV ? warning( - partialState != null, - 'setState(...): You passed an undefined or null state object; ' + - 'instead, use forceUpdate().' - ) : null); - } - // Merge with `_pendingState` if it exists, otherwise with existing state. - this.replaceState( - assign({}, this._pendingState || this.state, partialState), - callback - ); - }, - - /** - * Replaces all of the state. Always use this or `setState` to mutate state. - * You should treat `this.state` as immutable. - * - * There is no guarantee that `this.state` will be immediately updated, so - * accessing `this.state` after calling this method may return the old value. - * - * @param {object} completeState Next state. - * @param {?function} callback Called after state is updated. - * @final - * @protected - */ - replaceState: function(completeState, callback) { - validateLifeCycleOnReplaceState(this); - this._pendingState = completeState; - if (this._compositeLifeCycleState !== CompositeLifeCycle.MOUNTING) { - // If we're in a componentWillMount handler, don't enqueue a rerender - // because ReactUpdates assumes we're in a browser context (which is wrong - // for server rendering) and we're about to do a render anyway. - // TODO: The callback here is ignored when setState is called from - // componentWillMount. Either fix it or disallow doing so completely in - // favor of getInitialState. - ReactUpdates.enqueueUpdate(this, callback); - } - }, - - /** - * Filters the context object to only contain keys specified in - * `contextTypes`, and asserts that they are valid. - * - * @param {object} context - * @return {?object} - * @private - */ - _processContext: function(context) { - var maskedContext = null; - var contextTypes = this.constructor.contextTypes; - if (contextTypes) { - maskedContext = {}; - for (var contextName in contextTypes) { - maskedContext[contextName] = context[contextName]; - } - if ("production" !== process.env.NODE_ENV) { - this._checkPropTypes( - contextTypes, - maskedContext, - ReactPropTypeLocations.context - ); - } - } - return maskedContext; - }, - - /** - * @param {object} currentContext - * @return {object} - * @private - */ - _processChildContext: function(currentContext) { - var childContext = this.getChildContext && this.getChildContext(); - var displayName = this.constructor.displayName || 'ReactCompositeComponent'; - if (childContext) { - ("production" !== process.env.NODE_ENV ? invariant( - typeof this.constructor.childContextTypes === 'object', - '%s.getChildContext(): childContextTypes must be defined in order to ' + - 'use getChildContext().', - displayName - ) : invariant(typeof this.constructor.childContextTypes === 'object')); - if ("production" !== process.env.NODE_ENV) { - this._checkPropTypes( - this.constructor.childContextTypes, - childContext, - ReactPropTypeLocations.childContext - ); - } - for (var name in childContext) { - ("production" !== process.env.NODE_ENV ? invariant( - name in this.constructor.childContextTypes, - '%s.getChildContext(): key "%s" is not defined in childContextTypes.', - displayName, - name - ) : invariant(name in this.constructor.childContextTypes)); - } - return assign({}, currentContext, childContext); - } - return currentContext; - }, - - /** - * Processes props by setting default values for unspecified props and - * asserting that the props are valid. Does not mutate its argument; returns - * a new props object with defaults merged in. - * - * @param {object} newProps - * @return {object} - * @private - */ - _processProps: function(newProps) { - if ("production" !== process.env.NODE_ENV) { - var propTypes = this.constructor.propTypes; - if (propTypes) { - this._checkPropTypes(propTypes, newProps, ReactPropTypeLocations.prop); - } - } - return newProps; - }, - - /** - * Assert that the props are valid - * - * @param {object} propTypes Map of prop name to a ReactPropType - * @param {object} props - * @param {string} location e.g. "prop", "context", "child context" - * @private - */ - _checkPropTypes: function(propTypes, props, location) { - // TODO: Stop validating prop types here and only use the element - // validation. - var componentName = this.constructor.displayName; - for (var propName in propTypes) { - if (propTypes.hasOwnProperty(propName)) { - var error = - propTypes[propName](props, propName, componentName, location); - if (error instanceof Error) { - // We may want to extend this logic for similar errors in - // renderComponent calls, so I'm abstracting it away into - // a function to minimize refactoring in the future - var addendum = getDeclarationErrorAddendum(this); - ("production" !== process.env.NODE_ENV ? warning(false, error.message + addendum) : null); - } - } - } - }, - - /** - * If any of `_pendingElement`, `_pendingState`, or `_pendingForceUpdate` - * is set, update the component. - * - * @param {ReactReconcileTransaction} transaction - * @internal - */ - performUpdateIfNecessary: function(transaction) { - var compositeLifeCycleState = this._compositeLifeCycleState; - // Do not trigger a state transition if we are in the middle of mounting or - // receiving props because both of those will already be doing this. - if (compositeLifeCycleState === CompositeLifeCycle.MOUNTING || - compositeLifeCycleState === CompositeLifeCycle.RECEIVING_PROPS) { - return; - } - - if (this._pendingElement == null && - this._pendingState == null && - !this._pendingForceUpdate) { - return; - } - - var nextContext = this.context; - var nextProps = this.props; - var nextElement = this._currentElement; - if (this._pendingElement != null) { - nextElement = this._pendingElement; - nextContext = this._processContext(nextElement._context); - nextProps = this._processProps(nextElement.props); - this._pendingElement = null; - - this._compositeLifeCycleState = CompositeLifeCycle.RECEIVING_PROPS; - if (this.componentWillReceiveProps) { - this.componentWillReceiveProps(nextProps, nextContext); - } - } - - this._compositeLifeCycleState = null; - - var nextState = this._pendingState || this.state; - this._pendingState = null; - - var shouldUpdate = - this._pendingForceUpdate || - !this.shouldComponentUpdate || - this.shouldComponentUpdate(nextProps, nextState, nextContext); - - if ("production" !== process.env.NODE_ENV) { - if (typeof shouldUpdate === "undefined") { - console.warn( - (this.constructor.displayName || 'ReactCompositeComponent') + - '.shouldComponentUpdate(): Returned undefined instead of a ' + - 'boolean value. Make sure to return true or false.' - ); - } - } - - if (shouldUpdate) { - this._pendingForceUpdate = false; - // Will set `this.props`, `this.state` and `this.context`. - this._performComponentUpdate( - nextElement, - nextProps, - nextState, - nextContext, - transaction - ); - } else { - // If it's determined that a component should not update, we still want - // to set props and state. - this._currentElement = nextElement; - this.props = nextProps; - this.state = nextState; - this.context = nextContext; - - // Owner cannot change because shouldUpdateReactComponent doesn't allow - // it. TODO: Remove this._owner completely. - this._owner = nextElement._owner; - } - }, - - /** - * Merges new props and state, notifies delegate methods of update and - * performs update. - * - * @param {ReactElement} nextElement Next element - * @param {object} nextProps Next public object to set as properties. - * @param {?object} nextState Next object to set as state. - * @param {?object} nextContext Next public object to set as context. - * @param {ReactReconcileTransaction} transaction - * @private - */ - _performComponentUpdate: function( - nextElement, - nextProps, - nextState, - nextContext, - transaction - ) { - var prevElement = this._currentElement; - var prevProps = this.props; - var prevState = this.state; - var prevContext = this.context; - - if (this.componentWillUpdate) { - this.componentWillUpdate(nextProps, nextState, nextContext); - } - - this._currentElement = nextElement; - this.props = nextProps; - this.state = nextState; - this.context = nextContext; - - // Owner cannot change because shouldUpdateReactComponent doesn't allow - // it. TODO: Remove this._owner completely. - this._owner = nextElement._owner; - - this.updateComponent( - transaction, - prevElement - ); - - if (this.componentDidUpdate) { - transaction.getReactMountReady().enqueue( - this.componentDidUpdate.bind(this, prevProps, prevState, prevContext), - this - ); - } - }, - - receiveComponent: function(nextElement, transaction) { - if (nextElement === this._currentElement && - nextElement._owner != null) { - // Since elements are immutable after the owner is rendered, - // we can do a cheap identity compare here to determine if this is a - // superfluous reconcile. It's possible for state to be mutable but such - // change should trigger an update of the owner which would recreate - // the element. We explicitly check for the existence of an owner since - // it's possible for a element created outside a composite to be - // deeply mutated and reused. - return; - } - - ReactComponent.Mixin.receiveComponent.call( - this, - nextElement, - transaction - ); - }, - - /** - * Updates the component's currently mounted DOM representation. - * - * By default, this implements React's rendering and reconciliation algorithm. - * Sophisticated clients may wish to override this. - * - * @param {ReactReconcileTransaction} transaction - * @param {ReactElement} prevElement - * @internal - * @overridable - */ - updateComponent: ReactPerf.measure( - 'ReactCompositeComponent', - 'updateComponent', - function(transaction, prevParentElement) { - ReactComponent.Mixin.updateComponent.call( - this, - transaction, - prevParentElement - ); - - var prevComponentInstance = this._renderedComponent; - var prevElement = prevComponentInstance._currentElement; - var nextElement = this._renderValidatedComponent(); - if (shouldUpdateReactComponent(prevElement, nextElement)) { - prevComponentInstance.receiveComponent(nextElement, transaction); - } else { - // These two IDs are actually the same! But nothing should rely on that. - var thisID = this._rootNodeID; - var prevComponentID = prevComponentInstance._rootNodeID; - prevComponentInstance.unmountComponent(); - this._renderedComponent = instantiateReactComponent( - nextElement, - this._currentElement.type - ); - var nextMarkup = this._renderedComponent.mountComponent( - thisID, - transaction, - this._mountDepth + 1 - ); - ReactComponent.BackendIDOperations.dangerouslyReplaceNodeWithMarkupByID( - prevComponentID, - nextMarkup - ); - } - } - ), - - /** - * Forces an update. This should only be invoked when it is known with - * certainty that we are **not** in a DOM transaction. - * - * You may want to call this when you know that some deeper aspect of the - * component's state has changed but `setState` was not called. - * - * This will not invoke `shouldUpdateComponent`, but it will invoke - * `componentWillUpdate` and `componentDidUpdate`. - * - * @param {?function} callback Called after update is complete. - * @final - * @protected - */ - forceUpdate: function(callback) { - var compositeLifeCycleState = this._compositeLifeCycleState; - ("production" !== process.env.NODE_ENV ? invariant( - this.isMounted() || - compositeLifeCycleState === CompositeLifeCycle.MOUNTING, - 'forceUpdate(...): Can only force an update on mounted or mounting ' + - 'components.' - ) : invariant(this.isMounted() || - compositeLifeCycleState === CompositeLifeCycle.MOUNTING)); - ("production" !== process.env.NODE_ENV ? invariant( - compositeLifeCycleState !== CompositeLifeCycle.UNMOUNTING && - ReactCurrentOwner.current == null, - 'forceUpdate(...): Cannot force an update while unmounting component ' + - 'or within a `render` function.' - ) : invariant(compositeLifeCycleState !== CompositeLifeCycle.UNMOUNTING && - ReactCurrentOwner.current == null)); - this._pendingForceUpdate = true; - ReactUpdates.enqueueUpdate(this, callback); - }, - - /** - * @private - */ - _renderValidatedComponent: ReactPerf.measure( - 'ReactCompositeComponent', - '_renderValidatedComponent', - function() { - var renderedComponent; - var previousContext = ReactContext.current; - ReactContext.current = this._processChildContext( - this._currentElement._context - ); - ReactCurrentOwner.current = this; - try { - renderedComponent = this.render(); - if (renderedComponent === null || renderedComponent === false) { - renderedComponent = ReactEmptyComponent.getEmptyComponent(); - ReactEmptyComponent.registerNullComponentID(this._rootNodeID); - } else { - ReactEmptyComponent.deregisterNullComponentID(this._rootNodeID); - } - } finally { - ReactContext.current = previousContext; - ReactCurrentOwner.current = null; - } - ("production" !== process.env.NODE_ENV ? invariant( - ReactElement.isValidElement(renderedComponent), - '%s.render(): A valid ReactComponent must be returned. You may have ' + - 'returned undefined, an array or some other invalid object.', - this.constructor.displayName || 'ReactCompositeComponent' - ) : invariant(ReactElement.isValidElement(renderedComponent))); - return renderedComponent; - } - ), - - /** - * @private - */ - _bindAutoBindMethods: function() { - for (var autoBindKey in this.__reactAutoBindMap) { - if (!this.__reactAutoBindMap.hasOwnProperty(autoBindKey)) { - continue; - } - var method = this.__reactAutoBindMap[autoBindKey]; - this[autoBindKey] = this._bindAutoBindMethod(ReactErrorUtils.guard( - method, - this.constructor.displayName + '.' + autoBindKey - )); - } - }, - - /** - * Binds a method to the component. - * - * @param {function} method Method to be bound. - * @private - */ - _bindAutoBindMethod: function(method) { - var component = this; - var boundMethod = method.bind(component); - if ("production" !== process.env.NODE_ENV) { - boundMethod.__reactBoundContext = component; - boundMethod.__reactBoundMethod = method; - boundMethod.__reactBoundArguments = null; - var componentName = component.constructor.displayName; - var _bind = boundMethod.bind; - boundMethod.bind = function(newThis ) {for (var args=[],$__0=1,$__1=arguments.length;$__0<$__1;$__0++) args.push(arguments[$__0]); - // User is trying to bind() an autobound method; we effectively will - // ignore the value of "this" that the user is trying to use, so - // let's warn. - if (newThis !== component && newThis !== null) { - monitorCodeUse('react_bind_warning', { component: componentName }); - console.warn( - 'bind(): React component methods may only be bound to the ' + - 'component instance. See ' + componentName - ); - } else if (!args.length) { - monitorCodeUse('react_bind_warning', { component: componentName }); - console.warn( - '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 ' + componentName - ); - return boundMethod; - } - var reboundMethod = _bind.apply(boundMethod, arguments); - reboundMethod.__reactBoundContext = component; - reboundMethod.__reactBoundMethod = method; - reboundMethod.__reactBoundArguments = args; - return reboundMethod; - }; - } - return boundMethod; - } -}; - -var ReactCompositeComponentBase = function() {}; -assign( - ReactCompositeComponentBase.prototype, - ReactComponent.Mixin, - ReactOwner.Mixin, - ReactPropTransferer.Mixin, - ReactCompositeComponentMixin -); - -/** - * Module for creating composite components. - * - * @class ReactCompositeComponent - * @extends ReactComponent - * @extends ReactOwner - * @extends ReactPropTransferer - */ -var ReactCompositeComponent = { - - LifeCycle: CompositeLifeCycle, - - Base: ReactCompositeComponentBase, - - /** - * Creates a composite component class given a class specification. - * - * @param {object} spec Class specification (which must define `render`). - * @return {function} Component constructor function. - * @public - */ - createClass: function(spec) { - var Constructor = function(props) { - // This constructor is overridden by mocks. The argument is used - // by mocks to assert on what gets mounted. This will later be used - // by the stand-alone class implementation. - }; - Constructor.prototype = new ReactCompositeComponentBase(); - Constructor.prototype.constructor = Constructor; - - injectedMixins.forEach( - mixSpecIntoComponent.bind(null, Constructor) - ); - - mixSpecIntoComponent(Constructor, spec); - - // Initialize the defaultProps property after all mixins have been merged - if (Constructor.getDefaultProps) { - Constructor.defaultProps = Constructor.getDefaultProps(); - } - - ("production" !== process.env.NODE_ENV ? invariant( - Constructor.prototype.render, - 'createClass(...): Class specification must implement a `render` method.' - ) : invariant(Constructor.prototype.render)); - - if ("production" !== process.env.NODE_ENV) { - if (Constructor.prototype.componentShouldUpdate) { - monitorCodeUse( - 'react_component_should_update_warning', - { component: spec.displayName } - ); - console.warn( - (spec.displayName || 'A component') + ' 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.' - ); - } - } - - // Reduce time spent doing lookups by setting these on the prototype. - for (var methodName in ReactCompositeComponentInterface) { - if (!Constructor.prototype[methodName]) { - Constructor.prototype[methodName] = null; - } - } - - if ("production" !== process.env.NODE_ENV) { - return ReactLegacyElement.wrapFactory( - ReactElementValidator.createFactory(Constructor) - ); - } - return ReactLegacyElement.wrapFactory( - ReactElement.createFactory(Constructor) - ); - }, - - injection: { - injectMixin: function(mixin) { - injectedMixins.push(mixin); - } - } -}; - -module.exports = ReactCompositeComponent; - -}).call(this,require('_process')) -},{"./Object.assign":28,"./ReactComponent":34,"./ReactContext":37,"./ReactCurrentOwner":38,"./ReactElement":54,"./ReactElementValidator":55,"./ReactEmptyComponent":56,"./ReactErrorUtils":57,"./ReactLegacyElement":63,"./ReactOwner":69,"./ReactPerf":70,"./ReactPropTransferer":71,"./ReactPropTypeLocationNames":72,"./ReactPropTypeLocations":73,"./ReactUpdates":81,"./instantiateReactComponent":127,"./invariant":128,"./keyMirror":134,"./keyOf":135,"./mapObject":136,"./monitorCodeUse":138,"./shouldUpdateReactComponent":144,"./warning":147,"_process":149}],37:[function(require,module,exports){ -/** - * Copyright 2013-2014, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * @providesModule ReactContext - */ - -"use strict"; - -var assign = require("./Object.assign"); - -/** - * Keeps track of the current context. - * - * The context is automatically passed down the component ownership hierarchy - * and is accessible via `this.context` on ReactCompositeComponents. - */ -var ReactContext = { - - /** - * @internal - * @type {object} - */ - current: {}, - - /** - * Temporarily extends the current context while executing scopedCallback. - * - * A typical use case might look like - * - * render: function() { - * var children = ReactContext.withContext({foo: 'foo'}, () => ( - * - * )); - * return
{children}
; - * } - * - * @param {object} newContext New context to merge into the existing context - * @param {function} scopedCallback Callback to run with the new context - * @return {ReactComponent|array} - */ - withContext: function(newContext, scopedCallback) { - var result; - var previousContext = ReactContext.current; - ReactContext.current = assign({}, previousContext, newContext); - try { - result = scopedCallback(); - } finally { - ReactContext.current = previousContext; - } - return result; - } - -}; - -module.exports = ReactContext; - -},{"./Object.assign":28}],38:[function(require,module,exports){ -/** - * Copyright 2013-2014, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * @providesModule ReactCurrentOwner - */ - -"use strict"; - -/** - * Keeps track of the current owner. - * - * The current owner is the component who should own any components that are - * currently being constructed. - * - * The depth indicate how many composite components are above this render level. - */ -var ReactCurrentOwner = { - - /** - * @internal - * @type {ReactComponent} - */ - current: null - -}; - -module.exports = ReactCurrentOwner; - -},{}],39:[function(require,module,exports){ -(function (process){ -/** - * Copyright 2013-2014, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * @providesModule ReactDOM - * @typechecks static-only - */ - -"use strict"; - -var ReactElement = require("./ReactElement"); -var ReactElementValidator = require("./ReactElementValidator"); -var ReactLegacyElement = require("./ReactLegacyElement"); - -var mapObject = require("./mapObject"); - -/** - * Create a factory that creates HTML tag elements. - * - * @param {string} tag Tag name (e.g. `div`). - * @private - */ -function createDOMFactory(tag) { - if ("production" !== process.env.NODE_ENV) { - return ReactLegacyElement.markNonLegacyFactory( - ReactElementValidator.createFactory(tag) - ); - } - return ReactLegacyElement.markNonLegacyFactory( - ReactElement.createFactory(tag) - ); -} - -/** - * Creates a mapping from supported HTML tags to `ReactDOMComponent` classes. - * This is also accessible via `React.DOM`. - * - * @public - */ -var ReactDOM = mapObject({ - a: 'a', - abbr: 'abbr', - address: 'address', - area: 'area', - article: 'article', - aside: 'aside', - audio: 'audio', - b: 'b', - base: 'base', - bdi: 'bdi', - bdo: 'bdo', - big: 'big', - blockquote: 'blockquote', - body: 'body', - br: 'br', - button: 'button', - canvas: 'canvas', - caption: 'caption', - cite: 'cite', - code: 'code', - col: 'col', - colgroup: 'colgroup', - data: 'data', - datalist: 'datalist', - dd: 'dd', - del: 'del', - details: 'details', - dfn: 'dfn', - dialog: 'dialog', - div: 'div', - dl: 'dl', - dt: 'dt', - em: 'em', - embed: 'embed', - fieldset: 'fieldset', - figcaption: 'figcaption', - figure: 'figure', - footer: 'footer', - form: 'form', - h1: 'h1', - h2: 'h2', - h3: 'h3', - h4: 'h4', - h5: 'h5', - h6: 'h6', - head: 'head', - header: 'header', - hr: 'hr', - html: 'html', - i: 'i', - iframe: 'iframe', - img: 'img', - input: 'input', - ins: 'ins', - kbd: 'kbd', - keygen: 'keygen', - label: 'label', - legend: 'legend', - li: 'li', - link: 'link', - main: 'main', - map: 'map', - mark: 'mark', - menu: 'menu', - menuitem: 'menuitem', - meta: 'meta', - meter: 'meter', - nav: 'nav', - noscript: 'noscript', - object: 'object', - ol: 'ol', - optgroup: 'optgroup', - option: 'option', - output: 'output', - p: 'p', - param: 'param', - picture: 'picture', - pre: 'pre', - progress: 'progress', - q: 'q', - rp: 'rp', - rt: 'rt', - ruby: 'ruby', - s: 's', - samp: 'samp', - script: 'script', - section: 'section', - select: 'select', - small: 'small', - source: 'source', - span: 'span', - strong: 'strong', - style: 'style', - sub: 'sub', - summary: 'summary', - sup: 'sup', - table: 'table', - tbody: 'tbody', - td: 'td', - textarea: 'textarea', - tfoot: 'tfoot', - th: 'th', - thead: 'thead', - time: 'time', - title: 'title', - tr: 'tr', - track: 'track', - u: 'u', - ul: 'ul', - 'var': 'var', - video: 'video', - wbr: 'wbr', - - // SVG - circle: 'circle', - defs: 'defs', - ellipse: 'ellipse', - g: 'g', - line: 'line', - linearGradient: 'linearGradient', - mask: 'mask', - path: 'path', - pattern: 'pattern', - polygon: 'polygon', - polyline: 'polyline', - radialGradient: 'radialGradient', - rect: 'rect', - stop: 'stop', - svg: 'svg', - text: 'text', - tspan: 'tspan' - -}, createDOMFactory); - -module.exports = ReactDOM; - -}).call(this,require('_process')) -},{"./ReactElement":54,"./ReactElementValidator":55,"./ReactLegacyElement":63,"./mapObject":136,"_process":149}],40:[function(require,module,exports){ -/** - * Copyright 2013-2014, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * @providesModule ReactDOMButton - */ - -"use strict"; - -var AutoFocusMixin = require("./AutoFocusMixin"); -var ReactBrowserComponentMixin = require("./ReactBrowserComponentMixin"); -var ReactCompositeComponent = require("./ReactCompositeComponent"); -var ReactElement = require("./ReactElement"); -var ReactDOM = require("./ReactDOM"); - -var keyMirror = require("./keyMirror"); - -// Store a reference to the