import e from"@babel/runtime/helpers/defineProperty";import{useCallback as t}from"react";import{normalizeFilters as l}from"../../stores/filter-store/utils/normalizeFilters.js";import{partitionSelectedWellIds as r,applyPartitionToOffsetSettings as s}from"./partitionSelectedWellIds.js";function n(e,t){var l=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),l.push.apply(l,r)}return l}function i(t){for(var l=1;l<arguments.length;l++){var r=null!=arguments[l]?arguments[l]:{};l%2?n(Object(r),!0).forEach((function(l){e(t,l,r[l])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var o=function(e){var n=e.selectedWells,o=e.selectedWellSection,c=e.currentSelectionZone,d=e.offsetSettings,a=e.assetCompanyId,f=e.subjectWellId,p=e.filters,u=e.metricsKeys,b=e.isMapHidden,m=e.isFilterExpanded,y=e.isLimitedOffsetWells,O=e.isLoadAllWells,W=e.isSynced,j=e.idasWellIds,I=e.owsWellIds,S=e.wellhubWellIds,w=e.onClose,v=e.onSave,g=e.resetSafeguard;return{handleSave:t((function(){g(),null==w||w();var e=n.map((function(e){return e.id})),t=r({selectedWellIds:e,subjectWellId:f,idasWellIds:j,owsWellIds:I,wellhubWellIds:S}),P=s(i(i({},d),{},{companyId:a,subjectWellId:f,selectedWellIds:e,filters:l(p),metricsKeys:u,wellSection:o,isSynced:W,mapHidden:b,filterExpanded:m,offsetWellsLimited:y,lastSelectionZone:null!=c?c:void 0,isLoadAllWells:O}),t);null==v||v(P,n)}),[g,w,n,d,a,f,p,u,o,W,b,m,y,c,O,j,I,S,v])}};export{o as usePerformSave};
//# sourceMappingURL=usePerformSave.js.map
