import{f as h,K as C,L as x,M as V,N as b,O as B,x as g,P as S,u as a,Y as c,n as w,e as n}from"./vue-BCrBmJiU.js";import{_ as P,a as T}from"./StatSection.vue_vue_type_script_setup_true_lang-B39yLjWZ.js";import{u as L,a4 as $,a5 as k,d as A,Y as R,a6 as G,a7 as r}from"./index-pUGkA0BX.js";import"./vuetify-CVZPtJFd.js";const I={"data-testid":"card-value",class:"text-title-medium font-weight-bold"},E={"data-testid":"card-unit",class:"text-label-large ml-1"},D=h({__name:"SpeedCard",props:{active:{type:Boolean},grow:{type:Boolean},title:{},icon:{},orientation:{},color:{},value:{}},setup(p){const l=p,e=L();return(u,t)=>(C(),x(P,V(b(l)),{default:B(({value:o})=>[g("span",I,S(a($)(o,a(e).useBitSpeed)),1),g("span",E,S(a(k)(o,a(e).useBitSpeed)),1)]),_:1},16))}}),W=h({__name:"CurrentSpeed",setup(p){const{t:l}=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 y(){t.value=o}function F(){t.value=d}const _=n(()=>o.every(i=>t.value.includes(i))&&o.length===t.value.length),m=n(()=>d.every(i=>t.value.includes(i))&&d.length===t.value.length),f=n(()=>!!e.value?.dl_rate_limit||!!e.value?.up_rate_limit),N=n(()=>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),O=n(()=>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)=>(C(),x(T,{title:a(l)("navbar.side.current_speed.title"),columns:"2"},{default:B(()=>[w(D,{orientation:"row",title:a(l)("navbar.side.current_speed.download"),icon:"mdi-arrow-down",color:"download",value:N.value,active:_.value,onClick:s[0]||(s[0]=U=>_.value?v():y())},null,8,["title","value","active"]),w(D,{orientation:"row",title:a(l)("navbar.side.current_speed.upload"),icon:"mdi-arrow-up",color:"upload",value:O.value,active:m.value,onClick:s[1]||(s[1]=U=>m.value?v():F())},null,8,["title","value","active"])]),_:1},8,["title"]))}});export{W as default};
