"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[81831],{49032:function(e,a,t){t.r(a),t(24776),t(44962),t(78557),t(90076),t(83994),t(23630),t(82367);var n=t(28850),o=(t(96244),t(8566)),r=t(5898),u=t(89100);function i(e){return ApiClient.getCountries().then((function(a){var t="";t+="<option value=''></option>";for(var n=0,o=a.length;n<o;n++){var r=a[n];t+="<option value='"+r.TwoLetterISORegionName+"'>"+r.DisplayName+"</option>"}e.innerHTML=t}))}function l(){var e=this;return o.Ay.show(),ApiClient.getServerConfiguration().then((function(a){a.PreferredMetadataLanguage=e.querySelector("#selectLanguage").value,a.MetadataCountryCode=e.querySelector("#selectCountry").value,a.DummyChapterDuration=e.querySelector("#valDummyChapterDuration").value,a.ChapterImageResolution=e.querySelector("#txtChapterImageResolution").value,ApiClient.updateServerConfiguration(a).then(u.default.processServerConfigurationUpdateResult)})),!1}$(document).on("pageinit","#metadataImagesConfigurationPage",(function(){$(".metadataImagesConfigurationForm").off("submit",l).on("submit",l)})).on("pageshow","#metadataImagesConfigurationPage",(function(){var e,a,t;o.Ay.show(),e=this,t=[ApiClient.getServerConfiguration(),(a=e.querySelector("#selectLanguage"),ApiClient.getCultures().then((function(e){var t="";t+="<option value=''></option>";for(var n=0,o=e.length;n<o;n++){var r=e[n];t+="<option value='"+r.TwoLetterISOLanguageName+"'>"+r.DisplayName+"</option>"}a.innerHTML=t}))),i(e.querySelector("#selectCountry"))],function(e){var a="";[{name:r.Ay.translate("ResolutionMatchSource"),value:n.m.MatchSource},{name:"2160p",value:n.m.P2160},{name:"1440p",value:n.m.P1440},{name:"1080p",value:n.m.P1080},{name:"720p",value:n.m.P720},{name:"480p",value:n.m.P480},{name:"360p",value:n.m.P360},{name:"240p",value:n.m.P240},{name:"144p",value:n.m.P144}].forEach((function(e){var t=e.value,n=e.name;a+='<option value="'.concat(t,'">').concat(n,"</option>")})),e.innerHTML=a}(e.querySelector("#txtChapterImageResolution")),Promise.all(t).then((function(a){var t=a[0];e.querySelector("#selectLanguage").value=t.PreferredMetadataLanguage||"",e.querySelector("#selectCountry").value=t.MetadataCountryCode||"",e.querySelector("#valDummyChapterDuration").value=t.DummyChapterDuration||"0",e.querySelector("#txtChapterImageResolution").value=t.ChapterImageResolution||"",o.Ay.hide()}))}))}}]);