"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[40501,62882,73405,96084],{39728:function(e,t,n){n.r(t),n.d(t,{default:function(){return s}}),n(44962),n(78557),n(90076),n(83994),n(82367);var i=n(8566),o=n(67430),a=n(89100);function r(e){return function(e){i.Ay.show();var t=o.tF.currentApiClient();t.getJSON(t.getUrl("Startup/Configuration")).then((function(n){n.PreferredMetadataLanguage=e.querySelector("#selectLanguage").value,n.MetadataCountryCode=e.querySelector("#selectCountry").value,t.ajax({type:"POST",data:JSON.stringify(n),url:t.getUrl("Startup/Configuration"),contentType:"application/json"}).then((function(){i.Ay.hide(),a.default.navigate("wizard/remoteaccess")}))}))}(this),e.preventDefault(),!1}function s(e){e.querySelector(".wizardSettingsForm").addEventListener("submit",r),e.addEventListener("viewshow",(function(){document.querySelector(".skinHeader").classList.add("noHomeButtonHeader"),function(e){i.Ay.show();var t=o.tF.currentApiClient(),n=t.getJSON(t.getUrl("Startup/Configuration")),a=t.getCultures(),r=t.getCountries();Promise.all([n,a,r]).then((function(t){!function(e,t,n,o){!function(e,t){var n="";n+="";for(var i=0,o=t.length;i"+a.DisplayName+""}e.innerHTML=n}(e.querySelector("#selectLanguage"),n),function(e,t){var n="";n+="";for(var i=0,o=t.length;i"+a.DisplayName+""}e.innerHTML=n}(e.querySelector("#selectCountry"),o),e.querySelector("#selectLanguage").value=t.PreferredMetadataLanguage,e.querySelector("#selectCountry").value=t.MetadataCountryCode,i.Ay.hide()}(e,t[0],t[1],t[2])}))}(this)})),e.addEventListener("viewhide",(function(){document.querySelector(".skinHeader").classList.remove("noHomeButtonHeader")}))}n(10353),n(77157),n(63001)},62882:function(e,t,n){n.r(t),n.d(t,{show:function(){return d}});var i=n(22696),o=n.n(i),a=n(79754),r=n(46782),s=n(5898),l=n(36300),c=(n(10353),function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],i=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")});function u(e,t,i){Promise.resolve().then(n.bind(n,10838)).then((function(n){var o=i?"on":"off";n.centerFocus[o](e,t)})).catch((function(e){console.warn("Error in centerFocus",e)}))}function d(e){var t,n,i,d={removeOnClose:!0,enableHistory:e.enableHistory,scrollY:!1};r.A.tv?(d.size="fullscreen",i=!0,d.autoFocus=!0):(d.modal=!1,d.entryAnimation=e.entryAnimation,d.exitAnimation=e.exitAnimation,d.entryAnimationDuration=e.entryAnimationDuration||140,d.exitAnimationDuration=e.exitAnimationDuration||100,d.autoFocus=!1);var v=a.default.createDialog(d);i?v.classList.add("actionsheet-fullscreen"):v.classList.add("actionsheet-not-fullscreen"),v.classList.add("actionSheet"),e.dialogClass&&v.classList.add(e.dialogClass);var h="",f=r.A.tv?"scrollY smoothScrollY hiddenScrollY":"scrollY",m="";e.items.length>20&&(m+="min-width:"+(l.Ay.getWindowSize().innerWidth>=300?240:200)+"px;");var y,p=!1,b=[];try{for(var g=c(e.items),S=g.next();!S.done;S=g.next())(y=(x=S.value).icon||(x.selected?"check":null))&&(p=!0),b.push(y||"")}catch(e){t={error:e}}finally{try{S&&!S.done&&(n=g.return)&&n.call(g)}finally{if(t)throw t.error}}r.A.tv&&(h+=''));var A=e.title&&!p;A||r.A.tv?h+='
':h+='
',e.title&&(h+='

'+o()(e.title)+"

"),e.text&&(h+='

'+o()(e.text)+"

