import{W as p}from"./WidgetChart-CQnj_aQq.js";import{b as d,k as u,y as m}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 A={__name:"WidgetCrmOpportunitesNouvellesParMois",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(r){const i=r,a=["Janv","Févr","Mars","Avr","Mai","Juin","Juil","Août","Sept","Oct","Nov","Déc"],n=m(()=>{const o=Array.isArray(i.data)?i.data:[],e={};for(const t of o)e[Number(t.mois)]=t.nb||0;return{labels:a,datasets:[{label:"Nouvelles opportunités",data:a.map((t,l)=>e[l+1]||0),borderColor:"#6366f1",backgroundColor:"#6366f133",tension:.3,fill:!0}]}}),s={plugins:{legend:{display:!1}},scales:{x:{grid:{display:!1},ticks:{font:{size:10}}},y:{beginAtZero:!0,ticks:{font:{size:10},precision:0}}}};return(o,e)=>(d(),u(p,{title:"Nouvelles opportunités par mois",icon:"pi pi-chart-line",type:"line","chart-data":n.value,options:s,loading:r.loading,error:r.error,editing:r.editing,onRefresh:e[0]||(e[0]=t=>o.$emit("refresh")),onRemove:e[1]||(e[1]=t=>o.$emit("remove"))},null,8,["chart-data","loading","error","editing"]))}};export{A as default};
