"use strict";var e=require("@babel/runtime/helpers/defineProperty"),t=require("prop-types"),i=require("react"),a=require("classnames"),r=require("@material-ui/core"),n=require("./utils.js"),o=require("react/jsx-runtime");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=s(e),d=s(t),c=s(a),p=r.makeStyles((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 u(e,t,i,a,r,o,s,l){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 c=d.getContext("2d");n.drawDonutSlice(c,t,i,a,r,o,s,l)}}function g(e){var t=e.wirelineTime,a=e.fracturingTime,n=p(),s=i.useRef(null),d=i.useRef(null),g=i.useRef(null);return i.useEffect((function(){var e=s.current;e.width=200,e.height=200,e.style.width="".concat(200,"px"),e.style.height="".concat(200,"px");var i=60*t/86400*Math.PI*2,r=i+60*a/86400*Math.PI*2;u(d,100,100,100,0,i,"#FF9C00",!0),u(g,100,100,100,i,r,"#8572FF",!0)})),o.jsxs("div",{className:n.root,children:[o.jsx("div",{className:c.default(n.backgroundRoot,l.default({},n.emptyStateBackground,!t||!a)),children:o.jsx("div",{className:n.dropShadowRoot})}),o.jsxs("div",{className:n.content,children:[o.jsx(r.Typography,{className:n.timeRange,children:"Previous 24hrs"}),t&&a?o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:n.time,children:[o.jsx(r.Typography,{className:c.default(n.timing,n.wirelineText),display:"inline",children:(t/60).toFixed(1)}),o.jsx(r.Typography,{className:n.timing,display:"inline",children:"/"}),o.jsx(r.Typography,{className:c.default(n.timing,n.fracturingText),display:"inline",children:(a/60).toFixed(1)}),o.jsx(r.Typography,{display:"inline",children:" h"})]}),o.jsxs("div",{className:n.legend,children:[o.jsxs(r.Typography,{className:n.legendItem,display:"inline",children:[o.jsx("div",{className:c.default(n.dot,n.wirelineDot)})," Wireline"]}),o.jsxs(r.Typography,{className:n.legendItem,display:"inline",children:[o.jsx("div",{className:c.default(n.dot,n.fracturingDot)}),"Fracturing"]})]})]}):o.jsx("div",{className:n.noData,children:o.jsx(r.Typography,{className:n.noDataText,children:"No Data"})})]}),o.jsxs("div",{className:n.chart,children:[o.jsx("canvas",{ref:s,className:n.canvas}),o.jsx("canvas",{ref:d,className:n.activities}),o.jsx("canvas",{ref:g,className:n.activities})]})]})}g.propTypes={wirelineTime:d.default.number,fracturingTime:d.default.number},g.defaultProps={wirelineTime:void 0,fracturingTime:void 0},module.exports=g;
//# sourceMappingURL=FracWirelineTimeChart.js.map
