react 16.0.0-alpha.7 → 16.0.0-alpha.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- "use strict";function e(e){for(var t=arguments.length-1,n="Minified React error #"+e+"; visit http://facebook.github.io/react/docs/error-decoder.html?invariant="+e,r=0;r<t;r++)n+="&args[]="+encodeURIComponent(arguments[r+1]);n+=" for the full message or use the non-minified dev environment for full errors and additional helpful warnings.";var o=new Error(n);throw o.name="Invariant Violation",o.framesToPop=1,o}function t(e,t){}function n(e,t,n){this.props=e,this.context=t,this.refs=j,this.updater=n||U}function r(e,t,n){this.props=e,this.context=t,this.refs=j,this.updater=n||U}function o(){}function i(e){return void 0!==e.ref}function a(e){return void 0!==e.key}function u(e){var t=e&&(ae&&e[ae]||e[ue]);if("function"==typeof t)return t}function l(e){var t={"=":"=0",":":"=2"};return"$"+(""+e).replace(/[=:]/g,function(e){return t[e]})}function c(e){var t={"=0":"=","=2":":"};return(""+("."===e[0]&&"$"===e[1]?e.substring(2):e.substring(1))).replace(/(=0|=2)/g,function(e){return t[e]})}function s(e,t){return e&&"object"==typeof e&&null!=e.key?se.escape(e.key):t.toString(36)}function p(e,t,n,r){var o=typeof e;if("undefined"!==o&&"boolean"!==o||(e=null),null===e||"string"===o||"number"===o||"object"===o&&e.$$typeof===te)return n(r,e,""===t?pe+s(e,0):t),1;var i,a,u=0,l=""===t?pe:t+fe;if(Array.isArray(e))for(var c=0;c<e.length;c++)i=e[c],a=l+s(i,c),u+=p(i,a,n,r);else{var f=le(e);if(f)for(var d,y=f.call(e),h=0;!(d=y.next()).done;)i=d.value,a=l+s(i,h++),u+=p(i,a,n,r);else if("object"===o){var m=""+e;Y("31","[object Object]"===m?"object with keys {"+Object.keys(e).join(", ")+"}":m,"")}}return u}function f(e,t,n){return null==e?0:p(e,"",t,n)}function d(e){return(""+e).replace(me,"$&/")}function y(e,t){this.func=e,this.context=t,this.count=0}function h(e,t,n){var r=e.func,o=e.context;r.call(o,t,e.count++)}function m(e,t,n){if(null==e)return e;var r=y.getPooled(t,n);de(e,h,r),y.release(r)}function v(e,t,n,r){this.result=e,this.keyPrefix=t,this.func=n,this.context=r,this.count=0}function E(e,t,n){var r=e.result,o=e.keyPrefix,i=e.func,a=e.context,u=i.call(a,t,e.count++);Array.isArray(u)?g(u,r,n,T.thatReturnsArgument):null!=u&&(ie.isValidElement(u)&&(u=ie.cloneAndReplaceKey(u,o+(!u.key||t&&t.key===u.key?"":d(u.key)+"/")+n)),r.push(u))}function g(e,t,n,r,o){var i="";null!=n&&(i=d(n)+"/");var a=v.getPooled(t,i,r,o);de(e,E,a),v.release(a)}function b(e,t,n){if(null==e)return e;var r=[];return g(e,r,null,t,n),r}function _(e,t,n){return null}function P(e,t){return de(e,_,null)}function N(e){var t=[];return g(e,t,null,T.thatReturnsArgument),t}function A(e){return e}function D(e,t){var n=_e.hasOwnProperty(t)?_e[t]:null;Ne.hasOwnProperty(t)&&"OVERRIDE_BASE"!==n&&Y("73",t),e&&"DEFINE_MANY"!==n&&"DEFINE_MANY_MERGED"!==n&&Y("74",t)}function x(e,t){if(t){"function"==typeof t&&Y("75"),ie.isValidElement(t)&&Y("76");var n=e.prototype,r=n.__reactAutoBindPairs;t.hasOwnProperty(be)&&Pe.mixins(e,t.mixins);for(var o in t)if(t.hasOwnProperty(o)&&o!==be){var i=t[o],a=n.hasOwnProperty(o);if(D(a,o),Pe.hasOwnProperty(o))Pe[o](e,i);else{var u=_e.hasOwnProperty(o),l="function"==typeof i,c=l&&!u&&!a&&!1!==t.autobind;if(c)r.push(o,i),n[o]=i;else if(a){var s=_e[o];(!u||"DEFINE_MANY_MERGED"!==s&&"DEFINE_MANY"!==s)&&Y("77",s,o),"DEFINE_MANY_MERGED"===s?n[o]=k(n[o],i):"DEFINE_MANY"===s&&(n[o]=w(n[o],i))}else n[o]=i}}}}function I(e,t){if(t)for(var n in t){var r=t[n];if(t.hasOwnProperty(n)){var o=n in Pe;o&&Y("78",n);var i=n in e;i&&Y("79",n),e[n]=r}}}function M(e,t){e&&t&&"object"==typeof e&&"object"==typeof t||Y("80");for(var n in t)t.hasOwnProperty(n)&&(void 0!==e[n]&&Y("81",n),e[n]=t[n]);return e}function k(e,t){return function(){var n=e.apply(this,arguments),r=t.apply(this,arguments);if(null==n)return r;if(null==r)return n;var o={};return M(o,n),M(o,r),o}}function w(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function O(e,t){return t.bind(e)}function F(e){for(var t=e.__reactAutoBindPairs,n=0;n<t.length;n+=2){var r=t[n],o=t[n+1];e[r]=O(e,o)}}function S(e){return ie.isValidElement(e)||Y("143"),e}function C(e,t,n,r,o){}var R=require("object-assign");require("fbjs/lib/warning");var j=require("fbjs/lib/emptyObject");require("fbjs/lib/invariant");var T=require("fbjs/lib/emptyFunction"),Y=e,q={isMounted:function(e){return!1},enqueueForceUpdate:function(e,n,r){t(e,"forceUpdate")},enqueueReplaceState:function(e,n,r,o){t(e,"replaceState")},enqueueSetState:function(e,n,r,o){t(e,"setState")}},U=q;n.prototype.isReactComponent={},n.prototype.setState=function(e,t){"object"!=typeof e&&"function"!=typeof e&&null!=e&&Y("85"),this.updater.enqueueSetState(this,e,t,"setState")},n.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},o.prototype=n.prototype,r.prototype=new o,r.prototype.constructor=r,R(r.prototype,n.prototype),r.prototype.isPureReactComponent=!0;var G={Component:n,PureComponent:r},V=function(e){var t=this;if(t.instancePool.length){var n=t.instancePool.pop();return t.call(n,e),n}return new t(e)},$=function(e,t){var n=this;if(n.instancePool.length){var r=n.instancePool.pop();return n.call(r,e,t),r}return new n(e,t)},B=function(e,t,n){var r=this;if(r.instancePool.length){var o=r.instancePool.pop();return r.call(o,e,t,n),o}return new r(e,t,n)},W=function(e,t,n,r){var o=this;if(o.instancePool.length){var i=o.instancePool.pop();return o.call(i,e,t,n,r),i}return new o(e,t,n,r)},z=function(e){var t=this;e instanceof t||Y("25"),e.destructor(),t.instancePool.length<t.poolSize&&t.instancePool.push(e)},K=10,L=V,H=function(e,t){var n=e;return n.instancePool=[],n.getPooled=t||L,n.poolSize||(n.poolSize=K),n.release=z,n},J={addPoolingTo:H,oneArgumentPooler:V,twoArgumentPooler:$,threeArgumentPooler:B,fourArgumentPooler:W},Q=J,X={current:null},Z=X,ee="function"==typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,te=ee,ne=Object.prototype.hasOwnProperty,re={key:!0,ref:!0,__self:!0,__source:!0},oe=function(e,t,n,r,o,i,a){return{$$typeof:te,type:e,key:t,ref:n,props:a,_owner:i}};oe.createElement=function(e,t,n){var r,o={},u=null,l=null,c=null,s=null;if(null!=t){i(t)&&(l=t.ref),a(t)&&(u=""+t.key),c=void 0===t.__self?null:t.__self,s=void 0===t.__source?null:t.__source;for(r in t)ne.call(t,r)&&!re.hasOwnProperty(r)&&(o[r]=t[r])}var p=arguments.length-2;if(1===p)o.children=n;else if(p>1){for(var f=Array(p),d=0;d<p;d++)f[d]=arguments[d+2];o.children=f}if(e&&e.defaultProps){var y=e.defaultProps;for(r in y)void 0===o[r]&&(o[r]=y[r])}return oe(e,u,l,c,s,Z.current,o)},oe.createFactory=function(e){var t=oe.createElement.bind(null,e);return t.type=e,t},oe.cloneAndReplaceKey=function(e,t){return oe(e.type,t,e.ref,e._self,e._source,e._owner,e.props)},oe.cloneElement=function(e,t,n){var r,o=R({},e.props),u=e.key,l=e.ref,c=e._self,s=e._source,p=e._owner;if(null!=t){i(t)&&(l=t.ref,p=Z.current),a(t)&&(u=""+t.key);var f;e.type&&e.type.defaultProps&&(f=e.type.defaultProps);for(r in t)ne.call(t,r)&&!re.hasOwnProperty(r)&&(void 0===t[r]&&void 0!==f?o[r]=f[r]:o[r]=t[r])}var d=arguments.length-2;if(1===d)o.children=n;else if(d>1){for(var y=Array(d),h=0;h<d;h++)y[h]=arguments[h+2];o.children=y}return oe(e.type,u,l,c,s,p,o)},oe.isValidElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===te};var ie=oe,ae="function"==typeof Symbol&&Symbol.iterator,ue="@@iterator",le=u,ce={escape:l,unescape:c},se=ce,pe=".",fe=":",de=f,ye=Q.twoArgumentPooler,he=Q.fourArgumentPooler,me=/\/+/g;y.prototype.destructor=function(){this.func=null,this.context=null,this.count=0},Q.addPoolingTo(y,ye),v.prototype.destructor=function(){this.result=null,this.keyPrefix=null,this.func=null,this.context=null,this.count=0},Q.addPoolingTo(v,he);var ve={forEach:m,map:b,mapIntoWithKeyPrefixInternal:g,count:P,toArray:N},Ee=ve,ge=G.Component,be="mixins",_e={mixins:"DEFINE_MANY",statics:"DEFINE_MANY",propTypes:"DEFINE_MANY",contextTypes:"DEFINE_MANY",childContextTypes:"DEFINE_MANY",getDefaultProps:"DEFINE_MANY_MERGED",getInitialState:"DEFINE_MANY_MERGED",getChildContext:"DEFINE_MANY_MERGED",render:"DEFINE_ONCE",componentWillMount:"DEFINE_MANY",componentDidMount:"DEFINE_MANY",componentWillReceiveProps:"DEFINE_MANY",shouldComponentUpdate:"DEFINE_ONCE",componentWillUpdate:"DEFINE_MANY",componentDidUpdate:"DEFINE_MANY",componentWillUnmount:"DEFINE_MANY",updateComponent:"OVERRIDE_BASE"},Pe={displayName:function(e,t){e.displayName=t},mixins:function(e,t){if(t)for(var n=0;n<t.length;n++)x(e,t[n])},childContextTypes:function(e,t){e.childContextTypes=R({},e.childContextTypes,t)},contextTypes:function(e,t){e.contextTypes=R({},e.contextTypes,t)},getDefaultProps:function(e,t){e.getDefaultProps?e.getDefaultProps=k(e.getDefaultProps,t):e.getDefaultProps=t},propTypes:function(e,t){e.propTypes=R({},e.propTypes,t)},statics:function(e,t){I(e,t)},autobind:function(){}},Ne={replaceState:function(e,t){this.updater.enqueueReplaceState(this,e,t,"replaceState")},isMounted:function(){return this.updater.isMounted(this)}},Ae=function(){};R(Ae.prototype,ge.prototype,Ne);var De={createClass:function(e){var t=A(function(e,n,r){this.__reactAutoBindPairs.length&&F(this),this.props=e,this.context=n,this.refs=j,this.updater=r||U,this.state=null;var o=this.getInitialState?this.getInitialState():null;("object"!=typeof o||Array.isArray(o))&&Y("82",t.displayName||"ReactCompositeComponent"),this.state=o});t.prototype=new Ae,t.prototype.constructor=t,t.prototype.__reactAutoBindPairs=[],x(t,e),t.getDefaultProps&&(t.defaultProps=t.getDefaultProps()),t.prototype.render||Y("83");for(var n in _e)t.prototype[n]||(t.prototype[n]=null);return t}},xe=De,Ie=ie.createFactory,Me={a:Ie("a"),abbr:Ie("abbr"),address:Ie("address"),area:Ie("area"),article:Ie("article"),aside:Ie("aside"),audio:Ie("audio"),b:Ie("b"),base:Ie("base"),bdi:Ie("bdi"),bdo:Ie("bdo"),big:Ie("big"),blockquote:Ie("blockquote"),body:Ie("body"),br:Ie("br"),button:Ie("button"),canvas:Ie("canvas"),caption:Ie("caption"),cite:Ie("cite"),code:Ie("code"),col:Ie("col"),colgroup:Ie("colgroup"),data:Ie("data"),datalist:Ie("datalist"),dd:Ie("dd"),del:Ie("del"),details:Ie("details"),dfn:Ie("dfn"),dialog:Ie("dialog"),div:Ie("div"),dl:Ie("dl"),dt:Ie("dt"),em:Ie("em"),embed:Ie("embed"),fieldset:Ie("fieldset"),figcaption:Ie("figcaption"),figure:Ie("figure"),footer:Ie("footer"),form:Ie("form"),h1:Ie("h1"),h2:Ie("h2"),h3:Ie("h3"),h4:Ie("h4"),h5:Ie("h5"),h6:Ie("h6"),head:Ie("head"),header:Ie("header"),hgroup:Ie("hgroup"),hr:Ie("hr"),html:Ie("html"),i:Ie("i"),iframe:Ie("iframe"),img:Ie("img"),input:Ie("input"),ins:Ie("ins"),kbd:Ie("kbd"),keygen:Ie("keygen"),label:Ie("label"),legend:Ie("legend"),li:Ie("li"),link:Ie("link"),main:Ie("main"),map:Ie("map"),mark:Ie("mark"),menu:Ie("menu"),menuitem:Ie("menuitem"),meta:Ie("meta"),meter:Ie("meter"),nav:Ie("nav"),noscript:Ie("noscript"),object:Ie("object"),ol:Ie("ol"),optgroup:Ie("optgroup"),option:Ie("option"),output:Ie("output"),p:Ie("p"),param:Ie("param"),picture:Ie("picture"),pre:Ie("pre"),progress:Ie("progress"),q:Ie("q"),rp:Ie("rp"),rt:Ie("rt"),ruby:Ie("ruby"),s:Ie("s"),samp:Ie("samp"),script:Ie("script"),section:Ie("section"),select:Ie("select"),small:Ie("small"),source:Ie("source"),span:Ie("span"),strong:Ie("strong"),style:Ie("style"),sub:Ie("sub"),summary:Ie("summary"),sup:Ie("sup"),table:Ie("table"),tbody:Ie("tbody"),td:Ie("td"),textarea:Ie("textarea"),tfoot:Ie("tfoot"),th:Ie("th"),thead:Ie("thead"),time:Ie("time"),title:Ie("title"),tr:Ie("tr"),track:Ie("track"),u:Ie("u"),ul:Ie("ul"),var:Ie("var"),video:Ie("video"),wbr:Ie("wbr"),circle:Ie("circle"),clipPath:Ie("clipPath"),defs:Ie("defs"),ellipse:Ie("ellipse"),g:Ie("g"),image:Ie("image"),line:Ie("line"),linearGradient:Ie("linearGradient"),mask:Ie("mask"),path:Ie("path"),pattern:Ie("pattern"),polygon:Ie("polygon"),polyline:Ie("polyline"),radialGradient:Ie("radialGradient"),rect:Ie("rect"),stop:Ie("stop"),svg:Ie("svg"),text:Ie("text"),tspan:Ie("tspan")},ke=Me,we,Oe=function(){Y("144")};Oe.isRequired=Oe;var Fe=function(){return Oe};we={array:Oe,bool:Oe,func:Oe,number:Oe,object:Oe,string:Oe,symbol:Oe,any:Oe,arrayOf:Fe,element:Oe,instanceOf:Fe,node:Oe,objectOf:Fe,oneOf:Fe,oneOfType:Fe,shape:Fe};var Se=we,Ce="16.0.0-alpha.7",Re=S,je=C,Te=ie.createElement,Ye=ie.createFactory,qe=ie.cloneElement,Ue=function(e){return e},Ge={Children:{map:Ee.map,forEach:Ee.forEach,count:Ee.count,toArray:Ee.toArray,only:Re},Component:G.Component,PureComponent:G.PureComponent,createElement:Te,cloneElement:qe,isValidElement:ie.isValidElement,checkPropTypes:je,PropTypes:Se,createClass:xe.createClass,createFactory:Ye,createMixin:Ue,DOM:ke,version:Ce},Ve=Ge,$e=R({__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:{ReactCurrentOwner:Z}},Ve),Be=$e;module.exports=Be;
1
+ "use strict";function e(e){for(var t=arguments.length-1,r="Minified React error #"+e+"; visit http://facebook.github.io/react/docs/error-decoder.html?invariant="+e,n=0;n<t;n++)r+="&args[]="+encodeURIComponent(arguments[n+1]);r+=" for the full message or use the non-minified dev environment for full errors and additional helpful warnings.";var o=new Error(r);throw o.name="Invariant Violation",o.framesToPop=1,o}function t(e,t){}function r(e,t,r){this.props=e,this.context=t,this.refs=A,this.updater=r||T}function n(e,t,r){this.props=e,this.context=t,this.refs=A,this.updater=r||T}function o(){}function i(e){return void 0!==e.ref}function a(e){return void 0!==e.key}function l(e){var t=e&&(Z&&e[Z]||e[ee]);if("function"==typeof t)return t}function u(e){var t={"=":"=0",":":"=2"};return"$"+(""+e).replace(/[=:]/g,function(e){return t[e]})}function c(e){var t={"=0":"=","=2":":"};return(""+("."===e[0]&&"$"===e[1]?e.substring(2):e.substring(1))).replace(/(=0|=2)/g,function(e){return t[e]})}function s(e,t){return e&&"object"==typeof e&&null!=e.key?ne.escape(e.key):t.toString(36)}function p(e,t,r,n){var o=typeof e;if("undefined"!==o&&"boolean"!==o||(e=null),null===e||"string"===o||"number"===o||"object"===o&&e.$$typeof===Y)return r(n,e,""===t?oe+s(e,0):t),1;var i,a,l=0,u=""===t?oe:t+ie;if(Array.isArray(e))for(var c=0;c<e.length;c++)i=e[c],a=u+s(i,c),l+=p(i,a,r,n);else{var f=te(e);if(f)for(var d,h=f.call(e),y=0;!(d=h.next()).done;)i=d.value,a=u+s(i,y++),l+=p(i,a,r,n);else if("object"===o){var m=""+e;R("31","[object Object]"===m?"object with keys {"+Object.keys(e).join(", ")+"}":m,"")}}return l}function f(e,t,r){return null==e?0:p(e,"",t,r)}function d(e){return(""+e).replace(ce,"$&/")}function h(e,t){this.func=e,this.context=t,this.count=0}function y(e,t,r){var n=e.func,o=e.context;n.call(o,t,e.count++)}function m(e,t,r){if(null==e)return e;var n=h.getPooled(t,r);ae(e,y,n),h.release(n)}function b(e,t,r,n){this.result=e,this.keyPrefix=t,this.func=r,this.context=n,this.count=0}function v(e,t,r){var n=e.result,o=e.keyPrefix,i=e.func,a=e.context,l=i.call(a,t,e.count++);Array.isArray(l)?g(l,n,r,j.thatReturnsArgument):null!=l&&(X.isValidElement(l)&&(l=X.cloneAndReplaceKey(l,o+(!l.key||t&&t.key===l.key?"":d(l.key)+"/")+r)),n.push(l))}function g(e,t,r,n,o){var i="";null!=r&&(i=d(r)+"/");var a=b.getPooled(t,i,n,o);ae(e,v,a),b.release(a)}function P(e,t,r){if(null==e)return e;var n=[];return g(e,n,null,t,r),n}function k(e,t,r){return null}function _(e,t){return ae(e,k,null)}function E(e){var t=[];return g(e,t,null,j.thatReturnsArgument),t}function w(e){return X.isValidElement(e)||R("143"),e}var S=require("object-assign");require("fbjs/lib/warning");var A=require("fbjs/lib/emptyObject");require("fbjs/lib/invariant");var j=require("fbjs/lib/emptyFunction"),x=require("prop-types/factory"),q=require("prop-types/checkPropTypes"),C=require("create-react-class/factory"),R=e,O={isMounted:function(e){return!1},enqueueForceUpdate:function(e,r,n){t(e,"forceUpdate")},enqueueReplaceState:function(e,r,n,o){t(e,"replaceState")},enqueueSetState:function(e,r,n,o){t(e,"setState")}},T=O;r.prototype.isReactComponent={},r.prototype.setState=function(e,t){"object"!=typeof e&&"function"!=typeof e&&null!=e&&R("85"),this.updater.enqueueSetState(this,e,t,"setState")},r.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},o.prototype=r.prototype,n.prototype=new o,n.prototype.constructor=n,S(n.prototype,r.prototype),n.prototype.isPureReactComponent=!0;var $={Component:r,PureComponent:n},F=function(e){var t=this;if(t.instancePool.length){var r=t.instancePool.pop();return t.call(r,e),r}return new t(e)},U=function(e,t){var r=this;if(r.instancePool.length){var n=r.instancePool.pop();return r.call(n,e,t),n}return new r(e,t)},V=function(e,t,r){var n=this;if(n.instancePool.length){var o=n.instancePool.pop();return n.call(o,e,t,r),o}return new n(e,t,r)},I=function(e,t,r,n){var o=this;if(o.instancePool.length){var i=o.instancePool.pop();return o.call(i,e,t,r,n),i}return new o(e,t,r,n)},G=function(e){var t=this;e instanceof t||R("25"),e.destructor(),t.instancePool.length<t.poolSize&&t.instancePool.push(e)},M=10,z=F,D=function(e,t){var r=e;return r.instancePool=[],r.getPooled=t||z,r.poolSize||(r.poolSize=M),r.release=G,r},K={addPoolingTo:D,oneArgumentPooler:F,twoArgumentPooler:U,threeArgumentPooler:V,fourArgumentPooler:I},L=K,N={current:null},W=N,B="function"==typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,Y=B,H=Object.prototype.hasOwnProperty,J={key:!0,ref:!0,__self:!0,__source:!0},Q=function(e,t,r,n,o,i,a){return{$$typeof:Y,type:e,key:t,ref:r,props:a,_owner:i}};Q.createElement=function(e,t,r){var n,o={},l=null,u=null,c=null,s=null;if(null!=t){i(t)&&(u=t.ref),a(t)&&(l=""+t.key),c=void 0===t.__self?null:t.__self,s=void 0===t.__source?null:t.__source;for(n in t)H.call(t,n)&&!J.hasOwnProperty(n)&&(o[n]=t[n])}var p=arguments.length-2;if(1===p)o.children=r;else if(p>1){for(var f=Array(p),d=0;d<p;d++)f[d]=arguments[d+2];o.children=f}if(e&&e.defaultProps){var h=e.defaultProps;for(n in h)void 0===o[n]&&(o[n]=h[n])}return Q(e,l,u,c,s,W.current,o)},Q.createFactory=function(e){var t=Q.createElement.bind(null,e);return t.type=e,t},Q.cloneAndReplaceKey=function(e,t){return Q(e.type,t,e.ref,e._self,e._source,e._owner,e.props)},Q.cloneElement=function(e,t,r){var n,o=S({},e.props),l=e.key,u=e.ref,c=e._self,s=e._source,p=e._owner;if(null!=t){i(t)&&(u=t.ref,p=W.current),a(t)&&(l=""+t.key);var f;e.type&&e.type.defaultProps&&(f=e.type.defaultProps);for(n in t)H.call(t,n)&&!J.hasOwnProperty(n)&&(void 0===t[n]&&void 0!==f?o[n]=f[n]:o[n]=t[n])}var d=arguments.length-2;if(1===d)o.children=r;else if(d>1){for(var h=Array(d),y=0;y<d;y++)h[y]=arguments[y+2];o.children=h}return Q(e.type,l,u,c,s,p,o)},Q.isValidElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===Y};var X=Q,Z="function"==typeof Symbol&&Symbol.iterator,ee="@@iterator",te=l,re={escape:u,unescape:c},ne=re,oe=".",ie=":",ae=f,le=L.twoArgumentPooler,ue=L.fourArgumentPooler,ce=/\/+/g;h.prototype.destructor=function(){this.func=null,this.context=null,this.count=0},L.addPoolingTo(h,le),b.prototype.destructor=function(){this.result=null,this.keyPrefix=null,this.func=null,this.context=null,this.count=0},L.addPoolingTo(b,ue);var se={forEach:m,map:P,mapIntoWithKeyPrefixInternal:g,count:_,toArray:E},pe=se,fe=X.createFactory,de={a:fe("a"),abbr:fe("abbr"),address:fe("address"),area:fe("area"),article:fe("article"),aside:fe("aside"),audio:fe("audio"),b:fe("b"),base:fe("base"),bdi:fe("bdi"),bdo:fe("bdo"),big:fe("big"),blockquote:fe("blockquote"),body:fe("body"),br:fe("br"),button:fe("button"),canvas:fe("canvas"),caption:fe("caption"),cite:fe("cite"),code:fe("code"),col:fe("col"),colgroup:fe("colgroup"),data:fe("data"),datalist:fe("datalist"),dd:fe("dd"),del:fe("del"),details:fe("details"),dfn:fe("dfn"),dialog:fe("dialog"),div:fe("div"),dl:fe("dl"),dt:fe("dt"),em:fe("em"),embed:fe("embed"),fieldset:fe("fieldset"),figcaption:fe("figcaption"),figure:fe("figure"),footer:fe("footer"),form:fe("form"),h1:fe("h1"),h2:fe("h2"),h3:fe("h3"),h4:fe("h4"),h5:fe("h5"),h6:fe("h6"),head:fe("head"),header:fe("header"),hgroup:fe("hgroup"),hr:fe("hr"),html:fe("html"),i:fe("i"),iframe:fe("iframe"),img:fe("img"),input:fe("input"),ins:fe("ins"),kbd:fe("kbd"),keygen:fe("keygen"),label:fe("label"),legend:fe("legend"),li:fe("li"),link:fe("link"),main:fe("main"),map:fe("map"),mark:fe("mark"),menu:fe("menu"),menuitem:fe("menuitem"),meta:fe("meta"),meter:fe("meter"),nav:fe("nav"),noscript:fe("noscript"),object:fe("object"),ol:fe("ol"),optgroup:fe("optgroup"),option:fe("option"),output:fe("output"),p:fe("p"),param:fe("param"),picture:fe("picture"),pre:fe("pre"),progress:fe("progress"),q:fe("q"),rp:fe("rp"),rt:fe("rt"),ruby:fe("ruby"),s:fe("s"),samp:fe("samp"),script:fe("script"),section:fe("section"),select:fe("select"),small:fe("small"),source:fe("source"),span:fe("span"),strong:fe("strong"),style:fe("style"),sub:fe("sub"),summary:fe("summary"),sup:fe("sup"),table:fe("table"),tbody:fe("tbody"),td:fe("td"),textarea:fe("textarea"),tfoot:fe("tfoot"),th:fe("th"),thead:fe("thead"),time:fe("time"),title:fe("title"),tr:fe("tr"),track:fe("track"),u:fe("u"),ul:fe("ul"),var:fe("var"),video:fe("video"),wbr:fe("wbr"),circle:fe("circle"),clipPath:fe("clipPath"),defs:fe("defs"),ellipse:fe("ellipse"),g:fe("g"),image:fe("image"),line:fe("line"),linearGradient:fe("linearGradient"),mask:fe("mask"),path:fe("path"),pattern:fe("pattern"),polygon:fe("polygon"),polyline:fe("polyline"),radialGradient:fe("radialGradient"),rect:fe("rect"),stop:fe("stop"),svg:fe("svg"),text:fe("text"),tspan:fe("tspan")},he=de,ye=X.isValidElement,me=x(ye),be="16.0.0-alpha.11",ve=w,ge=$.Component,Pe=X.isValidElement,ke=C(ge,Pe,T),_e=X.createElement,Ee=X.createFactory,we=X.cloneElement,Se=function(e){return e},Ae={Children:{map:pe.map,forEach:pe.forEach,count:pe.count,toArray:pe.toArray,only:ve},Component:$.Component,PureComponent:$.PureComponent,createElement:_e,cloneElement:we,isValidElement:X.isValidElement,PropTypes:me,checkPropTypes:q,createClass:ke,createFactory:Ee,createMixin:Se,DOM:he,version:be,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:{ReactCurrentOwner:W}},je=Ae;module.exports=je;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "react",
3
3
  "description": "React is a JavaScript library for building user interfaces.",
