import e from"@babel/runtime/helpers/toConsumableArray";import l from"@babel/runtime/helpers/slicedToArray";import{useState as t,useCallback as n}from"react";var r=function(r){var o=r.pads,a=r.selectedOffsetWellIds,c=r.onOffsetWellsSelect,f=t(a),s=l(f,2),d=s[0],i=s[1],u=t([]),p=l(u,2),m=p[0],h=p[1],O=t(!1),S=l(O,2),b=S[0],W=S[1],v=n((function(){return W(!1)}),[]),C=n((function(){h(e(d)),W(!0)}),[d]),I=n((function(){W(!1);var e=o.flatMap((function(e){return e.wells})).filter((function(e){return d.includes(e.id)}));c(e)}),[d,c,o]),M=n((function(){i(m),W(!1)}),[m]),y=n((function(){i([])}),[]);return{isModalOpen:b,handleCloseModal:v,handleOpenModal:C,handleSaveSelectedWellIds:I,handleCancelButtonClick:M,localSelectedOffsetWellIds:d,setLocalSelectedOffsetWellIds:i,handleResetSelection:y}};export{r as useModalHandlers};
//# sourceMappingURL=useModalHandlers.js.map
