jQuery(function(a){a(document.body).on("wc_add_error_tip",function(b,c,d){var e=c.position();0==c.parent().find(".wc_error_tip").size()&&(c.after('
'+woocommerce_admin[d]+"
"),c.parent().find(".wc_error_tip").css("left",e.left+c.width()-c.width()/2-a(".wc_error_tip").width()/2).css("top",e.top+c.height()).fadeIn("100"))}).on("wc_remove_error_tip",function(a,b,c){b.parent().find(".wc_error_tip."+c).remove()}).on("click",function(){a(".wc_error_tip").fadeOut("100",function(){a(this).remove()})}).on("blur",".wc_input_decimal[type=text], .wc_input_price[type=text], .wc_input_country_iso[type=text]",function(){a(".wc_error_tip").fadeOut("100",function(){a(this).remove()})}).on("keyup change",".wc_input_price[type=text]",function(){var b=a(this).val(),c=new RegExp("[^-0-9%\\"+woocommerce_admin.mon_decimal_point+"]+","gi"),d=b.replace(c,"");b!==d?(a(this).val(d),a(document.body).triggerHandler("wc_add_error_tip",[a(this),"i18n_mon_decimal_error"])):a(document.body).triggerHandler("wc_remove_error_tip",[a(this),"i18n_mon_decimal_error"])}).on("keyup change",".wc_input_decimal[type=text]",function(){var b=a(this).val(),c=new RegExp("[^-0-9%\\"+woocommerce_admin.decimal_point+"]+","gi"),d=b.replace(c,"");b!==d?(a(this).val(d),a(document.body).triggerHandler("wc_add_error_tip",[a(this),"i18n_decimal_error"])):a(document.body).triggerHandler("wc_remove_error_tip",[a(this),"i18n_decimal_error"])}).on("keyup change",".wc_input_country_iso[type=text]",function(){var b=a(this).val(),c=new RegExp("^([A-Z])?([A-Z])$");c.test(b)?a(document.body).triggerHandler("wc_remove_error_tip",[a(this),"i18n_country_iso_error"]):(a(this).val(""),a(document.body).triggerHandler("wc_add_error_tip",[a(this),"i18n_country_iso_error"]))}).on("keyup change","#_sale_price.wc_input_price[type=text], .wc_input_price[name^=variable_sale_price]",function(){var b=a(this);if(-1!==b.attr("name").indexOf("variable"))var c=b.parents(".variable_pricing").find(".wc_input_price[name^=variable_regular_price]");else var c=a("#_regular_price");var d=parseFloat(accounting.unformat(b.val(),woocommerce_admin.mon_decimal_point)),e=parseFloat(accounting.unformat(c.val(),woocommerce_admin.mon_decimal_point));d>=e?a(document.body).triggerHandler("wc_add_error_tip",[a(this),"i18_sale_less_than_regular_error"]):a(document.body).triggerHandler("wc_remove_error_tip",[a(this),"i18_sale_less_than_regular_error"])});var b={attribute:"data-tip",fadeIn:50,fadeOut:50,delay:200};a(".tips, .help_tip").tipTip(b),a(".parent-tips").each(function(){a(this).closest("a, th").attr("data-tip",a(this).data("tip")).tipTip(b).css("cursor","help")}),a(".wc_input_table.sortable tbody").sortable({items:"tr",cursor:"move",axis:"y",scrollSensitivity:40,forcePlaceholderSize:!0,helper:"clone",opacity:.65,placeholder:"wc-metabox-sortable-placeholder",start:function(a,b){b.item.css("background-color","#f6f6f6")},stop:function(a,b){b.item.removeAttr("style")}}),a(".wc_input_table .remove_rows").click(function(){var b=a(this).closest(".wc_input_table").find("tbody");return b.find("tr.current").size()>0&&($current=b.find("tr.current"),$current.each(function(){a(this).remove()})),!1});var c=!1,d=!1,e=!1;a(document).bind("keyup keydown",function(a){d=a.shiftKey,c=a.ctrlKey||a.metaKey}),a(".wc_input_table").on("focus click","input",function(b){$this_table=a(this).closest("table"),$this_row=a(this).closest("tr"),("focus"==b.type&&e!=$this_row.index()||"click"==b.type&&a(this).is(":focus"))&&(e=$this_row.index(),d||c?d?(a("tr",$this_table).removeClass("current"),$this_row.addClass("selected_now").addClass("current"),a("tr.last_selected",$this_table).size()>0&&($this_row.index()>a("tr.last_selected, $this_table").index()?a("tr",$this_table).slice(a("tr.last_selected",$this_table).index(),$this_row.index()).addClass("current"):a("tr",$this_table).slice($this_row.index(),a("tr.last_selected",$this_table).index()+1).addClass("current")),a("tr",$this_table).removeClass("last_selected"),$this_row.addClass("last_selected")):(a("tr",$this_table).removeClass("last_selected"),c&&a(this).closest("tr").is(".current")?$this_row.removeClass("current"):$this_row.addClass("current").addClass("last_selected")):(a("tr",$this_table).removeClass("current").removeClass("last_selected"),$this_row.addClass("current").addClass("last_selected")),a("tr",$this_table).removeClass("selected_now"))}).on("blur","input",function(){e=!1}),a(".woocommerce_page_wc-settings .shippingrows tbody tr:even").addClass("alternate"),a("select.availability").change(function(){"all"==a(this).val()?a(this).closest("tr").next("tr").hide():a(this).closest("tr").next("tr").show()}).change(),a(document.body).on("click",".show_order_items",function(){return a(this).closest("td").find("table").toggle(),!1}),a(".hide_options_if_checked").each(function(){a(this).find("input:eq(0)").change(function(){a(this).is(":checked")?a(this).closest("fieldset, tr").nextUntil(".hide_options_if_checked, .show_options_if_checked",".hidden_option").hide():a(this).closest("fieldset, tr").nextUntil(".hide_options_if_checked, .show_options_if_checked",".hidden_option").show()}).change()}),a(".show_options_if_checked").each(function(){a(this).find("input:eq(0)").change(function(){a(this).is(":checked")?a(this).closest("fieldset, tr").nextUntil(".hide_options_if_checked, .show_options_if_checked",".hidden_option").show():a(this).closest("fieldset, tr").nextUntil(".hide_options_if_checked, .show_options_if_checked",".hidden_option").hide()}).change()}),a("input#woocommerce_demo_store").change(function(){a(this).is(":checked")?a("#woocommerce_demo_store_notice").closest("tr").show():a("#woocommerce_demo_store_notice").closest("tr").hide()}).change(),a("table.attributes-table tbody tr:nth-child(odd)").addClass("alternate"),"undefined"!=typeof woocommerce_admin&&"undefined"!=typeof woocommerce_admin.qrcode_key&&a("#qrcode_small").qrcode({text:woocommerce_admin.qrcode_key,width:90,height:90})});