jQuery(function(a){function e(){this.init()}e.prototype.init=function(){a(document.body).on("payment_method_selected",this.payment_method_selected.bind(this)),a(document.body).on("change",'[name="payment_method"]',this.payment_method_selected.bind(this)),a(document.body).on("updated_checkout",this.updated_checkout.bind(this)),a(document.body).on("change",".wc-stripe-payment-type",this.payment_type_change.bind(this)),a(document.body).on("updated_wc_div, updated_cart_totals",this.cart_html.bind(this)),this.saved_payment_methods(),"MutationObserver"in window&&null!==document.querySelector("form.checkout")&&new MutationObserver(this.observer_callback.bind(this)).observe(document.querySelector("form.checkout"),{attributes:!1,childList:!0,subtree:!0}),a(document.body).is(".woocommerce-cart")&&(a(window).on("resize",this.cart_html),this.cart_html())},e.prototype.observer_callback=function(e,t){try{if(0<e.length)for(var o=0;o<e.length;o++)if(e[o].addedNodes&&0<e[o].addedNodes.length)for(var n=e[o].addedNodes,s=0;s<n.length;s++)"UL"===n[s].nodeName&&n[s].classList&&n[s].classList.value.indexOf("payment_methods")&&(a("select.wc-stripe-saved-methods").removeClass("enhanced"),a("select.wc-stripe-saved-methods + .select2").remove(),this.saved_payment_methods())}catch(d){}},e.prototype.payment_method_selected=function(){var e=this.get_payment_method();a(document.body).triggerHandler("wc_stripe_payment_method_selected",e)},e.prototype.updated_checkout=function(){this.saved_payment_methods(),a(document.body).hasClass("woocommerce-checkout")&&a(".payment_methods").width()<475&&a(".payment_methods").addClass("stripe-small")},e.prototype.payment_type_change=function(){var e=this.get_payment_method(),t=a('[name="'+e+'_payment_type_key"]:checked');0===t.length||"new"===t.val()?(a(".wc-"+e+"-saved-methods-container").slideUp(400,function(){a(".wc-"+e+"-new-method-container").slideDown(400)}),a(document.body).triggerHandler("wc_stripe_new_method_"+e)):(a(".wc-"+e+"-new-method-container").slideUp(400,function(){a(".wc-"+e+"-saved-methods-container").slideDown(400)}),a(document.body).triggerHandler("wc_stripe_saved_method_"+e))},e.prototype.saved_payment_methods=function(){a().selectWoo&&a("select.wc-stripe-saved-methods").length&&!a("select.wc-stripe-saved-methods").hasClass("enhanced")&&a("select.wc-stripe-saved-methods").selectWoo({width:"100%",templateResult:this.output_template,templateSelection:this.output_template,language:{noResults:function(){return wc_stripe_form_handler_params.no_results}.bind(this)}}).addClass("enhanced").trigger("change")},e.prototype.get_payment_method=function(){return a('[name="payment_method"]:checked').val()},e.prototype.get_payment_type=function(e){return a('[name="'+e+'"]:checked').val()},e.prototype.output_template=function(e,t){var o=a(e.element).attr("class");return a.each(a(e.element).parent().find("option"),function(){a(t).removeClass(a(this).attr("class"))}),a(t).addClass("wc-stripe-select2-container "+o),a(document.body).triggerHandler("wc_stripe_payment_method_template",[e,t]),e.text},e.prototype.cart_html=function(){var e=a(".checkout-button"),t=e.outerWidth();t&&a(".wc_stripe_cart_payment_methods").length&&a(".wc_stripe_cart_payment_methods ").width(t),"none"!==e.css("float")&&a(".wc_stripe_cart_payment_methods ").css("float",e.css("float"))},new e});
!function(a,r){a.wc_stripe={product_gateways:[]};var i=null,s=("undefined"==typeof wc_stripe_checkout_fields&&(a.wc_stripe_checkout_fields=[]),wc_stripe.BaseGateway=function(t,e){this.params=t,this.gateway_id=this.params.gateway_id,this.container=void 0===e?"li.payment_method_".concat(this.gateway_id):e,r(this.container).length||(this.container=".payment_method_".concat(this.gateway_id)),this.token_selector=this.params.token_selector,this.saved_method_selector=this.params.saved_method_selector,this.payment_token_received=!1,this.stripe=i,this.fields=o,this.elements=this.create_stripe_elements(),this.initialize()},wc_stripe.BaseGateway.prototype.create_stripe_elements=function(){return i.elements(r.extend({},{locale:"auto"},this.get_element_options()))},wc_stripe.BaseGateway.prototype.is_user_logged_in=function(){return 0<this.params.user_id},wc_stripe.BaseGateway.prototype.get_page=function(){var t=wc_stripe_params_v3.page;return t="cart"===t&&r(document.body).is(".woocommerce-checkout")?"checkout":t},wc_stripe.BaseGateway.prototype.set_nonce=function(t){this.fields.set(this.gateway_id+"_token_key",t),r(this.token_selector).val(t)},wc_stripe.BaseGateway.prototype.set_intent=function(t){this.fields.set(this.gateway_id+"_payment_intent_key",t),r("#"+this.gateway_id+"_payment_intent_key").val(t)},wc_stripe.BaseGateway.prototype.get_element_options=function(){return{}},wc_stripe.BaseGateway.prototype.initialize=function(){},wc_stripe.BaseGateway.prototype.create_button=function(){},wc_stripe.BaseGateway.prototype.is_gateway_selected=function(){return r('[name="payment_method"]:checked').val()===this.gateway_id},wc_stripe.BaseGateway.prototype.is_saved_method_selected=function(){return this.is_gateway_selected()&&"saved"===r('[name="'+this.gateway_id+'_payment_type_key"]:checked').val()},wc_stripe.BaseGateway.prototype.has_checkout_error=function(){return 0<r("#wc_stripe_checkout_error").length&&this.is_gateway_selected()},wc_stripe.BaseGateway.prototype.submit_error=function(t,e){var i;((a=this.get_error_message(t)).indexOf("</ul>")<0||Array.isArray(t))&&(a='<div class="'+function(){var t="woocommerce-NoticeGroup";return this.is_current_page("checkout")&&(t+=" woocommerce-NoticeGroup-checkout"),t}.bind(this)()+'"><ul class="woocommerce-error">'+(s=a,i="",Array.isArray(s)?s.forEach(function(t){i+="<li>"+t+"</li>"}):i+="<li>"+s+"</li>",i)+"</ul></div>");var s=r(document.body).triggerHandler("wc_stripe_submit_error",[a,t,this]),a=void 0===s?a:s;this.submit_message(a,e)},wc_stripe.BaseGateway.prototype.submit_error_code=function(t){console.log(t)},wc_stripe.BaseGateway.prototype.get_error_message=function(t){return Array.isArray(t)||"object"==typeof t&&(t.hasOwnProperty("message")&&(-1<t.message.indexOf("server_side_confirmation_beta=v1")?t.code="server_side_confirmation_beta":-1<t.message.indexOf("params.payment_method_data.billing_details.phone")&&(t.code="phone_required")),t=t.code&&wc_stripe_messages[t.code]?wc_stripe_messages[t.code]:t.message),t},wc_stripe.BaseGateway.prototype.submit_message=function(t,e){r(".woocommerce-NoticeGroup-checkout, .woocommerce-error, .woocommerce-message").remove();var i=r(this.message_container);i.length&&(e||!i.closest("form").length)||(i=(i=i.length?i:r(this.container)).closest("form")),r().unblock&&(this.unblock(),i.unblock()),!1!==r(document.body).triggerHandler("wc_stripe_error_message_enabled",[!0,t,i])&&(i.prepend(t),r("form.checkout").removeClass("processing"),i.removeClass("processing"),i.find(".input-text, select, input:checkbox").trigger("blur"),r.scroll_to_notices?r.scroll_to_notices(i):r("html, body").animate({scrollTop:i.offset().top-100},1e3)),r(document.body).trigger("wc_stripe_error_message",[t,i,this])},wc_stripe.BaseGateway.prototype.get_billing_details=function(){var t=this.get_billing_prefix(),t={name:this.get_customer_name(t),address:{city:this.fields.get(t+"_city",null),country:this.fields.get(t+"_country",null),line1:this.fields.get(t+"_address_1",null),line2:this.fields.get(t+"_address_2",null),postal_code:this.fields.get(t+"_postcode",null),state:this.fields.get(t+"_state",null)}};return t.name&&" "!==t.name||delete t.name,""!=this.fields.get("billing_email")&&(t.email=this.fields.get("billing_email")),""!=this.fields.get("billing_phone")&&(t.phone=this.fields.get("billing_phone")),t},wc_stripe.BaseGateway.prototype.get_first_name=function(t){return r("#"+t+"_first_name").val()},wc_stripe.BaseGateway.prototype.get_last_name=function(t){return r("#"+t+"_last_name").val()},wc_stripe.BaseGateway.prototype.get_shipping_prefix=function(){return this.needs_shipping()&&0<r('[name="ship_to_different_address"]').length&&r('[name="ship_to_different_address"]').is(":checked")?"shipping":"billing"},wc_stripe.BaseGateway.prototype.get_billing_prefix=function(){var t="billing",e=(r('[name="billing_same_as_shipping"]').length&&!r('[name="billing_same_as_shipping"]').is(":checked")&&(t="shipping"),r('[name="bill_to_different_address"]').length&&(1<r('[name="bill_to_different_address"]').length?"same_as_shipping"===r('[name="bill_to_different_address"]:checked').val()&&(t="shipping"):r('[name="bill_to_different_address"]').is(":checked")||(t="shipping")),r(document.body).triggerHandler("wc_stripe_get_billing_prefix",[t]));return void 0===e?t:e},wc_stripe.BaseGateway.prototype.should_save_method=function(){return r("#"+this.gateway_id+"_save_source_key").is(":checked")},wc_stripe.BaseGateway.prototype.is_add_payment_method_page=function(){return"add_payment_method"===this.get_page()||r(document.body).hasClass("woocommerce-add-payment-method")},wc_stripe.BaseGateway.prototype.is_change_payment_method=function(){return"change_payment_method"===this.get_page()},wc_stripe.BaseGateway.prototype.get_selected_payment_method=function(){return r(this.saved_method_selector).val()},wc_stripe.BaseGateway.prototype.needs_shipping=function(){return this.get_gateway_data().needs_shipping},wc_stripe.BaseGateway.prototype.get_currency=function(){return this.get_gateway_data().currency},wc_stripe.BaseGateway.prototype.get_gateway_data=function(){var t=r(this.container).find(".woocommerce_".concat(this.gateway_id,"_gateway_data")).data("gateway");return t=void 0===t&&this.is_current_page("checkout")&&void 0===(t=r("form.checkout").find(".woocommerce_".concat(this.gateway_id,"_gateway_data")).data("gateway"))?r(".woocommerce_"+this.gateway_id+"_gateway_data").data("gateway"):t},wc_stripe.BaseGateway.prototype.set_gateway_data=function(t){r(this.container).find(".woocommerce_".concat(this.gateway_id,"_gateway_data")).data("gateway",t)},wc_stripe.BaseGateway.prototype.has_gateway_data=function(){return void 0!==this.get_gateway_data()},wc_stripe.BaseGateway.prototype.get_customer_name=function(t){return this.fields.get(t+"_first_name")+" "+this.fields.get(t+"_last_name")},wc_stripe.BaseGateway.prototype.get_customer_email=function(){return this.fields.get("billing_email")},wc_stripe.BaseGateway.prototype.get_address_field_hash=function(t){for(var e=["_first_name","_last_name","_address_1","_address_2","_postcode","_city","_state","_country"],i="",s=0;s<e.length;s++)i+=this.fields.get(t+e[s])+"_";return i},wc_stripe.BaseGateway.prototype.block=function(){r().block&&r.blockUI({message:null,overlayCSS:{background:"#fff",opacity:.6}})},wc_stripe.BaseGateway.prototype.unblock=function(){r().block&&r.unblockUI()},wc_stripe.BaseGateway.prototype.get_form=function(){return r(this.token_selector).closest("form")},wc_stripe.BaseGateway.prototype.get_total_price=function(){return this.get_gateway_data().total},wc_stripe.BaseGateway.prototype.get_total_price_cents=function(){return this.get_gateway_data().total_cents},wc_stripe.BaseGateway.prototype.set_total_price=function(t){var e=this.get_gateway_data();e.total=t,this.set_gateway_data(e)},wc_stripe.BaseGateway.prototype.set_total_price_cents=function(t){var e=this.get_gateway_data();e.total_cents=t,this.set_gateway_data(e)},wc_stripe.BaseGateway.prototype.set_payment_method=function(t){r('[name="payment_method"][value="'+t+'"]').prop("checked",!0).trigger("click")},wc_stripe.BaseGateway.prototype.set_selected_shipping_methods=function(t){if(this.fields.set("shipping_method",t),t&&r('[name^="shipping_method"]').length)for(var e in t){var i=t[e];r('[name="shipping_method['+e+']"][value="'+i+'"]').prop("checked",!0).trigger("change")}},wc_stripe.BaseGateway.prototype.on_token_received=function(t){this.payment_token_received=!0,this.set_nonce(t.id),this.process_checkout()},wc_stripe.BaseGateway.prototype.createPaymentRequest=function(){try{this.payment_request_options=this.get_payment_request_options(),this.paymentRequest=i.paymentRequest(this.payment_request_options),this.payment_request_options.requestShipping&&(this.paymentRequest.on("shippingaddresschange",this.update_shipping_address.bind(this)),this.paymentRequest.on("shippingoptionchange",this.update_shipping_method.bind(this))),this.paymentRequest.on("paymentmethod",this.on_payment_method_received.bind(this))}catch(t){this.submit_error(t.message)}},wc_stripe.BaseGateway.prototype.get_payment_request_options=function(){var t={country:this.params.country_code,currency:this.get_currency().toLowerCase(),total:{amount:this.get_total_price_cents(),label:this.params.total_label,pending:!0},requestPayerName:function(){return!this.is_current_page("checkout")||!this.is_valid_address(this.get_address_object("billing"),"billing",["email","phone"])}.bind(this)(),requestPayerEmail:this.fields.requestFieldInWallet("billing_email"),requestPayerPhone:this.fields.requestFieldInWallet("billing_phone"),requestShipping:function(){if(this.needs_shipping()){var t=this.get_shipping_prefix();if(this.is_current_page("checkout")&&!this.is_valid_address(this.get_address_object(t),t,["email","phone"])||!this.is_current_page("checkout"))return!0}return!1}.bind(this)()},e=this.get_display_items(),i=this.get_shipping_options();return e&&(t.displayItems=e),t.requestShipping&&i&&(t.shippingOptions=i),t},wc_stripe.BaseGateway.prototype.get_payment_request_update=function(t){var e={currency:this.get_currency().toLowerCase(),total:{amount:parseInt(this.get_total_price_cents()),label:this.params.total_label,pending:!0}},i=this.get_display_items(),s=this.get_shipping_options();return i&&(e.displayItems=i),this.payment_request_options.requestShipping&&s&&(e.shippingOptions=s),e=t?r.extend(!0,{},e,t):e},wc_stripe.BaseGateway.prototype.get_display_items=function(){return this.get_gateway_data().items},wc_stripe.BaseGateway.prototype.set_display_items=function(t){var e=this.get_gateway_data();e.items=t,this.set_gateway_data(e)},wc_stripe.BaseGateway.prototype.get_shipping_options=function(){return this.get_gateway_data().shipping_options},wc_stripe.BaseGateway.prototype.set_shipping_options=function(t){var e=this.get_gateway_data();e.shipping_options=t,this.set_gateway_data(e)},wc_stripe.BaseGateway.prototype.map_address=function(t){return{city:t.city,postcode:t.postalCode,state:t.region,country:t.country}},wc_stripe.BaseGateway.prototype.on_payment_method_received=function(t){try{this.payment_response=t,this.populate_checkout_fields(t),t.complete("success"),this.on_token_received(t.paymentMethod)}catch(e){a.alert(e)}},wc_stripe.BaseGateway.prototype.populate_checkout_fields=function(t){this.set_nonce(t.paymentMethod.id),this.update_addresses(t)},wc_stripe.BaseGateway.prototype.update_addresses=function(t){t.payerName&&this.fields.isEmpty("billing_first_name")&&this.fields.set("name",t.payerName,"billing"),t.payerEmail&&this.fields.isEmpty("billing_email")&&this.fields.set("email",t.payerEmail,"billing"),t.payerPhone&&(this.fields.set("phone",t.payerPhone,"billing"),this.fields.exists("shipping_phone"))&&this.fields.isEmpty("shipping_phone")&&this.fields.set("shipping_phone",t.payerPhone),t.shippingAddress&&this.populate_shipping_fields(t.shippingAddress),t.paymentMethod.billing_details.address&&!this.skipBillingAddress&&this.populate_billing_fields(t.paymentMethod.billing_details.address)},wc_stripe.BaseGateway.prototype.populate_address_fields=function(t,e){for(var i in t)null!==t[i]&&this.fields.set(i,t[i],e)},wc_stripe.BaseGateway.prototype.populate_billing_fields=function(t){this.populate_address_fields(t,"billing")},wc_stripe.BaseGateway.prototype.populate_shipping_fields=function(t){this.populate_address_fields(t,"shipping")},wc_stripe.BaseGateway.prototype.get_address_fields=function(){return["first_name","last_name","country","address_1","address_2","city","state","postcode","phone","email"]},wc_stripe.BaseGateway.prototype.get_address_object=function(e){var i={};return this.get_address_fields().forEach(function(t){i[t]=this.fields.get(t,e)}.bind(this)),i},wc_stripe.BaseGateway.prototype.is_current_page=function(t){return Array.isArray(t)?-1<t.indexOf(this.get_page()):this.get_page()===t},wc_stripe.BaseGateway.prototype.is_valid_address=function(t,e,i){if(r.isEmptyObject(t))return!1;var s=this.get_address_fields();void 0!==i&&i.forEach(function(t){-1<s.indexOf(t)&&s.splice(s.indexOf(t),1)});for(var a=0;a<s.length;a++){var n=s[a],o=this.fields.required(e+"_"+n);if(o&&(!t[n]||"undefined"==typeof t[n]||!this.fields.isValid(n,t[n],t)))return!1}return!0},wc_stripe.BaseGateway.prototype.ajax_before_send=function(t){this.is_user_logged_in()&&t.setRequestHeader("X-WP-Nonce",this.params.rest_nonce)},wc_stripe.BaseGateway.prototype.process_checkout=function(){return new Promise(function(){this.block(),r.ajax({url:this.params.routes.checkout,method:"POST",dataType:"json",data:r.extend({},this.serialize_fields(),{payment_method:this.gateway_id,page_id:this.get_page(),currency:this.get_currency()}),beforeSend:this.ajax_before_send.bind(this)}).done(function(t){t.reload?a.location.reload():"success"===t.result?a.location=t.redirect:(t.messages&&this.submit_error(t.messages),this.unblock())}.bind(this)).fail(function(t,e,i){this.unblock(),this.submit_error(i)}.bind(this))}.bind(this))},wc_stripe.BaseGateway.prototype.process_payment=function(t,e){r.ajax({method:"POST",url:this.params.routes.checkout_payment,dataType:"json",data:r.extend({},this.fields.toJson(),{order_id:t,order_key:e}),beforeSend:this.ajax_before_send.bind(this)}).done(function(t){if(t.result&&"success"===t.result)a.location=t.redirect;else{if(t.reload)return a.location.reload();t.messages?(this.payment_token_received=!1,this.submit_error(t.messages)):this.submit_error(wc_checkout_params.i18n_checkout_error)}}.bind(this)).fail(function(){}.bind(this))},wc_stripe.BaseGateway.prototype.handle_next_action=function(e){try{return this.stripe[this.handleActionMethod](e.client_secret).then(function(t){if(t.error)return this.unblock(),this.payment_token_received=!1,this.submit_error(t.error);this.is_current_page("order_pay")?this.get_form().trigger("submit"):this.process_payment(e.order_id,e.order_key)}.bind(this))["catch"](function(t){this.submit_error(t.message)}.bind(this)),!1}catch(t){}},wc_stripe.BaseGateway.prototype.handle_payment_method_setup=function(e){try{return this.stripe[this.setupActionMethod](e.client_secret).then(function(t){if(t.error)return this.payment_token_received=!1,this.submit_error(t.error);this.is_current_page("order_pay")?this.get_form().trigger("submit"):this.process_payment(e.order_id,e.order_key)}.bind(this))["catch"](function(t){this.submit_error(t.message)}.bind(this)),!1}catch(t){}},wc_stripe.BaseGateway.prototype.hashchange=function(t){var e=a.location.hash.match(/response=(.*)/);if(e)try{var i=JSON.parse(a.atob(decodeURIComponent(e[1])));i&&i.hasOwnProperty("client_secret")&&i.gateway_id===this.gateway_id&&(history.pushState({},"",a.location.pathname),"payment_intent"===i.type?this.handle_next_action(i):this.handle_payment_method_setup(i))}catch(s){}return!0},wc_stripe.BaseGateway.prototype.sync_payment_intent=function(t,s){return new Promise(function(e,i){r.ajax({method:"POST",dataType:"json",url:this.params.routes.sync_intent,data:{order_id:t,client_secret:s},beforeSend:this.ajax_before_send.bind(this)}).done(function(t){(t.code?i:e)(t)}).fail(function(t,e,i){this.submit_error(i)}.bind(this))}.bind(this))},wc_stripe.BaseGateway.prototype.create_setup_intent=function(t){return this.creating_setup_intent||(this.creating_setup_intent=new Promise(function(e,i){r.ajax({method:"POST",dataType:"json",data:r.extend({},{payment_method:this.gateway_id,_wpnonce:this.params.rest_nonce},t),url:this.params.routes.setup_intent}).done(function(t){t.code?i(t.message):(this.client_secret=t.intent.client_secret,e(t))}.bind(this)).fail(function(t,e,i){this.submit_error(i)}.bind(this)).always(function(){this.creating_setup_intent=null}.bind(this))}.bind(this))),this.creating_setup_intent},wc_stripe.BaseGateway.prototype.serialize_form=function(t){var e,i=t.find("input").filter(function(t,e){return!r(e).is('[name^="add-to-cart"]')}.bind(this)).serializeArray(),s={};for(e in i){var a=i[e];s[a.name]=a.value}return s.payment_method=this.gateway_id,s},wc_stripe.BaseGateway.prototype.serialize_fields=function(){return r.extend({},this.fields.toJson(),r(document.body).triggerHandler("wc_stripe_process_checkout_data",[this,this.fields]))},wc_stripe.BaseGateway.prototype.map_shipping_methods=function(t){var e={};return"default"!==t&&1<(t=t.match(/^([\w+]):(.+)$/)).length&&(e[t[1]]=t[2]),e},wc_stripe.BaseGateway.prototype.maybe_set_ship_to_different=function(){r('[name="ship_to_different_address"]').length&&r('[name="ship_to_different_address"]').prop("checked",this.get_address_field_hash("billing")!==this.get_address_field_hash("shipping")).trigger("change")},wc_stripe.BaseGateway.prototype.update_shipping_address=function(s,t){return new Promise(function(e,i){r.ajax({url:this.params.routes.shipping_address,method:"POST",dataType:"json",data:r.extend({},{address:this.map_address(s.shippingAddress),payment_method:this.gateway_id,page_id:this.get_page(),currency:this.get_currency()},t),beforeSend:this.ajax_before_send.bind(this)}).done(function(t){(t.code?(s.updateWith(t.data.newData),i):(s.updateWith(t.data.newData),this.fields.set("shipping_method",t.data.shipping_method),e))(t.data)}.bind(this)).fail(function(){}.bind(this))}.bind(this))},wc_stripe.BaseGateway.prototype.update_shipping_method=function(s,t){return new Promise(function(e,i){r.ajax({url:this.params.routes.shipping_method,method:"POST",dataType:"json",data:r.extend({},{shipping_method:s.shippingOption.id,payment_method:this.gateway_id,currency:this.get_currency(),page_id:this.get_page()},t),beforeSend:this.ajax_before_send.bind(this)}).done(function(t){(t.code?(s.updateWith(t.data.newData),i):(this.set_selected_shipping_methods(t.data.shipping_methods),s.updateWith(t.data.newData),e))(t.data)}.bind(this)).fail(function(t,e,i){this.submit_error(i)}.bind(this))}.bind(this))},wc_stripe.CheckoutGateway=function(){this.message_container="li.payment_method_"+this.gateway_id,this.banner_container="li.banner_payment_method_"+this.gateway_id,r(document.body).on("update_checkout",this.update_checkout.bind(this)),r(document.body).on("updated_checkout",this.updated_checkout.bind(this)),r(document.body).on("updated_checkout",this.container_styles.bind(this)),r(document.body).on("checkout_error",this.checkout_error.bind(this)),r(this.token_selector).closest("form").on("checkout_place_order_"+this.gateway_id,this.checkout_place_order.bind(this)),r(document.body).on("wc_stripe_new_method_"+this.gateway_id,this.on_show_new_methods.bind(this)),r(document.body).on("wc_stripe_saved_method_"+this.gateway_id,this.on_show_saved_methods.bind(this)),r(document.body).on("wc_stripe_payment_method_selected",this.on_payment_method_selected.bind(this)),this.banner_enabled()&&r(".woocommerce-billing-fields").length&&r(".wc-stripe-banner-checkout").css("max-width",r(".woocommerce-billing-fields").outerWidth(!0)),this.container_styles(),this.hasOrderReviewParams()},wc_stripe.CheckoutGateway.prototype.get_element_options=function(){return this.params.elementOptions},wc_stripe.CheckoutGateway.prototype.container_styles=function(){this.params.description||r(this.container).addClass("wc-stripe-no-desc"),r(this.container).find(".wc-stripe-saved-methods").length||r(this.container).find(".payment_box").addClass("wc-stripe-no-methods")},wc_stripe.CheckoutGateway.prototype.hasOrderReviewParams=function(){var t=a.location.search.match(/_stripe_order_review=(.+)/);if(t&&1<t.length)try{var e=JSON.parse(a.atob(decodeURIComponent(t[1])));this.gateway_id===e.payment_method&&(r(function(){this.payment_token_received=!0,this.set_nonce(e.payment_nonce),this.set_use_new_option(!0)}.bind(this)),history.pushState({},"",a.location.pathname))}catch(i){}},wc_stripe.CheckoutGateway.prototype.has3DSecureParams=function(){if((this.is_current_page("order_pay")||this.is_current_page("checkout")||this.is_change_payment_method())&&a.location.hash&&"string"==typeof a.location.hash){var t=a.location.hash.match(/response=(.*)/);if(t)try{var e=JSON.parse(a.atob(decodeURIComponent(t[1])));e&&e.hasOwnProperty("client_secret")&&e.gateway_id===this.gateway_id&&(r(function(){this.set_payment_method(this.gateway_id),this.set_use_new_option(!0),this.set_nonce(e.pm),!0===e.save_method&&this.set_save_payment_method(!0),r('[name="terms"]').prop("checked",!0)}.bind(this)),history.pushState({},"",a.location.pathname+a.location.search),this.handle_next_action(e))}catch(i){}}},wc_stripe.CheckoutGateway.prototype.update_shipping_address=function(){return wc_stripe.BaseGateway.prototype.update_shipping_address.apply(this,arguments).then(function(t){this.populate_address_fields(t.address,this.get_shipping_prefix()),this.fields.toFormFields({update_shipping_method:!1})}.bind(this))},wc_stripe.CheckoutGateway.prototype.updated_checkout=function(){},wc_stripe.CheckoutGateway.prototype.update_checkout=function(){},wc_stripe.CheckoutGateway.prototype.checkout_error=function(){this.has_checkout_error()&&(this.payment_token_received=!1,this.payment_response=null,this.show_payment_button(),this.hide_place_order())},wc_stripe.CheckoutGateway.prototype.is_valid_checkout=function(){return!(r('[name="terms"]').length&&r('[name="terms"]').is(":visible")&&!r('[name="terms"]').is(":checked"))},wc_stripe.CheckoutGateway.prototype.get_payment_method=function(){return r('[name="payment_method"]:checked').val()},wc_stripe.CheckoutGateway.prototype.set_use_new_option=function(t){r("#"+this.gateway_id+"_use_new").prop("checked",t).trigger("change")},wc_stripe.CheckoutGateway.prototype.checkout_place_order=function(){return this.is_valid_checkout()?!!this.is_saved_method_selected()||this.payment_token_received:(this.submit_error(this.params.messages.terms),!1)},wc_stripe.CheckoutGateway.prototype.on_token_received=function(t){this.payment_token_received=!0,this.set_nonce(t.id),this.hide_payment_button(),this.show_place_order()},wc_stripe.CheckoutGateway.prototype.block=function(){r().block&&this.get_form().block({message:null,overlayCSS:{background:"#fff",opacity:.6}})},wc_stripe.CheckoutGateway.prototype.unblock=function(){r().block&&this.get_form().unblock()},wc_stripe.CheckoutGateway.prototype.hide_place_order=function(){r("#place_order").addClass("wc-stripe-hide")},wc_stripe.CheckoutGateway.prototype.show_place_order=function(){r("#place_order").removeClass("wc-stripe-hide")},wc_stripe.CheckoutGateway.prototype.on_show_new_methods=function(){this.payment_token_received?(this.show_place_order(),this.hide_payment_button()):(this.hide_place_order(),this.show_payment_button())},wc_stripe.CheckoutGateway.prototype.on_show_saved_methods=function(){this.hide_payment_button(),this.show_place_order()},wc_stripe.CheckoutGateway.prototype.show_payment_button=function(){this.$button&&this.$button.show()},wc_stripe.CheckoutGateway.prototype.hide_payment_button=function(){this.$button&&this.$button.hide()},wc_stripe.CheckoutGateway.prototype.trigger_payment_method_selected=function(){this.on_payment_method_selected(null,r('[name="payment_method"]:checked').val())},wc_stripe.CheckoutGateway.prototype.show_new_payment_method=function(){r('[name="'+this.gateway_id+'_payment_type_key"][value="new"').trigger("click")},wc_stripe.CheckoutGateway.prototype.on_payment_method_selected=function(t,e){e===this.gateway_id?this.payment_token_received||this.is_saved_method_selected()?(this.hide_payment_button(),this.show_place_order()):(this.show_payment_button(),this.hide_place_order()):(this.hide_payment_button(),e&&e.indexOf("stripe_")<0&&this.show_place_order())},wc_stripe.CheckoutGateway.prototype.banner_enabled=function(){return"1"===this.params.banner_enabled},wc_stripe.CheckoutGateway.prototype.checkout_fields_valid=function(){var t;return["checkout","order_pay"].indexOf(this.get_page())<0||(t=!0,(t=this.fields.validateFields("billing"))?this.needs_shipping()&&r("#ship-to-different-address-checkbox").is(":checked")?(t=this.fields.validateFields("shipping"))||this.submit_error(this.params.messages.required_field):(t=this.is_valid_checkout())||this.submit_error(this.params.messages.terms):this.submit_error(this.params.messages.required_field),t)},wc_stripe.CheckoutGateway.prototype.cart_contains_subscription=function(){return"undefined"!=typeof wc_stripe_cart_contains_subscription&&!0===wc_stripe_cart_contains_subscription},wc_stripe.CheckoutGateway.prototype.set_save_payment_method=function(t){r('[name="'+this.gateway_id+'_save_source_key"]').prop("checked",t)},wc_stripe.CheckoutGateway.prototype.process_order_pay=function(){var t=this.get_form().serializeArray();t.push({name:"_wpnonce",value:this.params.rest_nonce}),t.push({name:"order_id",value:this.params.order_id}),t.push({name:"order_key",value:this.params.order_key}),this.block(),r.ajax({url:this.params.routes.order_pay,method:"POST",dataType:"json",data:r.param(t)}).done(function(t){t.success?t.needs_confirmation?t.data?this.handle_next_action(t.data):a.location.href=t.redirect:(this.payment_token_received=!0,this.get_form().trigger("submit")):this.submit_error(t.message)}.bind(this)).fail(function(t,e,i){this.unblock(),this.submit_error(i)}.bind(this))},wc_stripe.CheckoutGateway.prototype.handle_create_account_change=function(){r("#createaccount").length&&(r("#createaccount").is(":checked")&&!this.linkPaymentEnabled?this.show_save_card():this.hide_save_card())},wc_stripe.CheckoutGateway.prototype.hide_save_card=function(){r(this.container).find(".wc-stripe-save-source").hide()},wc_stripe.CheckoutGateway.prototype.show_save_card=function(){r(this.container).find(".wc-stripe-save-source").show()},wc_stripe.ProductGateway=function(){this.message_container="div.product",r("form.cart").on("found_variation",this.found_variation.bind(this)),r("form.cart").on("reset_data",this.reset_variation_data.bind(this)),this.buttonWidth=r("form.cart div.quantity").outerWidth(!0)+r(".single_add_to_cart_button").outerWidth();var t=r(".single_add_to_cart_button").css("marginLeft");t&&(this.buttonWidth+=parseInt(t.replace("px",""))),r(this.container).css("max-width",this.buttonWidth+"px")},wc_stripe.ProductGateway.prototype.update_shipping_address=function(t){return wc_stripe.BaseGateway.prototype.update_shipping_address.call(this,t,this.get_add_to_cart_data())},wc_stripe.ProductGateway.prototype.update_shipping_method=function(t){return wc_stripe.BaseGateway.prototype.update_shipping_method.call(this,t,this.get_add_to_cart_data())},wc_stripe.ProductGateway.prototype.get_quantity=function(){return r('[name="quantity"]').length?parseInt(r('[name="quantity"]').val()):1},wc_stripe.ProductGateway.prototype.set_rest_nonce=function(t,e){this.params.rest_nonce=e},wc_stripe.ProductGateway.prototype.found_variation=function(t,e){var i=this.get_gateway_data();i.product.price=e.display_price,i.product.price_cents=e.display_price_cents,i.needs_shipping=!e.is_virtual,i.product.variation=e,this.set_gateway_data(i)},wc_stripe.ProductGateway.prototype.reset_variation_data=function(){var t=this.get_product_data();t.variation=!1,this.set_product_data(t),this.disable_payment_button()},wc_stripe.ProductGateway.prototype.disable_payment_button=function(){this.$button&&this.get_button().prop("disabled",!0).addClass("disabled")},wc_stripe.ProductGateway.prototype.enable_payment_button=function(){this.$button&&this.get_button().prop("disabled",!1).removeClass("disabled")},wc_stripe.ProductGateway.prototype.get_button=function(){return this.$button},wc_stripe.ProductGateway.prototype.is_variable_product=function(){return!!this.get_product_data().variation||0<r('[name="variation_id"]').length},wc_stripe.ProductGateway.prototype.variable_product_selected=function(){var t=this.get_product_data().variation,e=r('input[name="variation_id"]').val();return!!t||!!e&&"0"!=e},wc_stripe.ProductGateway.prototype.get_product_data=function(){return this.get_gateway_data().product},wc_stripe.ProductGateway.prototype.set_product_data=function(t){var e=this.get_gateway_data();e.product=t,this.set_gateway_data(e)},wc_stripe.ProductGateway.prototype.get_form=function(){return r(this.container).closest("form")},wc_stripe.ProductGateway.prototype.get_add_to_cart_data=function(){return r.extend({},{product_id:this.get_product_data().id,variation_id:this.is_variable_product()?r('[name="variation_id"]').val():0,qty:this.get_quantity(),payment_method:this.gateway_id,currency:this.get_currency(),page_id:this.get_page()},this.get_product_variations())},wc_stripe.ProductGateway.prototype.add_to_cart=function(){return new Promise(function(e,i){this.block();var t=this.get_add_to_cart_data(),s=this.get_form().find(':not([name="add-to-cart"],[name="quantity"],[name^="attribute_"],[name="variation_id"])').serializeArray();if(s)for(var a in s)t[s[a].name]=s[a].value;r.ajax({url:this.params.routes.add_to_cart,method:"POST",dataType:"json",data:r.extend({},t,this.get_product_variations()),beforeSend:this.ajax_before_send.bind(this)}).done(function(t){this.unblock(),t.code?(this.submit_error(t.message),i(t)):(this.set_total_price(t.data.total),this.set_total_price_cents(t.data.totalCents),this.set_display_items(t.data.displayItems),e(t.data))}.bind(this)).fail(function(t,e,i){this.unblock(),this.submit_error(i)}.bind(this))}.bind(this))},wc_stripe.ProductGateway.prototype.cart_calculation=function(s){return wc_stripe.processing_calculation||(wc_stripe.processing_calculation=new Promise(function(e,i){var t=this.get_product_data().variation;r.ajax({url:this.params.routes.cart_calculation,method:"POST",dataType:"json",data:r.extend({},this.get_add_to_cart_data(),this.get_product_variations(),{variation_id:t.variation_id},s),beforeSend:this.ajax_before_send.bind(this)}).done(function(t){t.code?i(t):e(t.data)}.bind(this)).fail(function(){i()})}.bind(this))["finally"](function(){wc_stripe.processing_calculation=!1}.bind(this))),wc_stripe.processing_calculation},wc_stripe.ProductGateway.prototype.update_from_cart_calculation=function(t){t&&t[this.gateway_id]&&(this.set_total_price(t[this.gateway_id].total),this.set_total_price_cents(t[this.gateway_id].totalCents),this.set_display_items(t[this.gateway_id].displayItems))},wc_stripe.ProductGateway.prototype.get_product_variations=function(){var t=this.get_product_data().variation,s=t?t.attributes:{};return this.is_variable_product()&&r('.variations [name^="attribute_"]').each(function(t,e){var e=r(e),i=e.data("attribute_name")||e.attr("name");i in s||(s[i]=e.val())}),s},wc_stripe.CartGateway=function(){this.message_container="div.woocommerce",r(document.body).on("updated_wc_div",this.updated_html.bind(this)),r(document.body).on("updated_cart_totals",this.updated_html.bind(this)),r(document.body).on("wc_cart_emptied",this.cart_emptied.bind(this))},wc_stripe.CartGateway.prototype.submit_error=function(t){this.submit_message(this.get_error_message(t))},wc_stripe.CartGateway.prototype.updated_html=function(t){},wc_stripe.CartGateway.prototype.cart_emptied=function(t){},wc_stripe.CartGateway.prototype.add_cart_totals_class=function(){r(".cart_totals").addClass("stripe_cart_gateway_active")},wc_stripe.GooglePay=function(){},wc_stripe.GooglePay.prototype.handleActionMethod="confirmCardPayment",wc_stripe.GooglePay.prototype.setupActionMethod="confirmCardSetup",{apiVersion:2,apiVersionMinor:0}),n={type:"CARD",parameters:{allowedAuthMethods:["PAN_ONLY"],allowedCardNetworks:["AMEX","DISCOVER","INTERAC","JCB","MASTERCARD","VISA"],assuranceDetailsRequired:!0}};wc_stripe.GooglePay.prototype.update_addresses=function(t){var e;t.paymentMethodData.info.billingAddress&&(e=t.paymentMethodData.info.billingAddress,this.is_current_page("checkout")&&this.is_valid_address(this.billing_address_object,"billing",["phone","email"])&&(e={phoneNumber:e.phoneNumber}),this.populate_billing_fields(e),e.phoneNumber)&&this.fields.exists("shipping_phone")&&this.fields.isEmpty("shipping_phone")&&this.fields.set("shipping_phone",e.phoneNumber),t.shippingAddress&&this.populate_shipping_fields(t.shippingAddress),t.email&&this.fields.set("email",t.email,"billing")},wc_stripe.GooglePay.prototype.map_address=function(t){return{city:t.locality,postcode:t.postalCode,state:t.administrativeArea,country:t.countryCode}},wc_stripe.GooglePay.prototype.update_payment_data=function(s,a){return new Promise(function(e,i){var t="default"==s.shippingOptionData.id?null:s.shippingOptionData.id;r.when(r.ajax({url:this.params.routes.payment_data,dataType:"json",method:"POST",data:r.extend({},{address:this.map_address(s.shippingAddress),shipping_method:t,page_id:this.get_page(),currency:this.get_currency()},a),beforeSend:this.ajax_before_send.bind(this)})).done(function(t){t.code?i(t.data.data):e(t.data)}.bind(this)).fail(function(){i()}.bind(this))}.bind(this))},wc_stripe.GooglePay.prototype.on_payment_data_changed=function(t){return new Promise(function(e){this.update_payment_data(t).then(function(t){e(t.paymentRequestUpdate),this.set_selected_shipping_methods(t.shipping_methods),this.payment_data_updated(t,address)}.bind(this))["catch"](function(t){e(t)}.bind(this))}.bind(this))},wc_stripe.GooglePay.prototype.payment_data_updated=function(t){},wc_stripe.GooglePay.prototype.get_merchant_info=function(){var t={merchantId:this.params.merchant_id,merchantName:this.params.merchant_name};return"TEST"===this.params.environment&&delete t.merchantId,t},wc_stripe.GooglePay.prototype.get_payment_options=function(){var t,e={environment:this.params.environment,merchantInfo:this.get_merchant_info(),paymentDataCallbacks:{onPaymentAuthorized:function(){return new Promise(function(t){t({transactionState:"SUCCESS"})}.bind(this))}}};return this.needs_shipping()&&(t=this.get_shipping_prefix(),(!this.is_current_page("checkout")||this.is_valid_address(this.get_address_object(t),t,["email","phone"]))&&this.is_current_page("checkout")||(e.paymentDataCallbacks.onPaymentDataChanged=this.on_payment_data_changed.bind(this))),e},wc_stripe.GooglePay.prototype.build_payment_request=function(){var t=r.extend({},s,{emailRequired:this.fields.requestFieldInWallet("billing_email"),merchantInfo:this.get_merchant_info(),allowedPaymentMethods:[r.extend({type:"CARD",tokenizationSpecification:{type:"PAYMENT_GATEWAY",parameters:{gateway:"stripe","stripe:version":"2018-10-31","stripe:publishableKey":this.params.api_key}}},n)],shippingAddressRequired:function(){if(this.needs_shipping()){var t=this.get_shipping_prefix();if(this.is_current_page("checkout")&&!this.is_valid_address(this.get_address_object(t),t,["email","phone"])||!this.is_current_page("checkout"))return!0}return!1}.bind(this)(),transactionInfo:{countryCode:this.params.processing_country,currencyCode:this.get_currency(),totalPriceStatus:"ESTIMATED",totalPrice:this.get_total_price().toString(),displayItems:this.get_display_items(),totalPriceLabel:this.params.total_price_label}});return t.allowedPaymentMethods[0].parameters.billingAddressRequired=function(){var t;return!(this.is_current_page("checkout")&&(t=this.billing_address_object=this.get_address_object("billing"),!this.fields.requestFieldInWallet("billing_phone"))&&this.is_valid_address(t,"billing",["email"]))}.bind(this)(),t.allowedPaymentMethods[0].parameters.billingAddressRequired&&(t.allowedPaymentMethods[0].parameters.billingAddressParameters={format:"FULL",phoneNumberRequired:this.fields.requestFieldInWallet("billing_phone")}),t.shippingAddressRequired?(t.shippingAddressParameters={},t.shippingOptionRequired=!0,t.shippingOptionParameters={shippingOptions:this.get_shipping_options()},t.callbackIntents=["SHIPPING_ADDRESS","SHIPPING_OPTION","PAYMENT_AUTHORIZATION"]):t.callbackIntents=["PAYMENT_AUTHORIZATION"],this.payment_request_options=t},wc_stripe.GooglePay.prototype.createPaymentsClient=function(){this.paymentsClient=new google.payments.api.PaymentsClient(this.get_payment_options())},wc_stripe.GooglePay.prototype.isReadyToPay=function(){return new Promise(function(t){var e=r.extend({},s);e.allowedPaymentMethods=[n],this.paymentsClient.isReadyToPay(e).then(function(){this.can_pay=!0,this.create_button(),t()}.bind(this))["catch"](function(t){t&&t.message&&-1<t.message.indexOf("ShadowRoot")?console.log("GPay is not supported on this browser."):this.submit_error(t)}.bind(this))}.bind(this))},wc_stripe.GooglePay.prototype.create_button=function(){this.$button&&this.$button.remove(),this.$button=r(this.paymentsClient.createButton(this.get_button_options())),this.$button.addClass("gpay-button-container")},wc_stripe.GooglePay.prototype.is_rectangle_button=function(){return"rect"===this.params.button_shape},wc_stripe.GooglePay.prototype.get_button_options=function(){var t={onClick:this.start.bind(this),buttonColor:this.params.button_color,buttonType:this.params.button_style,buttonSizeMode:this.params.button_size_mode,buttonRadius:parseInt(this.params.button_radius)};return null!==this.params.button_locale&&(t.buttonLocale=this.params.button_locale),t},wc_stripe.GooglePay.prototype.start=function(){this.createPaymentsClient(),this.paymentsClient.loadPaymentData(this.build_payment_request()).then(function(t){var e=JSON.parse(t.paymentMethodData.tokenizationData.token);this.update_addresses(t),this.stripe.createPaymentMethod({type:"card",card:{token:e.id},billing_details:this.get_billing_details()}).then(function(t){if(t.error)return this.submit_error(t.error);this.on_token_received(t.paymentMethod)}.bind(this))}.bind(this))["catch"](function(t){"CANCELED"!==t.statusCode&&(t.statusMessage&&-1<t.statusMessage.indexOf("paymentDataRequest.callbackIntent")?this.submit_error_code("DEVELOPER_ERROR_WHITELIST"):this.submit_error(t.statusMessage))}.bind(this))},wc_stripe.ApplePay=function(){},wc_stripe.ApplePay.prototype.handleActionMethod="confirmCardPayment",wc_stripe.ApplePay.prototype.setupActionMethod="confirmCardSetup",wc_stripe.ApplePay.prototype.initialize=function(){this.createPaymentRequest(),this.canMakePayment()},wc_stripe.ApplePay.prototype.get_payment_request_options=function(){return r.extend({},wc_stripe.BaseGateway.prototype.get_payment_request_options.apply(this,arguments),{requestPayerName:!0,requestPayerEmail:!0,disableWallets:["googlePay"]})},wc_stripe.ApplePay.prototype.create_button=function(){this.$button&&this.$button.remove(),this.$button=r(this.params.button),this.$button.on("click",this.start.bind(this)),this.append_button()},wc_stripe.ApplePay.prototype.canMakePayment=function(){return new Promise(function(e){this.paymentRequest.canMakePayment().then(function(t){t&&t.applePay&&(this.can_pay=!0,this.create_button(),r(this.container).show(),e(t))}.bind(this))}.bind(this))},wc_stripe.ApplePay.prototype.start=function(t){t.preventDefault(),this.paymentRequest.update(this.get_payment_request_update({total:{pending:!1}})),this.paymentRequest.show()},wc_stripe.PaymentRequest=function(){},wc_stripe.PaymentRequest.prototype.handleActionMethod="confirmCardPayment",wc_stripe.PaymentRequest.prototype.setupActionMethod="confirmCardSetup",wc_stripe.PaymentRequest.prototype.initialize=function(){this.createPaymentRequest(),this.createPaymentRequestButton(),this.canMakePayment(),this.paymentRequestButton.on("click",this.button_click.bind(this))},wc_stripe.PaymentRequest.prototype.button_click=function(t){},wc_stripe.PaymentRequest.prototype.createPaymentRequestButton=function(){this.paymentRequestButton&&this.paymentRequestButton.destroy(),this.paymentRequestButton=this.elements.create("paymentRequestButton",{paymentRequest:this.paymentRequest,style:{paymentRequestButton:{type:this.params.button.type,theme:this.params.button.theme,height:this.params.button.height}}})},wc_stripe.PaymentRequest.prototype.canMakePayment=function(){return new Promise(function(e){var i=this.paymentRequest;this.paymentRequest.canMakePayment().then(function(t){t&&!t.applePay&&t.googlePay&&i===this.paymentRequest&&(this.can_pay=!0,this.create_button(),r(this.container).show(),e(t))}.bind(this))}.bind(this))},wc_stripe.PaymentRequest.prototype.create_button=function(){this.paymentRequestButton.mount("#wc-stripe-payment-request-container")},wc_stripe.Afterpay=function(){},wc_stripe.Afterpay.prototype.is_eligible=function(t){return t>=this.get_min()&&t<=this.get_max()},wc_stripe.Afterpay.prototype.get_min=function(){var t=this.get_currency(),t=this.params.requirements[t];return t?t[1]:0},wc_stripe.Afterpay.prototype.get_max=function(){var t=this.get_currency(),t=this.params.requirements[t];return t?t[2]:0},wc_stripe.Afterpay.prototype.add_eligibility=function(t,e){r(t).length&&(this.is_eligible(e)?r(t).removeClass("afterpay-ineligible"):this.hide_ineligible_active()&&r(t).addClass("afterpay-ineligible"))},wc_stripe.Afterpay.prototype.hide_ineligible_active=function(){return"yes"===this.params.hide_ineligible},wc_stripe.CheckoutFields=function(t,e){this.params=t,this.page=e,this.session_values=this.supportsSessionStorage()&&sessionStorage.getItem("wc_stripe_checkout_fields")?JSON.parse(sessionStorage.getItem("wc_stripe_checkout_fields")):{},this.fields=new Map(Object.keys(this.params).map(function(t){return null===this.params[t].value&&(t in this.session_values&&null!==this.session_values[t]?this.params[t].value=this.session_values[t]:this.params[t].value=""),[t,this.params[t].value]}.bind(this))),("checkout"===e||"cart"===e&&r(document.body).is(".woocommerce-checkout")||0<r("form.woocommerce-checkout").length)&&(r(document.body).on("updated_checkout",this.updated_checkout.bind(this)),r(document.body).on("change",'[name^="billing_"], [name^="shipping_"]',this.onChange.bind(this)),r("form.checkout").on("change",'.input-text:not([name^="billing_"], [name^="shipping_"], [name="account_password"]), select:not([name^="billing_"], [name^="shipping_"])',this.onChange.bind(this)),r("form.checkout").on("change",'[name="ship_to_different_address"]',this.on_ship_to_address_change.bind(this)),this.init_i18n(),r('[name="ship_to_different_address"]').is(":checked")?this.update_required_fields(r("#shipping_country").val(),"shipping_country"):this.update_required_fields(r("#billing_country").val(),"billing_country"))},wc_stripe.CheckoutFields.prototype.supportsSessionStorage=function(){return"sessionStorage"in a&&null!==a.sessionStorage&&["getItem","setItem"].reduce(function(t,e){return t&&e in sessionStorage}.bind(this),!0)},wc_stripe.CheckoutFields.prototype.init_i18n=function(){"undefined"!=typeof wc_address_i18n_params?this.locales=JSON.parse(wc_address_i18n_params.locale.replace(/&quot;/g,'"')):this.locales=null},wc_stripe.CheckoutFields.prototype.updated_checkout=function(){this.syncCheckoutFieldsWithDOM()},wc_stripe.CheckoutFields.prototype.syncCheckoutFieldsWithDOM=function(){for(var t in this.params)r("#"+t).length&&this.fields.set(t,r("#"+t).val())},wc_stripe.CheckoutFields.prototype.onChange=function(t){try{var e=t.currentTarget.name,i=t.currentTarget.value;this.fields.set(e,i),"billing_country"!==e&&"shipping_country"!==e||this.update_required_fields(i,e),this.supportsSessionStorage()&&sessionStorage.setItem("wc_stripe_checkout_fields",JSON.stringify(this.toJson()))}catch(s){console.log(s)}},wc_stripe.CheckoutFields.prototype.update_required_fields=function(t,e){if(this.locales){var i,s=-1<e.indexOf("billing_")?"billing_":"shipping_",e="undefined"!=typeof this.locales[t]?this.locales[t]:this.locales["default"],a=r.extend(!0,{},this.locales["default"],e);for(i in a){var n=s+i;this.params[n]&&(this.params[n]=r.extend(!0,{},this.params[n],a[i]))}}},wc_stripe.CheckoutFields.prototype.on_ship_to_address_change=function(t){r(t.currentTarget).is(":checked")&&this.update_required_fields(r("#shipping_country").val(),"shipping_country")},wc_stripe.CheckoutFields.prototype.requestFieldInWallet=function(t){return"checkout"===this.page?this.required(t)&&this.isEmpty(t):"order_pay"!==this.page&&this.required(t)},wc_stripe.CheckoutFields.prototype.set=function(t,e,i){this[t]&&"function"==typeof this[t]?this[t]().set.call(this,e,i):this.fields.set(t,e)},wc_stripe.CheckoutFields.prototype.get=function(t,e){var i;return this[t]&&"function"==typeof this[t]?i=this[t]().get.call(this,e):null!=(i=this.fields.get(t))&&""!==i||(void 0!==e?i=e:r('[name="'+t+'"]').length&&(i=r('[name="'+t+'"]').val())),void 0===i?"":i},wc_stripe.CheckoutFields.prototype.required=function(t){return!(!this.params[t]||"undefined"==typeof this.params[t].required||!this.params[t].required)},wc_stripe.CheckoutFields.prototype.exists=function(t){return t in this.params},wc_stripe.CheckoutFields.prototype.isEmpty=function(t){return!this.fields.has(t)||null==(t=this.fields.get(t))||"string"==typeof t&&0===t.trim().length},wc_stripe.CheckoutFields.prototype.isValid=function(t){if(this[t]&&"function"==typeof this[t])return this[t]().isValid.apply(this,Array.prototype.slice.call(arguments,1))},wc_stripe.CheckoutFields.prototype.first_name=function(){return{set:function(t,e){this.fields.set(e+"_first_name",t)},get:function(t){return this.fields.get(t+"_first_name")},isValid:function(t){return"string"==typeof t&&0<t.length}}},wc_stripe.CheckoutFields.prototype.last_name=function(){return{set:function(t,e){this.fields.set(e+"_last_name",t)},get:function(t){return this.fields.get(t+"_last_name")},isValid:function(t){return"string"==typeof t&&0<t.length}}},wc_stripe.CheckoutFields.prototype.address_1=function(){return{set:function(t,e){this.fields.set(e+"_address_1",t)},get:function(t){return this.fields.get(t+"_address_1")},isValid:function(t){return"string"==typeof t&&0<t.length}}},wc_stripe.CheckoutFields.prototype.address_2=function(){return{set:function(t,e){this.fields.set(e+"_address_2",t)},get:function(t){return this.fields.get(t+"_address_2")},isValid:function(t){return"string"==typeof t&&0<t.length}}},wc_stripe.CheckoutFields.prototype.name=function(){return{set:function(t,e){this.fields.set(e+"_full_name",t);var i,t=t.split(" ");1<t.length?(i=t.pop(),this.fields.set(e+"_first_name",t.join(" ")),this.fields.set(e+"_last_name",i)):1==t.length&&this.fields.set(e+"_first_name",t[0])},get:function(t){return this.fields.get(t+"_first_name")+" "+this.fields.get(t+"_last_name")}}},wc_stripe.CheckoutFields.prototype.email=function(){return{set:function(t,e){this.fields.set(e+"_email",t)},get:function(t){return this.fields.get(t+"_email")},isValid:function(t){return"string"==typeof t&&0<t.length}}},wc_stripe.CheckoutFields.prototype.phone=function(){return{set:function(t,e){this.fields.set(e+"_phone",t)},get:function(t){return this.fields.get(t+"_phone")},isValid:function(t){return"string"==typeof t&&0<t.length}}},wc_stripe.CheckoutFields.prototype.country=function(){return{set:function(t,e){this.fields.set(e+"_country",t)},get:function(t){return this.fields.get(t+"_country")},isValid:function(t){return"string"==typeof t&&2===t.length}}},wc_stripe.CheckoutFields.prototype.state=function(){return{set:function(i,t){2<(i=i.toUpperCase()).length&&"checkout"===this.page&&r("#"+t+"_state option").each(function(){var t=r(this),e=t.text().toUpperCase();i===e&&(i=t.val())}),this.fields.set(t+"_state",i)},get:function(t){return this.fields.get(t+"_state")},isValid:function(t){return"string"==typeof t&&0<t.length}}},wc_stripe.CheckoutFields.prototype.city=function(){return{set:function(t,e){this.fields.set(e+"_city",t)},get:function(t){return this.fields.get(t+"_city")},isValid:function(t){return"string"==typeof t&&0<t.length}}},wc_stripe.CheckoutFields.prototype.postcode=function(){return{set:function(t,e){this.fields.set(e+"_postcode",t)},get:function(t){return this.fields.get(t+"_postcode")},isValid:function(t){return"string"==typeof t&&0<t.length}}},wc_stripe.CheckoutFields.prototype.recipient=function(){return wc_stripe.CheckoutFields.prototype.name.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.payerName=function(){return wc_stripe.CheckoutFields.prototype.name.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.payerEmail=function(){return wc_stripe.CheckoutFields.prototype.email.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.payerPhone=function(){return wc_stripe.CheckoutFields.prototype.phone.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.phoneNumber=function(){return wc_stripe.CheckoutFields.prototype.phone.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.countryCode=function(){return wc_stripe.CheckoutFields.prototype.country.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.address1=function(){return wc_stripe.CheckoutFields.prototype.address_1.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.address2=function(){return wc_stripe.CheckoutFields.prototype.address_2.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.line1=function(){return wc_stripe.CheckoutFields.prototype.address_1.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.line2=function(){return wc_stripe.CheckoutFields.prototype.address_2.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.addressLine=function(){return{set:function(t,e){0<t.length&&this.fields.set(e+"_address_1",t[0]),1<t.length&&this.fields.set(e+"_address_2",t[1])},get:function(t){return[this.fields.get(t+"_address_1"),this.fields.get(t+"_address_2")]},isValid:function(t){return 0<t.length&&"string"==typeof t[0]&&0<t[0].length}}},wc_stripe.CheckoutFields.prototype.region=function(){return wc_stripe.CheckoutFields.prototype.state.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.administrativeArea=function(){return wc_stripe.CheckoutFields.prototype.state.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.locality=function(){return wc_stripe.CheckoutFields.prototype.city.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.postal_code=function(){return wc_stripe.CheckoutFields.prototype.postcode.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.postalCode=function(){return wc_stripe.CheckoutFields.prototype.postcode.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.toJson=function(){var i={};return this.fields.forEach(function(t,e){i[e]=t}),i},wc_stripe.CheckoutFields.prototype.toFormFields=function(t){var i=[];this.fields.forEach(function(t,e){e='[name="'+e+'"]';r(e).length&&""!==t&&(r(e).val()!==t&&r(e).is("select")&&i.push(e),r(e).val(t))}),0<i.length&&r(i.join(",")).trigger("change"),void 0!==t&&r(document.body).trigger("update_checkout",t)},wc_stripe.CheckoutFields.prototype.validateFields=function(t){for(var e in this.params){var i=this.params[e];if(-1<e.indexOf(t)&&i.required&&r("#"+e).length&&r("#"+e).is(":visible")){i=r("#"+e).val();if(null==i||0===i.length)return!1}}return!0};try{i=Stripe(wc_stripe_params_v3.api_key,wc_stripe_params_v3.stripeParams),wc_stripe.stripe=i}catch(t){console.log(t)}var o=new wc_stripe.CheckoutFields(wc_stripe_checkout_fields,wc_stripe_params_v3.page)}(window,jQuery);
!function(e,a){function t(){a.BaseGateway.call(this,wc_stripe_applepay_product_params),this.old_qty=this.get_quantity()}(t.prototype=e.extend({},a.BaseGateway.prototype,a.ProductGateway.prototype,a.ApplePay.prototype)).initialize=function(){e(".wc_stripe_product_payment_methods "+this.container).length?(this.container=".wc_stripe_product_payment_methods "+this.container,a.ProductGateway.call(this),a.ApplePay.prototype.initialize.call(this)):setTimeout(this.initialize.bind(this),1e3)},t.prototype.canMakePayment=function(){a.ApplePay.prototype.canMakePayment.call(this).then(function(){e(document.body).on("change",'[name="quantity"]',this.maybe_calculate_cart.bind(this)),e(this.container).parent().parent().addClass("active"),this.is_variable_product()?this.variable_product_selected()?this.cart_calculation(this.get_product_data().variation.variation_id):this.disable_payment_button():this.cart_calculation()}.bind(this))},t.prototype.cart_calculation=function(){return a.ProductGateway.prototype.cart_calculation.apply(this,arguments).then(function(t){this.update_from_cart_calculation(t),this.payment_request_options.requestShipping!==t.needsShipping&&a.ApplePay.prototype.initialize.call(this)}.bind(this))},t.prototype.start=function(t){0===this.get_quantity()?(t.preventDefault(),this.submit_error(this.params.messages.invalid_amount)):(this.needs_shipping()||this.add_to_cart(),a.ApplePay.prototype.start.apply(this,arguments))},t.prototype.append_button=function(){var t=document.querySelectorAll(".wc-stripe-applepay-container");t&&1<t.length?(e.each(t,function(t,a){e(a).empty(),e(a).append(this.$button.clone(!0))}.bind(this)),this.$button=e(".wc-stripe-applepay-container").find("button")):e("#wc-stripe-applepay-container").append(this.$button)},t.prototype.maybe_calculate_cart=function(){this.disable_payment_button(),this.old_qty=this.get_quantity(),this.is_variable_product()&&!this.variable_product_selected()||this.cart_calculation().then(function(){this.is_variable_product()?(this.createPaymentRequest(),a.ApplePay.prototype.canMakePayment.apply(this,arguments).then(function(){this.enable_payment_button()}.bind(this))):this.enable_payment_button()}.bind(this))},t.prototype.found_variation=function(t){a.ProductGateway.prototype.found_variation.apply(this,arguments),this.can_pay&&this.maybe_calculate_cart()},a.product_gateways.push(new t)}(jQuery,wc_stripe);
!function(e,a){e(document.body).is(".single-product")&&((t=function(){a.BaseGateway.call(this,wc_stripe_payment_request_params),window.addEventListener("hashchange",this.hashchange.bind(this)),this.old_qty=this.get_quantity()}).prototype=e.extend({},a.BaseGateway.prototype,a.ProductGateway.prototype,a.PaymentRequest.prototype),t.prototype.initialize=function(){if(!e(this.container).length)return setTimeout(this.initialize.bind(this),1e3);a.ProductGateway.call(this),a.PaymentRequest.prototype.initialize.call(this)},t.prototype.canMakePayment=function(){a.PaymentRequest.prototype.canMakePayment.apply(this,arguments).then(function(){e(document.body).on("change",'[name="quantity"]',this.maybe_calculate_cart.bind(this)),e(this.container).parent().parent().addClass("active"),this.is_variable_product()?this.variable_product_selected()?(this.cart_calculation(),e(this.container).removeClass("processingFoundVariation")):this.disable_payment_button():this.cart_calculation()}.bind(this))},t.prototype.maybe_calculate_cart=function(t){this.disable_payment_button(),this.old_qty=this.get_quantity();this.get_product_data().variation;this.is_variable_product()&&!this.variable_product_selected()||this.cart_calculation().then(function(){this.is_variable_product()?(this.createPaymentRequest(),this.createPaymentRequestButton(),a.PaymentRequest.prototype.canMakePayment.apply(this,arguments).then(function(){this.enable_payment_button()}.bind(this))):this.enable_payment_button()}.bind(this))},t.prototype.cart_calculation=function(){return a.ProductGateway.prototype.cart_calculation.apply(this,arguments).then(function(t){this.update_from_cart_calculation(t),this.payment_request_options.requestShipping!==t.needsShipping?a.PaymentRequest.prototype.initialize.call(this):this.paymentRequest.update(this.get_payment_request_update({total:{pending:!1}}))}.bind(this))["catch"](function(){}.bind(this))},t.prototype.create_button=function(){e("#wc-stripe-payment-request-container").empty(),a.PaymentRequest.prototype.create_button.apply(this,arguments),this.$button=e("#wc-stripe-payment-request-container")},t.prototype.button_click=function(t){this.$button.is(".disabled")?t.preventDefault():0==this.get_quantity()?(t.preventDefault(),this.submit_error(this.params.messages.invalid_amount)):this.needs_shipping()||this.add_to_cart()},t.prototype.found_variation=function(){a.ProductGateway.prototype.found_variation.apply(this,arguments),this.can_pay&&this.maybe_calculate_cart()},t.prototype.block=function(){e.blockUI({message:this.adding_to_cart?this.params.messages.add_to_cart:null,overlayCSS:{background:"#fff",opacity:.6}})}),e(document.body).is(".woocommerce-cart")&&((t=function(){a.BaseGateway.call(this,wc_stripe_payment_request_params),window.addEventListener("hashchange",this.hashchange.bind(this))}).prototype=e.extend({},a.BaseGateway.prototype,a.CartGateway.prototype,a.PaymentRequest.prototype),t.prototype.initialize=function(){a.CartGateway.call(this),a.PaymentRequest.prototype.initialize.call(this)},t.prototype.canMakePayment=function(){a.PaymentRequest.prototype.canMakePayment.apply(this,arguments).then(function(){e(this.container).addClass("active").parent().addClass("active")}.bind(this))},t.prototype.updated_html=function(){e(this.container).length||(this.can_pay=!1),this.can_pay&&this.initialize()},t.prototype.button_click=function(t){this.paymentRequest.update(this.get_payment_request_update({total:{pending:!1}}))},t.prototype.cart_emptied=function(t){this.can_pay=!1}),e(document.body).is(".woocommerce-checkout")&&((t=function(){a.BaseGateway.call(this,wc_stripe_payment_request_params),window.addEventListener("hashchange",this.hashchange.bind(this))}).prototype=e.extend({},a.BaseGateway.prototype,a.CheckoutGateway.prototype,a.PaymentRequest.prototype),t.prototype.initialize=function(){a.CheckoutGateway.call(this),e("form.checkout").on("change",".form-row:not(.address-field) .input-text",this.update_payment_request.bind(this)),e(this.container).length&&a.PaymentRequest.prototype.initialize.call(this)},t.prototype.canMakePayment=function(){a.PaymentRequest.prototype.canMakePayment.apply(this,arguments).then(function(){var t;this.show_icons(),this.banner_enabled()&&(e(this.banner_container).empty().show().append('<div id="wc-stripe-payment-request-banner"></div>'),e(this.banner_container).show().addClass("active").closest(".wc-stripe-banner-checkout").addClass("active"),(t=this.stripe.elements().create("paymentRequestButton",{paymentRequest:this.paymentRequest,style:{paymentRequestButton:{type:this.params.button.type,theme:this.params.button.theme,height:this.params.button.height}}})).on("click",this.banner_checkout.bind(this)),t.mount("#wc-stripe-payment-request-banner"))}.bind(this))},t.prototype.create_button=function(){this.$button&&this.$button.remove(),this.$button=e('<div id="wc-stripe-payment-request-container"></div>'),e("#place_order").after(this.$button),a.PaymentRequest.prototype.create_button.call(this),this.trigger_payment_method_selected()},t.prototype.updated_checkout=function(){e(this.container).length&&a.PaymentRequest.prototype.initialize.call(this)},t.prototype.banner_checkout=function(t){this.set_payment_method(this.gateway_id),this.set_use_new_option(!0),e('[name="terms"]').prop("checked",!0)},t.prototype.on_token_received=function(){a.CheckoutGateway.prototype.on_token_received.apply(this,arguments),this.fields.toFormFields(),this.payment_request_options.requestShipping&&this.maybe_set_ship_to_different(),this.checkout_fields_valid()&&this.get_form().trigger("submit")},t.prototype.update_payment_request=function(){e(this.container).length&&a.PaymentRequest.prototype.initialize.call(this)},t.prototype.show_icons=function(){e(this.container).length&&e(this.container).find(".wc-stripe-paymentRequest-icon.gpay").show()});var t=new t;e(document.body).is(".single-product")&&a.product_gateways.push(t)}(jQuery,window.wc_stripe);