import{b as x,E as N,j as o,B as p,q as a,at as f}from"./index-DlNZgIG9.js";const C={UPCOMING:"#ab9e16",ACTIVE:"#3b82f6",ACHIEVED:"#10b981",CLOSED:"#a41010"},g=t=>(t||"").replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase()),S=t=>t?new Date(t).toLocaleDateString("en-GB"):"—",u=t=>`₹${Number(t||0).toLocaleString("en-IN",{maximumFractionDigits:2})}`,h=(t,e)=>{const r=Number(e||0);return r<=0?0:Math.round(Number(t||0)/r*100)},M=({status:t})=>{const e=t||"ACTIVE",r=C[e]||"#6b7280";return x(N,{label:g(e),size:"small",sx:{bgcolor:`${r}1a`,color:r,fontWeight:600,border:`1px solid ${r}55`}})},D=({label:t,achieved:e,target:r,money:c,hint:i})=>{const n=Number(r||0)>0,l=h(e,r),s=n&&Number(e||0)>Number(r||0),b=m=>c?u(m):String(Number(m||0)),d=s?"#10b981":"#3b82f6";return o(p,{sx:{mb:1},children:[o(p,{sx:{display:"flex",justifyContent:"space-between",alignItems:"baseline"},children:[o(a,{variant:"caption",color:"text.secondary",children:[t,i&&o(a,{component:"span",variant:"caption",color:"text.disabled",sx:{ml:.5},children:["(",i,")"]})]}),o(a,{variant:"caption",fontWeight:600,color:n?"text.primary":"text.disabled",children:[n?`${b(e)} / ${b(r)}`:"—",n&&o(a,{component:"span",variant:"caption",color:s?"success.main":"text.secondary",sx:{ml:.5},children:["(",l,"%",s?` · +${c?u(Number(e)-Number(r)):Number(e)-Number(r)} over`:"",")"]})]})]}),x(f,{variant:"determinate",value:Math.min(l,100),sx:{height:6,borderRadius:3,mt:.3,opacity:n?1:.35,"& .MuiLinearProgress-bar":{backgroundColor:d}}})]})};export{D as M,M as S,S as f};
