@welldone-software/why-did-you-render
Advanced tools
Comparing version 2.5.0 to 2.5.1
/** | ||
* @welldone-software/why-did-you-render 2.5.0 | ||
* @welldone-software/why-did-you-render 2.5.1 | ||
* MIT Licensed | ||
* Generated by Vitali Zaidman <vzaidman@gmail.com> (https://github.com/vzaidman) | ||
* Generated at 2019-01-19 | ||
* Generated at 2019-02-12 | ||
*/ | ||
@@ -562,11 +562,13 @@ | ||
function patchFunctionalComponent(FunctionalComponent, displayName, React, options) { | ||
var _prevProps = undefined; | ||
function WDYRFunctionalComponent(nextProps) { | ||
var prevCountRef = React.useRef(); | ||
var prevProps = prevCountRef.current; | ||
prevCountRef.current = nextProps; | ||
function WDYRFunctionalComponent(props) { | ||
if (_prevProps) { | ||
if (prevProps) { | ||
options.notifier(getUpdateInfo({ | ||
Component: FunctionalComponent, | ||
displayName: displayName, | ||
prevProps: _prevProps, | ||
nextProps: props, | ||
prevProps: prevProps, | ||
nextProps: nextProps, | ||
options: options | ||
@@ -576,4 +578,3 @@ })); | ||
_prevProps = props; | ||
return FunctionalComponent(props); | ||
return FunctionalComponent(nextProps); | ||
} | ||
@@ -580,0 +581,0 @@ |
/** | ||
* @welldone-software/why-did-you-render 2.5.0 | ||
* @welldone-software/why-did-you-render 2.5.1 | ||
* MIT Licensed | ||
* Generated by Vitali Zaidman <vzaidman@gmail.com> (https://github.com/vzaidman) | ||
* Generated at 2019-01-19 | ||
* Generated at 2019-02-12 | ||
*/ | ||
"use strict";function _interopDefault(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var _isString=_interopDefault(require("lodash/isString")),_reduce=_interopDefault(require("lodash/reduce")),_keys=_interopDefault(require("lodash/keys")),_has=_interopDefault(require("lodash/has")),_isFunction=_interopDefault(require("lodash/isFunction")),_isRegExp=_interopDefault(require("lodash/isRegExp")),_isDate=_interopDefault(require("lodash/isDate")),_isPlainObject=_interopDefault(require("lodash/isPlainObject")),_isArray=_interopDefault(require("lodash/isArray"));function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function _createClass(e,t,r){return t&&_defineProperties(e.prototype,t),r&&_defineProperties(e,r),e}function _defineProperty(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){_defineProperty(e,t,r[t])})}return e}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&_setPrototypeOf(e,t)}function _getPrototypeOf(e){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function _setPrototypeOf(e,t){return(_setPrototypeOf=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _possibleConstructorReturn(e,t){return!t||"object"!=typeof t&&"function"!=typeof t?_assertThisInitialized(e):t}function _superPropBase(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=_getPrototypeOf(e)););return e}function _get(e,t,r){return(_get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=_superPropBase(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(r):o.value}})(e,t,r||e)}function _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_nonIterableSpread()}function _arrayWithoutHoles(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t<e.length;t++)r[t]=e[t];return r}}function _iterableToArray(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance")}var _diffTypesDescription,diffTypes={different:"different",deepEquals:"deepEquals",date:"date",regex:"regex",reactElement:"reactElement",function:"function"},moreInfoUrl="http://bit.ly/wdyr02",diffTypesDescriptions=(_defineProperty(_diffTypesDescription={},diffTypes.different,"different objects."),_defineProperty(_diffTypesDescription,diffTypes.deepEquals,"different objects that are equal by value."),_defineProperty(_diffTypesDescription,diffTypes.date,"different date objects with the same value."),_defineProperty(_diffTypesDescription,diffTypes.regex,"different regular expressions with the same value."),_defineProperty(_diffTypesDescription,diffTypes.reactElement,"different React elements with the same displayName."),_defineProperty(_diffTypesDescription,diffTypes.function,"different functions with the same name."),_diffTypesDescription),inHotReload=!1;function shouldLog(e,t,r){return!inHotReload&&(!!r.logOnDifferentValues||(!(!t.whyDidYouRender||!t.whyDidYouRender.logOnDifferentValues)||!(e.propsDifferences&&e.propsDifferences.some(function(e){return e.diffType===diffTypes.different})||e.stateDifferences&&e.stateDifferences.some(function(e){return e.diffType===diffTypes.different}))))}function logDifference(e,t,r,n,o,i,f){o&&o.length>0?(f.consoleLog(_defineProperty({},t,e),"".concat(r," of ").concat(n," changes:")),o.forEach(function(e){var t=e.pathString,r=e.diffType,o=e.prevValue,i=e.nextValue;f.consoleGroup("%c".concat(n,".%c").concat(t,"%c"),"color:blue;","color:red;","color:black;"),f.consoleLog("".concat(diffTypesDescriptions[r]," (more info at ").concat(moreInfoUrl,")")),f.consoleLog(_defineProperty({},"prev ".concat(t),o),"!==",_defineProperty({},"next ".concat(t),i)),f.consoleGroupEnd()})):o&&(f.consoleLog(_defineProperty({},t,e),"".concat(r," the ").concat(n," object itself changed but it's values are all equal."),"props"===n?"This could of been avoided by making the component pure, or by preventing it's father from re-rendering.":"This usually means this component called setState when no changes in it's state actually occurred.","more info at ".concat(moreInfoUrl)),f.consoleLog("prev ".concat(n,":"),i.prev," !== ",i.next,":next ".concat(n)))}function defaultNotifier(e){var t=e.Component,r=e.displayName,n=e.prevProps,o=e.prevState,i=e.nextProps,f=e.nextState,a=e.reason,s=e.options;if(shouldLog(a,t,s)){s.consoleGroup("%c".concat(r),"color: #058;");var c="Re-rendered because";a.propsDifferences&&(logDifference(t,r,c,"props",a.propsDifferences,{prev:n,next:i},s),c="And because"),a.stateDifferences&&logDifference(t,r,c,"state",a.stateDifferences,{prev:o,next:f},s),a.propsDifferences||a.stateDifferences||s.consoleLog(_defineProperty({},r,t),"Re-rendered although props and state objects are the same.","This usually means there was a call to this.forceUpdate() inside the component.","more info at ".concat(moreInfoUrl)),s.consoleGroupEnd()}}function createDefaultNotifier(e){return e&&module&&module.hot&&module.hot.addStatusHandler&&module.hot.addStatusHandler(function(t){"idle"===t&&(inHotReload=!0,setTimeout(function(){inHotReload=!1},e))}),defaultNotifier}var emptyFn=function(){};function normalizeOptions(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=console.group,r=console.groupEnd;return e.collapseGroups?t=console.groupCollapsed:e.onlyLogs&&(t=console.log,r=emptyFn),_objectSpread({include:null,exclude:null,notifier:e.notifier||createDefaultNotifier(e.hasOwnProperty("hotReloadBufferMs")?e.hotReloadBufferMs:500),onlyLogs:!1,consoleLog:console.log,consoleGroup:t,consoleGroupEnd:r,logOnDifferentValues:!1},e)}function getDisplayName(e){return e.displayName||e.name||(_isString(e)?e:void 0)}var hasElementType="undefined"!=typeof Element,hasSymbol="function"==typeof Symbol&&Symbol.for,REACT_ELEMENT_TYPE$1=hasSymbol?Symbol.for("react.element"):60103,isReactElement=function(e){return e.$$typeof===REACT_ELEMENT_TYPE$1};function trackDiff(e,t,r,n,o){return r.push({diffType:o,pathString:n,prevValue:e,nextValue:t}),o!==diffTypes.different}function accumulateDeepEqualDiffs(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";if(e===t)return!0;if(!e||!t)return trackDiff(e,t,r,n,diffTypes.different);if(_isArray(e)&&_isArray(t)){var o=e.length;if(o!==t.length)return trackDiff(e,t,r,n,diffTypes.different);for(var i=!0,f=o;0!=f--;)accumulateDeepEqualDiffs(e[f],t[f],r,"".concat(n,"[").concat(f,"]"))||(i=!1);return trackDiff(e,t,r,n,i?diffTypes.deepEquals:diffTypes.different)}if(_isDate(e)&&_isDate(t))return e.getTime()===t.getTime()?trackDiff(e,t,r,n,diffTypes.date):trackDiff(e,t,r,n,diffTypes.different);if(_isRegExp(e)&&_isRegExp(t))return e.toString()===t.toString()?trackDiff(e,t,r,n,diffTypes.regex):trackDiff(e,t,r,n,diffTypes.different);if(hasElementType&&e instanceof Element&&t instanceof Element)return trackDiff(e,t,r,n,diffTypes.different);if(isReactElement(e)&&isReactElement(t))return e.type===t.type?trackDiff(e,t,r,n,diffTypes.reactElement):trackDiff(e,t,r,n,diffTypes.different);if(_isFunction(e)&&_isFunction(t))return e.name===t.name?trackDiff(e,t,r,n,diffTypes.function):trackDiff(e,t,r,n,diffTypes.different);if(_isPlainObject(e)&&_isPlainObject(t)){var a=_keys(e),s=a.length;if(s!==_keys(t).length)return trackDiff(e,t,r,n,diffTypes.different);for(var c=s;0!=c--;)if(!_has(t,a[c]))return trackDiff(e,t,r,n,diffTypes.different);for(var p=!0,u=s;0!=u--;){var l=a[u];accumulateDeepEqualDiffs(e[l],t[l],r,"".concat(n,".").concat(l))||(p=!1)}return trackDiff(e,t,r,n,p?diffTypes.deepEquals:diffTypes.different)}return trackDiff(e,t,r,n,diffTypes.different)}function calculateDeepEqualDiffs(e,t,r){try{var n=[];return accumulateDeepEqualDiffs(e,t,n,r),n}catch(e){if(e.message&&e.message.match(/stack|recursion/i)||-2146828260===e.number)return console.warn("Warning: why-did-you-render couldn't handle circular references in props.",e.name,e.message),!1;throw e}}var emptyObject={};function findObjectsDifferences(e,t){if(e===t)return!1;var r=e||emptyObject,n=t||emptyObject,o=_keys(_objectSpread({},r,n));return _reduce(o,function(e,t){var o=calculateDeepEqualDiffs(r[t],n[t],t);return o&&(e=[].concat(_toConsumableArray(e||[]),_toConsumableArray(o))),e},[])}function getUpdateReason(e,t,r,n){return{propsDifferences:findObjectsDifferences(e,r,"props"),stateDifferences:findObjectsDifferences(t,n,"state")}}function getUpdateInfo(e){var t=e.Component,r=e.displayName,n=e.prevProps,o=e.prevState,i=e.nextProps,f=e.nextState;return{Component:t,displayName:r,prevProps:n,prevState:o,nextProps:i,nextState:f,options:e.options,reason:getUpdateReason(n,o,i,f)}}function shouldInclude(e,t){return t.include&&t.include.length>0&&t.include.some(function(t){return t.test(e)})}function shouldExclude(e,t){return t.exclude&&t.exclude.length>0&&t.exclude.some(function(t){return t.test(e)})}function shouldTrack(e,t,r){return!shouldExclude(t,r)&&!(!e.whyDidYouRender&&!shouldInclude(t,r))}function patchClassComponent(e,t,r,n){var o=function(r){function o(t,r){var n;if(_classCallCheck(this,o),(n=_possibleConstructorReturn(this,_getPrototypeOf(o).call(this,t,r))).render&&!e.prototype.render){var i=n.render;n.render=function(){return o.prototype.render.apply(_assertThisInitialized(_assertThisInitialized(n))),i()}}return n}return _inherits(o,e),_createClass(o,[{key:"render",value:function(){return this._prevProps&&n.notifier(getUpdateInfo({Component:e,displayName:t,prevProps:this._prevProps,prevState:this._prevState,nextProps:this.props,nextState:this.state,options:n})),this._prevProps=this.props,this._prevState=this.state,_get(_getPrototypeOf(o.prototype),"render",this)&&_get(_getPrototypeOf(o.prototype),"render",this).call(this)}}]),o}();return Object.assign(o,e,{displayName:t}),o}function patchFunctionalComponent(e,t,r,n){var o=void 0;function i(r){return o&&n.notifier(getUpdateInfo({Component:e,displayName:t,prevProps:o,nextProps:r,options:n})),o=r,e(r)}return Object.assign(i,e,{displayName:t}),i}function createPatchedComponent(e,t,r,n,o){return t.prototype&&t.prototype.isReactComponent?patchClassComponent(t,r,n,o):patchFunctionalComponent(t,r,n,o)}function getPatchedComponent(e,t,r,n,o){if(e.has(t))return e.get(t);var i=createPatchedComponent(e,t,r,n,o);return e.set(t,i),i}function whyDidYouRender(e,t){var r=normalizeOptions(t),n=e.createElement,o=e.createFactory,i=new WeakMap;return e.createElement=function(t){for(var o="function"==typeof t&&shouldTrack(t,getDisplayName(t),r),f=arguments.length,a=new Array(f>1?f-1:0),s=1;s<f;s++)a[s-1]=arguments[s];if(!o)return n.apply(e,[t].concat(a));var c=t&&t.whyDidYouRender&&t.whyDidYouRender.customName||getDisplayName(t),p=getPatchedComponent(i,t,c,e,r);return n.apply(e,[p].concat(a))},Object.assign(e.createElement,n),e.createFactory=function(t){var r=e.createElement.bind(null,t);return r.type=t,r},Object.assign(e.createFactory,o),e.__REVERT_WHY_DID_YOU_RENDER__=function(){e.createElement=n,e.createFactory=o,i=null,delete e.__REVERT_WHY_DID_YOU_RENDER__},e}module.exports=whyDidYouRender; | ||
"use strict";function _interopDefault(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var _isString=_interopDefault(require("lodash/isString")),_reduce=_interopDefault(require("lodash/reduce")),_keys=_interopDefault(require("lodash/keys")),_has=_interopDefault(require("lodash/has")),_isFunction=_interopDefault(require("lodash/isFunction")),_isRegExp=_interopDefault(require("lodash/isRegExp")),_isDate=_interopDefault(require("lodash/isDate")),_isPlainObject=_interopDefault(require("lodash/isPlainObject")),_isArray=_interopDefault(require("lodash/isArray"));function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function _createClass(e,t,r){return t&&_defineProperties(e.prototype,t),r&&_defineProperties(e,r),e}function _defineProperty(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){_defineProperty(e,t,r[t])})}return e}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&_setPrototypeOf(e,t)}function _getPrototypeOf(e){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function _setPrototypeOf(e,t){return(_setPrototypeOf=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _possibleConstructorReturn(e,t){return!t||"object"!=typeof t&&"function"!=typeof t?_assertThisInitialized(e):t}function _superPropBase(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=_getPrototypeOf(e)););return e}function _get(e,t,r){return(_get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=_superPropBase(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(r):o.value}})(e,t,r||e)}function _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_nonIterableSpread()}function _arrayWithoutHoles(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t<e.length;t++)r[t]=e[t];return r}}function _iterableToArray(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance")}var _diffTypesDescription,diffTypes={different:"different",deepEquals:"deepEquals",date:"date",regex:"regex",reactElement:"reactElement",function:"function"},moreInfoUrl="http://bit.ly/wdyr02",diffTypesDescriptions=(_defineProperty(_diffTypesDescription={},diffTypes.different,"different objects."),_defineProperty(_diffTypesDescription,diffTypes.deepEquals,"different objects that are equal by value."),_defineProperty(_diffTypesDescription,diffTypes.date,"different date objects with the same value."),_defineProperty(_diffTypesDescription,diffTypes.regex,"different regular expressions with the same value."),_defineProperty(_diffTypesDescription,diffTypes.reactElement,"different React elements with the same displayName."),_defineProperty(_diffTypesDescription,diffTypes.function,"different functions with the same name."),_diffTypesDescription),inHotReload=!1;function shouldLog(e,t,r){return!inHotReload&&(!!r.logOnDifferentValues||(!(!t.whyDidYouRender||!t.whyDidYouRender.logOnDifferentValues)||!(e.propsDifferences&&e.propsDifferences.some(function(e){return e.diffType===diffTypes.different})||e.stateDifferences&&e.stateDifferences.some(function(e){return e.diffType===diffTypes.different}))))}function logDifference(e,t,r,n,o,i,f){o&&o.length>0?(f.consoleLog(_defineProperty({},t,e),"".concat(r," of ").concat(n," changes:")),o.forEach(function(e){var t=e.pathString,r=e.diffType,o=e.prevValue,i=e.nextValue;f.consoleGroup("%c".concat(n,".%c").concat(t,"%c"),"color:blue;","color:red;","color:black;"),f.consoleLog("".concat(diffTypesDescriptions[r]," (more info at ").concat(moreInfoUrl,")")),f.consoleLog(_defineProperty({},"prev ".concat(t),o),"!==",_defineProperty({},"next ".concat(t),i)),f.consoleGroupEnd()})):o&&(f.consoleLog(_defineProperty({},t,e),"".concat(r," the ").concat(n," object itself changed but it's values are all equal."),"props"===n?"This could of been avoided by making the component pure, or by preventing it's father from re-rendering.":"This usually means this component called setState when no changes in it's state actually occurred.","more info at ".concat(moreInfoUrl)),f.consoleLog("prev ".concat(n,":"),i.prev," !== ",i.next,":next ".concat(n)))}function defaultNotifier(e){var t=e.Component,r=e.displayName,n=e.prevProps,o=e.prevState,i=e.nextProps,f=e.nextState,a=e.reason,s=e.options;if(shouldLog(a,t,s)){s.consoleGroup("%c".concat(r),"color: #058;");var c="Re-rendered because";a.propsDifferences&&(logDifference(t,r,c,"props",a.propsDifferences,{prev:n,next:i},s),c="And because"),a.stateDifferences&&logDifference(t,r,c,"state",a.stateDifferences,{prev:o,next:f},s),a.propsDifferences||a.stateDifferences||s.consoleLog(_defineProperty({},r,t),"Re-rendered although props and state objects are the same.","This usually means there was a call to this.forceUpdate() inside the component.","more info at ".concat(moreInfoUrl)),s.consoleGroupEnd()}}function createDefaultNotifier(e){return e&&module&&module.hot&&module.hot.addStatusHandler&&module.hot.addStatusHandler(function(t){"idle"===t&&(inHotReload=!0,setTimeout(function(){inHotReload=!1},e))}),defaultNotifier}var emptyFn=function(){};function normalizeOptions(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=console.group,r=console.groupEnd;return e.collapseGroups?t=console.groupCollapsed:e.onlyLogs&&(t=console.log,r=emptyFn),_objectSpread({include:null,exclude:null,notifier:e.notifier||createDefaultNotifier(e.hasOwnProperty("hotReloadBufferMs")?e.hotReloadBufferMs:500),onlyLogs:!1,consoleLog:console.log,consoleGroup:t,consoleGroupEnd:r,logOnDifferentValues:!1},e)}function getDisplayName(e){return e.displayName||e.name||(_isString(e)?e:void 0)}var hasElementType="undefined"!=typeof Element,hasSymbol="function"==typeof Symbol&&Symbol.for,REACT_ELEMENT_TYPE$1=hasSymbol?Symbol.for("react.element"):60103,isReactElement=function(e){return e.$$typeof===REACT_ELEMENT_TYPE$1};function trackDiff(e,t,r,n,o){return r.push({diffType:o,pathString:n,prevValue:e,nextValue:t}),o!==diffTypes.different}function accumulateDeepEqualDiffs(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";if(e===t)return!0;if(!e||!t)return trackDiff(e,t,r,n,diffTypes.different);if(_isArray(e)&&_isArray(t)){var o=e.length;if(o!==t.length)return trackDiff(e,t,r,n,diffTypes.different);for(var i=!0,f=o;0!=f--;)accumulateDeepEqualDiffs(e[f],t[f],r,"".concat(n,"[").concat(f,"]"))||(i=!1);return trackDiff(e,t,r,n,i?diffTypes.deepEquals:diffTypes.different)}if(_isDate(e)&&_isDate(t))return e.getTime()===t.getTime()?trackDiff(e,t,r,n,diffTypes.date):trackDiff(e,t,r,n,diffTypes.different);if(_isRegExp(e)&&_isRegExp(t))return e.toString()===t.toString()?trackDiff(e,t,r,n,diffTypes.regex):trackDiff(e,t,r,n,diffTypes.different);if(hasElementType&&e instanceof Element&&t instanceof Element)return trackDiff(e,t,r,n,diffTypes.different);if(isReactElement(e)&&isReactElement(t))return e.type===t.type?trackDiff(e,t,r,n,diffTypes.reactElement):trackDiff(e,t,r,n,diffTypes.different);if(_isFunction(e)&&_isFunction(t))return e.name===t.name?trackDiff(e,t,r,n,diffTypes.function):trackDiff(e,t,r,n,diffTypes.different);if(_isPlainObject(e)&&_isPlainObject(t)){var a=_keys(e),s=a.length;if(s!==_keys(t).length)return trackDiff(e,t,r,n,diffTypes.different);for(var c=s;0!=c--;)if(!_has(t,a[c]))return trackDiff(e,t,r,n,diffTypes.different);for(var u=!0,p=s;0!=p--;){var l=a[p];accumulateDeepEqualDiffs(e[l],t[l],r,"".concat(n,".").concat(l))||(u=!1)}return trackDiff(e,t,r,n,u?diffTypes.deepEquals:diffTypes.different)}return trackDiff(e,t,r,n,diffTypes.different)}function calculateDeepEqualDiffs(e,t,r){try{var n=[];return accumulateDeepEqualDiffs(e,t,n,r),n}catch(e){if(e.message&&e.message.match(/stack|recursion/i)||-2146828260===e.number)return console.warn("Warning: why-did-you-render couldn't handle circular references in props.",e.name,e.message),!1;throw e}}var emptyObject={};function findObjectsDifferences(e,t){if(e===t)return!1;var r=e||emptyObject,n=t||emptyObject,o=_keys(_objectSpread({},r,n));return _reduce(o,function(e,t){var o=calculateDeepEqualDiffs(r[t],n[t],t);return o&&(e=[].concat(_toConsumableArray(e||[]),_toConsumableArray(o))),e},[])}function getUpdateReason(e,t,r,n){return{propsDifferences:findObjectsDifferences(e,r,"props"),stateDifferences:findObjectsDifferences(t,n,"state")}}function getUpdateInfo(e){var t=e.Component,r=e.displayName,n=e.prevProps,o=e.prevState,i=e.nextProps,f=e.nextState;return{Component:t,displayName:r,prevProps:n,prevState:o,nextProps:i,nextState:f,options:e.options,reason:getUpdateReason(n,o,i,f)}}function shouldInclude(e,t){return t.include&&t.include.length>0&&t.include.some(function(t){return t.test(e)})}function shouldExclude(e,t){return t.exclude&&t.exclude.length>0&&t.exclude.some(function(t){return t.test(e)})}function shouldTrack(e,t,r){return!shouldExclude(t,r)&&!(!e.whyDidYouRender&&!shouldInclude(t,r))}function patchClassComponent(e,t,r,n){var o=function(r){function o(t,r){var n;if(_classCallCheck(this,o),(n=_possibleConstructorReturn(this,_getPrototypeOf(o).call(this,t,r))).render&&!e.prototype.render){var i=n.render;n.render=function(){return o.prototype.render.apply(_assertThisInitialized(_assertThisInitialized(n))),i()}}return n}return _inherits(o,e),_createClass(o,[{key:"render",value:function(){return this._prevProps&&n.notifier(getUpdateInfo({Component:e,displayName:t,prevProps:this._prevProps,prevState:this._prevState,nextProps:this.props,nextState:this.state,options:n})),this._prevProps=this.props,this._prevState=this.state,_get(_getPrototypeOf(o.prototype),"render",this)&&_get(_getPrototypeOf(o.prototype),"render",this).call(this)}}]),o}();return Object.assign(o,e,{displayName:t}),o}function patchFunctionalComponent(e,t,r,n){function o(o){var i=r.useRef(),f=i.current;return i.current=o,f&&n.notifier(getUpdateInfo({Component:e,displayName:t,prevProps:f,nextProps:o,options:n})),e(o)}return Object.assign(o,e,{displayName:t}),o}function createPatchedComponent(e,t,r,n,o){return t.prototype&&t.prototype.isReactComponent?patchClassComponent(t,r,n,o):patchFunctionalComponent(t,r,n,o)}function getPatchedComponent(e,t,r,n,o){if(e.has(t))return e.get(t);var i=createPatchedComponent(e,t,r,n,o);return e.set(t,i),i}function whyDidYouRender(e,t){var r=normalizeOptions(t),n=e.createElement,o=e.createFactory,i=new WeakMap;return e.createElement=function(t){for(var o="function"==typeof t&&shouldTrack(t,getDisplayName(t),r),f=arguments.length,a=new Array(f>1?f-1:0),s=1;s<f;s++)a[s-1]=arguments[s];if(!o)return n.apply(e,[t].concat(a));var c=t&&t.whyDidYouRender&&t.whyDidYouRender.customName||getDisplayName(t),u=getPatchedComponent(i,t,c,e,r);return n.apply(e,[u].concat(a))},Object.assign(e.createElement,n),e.createFactory=function(t){var r=e.createElement.bind(null,t);return r.type=t,r},Object.assign(e.createFactory,o),e.__REVERT_WHY_DID_YOU_RENDER__=function(){e.createElement=n,e.createFactory=o,i=null,delete e.__REVERT_WHY_DID_YOU_RENDER__},e}module.exports=whyDidYouRender; | ||
//# sourceMappingURL=whyDidYouRender.min.js.map |
/** | ||
* @welldone-software/why-did-you-render 2.5.0 | ||
* @welldone-software/why-did-you-render 2.5.1 | ||
* MIT Licensed | ||
* Generated by Vitali Zaidman <vzaidman@gmail.com> (https://github.com/vzaidman) | ||
* Generated at 2019-01-19 | ||
* Generated at 2019-02-12 | ||
*/ | ||
@@ -558,11 +558,13 @@ | ||
function patchFunctionalComponent(FunctionalComponent, displayName, React, options) { | ||
var _prevProps = undefined; | ||
function WDYRFunctionalComponent(nextProps) { | ||
var prevCountRef = React.useRef(); | ||
var prevProps = prevCountRef.current; | ||
prevCountRef.current = nextProps; | ||
function WDYRFunctionalComponent(props) { | ||
if (_prevProps) { | ||
if (prevProps) { | ||
options.notifier(getUpdateInfo({ | ||
Component: FunctionalComponent, | ||
displayName: displayName, | ||
prevProps: _prevProps, | ||
nextProps: props, | ||
prevProps: prevProps, | ||
nextProps: nextProps, | ||
options: options | ||
@@ -572,4 +574,3 @@ })); | ||
_prevProps = props; | ||
return FunctionalComponent(props); | ||
return FunctionalComponent(nextProps); | ||
} | ||
@@ -576,0 +577,0 @@ |
/** | ||
* @welldone-software/why-did-you-render 2.5.0 | ||
* @welldone-software/why-did-you-render 2.5.1 | ||
* MIT Licensed | ||
* Generated by Vitali Zaidman <vzaidman@gmail.com> (https://github.com/vzaidman) | ||
* Generated at 2019-01-19 | ||
* Generated at 2019-02-12 | ||
*/ | ||
import e from"lodash/isString";import t from"lodash/reduce";import n from"lodash/keys";import r from"lodash/has";import o from"lodash/isFunction";import a from"lodash/isRegExp";import i from"lodash/isDate";import c from"lodash/isPlainObject";import f from"lodash/isArray";function u(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function s(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){s(e,t,n[t])})}return e}function p(e){return(p=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function d(e,t){return(d=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function m(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function h(e,t,n){return(h="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=p(e)););return e}(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(n):o.value}})(e,t,n||e)}function y(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}var g,v={different:"different",deepEquals:"deepEquals",date:"date",regex:"regex",reactElement:"reactElement",function:"function"},b="http://bit.ly/wdyr02",E=(s(g={},v.different,"different objects."),s(g,v.deepEquals,"different objects that are equal by value."),s(g,v.date,"different date objects with the same value."),s(g,v.regex,"different regular expressions with the same value."),s(g,v.reactElement,"different React elements with the same displayName."),s(g,v.function,"different functions with the same name."),g),w=!1;function O(e,t,n,r,o,a,i){o&&o.length>0?(i.consoleLog(s({},t,e),"".concat(n," of ").concat(r," changes:")),o.forEach(function(e){var t=e.pathString,n=e.diffType,o=e.prevValue,a=e.nextValue;i.consoleGroup("%c".concat(r,".%c").concat(t,"%c"),"color:blue;","color:red;","color:black;"),i.consoleLog("".concat(E[n]," (more info at ").concat(b,")")),i.consoleLog(s({},"prev ".concat(t),o),"!==",s({},"next ".concat(t),a)),i.consoleGroupEnd()})):o&&(i.consoleLog(s({},t,e),"".concat(n," the ").concat(r," object itself changed but it's values are all equal."),"props"===r?"This could of been avoided by making the component pure, or by preventing it's father from re-rendering.":"This usually means this component called setState when no changes in it's state actually occurred.","more info at ".concat(b)),i.consoleLog("prev ".concat(r,":"),a.prev," !== ",a.next,":next ".concat(r)))}function D(e){var t=e.Component,n=e.displayName,r=e.prevProps,o=e.prevState,a=e.nextProps,i=e.nextState,c=e.reason,f=e.options;if(function(e,t,n){return!(w||!n.logOnDifferentValues&&(!t.whyDidYouRender||!t.whyDidYouRender.logOnDifferentValues)&&(e.propsDifferences&&e.propsDifferences.some(function(e){return e.diffType===v.different})||e.stateDifferences&&e.stateDifferences.some(function(e){return e.diffType===v.different})))}(c,t,f)){f.consoleGroup("%c".concat(n),"color: #058;");var u="Re-rendered because";c.propsDifferences&&(O(t,n,u,"props",c.propsDifferences,{prev:r,next:a},f),u="And because"),c.stateDifferences&&O(t,n,u,"state",c.stateDifferences,{prev:o,next:i},f),c.propsDifferences||c.stateDifferences||f.consoleLog(s({},n,t),"Re-rendered although props and state objects are the same.","This usually means there was a call to this.forceUpdate() inside the component.","more info at ".concat(b)),f.consoleGroupEnd()}}var _=function(){};function x(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=console.group,r=console.groupEnd;return t.collapseGroups?n=console.groupCollapsed:t.onlyLogs&&(n=console.log,r=_),l({include:null,exclude:null,notifier:t.notifier||((e=t.hasOwnProperty("hotReloadBufferMs")?t.hotReloadBufferMs:500)&&module&&module.hot&&module.hot.addStatusHandler&&module.hot.addStatusHandler(function(t){"idle"===t&&(w=!0,setTimeout(function(){w=!1},e))}),D),onlyLogs:!1,consoleLog:console.log,consoleGroup:n,consoleGroupEnd:r,logOnDifferentValues:!1},t)}function j(t){return t.displayName||t.name||(e(t)?t:void 0)}var P="undefined"!=typeof Element,S="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103,R=function(e){return e.$$typeof===S};function T(e,t,n,r,o){return n.push({diffType:o,pathString:r,prevValue:e,nextValue:t}),o!==v.different}function N(e,t,u){try{var s=[];return function e(t,u,s){var l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";if(t===u)return!0;if(!t||!u)return T(t,u,s,l,v.different);if(f(t)&&f(u)){var p=t.length;if(p!==u.length)return T(t,u,s,l,v.different);for(var d=!0,m=p;0!=m--;)e(t[m],u[m],s,"".concat(l,"[").concat(m,"]"))||(d=!1);return T(t,u,s,l,d?v.deepEquals:v.different)}if(i(t)&&i(u))return t.getTime()===u.getTime()?T(t,u,s,l,v.date):T(t,u,s,l,v.different);if(a(t)&&a(u))return t.toString()===u.toString()?T(t,u,s,l,v.regex):T(t,u,s,l,v.different);if(P&&t instanceof Element&&u instanceof Element)return T(t,u,s,l,v.different);if(R(t)&&R(u))return t.type===u.type?T(t,u,s,l,v.reactElement):T(t,u,s,l,v.different);if(o(t)&&o(u))return t.name===u.name?T(t,u,s,l,v.function):T(t,u,s,l,v.different);if(c(t)&&c(u)){var h=n(t),y=h.length;if(y!==n(u).length)return T(t,u,s,l,v.different);for(var g=y;0!=g--;)if(!r(u,h[g]))return T(t,u,s,l,v.different);for(var b=!0,E=y;0!=E--;){var w=h[E];e(t[w],u[w],s,"".concat(l,".").concat(w))||(b=!1)}return T(t,u,s,l,b?v.deepEquals:v.different)}return T(t,u,s,l,v.different)}(e,t,s,u),s}catch(e){if(e.message&&e.message.match(/stack|recursion/i)||-2146828260===e.number)return console.warn("Warning: why-did-you-render couldn't handle circular references in props.",e.name,e.message),!1;throw e}}var L={};function V(e,r){if(e===r)return!1;var o=e||L,a=r||L,i=n(l({},o,a));return t(i,function(e,t){var n=N(o[t],a[t],t);return n&&(e=[].concat(y(e||[]),y(n))),e},[])}function Y(e,t,n,r){return{propsDifferences:V(e,n),stateDifferences:V(t,r)}}function k(e){var t=e.Component,n=e.displayName,r=e.prevProps,o=e.prevState,a=e.nextProps,i=e.nextState;return{Component:t,displayName:n,prevProps:r,prevState:o,nextProps:a,nextState:i,options:e.options,reason:Y(r,o,a,i)}}function A(e,t,n,r){var o=function(n){function o(t,n){var r,a,i;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),a=this,i=p(o).call(this,t,n),(r=!i||"object"!=typeof i&&"function"!=typeof i?m(a):i).render&&!e.prototype.render){var c=r.render;r.render=function(){return o.prototype.render.apply(m(m(r))),c()}}return r}var a,i,c;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&d(e,t)}(o,e),a=o,(i=[{key:"render",value:function(){return this._prevProps&&r.notifier(k({Component:e,displayName:t,prevProps:this._prevProps,prevState:this._prevState,nextProps:this.props,nextState:this.state,options:r})),this._prevProps=this.props,this._prevState=this.state,h(p(o.prototype),"render",this)&&h(p(o.prototype),"render",this).call(this)}}])&&u(a.prototype,i),c&&u(a,c),o}();return Object.assign(o,e,{displayName:t}),o}function C(e,t,n,r,o){return t.prototype&&t.prototype.isReactComponent?A(t,n,0,o):function(e,t,n,r){var o=void 0;function a(n){return o&&r.notifier(k({Component:e,displayName:t,prevProps:o,nextProps:n,options:r})),o=n,e(n)}return Object.assign(a,e,{displayName:t}),a}(t,n,0,o)}export default function(e,t){var n=x(t),r=e.createElement,o=e.createFactory,a=new WeakMap;return e.createElement=function(t){for(var o="function"==typeof t&&function(e,t,n){return!(function(e,t){return t.exclude&&t.exclude.length>0&&t.exclude.some(function(t){return t.test(e)})}(t,n)||!e.whyDidYouRender&&!function(e,t){return t.include&&t.include.length>0&&t.include.some(function(t){return t.test(e)})}(t,n))}(t,j(t),n),i=arguments.length,c=new Array(i>1?i-1:0),f=1;f<i;f++)c[f-1]=arguments[f];if(!o)return r.apply(e,[t].concat(c));var u=t&&t.whyDidYouRender&&t.whyDidYouRender.customName||j(t),s=function(e,t,n,r,o){if(e.has(t))return e.get(t);var a=C(0,t,n,0,o);return e.set(t,a),a}(a,t,u,0,n);return r.apply(e,[s].concat(c))},Object.assign(e.createElement,r),e.createFactory=function(t){var n=e.createElement.bind(null,t);return n.type=t,n},Object.assign(e.createFactory,o),e.__REVERT_WHY_DID_YOU_RENDER__=function(){e.createElement=r,e.createFactory=o,a=null,delete e.__REVERT_WHY_DID_YOU_RENDER__},e} | ||
import e from"lodash/isString";import t from"lodash/reduce";import n from"lodash/keys";import r from"lodash/has";import o from"lodash/isFunction";import a from"lodash/isRegExp";import i from"lodash/isDate";import c from"lodash/isPlainObject";import f from"lodash/isArray";function u(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function s(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){s(e,t,n[t])})}return e}function p(e){return(p=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function d(e,t){return(d=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function m(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function h(e,t,n){return(h="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=p(e)););return e}(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(n):o.value}})(e,t,n||e)}function y(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}var g,v={different:"different",deepEquals:"deepEquals",date:"date",regex:"regex",reactElement:"reactElement",function:"function"},b="http://bit.ly/wdyr02",E=(s(g={},v.different,"different objects."),s(g,v.deepEquals,"different objects that are equal by value."),s(g,v.date,"different date objects with the same value."),s(g,v.regex,"different regular expressions with the same value."),s(g,v.reactElement,"different React elements with the same displayName."),s(g,v.function,"different functions with the same name."),g),w=!1;function O(e,t,n,r,o,a,i){o&&o.length>0?(i.consoleLog(s({},t,e),"".concat(n," of ").concat(r," changes:")),o.forEach(function(e){var t=e.pathString,n=e.diffType,o=e.prevValue,a=e.nextValue;i.consoleGroup("%c".concat(r,".%c").concat(t,"%c"),"color:blue;","color:red;","color:black;"),i.consoleLog("".concat(E[n]," (more info at ").concat(b,")")),i.consoleLog(s({},"prev ".concat(t),o),"!==",s({},"next ".concat(t),a)),i.consoleGroupEnd()})):o&&(i.consoleLog(s({},t,e),"".concat(n," the ").concat(r," object itself changed but it's values are all equal."),"props"===r?"This could of been avoided by making the component pure, or by preventing it's father from re-rendering.":"This usually means this component called setState when no changes in it's state actually occurred.","more info at ".concat(b)),i.consoleLog("prev ".concat(r,":"),a.prev," !== ",a.next,":next ".concat(r)))}function D(e){var t=e.Component,n=e.displayName,r=e.prevProps,o=e.prevState,a=e.nextProps,i=e.nextState,c=e.reason,f=e.options;if(function(e,t,n){return!(w||!n.logOnDifferentValues&&(!t.whyDidYouRender||!t.whyDidYouRender.logOnDifferentValues)&&(e.propsDifferences&&e.propsDifferences.some(function(e){return e.diffType===v.different})||e.stateDifferences&&e.stateDifferences.some(function(e){return e.diffType===v.different})))}(c,t,f)){f.consoleGroup("%c".concat(n),"color: #058;");var u="Re-rendered because";c.propsDifferences&&(O(t,n,u,"props",c.propsDifferences,{prev:r,next:a},f),u="And because"),c.stateDifferences&&O(t,n,u,"state",c.stateDifferences,{prev:o,next:i},f),c.propsDifferences||c.stateDifferences||f.consoleLog(s({},n,t),"Re-rendered although props and state objects are the same.","This usually means there was a call to this.forceUpdate() inside the component.","more info at ".concat(b)),f.consoleGroupEnd()}}var _=function(){};function x(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=console.group,r=console.groupEnd;return t.collapseGroups?n=console.groupCollapsed:t.onlyLogs&&(n=console.log,r=_),l({include:null,exclude:null,notifier:t.notifier||((e=t.hasOwnProperty("hotReloadBufferMs")?t.hotReloadBufferMs:500)&&module&&module.hot&&module.hot.addStatusHandler&&module.hot.addStatusHandler(function(t){"idle"===t&&(w=!0,setTimeout(function(){w=!1},e))}),D),onlyLogs:!1,consoleLog:console.log,consoleGroup:n,consoleGroupEnd:r,logOnDifferentValues:!1},t)}function j(t){return t.displayName||t.name||(e(t)?t:void 0)}var P="undefined"!=typeof Element,S="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103,R=function(e){return e.$$typeof===S};function T(e,t,n,r,o){return n.push({diffType:o,pathString:r,prevValue:e,nextValue:t}),o!==v.different}function N(e,t,u){try{var s=[];return function e(t,u,s){var l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";if(t===u)return!0;if(!t||!u)return T(t,u,s,l,v.different);if(f(t)&&f(u)){var p=t.length;if(p!==u.length)return T(t,u,s,l,v.different);for(var d=!0,m=p;0!=m--;)e(t[m],u[m],s,"".concat(l,"[").concat(m,"]"))||(d=!1);return T(t,u,s,l,d?v.deepEquals:v.different)}if(i(t)&&i(u))return t.getTime()===u.getTime()?T(t,u,s,l,v.date):T(t,u,s,l,v.different);if(a(t)&&a(u))return t.toString()===u.toString()?T(t,u,s,l,v.regex):T(t,u,s,l,v.different);if(P&&t instanceof Element&&u instanceof Element)return T(t,u,s,l,v.different);if(R(t)&&R(u))return t.type===u.type?T(t,u,s,l,v.reactElement):T(t,u,s,l,v.different);if(o(t)&&o(u))return t.name===u.name?T(t,u,s,l,v.function):T(t,u,s,l,v.different);if(c(t)&&c(u)){var h=n(t),y=h.length;if(y!==n(u).length)return T(t,u,s,l,v.different);for(var g=y;0!=g--;)if(!r(u,h[g]))return T(t,u,s,l,v.different);for(var b=!0,E=y;0!=E--;){var w=h[E];e(t[w],u[w],s,"".concat(l,".").concat(w))||(b=!1)}return T(t,u,s,l,b?v.deepEquals:v.different)}return T(t,u,s,l,v.different)}(e,t,s,u),s}catch(e){if(e.message&&e.message.match(/stack|recursion/i)||-2146828260===e.number)return console.warn("Warning: why-did-you-render couldn't handle circular references in props.",e.name,e.message),!1;throw e}}var L={};function V(e,r){if(e===r)return!1;var o=e||L,a=r||L,i=n(l({},o,a));return t(i,function(e,t){var n=N(o[t],a[t],t);return n&&(e=[].concat(y(e||[]),y(n))),e},[])}function Y(e,t,n,r){return{propsDifferences:V(e,n),stateDifferences:V(t,r)}}function k(e){var t=e.Component,n=e.displayName,r=e.prevProps,o=e.prevState,a=e.nextProps,i=e.nextState;return{Component:t,displayName:n,prevProps:r,prevState:o,nextProps:a,nextState:i,options:e.options,reason:Y(r,o,a,i)}}function A(e,t,n,r){var o=function(n){function o(t,n){var r,a,i;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),a=this,i=p(o).call(this,t,n),(r=!i||"object"!=typeof i&&"function"!=typeof i?m(a):i).render&&!e.prototype.render){var c=r.render;r.render=function(){return o.prototype.render.apply(m(m(r))),c()}}return r}var a,i,c;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&d(e,t)}(o,e),a=o,(i=[{key:"render",value:function(){return this._prevProps&&r.notifier(k({Component:e,displayName:t,prevProps:this._prevProps,prevState:this._prevState,nextProps:this.props,nextState:this.state,options:r})),this._prevProps=this.props,this._prevState=this.state,h(p(o.prototype),"render",this)&&h(p(o.prototype),"render",this).call(this)}}])&&u(a.prototype,i),c&&u(a,c),o}();return Object.assign(o,e,{displayName:t}),o}function C(e,t,n,r,o){return t.prototype&&t.prototype.isReactComponent?A(t,n,0,o):function(e,t,n,r){function o(o){var a=n.useRef(),i=a.current;return a.current=o,i&&r.notifier(k({Component:e,displayName:t,prevProps:i,nextProps:o,options:r})),e(o)}return Object.assign(o,e,{displayName:t}),o}(t,n,r,o)}export default function(e,t){var n=x(t),r=e.createElement,o=e.createFactory,a=new WeakMap;return e.createElement=function(t){for(var o="function"==typeof t&&function(e,t,n){return!(function(e,t){return t.exclude&&t.exclude.length>0&&t.exclude.some(function(t){return t.test(e)})}(t,n)||!e.whyDidYouRender&&!function(e,t){return t.include&&t.include.length>0&&t.include.some(function(t){return t.test(e)})}(t,n))}(t,j(t),n),i=arguments.length,c=new Array(i>1?i-1:0),f=1;f<i;f++)c[f-1]=arguments[f];if(!o)return r.apply(e,[t].concat(c));var u=t&&t.whyDidYouRender&&t.whyDidYouRender.customName||j(t),s=function(e,t,n,r,o){if(e.has(t))return e.get(t);var a=C(0,t,n,r,o);return e.set(t,a),a}(a,t,u,e,n);return r.apply(e,[s].concat(c))},Object.assign(e.createElement,r),e.createFactory=function(t){var n=e.createElement.bind(null,t);return n.type=t,n},Object.assign(e.createFactory,o),e.__REVERT_WHY_DID_YOU_RENDER__=function(){e.createElement=r,e.createFactory=o,a=null,delete e.__REVERT_WHY_DID_YOU_RENDER__},e} | ||
//# sourceMappingURL=whyDidYouRender.min.js.map |
/** | ||
* @welldone-software/why-did-you-render 2.5.0 | ||
* @welldone-software/why-did-you-render 2.5.1 | ||
* MIT Licensed | ||
* Generated by Vitali Zaidman <vzaidman@gmail.com> (https://github.com/vzaidman) | ||
* Generated at 2019-01-19 | ||
* Generated at 2019-02-12 | ||
*/ | ||
@@ -452,11 +452,13 @@ | ||
function patchFunctionalComponent(FunctionalComponent, displayName, React, options) { | ||
var _prevProps = undefined; | ||
function WDYRFunctionalComponent(nextProps) { | ||
var prevCountRef = React.useRef(); | ||
var prevProps = prevCountRef.current; | ||
prevCountRef.current = nextProps; | ||
function WDYRFunctionalComponent(props) { | ||
if (_prevProps) { | ||
if (prevProps) { | ||
options.notifier(getUpdateInfo({ | ||
Component: FunctionalComponent, | ||
displayName: displayName, | ||
prevProps: _prevProps, | ||
nextProps: props, | ||
prevProps: prevProps, | ||
nextProps: nextProps, | ||
options: options | ||
@@ -466,4 +468,3 @@ })); | ||
_prevProps = props; | ||
return FunctionalComponent(props); | ||
return FunctionalComponent(nextProps); | ||
} | ||
@@ -470,0 +471,0 @@ |
/** | ||
* @welldone-software/why-did-you-render 2.5.0 | ||
* @welldone-software/why-did-you-render 2.5.1 | ||
* MIT Licensed | ||
* Generated by Vitali Zaidman <vzaidman@gmail.com> (https://github.com/vzaidman) | ||
* Generated at 2019-01-19 | ||
* Generated at 2019-02-12 | ||
*/ | ||
@@ -448,11 +448,13 @@ | ||
function patchFunctionalComponent(FunctionalComponent, displayName, React, options) { | ||
var _prevProps = undefined; | ||
function WDYRFunctionalComponent(nextProps) { | ||
var prevCountRef = React.useRef(); | ||
var prevProps = prevCountRef.current; | ||
prevCountRef.current = nextProps; | ||
function WDYRFunctionalComponent(props) { | ||
if (_prevProps) { | ||
if (prevProps) { | ||
options.notifier(getUpdateInfo({ | ||
Component: FunctionalComponent, | ||
displayName: displayName, | ||
prevProps: _prevProps, | ||
nextProps: props, | ||
prevProps: prevProps, | ||
nextProps: nextProps, | ||
options: options | ||
@@ -462,4 +464,3 @@ })); | ||
_prevProps = props; | ||
return FunctionalComponent(props); | ||
return FunctionalComponent(nextProps); | ||
} | ||
@@ -466,0 +467,0 @@ |
/** | ||
* @welldone-software/why-did-you-render 2.5.0 | ||
* @welldone-software/why-did-you-render 2.5.1 | ||
* MIT Licensed | ||
* Generated by Vitali Zaidman <vzaidman@gmail.com> (https://github.com/vzaidman) | ||
* Generated at 2019-01-19 | ||
* Generated at 2019-02-12 | ||
*/ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).whyDidYouRender=t()}(this,function(){"use strict";function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function t(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function r(e){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{},o=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),o.forEach(function(r){t(e,r,n[r])})}return e}function n(e){return(n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function o(e,t){return(o=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function a(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function i(e,t,r){return(i="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var o=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=n(e)););return e}(e,t);if(o){var a=Object.getOwnPropertyDescriptor(o,t);return a.get?a.get.call(r):a.value}})(e,t,r||e)}function u(e){return function(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t<e.length;t++)r[t]=e[t];return r}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}var c,f={different:"different",deepEquals:"deepEquals",date:"date",regex:"regex",reactElement:"reactElement",function:"function"},s="http://bit.ly/wdyr02",l=(t(c={},f.different,"different objects."),t(c,f.deepEquals,"different objects that are equal by value."),t(c,f.date,"different date objects with the same value."),t(c,f.regex,"different regular expressions with the same value."),t(c,f.reactElement,"different React elements with the same displayName."),t(c,f.function,"different functions with the same name."),c),p=!1;function v(e,r,n,o,a,i,u){a&&a.length>0?(u.consoleLog(t({},r,e),"".concat(n," of ").concat(o," changes:")),a.forEach(function(e){var r=e.pathString,n=e.diffType,a=e.prevValue,i=e.nextValue;u.consoleGroup("%c".concat(o,".%c").concat(r,"%c"),"color:blue;","color:red;","color:black;"),u.consoleLog("".concat(l[n]," (more info at ").concat(s,")")),u.consoleLog(t({},"prev ".concat(r),a),"!==",t({},"next ".concat(r),i)),u.consoleGroupEnd()})):a&&(u.consoleLog(t({},r,e),"".concat(n," the ").concat(o," object itself changed but it's values are all equal."),"props"===o?"This could of been avoided by making the component pure, or by preventing it's father from re-rendering.":"This usually means this component called setState when no changes in it's state actually occurred.","more info at ".concat(s)),u.consoleLog("prev ".concat(o,":"),i.prev," !== ",i.next,":next ".concat(o)))}function d(e){var r=e.Component,n=e.displayName,o=e.prevProps,a=e.prevState,i=e.nextProps,u=e.nextState,c=e.reason,l=e.options;if(function(e,t,r){return!(p||!r.logOnDifferentValues&&(!t.whyDidYouRender||!t.whyDidYouRender.logOnDifferentValues)&&(e.propsDifferences&&e.propsDifferences.some(function(e){return e.diffType===f.different})||e.stateDifferences&&e.stateDifferences.some(function(e){return e.diffType===f.different})))}(c,r,l)){l.consoleGroup("%c".concat(n),"color: #058;");var d="Re-rendered because";c.propsDifferences&&(v(r,n,d,"props",c.propsDifferences,{prev:o,next:i},l),d="And because"),c.stateDifferences&&v(r,n,d,"state",c.stateDifferences,{prev:a,next:u},l),c.propsDifferences||c.stateDifferences||l.consoleLog(t({},n,r),"Re-rendered although props and state objects are the same.","This usually means there was a call to this.forceUpdate() inside the component.","more info at ".concat(s)),l.consoleGroupEnd()}}var h=function(){};function y(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=console.group,o=console.groupEnd;return t.collapseGroups?n=console.groupCollapsed:t.onlyLogs&&(n=console.log,o=h),r({include:null,exclude:null,notifier:t.notifier||((e=t.hasOwnProperty("hotReloadBufferMs")?t.hotReloadBufferMs:500)&&module&&module.hot&&module.hot.addStatusHandler&&module.hot.addStatusHandler(function(t){"idle"===t&&(p=!0,setTimeout(function(){p=!1},e))}),d),onlyLogs:!1,consoleLog:console.log,consoleGroup:n,consoleGroupEnd:o,logOnDifferentValues:!1},t)}var b="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function g(e,t){return e(t={exports:{}},t.exports),t.exports}var _="object"==typeof b&&b&&b.Object===Object&&b,j="object"==typeof self&&self&&self.Object===Object&&self,m=_||j||Function("return this")(),O=m.Symbol,w=Object.prototype,E=w.hasOwnProperty,S=w.toString,P=O?O.toStringTag:void 0;var x=function(e){var t=E.call(e,P),r=e[P];try{e[P]=void 0;var n=!0}catch(e){}var o=S.call(e);return n&&(t?e[P]=r:delete e[P]),o},D=Object.prototype.toString;var A=function(e){return D.call(e)},R="[object Null]",z="[object Undefined]",T=O?O.toStringTag:void 0;var k=function(e){return null==e?void 0===e?z:R:T&&T in Object(e)?x(e):A(e)},N=Array.isArray;var F=function(e){return null!=e&&"object"==typeof e},L="[object String]";var V=function(e){return"string"==typeof e||!N(e)&&F(e)&&k(e)==L};function C(e){return e.displayName||e.name||(V(e)?e:void 0)}var M=function(e,t,r,n){var o=-1,a=null==e?0:e.length;for(n&&a&&(r=e[++o]);++o<a;)r=t(r,e[o],o,e);return r};var $=function(e){return function(t,r,n){for(var o=-1,a=Object(t),i=n(t),u=i.length;u--;){var c=i[e?u:++o];if(!1===r(a[c],c,a))break}return t}}();var Y=function(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n},q="[object Arguments]";var B=function(e){return F(e)&&k(e)==q},I=Object.prototype,U=I.hasOwnProperty,G=I.propertyIsEnumerable,W=B(function(){return arguments}())?B:function(e){return F(e)&&U.call(e,"callee")&&!G.call(e,"callee")};var H=function(){return!1},J=g(function(e,t){var r=t&&!t.nodeType&&t,n=r&&e&&!e.nodeType&&e,o=n&&n.exports===r?m.Buffer:void 0,a=(o?o.isBuffer:void 0)||H;e.exports=a}),K=9007199254740991,Q=/^(?:0|[1-9]\d*)$/;var X=function(e,t){var r=typeof e;return!!(t=null==t?K:t)&&("number"==r||"symbol"!=r&&Q.test(e))&&e>-1&&e%1==0&&e<t},Z=9007199254740991;var ee=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=Z},te={};te["[object Float32Array]"]=te["[object Float64Array]"]=te["[object Int8Array]"]=te["[object Int16Array]"]=te["[object Int32Array]"]=te["[object Uint8Array]"]=te["[object Uint8ClampedArray]"]=te["[object Uint16Array]"]=te["[object Uint32Array]"]=!0,te["[object Arguments]"]=te["[object Array]"]=te["[object ArrayBuffer]"]=te["[object Boolean]"]=te["[object DataView]"]=te["[object Date]"]=te["[object Error]"]=te["[object Function]"]=te["[object Map]"]=te["[object Number]"]=te["[object Object]"]=te["[object RegExp]"]=te["[object Set]"]=te["[object String]"]=te["[object WeakMap]"]=!1;var re=function(e){return F(e)&&ee(e.length)&&!!te[k(e)]};var ne=function(e){return function(t){return e(t)}},oe=g(function(e,t){var r=t&&!t.nodeType&&t,n=r&&e&&!e.nodeType&&e,o=n&&n.exports===r&&_.process,a=function(){try{var e=n&&n.require&&n.require("util").types;return e||o&&o.binding&&o.binding("util")}catch(e){}}();e.exports=a}),ae=oe&&oe.isTypedArray,ie=ae?ne(ae):re,ue=Object.prototype.hasOwnProperty;var ce=function(e,t){var r=N(e),n=!r&&W(e),o=!r&&!n&&J(e),a=!r&&!n&&!o&&ie(e),i=r||n||o||a,u=i?Y(e.length,String):[],c=u.length;for(var f in e)!t&&!ue.call(e,f)||i&&("length"==f||o&&("offset"==f||"parent"==f)||a&&("buffer"==f||"byteLength"==f||"byteOffset"==f)||X(f,c))||u.push(f);return u},fe=Object.prototype;var se=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||fe)};var le=function(e,t){return function(r){return e(t(r))}},pe=le(Object.keys,Object),ve=Object.prototype.hasOwnProperty;var de=function(e){if(!se(e))return pe(e);var t=[];for(var r in Object(e))ve.call(e,r)&&"constructor"!=r&&t.push(r);return t};var he=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},ye="[object AsyncFunction]",be="[object Function]",ge="[object GeneratorFunction]",_e="[object Proxy]";var je=function(e){if(!he(e))return!1;var t=k(e);return t==be||t==ge||t==ye||t==_e};var me=function(e){return null!=e&&ee(e.length)&&!je(e)};var Oe=function(e){return me(e)?ce(e):de(e)};var we=function(e,t){return function(r,n){if(null==r)return r;if(!me(r))return e(r,n);for(var o=r.length,a=t?o:-1,i=Object(r);(t?a--:++a<o)&&!1!==n(i[a],a,i););return r}}(function(e,t){return e&&$(e,t,Oe)});var Ee=function(){this.__data__=[],this.size=0};var Se=function(e,t){return e===t||e!=e&&t!=t};var Pe=function(e,t){for(var r=e.length;r--;)if(Se(e[r][0],t))return r;return-1},xe=Array.prototype.splice;var De=function(e){var t=this.__data__,r=Pe(t,e);return!(r<0||(r==t.length-1?t.pop():xe.call(t,r,1),--this.size,0))};var Ae=function(e){var t=this.__data__,r=Pe(t,e);return r<0?void 0:t[r][1]};var Re=function(e){return Pe(this.__data__,e)>-1};var ze=function(e,t){var r=this.__data__,n=Pe(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this};function Te(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Te.prototype.clear=Ee,Te.prototype.delete=De,Te.prototype.get=Ae,Te.prototype.has=Re,Te.prototype.set=ze;var ke=Te;var Ne=function(){this.__data__=new ke,this.size=0};var Fe=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r};var Le=function(e){return this.__data__.get(e)};var Ve,Ce=function(e){return this.__data__.has(e)},Me=m["__core-js_shared__"],$e=(Ve=/[^.]+$/.exec(Me&&Me.keys&&Me.keys.IE_PROTO||""))?"Symbol(src)_1."+Ve:"";var Ye=function(e){return!!$e&&$e in e},qe=Function.prototype.toString;var Be=function(e){if(null!=e){try{return qe.call(e)}catch(e){}try{return e+""}catch(e){}}return""},Ie=/^\[object .+?Constructor\]$/,Ue=Function.prototype,Ge=Object.prototype,We=Ue.toString,He=Ge.hasOwnProperty,Je=RegExp("^"+We.call(He).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var Ke=function(e){return!(!he(e)||Ye(e))&&(je(e)?Je:Ie).test(Be(e))};var Qe=function(e,t){return null==e?void 0:e[t]};var Xe=function(e,t){var r=Qe(e,t);return Ke(r)?r:void 0},Ze=Xe(m,"Map"),et=Xe(Object,"create");var tt=function(){this.__data__=et?et(null):{},this.size=0};var rt=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},nt="__lodash_hash_undefined__",ot=Object.prototype.hasOwnProperty;var at=function(e){var t=this.__data__;if(et){var r=t[e];return r===nt?void 0:r}return ot.call(t,e)?t[e]:void 0},it=Object.prototype.hasOwnProperty;var ut=function(e){var t=this.__data__;return et?void 0!==t[e]:it.call(t,e)},ct="__lodash_hash_undefined__";var ft=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=et&&void 0===t?ct:t,this};function st(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}st.prototype.clear=tt,st.prototype.delete=rt,st.prototype.get=at,st.prototype.has=ut,st.prototype.set=ft;var lt=st;var pt=function(){this.size=0,this.__data__={hash:new lt,map:new(Ze||ke),string:new lt}};var vt=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e};var dt=function(e,t){var r=e.__data__;return vt(t)?r["string"==typeof t?"string":"hash"]:r.map};var ht=function(e){var t=dt(this,e).delete(e);return this.size-=t?1:0,t};var yt=function(e){return dt(this,e).get(e)};var bt=function(e){return dt(this,e).has(e)};var gt=function(e,t){var r=dt(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this};function _t(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}_t.prototype.clear=pt,_t.prototype.delete=ht,_t.prototype.get=yt,_t.prototype.has=bt,_t.prototype.set=gt;var jt=_t,mt=200;var Ot=function(e,t){var r=this.__data__;if(r instanceof ke){var n=r.__data__;if(!Ze||n.length<mt-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new jt(n)}return r.set(e,t),this.size=r.size,this};function wt(e){var t=this.__data__=new ke(e);this.size=t.size}wt.prototype.clear=Ne,wt.prototype.delete=Fe,wt.prototype.get=Le,wt.prototype.has=Ce,wt.prototype.set=Ot;var Et=wt,St="__lodash_hash_undefined__";var Pt=function(e){return this.__data__.set(e,St),this};var xt=function(e){return this.__data__.has(e)};function Dt(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new jt;++t<r;)this.add(e[t])}Dt.prototype.add=Dt.prototype.push=Pt,Dt.prototype.has=xt;var At=Dt;var Rt=function(e,t){for(var r=-1,n=null==e?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1};var zt=function(e,t){return e.has(t)},Tt=1,kt=2;var Nt=function(e,t,r,n,o,a){var i=r&Tt,u=e.length,c=t.length;if(u!=c&&!(i&&c>u))return!1;var f=a.get(e);if(f&&a.get(t))return f==t;var s=-1,l=!0,p=r&kt?new At:void 0;for(a.set(e,t),a.set(t,e);++s<u;){var v=e[s],d=t[s];if(n)var h=i?n(d,v,s,t,e,a):n(v,d,s,e,t,a);if(void 0!==h){if(h)continue;l=!1;break}if(p){if(!Rt(t,function(e,t){if(!zt(p,t)&&(v===e||o(v,e,r,n,a)))return p.push(t)})){l=!1;break}}else if(v!==d&&!o(v,d,r,n,a)){l=!1;break}}return a.delete(e),a.delete(t),l},Ft=m.Uint8Array;var Lt=function(e){var t=-1,r=Array(e.size);return e.forEach(function(e,n){r[++t]=[n,e]}),r};var Vt=function(e){var t=-1,r=Array(e.size);return e.forEach(function(e){r[++t]=e}),r},Ct=1,Mt=2,$t="[object Boolean]",Yt="[object Date]",qt="[object Error]",Bt="[object Map]",It="[object Number]",Ut="[object RegExp]",Gt="[object Set]",Wt="[object String]",Ht="[object Symbol]",Jt="[object ArrayBuffer]",Kt="[object DataView]",Qt=O?O.prototype:void 0,Xt=Qt?Qt.valueOf:void 0;var Zt=function(e,t,r,n,o,a,i){switch(r){case Kt:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case Jt:return!(e.byteLength!=t.byteLength||!a(new Ft(e),new Ft(t)));case $t:case Yt:case It:return Se(+e,+t);case qt:return e.name==t.name&&e.message==t.message;case Ut:case Wt:return e==t+"";case Bt:var u=Lt;case Gt:var c=n&Ct;if(u||(u=Vt),e.size!=t.size&&!c)return!1;var f=i.get(e);if(f)return f==t;n|=Mt,i.set(e,t);var s=Nt(u(e),u(t),n,o,a,i);return i.delete(e),s;case Ht:if(Xt)return Xt.call(e)==Xt.call(t)}return!1};var er=function(e,t){for(var r=-1,n=t.length,o=e.length;++r<n;)e[o+r]=t[r];return e};var tr=function(e,t,r){var n=t(e);return N(e)?n:er(n,r(e))};var rr=function(e,t){for(var r=-1,n=null==e?0:e.length,o=0,a=[];++r<n;){var i=e[r];t(i,r,e)&&(a[o++]=i)}return a};var nr=function(){return[]},or=Object.prototype.propertyIsEnumerable,ar=Object.getOwnPropertySymbols,ir=ar?function(e){return null==e?[]:(e=Object(e),rr(ar(e),function(t){return or.call(e,t)}))}:nr;var ur=function(e){return tr(e,Oe,ir)},cr=1,fr=Object.prototype.hasOwnProperty;var sr=function(e,t,r,n,o,a){var i=r&cr,u=ur(e),c=u.length;if(c!=ur(t).length&&!i)return!1;for(var f=c;f--;){var s=u[f];if(!(i?s in t:fr.call(t,s)))return!1}var l=a.get(e);if(l&&a.get(t))return l==t;var p=!0;a.set(e,t),a.set(t,e);for(var v=i;++f<c;){var d=e[s=u[f]],h=t[s];if(n)var y=i?n(h,d,s,t,e,a):n(d,h,s,e,t,a);if(!(void 0===y?d===h||o(d,h,r,n,a):y)){p=!1;break}v||(v="constructor"==s)}if(p&&!v){var b=e.constructor,g=t.constructor;b!=g&&"constructor"in e&&"constructor"in t&&!("function"==typeof b&&b instanceof b&&"function"==typeof g&&g instanceof g)&&(p=!1)}return a.delete(e),a.delete(t),p},lr=Xe(m,"DataView"),pr=Xe(m,"Promise"),vr=Xe(m,"Set"),dr=Xe(m,"WeakMap"),hr=Be(lr),yr=Be(Ze),br=Be(pr),gr=Be(vr),_r=Be(dr),jr=k;(lr&&"[object DataView]"!=jr(new lr(new ArrayBuffer(1)))||Ze&&"[object Map]"!=jr(new Ze)||pr&&"[object Promise]"!=jr(pr.resolve())||vr&&"[object Set]"!=jr(new vr)||dr&&"[object WeakMap]"!=jr(new dr))&&(jr=function(e){var t=k(e),r="[object Object]"==t?e.constructor:void 0,n=r?Be(r):"";if(n)switch(n){case hr:return"[object DataView]";case yr:return"[object Map]";case br:return"[object Promise]";case gr:return"[object Set]";case _r:return"[object WeakMap]"}return t});var mr=jr,Or=1,wr="[object Arguments]",Er="[object Array]",Sr="[object Object]",Pr=Object.prototype.hasOwnProperty;var xr=function(e,t,r,n,o,a){var i=N(e),u=N(t),c=i?Er:mr(e),f=u?Er:mr(t),s=(c=c==wr?Sr:c)==Sr,l=(f=f==wr?Sr:f)==Sr,p=c==f;if(p&&J(e)){if(!J(t))return!1;i=!0,s=!1}if(p&&!s)return a||(a=new Et),i||ie(e)?Nt(e,t,r,n,o,a):Zt(e,t,c,r,n,o,a);if(!(r&Or)){var v=s&&Pr.call(e,"__wrapped__"),d=l&&Pr.call(t,"__wrapped__");if(v||d){var h=v?e.value():e,y=d?t.value():t;return a||(a=new Et),o(h,y,r,n,a)}}return!!p&&(a||(a=new Et),sr(e,t,r,n,o,a))};var Dr=function e(t,r,n,o,a){return t===r||(null==t||null==r||!F(t)&&!F(r)?t!=t&&r!=r:xr(t,r,n,o,e,a))},Ar=1,Rr=2;var zr=function(e,t,r,n){var o=r.length,a=o,i=!n;if(null==e)return!a;for(e=Object(e);o--;){var u=r[o];if(i&&u[2]?u[1]!==e[u[0]]:!(u[0]in e))return!1}for(;++o<a;){var c=(u=r[o])[0],f=e[c],s=u[1];if(i&&u[2]){if(void 0===f&&!(c in e))return!1}else{var l=new Et;if(n)var p=n(f,s,c,e,t,l);if(!(void 0===p?Dr(s,f,Ar|Rr,n,l):p))return!1}}return!0};var Tr=function(e){return e==e&&!he(e)};var kr=function(e){for(var t=Oe(e),r=t.length;r--;){var n=t[r],o=e[n];t[r]=[n,o,Tr(o)]}return t};var Nr=function(e,t){return function(r){return null!=r&&r[e]===t&&(void 0!==t||e in Object(r))}};var Fr=function(e){var t=kr(e);return 1==t.length&&t[0][2]?Nr(t[0][0],t[0][1]):function(r){return r===e||zr(r,e,t)}},Lr="[object Symbol]";var Vr=function(e){return"symbol"==typeof e||F(e)&&k(e)==Lr},Cr=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Mr=/^\w*$/;var $r=function(e,t){if(N(e))return!1;var r=typeof e;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!Vr(e))||Mr.test(e)||!Cr.test(e)||null!=t&&e in Object(t)},Yr="Expected a function";function qr(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError(Yr);var r=function(){var n=arguments,o=t?t.apply(this,n):n[0],a=r.cache;if(a.has(o))return a.get(o);var i=e.apply(this,n);return r.cache=a.set(o,i)||a,i};return r.cache=new(qr.Cache||jt),r}qr.Cache=jt;var Br=qr,Ir=500;var Ur=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Gr=/\\(\\)?/g,Wr=function(e){var t=Br(e,function(e){return r.size===Ir&&r.clear(),e}),r=t.cache;return t}(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(Ur,function(e,r,n,o){t.push(n?o.replace(Gr,"$1"):r||e)}),t});var Hr=function(e,t){for(var r=-1,n=null==e?0:e.length,o=Array(n);++r<n;)o[r]=t(e[r],r,e);return o},Jr=1/0,Kr=O?O.prototype:void 0,Qr=Kr?Kr.toString:void 0;var Xr=function e(t){if("string"==typeof t)return t;if(N(t))return Hr(t,e)+"";if(Vr(t))return Qr?Qr.call(t):"";var r=t+"";return"0"==r&&1/t==-Jr?"-0":r};var Zr=function(e){return null==e?"":Xr(e)};var en=function(e,t){return N(e)?e:$r(e,t)?[e]:Wr(Zr(e))},tn=1/0;var rn=function(e){if("string"==typeof e||Vr(e))return e;var t=e+"";return"0"==t&&1/e==-tn?"-0":t};var nn=function(e,t){for(var r=0,n=(t=en(t,e)).length;null!=e&&r<n;)e=e[rn(t[r++])];return r&&r==n?e:void 0};var on=function(e,t,r){var n=null==e?void 0:nn(e,t);return void 0===n?r:n};var an=function(e,t){return null!=e&&t in Object(e)};var un=function(e,t,r){for(var n=-1,o=(t=en(t,e)).length,a=!1;++n<o;){var i=rn(t[n]);if(!(a=null!=e&&r(e,i)))break;e=e[i]}return a||++n!=o?a:!!(o=null==e?0:e.length)&&ee(o)&&X(i,o)&&(N(e)||W(e))};var cn=function(e,t){return null!=e&&un(e,t,an)},fn=1,sn=2;var ln=function(e,t){return $r(e)&&Tr(t)?Nr(rn(e),t):function(r){var n=on(r,e);return void 0===n&&n===t?cn(r,e):Dr(t,n,fn|sn)}};var pn=function(e){return e};var vn=function(e){return function(t){return null==t?void 0:t[e]}};var dn=function(e){return function(t){return nn(t,e)}};var hn=function(e){return $r(e)?vn(rn(e)):dn(e)};var yn=function(e){return"function"==typeof e?e:null==e?pn:"object"==typeof e?N(e)?ln(e[0],e[1]):Fr(e):hn(e)};var bn=function(e,t,r,n,o){return o(e,function(e,o,a){r=n?(n=!1,e):t(r,e,o,a)}),r};var gn=function(e,t,r){var n=N(e)?M:bn,o=arguments.length<3;return n(e,yn(t,4),r,o,we)},_n=Object.prototype.hasOwnProperty;var jn=function(e,t){return null!=e&&_n.call(e,t)};var mn=function(e,t){return null!=e&&un(e,t,jn)},On="[object RegExp]";var wn=function(e){return F(e)&&k(e)==On},En=oe&&oe.isRegExp,Sn=En?ne(En):wn,Pn="[object Date]";var xn=function(e){return F(e)&&k(e)==Pn},Dn=oe&&oe.isDate,An=Dn?ne(Dn):xn,Rn=le(Object.getPrototypeOf,Object),zn="[object Object]",Tn=Function.prototype,kn=Object.prototype,Nn=Tn.toString,Fn=kn.hasOwnProperty,Ln=Nn.call(Object);var Vn=function(e){if(!F(e)||k(e)!=zn)return!1;var t=Rn(e);if(null===t)return!0;var r=Fn.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&Nn.call(r)==Ln},Cn="undefined"!=typeof Element,Mn="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103,$n=function(e){return e.$$typeof===Mn};function Yn(e,t,r,n,o){return r.push({diffType:o,pathString:n,prevValue:e,nextValue:t}),o!==f.different}function qn(e,t,r){try{var n=[];return function e(t,r,n){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";if(t===r)return!0;if(!t||!r)return Yn(t,r,n,o,f.different);if(N(t)&&N(r)){var a=t.length;if(a!==r.length)return Yn(t,r,n,o,f.different);for(var i=!0,u=a;0!=u--;)e(t[u],r[u],n,"".concat(o,"[").concat(u,"]"))||(i=!1);return Yn(t,r,n,o,i?f.deepEquals:f.different)}if(An(t)&&An(r))return t.getTime()===r.getTime()?Yn(t,r,n,o,f.date):Yn(t,r,n,o,f.different);if(Sn(t)&&Sn(r))return t.toString()===r.toString()?Yn(t,r,n,o,f.regex):Yn(t,r,n,o,f.different);if(Cn&&t instanceof Element&&r instanceof Element)return Yn(t,r,n,o,f.different);if($n(t)&&$n(r))return t.type===r.type?Yn(t,r,n,o,f.reactElement):Yn(t,r,n,o,f.different);if(je(t)&&je(r))return t.name===r.name?Yn(t,r,n,o,f.function):Yn(t,r,n,o,f.different);if(Vn(t)&&Vn(r)){var c=Oe(t),s=c.length;if(s!==Oe(r).length)return Yn(t,r,n,o,f.different);for(var l=s;0!=l--;)if(!mn(r,c[l]))return Yn(t,r,n,o,f.different);for(var p=!0,v=s;0!=v--;){var d=c[v];e(t[d],r[d],n,"".concat(o,".").concat(d))||(p=!1)}return Yn(t,r,n,o,p?f.deepEquals:f.different)}return Yn(t,r,n,o,f.different)}(e,t,n,r),n}catch(e){if(e.message&&e.message.match(/stack|recursion/i)||-2146828260===e.number)return console.warn("Warning: why-did-you-render couldn't handle circular references in props.",e.name,e.message),!1;throw e}}var Bn={};function In(e,t){if(e===t)return!1;var n=e||Bn,o=t||Bn,a=Oe(r({},n,o));return gn(a,function(e,t){var r=qn(n[t],o[t],t);return r&&(e=[].concat(u(e||[]),u(r))),e},[])}function Un(e,t,r,n){return{propsDifferences:In(e,r),stateDifferences:In(t,n)}}function Gn(e){var t=e.Component,r=e.displayName,n=e.prevProps,o=e.prevState,a=e.nextProps,i=e.nextState;return{Component:t,displayName:r,prevProps:n,prevState:o,nextProps:a,nextState:i,options:e.options,reason:Un(n,o,a,i)}}function Wn(t,r,u,c){var f=function(u){function f(e,r){var o,i,u;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,f),i=this,u=n(f).call(this,e,r),(o=!u||"object"!=typeof u&&"function"!=typeof u?a(i):u).render&&!t.prototype.render){var c=o.render;o.render=function(){return f.prototype.render.apply(a(a(o))),c()}}return o}var s,l,p;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&o(e,t)}(f,t),s=f,(l=[{key:"render",value:function(){return this._prevProps&&c.notifier(Gn({Component:t,displayName:r,prevProps:this._prevProps,prevState:this._prevState,nextProps:this.props,nextState:this.state,options:c})),this._prevProps=this.props,this._prevState=this.state,i(n(f.prototype),"render",this)&&i(n(f.prototype),"render",this).call(this)}}])&&e(s.prototype,l),p&&e(s,p),f}();return Object.assign(f,t,{displayName:r}),f}function Hn(e,t,r,n,o){return t.prototype&&t.prototype.isReactComponent?Wn(t,r,0,o):function(e,t,r,n){var o=void 0;function a(r){return o&&n.notifier(Gn({Component:e,displayName:t,prevProps:o,nextProps:r,options:n})),o=r,e(r)}return Object.assign(a,e,{displayName:t}),a}(t,r,0,o)}return function(e,t){var r=y(t),n=e.createElement,o=e.createFactory,a=new WeakMap;return e.createElement=function(t){for(var o="function"==typeof t&&function(e,t,r){return!(function(e,t){return t.exclude&&t.exclude.length>0&&t.exclude.some(function(t){return t.test(e)})}(t,r)||!e.whyDidYouRender&&!function(e,t){return t.include&&t.include.length>0&&t.include.some(function(t){return t.test(e)})}(t,r))}(t,C(t),r),i=arguments.length,u=new Array(i>1?i-1:0),c=1;c<i;c++)u[c-1]=arguments[c];if(!o)return n.apply(e,[t].concat(u));var f=t&&t.whyDidYouRender&&t.whyDidYouRender.customName||C(t),s=function(e,t,r,n,o){if(e.has(t))return e.get(t);var a=Hn(0,t,r,0,o);return e.set(t,a),a}(a,t,f,0,r);return n.apply(e,[s].concat(u))},Object.assign(e.createElement,n),e.createFactory=function(t){var r=e.createElement.bind(null,t);return r.type=t,r},Object.assign(e.createFactory,o),e.__REVERT_WHY_DID_YOU_RENDER__=function(){e.createElement=n,e.createFactory=o,a=null,delete e.__REVERT_WHY_DID_YOU_RENDER__},e}}); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).whyDidYouRender=t()}(this,function(){"use strict";function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function t(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function r(e){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{},o=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),o.forEach(function(r){t(e,r,n[r])})}return e}function n(e){return(n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function o(e,t){return(o=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function a(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function i(e,t,r){return(i="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var o=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=n(e)););return e}(e,t);if(o){var a=Object.getOwnPropertyDescriptor(o,t);return a.get?a.get.call(r):a.value}})(e,t,r||e)}function u(e){return function(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t<e.length;t++)r[t]=e[t];return r}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}var c,f={different:"different",deepEquals:"deepEquals",date:"date",regex:"regex",reactElement:"reactElement",function:"function"},s="http://bit.ly/wdyr02",l=(t(c={},f.different,"different objects."),t(c,f.deepEquals,"different objects that are equal by value."),t(c,f.date,"different date objects with the same value."),t(c,f.regex,"different regular expressions with the same value."),t(c,f.reactElement,"different React elements with the same displayName."),t(c,f.function,"different functions with the same name."),c),p=!1;function v(e,r,n,o,a,i,u){a&&a.length>0?(u.consoleLog(t({},r,e),"".concat(n," of ").concat(o," changes:")),a.forEach(function(e){var r=e.pathString,n=e.diffType,a=e.prevValue,i=e.nextValue;u.consoleGroup("%c".concat(o,".%c").concat(r,"%c"),"color:blue;","color:red;","color:black;"),u.consoleLog("".concat(l[n]," (more info at ").concat(s,")")),u.consoleLog(t({},"prev ".concat(r),a),"!==",t({},"next ".concat(r),i)),u.consoleGroupEnd()})):a&&(u.consoleLog(t({},r,e),"".concat(n," the ").concat(o," object itself changed but it's values are all equal."),"props"===o?"This could of been avoided by making the component pure, or by preventing it's father from re-rendering.":"This usually means this component called setState when no changes in it's state actually occurred.","more info at ".concat(s)),u.consoleLog("prev ".concat(o,":"),i.prev," !== ",i.next,":next ".concat(o)))}function h(e){var r=e.Component,n=e.displayName,o=e.prevProps,a=e.prevState,i=e.nextProps,u=e.nextState,c=e.reason,l=e.options;if(function(e,t,r){return!(p||!r.logOnDifferentValues&&(!t.whyDidYouRender||!t.whyDidYouRender.logOnDifferentValues)&&(e.propsDifferences&&e.propsDifferences.some(function(e){return e.diffType===f.different})||e.stateDifferences&&e.stateDifferences.some(function(e){return e.diffType===f.different})))}(c,r,l)){l.consoleGroup("%c".concat(n),"color: #058;");var h="Re-rendered because";c.propsDifferences&&(v(r,n,h,"props",c.propsDifferences,{prev:o,next:i},l),h="And because"),c.stateDifferences&&v(r,n,h,"state",c.stateDifferences,{prev:a,next:u},l),c.propsDifferences||c.stateDifferences||l.consoleLog(t({},n,r),"Re-rendered although props and state objects are the same.","This usually means there was a call to this.forceUpdate() inside the component.","more info at ".concat(s)),l.consoleGroupEnd()}}var d=function(){};function y(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=console.group,o=console.groupEnd;return t.collapseGroups?n=console.groupCollapsed:t.onlyLogs&&(n=console.log,o=d),r({include:null,exclude:null,notifier:t.notifier||((e=t.hasOwnProperty("hotReloadBufferMs")?t.hotReloadBufferMs:500)&&module&&module.hot&&module.hot.addStatusHandler&&module.hot.addStatusHandler(function(t){"idle"===t&&(p=!0,setTimeout(function(){p=!1},e))}),h),onlyLogs:!1,consoleLog:console.log,consoleGroup:n,consoleGroupEnd:o,logOnDifferentValues:!1},t)}var b="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function g(e,t){return e(t={exports:{}},t.exports),t.exports}var _="object"==typeof b&&b&&b.Object===Object&&b,j="object"==typeof self&&self&&self.Object===Object&&self,m=_||j||Function("return this")(),O=m.Symbol,w=Object.prototype,E=w.hasOwnProperty,S=w.toString,P=O?O.toStringTag:void 0;var x=function(e){var t=E.call(e,P),r=e[P];try{e[P]=void 0;var n=!0}catch(e){}var o=S.call(e);return n&&(t?e[P]=r:delete e[P]),o},D=Object.prototype.toString;var A=function(e){return D.call(e)},R="[object Null]",z="[object Undefined]",T=O?O.toStringTag:void 0;var k=function(e){return null==e?void 0===e?z:R:T&&T in Object(e)?x(e):A(e)},N=Array.isArray;var F=function(e){return null!=e&&"object"==typeof e},L="[object String]";var V=function(e){return"string"==typeof e||!N(e)&&F(e)&&k(e)==L};function C(e){return e.displayName||e.name||(V(e)?e:void 0)}var M=function(e,t,r,n){var o=-1,a=null==e?0:e.length;for(n&&a&&(r=e[++o]);++o<a;)r=t(r,e[o],o,e);return r};var $=function(e){return function(t,r,n){for(var o=-1,a=Object(t),i=n(t),u=i.length;u--;){var c=i[e?u:++o];if(!1===r(a[c],c,a))break}return t}}();var Y=function(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n},q="[object Arguments]";var B=function(e){return F(e)&&k(e)==q},I=Object.prototype,U=I.hasOwnProperty,G=I.propertyIsEnumerable,W=B(function(){return arguments}())?B:function(e){return F(e)&&U.call(e,"callee")&&!G.call(e,"callee")};var H=function(){return!1},J=g(function(e,t){var r=t&&!t.nodeType&&t,n=r&&e&&!e.nodeType&&e,o=n&&n.exports===r?m.Buffer:void 0,a=(o?o.isBuffer:void 0)||H;e.exports=a}),K=9007199254740991,Q=/^(?:0|[1-9]\d*)$/;var X=function(e,t){var r=typeof e;return!!(t=null==t?K:t)&&("number"==r||"symbol"!=r&&Q.test(e))&&e>-1&&e%1==0&&e<t},Z=9007199254740991;var ee=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=Z},te={};te["[object Float32Array]"]=te["[object Float64Array]"]=te["[object Int8Array]"]=te["[object Int16Array]"]=te["[object Int32Array]"]=te["[object Uint8Array]"]=te["[object Uint8ClampedArray]"]=te["[object Uint16Array]"]=te["[object Uint32Array]"]=!0,te["[object Arguments]"]=te["[object Array]"]=te["[object ArrayBuffer]"]=te["[object Boolean]"]=te["[object DataView]"]=te["[object Date]"]=te["[object Error]"]=te["[object Function]"]=te["[object Map]"]=te["[object Number]"]=te["[object Object]"]=te["[object RegExp]"]=te["[object Set]"]=te["[object String]"]=te["[object WeakMap]"]=!1;var re=function(e){return F(e)&&ee(e.length)&&!!te[k(e)]};var ne=function(e){return function(t){return e(t)}},oe=g(function(e,t){var r=t&&!t.nodeType&&t,n=r&&e&&!e.nodeType&&e,o=n&&n.exports===r&&_.process,a=function(){try{var e=n&&n.require&&n.require("util").types;return e||o&&o.binding&&o.binding("util")}catch(e){}}();e.exports=a}),ae=oe&&oe.isTypedArray,ie=ae?ne(ae):re,ue=Object.prototype.hasOwnProperty;var ce=function(e,t){var r=N(e),n=!r&&W(e),o=!r&&!n&&J(e),a=!r&&!n&&!o&&ie(e),i=r||n||o||a,u=i?Y(e.length,String):[],c=u.length;for(var f in e)!t&&!ue.call(e,f)||i&&("length"==f||o&&("offset"==f||"parent"==f)||a&&("buffer"==f||"byteLength"==f||"byteOffset"==f)||X(f,c))||u.push(f);return u},fe=Object.prototype;var se=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||fe)};var le=function(e,t){return function(r){return e(t(r))}},pe=le(Object.keys,Object),ve=Object.prototype.hasOwnProperty;var he=function(e){if(!se(e))return pe(e);var t=[];for(var r in Object(e))ve.call(e,r)&&"constructor"!=r&&t.push(r);return t};var de=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},ye="[object AsyncFunction]",be="[object Function]",ge="[object GeneratorFunction]",_e="[object Proxy]";var je=function(e){if(!de(e))return!1;var t=k(e);return t==be||t==ge||t==ye||t==_e};var me=function(e){return null!=e&&ee(e.length)&&!je(e)};var Oe=function(e){return me(e)?ce(e):he(e)};var we=function(e,t){return function(r,n){if(null==r)return r;if(!me(r))return e(r,n);for(var o=r.length,a=t?o:-1,i=Object(r);(t?a--:++a<o)&&!1!==n(i[a],a,i););return r}}(function(e,t){return e&&$(e,t,Oe)});var Ee=function(){this.__data__=[],this.size=0};var Se=function(e,t){return e===t||e!=e&&t!=t};var Pe=function(e,t){for(var r=e.length;r--;)if(Se(e[r][0],t))return r;return-1},xe=Array.prototype.splice;var De=function(e){var t=this.__data__,r=Pe(t,e);return!(r<0||(r==t.length-1?t.pop():xe.call(t,r,1),--this.size,0))};var Ae=function(e){var t=this.__data__,r=Pe(t,e);return r<0?void 0:t[r][1]};var Re=function(e){return Pe(this.__data__,e)>-1};var ze=function(e,t){var r=this.__data__,n=Pe(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this};function Te(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Te.prototype.clear=Ee,Te.prototype.delete=De,Te.prototype.get=Ae,Te.prototype.has=Re,Te.prototype.set=ze;var ke=Te;var Ne=function(){this.__data__=new ke,this.size=0};var Fe=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r};var Le=function(e){return this.__data__.get(e)};var Ve,Ce=function(e){return this.__data__.has(e)},Me=m["__core-js_shared__"],$e=(Ve=/[^.]+$/.exec(Me&&Me.keys&&Me.keys.IE_PROTO||""))?"Symbol(src)_1."+Ve:"";var Ye=function(e){return!!$e&&$e in e},qe=Function.prototype.toString;var Be=function(e){if(null!=e){try{return qe.call(e)}catch(e){}try{return e+""}catch(e){}}return""},Ie=/^\[object .+?Constructor\]$/,Ue=Function.prototype,Ge=Object.prototype,We=Ue.toString,He=Ge.hasOwnProperty,Je=RegExp("^"+We.call(He).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var Ke=function(e){return!(!de(e)||Ye(e))&&(je(e)?Je:Ie).test(Be(e))};var Qe=function(e,t){return null==e?void 0:e[t]};var Xe=function(e,t){var r=Qe(e,t);return Ke(r)?r:void 0},Ze=Xe(m,"Map"),et=Xe(Object,"create");var tt=function(){this.__data__=et?et(null):{},this.size=0};var rt=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},nt="__lodash_hash_undefined__",ot=Object.prototype.hasOwnProperty;var at=function(e){var t=this.__data__;if(et){var r=t[e];return r===nt?void 0:r}return ot.call(t,e)?t[e]:void 0},it=Object.prototype.hasOwnProperty;var ut=function(e){var t=this.__data__;return et?void 0!==t[e]:it.call(t,e)},ct="__lodash_hash_undefined__";var ft=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=et&&void 0===t?ct:t,this};function st(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}st.prototype.clear=tt,st.prototype.delete=rt,st.prototype.get=at,st.prototype.has=ut,st.prototype.set=ft;var lt=st;var pt=function(){this.size=0,this.__data__={hash:new lt,map:new(Ze||ke),string:new lt}};var vt=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e};var ht=function(e,t){var r=e.__data__;return vt(t)?r["string"==typeof t?"string":"hash"]:r.map};var dt=function(e){var t=ht(this,e).delete(e);return this.size-=t?1:0,t};var yt=function(e){return ht(this,e).get(e)};var bt=function(e){return ht(this,e).has(e)};var gt=function(e,t){var r=ht(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this};function _t(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}_t.prototype.clear=pt,_t.prototype.delete=dt,_t.prototype.get=yt,_t.prototype.has=bt,_t.prototype.set=gt;var jt=_t,mt=200;var Ot=function(e,t){var r=this.__data__;if(r instanceof ke){var n=r.__data__;if(!Ze||n.length<mt-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new jt(n)}return r.set(e,t),this.size=r.size,this};function wt(e){var t=this.__data__=new ke(e);this.size=t.size}wt.prototype.clear=Ne,wt.prototype.delete=Fe,wt.prototype.get=Le,wt.prototype.has=Ce,wt.prototype.set=Ot;var Et=wt,St="__lodash_hash_undefined__";var Pt=function(e){return this.__data__.set(e,St),this};var xt=function(e){return this.__data__.has(e)};function Dt(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new jt;++t<r;)this.add(e[t])}Dt.prototype.add=Dt.prototype.push=Pt,Dt.prototype.has=xt;var At=Dt;var Rt=function(e,t){for(var r=-1,n=null==e?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1};var zt=function(e,t){return e.has(t)},Tt=1,kt=2;var Nt=function(e,t,r,n,o,a){var i=r&Tt,u=e.length,c=t.length;if(u!=c&&!(i&&c>u))return!1;var f=a.get(e);if(f&&a.get(t))return f==t;var s=-1,l=!0,p=r&kt?new At:void 0;for(a.set(e,t),a.set(t,e);++s<u;){var v=e[s],h=t[s];if(n)var d=i?n(h,v,s,t,e,a):n(v,h,s,e,t,a);if(void 0!==d){if(d)continue;l=!1;break}if(p){if(!Rt(t,function(e,t){if(!zt(p,t)&&(v===e||o(v,e,r,n,a)))return p.push(t)})){l=!1;break}}else if(v!==h&&!o(v,h,r,n,a)){l=!1;break}}return a.delete(e),a.delete(t),l},Ft=m.Uint8Array;var Lt=function(e){var t=-1,r=Array(e.size);return e.forEach(function(e,n){r[++t]=[n,e]}),r};var Vt=function(e){var t=-1,r=Array(e.size);return e.forEach(function(e){r[++t]=e}),r},Ct=1,Mt=2,$t="[object Boolean]",Yt="[object Date]",qt="[object Error]",Bt="[object Map]",It="[object Number]",Ut="[object RegExp]",Gt="[object Set]",Wt="[object String]",Ht="[object Symbol]",Jt="[object ArrayBuffer]",Kt="[object DataView]",Qt=O?O.prototype:void 0,Xt=Qt?Qt.valueOf:void 0;var Zt=function(e,t,r,n,o,a,i){switch(r){case Kt:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case Jt:return!(e.byteLength!=t.byteLength||!a(new Ft(e),new Ft(t)));case $t:case Yt:case It:return Se(+e,+t);case qt:return e.name==t.name&&e.message==t.message;case Ut:case Wt:return e==t+"";case Bt:var u=Lt;case Gt:var c=n&Ct;if(u||(u=Vt),e.size!=t.size&&!c)return!1;var f=i.get(e);if(f)return f==t;n|=Mt,i.set(e,t);var s=Nt(u(e),u(t),n,o,a,i);return i.delete(e),s;case Ht:if(Xt)return Xt.call(e)==Xt.call(t)}return!1};var er=function(e,t){for(var r=-1,n=t.length,o=e.length;++r<n;)e[o+r]=t[r];return e};var tr=function(e,t,r){var n=t(e);return N(e)?n:er(n,r(e))};var rr=function(e,t){for(var r=-1,n=null==e?0:e.length,o=0,a=[];++r<n;){var i=e[r];t(i,r,e)&&(a[o++]=i)}return a};var nr=function(){return[]},or=Object.prototype.propertyIsEnumerable,ar=Object.getOwnPropertySymbols,ir=ar?function(e){return null==e?[]:(e=Object(e),rr(ar(e),function(t){return or.call(e,t)}))}:nr;var ur=function(e){return tr(e,Oe,ir)},cr=1,fr=Object.prototype.hasOwnProperty;var sr=function(e,t,r,n,o,a){var i=r&cr,u=ur(e),c=u.length;if(c!=ur(t).length&&!i)return!1;for(var f=c;f--;){var s=u[f];if(!(i?s in t:fr.call(t,s)))return!1}var l=a.get(e);if(l&&a.get(t))return l==t;var p=!0;a.set(e,t),a.set(t,e);for(var v=i;++f<c;){var h=e[s=u[f]],d=t[s];if(n)var y=i?n(d,h,s,t,e,a):n(h,d,s,e,t,a);if(!(void 0===y?h===d||o(h,d,r,n,a):y)){p=!1;break}v||(v="constructor"==s)}if(p&&!v){var b=e.constructor,g=t.constructor;b!=g&&"constructor"in e&&"constructor"in t&&!("function"==typeof b&&b instanceof b&&"function"==typeof g&&g instanceof g)&&(p=!1)}return a.delete(e),a.delete(t),p},lr=Xe(m,"DataView"),pr=Xe(m,"Promise"),vr=Xe(m,"Set"),hr=Xe(m,"WeakMap"),dr=Be(lr),yr=Be(Ze),br=Be(pr),gr=Be(vr),_r=Be(hr),jr=k;(lr&&"[object DataView]"!=jr(new lr(new ArrayBuffer(1)))||Ze&&"[object Map]"!=jr(new Ze)||pr&&"[object Promise]"!=jr(pr.resolve())||vr&&"[object Set]"!=jr(new vr)||hr&&"[object WeakMap]"!=jr(new hr))&&(jr=function(e){var t=k(e),r="[object Object]"==t?e.constructor:void 0,n=r?Be(r):"";if(n)switch(n){case dr:return"[object DataView]";case yr:return"[object Map]";case br:return"[object Promise]";case gr:return"[object Set]";case _r:return"[object WeakMap]"}return t});var mr=jr,Or=1,wr="[object Arguments]",Er="[object Array]",Sr="[object Object]",Pr=Object.prototype.hasOwnProperty;var xr=function(e,t,r,n,o,a){var i=N(e),u=N(t),c=i?Er:mr(e),f=u?Er:mr(t),s=(c=c==wr?Sr:c)==Sr,l=(f=f==wr?Sr:f)==Sr,p=c==f;if(p&&J(e)){if(!J(t))return!1;i=!0,s=!1}if(p&&!s)return a||(a=new Et),i||ie(e)?Nt(e,t,r,n,o,a):Zt(e,t,c,r,n,o,a);if(!(r&Or)){var v=s&&Pr.call(e,"__wrapped__"),h=l&&Pr.call(t,"__wrapped__");if(v||h){var d=v?e.value():e,y=h?t.value():t;return a||(a=new Et),o(d,y,r,n,a)}}return!!p&&(a||(a=new Et),sr(e,t,r,n,o,a))};var Dr=function e(t,r,n,o,a){return t===r||(null==t||null==r||!F(t)&&!F(r)?t!=t&&r!=r:xr(t,r,n,o,e,a))},Ar=1,Rr=2;var zr=function(e,t,r,n){var o=r.length,a=o,i=!n;if(null==e)return!a;for(e=Object(e);o--;){var u=r[o];if(i&&u[2]?u[1]!==e[u[0]]:!(u[0]in e))return!1}for(;++o<a;){var c=(u=r[o])[0],f=e[c],s=u[1];if(i&&u[2]){if(void 0===f&&!(c in e))return!1}else{var l=new Et;if(n)var p=n(f,s,c,e,t,l);if(!(void 0===p?Dr(s,f,Ar|Rr,n,l):p))return!1}}return!0};var Tr=function(e){return e==e&&!de(e)};var kr=function(e){for(var t=Oe(e),r=t.length;r--;){var n=t[r],o=e[n];t[r]=[n,o,Tr(o)]}return t};var Nr=function(e,t){return function(r){return null!=r&&r[e]===t&&(void 0!==t||e in Object(r))}};var Fr=function(e){var t=kr(e);return 1==t.length&&t[0][2]?Nr(t[0][0],t[0][1]):function(r){return r===e||zr(r,e,t)}},Lr="[object Symbol]";var Vr=function(e){return"symbol"==typeof e||F(e)&&k(e)==Lr},Cr=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Mr=/^\w*$/;var $r=function(e,t){if(N(e))return!1;var r=typeof e;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!Vr(e))||Mr.test(e)||!Cr.test(e)||null!=t&&e in Object(t)},Yr="Expected a function";function qr(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError(Yr);var r=function(){var n=arguments,o=t?t.apply(this,n):n[0],a=r.cache;if(a.has(o))return a.get(o);var i=e.apply(this,n);return r.cache=a.set(o,i)||a,i};return r.cache=new(qr.Cache||jt),r}qr.Cache=jt;var Br=qr,Ir=500;var Ur=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Gr=/\\(\\)?/g,Wr=function(e){var t=Br(e,function(e){return r.size===Ir&&r.clear(),e}),r=t.cache;return t}(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(Ur,function(e,r,n,o){t.push(n?o.replace(Gr,"$1"):r||e)}),t});var Hr=function(e,t){for(var r=-1,n=null==e?0:e.length,o=Array(n);++r<n;)o[r]=t(e[r],r,e);return o},Jr=1/0,Kr=O?O.prototype:void 0,Qr=Kr?Kr.toString:void 0;var Xr=function e(t){if("string"==typeof t)return t;if(N(t))return Hr(t,e)+"";if(Vr(t))return Qr?Qr.call(t):"";var r=t+"";return"0"==r&&1/t==-Jr?"-0":r};var Zr=function(e){return null==e?"":Xr(e)};var en=function(e,t){return N(e)?e:$r(e,t)?[e]:Wr(Zr(e))},tn=1/0;var rn=function(e){if("string"==typeof e||Vr(e))return e;var t=e+"";return"0"==t&&1/e==-tn?"-0":t};var nn=function(e,t){for(var r=0,n=(t=en(t,e)).length;null!=e&&r<n;)e=e[rn(t[r++])];return r&&r==n?e:void 0};var on=function(e,t,r){var n=null==e?void 0:nn(e,t);return void 0===n?r:n};var an=function(e,t){return null!=e&&t in Object(e)};var un=function(e,t,r){for(var n=-1,o=(t=en(t,e)).length,a=!1;++n<o;){var i=rn(t[n]);if(!(a=null!=e&&r(e,i)))break;e=e[i]}return a||++n!=o?a:!!(o=null==e?0:e.length)&&ee(o)&&X(i,o)&&(N(e)||W(e))};var cn=function(e,t){return null!=e&&un(e,t,an)},fn=1,sn=2;var ln=function(e,t){return $r(e)&&Tr(t)?Nr(rn(e),t):function(r){var n=on(r,e);return void 0===n&&n===t?cn(r,e):Dr(t,n,fn|sn)}};var pn=function(e){return e};var vn=function(e){return function(t){return null==t?void 0:t[e]}};var hn=function(e){return function(t){return nn(t,e)}};var dn=function(e){return $r(e)?vn(rn(e)):hn(e)};var yn=function(e){return"function"==typeof e?e:null==e?pn:"object"==typeof e?N(e)?ln(e[0],e[1]):Fr(e):dn(e)};var bn=function(e,t,r,n,o){return o(e,function(e,o,a){r=n?(n=!1,e):t(r,e,o,a)}),r};var gn=function(e,t,r){var n=N(e)?M:bn,o=arguments.length<3;return n(e,yn(t,4),r,o,we)},_n=Object.prototype.hasOwnProperty;var jn=function(e,t){return null!=e&&_n.call(e,t)};var mn=function(e,t){return null!=e&&un(e,t,jn)},On="[object RegExp]";var wn=function(e){return F(e)&&k(e)==On},En=oe&&oe.isRegExp,Sn=En?ne(En):wn,Pn="[object Date]";var xn=function(e){return F(e)&&k(e)==Pn},Dn=oe&&oe.isDate,An=Dn?ne(Dn):xn,Rn=le(Object.getPrototypeOf,Object),zn="[object Object]",Tn=Function.prototype,kn=Object.prototype,Nn=Tn.toString,Fn=kn.hasOwnProperty,Ln=Nn.call(Object);var Vn=function(e){if(!F(e)||k(e)!=zn)return!1;var t=Rn(e);if(null===t)return!0;var r=Fn.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&Nn.call(r)==Ln},Cn="undefined"!=typeof Element,Mn="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103,$n=function(e){return e.$$typeof===Mn};function Yn(e,t,r,n,o){return r.push({diffType:o,pathString:n,prevValue:e,nextValue:t}),o!==f.different}function qn(e,t,r){try{var n=[];return function e(t,r,n){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";if(t===r)return!0;if(!t||!r)return Yn(t,r,n,o,f.different);if(N(t)&&N(r)){var a=t.length;if(a!==r.length)return Yn(t,r,n,o,f.different);for(var i=!0,u=a;0!=u--;)e(t[u],r[u],n,"".concat(o,"[").concat(u,"]"))||(i=!1);return Yn(t,r,n,o,i?f.deepEquals:f.different)}if(An(t)&&An(r))return t.getTime()===r.getTime()?Yn(t,r,n,o,f.date):Yn(t,r,n,o,f.different);if(Sn(t)&&Sn(r))return t.toString()===r.toString()?Yn(t,r,n,o,f.regex):Yn(t,r,n,o,f.different);if(Cn&&t instanceof Element&&r instanceof Element)return Yn(t,r,n,o,f.different);if($n(t)&&$n(r))return t.type===r.type?Yn(t,r,n,o,f.reactElement):Yn(t,r,n,o,f.different);if(je(t)&&je(r))return t.name===r.name?Yn(t,r,n,o,f.function):Yn(t,r,n,o,f.different);if(Vn(t)&&Vn(r)){var c=Oe(t),s=c.length;if(s!==Oe(r).length)return Yn(t,r,n,o,f.different);for(var l=s;0!=l--;)if(!mn(r,c[l]))return Yn(t,r,n,o,f.different);for(var p=!0,v=s;0!=v--;){var h=c[v];e(t[h],r[h],n,"".concat(o,".").concat(h))||(p=!1)}return Yn(t,r,n,o,p?f.deepEquals:f.different)}return Yn(t,r,n,o,f.different)}(e,t,n,r),n}catch(e){if(e.message&&e.message.match(/stack|recursion/i)||-2146828260===e.number)return console.warn("Warning: why-did-you-render couldn't handle circular references in props.",e.name,e.message),!1;throw e}}var Bn={};function In(e,t){if(e===t)return!1;var n=e||Bn,o=t||Bn,a=Oe(r({},n,o));return gn(a,function(e,t){var r=qn(n[t],o[t],t);return r&&(e=[].concat(u(e||[]),u(r))),e},[])}function Un(e,t,r,n){return{propsDifferences:In(e,r),stateDifferences:In(t,n)}}function Gn(e){var t=e.Component,r=e.displayName,n=e.prevProps,o=e.prevState,a=e.nextProps,i=e.nextState;return{Component:t,displayName:r,prevProps:n,prevState:o,nextProps:a,nextState:i,options:e.options,reason:Un(n,o,a,i)}}function Wn(t,r,u,c){var f=function(u){function f(e,r){var o,i,u;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,f),i=this,u=n(f).call(this,e,r),(o=!u||"object"!=typeof u&&"function"!=typeof u?a(i):u).render&&!t.prototype.render){var c=o.render;o.render=function(){return f.prototype.render.apply(a(a(o))),c()}}return o}var s,l,p;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&o(e,t)}(f,t),s=f,(l=[{key:"render",value:function(){return this._prevProps&&c.notifier(Gn({Component:t,displayName:r,prevProps:this._prevProps,prevState:this._prevState,nextProps:this.props,nextState:this.state,options:c})),this._prevProps=this.props,this._prevState=this.state,i(n(f.prototype),"render",this)&&i(n(f.prototype),"render",this).call(this)}}])&&e(s.prototype,l),p&&e(s,p),f}();return Object.assign(f,t,{displayName:r}),f}function Hn(e,t,r,n,o){return t.prototype&&t.prototype.isReactComponent?Wn(t,r,0,o):function(e,t,r,n){function o(o){var a=r.useRef(),i=a.current;return a.current=o,i&&n.notifier(Gn({Component:e,displayName:t,prevProps:i,nextProps:o,options:n})),e(o)}return Object.assign(o,e,{displayName:t}),o}(t,r,n,o)}return function(e,t){var r=y(t),n=e.createElement,o=e.createFactory,a=new WeakMap;return e.createElement=function(t){for(var o="function"==typeof t&&function(e,t,r){return!(function(e,t){return t.exclude&&t.exclude.length>0&&t.exclude.some(function(t){return t.test(e)})}(t,r)||!e.whyDidYouRender&&!function(e,t){return t.include&&t.include.length>0&&t.include.some(function(t){return t.test(e)})}(t,r))}(t,C(t),r),i=arguments.length,u=new Array(i>1?i-1:0),c=1;c<i;c++)u[c-1]=arguments[c];if(!o)return n.apply(e,[t].concat(u));var f=t&&t.whyDidYouRender&&t.whyDidYouRender.customName||C(t),s=function(e,t,r,n,o){if(e.has(t))return e.get(t);var a=Hn(0,t,r,n,o);return e.set(t,a),a}(a,t,f,e,r);return n.apply(e,[s].concat(u))},Object.assign(e.createElement,n),e.createFactory=function(t){var r=e.createElement.bind(null,t);return r.type=t,r},Object.assign(e.createFactory,o),e.__REVERT_WHY_DID_YOU_RENDER__=function(){e.createElement=n,e.createFactory=o,a=null,delete e.__REVERT_WHY_DID_YOU_RENDER__},e}}); | ||
//# sourceMappingURL=whyDidYouRender.min.js.map |
{ | ||
"name": "@welldone-software/why-did-you-render", | ||
"version": "2.5.0", | ||
"version": "2.5.1", | ||
"description": "Monkey patches React to notify you about avoidable re-renders.", | ||
@@ -40,3 +40,3 @@ "main": "dist/cjs/whyDidYouRender.min.js", | ||
"peerDependencies": { | ||
"react": ">=16.0" | ||
"react": ">=16.8" | ||
}, | ||
@@ -46,4 +46,4 @@ "devDependencies": { | ||
"@babel/core": "^7.2.2", | ||
"@babel/plugin-proposal-class-properties": "^7.2.3", | ||
"@babel/preset-env": "^7.2.3", | ||
"@babel/plugin-proposal-class-properties": "^7.3.0", | ||
"@babel/preset-env": "^7.3.1", | ||
"@babel/preset-react": "^7.0.0", | ||
@@ -54,3 +54,3 @@ "acorn-walk": "^6.1.1", | ||
"babel-eslint": "^10.0.1", | ||
"babel-jest": "^23.6.0", | ||
"babel-jest": "^24.1.0", | ||
"babel-plugin-lodash": "^3.3.4", | ||
@@ -60,4 +60,4 @@ "concurrently": "^4.1.0", | ||
"cross-env": "^5.2.0", | ||
"eslint": "^5.12.1", | ||
"eslint-plugin-jest": "^22.1.3", | ||
"eslint": "^5.13.0", | ||
"eslint-plugin-jest": "^22.2.2", | ||
"eslint-plugin-react": "^7.12.4", | ||
@@ -68,18 +68,19 @@ "eslint-watch": "^4.0.2", | ||
"husky": "^1.3.1", | ||
"jest": "^23.6.0", | ||
"jest-cli": "^23.6.0", | ||
"magic-string": "^0.25.1", | ||
"nollup": "^0.4.0", | ||
"react": "^16.7.0", | ||
"react-dom": "^16.7.0", | ||
"react-hot-loader": "^4.6.3", | ||
"react-test-renderer": "^16.7.0", | ||
"jest": "^24.1.0", | ||
"jest-cli": "^24.1.0", | ||
"magic-string": "^0.25.2", | ||
"nollup": "^0.5.0", | ||
"react": "^16.8.1", | ||
"react-dom": "^16.8.1", | ||
"react-hot-loader": "^4.6.5", | ||
"react-test-renderer": "^16.8.1", | ||
"rimraf": "^2.6.3", | ||
"rollup": "^1.1.0", | ||
"rollup-plugin-babel": "^4.3.1", | ||
"rollup": "^1.1.2", | ||
"rollup-plugin-babel": "^4.3.2", | ||
"rollup-plugin-commonjs": "^9.2.0", | ||
"rollup-plugin-commonjs-alternate": "^0.0.5", | ||
"rollup-plugin-license": "^0.8.1", | ||
"rollup-plugin-node-resolve": "^4.0.0", | ||
"rollup-plugin-replace": "^2.1.0", | ||
"rollup-plugin-terser": "^4.0.2" | ||
"rollup-plugin-terser": "^4.0.4" | ||
}, | ||
@@ -86,0 +87,0 @@ "authors": [ |
@@ -55,3 +55,3 @@ # Why Did You Render | ||
`class constructors must be invoked with |new|`. | ||
`Class constructors must be invoked with 'new'`. | ||
@@ -58,0 +58,0 @@ |
@@ -8,2 +8,7 @@ /* eslint-disable no-console */ | ||
const FunctionalTestComponent = () => ( | ||
<div>hi!</div> | ||
) | ||
FunctionalTestComponent.whyDidYouRender = true | ||
class TestComponent extends React.Component{ | ||
@@ -30,7 +35,7 @@ static whyDidYouRender = true | ||
describe('index', () => { | ||
let updateInfo | ||
let updateInfos = [] | ||
beforeEach(() => { | ||
updateInfo = null | ||
updateInfos = [] | ||
whyDidYouRender(React, { | ||
notifier: _updateInfo => updateInfo = _updateInfo | ||
notifier: updateInfo => updateInfos.push(updateInfo) | ||
}) | ||
@@ -51,6 +56,7 @@ }) | ||
expect(updateInfo.reason).toEqual({ | ||
expect(updateInfos[0].reason).toEqual({ | ||
propsDifferences: [], | ||
stateDifferences: false | ||
}) | ||
expect(updateInfos).toHaveLength(1) | ||
}) | ||
@@ -66,6 +72,7 @@ | ||
expect(updateInfo.reason).toEqual({ | ||
expect(updateInfos[0].reason).toEqual({ | ||
propsDifferences: [], | ||
stateDifferences: false | ||
}) | ||
expect(updateInfos).toHaveLength(1) | ||
}) | ||
@@ -81,6 +88,7 @@ | ||
.then(() => { | ||
expect(updateInfo.reason).toEqual({ | ||
expect(updateInfos[0].reason).toEqual({ | ||
propsDifferences: false, | ||
stateDifferences: [] | ||
}) | ||
expect(updateInfos).toHaveLength(1) | ||
}) | ||
@@ -97,3 +105,3 @@ }) | ||
expect(updateInfo.reason).toEqual({ | ||
expect(updateInfos[0].reason).toEqual({ | ||
propsDifferences: [{ | ||
@@ -107,2 +115,4 @@ pathString: 'a', | ||
}) | ||
expect(updateInfos).toHaveLength(1) | ||
}) | ||
@@ -123,3 +133,3 @@ | ||
expect(updateInfo.reason).toEqual({ | ||
expect(updateInfos[0].reason).toEqual({ | ||
propsDifferences: [{ | ||
@@ -133,2 +143,4 @@ pathString: 'a', | ||
}) | ||
expect(updateInfos).toHaveLength(1) | ||
}) | ||
@@ -155,3 +167,3 @@ | ||
expect(updateInfo.reason).toEqual({ | ||
expect(updateInfos[0].reason).toEqual({ | ||
propsDifferences: [{ | ||
@@ -166,2 +178,3 @@ pathString: 'a', | ||
expect(innerComponentDidUpdateCalled).toBe(true) | ||
expect(updateInfos).toHaveLength(1) | ||
}) | ||
@@ -184,3 +197,3 @@ | ||
expect(updateInfo.reason).toEqual({ | ||
expect(updateInfos[0].reason).toEqual({ | ||
propsDifferences: false, | ||
@@ -199,3 +212,3 @@ stateDifferences: [{ | ||
expect(updateInfo.reason).toEqual({ | ||
expect(updateInfos[1].reason).toEqual({ | ||
propsDifferences: [{ | ||
@@ -209,2 +222,4 @@ pathString: 'a', | ||
}) | ||
expect(updateInfos).toHaveLength(2) | ||
}) | ||
@@ -234,2 +249,3 @@ | ||
expect(resolve).toBe(true) | ||
expect(updateInfos).toHaveLength(0) | ||
}) | ||
@@ -254,3 +270,3 @@ | ||
expect(updateInfo.reason).toEqual({ | ||
expect(updateInfos[0].reason).toEqual({ | ||
propsDifferences: [{ | ||
@@ -264,2 +280,3 @@ pathString: 'a', | ||
}) | ||
expect(updateInfos).toHaveLength(1) | ||
}) | ||
@@ -288,3 +305,3 @@ | ||
expect(updateInfo.reason).toEqual({ | ||
expect(updateInfos[0].reason).toEqual({ | ||
propsDifferences: [{ | ||
@@ -298,2 +315,3 @@ pathString: 'a', | ||
}) | ||
expect(updateInfos).toHaveLength(1) | ||
expect(innerComponentDidUpdateCalled).toBe(true) | ||
@@ -312,6 +330,8 @@ }) | ||
expect(updateInfo.reason).toEqual({ | ||
expect(updateInfos[0].reason).toEqual({ | ||
propsDifferences: [], | ||
stateDifferences: false | ||
}) | ||
expect(updateInfos).toHaveLength(1) | ||
}) | ||
@@ -326,7 +346,89 @@ | ||
expect(updateInfo.reason).toEqual({ | ||
expect(updateInfos[0].reason).toEqual({ | ||
propsDifferences: [], | ||
stateDifferences: false | ||
}) | ||
expect(updateInfos).toHaveLength(1) | ||
}) | ||
test('Several class components', () => { | ||
const testRenderer = TestRenderer.create( | ||
<> | ||
<TestComponent/> | ||
<TestComponent a={{a: 'a'}}/> | ||
<TestComponent/> | ||
</> | ||
) | ||
testRenderer.update( | ||
<> | ||
<TestComponent/> | ||
<TestComponent a={{a: 'a'}}/> | ||
<TestComponent/> | ||
</> | ||
) | ||
expect(updateInfos[0].reason).toEqual({ | ||
propsDifferences: [], | ||
stateDifferences: false | ||
}) | ||
expect(updateInfos[1].reason).toEqual({ | ||
propsDifferences: [{ | ||
diffType: diffTypes.deepEquals, | ||
pathString: 'a', | ||
nextValue: {a: 'a'}, | ||
prevValue: {a: 'a'} | ||
}], | ||
stateDifferences: false | ||
}) | ||
expect(updateInfos[2].reason).toEqual({ | ||
propsDifferences: [], | ||
stateDifferences: false | ||
}) | ||
expect(updateInfos).toHaveLength(3) | ||
}) | ||
test('Several functional components', () => { | ||
const testRenderer = TestRenderer.create( | ||
<> | ||
<FunctionalTestComponent/> | ||
<FunctionalTestComponent a={{a: 'a'}}/> | ||
<FunctionalTestComponent/> | ||
</> | ||
) | ||
testRenderer.update( | ||
<> | ||
<FunctionalTestComponent/> | ||
<FunctionalTestComponent a={{a: 'a'}}/> | ||
<FunctionalTestComponent/> | ||
</> | ||
) | ||
expect(updateInfos[0].reason).toEqual({ | ||
propsDifferences: [], | ||
stateDifferences: false | ||
}) | ||
expect(updateInfos[1].reason).toEqual({ | ||
propsDifferences: [{ | ||
diffType: diffTypes.deepEquals, | ||
pathString: 'a', | ||
nextValue: {a: 'a'}, | ||
prevValue: {a: 'a'} | ||
}], | ||
stateDifferences: false | ||
}) | ||
expect(updateInfos[2].reason).toEqual({ | ||
propsDifferences: [], | ||
stateDifferences: false | ||
}) | ||
expect(updateInfos).toHaveLength(3) | ||
}) | ||
}) |
@@ -45,11 +45,14 @@ import normalizeOptions from './normalizeOptions' | ||
function patchFunctionalComponent(FunctionalComponent, displayName, React, options){ | ||
let _prevProps = undefined | ||
function WDYRFunctionalComponent(nextProps){ | ||
const prevCountRef = React.useRef() | ||
function WDYRFunctionalComponent(props){ | ||
if(_prevProps){ | ||
const prevProps = prevCountRef.current | ||
prevCountRef.current = nextProps | ||
if(prevProps){ | ||
options.notifier(getUpdateInfo({ | ||
Component: FunctionalComponent, | ||
displayName, | ||
prevProps: _prevProps, | ||
nextProps: props, | ||
prevProps, | ||
nextProps, | ||
options | ||
@@ -59,5 +62,3 @@ })) | ||
_prevProps = props | ||
return FunctionalComponent(props) | ||
return FunctionalComponent(nextProps) | ||
} | ||
@@ -64,0 +65,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
813337
10907
38