"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[52361],{52361:function(e,t,a){a.r(t),a.d(t,{default:function(){return c},show:function(){return i}}),a(24776),a(77575),a(78557),a(67593),a(96054),a(90076);var o=a(79754),n=a(98320),l=a(9482),s=(a(63001),a(15453),'<div class="formDialogHeader"> <button is="paper-icon-button-light" class="btnCancel autoSize" title="${Previous}" tabindex="-1"> <span class="material-icons arrow_back" aria-hidden="true"></span> </button> <h3 class="formDialogHeaderTitle"> ${HeaderAccessSchedule} </h3> </div> <div class="formDialogContent scrollY" style="padding-top:2em"> <div class="dialogContentInner dialog-content-centered"> <form class="scheduleForm" style="margin:auto"> <div class="selectContainer"> <select is="emby-select" id="selectDay" label="${LabelAccessDay}"> <option value="Sunday">${Sunday}</option> <option value="Monday">${Monday}</option> <option value="Tuesday">${Tuesday}</option> <option value="Wednesday">${Wednesday}</option> <option value="Thursday">${Thursday}</option> <option value="Friday">${Friday}</option> <option value="Saturday">${Saturday}</option> <option value="Everyday">${OptionEveryday}</option> <option value="Weekday">${OptionWeekdays}</option> <option value="Weekend">${OptionWeekends}</option> </select> </div> <div class="selectContainer"> <select is="emby-select" class="selectHour" id="selectStart" label="${LabelAccessStart}"></select> </div> <div class="selectContainer"> <select is="emby-select" class="selectHour" id="selectEnd" label="${LabelAccessEnd}"></select> </div> <div class="formDialogFooter"> <button is="emby-button" type="submit" class="raised button-submit block formDialogFooterItem"> <span>${Add}</span> </button> </div> </form> </div> </div> ');function r(e){var t=0,a=e%1;return a&&(t=parseInt(60*a,10)),n.Ay.getDisplayTime(new Date(2e3,1,1,e,t,0,0))}function i(e){return new Promise((function(t,a){var n=o.default.createDialog({removeOnClose:!0,size:"small"});n.classList.add("formDialog");var i,c,u,d,y,v="";v+=l.Ay.translateHtml(s),n.innerHTML=v,function(e){for(var t="",a=0;a<24;a+=.5)t+='<option value="'.concat(a,'">').concat(r(a),"</option>");t+='<option value="24">'.concat(r(0),"</option>"),e.querySelector("#selectStart").innerHTML=t,e.querySelector("#selectEnd").innerHTML=t}(n),i=n,u=(c=e.schedule).DayOfWeek,d=c.StartHour,y=c.EndHour,i.querySelector("#selectDay").value=u||"Sunday",i.querySelector("#selectStart").value=d||0,i.querySelector("#selectEnd").value=y||0,o.default.open(n),n.addEventListener("close",(function(){n.submitted?t(e.schedule):a()})),n.querySelector(".btnCancel").addEventListener("click",(function(){o.default.close(n)})),n.querySelector("form").addEventListener("submit",(function(t){return function(e,t){var a={DayOfWeek:e.querySelector("#selectDay").value,StartHour:e.querySelector("#selectStart").value,EndHour:e.querySelector("#selectEnd").value};parseFloat(a.StartHour)>=parseFloat(a.EndHour)?alert(l.Ay.translate("ErrorStartHourGreaterThanEnd")):(e.submitted=!0,t.schedule=Object.assign(t.schedule,a),o.default.close(e))}(n,e),t.preventDefault(),!1}))}))}var c={show:i}}}]);