import{W as f}from"./WidgetChart-CQnj_aQq.js";import{b as p,k as m,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 M={__name:"WidgetPaieMasseSalarialeEtEffectif",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 s=a,i=["Janv","Févr","Mars","Avr","Mai","Juin","Juil","Août","Sept","Oct","Nov","Déc"],l=c(()=>{const e=Array.isArray(s.data)?s.data:[],t=e.find(r=>r.Element==="Montant")||{},o=e.find(r=>r.Element==="Nombre")||{};return{labels:i,datasets:[{type:"bar",label:"Masse salariale",data:i.map((r,n)=>t[String(n+1)]||0),backgroundColor:"#10b981",borderWidth:0,yAxisID:"y"},{type:"line",label:"Effectif",data:i.map((r,n)=>o[String(n+1)]||0),borderColor:"#ef4444",backgroundColor:"#ef4444",borderWidth:3,tension:.4,pointRadius:4,yAxisID:"y1"}]}}),d={scales:{x:{grid:{display:!1},ticks:{font:{size:10}}},y:{beginAtZero:!0,position:"left",ticks:{font:{size:10}}},y1:{beginAtZero:!0,position:"right",grid:{drawOnChartArea:!1},ticks:{font:{size:10},precision:0}}}};return(e,t)=>(p(),m(f,{title:"Masse salariale et effectif",icon:"pi pi-chart-line",type:"bar","chart-data":l.value,options:d,loading:a.loading,error:a.error,editing:a.editing,onRefresh:t[0]||(t[0]=o=>e.$emit("refresh")),onRemove:t[1]||(t[1]=o=>e.$emit("remove"))},null,8,["chart-data","loading","error","editing"]))}};export{M as default};
