import{r as t,c as s,h as i}from"./p-65ddb289.js";class e{constructor(i){t(this,i),this.step=15,this.clock24=!0,this.timeSelectedChange=s(this,"timeSelectedChange",7)}_getOptions(){const t=Math.round(60/this.step*24),s=[];for(let i=0;i<t;i++)s.push(i*this.step);return s}_format(t,s){let i="";return!this.clock24&&t>=12?(i="PM",t-=12):!this.clock24&&t<12&&(i="AM"),this.clock24||0!==t||(t=12),t<10&&(t=`0${t}`),s<10&&(s=`0${s}`),i&&(s+=` ${i}`),`${t}:${s}`}_renderOption(t){const s=new Date(0);s.setMinutes(t);const e=s.getUTCHours(),r=s.getUTCMinutes(),h=this._format(e,r);return i("materials-list-item",this.timeSelected===h?{selected:!0,onClick:()=>this.timeSelectedChange.emit(h)}:{onClick:()=>this.timeSelectedChange.emit(h)},h)}render(){return this._getOptions().map(t=>this._renderOption(t))}}export{e as materials_timepicker};