-
Notifications
You must be signed in to change notification settings - Fork 1
/
react-redux.min.js
1 lines (1 loc) · 13.3 KB
/
react-redux.min.js
1
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("redux")):"function"==typeof define&&define.amd?define(["exports","react","redux"],t):t(e.ReactRedux={},e.React,e.Redux)}(this,function(e,g,n){"use strict";function O(e,t){e.prototype=Object.create(t.prototype),(e.prototype.constructor=e).__proto__=t}function t(e,t){return e(t={exports:{}},t.exports),t.exports}function r(e){return function(){return e}}var o=function(){};o.thatReturns=r,o.thatReturnsFalse=r(!1),o.thatReturnsTrue=r(!0),o.thatReturnsNull=r(null),o.thatReturnsThis=function(){return this},o.thatReturnsArgument=function(e){return e};var i=o;var s=function(e,t,n,r,o,i,s,u){if(!e){var a;if(void 0===t)a=Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[n,r,o,i,s,u],p=0;(a=Error(t.replace(/%s/g,function(){return c[p++]}))).name="Invariant Violation"}throw a.framesToPop=1,a}},u=t(function(e){e.exports=function(){function e(e,t,n,r,o,i){"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"!==i&&s(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types")}function t(){return e}var n={array:e.isRequired=e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t};return n.checkPropTypes=i,n.PropTypes=n}()}),C=u.shape({trySubscribe:u.func.isRequired,tryUnsubscribe:u.func.isRequired,notifyNestedSubs:u.func.isRequired,isSubscribed:u.func.isRequired}),w=u.shape({subscribe:u.func.isRequired,dispatch:u.func.isRequired,getState:u.func.isRequired});function a(o){var e;void 0===o&&(o="store");var n=o+"Subscription",t=function(r){O(t,r);var e=t.prototype;function t(e,t){var n;return(n=r.call(this,e,t)||this)[o]=e.store,n}return e.getChildContext=function(){var e;return(e={})[o]=this[o],e[n]=null,e},e.render=function(){return g.Children.only(this.props.children)},t}(g.Component);return t.propTypes={store:w.isRequired,children:u.element.isRequired},t.childContextTypes=((e={})[o]=w.isRequired,e[n]=C,e),t}var c=a();function T(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function x(){return(x=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function E(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)t.indexOf(n=i[r])<0&&(o[n]=e[n]);return o}var p,f=t(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n="function"==typeof Symbol&&Symbol.for,r=n?Symbol.for("react.element"):60103,o=n?Symbol.for("react.portal"):60106,i=n?Symbol.for("react.fragment"):60107,s=n?Symbol.for("react.strict_mode"):60108,u=n?Symbol.for("react.profiler"):60114,a=n?Symbol.for("react.provider"):60109,c=n?Symbol.for("react.context"):60110,p=n?Symbol.for("react.concurrent_mode"):60111,f=n?Symbol.for("react.forward_ref"):60112,d=n?Symbol.for("react.suspense"):60113,l=n?Symbol.for("react.memo"):60115,h=n?Symbol.for("react.lazy"):60116;function y(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:switch(e=e.type){case p:case i:case u:case s:return e;default:switch(e=e&&e.$$typeof){case c:case f:case a:return e;default:return t}}case o:return t}}}function b(e){return y(e)===p}t.typeOf=y,t.AsyncMode=p,t.ConcurrentMode=p,t.ContextConsumer=c,t.ContextProvider=a,t.Element=r,t.ForwardRef=f,t.Fragment=i,t.Profiler=u,t.Portal=o,t.StrictMode=s,t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===i||e===p||e===u||e===s||e===d||"object"==typeof e&&null!==e&&(e.$$typeof===h||e.$$typeof===l||e.$$typeof===a||e.$$typeof===c||e.$$typeof===f)},t.isAsyncMode=function(e){return b(e)},t.isConcurrentMode=b,t.isContextConsumer=function(e){return y(e)===c},t.isContextProvider=function(e){return y(e)===a},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},t.isForwardRef=function(e){return y(e)===f},t.isFragment=function(e){return y(e)===i},t.isProfiler=function(e){return y(e)===u},t.isPortal=function(e){return y(e)===o},t.isStrictMode=function(e){return y(e)===s}});(p=f)&&p.__esModule&&Object.prototype.hasOwnProperty.call(p,"default");var d=t(function(e){e.exports=f}),R=d.isValidElementType,l={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},h={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},y={};y[d.ForwardRef]={$$typeof:!0,render:!0};var b=Object.defineProperty,v=Object.getOwnPropertyNames,m=Object.getOwnPropertySymbols,P=Object.getOwnPropertyDescriptor,S=Object.getPrototypeOf,M=Object.prototype;var q=function e(t,n,r){if("string"==typeof n)return t;if(M){var o=S(n);o&&o!==M&&e(t,o,r)}var i=v(n);m&&(i=i.concat(m(n)));for(var s=y[t.$$typeof]||l,u=y[n.$$typeof]||l,a=0;a<i.length;++a){var c=i[a];if(!(h[c]||r&&r[c]||u&&u[c]||s&&s[c])){var p=P(n,c);try{b(t,c,p)}catch(e){}}}return t},N=function(e,t,n,r,o,i,s,u){if(!e){var a;if(void 0===t)a=Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[n,r,o,i,s,u],p=0;(a=Error(t.replace(/%s/g,function(){return c[p++]}))).name="Invariant Violation"}throw a.framesToPop=1,a}},j={notify:function(){}};var $=function(){function e(e,t,n){this.store=e,this.parentSub=t,this.onStateChange=n,this.unsubscribe=null,this.listeners=j}var t=e.prototype;return t.addNestedSub=function(e){return this.trySubscribe(),this.listeners.subscribe(e)},t.notifyNestedSubs=function(){this.listeners.notify()},t.isSubscribed=function(){return!!this.unsubscribe},t.trySubscribe=function(){var n,r;this.unsubscribe||(this.unsubscribe=this.parentSub?this.parentSub.addNestedSub(this.onStateChange):this.store.subscribe(this.onStateChange),this.listeners=(n=[],r=[],{clear:function(){n=r=null},notify:function(){for(var e=n=r,t=0;t<e.length;t++)e[t]()},get:function(){return r},subscribe:function(e){var t=!0;return r===n&&(r=n.slice()),r.push(e),function(){t&&null!==n&&(t=!1,r===n&&(r=n.slice()),r.splice(r.indexOf(e),1))}}}))},t.tryUnsubscribe=function(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=null,this.listeners.clear(),this.listeners=j)},e}(),_=0,D={};function U(){}function I(s,e){var t,n;void 0===e&&(e={});var r=e.getDisplayName,u=void 0===r?function(e){return"ConnectAdvanced("+e+")"}:r,o=e.methodName,a=void 0===o?"connectAdvanced":o,i=e.renderCountProp,c=void 0===i?void 0:i,p=e.shouldHandleStateChanges,f=void 0===p||p,d=e.storeKey,l=void 0===d?"store":d,h=e.withRef,y=void 0!==h&&h,b=E(e,["getDisplayName","methodName","renderCountProp","shouldHandleStateChanges","storeKey","withRef"]),v=l+"Subscription",m=_++,P=((t={})[l]=w,t[v]=C,t),S=((n={})[v]=C,n);return function(n){N(R(n),"You must pass a component to the function returned by "+a+". Instead received "+JSON.stringify(n));var e=n.displayName||n.name||"Component",o=u(e),i=x({},b,{getDisplayName:u,methodName:a,renderCountProp:c,shouldHandleStateChanges:f,storeKey:l,withRef:y,displayName:o,wrappedComponentName:e,WrappedComponent:n}),t=function(r){function e(e,t){var n;return(n=r.call(this,e,t)||this).version=m,n.state={},n.renderCount=0,n.store=e[l]||t[l],n.propsMode=!!e[l],n.setWrappedInstance=n.setWrappedInstance.bind(T(T(n))),N(n.store,'Could not find "'+l+'" in either the context or props of "'+o+'". Either wrap the root component in a <Provider>, or explicitly pass "'+l+'" as a prop to "'+o+'".'),n.initSelector(),n.initSubscription(),n}O(e,r);var t=e.prototype;return t.getChildContext=function(){var e;return(e={})[v]=(this.propsMode?null:this.subscription)||this.context[v],e},t.componentDidMount=function(){f&&(this.subscription.trySubscribe(),this.selector.run(this.props),this.selector.shouldComponentUpdate&&this.forceUpdate())},t.componentWillReceiveProps=function(e){this.selector.run(e)},t.shouldComponentUpdate=function(){return this.selector.shouldComponentUpdate},t.componentWillUnmount=function(){this.subscription&&this.subscription.tryUnsubscribe(),this.subscription=null,this.notifyNestedSubs=U,this.store=null,this.selector.run=U,this.selector.shouldComponentUpdate=!1},t.getWrappedInstance=function(){return N(y,"To access the wrapped instance, you need to specify { withRef: true } in the options argument of the "+a+"() call."),this.wrappedInstance},t.setWrappedInstance=function(e){this.wrappedInstance=e},t.initSelector=function(){var n,r,o,e=s(this.store.dispatch,i);this.selector=(n=e,r=this.store,o={run:function(e){try{var t=n(r.getState(),e);(t!==o.props||o.error)&&(o.shouldComponentUpdate=!0,o.props=t,o.error=null)}catch(e){o.shouldComponentUpdate=!0,o.error=e}}}),this.selector.run(this.props)},t.initSubscription=function(){f&&(this.subscription=new $(this.store,(this.propsMode?this.props:this.context)[v],this.onStateChange.bind(this)),this.notifyNestedSubs=this.subscription.notifyNestedSubs.bind(this.subscription))},t.onStateChange=function(){this.selector.run(this.props),this.selector.shouldComponentUpdate?(this.componentDidUpdate=this.notifyNestedSubsOnComponentDidUpdate,this.setState(D)):this.notifyNestedSubs()},t.notifyNestedSubsOnComponentDidUpdate=function(){this.componentDidUpdate=void 0,this.notifyNestedSubs()},t.isSubscribed=function(){return!!this.subscription&&this.subscription.isSubscribed()},t.addExtraProps=function(e){if(!(y||c||this.propsMode&&this.subscription))return e;var t=x({},e);return y&&(t.ref=this.setWrappedInstance),c&&(t[c]=this.renderCount++),this.propsMode&&this.subscription&&(t[v]=this.subscription),t},t.render=function(){var e=this.selector;if(e.shouldComponentUpdate=!1,e.error)throw e.error;return g.createElement(n,this.addExtraProps(e.props))},e}(g.Component);return t.WrappedComponent=n,t.displayName=o,t.childContextTypes=S,t.contextTypes=P,t.propTypes=P,q(t,n)}}var F=Object.prototype.hasOwnProperty;function W(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!=e&&t!=t}function A(e,t){if(W(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(var r=0;r<n.length;r++)if(!F.call(t,n[r])||!W(e[n[r]],t[n[r]]))return!1;return!0}function k(o){return function(e,t){var n=o(e,t);function r(){return n}return r.dependsOnOwnProps=!1,r}}function H(e){return null!=e.dependsOnOwnProps?!!e.dependsOnOwnProps:1!==e.length}function V(o,e){return function(e,t){var r=function(e,t){return r.dependsOnOwnProps?r.mapToProps(e,t):r.mapToProps(e)};return r.dependsOnOwnProps=!0,r.mapToProps=function(e,t){r.mapToProps=o,r.dependsOnOwnProps=H(o);var n=r(e,t);return"function"==typeof n&&(r.mapToProps=n,r.dependsOnOwnProps=H(n),n=r(e,t)),n},r}}function K(e,t,n){return x({},n,e,t)}function L(n,r,o,i){return function(e,t){return o(n(e,t),r(i,t),t)}}function Y(s,u,a,c,e){var p,f,d,l,h,y=e.areStatesEqual,b=e.areOwnPropsEqual,v=e.areStatePropsEqual,n=!1;function r(e,t){var n,r,o=!b(t,f),i=!y(e,p);return p=e,f=t,o&&i?(d=s(p,f),u.dependsOnOwnProps&&(l=u(c,f)),h=a(d,l,f)):o?(s.dependsOnOwnProps&&(d=s(p,f)),u.dependsOnOwnProps&&(l=u(c,f)),h=a(d,l,f)):(i&&(n=s(p,f),r=!v(n,d),d=n,r&&(h=a(d,l,f))),h)}return function(e,t){return n?r(e,t):(d=s(p=e,f=t),l=u(c,f),h=a(d,l,f),n=!0,h)}}function z(e,t){var n=t.initMapStateToProps,r=t.initMapDispatchToProps,o=t.initMergeProps,i=E(t,["initMapStateToProps","initMapDispatchToProps","initMergeProps"]),s=n(e,i),u=r(e,i),a=o(e,i);return(i.pure?Y:L)(s,u,a,e,i)}function B(n,e,r){for(var t=e.length-1;0<=t;t--){var o=e[t](n);if(o)return o}return function(e,t){throw Error("Invalid value of type "+typeof n+" for "+r+" argument when connecting component "+t.wrappedComponentName+".")}}function J(e,t){return e===t}var G,Q,X,Z,ee,te,ne,re,oe,ie,se,ue,ae=(Z=void 0===(X=(Q=void 0===G?{}:G).connectHOC)?I:X,te=void 0===(ee=Q.mapStateToPropsFactories)?[function(e){return"function"==typeof e?V(e):void 0},function(e){return e?void 0:k(function(){return{}})}]:ee,re=void 0===(ne=Q.mapDispatchToPropsFactories)?[function(e){return"function"==typeof e?V(e):void 0},function(e){return e?void 0:k(function(e){return{dispatch:e}})},function(t){return t&&"object"==typeof t?k(function(e){return n.bindActionCreators(t,e)}):void 0}]:ne,ie=void 0===(oe=Q.mergePropsFactories)?[function(e){return"function"==typeof e?(a=e,function(e,t){var o,i=t.pure,s=t.areMergedPropsEqual,u=!1;return function(e,t,n){var r=a(e,t,n);return u?i&&s(r,o)||(o=r):(u=!0,o=r),o}}):void 0;var a},function(e){return e?void 0:function(){return K}}]:oe,ue=void 0===(se=Q.selectorFactory)?z:se,function(e,t,n,r){void 0===r&&(r={});var o=r.pure,i=void 0===o||o,s=r.areStatesEqual,u=void 0===s?J:s,a=r.areOwnPropsEqual,c=void 0===a?A:a,p=r.areStatePropsEqual,f=void 0===p?A:p,d=r.areMergedPropsEqual,l=void 0===d?A:d,h=E(r,["pure","areStatesEqual","areOwnPropsEqual","areStatePropsEqual","areMergedPropsEqual"]),y=B(e,te,"mapStateToProps"),b=B(t,re,"mapDispatchToProps"),v=B(n,ie,"mergeProps");return Z(ue,x({methodName:"connect",getDisplayName:function(e){return"Connect("+e+")"},shouldHandleStateChanges:!!e,initMapStateToProps:y,initMapDispatchToProps:b,initMergeProps:v,pure:i,areStatesEqual:u,areOwnPropsEqual:c,areStatePropsEqual:f,areMergedPropsEqual:l},h))});e.Provider=c,e.createProvider=a,e.connectAdvanced=I,e.connect=ae,Object.defineProperty(e,"__esModule",{value:!0})});