let timeDisplay=document.getElementById("tracker-time"),trackerBtn=document.querySelector(".time-tracker-btn"),timerInterval=(timeDisplay&&trackerBtn||console.error("Projects Dashboard: Elements not found."),null),isRunning=!1;function timeToSeconds(t){var[t,e,r]=t.split(":").map(Number);return 3600*t+60*e+r}function formatTime(t){return String(Math.floor(t/3600)).padStart(2,"0")+`:${String(Math.floor(t%3600/60)).padStart(2,"0")}:`+String(t%60).padStart(2,"0")}let currentSeconds=timeToSeconds(timeDisplay.textContent);trackerBtn.addEventListener("click",()=>{isRunning?(trackerBtn.textContent="Start Tracker",trackerBtn.classList.remove("btn-danger"),trackerBtn.classList.add("btn-info"),isRunning=!1,clearInterval(timerInterval)):(trackerBtn.textContent="Stop Tracker",trackerBtn.classList.remove("btn-info"),trackerBtn.classList.add("btn-danger"),isRunning=!0,timerInterval=setInterval(()=>{currentSeconds++,timeDisplay.textContent=formatTime(currentSeconds)},1e3))}),new CustomApexChart({selector:"#project-status-chart",options:()=>({chart:{height:329,type:"radialBar"},plotOptions:{circle:{dataLabels:{showOn:"hover"}},radialBar:{track:{margin:22,background:"rgba(170,184,197, 0.2)"},hollow:{size:"1%"},dataLabels:{name:{show:!0},value:{show:!0}}}},stroke:{lineCap:"round"},colors:[theme("chart-primary"),theme("chart-gamma"),theme("chart-secondary"),theme("chart-beta")],series:[44,55,67,22],labels:["Completed","In Progress","Yet to Start","Cancelled"],responsive:[{breakpoint:380,options:{chart:{height:260}}}]})}),new CustomApexChart({selector:"#dash-projects-overviews",options:()=>({series:[{name:"Project Revenue",type:"area",data:[30,35,40,45,50,58,62,68,72,78,80,70]},{name:"Project Orders",type:"line",data:[20,24,28,30,33,35,38,40,42,45,48,50]},{name:"Project Users",type:"bar",data:[15,18,22,25,28,30,35,38,40,45,48,50]},{name:"Active Projects Count",type:"bar",data:[10,12,15,18,20,24,26,28,30,35,38,40]}],chart:{type:"line",height:309,toolbar:{show:!1},offsetX:0},stroke:{width:[2,2,0,0],curve:"smooth",dashArray:[0,3,0,0]},colors:[theme("chart-gray"),theme("chart-gamma"),theme("chart-primary"),theme("chart-zeta")],grid:{strokeDashArray:1},zoom:{enabled:!1},xaxis:{categories:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],type:"category",axisBorder:{show:!1},labels:{offsetY:1}},yaxis:{min:0,labels:{formatter:function(t){return t+"k"},offsetX:-10},axisBorder:{show:!1}},plotOptions:{bar:{horizontal:!1,columnWidth:"50%",borderRadius:3}},legend:{show:!1},dataLabels:{enabled:!1},markers:{size:0},fill:{opacity:[.2,1,1,1]},tooltip:{y:{formatter:function(t,{}){return"$"+t+"k"}}}})});