Files
pyMC_Repeater/repeater/web/html/assets/Statistics-BQdSlYZ9.js
T
2026-01-22 13:10:07 +00:00

2 lines
19 KiB
JavaScript

import{a as Ae,J as Ne,K as Oe,r as u,D as ue,c as pe,o as Le,E as me,R as M,H as ze,b as h,e as a,g as B,w as He,q as Je,F as ve,h as fe,f as te,u as ge,i as Ue,t as X,L as W,I as ae,n as je,p as k,x as $e}from"./index-sHch0610.js";import{S as se}from"./chartjs-adapter-date-fns.esm-BnFZGz19.js";import{g as Ke,s as Ve}from"./preferences-DtwbSSgO.js";import{C as G,a as Ie,L as Xe,P as We,b as Ge,c as Ye,B as Ze,D as qe,S as Qe,p as et,d as tt,e as at,A as st,f as rt,i as ot,T as lt}from"./chart-B185MtDy.js";import{P as H}from"./plotly.min-DO11Gp-n.js";import"./_commonjsHelpers-CqkleIqs.js";const nt={class:"p-3 sm:p-6 space-y-4 sm:space-y-6"},it={class:"flex flex-col sm:flex-row sm:justify-between sm:items-center gap-3"},ct={class:"flex items-center gap-2 sm:gap-3"},dt=["value"],ut={class:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4"},pt={class:"glass-card rounded-[15px] p-3 sm:p-6"},mt={class:"relative h-40 sm:h-48 rounded-lg p-2 sm:p-4"},vt={key:0,class:"absolute inset-0 flex items-center justify-center bg-white/50 dark:bg-white/5 backdrop-blur-xs z-20"},ft={key:1,class:"absolute inset-0 flex items-center justify-center bg-white/50 dark:bg-white/5 z-20"},gt={class:"grid grid-cols-1 lg:grid-cols-2 gap-4 sm:gap-6 items-stretch"},xt={class:"glass-card rounded-[15px] p-3 sm:p-6 flex flex-col"},bt={class:"relative flex-1 min-h-[12rem] sm:min-h-[16rem] rounded-lg"},yt={key:0,class:"absolute inset-0 flex items-center justify-center bg-white/50 dark:bg-white/5 backdrop-blur-xs z-20"},ht={class:"glass-card rounded-[15px] p-3 sm:p-6 flex flex-col"},kt={class:"flex-1 flex flex-col justify-evenly"},Ct={key:0,class:"flex items-center justify-center flex-1"},_t={key:1,class:"flex items-center justify-center flex-1"},wt={class:"w-28 sm:w-32 text-sm text-content-primary dark:text-content-primary truncate"},St={class:"flex-1 h-12 bg-background-mute dark:bg-stroke/10 rounded overflow-hidden"},Tt={class:"w-20 text-sm text-content-secondary dark:text-content-muted text-right tabular-nums"},Rt={key:0,class:"glass-card rounded-[15px] p-6 sm:p-8 text-center"},Dt={key:1,class:"glass-card rounded-[15px] p-6 sm:p-8 text-center"},Ft={class:"text-content-secondary dark:text-content-muted text-sm"},Et=Ae({name:"StatisticsView",__name:"Statistics",setup(Mt){G.register(Ie,Xe,We,Ge,Ye,Ze,qe,Qe,et,tt,at,st,rt,ot,lt);const A=Ne(),Y=Oe(),N=u(null),Z=u(!1),re=()=>{N.value||Y.isConnected||(N.value=window.setInterval(V,3e4))},oe=()=>{N.value&&(clearInterval(N.value),N.value=null)},T=()=>{const t=document.documentElement.classList.contains("dark");return{gridColor:t?"rgba(255, 255, 255, 0.1)":"rgba(0, 0, 0, 0.1)",tickColor:t?"rgba(255, 255, 255, 0.7)":"rgba(0, 0, 0, 0.7)",legendColor:t?"rgba(255, 255, 255, 0.8)":"rgba(0, 0, 0, 0.8)",titleColor:t?"rgba(255, 255, 255, 0.8)":"rgba(0, 0, 0, 0.8)"}},g=u(Ke("statistics_selectedHours",24)),xe=[{value:1,label:"1 Hour"},{value:6,label:"6 Hours"},{value:12,label:"12 Hours"},{value:24,label:"24 Hours"},{value:48,label:"2 Days"},{value:168,label:"1 Week"}];ue(g,t=>Ve("statistics_selectedHours",t));const R=u(null),O=u(null),J=u([]),D=u(null),q=u([]),U=u(!0),j=u(null),S=u({packetRate:!0,packetType:!0,noiseFloor:!1,routePie:!0,sparklines:!0}),L=u(!1),$=u(!1),z=u(!1),C=u(null),_=u(null),y=u(null),K=u(null),Q=u(null),ee=u(null),F=u(null),le=pe(()=>{const t=A.packetStats;return t?{totalRx:t.total_packets||0,totalTx:t.transmitted_packets||0}:{totalRx:0,totalTx:0}}),ne=(t,e)=>{if(t.length===0)return[];const i=Math.round(e*60*60*1e3/72),r=new Map;return t.forEach(([n,v])=>{let f=n;n>1e15?f=n/1e3:n>1e9&&n<1e12&&(f=n*1e3);const w=Math.floor(f/i)*i;r.has(w)||r.set(w,[]),r.get(w).push(v)}),Array.from(r.entries()).sort((n,v)=>n[0]-v[0]).map(([,n])=>n.reduce((v,f)=>v+f,0)/n.length)},ie=pe(()=>{let t=[],e=[];if(R.value?.series){const s=R.value.series.find(r=>r.type==="rx_count"),i=R.value.series.find(r=>r.type==="tx_count");s?.data&&(t=ne(s.data,g.value)),i?.data&&(e=ne(i.data,g.value))}return{totalPackets:t,transmittedPackets:e,droppedPackets:[]}}),V=async()=>{try{U.value=!0,j.value=null,await Promise.all([A.fetchPacketStats({hours:g.value}),A.fetchSystemStats()]),U.value=!1,be()}catch(t){j.value=t instanceof Error?t.message:"Failed to fetch data",U.value=!1}},be=async()=>{S.value={packetRate:!0,packetType:!0,noiseFloor:!0,routePie:!0,sparklines:!0};const t=[ye(),he(),ke(),Ce()];try{await Promise.allSettled(t),await me(),!K.value||!Q.value?setTimeout(()=>{ce()},100):ce()}catch(e){console.error("Error loading chart data:",e)}},ye=async()=>{try{const t=await W.get("/metrics_graph_data",{hours:g.value,resolution:"average",metrics:"rx_count,tx_count"});t?.success&&(R.value=t.data)}catch{R.value=null}},he=async()=>{try{const t=await W.get("/packet_type_graph_data",{hours:g.value,resolution:"average",types:"all"});if(t?.success&&t.data){const e=t.data;J.value=e.series||[]}}catch{J.value=[]}},ke=async()=>{try{const t=await W.get("/route_stats",{hours:g.value});t?.success&&t.data&&(D.value=t.data)}catch{D.value=null}},Ce=async()=>{try{const t={hours:g.value},e=await W.get("/noise_floor_history",t);if(e.success&&e.data){const i=e.data.history||[];Array.isArray(i)&&i.length>0&&(O.value={chart_data:i.map(r=>({timestamp:r.timestamp||Date.now()/1e3,noise_floor_dbm:r.noise_floor_dbm||r.noise_floor||-120}))},we())}}catch{O.value={chart_data:[]}}},_e=()=>{S.value={packetRate:!0,packetType:!0,noiseFloor:!0,routePie:!0,sparklines:!0},de(),L.value=!1,$.value=!1,z.value=!1,V()},we=()=>{if(q.value=[],O.value?.chart_data&&O.value.chart_data.length>0){const t=O.value.chart_data;q.value=t.map(e=>({timestamp:e.timestamp*1e3,snr:null,rssi:null,noiseFloor:e.noise_floor_dbm}))}},ce=()=>{if(!Z.value){Z.value=!0;try{Se(),Te(),Re(),De(),setTimeout(()=>{S.value={packetRate:!1,packetType:!1,noiseFloor:!1,routePie:!1,sparklines:!1},setTimeout(()=>{const t=M(C.value),e=M(_.value),s=M(y.value);t&&t.update("none"),e&&e.update("none"),s&&s.update("none")},50)},100)}catch(t){console.error("Error creating/updating charts:",t),de()}finally{Z.value=!1}}},de=()=>{try{C.value&&(C.value.destroy(),C.value=null),_.value&&(_.value.destroy(),_.value=null),y.value&&(y.value.destroy(),y.value=null),F.value&&H.purge(F.value)}catch(t){console.error("Error destroying charts:",t)}},Se=()=>{if(!K.value)return;const t=K.value.getContext("2d");if(!t)return;let e=[],s=[];if(R.value?.series){const p=R.value.series.find(c=>c.type==="rx_count"),b=R.value.series.find(c=>c.type==="tx_count");p?.data&&(e=p.data.map(([c,d])=>{let l=c;return c>1e15?l=c/1e3:c>1e12?l=c:c>1e9?l=c*1e3:l=Date.now(),{x:l,y:d}})),b?.data&&(s=b.data.map(([c,d])=>{let l=c;return c>1e15?l=c/1e3:c>1e12?l=c:c>1e9?l=c*1e3:l=Date.now(),{x:l,y:d}}))}if(e.length===0&&s.length===0){L.value=!0;return}L.value=!1,C.value&&(C.value.destroy(),C.value=null);const r=Math.round(g.value*60*60*1e3/72),n=p=>{if(p.length===0)return[];const b=new Map;return p.forEach(d=>{const l=Math.floor(d.x/r)*r;b.has(l)||b.set(l,[]),b.get(l).push(d.y)}),Array.from(b.entries()).map(([d,l])=>({x:d,y:l.reduce((E,I)=>E+I,0)/l.length})).sort((d,l)=>d.x-l.x)},v=(p,b=3)=>{if(p.length<b)return p;const c=[];for(let d=0;d<p.length;d++){const l=Math.max(0,d-Math.floor(b/2)),E=Math.min(p.length,d+Math.ceil(b/2)),I=p.slice(l,E),Me=I.reduce((Pe,Be)=>Pe+Be.y,0)/I.length;c.push({x:p[d].x,y:Me})}return c},f=v(n(e)),w=v(n(s)),P=[...f.map(p=>p.y),...w.map(p=>p.y)],o=Math.min(...P),m=Math.max(...P),x=m-o||m*.1||.001,Fe=Math.max(0,o-x*.05),Ee=m+x*.05;try{const p=JSON.parse(JSON.stringify(f)),b=JSON.parse(JSON.stringify(w)),c=new G(t,{type:"line",data:{datasets:[{label:"TX/hr",data:b,borderColor:"#F59E0B",backgroundColor:"#F59E0B",borderWidth:2,fill:"origin",tension:.4,pointRadius:0,pointHoverRadius:3,order:1},{label:"RX/hr",data:p,borderColor:"#C084FC",backgroundColor:"#C084FC",borderWidth:2,fill:"origin",tension:.4,pointRadius:0,pointHoverRadius:3,order:2}]},options:{responsive:!0,maintainAspectRatio:!1,animation:{duration:0},interaction:{mode:"index",intersect:!1},plugins:{legend:{display:!1},title:{display:!1},tooltip:{enabled:!0,backgroundColor:"rgba(0, 0, 0, 0.8)",titleColor:"rgba(255, 255, 255, 0.9)",bodyColor:"rgba(255, 255, 255, 0.8)",borderColor:"rgba(255, 255, 255, 0.2)",borderWidth:1,padding:12,displayColors:!0,callbacks:{title:function(d){const l=d[0]?.parsed?.x;return l==null?"":new Date(l).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})},label:function(d){const l=d.dataset?.label||"",E=d.parsed?.y;return E==null?l:`${l}: ${E.toFixed(3)}`}}}},scales:{x:{type:"time",time:{unit:"hour",displayFormats:{hour:"HH:mm"}},min:Date.now()-g.value*3600*1e3,max:Date.now(),grid:{color:T().gridColor},ticks:{color:T().tickColor,maxTicksLimit:8}},y:{beginAtZero:!1,grid:{color:T().gridColor},ticks:{color:T().tickColor,callback:function(d){return typeof d=="number"?d.toFixed(3):d}},min:Fe,max:Ee}}}});C.value=ae(c)}catch(p){console.error("Error creating packet rate chart:",p),L.value=!0}},Te=()=>{if(!Q.value)return;const t=Q.value.getContext("2d");if(!t)return;const e=[],s=[],i=["#60A5FA","#34D399","#FBBF24","#A78BFA","#F87171","#06B6D4","#84CC16","#F472B6","#10B981"];if(J.value.length>0)J.value.forEach(r=>{const n=r.data?r.data.reduce((v,f)=>v+f[1],0):0;n>0&&(e.push(r.name.replace(/\([^)]*\)/g,"").trim()),s.push(n))});else{$.value=!0;return}$.value=!1,_.value&&(_.value.destroy(),_.value=null);try{const r=JSON.parse(JSON.stringify(e)),n=JSON.parse(JSON.stringify(s)),v=new G(t,{type:"bar",data:{labels:r,datasets:[{data:n,backgroundColor:i.slice(0,n.length),borderRadius:8,borderSkipped:!1}]},options:{responsive:!0,maintainAspectRatio:!1,animation:{duration:0},plugins:{legend:{display:!1}},scales:{x:{grid:{display:!1},ticks:{color:"rgba(255, 255, 255, 0.7)",font:{size:10}}},y:{beginAtZero:!0,grid:{color:"rgba(255, 255, 255, 0.1)"},ticks:{color:"rgba(255, 255, 255, 0.7)"}}}}});_.value=ae(v)}catch(r){console.error("Error creating packet type chart:",r),$.value=!0}},Re=()=>{if(!ee.value)return;const t=ee.value.getContext("2d");if(!t)return;const e=q.value.map(o=>({x:o.timestamp,y:o.noiseFloor})).filter(o=>o.y!==null&&o.y!==void 0),s=e.map(o=>o.y),i=s.length>0?Math.min(...s):-120,r=s.length>0?Math.max(...s):-110,n=r-i||1,v=i-n*.05,f=r+n*.05;if(y.value)try{const o=M(y.value),m=JSON.parse(JSON.stringify(e));o.data.datasets[0]&&(o.data.datasets[0].data=m),o.options?.scales?.x&&(o.options.scales.x.min=Date.now()-g.value*3600*1e3,o.options.scales.x.max=Date.now()),o.update("active");return}catch{y.value.destroy(),y.value=null}const w=JSON.parse(JSON.stringify(e)),P=new G(t,{type:"scatter",data:{datasets:[{label:"Noise Floor (dBm)",data:w,borderWidth:0,backgroundColor:"rgba(245, 158, 11, 0.8)",pointRadius:3,pointHoverRadius:5,pointStyle:"circle"}]},options:{responsive:!0,maintainAspectRatio:!1,animation:{duration:0},interaction:{mode:"index",intersect:!1},plugins:{legend:{display:!0,position:"top",labels:{color:T().legendColor,usePointStyle:!0,padding:20}},tooltip:{enabled:!0,backgroundColor:"rgba(0, 0, 0, 0.8)",titleColor:"rgba(255, 255, 255, 0.9)",bodyColor:"rgba(255, 255, 255, 0.8)",borderColor:"rgba(255, 255, 255, 0.2)",borderWidth:1,padding:12,displayColors:!0,callbacks:{title:function(o){const m=o[0]?.parsed?.x;return m==null?"":new Date(m).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})},label:function(o){const m=o.dataset?.label||"",x=o.parsed?.y;return x==null?m:`${m}: ${x.toFixed(1)} dBm`}}}},scales:{x:{type:"time",time:{unit:"hour",displayFormats:{hour:"HH:mm"}},min:Date.now()-g.value*3600*1e3,max:Date.now(),grid:{color:T().gridColor},ticks:{color:T().tickColor,maxTicksLimit:8}},y:{type:"linear",display:!0,title:{display:!0,text:"Noise Floor (dBm)",color:T().titleColor},grid:{color:"rgba(245, 158, 11, 0.2)"},ticks:{color:"#F59E0B",callback:function(o){return typeof o=="number"?o.toFixed(1):o}},min:v,max:f}}}});y.value=ae(P)},De=()=>{if(!F.value)return;if(!D.value||!D.value.route_totals){z.value=!0;return}z.value=!1;const t=D.value.route_totals,e=Object.keys(t),s=Object.values(t),i=["#3B82F6","#10B981","#F59E0B","#A78BFA","#F87171"];try{const r=JSON.parse(JSON.stringify(e)),n=JSON.parse(JSON.stringify(s)),v=n.reduce((m,x)=>m+x,0),f=n.map(m=>m/v*100),w=r.map((m,x)=>({type:"bar",name:m,x:[f[x]],y:[""],orientation:"h",marker:{color:i[x%i.length]},text:f[x]>=5?`${m} ${f[x].toFixed(0)}%`:"",textposition:"inside",textfont:{color:"white",size:11},hoverinfo:"none",insidetextanchor:"middle"})),P={paper_bgcolor:"rgba(0,0,0,0)",plot_bgcolor:"rgba(0,0,0,0)",font:{color:"rgba(255, 255, 255, 0.8)",size:11},margin:{t:10,b:60,l:10,r:10},barmode:"stack",showlegend:!0,legend:{orientation:"h",x:0,y:-.3,xanchor:"left",font:{color:"rgba(255, 255, 255, 0.8)",size:10}},xaxis:{showgrid:!1,showticklabels:!1,zeroline:!1,range:[0,100]},yaxis:{showgrid:!1,showticklabels:!1,zeroline:!1},hovermode:!1,bargap:0},o={responsive:!0,displayModeBar:!1,staticPlot:!0};H.newPlot(F.value,w,P,o)}catch(r){console.error("Error creating route treemap chart:",r),z.value=!0}};return Le(async()=>{await me(),V(),Y.isConnected||re(),ue(()=>Y.isConnected,t=>{t?oe():re()}),window.addEventListener("resize",()=>{setTimeout(()=>{M(C.value)?.resize(),M(_.value)?.resize(),M(y.value)?.resize(),F.value&&H.Plots&&H.Plots.resize(F.value)},100)})}),ze(()=>{oe(),C.value?.destroy(),_.value?.destroy(),y.value?.destroy(),F.value&&H.purge(F.value),window.removeEventListener("resize",()=>{})}),(t,e)=>(k(),h("div",nt,[a("div",it,[e[2]||(e[2]=a("h2",{class:"text-xl sm:text-2xl font-bold text-content-primary dark:text-content-primary"},"Statistics",-1)),a("div",ct,[e[1]||(e[1]=a("label",{class:"text-content-secondary dark:text-content-muted text-xs sm:text-sm"},"Time Range:",-1)),He(a("select",{"onUpdate:modelValue":e[0]||(e[0]=s=>g.value=s),onChange:_e,class:"bg-white dark:bg-white/10 border border-stroke-subtle dark:border-stroke/20 rounded-lg px-2 sm:px-3 py-1.5 sm:py-2 text-content-primary dark:text-content-primary text-xs sm:text-sm focus:outline-hidden focus:border-primary dark:focus:border-accent-purple/50 transition-colors"},[(k(),h(ve,null,fe(xe,s=>a("option",{key:s.value,value:s.value,class:"bg-white dark:bg-gray-800 text-content-primary dark:text-content-primary"},X(s.label),9,dt)),64))],544),[[Je,g.value]])])]),a("div",ut,[te(se,{title:"Total RX",value:le.value.totalRx,color:"#AAE8E8",data:ie.value.totalPackets,loading:S.value.sparklines,variant:"classic"},null,8,["value","data","loading"]),te(se,{title:"Total TX",value:le.value.totalTx,color:"#FFC246",data:ie.value.transmittedPackets,loading:S.value.sparklines,variant:"classic"},null,8,["value","data","loading"]),te(se,{title:"Packet Hash Cache",value:ge(A).systemStats?.duplicate_cache_size??0,color:"#9F7AEA",data:[],loading:!1,variant:"smooth",subtitle:`Entries expire after ${(()=>{const s=ge(A).systemStats?.cache_ttl??3600,i=Math.floor(s/60);return i>=60?`${Math.floor(i/60)}h`:`${i}m`})()}`},null,8,["value","subtitle"])]),a("div",pt,[e[6]||(e[6]=a("h3",{class:"text-content-primary dark:text-content-primary text-lg sm:text-xl font-semibold mb-3 sm:mb-4"},"Performance Metrics",-1)),a("div",null,[e[5]||(e[5]=Ue('<p class="text-content-secondary dark:text-content-muted text-xs sm:text-sm uppercase tracking-wide mb-2" data-v-c51a7a30> Packet Rate (RX/TX PER HOUR) </p><div class="flex items-center gap-3 sm:gap-6 mb-3 sm:mb-4" data-v-c51a7a30><div class="flex items-center gap-2" data-v-c51a7a30><div class="w-3 h-3 rounded-full bg-purple-400" data-v-c51a7a30></div><span class="text-content-secondary dark:text-content-muted text-sm" data-v-c51a7a30>RX/hr</span></div><div class="flex items-center gap-2" data-v-c51a7a30><div class="w-3 h-3 rounded-full bg-amber-400" data-v-c51a7a30></div><span class="text-content-secondary dark:text-content-muted text-sm" data-v-c51a7a30>TX/hr</span></div></div>',2)),a("div",mt,[a("canvas",{ref_key:"packetRateCanvasRef",ref:K,class:"w-full h-full relative z-10"},null,512),S.value.packetRate?(k(),h("div",vt,e[3]||(e[3]=[a("div",{class:"text-center"},[a("div",{class:"animate-spin w-6 h-6 sm:w-8 sm:h-8 border-2 border-stroke-subtle dark:border-stroke/20 border-t-purple-600 dark:border-t-purple-400 rounded-full mx-auto mb-2"}),a("div",{class:"text-content-secondary dark:text-content-muted text-[10px] sm:text-xs"},"Loading packet rate data...")],-1)]))):B("",!0),L.value&&!S.value.packetRate?(k(),h("div",ft,e[4]||(e[4]=[a("div",{class:"text-center"},[a("div",{class:"text-red-700 dark:text-red-400 text-sm font-semibold mb-1"},"No Data Available"),a("div",{class:"text-content-secondary dark:text-content-muted text-xs"},"Packet rate data not found")],-1)]))):B("",!0)])])]),a("div",gt,[a("div",xt,[e[8]||(e[8]=a("h3",{class:"text-content-primary dark:text-content-primary text-lg sm:text-xl font-semibold mb-3 sm:mb-4"}," Noise Floor Over Time ",-1)),a("div",bt,[a("canvas",{ref_key:"signalMetricsCanvasRef",ref:ee,class:"w-full h-full"},null,512),S.value.noiseFloor?(k(),h("div",yt,e[7]||(e[7]=[a("div",{class:"text-center"},[a("div",{class:"animate-spin w-6 h-6 sm:w-8 sm:h-8 border-2 border-stroke-subtle dark:border-stroke/20 border-t-amber-600 dark:border-t-amber-400 rounded-full mx-auto mb-2"}),a("div",{class:"text-content-secondary dark:text-content-muted text-[10px] sm:text-xs"},"Loading noise floor data...")],-1)]))):B("",!0)])]),a("div",ht,[e[11]||(e[11]=a("h3",{class:"text-content-primary dark:text-content-primary text-lg sm:text-xl font-semibold mb-3 sm:mb-4"},"Route Distribution",-1)),a("div",kt,[S.value.routePie?(k(),h("div",Ct,e[9]||(e[9]=[a("div",{class:"text-center"},[a("div",{class:"animate-spin w-6 h-6 border-2 border-stroke-subtle dark:border-stroke/20 border-t-green-600 dark:border-t-green-400 rounded-full mx-auto mb-2"}),a("div",{class:"text-content-secondary dark:text-content-muted text-xs"},"Loading route data...")],-1)]))):z.value?(k(),h("div",_t,e[10]||(e[10]=[a("div",{class:"text-center"},[a("div",{class:"text-red-700 dark:text-red-400 text-sm font-semibold mb-1"},"No Data Available"),a("div",{class:"text-content-secondary dark:text-content-muted text-xs"},"Route statistics not found")],-1)]))):D.value?.route_totals?(k(!0),h(ve,{key:2},fe(D.value.route_totals,(s,i,r)=>(k(),h("div",{key:i,class:"flex items-center gap-3"},[a("div",wt,X(i),1),a("div",St,[a("div",{class:"h-full rounded transition-all duration-300",style:je({width:`${s/Math.max(...Object.values(D.value.route_totals))*100}%`,backgroundColor:["#3B82F6","#10B981","#F59E0B","#A78BFA","#F87171"][r%5]})},null,4)]),a("div",Tt,X(s.toLocaleString()),1)]))),128)):B("",!0)])])]),U.value?(k(),h("div",Rt,e[12]||(e[12]=[a("div",{class:"text-content-secondary dark:text-content-muted mb-2 text-sm"},"Loading statistics...",-1),a("div",{class:"animate-spin w-6 h-6 sm:w-8 sm:h-8 border-2 border-stroke-subtle dark:border-stroke/20 border-t-content-primary dark:border-t-white/70 rounded-full mx-auto"},null,-1)]))):B("",!0),j.value?(k(),h("div",Dt,[e[13]||(e[13]=a("div",{class:"text-red-700 dark:text-red-400 mb-2 text-sm font-semibold"},"Failed to load statistics",-1)),a("p",Ft,X(j.value),1),a("button",{onClick:V,class:"mt-4 px-4 py-2 bg-primary hover:bg-primary/90 dark:bg-primary dark:hover:bg-primary/80 text-white font-medium rounded-lg border border-primary/20 dark:border-primary/30 transition-colors shadow-sm"}," Retry ")])):B("",!0)]))}}),zt=$e(Et,[["__scopeId","data-v-c51a7a30"]]);export{zt as default};