import{W as d}from"./WidgetChart-CQnj_aQq.js";import{b as m,k as p,y as u}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 n="#6366f1",i="#10b981",O={__name:"WidgetCAMensuel",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(a){const o=a,l=u(()=>{const e=Array.isArray(o.data)?o.data:[];if(e.length===0||!e[0])return{labels:[],datasets:[]};const t=Object.keys(e[0]).filter(r=>r!=="annee");return{labels:t,datasets:[{label:String(e[0].annee??""),data:t.map(r=>e[0][r]||0),borderColor:n,backgroundColor:n+"33",tension:.3},...e[1]?[{label:String(e[1].annee??""),data:t.map(r=>e[1][r]||0),borderColor:i,backgroundColor:i+"33",tension:.3}]:[]]}}),s={scales:{x:{grid:{display:!1},ticks:{font:{size:10}}},y:{beginAtZero:!0,ticks:{font:{size:10}}}}};return(e,t)=>(m(),p(d,{title:"CA mensuel N / N-1",icon:"pi pi-chart-line",type:"line","chart-data":l.value,options:s,loading:a.loading,error:a.error,editing:a.editing,onRefresh:t[0]||(t[0]=r=>e.$emit("refresh")),onRemove:t[1]||(t[1]=r=>e.$emit("remove"))},null,8,["chart-data","loading","error","editing"]))}};export{O as default};
