import e from"@babel/runtime/helpers/defineProperty";import i from"prop-types";import{useRef as t,useEffect as a}from"react";import n from"classnames";import{makeStyles as r,Typography as o}from"@material-ui/core";import{drawDonutSlice as l}from"./utils.js";import{jsxs as c,jsx as d,Fragment as s}from"react/jsx-runtime";var m=r((function(e){return{root:{width:"228px",height:"228px",borderRadius:"50%",padding:"6px",position:"relative",background:"url(".concat("/static/media/9bda514bfc837939d0b6f7d8dbe94d03.svg",")"),backgroundRepeat:"no-repeat"},backgroundRoot:{width:"100%",height:"100%",borderRadius:"50%",border:"2px solid #616161",padding:"2px",display:"flex",alignItems:"center",justifyContent:"center",overflow:"hidden",background:"url(".concat("/static/media/49092309a3fda5ecf77311bd794ac103.svg",")")},emptyStateBackground:{background:"radial-gradient(50% 50% at 50% 50%, rgba(100, 181, 246, 0) 54.4%, rgba(100, 181, 246, 0.01) 76.49%, rgba(100, 181, 246, 0.06) 100%)"},dropShadowRoot:{width:"100%",height:"100%",borderRadius:"50%",filter:"blur(36px)",border:"2px solid #64B5F6",display:"flex",alignItems:"center",justifyContent:"center"},content:{position:"absolute",width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column",left:0,top:0},timeRange:{fontSize:"10px",textTransform:"uppercase",color:e.palette.primary.text7,lineHeight:"24px",fontWeight:500,letterSpacing:"1px",position:"absolute",top:36},time:{marginTop:42},timing:{fontFamily:"Roboto",fontSize:36,lineHeight:"24px",letterSpacing:.4,fontWeight:300,color:e.palette.background.b9},wirelineText:{color:"#FF9C00"},wirelineDot:{backgroundColor:"#FF9C00"},fracturingText:{color:"#8572FF"},fracturingDot:{backgroundColor:"#8572FF"},legend:{marginTop:24},legendItem:{fontFamily:"Roboto",fontSize:12,lineHeight:"14px",letterSpacing:.4,display:"flex",margin:"2px 0",alignItems:"center"},dot:{width:8,height:8,borderRadius:"100%",marginRight:9},chart:{position:"absolute",left:2,top:2,width:"100%",height:"100%",padding:"12px"},noData:{width:90,height:90},noDataText:{marginTop:24,color:"#9E9E9E",display:"flex",justifyContent:"center"},canvas:{width:"100%",height:"100%"},activities:{position:"absolute",left:12,top:12}}}));function p(e,i,t,a,n,r,o,c){var d=e.current;if(d){d.width=200,d.height=200,d.style.width="".concat(200,"px"),d.style.height="".concat(200,"px");var s=d.getContext("2d");l(s,i,t,a,n,r,o,c)}}function g(i){var r=i.wirelineTime,l=i.fracturingTime,g=m(),h=t(null),u=t(null),f=t(null);return a((function(){var e=h.current;e.width=200,e.height=200,e.style.width="".concat(200,"px"),e.style.height="".concat(200,"px");var i=60*r/86400*Math.PI*2,t=i+60*l/86400*Math.PI*2;p(u,100,100,100,0,i,"#FF9C00",!0),p(f,100,100,100,i,t,"#8572FF",!0)})),c("div",{className:g.root,children:[d("div",{className:n(g.backgroundRoot,e({},g.emptyStateBackground,!r||!l)),children:d("div",{className:g.dropShadowRoot})}),c("div",{className:g.content,children:[d(o,{className:g.timeRange,children:"Previous 24hrs"}),r&&l?c(s,{children:[c("div",{className:g.time,children:[d(o,{className:n(g.timing,g.wirelineText),display:"inline",children:(r/60).toFixed(1)}),d(o,{className:g.timing,display:"inline",children:"/"}),d(o,{className:n(g.timing,g.fracturingText),display:"inline",children:(l/60).toFixed(1)}),d(o,{display:"inline",children:" h"})]}),c("div",{className:g.legend,children:[c(o,{className:g.legendItem,display:"inline",children:[d("div",{className:n(g.dot,g.wirelineDot)})," Wireline"]}),c(o,{className:g.legendItem,display:"inline",children:[d("div",{className:n(g.dot,g.fracturingDot)}),"Fracturing"]})]})]}):d("div",{className:g.noData,children:d(o,{className:g.noDataText,children:"No Data"})})]}),c("div",{className:g.chart,children:[d("canvas",{ref:h,className:g.canvas}),d("canvas",{ref:u,className:g.activities}),d("canvas",{ref:f,className:g.activities})]})]})}g.propTypes={wirelineTime:i.number,fracturingTime:i.number},g.defaultProps={wirelineTime:void 0,fracturingTime:void 0};export{g as default};
//# sourceMappingURL=FracWirelineTimeChart.js.map