4
- "version": "16.0.0-alpha.7",
4
+ "version": "16.0.0-alpha.11",
5
5
  "keywords": [
6
6
  "react"
7
7
  ],
@@ -22,9 +22,11 @@
22
22
  "node": ">=0.10.0"
23
23
  },
24
24
  "dependencies": {
25
+ "create-react-class": "^15.5.2",
25
26
  "fbjs": "^0.8.9",
26
27
  "loose-envify": "^1.1.0",
27
- "object-assign": "^4.1.0"
28
+ "object-assign": "^4.1.0",
29
+ "prop-types": "^15.5.6"
28
30
  },
29
31
  "browserify": {
30
32
  "transform": [
@@ -1,5 +1,5 @@
1
1
  /**
2
- * react.development.js v16.0.0-alpha.7
2
+ * react.development.js v16.0.0-alpha.11
3
3
  */
4
4
 
5
5
  (function (global, factory) {
@@ -154,7 +154,7 @@ var emptyFunction_1 = emptyFunction;
154
154
  * same logic and follow the same code paths.
155
155
  */
156
156
 
157
- var warning = emptyFunction_1;
157
+ var warning$1 = emptyFunction_1;
158
158
 
159
159
  {
160
160
  (function () {
@@ -178,7 +178,7 @@ var warning = emptyFunction_1;
178
178
  } catch (x) {}
179
179
  };
180
180
 
181
- warning = function warning(condition, format) {
181
+ warning$1 = function warning(condition, format) {
182
182
  if (format === undefined) {
183
183
  throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument');
184
184
  }
@@ -198,7 +198,7 @@ var warning = emptyFunction_1;
198
198
  })();
199
199
  }
200
200
 
201
- var warning_1 = warning;
201
+ var warning_1 = warning$1;
202
202
 
203
203
  function warnNoop(publicInstance, callerName) {
204
204
  {
@@ -289,18 +289,18 @@ var ReactNoopUpdateQueue_1 = ReactNoopUpdateQueue;
289
289
  * @providesModule canDefineProperty
290
290
  */
291
291
 
292
- var canDefineProperty = false;
292
+ var canDefineProperty$1 = false;
293
293
  {
294
294
  try {
295
295
  // $FlowFixMe https://github.com/facebook/flow/issues/285
296
296
  Object.defineProperty({}, 'x', { get: function () {} });
297
- canDefineProperty = true;
297
+ canDefineProperty$1 = true;
298
298
  } catch (x) {
299
299
  // IE will fail on defineProperty
300
300
  }
301
301
  }
302
302
 
303
- var canDefineProperty_1 = canDefineProperty;
303
+ var canDefineProperty_1 = canDefineProperty$1;
304
304
 
305
305
  /**
306
306
  * Copyright (c) 2013-present, Facebook, Inc.
@@ -1053,997 +1053,748 @@ var KeyEscapeUtils = {
1053
1053
 
1054
1054
  var KeyEscapeUtils_1 = KeyEscapeUtils;
1055
1055
 
1056
- var SEPARATOR = '.';
1057
- var SUBSEPARATOR = ':';
1058
-
1059
1056
  /**
1060
- * This is inlined from ReactElement since this file is shared between
1061
- * isomorphic and renderers. We could extract this to a
1057
+ * Copyright 2013-present, Facebook, Inc.
1058
+ * All rights reserved.
1062
1059
  *
1060
+ * This source code is licensed under the BSD-style license found in the
1061
+ * LICENSE file in the root directory of this source tree. An additional grant
1062
+ * of patent rights can be found in the PATENTS file in the same directory.
1063
+ *
1064
+ * @providesModule ReactTypeOfWork
1065
+ *
1063
1066
  */
1064
1067
 
1065
- /**
1066
- * TODO: Test that a single child and an array with one item have the same key
1067
- * pattern.
1068
- */
1069
-
1070
- var didWarnAboutMaps = false;
1068
+ var ReactTypeOfWork = {
1069
+ IndeterminateComponent: 0, // Before we know whether it is functional or class
1070
+ FunctionalComponent: 1,
1071
+ ClassComponent: 2,
1072
+ HostRoot: 3, // Root of a host tree. Could be nested inside another node.
1073
+ HostPortal: 4, // A subtree. Could be an entry point to a different renderer.
1074
+ HostComponent: 5,
1075
+ HostText: 6,
1076
+ CoroutineComponent: 7,
1077
+ CoroutineHandlerPhase: 8,
1078
+ YieldComponent: 9,
1079
+ Fragment: 10
1080
+ };
1071
1081
 
1072
1082
  /**
1073
- * Generate a key string that identifies a component within a set.
1083
+ * Copyright 2013-present, Facebook, Inc.
1084
+ * All rights reserved.
1074
1085
  *
1075
- * @param {*} component A component that could contain a manual key.
1076
- * @param {number} index Index that is used if a manual key is not provided.
1077
- * @return {string}
1078
- */
1079
- function getComponentKey(component, index) {
1080
- // Do some typechecking here since we call this blindly. We want to ensure
1081
- // that we don't block potential future ES APIs.
1082
- if (component && typeof component === 'object' && component.key != null) {
1083
- // Explicit key
1084
- return KeyEscapeUtils_1.escape(component.key);
1085
- }
1086
- // Implicit key determined by the index in the set
1087
- return index.toString(36);
1088
- }
1089
-
1090
- /**
1091
- * @param {?*} children Children tree container.
1092
- * @param {!string} nameSoFar Name of the key path so far.
1093
- * @param {!function} callback Callback to invoke with each child found.
1094
- * @param {?*} traverseContext Used to pass information throughout the traversal
1095
- * process.
1096
- * @return {!number} The number of children in this subtree.
1086
+ * This source code is licensed under the BSD-style license found in the
1087
+ * LICENSE file in the root directory of this source tree. An additional grant
1088
+ * of patent rights can be found in the PATENTS file in the same directory.
1089
+ *
1090
+ * @providesModule getComponentName
1091
+ *
1097
1092
  */
1098
- function traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext) {
1099
- var type = typeof children;
1100
1093
 
1101
- if (type === 'undefined' || type === 'boolean') {
1102
- // All of the above are perceived as null.
1103
- children = null;
1094
+ function getComponentName(instanceOrFiber) {
1095
+ if (typeof instanceOrFiber.getName === 'function') {
1096
+ // Stack reconciler
1097
+ var instance = instanceOrFiber;
1098
+ return instance.getName();
1104
1099
  }
1100
+ if (typeof instanceOrFiber.tag === 'number') {
1101
+ // Fiber reconciler
1102
+ var fiber = instanceOrFiber;
1103
+ var type = fiber.type;
1105
1104
 
1106
- if (children === null || type === 'string' || type === 'number' ||
1107
- // The following is inlined from ReactElement. This means we can optimize
1108
- // some checks. React Fiber also inlines this logic for similar purposes.
1109
- type === 'object' && children.$$typeof === ReactElementSymbol) {
1110
- callback(traverseContext, children,
1111
- // If it's the only child, treat the name as if it was wrapped in an array
1112
- // so that it's consistent if the number of children grows.
1113
- nameSoFar === '' ? SEPARATOR + getComponentKey(children, 0) : nameSoFar);
1114
- return 1;
1105
+ if (typeof type === 'string') {
1106
+ return type;
1107
+ }
1108
+ if (typeof type === 'function') {
1109
+ return type.displayName || type.name;
1110
+ }
1115
1111
  }
1112
+ return null;
1113
+ }
1116
1114
 
1117
- var child;
1118
- var nextName;
1119
- var subtreeCount = 0; // Count of children found in the current subtree.
1120
- var nextNamePrefix = nameSoFar === '' ? SEPARATOR : nameSoFar + SUBSEPARATOR;
1115
+ var getComponentName_1 = getComponentName;
1121
1116
 
1122
- if (Array.isArray(children)) {
1123
- for (var i = 0; i < children.length; i++) {
1124
- child = children[i];
1125
- nextName = nextNamePrefix + getComponentKey(child, i);
1126
- subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
1127
- }
1128
- } else {
1129
- var iteratorFn = getIteratorFn_1(children);
1130
- if (iteratorFn) {
1131
- {
1132
- // Warn about using Maps as children
1133
- if (iteratorFn === children.entries) {
1134
- var mapsAsChildrenAddendum = '';
1135
- if (ReactCurrentOwner_1.current) {
1136
- var mapsAsChildrenOwnerName = ReactCurrentOwner_1.current.getName();
1137
- if (mapsAsChildrenOwnerName) {
1138
- mapsAsChildrenAddendum = '\n\nCheck the render method of `' + mapsAsChildrenOwnerName + '`.';
1139
- }
1140
- }
1141
- warning_1(didWarnAboutMaps, 'Using Maps as children is unsupported and will likely yield ' + 'unexpected results. Convert it to a sequence/iterable of keyed ' + 'ReactElements instead.%s', mapsAsChildrenAddendum);
1142
- didWarnAboutMaps = true;
1143
- }
1144
- }
1117
+ var IndeterminateComponent = ReactTypeOfWork.IndeterminateComponent;
1118
+ var FunctionalComponent = ReactTypeOfWork.FunctionalComponent;
1119
+ var ClassComponent = ReactTypeOfWork.ClassComponent;
1120
+ var HostComponent = ReactTypeOfWork.HostComponent;
1145
1121
 
1146
- var iterator = iteratorFn.call(children);
1147
- var step;
1148
- var ii = 0;
1149
- while (!(step = iterator.next()).done) {
1150
- child = step.value;
1151
- nextName = nextNamePrefix + getComponentKey(child, ii++);
1152
- subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
1153
- }
1154
- } else if (type === 'object') {
1155
- var addendum = '';
1156
- {
1157
- addendum = ' If you meant to render a collection of children, use an array ' + 'instead.';
1158
- if (ReactCurrentOwner_1.current) {
1159
- var name = ReactCurrentOwner_1.current.getName();
1160
- if (name) {
1161
- addendum += '\n\nCheck the render method of `' + name + '`.';
1162
- }
1163
- }
1164
- }
1165
- var childrenString = '' + children;
1166
- invariant_1(false, 'Objects are not valid as a React child (found: %s).%s', childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString, addendum);
1167
- }
1168
- }
1169
1122
 
1170
- return subtreeCount;
1123
+
1124
+ function describeComponentFrame$1(name, source, ownerName) {
1125
+ return '\n in ' + (name || 'Unknown') + (source ? ' (at ' + source.fileName.replace(/^.*[\\\/]/, '') + ':' + source.lineNumber + ')' : ownerName ? ' (created by ' + ownerName + ')' : '');
1171
1126
  }
1172
1127
 
1173
- /**
1174
- * Traverses children that are typically specified as `props.children`, but
1175
- * might also be specified through attributes:
1176
- *
1177
- * - `traverseAllChildren(this.props.children, ...)`
1178
- * - `traverseAllChildren(this.props.leftPanelChildren, ...)`
1179
- *
1180
- * The `traverseContext` is an optional argument that is passed through the
1181
- * entire traversal. It can be used to store accumulations or anything else that
1182
- * the callback might find relevant.
1183
- *
1184
- * @param {?*} children Children tree object.
1185
- * @param {!function} callback To invoke upon traversing each child.
1186
- * @param {?*} traverseContext Context for traversal.
1187
- * @return {!number} The number of children in this subtree.
1188
- */
1189
- function traverseAllChildren(children, callback, traverseContext) {
1190
- if (children == null) {
1191
- return 0;
1128
+ function describeFiber(fiber) {
1129
+ switch (fiber.tag) {
1130
+ case IndeterminateComponent:
1131
+ case FunctionalComponent:
1132
+ case ClassComponent:
1133
+ case HostComponent:
1134
+ var owner = fiber._debugOwner;
1135
+ var source = fiber._debugSource;
1136
+ var name = getComponentName_1(fiber);
1137
+ var ownerName = null;
1138
+ if (owner) {
1139
+ ownerName = getComponentName_1(owner);
1140
+ }
1141
+ return describeComponentFrame$1(name, source, ownerName);
1142
+ default:
1143
+ return '';
1192
1144
  }
1145
+ }
1193
1146
 
1194
- return traverseAllChildrenImpl(children, '', callback, traverseContext);
1147
+ // This function can only be called with a work-in-progress fiber and
1148
+ // only during begin or complete phase. Do not call it under any other
1149
+ // circumstances.
1150
+ function getStackAddendumByWorkInProgressFiber$1(workInProgress) {
1151
+ var info = '';
1152
+ var node = workInProgress;
1153
+ do {
1154
+ info += describeFiber(node);
1155
+ // Otherwise this return pointer might point to the wrong tree:
1156
+ node = node['return'];
1157
+ } while (node);
1158
+ return info;
1195
1159
  }
1196
1160
 
1197
- var traverseAllChildren_1 = traverseAllChildren;
1161
+ var ReactFiberComponentTreeHook = {
1162
+ getStackAddendumByWorkInProgressFiber: getStackAddendumByWorkInProgressFiber$1,
1163
+ describeComponentFrame: describeComponentFrame$1
1164
+ };
1198
1165
 
1199
- var twoArgumentPooler = PooledClass_1.twoArgumentPooler;
1200
- var fourArgumentPooler = PooledClass_1.fourArgumentPooler;
1166
+ var getStackAddendumByWorkInProgressFiber = ReactFiberComponentTreeHook.getStackAddendumByWorkInProgressFiber;
1167
+ var describeComponentFrame = ReactFiberComponentTreeHook.describeComponentFrame;
1201
1168
 
1202
- var userProvidedKeyEscapeRegex = /\/+/g;
1203
- function escapeUserProvidedKey(text) {
1204
- return ('' + text).replace(userProvidedKeyEscapeRegex, '$&/');
1205
- }
1206
1169
 
1207
- /**
1208
- * PooledClass representing the bookkeeping associated with performing a child
1209
- * traversal. Allows avoiding binding callbacks.
1210
- *
1211
- * @constructor ForEachBookKeeping
1212
- * @param {!function} forEachFunction Function to perform traversal with.
1213
- * @param {?*} forEachContext Context to perform context with.
1214
- */
1215
- function ForEachBookKeeping(forEachFunction, forEachContext) {
1216
- this.func = forEachFunction;
1217
- this.context = forEachContext;
1218
- this.count = 0;
1219
- }
1220
- ForEachBookKeeping.prototype.destructor = function () {
1221
- this.func = null;
1222
- this.context = null;
1223
- this.count = 0;
1224
- };
1225
- PooledClass_1.addPoolingTo(ForEachBookKeeping, twoArgumentPooler);
1226
1170
 
1227
- function forEachSingleChild(bookKeeping, child, name) {
1228
- var func = bookKeeping.func,
1229
- context = bookKeeping.context;
1230
1171
 
1231
- func.call(context, child, bookKeeping.count++);
1232
- }
1233
1172
 
1234
- /**
1235
- * Iterates through children that are typically specified as `props.children`.
1236
- *
1237
- * See https://facebook.github.io/react/docs/react-api.html#react.children.foreach
1238
- *
1239
- * The provided forEachFunc(child, index) will be called for each
1240
- * leaf child.
1241
- *
1242
- * @param {?*} children Children tree container.
1243
- * @param {function(*, int)} forEachFunc
1244
- * @param {*} forEachContext Context for forEachContext.
1245
- */
1246
- function forEachChildren(children, forEachFunc, forEachContext) {
1247
- if (children == null) {
1248
- return children;
1173
+ function isNative(fn) {
1174
+ // Based on isNative() from Lodash
1175
+ var funcToString = Function.prototype.toString;
1176
+ var hasOwnProperty = Object.prototype.hasOwnProperty;
1177
+ var reIsNative = RegExp('^' + funcToString
1178
+ // Take an example native function source for comparison
1179
+ .call(hasOwnProperty)
1180
+ // Strip regex characters so we can use it for regex
1181
+ .replace(/[\\^$.*+?()[\]{}|]/g, '\\$&')
1182
+ // Remove hasOwnProperty from the template to make it generic
1183
+ .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$');
1184
+ try {
1185
+ var source = funcToString.call(fn);
1186
+ return reIsNative.test(source);
1187
+ } catch (err) {
1188
+ return false;
1249
1189
  }
1250
- var traverseContext = ForEachBookKeeping.getPooled(forEachFunc, forEachContext);
1251
- traverseAllChildren_1(children, forEachSingleChild, traverseContext);
1252
- ForEachBookKeeping.release(traverseContext);
1253
- }
1254
-
1255
- /**
1256
- * PooledClass representing the bookkeeping associated with performing a child
1257
- * mapping. Allows avoiding binding callbacks.
1258
- *
1259
- * @constructor MapBookKeeping
1260
- * @param {!*} mapResult Object containing the ordered map of results.
1261
- * @param {!function} mapFunction Function to perform mapping with.
1262
- * @param {?*} mapContext Context to perform mapping with.
1263
- */
1264
- function MapBookKeeping(mapResult, keyPrefix, mapFunction, mapContext) {
1265
- this.result = mapResult;
1266
- this.keyPrefix = keyPrefix;
1267
- this.func = mapFunction;
1268
- this.context = mapContext;
1269
- this.count = 0;
1270
1190
  }
1271
- MapBookKeeping.prototype.destructor = function () {
1272
- this.result = null;
1273
- this.keyPrefix = null;
1274
- this.func = null;
1275
- this.context = null;
1276
- this.count = 0;
1277
- };
1278
- PooledClass_1.addPoolingTo(MapBookKeeping, fourArgumentPooler);
1279
1191
 
1280
- function mapSingleChildIntoContext(bookKeeping, child, childKey) {
1281
- var result = bookKeeping.result,
1282
- keyPrefix = bookKeeping.keyPrefix,
1283
- func = bookKeeping.func,
1284
- context = bookKeeping.context;
1192
+ var canUseCollections =
1193
+ // Array.from
1194
+ typeof Array.from === 'function' &&
1195
+ // Map
1196
+ typeof Map === 'function' && isNative(Map) &&
1197
+ // Map.prototype.keys
1198
+ Map.prototype != null && typeof Map.prototype.keys === 'function' && isNative(Map.prototype.keys) &&
1199
+ // Set
1200
+ typeof Set === 'function' && isNative(Set) &&
1201
+ // Set.prototype.keys
1202
+ Set.prototype != null && typeof Set.prototype.keys === 'function' && isNative(Set.prototype.keys);
1285
1203
 
1204
+ var setItem;
1205
+ var getItem;
1206
+ var removeItem;
1207
+ var getItemIDs;
1208
+ var addRoot;
1209
+ var removeRoot;
1210
+ var getRootIDs;
1286
1211
 
1287
- var mappedChild = func.call(context, child, bookKeeping.count++);
1288
- if (Array.isArray(mappedChild)) {
1289
- mapIntoWithKeyPrefixInternal(mappedChild, result, childKey, emptyFunction_1.thatReturnsArgument);
1290
- } else if (mappedChild != null) {
1291
- if (ReactElement_1.isValidElement(mappedChild)) {
1292
- mappedChild = ReactElement_1.cloneAndReplaceKey(mappedChild,
1293
- // Keep both the (mapped) and old keys if they differ, just as
1294
- // traverseAllChildren used to do for objects as children
1295
- keyPrefix + (mappedChild.key && (!child || child.key !== mappedChild.key) ? escapeUserProvidedKey(mappedChild.key) + '/' : '') + childKey);
1296
- }
1297
- result.push(mappedChild);
1298
- }
1299
- }
1212
+ if (canUseCollections) {
1213
+ var itemMap = new Map();
1214
+ var rootIDSet = new Set();
1300
1215
 
1301
- function mapIntoWithKeyPrefixInternal(children, array, prefix, func, context) {
1302
- var escapedPrefix = '';
1303
- if (prefix != null) {
1304
- escapedPrefix = escapeUserProvidedKey(prefix) + '/';
1305
- }
1306
- var traverseContext = MapBookKeeping.getPooled(array, escapedPrefix, func, context);
1307
- traverseAllChildren_1(children, mapSingleChildIntoContext, traverseContext);
1308
- MapBookKeeping.release(traverseContext);
1309
- }
1216
+ setItem = function (id, item) {
1217
+ itemMap.set(id, item);
1218
+ };
1219
+ getItem = function (id) {
1220
+ return itemMap.get(id);
1221
+ };
1222
+ removeItem = function (id) {
1223
+ itemMap['delete'](id);
1224
+ };
1225
+ getItemIDs = function () {
1226
+ return Array.from(itemMap.keys());
1227
+ };
1310
1228
 
1311
- /**
1312
- * Maps children that are typically specified as `props.children`.
1313
- *
1314
- * See https://facebook.github.io/react/docs/react-api.html#react.children.map
1315
- *
1316
- * The provided mapFunction(child, key, index) will be called for each
1317
- * leaf child.
1318
- *
1319
- * @param {?*} children Children tree container.
1320
- * @param {function(*, int)} func The map function.
1321
- * @param {*} context Context for mapFunction.
1322
- * @return {object} Object containing the ordered map of results.
1323
- */
1324
- function mapChildren(children, func, context) {
1325
- if (children == null) {
1326
- return children;
1327
- }
1328
- var result = [];
1329
- mapIntoWithKeyPrefixInternal(children, result, null, func, context);
1330
- return result;
1331
- }
1229
+ addRoot = function (id) {
1230
+ rootIDSet.add(id);
1231
+ };
1232
+ removeRoot = function (id) {
1233
+ rootIDSet['delete'](id);
1234
+ };
1235
+ getRootIDs = function () {
1236
+ return Array.from(rootIDSet.keys());
1237
+ };
1238
+ } else {
1239
+ var itemByKey = {};
1240
+ var rootByKey = {};
1332
1241
 
1333
- function forEachSingleChildDummy(traverseContext, child, name) {
1334
- return null;
1335
- }
1242
+ // Use non-numeric keys to prevent V8 performance issues:
1243
+ // https://github.com/facebook/react/pull/7232
1244
+ var getKeyFromID = function (id) {
1245
+ return '.' + id;
1246
+ };
1247
+ var getIDFromKey = function (key) {
1248
+ return parseInt(key.substr(1), 10);
1249
+ };
1336
1250
 
1337
- /**
1338
- * Count the number of children that are typically specified as
1339
- * `props.children`.
1340
- *
1341
- * See https://facebook.github.io/react/docs/react-api.html#react.children.count
1342
- *
1343
- * @param {?*} children Children tree container.
1344
- * @return {number} The number of children.
1345
- */
1346
- function countChildren(children, context) {
1347
- return traverseAllChildren_1(children, forEachSingleChildDummy, null);
1348
- }
1251
+ setItem = function (id, item) {
1252
+ var key = getKeyFromID(id);
1253
+ itemByKey[key] = item;
1254
+ };
1255
+ getItem = function (id) {
1256
+ var key = getKeyFromID(id);
1257
+ return itemByKey[key];
1258
+ };
1259
+ removeItem = function (id) {
1260
+ var key = getKeyFromID(id);
1261
+ delete itemByKey[key];
1262
+ };
1263
+ getItemIDs = function () {
1264
+ return Object.keys(itemByKey).map(getIDFromKey);
1265
+ };
1349
1266
 
1350
- /**
1351
- * Flatten a children object (typically specified as `props.children`) and
1352
- * return an array with appropriately re-keyed children.
1353
- *
1354
- * See https://facebook.github.io/react/docs/react-api.html#react.children.toarray
1355
- */
1356
- function toArray(children) {
1357
- var result = [];
1358
- mapIntoWithKeyPrefixInternal(children, result, null, emptyFunction_1.thatReturnsArgument);
1359
- return result;
1267
+ addRoot = function (id) {
1268
+ var key = getKeyFromID(id);
1269
+ rootByKey[key] = true;
1270
+ };
1271
+ removeRoot = function (id) {
1272
+ var key = getKeyFromID(id);
1273
+ delete rootByKey[key];
1274
+ };
1275
+ getRootIDs = function () {
1276
+ return Object.keys(rootByKey).map(getIDFromKey);
1277
+ };
1360
1278
  }
1361
1279
 
1362
- var ReactChildren = {
1363
- forEach: forEachChildren,
1364
- map: mapChildren,
1365
- mapIntoWithKeyPrefixInternal: mapIntoWithKeyPrefixInternal,
1366
- count: countChildren,
1367
- toArray: toArray
1368
- };
1369
-
1370
- var ReactChildren_1 = ReactChildren;
1371
-
1372
- var ReactComponent$1 = ReactBaseClasses.Component;
1280
+ var unmountedIDs = [];
1373
1281
 
1374
- var MIXINS_KEY = 'mixins';
1282
+ function purgeDeep(id) {
1283
+ var item = getItem(id);
1284
+ if (item) {
1285
+ var childIDs = item.childIDs;
1375
1286
 
1376
- // Helper function to allow the creation of anonymous functions which do not
1377
- // have .name set to the name of the variable being assigned to.
1378
- function identity(fn) {
1379
- return fn;
1287
+ removeItem(id);
1288
+ childIDs.forEach(purgeDeep);
1289
+ }
1380
1290
  }
1381
1291
 
1382
- /**
1383
- * Policies that describe methods in `ReactClassInterface`.
1384
- */
1385
-
1386
-
1387
- /**
1388
- * Composite components are higher-level components that compose other composite
1389
- * or host components.
1390
- *
1391
- * To create a new type of `ReactClass`, pass a specification of
1392
- * your new class to `React.createClass`. The only requirement of your class
1393
- * specification is that you implement a `render` method.
1394
- *
1395
- * var MyComponent = React.createClass({
1396
- * render: function() {
1397
- * return <div>Hello World</div>;
1398
- * }
1399
- * });
1400
- *
1401
- * The class specification supports a specific protocol of methods that have
1402
- * special meaning (e.g. `render`). See `ReactClassInterface` for
1403
- * more the comprehensive protocol. Any other properties and methods in the
1404
- * class specification will be available on the prototype.
1405
- *
1406
- * @interface ReactClassInterface
1407
- * @internal
1408
- */
1409
- var ReactClassInterface = {
1410
- /**
1411
- * An array of Mixin objects to include when defining your component.
1412
- *
1413
- * @type {array}
1414
- * @optional
1415
- */
1416
- mixins: 'DEFINE_MANY',
1292
+ function getDisplayName(element) {
1293
+ if (element == null) {
1294
+ return '#empty';
1295
+ } else if (typeof element === 'string' || typeof element === 'number') {
1296
+ return '#text';
1297
+ } else if (typeof element.type === 'string') {
1298
+ return element.type;
1299
+ } else {
1300
+ return element.type.displayName || element.type.name || 'Unknown';
1301
+ }
1302
+ }
1417
1303
 
1418
- /**
1419
- * An object containing properties and methods that should be defined on
1420
- * the component's constructor instead of its prototype (static methods).
1421
- *
1422
- * @type {object}
1423
- * @optional
1424
- */
1425
- statics: 'DEFINE_MANY',
1304
+ function describeID(id) {
1305
+ var name = ReactComponentTreeHook.getDisplayName(id);
1306
+ var element = ReactComponentTreeHook.getElement(id);
1307
+ var ownerID = ReactComponentTreeHook.getOwnerID(id);
1308
+ var ownerName = void 0;
1426
1309
 
1427
- /**
1428
- * Definition of prop types for this component.
1429
- *
1430
- * @type {object}
1431
- * @optional
1432
- */
1433
- propTypes: 'DEFINE_MANY',
1310
+ if (ownerID) {
1311
+ ownerName = ReactComponentTreeHook.getDisplayName(ownerID);
1312
+ }
1313
+ warning_1(element, 'ReactComponentTreeHook: Missing React element for debugID %s when ' + 'building stack', id);
1314
+ return describeComponentFrame(name || '', element && element._source, ownerName || '');
1315
+ }
1434
1316
 
1435
- /**
1436
- * Definition of context types for this component.
1437
- *
1438
- * @type {object}
1439
- * @optional
1440
- */
1441
- contextTypes: 'DEFINE_MANY',
1317
+ var ReactComponentTreeHook = {
1318
+ onSetChildren: function (id, nextChildIDs) {
1319
+ var item = getItem(id);
1320
+ invariant_1(item, 'Item must have been set');
1321
+ item.childIDs = nextChildIDs;
1442
1322
 
1443
- /**
1444
- * Definition of context types this component sets for its children.
1445
- *
1446
- * @type {object}
1447
- * @optional
1448
- */
1449
- childContextTypes: 'DEFINE_MANY',
1450
-
1451
- // ==== Definition methods ====
1452
-
1453
- /**
1454
- * Invoked when the component is mounted. Values in the mapping will be set on
1455
- * `this.props` if that prop is not specified (i.e. using an `in` check).
1456
- *
1457
- * This method is invoked before `getInitialState` and therefore cannot rely
1458
- * on `this.state` or use `this.setState`.
1459
- *
1460
- * @return {object}
1461
- * @optional
1462
- */
1463
- getDefaultProps: 'DEFINE_MANY_MERGED',
1464
-
1465
- /**
1466
- * Invoked once before the component is mounted. The return value will be used
1467
- * as the initial value of `this.state`.
1468
- *
1469
- * getInitialState: function() {
1470
- * return {
1471
- * isOn: false,
1472
- * fooBaz: new BazFoo()
1473
- * }
1474
- * }
1475
- *
1476
- * @return {object}
1477
- * @optional
1478
- */
1479
- getInitialState: 'DEFINE_MANY_MERGED',
1480
-
1481
- /**
1482
- * @return {object}
1483
- * @optional
1484
- */
1485
- getChildContext: 'DEFINE_MANY_MERGED',
1486
-
1487
- /**
1488
- * Uses props from `this.props` and state from `this.state` to render the
1489
- * structure of the component.
1490
- *
1491
- * No guarantees are made about when or how often this method is invoked, so
1492
- * it must not have side effects.
1493
- *
1494
- * render: function() {
1495
- * var name = this.props.name;
1496
- * return <div>Hello, {name}!</div>;
1497
- * }
1498
- *
1499
- * @return {ReactComponent}
1500
- * @required
1501
- */
1502
- render: 'DEFINE_ONCE',
1503
-
1504
- // ==== Delegate methods ====
1505
-
1506
- /**
1507
- * Invoked when the component is initially created and about to be mounted.
1508
- * This may have side effects, but any external subscriptions or data created
1509
- * by this method must be cleaned up in `componentWillUnmount`.
1510
- *
1511
- * @optional
1512
- */
1513
- componentWillMount: 'DEFINE_MANY',
1514
-
1515
- /**
1516
- * Invoked when the component has been mounted and has a DOM representation.
1517
- * However, there is no guarantee that the DOM node is in the document.
1518
- *
1519
- * Use this as an opportunity to operate on the DOM when the component has
1520
- * been mounted (initialized and rendered) for the first time.
1521
- *
1522
- * @param {DOMElement} rootNode DOM element representing the component.
1523
- * @optional
1524
- */
1525
- componentDidMount: 'DEFINE_MANY',
1526
-
1527
- /**
1528
- * Invoked before the component receives new props.
1529
- *
1530
- * Use this as an opportunity to react to a prop transition by updating the
1531
- * state using `this.setState`. Current props are accessed via `this.props`.
1532
- *
1533
- * componentWillReceiveProps: function(nextProps, nextContext) {
1534
- * this.setState({
1535
- * likesIncreasing: nextProps.likeCount > this.props.likeCount
1536
- * });
1537
- * }
1538
- *
1539
- * NOTE: There is no equivalent `componentWillReceiveState`. An incoming prop
1540
- * transition may cause a state change, but the opposite is not true. If you
1541
- * need it, you are probably looking for `componentWillUpdate`.
1542
- *
1543
- * @param {object} nextProps
1544
- * @optional
1545
- */
1546
- componentWillReceiveProps: 'DEFINE_MANY',
1547
-
1548
- /**
1549
- * Invoked while deciding if the component should be updated as a result of
1550
- * receiving new props, state and/or context.
1551
- *
1552
- * Use this as an opportunity to `return false` when you're certain that the
1553
- * transition to the new props/state/context will not require a component
1554
- * update.
1555
- *
1556
- * shouldComponentUpdate: function(nextProps, nextState, nextContext) {
1557
- * return !equal(nextProps, this.props) ||
1558
- * !equal(nextState, this.state) ||
1559
- * !equal(nextContext, this.context);
1560
- * }
1561
- *
1562
- * @param {object} nextProps
1563
- * @param {?object} nextState
1564
- * @param {?object} nextContext
1565
- * @return {boolean} True if the component should update.
1566
- * @optional
1567
- */
1568
- shouldComponentUpdate: 'DEFINE_ONCE',
1569
-
1570
- /**
1571
- * Invoked when the component is about to update due to a transition from
1572
- * `this.props`, `this.state` and `this.context` to `nextProps`, `nextState`
1573
- * and `nextContext`.
1574
- *
1575
- * Use this as an opportunity to perform preparation before an update occurs.
1576
- *
1577
- * NOTE: You **cannot** use `this.setState()` in this method.
1578
- *
1579
- * @param {object} nextProps
1580
- * @param {?object} nextState
1581
- * @param {?object} nextContext
1582
- * @param {ReactReconcileTransaction} transaction
1583
- * @optional
1584
- */
1585
- componentWillUpdate: 'DEFINE_MANY',
1586
-
1587
- /**
1588
- * Invoked when the component's DOM representation has been updated.
1589
- *
1590
- * Use this as an opportunity to operate on the DOM when the component has
1591
- * been updated.
1592
- *
1593
- * @param {object} prevProps
1594
- * @param {?object} prevState
1595
- * @param {?object} prevContext
1596
- * @param {DOMElement} rootNode DOM element representing the component.
1597
- * @optional
1598
- */
1599
- componentDidUpdate: 'DEFINE_MANY',
1600
-
1601
- /**
1602
- * Invoked when the component is about to be removed from its parent and have
1603
- * its DOM representation destroyed.
1604
- *
1605
- * Use this as an opportunity to deallocate any external resources.
1606
- *
1607
- * NOTE: There is no `componentDidUnmount` since your component will have been
1608
- * destroyed by that point.
1609
- *
1610
- * @optional
1611
- */
1612
- componentWillUnmount: 'DEFINE_MANY',
1613
-
1614
- // ==== Advanced methods ====
1615
-
1616
- /**
1617
- * Updates the component's currently mounted DOM representation.
1618
- *
1619
- * By default, this implements React's rendering and reconciliation algorithm.
1620
- * Sophisticated clients may wish to override this.
1621
- *
1622
- * @param {ReactReconcileTransaction} transaction
1623
- * @internal
1624
- * @overridable
1625
- */
1626
- updateComponent: 'OVERRIDE_BASE'
1627
- };
1323
+ for (var i = 0; i < nextChildIDs.length; i++) {
1324
+ var nextChildID = nextChildIDs[i];
1325
+ var nextChild = getItem(nextChildID);
1326
+ !nextChild ? invariant_1(false, 'Expected hook events to fire for the child before its parent includes it in onSetChildren().') : void 0;
1327
+ !(nextChild.childIDs != null || typeof nextChild.element !== 'object' || nextChild.element == null) ? invariant_1(false, 'Expected onSetChildren() to fire for a container child before its parent includes it in onSetChildren().') : void 0;
1328
+ !nextChild.isMounted ? invariant_1(false, 'Expected onMountComponent() to fire for the child before its parent includes it in onSetChildren().') : void 0;
1329
+ if (nextChild.parentID == null) {
1330
+ nextChild.parentID = id;
1331
+ // TODO: This shouldn't be necessary but mounting a new root during in
1332
+ // componentWillMount currently causes not-yet-mounted components to
1333
+ // be purged from our tree data so their parent id is missing.
1334
+ }
1335
+ !(nextChild.parentID === id) ? invariant_1(false, 'Expected onBeforeMountComponent() parent and onSetChildren() to be consistent (%s has parents %s and %s).', nextChildID, nextChild.parentID, id) : void 0;
1336
+ }
1337
+ },
1338
+ onBeforeMountComponent: function (id, element, parentID) {
1339
+ var item = {
1340
+ element: element,
1341
+ parentID: parentID,
1342
+ text: null,
1343
+ childIDs: [],
1344
+ isMounted: false,
1345
+ updateCount: 0
1346
+ };
1347
+ setItem(id, item);
1348
+ },
1349
+ onBeforeUpdateComponent: function (id, element) {
1350
+ var item = getItem(id);
1351
+ if (!item || !item.isMounted) {
1352
+ // We may end up here as a result of setState() in componentWillUnmount().
1353
+ // In this case, ignore the element.
1354
+ return;
1355
+ }
1356
+ item.element = element;
1357
+ },
1358
+ onMountComponent: function (id) {
1359
+ var item = getItem(id);
1360
+ invariant_1(item, 'Item must have been set');
1361
+ item.isMounted = true;
1362
+ var isRoot = item.parentID === 0;
1363
+ if (isRoot) {
1364
+ addRoot(id);
1365
+ }
1366
+ },
1367
+ onUpdateComponent: function (id) {
1368
+ var item = getItem(id);
1369
+ if (!item || !item.isMounted) {
1370
+ // We may end up here as a result of setState() in componentWillUnmount().
1371
+ // In this case, ignore the element.
1372
+ return;
1373
+ }
1374
+ item.updateCount++;
1375
+ },
1376
+ onUnmountComponent: function (id) {
1377
+ var item = getItem(id);
1378
+ if (item) {
1379
+ // We need to check if it exists.
1380
+ // `item` might not exist if it is inside an error boundary, and a sibling
1381
+ // error boundary child threw while mounting. Then this instance never
1382
+ // got a chance to mount, but it still gets an unmounting event during
1383
+ // the error boundary cleanup.
1384
+ item.isMounted = false;
1385
+ var isRoot = item.parentID === 0;
1386
+ if (isRoot) {
1387
+ removeRoot(id);
1388
+ }
1389
+ }
1390
+ unmountedIDs.push(id);
1391
+ },
1392
+ purgeUnmountedComponents: function () {
1393
+ if (ReactComponentTreeHook._preventPurging) {
1394
+ // Should only be used for testing.
1395
+ return;
1396
+ }
1628
1397
 
1629
- /**
1630
- * Mapping from class specification keys to special processing functions.
1631
- *
1632
- * Although these are declared like instance properties in the specification
1633
- * when defining classes using `React.createClass`, they are actually static
1634
- * and are accessible on the constructor instead of the prototype. Despite
1635
- * being static, they must be defined outside of the "statics" key under
1636
- * which all other static methods are defined.
1637
- */
1638
- var RESERVED_SPEC_KEYS = {
1639
- displayName: function (Constructor, displayName) {
1640
- Constructor.displayName = displayName;
1398
+ for (var i = 0; i < unmountedIDs.length; i++) {
1399
+ var id = unmountedIDs[i];
1400
+ purgeDeep(id);
1401
+ }
1402
+ unmountedIDs.length = 0;
1641
1403
  },
1642
- mixins: function (Constructor, mixins) {
1643
- if (mixins) {
1644
- for (var i = 0; i < mixins.length; i++) {
1645
- mixSpecIntoComponent(Constructor, mixins[i]);
1404
+ isMounted: function (id) {
1405
+ var item = getItem(id);
1406
+ return item ? item.isMounted : false;
1407
+ },
1408
+ getCurrentStackAddendum: function (topElement) {
1409
+ var info = '';
1410
+ if (topElement) {
1411
+ var name = getDisplayName(topElement);
1412
+ var owner = topElement._owner;
1413
+ info += describeComponentFrame(name, topElement._source, owner && getComponentName_1(owner));
1414
+ }
1415
+
1416
+ var currentOwner = ReactCurrentOwner_1.current;
1417
+ if (currentOwner) {
1418
+ if (typeof currentOwner.tag === 'number') {
1419
+ var workInProgress = currentOwner;
1420
+ // Safe because if current owner exists, we are reconciling,
1421
+ // and it is guaranteed to be the work-in-progress version.
1422
+ info += getStackAddendumByWorkInProgressFiber(workInProgress);
1423
+ } else if (typeof currentOwner._debugID === 'number') {
1424
+ info += ReactComponentTreeHook.getStackAddendumByID(currentOwner._debugID);
1646
1425
  }
1647
1426
  }
1427
+ return info;
1648
1428
  },
1649
- childContextTypes: function (Constructor, childContextTypes) {
1650
- {
1651
- validateTypeDef(Constructor, childContextTypes, 'child context');
1429
+ getStackAddendumByID: function (id) {
1430
+ var info = '';
1431
+ while (id) {
1432
+ info += describeID(id);
1433
+ id = ReactComponentTreeHook.getParentID(id);
1652
1434
  }
1653
- Constructor.childContextTypes = index({}, Constructor.childContextTypes, childContextTypes);
1435
+ return info;
1654
1436
  },
1655
- contextTypes: function (Constructor, contextTypes) {
1656
- {
1657
- validateTypeDef(Constructor, contextTypes, 'context');
1437
+ getChildIDs: function (id) {
1438
+ var item = getItem(id);
1439
+ return item ? item.childIDs : [];
1440
+ },
1441
+ getDisplayName: function (id) {
1442
+ var element = ReactComponentTreeHook.getElement(id);
1443
+ if (!element) {
1444
+ return null;
1658
1445
  }
1659
- Constructor.contextTypes = index({}, Constructor.contextTypes, contextTypes);
1446
+ return getDisplayName(element);
1660
1447
  },
1661
- /**
1662
- * Special case getDefaultProps which should move into statics but requires
1663
- * automatic merging.
1664
- */
1665
- getDefaultProps: function (Constructor, getDefaultProps) {
1666
- if (Constructor.getDefaultProps) {
1667
- Constructor.getDefaultProps = createMergedResultFunction(Constructor.getDefaultProps, getDefaultProps);
1668
- } else {
1669
- Constructor.getDefaultProps = getDefaultProps;
1448
+ getElement: function (id) {
1449
+ var item = getItem(id);
1450
+ return item ? item.element : null;
1451
+ },
1452
+ getOwnerID: function (id) {
1453
+ var element = ReactComponentTreeHook.getElement(id);
1454
+ if (!element || !element._owner) {
1455
+ return null;
1670
1456
  }
1457
+ return element._owner._debugID;
1671
1458
  },
1672
- propTypes: function (Constructor, propTypes) {
1673
- {
1674
- validateTypeDef(Constructor, propTypes, 'prop');
1459
+ getParentID: function (id) {
1460
+ var item = getItem(id);
1461
+ return item ? item.parentID : null;
1462
+ },
1463
+ getSource: function (id) {
1464
+ var item = getItem(id);
1465
+ var element = item ? item.element : null;
1466
+ var source = element != null ? element._source : null;
1467
+ return source;
1468
+ },
1469
+ getText: function (id) {
1470
+ var element = ReactComponentTreeHook.getElement(id);
1471
+ if (typeof element === 'string') {
1472
+ return element;
1473
+ } else if (typeof element === 'number') {
1474
+ return '' + element;
1475
+ } else {
1476
+ return null;
1675
1477
  }
1676
- Constructor.propTypes = index({}, Constructor.propTypes, propTypes);
1677
1478
  },
1678
- statics: function (Constructor, statics) {
1679
- mixStaticSpecIntoComponent(Constructor, statics);
1479
+ getUpdateCount: function (id) {
1480
+ var item = getItem(id);
1481
+ return item ? item.updateCount : 0;
1680
1482
  },
1681
- autobind: function () {} };
1682
1483
 
1683
- function validateTypeDef(Constructor, typeDef, location) {
1684
- for (var propName in typeDef) {
1685
- if (typeDef.hasOwnProperty(propName)) {
1686
- // use a warning instead of an invariant so components
1687
- // don't show up in prod but only in true
1688
- warning_1(typeof typeDef[propName] === 'function', '%s: %s type `%s` is invalid; it must be a function, usually from ' + 'React.PropTypes.', Constructor.displayName || 'ReactClass', location, propName);
1689
- }
1690
- }
1691
- }
1692
1484
 
1693
- function validateMethodOverride(isAlreadyDefined, name) {
1694
- var specPolicy = ReactClassInterface.hasOwnProperty(name) ? ReactClassInterface[name] : null;
1485
+ getRootIDs: getRootIDs,
1486
+ getRegisteredIDs: getItemIDs
1487
+ };
1695
1488
 
1696
- // Disallow overriding of base class methods unless explicitly allowed.
1697
- if (ReactClassMixin.hasOwnProperty(name)) {
1698
- !(specPolicy === 'OVERRIDE_BASE') ? invariant_1(false, 'ReactClassInterface: You are attempting to override `%s` from your class specification. Ensure that your method names do not overlap with React methods.', name) : void 0;
1699
- }
1489
+ var ReactComponentTreeHook_1 = ReactComponentTreeHook;
1700
1490
 
1701
- // Disallow defining methods more than once unless explicitly allowed.
1702
- if (isAlreadyDefined) {
1703
- !(specPolicy === 'DEFINE_MANY' || specPolicy === 'DEFINE_MANY_MERGED') ? invariant_1(false, 'ReactClassInterface: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.', name) : void 0;
1704
- }
1491
+ {
1492
+ var _require = ReactComponentTreeHook_1,
1493
+ getCurrentStackAddendum = _require.getCurrentStackAddendum;
1705
1494
  }
1706
1495
 
1496
+ var SEPARATOR = '.';
1497
+ var SUBSEPARATOR = ':';
1498
+
1707
1499
  /**
1708
- * Mixin helper which handles policy validation and reserved
1709
- * specification keys when building React classes.
1500
+ * This is inlined from ReactElement since this file is shared between
1501
+ * isomorphic and renderers. We could extract this to a
1502
+ *
1710
1503
  */
1711
- function mixSpecIntoComponent(Constructor, spec) {
1712
- if (!spec) {
1713
- {
1714
- var typeofSpec = typeof spec;
1715
- var isMixinValid = typeofSpec === 'object' && spec !== null;
1716
-
1717
- warning_1(isMixinValid, "%s: You're attempting to include a mixin that is either null " + 'or not an object. Check the mixins included by the component, ' + 'as well as any mixins they include themselves. ' + 'Expected object but got %s.', Constructor.displayName || 'ReactClass', spec === null ? null : typeofSpec);
1718
- }
1719
-
1720
- return;
1721
- }
1722
-
1723
- !(typeof spec !== 'function') ? invariant_1(false, 'ReactClass: You\'re attempting to use a component class or function as a mixin. Instead, just use a regular object.') : void 0;
1724
- !!ReactElement_1.isValidElement(spec) ? invariant_1(false, 'ReactClass: You\'re attempting to use a component as a mixin. Instead, just use a regular object.') : void 0;
1725
1504
 
1726
- var proto = Constructor.prototype;
1727
- var autoBindPairs = proto.__reactAutoBindPairs;
1505
+ /**
1506
+ * TODO: Test that a single child and an array with one item have the same key
1507
+ * pattern.
1508
+ */
1728
1509
 
1729
- // By handling mixins before any other properties, we ensure the same
1730
- // chaining order is applied to methods with DEFINE_MANY policy, whether
1731
- // mixins are listed before or after these methods in the spec.
1732
- if (spec.hasOwnProperty(MIXINS_KEY)) {
1733
- RESERVED_SPEC_KEYS.mixins(Constructor, spec.mixins);
1734
- }
1510
+ var didWarnAboutMaps = false;
1735
1511
 
1736
- for (var name in spec) {
1737
- if (!spec.hasOwnProperty(name)) {
1738
- continue;
1739
- }
1512
+ /**
1513
+ * Generate a key string that identifies a component within a set.
1514
+ *
1515
+ * @param {*} component A component that could contain a manual key.
1516
+ * @param {number} index Index that is used if a manual key is not provided.
1517
+ * @return {string}
1518
+ */
1519
+ function getComponentKey(component, index) {
1520
+ // Do some typechecking here since we call this blindly. We want to ensure
1521
+ // that we don't block potential future ES APIs.
1522
+ if (component && typeof component === 'object' && component.key != null) {
1523
+ // Explicit key
1524
+ return KeyEscapeUtils_1.escape(component.key);
1525
+ }
1526
+ // Implicit key determined by the index in the set
1527
+ return index.toString(36);
1528
+ }
1740
1529
 
1741
- if (name === MIXINS_KEY) {
1742
- // We have already handled mixins in a special case above.
1743
- continue;
1744
- }
1530
+ /**
1531
+ * @param {?*} children Children tree container.
1532
+ * @param {!string} nameSoFar Name of the key path so far.
1533
+ * @param {!function} callback Callback to invoke with each child found.
1534
+ * @param {?*} traverseContext Used to pass information throughout the traversal
1535
+ * process.
1536
+ * @return {!number} The number of children in this subtree.
1537
+ */
1538
+ function traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext) {
1539
+ var type = typeof children;
1540
+
1541
+ if (type === 'undefined' || type === 'boolean') {
1542
+ // All of the above are perceived as null.
1543
+ children = null;
1544
+ }
1745
1545
 
1746
- var property = spec[name];
1747
- var isAlreadyDefined = proto.hasOwnProperty(name);
1748
- validateMethodOverride(isAlreadyDefined, name);
1546
+ if (children === null || type === 'string' || type === 'number' ||
1547
+ // The following is inlined from ReactElement. This means we can optimize
1548
+ // some checks. React Fiber also inlines this logic for similar purposes.
1549
+ type === 'object' && children.$$typeof === ReactElementSymbol) {
1550
+ callback(traverseContext, children,
1551
+ // If it's the only child, treat the name as if it was wrapped in an array
1552
+ // so that it's consistent if the number of children grows.
1553
+ nameSoFar === '' ? SEPARATOR + getComponentKey(children, 0) : nameSoFar);
1554
+ return 1;
1555
+ }
1749
1556
 
1750
- if (RESERVED_SPEC_KEYS.hasOwnProperty(name)) {
1751
- RESERVED_SPEC_KEYS[name](Constructor, property);
1752
- } else {
1753
- // Setup methods on prototype:
1754
- // The following member methods should not be automatically bound:
1755
- // 1. Expected ReactClass methods (in the "interface").
1756
- // 2. Overridden methods (that were mixed in).
1757
- var isReactClassMethod = ReactClassInterface.hasOwnProperty(name);
1758
- var isFunction = typeof property === 'function';
1759
- var shouldAutoBind = isFunction && !isReactClassMethod && !isAlreadyDefined && spec.autobind !== false;
1760
-
1761
- if (shouldAutoBind) {
1762
- autoBindPairs.push(name, property);
1763
- proto[name] = property;
1764
- } else {
1765
- if (isAlreadyDefined) {
1766
- var specPolicy = ReactClassInterface[name];
1767
-
1768
- // These cases should already be caught by validateMethodOverride.
1769
- !(isReactClassMethod && (specPolicy === 'DEFINE_MANY_MERGED' || specPolicy === 'DEFINE_MANY')) ? invariant_1(false, 'ReactClass: Unexpected spec policy %s for key %s when mixing in component specs.', specPolicy, name) : void 0;
1770
-
1771
- // For methods which are defined more than once, call the existing
1772
- // methods before calling the new property, merging if appropriate.
1773
- if (specPolicy === 'DEFINE_MANY_MERGED') {
1774
- proto[name] = createMergedResultFunction(proto[name], property);
1775
- } else if (specPolicy === 'DEFINE_MANY') {
1776
- proto[name] = createChainedFunction(proto[name], property);
1777
- }
1778
- } else {
1779
- proto[name] = property;
1780
- {
1781
- // Add verbose displayName to the function, which helps when looking
1782
- // at profiling tools.
1783
- if (typeof property === 'function' && spec.displayName) {
1784
- proto[name].displayName = spec.displayName + '_' + name;
1785
- }
1786
- }
1557
+ var child;
1558
+ var nextName;
1559
+ var subtreeCount = 0; // Count of children found in the current subtree.
1560
+ var nextNamePrefix = nameSoFar === '' ? SEPARATOR : nameSoFar + SUBSEPARATOR;
1561
+
1562
+ if (Array.isArray(children)) {
1563
+ for (var i = 0; i < children.length; i++) {
1564
+ child = children[i];
1565
+ nextName = nextNamePrefix + getComponentKey(child, i);
1566
+ subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
1567
+ }
1568
+ } else {
1569
+ var iteratorFn = getIteratorFn_1(children);
1570
+ if (iteratorFn) {
1571
+ {
1572
+ // Warn about using Maps as children
1573
+ if (iteratorFn === children.entries) {
1574
+ warning_1(didWarnAboutMaps, 'Using Maps as children is unsupported and will likely yield ' + 'unexpected results. Convert it to a sequence/iterable of keyed ' + 'ReactElements instead.%s', getCurrentStackAddendum());
1575
+ didWarnAboutMaps = true;
1787
1576
  }
1788
1577
  }
1578
+
1579
+ var iterator = iteratorFn.call(children);
1580
+ var step;
1581
+ var ii = 0;
1582
+ while (!(step = iterator.next()).done) {
1583
+ child = step.value;
1584
+ nextName = nextNamePrefix + getComponentKey(child, ii++);
1585
+ subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
1586
+ }
1587
+ } else if (type === 'object') {
1588
+ var addendum = '';
1589
+ {
1590
+ addendum = ' If you meant to render a collection of children, use an array ' + 'instead.' + getCurrentStackAddendum();
1591
+ }
1592
+ var childrenString = '' + children;
1593
+ invariant_1(false, 'Objects are not valid as a React child (found: %s).%s', childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString, addendum);
1789
1594
  }
1790
1595
  }
1596
+
1597
+ return subtreeCount;
1791
1598
  }
1792
1599
 
1793
- function mixStaticSpecIntoComponent(Constructor, statics) {
1794
- if (!statics) {
1795
- return;
1600
+ /**
1601
+ * Traverses children that are typically specified as `props.children`, but
1602
+ * might also be specified through attributes:
1603
+ *
1604
+ * - `traverseAllChildren(this.props.children, ...)`
1605
+ * - `traverseAllChildren(this.props.leftPanelChildren, ...)`
1606
+ *
1607
+ * The `traverseContext` is an optional argument that is passed through the
1608
+ * entire traversal. It can be used to store accumulations or anything else that
1609
+ * the callback might find relevant.
1610
+ *
1611
+ * @param {?*} children Children tree object.
1612
+ * @param {!function} callback To invoke upon traversing each child.
1613
+ * @param {?*} traverseContext Context for traversal.
1614
+ * @return {!number} The number of children in this subtree.
1615
+ */
1616
+ function traverseAllChildren(children, callback, traverseContext) {
1617
+ if (children == null) {
1618
+ return 0;
1796
1619
  }
1797
- for (var name in statics) {
1798
- var property = statics[name];
1799
- if (!statics.hasOwnProperty(name)) {
1800
- continue;
1801
- }
1802
1620
 
1803
- var isReserved = name in RESERVED_SPEC_KEYS;
1804
- !!isReserved ? invariant_1(false, 'ReactClass: You are attempting to define a reserved property, `%s`, that shouldn\'t be on the "statics" key. Define it as an instance property instead; it will still be accessible on the constructor.', name) : void 0;
1621
+ return traverseAllChildrenImpl(children, '', callback, traverseContext);
1622
+ }
1623
+
1624
+ var traverseAllChildren_1 = traverseAllChildren;
1805
1625
 
1806
- var isInherited = name in Constructor;
1807
- !!isInherited ? invariant_1(false, 'ReactClass: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.', name) : void 0;
1808
- Constructor[name] = property;
1809
- }
1626
+ var twoArgumentPooler = PooledClass_1.twoArgumentPooler;
1627
+ var fourArgumentPooler = PooledClass_1.fourArgumentPooler;
1628
+
1629
+ var userProvidedKeyEscapeRegex = /\/+/g;
1630
+ function escapeUserProvidedKey(text) {
1631
+ return ('' + text).replace(userProvidedKeyEscapeRegex, '$&/');
1810
1632
  }
1811
1633
 
1812
1634
  /**
1813
- * Merge two objects, but throw if both contain the same key.
1635
+ * PooledClass representing the bookkeeping associated with performing a child
1636
+ * traversal. Allows avoiding binding callbacks.
1814
1637
  *
1815
- * @param {object} one The first object, which is mutated.
1816
- * @param {object} two The second object
1817
- * @return {object} one after it has been mutated to contain everything in two.
1638
+ * @constructor ForEachBookKeeping
1639
+ * @param {!function} forEachFunction Function to perform traversal with.
1640
+ * @param {?*} forEachContext Context to perform context with.
1818
1641
  */
1819
- function mergeIntoWithNoDuplicateKeys(one, two) {
1820
- !(one && two && typeof one === 'object' && typeof two === 'object') ? invariant_1(false, 'mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects.') : void 0;
1642
+ function ForEachBookKeeping(forEachFunction, forEachContext) {
1643
+ this.func = forEachFunction;
1644
+ this.context = forEachContext;
1645
+ this.count = 0;
1646
+ }
1647
+ ForEachBookKeeping.prototype.destructor = function () {
1648
+ this.func = null;
1649
+ this.context = null;
1650
+ this.count = 0;
1651
+ };
1652
+ PooledClass_1.addPoolingTo(ForEachBookKeeping, twoArgumentPooler);
1821
1653
 
1822
- for (var key in two) {
1823
- if (two.hasOwnProperty(key)) {
1824
- !(one[key] === undefined) ? invariant_1(false, 'mergeIntoWithNoDuplicateKeys(): Tried to merge two objects with the same key: `%s`. This conflict may be due to a mixin; in particular, this may be caused by two getInitialState() or getDefaultProps() methods returning objects with clashing keys.', key) : void 0;
1825
- one[key] = two[key];
1826
- }
1827
- }
1828
- return one;
1654
+ function forEachSingleChild(bookKeeping, child, name) {
1655
+ var func = bookKeeping.func,
1656
+ context = bookKeeping.context;
1657
+
1658
+ func.call(context, child, bookKeeping.count++);
1829
1659
  }
1830
1660
 
1831
1661
  /**
1832
- * Creates a function that invokes two functions and merges their return values.
1662
+ * Iterates through children that are typically specified as `props.children`.
1833
1663
  *
1834
- * @param {function} one Function to invoke first.
1835
- * @param {function} two Function to invoke second.
1836
- * @return {function} Function that invokes the two argument functions.
1837
- * @private
1664
+ * See https://facebook.github.io/react/docs/react-api.html#react.children.foreach
1665
+ *
1666
+ * The provided forEachFunc(child, index) will be called for each
1667
+ * leaf child.
1668
+ *
1669
+ * @param {?*} children Children tree container.
1670
+ * @param {function(*, int)} forEachFunc
1671
+ * @param {*} forEachContext Context for forEachContext.
1838
1672
  */
1839
- function createMergedResultFunction(one, two) {
1840
- return function mergedResult() {
1841
- var a = one.apply(this, arguments);
1842
- var b = two.apply(this, arguments);
1843
- if (a == null) {
1844
- return b;
1845
- } else if (b == null) {
1846
- return a;
1847
- }
1848
- var c = {};
1849
- mergeIntoWithNoDuplicateKeys(c, a);
1850
- mergeIntoWithNoDuplicateKeys(c, b);
1851
- return c;
1852
- };
1673
+ function forEachChildren(children, forEachFunc, forEachContext) {
1674
+ if (children == null) {
1675
+ return children;
1676
+ }
1677
+ var traverseContext = ForEachBookKeeping.getPooled(forEachFunc, forEachContext);
1678
+ traverseAllChildren_1(children, forEachSingleChild, traverseContext);
1679
+ ForEachBookKeeping.release(traverseContext);
1853
1680
  }
1854
1681
 
1855
1682
  /**
1856
- * Creates a function that invokes two functions and ignores their return vales.
1683
+ * PooledClass representing the bookkeeping associated with performing a child
1684
+ * mapping. Allows avoiding binding callbacks.
1857
1685
  *
1858
- * @param {function} one Function to invoke first.
1859
- * @param {function} two Function to invoke second.
1860
- * @return {function} Function that invokes the two argument functions.
1861
- * @private
1686
+ * @constructor MapBookKeeping
1687
+ * @param {!*} mapResult Object containing the ordered map of results.
1688
+ * @param {!function} mapFunction Function to perform mapping with.
1689
+ * @param {?*} mapContext Context to perform mapping with.
1862
1690
  */
1863
- function createChainedFunction(one, two) {
1864
- return function chainedFunction() {
1865
- one.apply(this, arguments);
1866
- two.apply(this, arguments);
1867
- };
1691
+ function MapBookKeeping(mapResult, keyPrefix, mapFunction, mapContext) {
1692
+ this.result = mapResult;
1693
+ this.keyPrefix = keyPrefix;
1694
+ this.func = mapFunction;
1695
+ this.context = mapContext;
1696
+ this.count = 0;
1868
1697
  }
1698
+ MapBookKeeping.prototype.destructor = function () {
1699
+ this.result = null;
1700
+ this.keyPrefix = null;
1701
+ this.func = null;
1702
+ this.context = null;
1703
+ this.count = 0;
1704
+ };
1705
+ PooledClass_1.addPoolingTo(MapBookKeeping, fourArgumentPooler);
1869
1706
 
1870
- /**
1871
- * Binds a method to the component.
1872
- *
1873
- * @param {object} component Component whose method is going to be bound.
1874
- * @param {function} method Method to be bound.
1875
- * @return {function} The bound method.
1876
- */
1877
- function bindAutoBindMethod(component, method) {
1878
- var boundMethod = method.bind(component);
1879
- {
1880
- boundMethod.__reactBoundContext = component;
1881
- boundMethod.__reactBoundMethod = method;
1882
- boundMethod.__reactBoundArguments = null;
1883
- var componentName = component.constructor.displayName;
1884
- var _bind = boundMethod.bind;
1885
- boundMethod.bind = function (newThis) {
1886
- for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
1887
- args[_key - 1] = arguments[_key];
1888
- }
1707
+ function mapSingleChildIntoContext(bookKeeping, child, childKey) {
1708
+ var result = bookKeeping.result,
1709
+ keyPrefix = bookKeeping.keyPrefix,
1710
+ func = bookKeeping.func,
1711
+ context = bookKeeping.context;
1889
1712
 
1890
- // User is trying to bind() an autobound method; we effectively will
1891
- // ignore the value of "this" that the user is trying to use, so
1892
- // let's warn.
1893
- if (newThis !== component && newThis !== null) {
1894
- warning_1(false, 'bind(): React component methods may only be bound to the ' + 'component instance.\n\nSee %s', componentName);
1895
- } else if (!args.length) {
1896
- warning_1(false, 'bind(): You are binding a component method to the component. ' + 'React does this for you automatically in a high-performance ' + 'way, so you can safely remove this call.\n\nSee %s', componentName);
1897
- return boundMethod;
1898
- }
1899
- var reboundMethod = _bind.apply(boundMethod, arguments);
1900
- reboundMethod.__reactBoundContext = component;
1901
- reboundMethod.__reactBoundMethod = method;
1902
- reboundMethod.__reactBoundArguments = args;
1903
- return reboundMethod;
1904
- };
1713
+
1714
+ var mappedChild = func.call(context, child, bookKeeping.count++);
1715
+ if (Array.isArray(mappedChild)) {
1716
+ mapIntoWithKeyPrefixInternal(mappedChild, result, childKey, emptyFunction_1.thatReturnsArgument);
1717
+ } else if (mappedChild != null) {
1718
+ if (ReactElement_1.isValidElement(mappedChild)) {
1719
+ mappedChild = ReactElement_1.cloneAndReplaceKey(mappedChild,
1720
+ // Keep both the (mapped) and old keys if they differ, just as
1721
+ // traverseAllChildren used to do for objects as children
1722
+ keyPrefix + (mappedChild.key && (!child || child.key !== mappedChild.key) ? escapeUserProvidedKey(mappedChild.key) + '/' : '') + childKey);
1723
+ }
1724
+ result.push(mappedChild);
1905
1725
  }
1906
- return boundMethod;
1907
1726
  }
1908
1727
 
1909
- /**
1910
- * Binds all auto-bound methods in a component.
1911
- *
1912
- * @param {object} component Component whose method is going to be bound.
1913
- */
1914
- function bindAutoBindMethods(component) {
1915
- var pairs = component.__reactAutoBindPairs;
1916
- for (var i = 0; i < pairs.length; i += 2) {
1917
- var autoBindKey = pairs[i];
1918
- var method = pairs[i + 1];
1919
- component[autoBindKey] = bindAutoBindMethod(component, method);
1728
+ function mapIntoWithKeyPrefixInternal(children, array, prefix, func, context) {
1729
+ var escapedPrefix = '';
1730
+ if (prefix != null) {
1731
+ escapedPrefix = escapeUserProvidedKey(prefix) + '/';
1920
1732
  }
1733
+ var traverseContext = MapBookKeeping.getPooled(array, escapedPrefix, func, context);
1734
+ traverseAllChildren_1(children, mapSingleChildIntoContext, traverseContext);
1735
+ MapBookKeeping.release(traverseContext);
1921
1736
  }
1922
1737
 
1923
1738
  /**
1924
- * Add more to the ReactClass base class. These are all legacy features and
1925
- * therefore not already part of the modern ReactComponent.
1739
+ * Maps children that are typically specified as `props.children`.
1740
+ *
1741
+ * See https://facebook.github.io/react/docs/react-api.html#react.children.map
1742
+ *
1743
+ * The provided mapFunction(child, key, index) will be called for each
1744
+ * leaf child.
1745
+ *
1746
+ * @param {?*} children Children tree container.
1747
+ * @param {function(*, int)} func The map function.
1748
+ * @param {*} context Context for mapFunction.
1749
+ * @return {object} Object containing the ordered map of results.
1926
1750
  */
1927
- var ReactClassMixin = {
1928
- /**
1929
- * TODO: This will be deprecated because state should always keep a consistent
1930
- * type signature and the only use case for this, is to avoid that.
1931
- */
1932
- replaceState: function (newState, callback) {
1933
- this.updater.enqueueReplaceState(this, newState, callback, 'replaceState');
1934
- },
1935
-
1936
- /**
1937
- * Checks whether or not this composite component is mounted.
1938
- * @return {boolean} True if mounted, false otherwise.
1939
- * @protected
1940
- * @final
1941
- */
1942
- isMounted: function () {
1943
- return this.updater.isMounted(this);
1751
+ function mapChildren(children, func, context) {
1752
+ if (children == null) {
1753
+ return children;
1944
1754
  }
1945
- };
1755
+ var result = [];
1756
+ mapIntoWithKeyPrefixInternal(children, result, null, func, context);
1757
+ return result;
1758
+ }
1946
1759
 
1947
- var ReactClassComponent = function () {};
1948
- index(ReactClassComponent.prototype, ReactComponent$1.prototype, ReactClassMixin);
1760
+ function forEachSingleChildDummy(traverseContext, child, name) {
1761
+ return null;
1762
+ }
1949
1763
 
1950
1764
  /**
1951
- * Module for creating composite components.
1765
+ * Count the number of children that are typically specified as
1766
+ * `props.children`.
1767
+ *
1768
+ * See https://facebook.github.io/react/docs/react-api.html#react.children.count
1952
1769
  *
1953
- * @class ReactClass
1770
+ * @param {?*} children Children tree container.
1771
+ * @return {number} The number of children.
1954
1772
  */
1955
- var ReactClass = {
1956
- /**
1957
- * Creates a composite component class given a class specification.
1958
- * See https://facebook.github.io/react/docs/react-api.html#createclass
1959
- *
1960
- * @param {object} spec Class specification (which must define `render`).
1961
- * @return {function} Component constructor function.
1962
- * @public
1963
- */
1964
- createClass: function (spec) {
1965
- // To keep our warnings more understandable, we'll use a little hack here to
1966
- // ensure that Constructor.name !== 'Constructor'. This makes sure we don't
1967
- // unnecessarily identify a class without displayName as 'Constructor'.
1968
- var Constructor = identity(function (props, context, updater) {
1969
- // This constructor gets overridden by mocks. The argument is used
1970
- // by mocks to assert on what gets mounted.
1971
-
1972
- {
1973
- warning_1(this instanceof Constructor, 'Something is calling a React component directly. Use a factory or ' + 'JSX instead. See: https://fb.me/react-legacyfactory');
1974
- }
1975
-
1976
- // Wire up auto-binding
1977
- if (this.__reactAutoBindPairs.length) {
1978
- bindAutoBindMethods(this);
1979
- }
1980
-
1981
- this.props = props;
1982
- this.context = context;
1983
- this.refs = emptyObject_1;
1984
- this.updater = updater || ReactNoopUpdateQueue_1;
1985
-
1986
- this.state = null;
1987
-
1988
- // ReactClasses doesn't have constructors. Instead, they use the
1989
- // getInitialState and componentWillMount methods for initialization.
1990
-
1991
- var initialState = this.getInitialState ? this.getInitialState() : null;
1992
- {
1993
- // We allow auto-mocks to proceed as if they're returning null.
1994
- if (initialState === undefined && this.getInitialState._isMockFunction) {
1995
- // This is probably bad practice. Consider warning here and
1996
- // deprecating this convenience.
1997
- initialState = null;
1998
- }
1999
- }
2000
- !(typeof initialState === 'object' && !Array.isArray(initialState)) ? invariant_1(false, '%s.getInitialState(): must return an object or null', Constructor.displayName || 'ReactCompositeComponent') : void 0;
2001
-
2002
- this.state = initialState;
2003
- });
2004
- Constructor.prototype = new ReactClassComponent();
2005
- Constructor.prototype.constructor = Constructor;
2006
- Constructor.prototype.__reactAutoBindPairs = [];
2007
-
2008
- mixSpecIntoComponent(Constructor, spec);
2009
-
2010
- // Initialize the defaultProps property after all mixins have been merged.
2011
- if (Constructor.getDefaultProps) {
2012
- Constructor.defaultProps = Constructor.getDefaultProps();
2013
- }
2014
-
2015
- {
2016
- // This is a tag to indicate that the use of these method names is ok,
2017
- // since it's used with createClass. If it's not, then it's likely a
2018
- // mistake so we'll warn you to use the static property, property
2019
- // initializer or constructor respectively.
2020
- if (Constructor.getDefaultProps) {
2021
- Constructor.getDefaultProps.isReactClassApproved = {};
2022
- }
2023
- if (Constructor.prototype.getInitialState) {
2024
- Constructor.prototype.getInitialState.isReactClassApproved = {};
2025
- }
2026
- }
2027
-
2028
- !Constructor.prototype.render ? invariant_1(false, 'createClass(...): Class specification must implement a `render` method.') : void 0;
2029
-
2030
- {
2031
- warning_1(!Constructor.prototype.componentShouldUpdate, '%s has a method called ' + 'componentShouldUpdate(). Did you mean shouldComponentUpdate()? ' + 'The name is phrased as a question because the function is ' + 'expected to return a value.', spec.displayName || 'A component');
2032
- warning_1(!Constructor.prototype.componentWillRecieveProps, '%s has a method called ' + 'componentWillRecieveProps(). Did you mean componentWillReceiveProps()?', spec.displayName || 'A component');
2033
- }
1773
+ function countChildren(children, context) {
1774
+ return traverseAllChildren_1(children, forEachSingleChildDummy, null);
1775
+ }
2034
1776
 
2035
- // Reduce time spent doing lookups by setting these on the prototype.
2036
- for (var methodName in ReactClassInterface) {
2037
- if (!Constructor.prototype[methodName]) {
2038
- Constructor.prototype[methodName] = null;
2039
- }
2040
- }
1777
+ /**
1778
+ * Flatten a children object (typically specified as `props.children`) and
1779
+ * return an array with appropriately re-keyed children.
1780
+ *
1781
+ * See https://facebook.github.io/react/docs/react-api.html#react.children.toarray
1782
+ */
1783
+ function toArray(children) {
1784
+ var result = [];
1785
+ mapIntoWithKeyPrefixInternal(children, result, null, emptyFunction_1.thatReturnsArgument);
1786
+ return result;
1787
+ }
2041
1788
 
2042
- return Constructor;
2043
- }
1789
+ var ReactChildren = {
1790
+ forEach: forEachChildren,
1791
+ map: mapChildren,
1792
+ mapIntoWithKeyPrefixInternal: mapIntoWithKeyPrefixInternal,
1793
+ count: countChildren,
1794
+ toArray: toArray
2044
1795
  };
2045
1796
 
2046
- var ReactClass_1 = ReactClass;
1797
+ var ReactChildren_1 = ReactChildren;
2047
1798
 
2048
1799
  /**
2049
1800
  * Copyright 2013-present, Facebook, Inc.
@@ -2052,16 +1803,18 @@ var ReactClass_1 = ReactClass;
2052
1803
  * This source code is licensed under the BSD-style license found in the
2053
1804
  * LICENSE file in the root directory of this source tree. An additional grant
2054
1805
  * of patent rights can be found in the PATENTS file in the same directory.
2055
- *
2056
- *
2057
- * @providesModule ReactPropTypesSecret
2058
1806
  */
2059
1807
 
2060
- var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
1808
+ var ReactPropTypesSecret$1 = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
2061
1809
 
2062
- var ReactPropTypesSecret_1 = ReactPropTypesSecret;
1810
+ var ReactPropTypesSecret_1 = ReactPropTypesSecret$1;
2063
1811
 
2064
- var loggedTypeFailures = {};
1812
+ {
1813
+ var invariant$1 = invariant_1;
1814
+ var warning$3 = warning_1;
1815
+ var ReactPropTypesSecret = ReactPropTypesSecret_1;
1816
+ var loggedTypeFailures = {};
1817
+ }
2065
1818
 
2066
1819
  /**
2067
1820
  * Assert that the values match with the type specs.
@@ -2074,7 +1827,7 @@ var loggedTypeFailures = {};
2074
1827
  * @param {?Function} getStack Returns the component stack.
2075
1828
  * @private
2076
1829
  */
2077
- function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
1830
+ function checkPropTypes$1(typeSpecs, values, location, componentName, getStack) {
2078
1831
  {
2079
1832
  for (var typeSpecName in typeSpecs) {
2080
1833
  if (typeSpecs.hasOwnProperty(typeSpecName)) {
@@ -2085,12 +1838,12 @@ function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
2085
1838
  try {
2086
1839
  // This is intentionally an invariant that gets caught. It's the same
2087
1840
  // behavior as without this statement except with a better message.
2088
- !(typeof typeSpecs[typeSpecName] === 'function') ? invariant_1(false, '%s: %s type `%s` is invalid; it must be a function, usually from React.PropTypes.', componentName || 'React class', location, typeSpecName) : void 0;
2089
- error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret_1);
1841
+ invariant$1(typeof typeSpecs[typeSpecName] === 'function', '%s: %s type `%s` is invalid; it must be a function, usually from ' + 'React.PropTypes.', componentName || 'React class', location, typeSpecName);
1842
+ error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
2090
1843
  } catch (ex) {
2091
1844
  error = ex;
2092
1845
  }
2093
- warning_1(!error || error instanceof Error, '%s: type specification of %s `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error);
1846
+ warning$3(!error || error instanceof Error, '%s: type specification of %s `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error);
2094
1847
  if (error instanceof Error && !(error.message in loggedTypeFailures)) {
2095
1848
  // Only monitor this failure once because there tends to be a lot of the
2096
1849
  // same error.
@@ -2098,459 +1851,24 @@ function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
2098
1851
 
2099
1852
  var stack = getStack ? getStack() : '';
2100
1853
 
2101
- warning_1(false, 'Failed %s type: %s%s', location, error.message, stack != null ? stack : '');
1854
+ warning$3(false, 'Failed %s type: %s%s', location, error.message, stack != null ? stack : '');
2102
1855
  }
2103
1856
  }
2104
1857
  }
2105
1858
  }
2106
1859
  }
2107
1860
 
2108
- var checkPropTypes_1 = checkPropTypes;
2109
-
2110
- /**
2111
- * Copyright 2013-present, Facebook, Inc.
2112
- * All rights reserved.
2113
- *
2114
- * This source code is licensed under the BSD-style license found in the
2115
- * LICENSE file in the root directory of this source tree. An additional grant
2116
- * of patent rights can be found in the PATENTS file in the same directory.
2117
- *
2118
- * @providesModule ReactTypeOfWork
2119
- *
2120
- */
2121
-
2122
- var ReactTypeOfWork = {
2123
- IndeterminateComponent: 0, // Before we know whether it is functional or class
2124
- FunctionalComponent: 1,
2125
- ClassComponent: 2,
2126
- HostRoot: 3, // Root of a host tree. Could be nested inside another node.
2127
- HostPortal: 4, // A subtree. Could be an entry point to a different renderer.
2128
- HostComponent: 5,
2129
- HostText: 6,
2130
- CoroutineComponent: 7,
2131
- CoroutineHandlerPhase: 8,
2132
- YieldComponent: 9,
2133
- Fragment: 10
2134
- };
2135
-
2136
- /**
2137
- * Copyright 2013-present, Facebook, Inc.
2138
- * All rights reserved.
2139
- *
2140
- * This source code is licensed under the BSD-style license found in the
2141
- * LICENSE file in the root directory of this source tree. An additional grant
2142
- * of patent rights can be found in the PATENTS file in the same directory.
2143
- *
2144
- * @providesModule getComponentName
2145
- *
2146
- */
2147
-
2148
- function getComponentName(instanceOrFiber) {
2149
- if (typeof instanceOrFiber.getName === 'function') {
2150
- // Stack reconciler
2151
- var instance = instanceOrFiber;
2152
- return instance.getName();
2153
- }
2154
- if (typeof instanceOrFiber.tag === 'number') {
2155
- // Fiber reconciler
2156
- var fiber = instanceOrFiber;
2157
- var type = fiber.type;
2158
-
2159
- if (typeof type === 'string') {
2160
- return type;
2161
- }
2162
- if (typeof type === 'function') {
2163
- return type.displayName || type.name;
2164
- }
2165
- }
2166
- return null;
2167
- }
2168
-
2169
- var getComponentName_1 = getComponentName;
2170
-
2171
- var IndeterminateComponent = ReactTypeOfWork.IndeterminateComponent;
2172
- var FunctionalComponent = ReactTypeOfWork.FunctionalComponent;
2173
- var ClassComponent = ReactTypeOfWork.ClassComponent;
2174
- var HostComponent = ReactTypeOfWork.HostComponent;
2175
-
2176
-
2177
-
2178
- function describeComponentFrame$1(name, source, ownerName) {
2179
- return '\n in ' + (name || 'Unknown') + (source ? ' (at ' + source.fileName.replace(/^.*[\\\/]/, '') + ':' + source.lineNumber + ')' : ownerName ? ' (created by ' + ownerName + ')' : '');
2180
- }
2181
-
2182
- function describeFiber(fiber) {
2183
- switch (fiber.tag) {
2184
- case IndeterminateComponent:
2185
- case FunctionalComponent:
2186
- case ClassComponent:
2187
- case HostComponent:
2188
- var owner = fiber._debugOwner;
2189
- var source = fiber._debugSource;
2190
- var name = getComponentName_1(fiber);
2191
- var ownerName = null;
2192
- if (owner) {
2193
- ownerName = getComponentName_1(owner);
2194
- }
2195
- return describeComponentFrame$1(name, source, ownerName);
2196
- default:
2197
- return '';
2198
- }
2199
- }
2200
-
2201
- // This function can only be called with a work-in-progress fiber and
2202
- // only during begin or complete phase. Do not call it under any other
2203
- // circumstances.
2204
- function getStackAddendumByWorkInProgressFiber$2(workInProgress) {
2205
- var info = '';
2206
- var node = workInProgress;
2207
- do {
2208
- info += describeFiber(node);
2209
- // Otherwise this return pointer might point to the wrong tree:
2210
- node = node['return'];
2211
- } while (node);
2212
- return info;
2213
- }
2214
-
2215
- var ReactFiberComponentTreeHook = {
2216
- getStackAddendumByWorkInProgressFiber: getStackAddendumByWorkInProgressFiber$2,
2217
- describeComponentFrame: describeComponentFrame$1
2218
- };
2219
-
2220
- var getStackAddendumByWorkInProgressFiber$1 = ReactFiberComponentTreeHook.getStackAddendumByWorkInProgressFiber;
2221
- var describeComponentFrame = ReactFiberComponentTreeHook.describeComponentFrame;
2222
-
2223
-
2224
-
2225
-
2226
-
2227
- function isNative(fn) {
2228
- // Based on isNative() from Lodash
2229
- var funcToString = Function.prototype.toString;
2230
- var hasOwnProperty = Object.prototype.hasOwnProperty;
2231
- var reIsNative = RegExp('^' + funcToString
2232
- // Take an example native function source for comparison
2233
- .call(hasOwnProperty)
2234
- // Strip regex characters so we can use it for regex
2235
- .replace(/[\\^$.*+?()[\]{}|]/g, '\\$&')
2236
- // Remove hasOwnProperty from the template to make it generic
2237
- .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$');
2238
- try {
2239
- var source = funcToString.call(fn);
2240
- return reIsNative.test(source);
2241
- } catch (err) {
2242
- return false;
2243
- }
2244
- }
2245
-
2246
- var canUseCollections =
2247
- // Array.from
2248
- typeof Array.from === 'function' &&
2249
- // Map
2250
- typeof Map === 'function' && isNative(Map) &&
2251
- // Map.prototype.keys
2252
- Map.prototype != null && typeof Map.prototype.keys === 'function' && isNative(Map.prototype.keys) &&
2253
- // Set
2254
- typeof Set === 'function' && isNative(Set) &&
2255
- // Set.prototype.keys
2256
- Set.prototype != null && typeof Set.prototype.keys === 'function' && isNative(Set.prototype.keys);
2257
-
2258
- var setItem;
2259
- var getItem;
2260
- var removeItem;
2261
- var getItemIDs;
2262
- var addRoot;
2263
- var removeRoot;
2264
- var getRootIDs;
2265
-
2266
- if (canUseCollections) {
2267
- var itemMap = new Map();
2268
- var rootIDSet = new Set();
2269
-
2270
- setItem = function (id, item) {
2271
- itemMap.set(id, item);
2272
- };
2273
- getItem = function (id) {
2274
- return itemMap.get(id);
2275
- };
2276
- removeItem = function (id) {
2277
- itemMap['delete'](id);
2278
- };
2279
- getItemIDs = function () {
2280
- return Array.from(itemMap.keys());
2281
- };
2282
-
2283
- addRoot = function (id) {
2284
- rootIDSet.add(id);
2285
- };
2286
- removeRoot = function (id) {
2287
- rootIDSet['delete'](id);
2288
- };
2289
- getRootIDs = function () {
2290
- return Array.from(rootIDSet.keys());
2291
- };
2292
- } else {
2293
- var itemByKey = {};
2294
- var rootByKey = {};
2295
-
2296
- // Use non-numeric keys to prevent V8 performance issues:
2297
- // https://github.com/facebook/react/pull/7232
2298
- var getKeyFromID = function (id) {
2299
- return '.' + id;
2300
- };
2301
- var getIDFromKey = function (key) {
2302
- return parseInt(key.substr(1), 10);
2303
- };
2304
-
2305
- setItem = function (id, item) {
2306
- var key = getKeyFromID(id);
2307
- itemByKey[key] = item;
2308
- };
2309
- getItem = function (id) {
2310
- var key = getKeyFromID(id);
2311
- return itemByKey[key];
2312
- };
2313
- removeItem = function (id) {
2314
- var key = getKeyFromID(id);
2315
- delete itemByKey[key];
2316
- };
2317
- getItemIDs = function () {
2318
- return Object.keys(itemByKey).map(getIDFromKey);
2319
- };
2320
-
2321
- addRoot = function (id) {
2322
- var key = getKeyFromID(id);
2323
- rootByKey[key] = true;
2324
- };
2325
- removeRoot = function (id) {
2326
- var key = getKeyFromID(id);
2327
- delete rootByKey[key];
2328
- };
2329
- getRootIDs = function () {
2330
- return Object.keys(rootByKey).map(getIDFromKey);
2331
- };
2332
- }
2333
-
2334
- var unmountedIDs = [];
2335
-
2336
- function purgeDeep(id) {
2337
- var item = getItem(id);
2338
- if (item) {
2339
- var childIDs = item.childIDs;
2340
-
2341
- removeItem(id);
2342
- childIDs.forEach(purgeDeep);
2343
- }
2344
- }
2345
-
2346
- function getDisplayName(element) {
2347
- if (element == null) {
2348
- return '#empty';
2349
- } else if (typeof element === 'string' || typeof element === 'number') {
2350
- return '#text';
2351
- } else if (typeof element.type === 'string') {
2352
- return element.type;
2353
- } else {
2354
- return element.type.displayName || element.type.name || 'Unknown';
2355
- }
2356
- }
2357
-
2358
- function describeID(id) {
2359
- var name = ReactComponentTreeHook.getDisplayName(id);
2360
- var element = ReactComponentTreeHook.getElement(id);
2361
- var ownerID = ReactComponentTreeHook.getOwnerID(id);
2362
- var ownerName = void 0;
2363
-
2364
- if (ownerID) {
2365
- ownerName = ReactComponentTreeHook.getDisplayName(ownerID);
2366
- }
2367
- warning_1(element, 'ReactComponentTreeHook: Missing React element for debugID %s when ' + 'building stack', id);
2368
- return describeComponentFrame(name || '', element && element._source, ownerName || '');
2369
- }
2370
-
2371
- var ReactComponentTreeHook = {
2372
- onSetChildren: function (id, nextChildIDs) {
2373
- var item = getItem(id);
2374
- invariant_1(item, 'Item must have been set');
2375
- item.childIDs = nextChildIDs;
2376
-
2377
- for (var i = 0; i < nextChildIDs.length; i++) {
2378
- var nextChildID = nextChildIDs[i];
2379
- var nextChild = getItem(nextChildID);
2380
- !nextChild ? invariant_1(false, 'Expected hook events to fire for the child before its parent includes it in onSetChildren().') : void 0;
2381
- !(nextChild.childIDs != null || typeof nextChild.element !== 'object' || nextChild.element == null) ? invariant_1(false, 'Expected onSetChildren() to fire for a container child before its parent includes it in onSetChildren().') : void 0;
2382
- !nextChild.isMounted ? invariant_1(false, 'Expected onMountComponent() to fire for the child before its parent includes it in onSetChildren().') : void 0;
2383
- if (nextChild.parentID == null) {
2384
- nextChild.parentID = id;
2385
- // TODO: This shouldn't be necessary but mounting a new root during in
2386
- // componentWillMount currently causes not-yet-mounted components to
2387
- // be purged from our tree data so their parent id is missing.
2388
- }
2389
- !(nextChild.parentID === id) ? invariant_1(false, 'Expected onBeforeMountComponent() parent and onSetChildren() to be consistent (%s has parents %s and %s).', nextChildID, nextChild.parentID, id) : void 0;
2390
- }
2391
- },
2392
- onBeforeMountComponent: function (id, element, parentID) {
2393
- var item = {
2394
- element: element,
2395
- parentID: parentID,
2396
- text: null,
2397
- childIDs: [],
2398
- isMounted: false,
2399
- updateCount: 0
2400
- };
2401
- setItem(id, item);
2402
- },
2403
- onBeforeUpdateComponent: function (id, element) {
2404
- var item = getItem(id);
2405
- if (!item || !item.isMounted) {
2406
- // We may end up here as a result of setState() in componentWillUnmount().
2407
- // In this case, ignore the element.
2408
- return;
2409
- }
2410
- item.element = element;
2411
- },
2412
- onMountComponent: function (id) {
2413
- var item = getItem(id);
2414
- invariant_1(item, 'Item must have been set');
2415
- item.isMounted = true;
2416
- var isRoot = item.parentID === 0;
2417
- if (isRoot) {
2418
- addRoot(id);
2419
- }
2420
- },
2421
- onUpdateComponent: function (id) {
2422
- var item = getItem(id);
2423
- if (!item || !item.isMounted) {
2424
- // We may end up here as a result of setState() in componentWillUnmount().
2425
- // In this case, ignore the element.
2426
- return;
2427
- }
2428
- item.updateCount++;
2429
- },
2430
- onUnmountComponent: function (id) {
2431
- var item = getItem(id);
2432
- if (item) {
2433
- // We need to check if it exists.
2434
- // `item` might not exist if it is inside an error boundary, and a sibling
2435
- // error boundary child threw while mounting. Then this instance never
2436
- // got a chance to mount, but it still gets an unmounting event during
2437
- // the error boundary cleanup.
2438
- item.isMounted = false;
2439
- var isRoot = item.parentID === 0;
2440
- if (isRoot) {
2441
- removeRoot(id);
2442
- }
2443
- }
2444
- unmountedIDs.push(id);
2445
- },
2446
- purgeUnmountedComponents: function () {
2447
- if (ReactComponentTreeHook._preventPurging) {
2448
- // Should only be used for testing.
2449
- return;
2450
- }
2451
-
2452
- for (var i = 0; i < unmountedIDs.length; i++) {
2453
- var id = unmountedIDs[i];
2454
- purgeDeep(id);
2455
- }
2456
- unmountedIDs.length = 0;
2457
- },
2458
- isMounted: function (id) {
2459
- var item = getItem(id);
2460
- return item ? item.isMounted : false;
2461
- },
2462
- getCurrentStackAddendum: function (topElement) {
2463
- var info = '';
2464
- if (topElement) {
2465
- var name = getDisplayName(topElement);
2466
- var owner = topElement._owner;
2467
- info += describeComponentFrame(name, topElement._source, owner && getComponentName_1(owner));
2468
- }
2469
-
2470
- var currentOwner = ReactCurrentOwner_1.current;
2471
- if (currentOwner) {
2472
- if (typeof currentOwner.tag === 'number') {
2473
- var workInProgress = currentOwner;
2474
- // Safe because if current owner exists, we are reconciling,
2475
- // and it is guaranteed to be the work-in-progress version.
2476
- info += getStackAddendumByWorkInProgressFiber$1(workInProgress);
2477
- } else if (typeof currentOwner._debugID === 'number') {
2478
- info += ReactComponentTreeHook.getStackAddendumByID(currentOwner._debugID);
2479
- }
2480
- }
2481
- return info;
2482
- },
2483
- getStackAddendumByID: function (id) {
2484
- var info = '';
2485
- while (id) {
2486
- info += describeID(id);
2487
- id = ReactComponentTreeHook.getParentID(id);
2488
- }
2489
- return info;
2490
- },
2491
- getChildIDs: function (id) {
2492
- var item = getItem(id);
2493
- return item ? item.childIDs : [];
2494
- },
2495
- getDisplayName: function (id) {
2496
- var element = ReactComponentTreeHook.getElement(id);
2497
- if (!element) {
2498
- return null;
2499
- }
2500
- return getDisplayName(element);
2501
- },
2502
- getElement: function (id) {
2503
- var item = getItem(id);
2504
- return item ? item.element : null;
2505
- },
2506
- getOwnerID: function (id) {
2507
- var element = ReactComponentTreeHook.getElement(id);
2508
- if (!element || !element._owner) {
2509
- return null;
2510
- }
2511
- return element._owner._debugID;
2512
- },
2513
- getParentID: function (id) {
2514
- var item = getItem(id);
2515
- return item ? item.parentID : null;
2516
- },
2517
- getSource: function (id) {
2518
- var item = getItem(id);
2519
- var element = item ? item.element : null;
2520
- var source = element != null ? element._source : null;
2521
- return source;
2522
- },
2523
- getText: function (id) {
2524
- var element = ReactComponentTreeHook.getElement(id);
2525
- if (typeof element === 'string') {
2526
- return element;
2527
- } else if (typeof element === 'number') {
2528
- return '' + element;
2529
- } else {
2530
- return null;
2531
- }
2532
- },
2533
- getUpdateCount: function (id) {
2534
- var item = getItem(id);
2535
- return item ? item.updateCount : 0;
2536
- },
2537
-
2538
-
2539
- getRootIDs: getRootIDs,
2540
- getRegisteredIDs: getItemIDs
2541
- };
2542
-
2543
- var ReactComponentTreeHook_1 = ReactComponentTreeHook;
1861
+ var checkPropTypes_1 = checkPropTypes$1;
2544
1862
 
2545
1863
  var ReactDebugCurrentFrame$1 = {};
2546
1864
 
2547
1865
  {
2548
- var _require$1 = ReactComponentTreeHook_1,
2549
- getStackAddendumByID = _require$1.getStackAddendumByID,
2550
- getCurrentStackAddendum$1 = _require$1.getCurrentStackAddendum;
1866
+ var _require$2 = ReactComponentTreeHook_1,
1867
+ getStackAddendumByID = _require$2.getStackAddendumByID,
1868
+ getCurrentStackAddendum$2 = _require$2.getCurrentStackAddendum;
2551
1869
 
2552
- var _require2 = ReactFiberComponentTreeHook,
2553
- getStackAddendumByWorkInProgressFiber = _require2.getStackAddendumByWorkInProgressFiber;
1870
+ var _require2$1 = ReactFiberComponentTreeHook,
1871
+ getStackAddendumByWorkInProgressFiber$2 = _require2$1.getStackAddendumByWorkInProgressFiber;
2554
1872
 
2555
1873
  // Component that is being worked on
2556
1874
 
@@ -2574,10 +1892,10 @@ var ReactDebugCurrentFrame$1 = {};
2574
1892
  // The stack will only be correct if this is a work in progress
2575
1893
  // version and we're calling it during reconciliation.
2576
1894
  var workInProgress = current;
2577
- stack = getStackAddendumByWorkInProgressFiber(workInProgress);
1895
+ stack = getStackAddendumByWorkInProgressFiber$2(workInProgress);
2578
1896
  }
2579
1897
  } else if (element !== null) {
2580
- stack = getCurrentStackAddendum$1(element);
1898
+ stack = getCurrentStackAddendum$2(element);
2581
1899
  }
2582
1900
  return stack;
2583
1901
  };
@@ -2585,20 +1903,13 @@ var ReactDebugCurrentFrame$1 = {};
2585
1903
 
2586
1904
  var ReactDebugCurrentFrame_1 = ReactDebugCurrentFrame$1;
2587
1905
 
2588
- var getStackAddendum = ReactDebugCurrentFrame_1.getStackAddendum;
2589
-
2590
- function checkReactTypeSpec(typeSpecs, values, location, componentName) {
2591
- checkPropTypes_1(typeSpecs, values, location, componentName, getStackAddendum);
2592
- }
2593
-
2594
- var checkReactTypeSpec_1 = checkReactTypeSpec;
2595
-
2596
1906
  {
1907
+ var checkPropTypes = checkPropTypes_1;
2597
1908
  var warning$2 = warning_1;
2598
1909
  var ReactDebugCurrentFrame = ReactDebugCurrentFrame_1;
2599
1910
 
2600
- var _require = ReactComponentTreeHook_1,
2601
- getCurrentStackAddendum = _require.getCurrentStackAddendum;
1911
+ var _require$1 = ReactComponentTreeHook_1,
1912
+ getCurrentStackAddendum$1 = _require$1.getCurrentStackAddendum;
2602
1913
  }
2603
1914
 
2604
1915
  function getDeclarationErrorAddendum() {
@@ -2657,13 +1968,11 @@ function validateExplicitKey(element, parentType) {
2657
1968
  }
2658
1969
  element._store.validated = true;
2659
1970
 
2660
- var memoizer = ownerHasKeyUseWarning.uniqueKey || (ownerHasKeyUseWarning.uniqueKey = {});
2661
-
2662
1971
  var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);
2663
- if (memoizer[currentComponentErrorInfo]) {
1972
+ if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
2664
1973
  return;
2665
1974
  }
2666
- memoizer[currentComponentErrorInfo] = true;
1975
+ ownerHasKeyUseWarning[currentComponentErrorInfo] = true;
2667
1976
 
2668
1977
  // Usually the current owner is the offender, but if it accepts children as a
2669
1978
  // property, it may be the creator of the child that's responsible for
@@ -2674,7 +1983,7 @@ function validateExplicitKey(element, parentType) {
2674
1983
  childOwner = ' It was passed a child from ' + getComponentName_1(element._owner) + '.';
2675
1984
  }
2676
1985
 
2677
- warning$2(false, 'Each child in an array or iterator should have a unique "key" prop.' + '%s%s See https://fb.me/react-warning-keys for more information.%s', currentComponentErrorInfo, childOwner, getCurrentStackAddendum(element));
1986
+ warning$2(false, 'Each child in an array or iterator should have a unique "key" prop.' + '%s%s See https://fb.me/react-warning-keys for more information.%s', currentComponentErrorInfo, childOwner, getCurrentStackAddendum$1(element));
2678
1987
  }
2679
1988
 
2680
1989
  /**
@@ -2740,7 +2049,7 @@ function validatePropTypes(element) {
2740
2049
  var propTypes = typeof componentClass.__propTypesSecretDontUseThesePlease === 'object' ? componentClass.__propTypesSecretDontUseThesePlease : componentClass.propTypes;
2741
2050
 
2742
2051
  if (propTypes) {
2743
- checkReactTypeSpec_1(propTypes, element.props, 'prop', name);
2052
+ checkPropTypes(propTypes, element.props, 'prop', name, ReactDebugCurrentFrame.getStackAddendum);
2744
2053
  }
2745
2054
  if (typeof componentClass.getDefaultProps === 'function') {
2746
2055
  warning$2(componentClass.getDefaultProps.isReactClassApproved, 'getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.');
@@ -2765,7 +2074,7 @@ var ReactElementValidator$2 = {
2765
2074
  info += getDeclarationErrorAddendum();
2766
2075
  }
2767
2076
 
2768
- info += getCurrentStackAddendum();
2077
+ info += getCurrentStackAddendum$1();
2769
2078
 
2770
2079
  warning$2(false, 'React.createElement: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', type == null ? type : typeof type, info);
2771
2080
  }
@@ -2856,7 +2165,6 @@ var createDOMFactory = ReactElement_1.createFactory;
2856
2165
 
2857
2166
  /**
2858
2167
  * Creates a mapping from supported HTML tags to `ReactDOMComponent` classes.
2859
- * This is also accessible via `React.DOM`.
2860
2168
  *
2861
2169
  * @public
2862
2170
  */
@@ -2999,60 +2307,84 @@ var ReactDOMFactories = {
2999
2307
 
3000
2308
  var ReactDOMFactories_1 = ReactDOMFactories;
3001
2309
 
3002
- /**
3003
- * Collection of methods that allow declaration and validation of props that are
3004
- * supplied to React components. Example usage:
3005
- *
3006
- * var Props = require('ReactPropTypes');
3007
- * var MyArticle = React.createClass({
3008
- * propTypes: {
3009
- * // An optional string prop named "description".
3010
- * description: Props.string,
3011
- *
3012
- * // A required enum prop named "category".
3013
- * category: Props.oneOf(['News','Photos']).isRequired,
3014
- *
3015
- * // A prop named "dialog" that requires an instance of Dialog.
3016
- * dialog: Props.instanceOf(Dialog).isRequired
3017
- * },
3018
- * render: function() { ... }
3019
- * });
3020
- *
3021
- * A more formal specification of how these methods are used:
3022
- *
3023
- * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)
3024
- * decl := ReactPropTypes.{type}(.isRequired)?
3025
- *
3026
- * Each and every declaration produces a function with the same signature. This
3027
- * allows the creation of custom validation functions. For example:
3028
- *
3029
- * var MyLink = React.createClass({
3030
- * propTypes: {
3031
- * // An optional string or URI prop named "href".
3032
- * href: function(props, propName, componentName) {
3033
- * var propValue = props[propName];
3034
- * if (propValue != null && typeof propValue !== 'string' &&
3035
- * !(propValue instanceof URI)) {
3036
- * return new Error(
3037
- * 'Expected a string or an URI for ' + propName + ' in ' +
3038
- * componentName
3039
- * );
3040
- * }
3041
- * }
3042
- * },
3043
- * render: function() {...}
3044
- * });
3045
- *
3046
- * @internal
3047
- */
2310
+ var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
2311
+ /* global Symbol */
2312
+ var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
2313
+ var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
3048
2314
 
3049
- var ANONYMOUS = '<<anonymous>>';
2315
+ /**
2316
+ * Returns the iterator method function contained on the iterable object.
2317
+ *
2318
+ * Be sure to invoke the function with the iterable as context:
2319
+ *
2320
+ * var iteratorFn = getIteratorFn(myIterable);
2321
+ * if (iteratorFn) {
2322
+ * var iterator = iteratorFn.call(myIterable);
2323
+ * ...
2324
+ * }
2325
+ *
2326
+ * @param {?object} maybeIterable
2327
+ * @return {?function}
2328
+ */
2329
+ function getIteratorFn(maybeIterable) {
2330
+ var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
2331
+ if (typeof iteratorFn === 'function') {
2332
+ return iteratorFn;
2333
+ }
2334
+ }
2335
+
2336
+ /**
2337
+ * Collection of methods that allow declaration and validation of props that are
2338
+ * supplied to React components. Example usage:
2339
+ *
2340
+ * var Props = require('ReactPropTypes');
2341
+ * var MyArticle = React.createClass({
2342
+ * propTypes: {
2343
+ * // An optional string prop named "description".
2344
+ * description: Props.string,
2345
+ *
2346
+ * // A required enum prop named "category".
2347
+ * category: Props.oneOf(['News','Photos']).isRequired,
2348
+ *
2349
+ * // A prop named "dialog" that requires an instance of Dialog.
2350
+ * dialog: Props.instanceOf(Dialog).isRequired
2351
+ * },
2352
+ * render: function() { ... }
2353
+ * });
2354
+ *
2355
+ * A more formal specification of how these methods are used:
2356
+ *
2357
+ * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)
2358
+ * decl := ReactPropTypes.{type}(.isRequired)?
2359
+ *
2360
+ * Each and every declaration produces a function with the same signature. This
2361
+ * allows the creation of custom validation functions. For example:
2362
+ *
2363
+ * var MyLink = React.createClass({
2364
+ * propTypes: {
2365
+ * // An optional string or URI prop named "href".
2366
+ * href: function(props, propName, componentName) {
2367
+ * var propValue = props[propName];
2368
+ * if (propValue != null && typeof propValue !== 'string' &&
2369
+ * !(propValue instanceof URI)) {
2370
+ * return new Error(
2371
+ * 'Expected a string or an URI for ' + propName + ' in ' +
2372
+ * componentName
2373
+ * );
2374
+ * }
2375
+ * }
2376
+ * },
2377
+ * render: function() {...}
2378
+ * });
2379
+ *
2380
+ * @internal
2381
+ */
3050
2382
 
3051
- var ReactPropTypes;
2383
+ var ANONYMOUS = '<<anonymous>>';
3052
2384
 
3053
- {
3054
- // Keep in sync with production version below
3055
- ReactPropTypes = {
2385
+ // Important!
2386
+ // Keep this list in sync with production version in `./factoryWithThrowingShims.js`.
2387
+ var ReactPropTypes = {
3056
2388
  array: createPrimitiveTypeChecker('array'),
3057
2389
  bool: createPrimitiveTypeChecker('boolean'),
3058
2390
  func: createPrimitiveTypeChecker('function'),
@@ -3071,382 +2403,1144 @@ var ReactPropTypes;
3071
2403
  oneOfType: createUnionTypeChecker,
3072
2404
  shape: createShapeTypeChecker
3073
2405
  };
3074
- }
2406
+
2407
+ /**
2408
+ * inlined Object.is polyfill to avoid requiring consumers ship their own
2409
+ * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
2410
+ */
2411
+ /*eslint-disable no-self-compare*/
2412
+ function is(x, y) {
2413
+ // SameValue algorithm
2414
+ if (x === y) {
2415
+ // Steps 1-5, 7-10
2416
+ // Steps 6.b-6.e: +0 != -0
2417
+ return x !== 0 || 1 / x === 1 / y;
2418
+ } else {
2419
+ // Step 6.a: NaN == NaN
2420
+ return x !== x && y !== y;
2421
+ }
2422
+ }
2423
+ /*eslint-enable no-self-compare*/
2424
+
2425
+ /**
2426
+ * We use an Error-like object for backward compatibility as people may call
2427
+ * PropTypes directly and inspect their output. However, we don't use real
2428
+ * Errors anymore. We don't inspect their stack anyway, and creating them
2429
+ * is prohibitively expensive if they are created too often, such as what
2430
+ * happens in oneOfType() for any type before the one that matched.
2431
+ */
2432
+ function PropTypeError(message) {
2433
+ this.message = message;
2434
+ this.stack = '';
2435
+ }
2436
+ // Make `instanceof Error` still work for returned errors.
2437
+ PropTypeError.prototype = Error.prototype;
2438
+
2439
+ function createChainableTypeChecker(validate) {
2440
+ {
2441
+ var manualPropTypeCallCache = {};
2442
+ var manualPropTypeWarningCount = 0;
2443
+ }
2444
+ function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
2445
+ componentName = componentName || ANONYMOUS;
2446
+ propFullName = propFullName || propName;
2447
+
2448
+ if (secret !== ReactPropTypesSecret_1) {
2449
+ if (throwOnDirectAccess) {
2450
+ // New behavior only for users of `prop-types` package
2451
+ invariant_1(
2452
+ false,
2453
+ 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
2454
+ 'Use `PropTypes.checkPropTypes()` to call them. ' +
2455
+ 'Read more at http://fb.me/use-check-prop-types'
2456
+ );
2457
+ } else if ('development' !== 'production' && typeof console !== 'undefined') {
2458
+ // Old behavior for people using React.PropTypes
2459
+ var cacheKey = componentName + ':' + propName;
2460
+ if (
2461
+ !manualPropTypeCallCache[cacheKey] &&
2462
+ // Avoid spamming the console because they are often not actionable except for lib authors
2463
+ manualPropTypeWarningCount < 3
2464
+ ) {
2465
+ warning_1(
2466
+ false,
2467
+ 'You are manually calling a React.PropTypes validation ' +
2468
+ 'function for the `%s` prop on `%s`. This is deprecated ' +
2469
+ 'and will throw in the standalone `prop-types` package. ' +
2470
+ 'You may be seeing this warning due to a third-party PropTypes ' +
2471
+ 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.',
2472
+ propFullName,
2473
+ componentName
2474
+ );
2475
+ manualPropTypeCallCache[cacheKey] = true;
2476
+ manualPropTypeWarningCount++;
2477
+ }
2478
+ }
2479
+ }
2480
+ if (props[propName] == null) {
2481
+ if (isRequired) {
2482
+ if (props[propName] === null) {
2483
+ return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));
2484
+ }
2485
+ return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));
2486
+ }
2487
+ return null;
2488
+ } else {
2489
+ return validate(props, propName, componentName, location, propFullName);
2490
+ }
2491
+ }
2492
+
2493
+ var chainedCheckType = checkType.bind(null, false);
2494
+ chainedCheckType.isRequired = checkType.bind(null, true);
2495
+
2496
+ return chainedCheckType;
2497
+ }
2498
+
2499
+ function createPrimitiveTypeChecker(expectedType) {
2500
+ function validate(props, propName, componentName, location, propFullName, secret) {
2501
+ var propValue = props[propName];
2502
+ var propType = getPropType(propValue);
2503
+ if (propType !== expectedType) {
2504
+ // `propValue` being instance of, say, date/regexp, pass the 'object'
2505
+ // check, but we can offer a more precise error message here rather than
2506
+ // 'of type `object`'.
2507
+ var preciseType = getPreciseType(propValue);
2508
+
2509
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'));
2510
+ }
2511
+ return null;
2512
+ }
2513
+ return createChainableTypeChecker(validate);
2514
+ }
2515
+
2516
+ function createAnyTypeChecker() {
2517
+ return createChainableTypeChecker(emptyFunction_1.thatReturnsNull);
2518
+ }
2519
+
2520
+ function createArrayOfTypeChecker(typeChecker) {
2521
+ function validate(props, propName, componentName, location, propFullName) {
2522
+ if (typeof typeChecker !== 'function') {
2523
+ return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');
2524
+ }
2525
+ var propValue = props[propName];
2526
+ if (!Array.isArray(propValue)) {
2527
+ var propType = getPropType(propValue);
2528
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));
2529
+ }
2530
+ for (var i = 0; i < propValue.length; i++) {
2531
+ var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret_1);
2532
+ if (error instanceof Error) {
2533
+ return error;
2534
+ }
2535
+ }
2536
+ return null;
2537
+ }
2538
+ return createChainableTypeChecker(validate);
2539
+ }
2540
+
2541
+ function createElementTypeChecker() {
2542
+ function validate(props, propName, componentName, location, propFullName) {
2543
+ var propValue = props[propName];
2544
+ if (!isValidElement(propValue)) {
2545
+ var propType = getPropType(propValue);
2546
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));
2547
+ }
2548
+ return null;
2549
+ }
2550
+ return createChainableTypeChecker(validate);
2551
+ }
2552
+
2553
+ function createInstanceTypeChecker(expectedClass) {
2554
+ function validate(props, propName, componentName, location, propFullName) {
2555
+ if (!(props[propName] instanceof expectedClass)) {
2556
+ var expectedClassName = expectedClass.name || ANONYMOUS;
2557
+ var actualClassName = getClassName(props[propName]);
2558
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));
2559
+ }
2560
+ return null;
2561
+ }
2562
+ return createChainableTypeChecker(validate);
2563
+ }
2564
+
2565
+ function createEnumTypeChecker(expectedValues) {
2566
+ if (!Array.isArray(expectedValues)) {
2567
+ warning_1(false, 'Invalid argument supplied to oneOf, expected an instance of array.');
2568
+ return emptyFunction_1.thatReturnsNull;
2569
+ }
2570
+
2571
+ function validate(props, propName, componentName, location, propFullName) {
2572
+ var propValue = props[propName];
2573
+ for (var i = 0; i < expectedValues.length; i++) {
2574
+ if (is(propValue, expectedValues[i])) {
2575
+ return null;
2576
+ }
2577
+ }
2578
+
2579
+ var valuesString = JSON.stringify(expectedValues);
2580
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + propValue + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));
2581
+ }
2582
+ return createChainableTypeChecker(validate);
2583
+ }
2584
+
2585
+ function createObjectOfTypeChecker(typeChecker) {
2586
+ function validate(props, propName, componentName, location, propFullName) {
2587
+ if (typeof typeChecker !== 'function') {
2588
+ return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');
2589
+ }
2590
+ var propValue = props[propName];
2591
+ var propType = getPropType(propValue);
2592
+ if (propType !== 'object') {
2593
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
2594
+ }
2595
+ for (var key in propValue) {
2596
+ if (propValue.hasOwnProperty(key)) {
2597
+ var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret_1);
2598
+ if (error instanceof Error) {
2599
+ return error;
2600
+ }
2601
+ }
2602
+ }
2603
+ return null;
2604
+ }
2605
+ return createChainableTypeChecker(validate);
2606
+ }
2607
+
2608
+ function createUnionTypeChecker(arrayOfTypeCheckers) {
2609
+ if (!Array.isArray(arrayOfTypeCheckers)) {
2610
+ warning_1(false, 'Invalid argument supplied to oneOfType, expected an instance of array.');
2611
+ return emptyFunction_1.thatReturnsNull;
2612
+ }
2613
+
2614
+ function validate(props, propName, componentName, location, propFullName) {
2615
+ for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
2616
+ var checker = arrayOfTypeCheckers[i];
2617
+ if (checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret_1) == null) {
2618
+ return null;
2619
+ }
2620
+ }
2621
+
2622
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.'));
2623
+ }
2624
+ return createChainableTypeChecker(validate);
2625
+ }
2626
+
2627
+ function createNodeChecker() {
2628
+ function validate(props, propName, componentName, location, propFullName) {
2629
+ if (!isNode(props[propName])) {
2630
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));
2631
+ }
2632
+ return null;
2633
+ }
2634
+ return createChainableTypeChecker(validate);
2635
+ }
2636
+
2637
+ function createShapeTypeChecker(shapeTypes) {
2638
+ function validate(props, propName, componentName, location, propFullName) {
2639
+ var propValue = props[propName];
2640
+ var propType = getPropType(propValue);
2641
+ if (propType !== 'object') {
2642
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
2643
+ }
2644
+ for (var key in shapeTypes) {
2645
+ var checker = shapeTypes[key];
2646
+ if (!checker) {
2647
+ continue;
2648
+ }
2649
+ var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret_1);
2650
+ if (error) {
2651
+ return error;
2652
+ }
2653
+ }
2654
+ return null;
2655
+ }
2656
+ return createChainableTypeChecker(validate);
2657
+ }
2658
+
2659
+ function isNode(propValue) {
2660
+ switch (typeof propValue) {
2661
+ case 'number':
2662
+ case 'string':
2663
+ case 'undefined':
2664
+ return true;
2665
+ case 'boolean':
2666
+ return !propValue;
2667
+ case 'object':
2668
+ if (Array.isArray(propValue)) {
2669
+ return propValue.every(isNode);
2670
+ }
2671
+ if (propValue === null || isValidElement(propValue)) {
2672
+ return true;
2673
+ }
2674
+
2675
+ var iteratorFn = getIteratorFn(propValue);
2676
+ if (iteratorFn) {
2677
+ var iterator = iteratorFn.call(propValue);
2678
+ var step;
2679
+ if (iteratorFn !== propValue.entries) {
2680
+ while (!(step = iterator.next()).done) {
2681
+ if (!isNode(step.value)) {
2682
+ return false;
2683
+ }
2684
+ }
2685
+ } else {
2686
+ // Iterator will provide entry [k,v] tuples rather than values.
2687
+ while (!(step = iterator.next()).done) {
2688
+ var entry = step.value;
2689
+ if (entry) {
2690
+ if (!isNode(entry[1])) {
2691
+ return false;
2692
+ }
2693
+ }
2694
+ }
2695
+ }
2696
+ } else {
2697
+ return false;
2698
+ }
2699
+
2700
+ return true;
2701
+ default:
2702
+ return false;
2703
+ }
2704
+ }
2705
+
2706
+ function isSymbol(propType, propValue) {
2707
+ // Native Symbol.
2708
+ if (propType === 'symbol') {
2709
+ return true;
2710
+ }
2711
+
2712
+ // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'
2713
+ if (propValue['@@toStringTag'] === 'Symbol') {
2714
+ return true;
2715
+ }
2716
+
2717
+ // Fallback for non-spec compliant Symbols which are polyfilled.
2718
+ if (typeof Symbol === 'function' && propValue instanceof Symbol) {
2719
+ return true;
2720
+ }
2721
+
2722
+ return false;
2723
+ }
2724
+
2725
+ // Equivalent of `typeof` but with special handling for array and regexp.
2726
+ function getPropType(propValue) {
2727
+ var propType = typeof propValue;
2728
+ if (Array.isArray(propValue)) {
2729
+ return 'array';
2730
+ }
2731
+ if (propValue instanceof RegExp) {
2732
+ // Old webkits (at least until Android 4.0) return 'function' rather than
2733
+ // 'object' for typeof a RegExp. We'll normalize this here so that /bla/
2734
+ // passes PropTypes.object.
2735
+ return 'object';
2736
+ }
2737
+ if (isSymbol(propType, propValue)) {
2738
+ return 'symbol';
2739
+ }
2740
+ return propType;
2741
+ }
2742
+
2743
+ // This handles more types than `getPropType`. Only used for error messages.
2744
+ // See `createPrimitiveTypeChecker`.
2745
+ function getPreciseType(propValue) {
2746
+ var propType = getPropType(propValue);
2747
+ if (propType === 'object') {
2748
+ if (propValue instanceof Date) {
2749
+ return 'date';
2750
+ } else if (propValue instanceof RegExp) {
2751
+ return 'regexp';
2752
+ }
2753
+ }
2754
+ return propType;
2755
+ }
2756
+
2757
+ // Returns class name of the object, if any.
2758
+ function getClassName(propValue) {
2759
+ if (!propValue.constructor || !propValue.constructor.name) {
2760
+ return ANONYMOUS;
2761
+ }
2762
+ return propValue.constructor.name;
2763
+ }
2764
+
2765
+ ReactPropTypes.checkPropTypes = checkPropTypes_1;
2766
+ ReactPropTypes.PropTypes = ReactPropTypes;
2767
+
2768
+ return ReactPropTypes;
2769
+ };
2770
+
2771
+ // React 15.5 references this module, and assumes PropTypes are still callable in production.
2772
+ // Therefore we re-export development-only version with all the PropTypes checks here.
2773
+ // However if one is migrating to the `prop-types` npm library, they will go through the
2774
+ // `index.js` entry point, and it will branch depending on the environment.
2775
+
2776
+ var factory_1 = function(isValidElement) {
2777
+ // It is still allowed in 15.5.
2778
+ var throwOnDirectAccess = false;
2779
+ return factoryWithTypeCheckers(isValidElement, throwOnDirectAccess);
2780
+ };
2781
+
2782
+ var isValidElement = ReactElement_1.isValidElement;
2783
+
2784
+
2785
+
2786
+ var ReactPropTypes = factory_1(isValidElement);
3075
2787
 
3076
2788
  /**
3077
- * inlined Object.is polyfill to avoid requiring consumers ship their own
3078
- * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
2789
+ * Copyright 2013-present, Facebook, Inc.
2790
+ * All rights reserved.
2791
+ *
2792
+ * This source code is licensed under the BSD-style license found in the
2793
+ * LICENSE file in the root directory of this source tree. An additional grant
2794
+ * of patent rights can be found in the PATENTS file in the same directory.
2795
+ *
2796
+ * @providesModule ReactVersion
3079
2797
  */
3080
- /*eslint-disable no-self-compare*/
3081
- function is(x, y) {
3082
- // SameValue algorithm
3083
- if (x === y) {
3084
- // Steps 1-5, 7-10
3085
- // Steps 6.b-6.e: +0 != -0
3086
- return x !== 0 || 1 / x === 1 / y;
3087
- } else {
3088
- // Step 6.a: NaN == NaN
3089
- return x !== x && y !== y;
3090
- }
3091
- }
3092
- /*eslint-enable no-self-compare*/
2798
+
2799
+ var ReactVersion = '16.0.0-alpha.11';
3093
2800
 
3094
2801
  /**
3095
- * We use an Error-like object for backward compatibility as people may call
3096
- * PropTypes directly and inspect their output. However, we don't use real
3097
- * Errors anymore. We don't inspect their stack anyway, and creating them
3098
- * is prohibitively expensive if they are created too often, such as what
3099
- * happens in oneOfType() for any type before the one that matched.
2802
+ * Returns the first child in a collection of children and verifies that there
2803
+ * is only one child in the collection.
2804
+ *
2805
+ * See https://facebook.github.io/react/docs/react-api.html#react.children.only
2806
+ *
2807
+ * The current implementation of this function assumes that a single child gets
2808
+ * passed without a wrapper, but the purpose of this helper function is to
2809
+ * abstract away the particular structure of children.
2810
+ *
2811
+ * @param {?object} children Child collection structure.
2812
+ * @return {ReactElement} The first and only `ReactElement` contained in the
2813
+ * structure.
3100
2814
  */
3101
- function PropTypeError(message) {
3102
- this.message = message;
3103
- this.stack = '';
2815
+ function onlyChild(children) {
2816
+ !ReactElement_1.isValidElement(children) ? invariant_1(false, 'React.Children.only expected to receive a single React element child.') : void 0;
2817
+ return children;
3104
2818
  }
3105
- // Make `instanceof Error` still work for returned errors.
3106
- PropTypeError.prototype = Error.prototype;
3107
2819
 
3108
- function createChainableTypeChecker(validate) {
3109
- {
3110
- var manualPropTypeCallCache = {};
3111
- }
3112
- function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
3113
- componentName = componentName || ANONYMOUS;
3114
- propFullName = propFullName || propName;
3115
- {
3116
- if (secret !== ReactPropTypesSecret_1 && typeof console !== 'undefined') {
3117
- var cacheKey = componentName + ':' + propName;
3118
- if (!manualPropTypeCallCache[cacheKey]) {
3119
- warning_1(false, 'You are manually calling a React.PropTypes validation ' + 'function for the `%s` prop on `%s`. This is deprecated ' + 'and will not work in production with the next major version. ' + 'You may be seeing this warning due to a third-party PropTypes ' + 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.', propFullName, componentName);
3120
- manualPropTypeCallCache[cacheKey] = true;
2820
+ var onlyChild_1 = onlyChild;
2821
+
2822
+ {
2823
+ var warning$4 = warning_1;
2824
+ }
2825
+
2826
+ var MIXINS_KEY = 'mixins';
2827
+
2828
+ // Helper function to allow the creation of anonymous functions which do not
2829
+ // have .name set to the name of the variable being assigned to.
2830
+ function identity(fn) {
2831
+ return fn;
2832
+ }
2833
+
2834
+ var ReactPropTypeLocationNames;
2835
+ {
2836
+ ReactPropTypeLocationNames = {
2837
+ prop: 'prop',
2838
+ context: 'context',
2839
+ childContext: 'child context',
2840
+ };
2841
+ }
2842
+
2843
+ function factory$2(ReactComponent, isValidElement, ReactNoopUpdateQueue) {
2844
+ /**
2845
+ * Policies that describe methods in `ReactClassInterface`.
2846
+ */
2847
+
2848
+
2849
+ var injectedMixins = [];
2850
+
2851
+ /**
2852
+ * Composite components are higher-level components that compose other composite
2853
+ * or host components.
2854
+ *
2855
+ * To create a new type of `ReactClass`, pass a specification of
2856
+ * your new class to `React.createClass`. The only requirement of your class
2857
+ * specification is that you implement a `render` method.
2858
+ *
2859
+ * var MyComponent = React.createClass({
2860
+ * render: function() {
2861
+ * return <div>Hello World</div>;
2862
+ * }
2863
+ * });
2864
+ *
2865
+ * The class specification supports a specific protocol of methods that have
2866
+ * special meaning (e.g. `render`). See `ReactClassInterface` for
2867
+ * more the comprehensive protocol. Any other properties and methods in the
2868
+ * class specification will be available on the prototype.
2869
+ *
2870
+ * @interface ReactClassInterface
2871
+ * @internal
2872
+ */
2873
+ var ReactClassInterface = {
2874
+
2875
+ /**
2876
+ * An array of Mixin objects to include when defining your component.
2877
+ *
2878
+ * @type {array}
2879
+ * @optional
2880
+ */
2881
+ mixins: 'DEFINE_MANY',
2882
+
2883
+ /**
2884
+ * An object containing properties and methods that should be defined on
2885
+ * the component's constructor instead of its prototype (static methods).
2886
+ *
2887
+ * @type {object}
2888
+ * @optional
2889
+ */
2890
+ statics: 'DEFINE_MANY',
2891
+
2892
+ /**
2893
+ * Definition of prop types for this component.
2894
+ *
2895
+ * @type {object}
2896
+ * @optional
2897
+ */
2898
+ propTypes: 'DEFINE_MANY',
2899
+
2900
+ /**
2901
+ * Definition of context types for this component.
2902
+ *
2903
+ * @type {object}
2904
+ * @optional
2905
+ */
2906
+ contextTypes: 'DEFINE_MANY',
2907
+
2908
+ /**
2909
+ * Definition of context types this component sets for its children.
2910
+ *
2911
+ * @type {object}
2912
+ * @optional
2913
+ */
2914
+ childContextTypes: 'DEFINE_MANY',
2915
+
2916
+ // ==== Definition methods ====
2917
+
2918
+ /**
2919
+ * Invoked when the component is mounted. Values in the mapping will be set on
2920
+ * `this.props` if that prop is not specified (i.e. using an `in` check).
2921
+ *
2922
+ * This method is invoked before `getInitialState` and therefore cannot rely
2923
+ * on `this.state` or use `this.setState`.
2924
+ *
2925
+ * @return {object}
2926
+ * @optional
2927
+ */
2928
+ getDefaultProps: 'DEFINE_MANY_MERGED',
2929
+
2930
+ /**
2931
+ * Invoked once before the component is mounted. The return value will be used
2932
+ * as the initial value of `this.state`.
2933
+ *
2934
+ * getInitialState: function() {
2935
+ * return {
2936
+ * isOn: false,
2937
+ * fooBaz: new BazFoo()
2938
+ * }
2939
+ * }
2940
+ *
2941
+ * @return {object}
2942
+ * @optional
2943
+ */
2944
+ getInitialState: 'DEFINE_MANY_MERGED',
2945
+
2946
+ /**
2947
+ * @return {object}
2948
+ * @optional
2949
+ */
2950
+ getChildContext: 'DEFINE_MANY_MERGED',
2951
+
2952
+ /**
2953
+ * Uses props from `this.props` and state from `this.state` to render the
2954
+ * structure of the component.
2955
+ *
2956
+ * No guarantees are made about when or how often this method is invoked, so
2957
+ * it must not have side effects.
2958
+ *
2959
+ * render: function() {
2960
+ * var name = this.props.name;
2961
+ * return <div>Hello, {name}!</div>;
2962
+ * }
2963
+ *
2964
+ * @return {ReactComponent}
2965
+ * @nosideeffects
2966
+ * @required
2967
+ */
2968
+ render: 'DEFINE_ONCE',
2969
+
2970
+ // ==== Delegate methods ====
2971
+
2972
+ /**
2973
+ * Invoked when the component is initially created and about to be mounted.
2974
+ * This may have side effects, but any external subscriptions or data created
2975
+ * by this method must be cleaned up in `componentWillUnmount`.
2976
+ *
2977
+ * @optional
2978
+ */
2979
+ componentWillMount: 'DEFINE_MANY',
2980
+
2981
+ /**
2982
+ * Invoked when the component has been mounted and has a DOM representation.
2983
+ * However, there is no guarantee that the DOM node is in the document.
2984
+ *
2985
+ * Use this as an opportunity to operate on the DOM when the component has
2986
+ * been mounted (initialized and rendered) for the first time.
2987
+ *
2988
+ * @param {DOMElement} rootNode DOM element representing the component.
2989
+ * @optional
2990
+ */
2991
+ componentDidMount: 'DEFINE_MANY',
2992
+
2993
+ /**
2994
+ * Invoked before the component receives new props.
2995
+ *
2996
+ * Use this as an opportunity to react to a prop transition by updating the
2997
+ * state using `this.setState`. Current props are accessed via `this.props`.
2998
+ *
2999
+ * componentWillReceiveProps: function(nextProps, nextContext) {
3000
+ * this.setState({
3001
+ * likesIncreasing: nextProps.likeCount > this.props.likeCount
3002
+ * });
3003
+ * }
3004
+ *
3005
+ * NOTE: There is no equivalent `componentWillReceiveState`. An incoming prop
3006
+ * transition may cause a state change, but the opposite is not true. If you
3007
+ * need it, you are probably looking for `componentWillUpdate`.
3008
+ *
3009
+ * @param {object} nextProps
3010
+ * @optional
3011
+ */
3012
+ componentWillReceiveProps: 'DEFINE_MANY',
3013
+
3014
+ /**
3015
+ * Invoked while deciding if the component should be updated as a result of
3016
+ * receiving new props, state and/or context.
3017
+ *
3018
+ * Use this as an opportunity to `return false` when you're certain that the
3019
+ * transition to the new props/state/context will not require a component
3020
+ * update.
3021
+ *
3022
+ * shouldComponentUpdate: function(nextProps, nextState, nextContext) {
3023
+ * return !equal(nextProps, this.props) ||
3024
+ * !equal(nextState, this.state) ||
3025
+ * !equal(nextContext, this.context);
3026
+ * }
3027
+ *
3028
+ * @param {object} nextProps
3029
+ * @param {?object} nextState
3030
+ * @param {?object} nextContext
3031
+ * @return {boolean} True if the component should update.
3032
+ * @optional
3033
+ */
3034
+ shouldComponentUpdate: 'DEFINE_ONCE',
3035
+
3036
+ /**
3037
+ * Invoked when the component is about to update due to a transition from
3038
+ * `this.props`, `this.state` and `this.context` to `nextProps`, `nextState`
3039
+ * and `nextContext`.
3040
+ *
3041
+ * Use this as an opportunity to perform preparation before an update occurs.
3042
+ *
3043
+ * NOTE: You **cannot** use `this.setState()` in this method.
3044
+ *
3045
+ * @param {object} nextProps
3046
+ * @param {?object} nextState
3047
+ * @param {?object} nextContext
3048
+ * @param {ReactReconcileTransaction} transaction
3049
+ * @optional
3050
+ */
3051
+ componentWillUpdate: 'DEFINE_MANY',
3052
+
3053
+ /**
3054
+ * Invoked when the component's DOM representation has been updated.
3055
+ *
3056
+ * Use this as an opportunity to operate on the DOM when the component has
3057
+ * been updated.
3058
+ *
3059
+ * @param {object} prevProps
3060
+ * @param {?object} prevState
3061
+ * @param {?object} prevContext
3062
+ * @param {DOMElement} rootNode DOM element representing the component.
3063
+ * @optional
3064
+ */
3065
+ componentDidUpdate: 'DEFINE_MANY',
3066
+
3067
+ /**
3068
+ * Invoked when the component is about to be removed from its parent and have
3069
+ * its DOM representation destroyed.
3070
+ *
3071
+ * Use this as an opportunity to deallocate any external resources.
3072
+ *
3073
+ * NOTE: There is no `componentDidUnmount` since your component will have been
3074
+ * destroyed by that point.
3075
+ *
3076
+ * @optional
3077
+ */
3078
+ componentWillUnmount: 'DEFINE_MANY',
3079
+
3080
+ // ==== Advanced methods ====
3081
+
3082
+ /**
3083
+ * Updates the component's currently mounted DOM representation.
3084
+ *
3085
+ * By default, this implements React's rendering and reconciliation algorithm.
3086
+ * Sophisticated clients may wish to override this.
3087
+ *
3088
+ * @param {ReactReconcileTransaction} transaction
3089
+ * @internal
3090
+ * @overridable
3091
+ */
3092
+ updateComponent: 'OVERRIDE_BASE'
3093
+
3094
+ };
3095
+
3096
+ /**
3097
+ * Mapping from class specification keys to special processing functions.
3098
+ *
3099
+ * Although these are declared like instance properties in the specification
3100
+ * when defining classes using `React.createClass`, they are actually static
3101
+ * and are accessible on the constructor instead of the prototype. Despite
3102
+ * being static, they must be defined outside of the "statics" key under
3103
+ * which all other static methods are defined.
3104
+ */
3105
+ var RESERVED_SPEC_KEYS = {
3106
+ displayName: function (Constructor, displayName) {
3107
+ Constructor.displayName = displayName;
3108
+ },
3109
+ mixins: function (Constructor, mixins) {
3110
+ if (mixins) {
3111
+ for (var i = 0; i < mixins.length; i++) {
3112
+ mixSpecIntoComponent(Constructor, mixins[i]);
3121
3113
  }
3122
3114
  }
3123
- }
3124
- if (props[propName] == null) {
3125
- if (isRequired) {
3126
- if (props[propName] === null) {
3127
- return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));
3128
- }
3129
- return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));
3115
+ },
3116
+ childContextTypes: function (Constructor, childContextTypes) {
3117
+ {
3118
+ validateTypeDef(Constructor, childContextTypes, 'childContext');
3119
+ }
3120
+ Constructor.childContextTypes = index({}, Constructor.childContextTypes, childContextTypes);
3121
+ },
3122
+ contextTypes: function (Constructor, contextTypes) {
3123
+ {
3124
+ validateTypeDef(Constructor, contextTypes, 'context');
3125
+ }
3126
+ Constructor.contextTypes = index({}, Constructor.contextTypes, contextTypes);
3127
+ },
3128
+ /**
3129
+ * Special case getDefaultProps which should move into statics but requires
3130
+ * automatic merging.
3131
+ */
3132
+ getDefaultProps: function (Constructor, getDefaultProps) {
3133
+ if (Constructor.getDefaultProps) {
3134
+ Constructor.getDefaultProps = createMergedResultFunction(Constructor.getDefaultProps, getDefaultProps);
3135
+ } else {
3136
+ Constructor.getDefaultProps = getDefaultProps;
3137
+ }
3138
+ },
3139
+ propTypes: function (Constructor, propTypes) {
3140
+ {
3141
+ validateTypeDef(Constructor, propTypes, 'prop');
3142
+ }
3143
+ Constructor.propTypes = index({}, Constructor.propTypes, propTypes);
3144
+ },
3145
+ statics: function (Constructor, statics) {
3146
+ mixStaticSpecIntoComponent(Constructor, statics);
3147
+ },
3148
+ autobind: function () {} };
3149
+
3150
+ function validateTypeDef(Constructor, typeDef, location) {
3151
+ for (var propName in typeDef) {
3152
+ if (typeDef.hasOwnProperty(propName)) {
3153
+ // use a warning instead of an _invariant so components
3154
+ // don't show up in prod but only in true
3155
+ warning$4(typeof typeDef[propName] === 'function', '%s: %s type `%s` is invalid; it must be a function, usually from ' + 'React.PropTypes.', Constructor.displayName || 'ReactClass', ReactPropTypeLocationNames[location], propName);
3130
3156
  }
3131
- return null;
3132
- } else {
3133
- return validate(props, propName, componentName, location, propFullName);
3134
3157
  }
3135
3158
  }
3136
3159
 
3137
- var chainedCheckType = checkType.bind(null, false);
3138
- chainedCheckType.isRequired = checkType.bind(null, true);
3160
+ function validateMethodOverride(isAlreadyDefined, name) {
3161
+ var specPolicy = ReactClassInterface.hasOwnProperty(name) ? ReactClassInterface[name] : null;
3139
3162
 
3140
- return chainedCheckType;
3141
- }
3142
-
3143
- function createPrimitiveTypeChecker(expectedType) {
3144
- function validate(props, propName, componentName, location, propFullName, secret) {
3145
- var propValue = props[propName];
3146
- var propType = getPropType(propValue);
3147
- if (propType !== expectedType) {
3148
- // `propValue` being instance of, say, date/regexp, pass the 'object'
3149
- // check, but we can offer a more precise error message here rather than
3150
- // 'of type `object`'.
3151
- var preciseType = getPreciseType(propValue);
3163
+ // Disallow overriding of base class methods unless explicitly allowed.
3164
+ if (ReactClassMixin.hasOwnProperty(name)) {
3165
+ invariant_1(specPolicy === 'OVERRIDE_BASE', 'ReactClassInterface: You are attempting to override ' + '`%s` from your class specification. Ensure that your method names ' + 'do not overlap with React methods.', name);
3166
+ }
3152
3167
 
3153
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'));
3168
+ // Disallow defining methods more than once unless explicitly allowed.
3169
+ if (isAlreadyDefined) {
3170
+ invariant_1(specPolicy === 'DEFINE_MANY' || specPolicy === 'DEFINE_MANY_MERGED', 'ReactClassInterface: You are attempting to define ' + '`%s` on your component more than once. This conflict may be due ' + 'to a mixin.', name);
3154
3171
  }
3155
- return null;
3156
3172
  }
3157
- return createChainableTypeChecker(validate);
3158
- }
3159
3173
 
3160
- function createAnyTypeChecker() {
3161
- return createChainableTypeChecker(emptyFunction_1.thatReturnsNull);
3162
- }
3174
+ /**
3175
+ * Mixin helper which handles policy validation and reserved
3176
+ * specification keys when building React classes.
3177
+ */
3178
+ function mixSpecIntoComponent(Constructor, spec) {
3179
+ if (!spec) {
3180
+ {
3181
+ var typeofSpec = typeof spec;
3182
+ var isMixinValid = typeofSpec === 'object' && spec !== null;
3183
+
3184
+ warning$4(isMixinValid, '%s: You\'re attempting to include a mixin that is either null ' + 'or not an object. Check the mixins included by the component, ' + 'as well as any mixins they include themselves. ' + 'Expected object but got %s.', Constructor.displayName || 'ReactClass', spec === null ? null : typeofSpec);
3185
+ }
3163
3186
 
3164
- function createArrayOfTypeChecker(typeChecker) {
3165
- function validate(props, propName, componentName, location, propFullName) {
3166
- if (typeof typeChecker !== 'function') {
3167
- return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');
3187
+ return;
3168
3188
  }
3169
- var propValue = props[propName];
3170
- if (!Array.isArray(propValue)) {
3171
- var propType = getPropType(propValue);
3172
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));
3189
+
3190
+ invariant_1(typeof spec !== 'function', 'ReactClass: You\'re attempting to ' + 'use a component class or function as a mixin. Instead, just use a ' + 'regular object.');
3191
+ invariant_1(!isValidElement(spec), 'ReactClass: You\'re attempting to ' + 'use a component as a mixin. Instead, just use a regular object.');
3192
+
3193
+ var proto = Constructor.prototype;
3194
+ var autoBindPairs = proto.__reactAutoBindPairs;
3195
+
3196
+ // By handling mixins before any other properties, we ensure the same
3197
+ // chaining order is applied to methods with DEFINE_MANY policy, whether
3198
+ // mixins are listed before or after these methods in the spec.
3199
+ if (spec.hasOwnProperty(MIXINS_KEY)) {
3200
+ RESERVED_SPEC_KEYS.mixins(Constructor, spec.mixins);
3173
3201
  }
3174
- for (var i = 0; i < propValue.length; i++) {
3175
- var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret_1);
3176
- if (error instanceof Error) {
3177
- return error;
3202
+
3203
+ for (var name in spec) {
3204
+ if (!spec.hasOwnProperty(name)) {
3205
+ continue;
3206
+ }
3207
+
3208
+ if (name === MIXINS_KEY) {
3209
+ // We have already handled mixins in a special case above.
3210
+ continue;
3211
+ }
3212
+
3213
+ var property = spec[name];
3214
+ var isAlreadyDefined = proto.hasOwnProperty(name);
3215
+ validateMethodOverride(isAlreadyDefined, name);
3216
+
3217
+ if (RESERVED_SPEC_KEYS.hasOwnProperty(name)) {
3218
+ RESERVED_SPEC_KEYS[name](Constructor, property);
3219
+ } else {
3220
+ // Setup methods on prototype:
3221
+ // The following member methods should not be automatically bound:
3222
+ // 1. Expected ReactClass methods (in the "interface").
3223
+ // 2. Overridden methods (that were mixed in).
3224
+ var isReactClassMethod = ReactClassInterface.hasOwnProperty(name);
3225
+ var isFunction = typeof property === 'function';
3226
+ var shouldAutoBind = isFunction && !isReactClassMethod && !isAlreadyDefined && spec.autobind !== false;
3227
+
3228
+ if (shouldAutoBind) {
3229
+ autoBindPairs.push(name, property);
3230
+ proto[name] = property;
3231
+ } else {
3232
+ if (isAlreadyDefined) {
3233
+ var specPolicy = ReactClassInterface[name];
3234
+
3235
+ // These cases should already be caught by validateMethodOverride.
3236
+ invariant_1(isReactClassMethod && (specPolicy === 'DEFINE_MANY_MERGED' || specPolicy === 'DEFINE_MANY'), 'ReactClass: Unexpected spec policy %s for key %s ' + 'when mixing in component specs.', specPolicy, name);
3237
+
3238
+ // For methods which are defined more than once, call the existing
3239
+ // methods before calling the new property, merging if appropriate.
3240
+ if (specPolicy === 'DEFINE_MANY_MERGED') {
3241
+ proto[name] = createMergedResultFunction(proto[name], property);
3242
+ } else if (specPolicy === 'DEFINE_MANY') {
3243
+ proto[name] = createChainedFunction(proto[name], property);
3244
+ }
3245
+ } else {
3246
+ proto[name] = property;
3247
+ {
3248
+ // Add verbose displayName to the function, which helps when looking
3249
+ // at profiling tools.
3250
+ if (typeof property === 'function' && spec.displayName) {
3251
+ proto[name].displayName = spec.displayName + '_' + name;
3252
+ }
3253
+ }
3254
+ }
3255
+ }
3178
3256
  }
3179
3257
  }
3180
- return null;
3181
3258
  }
3182
- return createChainableTypeChecker(validate);
3183
- }
3184
3259
 
3185
- function createElementTypeChecker() {
3186
- function validate(props, propName, componentName, location, propFullName) {
3187
- var propValue = props[propName];
3188
- if (!ReactElement_1.isValidElement(propValue)) {
3189
- var propType = getPropType(propValue);
3190
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));
3260
+ function mixStaticSpecIntoComponent(Constructor, statics) {
3261
+ if (!statics) {
3262
+ return;
3191
3263
  }
3192
- return null;
3193
- }
3194
- return createChainableTypeChecker(validate);
3195
- }
3264
+ for (var name in statics) {
3265
+ var property = statics[name];
3266
+ if (!statics.hasOwnProperty(name)) {
3267
+ continue;
3268
+ }
3269
+
3270
+ var isReserved = name in RESERVED_SPEC_KEYS;
3271
+ invariant_1(!isReserved, 'ReactClass: You are attempting to define a reserved ' + 'property, `%s`, that shouldn\'t be on the "statics" key. Define it ' + 'as an instance property instead; it will still be accessible on the ' + 'constructor.', name);
3196
3272
 
3197
- function createInstanceTypeChecker(expectedClass) {
3198
- function validate(props, propName, componentName, location, propFullName) {
3199
- if (!(props[propName] instanceof expectedClass)) {
3200
- var expectedClassName = expectedClass.name || ANONYMOUS;
3201
- var actualClassName = getClassName(props[propName]);
3202
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));
3273
+ var isInherited = name in Constructor;
3274
+ invariant_1(!isInherited, 'ReactClass: You are attempting to define ' + '`%s` on your component more than once. This conflict may be ' + 'due to a mixin.', name);
3275
+ Constructor[name] = property;
3203
3276
  }
3204
- return null;
3205
3277
  }
3206
- return createChainableTypeChecker(validate);
3207
- }
3208
3278
 
3209
- function createEnumTypeChecker(expectedValues) {
3210
- if (!Array.isArray(expectedValues)) {
3211
- warning_1(false, 'Invalid argument supplied to oneOf, expected an instance of array.');
3212
- return emptyFunction_1.thatReturnsNull;
3213
- }
3279
+ /**
3280
+ * Merge two objects, but throw if both contain the same key.
3281
+ *
3282
+ * @param {object} one The first object, which is mutated.
3283
+ * @param {object} two The second object
3284
+ * @return {object} one after it has been mutated to contain everything in two.
3285
+ */
3286
+ function mergeIntoWithNoDuplicateKeys(one, two) {
3287
+ invariant_1(one && two && typeof one === 'object' && typeof two === 'object', 'mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects.');
3214
3288
 
3215
- function validate(props, propName, componentName, location, propFullName) {
3216
- var propValue = props[propName];
3217
- for (var i = 0; i < expectedValues.length; i++) {
3218
- if (is(propValue, expectedValues[i])) {
3219
- return null;
3289
+ for (var key in two) {
3290
+ if (two.hasOwnProperty(key)) {
3291
+ invariant_1(one[key] === undefined, 'mergeIntoWithNoDuplicateKeys(): ' + 'Tried to merge two objects with the same key: `%s`. This conflict ' + 'may be due to a mixin; in particular, this may be caused by two ' + 'getInitialState() or getDefaultProps() methods returning objects ' + 'with clashing keys.', key);
3292
+ one[key] = two[key];
3220
3293
  }
3221
3294
  }
3222
-
3223
- var valuesString = JSON.stringify(expectedValues);
3224
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + propValue + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));
3295
+ return one;
3225
3296
  }
3226
- return createChainableTypeChecker(validate);
3227
- }
3228
3297
 
3229
- function createObjectOfTypeChecker(typeChecker) {
3230
- function validate(props, propName, componentName, location, propFullName) {
3231
- if (typeof typeChecker !== 'function') {
3232
- return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');
3233
- }
3234
- var propValue = props[propName];
3235
- var propType = getPropType(propValue);
3236
- if (propType !== 'object') {
3237
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
3238
- }
3239
- for (var key in propValue) {
3240
- if (propValue.hasOwnProperty(key)) {
3241
- var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret_1);
3242
- if (error instanceof Error) {
3243
- return error;
3244
- }
3298
+ /**
3299
+ * Creates a function that invokes two functions and merges their return values.
3300
+ *
3301
+ * @param {function} one Function to invoke first.
3302
+ * @param {function} two Function to invoke second.
3303
+ * @return {function} Function that invokes the two argument functions.
3304
+ * @private
3305
+ */
3306
+ function createMergedResultFunction(one, two) {
3307
+ return function mergedResult() {
3308
+ var a = one.apply(this, arguments);
3309
+ var b = two.apply(this, arguments);
3310
+ if (a == null) {
3311
+ return b;
3312
+ } else if (b == null) {
3313
+ return a;
3245
3314
  }
3246
- }
3247
- return null;
3315
+ var c = {};
3316
+ mergeIntoWithNoDuplicateKeys(c, a);
3317
+ mergeIntoWithNoDuplicateKeys(c, b);
3318
+ return c;
3319
+ };
3248
3320
  }
3249
- return createChainableTypeChecker(validate);
3250
- }
3251
3321
 
3252
- function createUnionTypeChecker(arrayOfTypeCheckers) {
3253
- if (!Array.isArray(arrayOfTypeCheckers)) {
3254
- warning_1(false, 'Invalid argument supplied to oneOfType, expected an instance of array.');
3255
- return emptyFunction_1.thatReturnsNull;
3322
+ /**
3323
+ * Creates a function that invokes two functions and ignores their return vales.
3324
+ *
3325
+ * @param {function} one Function to invoke first.
3326
+ * @param {function} two Function to invoke second.
3327
+ * @return {function} Function that invokes the two argument functions.
3328
+ * @private
3329
+ */
3330
+ function createChainedFunction(one, two) {
3331
+ return function chainedFunction() {
3332
+ one.apply(this, arguments);
3333
+ two.apply(this, arguments);
3334
+ };
3256
3335
  }
3257
3336
 
3258
- function validate(props, propName, componentName, location, propFullName) {
3259
- for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
3260
- var checker = arrayOfTypeCheckers[i];
3261
- if (checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret_1) == null) {
3262
- return null;
3263
- }
3264
- }
3337
+ /**
3338
+ * Binds a method to the component.
3339
+ *
3340
+ * @param {object} component Component whose method is going to be bound.
3341
+ * @param {function} method Method to be bound.
3342
+ * @return {function} The bound method.
3343
+ */
3344
+ function bindAutoBindMethod(component, method) {
3345
+ var boundMethod = method.bind(component);
3346
+ {
3347
+ boundMethod.__reactBoundContext = component;
3348
+ boundMethod.__reactBoundMethod = method;
3349
+ boundMethod.__reactBoundArguments = null;
3350
+ var componentName = component.constructor.displayName;
3351
+ var _bind = boundMethod.bind;
3352
+ boundMethod.bind = function (newThis) {
3353
+ for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
3354
+ args[_key - 1] = arguments[_key];
3355
+ }
3265
3356
 
3266
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.'));
3357
+ // User is trying to bind() an autobound method; we effectively will
3358
+ // ignore the value of "this" that the user is trying to use, so
3359
+ // let's warn.
3360
+ if (newThis !== component && newThis !== null) {
3361
+ warning$4(false, 'bind(): React component methods may only be bound to the ' + 'component instance. See %s', componentName);
3362
+ } else if (!args.length) {
3363
+ warning$4(false, 'bind(): You are binding a component method to the component. ' + 'React does this for you automatically in a high-performance ' + 'way, so you can safely remove this call. See %s', componentName);
3364
+ return boundMethod;
3365
+ }
3366
+ var reboundMethod = _bind.apply(boundMethod, arguments);
3367
+ reboundMethod.__reactBoundContext = component;
3368
+ reboundMethod.__reactBoundMethod = method;
3369
+ reboundMethod.__reactBoundArguments = args;
3370
+ return reboundMethod;
3371
+ };
3372
+ }
3373
+ return boundMethod;
3267
3374
  }
3268
- return createChainableTypeChecker(validate);
3269
- }
3270
3375
 
3271
- function createNodeChecker() {
3272
- function validate(props, propName, componentName, location, propFullName) {
3273
- if (!isNode(props[propName])) {
3274
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));
3376
+ /**
3377
+ * Binds all auto-bound methods in a component.
3378
+ *
3379
+ * @param {object} component Component whose method is going to be bound.
3380
+ */
3381
+ function bindAutoBindMethods(component) {
3382
+ var pairs = component.__reactAutoBindPairs;
3383
+ for (var i = 0; i < pairs.length; i += 2) {
3384
+ var autoBindKey = pairs[i];
3385
+ var method = pairs[i + 1];
3386
+ component[autoBindKey] = bindAutoBindMethod(component, method);
3275
3387
  }
3276
- return null;
3277
3388
  }
3278
- return createChainableTypeChecker(validate);
3279
- }
3280
3389
 
3281
- function createShapeTypeChecker(shapeTypes) {
3282
- function validate(props, propName, componentName, location, propFullName) {
3283
- var propValue = props[propName];
3284
- var propType = getPropType(propValue);
3285
- if (propType !== 'object') {
3286
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
3390
+ var IsMountedMixin = {
3391
+ componentDidMount: function () {
3392
+ this.__isMounted = true;
3393
+ },
3394
+ componentWillUnmount: function () {
3395
+ this.__isMounted = false;
3287
3396
  }
3288
- for (var key in shapeTypes) {
3289
- var checker = shapeTypes[key];
3290
- if (!checker) {
3291
- continue;
3292
- }
3293
- var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret_1);
3294
- if (error) {
3295
- return error;
3397
+ };
3398
+
3399
+ /**
3400
+ * Add more to the ReactClass base class. These are all legacy features and
3401
+ * therefore not already part of the modern ReactComponent.
3402
+ */
3403
+ var ReactClassMixin = {
3404
+
3405
+ /**
3406
+ * TODO: This will be deprecated because state should always keep a consistent
3407
+ * type signature and the only use case for this, is to avoid that.
3408
+ */
3409
+ replaceState: function (newState, callback) {
3410
+ this.updater.enqueueReplaceState(this, newState, callback);
3411
+ },
3412
+
3413
+ /**
3414
+ * Checks whether or not this composite component is mounted.
3415
+ * @return {boolean} True if mounted, false otherwise.
3416
+ * @protected
3417
+ * @final
3418
+ */
3419
+ isMounted: function () {
3420
+ {
3421
+ warning$4(this.__didWarnIsMounted, '%s: isMounted is deprecated. Instead, make sure to clean up ' + 'subscriptions and pending requests in componentWillUnmount to ' + 'prevent memory leaks.', this.constructor && this.constructor.displayName || this.name || 'Component');
3422
+ this.__didWarnIsMounted = true;
3296
3423
  }
3424
+ return !!this.__isMounted;
3297
3425
  }
3298
- return null;
3299
- }
3300
- return createChainableTypeChecker(validate);
3301
- }
3426
+ };
3302
3427
 
3303
- function isNode(propValue) {
3304
- switch (typeof propValue) {
3305
- case 'number':
3306
- case 'string':
3307
- case 'undefined':
3308
- return true;
3309
- case 'boolean':
3310
- return !propValue;
3311
- case 'object':
3312
- if (Array.isArray(propValue)) {
3313
- return propValue.every(isNode);
3428
+ var ReactClassComponent = function () {};
3429
+ index(ReactClassComponent.prototype, ReactComponent.prototype, ReactClassMixin);
3430
+
3431
+ /**
3432
+ * Creates a composite component class given a class specification.
3433
+ * See https://facebook.github.io/react/docs/top-level-api.html#react.createclass
3434
+ *
3435
+ * @param {object} spec Class specification (which must define `render`).
3436
+ * @return {function} Component constructor function.
3437
+ * @public
3438
+ */
3439
+ function createClass(spec) {
3440
+ // To keep our warnings more understandable, we'll use a little hack here to
3441
+ // ensure that Constructor.name !== 'Constructor'. This makes sure we don't
3442
+ // unnecessarily identify a class without displayName as 'Constructor'.
3443
+ var Constructor = identity(function (props, context, updater) {
3444
+ // This constructor gets overridden by mocks. The argument is used
3445
+ // by mocks to assert on what gets mounted.
3446
+
3447
+ {
3448
+ warning$4(this instanceof Constructor, 'Something is calling a React component directly. Use a factory or ' + 'JSX instead. See: https://fb.me/react-legacyfactory');
3314
3449
  }
3315
- if (propValue === null || ReactElement_1.isValidElement(propValue)) {
3316
- return true;
3450
+
3451
+ // Wire up auto-binding
3452
+ if (this.__reactAutoBindPairs.length) {
3453
+ bindAutoBindMethods(this);
3317
3454
  }
3318
3455
 
3319
- var iteratorFn = getIteratorFn_1(propValue);
3320
- if (iteratorFn) {
3321
- var iterator = iteratorFn.call(propValue);
3322
- var step;
3323
- if (iteratorFn !== propValue.entries) {
3324
- while (!(step = iterator.next()).done) {
3325
- if (!isNode(step.value)) {
3326
- return false;
3327
- }
3328
- }
3329
- } else {
3330
- // Iterator will provide entry [k,v] tuples rather than values.
3331
- while (!(step = iterator.next()).done) {
3332
- var entry = step.value;
3333
- if (entry) {
3334
- if (!isNode(entry[1])) {
3335
- return false;
3336
- }
3337
- }
3338
- }
3456
+ this.props = props;
3457
+ this.context = context;
3458
+ this.refs = emptyObject_1;
3459
+ this.updater = updater || ReactNoopUpdateQueue;
3460
+
3461
+ this.state = null;
3462
+
3463
+ // ReactClasses doesn't have constructors. Instead, they use the
3464
+ // getInitialState and componentWillMount methods for initialization.
3465
+
3466
+ var initialState = this.getInitialState ? this.getInitialState() : null;
3467
+ {
3468
+ // We allow auto-mocks to proceed as if they're returning null.
3469
+ if (initialState === undefined && this.getInitialState._isMockFunction) {
3470
+ // This is probably bad practice. Consider warning here and
3471
+ // deprecating this convenience.
3472
+ initialState = null;
3339
3473
  }
3340
- } else {
3341
- return false;
3342
3474
  }
3475
+ invariant_1(typeof initialState === 'object' && !Array.isArray(initialState), '%s.getInitialState(): must return an object or null', Constructor.displayName || 'ReactCompositeComponent');
3343
3476
 
3344
- return true;
3345
- default:
3346
- return false;
3347
- }
3348
- }
3477
+ this.state = initialState;
3478
+ });
3479
+ Constructor.prototype = new ReactClassComponent();
3480
+ Constructor.prototype.constructor = Constructor;
3481
+ Constructor.prototype.__reactAutoBindPairs = [];
3349
3482
 
3350
- function isSymbol(propType, propValue) {
3351
- // Native Symbol.
3352
- if (propType === 'symbol') {
3353
- return true;
3354
- }
3483
+ injectedMixins.forEach(mixSpecIntoComponent.bind(null, Constructor));
3355
3484
 
3356
- // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'
3357
- if (propValue['@@toStringTag'] === 'Symbol') {
3358
- return true;
3359
- }
3485
+ mixSpecIntoComponent(Constructor, IsMountedMixin);
3486
+ mixSpecIntoComponent(Constructor, spec);
3360
3487
 
3361
- // Fallback for non-spec compliant Symbols which are polyfilled.
3362
- if (typeof Symbol === 'function' && propValue instanceof Symbol) {
3363
- return true;
3364
- }
3488
+ // Initialize the defaultProps property after all mixins have been merged.
3489
+ if (Constructor.getDefaultProps) {
3490
+ Constructor.defaultProps = Constructor.getDefaultProps();
3491
+ }
3365
3492
 
3366
- return false;
3367
- }
3493
+ {
3494
+ // This is a tag to indicate that the use of these method names is ok,
3495
+ // since it's used with createClass. If it's not, then it's likely a
3496
+ // mistake so we'll warn you to use the static property, property
3497
+ // initializer or constructor respectively.
3498
+ if (Constructor.getDefaultProps) {
3499
+ Constructor.getDefaultProps.isReactClassApproved = {};
3500
+ }
3501
+ if (Constructor.prototype.getInitialState) {
3502
+ Constructor.prototype.getInitialState.isReactClassApproved = {};
3503
+ }
3504
+ }
3368
3505
 
3369
- // Equivalent of `typeof` but with special handling for array and regexp.
3370
- function getPropType(propValue) {
3371
- var propType = typeof propValue;
3372
- if (Array.isArray(propValue)) {
3373
- return 'array';
3374
- }
3375
- if (propValue instanceof RegExp) {
3376
- // Old webkits (at least until Android 4.0) return 'function' rather than
3377
- // 'object' for typeof a RegExp. We'll normalize this here so that /bla/
3378
- // passes PropTypes.object.
3379
- return 'object';
3380
- }
3381
- if (isSymbol(propType, propValue)) {
3382
- return 'symbol';
3383
- }
3384
- return propType;
3385
- }
3506
+ invariant_1(Constructor.prototype.render, 'createClass(...): Class specification must implement a `render` method.');
3386
3507
 
3387
- // This handles more types than `getPropType`. Only used for error messages.
3388
- // See `createPrimitiveTypeChecker`.
3389
- function getPreciseType(propValue) {
3390
- var propType = getPropType(propValue);
3391
- if (propType === 'object') {
3392
- if (propValue instanceof Date) {
3393
- return 'date';
3394
- } else if (propValue instanceof RegExp) {
3395
- return 'regexp';
3508
+ {
3509
+ warning$4(!Constructor.prototype.componentShouldUpdate, '%s has a method called ' + 'componentShouldUpdate(). Did you mean shouldComponentUpdate()? ' + 'The name is phrased as a question because the function is ' + 'expected to return a value.', spec.displayName || 'A component');
3510
+ warning$4(!Constructor.prototype.componentWillRecieveProps, '%s has a method called ' + 'componentWillRecieveProps(). Did you mean componentWillReceiveProps()?', spec.displayName || 'A component');
3511
+ }
3512
+
3513
+ // Reduce time spent doing lookups by setting these on the prototype.
3514
+ for (var methodName in ReactClassInterface) {
3515
+ if (!Constructor.prototype[methodName]) {
3516
+ Constructor.prototype[methodName] = null;
3517
+ }
3396
3518
  }
3397
- }
3398
- return propType;
3399
- }
3400
3519
 
3401
- // Returns class name of the object, if any.
3402
- function getClassName(propValue) {
3403
- if (!propValue.constructor || !propValue.constructor.name) {
3404
- return ANONYMOUS;
3520
+ return Constructor;
3405
3521
  }
3406
- return propValue.constructor.name;
3522
+
3523
+ return createClass;
3407
3524
  }
3408
3525
 
3409
- var ReactPropTypes_1 = ReactPropTypes;
3526
+ var factory_1$2 = factory$2;
3410
3527
 
3411
- /**
3412
- * Copyright 2013-present, Facebook, Inc.
3413
- * All rights reserved.
3414
- *
3415
- * This source code is licensed under the BSD-style license found in the
3416
- * LICENSE file in the root directory of this source tree. An additional grant
3417
- * of patent rights can be found in the PATENTS file in the same directory.
3418
- *
3419
- * @providesModule ReactVersion
3420
- */
3528
+ var Component = ReactBaseClasses.Component;
3529
+
3530
+ var isValidElement$1 = ReactElement_1.isValidElement;
3421
3531
 
3422
- var ReactVersion = '16.0.0-alpha.7';
3423
3532
 
3424
- /**
3425
- * Returns the first child in a collection of children and verifies that there
3426
- * is only one child in the collection.
3427
- *
3428
- * See https://facebook.github.io/react/docs/react-api.html#react.children.only
3429
- *
3430
- * The current implementation of this function assumes that a single child gets
3431
- * passed without a wrapper, but the purpose of this helper function is to
3432
- * abstract away the particular structure of children.
3433
- *
3434
- * @param {?object} children Child collection structure.
3435
- * @return {ReactElement} The first and only `ReactElement` contained in the
3436
- * structure.
3437
- */
3438
- function onlyChild(children) {
3439
- !ReactElement_1.isValidElement(children) ? invariant_1(false, 'React.Children.only expected to receive a single React element child.') : void 0;
3440
- return children;
3441
- }
3442
3533
 
3443
- var onlyChild_1 = onlyChild;
3534
+
3535
+ var createClass = factory_1$2(Component, isValidElement$1, ReactNoopUpdateQueue_1);
3444
3536
 
3445
3537
  var createElement = ReactElement_1.createElement;
3446
3538
  var createFactory = ReactElement_1.createFactory;
3447
3539
  var cloneElement = ReactElement_1.cloneElement;
3448
3540
 
3449
3541
  {
3542
+ var warning = warning_1;
3543
+ var canDefineProperty = canDefineProperty_1;
3450
3544
  var ReactElementValidator = ReactElementValidator_1;
3451
3545
  createElement = ReactElementValidator.createElement;
3452
3546
  createFactory = ReactElementValidator.createFactory;
@@ -3457,16 +3551,6 @@ var createMixin = function (mixin) {
3457
3551
  return mixin;
3458
3552
  };
3459
3553
 
3460
- {
3461
- var warnedForCreateMixin = false;
3462
-
3463
- createMixin = function (mixin) {
3464
- warning_1(warnedForCreateMixin, 'React.createMixin is deprecated and should not be used. You ' + 'can use this mixin directly instead.');
3465
- warnedForCreateMixin = true;
3466
- return mixin;
3467
- };
3468
- }
3469
-
3470
3554
  var React = {
3471
3555
  // Modern
3472
3556
 
@@ -3485,12 +3569,13 @@ var React = {
3485
3569
  cloneElement: cloneElement,
3486
3570
  isValidElement: ReactElement_1.isValidElement,
3487
3571
 
3572
+ // TODO (bvaughn) Remove these getters before 16.0.0
3573
+ PropTypes: ReactPropTypes,
3488
3574
  checkPropTypes: checkPropTypes_1,
3575
+ createClass: createClass,
3489
3576
 
3490
3577
  // Classic
3491
3578
 
3492
- PropTypes: ReactPropTypes_1,
3493
- createClass: ReactClass_1.createClass,
3494
3579
  createFactory: createFactory,
3495
3580
  createMixin: createMixin,
3496
3581
 
@@ -3498,27 +3583,76 @@ var React = {
3498
3583
  // since they are just generating DOM strings.
3499
3584
  DOM: ReactDOMFactories_1,
3500
3585
 
3501
- version: ReactVersion
3502
- };
3503
-
3504
- var React_1 = React;
3586
+ version: ReactVersion,
3505
3587
 
3506
- // `version` will be added here by the React module.
3507
- var ReactUMDEntry = index({
3508
3588
  __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: {
3509
3589
  ReactCurrentOwner: ReactCurrentOwner_1
3510
3590
  }
3511
- }, React_1);
3591
+ };
3512
3592
 
3513
3593
  {
3514
- index(ReactUMDEntry.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, {
3515
- // ReactComponentTreeHook should not be included in production.
3516
- ReactComponentTreeHook: ReactComponentTreeHook_1
3594
+ index(React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, {
3595
+ // These should not be included in production.
3596
+ ReactComponentTreeHook: ReactComponentTreeHook_1,
3597
+ ReactDebugCurrentFrame: ReactDebugCurrentFrame_1
3598
+ });
3599
+
3600
+ var warnedForCheckPropTypes = false;
3601
+ var warnedForCreateMixin = false;
3602
+ var warnedForCreateClass = false;
3603
+ var warnedForPropTypes = false;
3604
+
3605
+ React.createMixin = function (mixin) {
3606
+ warning(warnedForCreateMixin, 'React.createMixin is deprecated and should not be used. You ' + 'can use this mixin directly instead.');
3607
+ warnedForCreateMixin = true;
3608
+ return mixin;
3609
+ };
3610
+
3611
+ // TODO (bvaughn) Remove all of these accessors before 16.0.0
3612
+ if (canDefineProperty) {
3613
+ Object.defineProperty(React, 'checkPropTypes', {
3614
+ get: function () {
3615
+ warning(warnedForCheckPropTypes, 'checkPropTypes has been moved to a separate package. ' + 'Accessing React.checkPropTypes is no longer supported ' + 'and will be removed completely in React 16. ' + 'Use the prop-types package on npm instead. ' + '(https://fb.me/migrating-from-react-proptypes)');
3616
+ warnedForCheckPropTypes = true;
3617
+ return checkPropTypes_1;
3618
+ }
3619
+ });
3620
+
3621
+ Object.defineProperty(React, 'createClass', {
3622
+ get: function () {
3623
+ warning(warnedForCreateClass, 'React.createClass is no longer supported. Use a plain JavaScript ' + "class instead. If you're not yet ready to migrate, " + 'create-react-class is available on npm as a drop-in replacement. ' + '(https://fb.me/migrating-from-react-create-class)');
3624
+ warnedForCreateClass = true;
3625
+ return createClass;
3626
+ }
3627
+ });
3628
+
3629
+ Object.defineProperty(React, 'PropTypes', {
3630
+ get: function () {
3631
+ warning(warnedForPropTypes, 'PropTypes has been moved to a separate package. ' + 'Accessing React.PropTypes is no longer supported ' + 'and will be removed completely in React 16. ' + 'Use the prop-types package on npm instead. ' + '(https://fb.me/migrating-from-react-proptypes)');
3632
+ warnedForPropTypes = true;
3633
+ return ReactPropTypes;
3634
+ }
3635
+ });
3636
+ }
3637
+
3638
+ // React.DOM factories are deprecated. Wrap these methods so that
3639
+ // invocations of the React.DOM namespace and alert users to switch
3640
+ // to the `react-addons-dom-factories` package.
3641
+ React.DOM = {};
3642
+ var warnedForFactories = false;
3643
+ Object.keys(ReactDOMFactories_1).forEach(function (factory) {
3644
+ React.DOM[factory] = function () {
3645
+ if (!warnedForFactories) {
3646
+ warning(false, 'Accessing factories like React.DOM.%s has been deprecated ' + 'and will be removed in the future. Use the ' + 'react-addons-dom-factories package instead.', factory);
3647
+ warnedForFactories = true;
3648
+ }
3649
+ return ReactDOMFactories_1[factory].apply(ReactDOMFactories_1, arguments);
3650
+ };
3517
3651
  });
3518
3652
  }
3519
3653
 
3520
- var ReactUMDEntry_1 = ReactUMDEntry;
3654
+ var React_1 = React;
3521
3655
 
3522
- return ReactUMDEntry_1;
3656
+ return React_1;
3523
3657
 
3524
3658
  })));