403Webshell
Server IP : 162.144.4.212  /  Your IP : 216.73.216.49
Web Server : Apache
System : Linux gator2125.hostgator.com 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64
User : cozeellc ( 2980)
PHP Version : 8.3.30
Disable Function : NONE
MySQL : OFF |  cURL : ON |  WGET : ON |  Perl : ON |  Python : ON |  Sudo : ON |  Pkexec : ON
Directory :  /home4/cozeellc/public_html/wp-content/themes/motta/assets/js/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /home4/cozeellc/public_html/wp-content/themes/motta/assets/js/scripts.min.js
(function(f){"use strict";var m=m||{};m.init=function(){m.$body=f(document.body),m.$window=f(window),m.$header=f("#site-header");this.toggleOffCanvas();this.toggleModals();this.mottaMore();this.focusSearchField();this.clickCategorySearch();this.clickSearchAdaptive();this.clickHamburgerMenu();this.clickCategoryMenu();this.hoverPrimaryMenu();this.clickHeaderDropdown();this.recentlyViewedProducts();this.stickyHeader();this.instanceSearch();this.tabMegaMenu();this.postsSliderWidget();this.trendingPosts();this.featuredPosts();this.loadMorePosts();this.postFound();this.showEntryMetaShare();this.entryGallerySlider();this.productQuantityNumber();this.updateQuantityAuto();this.openMiniCartPanel();this.productPopupATC();this.productCardHoverSlider();this.productCardHoverZoom();this.productAttribute();this.productQuickView();this.addCompare();this.loginTabs();this.productLoaded();this.preferences();this.addToCartSingleAjax();this.backToTop()};m.toggleOffCanvas=function(){f(document.body).on("click",'[data-toggle="off-canvas"]',function(e){var t="#"+f(this).data("target");if(f(t).hasClass("offscreen-panel--open")){m.closeOffCanvas(t)}else if(m.openOffCanvas(t)){e.preventDefault()}}).on("click",".offscreen-panel .panel__button-close, .offscreen-panel .panel__backdrop, .offscreen-panel .sidebar__backdrop",function(e){e.preventDefault();m.closeOffCanvas(this)}).on("keyup",function(e){if(e.keyCode===27){m.closeOffCanvas()}})};m.openOffCanvas=function(e){var t=f(e);if(!t.length){return false}var a=window.innerWidth-f("#page").width();if(f("#page").width()<767){a=0}f(document.body).css({"padding-right":a,overflow:"hidden"});t.fadeIn();t.addClass("offscreen-panel--open");f(document.body).addClass("offcanvas-opened "+t.attr("id")+"-opened").trigger("motta_off_canvas_opened",[t]);return true};m.closeOffCanvas=function(e){if(!e){f(".offscreen-panel").each(function(){var e=f(this);if(!e.hasClass("offscreen-panel--open")){return}e.removeClass("offscreen-panel--open").fadeOut();f(document.body).removeClass(e.attr("id")+"-opened")})}else{e=f(e).closest(".offscreen-panel");e.removeClass("offscreen-panel--open").fadeOut();f(document.body).removeClass(e.attr("id")+"-opened")}f(document.body).removeAttr("style");f(document.body).removeClass("offcanvas-opened").trigger("motta_off_canvas_closed",[e])};m.toggleModals=function(){f(document.body).on("click",'[data-toggle="modal"]',function(e){var t="#"+f(this).data("target");if(f(t).hasClass("modal--open")){m.closeModal(t)}else if(m.openModal(t)){e.preventDefault()}}).on("click",".modal .modal__button-close, .modal .modal__backdrop",function(e){e.preventDefault();m.closeModal(this)}).on("keyup",function(e){if(e.keyCode===27){m.closeModal()}})};m.openModal=function(e){var t=f(e);if(!t.length){return false}var a=window.innerWidth-f("#page").width();if(f("#page").width()<767){a=0}f(document.body).css({"padding-right":a,overflow:"hidden"});t.fadeIn();t.addClass("modal--open");f(document.body).addClass("modal-opened "+t.attr("id")+"-opened").trigger("motta_modal_opened",[t]);return true};m.closeModal=function(e){if(!e){f(".modal").removeClass("modal--open").fadeOut();f(".modal").each(function(){var e=f(this);if(!e.hasClass("modal--open")){return}e.removeClass("modal--open").fadeOut();f(document.body).removeClass(e.attr("id")+"-opened")})}else{e=f(e).closest(".modal");e.removeClass("modal--open").fadeOut();f(document.body).removeClass(e.attr("id")+"-opened")}f(document.body).removeAttr("style");f(document.body).removeClass("modal-opened").trigger("motta_modal_closed",[e])};m.mottaMore=function(){f(".motta-more .motta-more__button").on("click",function(e){e.preventDefault();var t=f(this).closest(".motta-more").data("settings"),a=t.more,o=t.less;if(f(this).hasClass("less")){f(this).removeClass("less");f(this).siblings(".motta-more__content").slideUp().removeClass("show");f(this).text(a)}else{f(this).addClass("less");f(this).siblings(".motta-more__content").slideDown().addClass("show");f(this).text(o)}})};m.focusSearchField=function(){f(".header-search .header-search__field").on("focus",function(){var e=f(this);var t=e.closest(".header-search").find(".header-search__trending--outside");e.closest(".header-search__form").addClass("header-search__form--focused");if(!t.length){return}if(!e.closest(".header-search__form").hasClass("searched")){t.addClass("header-search__trending--open")}e.addClass("header-search--focused");f(".header-search__results").removeClass("hidden");f(window).one("scroll",function(){e.trigger("blur")})});f(document.body).on("click",".header-search__trending-label, .header-search__categories-label",function(){f(".header-search__trending--outside").removeClass("header-search__trending--open");f(".header-search__form").removeClass("header-search__form--focused")}).on("click","div",function(e){var t=f(e.target);if(t.is(".header-search")||t.closest(".header-search").length){return}f(".header-search__trending--outside").removeClass("header-search__trending--open");f(".header-search").removeClass("header-search--focused");f(".header-search__form").removeClass("header-search__form--focused");f(".header-search__results").addClass("hidden")});var e=f(".header-search--form").data("width");if(e){m.$window.on("resize",function(){if(m.$window.width()>1300){f(".header-search--form").css("max-width",e)}else{f(".header-search--form").removeAttr("style")}}).trigger("resize")}};m.clickCategorySearch=function(){if(!mottaData.header_search_type){return}if(mottaData.header_search_type=="adaptive"&&mottaData.post_type=="post"){return}f(".header-search__categories-label").on("click",function(){f(this).closest(".header-search__form").find(".header-search__categories").addClass("header-search__categories--open");f(this).closest(".header-search__form").addClass("categories--open")});f(document.body).on("click",".header-search__categories-close",function(){f(this).closest(".header-search__categories").removeClass("header-search__categories--open");f(".header-search__form").removeClass("categories--open")}).on("click","div",function(e){var t=f(e.target);if(t.is(".header-search")||t.closest(".header-search").length){return}f(".header-search__categories").removeClass("header-search__categories--open");f(".header-search__form").removeClass("categories--open")});f(".header-search__categories a").on("click",function(e){e.preventDefault();f(".header-search__categories a").removeClass("active");f(this).addClass("active");var t=f(this).attr("data-slug"),a=f(this).text();f(this).closest(".header-search__form").find("input.category-name").val(t);f(this).closest(".header-search__categories").removeClass("header-search__categories--open");f(".header-search__form").removeClass("categories--open");f(".header-search__form").find(".header-search__categories-label").find(".header-search__categories-text").text(a);var o=f(".header-search__categories-label").is(":visible")?f(".header-search__categories-label").outerWidth(true):0,i=f(".header-search__divider").is(":visible")?f(".header-search__divider").outerWidth(true):0;if(m.$body.hasClass("rtl")){f(this).closest(".header-search__form").find(".close-search-results").css("left",o+i+10)}else{f(this).closest(".header-search__form").find(".close-search-results").css("right",o+i+10)}});f(window).on("load",function(){var e=f(".header-search__form").find("input.category-name").val();if(e){var t=f(".header-search__categories").find('a[data-slug="'+e+'"]');f(".header-search__categories a").removeClass("active");t.addClass("active")}})};m.clickSearchAdaptive=function(){f(".header-search--icon").on("click",".header-search__icon",function(){f(this).closest(".header-search--icon").addClass("header-search--icon-open")});f(document.body).on("click","div",function(e){var t=f(e.target);if(t.is(".header-search--icon")||t.closest(".header-search--icon").length){return}f(".header-search--icon").removeClass("header-search--icon-open")})};m.postsSliderWidget=function(){if(typeof Swiper==="undefined"){return}var e=f(".posts-slider-widget .swiper-container"),t={pagination:{el:".swiper-pagination",clickable:true,renderBullet:function(e,t){return'<span class="'+t+'"></span>'}},watchOverflow:true,navigation:{nextEl:e.find(".motta-swiper-button-next"),prevEl:e.find(".motta-swiper-button-prev")},on:{init:function(){this.$el.css("opacity",1)}},breakpoints:{0:{slidesPerView:1,slidesPerGroup:1,spaceBetween:60},600:{slidesPerView:2,spaceBetween:40},992:{slidesPerView:1,slidesPerGroup:1,spaceBetween:60}}};new Swiper(e,t)};m.showEntryMetaShare=function(){m.$body.on("click",".entry-meta__share",function(){if(f(this).hasClass("active")){f(this).removeClass("active")}else{f(this).addClass("active")}});f(document).on("click",function(e){if(f(e.target).is(".entry-meta__share")===false){f(".entry-meta__share").removeClass("active")}})};m.entryGallerySlider=function(){if(typeof Swiper==="undefined"){return}var e=f(".single-post .entry-gallery.swiper-container"),t={slidesPerView:1,slidesPerGroup:1,pagination:{el:".motta-swiper-pagination",clickable:true,renderBullet:function(e,t){return'<span class="'+t+'"></span>'}},navigation:{nextEl:e.find(".motta-swiper-button-next"),prevEl:e.find(".motta-swiper-button-prev")},on:{init:function(){this.$el.css("opacity",1)}}};new Swiper(e,t)};m.trendingPosts=function(){if(typeof Swiper==="undefined"){return}if(!f("#trending-posts").hasClass("trending-posts--layout-2")){return}f(".trending-posts__items").find(".hentry").addClass("swiper-slide");var e=f(".trending-posts__items .swiper-container"),t={navigation:{nextEl:e.parent().find(".motta-swiper-button-next"),prevEl:e.parent().find(".motta-swiper-button-prev")},watchOverflow:true,on:{init:function(){this.$el.css("opacity",1)}}};new Swiper(e,t)};m.featuredPosts=function(){if(typeof Swiper==="undefined"){return}var e=null;var t=f(window);var a=f(".featured-posts__container");if(a.length==0){return}var o=f("#motta-featured-posts").data("columns"),i={navigation:{nextEl:a.parent().find(".motta-swiper-button-next"),prevEl:a.parent().find(".motta-swiper-button-prev")},watchOverflow:true,on:{init:function(){this.$el.css("opacity",1)}},breakpoints:{0:{slidesPerView:2,slidesPerGroup:1,spaceBetween:24},600:{slidesPerView:3,spaceBetween:24},992:{slidesPerView:o,slidesPerGroup:1,spaceBetween:24}}};function n(){if(t.width()>=768){a.addClass("swiper-container");a.find(".featured-posts__wrapper").addClass("swiper-wrapper");if(!e){e=new Swiper(a,i)}}else if(e){e.destroy();e=null;a.removeClass("swiper-container");a.find(".featured-posts__wrapper").removeClass("swiper-wrapper")}}n();t.on("load resize",function(){n()})};m.loadMorePosts=function(){f(document.body).on("click",".navigation.next-posts-navigation a",function(e){e.preventDefault();var n=f(this),t=n.closest("#main"),r=t.children(".hentry").length,s=n.closest(".navigation"),d=n.attr("href"),c=f(".motta-posts-found");if(n.closest(".next-posts-navigation").hasClass("loading")){return}n.closest(".next-posts-navigation").addClass("loading");f.get(d,function(e){var t=f("#main",e),a=f(".hentry",t),o=a.length+r,i=f(".next-posts-navigation",t);a.each(function(e,t){f(t).css("animation-delay",e*100+"ms")});if(s.siblings(".motta-posts__list").length){a.appendTo(s.siblings(".motta-posts__list"))}else{a.insertBefore(c)}a.addClass("animated mottaFadeInUp");if(i.length){n.replaceWith(f("a",i))}else{s.fadeOut()}s.removeClass("loading");c.find(".current-post").html(" "+o);m.postFound();if(mottaData.blog_nav_ajax_url_change){window.history.pushState(null,"",d)}})})};m.postFound=function(e){var t=f(".motta-posts-found__inner"),a=t.find(".count-bar"),o=t.find(".current-post").html(),i=t.find(".found-post").html(),n=o/i*100;a.css("width",n+"%")};m.productQuantityNumber=function(){m.$body.on("click",".motta-qty-button",function(e){e.preventDefault();var t=f(this),a=t.siblings(".qty"),o=0,i=parseFloat(a.attr("min")),n=parseFloat(a.attr("max")),r=parseFloat(a.attr("step"));if(a.val()!==""){o=parseFloat(a.val())}else if(a.attr("placeholder")!==""){o=parseFloat(a.attr("placeholder"))}i=i?i:0;n=n?n:o+1;if(t.hasClass("decrease")&&o>i){a.val(o-r);a.trigger("change")}if(t.hasClass("increase")&&o<n){a.val(o+r);a.trigger("change")}})};m.updateQuantityAuto=function(){var t=null;f(document.body).on("change",".woocommerce-mini-cart .qty",function(){var e=f(this);if(t){clearTimeout(t)}t=setTimeout(function(){m.updateCartAJAX(e)},500)})};m.updateCartAJAX=function(e){var t=e.closest(".woocommerce-mini-cart-item"),a=t.find("a.remove").data("cart_item_key"),o=t.find(".woocommerce-mini-cart-item__qty").data("nonce"),i=wc_add_to_cart_params.wc_ajax_url.toString().replace("%%endpoint%%","update_cart_item");if(f.fn.block){t.block({message:null,overlayCSS:{opacity:.6,background:"#fff"}})}f.post(i,{cart_item_key:a,qty:e.val(),security:o},function(e){if(!e||!e.fragments){return}if(f.fn.unblock){t.unblock()}f(document.body).trigger("added_to_cart",[e.fragments,e.cart_hash]);if(f(".single-product div.product").find(".motta-free-shipping-bar").length&&f(e.fragments["div.widget_shopping_cart_content"]).length&&f(e.fragments["div.widget_shopping_cart_content"]).find(".motta-free-shipping-bar").length){f(".single-product div.product").find(".motta-free-shipping-bar").replaceWith(f(e.fragments["div.widget_shopping_cart_content"]).find(".motta-free-shipping-bar"))}}).fail(function(){if(f.fn.unblock){t.unblock()}return})};m.openMiniCartPanel=function(){if(typeof mottaData.added_to_cart_notice==="undefined"){return}if(mottaData.added_to_cart_notice.added_to_cart_notice_layout!=="mini"){return}var a="";f(document.body).on("adding_to_cart",function(e,t){if(mottaData.added_to_cart_notice.header_cart_icon_behaviour==="panel"){a="1"}else{a="2"}});f(document.body).on("added_to_cart wc_fragments_refreshed",function(){if(a==="1"){m.openOffCanvas("#cart-panel")}if(a==="2"){f("html, body").animate({scrollTop:0},800);setTimeout(function(){f(".header-cart .header-button-dropdown").trigger("click")},900)}})};m.productPopupATC=function(){if(typeof mottaData.added_to_cart_notice==="undefined"){return}if(mottaData.added_to_cart_notice.added_to_cart_notice_layout!="popup"){return}var i=f("#motta-popup-add-to-cart"),n=i.find(".product-modal-content"),r=n.find(".motta-product-popup-atc__recommendation");if(i.length<1){return}var o=0,s=0;f(document.body).on("adding_to_cart",function(e,t){o=s=0;if(typeof t.data("product_id")!=="undefined"){s=t.data("product_id");o="0,"+s}s=typeof s==="undefined"?0:s;if(s===0&&t.closest("form.cart").length){var a=t.closest("form.cart");s=a.find(".motta_product_id").val();o=s;if(a.hasClass("variations_form")&&a.find(".single_variation_wrap .variation_id").length>0){o=a.find(".single_variation_wrap .variation_id").val()}if(a.hasClass("grouped_form")){o=0;a.find(".woocommerce-grouped-product-list-item").each(function(){if(f(this).find(".quantity .input-text").val()>0){var e=f(this).attr("id");e=e.replace("product-","");o+=","+e}})}}});f(document.body).on("added_to_cart",function(){if(o&&s){e(s,o);o=0;s=0}});f(document.body).on("wc_fragments_refreshed",function(){if(o&&s){e(s,o);o=0;s=0}});function e(e,t){var a=t.split(",");for(var o=0;o<a.length;++o){n.find(".mini-cart-item-"+a[o]).addClass("active")}n.find(".woocommerce-mini-cart-item").not(".active").remove();n.find(".woocommerce-mini-cart-item").find(".woocommerce-mini-cart-item__qty, .woocommerce-mini-cart-item__remove").remove();m.openModal(i);if(!r.hasClass("loaded")){r.removeClass("active").removeClass("hidden").addClass("loading");f.ajax({url:mottaData.ajax_url.toString().replace("%%endpoint%%","motta_product_popup_recommended"),type:"POST",data:{nonce:mottaData.nonce,product_id:e},success:function(e){if(!e||e.data===""){r.addClass("hidden");return}r.html(e.data);d(r);r.removeClass("loading");r.addClass("active")}})}else{if(!r.hasClass("has-carousel")){d(r);r.addClass("has-carousel")}}}function d(e){if(e.length<1){return}var t=e.find("ul.products");if(t.length<1){return}t.find("li.product").addClass("swiper-slide");t.after('<div class="swiper-pagination"></div>');new Swiper(e.find(".linked-products-carousel").get(0),{loop:false,autoplay:false,speed:800,watchSlidesVisibility:true,slidesPerView:4,navigation:{nextEl:e.find(".motta-swiper-button-next"),prevEl:e.find(".motta-swiper-button-prev")},pagination:{el:e.find(".swiper-pagination"),type:"bullets",clickable:true},on:{init:function(){this.$el.css("opacity",1)}},spaceBetween:20,breakpoints:{300:{slidesPerView:mottaData.mobile_product_columns==""?2:mottaData.mobile_product_columns,slidesPerGroup:mottaData.mobile_product_columns==""?2:mottaData.mobile_product_columns,spaceBetween:16},768:{slidesPerView:3},1200:{slidesPerView:4}}})}};m.clickHamburgerMenu=function(){var o=f("#hamburger-panel, #mobile-menu-panel, #mobile-header-v11-menu-panel, #mobile-header-v12-menu-panel");o.find("ul.menu > li.menu-item-has-children > a").find(".motta-svg-icon--select-arrow").remove();o.find("ul.menu > li.menu-item-has-children > a").append('<span class="motta-svg-icon icon-arrow"><svg viewBox="0 0 32 32"><path d="M11.42 29.42l-2.84-2.84 10.6-10.58-10.6-10.58 2.84-2.84 13.4 13.42z"></path></svg></span>');o.find("ul.menu > li.menu-item-has-children > ul.sub-menu > li.menu-item-has-children > a, ul.menu > li.menu-item-has-children > ul.sub-menu li.menu-item--type-label h6").append('<span class="motta-svg-icon icon-minus"><svg viewBox="0 0 32 32"><path d="M26.667 13.333v5.333h-21.333v-5.333h21.333z"></path></svg></span>');o.find("ul.menu > li.menu-item-has-children > ul.sub-menu > li.menu-item-has-children > a, ul.menu > li.menu-item-has-children > ul.sub-menu li.menu-item--type-label h6").append('<span class="motta-svg-icon icon-plus"><svg viewBox="0 0 32 32"><path d="M26.667 13.333h-8v-8h-5.333v8h-8v5.333h8v8h5.333v-8h8z"></path></svg></span>');o.find("ul.menu > li.menu-item-has-children > ul.sub-menu li.menu-item--type-label").nextUntil(".menu-item--type-label").addClass("menu-sub-item");o.on("click","ul.menu > li.menu-item-has-children > a",function(e){e.preventDefault();var t=f(this).data("title"),a=f(this).data("image");f(this).closest(o).find(".header-category__sub-title").html(t);if(f(this).data("image")){o.find(".header-category__box-image").css("background-image","url("+a+")");o.find(".header-category__box").addClass("has-image")}else{o.find(".header-category__box-image").removeAttr("style")}f(this).closest(o).find(".panel__container").addClass("motta-open");f(this).closest("li.menu-item-has-children").addClass("motta-open")}).on("click",".header-category__back",function(e){f(this).closest(o).find(".panel__container").removeClass("motta-open");f(this).closest(o).find("li.menu-item-has-children").removeClass("motta-open");f(this).closest(o).find(".preferences-menu__item").removeClass("motta-open")}).on("click","ul.menu > li.menu-item-has-children > ul.sub-menu > li.menu-item-has-children > a",function(e){e.preventDefault();var t=f(this).closest("li.menu-item-has-children");t.toggleClass("active").siblings().removeClass("active");if(t.closest("ul").hasClass("sub-menu")){t.children("ul").slideToggle();t.siblings().find("ul").slideUp()}}).on("click","ul.menu > li.menu-item-has-children > ul.sub-menu li.menu-item--type-label",function(e){e.preventDefault();f(this).toggleClass("active").siblings().removeClass("active");f(this).nextAll().each(function(){if(f(this).filter(".menu-item--type-label").length){return false}f(this).filter("li.menu-sub-item").slideToggle(200)})}).on("click",".preferences-menu__item > a",function(e){e.preventDefault();f(this).closest(o).find(".header-category__sub-title").html(f(this).data("title"));f(this).closest(o).find(".panel__container").addClass("motta-open");f(this).parent().addClass("motta-open")})};m.clickCategoryMenu=function(){var a=f(".header-category-menu");if(a.hasClass("header-category--icon")){a.find("ul.menu > li.menu-item-has-children > a").append('<span class="motta-svg-icon icon-arrow"><svg viewBox="0 0 32 32"><path d="M11.42 29.42l-2.84-2.84 10.6-10.58-10.6-10.58 2.84-2.84 13.4 13.42z"></path></svg></span>')}if(a.hasClass("header-category--both")){a.find(".motta-button--subtle + .header-category__content ul.menu > li.menu-item-has-children > a, .motta-button--text + .header-category__content ul.menu > li.menu-item-has-children > a").append('<span class="motta-svg-icon icon-arrow"><svg viewBox="0 0 32 32"><path d="M11.42 29.42l-2.84-2.84 10.6-10.58-10.6-10.58 2.84-2.84 13.4 13.42z"></path></svg></span>')}a.find("ul.menu > li.menu-item-has-children").mouseenter(function(){a.find("ul.menu").addClass("motta-hover")}).mouseleave(function(){a.find("ul.menu").removeClass("motta-hover")});a.on("click",".header-category__title",function(e){if(f(this).closest(a).hasClass("header-category--open")){return}f(this).closest(a).toggleClass("motta-open")});f(document.body).on("click","div",function(e){if(f(".header-category-menu").hasClass("header-category--open")){return}var t=f(e.target);if(t.is(a)||t.closest(a).length){return}a.removeClass("motta-open")});if(a.find(".header-category__content .mega-menu-container").hasClass("full-width")){f(".header-category__content .mega-menu-container.full-width").append('<div class="motta-container-full-width-hover"></div>');var e=a.find(".header-category__content"),t=e.offset().left,t=t-f(window).scrollLeft(),o=e.width(),i=-t-o;a.find(".motta-container-full-width-hover").css("left",i)}};m.hoverPrimaryMenu=function(){var t=f(".site-header .primary-navigation, .site-header .secondary-navigation"),e=f("#wpadminbar").is(":visible")?f("#wpadminbar").outerHeight(true):0,a=f("#campaign-bar").is(":visible")?f("#campaign-bar").outerHeight(true):0,o=f("#topbar").is(":visible")?f("#topbar").outerHeight(true):0,i=f("#site-header").outerHeight(true)+e+a+o;t.append('<div class="motta-primary-menu-overlay"></div>');t.find(".motta-primary-menu-overlay").css("top",i);t.find("ul.menu > li.menu-item-has-children").mouseenter(function(){t.find(".motta-primary-menu-overlay").addClass("motta-hover")}).mouseleave(function(){t.find(".motta-primary-menu-overlay").removeClass("motta-hover")});m.$window.scroll(function(){var e=m.$window.scrollTop();t.find(".motta-primary-menu-overlay").css("top",i-e)})};m.recentlyViewedProducts=function(){m.$body.find(".header-view-history").each(function(){var t=f(this),a=true;t.on("click",".header-view-history__title",function(e){e.preventDefault();t.toggleClass("motta-open");if(a){o(t);a=false}})});f(document.body).on("click","div",function(e){var t=m.$body.find(".header-view-history"),a=f(e.target);if(a.is(t)||a.closest(t).length){return}t.removeClass("motta-open")});function o(t){var a=t.find(".header-view-history__content-products"),e=mottaData.ajax_url.toString().replace("%%endpoint%%","motta_recently_viewed_products");if(e==""){return}f.post(e,{nonce:mottaData.nonce},function(e){a.html(e);m.productCardHoverSlider();a.addClass("swiper-container");if(a.find(".products")){t.find(".products").addClass("swiper-wrapper")}if(!a.find("ul.products li").hasClass("no-products")){i(a)}t.addClass("products-loaded");t.find(".motta-pagination--loading").remove()})}function i(e){var t=e,a=t.find("ul.products");if(t.find("div").hasClass("no-products")){return}t.addClass("swiper-container");t.find(".products").removeClass("product-card-layout-2");t.find(".products").removeClass("product-card-layout-3");t.find(".products").removeClass("product-card-layout-4");t.find(".products").removeClass("product-card-layout-5");if(t.find(".products")){t.find(".products").addClass("swiper-wrapper");t.find(".products").addClass("product-card-layout-1 product-card-layout-recently")}t.parent().append('<span class="motta-svg-icon swiper-button motta-swiper-button-prev motta-swiper-button"><svg viewBox="0 0 32 32"><path d="M20.58 2.58l2.84 2.84-10.6 10.58 10.6 10.58-2.84 2.84-13.4-13.42z"></path></svg></span>');t.parent().append('<span class="motta-svg-icon swiper-button motta-swiper-button-next motta-swiper-button"><svg viewBox="0 0 32 32"><path d="M11.42 29.42l-2.84-2.84 10.6-10.58-10.6-10.58 2.84-2.84 13.4 13.42z"></path></svg></span>');a.find("li.product").addClass("swiper-slide");var o={loop:false,autoplay:false,speed:800,watchOverflow:true,lazy:true,slidesPerView:7,breakpoints:{}};o.navigation={nextEl:t.parent().find(".motta-swiper-button-next"),prevEl:t.parent().find(".motta-swiper-button-prev")};new Swiper(t,o)}};m.clickHeaderDropdown=function(){var o=f(".site-header");var e=f(".site-header").find(".header-cart a").width()/2-5;o.find(".dropdown-content").append('<div class="dropdown-after"></div>');o.find(".dropdown-after").css("right",e+"px");o.on("click",".header-button-dropdown",function(e){e.preventDefault();if(!f(this).parent().find(".dropdown-content").hasClass("motta-open")){f(".dropdown-content").removeClass("motta-open")}f(this).parent().find(".dropdown-content").toggleClass("motta-open")});f(document.body).on("click",function(e){var t=f(e.target),a=f(".header-button-dropdown").parent();if(t.is(a)||t.closest(a).length){return}o.find(".dropdown-content").removeClass("motta-open")})};m.stickyHeader=function(){if(!mottaData.sticky_header){return}var r=f("#site-header-minimized"),s=m.$header.find(".site-header__section.motta-header-sticky"),e=m.$header.find(".site-header__desktop").find(".header-sticky"),t=m.$header.find(".site-header__mobile").find(".header-mobile-sticky"),d=e.length?e.outerHeight():0,c=t.length?t.outerHeight():0;m.$window.on("scroll",function(){var e=m.$window.scrollTop(),t=m.$header.outerHeight(true),a=m.$body.outerHeight(true),o=f("#campaign-bar").is(":visible")?f("#campaign-bar").height():0,i=f("#topbar").is(":visible")?f("#topbar").height():0,n=t+o+i+100;if(a<=n+m.$window.height()){return}if(e>n){s.addClass("minimized");if(m.$window.width()>992){r.css("height",d)}else{r.css("height",c)}l()}else{s.removeClass("minimized");r.removeAttr("style")}});var a=m.$header.find(".header-sticky .header-category-menu");if(a.hasClass("header-category--open")){a.removeClass("header-category--open motta-open")}f(document.body).on("click","div",function(e){if(a.hasClass("motta-open")){var t=f(e.target);if(t.is(a)||t.closest(a).length){return}a.removeClass("motta-open")}});function l(){f(".header-search__trending--outside").removeClass("header-search__trending--open");f(".header-search").removeClass("header-search--focused");f(".header-search__form").removeClass("header-search__form--focused");f(".header-search__categories").removeClass("header-search__categories--open");f(".header-search__form").removeClass("categories--open");f(".header-search__results").addClass("hidden")}};m.instanceSearch=function(){if(mottaData.header_ajax_search!="1"){return}var s=f("#search-modal, .header-search");var l=null,u={},h=s.find("form");s.on("keyup",".header-search__field, .search-modal__field",function(e){var t=false;if(typeof e.which=="undefined"){t=true}else if(typeof e.which=="number"&&e.which>0){t=!e.ctrlKey&&!e.metaKey&&!e.altKey}if(!t){return}if(l){l.abort()}var a=f(".header-search__categories-label").is(":visible")?f(".header-search__categories-label").outerWidth(true):0,o=f(".header-search__divider").is(":visible")?f(".header-search__divider").outerWidth(true):0,i=a+o+10;if(f(".header-search__container > div:first-child").hasClass("header-search__categories-label")){i=10}if(m.$body.hasClass("rtl")){s.find(".close-search-results").css("left",i)}else{s.find(".close-search-results").css("right",i)}s.find(".header-search__trending").removeClass("header-search__trending--open");s.find(".result-list-found, .result-list-not-found").html("");var n=f(".header-search__form, .search-modal__form"),r=n.find("input.header-search__field, input.search-modal__field");if(r.val().length<2){n.removeClass("searching searched actived found-products found-no-product invalid-length")}d(n)}).on("click",".header-search__categories-container a",function(){if(l){l.abort()}s.find(".result-list-found").html("");var e=f(this).closest(".header-search__form");d(e)}).on("focusout",".header-search__field, .search-modal__field",function(){var e=f(this).closest(".header-search__form, .search-modal__form"),t=e.find("input.header-search__field, input.search-modal__field");if(t.val().length<2){e.removeClass("searching searched actived found-products found-no-product invalid-length")}});s.on("click",".close-search-results",function(e){e.preventDefault();s.find(".header-search__field, .search-modal__field").val("");s.find(".header-search__form, .search-modal__form").removeClass("searching searched actived found-products found-no-product invalid-length");s.find(".result-list-found").html("")});function d(a){var e=a.find("input.header-search__field, input.search-modal__field"),t=e.val(),o=0,i=a.find(".search-results");if(a.find("input.category-name").length>0){o=a.find("input.category-name").val()}if(t.trim().length<2){a.removeClass("searching found-products found-no-product").addClass("invalid-length");return}a.removeClass("found-products found-no-product").addClass("searching");var n=t+o,r=h.attr("action")+"?"+h.serialize();if(n in u){var s=u[n];a.removeClass("searching");a.addClass("found-products");i.html(s.products);f(document.body).trigger("motta_ajax_search_request_success",[i]);a.removeClass("invalid-length");a.addClass("searched actived")}else{var d={term:t,cat:o,ajax_search_number:mottaData.header_search_number,search_type:a.find("input.header-search__post-type, input.search-modal__post-type").val()},c=mottaData.ajax_url.toString().replace("%%endpoint%%","motta_instance_search_form");l=f.post(c,d,function(e){var t=e.data;a.removeClass("searching");a.addClass("found-products");i.html(t);a.removeClass("invalid-length");f(document.body).trigger("motta_ajax_search_request_success",[i]);u[n]={found:true,products:t};i.find(".view-more a").attr("href",r);a.addClass("searched actived")})}}f(".site-header .header-search__field").on("input",function(){var e=f(this).val();f(".site-header .header-search__field").val(e)})};m.tabMegaMenu=function(){var o=f(".site-header .main-navigation, #hamburger-panel, #mobile-menu-panel, #mobile-header-v11-menu-panel, #mobile-header-v12-menu-panel");o.on("mouseover",".mega-menu--behavior-hover .mega-menu__tablist > li > a",function(){t(f(this))});o.on("click",".mega-menu--behavior-click .mega-menu__tablist > li > a",function(e){e.preventDefault();t(f(this))});function t(e){var t=e.parent();if(!e.hasClass("active")){var a=t.data("tab");o.find(".mega-menu__tablist > li").removeClass("active");t.addClass("active");t.parent().siblings(".mega-menu__panellist").find(".mega-menu__tabpanel").removeClass("active");t.parent().siblings(".mega-menu__panellist").find('[data-tabpanel="'+a+'"]').addClass("active")}}};m.productCardHoverSlider=function(){var e=m.$body.find("ul.products .product-thumbnails--slider"),t={observer:true,observeParents:true,loop:false,autoplay:false,speed:800,watchOverflow:true,lazy:true,breakpoints:{}};e.find(".woocommerce-loop-product__link").addClass("swiper-slide");m.$body.find("ul.products").imagesLoaded(function(){setTimeout(function(){e.each(function(){t.navigation={nextEl:f(this).find(".motta-product-card-swiper-next"),prevEl:f(this).find(".motta-product-card-swiper-prev")};new Swiper(f(this),t)})},200)})};m.productCardHoverZoom=function(){if(typeof mottaData.product_card_hover==="undefined"||!f.fn.zoom){return}if(mottaData.product_card_hover!=="zoom"){return}var e=m.$body.find("ul.products .product-thumbnail-zoom");e.each(function(){var e=f(this);e.zoom({url:e.attr("data-zoom_image")})})};m.productAttribute=function(){m.$body.on("click",".product-variation-item--attrs",function(e){e.preventDefault();f(this).siblings(".product-variation-item--attrs").removeClass("selected");f(this).addClass("selected");var t=f(this).data("product_variations"),a=f(this).closest(".product-inner").find(".woocommerce-LoopProduct-link").first(),o=a.find("img").first(),i=f(this).closest(".product-inner").find(".price");a.addClass("image-loading");if(t.img_src&&t.img_src!="undefined"){o.attr("src",t.img_src)}if(t.img_srcset&&t.img_srcset!="undefined"){o.attr("srcset",t.img_srcset)}if(t.price&&t.price!="undefined"){i.replaceWith(t.price)}if(t.img_zoom_src&&t.img_zoom_src!="undefined"){a.find(".zoomImg").attr("src",t.img_zoom_src)}o.load(function(){a.removeClass("image-loading")})});m.$body.on("mouseover",".product-variation-items",function(e){e.preventDefault();f(this).closest(".product-inner").find(".product-thumbnail").addClass("hover-swatch")}).on("mouseout",".product-variation-items",function(e){e.preventDefault();f(this).closest(".product-inner").find(".product-thumbnail").removeClass("hover-swatch")})};m.productQuickView=function(){f(document.body).on("click",".motta-button--quickview",function(e){e.preventDefault();var t=f(this),a=t.data("id"),o=f("#"+t.data("target")),i=o.find(".woocommerce"),n=mottaData.ajax_url.toString().replace("%%endpoint%%","product_quick_view");o.removeClass("modal--open");o.addClass("loading");i.find(".product-quickview").html("");f.post(n,{action:"motta_get_product_quickview",product_id:a,security:mottaData.product_quickview_nonce},function(e){i.find(".product-quickview").replaceWith(e.data);if(e.success){r()}o.removeClass("loading");o.addClass("modal--open");m.addToCartSingleAjax();m.$body.trigger("motta_product_quick_view_loaded");if(i.find(".deal-expire-countdown").length>0){f(document.body).trigger("motta_countdown",[f(".deal-expire-countdown")])}}).fail(function(){window.location.herf=t.attr("href")});function r(){var e=i.find(".product-quickview"),t=e.find(".woocommerce-product-gallery"),a=e.find(".variations_form");s();t.on("motta_update_product_gallery_on_quickview",function(){s()});if(typeof wc_add_to_cart_variation_params!=="undefined"){a.each(function(){d();f(this).wc_variation_form()})}f(document.body).trigger("init_variation_swatches")}function s(){var e=i.find(".product-quickview"),t=e.find(".woocommerce-product-gallery");t.on("click",".woocommerce-product-gallery__image a",function(e){e.preventDefault()});if(t.find(".woocommerce-product-gallery__image").length>1){t.flexslider({selector:".woocommerce-product-gallery__wrapper > .woocommerce-product-gallery__image",animation:"slide",animationLoop:false,animationSpeed:500,controlNav:true,directionNav:true,prevText:'<span class="motta-svg-icon motta-svg-icon--arrow-left-long"><svg viewBox="0 0 19 32"><path d="M13.552 0.72l2.656 1.76-9.008 13.52 9.008 13.52-2.656 1.76-10.192-15.28z"></path></svg></span>',nextText:'<span class="motta-svg-icon motta-svg-icon--arrow-right-long"><svg viewBox="0 0 19 32"><path d="M5.648 31.28l-2.656-1.76 9.008-13.52-9.008-13.52 2.656-1.76 10.192 15.28z"></path></svg></span>',slideshow:false,start:function(){t.css("opacity",1)}})}else{t.css("opacity",1)}t.append('<a class="product-image__link" href="'+e.find(".product_title a").attr("href")+'"></a>')}function d(){var t=f(".product-quickview .variations-attribute-change .price").html(),a=f(".product-quickview .variations-attribute-change .stock").html();f(".product-quickview .variations_form").on("show_variation",function(){var e=f(this).closest(".product-quickview").find(".variations-attribute-change"),t=f(this).find(".woocommerce-variation-price .price").html(),a=f(this).find(".woocommerce-variation-availability .stock").html();e.find(".price").html(t);e.find(".stock").html(a)});f(".product-quickview .variations_form").on("hide_variation",function(){var e=f(this).closest(".product-quickview").find(".variations-attribute-change");e.find(".price").html(t);e.find(".stock").html(a)})}})};m.addCompare=function(){m.$body.on("click","a.compare:not(.added)",function(e){e.preventDefault();var t=f(this);t.addClass("loading");t.closest(".product-inner").find(".compare:not(.loading)").trigger("click");if(f(this).hasClass("added")){t.removeClass("loading")}else{setTimeout(function(){t.removeClass("loading")},2e3)}})};m.loginTabs=function(){f(".woocommerce-account__heading").on("click","h2",function(e){e.preventDefault();var t=f(this).parent();if(!f(this).hasClass("active")){var a=f(this).data("tab");t.find("h2").removeClass("active");f(this).addClass("active");t.siblings(".woocommerce-account__form").find(".woocommerce-form").removeClass("active");t.siblings(".woocommerce-account__form").find("."+a).addClass("active")}});f(".motta-create-account").on("click","a",function(e){e.preventDefault();f(this).closest(".woocommerce-account__summary").find('h2[data-tab="register"]').trigger("click")});f(".motta-sign-in").on("click","a",function(e){e.preventDefault();f(this).closest(".woocommerce-account__summary").find('h2[data-tab="login"]').trigger("click")});if(typeof mottaData.show_text!=="undefined"&&typeof mottaData.hide_text!=="undefined"){f(".woocommerce-account__summary .show-password-input").text(mottaData.show_text);f(".woocommerce-account__summary .show-password-input").on("click",function(e){e.preventDefault();if(f(this).hasClass("display-password")){f(".woocommerce-account__summary .show-password-input").text(mottaData.hide_text)}else{f(".woocommerce-account__summary .show-password-input").text(mottaData.show_text)}})}var e=window.location.hash;if(e==="#register"){f(".woocommerce-account__heading .register").trigger("click");f("html, body").animate({scrollTop:f(e).offset().top-300},300)}};m.productLoaded=function(){m.$window.on("motta_products_loaded",function(e,t){setTimeout(function(){t.removeClass("animated mottaFadeInUp")},1500);m.productCardHoverSlider()})};m.preferences=function(){var e=f(".preferences-modal");if(f.fn.select2){e.find(".language_select").select2({width:"100%",minimumResultsForSearch:5,selectionCssClass:"motta-input--default",dropdownCssClass:"language-select",dropdownParent:e.find(".language_select").parent()});e.find(".currency_select").select2({width:"100%",minimumResultsForSearch:5,selectionCssClass:"motta-input--default",dropdownCssClass:"currency-select",dropdownParent:e.find(".currency_select").parent()})}e.on("change",".preferences_select",function(){if(f(this).hasClass("language_select")){f(this).closest("form").attr("action",f(this).val())}});f(".update-preferences").on("click",function(e){var t=f(this).closest("form"),a=t.attr("action");t.find(".language_select").prop("disabled",true);if(a.indexOf("?")!=-1){e.preventDefault();window.location.href=a+"&"+t.serialize()}})};m.addToCartSingleAjax=function(){var e=f("div.product, #motta-sticky-add-to-cart");if(e.length<1){return}if(!e.hasClass("product-add-to-cart-ajax")){return}e.find("form.cart").on("click",".single_add_to_cart_button",function(e){var t=f(this),a=t.closest("form.cart");if(t.closest(".product").hasClass("product-type-external")){return}if(a.hasClass("buy-now-clicked")){return}if(t.is(".disabled")){return}if(a.length>0){e.preventDefault()}else{return}m.addToCartFormAJAX(t,a,t)})};m.addToCartFormAJAX=function(n,e,r){if(n.data("requestRunning")){return}n.data("requestRunning",true);var s=false;r.addClass("loading");if(s){return}s=true;var t=e.serializeArray(),d=e.attr("action");if(n.val()!=""){t.push({name:n.attr("name"),value:n.val()})}f(document.body).trigger("adding_to_cart",[n,t]);f.ajax({url:d,method:"post",data:t,error:function(e){window.location=d},success:function(e){if(!e){window.location=d}if(typeof wc_add_to_cart_params!=="undefined"){if(wc_add_to_cart_params.cart_redirect_after_add==="yes"){window.location=wc_add_to_cart_params.cart_url;return}}var t="",a="info";if(f(e).find(".woocommerce-notices-wrapper .woocommerce-message").length>0){f(document.body).trigger("wc_fragment_refresh");if(f(".single-product div.product").find(".motta-free-shipping-bar").length&&f(e).find("div.product .motta-free-shipping-bar").length){f(".single-product div.product").find(".motta-free-shipping-bar").replaceWith(f(e).find("div.product .motta-free-shipping-bar"))}}else{if(!f.fn.notify){return}var o='<span class="motta-svg-icon message-icon"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" ><circle cx="12" cy="12" r="10"/><line x1="12" y1="16" x2="12" y2="12"/><line x1="12" y1="8" x2="12.01" y2="8"/></svg></span>',i='<span class="motta-svg-icon svg-active"><svg class="svg-icon" aria-hidden="true" role="img" focusable="false" width="15" height="15" viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M14 1L1 14M1 1L14 14" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"></path></svg></span>';if(f(e).find(".woocommerce-notices-wrapper .woocommerce-error").length>0){t=f(e).find(".woocommerce-notices-wrapper .woocommerce-error").html();a="error";o='<span class="motta-svg-icon message-icon"><span class="motta-svg-icon message-icon"><svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg"><g data-name="1" id="_1"><path d="M257,461.46c-114,0-206.73-92.74-206.73-206.73S143,48,257,48s206.73,92.74,206.73,206.73S371,461.46,257,461.46ZM257,78C159.55,78,80.27,157.28,80.27,254.73S159.55,431.46,257,431.46s176.73-79.28,176.73-176.73S354.45,78,257,78Z"/><path d="M342.92,358a15,15,0,0,1-10.61-4.39L160.47,181.76a15,15,0,1,1,21.21-21.21L353.53,332.4A15,15,0,0,1,342.92,358Z"/><path d="M171.07,358a15,15,0,0,1-10.6-25.6L332.31,160.55a15,15,0,0,1,21.22,21.21L181.68,353.61A15,15,0,0,1,171.07,358Z"/></g></svg></span></span>'}else if(f(e).find(".woocommerce-notices-wrapper .woocommerce-info").length>0){t=f(e).find(".woocommerce-notices-wrapper .woocommerce-info").html()}f.notify.addStyle("motta",{html:"<div>"+o+'<ul class="message-box">'+t+"</ul>"+i+"</div>"});f.notify("&nbsp",{autoHideDelay:5e3,className:a,style:"motta",showAnimation:"fadeIn",hideAnimation:"fadeOut"})}n.data("requestRunning",false);n.removeClass("loading");r.removeClass("loading");s=false}})};m.backToTop=function(){var e=f("#gotop");m.$window.on("scroll",function(){if(m.$window.scrollTop()>m.$window.height()){e.addClass("show-scroll")}else{e.removeClass("show-scroll")}});m.$body.on("click","#gotop",function(e){e.preventDefault();f("html, body").animate({scrollTop:0},800)})};f(function(){m.init()})})(jQuery);

Youez - 2016 - github.com/yon3zu
LinuXploit