1 line
8.3 KiB
JavaScript
1 line
8.3 KiB
JavaScript
|
!function(e){var d={};function t(a){if(d[a])return d[a].exports;var n=d[a]={i:a,l:!1,exports:{}};return e[a].call(n.exports,n,n.exports,t),n.l=!0,n.exports}t.m=e,t.c=d,t.d=function(e,d,a){t.o(e,d)||Object.defineProperty(e,d,{enumerable:!0,get:a})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,d){if(1&d&&(e=t(e)),8&d)return e;if(4&d&&"object"==typeof e&&e&&e.__esModule)return e;var a=Object.create(null);if(t.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&d&&"string"!=typeof e)for(var n in e)t.d(a,n,function(d){return e[d]}.bind(null,n));return a},t.n=function(e){var d=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(d,"a",d),d},t.o=function(e,d){return Object.prototype.hasOwnProperty.call(e,d)},t.p="",t(t.s=222)}({1:function(e,d){e.exports=jQuery},10:function(e,d,t){"use strict";(function(e){t.d(d,"a",(function(){return a})),t.d(d,"b",(function(){return o}));var a=function(e){var d,t=e;switch(e){case"amex":t="americanexpress",d=32;break;default:d=50}return"\n <svg\n width=".concat(d,"\n height=",32,'\n class="payment-icon icon-').concat(t,'"\n role="img"\n >\n <use\n href="#icon-').concat(t,'"\n xlink:href="#icon-').concat(t,'">\n </use>\n </svg>')},n=0;function o(d){if("1"==edd_global_vars.taxes_enabled){var t=e("#edd_cc_address"),a=t.find("#billing_country").val(),o=t.find("#card_address").val(),r=t.find("#card_address_2").val(),c=t.find("#card_city").val(),i=t.find("#card_state").val();d||(d=i);var l={action:"edd_recalculate_taxes",card_address:o,card_address_2:r,card_city:c,card_zip:t.find("#card_zip").val(),state:d,billing_country:a,nonce:e("#edd-checkout-address-fields-nonce").val(),current_page:edd_global_vars.current_page};e("#edd_purchase_submit [type=submit]").after('<span class="edd-loading-ajax edd-recalculate-taxes-loading edd-loading"></span>');var s=++n;return e.ajax({type:"POST",data:l,dataType:"json",url:edd_global_vars.ajaxurl,xhrFields:{withCredentials:!0},success:function(d){if(s===n){d.html&&e("#edd_checkout_cart_form").replaceWith(d.html),e(".edd_cart_amount").html(d.total);var t=new Object;t.postdata=l,t.response=d,e("body").trigger("edd_taxes_recalculated",[t])}e(".edd-recalculate-taxes-loading").remove()}}).fail((function(d){window.console&&window.console.log&&(console.log(d),s===n&&e("body").trigger("edd_taxes_recalculated",[tax_data]))}))}}}).call(this,t(1))},222:function(e,d,t){"use strict";t.r(d),t(223);var a=t(10);window.recalculate_taxes=a.b,window.EDD_Checkout=function(e){var d,t,n;function o(t){t.preventDefault();var o=e("#edd-discount").val(),r=e("#edd-discount-loader"),c=e("#edd_cc_address .edd-input, #edd_cc_address .edd-select").filter("[required]");if(""==o||o==edd_global_vars.enter_discount)return!1;var i={action:"edd_apply_discount",code:o,form:e("#edd_purchase_form").serialize(),current_page:edd_global_vars.current_page};return e("#edd-discount-error-wrap").html("").hide(),r.show(),e.ajax({type:"POST",data:i,dataType:"json",url:edd_global_vars.ajaxurl,xhrFields:{withCredentials:!0},success:function(t){t?"valid"==t.msg?(e(".edd_cart_discount").html(t.html),e(".edd_cart_discount_row").show(),e(".edd_cart_amount").each((function(){e(this).text(t.total),e(this).data("total",t.total_plain)})),e("#edd-discount",n).val(""),Object(a.b)(),"0.00"==t.total_plain?(e("#edd_cc_fields,#edd_cc_address,#edd_payment_mode_select").slideUp(),c.prop("required",!1),e('input[name="edd-gateway"]').val("manual")):(c.prop("required",!0),e("#edd_cc_fields,#edd_cc_address").slideDown()),d.trigger("edd_discount_applied",[t])):(e("#edd-discount-error-wrap").html('<span class="edd_error">'+t.msg+"</span>"),e("#edd-discount-error-wrap").show(),d.trigger("edd_discount_invalid",[t])):(window.console&&window.console.log&&console.log(t),d.trigger("edd_discount_failed",[t])),r.hide()}}).fail((function(e){window.console&&window.console.log&&console.log(e)})),!1}function r(t){var
|