");var L="actionSheetScroller";r.A.tv&&(L+=" actionSheetScroller-tv focuscontainer-x focuscontainer-y"),h+='
';var w="listItem listItem-button actionSheetMenuItem";(e.border||e.shaded)&&(w+=" listItem-border"),e.menuItemClass&&(w+=" "+e.menuItemClass),r.A.tv&&(w+=" listItem-focusscale"),r.A.mobile&&(w+=" actionsheet-xlargeFont");for(var C=0;C
':(h+="',(y=b[C])?h+=''):p&&!A&&(h+=''),h+='
',h+='
',h+=o()(x.name||x.textContent||x.innerText),h+="
",x.secondaryText&&(h+='
'.concat(o()(x.secondaryText),"
")),h+="
",x.asideText&&(h+='
'.concat(o()(x.asideText),"
")),h+="")}if(e.showCancel&&(h+='
',h+='"),h+="
"),h+="
",v.innerHTML=h,r.A.tv){var T=v.querySelector(".actionSheetScroller");T&&u(T,!1,!0)}var I=v.querySelector(".btnCloseActionSheet");I&&I.addEventListener("click",(function(){a.default.close(v)}));var k,E=null;return e.timeout&&(k=setTimeout((function(){a.default.close(v)}),e.timeout)),new Promise((function(t,n){var i=!1;v.addEventListener("click",(function(n){var o=l.Ay.parentWithClass(n.target,"actionSheetMenuItem");o&&(E=o.getAttribute("data-id"),e.resolveOnClick&&(Array.isArray(e.resolveOnClick)?-1!==e.resolveOnClick.indexOf(E)&&(t(E),i=!0):(t(E),i=!0)),a.default.close(v))})),v.addEventListener("close",(function(){if(r.A.tv){var o=v.querySelector(".actionSheetScroller");o&&u(o,!1,!1)}k&&(clearTimeout(k),k=void 0),i||(null!=E?(e.callback&&e.callback(E),t(E)):n(new Error("ActionSheet closed without resolving")))})),a.default.open(v).catch((function(e){console.warn("DialogHelper.open error",e)}));var o=e.positionTo&&"fullscreen"!==d.size?function(e,t,n){var i=l.Ay.getWindowSize(),o=i.innerHeight,a=i.innerWidth,r=function(e){var t,n,i=[];if(!document)return i;try{for(var o=c(e),a=o.next();!a.done;a=o.next()){var r=a.value.getBoundingClientRect();i.push({top:r.top,left:r.left,width:r.width,height:r.height})}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return i}([e])[0];"top"!==t.positionY&&(r.top+=(r.height||0)/2),r.left+=(r.width||0)/2;var s=n.offsetHeight||300,u=n.offsetWidth||160;r.top-=s/2,r.left-=u/2;var d=r.left+u-a,v=r.top+s-o;return d>0&&(r.left-=d+20),v>0&&(r.top-=v+20),r.top+=t.offsetTop||0,r.left+=t.offsetLeft||0,r.top=Math.max(r.top,10),r.left=Math.max(r.left,10),r}(e.positionTo,e,v):null;o&&(v.style.position="fixed",v.style.margin="0",v.style.left=o.left+"px",v.style.top=o.top+"px")}))}t.default={show:d}},63001:function(e,t,n){var i=n(46782),o=n(34789),a=n(62882),r=(n(69177),Object.create(HTMLSelectElement.prototype));function s(){return!(o.A.edgeUwp||o.A.xboxOne||o.A.tizen||o.A.orsay||o.A.web0s||!o.A.tv&&i.A.tv)}function l(e){var t=c(e),n=t?t.textContent||t.innerText:null;a.default.show({items:e.options,positionTo:e,title:n}).then((function(t){!function(e,t){e.value=t}(e,t),function(e){var t=new Event("change",{bubbles:!1,cancelable:!0});e.dispatchEvent(t)}(e)}))}function c(e){for(var t=e.previousSibling;t&&"LABEL"!==t.tagName;)t=t.previousSibling;return t}function u(){var e=c(this);e&&e.classList.add("selectLabelFocused")}function d(){var e=c(this);e&&e.classList.remove("selectLabelFocused")}function v(e){e.button||s()||(e.preventDefault(),l(this))}function h(e){13!==e.keyCode&&195!==e.keyCode||s()||(e.preventDefault(),l(this))}var f=0;r.createdCallback=function(){this.id||(this.id="embyselect"+f,f++),this.classList.add("emby-select-withcolor"),i.A.tv&&this.classList.add("emby-select-focusscale"),this.addEventListener("mousedown",v),this.addEventListener("keydown",h),this.addEventListener("focus",u),this.addEventListener("blur",d)},r.attachedCallback=function(){var e;if(!this.classList.contains("emby-select")){this.classList.add("emby-select");var t,n=this.ownerDocument.createElement("label");n.innerText=this.getAttribute("label")||"",n.classList.add("selectLabel"),n.htmlFor=this.id,null===(e=this.parentNode)||void 0===e||e.insertBefore(n,this),this.classList.contains("emby-select-withcolor")&&(null===(t=this.parentNode)||void 0===t||t.insertAdjacentHTML("beforeend",'
0
'))}},r.setLabel=function(e){var t;(null===(t=this.parentNode)||void 0===t?void 0:t.querySelector("label")).innerText=e},document.registerElement("emby-select",{prototype:r,extends:"select"})}}]);