define(["exports","./../modules/viewmanager/baseview.js","./../modules/loading/loading.js","./../modules/emby-elements/emby-input/emby-input.js","./../modules/emby-elements/emby-button/emby-button.js","./../modules/emby-elements/emby-checkbox/emby-checkbox.js","./../modules/emby-elements/emby-scroller/emby-scroller.js","./../modules/emby-apiclient/connectionmanager.js","./../modules/approuter.js","./../modules/common/appsettings.js"],function(_exports,_baseview,_loading,_embyInput,_embyButton,_embyCheckbox,_embyScroller,_connectionmanager,_approuter,_appsettings){function View(view,params){_baseview.default.apply(this,arguments),view.querySelector("form").addEventListener("submit",function(e){var address=this.querySelector(".txtServerHost").value,port=this.querySelector(".txtServerPort").value;return port&&(address=function(string,charToRemove){for(;string.charAt(string.length-1)===charToRemove;)string=string.substring(0,string.length-1);return string}(address,"/"),address+=":"+port),_loading.default.show(),_connectionmanager.default.connectToAddress(address,{enableAutoLogin:_appsettings.default.enableAutoLogin()}).then(function(result){_loading.default.hide(),_approuter.default.handleConnectionResult(result,view)}),e.preventDefault(),!1}),view.querySelector(".buttonCancel").addEventListener("click",function(e){_approuter.default.back()})}Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.default=void 0,require(["material-icons"]),Object.assign(View.prototype,_baseview.default.prototype),View.prototype.onResume=function(options){_baseview.default.prototype.onResume.apply(this,arguments);var view=this.view;view.querySelector(".txtServerHost").value="",view.querySelector(".txtServerPort").value="8096"},_exports.default=View});