import e from"@babel/runtime/helpers/asyncToGenerator";import t from"@babel/runtime/regenerator";import{debounce as r,pick as n,isEqual as s}from"lodash";import"../../../../../clients/jsonApi/index.js";import{saveUserSettings as a}from"../../../api/user-settings/saveUserSettings.js";var i=["isMapHidden","isFilterExpanded","isWellNameExpand","mapStyle"],o=function(o,p){var c=r(function(){var r=e(t.mark((function e(r){var s;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(s=n(r,i),!(Object.keys(s).length>0)){e.next=10;break}return e.prev=2,e.next=5,a(p,s);case 5:e.next=10;break;case 7:e.prev=7,e.t0=e.catch(2),console.error("Failed to save user settings:",e.t0);case 10:case"end":return e.stop()}}),e,null,[[2,7]])})));return function(e){return r.apply(this,arguments)}}(),500);o.subscribe((function(e,t){"loaded"!==e.loadState||s(e.settings,t.settings)||c(e.settings)}))};export{o as subscribeToSettingsSave};
//# sourceMappingURL=subscribeToSettingsSave.js.map
