define(["emby-linkbutton"],function(){"use strict";functiongoNext(){Dashboard.navigate("wizardagreement.html")}functionloadDownloadInfo(view){varinstructions="";ApiClient.getSystemInfo().then(function(systemInfo){varoperatingSystem=systemInfo.OperatingSystem.toLowerCase();"windows"===operatingSystem?view.querySelector(".markExec").classList.add("hide"):view.querySelector(".markExec").classList.remove("hide"),"windows"===operatingSystem&&"Arm"!==systemInfo.SystemArchitecture?(view.querySelector(".suggestedLocation").innerHTML=Globalize.translate("FFmpegSuggestedDownload",'<a is="emby-linkbutton" class="button-link" target="_blank" href="https://ffmpeg.zeranoe.com/builds">https://ffmpeg.zeranoe.com</a>'),"X86"===systemInfo.SystemArchitecture?instructions="Download FFmpeg 32-Bit Static":"X64"===systemInfo.SystemArchitecture&&(instructions="Download FFmpeg 64-Bit Static")):"linux"===operatingSystem?(view.querySelector(".suggestedLocation").innerHTML=Globalize.translate("FFmpegSuggestedDownload",'<a is="emby-linkbutton" class="button-link" target="_blank" href="http://johnvansickle.com/ffmpeg">http://johnvansickle.com/ffmpeg</a>'),"X86"===systemInfo.SystemArchitecture?instructions="Download x86 build":"X64"===systemInfo.SystemArchitecture&&(instructions="Download x86_64 build")):"osx"===operatingSystem&&"X64"===systemInfo.SystemArchitecture?(view.querySelector(".suggestedLocation").innerHTML=Globalize.translate("FFmpegSuggestedDownload",'<a is="emby-linkbutton" class="button-link" target="_blank" href="http://evermeet.cx/ffmpeg">http://evermeet.cx/ffmpeg</a>'),instructions="Download both ffmpeg and ffprobe, and extract them to the same folder."):view.querySelector(".suggestedLocation").innerHTML=Globalize.translate("FFmpegSuggestedDownload",'<a is="emby-linkbutton" class="button-link" target="_blank" href="http://ffmpeg.org">https://ffmpeg.org/download.html</a>'),view.querySelector(".downloadInstructions").innerHTML=instructions})}functiononSaveEncodingPathFailure(response){varmsg="";msg=Globalize.translate("FFmpegSavePathNotFound"),require(["alert"],function(alert){alert(msg)})}returnfunction(view,params){view.querySelector("#btnSelectEncoderPath").addEventListener("click",function(){require(["directorybrowser"],function(directoryBrowser){varpicker=newdirectoryBrowser;picker.show({includeFiles:!0,callback:function(path){path&&(view.querySelector(".txtEncoderPath").value=path),picker.close()}})})}),view.querySelector("form").addEventListener("submit",function(e){varform=this;returnApiClient.ajax({url:ApiClient.getUrl("System/MediaEncoder/Path"),type:"POST",data:{Path:form.querySelector(".txtEncoderPath").value,PathType:"Custom"}}).then(goNext,onSaveEncodingPathFailure),e.preventDefault(),!1}),view.addEventListener("viewbeforeshow",function(e){loadDownloadInfo(view)}),view.addEventListener("viewshow",function(){document.querySelector(".skinHeader").classList.add("noHomeButtonHeader")}),view.addEventListener("viewhide",function(){document.querySelector(".skinHeader").classList.remove("noHomeButtonHeader")})}});