function addMobileBanner(){switch(getPlatform()){case"NotMobile":return;case"Android":storeLink=mobileStoreURLAndroid;break;case"iOS":if(isSafari())return;storeLink=mobileStoreURLiOS}if(tryRedirect(storeLink),shouldDisplayBanner()){document.getElementById("appIcon").src="/Images/icons/BairdMobileIcon.png";document.getElementById("closeButton").addEventListener("touchend",function(n){n.preventDefault();setCache(userClosedBannerKey);closeBanner()});document.getElementById("appIcon").addEventListener("touchend",function(n){n.preventDefault();setCache(forceMobileKey);goToMobile(storeLink)});document.getElementById("appButton").addEventListener("touchend",function(n){n.preventDefault();setCache(forceMobileKey);goToMobile(storeLink)});"scrollRestoration"in history&&(history.scrollRestoration="manual");const n=document.getElementById("mobileBanner");n.addEventListener("touchstart",n=>{touchstartY=n.changedTouches[0].screenY});n.addEventListener("touchend",n=>{touchendY=n.changedTouches[0].screenY,handleGesture()});n.style.display="block";document.getElementById("baird-header").classList.add("baird-header-pushed")}}function handleGesture(){touchendY<touchstartY&&closeBanner()}function shouldDisplayBanner(){return checkCache(userClosedBannerKey)?!1:!0}function getPlatform(){var n=navigator.userAgent||navigator.vendor||window.opera;return/android/i.test(n)?"Android":/iPad|iPhone|iPod/.test(n)&&!window.MSStream?"iOS":"NotMobile"}function isSafari(){return navigator.userAgent.match("CriOS")?!1:!0}function tryRedirect(){if(mobileSuppressAutoRedirect===!0)return!1;const n=checkCache(forceMobileKey);if(n===!0)return goToMobile(),!0}function closeBanner(){setCache(userClosedBannerKey);$("#mobileBanner").hide("drop",{direction:"up"},"slow");document.getElementById("baird-header").classList.remove("baird-header-pushed")}function checkCache(n){const i=window.localStorage,t=i.getItem(n);if(n===forceMobileKey&&t!=null)return!0;const r=Date.parse(t),u=Date.parse(new Date);return n==userClosedBannerKey&&u<=r?!0:!1}function setCache(n){window.localStorage.setItem(n,new Date((new Date).getTime()+2592e6))}function removeCache(n){window.localStorage.removeItem(n)}function goToMobile(n=null){if(mobileURL!=null){const i=new URL(window.location);if(n!=null){var t=setTimeout(function(){setTimeout(function(){document.visibilityState!="hidden"&&(window.location=n)},500)},2e3);window.addEventListener("visibilitychange",()=>{clearTimeout(t)});window.addEventListener("pagehide",()=>{clearTimeout(t)})}window.location=mobileURL+i.search}}const userClosedBannerKey="dontShowBanner",forceMobileKey="forceMobile";let touchstartY=0,touchendY=0;$(document).ready(function(){addMobileBanner();window.scrollTo(0,0)})