jQuery(function(e){if("undefined"==typeof wc_address_i18n_params)return!1;var a=wc_address_i18n_params.locale.replace(/&quot;/g,'"'),i=JSON.parse(a);function d(e,a){a?(e.find("label .optional").remove(),e.addClass("validate-required"),0===e.find('label .required[aria-hidden="true"]').length&&e.find("label").append('&nbsp;<span class="required" aria-hidden="true">*</span>')):(e.find("label .required").remove(),e.removeClass("validate-required woocommerce-invalid woocommerce-invalid-required-field"),0===e.find("label .optional").length&&e.find("label").append('&nbsp;<span class="optional">('+wc_address_i18n_params.i18n_optional_text+")</span>"))}e(document.body).on("country_to_state_changing",function(a,r,t){var l,n=t;l="undefined"!=typeof i[r]?i[r]:i["default"];var o=n.find("#billing_postcode_field, #shipping_postcode_field, #calc_shipping_postcode_field"),s=n.find("#billing_city_field, #shipping_city_field, #calc_shipping_city_field"),p=n.find("#billing_state_field, #shipping_state_field, #calc_shipping_state_field");o.attr("data-o_class")||(o.attr("data-o_class",o.attr("class")),s.attr("data-o_class",s.attr("class")),p.attr("data-o_class",p.attr("class")));var c=JSON.parse(wc_address_i18n_params.locale_fields);e.each(c,function(a,r){var t=n.find(r),o=e.extend(!0,{},i["default"][a],l[a]);"undefined"!=typeof o.label&&t.find("label").html(o.label),"undefined"!=typeof o.placeholder&&(t.find(":input").attr("placeholder",o.placeholder),t.find(":input").attr("data-placeholder",o.placeholder),t.find(".select2-selection__placeholder").text(o.placeholder)),"undefined"!=typeof o.placeholder||"undefined"==typeof o.label||t.find("label:not(.screen-reader-text)").length||(t.find(":input").attr("placeholder",o.label),t.find(":input").attr("data-placeholder",o.label),t.find(".select2-selection__placeholder").text(o.label)),"undefined"!=typeof o.required?d(t,o.required):d(t,!1),"undefined"!=typeof o.priority&&t.data("priority",o.priority),"state"!==a&&("undefined"!=typeof o.hidden&&!0===o.hidden?t.hide().find(":input").val(""):t.show()),Array.isArray(o["class"])&&(t.removeClass("form-row-first form-row-last form-row-wide"),t.addClass(o["class"].join(" ")))}),e(".woocommerce-billing-fields__field-wrapper,.woocommerce-shipping-fields__field-wrapper,.woocommerce-address-fields__field-wrapper,.woocommerce-additional-fields__field-wrapper .woocommerce-account-fields").each(function(a,i){var d=e(i).find(".form-row"),r=d.first().parent(),t=0;d.each(function(){e(this).data("priority")||e(this).data("priority",t+1),t=e(this).data("priority")}),d.sort(function(a,i){var d=parseInt(e(a).data("priority"),10),r=parseInt(e(i).data("priority"),10);return d>r?1:d<r?-1:0}),d.detach().appendTo(r)})}).trigger("wc_address_i18n_ready")});
!function(e){"use strict";window.wc=window.wc||{},window.wc.customPlaceOrderButton=window.wc.customPlaceOrderButton||{},function(){var e="wc-custom-place-order-button-styles";if(!document.getElementById(e)){var t=document.createElement("style");t.id=e,t.textContent="form.has-custom-place-order-button #place_order { display: none !important; }",document.head.appendChild(t)}}();var t={},o=null,r=null;function n(){return e("form.checkout").length?e("form.checkout").first():e("#order_review").length?e("#order_review").first():e("#add_payment_method").length?e("#add_payment_method").first():e([])}function c(e){return-1!==("undefined"!=typeof wc_checkout_params&&wc_checkout_params.gateways_with_custom_place_order_button?wc_checkout_params.gateways_with_custom_place_order_button:"undefined"!=typeof wc_add_payment_method_params&&wc_add_payment_method_params.gateways_with_custom_place_order_button?wc_add_payment_method_params.gateways_with_custom_place_order_button:[]).indexOf(e)}function a(){r&&r.length&&(r.remove(),r=null)}window.wc.customPlaceOrderButton.register=function(o,r){t[o]||("string"==typeof o&&o?"object"==typeof r&&null!==r?"function"==typeof r.render?"function"==typeof r.cleanup?(t[o]=r,n().find('input[name="payment_method"]:checked').val()===o&&e(document.body).trigger("wc_custom_place_order_button_registered",[o])):console.error("wc.customPlaceOrderButton.register: cleanup must be a function"):console.error("wc.customPlaceOrderButton.register: render must be a function"):console.error("wc.customPlaceOrderButton.register: config must be an object"):console.error("wc.customPlaceOrderButton.register: gatewayId must be a non-empty string"))},window.wc.customPlaceOrderButton.__maybeShow=function(u,d){var s=n();if(o&&t[o])try{t[o].cleanup()}catch(i){console.error("Error in custom place order button cleanup:",i)}if(Boolean(t[u])){s.addClass("has-custom-place-order-button"),o=u;var l=function(){if(r&&r.length&&e.contains(document,r[0]))return r;var t=n().find("#place_order");return t.length?(r=e('<div class="wc-custom-place-order-button"></div>'),t.after(r),r):e([])}();l.empty();try{t[u].render(l.get(0),d)}catch(i){console.error("Error rendering custom place order button:",i)}}else c(u)||s.removeClass("has-custom-place-order-button"),o=null,a()},window.wc.customPlaceOrderButton.__maybeHideDefaultButtonOnInit=function(e){c(e)&&n().addClass("has-custom-place-order-button")},window.wc.customPlaceOrderButton.__cleanup=function(){if(o&&t[o])try{t[o].cleanup()}catch(e){console.error("Error in custom place order button cleanup:",e)}a(),o=null},window.wc.customPlaceOrderButton.__getForm=n}(jQuery);