var u=(()=>{class s{static{this.MINUTES_PER_DAY=1440}static clockToTotalMinutes(t){if(!t||!t.trim())return 0;let r=t.split(":").map(e=>Number(e)),o=r[0]||0,n=r[1]||0;return o*60+n}static parseClockParts(t){if(!t||!t.trim())return{hours:0,minutes:0};let r=t.split(":").map(e=>Number(e)),o=r[0],n=r[1];return{hours:Number.isFinite(o)?o:0,minutes:Number.isFinite(n)?n:0}}static partsToHHmm(t,r){let o=Math.floor(t),n=Math.floor(r);return`${o.toString().padStart(2,"0")}:${n.toString().padStart(2,"0")}`}static splitTotalMinutesFloored(t){let r=Math.floor(t);return Number.isFinite(r)?{hours:Math.floor(r/60),minutes:r%60}:{hours:0,minutes:0}}static normalizeTotalMinutesToDayRange(t){let r=Math.floor(t);if(!Number.isFinite(r))return 0;let o=s.MINUTES_PER_DAY;return(r%o+o)%o}static totalMinutesToHHmm(t){if(t==null)return"00:00";let r=Math.floor(t);if(!Number.isFinite(r))return"00:00";let o=s.normalizeTotalMinutesToDayRange(r),n=Math.floor(o/60),e=o%60;return s.partsToHHmm(n,e)}static dateLocalToHHmm(t){return s.partsToHHmm(t.getHours(),t.getMinutes())}static hourToHH00(t){return s.partsToHHmm(t,0)}static localDateToYyyyMmDd(t){let r=t.getFullYear(),o=String(t.getMonth()+1).padStart(2,"0"),n=String(t.getDate()).padStart(2,"0");return`${r}-${o}-${n}`}static normalizeClockStringInput(t){let r=/^(\d{1,2}):(\d{2})$/.exec(t),o=/^(\d{1,2}):(\d{2}):(\d{2})$/.exec(t),n=r||o;if(!n)return null;let e=parseInt(n[1],10),a=parseInt(n[2],10);return Number.isNaN(e)||Number.isNaN(a)?null:s.partsToHHmm(e,a)}static clockStringToTodayDate(t){let{hours:r,minutes:o}=s.parseClockParts(t),n=new Date;return n.setHours(r||0,o||0,0,0),n}}return s})();export{u as a};
