(n=>{woodmartThemeModule.menuDropdownsAJAX=function(){woodmartThemeModule.$body.on("mousemove",function(){n(".menu").has(".dropdown-load-ajax").each(function(){var o=n(this);if(!o.hasClass("dropdowns-loading")&&!o.hasClass("dropdowns-loaded")){var a=o,d=(a.addClass("dropdowns-loading"),woodmart_settings.menu_storage_key+"_"+a.attr("id")),o=!1,e=a.find(".dropdown-load-ajax"),t=[];if(e.each(function(){var o=n(this).find(".dropdown-html-placeholder");0<o.length&&t.push(o.data("id"))}),woodmart_settings.ajax_dropdowns_save&&woodmartThemeModule.supports_html5_storage){e=localStorage.getItem(d);try{o=JSON.parse(e)}catch(o){console.log("cant parse Json",o)}}function s(o){Object.keys(o).forEach(function(d){woodmartThemeModule.removeDuplicatedStylesFromHTML(o[d],function(o){a.find('[data-id="'+d+'"]').replaceWith(o),a.addClass("dropdowns-loaded"),setTimeout(function(){a.removeClass("dropdowns-loading")},1e3)})}),setTimeout(function(){woodmartThemeModule.$document.trigger("wdLoadDropdownsSuccess")},500)}o?s(o):0===t.length?(a.addClass("dropdowns-loaded"),a.removeClass("dropdowns-loading")):n.ajax({url:woodmart_settings.ajaxurl,data:{action:"woodmart_load_html_dropdowns",ids:t},dataType:"json",method:"POST",success:function(o){if("success"===o.status){if(s(o.data),woodmart_settings.ajax_dropdowns_save&&woodmartThemeModule.supports_html5_storage)try{localStorage.setItem(d,JSON.stringify(o.data))}catch(o){}}else console.log("loading html dropdowns returns wrong data - ",o.message)},error:function(){console.log("loading html dropdowns ajax error")}})}})})},n(document).ready(function(){woodmartThemeModule.menuDropdownsAJAX()})})(jQuery);