import{W as p}from"./WidgetChart-CQnj_aQq.js";import{b as d,k as s,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 O={__name:"WidgetCrmOpportunitesParPriorite",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 a=r,i={Aucune:"#9ca3af",Faible:"#86efac",Normale:"#3b82f6",Haute:"#f59e0b",Critique:"#ef4444"},o=m(()=>{const e=Array.isArray(a.data)?a.data:[];return{labels:e.map(t=>t.priorite_libelle||""),datasets:[{data:e.map(t=>t.nb||0),backgroundColor:e.map(t=>i[t.priorite_libelle]||"#6366f1"),borderWidth:0}]}}),n={plugins:{legend:{position:"right",labels:{font:{size:10},boxWidth:12,padding:6}}}};return(e,t)=>(d(),s(p,{title:"Opportunités par priorité",icon:"pi pi-flag-fill",type:"doughnut","chart-data":o.value,options:n,loading:r.loading,error:r.error,editing:r.editing,onRefresh:t[0]||(t[0]=l=>e.$emit("refresh")),onRemove:t[1]||(t[1]=l=>e.$emit("remove"))},null,8,["chart-data","loading","error","editing"]))}};export{O as default};
