(()=>{"use strict";function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}function t(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function r(t,r,n){return(r=function(t){var r=function(t){if("object"!=e(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=e(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==e(r)?r:r+""}(r))in t?Object.defineProperty(t,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[r]=n,t}window.wp.i18n,((function(e){for(var n=1;n<arguments.length;n++){var o=null!=arguments[n]?arguments[n]:{};n%2?t(Object(o),!0).forEach(function(t){r(e,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):t(Object(o)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))})}return e}({},tripzzy.strings)||{}).messages||{}).required_field;var n=tripzzy;function o(){var e=document.getElementById("tripzzy-checkout-form-response-msg"),t=document.getElementById("tripzzy-checkout-form-response-title"),r=document.getElementById("tripzzy-checkout-form-response"),n=document.getElementById("tripzzy-payment-button");try{var o=wp.template("tripzzy-book-now-pay-latter");n.innerHTML=o();var i=document.getElementById("tripzzy-checkout-form-response-msg"),c=document.getElementById("tripzzy-checkout-form-response-title"),s=document.getElementById("tripzzy-checkout-form-response");i.classList.remove("tripzzy-response-msg","tripzzy-error"),c.innerHTML="",s.innerHTML="",setTimeout(function(){n.classList.remove("tripzzy-is-processing")},100)}catch(o){e.classList.add("tripzzy-response-msg","tripzzy-error"),t.innerHTML="Error",r.innerHTML=o.message,setTimeout(function(){n.classList.remove("tripzzy-is-processing")},100)}}n.ajax_url,n.nonce,o(),document.addEventListener("click",function(e){e.target===document.querySelector("#tripzzy-payment-mode-book_now_pay_later")&&o()})})();