"use strict";var i=require("prop-types"),e=require("@material-ui/core"),l=require("../../../../Drillstring/BhaIndicator/BhaIndicator.js"),r=require("../../../../Drillstring/BHASchematic.js"),t=require("../../../../Drillstring/DrillstringDetail/DrillstringDetail.js"),a=require("../../../../../utils/convert.js"),n=require("../../../../../utils/bha.js"),s=require("react/jsx-runtime"),o=e.makeStyles({wrapper:{width:200,cursor:"pointer",marginTop:-52,marginBottom:-52},bhaDetail:{maxWidth:1500,maxHeight:"80%"}}),d=function(i){var d,g,D,u,h,c=i.feedItem,p=i.drillStringData,m=i.handleShowDrillstringDetailDialog,x=i.isShowDrillstringDetailDialog,j=i.handleHideDrillstringDetailDialog,q=o(),v=null===(d=c.well)||void 0===d?void 0:d.id,S=null===(g=c.context)||void 0===g||null===(D=g.bha)||void 0===D||null===(u=D.data)||void 0===u?void 0:u.id,f=n.getBHAInformation(v,S,p),w=n.calculateBHALengthMax(p),B=null===(h=f.data)||void 0===h?void 0:h.components,H=B&&n.getBHASchematic(B);return s.jsxs(s.Fragment,{children:[s.jsx("div",{className:q.wrapper,onClick:m,children:H&&s.jsx(r,{schematic:H,bhaLengthMax:w},v)}),s.jsx(l,{align:"left"}),s.jsx(e.Dialog,{classes:{paperScrollPaper:q.bhaDetail},open:x,onClose:j,scroll:"paper",children:s.jsx(e.DialogContent,{children:s.jsx(t,{drillStringInfo:f,unit:a.getUnitDisplay("length"),onDone:j})})})]})};d.propTypes={feedItem:i.shape().isRequired,drillStringData:i.shape().isRequired,isShowDrillstringDetailDialog:i.bool.isRequired,handleShowDrillstringDetailDialog:i.func.isRequired,handleHideDrillstringDetailDialog:i.func.isRequired},module.exports=d;
