"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[32242],{77004:function(e,t,a){a.r(t),a(44962),a(29305),a(32733),a(84701),a(81678),a(4754),a(94),a(36947),a(78557),a(90076),a(83994),a(23630),a(82367);var o=a(47629),n=a(79754),r=a(56869),l=a(46782),s=a(9482),i=(a(98959),a(10353),a(15453),a(77157),a(63001),a(86191)),c=a(50764);function u(e){return u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},u(e)}function d(e,t){for(var a=0;a<t.length;a++){var o=t[a];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,f(o.key),o)}}function f(e){var t=function(e,t){if("object"!=u(e)||!e)return e;var a=e[Symbol.toPrimitive];if(void 0!==a){var o=a.call(e,"string");if("object"!=u(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==u(t)?t:t+""}function p(e,t,o){Promise.resolve().then(a.bind(a,46345)).then((function(a){var n=o?"on":"off";a.centerFocus[n](e,t)}))}function m(e){r.Ay.show();var t=o.Ay.parentWithClass(e.target,"dialog"),a=this.options,l=i.A.getApiClient(a.serverId),u="all"===t.querySelector("#selectMetadataRefreshMode").value,d="scan"===t.querySelector("#selectMetadataRefreshMode").value?"Default":"FullRefresh",f="FullRefresh"===d&&t.querySelector(".chkReplaceImages").checked;return a.itemIds.forEach((function(e){l.refreshItem(e,{Recursive:!0,ImageRefreshMode:d,MetadataRefreshMode:d,ReplaceAllImages:f,ReplaceAllMetadata:u})})),n.default.close(t),(0,c.A)(s.Ay.translate("RefreshQueued")),r.Ay.hide(),e.preventDefault(),!1}var y=function(){return e=function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.options=t},(t=[{key:"show",value:function(){var e={removeOnClose:!0,scrollY:!1};l.A.tv?e.size="fullscreen":e.size="small";var t=n.default.createDialog(e);t.classList.add("formDialog");var a="",o=s.Ay.translate("RefreshMetadata");return a+='<div class="formDialogHeader">',a+='<button is="paper-icon-button-light" class="btnCancel autoSize" tabindex="-1" title="'.concat(s.Ay.translate("ButtonBack"),'"><span class="material-icons arrow_back" aria-hidden="true"></span></button>'),a+='<h3 class="formDialogHeaderTitle">',a+=o,a+="</h3>",a+="</div>",a+=function(){var e="";return e+='<div class="formDialogContent smoothScrollY" style="padding-top:2em;">',e+='<div class="dialogContentInner dialog-content-centered">',e+='<form style="margin:auto;">',e+='<div class="fldSelectPlaylist selectContainer">',e+='<select is="emby-select" id="selectMetadataRefreshMode" label="'+s.Ay.translate("LabelRefreshMode")+'">',e+='<option value="scan" selected>'+s.Ay.translate("ScanForNewAndUpdatedFiles")+"</option>",e+='<option value="missing">'+s.Ay.translate("SearchForMissingMetadata")+"</option>",e+='<option value="all">'+s.Ay.translate("ReplaceAllMetadata")+"</option>",e+="</select>",e+="</div>",e+='<label class="checkboxContainer hide fldReplaceExistingImages">',e+='<input type="checkbox" is="emby-checkbox" class="chkReplaceImages" />',e+="<span>"+s.Ay.translate("ReplaceExistingImages")+"</span>",e+="</label>",e+='<div class="fieldDescription">',e+=s.Ay.translate("RefreshDialogHelp"),e+="</div>",e+='<input type="hidden" class="fldSelectedItemIds" />',e+="<br />",e+='<div class="formDialogFooter">',e+='<button is="emby-button" type="submit" class="raised btnSubmit block formDialogFooterItem button-submit">'+s.Ay.translate("Refresh")+"</button>",e+="</div>",e+="</form>",(e+="</div>")+"</div>"}(),t.innerHTML=a,t.querySelector("form").addEventListener("submit",m.bind(this)),t.querySelector("#selectMetadataRefreshMode").addEventListener("change",(function(){"scan"===this.value?t.querySelector(".fldReplaceExistingImages").classList.add("hide"):t.querySelector(".fldReplaceExistingImages").classList.remove("hide")})),this.options.mode&&(t.querySelector("#selectMetadataRefreshMode").value=this.options.mode),t.querySelector("#selectMetadataRefreshMode").dispatchEvent(new CustomEvent("change")),t.querySelector(".btnCancel").addEventListener("click",(function(){n.default.close(t)})),l.A.tv&&p(t.querySelector(".formDialogContent"),!1,!0),new Promise((function(e){l.A.tv&&p(t.querySelector(".formDialogContent"),!1,!1),t.addEventListener("close",e),n.default.open(t)}))}}])&&d(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();t.default=y}}]);