HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux WebLive 5.15.0-79-generic #86-Ubuntu SMP Mon Jul 10 16:07:21 UTC 2023 x86_64
User: ubuntu (1000)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/html/wptuneprotect/wp-content/plugins/woocommerce/assets/js/frontend/checkout.min.js
jQuery(function(k){if("undefined"==typeof wc_checkout_params)return!1;k.blockUI.defaults.overlayCSS.cursor="default";const w=c=>{var e=new AbortController;return window.fetch(c.url,{method:c.type,headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},body:c.data,signal:e.signal}).then(o=>{o.text().then(e=>{if(!o.ok){const t=new Error(o.statusText);throw t.responseText=e,t}"html"!==c.dataType&&(e=JSON.parse(w.dataFilter(e,"json"))),c.success(e)})})["catch"](e=>c.error&&c.error(e.responseText,"error",e.message)),e};var F={updateTimer:!(w.dataFilter=(e,t)=>e),dirtyInput:!1,selectedPaymentMethod:!1,xhr:!1,$order_review:k("#order_review"),$checkout_form:k("form.checkout"),init:function(){k(document.body).on("update_checkout",this.update_checkout),k(document.body).on("init_checkout",this.init_checkout),this.$checkout_form.on("click",'input[name="payment_method"]',this.payment_method_selected),k(document.body).hasClass("woocommerce-order-pay")&&(this.$order_review.on("click",'input[name="payment_method"]',this.payment_method_selected),this.$order_review.on("submit",this.submitOrder),this.$order_review.attr("novalidate","novalidate")),this.$checkout_form.attr("novalidate","novalidate"),this.$checkout_form.on("submit",this.submit),this.$checkout_form.on("input validate change",".input-text, select, input:checkbox",this.validate_field),this.$checkout_form.on("update",this.trigger_update_checkout),this.$checkout_form.on("change",'select.shipping_method, input[name^="shipping_method"], #ship-to-different-address input, .update_totals_on_change select, .update_totals_on_change input[type="radio"], .update_totals_on_change input[type="checkbox"]',this.trigger_update_checkout),this.$checkout_form.on("change",".address-field select",this.input_changed),this.$checkout_form.on("change",".address-field input.input-text, .update_totals_on_change input.input-text",this.maybe_input_changed),this.$checkout_form.on("keydown",".address-field input.input-text, .update_totals_on_change input.input-text",this.queue_update_checkout),this.$checkout_form.on("change","#ship-to-different-address input",this.ship_to_different_address),this.$checkout_form.find("#ship-to-different-address input").trigger("change"),this.init_payment_methods(),"1"===wc_checkout_params.is_checkout&&k(document.body).trigger("init_checkout"),"yes"===wc_checkout_params.option_guest_checkout&&k("input#createaccount").on("change",this.toggle_create_account).trigger("change")},init_payment_methods:function(){var e=k(".woocommerce-checkout").find('input[name="payment_method"]'),t=(1===e.length&&e.eq(0).hide(),F.selectedPaymentMethod&&k("#"+F.selectedPaymentMethod).prop("checked",!0),0===e.filter(":checked").length&&e.eq(0).prop("checked",!0),e.filter(":checked").eq(0).prop("id"));1<e.length&&k('div.payment_box:not(".'+t+'")').filter(":visible").slideUp(0),e.filter(":checked").eq(0).trigger("click")},get_payment_method:function(){return F.$checkout_form.find('input[name="payment_method"]:checked').val()},payment_method_selected:function(e){e.stopPropagation(),1<k(".payment_methods input.input-radio").length?(e=k("div.payment_box."+k(this).attr("ID")),(t=k(this).is(":checked"))&&!e.is(":visible")&&(k("div.payment_box").filter(":visible").slideUp(230),t&&e.slideDown(230))):k("div.payment_box").show(),k(this).data("order_button_text")?k("#place_order").text(k(this).data("order_button_text")):k("#place_order").text(k("#place_order").data("value"));var t=k('.woocommerce-checkout input[name="payment_method"]:checked').attr("id");t!==F.selectedPaymentMethod&&k(document.body).trigger("payment_method_selected"),F.selectedPaymentMethod=t},toggle_create_account:function(){k("div.create-account").hide(),k(this).is(":checked")&&(k("#account_password").val("").trigger("change"),k("div.create-account").slideDown())},init_checkout:function(){k(document.body).trigger("update_checkout")},maybe_input_changed:function(e){F.dirtyInput&&F.input_changed(e)},input_changed:function(e){F.dirtyInput=e.target,F.maybe_update_checkout()},queue_update_checkout:function(e){if(9===(e.keyCode||e.which||0))return!0;F.dirtyInput=this,F.reset_update_checkout_timer(),F.updateTimer=setTimeout(F.maybe_update_checkout,"1000")},trigger_update_checkout:function(){F.reset_update_checkout_timer(),F.dirtyInput=!1,k(document.body).trigger("update_checkout")},maybe_update_checkout:function(){var e,t=!0;k(F.dirtyInput).length&&(e=k(F.dirtyInput).closest("div").find(".address-field.validate-required")).length&&e.each(function(){""===k(this).find("input.input-text").val()&&(t=!1)}),t&&F.trigger_update_checkout()},ship_to_different_address:function(){k("div.shipping_address").hide(),k(this).is(":checked")&&k("div.shipping_address").slideDown()},reset_update_checkout_timer:function(){clearTimeout(F.updateTimer)},is_valid_json:function(e){try{var t=JSON.parse(e);return t&&"object"==typeof t}catch(o){return!1}},validate_field:function(e){var t=k(this),o=t.closest(".form-row"),c=!0,i=o.is(".validate-required"),n=o.is(".validate-email"),r=o.is(".validate-phone"),a="",e=e.type;"input"===e&&o.removeClass("woocommerce-invalid woocommerce-invalid-required-field woocommerce-invalid-email woocommerce-invalid-phone woocommerce-validated"),"validate"!==e&&"change"!==e||(i&&("checkbox"===t.attr("type")&&!t.is(":checked")||""===t.val())&&(o.removeClass("woocommerce-validated").addClass("woocommerce-invalid woocommerce-invalid-required-field"),c=!1),n&&t.val()&&!(a=new RegExp(/^([a-z\d!#$%&'*+\-\/=?^_`{|}~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+(\.[a-z\d!#$%&'*+\-\/=?^_`{|}~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+)*|"((([ \t]*\r\n)?[ \t]+)?([\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]|\\[\x01-\x09\x0b\x0c\x0d-\x7f\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))*(([ \t]*\r\n)?[ \t]+)?")@(([a-z\d\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]|[a-z\d\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF][a-z\d\-._~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]*[a-z\d\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])\.)+([a-z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]|[a-z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF][a-z\d\-._~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]*[0-9a-z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])\.?$/i)).test(t.val())&&(o.removeClass("woocommerce-validated").addClass("woocommerce-invalid woocommerce-invalid-email woocommerce-invalid-phone"),c=!1),r&&(a=new RegExp(/[\s\#0-9_\-\+\/\(\)\.]/g),0<t.val().replace(a,"").length&&(o.removeClass("woocommerce-validated").addClass("woocommerce-invalid woocommerce-invalid-phone"),c=!1)),c&&o.removeClass("woocommerce-invalid woocommerce-invalid-required-field woocommerce-invalid-email woocommerce-invalid-phone").addClass("woocommerce-validated"))},update_checkout:function(e,t){F.reset_update_checkout_timer(),F.updateTimer=setTimeout(F.update_checkout_action,"5",t)},update_checkout_action:function(e){F.controller&&F.controller.abort();var c=k("form.checkout");if(0!==c.length){e=void 0!==e?e:{update_shipping_method:!0};var t=k("#billing_country").val(),o=k("#billing_state").val(),i=k(":input#billing_postcode").val(),n=k("#billing_city").val(),r=k(":input#billing_address_1").val(),a=k(":input#billing_address_2").val(),d=t,u=o,s=i,m=n,l=r,h=a,p=k(F.$checkout_form).find(".address-field.validate-required:visible"),_=!0,g=(p.length&&p.each(function(){""===k(this).find(":input").val()&&(_=!1)}),k("#ship-to-different-address").find("input").is(":checked")&&(d=k("#shipping_country").val(),u=k("#shipping_state").val(),s=k(":input#shipping_postcode").val(),m=k("#shipping_city").val(),l=k(":input#shipping_address_1").val(),h=k(":input#shipping_address_2").val()),{security:wc_checkout_params.update_order_review_nonce,payment_method:F.get_payment_method(),country:t,state:o,postcode:i,city:n,address:r,address_2:a,s_country:d,s_state:u,s_postcode:s,s_city:m,s_address:l,s_address_2:h,has_full_address:_,post_data:new URLSearchParams(new FormData(c[0])).toString()});if(!1!==e.update_shipping_method){var f,v={};for(f in k('select.shipping_method, input[name^="shipping_method"][type="radio"]:checked, input[name^="shipping_method"][type="hidden"]').each(function(){v[k(this).data("index")]=k(this).val()}),v)g["shipping_method["+f+"]"]=v[f]}k(".woocommerce-checkout-payment, .woocommerce-checkout-review-order-table").block({message:null,overlayCSS:{background:"#fff",opacity:.6}}),F.controller=w({type:"POST",url:wc_checkout_params.wc_ajax_url.toString().replace("%%endpoint%%","update_order_review"),data:new URLSearchParams(g).toString(),success:function(e){var t,o;e&&!0===e.reload?window.location.reload():(k(".woocommerce-NoticeGroup-updateOrderReview").remove(),t=k("#terms").prop("checked"),o={},k(".payment_box :input").each(function(){var e=k(this).attr("id");e&&(-1!==k.inArray(k(this).attr("type"),["checkbox","radio"])?o[e]=k(this).prop("checked"):o[e]=k(this).val())}),e&&e.fragments&&(k.each(e.fragments,function(e,t){F.fragments&&F.fragments[e]===t||k(e).replaceWith(t),k(e).unblock()}),F.fragments=e.fragments),t&&k("#terms").prop("checked",!0),k.isEmptyObject(o)||k(".payment_box :input").each(function(){var e=k(this).attr("id");e&&(-1!==k.inArray(k(this).attr("type"),["checkbox","radio"])?k(this).prop("checked",o[e]).trigger("change"):(-1!==k.inArray(k(this).attr("type"),["select"])||null!==k(this).val()&&0===k(this).val().length)&&k(this).val(o[e]).trigger("change"))}),e&&"failure"===e.result&&(k(".woocommerce-error, .woocommerce-message").remove(),e.messages?c.prepend('<div class="woocommerce-NoticeGroup woocommerce-NoticeGroup-updateOrderReview">'+e.messages+"</div>"):c.prepend(e),c.find(".input-text, select, input:checkbox").trigger("validate").trigger("blur"),F.scroll_to_notices()),F.init_payment_methods(),k(document.body).trigger("updated_checkout",[e]))}})}},handleUnloadEvent:function(e){return-1===navigator.userAgent.indexOf("MSIE")&&!document.documentMode||(e.preventDefault(),undefined)},attachUnloadEventsOnSubmit:function(){k(window).on("beforeunload",this.handleUnloadEvent)},detachUnloadEventsOnSubmit:function(){k(window).off("beforeunload",this.handleUnloadEvent)},blockOnSubmit:function(e){1!==e.data("blockUI.isBlocked")&&e.block({message:null,overlayCSS:{background:"#fff",opacity:.6}})},submitOrder:function(){F.blockOnSubmit(k(this))},submit:function(){F.reset_update_checkout_timer();var o=k(this);return o.is(".processing")||!1!==o.triggerHandler("checkout_place_order")&&!1!==o.triggerHandler("checkout_place_order_"+F.get_payment_method())&&(o.addClass("processing"),F.blockOnSubmit(o),F.attachUnloadEventsOnSubmit(),w.dataFilter=function(e,t){return"json"!==t||F.is_valid_json(e)||(null!==(t=e.match(/{"result.*}/))&&F.is_valid_json(t[0])?(console.log("Fixed malformed JSON. Original:"),console.log(e),e=t[0]):console.log("Unable to fix malformed JSON")),e},w({type:"POST",url:wc_checkout_params.checkout_url,data:new URLSearchParams(new FormData(o[0])).toString(),dataType:"json",success:function(e){F.detachUnloadEventsOnSubmit();try{if("success"!==e.result||!1===o.triggerHandler("checkout_place_order_success",e))throw"failure"===e.result?"Result failure":"Invalid response";-1===e.redirect.indexOf("https://")||-1===e.redirect.indexOf("http://")?window.location=e.redirect:window.location=decodeURI(e.redirect)}catch(t){!0===e.reload?window.location.reload():(!0===e.refresh&&k(document.body).trigger("update_checkout"),e.messages?F.submit_error(e.messages):F.submit_error('<div class="woocommerce-error">'+wc_checkout_params.i18n_checkout_error+"</div>"))}},error:function(e,t,o){F.detachUnloadEventsOnSubmit(),F.submit_error('<div class="woocommerce-error">'+(o||wc_checkout_params.i18n_checkout_error)+"</div>")}})),!1},submit_error:function(e){k(".woocommerce-NoticeGroup-checkout, .woocommerce-error, .woocommerce-message").remove(),F.$checkout_form.prepend('<div class="woocommerce-NoticeGroup woocommerce-NoticeGroup-checkout">'+e+"</div>"),F.$checkout_form.removeClass("processing").unblock(),F.$checkout_form.find(".input-text, select, input:checkbox").trigger("validate").trigger("blur"),F.scroll_to_notices(),k(document.body).trigger("checkout_error",[e])},scroll_to_notices:function(){var e=k(".woocommerce-NoticeGroup-updateOrderReview, .woocommerce-NoticeGroup-checkout");e.length||(e=k("form.checkout")),k.scroll_to_notices(e)}},e={init:function(){k(document.body).on("click","a.showcoupon",this.show_coupon_form),k(document.body).on("click",".woocommerce-remove-coupon",this.remove_coupon),k("form.checkout_coupon").hide().on("submit",this.submit)},show_coupon_form:function(){return k(".checkout_coupon").slideToggle(400,function(){k(".checkout_coupon").find(":input:eq(0)").trigger("focus")}),!1},submit:function(){var t,o=k(this);return o.is(".processing")||(o.addClass("processing").block({message:null,overlayCSS:{background:"#fff",opacity:.6}}),t={security:wc_checkout_params.apply_coupon_nonce,coupon_code:o.find('input[name="coupon_code"]').val()},w({type:"POST",url:wc_checkout_params.wc_ajax_url.toString().replace("%%endpoint%%","apply_coupon"),data:new URLSearchParams(t).toString(),success:function(e){k(".woocommerce-error, .woocommerce-message").remove(),o.removeClass("processing").unblock(),e&&(o.before(e),o.slideUp(),k(document.body).trigger("applied_coupon_in_checkout",[t.coupon_code]),k(document.body).trigger("update_checkout",{update_shipping_method:!1}))},dataType:"html"})),!1},remove_coupon:function(e){e.preventDefault();var t=k(this).parents(".woocommerce-checkout-review-order"),e=k(this).data("coupon"),o=(t.addClass("processing").block({message:null,overlayCSS:{background:"#fff",opacity:.6}}),{security:wc_checkout_params.remove_coupon_nonce,coupon:e});w({type:"POST",url:wc_checkout_params.wc_ajax_url.toString().replace("%%endpoint%%","remove_coupon"),data:new URLSearchParams(o).toString(),success:function(e){k(".woocommerce-error, .woocommerce-message").remove(),t.removeClass("processing").unblock(),e&&(k("form.woocommerce-checkout").before(e),k(document.body).trigger("removed_coupon_in_checkout",[o.coupon]),k(document.body).trigger("update_checkout",{update_shipping_method:!1}),k("form.checkout_coupon").find('input[name="coupon_code"]').val(""))},error:function(e){wc_checkout_params.debug_mode&&console.log(e)},dataType:"html"})}},t={init:function(){k(document.body).on("click","a.showlogin",this.show_login_form)},show_login_form:function(){return k("form.login, form.woocommerce-form--login").slideToggle(),!1}},o={init:function(){k(document.body).on("click","a.woocommerce-terms-and-conditions-link",this.toggle_terms)},toggle_terms:function(){if(k(".woocommerce-terms-and-conditions").length)return k(".woocommerce-terms-and-conditions").slideToggle(function(){var e=k(".woocommerce-terms-and-conditions-link");k(".woocommerce-terms-and-conditions").is(":visible")?(e.addClass("woocommerce-terms-and-conditions-link--open"),e.removeClass("woocommerce-terms-and-conditions-link--closed")):(e.removeClass("woocommerce-terms-and-conditions-link--open"),e.addClass("woocommerce-terms-and-conditions-link--closed"))}),!1}};F.init(),e.init(),t.init(),o.init()});