"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[8806],{88806:function(e,t,n){n.r(t),n.d(t,{default:function(){return u}}),n(5769),n(63238),n(61418),n(17460),n(14078),n(61013),n(99785);var r=n(90914),o=n(78695),l=n(44614),i=n(28978);function a(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function s(e){return e.preventDefault(),!1}function c(e,t,r){Promise.resolve().then(n.bind(n,74227)).then((function(n){var o=r?"on":"off";n.centerFocus[o](e,t)}))}n(20716),n(21865),n(85427),n(6626),n(78066),n(15359);var u=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,n;return t=e,(n=[{key:"show",value:function(e){return new Promise((function(t,n){var a={removeOnClose:!0,scrollY:!1};o.Z.tv?a.size="fullscreen":a.size="small";var u=r.default.createDialog(a);u.classList.add("formDialog");var d,f,v,m="";m+='<div class="formDialogHeader">',m+='<button is="paper-icon-button-light" class="btnCancel hide-mouse-idle-tv" tabindex="-1" title="'.concat(l.ZP.translate("ButtonBack"),'"><span class="material-icons arrow_back" aria-hidden="true"></span></button>'),m+='<h3 class="formDialogHeaderTitle">${Sort}</h3>',m+="</div>",m+='<div class="formDialogContent smoothScrollY"> <div class="dialogContentInner dialog-content-centered"> <form style="margin:auto"> <div class="verticalSection verticalSection-extrabottompadding" style="margin-top:2em"> <div class="selectContainer"> <select is="emby-select" class="selectSortBy" label="${LabelSortBy}"> </select> </div> <div class="selectContainer"> <select is="emby-select" class="selectSortOrder" label="${LabelSortOrder}"> <option value="Ascending">${Ascending}</option> <option value="Descending">${Descending}</option> </select> </div> </div> </form> </div> </div> ',u.innerHTML=l.ZP.translateHtml(m,"core"),function(e,t){e.querySelector(".selectSortBy").innerHTML=t.map((function(e){return'<option value="'+e.value+'">'+e.name+"</option>"})).join("")}(u,e.sortOptions),d=u,f=e.settings,d.querySelector("form").addEventListener("submit",s),d.querySelector(".selectSortOrder").value=f.sortOrder,d.querySelector(".selectSortBy").value=f.sortBy,u.querySelector(".btnCancel").addEventListener("click",(function(){r.default.close(u)})),o.Z.tv&&c(u.querySelector(".formDialogContent"),!1,!0),u.querySelector("form").addEventListener("change",(function(){v=!0}),!0),r.default.open(u).then((function(){if(o.Z.tv&&c(u.querySelector(".formDialogContent"),!1,!1),v)return function(e,t){i.setFilter(t+"-sortorder",e.querySelector(".selectSortOrder").value),i.setFilter(t+"-sortby",e.querySelector(".selectSortBy").value)}(u,e.settingsKey),void t();n()}))}))}}])&&a(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),e}()}}]);