import{An as e,Cr as t,_r as n,ci as r,dr as i,gr as a,ii as o,jr as s,mr as c,pr as l,ri as u,ti as d}from"./ChQ2IioC.js";import{et as f,tt as p}from"./B8xAZa0G.js";var m=r(f(),1),h={class:`flex items-center gap-2 pt-1`},g={class:`h-2 flex-1 overflow-hidden rounded-full bg-base-content/15`},_={class:`flex items-center justify-center rounded-full bg-secondary px-2 py-0.5 text-xs font-semibold text-secondary-content`},v={class:`mt-1.5 flex flex-wrap items-center justify-between gap-2`},y={class:`text-sm text-base-content/60`},b={class:`text-sm text-base-content/60`},x=t({__name:`SubscriptionInfo`,props:{subscriptionInfo:{}},setup(t){let r=t,{t:f}=e(),x=l(()=>r.subscriptionInfo?p(r.subscriptionInfo.Total||0,{units:`iec`}).toString():`0 B`),S=l(()=>{if(!r.subscriptionInfo)return`0 B`;let{Download:e=0,Upload:t=0}=r.subscriptionInfo;return p(e+t,{units:`iec`}).toString()}),C=l(()=>{if(!r.subscriptionInfo?.Total)return 0;let{Download:e=0,Upload:t=0,Total:n=1}=r.subscriptionInfo;return Math.min(Number(((e+t)/n*100).toFixed(1)),999)}),w=l(()=>r.subscriptionInfo?.Expire?(0,m.default)(r.subscriptionInfo.Expire*1e3).format(`YYYY-MM-DD`):f(`noExpire`));return(e,r)=>t.subscriptionInfo?(s(),n(i,{key:0},[c(`div`,h,[c(`div`,g,[c(`div`,{class:`h-full rounded-full transition-[width] duration-500 ease-out`,style:u({width:`${d(C)}%`,background:`linear-gradient(90deg, var(--color-primary), var(--color-secondary))`})},null,4)]),c(`div`,_,o(d(C))+`% `,1)]),c(`div`,v,[c(`div`,y,o(d(S))+` / `+o(d(x)),1),c(`div`,b,o(d(f)(`expire`))+`: `+o(d(w)),1)])],64)):a(``,!0)}}),S=Object.assign(x,{__name:`SubscriptionInfo`});export{S as t};