import{Cn as e,Dn as t,En as n,Nn as r,Nt as i,Pt as a,Rt as o,ar as s,cr as c,fr as l,sr as u,wn as d,xn as f,zn as p}from"./B-6m3w3Q.js";var m=l(i(),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=r({__name:`SubscriptionInfo`,props:{subscriptionInfo:{}},setup(r){let i=r,{t:l}=o(),x=e(()=>i.subscriptionInfo?a(i.subscriptionInfo.Total||0,{units:`iec`}).toString():`0 B`),S=e(()=>{if(!i.subscriptionInfo)return`0 B`;let{Download:e=0,Upload:t=0}=i.subscriptionInfo;return a(e+t,{units:`iec`}).toString()}),C=e(()=>{if(!i.subscriptionInfo?.Total)return 0;let{Download:e=0,Upload:t=0,Total:n=1}=i.subscriptionInfo;return Math.min(Number(((e+t)/n*100).toFixed(1)),999)}),w=e(()=>i.subscriptionInfo?.Expire?(0,m.default)(i.subscriptionInfo.Expire*1e3).format(`YYYY-MM-DD`):l(`noExpire`));return(e,i)=>r.subscriptionInfo?(p(),t(f,{key:0},[d(`div`,h,[d(`div`,g,[d(`div`,{class:`h-full rounded-full transition-[width] duration-500 ease-out`,style:u({width:`${s(C)}%`,background:`linear-gradient(90deg, var(--color-primary), var(--color-secondary))`})},null,4)]),d(`div`,_,c(s(C))+`% `,1)]),d(`div`,v,[d(`div`,y,c(s(S))+` / `+c(s(x)),1),d(`div`,b,c(s(l)(`expire`))+`: `+c(s(w)),1)])],64)):n(``,!0)}}),S=Object.assign(x,{__name:`SubscriptionInfo`});export{S as t};