"use strict";window.theme||(window.theme={}),function(e){function t(e,t,i){var a;return function(){var n=this,o=arguments;function s(){i||e.apply(n,o),a=null}a?theme.deleteTimeout(a):i&&e.apply(n,o),a=theme.requestTimeout(s,t||100)}}var i;(theme.$window=e(window),theme.$body,theme.status="loading",theme.hash=location.hash.indexOf("&")>0?location.hash.substring(0,location.hash.indexOf("&")):location.hash,theme.isIE=navigator.userAgent.indexOf("Trident")>=0,theme.isEdge=navigator.userAgent.indexOf("Edge")>=0,theme.isMobile=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),theme.defaults={stickySidebar:{autoInit:!0,minWidth:991,containerSelector:".sticky-sidebar-wrapper",autoFit:!0,activeClass:"sticky-sidebar-fixed",padding:{top:0,bottom:0}},lazyload:{effect:"fadeIn",data_attribute:"lazy",data_srcset:"lazyset",effect_speed:400,failure_limit:1e3,event:"scroll update_lazyload",load:function(){var t=e(this);"IMG"==this.tagName?(t.css("padding-top",""),t.removeClass("d-lazyload")):(this.classList.contains("elementor-element-populated")||this.classList.contains("elementor-section"))&&t.css("background-image",""),t.removeAttr("data-lazy data-lazyset data-sizes"),t.closest(".icomp-container").length&&void 0!==theme.imageCompare&&theme.imageCompare(t.closest(".icomp-container"))}},sticky:{minWidth:0,maxWidth:2e4,top:!1,bottomOrigin:!1,max_index:1059,scrollMode:!1},animation:{name:"fadeIn",duration:"1.2s",delay:".2s"},stickyMobileBar:{minWidth:0,maxWidth:767,top:150,scrollMode:!0},stickyToolbox:{minWidth:0,maxWidth:767,scrollMode:!0},minipopup:{content:"",delay:4e3}},theme.call=function(e,t){alpus_vars.resource_split_tasks||t?setTimeout(e,t):e()},theme.byId=function(e){return document.getElementById(e)},theme.byTag=function(e,t){return(t||document).getElementsByTagName(e)},theme.byClass=function(e,t){return t?t.getElementsByClassName(e):document.getElementsByClassName(e)},theme.$=function(t,i){return"string"==typeof t&&"string"==typeof i?e(t+" "+i):t instanceof jQuery?t.is(i)||void 0===i?t:t.find(i):void 0!==t&&t?void 0===i?e(t):e(t).find(i):e(i)},theme.getCache=function(){return localStorage[alpus_vars.alpus_cache_key]?JSON.parse(localStorage[alpus_vars.alpus_cache_key]):{}},theme.setCache=function(e){localStorage[alpus_vars.alpus_cache_key]=JSON.stringify(e)},theme.hooks=[],theme.addFilter=function(e,t,i=10){theme.hooks[e]=theme.hooks[e]||[],theme.hooks[e][i]=theme.hooks[e][i]||[],theme.hooks[e][i].push(t)},theme.removeFilter=function(e,t,i=10){if(theme.hooks[e]&&theme.hooks[e][i]){var a=theme.hooks[e][i].indexOf(t);a>=0&&theme.hooks[e][i].splice(a,1)}},theme.applyFilters=function(e,t,i){return theme.hooks[e]&&theme.hooks[e].forEach((function(e){e&&e.forEach((function(e){t="function"==typeof e?e(t,i):e}))})),t},theme.addAction=theme.addFilter,theme.removeAction=theme.removeFilter,theme.doActions=function(e,t){theme.hooks[e]&&theme.hooks[e].forEach((function(e){e&&e.forEach((function(e){e(t)}))}))},theme.requestTimeout=function(e,t){var i=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame;if(!i)return setTimeout(e,t);t||(t=0);var a,n=new Object;return n.val=i((function o(s){a||(a=s),s-a>=t?e():n.val=i(o)})),n},theme.requestFrame=function(e){return{val:(window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame)(e)}},theme.requestInterval=function(e,t,i){var a=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame;if(!a)return i?setInterval(e,t):setTimeout(e,i);var n,o,s=new Object;return s.val=a((function r(l){n||(n=o=l),!i||l-nt?(s.val=a(r),e(),o=l):s.val=a(r):e()})),s},theme.deleteTimeout=function(e){if(e){var t=window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame;return t?e.val?t(e.val):void 0:clearTimeout(e)}},e.fn.smartresize=function(e){e?this.get(0).addEventListener("resize",t(e),{passive:!0}):this.trigger("smartresize")},e.fn.smartscroll=function(e){e?this.get(0).addEventListener("scroll",t(e),{passive:!0}):this.trigger("smartscroll")},theme.parseOptions=function(e){return"string"==typeof e?JSON.parse(e.replace(/'/g,'"').replace(";","")):{}},theme.isOnScreen=function(e,t,i){var a=window.pageXOffset,n=window.pageYOffset,o=e.getBoundingClientRect(),s=o.left+a,r=o.top+n,l=void 0===t?0:t,d=void 0===i?0:i;return r+o.height+d>=n&&r<=n+window.innerHeight+d&&s+o.width+l>=a&&s<=a+window.innerWidth+l},theme.appear=function(t,i,a){var n=e(t);if(!n.data("observer-init")){var o={rootMargin:"0px 0px 200px 0px",threshold:0,alwaysObserve:!1};a&&Object.keys(a).length&&(o=e.extend(o,a));var s=new IntersectionObserver(function(e){for(var t=0;t0){if("string"==typeof i)Function("return "+functionName)();else i.call(a.target);0==this.alwaysObserve&&s.unobserve(a.target)}}}.bind(o),o);return s.observe(t),n.data("observer-init",!0),this}},theme.fitVideoSize=function(t){if(e.fn.fitVids){var i=void 0===i?e(".fit-video"):theme.$(t).find(".fit-video");i.each((function(){var t=e(this),i=t.find("video"),a=i.attr("width"),n=i.attr("height"),o=t.outerWidth();i.css({width:o,height:o/a*n}),window.wp.mediaelement&&window.wp.mediaelement.initialize(),t.fitVids(),t.hasClass("d-none")&&t.removeClass("d-none")})),"loading"==theme.status&&window.addEventListener("resize",(function(){e(".fit-video").fitVids()}),{passive:!0})}},theme.stickySidebar=function(t){e.fn.themeSticky&&theme.$(t).each((function(){var t=e(this),i=t.closest(".sidebar"),a=theme.defaults.stickySidebar,n=0;i.hasClass("sidebar-offcanvas")||((i.length?i:t.parent()).addClass("sticky-sidebar-wrapper"),e(".sticky-sidebar > .filter-actions").length||e(".sticky-content.fix-top").each((function(t){if(!e(this).hasClass("sticky-toolbox")){var i=e(this).hasClass("fixed");n+=e(this).addClass("fixed").outerHeight(),i||e(this).removeClass("fixed")}})),a.padding.top=n,t.themeSticky(e.extend({},a,theme.parseOptions(t.attr("data-sticky-options")))),theme.$window.on("alpus_complete",(function(){theme.refreshLayouts(),t.on("click",".nav-link",(function(){setTimeout((function(){t.trigger("recalc.pin")}))}))})))}))},theme.refreshLayouts=function(){e(".sticky-sidebar").trigger("recalc.pin"),theme.$window.trigger("update_lazyload")},theme._lazyload_force=function(e){theme.$(e).each((function(){var e=this.getAttribute("data-lazy");if(e){if("IMG"==this.tagName){var t=this.getAttribute("data-lazyset");t&&(this.setAttribute("srcset",t),this.removeAttribute("data-lazyset")),this.style["padding-top"]="",this.setAttribute("src",e),this.classList.remove("d-lazyload")}else this.style["background-image"]="url("+e+")";this.removeAttribute("data-lazy"),this.removeAttribute("data-lazyset")}}))},theme.lazyload=function(t){e.fn.lazyload&&theme.$(t,"[data-lazy]").lazyload(theme.defaults.lazyload)},theme.initPriceSlider=function(){if(e.fn.slider&&e(".price_slider").length){e("input#min_price, input#max_price").hide(),e(".price_slider, .price_label").show();var t=e(".price_slider_amount #min_price").data("min"),i=e(".price_slider_amount #max_price").data("max"),a=e(".price_slider_amount").data("step")||1,n=e(".price_slider_amount #min_price").val(),o=e(".price_slider_amount #max_price").val();e(".price_slider:not(.ui-slider)").slider({range:!0,animate:!0,min:t,max:i,step:a,values:[n,o],create:function(){e(".price_slider_amount #min_price").val(n),e(".price_slider_amount #max_price").val(o),e(document.body).trigger("price_slider_create",[n,o])},slide:function(t,i){e("input#min_price").val(i.values[0]),e("input#max_price").val(i.values[1]),e(document.body).trigger("price_slider_slide",[i.values[0],i.values[1]])},change:function(t,i){e(document.body).trigger("price_slider_change",[i.values[0],i.values[1]])}})}},theme.doLoading=function(t,i){var a=theme.$(t);a.find(".d-loading").length||(void 0===i?a.append('
'):"small"==i?a.append('
'):"simple"==i&&a.append('
'),a.each((function(){var t=e(this);"static"==t.css("position")&&t.css("position","relative"),void 0!==i&&t.closest(`.product-archive, .post-archive, .elementor-widget-${alpus_vars.theme}_widget_archive_posts_grid`).length&&theme.$window.trigger("scroll.loadingPosition")})))},theme.loadingPosition=function(t){var i=e(`.product-archive, .post-archive, .elementor-widget-${alpus_vars.theme}_widget_archive_posts_grid`);if(i.length&&!i.find(".d-loading").closest(".btn, .alpus-tb-item, .product").length){var a=i.find(".d-loading");a.parent().hasClass("d-loading-stick")||a.wrap('
'),a=a.parent();var n=theme.$window.height()/2,o=theme.$window.scrollTop(),s=i.offset().top-n+80,r=s+i.height()-170;or?(a.addClass("is-bottom"),a.removeClass("is-stick")):(a.addClass("is-stick"),a.removeClass("is-top is-bottom"))}},theme.endLoading=function(e){theme.$(e).find(".d-loading-stick").remove(),theme.$(e).find(".d-loading").remove(),theme.$(e).css("position","")},theme.setCurrentMenuItems=function(t){theme.getUrlParam(location.href,"s")||theme.$(t,'a[href="'+location.origin+location.pathname+'"]').parent("li").each((function(){var t=e(this);t.hasClass("menu-item-object-page")&&(t.addClass("current_page_item").parent().closest(".mobile-menu li").addClass("current_page_parent"),t.parents(".mobile-menu li").addClass("current_page_ancestor")),t.addClass("current-menu-item").parent().closest(".mobile-menu li").addClass("current-menu-parent"),t.parents(".mobile-menu li").addClass("current-menu-ancestor")}))},theme.lazyloadMenu=function(){var t=e(".lazy-menu").map((function(){return this.getAttribute("id").slice(5)})).get();if(t&&t.length){function i(t,i){var a=e(theme.byId("menu-"+t)).removeClass("lazy-menu").children("li");e(i).filter("li").each((function(){var t=e(this),i=a.eq(t.index());i.children("ul").remove(),i.append(t.children("ul"))})),theme.setCurrentMenuItems("#menu-"+t)}var a=theme.getCache(),n=a.menus?a.menus:{},o=[];if(alpus_vars.lazyload_menu&&a.menus&&a.menuLastTime&&alpus_vars.menu_last_time&&parseInt(a.menuLastTime)>=parseInt(alpus_vars.menu_last_time))for(var s in t){var r=t[s];n[r]?i(r,n[r]):o.push(r)}else o=t;o.length&&e.ajax({type:"POST",url:alpus_vars.ajax_url,dataType:"json",data:{action:"alpus_load_menu",menus:o,nonce:alpus_vars.nonce,load_menu:!0},success:function(e){if(e)for(var t in e){var o=e[t];o&&(i(t,o=o.replace(/(class=".*)current_page_parent\s*(.*")/,"$1$2")),n[t]=o)}theme.menu&&theme.menu.addToggleButtons(".collapsible-menu li"),theme.showEditPageTooltip&&theme.showEditPageTooltip(),a.menus=n,a.menuLastTime=alpus_vars.menu_last_time,theme.setCache(a),theme.$window.trigger("recalc_menus")}})}},theme.disableMobileAnimations=function(){e(document.body).hasClass("alpus-disable-mobile-animation")&&window.innerWidth<768&&e(".elementor-invisible").removeAttr("data-settings").removeData("settings").removeClass("elementor-invisible").add(e(".appear-animate").removeClass("appear-animate"))},theme.initLayout=function(){theme.lazyload(),theme.fitVideoSize(),theme.stickySidebar(".sticky-sidebar"),theme.lazyloadMenu(),theme.initPriceSlider(),theme.$window.on("scroll.loadingPosition",theme.loadingPosition),"loading"==theme.status&&(theme.status="load"),theme.$window.trigger("alpus_load"),alpus_vars.resource_after_load?theme.call(theme.initAsync):theme.initAsync()},theme.disableMobileAnimations(),"function"==typeof Swiper)?theme.Swiper=Swiper:(i=document.getElementById("swiper-js"))&&i.addEventListener("load",(function(){theme.Swiper=Swiper}));e(window).on("load",(function(){theme.$body=e(document.body).addClass("loaded"),e("html").addClass("ontouchstart"in document?"touchable":"untouchable"),e.fn.imagesLoaded&&"function"==typeof theme.skeleton?alpus_vars.resource_after_load?theme.call((function(){theme.skeleton(e(".skeleton-body"),theme.initLayout)})):theme.skeleton(e(".skeleton-body"),theme.initLayout):alpus_vars.resource_after_load?theme.call(theme.initLayout):theme.initLayout()}))}(jQuery);