!function(a){"use strict";a.fn.fusionImageCompare=function(){return this.each(function(){var b=a(this),c=void 0!==a(this).data("offset")?a(this).data("offset"):.5,d=void 0!==a(this).data("orientation")?a(this).data("orientation"):"horizontal",e=void 0!==a(this).data("move-slider-on-hover")&&a(this).data("move-slider-on-hover"),f=void 0===a(this).data("move-with-handle-only")||a(this).data("move-with-handle-only"),g=void 0!==a(this).data("click-to-move")&&a(this).data("click-to-move"),h=b.find("img:first"),i=b.find("img:last"),j=b.find(".fusion-image-before-after-handle"),k=a(".before-after-label-out-image-up-down"),l=0,m=0,n=0,o=0,p="",q=function(a){var b=h.width(),c=h.height();return{w:b+"px",h:c+"px",cw:a*b+"px",ch:a*c+"px"}},r=function(a){"vertical"===d?(h.css("clip","rect(0,"+a.w+","+a.ch+",0)"),i.css("clip","rect("+a.ch+","+a.w+","+a.h+",0)")):(h.css("clip","rect(0,"+a.cw+","+a.h+",0)"),i.css("clip","rect(0,"+a.w+","+a.h+","+a.cw+")")),b.css("height",a.h),k.addClass("visible")},s=function(a){var b=q(a);j.css("vertical"===d?"top":"left","vertical"===d?b.ch:b.cw),r(b)},t=function(a,b,c){return Math.max(b,Math.min(c,a))},u=function(a,b){return t("vertical"===d?(b-m)/o:(a-l)/n,0,1)},v=function(a){(a.distX>a.distY&&a.distX<-a.distY||a.distX-a.distY)&&"vertical"!==d?a.preventDefault():(a.distXa.distY&&a.distX>-a.distY)&&"vertical"===d&&a.preventDefault(),b.addClass("active"),l=b.offset().left,m=b.offset().top,n=h.width(),o=h.height()},w=function(a){b.hasClass("active")&&(c=u(a.pageX,a.pageY),s(c))},x=function(){b.removeClass("active")},y=function(a){var e;l=b.offset().left,m=b.offset().top,n=h.width(),o=h.height(),c=u(a.pageX,a.pageY),e=q(c),b.addClass("active"),"vertical"===d?j.stop(!0,!0).animate({top:e.ch},{queue:!1,duration:300,easing:"easeOutCubic",step:function(a,b){var c=a/o,d=q(c);r(d)},complete:function(){b.removeClass("active")}}):j.stop(!0,!0).animate({left:e.cw},{queue:!1,duration:300,easing:"easeOutCubic",step:function(a,b){var c=a/n,d=q(c);r(d)},complete:function(){b.removeClass("active")}})};a(window).on("resize.fusion-image-before-after",function(a){s(c)}),p=f?b:j,p.on("movestart",v),p.on("move",w),p.on("moveend",x),e&&(b.on("mouseenter",v),b.on("mousemove",w),b.on("mouseleave",x)),j.on("touchmove",function(a){a.preventDefault()}),b.find("img").on("mousedown",function(a){a.preventDefault()}),g&&b.on("click",y),a(window).trigger("resize.fusion-image-before-after")})}}(jQuery),jQuery(window).load(function(){jQuery(".fusion-image-before-after").fusionImageCompare()});