$=window.jQuery,new(function(){function e(){this.videoPlayable=void 0!==document.createElement("video").canPlayType,this.activateVideos(),this.setupVideoCycle(),this.setupImageCycle(),this.setupQuoteCycle(),this.handleScrollAnimations(),this.handleEmailSubmit()}return e.prototype.handleScrollAnimations=function(){$(document).on("scroll",(function(e){if(!($(window).width()<=800)){if($(".streamline .wrapper .right .hover").offset().top<$(document).scrollTop()+$(window).height()&&$(".streamline .wrapper .right .hover").offset().top>$(document).scrollTop()){var o=($(".streamline .wrapper .right .hover").offset().top-$(document).scrollTop())/$(window).height();$(".streamline .wrapper .right .hover").css({top:30+70*o+"px"})}$(".workspaces .wrapper .main").offset().top<$(document).scrollTop()+$(window).height()&&$(".workspaces .wrapper .main").offset().top>$(document).scrollTop()&&(o=($(".workspaces .wrapper .main").offset().top-$(document).scrollTop())/$(window).height(),$(".workspaces .wrapper .main").css({bottom:50+100*o+"px"})),$(".emails-extensions .left.image").offset().top<$(document).scrollTop()+$(window).height()&&$(".emails-extensions .left.image").offset().top>$(document).scrollTop()&&(o=($(".emails-extensions .left.image").offset().top-$(document).scrollTop())/$(window).height(),$(".emails-extensions .left.image .left").css({top:140+60*(1-o)+"px"}),$(".emails-extensions .left.image .left.back").css({top:10+60*(1-o)+"px"}),$(".emails-extensions .left.image .right").css({top:115+60*(1-o)+"px"}),$(".emails-extensions .left.image .right.back").css({top:0+60*(1-o)+"px"}))}}))},e.prototype.activateVideos=function(){$(window).width()<=600||!this.videoPlayable||$(".video-source").each((function(e,o){var t=$(o).get(0),i=$(o).data("src");if(window.devicePixelRatio>=2&&(i=i.replace(/\.(?=[^./]*[.][^.]*$)(.*)\.(?=[^.]*$)/,"@2x.")),$(o).attr("src",i),t.load(),!$(o).hasClass("no-auto")){var n=t.play();n&&n.catch((function(e){}))}}))},e.prototype.setupVideoCycle=function(){var e=this;this.nextVideo(4),$(".logical .options .option").on("click",(function(o){o.preventDefault();var t=$(".logical .options .option").index(o.currentTarget);clearTimeout(e.videoTimeout),e.nextVideo(t)}))},e.prototype.nextVideo=function(e){var o=this,t=e-1;if(e==$(".logical .options .option").length&&(e=0,t=3),$(".logical .videos .video").hide(),$(".logical .options .option").removeClass("active"),$(".logical .videos .video").eq(e).fadeIn("slow"),$(".logical .options .option").eq(e).addClass("active"),$(window).width()>600&&this.videoPlayable){$(".logical .videos .video").eq(t).children("video").get(0).pause();var i=$(".logical .videos .video").eq(e).children("video").get(0);i.currentTime=0;var n=i.play();n&&n.catch((function(e){}))}var s=$(".logical .videos .video").eq(e).data("length");$(".logical .videos .video").eq(e).children(".mobile:visible").length&&(s=5),this.videoTimeout=setTimeout((function(){e++,o.nextVideo(e)}),1e3*s)},e.prototype.setupImageCycle=function(){var e=this,o=this.runImageCycle(0);$(".focused-browsing .options .option").eq(0).addClass("active"),$(".focused-browsing .options .option").on("click",(function(t){t.preventDefault();var i=$(".focused-browsing .options .option").index(t.currentTarget);clearInterval(o),$(".focused-browsing img").hide(),$(".focused-browsing .options .option").removeClass("active"),$(".focused-browsing img").eq(i).fadeIn("slow"),$(".focused-browsing .options .option").eq(i).addClass("active"),o=e.runImageCycle(i)}))},e.prototype.runImageCycle=function(e){var o=$(".focused-browsing .options .option").length;return setInterval((function(){$(".focused-browsing img").hide(),$(".focused-browsing .options .option").removeClass("active"),e==o-1?e=0:e++,$(".focused-browsing img").eq(e).fadeIn("slow"),$(".focused-browsing .options .option").eq(e).addClass("active")}),5e3)},e.prototype.setupQuoteCycle=function(){var e=this,o=this.runQuoteCycle(0);$(".quotes .options .option").eq(0).addClass("active"),$(".quotes .options .option").on("click",(function(t){t.preventDefault();var i=$(".quotes .options .option").index(t.currentTarget);clearInterval(o),$(".quotes .quote").hide(),$(".quotes .options .option").removeClass("active"),$(".quotes .quote").eq(i).fadeIn("slow"),$(".quotes .options .option").eq(i).addClass("active"),o=e.runQuoteCycle(i)}))},e.prototype.runQuoteCycle=function(e){var o=$(".quotes .options .option").length;return setInterval((function(){$(".quotes .quote").hide(),$(".quotes .options .option").removeClass("active"),e==o-1?e=0:e++,$(".quotes .quote").eq(e).fadeIn("slow"),$(".quotes .options .option").eq(e).addClass("active")}),5e3)},e.prototype.handleEmailSubmit=function(){$(".email-submit").on("submit",(function(e){e.preventDefault();var o=$(e.currentTarget),t=o.attr("action");$.post(t,o.serialize()).done((function(e){var t=e.success?"success":"danger",i=$("
").addClass("alert alert-"+t);i.text(e.message),o.find(".alert-container").append(i)}))}))},e}());