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