import{f as D,K as x,L as C,M as U,N as V,O as B,x as g,P as w,u as a,Y as c,n as S,e as l}from"./vue-CPEHuaRL.js";import{_ as P,a as T}from"./StatSection.vue_vue_type_script_setup_true_lang-qvYGwkEi.js";import{d as L,ad as $,ae as k,h as A,Y as R,af as G,ag as r}from"./index-vmUNdjsE.js";import"./VSheet-Br_0hONz.js";import"./vuetify-DlufGdsb.js";const I={"data-testid":"card-value",class:"text-subtitle-1 font-weight-bold"},E={"data-testid":"card-unit",class:"font-weight-light text-caption ml-1 text-subtitle-1"},h=D({__name:"SpeedCard",props:{active:{type:Boolean},grow:{type:Boolean},title:{},icon:{},orientation:{},color:{},value:{}},setup(p){const n=p,e=L();return(u,t)=>(x(),C(P,U(V(n)),{default:B(({value:o})=>[g("span",I,w(a($)(o,a(e).useBitSpeed)),1),g("span",E,w(a(k)(o,a(e).useBitSpeed)),1)]),_:1},16))}}),j=D({__name:"CurrentSpeed",setup(p){const{t:n}=A(),{serverState:e}=c(R()),{displayGraphLimits:u}=c(L()),{statusFilter:t}=c(G()),o=[r.DOWNLOADING,r.DL_FORCED],d=[r.UPLOADING,r.UL_FORCED];function v(){t.value=[]}function b(){t.value=o}function y(){t.value=d}const _=l(()=>o.every(i=>t.value.includes(i))&&o.length===t.value.length),m=l(()=>d.every(i=>t.value.includes(i))&&d.length===t.value.length),f=l(()=>!!e.value?.dl_rate_limit||!!e.value?.up_rate_limit),F=l(()=>u&&f.value&&e.value?.dl_rate_limit?[e.value?.dl_info_speed??0,e.value?.dl_rate_limit??0]:e.value?.dl_info_speed??0),N=l(()=>u&&f.value&&e.value?.up_rate_limit?[e.value?.up_info_speed??0,e.value?.up_rate_limit??0]:e.value?.up_info_speed??0);return(i,s)=>(x(),C(T,{title:a(n)("navbar.side.current_speed.title"),columns:"2"},{default:B(()=>[S(h,{orientation:"row",title:a(n)("navbar.side.current_speed.download"),icon:"mdi-arrow-down",color:"download",value:F.value,active:_.value,onClick:s[0]||(s[0]=O=>_.value?v():b())},null,8,["title","value","active"]),S(h,{orientation:"row",title:a(n)("navbar.side.current_speed.upload"),icon:"mdi-arrow-up",color:"upload",value:N.value,active:m.value,onClick:s[1]||(s[1]=O=>m.value?v():y())},null,8,["title","value","active"])]),_:1},8,["title"]))}});export{j as default};
