import e from"@babel/runtime/helpers/asyncToGenerator";import l from"@babel/runtime/regenerator";import{useCallback as s}from"react";import{ALL_SECTION_KEY as t}from"../../constants.js";import{useSaveResetDerivedState as d}from"./useSaveResetDerivedState.js";import{usePerformSave as n}from"./usePerformSave.js";import{useCancelHandler as i}from"./useCancelHandler.js";var a=function(a){var o,r,c,f,W,u,S,v,p,I,b=d({externalOffsets:a.externalOffsets,selectedWells:a.selectedWells,selectedWellsCount:a.selectedWellsCount,selectedWellSection:a.selectedWellSection,subjectWellId:a.subjectWellId,rawWellsWithSubject:a.rawWellsWithSubject,maxOffsetSize:a.maxOffsetSize,companyProvider:a.companyProvider,isWDUser:a.isWDUser,isManualWellsEnabled:a.isManualWellsEnabled,hasValidAssetId:a.hasValidAssetId,isAllWellsLoaded:a.isAllWellsLoaded,filters:a.filters,idasWellIds:a.idasWellIds,owsWellIds:a.owsWellIds,wellhubWellIds:a.wellhubWellIds,savedIdasWellIds:null!==(o=null===(r=a.offsetSettings)||void 0===r?void 0:r.idasWellIds)&&void 0!==o?o:[],savedOwsWellIds:null!==(c=null===(f=a.offsetSettings)||void 0===f?void 0:f.owsWellIds)&&void 0!==c?c:[],savedWellhubWellIds:null!==(W=null===(u=a.offsetSettings)||void 0===u?void 0:u.wellhubWellIds)&&void 0!==W?W:[],savedHandpickedWellIds:null!==(S=null!==(v=null===(p=a.offsetSettings)||void 0===p?void 0:p.handpickedWellIds)&&void 0!==v?v:null===(I=a.offsetSettings)||void 0===I?void 0:I.manualWellIds)&&void 0!==S?S:[]}),m=b.isSynced,h=b.isXtoProvider,w=b.isXtoIdas,g=b.syncedOffsetLabel,x=b.savedOffsetLabel,y=b.resetTooltipLabel,L=b.isResetVisible,O=b.hasOffsetSource,C=b.hasSavedHandpicked,j=n({selectedWells:a.selectedWells,selectedWellSection:a.selectedWellSection,currentSelectionZone:a.currentSelectionZone,offsetSettings:a.offsetSettings,assetCompanyId:a.assetCompanyId,subjectWellId:a.subjectWellId,filters:a.filters,metricsKeys:a.metricsKeys,isMapHidden:a.isMapHidden,isFilterExpanded:a.isFilterExpanded,isLimitedOffsetWells:a.isLimitedOffsetWells,isLoadAllWells:a.isLoadAllWells,isSynced:m,idasWellIds:a.idasWellIds,owsWellIds:a.owsWellIds,wellhubWellIds:a.wellhubWellIds,onClose:a.onClose,onSave:a.onSave,resetSafeguard:a.resetSafeguard}).handleSave,A=i({selectedWells:a.selectedWells,setSelectedWells:a.setSelectedWells,setSelectedWellSection:a.setSelectedWellSection,setCurrentSelectionZone:a.setCurrentSelectionZone,offsetSettings:a.offsetSettings,subjectWell:a.subjectWell,isMapHidden:a.isMapHidden,isFilterExpanded:a.isFilterExpanded,wells:a.wells,pinnedWells:a.pinnedWells,onClose:a.onClose,onSave:a.onSave,setFilters:a.setFilters,resetIsLoadAllWells:a.resetIsLoadAllWells,resetSafeguard:a.resetSafeguard,abandonPendingSearch:a.abandonPendingSearch}),F=a.resetFilters,H=a.resetSelectionTool,P=a.setCurrentSelectionZone,E=a.setSelectedWellSection,k=a.updateSelectedWellsBySection,M=a.abandonPendingSearch,R=s(e(l.mark((function e(){return l.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return M(),F(),H(),P(null),E(t),e.next=7,k(t);case 7:case"end":return e.stop()}}),e)}))),[M,F,H,P,E,k]);return{isSynced:m,isXtoProvider:h,isXtoIdas:w,syncedOffsetLabel:g,savedOffsetLabel:x,resetTooltipLabel:y,isResetVisible:L,hasOffsetSource:O,hasSavedHandpicked:C,handleSave:j,handleCancel:A,handleReset:s(e(l.mark((function e(){return l.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,R();case 2:case"end":return e.stop()}}),e)}))),[R]),applyResetFromExternalOffsets:R}};export{a as useSaveReset};
//# sourceMappingURL=useSaveReset.js.map
