App={};App.attachedKeyEvents=!1;App.init=function(){App.textBox.loadUrlMap();App.cookiesSupported()?typeof Cookies.get(App.cookieConsent.COOKIE_CONSENT_NAME)=="undefined"&&($("#CookieConsentText").html(App.getString(200630)),$("#CookieConsentMoreInfo").html(App.getString(200631)),$("#CookieConsentGotItButton").html(App.getString(200632)),App.cookieConsent.show()):$("#Header").before("<div class='BlockedCookiesInfoBox'>"+App.getString(200396)+'<\/div><div class="Line"><\/div>');$("#LegalNoticeLink").html(App.getString(200481));$("#PrivacyPolicyLink").html(App.getString(200592));$("#UniFlowOnlineCloudServicesTermsLink").html(App.getString(232715));$("#FAQ").html(App.getString(230374));$(".footerLogo").html(App.getString(201048))};App.fixLogoOnIE=function(){var n=App.detectIE();n&&$("#Logo").css("height","150px")};App.getString=function(n){return Strings.getString(n)};App.replaceStrings=function(){Strings.replaceStrings()};App.htmlEncode=function(n){return Strings.htmlEncode(n)};App.cookiesSupported=function(){var n=new Date;return(n.setTime(n.getTime()+6e4),Cookies.set(App.cookieConsent.COOKIE_TESTING_NAME,"are cookies supported?",{expires:n,secure:!0}),typeof Cookies.get(App.cookieConsent.COOKIE_TESTING_NAME)=="undefined")?!1:(Cookies.remove(App.cookieConsent.COOKIE_TESTING_NAME),!0)};App.getUrlParameter=function(n){for(var u=window.location.search.substring(1),r=u.split("&"),t,i=r.length;i;)if(i--,t=r[i].split("="),t[0]!==null&&n!==null&&decodeURIComponent(t[0]).toUpperCase()===n.toUpperCase())return typeof t[1]=="undefined"?!0:decodeURIComponent(t[1]);return!1};App.getAnchor=function(){var n=window.location.href.split("#");return typeof n[1]!="undefined"?n[1]:""};App.validateDecoratedInputFields=function(n){var i=$(n),t=!0;return i.find(":input[data-val=true]").each(function(){var n=$(this);n.attr("data-val-required")===void 0||n.val()?n.removeClass("Error"):(n.addClass("Error"),t=!1)}),t};App.validation={};App.validation.isEmail=function(n){return/^([a-zA-Z0-9_.+'&-])+@(([a-zA-Z0-9-])+\.)+([a-zA-Z0-9]{2,4})+$/.test(n)};App.detectIE=function(){var n=window.navigator.userAgent,t,u,i,r;return(t=n.indexOf("MSIE "),t>0)?parseInt(n.substring(t+5,n.indexOf(".",t)),10):(u=n.indexOf("Trident/"),u>0)?(r=n.indexOf("rv:"),parseInt(n.substring(r+3,n.indexOf(".",r)),10)):(i=n.indexOf("Edge/"),i>0)?parseInt(n.substring(i+5,n.indexOf(".",i)),10):!1};App.cookieConsent={COOKIE_CONSENT_NAME:"NTWareCookiePolicyConsent",COOKIE_TESTING_NAME:"TestCookies"};App.cookieConsent.show=function(){$("#CookieConsent").css("display","block")};App.cookieConsent.hide=function(){$("#CookieConsent").css("display","none")};App.cookieConsent.moreInfo=function(){App.textBox.show(App.textBox.COOKIE_POLICY)};App.cookieConsent.agree=function(){var n=new Date;n.setTime(n.getTime()+31536e6);Cookies.set(App.cookieConsent.COOKIE_CONSENT_NAME,1,{expires:n,secure:!0});App.cookieConsent.hide()};App.textBox={PRIVACY_POLICY:"PrivacyPolicy",EULA:"Eula",LEGAL_NOTICE:"LegalNotice",COOKIE_POLICY:"CookiePolicy",FAQ:"FAQ",FAQ_PWD_RECOVERY:"FAQPasswordRecovery",UNIFLOW_ONLINE_CLOUD_SERVICES_TERMS:"CloudServicesTerms"};App.textBox.cache={};App.textBox.urlMap={};App.textBox.loadUrlMap=function(){App.textBox.urlMap[App.textBox.FAQ]=GlobalConfig.Catalog.HelpResources.FaqStartingPage;App.textBox.urlMap[App.textBox.FAQ_PWD_RECOVERY]=GlobalConfig.Catalog.HelpResources.FaqPasswordRecoveryPage;App.textBox.urlMap[App.textBox.PRIVACY_POLICY]=GlobalConfig.Catalog.LegalDocuments.PrivacyPolicyPath;App.textBox.urlMap[App.textBox.UNIFLOW_ONLINE_CLOUD_SERVICES_TERMS]=GlobalConfig.Catalog.LegalDocuments.EulaMomoPath;App.textBox.urlMap[App.textBox.EULA]=GlobalConfig.Catalog.LegalDocuments.EndUserLicenseAgreementPath;App.textBox.urlMap[App.textBox.LEGAL_NOTICE]=GlobalConfig.Catalog.LegalDocuments.ImprintPath;App.textBox.urlMap[App.textBox.COOKIE_POLICY]=GlobalConfig.Catalog.LegalDocuments.CookiePolicyPath};App.textBox.show=function(n){var t,i;t=App.textBox.urlMap[n]||App.textBox.urlMap[App.textBox.LEGAL_NOTICE];i=App.textBox.cache[t];i?$(".TextView").html(App.textBox.cache[t]):App.textBox.loadUrl(t);$(".MainContainer").addClass("ShowTextBox");$("#Main").hide();$("#TextBox").css("display","block");App.attachedKeyEvents||($(document).keyup(function(n){n.keyCode===27&&App.textBox.hide()}),App.attachedKeyEvents=!0)};App.textBox.hide=function(){$(".MainContainer").removeClass("ShowTextBox");$("#Main").show();$("#TextBox").css("display","none")};App.textBox.removeScriptFromDom=function(n,t){var r=new DOMParser,i;return n.indexOf(t)===-1?n:(i=r.parseFromString(n,"text/html"),$(i).find("head, body").each(function(n,i){$(i).find("script").each(function(n,i){i.innerText.indexOf(t)!==-1&&$(i).remove()})}),i.documentElement.outerHTML)};App.textBox.loadUrl=function(n){$.get(n,function(t){var i=App.textBox.removeScriptFromDom(t,"ATL_JQ_PAGE_PROPS");App.textBox.cache[n]=i;$(".TextView").html(i)}).fail(function(){$(".TextView").html(App.getString(200264))})};App.goToOnlineFaqPages=function(){window.open(App.textBox.urlMap[App.textBox.FAQ],"_blank")};App.goToOnlineFaqPwdRecoveryPages=function(){window.open(App.textBox.urlMap[App.textBox.FAQ_PWD_RECOVERY],"_blank")};App.addFaqLink=function(){$("#Main").after("<div class='faqMessage'><a id='GoToOnlineFaqPages' href='#'>"+App.getString(203639)+"<\/a><\/div>");App.addEventListener([{element:document.getElementById("GoToOnlineFaqPages"),event:"click",callback:function(){App.goToOnlineFaqPages()}}])};App.addPasswordRecoveryAndFaqLink=function(){$("#Main").after($("<div>",{"class":"faqMessage"}).append($("<div>").append($("<a>",{id:"ForgotCredentials",text:App.getString(203638),href:"/Login/ForgotCredentials",title:App.getString(203638)}))).append($("<div>",{"class":"FAQLinkHolder"}).append($("<a>",{id:"GoToOnlineFaqPwdRecoveryPages",text:App.getString(203639),href:"#"}).click(App.goToOnlineFaqPwdRecoveryPages))))};App.addEventListener=function(n){for(var t=0;t<n.length;t++)n[t].element.addEventListener?n[t].element.addEventListener(n[t].event,n[t].callback,!1):n[t].element.attachEvent&&n[t].element.attachEvent("on"+n[t].event,n[t].callback)};App=App||{};App.previousLoginFailed=!1;App.identityTrainingEnabled=!1;App.DeviceAuthorizationLandingPageUrl="";App.canOpenIdentityProviderCapableBrowser=!1;App.isDeviceRegistration=!1;App.identityProviderValue=null;App.identityProviderName=null;App.preSelectedIdentityProviderId=null;App.Tpl={};App.WebControlClientTypes=["SmartClientForWindows","SmartClientForMac","LocalServerAgent","PrintSupportApp","PowerShellObjectManagement"];App.ExternalLoginWindowClientTypes=["SmartClientForWindows","SmartClientForMac","LocalServerAgent","PrintSupportApp"];App.PrivilegedAccountPageUrl="/Login/privilegedaccount";App.start=function(){var t,n,i=App.detectIE();if(App.createReturnUrlCookie(),App.getUrlParameter("isPrivilegedLogin")==="true"){window.location.href=App.PrivilegedAccountPageUrl;return}document.title=App.getString(200253);App.displayUsername();$("#Main .Title").html(App.getString(203637));$("#CancelTraining").html(App.getString(200521));n=$("#EmailLoginSubmitForm");n.val(App.getString(n.attr("data-stringid"))).click(function(n){n.target.disabled||(n.preventDefault(),App.emailLoginFormSubmit(n))});t=$("input[name=EmailAddress]");(i===!1||i>11)&&t.focus();App.WebControlClientTypes.indexOf(PageConfig.ClientType)>-1&&$("body div#UnsupportedBrowser").css("display","none");App.isDeviceRegistration=PageConfig.LoginIntent==="DeviceRegistration"&&PageConfig.ClientType!==null;App.ExternalLoginWindowClientTypes.indexOf(PageConfig.ClientType)>-1&&(App.canOpenIdentityProviderCapableBrowser=!0);PageConfig.ClientType==="SmartClientForWindows"&&(typeof external=="undefined"||typeof window.external.OpenInSystemBrowser=="undefined")&&($("body div#UnsupportedSmartClientVersion").css("display","flex"),App.canOpenIdentityProviderCapableBrowser=!1);PageConfig.ClientType==="SmartClientForMac"&&(typeof webkit=="undefined"||typeof window.webkit.messageHandlers=="undefined"||typeof window.webkit.messageHandlers.smartClientMacOpenInSystemBrowser=="undefined")&&($("body div#UnsupportedSmartClientVersion").css("display","flex"),App.canOpenIdentityProviderCapableBrowser=!1);PageConfig.ClientType==="LocalServerAgent"&&(typeof external=="undefined"||typeof window.external.OpenInSystemBrowser=="undefined")&&($("body div#UnsupportedLocalServerAgentVersion").css("display","flex"),App.canOpenIdentityProviderCapableBrowser=!1);PageConfig.ClientType==="PrintSupportApp"&&(typeof nativeObject=="undefined"||typeof window.nativeObject.openInSystemBrowser=="undefined")&&($("body div#UnsupportedPrintSupportAppVersion").css("display","flex"),App.canOpenIdentityProviderCapableBrowser=!1);App.init();App.replaceStrings();App.loadIdentityProviders();App.fixFontSizeOnBigScreen();App.fixLogoOnIE();switch(location.hash.substring(1)){case"LegalNotice":App.textBox.show(App.textBox.LEGAL_NOTICE);break;case"PrivacyPolicy":App.textBox.show(App.textBox.PRIVACY_POLICY);break;case"UniFlowOnlineCloudServicesTerms":App.textBox.show(App.textBox.UNIFLOW_ONLINE_CLOUD_SERVICES_TERMS)}document.getElementById("UsernameIsNotYouButton").addEventListener("click",function(){App.hideUsernameIsNotYou()});document.getElementById("EmailLogin").addEventListener("submit",function(){App.emailLoginFormSubmit()})};App.fixFontSizeOnBigScreen=function(){App.WebControlClientTypes.indexOf(PageConfig.ClientType)>-1&&$(window).width()>1200&&$("body").css("font-size","x-small")};App.displayUsername=function(){typeof PageConfig!="undefined"&&typeof PageConfig.Username!="undefined"&&PageConfig.Username!==""&&($("#CookieConsent").css("position","relative"),App.updateBannerForSameUser(),App.toggleVisibilityOfusernameBanner(!0))};App.showUsernameIsNotYou=function(){$("#Main").hide();$("#TextBox").hide();$(".UsernameIsNotYou").show();$(".UsernameIsNotYou .Title").text(App.getString(201883));$(".UsernameIsNotYou .Content").text(App.getString(201884));$(".UsernameIsNotYou .hideUsernameIsNotYouBtn").text(App.getString(201885));App.updateBannerForDifferentUser()};App.hideUsernameIsNotYou=function(){$(".UsernameIsNotYou").hide();$("#Main").show();App.updateBannerForSameUser()};App.updateBannerForSameUser=function(){$("#Username").html(App.getString(201881).replace("{0}","<b>"+App.htmlEncode(PageConfig.Username)+"<\/b>")+" "+App.getString(201873).replace("{0}","<a href='#' class='UsernameLink'>").replace("{1}","<\/a>")).on("click",".UsernameLink",function(n){n.preventDefault();App.showUsernameIsNotYou()})};App.updateBannerForDifferentUser=function(){$("#Username").html(App.getString(201881).replace("{0}","<b>"+App.htmlEncode(PageConfig.Username)+"<\/b>"))};App.toggleVisibilityOfusernameBanner=function(n){n?$("#Username").show():$("#Username").hide()};App.textBox.hide=function(){$(".MainContainer").removeClass("ShowTextBox");$("#Main").show();$("#TextBox").css("display","none");$(".UsernameIsNotYou").css("display","none");App.displayUsername()};App.textBox.show=function(n){var t,i;$(".UsernameIsNotYou").css("display","none");t=App.textBox.urlMap[n]||App.textBox.urlMap[App.textBox.LEGAL_NOTICE];i=App.textBox.cache[t];i?$(".TextView").html(App.textBox.cache[t]):App.textBox.loadUrl(t);$(".MainContainer").addClass("ShowTextBox");$("#Main").hide();$("#TextBox").css("display","block");App.attachedKeyEvents||($(document).keyup(function(n){n.keyCode===27&&App.textBox.hide()}),App.attachedKeyEvents=!0)};App.createReturnUrlCookie=function(){document.location.search.indexOf("ReturnUrl")!==-1&&(document.cookie="loginredirection="+Base64.encode(document.location.href)+"; secure; samesite=strict")};App.loadIdentityProviders=function(){var t,i,r,n,u,f,e,h=App.getAllowedIdentityProviderCategories(),o="includedCategories",s;App.showPreloader();App.getUrlParameter("identityProvider")&&(App.identityProviderName=App.getUrlParameter("identityProvider"));t=Cookies.get("LastProvider");typeof t!="undefined"&&App.identityProviderValue===null&&(App.identityProviderValue=t);f=App.getUrlParameter("preselectedIdpId");f&&(App.preSelectedIdentityProviderId=f);r=App.getAnchor();n=PageConfig.ReturnUrl;e=n.split("#")[1];r!==""&&typeof e=="undefined"&&(n+="#"+r);i=window.location.href.split("/");s="?"+o+"="+h.join("&"+o+"=");u="";PageConfig.TrainingId&&(u="&trainingId="+PageConfig.TrainingId);$.ajax({url:i[0]+"//"+i[2]+"/publicapi/domainIdps"+s+u,dataType:"json",headers:{Accept:"application/json","X-ClientType":PageConfig.ClientType},data:{returnTo:n},success:function(n){return typeof n=="undefined"||typeof n.IdentityProviders=="undefined"?(App.hidePreloader(),App.showError(App.getString(232218),App.getString(232215)),!1):n.HasLoginNonceBeenProvided===!1?(App.hidePreloader(),App.showError(App.getString(232218),App.getString(232246)),!1):n.IdentityProviders.length===0?(App.hidePreloader(),App.showError(App.getString(232217),App.getString(232216)),!1):(App.identityTrainingEnabled=n.IdentityTrainingEnabled===!0,App.DeviceAuthorizationLandingPageUrl=n.DeviceAuthorizationLandingPageUrl,App.previousLoginFailed=n.FailedPreviousLogin===!0,App.displayIdentityProviders(n),!0)},error:function(n){App.hidePreloader();App.showHttpError(n.status)}})};App.tryAddEmailLoginProvider=function(n){var i,t;if(App.identityTrainingEnabled===!0)return null;for(t=0;t<n.length;t++)if(n[t].Category.toLowerCase()==="emaillogin")return $("#EmailLogin").show(),i=Cookies.get("LastEmailAddress"),typeof i!="undefined"&&$("input[name=EmailAddress]").val(i),n[t];return null};App.tryRedirectToPreSelectedIdentityProvider=function(n){for(var t=0;t<n.length;t++)n[t].Category.toLowerCase()!=="emaillogin"&&(App.preSelectedIdentityProviderId&&App.preSelectedIdentityProviderId.toLowerCase()===n[t].Id.toLowerCase()||n[t].Label===App.identityProviderValue&&App.identityTrainingEnabled===!1&&App.previousLoginFailed===!1&&App.identityProviderValue!==null&&App.identityProviderValue.length>0||n[t].Label===App.identityProviderName&&App.identityTrainingEnabled===!1&&App.previousLoginFailed===!1)&&App.redirectToProvider(n[t])};App.tryAddOtherProviders=function(n,t,i,r){for(var f=[],u=0;u<n.length;u++)n[u].Category.toLowerCase()!=="emaillogin"&&n[u].Category.toLowerCase()!=="internal"&&(App.identityTrainingEnabled!==!0||n[u].Label!==r)&&(t.addClass("providers-wrapper"),t.before($("<input type='submit'>").addClass("Provider clickable font-family-default line-height-default font-size-default").val(App.getString(203641)+" "+n[u].Label).click(i(n[u]))),f.push(n[u]));return f};App.getPrivilegedAccountPageLink=function(){var n=App.PrivilegedAccountPageUrl;return App.ExternalLoginWindowClientTypes.indexOf(PageConfig.ClientType)>-1&&App.canOpenIdentityProviderCapableBrowser&&App.isDeviceRegistration&&(n=App.DeviceAuthorizationLandingPageUrl+"&isPrivilegedLogin=true&clientType="+PageConfig.ClientType),n};App.tryAddInternalProvider=function(n,t,i){for(var f,u,r=0;r<n.length;r++)if(n[r].Category.toLowerCase()==="internal")return f=App.getString(204468).replace("{0}","<a class='internalProviderLink' href='#'>").replace("{1}","<\/a>").replace("{2}","<a href='"+App.getPrivilegedAccountPageLink()+"' >").replace("{3}","<\/a>"),u=$($.parseHTML("<p class='InternalProvider'>"+f+"<\/p>")),u.find(".internalProviderLink").click(i(n[r])),t.before(u),n[r];return null};App.displayIdentityProviders=function(n){var t=n.IdentityProviders,i,c=App.identityTrainingEnabled,f,e,r,o=null,u,h,s=[];if(App.identityTrainingEnabled===!0){for(f=!1,r=0;r<t.length;r++)t[r].Label!==n.PreviousIdP&&(f=!0);f===!1&&(App.identityTrainingEnabled=!1)}if(i=$("#Main .FormButtons"),App.identityTrainingEnabled===!0&&($("#Main .Title").html(App.getString(203648)).after("<div class='InfoMessage'><img id='InfoMessageIcon' src='/Content/LoginPage/img/infomation-circle.svg' /><div>"+App.getString(434502)+"<\/div><\/div>"),i.addClass("FormButtonsMargin"),$("#CancelTraining").show()),e=function(n){return function(){App.redirectToProvider(n)}},u=App.tryAddEmailLoginProvider(t),h=u===null||!App.isDeviceRegistration||App.canOpenIdentityProviderCapableBrowser,h&&(App.tryRedirectToPreSelectedIdentityProvider(t),s=App.tryAddOtherProviders(t,i,e,n.PreviousIdP),o=App.tryAddInternalProvider(t,i,e)),u!==null&&o!==null){$(".SubmitButtonWrapper").after("<p class='PrivilegedAccountLoginLink'>"+App.getString(203675)+" <a id='PrivilegedAccountLoginLink' href='"+App.getPrivilegedAccountPageLink()+"'>"+App.getString(203676)+"<\/a><\/p>");s.length===0&&($(".InternalProvider").hide(),$(".OrSeparator").html(""));$(".EmailLoginValidation").on("input",function(){$(".EmailLoginValidation").removeClass("HasError");$(".EmailLoginValidation .error-empty").hide();$(".EmailLoginValidation .error-invalid").hide()})}return(App.hidePreloader(),u===null&&s.length===0&&o===null)?(App.showError(App.getString(232218),App.getString(200272)),!1):c===!0&&App.identityTrainingEnabled===!1&&App.previousLoginFailed===!0?(App.showError(App.getString(232218),App.getString(200273)),!1):(App.identityTrainingEnabled===!1&&i.before("<div class='loginActions'><input class='rememberLast' type='checkbox' id='rememberLastCheckbox' value='false'/>&nbsp;<label for='rememberLastCheckbox'>"+App.getString(200257)+"<\/label><br /><\/div>"),App.addPasswordRecoveryAndFaqLink(),null)};App.redirectToProvider=function(n){var t=n.URL,u=n.Label,i=new Date,r=$("#Main .rememberLast");r&&r.length>0&&r[0].checked?(i.setTime(i.getTime()+864e6),Cookies.set("LastProvider",u,{expires:i})):Cookies.remove("LastProvider");App.showRedirectSpinner();App.ExternalLoginWindowClientTypes.indexOf(PageConfig.ClientType)>-1&&App.canOpenIdentityProviderCapableBrowser&&App.isDeviceRegistration&&(t=App.DeviceAuthorizationLandingPageUrl,t+="&identityProviderId="+n.Id,t+="&clientType="+PageConfig.ClientType,n.Category.toLowerCase()==="emaillogin"&&(t+="&emailAddress="+encodeURIComponent($("#EmailLogin input[name=EmailAddress]").val())));window.location.href=t};App.showPreloader=function(){$("#Main .Provider").remove();$("#Main .loginActions").remove();$("#Main .EmailLogin").hide();$("#Main").removeClass("MainBorder");$("body").removeClass("BodyBackground");$("#Preloader").show()};App.showRedirectSpinner=function(){$(".MainContainer").remove();$("#Footer").remove();$("body").removeClass("BodyBackground");$("#RedirectSpinner .logo, #RedirectSpinner .spinner").css("display","block")};App.hidePreloader=function(){$("#Preloader").hide();$("body").addClass("BodyBackground");$("#Main .EmailLogin").show();$("#Main").addClass("MainBorder")};App.showError=function(n,t){$(".ErrorContainer .Title").text(n);$(".ErrorContainer .Error").text(t);$("#Main").html($(".ErrorContainer").show())};App.showHttpError=function(n){switch(n){case 0:case 302:case 400:case 500:case 502:case 504:App.showError(App.getString(232218),App.getString(232215));break;case 404:App.showError(App.getString(232218),App.getString(200260));break;case 200:App.showError(App.getString(232218),App.getString(200266));break;default:App.showError(App.getString(232218),App.getString(200258)+" "+n)}};App.emailLoginFormSubmit=function(){var n=!0,r=!0,t=$("input[name=EmailAddress]").val(),i,f,u;if($(".EmailLoginValidation").removeClass("HasError"),t===""?(r=!1,$(".EmailLoginValidation").addClass("HasError"),$(".EmailLoginValidation .error-empty").show(),$(".EmailLoginValidation .error-invalid").hide()):App.validation.isEmail(t)||(r=!1,$(".EmailLoginValidation").addClass("HasError"),$(".EmailLoginValidation .error-empty").hide(),$(".EmailLoginValidation .error-invalid").show()),r)if(arguments.length===0)n=!0;else{if(App.ExternalLoginWindowClientTypes.indexOf(PageConfig.ClientType)>-1&&App.canOpenIdentityProviderCapableBrowser&&App.isDeviceRegistration){window.location.href=App.DeviceAuthorizationLandingPageUrl+"&clientType="+PageConfig.ClientType+"&emailAddress="+encodeURIComponent(t);return}u=$("#EmailLoginSubmitForm");u.prop("disabled",!0);u.css({"background-color":"#6F6F6F",color:"#a8a8a8",border:"#6F6F6F","box-shadow":"none",transform:"none",cursor:"default"});document.forms.EmailLogin.submit()}else $("#ErrorMessageBox").show(),n=!1;return n&&(i=new Date,f=864e6,i.setTime(i.getTime()+f),Cookies.set("LastEmailAddress",t,{expires:i})),n};App.getAllowedIdentityProviderCategories=function(){var n=["Internal","Shared","WsFed","OpenId","EmailLogin"];return PageConfig.ShowOnlyPrivilegedUserIdentityProviders&&n.pop(),n}