import e from"@babel/runtime/helpers/slicedToArray";import{memo as o,useMemo as r}from"react";import l from"prop-types";import{makeStyles as s}from"@material-ui/core";import i from"./FormationsLegend.js";import t from"./popupGenerator.js";import{getAllFormations as a}from"./utils.js";import n from"./Map.js";import{jsxs as p,jsx as f}from"react/jsx-runtime";var d=s({mapContainerHidden:{marginTop:"20px",display:"none"}});function m(o){var l=o.open,s=o.subjectWell,m=o.wells,u=o.offsetWells,c=o.radius,W=o.mapHidden,b=o.isMobile,j=o.onAddOffsetWell,O=o.onDeleteOffsetWell,q=d(),R=r((function(){return a(m)}),[m]),h=e(R,2),y=h[0],H=h[1];return p("div",{className:W&&q.mapContainerHidden,children:[f(n,{open:l,subjectWell:s,wells:m,offsetWells:u,radius:c,formationColors:H,popUpFormatter:t(),coordsDataPath:"topHole.coordinates",onAddOffsetWell:j,onDeleteOffsetWell:O}),!b&&f(i,{formations:y,formationColors:H})]})}m.propTypes={open:l.bool.isRequired,subjectWell:l.shape({}),wells:l.arrayOf(l.shape({})).isRequired,offsetWells:l.arrayOf(l.shape({})).isRequired,radius:l.number,mapHidden:l.bool.isRequired,isMobile:l.bool.isRequired,onAddOffsetWell:l.func.isRequired,onDeleteOffsetWell:l.func.isRequired},m.defaultProps={subjectWell:null,radius:null};var u=o(m);export{u as default};
