jQuery(document).ready(function(){function t(t){var e,a;if(t instanceof jQuery.Event)(a=jQuery(t.target).closest("select")).length&&a.closest(".avada-select-wrapper").length&&r(a);else for(e=0;e<t.length;e++)a=jQuery(t[e].target),"childList"===t[e].type&&a.is("select")&&a.closest(".avada-select-wrapper").length&&r(a);function r(t){t.closest("td.value").find(".avada-color-select, .avada-button-select, .avada-image-select").each(function(){var e=jQuery(this),a=e.attr("data-value");t.find('[value="'+a+'"]').length?e.removeAttr("data-disabled"):e.attr("data-disabled",!0)})}}jQuery(".avada-select-wrapper").each(function(){var t=jQuery(this).find("select").val(),e=jQuery(this).find('[data-value="'+t+'"]'),a=jQuery(this).find("[data-checked]");e.length&&!e.is("[data-checked]")&&(a.removeAttr("data-checked"),e.attr("data-checked",!0))}),jQuery("body").on("click",".avada-color-select, .avada-image-select, .avada-button-select",function(t){var e=jQuery(this).closest(".avada-select-wrapper"),a=e.find("select"),r=jQuery(this).attr("data-value");if(e.length&&t.preventDefault(),!jQuery(this).attr("data-disabled")){if(jQuery(this).is("[data-checked]"))return e.find("[data-checked]").removeAttr("data-checked"),void a.val("").trigger("change.wc-variation-form");e.find("[data-checked]").removeAttr("data-checked"),jQuery(this).attr("data-checked",!0),a.val(r).trigger("change.wc-variation-form")}}),window.MutationObserver?new MutationObserver(t).observe(document.querySelector("body"),{attributes:!1,childList:!0,characterData:!0,subtree:!0}):jQuery("body").on("DOMNodeInserted DOMNodeRemoved",t),jQuery("body").on("check_variations",".variations_form",function(t){var e=jQuery(t.currentTarget).closest(".product").find(".product_meta").find(".sku");1<e.length&&e.each(function(){void 0===jQuery(this).attr("data-o-content-set")?(jQuery(this).attr("data-o_content",jQuery(this).text()),jQuery(this).attr("data-o-content-set",!0)):jQuery(this).closest(".fusion-layout-column").hasClass("post-card")&&jQuery(this).text(jQuery(this).attr("data-o_content"))})}),jQuery("body").on("reset_data",".variations_form",function(t){var e=jQuery(t.currentTarget).closest(".product").find(".product_meta").find(".sku");1<e.length&&jQuery(e).each(function(){jQuery(this).closest(".fusion-layout-column").hasClass("post-card")&&void 0!==jQuery(this).attr("data-o_content")&&jQuery(this).text(jQuery(this).attr("data-o_content"))})}),jQuery("body").on("click",".reset_variations",function(){jQuery(".product").find(".product_meta").find(".sku").each(function(){void 0!==jQuery(this).attr("data-o_content")&&jQuery(this).text(jQuery(this).attr("data-o_content"))}),jQuery(this).closest(".variations_form").find("[data-checked]").removeAttr("data-checked")})});