import e from"@babel/runtime/helpers/slicedToArray";import{useCallback as t}from"react";import{MapConfig as o}from"../constants.js";var l=function(l){var i=l.isRadiusToolActive,r=l.radiusDrawingHandlers,s=l.isSubjectWellHovered,a=l.showTooltip,n=l.showClusterTooltip,u=l.hideTooltip;return t((function(t){var l;i&&r.handleMouseMove(t);var d=t.features;if(null!=d&&d.length){var v=d[0];if((null===(l=v.layer)||void 0===l?void 0:l.id)!==o.LayerIds.WellsClusters){var c=v.properties;if(c&&"Point"===v.geometry.type){var p=e(v.geometry.coordinates,2),f=p[0],m=p[1],g={id:c.id,name:c.name,formation:c.formation,status:c.status,totalDepth:c.totalDepth,rigReleaseDate:c.rigReleaseDate};a({well:g,isOffsetWell:c.isOffsetWell,isSubjectWell:c.isSubjectWell,coords:{latitude:m,longitude:f}})}}else{var y,h=v.properties,W=null!==(y=null==h?void 0:h.count_selected)&&void 0!==y?y:0;if(W>0&&"Point"===v.geometry.type){var b,D,T=e(v.geometry.coordinates,2),j=T[0],w=T[1];n({clusterId:null!==(b=null==h?void 0:h.cluster_id)&&void 0!==b?b:0,coords:{latitude:w,longitude:j},totalCount:null!==(D=null==h?void 0:h.point_count)&&void 0!==D?D:0,selectedCount:W})}else u()}}else s||u()}),[a,n,u,s,i,r])};export{l as useMapMoveHandler};
//# sourceMappingURL=useMapMoveHandler.js.map
