import{r as e}from"./markdown-Biq8ujIZ.js";import{n as t}from"./createLucideIcon-dIT_VeEb.js";import{t as n}from"./Card-BKKJdAcY.js";var r=e();function i({icon:e,label:i,value:o,accent:s=`brand`,trend:c}){return(0,r.jsxs)(n,{className:`flex items-center gap-3.5`,children:[(0,r.jsx)(`div`,{className:t(`flex h-11 w-11 shrink-0 items-center justify-center rounded-xl`,{brand:`bg-brand-50 text-brand-600 dark:bg-brand-500/10 dark:text-brand-300`,green:`bg-accent-500/10 text-accent-600 dark:text-accent-400`,amber:`bg-amber-500/10 text-amber-600 dark:text-amber-400`,violet:`bg-violet-500/10 text-violet-600 dark:text-violet-400`}[s]),children:e}),(0,r.jsxs)(`div`,{className:`min-w-0`,children:[(0,r.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,r.jsx)(`p`,{className:`text-2xl font-bold leading-tight text-text`,children:o}),c!=null&&(0,r.jsx)(a,{value:c})]}),(0,r.jsx)(`p`,{className:`truncate text-xs text-text-muted`,children:i})]})]})}function a({value:e}){if(e===0)return null;let n=e>0;return(0,r.jsxs)(`span`,{className:t(`inline-flex items-center gap-0.5 rounded-full px-1.5 py-0.5 text-[10px] font-bold`,n?`bg-accent-500/15 text-accent-600 dark:text-accent-400`:`bg-red-500/10 text-red-500`),children:[n?`↑`:`↓`,Math.abs(e),`%`]})}function o({data:e}){let n=Math.max(1,...e.map(e=>e.hours));return(0,r.jsx)(`div`,{className:`flex h-44 items-stretch gap-1.5 sm:gap-2.5`,children:e.map((i,a)=>{let o=a===e.length-1,s=i.hours>0?Math.max(6,i.hours/n*100):0;return(0,r.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col items-center gap-1.5`,children:[(0,r.jsx)(`span`,{className:`text-[10px] font-semibold tabular-nums text-text-muted`,children:i.hours>0?`${i.hours}h`:``}),(0,r.jsx)(`div`,{className:`relative w-full flex-1 overflow-hidden rounded-lg bg-surface-muted`,children:(0,r.jsx)(`div`,{className:t(`absolute inset-x-0 bottom-0 rounded-lg transition-[height] duration-700`,o?`bg-gradient-to-t from-brand-600 to-brand-400`:`bg-gradient-to-t from-brand-500/70 to-brand-400/70`),style:{height:`${s}%`},title:`${i.day}: ${i.hours}h`})}),(0,r.jsx)(`span`,{className:t(`text-xs`,o?`font-semibold text-text`:`text-text-muted`),children:i.day})]},a)})})}var s=[`#1f47f5`,`#10b981`,`#f59e0b`,`#8b5cf6`,`#ec4899`,`#06b6d4`,`#ef4444`,`#64748b`];function c({data:e,size:t=168,thickness:n=26,centerLabel:i,centerSub:a}){let o=e.filter(e=>e.value>0),c=o.reduce((e,t)=>e+t.value,0)||1,l=(t-n)/2,u=2*Math.PI*l,d=0;return(0,r.jsxs)(`div`,{className:`flex min-w-0 flex-col items-center gap-4`,children:[(0,r.jsxs)(`div`,{className:`relative shrink-0`,style:{width:t,height:t},children:[(0,r.jsxs)(`svg`,{width:t,height:t,className:`-rotate-90`,children:[(0,r.jsx)(`circle`,{cx:t/2,cy:t/2,r:l,fill:`none`,strokeWidth:n,className:`stroke-border`}),o.map((e,i)=>{let a=e.value/c*u,o=(0,r.jsx)(`circle`,{cx:t/2,cy:t/2,r:l,fill:`none`,strokeWidth:n,strokeLinecap:`butt`,stroke:e.color??s[i%s.length],strokeDasharray:`${a} ${u-a}`,strokeDashoffset:-d,className:`transition-all duration-700`},i);return d+=a,o})]}),(i||a)&&(0,r.jsxs)(`div`,{className:`absolute inset-0 flex flex-col items-center justify-center text-center`,children:[i&&(0,r.jsx)(`p`,{className:`text-xl font-bold text-text`,children:i}),a&&(0,r.jsx)(`p`,{className:`text-[11px] text-text-muted`,children:a})]})]}),(0,r.jsx)(`ul`,{className:`grid w-full min-w-0 grid-cols-1 gap-x-4 gap-y-2 sm:grid-cols-2 lg:grid-cols-1`,children:o.map((e,t)=>(0,r.jsxs)(`li`,{className:`flex min-w-0 items-center gap-2.5 text-sm`,children:[(0,r.jsx)(`span`,{className:`h-3 w-3 shrink-0 rounded-sm`,style:{backgroundColor:e.color??s[t%s.length]}}),(0,r.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-text`,title:e.label,children:e.label}),(0,r.jsxs)(`span`,{className:`shrink-0 font-medium tabular-nums text-text-muted`,children:[Math.round(e.value/c*100),`%`]})]},t))})]})}function l({days:e}){return(0,r.jsx)(`div`,{className:`flex justify-between gap-1`,children:e.map((n,i)=>{let a=n.hours>0,o=i===e.length-1;return(0,r.jsxs)(`div`,{className:`flex flex-col items-center gap-1.5`,children:[(0,r.jsx)(`div`,{className:t(`flex h-9 w-9 items-center justify-center rounded-full text-xs font-semibold transition`,a?`bg-gradient-to-br from-orange-400 to-red-500 text-white shadow-sm`:`bg-surface-muted text-text-muted`,o&&!a&&`ring-2 ring-brand-500/40`),title:`${n.day}: ${n.hours}h`,children:a?`🔥`:n.day[0]}),(0,r.jsx)(`span`,{className:t(`text-[10px]`,o?`font-semibold text-text`:`text-text-muted`),children:o?`Today`:n.day})]},i)})})}export{o as i,i as n,l as r,c as t};