This repository has been archived by the owner on Nov 9, 2017. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 45
/
Copy pathreact-dom-unstable-native-dependencies.production.min.js
30 lines (30 loc) · 11.1 KB
/
react-dom-unstable-native-dependencies.production.min.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/** @license React v16.1.0
* react-dom-unstable-native-dependencies.production.min.js
*
* Copyright (c) 2013-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
'use strict';(function(C,l){"object"===typeof exports&&"undefined"!==typeof module?module.exports=l(require("react-dom"),require("react")):"function"===typeof define&&define.amd?define(["react-dom","react"],l):C.ReactDOMUnstableNativeDependencies=l(C.ReactDOM,C.React)})(this,function(C,l){function z(a){for(var b=arguments.length-1,c="Minified React error #"+a+"; visit http://facebook.github.io/react/docs/error-decoder.html?invariant\x3d"+a,f=0;f<b;f++)c+="\x26args[]\x3d"+encodeURIComponent(arguments[f+
1]);b=Error(c+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings.");b.name="Invariant Violation";b.framesToPop=1;throw b;}function F(a){return function(){return a}}function G(a){return"topMouseUp"===a||"topTouchEnd"===a||"topTouchCancel"===a}function H(a){return"topMouseMove"===a||"topTouchMove"===a}function D(a){return"topMouseDown"===a||"topTouchStart"===a}function N(a){var b=a._dispatchListeners,c=a._dispatchInstances;Array.isArray(b)?
z("103"):void 0;a.currentTarget=b?O(c):null;b=b?b(a):null;a.currentTarget=null;a._dispatchListeners=null;a._dispatchInstances=null;return b}function t(a){do a=a["return"];while(a&&5!==a.tag);return a?a:null}function P(a,b,c){for(var f=[];a;)f.push(a),a=t(a);for(a=f.length;0<a--;)b(f[a],"captured",c);for(a=0;a<f.length;a++)b(f[a],"bubbled",c)}function I(a,b){null==b?z("30"):void 0;if(null==a)return b;if(Array.isArray(a)){if(Array.isArray(b))return a.push.apply(a,b),a;a.push(b);return a}return Array.isArray(b)?
[a].concat(b):[a,b]}function u(a,b,c){Array.isArray(a)?a.forEach(b,c):a&&b.call(c,a)}function Q(a,b){var c=a.stateNode;if(!c)return null;var f=R(c);if(!f)return null;c=f[b];a:switch(b){case "onClick":case "onClickCapture":case "onDoubleClick":case "onDoubleClickCapture":case "onMouseDown":case "onMouseDownCapture":case "onMouseMove":case "onMouseMoveCapture":case "onMouseUp":case "onMouseUpCapture":(f=!f.disabled)||(a=a.type,f=!("button"===a||"input"===a||"select"===a||"textarea"===a));a=!f;break a;
default:a=!1}if(a)return null;c&&"function"!==typeof c?z("231",b,typeof c):void 0;return c}function S(a,b,c){if(b=Q(a,c.dispatchConfig.phasedRegistrationNames[b]))c._dispatchListeners=I(c._dispatchListeners,b),c._dispatchInstances=I(c._dispatchInstances,a)}function Z(a){a&&a.dispatchConfig.phasedRegistrationNames&&P(a._targetInst,S,a)}function aa(a){if(a&&a.dispatchConfig.phasedRegistrationNames){var b=a._targetInst;b=b?t(b):null;P(b,S,a)}}function A(a){if(a&&a.dispatchConfig.registrationName){var b=
a._targetInst;if(b&&a&&a.dispatchConfig.registrationName){var c=Q(b,a.dispatchConfig.registrationName);c&&(a._dispatchListeners=I(a._dispatchListeners,c),a._dispatchInstances=I(a._dispatchInstances,b))}}}function B(a,b,c,f){this.dispatchConfig=a;this._targetInst=b;this.nativeEvent=c;a=this.constructor.Interface;for(var d in a)a.hasOwnProperty(d)&&((b=a[d])?this[d]=b(c):"target"===d?this.target=f:this[d]=c[d]);this.isDefaultPrevented=(null!=c.defaultPrevented?c.defaultPrevented:!1===c.returnValue)?
v.thatReturnsTrue:v.thatReturnsFalse;this.isPropagationStopped=v.thatReturnsFalse;return this}function ba(a,b,c,f){if(this.eventPool.length){var d=this.eventPool.pop();this.call(d,a,b,c,f);return d}return new this(a,b,c,f)}function ca(a){a instanceof this?void 0:z("223");a.destructor();10>this.eventPool.length&&this.eventPool.push(a)}function T(a){a.eventPool=[];a.getPooled=ba;a.release=ca}function w(a,b,c,f){return B.call(this,a,b,c,f)}function h(a){return a.timeStamp||a.timestamp}function K(a){a=
a.identifier;null==a?z("138"):void 0;return a}function da(a){var b=K(a),c=p[b];c?(c.touchActive=!0,c.startPageX=a.pageX,c.startPageY=a.pageY,c.startTimeStamp=h(a),c.currentPageX=a.pageX,c.currentPageY=a.pageY,c.currentTimeStamp=h(a),c.previousPageX=a.pageX,c.previousPageY=a.pageY,c.previousTimeStamp=h(a)):(c={touchActive:!0,startPageX:a.pageX,startPageY:a.pageY,startTimeStamp:h(a),currentPageX:a.pageX,currentPageY:a.pageY,currentTimeStamp:h(a),previousPageX:a.pageX,previousPageY:a.pageY,previousTimeStamp:h(a)},
p[b]=c);q.mostRecentTimeStamp=h(a)}function ea(a){var b=p[K(a)];b?(b.touchActive=!0,b.previousPageX=b.currentPageX,b.previousPageY=b.currentPageY,b.previousTimeStamp=b.currentTimeStamp,b.currentPageX=a.pageX,b.currentPageY=a.pageY,b.currentTimeStamp=h(a),q.mostRecentTimeStamp=h(a)):console.error("Cannot record touch move without a touch start.\nTouch Move: %s\n","Touch Bank: %s",U(a),V())}function fa(a){var b=p[K(a)];b?(b.touchActive=!1,b.previousPageX=b.currentPageX,b.previousPageY=b.currentPageY,
b.previousTimeStamp=b.currentTimeStamp,b.currentPageX=a.pageX,b.currentPageY=a.pageY,b.currentTimeStamp=h(a),q.mostRecentTimeStamp=h(a)):console.error("Cannot record touch end without a touch start.\nTouch End: %s\n","Touch Bank: %s",U(a),V())}function U(a){return JSON.stringify({identifier:a.identifier,pageX:a.pageX,pageY:a.pageY,timestamp:h(a)})}function V(){var a=JSON.stringify(p.slice(0,20));20<p.length&&(a+=" (original size: "+p.length+")");return a}function E(a,b){null==b?z("29"):void 0;return null==
a?b:Array.isArray(a)?a.concat(b):Array.isArray(b)?[a].concat(b):[a,b]}var x=function(){};x.thatReturns=F;x.thatReturnsFalse=F(!1);x.thatReturnsTrue=F(!0);x.thatReturnsNull=F(null);x.thatReturnsThis=function(){return this};x.thatReturnsArgument=function(a){return a};var v=x,R=null,W=null,O=null,L=l.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.assign,X="dispatchConfig _targetInst nativeEvent isDefaultPrevented isPropagationStopped _dispatchListeners _dispatchInstances".split(" ");l={type:null,
target:null,currentTarget:v.thatReturnsNull,eventPhase:null,bubbles:null,cancelable:null,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:null,isTrusted:null};L(B.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():"unknown"!==typeof a.returnValue&&(a.returnValue=!1),this.isDefaultPrevented=v.thatReturnsTrue)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():"unknown"!==
typeof a.cancelBubble&&(a.cancelBubble=!0),this.isPropagationStopped=v.thatReturnsTrue)},persist:function(){this.isPersistent=v.thatReturnsTrue},isPersistent:v.thatReturnsFalse,destructor:function(){var a=this.constructor.Interface,b;for(b in a)this[b]=null;for(a=0;a<X.length;a++)this[X[a]]=null}});B.Interface=l;B.augmentClass=function(a,b){var c=function(){};c.prototype=this.prototype;c=new c;L(c,a.prototype);a.prototype=c;a.prototype.constructor=a;a.Interface=L({},this.Interface,b);a.augmentClass=
this.augmentClass;T(a)};T(B);B.augmentClass(w,{touchHistory:function(a){return null}});var p=[],q={touchBank:p,numberActiveTouches:0,indexOfSingleActiveTouch:-1,mostRecentTimeStamp:0},r={recordTouchTrack:function(a,b){if(H(a))b.changedTouches.forEach(ea);else if(D(a))b.changedTouches.forEach(da),q.numberActiveTouches=b.touches.length,1===q.numberActiveTouches&&(q.indexOfSingleActiveTouch=b.touches[0].identifier);else if(G(a)&&(b.changedTouches.forEach(fa),q.numberActiveTouches=b.touches.length,1===
q.numberActiveTouches))for(a=0;a<p.length;a++)if(b=p[a],null!=b&&b.touchActive){q.indexOfSingleActiveTouch=a;break}},touchHistory:q},k=null,J=0,Y=0,M=function(a,b){var c=k;k=a;if(null!==y.GlobalResponderHandler)y.GlobalResponderHandler.onChange(c,a,b)},m={startShouldSetResponder:{phasedRegistrationNames:{bubbled:"onStartShouldSetResponder",captured:"onStartShouldSetResponderCapture"}},scrollShouldSetResponder:{phasedRegistrationNames:{bubbled:"onScrollShouldSetResponder",captured:"onScrollShouldSetResponderCapture"}},
selectionChangeShouldSetResponder:{phasedRegistrationNames:{bubbled:"onSelectionChangeShouldSetResponder",captured:"onSelectionChangeShouldSetResponderCapture"}},moveShouldSetResponder:{phasedRegistrationNames:{bubbled:"onMoveShouldSetResponder",captured:"onMoveShouldSetResponderCapture"}},responderStart:{registrationName:"onResponderStart"},responderMove:{registrationName:"onResponderMove"},responderEnd:{registrationName:"onResponderEnd"},responderRelease:{registrationName:"onResponderRelease"},
responderTerminationRequest:{registrationName:"onResponderTerminationRequest"},responderGrant:{registrationName:"onResponderGrant"},responderReject:{registrationName:"onResponderReject"},responderTerminate:{registrationName:"onResponderTerminate"}},y={_getResponder:function(){return k},eventTypes:m,extractEvents:function(a,b,c,f){if(D(a))J+=1;else if(G(a))if(0<=J)--J;else return console.error("Ended a touch event which was not counted in `trackedTouchCount`."),null;r.recordTouchTrack(a,c);if(b&&("topScroll"===
a&&!c.responderIgnoreScroll||0<J&&"topSelectionChange"===a||D(a)||H(a))){var d=D(a)?m.startShouldSetResponder:H(a)?m.moveShouldSetResponder:"topSelectionChange"===a?m.selectionChangeShouldSetResponder:m.scrollShouldSetResponder;if(k)b:{var e=k;for(var g=0,h=e;h;h=t(h))g++;h=0;for(var l=b;l;l=t(l))h++;for(;0<g-h;)e=t(e),g--;for(;0<h-g;)b=t(b),h--;for(;g--;){if(e===b||e===b.alternate)break b;e=t(e);b=t(b)}e=null}else e=b;b=e===k;e=w.getPooled(d,e,c,f);e.touchHistory=r.touchHistory;b?u(e,aa):u(e,Z);
b:{d=e._dispatchListeners;b=e._dispatchInstances;if(Array.isArray(d))for(g=0;g<d.length&&!e.isPropagationStopped();g++){if(d[g](e,b[g])){d=b[g];break b}}else if(d&&d(e,b)){d=b;break b}d=null}e._dispatchInstances=null;e._dispatchListeners=null;e.isPersistent()||e.constructor.release(e);if(d&&d!==k)if(e=w.getPooled(m.responderGrant,d,c,f),e.touchHistory=r.touchHistory,u(e,A),b=!0===N(e),k)if(g=w.getPooled(m.responderTerminationRequest,k,c,f),g.touchHistory=r.touchHistory,u(g,A),h=!g._dispatchListeners||
N(g),g.isPersistent()||g.constructor.release(g),h){g=w.getPooled(m.responderTerminate,k,c,f);g.touchHistory=r.touchHistory;u(g,A);var n=E(n,[e,g]);M(d,b)}else d=w.getPooled(m.responderReject,d,c,f),d.touchHistory=r.touchHistory,u(d,A),n=E(n,d);else n=E(n,e),M(d,b);else n=null}else n=null;d=k&&D(a);e=k&&H(a);b=k&&G(a);if(d=d?m.responderStart:e?m.responderMove:b?m.responderEnd:null)d=w.getPooled(d,k,c,f),d.touchHistory=r.touchHistory,u(d,A),n=E(n,d);d=k&&"topTouchCancel"===a;if(a=k&&!d&&G(a))a:{if((a=
c.touches)&&0!==a.length)for(e=0;e<a.length;e++)if(b=a[e].target,null!==b&&void 0!==b&&0!==b){g=W(b);b:{for(b=k;g;){if(b===g||b===g.alternate){b=!0;break b}g=t(g)}b=!1}if(b){a=!1;break a}}a=!0}if(a=d?m.responderTerminate:a?m.responderRelease:null)c=w.getPooled(a,k,c,f),c.touchHistory=r.touchHistory,u(c,A),n=E(n,c),M(null);c=r.touchHistory.numberActiveTouches;if(y.GlobalInteractionHandler&&c!==Y)y.GlobalInteractionHandler.onChange(c);Y=c;return n},GlobalResponderHandler:null,GlobalInteractionHandler:null,
injection:{injectGlobalResponderHandler:function(a){y.GlobalResponderHandler=a},injectGlobalInteractionHandler:function(a){y.GlobalInteractionHandler=a}}};l=function(a){R=a.getFiberCurrentPropsFromNode;W=a.getInstanceFromNode;O=a.getNodeFromInstance};l(C.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactDOMComponentTree);return Object.freeze({injectComponentTree:l,ResponderEventPlugin:y,ResponderTouchHistoryStore:r})});