'use strict';var woof_redirect='';var woof_reset_btn_action=!1;var woof_additional_fields={};jQuery(function(){try{woof_current_values=JSON.parse(woof_current_values)}catch(e){woof_current_values=null} if(woof_current_values==null||woof_current_values.length==0){woof_current_values={}}});if(typeof woof_lang_custom=='undefined'){var woof_lang_custom={};/*!!important*/ } if(typeof woof_ext_filter_titles!='undefined'){woof_lang_custom=Object.assign({},woof_lang_custom,woof_ext_filter_titles)} jQuery(function($){jQuery('body').append('');jQuery.extend(jQuery.fn,{within:function(pSelector){return this.filter(function(){return jQuery(this).closest(pSelector).length})},});let forms=document.querySelectorAll('.woof[data-slug]');if(forms.length){forms.forEach((f)=>{if(f.dataset.slug.length>0){swoof_search_slug=f.dataset.slug}})} if(jQuery('#woof_results_by_ajax').length>0){woof_is_ajax=1} woof_autosubmit=parseInt(jQuery('.woof').eq(0).data('autosubmit'),10);woof_ajax_redraw=parseInt(jQuery('.woof').eq(0).data('ajax-redraw'),10);woof_ext_init_functions=JSON.parse(woof_ext_init_functions);woof_init_native_woo_price_filter();jQuery('body').on('price_slider_change',function(event,min,max){if(woof_autosubmit&&!woof_show_price_search_button&&jQuery('.price_slider_wrapper').length<3){jQuery('.woof .widget_price_filter form').trigger('submit')}else{var min_price=jQuery(this).find('.price_slider_amount #min_price').val();var max_price=jQuery(this).find('.price_slider_amount #max_price').val();woof_current_values.min_price=min_price;woof_current_values.max_price=max_price}});jQuery('body').on('change','.woof_price_filter_dropdown',function(){var val=jQuery(this).val();if(parseInt(val,10)==-1){delete woof_current_values.min_price;delete woof_current_values.max_price}else{var val=val.split('-');woof_current_values.min_price=val[0];woof_current_values.max_price=val[1]} if(woof_autosubmit||jQuery(this).within('.woof').length==0){woof_submit_link(woof_get_submit_link())}});woof_recount_text_price_filter();jQuery('body').on('change','.woof_price_filter_txt',function(){var from=parseInt(jQuery(this).parent().find('.woof_price_filter_txt_from').val(),10);var to=parseInt(jQuery(this).parent().find('.woof_price_filter_txt_to').val(),10);if(to0){woof_shop_page=woof_current_page_link=woof_redirect} return woof_redirect}}}catch(e){console.log(e)}} function woof_init_orderby(){jQuery('body').on('submit','form.woocommerce-ordering',function(){if(!jQuery('#is_woo_shortcode').length){return!1}});jQuery('body').on('change','form.woocommerce-ordering select.orderby',function(){if(!jQuery('#is_woo_shortcode').length){woof_current_values.orderby=jQuery(this).val();woof_ajax_page_num=1;woof_submit_link(woof_get_submit_link(),0);return!1}})} function woof_init_reset_button(){jQuery('body').on('click','.woof_reset_search_form',function(){woof_ajax_page_num=1;woof_ajax_redraw=0;woof_reset_btn_action=!0;if(woof_is_permalink){woof_current_values={};woof_submit_link(woof_get_submit_link().split('page/')[0])}else{var link=woof_shop_page;if(woof_current_values.hasOwnProperty('page_id')){link=location.protocol+'//'+location.host+'/?page_id='+woof_current_values.page_id;woof_current_values={page_id:woof_current_values.page_id};woof_get_submit_link()} woof_submit_link(link);if(woof_is_ajax){history.pushState({},'',link);if(woof_current_values.hasOwnProperty('page_id')){woof_current_values={page_id:woof_current_values.page_id,}}else{woof_current_values={}}}} return!1})} function woof_init_pagination(){if(woof_is_ajax===1){jQuery('body').on('click','.woocommerce-pagination a.page-numbers',function(){var l=jQuery(this).attr('href');if(woof_ajax_first_done){var res=l.split('paged=');if(typeof res[1]!=='undefined'){woof_ajax_page_num=parseInt(res[1])}else{woof_ajax_page_num=1} var res2=l.split('product-page=');if(typeof res2[1]!=='undefined'){woof_ajax_page_num=parseInt(res2[1])}}else{var res=l.split('page/');if(typeof res[1]!=='undefined'){woof_ajax_page_num=parseInt(res[1])}else{woof_ajax_page_num=1} var res2=l.split('product-page=');if(typeof res2[1]!=='undefined'){woof_ajax_page_num=parseInt(res2[1])}} {woof_submit_link(woof_get_submit_link(),0)} return!1})}} function woof_init_search_form(){woof_init_checkboxes();woof_init_mselects();woof_init_radios();woof_price_filter_radio_init();woof_init_selects();if(woof_ext_init_functions!==null){jQuery.each(woof_ext_init_functions,function(type,func){eval(func+'()')})} jQuery('.woof_submit_search_form').on('click',function(){if(woof_ajax_redraw){woof_ajax_redraw=0;woof_is_ajax=0} woof_submit_link(woof_get_submit_link());return!1});jQuery('ul.woof_childs_list').parent('li').addClass('woof_childs_list_li');woof_remove_class_widget();woof_checkboxes_slide();document.dispatchEvent(new CustomEvent('woof_init_search_form',{detail:{}}))} var woof_submit_link_locked=!1;function woof_submit_link(link,ajax_redraw){if(woof_submit_link_locked){return} if(typeof WoofTurboMode!='undefined'){WoofTurboMode.woof_submit_link(link);return} if(typeof ajax_redraw=='undefined'){ajax_redraw=woof_ajax_redraw} woof_submit_link_locked=!0;woof_show_info_popup(woof_lang_loading);if(woof_is_ajax===1&&!ajax_redraw){woof_ajax_first_done=!0;var data={action:'woof_draw_products',link:link,page:woof_ajax_page_num,shortcode:jQuery('#woof_results_by_ajax').data('shortcode'),woof_shortcode:jQuery('div.woof').data('shortcode'),nonce_filter:woof_front_nonce,};jQuery.post(woof_ajaxurl,data,function(content){content=JSON.parse(content);woof_before_ajax_form_redrawing();if(jQuery('.woof_results_by_ajax_shortcode').length){if(typeof content.products!='undefined'){jQuery('#woof_results_by_ajax').replaceWith(content.products);var found_count=jQuery('.woof_found_count');jQuery(found_count).show();if(found_count.length>0){var count_prod=jQuery('#woof_results_by_ajax').data('count');if(typeof count_prod!='undefined'){jQuery(found_count).text(count_prod)}}}}else{if(typeof content.products!='undefined'){jQuery('.woof_shortcode_output').replaceWith(content.products)}} if(typeof content.additional_fields!='undefined'){jQuery.each(content.additional_fields,function(selector,html_data){if(typeof woof_additional_fields[selector]=='undefined'){woof_additional_fields[selector]=jQuery(selector)} jQuery(selector).replaceWith(html_data)});jQuery.each(woof_additional_fields,function(selector,html_data_old){if(typeof content.additional_fields[selector]=='undefined'){jQuery(selector).replaceWith(html_data_old)}})} jQuery('div.woof_redraw_zone').replaceWith(jQuery(content.form).find('.woof_redraw_zone'));woof_draw_products_top_panel();woof_mass_reinit();woof_submit_link_locked=!1;jQuery.each(jQuery('#woof_results_by_ajax'),function(index,item){if(index==0){return} jQuery(item).removeAttr('id')});jQuery('.woof').removeClass('woof_show_filter_for_mobile');woof_infinite();woof_js_after_ajax_done();woof_change_link_addtocart();woof_init_tooltip();document.dispatchEvent(new CustomEvent('woof-ajax-form-redrawing',{detail:{link:link,},}))})}else{if(ajax_redraw){var data={action:'woof_draw_products',link:link,page:1,shortcode:'woof_nothing',woof_shortcode:jQuery('div.woof').eq(0).data('shortcode'),nonce_filter:woof_front_nonce,};jQuery.post(woof_ajaxurl,data,function(content){woof_before_ajax_form_redrawing();content=JSON.parse(content);jQuery('div.woof_redraw_zone').replaceWith(jQuery(content.form).find('.woof_redraw_zone'));woof_mass_reinit();woof_submit_link_locked=!1;woof_init_tooltip();document.dispatchEvent(new CustomEvent('woof-ajax-form-redrawing',{detail:{link:link,},}))})}else{window.location=link;woof_show_info_popup(woof_lang_loading)}}} function woof_remove_empty_elements(){jQuery.each(jQuery('.woof_container select'),function(index,select){var size=jQuery(select).find('option').length;if(size===0){jQuery(select).parents('.woof_container').remove()}});jQuery.each(jQuery('ul.woof_list'),function(index,ch){var size=jQuery(ch).find('li').length;if(size===0){jQuery(ch).parents('.woof_container').remove()}});jQuery.each(jQuery('.woof_container .woof_list_sd'),function(index,ch){var size=jQuery(ch).find('.woof-sd-ie').length;if(size===0){jQuery(ch).parents('.woof_container').remove()}})} function woof_get_submit_link(){if(woof_is_ajax){woof_current_values.page=woof_ajax_page_num} if(Object.keys(woof_current_values).length>0){jQuery.each(woof_current_values,function(index,value){if(index==swoof_search_slug){delete woof_current_values[index]} if(index=='s'){delete woof_current_values[index]} if(index=='product'){delete woof_current_values[index]} if(index=='really_curr_tax'){delete woof_current_values[index]}})} if(Object.keys(woof_current_values).length===2){if('min_price' in woof_current_values&&'max_price' in woof_current_values){woof_current_page_link=woof_current_page_link.replace(new RegExp(/page\/(\d+)/),'');var l=woof_current_page_link+'?min_price='+woof_current_values.min_price+'&max_price='+woof_current_values.max_price;if(woof_is_ajax){history.pushState({},'',l)} return l}} if(Object.keys(woof_current_values).length===0){if(woof_is_ajax){history.pushState({},'',woof_current_page_link)} return woof_current_page_link} if(Object.keys(woof_really_curr_tax).length>0){woof_current_values.really_curr_tax=woof_really_curr_tax.term_id+'-'+woof_really_curr_tax.taxonomy} var link=woof_current_page_link+'?'+swoof_search_slug+'=1';if(!woof_is_permalink){if(woof_redirect.length>0){link=woof_redirect+'?'+swoof_search_slug+'=1';if(woof_current_values.hasOwnProperty('page_id')){delete woof_current_values.page_id}}else{link=location.protocol+'//'+location.host+'?'+swoof_search_slug+'=1'}} var woof_exclude_accept_array=['path'];if(Object.keys(woof_current_values).length>0){jQuery.each(woof_current_values,function(index,value){if(index=='page'&&woof_is_ajax){index='paged'} if(index=='product-page'){return} if(typeof value!=='undefined'){if((typeof value&&value.length>0)||typeof value=='number'){if(jQuery.inArray(index,woof_exclude_accept_array)==-1){link=link+'&'+index+'='+value}}}})} link=link.replace(new RegExp(/page\/(\d+)/),'');if(woof_is_ajax){history.pushState({},'',link)} return link} function woof_show_info_popup(text){if(woof_overlay_skin=='default'){jQuery('#woof_html_buffer').text(text);jQuery('#woof_html_buffer').fadeTo(200,0.9)}else{switch(woof_overlay_skin){case 'loading-balls':case 'loading-bars':case 'loading-bubbles':case 'loading-cubes':case 'loading-cylon':case 'loading-spin':case 'loading-spinning-bubbles':case 'loading-spokes':jQuery('body').plainOverlay('show',{progress:function(){return jQuery('
')},});break;default:jQuery('body').plainOverlay('show',{duration:-1});break}}} function woof_hide_info_popup(){if(woof_overlay_skin=='default'){window.setTimeout(function(){jQuery('#woof_html_buffer').fadeOut(400)},200)}else{jQuery('body').plainOverlay('hide')}} function woof_draw_products_top_panel(){if(woof_is_ajax){jQuery('#woof_results_by_ajax').prev('.woof_products_top_panel').remove()} var panel=jQuery('.woof_products_top_panel');panel.html('');if(Object.keys(woof_current_values).length>0){panel.show();panel.html('');panel.find('ul').attr('class','woof_products_top_panel_ul');var is_price_in=!1;jQuery.each(woof_current_values,function(index,value){if(jQuery.inArray(index,woof_accept_array)==-1&&jQuery.inArray(index.replace('rev_',''),woof_accept_array)==-1){return} if((index=='min_price'||index=='max_price')&&is_price_in){return} if((index=='min_price'||index=='max_price')&&!is_price_in){is_price_in=!0;index='price';value=woof_lang_pricerange} var is_range=!1;var range_txt=jQuery("input[data-anchor='woof_n_"+index+"_all_range']").val();if(typeof range_txt!='undefined'){is_range=!0} value=value.toString().trim();if(value.search(',')){value=value.split(',')} if(!is_range){jQuery.each(value,function(i,v){if(index=='page'){return} if(index=='post_type'){return} var txt=v;if(index=='orderby'){if(woof_lang[v]!==undefined){txt=woof_lang.orderby+': '+woof_lang[v]}else{txt=woof_lang.orderby+': '+v}}else if(index=='perpage'){txt=woof_lang.perpage}else if(index=='price'){txt=woof_lang.pricerange}else{var is_in_custom=!1;if(Object.keys(woof_lang_custom).length>0){jQuery.each(woof_lang_custom,function(i,tt){if(i==index){is_in_custom=!0;txt=tt;if(index=='woof_sku'){txt+=' '+v}}})} if(!is_in_custom){try{txt=jQuery("input[data-anchor='woof_n_"+index+'_'+v+"']").val()}catch(e){console.log(e)} if(typeof txt==='undefined'){txt=v}}} if(typeof woof_filter_titles[index]!='undefined'){var cont_item=panel.find('ul.woof_products_top_panel_ul li ul[data-container='+index+']');if(cont_item.length){cont_item.append(jQuery('
  • ').append(jQuery('').attr('href','').attr('data-tax',index).attr('data-slug',v).attr('rel','nofollow').append(jQuery('').attr('class','woof_remove_ppi').append(txt))))}else{panel.find('ul.woof_products_top_panel_ul').append(jQuery('
  • ').append(jQuery('