const c={draft:{label:"Calculé",badgeClassName:"border-accent/20 bg-accent/10 text-accent"},adjusted:{label:"Ajusté",badgeClassName:"border-gold/20 bg-gold/10 text-gold"},validated:{label:"Validé",badgeClassName:"border-accent2/20 bg-accent2/10 text-accent2"},locked:{label:"Verrouillé",badgeClassName:"border-border bg-surface2 text-textMuted"}},n=["draft","adjusted","validated","locked"],d=[{value:"facturation_error",label:"Erreur de facturation"},{value:"missing_entry",label:"Écriture manquante (non saisie)"},{value:"rate_correction",label:"Correction de taux"},{value:"credit_note_missing",label:"Avoir non comptabilisé"},{value:"other",label:"Autre (préciser)"}],s=d.reduce((e,a)=>(e[a.value]=a.label,e),{}),b=e=>c[e]||{label:e||"Inconnu",badgeClassName:"border-border bg-surface2 text-textMuted"},u=e=>Number((e==null?void 0:e.montant_final)||0)===0?{label:"Vide",className:"border-border bg-surface2 text-textMuted"}:e!=null&&e.is_manually_adjusted?{label:"Ajusté",className:"border-gold/20 bg-gold/10 text-gold"}:{label:"Auto",className:"border-accent2/20 bg-accent2/10 text-accent2"},i=(e,a,r="application/octet-stream")=>{const l=e instanceof Blob?e:new Blob([e],{type:r}),o=window.URL.createObjectURL(l),t=document.createElement("a");t.href=o,t.download=a,document.body.appendChild(t),t.click(),t.remove(),window.setTimeout(()=>{window.URL.revokeObjectURL(o)},1e4)},g=e=>e.map(a=>a.map(r=>`"${String(r??"").replace(/"/g,'""')}"`).join(";")).join(`
`);export{n as G,u as a,d as b,s as c,i as d,g as e,b as g};
