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