const d="m/d/Y";const a=t=>String(t).padStart(2,"0"),g=["January","February","March","April","May","June","July","August","September","October","November","December"],c=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],m=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],_=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];function u(){if(typeof window>"u")return{};const t=[window.radius_booking_param,window.radius_booking_my_booking_param,window.radius_booking_site_param,window.radius_booking_event_param,window.radius_booking_meeting_param];for(const n of t)if(n!=null&&n.date_time_settings)return n.date_time_settings;return{}}function f(){return u().dateFormat||d}function y(){return u().timeSystem||"12h"}function S(t){if(!t)return null;if(t instanceof Date)return isNaN(t.getTime())?null:t;if(typeof t=="string"&&/^\d{4}-\d{2}-\d{2}$/.test(t)){const[e,r,o]=t.split("-").map(Number),i=new Date(e,r-1,o);return isNaN(i.getTime())?null:i}const n=new Date(t);return isNaN(n.getTime())?null:n}function p(t,n){const e=S(t);if(!e)return"";const r=n||f(),o={Y:e.getFullYear(),y:String(e.getFullYear()).slice(-2),m:a(e.getMonth()+1),n:e.getMonth()+1,d:a(e.getDate()),j:e.getDate(),F:g[e.getMonth()],M:c[e.getMonth()],l:m[e.getDay()],D:_[e.getDay()]};return r.replace(/Y|y|m|n|d|j|F|M|l|D/g,i=>o[i])}function D(t,n){if(!t)return"";const e=y();let r,o;if(typeof t=="string"){const s=t.split(":").map(Number);r=s[0]||0,o=s[1]||0}else if(t instanceof Date)r=t.getHours(),o=t.getMinutes();else return"";if(e==="24h")return`${a(r)}:${a(o)}`;const i=r>=12?"PM":"AM";return`${r%12===0?12:r%12}:${a(o)} ${i}`}export{D as a,p as f,y as g};
//# sourceMappingURL=dateTimeFormat-yH4yHSCh.js.map
