(self["webpackChunkaw_webui"]=self["webpackChunkaw_webui"]||[]).push([[2679],{2679:(t,r,e)=>{"use strict";e.r(r),e.d(r,{default:()=>_});var a=function(){var t=this,r=t._self._c;return r("svg")},n=[],o=e(66073),i=e(63105),s=e(91175),u=(e(21249),e(64958)),l=e(30381),c=e(49492);function f(t){t.innerHTML=""}function p(t,r){t.innerHTML="";var e=u.select(t);e.append("text").attr("x","50%").attr("y","25pt").text(r).attr("font-family","sans-serif").attr("font-size","20pt").attr("text-anchor","middle").attr("fill","#AAA")}var d="#aaa",h="#fc5",v="#adf";function x(t,r,e){var a="YYYY-MM-DD";if(r.length<=0)p(t,"No data");else{t.innerHTML="";var n=u.select(t),f=r.map((function(t){return g(t)})),x=Math.max.apply(null,f);x<=0&&(x=1e-11);var y=100/(r.length-1)*.3,k=100/r.length-y,m=Math.floor(r.length/2);o(r,(function(t,r){var o=g(t),i=o/x*85,s="";t.length>0&&(s=l(t[0].timestamp).subtract((0,c.mB)(),"hours").format(a));var u=r==m?h:d,f=50,p=r*y+r*k+.25*k;l(s).isSame(l(),"day")&&(n.append("line").attr("x1",p+k/2+"%").attr("y1",0).attr("x2",p+k/2+"%").attr("y2",200).attr("style","stroke: #888; stroke-width: 2px;").attr("stroke-dasharray","4, 2"),n.append("text").attr("x",p+1.5*k+"%").attr("y","30").text("Today"));var w=n.append("rect").attr("x",p+"%").attr("y",101-i+"%").attr("rx",3).attr("ry",3).attr("style",r==m?"stroke: black; stroke-width: 1;":"stroke: #222; stroke-width: 1;").attr("width",k+"%").attr("height",i+f+"%").attr("color",u).attr("date",s).style("fill",u).on("mouseover",(function(){w.style("fill",v)})).on("mouseout",(function(t){w.style("fill",t.target.attributes.color.value)})).on("click",(function(){e(s)}));w.append("title").text(s+"\n"+(0,c.SI)(o))}))}function g(t){var r=s(i(t,(function(t){return"not-afk"==t.data.status})));return void 0!=r?r.duration:0}}const y={create:f,update:x,set_status:p},k={name:"aw-periodusage",props:{periodusage_arr:{type:Array}},watch:{periodusage_arr:function(){y.update(this.$el,this.periodusage_arr,this.onPeriodClicked)}},mounted:function(){y.create(this.$el),y.set_status(this.$el,"Loading...")},methods:{onPeriodClicked:function(t){this.$emit("update",t)}}},m=k;var g=e(1001),w=(0,g.Z)(m,a,n,!1,null,"415cce6b",null);const _=w.exports},80760:(t,r,e)=>{var a=e(89881);function n(t,r){var e=[];return a(t,(function(t,a,n){r(t,a,n)&&e.push(t)})),e}t.exports=n},54290:(t,r,e)=>{var a=e(6557);function n(t){return"function"==typeof t?t:a}t.exports=n},66073:(t,r,e)=>{t.exports=e(84486)},63105:(t,r,e)=>{var a=e(34963),n=e(80760),o=e(67206),i=e(1469);function s(t,r){var e=i(t)?a:n;return e(t,o(r,3))}t.exports=s},84486:(t,r,e)=>{var a=e(77412),n=e(89881),o=e(54290),i=e(1469);function s(t,r){var e=i(t)?a:n;return e(t,o(r))}t.exports=s},91175:t=>{function r(t){return t&&t.length?t[0]:void 0}t.exports=r}}]);
//# sourceMappingURL=2679.81759204.js.map