!function(e){"use strict";e((function(){let o=e(window),i=e("#wopb-header-template");if(!i.length)return;let t=e("#wpadminbar");function l(){return t.length?t.outerHeight():0}let s=l(),n=i.find(".wopb-sticky-header"),r=i.find(".wopb-sticky-scroll-header");if(window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches)return void r.addClass("wopb-scroll-visible");function c(o){let i=[];return o.each((function(){let o=e(this);i.push({$el:o,el:this,originalTop:o.offset().top,height:o.outerHeight(),fixed:!1,originalBackground:o.css("background-color"),originalOpacity:o.css("opacity")})})),i}let a=c(n),d=c(r);function f(e,o){let i=(s||0)+o;e.$el.css({position:"fixed",top:i+"px",left:"0",right:"0","z-index":"9999","background-color":e.originalBackground||"",opacity:e.originalOpacity||"1"}),e.fixed=!0}function p(e){e.$el.css({position:"",top:"",left:"",right:"","z-index":"","background-color":"",opacity:"",transform:""}),e.fixed=!1}let h=!1,u=window.pageYOffset||document.documentElement.scrollTop,g=!1;function b(){g||(g=!0,window.requestAnimationFrame((function(){!function(){s=l();let e=window.pageYOffset||document.documentElement.scrollTop;if(h||(h=!0),e<=0)return a.forEach((function(e){e.fixed&&p(e)})),d.forEach((function(e){e.fixed&&p(e),e.$el.removeClass("wopb-scroll-hidden").addClass("wopb-scroll-visible")})),i.css("padding-top",""),void(u=e);let o=0;a.forEach((function(i){e>=i.originalTop-o?(i.fixed||f(i,o),o+=i.height):i.fixed&&p(i)})),d.forEach((function(i){if(e>=i.originalTop-o){if(i.fixed||f(i,o),e<=50)i.$el.removeClass("wopb-scroll-hidden").addClass("wopb-scroll-visible"),i.$el.css("transform","translateY(0)");else if(Math.abs(e-u)>10)if(e>u){const e=-((s||0)+o+i.height);i.$el.removeClass("wopb-scroll-visible").addClass("wopb-scroll-hidden"),i.$el.css("transform","translateY("+e+"px)")}else i.$el.removeClass("wopb-scroll-hidden").addClass("wopb-scroll-visible"),i.$el.css("transform","translateY(0)");o+=i.height}else i.fixed&&p(i),i.$el.removeClass("wopb-scroll-hidden").addClass("wopb-scroll-visible")})),o>0?i.css("padding-top",o+"px"):i.css("padding-top",""),u=e}(),g=!1})))}r.addClass("wopb-scroll-visible"),o.on("scroll touchmove",b),o.on("resize",(function(){s=l(),a.forEach((function(e){e.originalTop=e.$el.offset().top,e.height=e.$el.outerHeight()})),d.forEach((function(e){e.originalTop=e.$el.offset().top,e.height=e.$el.outerHeight()})),b()})),i.on("mouseenter touchstart pointerenter",(function(){r.removeClass("wopb-scroll-hidden").addClass("wopb-scroll-visible")}))}))}(jQuery);