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