!function(n){"use strict";window.awb_oc_timeouts={},window.awbOffCanvas={timeouts:{},capitalize:function(n){return n.charAt(0).toUpperCase()+n.slice(1)},set:function(n,t,e){n=n?"_"+n:"_data";let a=localStorage.getItem("off_canvas"+n);a=a?JSON.parse(a):{},a[t]=e,localStorage.setItem("off_canvas"+n,JSON.stringify(a))},get:function(n,t){n=n?"_"+n:"_data";let e=localStorage.getItem("off_canvas"+n);return e=e?JSON.parse(e):{},e[t]||""},animationsWithoutDirection:["flash","rubberBand","shake","flipinx","flipiny","lightspeedin","flipOutX","flipOutY","lightSpeedOut"],open_off_canvas:function(t,e=!0,a=!1){const o=n('.awb-off-canvas-wrap[data-id="'+t+'"]'),i=o.find(".awb-off-canvas"),s=window["off_canvas_"+t],c=this;if(!o.length)return;if(o.hasClass("awb-show")&&a)return void this.close_off_canvas(t);if(this.set(t,"last_open_date",new Date),o.hasClass("awb-show")&&!a)return;let f=s.enter_animation;const r=s.enter_animation_direction&&"static"!==s.enter_animation_direction?this.capitalize(s.enter_animation_direction):"",d=s.enter_animation_speed||1,l=s.enter_animation_timing||"ease";if(("off"===s.status_css_animations||"desktop"===s.status_css_animations&&window.cssua.ua.mobile)&&(f=!1),f){if(this.animationsWithoutDirection.includes(f)||(f=f+"In"+r),i.addClass("fusion-animated "+f),i.attr("data-animation-type",f),i.css({visibility:"visible","animation-duration":d+"s","animation-timing-function":l}),"sliding-bar"===s.type&&"push"===s.transition&&"top"===s.position){const t={transition:"margin-top "+s.enter_animation_speed+"s"};t.marginTop=i.outerHeight()+"px";let e="#wrapper";o.hasClass("init-for-studio")&&(e=".post-preview"),n(e).css(t);const a=n(".fusion-tb-header").find(".fusion-sticky-container.fusion-container-stuck");a.length&&a.each(function(){n(this).attr("data-top",n(this).css("top")),n(this).css({top:"calc("+t.marginTop+" + "+n(this).attr("data-top")+")",transition:"top "+s.enter_animation_speed+"s"})})}if("sliding-bar"===s.type&&"push"===s.transition&&("left"===s.position||"right"===s.position)){const t={transition:"margin-inline-start "+s.enter_animation_speed+"s"};n("body").hasClass("rtl")?(t.marginInlineStart="-"+i.outerWidth()+"px","right"===s.position&&(t.marginInlineStart=i.outerWidth()+"px")):(t.marginInlineStart=i.outerWidth()+"px","right"===s.position&&(t.marginInlineStart="-"+i.outerWidth()+"px"));let e="#wrapper";o.hasClass("init-for-studio")&&(e=".post-preview"),n(e).css(t),n('#sliders-container .tfs-slider[data-parallax="1"]').length&&n('#sliders-container .tfs-slider[data-parallax="1"]').css(t)}}else this.enableTrapFocus(o);if("yes"===s.overlay&&"no"===s.overlay_page_scrollbar&&n("html").css("overflow","hidden"),o.addClass("awb-show"),n('a[href^="#awb-oc__'+t+'"]').addClass("awb-oc-active"),e){const n=this.get(t,"open_count")||0;this.set(t,"open_count",n+1)}const w=parseInt(s.auto_close_after_time);w&&(window.awb_oc_timeouts["close_after_time_"+t]=setTimeout(()=>{c.close_off_canvas(t)},1e3*w));const _=parseInt(s.show_close_button_after_time);_&&(window.awb_oc_timeouts["show_close_button_"+t]=setTimeout(()=>{i.children(".off-canvas-close").removeClass("hidden")},1e3*_)),o.trigger(n.Event("awb-oc-opened"),[t])},close_off_canvas:function(t,e=!0){const a=n('.awb-off-canvas-wrap[data-id="'+t+'"]'),o=a.find(".awb-off-canvas"),i=window["off_canvas_"+t];if(0===a.length||void 0===i)return;let s=i.exit_animation;const c=i.exit_animation_direction&&"static"!==i.exit_animation_direction?this.capitalize(i.exit_animation_direction):"",f=i.exit_animation_speed||1,r=i.exit_animation_timing||"ease";if(("off"===i.status_css_animations||"desktop"===i.status_css_animations&&window.cssua.ua.mobile)&&(s=!1),s){if(this.animationsWithoutDirection.includes(s)||(s=s+"Out"+c),o.addClass("fusion-animated "+s),o.attr("data-animation-type",s),o.addClass("is-closing"),o.css({"animation-duration":f+"s","animation-timing-function":r}),"sliding-bar"===i.type&&"push"===i.transition&&"top"===i.position){const t={transition:"margin-top "+i.enter_animation_speed+"s",marginTop:0};let e="#wrapper";a.hasClass("init-for-studio")&&(e=".post-preview"),n(e).css(t);const o=n(".fusion-tb-header").find(".fusion-sticky-container");o.length&&o.each(function(){const t=this;void 0!==n(this).attr("data-top")&&(n(this).css("top",n(this).attr("data-top")),n(this).removeAttr("data-top"),setTimeout(function(){n(t).css("transition","")},1e3*i.enter_animation_speed))})}if("sliding-bar"===i.type&&"push"===i.transition&&("left"===i.position||"right"===i.position)){const t={transition:"margin-inline-start "+i.exit_animation_speed+"s",marginInlineStart:0};let e="#wrapper";a.hasClass("init-for-studio")&&(e=".post-preview"),n(e).css(t),n('#sliders-container .tfs-slider[data-parallax="1"]').length&&n('#sliders-container .tfs-slider[data-parallax="1"]').css(t)}}else"yes"===i.overlay&&a.hasClass("init-for-studio")&&o.addClass("is-closing"),"no"===i.overlay&&a.hasClass("init-for-studio")&&n("#icon-bar .go-back").click(),a.removeClass("awb-show");if(n('a[href^="#awb-oc__'+t+'"]').removeClass("awb-oc-active"),"yes"===i.overlay&&"no"===i.overlay_page_scrollbar&&n("html").css("overflow",""),setTimeout(()=>{this.removeHash()},10),e){const n=this.get(t,"close_count")||0;this.set(t,"close_count",n+1)}this.set(t,"closed",!0),clearTimeout(window.awb_oc_timeouts["close_after_time_"+t]),clearTimeout(window.awb_oc_timeouts["show_close_button_"+t]);parseInt(i.show_close_button_after_time)&&o.children(".off-canvas-close").addClass("hidden"),a.trigger(n.Event("awb-oc-closed"),[t]),this.moveOCContentToPostCard(a)},removeHash(){const n=window.location.href.split("#")[0];history.replaceState({},"",n)},enableTrapFocus(n){if(!n.hasClass("type-popup"))return;const t=n.find(".awb-off-canvas"),e=t.find('a[href]:not([disabled]):visible, button:not([disabled]):visible, textarea:not([disabled]):visible, input[type="text"]:not([disabled]):visible, input[type="radio"]:not([disabled]):visible, input[type="checkbox"]:not([disabled]):visible, select:not([disabled]):visible'),a=e[0],o=e[e.length-1];setTimeout(()=>{t[0].focus()},100),t[0].addEventListener("keydown",function(n){("Tab"===n.key||9===n.keyCode)&&(n.shiftKey?document.activeElement===a&&(o.focus(),n.preventDefault()):document.activeElement===o&&(a.focus(),n.preventDefault()))})},movePostCardOCContentToOC(t,e){const a=e.closest(".post-card:not(.fusion_builder_column_inner)");if(a.length&&a.children(".awb-post-card-off-canvas-content").length){const e=n('.awb-off-canvas-wrap[data-id="'+t+'"]');if(e.length){const o=e.find(".off-canvas-content"),i=a.children(".awb-post-card-off-canvas-content");o.data("post-card",i).empty(),i.children().appendTo(o),o.children().find(".fusion-lottie").each(function(){if(!n(this).find("lottie-player").length){const t=n(this).find(".fusion-lottie-animation"),e=parseInt(t.data("speed")),a=parseInt(t.data("loop"));let o=parseInt(t.data("reverse"));o=1===o?-1:0,t.append('<lottie-player loop="'+a+'" speed="'+e+'" direction="'+o+'"></lottie-player>')}}),setTimeout(function(){n(window).trigger("fusion-dynamic-content-render",o)},10),o.find(".full-video, .video-shortcode, .wooslider .slide-content").fitVids(),o.find(".fusion-flexslider, .flexslider").each(function(){1<n(this).find(".slides li").length&&n(this).flexslider(0)}),o.find(".awb-openstreet-map").trigger("awb_openstreetmap/updateMap"),window.awbOffCanvas.handlePagination(t,e,a)}}},handlePagination(n,t,e){const a=t.find(".off-canvas-content").find(".fusion-pagination-tb");if(a.length){const o=e.next().length?e.next():e.parent().children().first(),i=e.prev().length?e.prev():e.parent().children().last(),s=a.find(".fusion-tb-next"),c=a.find(".fusion-tb-previous");a.hasClass("layout-preview")&&(s.find(".fusion-item-media").html(o.children(".awb-post-card-off-canvas-add-content").find(".awb-thumbnail").html()),s.find(".fusion-item-title").html(o.children(".awb-post-card-off-canvas-add-content").find(".awb-title").html()),c.find(".fusion-item-media").html(i.children(".awb-post-card-off-canvas-add-content").find(".awb-thumbnail").html()),c.find(".fusion-item-title").html(i.children(".awb-post-card-off-canvas-add-content").find(".awb-title").html())),s.off(),c.off(),s.one("click",function(e){e.preventDefault(),window.awbOffCanvas.moveOCContentToPostCard(t),setTimeout(function(){window.awbOffCanvas.movePostCardOCContentToOC(n,o.children(".awb-post-card-off-canvas-content"))},10)}),c.one("click",function(e){e.preventDefault(),window.awbOffCanvas.moveOCContentToPostCard(t),setTimeout(function(){window.awbOffCanvas.movePostCardOCContentToOC(n,i.children(".awb-post-card-off-canvas-content"))},10)})}},moveOCContentToPostCard(n){const t=n.find(".off-canvas-content"),e=void 0!==t.data("post-card")?t.data("post-card"):{};e.length&&(t.removeData("post-card"),t.children().appendTo(e))}},n(".awb-off-canvas").on("animationend",function(t){if(t.target!==this)return;const e=n(this),a=e.parent();e.attr("data-animation-type")&&e.removeClass("fusion-animated").removeClass(e.attr("data-animation-type")).removeAttr("data-animation-type"),e.hasClass("is-closing")?(e.removeClass("is-closing"),e.addClass("oc-waiting-for-close"),a.removeClass("awb-show"),a.hasClass("init-for-studio")&&n("#icon-bar .go-back").click()):window.awbOffCanvas.enableTrapFocus(a)}),n(".awb-off-canvas-wrap").on("transitionend",function(t){const e=n(this).find(".awb-off-canvas");e.hasClass("is-closing")&&n(this).hasClass("init-for-studio")&&(n("#icon-bar .go-back").click(),e.removeClass("is-closing")),e.removeClass("oc-waiting-for-close")}),n(window).on("load",function(){if(location.hash&&location.hash.startsWith("#awb-oc__")||location.hash&&location.hash.startsWith("#awb-open-oc__")){const n=location.hash.split("__")[1];window.awbOffCanvas.open_off_canvas(n,!1,!1)}n(".awb-off-canvas-wrap.init-for-studio").each(function(t,e){const a=n(e).data("id");window.awbOffCanvas.open_off_canvas(a,!1,!1)}),n(".awb-off-canvas-wrap").each(function(){n(this).on("awb-oc-closed",function(){n(this).find(".fusion-youtube iframe").each(function(){this.contentWindow.postMessage('{"event":"command","func":"pauseVideo","args":""}',"*")}),n(this).find(".fusion-vimeo iframe").each(function(){new Vimeo.Player(this).pause()}),n(this).find("video").each(function(){n(this).get(0).pause()}),n(this).find(".mejs-audio").each(function(){n(this).find(".mejs-playpause-button.mejs-pause button").trigger("click")})})})}),n("body").on("click",'a[href^="#awb-oc__"]',function(t){t.preventDefault();const e=(n(this).attr("href")||"").split("__")[1];window.awbOffCanvas.movePostCardOCContentToOC(e,n(this)),window.awbOffCanvas.open_off_canvas(e,!1,!0)}),n("body").on("click",'a[href^="#awb-open-oc__"]',function(t){t.preventDefault();const e=(n(this).attr("href")||"").split("__")[1];window.awbOffCanvas.movePostCardOCContentToOC(e,n(this)),window.awbOffCanvas.open_off_canvas(e,!1,!1)}),n("body").on("click",'a[href^="#awb-close-oc__"]',function(t){t.preventDefault();const e=(n(this).attr("href")||"").split("__")[1];e?window.awbOffCanvas.close_off_canvas(e):n(".awb-off-canvas-wrap.awb-show").each(function(){const t=n(this).data("id");window.awbOffCanvas.close_off_canvas(t)}),window.awbOffCanvas.removeHash()}),n(".awb-off-canvas-wrap:not(.overlay-disable-close)").on("click",function(t){if(t.target===this){const t=n(this).data("id");window.awbOffCanvas.close_off_canvas(t)}}),n(".close-on-anchor a").on("click",function(){if((n(this).attr("href")||"").includes("#")){const t=n(this).closest(".awb-off-canvas-wrap").data("id");window.awbOffCanvas.close_off_canvas(t)}}),n(".off-canvas-close").on("click",function(t){t.preventDefault();const e=n(this).closest(".awb-off-canvas-wrap").data("id");window.awbOffCanvas.close_off_canvas(e)}),n(document).on("keydown",function(t){if(27!==t.keyCode)return;n(".awb-off-canvas-wrap.awb-show:not(.disable-close-on-esc)").each(function(t,e){const a=n(e).data("id");window.awbOffCanvas.close_off_canvas(a)})}),n(".awb-off-canvas").on("mouseover",function(){const t=n(this).closest(".awb-off-canvas-wrap").data("id"),e=window["off_canvas_"+t];parseInt(e.auto_close_after_time)&&window.awb_oc_timeouts["close_after_time_"+t]&&clearTimeout(window.awb_oc_timeouts["close_after_time_"+t])}),n(".awb-off-canvas").on("mouseleave",function(){const t=n(this).closest(".awb-off-canvas-wrap").data("id"),e=window["off_canvas_"+t],a=parseInt(e.auto_close_after_time);a&&window.awb_oc_timeouts["close_after_time_"+t]&&(window.awb_oc_timeouts["close_after_time_"+t]=setTimeout(()=>{window.awbOffCanvas.close_off_canvas(t)},1e3*a))}),n("body").on("goback",function(t){n(".post-preview").css({"margin-right":0,"margin-left":0})}),n(".awb-off-canvas-wrap").each(function(t,e){const a=n(e).data("id"),o=window["off_canvas_"+a],i=n("#wpadminbar"),s=i.outerHeight();if("full"===o.height&&i.length&&n(e).find(".awb-off-canvas").css("height",`calc(100vh - ${s}px)`),"sliding-bar"===o.type&&"top"===o.position&&i.length&&n(e).find(".awb-off-canvas").css("margin-top",`${s}px`),"yes"===o.on_click){const t=o.on_click_element?n(o.on_click_element):null;t&&t.length&&(t.attr("data-off-canvas",o.on_click_element),n(document).on("click",o.on_click_element,function(n){n.preventDefault(),window.awbOffCanvas.open_off_canvas(a,!1)}))}"yes"===o.on_add_to_cart&&n(document).on("added_to_cart",function(){window.awbOffCanvas.open_off_canvas(a)});let c=!1;if(o.frequency){if("close"===o.frequency){!0===window.awbOffCanvas.get(a,"closed")&&(c=!0)}if("once"===o.frequency){0<window.awbOffCanvas.get(a,"open_count")&&(c=!0)}if("xtimes"===o.frequency&&o.frequency_xtimes){const n=window.awbOffCanvas.get(a,"open_count");parseInt(o.frequency_xtimes)<=n&&(c=!0)}if("session"===o.frequency){sessionStorage.getItem("off_canvas_"+a+"_opened")?c=!0:sessionStorage.setItem("off_canvas_"+a+"_opened",!0)}let n=window.awbOffCanvas.get(a,"last_open_date");const t=new Date;if("day"===o.frequency&&n){n=new Date(n);t<n.getTime()+864e5&&(c=!0)}if("week"===o.frequency&&n){n=new Date(n);t<n.getTime()+6048e5&&(c=!0)}if("month"===o.frequency&&n){n=new Date(n);t<new Date(n).setMonth(n.getMonth()+1)&&(c=!0)}if("xdays"===o.frequency&&o.frequency_xdays&&n){n=new Date(n);const e=parseInt(o.frequency_xdays);t<n.getTime()+24*e*60*60*1e3&&(c=!0)}}if("yes"===o.after_x_page_views){const n=window.awbOffCanvas.get(a,"page_views")||0;n<parseInt(o.number_of_page_views)&&(c=!0),window.awbOffCanvas.set(a,"page_views",n+1)}if("yes"===o.after_x_sessions){let n;sessionStorage.getItem("off_canvas_"+a)||(sessionStorage.setItem("off_canvas_"+a,!0),n=window.awbOffCanvas.get(a,"sessions")||0,window.awbOffCanvas.set(a,"sessions",n+1)),n=window.awbOffCanvas.get(a,"sessions"),n<=parseInt(o.number_of_sessions)&&(c=!0)}if(o.when_arriving_from){const n=document.referrer,t=window.location.host,e=o.when_arriving_from;let a;!n||n.includes(t)?a="internal":(a="external",/\.?(google|bing|yahoo|duckduckbot|yandex|baidu|msn|teoma|slurp)\./.test(n)&&(a="search")),c=!e.includes(a)}if("until_consent"===o.until_consent_interaction||"until_consent_close"===o.until_consent_interaction){let t=!1;"undefined"!=typeof avadaPrivacyVars&&avadaPrivacyVars.name&&(t=document.cookie.split(";").some(function(n){return n.trim().startsWith(avadaPrivacyVars.name+"=")})),t?c=!0:"until_consent_close"===o.until_consent_interaction&&n(document).one("awb_privacy_saved",function(){window.awbOffCanvas.close_off_canvas(a)})}if("opened"===o.off_canvas_state&&"sliding-bar"===o.type&&o.has_js_rules&&!c&&(n(window).on("load",function(){window.awbOffCanvas.open_off_canvas(a)}),c=!0),!0===o.isOpened&&(c=!0),!c){if("yes"===o.on_page_load&&setTimeout(()=>{window.awbOffCanvas.open_off_canvas(a),o.isOpened=!0},100),"yes"===o.time_on_page&&o.time_on_page_duration&&setTimeout(()=>{window.awbOffCanvas.open_off_canvas(a),o.isOpened=!0},1e3*o.time_on_page_duration),"yes"===o.on_scroll){const t=o.scroll_direction,e=o.scroll_to,i=document.documentElement.scrollHeight;let s=o.scroll_position;if(s&&isNaN(s)&&(s=s.includes("%")?i/100*parseInt(s):parseInt(s)),"down"===t&&"element"===e){const n=o.scroll_element?document.querySelector(o.scroll_element):null;if(n){const t=new IntersectionObserver(n=>{n.forEach(n=>{n.isIntersecting&&(window.awbOffCanvas.open_off_canvas(a),o.isOpened=!0,t.unobserve(n.target))})});t.observe(n)}}else n(window).on("scroll",function(n){"up"===o.scroll_direction&&this.oldScroll>this.scrollY&&(o.isOpened||window.awbOffCanvas.open_off_canvas(a),o.isOpened=!0),"down"===o.scroll_direction&&this.oldScroll<this.scrollY&&this.scrollY>=s&&(o.isOpened||window.awbOffCanvas.open_off_canvas(a),o.isOpened=!0),this.oldScroll=this.scrollY})}if("yes"===o.exit_intent){const n=function(t){null==t.relatedTarget&&"select"!==t.target.nodeName.toLowerCase()&&(window.awbOffCanvas.open_off_canvas(a),document.removeEventListener("mouseout",n),o.isOpened=!0)};document.addEventListener("mouseout",n)}if("yes"===o.after_inactivity&&o.inactivity_duration){const n=o.inactivity_duration;let t;const e=function(){t=window.setTimeout(i,1e3*n)},i=function(){o.isOpened||window.awbOffCanvas.open_off_canvas(a),o.isOpened=!0},s=function(){document.addEventListener("mousemove",c,!1),document.addEventListener("mousedown",c,!1),document.addEventListener("keypress",c,!1),document.addEventListener("touchmove",c,!1),document.addEventListener("scroll",c,!1),e()},c=function(){window.clearTimeout(t),e()};s()}}}),n(".awb-off-canvas-wrap").on("select2:open",function(t){const e=n(t.target);n(".select2-dropdown").css("z-index",e.closest(".awb-off-canvas-wrap").css("z-index"))})}(jQuery);