import{_ as e,a as t}from"./i18n-DfIivedY.js";import{t as n}from"./arrow-up-right-ChK-5OML.js";import{fn as r}from"./app-BUWZBqJJ.js";import{t as i}from"./card-CTKhq4f5.js";var a=r(`ArrowDownRight`,[[`path`,{d:`m7 7 10 10`,key:`1fmybs`}],[`path`,{d:`M17 7v10H7`,key:`6fjiku`}]]),o=e(),s=t();function c(e){let t=(0,o.c)(19),{values:n,accent:r,width:i,height:a}=e,c=i===void 0?96:i,l=a===void 0?28:a;if(n.length===0)return null;let u=Math.max(1,...n),d=c/Math.max(1,n.length-1),f;if(t[0]!==l||t[1]!==u||t[2]!==d||t[3]!==n){let e;t[5]!==l||t[6]!==u||t[7]!==d?(e=(e,t)=>`${(t*d).toFixed(1)},${(l-e/u*l).toFixed(1)}`,t[5]=l,t[6]=u,t[7]=d,t[8]=e):e=t[8],f=n.map(e).join(` `),t[0]=l,t[1]=u,t[2]=d,t[3]=n,t[4]=f}else f=t[4];let p=f,m=`0,${l} ${p} ${c},${l}`,h=`0 0 ${c} ${l}`,g;t[9]!==r||t[10]!==m?(g=(0,s.jsx)(`polygon`,{points:m,fill:r,fillOpacity:`0.12`}),t[9]=r,t[10]=m,t[11]=g):g=t[11];let _;t[12]!==r||t[13]!==p?(_=(0,s.jsx)(`polyline`,{points:p,fill:`none`,stroke:r,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`}),t[12]=r,t[13]=p,t[14]=_):_=t[14];let v;return t[15]!==h||t[16]!==g||t[17]!==_?(v=(0,s.jsxs)(`svg`,{viewBox:h,className:`h-7 w-20 shrink-0 sm:w-24`,preserveAspectRatio:`none`,"aria-hidden":!0,children:[g,_]}),t[15]=h,t[16]=g,t[17]=_,t[18]=v):v=t[18],v}function l(e,t){if(t===0)return{dir:`flat`,pct:0};let n=Math.round((e-t)/t*100);return n===0?{dir:`flat`,pct:0}:{dir:n>0?`up`:`down`,pct:Math.abs(n)}}function u(e){let t=(0,o.c)(25),{label:r,value:l,sub:u,icon:d,iconTone:f,series:p,accent:m,trendData:h}=e,g=`rounded-lg p-2 ${f}`,_;t[0]!==d||t[1]!==g?(_=(0,s.jsx)(`div`,{className:g,children:d}),t[0]=d,t[1]=g,t[2]=_):_=t[2];let v;t[3]===h?v=t[4]:(v=h&&h.dir!==`flat`&&(0,s.jsxs)(`span`,{className:`inline-flex items-center gap-0.5 rounded-full px-2 py-0.5 text-[11px] font-medium ${h.dir===`up`?`bg-emerald-500/10 text-emerald-700 dark:text-emerald-400`:`bg-rose-500/10 text-rose-700 dark:text-rose-400`}`,children:[h.dir===`up`?(0,s.jsx)(n,{className:`size-3`}):(0,s.jsx)(a,{className:`size-3`}),h.pct,`%`]}),t[3]=h,t[4]=v);let y;t[5]!==_||t[6]!==v?(y=(0,s.jsxs)(`div`,{className:`flex items-start justify-between`,children:[_,v]}),t[5]=_,t[6]=v,t[7]=y):y=t[7];let b;t[8]===r?b=t[9]:(b=(0,s.jsx)(`p`,{className:`mt-3 text-xs leading-tight font-medium tracking-wider text-muted-foreground uppercase`,children:r}),t[8]=r,t[9]=b);let x;t[10]===l?x=t[11]:(x=(0,s.jsx)(`p`,{className:`mt-1 text-2xl font-semibold tracking-tight tabular-nums sm:text-3xl`,children:l}),t[10]=l,t[11]=x);let S;t[12]===u?S=t[13]:(S=u&&(0,s.jsx)(`p`,{className:`min-w-0 text-xs text-muted-foreground`,children:u}),t[12]=u,t[13]=S);let C;t[14]!==m||t[15]!==p?(C=p&&m&&(0,s.jsx)(c,{values:p,accent:m}),t[14]=m,t[15]=p,t[16]=C):C=t[16];let w;t[17]!==S||t[18]!==C?(w=(0,s.jsxs)(`div`,{className:`mt-1 flex min-w-0 flex-col gap-2 sm:flex-row sm:items-end sm:justify-between`,children:[S,C]}),t[17]=S,t[18]=C,t[19]=w):w=t[19];let T;return t[20]!==y||t[21]!==b||t[22]!==x||t[23]!==w?(T=(0,s.jsxs)(i,{className:`relative min-w-0 overflow-hidden p-4 sm:p-5`,children:[y,b,x,w]}),t[20]=y,t[21]=b,t[22]=x,t[23]=w,t[24]=T):T=t[24],T}export{l as n,c as r,u as t};