import{W as m}from"./WidgetChart-CQnj_aQq.js";import{b as p,k as u,y as c}from"./vue-core-Di3IuVqe.js";import"./WidgetCard-CLnTgmXL.js";import"./primevue-CfIk0_DY.js";import"./index-BxIwIJfy.js";import"./cjs-helpers-psZwOBky.js";import"./vue-cal-DKMVGERa.js";import"./moment-BeHQNF8T.js";const O={__name:"WidgetEvolutionMarge",props:{data:{type:[Array,Object,null],default:null},loading:{type:Boolean,default:!1},error:{type:String,default:""},editing:{type:Boolean,default:!1}},emits:["refresh","remove"],setup(e){const a=e,o=["Janv","Févr","Mars","Avr","Mai","Juin","Juil","Août","Sept","Oct","Nov","Déc"],i={Charges:"#ef4444",Produits:"#10b981",Resultat:"#6366f1"},l=c(()=>{const r=Array.isArray(a.data)?a.data:[];return{labels:o,datasets:r.map(t=>({label:t.Element||"",data:o.map((n,d)=>t[String(d+1)]||0),borderColor:i[t.Element]||"#9ca3af",backgroundColor:(i[t.Element]||"#9ca3af")+"33",tension:.3}))}}),s={scales:{x:{grid:{display:!1},ticks:{font:{size:10}}},y:{beginAtZero:!0,ticks:{font:{size:10}}}}};return(r,t)=>(p(),u(m,{title:"Évolution charges / produits / résultat",icon:"pi pi-chart-line",type:"line","chart-data":l.value,options:s,loading:e.loading,error:e.error,editing:e.editing,onRefresh:t[0]||(t[0]=n=>r.$emit("refresh")),onRemove:t[1]||(t[1]=n=>r.$emit("remove"))},null,8,["chart-data","loading","error","editing"]))}};export{O as default};
