var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.mergeWithStableProps=void 0;var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));var _deepEqual=function deepEqual(a,b){if(typeof a!==typeof b)return false;if(a===null||b===null)return a===b;if(typeof a==='object'){if(Object.keys(a).length!==Object.keys(b).length||Object.keys(a).some(function(k){return!(k in b);}))return false;return Object.entries(a).every(function(_ref){var _ref2=(0,_slicedToArray2.default)(_ref,2),k=_ref2[0],v=_ref2[1];return _deepEqual(v,b[k]);});}return a===b;};var mergeWithStableProps=exports.mergeWithStableProps=function mergeWithStableProps(oldValue,newValue){if(oldValue===newValue){return newValue;}return Object.keys(oldValue).reduce(function(acc,key){if(key in newValue&&_deepEqual(oldValue[key],newValue[key])){acc[key]=oldValue[key];}return acc;},Object.assign({},newValue));};