/*OffCanvas*/function PlusOffcanvas(a){"use strict";this.node=a,this.wrap=a.find(".plus-offcanvas-wrapper"),this.content=a.find(".plus-canvas-content-wrap"),this.button=a.find(".offcanvas-toggle-btn"),this.settings=this.wrap.data("settings"),this.id=this.settings.content_id,this.transition=this.settings.transition,this.esc_close=this.settings.esc_close,this.body_click_close=this.settings.body_click_close,this.direction=this.settings.direction,this.duration=500,this.destroy(),this.init()}PlusOffcanvas.prototype={id:"",node:"",wrap:"",content:"",button:"",settings:{},transition:"",delaytimeout:"",duration:400,initialized:!1,animations:["slide","slide-along","reveal","push"],init:function(){this.wrap.length&&(jQuery("html").addClass("plus-offcanvas-content-widget"),0===jQuery(".plus-offcanvas-container").length&&(jQuery("body").wrapInner("<div class=\"plus-offcanvas-container\" />"),this.content.insertBefore(".plus-offcanvas-container")),0<this.wrap.find(".plus-canvas-content-wrap").length&&(0<jQuery(".plus-offcanvas-container > .plus-"+this.id).length&&jQuery(".plus-offcanvas-container > .plus-"+this.id).remove(),0<jQuery("body > .plus-"+this.id).length&&jQuery("body > .plus-"+this.id).remove(),jQuery("body").prepend(this.wrap.find(".plus-canvas-content-wrap"))),this.bindEvents())},destroy:function(){this.close(),this.animations.forEach(function(b){jQuery("html").hasClass("plus-"+b)&&jQuery("html").removeClass("plus-"+b)}),jQuery("body > .plus-"+this.id).length},bindEvents:function(){this.button.on("click",jQuery.proxy(this.toggleContent,this)),jQuery("body").delegate(".plus-canvas-content-wrap .plus-offcanvas-close","click",jQuery.proxy(this.close,this)),"yes"===this.esc_close&&this.closeESC(),"yes"===this.body_click_close&&this.closeClick()},toggleContent:function(){jQuery("html").hasClass("plus-open")?this.close():this.show()},show:function(){jQuery(".plus-"+this.id).addClass("plus-visible"),jQuery("html").addClass("plus-"+this.transition),jQuery("html").addClass("plus-"+this.direction),jQuery("html").addClass("plus-open"),jQuery("html").addClass("plus-"+this.id+"-open"),jQuery("html").addClass("plus-reset"),this.button.addClass("plus-is-active")},close:function(){jQuery(".plus-"+this.id).hasClass("plus-slide-along")?(this.delaytimeout=0,jQuery(".plus-"+this.id).removeClass("plus-visible")):this.delaytimeout=500,jQuery("html").removeClass("plus-open"),jQuery("html").removeClass("plus-"+this.id+"-open"),setTimeout(jQuery.proxy(function(){jQuery("html").removeClass("plus-reset"),jQuery("html").removeClass("plus-"+this.transition),jQuery("html").removeClass("plus-"+this.direction),jQuery(".plus-"+this.id).hasClass("plus-slide-along")||jQuery(".plus-"+this.id).removeClass("plus-visible")},this),this.delaytimeout),this.button.removeClass("plus-is-active")},closeESC:function(){var a=this;""!==a.settings.esc_close&&jQuery(document).on("keydown",function(c){27===c.keyCode&&a.close()})},closeClick:function(){var c=this;jQuery(document).on("click",function(a){jQuery(a.target).is(".plus-canvas-content-wrap")||0<jQuery(a.target).parents(".plus-canvas-content-wrap").length||jQuery(a.target).is(".offcanvas-toggle-btn")||0<jQuery(a.target).parents(".offcanvas-toggle-btn").length||c.close()})}},function(b){var c=function(c,d){new PlusOffcanvas(c);var e=c.find(".plus-offcanvas-wrapper.scroll-view"),b=c.find(".offcanvas-toggle-btn.position-fixed");0<e.length&&b&&d(window).on("scroll",function(){var f=d(this).scrollTop();e.each(function(){var e=d(this).data("scroll-view"),a=d(this).data("canvas-id"),b=d("."+a);f>e?b.addClass("show"):b.removeClass("show")})})};b(window).on("elementor/frontend/init",function(){elementorFrontend.hooks.addAction("frontend/element_ready/tp-off-canvas.default",c)})}(jQuery);