const c=(t="fr")=>t==="fr"?"fr-FR":"en-US",i=t=>t instanceof Date&&!Number.isNaN(t.getTime()),m=t=>{if(!t)return null;if(t instanceof Date)return i(t)?t:null;if(typeof t=="string"){const e=t.trim();if(!e)return null;const r=e.match(/^(\d{4})-(\d{2})-(\d{2})(?:[T\s].*)?$/);if(r){const[,o,u,d]=r,s=new Date(Number(o),Number(u)-1,Number(d));return i(s)?s:null}const a=new Date(e);return i(a)?a:null}const n=new Date(t);return i(n)?n:null},f=t=>{const n=Number(t||0),e=n<0?"-":"",[r,a]=Math.abs(n).toFixed(2).split("."),o=r.replace(/\B(?=(\d{3})+(?!\d))/g," ");return`${e}${o},${a} DZD`},l=(t,n="fr")=>{const e=m(t);return e?new Intl.DateTimeFormat(c(n),{year:"numeric",month:"2-digit",day:"2-digit"}).format(e):"—"},D=(t,n="fr")=>{const e=m(t);return e?new Intl.DateTimeFormat(c(n),{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}).format(e):"—"};export{f as a,D as b,l as f};
