jQuery(function(d){function a(){"undefined"!=typeof d.fn.selectBox&&d("select.selectBox").filter(":visible").not(".enhanced").selectBox().addClass("enhanced")}function e(){var t,e,i,n;"undefined"!=typeof d.prettyPhoto&&(t={hook:"data-rel",social_tools:!1,theme:"pp_woocommerce yith-wcwl-pp-modal",horizontal_padding:20,opacity:.8,deeplinking:!1,overlay_gallery:!1,keyboard_shortcuts:!1,default_width:500,changepicturecallback:function(){a(),d(".wishlist-select").filter(":visible").change(),d(document).trigger("yith_wcwl_popup_opened",[this])},markup:'
'},d('a[data-rel^="prettyPhoto[add_to_wishlist_"]').add('a[data-rel="prettyPhoto[ask_an_estimate]"]').add('a[data-rel="prettyPhoto[create_wishlist]"]').off("click").prettyPhoto(t),d('a[data-rel="prettyPhoto[move_to_another_wishlist]"]').on("click",function(){var t=d(this),e=d("#move_to_another_wishlist").find("form"),i=e.find(".row-id"),t=t.closest("[data-row-id]").data("row-id");i.length&&i.remove(),e.append('')}).prettyPhoto(t),e=function(t,e){"undefined"!=typeof t.classList&&t.classList.contains("yith-wcwl-overlay")&&(t="remove"===e?"removeClass":"addClass",d("body")[t]("yith-wcwl-with-pretty-photo"))},i=function(t){e(t,"add")},n=function(t){e(t,"remove")},new MutationObserver(function(t){for(var e in t){e=t[e];"childList"===e.type&&("undefined"!=typeof e.addedNodes&&"function"==typeof e.addedNodes.forEach&&e.addedNodes.forEach(i),"undefined"!=typeof e.removedNodes)&&"function"==typeof e.addedNodes.forEach&&e.removedNodes.forEach(n)}}).observe(document.body,{childList:!0}))}function i(){d(".wishlist_table").find('.product-checkbox input[type="checkbox"]').off("change").on("change",function(){var t=d(this);t.parent().removeClass("checked").removeClass("unchecked").addClass(t.is(":checked")?"checked":"unchecked")}).trigger("change")}function n(){d(".add_to_cart").filter("[data-icon]").not(".icon-added").each(function(){var t=d(this),e=t.data("icon"),e=e.match(/[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*)?/gi)?d("",{src:e}):d("",{"class":"fa "+e});t.prepend(e).addClass("icon-added")})}function c(){a(),e(),i(),n(),r(),o(),f(),_(),h(),w(),d(document).trigger("yith_wcwl_init_after_ajax")}function o(){yith_wcwl_l10n.enable_tooltip&&d(".yith-wcwl-add-to-wishlist").find("[data-title]").each(function(){var t=d(this);t.hasClass("tooltip-added")||(t.on("mouseenter",function(){var t=d(this),e=d("",{"class":"yith-wcwl-tooltip",text:t.data("title")}),i=(t.append(e),e.outerWidth()+6);e.outerWidth(i),e.fadeIn(200),t.addClass("with-tooltip")}).on("mouseleave",function(){var t=d(this);t.find(".yith-wcwl-tooltip").fadeOut(200,function(){t.removeClass("with-tooltip").find(".yith-wcwl-tooltip").remove()})}),t.addClass("tooltip-added"))})}function r(){d(".yith-wcwl-add-button").filter(".with-dropdown").on("mouseleave",function(){var t=d(this).find(".yith-wcwl-dropdown");t.length&&t.fadeOut(200)}).children("a").on("mouseenter",function(){var t=d(this).closest(".with-dropdown"),e=t.find(".yith-wcwl-dropdown");e.length&&e.children().length&&t.find(".yith-wcwl-dropdown").fadeIn(200)})}function _(){"undefined"!=typeof yith_wcwl_l10n.enable_drag_n_drop&&yith_wcwl_l10n.enable_drag_n_drop&&d(".wishlist_table").filter(".sortable").not(".no-interactions").each(function(){var n=d(this),a=!1;n.sortable({items:"[data-row-id]",scroll:!0,helper:function(t,e){return e.children().each(function(){d(this).width(d(this).width())}),e},update:function(){var t=n.find("[data-row-id]"),e=[],i=0;t.length&&(a&&a.abort(),t.each(function(){var t=d(this);t.find('input[name*="[position]"]').val(i++),e.push(t.data("row-id"))}),a=d.ajax({data:{action:yith_wcwl_l10n.actions.sort_wishlist_items,nonce:yith_wcwl_l10n.nonce.sort_wishlist_items_nonce,context:"frontend",positions:e,wishlist_token:n.data("token"),page:n.data("page"),per_page:n.data("per-page")},method:"POST",url:yith_wcwl_l10n.ajax_url}))}})})}function h(){var o,s;d(".wishlist_table").on("change",".product-quantity :input",function(){var t=d(this),e=t.closest("[data-row-id]"),i=e.data("row-id"),n=t.closest(".wishlist_table"),a=n.data("token");clearTimeout(s),e.find(".add_to_cart").attr("data-quantity",t.val()),s=setTimeout(function(){o&&o.abort(),o=d.ajax({beforeSend:function(){j(n)},complete:function(){C(n)},data:{action:yith_wcwl_l10n.actions.update_item_quantity,nonce:yith_wcwl_l10n.nonce.update_item_quantity_nonce,context:"frontend",product_id:i,wishlist_token:a,quantity:t.val()},method:"POST",url:yith_wcwl_l10n.ajax_url})},1e3)})}function w(){d(".copy-trigger").on("click",function(){var t=d(".copy-target");0",{val:t.text(),type:"text"}),d("body").append(t),l()?t[0].setSelectionRange(0,9999):t.select(),document.execCommand("copy"),t.remove()))})}function f(){d(".wishlist_table").filter(".images_grid").not(".enhanced").on("click","[data-row-id] .product-thumbnail a",function(t){var e,i,n;yith_wcwl_l10n.disable_popup_grid_view||(i=(e=d(this).closest("[data-row-id]")).siblings("[data-row-id]"),n=e.find(".item-details"),t.preventDefault(),n.length&&(i.removeClass("show"),e.toggleClass("show")))}).on("click","[data-row-id] a.close",function(t){var e=d(this).closest("[data-row-id]"),i=e.find(".item-details");t.preventDefault(),i.length&&e.removeClass("show")}).on("click","[data-row-id] a.remove_from_wishlist",function(t){var e=d(this);return t.stopPropagation(),p(e),!1}).addClass("enhanced"),d(document).on("click",function(t){d(t.target).closest("[data-row-id]").length||d(".wishlist_table").filter(".images_grid").find(".show").removeClass("show")}).on("added_to_cart",function(){d(".wishlist_table").filter(".images_grid").find(".show").removeClass("show")})}function u(e,t,i){e.action=yith_wcwl_l10n.actions.move_to_another_wishlist_action,e.nonce=yith_wcwl_l10n.nonce.move_to_another_wishlist_nonce,e.context="frontend",""!==e.wishlist_token&&""!==e.destination_wishlist_token&&""!==e.item_id&&d.ajax({beforeSend:t,url:yith_wcwl_l10n.ajax_url,data:e,dataType:"json",method:"post",success:function(t){i(t),c(),d("body").trigger("moved_to_another_wishlist",[d(this),e.item_id])}})}function p(e){var t=e.parents(".cart.wishlist_table"),i=e.parents("[data-row-id]"),n=i.data("row-id"),a=t.data("id"),o=t.data("token"),a={action:yith_wcwl_l10n.actions.remove_from_wishlist_action,nonce:yith_wcwl_l10n.nonce.remove_from_wishlist_nonce,context:"frontend",remove_from_wishlist:n,wishlist_id:a,wishlist_token:o,fragments:S(n)};d.ajax({beforeSend:function(){j(t)},complete:function(){C(t)},data:a,method:"post",success:function(t){"undefined"!=typeof t.fragments&&D(t.fragments),c(),d("body").trigger("removed_from_wishlist",[e,i])},url:yith_wcwl_l10n.ajax_url})}function m(t){var e=d(this),i=e.closest(".wishlist_table"),n=null;t.preventDefault(),(n=i.length?e.closest("[data-wishlist-id]").find(".wishlist-title"):e.parents(".wishlist-title")).next().css("display","inline-block").find('input[type="text"]').focus(),n.hide()}function y(t){var e=d(this);t.preventDefault(),e.parents(".hidden-title-form").hide(),e.parents(".hidden-title-form").prev().show()}function v(t){var e=d(this),i=e.closest(".hidden-title-form"),e=e.closest("[data-wishlist-id]").data("wishlist-id"),n=i.find('input[type="text"]'),a=n.val();t.preventDefault(),a?(e=e||d("#wishlist_id").val(),t={action:yith_wcwl_l10n.actions.save_title_action,nonce:yith_wcwl_l10n.nonce.save_title_nonce,context:"frontend",wishlist_id:e,title:a,fragments:S()},d.ajax({type:"POST",url:yith_wcwl_l10n.ajax_url,data:t,dataType:"json",beforeSend:function(){j(i)},complete:function(){C(i)},success:function(t){var e=t.fragments;t.result?(i.hide(),i.prev().find(".wishlist-anchor, h1, h2").text(a).end().show()):(i.addClass("woocommerce-invalid"),n.focus()),void 0!==e&&D(e),c()}})):(i.addClass("woocommerce-invalid"),n.focus())}function g(){var t=d(this),e=t.val(),t=t.closest("[data-wishlist-id]").data("wishlist-id"),t={action:yith_wcwl_l10n.actions.save_privacy_action,nonce:yith_wcwl_l10n.nonce.save_privacy_nonce,context:"frontend",wishlist_id:t,privacy:e,fragments:S()};d.ajax({type:"POST",url:yith_wcwl_l10n.ajax_url,data:t,dataType:"json",success:function(t){t=t.fragments;void 0!==t&&D(t)}})}function b(t,e){if("undefined"!=typeof d.prettyPhoto&&"undefined"!=typeof d.prettyPhoto.close)if(void 0!==t){var i,n=d(".pp_content_container"),a=n.find(".pp_content"),n=n.find(".yith-wcwl-popup-form"),o=n.closest(".pp_pic_holder");n.length&&((i=d("
",{"class":"yith-wcwl-popup-feedback"})).append(d("",{"class":"fa heading-icon "+("error"===e?"fa-exclamation-triangle":"fa-check")})),i.append(d("

",{"class":"feedback",html:t})),i.css("display","none"),a.css("height","auto"),n.after(i),n.fadeOut(200,function(){i.fadeIn()}),o.addClass("feedback"),o.css("left",d(window).innerWidth()/2-o.outerWidth()/2+"px"),"undefined"!=typeof yith_wcwl_l10n.auto_close_popup&&!yith_wcwl_l10n.auto_close_popup||setTimeout(b,yith_wcwl_l10n.popup_timeout))}else try{d.prettyPhoto.close(),yith_wcwl_l10n.redirect_after_ask_estimate&&window.location.replace(yith_wcwl_l10n.ask_estimate_redirect_url)}catch(s){}}function k(t){var e=d("#yith-wcwl-popup-message"),i=d("#yith-wcwl-message"),n="undefined"!=typeof yith_wcwl_l10n.popup_timeout?yith_wcwl_l10n.popup_timeout:3e3;"undefined"!=typeof yith_wcwl_l10n.enable_notices&&!yith_wcwl_l10n.enable_notices||(i.html(t),e.css("margin-left","-"+d(e).width()+"px").fadeIn(),window.setTimeout(function(){e.fadeOut()},n))}function x(o){var t=d("select.wishlist-select"),e=d("ul.yith-wcwl-dropdown");t.each(function(){var i=d(this),t=i.find("option"),e=t.filter('[value="new"]');t.not(e).remove(),d.each(o,function(t,e){d("

  • ").append(d("",{rel:"nofollow",html:e.wishlist_name,"class":"add_to_wishlist",href:e.add_to_this_wishlist_url,"data-product-id":n,"data-product-type":a,"data-wishlist-id":e.id})).appendTo(i)})})}function j(t){"undefined"!=typeof d.fn.block&&t.fadeTo("400","0.6").block({message:null,overlayCSS:{background:"transparent url("+yith_wcwl_l10n.ajax_loader_url+") no-repeat center",backgroundSize:"40px 40px",opacity:1}})}function C(t){"undefined"!=typeof d.fn.unblock&&t.stop(!0).css("opacity","1").unblock()}function T(){if(navigator.cookieEnabled)return 1;document.cookie="cookietest=1";var t=-1!==document.cookie.indexOf("cookietest=");return document.cookie="cookietest=1; expires=Thu, 01-Jan-1970 00:00:01 GMT",t}function S(t){var i={},e=null;return t?"object"==typeof t?(e=(t=d.extend({fragments:null,s:"",container:d(document),firstLoad:!1},t)).fragments||t.container.find(".wishlist-fragment"),t.s&&(e=e.not("[data-fragment-ref]").add(e.filter('[data-fragment-ref="'+t.s+'"]'))),t.firstLoad&&(e=e.filter(".on-first-load"))):(e=d(".wishlist-fragment"),"string"!=typeof t&&"number"!=typeof t||(e=e.not("[data-fragment-ref]").add(e.filter('[data-fragment-ref="'+t+'"]')))):e=d(".wishlist-fragment"),e.length?(e.each(function(){var t=d(this),e=t.attr("class").split(" ").filter(t=>t.length&&"exists"!==t).join(yith_wcwl_l10n.fragments_index_glue);i[e]=t.data("fragment-options")}),i):null}function P(e){var i=S(e=d.extend({firstLoad:!0},e));i&&d.ajax({data:{action:yith_wcwl_l10n.actions.load_fragments,nonce:yith_wcwl_l10n.nonce.load_fragments_nonce,context:"frontend",fragments:i},method:"post",success:function(t){"undefined"!=typeof t.fragments&&(D(t.fragments,e),c(),d(document).trigger("yith_wcwl_fragments_loaded",[i,t.fragments,e.firstLoad]))},url:yith_wcwl_l10n.ajax_url})}function D(t,e={}){d.each(t,function(t,e){var t="."+t.split(yith_wcwl_l10n.fragments_index_glue).filter(t=>t.length&&"exists"!==t&&"with-count"!==t).join("."),i=d(t),n=d(e).filter(t);n.length||(n=d(e).find(t)),i.length&&n.length&&i.replaceWith(n)}),d(document.body).trigger("yith_wcwl_fragments_replaced",{fragments:t,data:e})}function t(){var t=d(".product-checkbox input:checked");s.prop("disabled",!t.length)}var s;function l(){return navigator.userAgent.match(/ipad|iphone/i)}function O(t){return!0===t||"yes"===t||"1"===t||1===t}d(document).on("yith_wcwl_init",function(){var l,t=d(this),s="undefined"!=typeof wc_add_to_cart_params&&null!==wc_add_to_cart_params?wc_add_to_cart_params.cart_redirect_after_add:"";t.on("click",".add_to_wishlist",function(t){var n=d(this),e=n.attr("data-product-id"),a=d(".add-to-wishlist-"+e),e={action:yith_wcwl_l10n.actions.add_to_wishlist_action,nonce:yith_wcwl_l10n.nonce.add_to_wishlist_nonce,context:"frontend",add_to_wishlist:e,product_type:n.data("product-type"),wishlist_id:n.data("wishlist-id"),fragments:S(e)};if((i=d(document).triggerHandler("yith_wcwl_add_to_wishlist_data",[n,e]))&&(e=i),t.preventDefault(),jQuery(document.body).trigger("adding_to_wishlist"),yith_wcwl_l10n.multi_wishlist&&yith_wcwl_l10n.modal_enable){var i=n.parents(".yith-wcwl-popup-footer").prev(".yith-wcwl-popup-content"),t=i.find(".wishlist-select"),o=i.find(".wishlist-name"),i=i.find(".wishlist-visibility").filter(":checked");if(e.wishlist_id=t.is(":visible")?t.val():"new",e.wishlist_name=o.val(),e.wishlist_visibility=i.val(),"new"===e.wishlist_id&&!e.wishlist_name)return o.closest("p").addClass("woocommerce-invalid"),!1;o.closest("p").removeClass("woocommerce-invalid")}if(T())return d.ajax({type:"POST",url:yith_wcwl_l10n.ajax_url,data:e,dataType:"json",beforeSend:function(){j(n)},complete:function(){C(n)},success:function(t){var e=t.result,i=t.message;yith_wcwl_l10n.multi_wishlist&&yith_wcwl_l10n.modal_enable?(b(i,e),"undefined"!=typeof t.user_wishlists&&x(t.user_wishlists)):k(i),"true"!==e&&"exists"!==e||("undefined"!=typeof t.fragments&&D(t.fragments),yith_wcwl_l10n.multi_wishlist&&!yith_wcwl_l10n.hide_add_button||a.find(".yith-wcwl-add-button").remove(),a.addClass("exists")),c(),d("body").trigger("added_to_wishlist",[n,a])}}),!1;window.alert(yith_wcwl_l10n.labels.cookie_disabled)}),t.on("click",".wishlist_table .remove_from_wishlist",function(t){var e=d(this);return t.preventDefault(),p(e),!1}),t.on("adding_to_cart","body",function(t,e,i){void 0!==e&&void 0!==i&&e.closest(".wishlist_table").length&&(i.remove_from_wishlist_after_add_to_cart=e.closest("[data-row-id]").data("row-id"),i.wishlist_id=e.closest(".wishlist_table").data("id"),"undefined"!=typeof wc_add_to_cart_params&&(wc_add_to_cart_params.cart_redirect_after_add=yith_wcwl_l10n.redirect_to_cart),"undefined"!=typeof yith_wccl_general)&&(yith_wccl_general.cart_redirect=O(yith_wcwl_l10n.redirect_to_cart))}),t.on("added_to_cart","body",function(t,e,i,n){var a,o;void 0!==n&&n.closest(".wishlist_table").length&&("undefined"!=typeof wc_add_to_cart_params&&(wc_add_to_cart_params.cart_redirect_after_add=s),"undefined"!=typeof yith_wccl_general&&(yith_wccl_general.cart_redirect=O(s)),o=(a=n.closest("[data-row-id]")).closest(".wishlist-fragment").data("fragment-options"),n.removeClass("added"),a.find(".added_to_cart").remove(),yith_wcwl_l10n.remove_from_wishlist_after_add_to_cart)&&o.is_user_owner&&a.remove()}),t.on("added_to_cart","body",function(){var t=d(".woocommerce-message");0===t.length?d("#yith-wcwl-form").prepend(yith_wcwl_l10n.labels.added_to_cart_message):t.fadeOut(300,function(){d(this).replaceWith(yith_wcwl_l10n.labels.added_to_cart_message).fadeIn()})}),t.on("cart_page_refreshed","body",c),t.on("click",".show-title-form",m),t.on("click",".wishlist-title-with-form h2",m),t.on("click",".remove_from_all_wishlists",function(t){var e=d(this),i=e.attr("data-product-id"),n=e.data("wishlist-id"),a=e.closest(".content"),e={action:yith_wcwl_l10n.actions.remove_from_all_wishlists,nonce:yith_wcwl_l10n.nonce.remove_from_all_wishlists_nonce,context:"frontend",prod_id:i,wishlist_id:n,fragments:S(i)};t.preventDefault(),d.ajax({beforeSend:function(){j(a)},complete:function(){C(a)},data:e,dataType:"json",method:"post",success:function(t){"undefined"!=typeof t.fragments&&D(t.fragments),c()},url:yith_wcwl_l10n.ajax_url})}),t.on("click",".hide-title-form",y),t.on("click",".save-title-form",v),t.on("change",".wishlist_manage_table .wishlist-visibility",g),t.on("change",".change-wishlist",function(){var t=d(this),e=t.parents(".cart.wishlist_table"),i=e.data("token"),n=t.parents("[data-row-id]").data("row-id");u({wishlist_token:i,destination_wishlist_token:t.val(),item_id:n,fragments:S()},function(){j(e)},function(t){"undefined"!=typeof t.fragments&&D(t.fragments),C(e)})}),t.on("click",".yith-wcwl-popup-footer .move_to_wishlist",function(){var i=d(this),t=i.attr("data-product-id"),e=i.data("origin-wishlist-id"),n=i.closest("form"),a=n.find(".wishlist-select").val(),o=n.find(".wishlist-name"),s=o.val(),n=n.find(".wishlist-visibility").filter(":checked").val();if("new"===a&&!s)return o.closest("p").addClass("woocommerce-invalid"),!1;o.closest("p").removeClass("woocommerce-invalid"),u({wishlist_token:e,destination_wishlist_token:a,item_id:t,wishlist_name:s,wishlist_visibility:n,fragments:S(t)},function(){j(i)},function(t){var e=t.message;yith_wcwl_l10n.multi_wishlist?(b(e),"undefined"!=typeof t.user_wishlists&&x(t.user_wishlists)):k(e),"undefined"!=typeof t.fragments&&D(t.fragments),c(),C(i)})}),t.on("click",".delete_item",function(){var i=d(this),t=i.attr("data-product-id"),e=i.data("item-id"),n=d(".add-to-wishlist-"+t),e={action:yith_wcwl_l10n.actions.delete_item_action,nonce:yith_wcwl_l10n.nonce.delete_item_nonce,context:"frontend",item_id:e,fragments:S(t)};return d.ajax({url:yith_wcwl_l10n.ajax_url,data:e,dataType:"json",beforeSend:function(){j(i)},complete:function(){C(i)},method:"post",success:function(t){var e=t.fragments,t=t.message;yith_wcwl_l10n.multi_wishlist&&b(t),i.closest(".yith-wcwl-remove-button").length||k(t),void 0!==e&&D(e),c(),d("body").trigger("removed_from_wishlist",[i,n])}}),!1}),t.on("change",".yith-wcwl-popup-content .wishlist-select",function(){var t=d(this);"new"===t.val()?t.parents(".yith-wcwl-first-row").next(".yith-wcwl-second-row").show():t.parents(".yith-wcwl-first-row").next(".yith-wcwl-second-row").hide()}),t.on("change","#bulk_add_to_cart",function(){var t=d(this),e=t.closest(".wishlist_table").find("[data-row-id]").find('input[type="checkbox"]:not(:disabled)');(t.is(":checked")?e.prop("checked","checked"):e.prop("checked",!1)).change()}),t.on("submit",".wishlist-ask-an-estimate-popup",function(){var t=d(this),i=t.closest("form"),n=t.closest(".pp_content"),t=i.serializeArray().reduce((t,e)=>(t[e.name]=e.value,t),{});return t.action=yith_wcwl_l10n.actions.ask_an_estimate,t.nonce=yith_wcwl_l10n.nonce.ask_an_estimate_nonce,t.context="frontend",d.ajax({beforeSend:function(){j(i)},complete:function(){C(i)},data:t,dataType:"json",method:"post",success:function(t){var e;"undefined"!=typeof t.result&&t.result?void 0!==(e=t.template)&&(i.replaceWith(e),n.css("height","auto"),setTimeout(b,yith_wcwl_l10n.time_to_close_prettyphoto)):"undefined"!=typeof t.message&&(i.find(".woocommerce-error").remove(),i.find(".popup-description").after(d("
    ",{text:t.message,"class":"woocommerce-error"})))},url:yith_wcwl_l10n.ajax_url}),!1}),t.on("click",".yith-wfbt-add-wishlist",function(t){t.preventDefault();var i,e,n,a,o,s,t=d(this),l=d("#yith-wcwl-form");d("html, body").animate({scrollTop:l.offset().top},500),i=l,t=(l=t).attr("data-product-id"),e=d(document).find(".cart.wishlist_table"),n=e.data("pagination"),a=e.data("per-page"),o=e.data("id"),s=e.data("token"),n={action:yith_wcwl_l10n.actions.reload_wishlist_and_adding_elem_action,nonce:yith_wcwl_l10n.nonce.reload_wishlist_and_adding_elem_nonce,context:"frontend",pagination:n,per_page:a,wishlist_id:o,wishlist_token:s,add_to_wishlist:t,product_type:l.data("product-type")},T()?d.ajax({type:"POST",url:yith_wcwl_l10n.ajax_url,data:n,dataType:"html",beforeSend:function(){j(e)},complete:function(){C(e)},success:function(t){var t=d(t),e=t.find("#yith-wcwl-form"),t=t.find(".yith-wfbt-slider-wrapper");i.replaceWith(e),d(".yith-wfbt-slider-wrapper").replaceWith(t),c(),d(document).trigger("yith_wcwl_reload_wishlist_from_frequently")}}):window.alert(yith_wcwl_l10n.labels.cookie_disabled)}),t.on("submit",".yith-wcwl-popup-form",function(){return!1}),t.on("yith_infs_added_elem",function(){e()}),t.on("found_variation",function(t,e){var i=d(t.target).data("product_id"),n=e.variation_id,t=d(".yith-wcwl-add-to-wishlist").find('[data-product-id="'+i+'"]'),e=d(".yith-wcwl-add-to-wishlist").find('[data-original-product-id="'+i+'"]'),e=t.add(e),t=e.closest(".wishlist-fragment").filter(":visible");i&&n&&e.length&&(e.each(function(){var t=d(this),e=t.closest(".yith-wcwl-add-to-wishlist");t.attr("data-original-product-id",i),t.attr("data-product-id",n),e.length&&(void 0!==(t=e.data("fragment-options"))&&(t.product_id=n,e.data("fragment-options",t)),e.removeClass(function(t,e){return e.match(/add-to-wishlist-\S+/g).join(" ")}).addClass("add-to-wishlist-"+n).attr("data-fragment-ref",n))}),yith_wcwl_l10n.reload_on_found_variation)&&(j(t),P({fragments:t,firstLoad:!1}))}),t.on("reset_data",function(t){var n=d(t.target).data("product_id"),t=d('[data-original-product-id="'+n+'"]'),e=t.closest(".wishlist-fragment").filter(":visible");n&&t.length&&(t.each(function(){var t=d(this),e=t.closest(".yith-wcwl-add-to-wishlist"),i=t.attr("data-product-id");t.attr("data-product-id",n),t.attr("data-original-product-id",""),e.length&&(void 0!==(t=e.data("fragment-options"))&&(t.product_id=n,e.data("fragment-options",t)),e.removeClass("add-to-wishlist-"+i).addClass("add-to-wishlist-"+n).attr("data-fragment-ref",n))}),yith_wcwl_l10n.reload_on_found_variation)&&(j(e),P({fragments:e,firstLoad:!1}))}),t.on("yith_wcwl_reload_fragments",(t,e)=>P(e)),t.on("yith_wcwl_reload_after_ajax",c),t.on("yith_infs_added_elem",function(t,e){P({container:e,firstLoad:!1})}),t.on("yith_wcwl_fragments_loaded",function(t,e,i,n){n&&d(".variations_form").find(".variations select").last().change()}),t.on("click",".yith-wcwl-popup-feedback .close-popup",function(t){t.preventDefault(),b()}),"undefined"!=typeof yith_wcwl_l10n.enable_notices&&!yith_wcwl_l10n.enable_notices||!d(".yith-wcwl-add-to-wishlist").length||d("#yith-wcwl-popup-message").length||(t=d("
    ").attr("id","yith-wcwl-message"),t=d("
    ").attr("id","yith-wcwl-popup-message").html(t).hide(),d("body").prepend(t)),o(),r(),_(),h(),f(),d(document).on("click",".show-tab",function(t){var e=d(this),i=e.closest(".yith-wcwl-popup-content"),n=e.data("tab"),a=i.find(".tab").filter("."+n);if(t.preventDefault(),!a.length)return!1;e.addClass("active").siblings(".show-tab").removeClass("active"),a.show().siblings(".tab").hide(),"create"===n?i.prepend(''):i.find("#new_wishlist_selector").remove(),d(document).trigger("yith_wcwl_tab_selected",[n,a])}),d(document).on("change",".wishlist-select",function(){var t=d(this),e=t.closest(".yith-wcwl-popup-content"),i=t.closest(".tab"),n=e.find(".tab.create"),e=e.find(".show-tab"),a=e.filter('[data-tab="create"]');"new"===t.val()&&n.length&&(i.hide(),n.show(),e.removeClass("active"),a.addClass("active"),t.find("option:selected").prop("selected",!1),t.change())}),a(),i(),e(),n(),l=!1,yith_wcwl_l10n.is_wishlist_responsive&&d(window).on("resize",function(){var t=d(".wishlist_table.responsive"),e=t.is(".mobile"),i=window.matchMedia("(max-width: "+yith_wcwl_l10n.mobile_media_query+"px)"),n=t.closest("form"),a=n.attr("class"),n=n.data("fragment-options"),o={},s=!1;t.length&&(i.matches&&t&&!e?(n.is_mobile="yes",s=!0):!i.matches&&t&&e&&(n.is_mobile="no",s=!0),s)&&(l&&l.abort(),o[a.split(" ").join(yith_wcwl_l10n.fragments_index_glue)]=n,l=d.ajax({beforeSend:function(){j(t)},complete:function(){C(t)},data:{action:yith_wcwl_l10n.actions.load_mobile_action,nonce:yith_wcwl_l10n.nonce.load_mobile_nonce,context:"frontend",fragments:o},method:"post",success:function(t){"undefined"!=typeof t.fragments&&(D(t.fragments),c(),d(document).trigger("yith_wcwl_responsive_template",[e,t.fragments]))},url:yith_wcwl_l10n.ajax_url}))}),w(),yith_wcwl_l10n.enable_ajax_loading&&P()}).trigger("yith_wcwl_init"),d("form#yith-wcwl-form .wishlist_table .product-quantity input").on("keypress",function(t){if("13"==t.keyCode)return t.preventDefault(),!1}),d(document).ready(function(){"thumbnails"===yith_wcwl_l10n.yith_wcwl_button_position&&d(".woocommerce-product-gallery + div.yith-wcwl-add-to-wishlist").appendTo(".woocommerce-product-gallery")}),d(document).on("keydown",'#yith-wcwl-form input[name="wishlist_name"]',function(t){var e,i=t.key;["Enter","Escape"].includes(i)&&(e=d(this).closest(".wishlist-title-container"),("Enter"===i?e.find("a.save-title-form"):e.find("a.hide-title-form")).trigger("click"),t.preventDefault())}),s=d('input[name="apply_bulk_actions"]'),d(document).on("change",".product-checkbox input",t),t()});