(function(){"use strict";var n=function(n){function isAppCandidate(){var r=getCookie(s),u,t,i;if(r)if(u=(new Date).valueOf(),t=parseInt(r),u>t)e(s,"",undefined),n.AppCookieOverrideName&&e(n.AppCookieOverrideName,"",undefined);else if(n.AppCookieOverrideName){if(i=getCookie(n.AppCookieOverrideName),i)return!1}else return!1;return isSmallIosDevice()&&n.AppEnabled}function isEmbedded(){try{return window.self!==window.top}catch(n){return!0}}function isSmallIosDevice(){var n=navigator.userAgent||"";return!(n.toLowerCase().indexOf("windows phone")>-1)&&!(n.toLowerCase().indexOf("windows")>-1)&&(n.indexOf("iPhone")>-1||n.indexOf("iPod")>-1)&&n.indexOf("Safari")>-1}function buildIosPlayCover(){t=$("body"),c=$(''+n.IPhonePlayCoverLinkText+""),c.prependTo(t),t.css({height:f.height()+"px",overflow:"hidden"})}function buildDetectionPrompt(){var s,h,e,o;t=$("body"),f=$('
'),u=f.find(".IosAppDetection-PromptContainer"),f.prependTo(t),r=$('

'+n.InstallTheIosAppText+'

"),i=$('

'+n.InstallTheIosAppText+'

"),s=r.find("button"),h=i.find("button"),r.appendTo(u),i.appendTo(u),e=$('

"),o=e.find("button"),e.appendTo(u);o.on("click",closePrompt);s.on("click",getAppClicked);h.on("click",tryAppLaunch);t.css({height:f.height()+"px",overflow:"hidden"})}function closePrompt(){$(l).trigger("IosAppMessageClosed");var r=(new Date).valueOf()+36e5;e(s,r,undefined),n.AppCookieOverrideName&&e(n.AppCookieOverrideName,r,undefined),u.empty(),u.remove(),f.remove(),t.css({height:"",overflow:""})}function tryAppLaunch(){h=new Date,window.location=n.AppContentUrl,window.setTimeout(function(){var n=new Date;n.valueOf()0&&(t=document.cookie.indexOf(n+"="),t!=-1)?(t=t+n.length+1,i=document.cookie.indexOf(";",t),i==-1&&(i=document.cookie.length),unescape(document.cookie.substring(t,i))):""}var f,u,c,t,r,i,s="MediasiteAppDismissed",l=this,a,o,h,e;this.Run=function(){isEmbedded()&&isSmallIosDevice()?buildIosPlayCover():isAppCandidate()?buildDetectionPrompt():$(this).trigger("NotIosAppCandidate")},o=1500,e=function(n,t,i){var u,r;i?(r=new Date,r.setTime(r.getTime()+i*864e5),u="; expires="+r.toGMTString()):u="",document.cookie=n+"="+t+u+"; path=/"}};window.IosAppDetection=n})()