Failed to save the file to the "xx" directory.

Failed to save the file to the "ll" directory.

Failed to save the file to the "mm" directory.

Failed to save the file to the "wp" directory.

403WebShell
403Webshell
Server IP : 66.29.132.124  /  Your IP : 18.119.116.77
Web Server : LiteSpeed
System : Linux business141.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64
User : wavevlvu ( 1524)
PHP Version : 7.4.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/wavevlvu/tacafoundation.org/wp-content/plugins/give/assets/dist/js/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/wavevlvu/tacafoundation.org/wp-content/plugins/give/assets/dist/js/paypal-commerce.js
(()=>{"use strict";function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}function e(){e=function(){return r};var r={},n=Object.prototype,o=n.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},c=a.iterator||"@@iterator",u=a.asyncIterator||"@@asyncIterator",s=a.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function f(t,e,r,n){var o=e&&e.prototype instanceof p?e:p,a=Object.create(o.prototype),c=new j(n||[]);return i(a,"_invoke",{value:S(t,r,c)}),a}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}r.wrap=f;var h={};function p(){}function y(){}function v(){}var m={};l(m,c,(function(){return this}));var g=Object.getPrototypeOf,b=g&&g(g(_([])));b&&b!==n&&o.call(b,c)&&(m=b);var w=v.prototype=p.prototype=Object.create(m);function P(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function E(e,r){function n(i,a,c,u){var s=d(e[i],e,a);if("throw"!==s.type){var l=s.arg,f=l.value;return f&&"object"==t(f)&&o.call(f,"__await")?r.resolve(f.__await).then((function(t){n("next",t,c,u)}),(function(t){n("throw",t,c,u)})):r.resolve(f).then((function(t){l.value=t,c(l)}),(function(t){return n("throw",t,c,u)}))}u(s.arg)}var a;i(this,"_invoke",{value:function(t,e){function o(){return new r((function(r,o){n(t,e,r,o)}))}return a=a?a.then(o,o):o()}})}function S(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return k()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=x(a,r);if(c){if(c===h)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=d(t,e,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===h)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}function x(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,x(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),h;var o=d(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,h;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,h):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,h)}function O(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function F(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function _(t){if(t){var e=t[c];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,n=function e(){for(;++r<t.length;)if(o.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return n.next=n}}return{next:k}}function k(){return{value:void 0,done:!0}}return y.prototype=v,i(w,"constructor",{value:v,configurable:!0}),i(v,"constructor",{value:y,configurable:!0}),y.displayName=l(v,s,"GeneratorFunction"),r.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===y||"GeneratorFunction"===(e.displayName||e.name))},r.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,v):(t.__proto__=v,l(t,s,"GeneratorFunction")),t.prototype=Object.create(w),t},r.awrap=function(t){return{__await:t}},P(E.prototype),l(E.prototype,u,(function(){return this})),r.AsyncIterator=E,r.async=function(t,e,n,o,i){void 0===i&&(i=Promise);var a=new E(f(t,e,n,o),i);return r.isGeneratorFunction(e)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},P(w),l(w,s,"Generator"),l(w,c,(function(){return this})),l(w,"toString",(function(){return"[object Generator]"})),r.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},r.values=_,j.prototype={constructor:j,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(F),!t)for(var e in this)"t"===e.charAt(0)&&o.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var c=o.call(i,"catchLoc"),u=o.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var i=n;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,h):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),h},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),F(r),h}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;F(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:_(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),h}},r}function r(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function n(e,r){for(var n=0;n<r.length;n++){var o=r[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,(i=o.key,a=void 0,a=function(e,r){if("object"!==t(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,r||"default");if("object"!==t(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(e)}(i,"string"),"symbol"===t(a)?a:String(a)),o)}var i,a}const o=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.form=e,this.jQueryForm=jQuery(e),this.ajaxurl=Give.fn.getGlobalVar("ajaxurl"),this.setupProperties()}var o,i,a,c,u;return o=t,i=[{key:"setupProperties",value:function(){}},{key:"boot",value:function(){this.renderPaymentMethodOption()}},{key:"renderPaymentMethodOption",value:function(){}},{key:"showError",value:function(t){t.hasOwnProperty("details")?j.addErrors(this.jQueryForm,Give.form.fn.getErrorHTML([{message:t.details[0].description}])):j.addErrors(this.jQueryForm,t)}},{key:"isInTestMode",value:function(){return"1"===Give.fn.getGlobalVar("is_test_mode")}},{key:"displayErrorMessage",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=Give.form.fn.getErrorHTML([{message:window.givePayPalCommerce.genericDonorErrorMessage}]);(e||this.isInTestMode())&&(r=t),this.showError(r)}},{key:"isProcessingEventForForm",value:function(t){return t===this.form.getAttribute("id")&&j.isPayPalCommerceSelected(this.jQueryForm)}},{key:"createOrderHandler",value:(c=e().mark((function t(r,n){var o,i;return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return Give.form.fn.removeErrors(this.jQueryForm),t.next=3,fetch("".concat(this.ajaxurl,"?action=give_paypal_commerce_create_order"),{method:"POST",body:j.getFormDataWithoutGiveActionField(this.form)});case 3:return o=t.sent,t.next=6,o.json();case 6:if((i=t.sent).success){t.next=9;break}throw i.data.error;case 9:return t.abrupt("return",i.data.id);case 10:case"end":return t.stop()}}),t,this)})),u=function(){var t=this,e=arguments;return new Promise((function(n,o){var i=c.apply(t,e);function a(t){r(i,n,o,a,u,"next",t)}function u(t){r(i,n,o,a,u,"throw",t)}a(void 0)}))},function(t,e){return u.apply(this,arguments)})}],i&&n(o.prototype,i),a&&n(o,a),Object.defineProperty(o,"prototype",{writable:!1}),t}();function i(t){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i(t)}function a(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(o=n.key,a=void 0,a=function(t,e){if("object"!==i(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==i(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(o,"string"),"symbol"===i(a)?a:String(a)),n)}var o,a}function c(t,e){return c=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},c(t,e)}function u(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=s(t);if(e){var o=s(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return function(t,e){if(e&&("object"===i(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,r)}}function s(t){return s=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},s(t)}const l=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&c(t,e)}(i,t);var e,r,n,o=u(i);function i(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),o.apply(this,arguments)}return e=i,n=[{key:"canShow",value:function(t){return x.canShow()&&j.isRecurringDonation(t)}}],(r=[{key:"setupProperties",value:function(){this.ccFieldsContainer=this.form.querySelector('[id^="give_cc_fields-"]'),this.cardFields=this.getCardFields(),this.recurringChoiceHiddenField=this.form.querySelector('input[name="_give_is_donation_recurring"]'),this.separator=this.ccFieldsContainer.querySelector(".separator-with-text"),this.separator||!i.canShow(this.form)&&!x.canShow()||(this.separator=this.cardFields.number.el?this.cardFields.number.el.parentElement.insertAdjacentElement("beforebegin",this.separatorHtml()):null)}},{key:"renderPaymentMethodOption",value:function(){this.toggleFields()}},{key:"getCardFields",value:function(){return{number:{el:this.form.querySelector('input[name="card_number"]')},cvv:{el:this.form.querySelector('input[name="card_cvc"]')},expirationDate:{el:this.form.querySelector('input[name="card_expiry"]')}}}},{key:"toggleFields",value:function(){var t=i.canShow(this.form)?"block":"none";for(var e in this.cardFields)this.cardFields[e].el.style.display=t,this.cardFields[e].el.disabled="none"===t}},{key:"removeFields",value:function(){for(var t in this.cardFields)this.cardFields[t].el&&this.cardFields[t].el.parentElement.remove();var e=this.form.querySelector('input[name="card_name"]');e&&e.parentElement.remove(),this.separator&&this.separator.remove()}},{key:"separatorHtml",value:function(){var t=document.createElement("div");return t.setAttribute("class","separator-with-text"),t.innerHTML='<div class="dashed-line"></div><div class="label">'.concat(givePayPalCommerce.separatorLabel,'</div><div class="dashed-line"></div>'),t}}])&&a(e.prototype,r),n&&a(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}(o);function f(t){return f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},f(t)}function d(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function h(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?d(Object(r),!0).forEach((function(e){p(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):d(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function p(t,e,r){return(e=b(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function y(){y=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function s(t,e,r,o){var i=e&&e.prototype instanceof h?e:h,a=Object.create(i.prototype),c=new j(o||[]);return n(a,"_invoke",{value:S(t,r,c)}),a}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=s;var d={};function h(){}function p(){}function v(){}var m={};u(m,i,(function(){return this}));var g=Object.getPrototypeOf,b=g&&g(g(_([])));b&&b!==e&&r.call(b,i)&&(m=b);var w=v.prototype=h.prototype=Object.create(m);function P(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function E(t,e){function o(n,i,a,c){var u=l(t[n],t,i);if("throw"!==u.type){var s=u.arg,d=s.value;return d&&"object"==f(d)&&r.call(d,"__await")?e.resolve(d.__await).then((function(t){o("next",t,a,c)}),(function(t){o("throw",t,a,c)})):e.resolve(d).then((function(t){s.value=t,a(s)}),(function(t){return o("throw",t,a,c)}))}c(u.arg)}var i;n(this,"_invoke",{value:function(t,r){function n(){return new e((function(e,n){o(t,r,e,n)}))}return i=i?i.then(n,n):n()}})}function S(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return k()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=x(a,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=l(t,e,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===d)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}function x(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,x(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var o=l(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,d;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,d):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,d)}function O(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function F(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function _(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:k}}function k(){return{value:void 0,done:!0}}return p.prototype=v,n(w,"constructor",{value:v,configurable:!0}),n(v,"constructor",{value:p,configurable:!0}),p.displayName=u(v,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===p||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,v):(t.__proto__=v,u(t,c,"GeneratorFunction")),t.prototype=Object.create(w),t},t.awrap=function(t){return{__await:t}},P(E.prototype),u(E.prototype,a,(function(){return this})),t.AsyncIterator=E,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new E(s(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},P(w),u(w,c,"Generator"),u(w,i,(function(){return this})),u(w,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=_,j.prototype={constructor:j,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(F),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,d):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),d},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),F(r),d}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;F(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:_(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},t}function v(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function m(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){v(i,n,o,a,c,"next",t)}function c(t){v(i,n,o,a,c,"throw",t)}a(void 0)}))}}function g(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,b(n.key),n)}}function b(t){var e=function(t,e){if("object"!==f(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==f(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===f(e)?e:String(e)}function w(t,e){return w=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},w(t,e)}function P(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=E(t);if(e){var o=E(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return function(t,e){if(e&&("object"===f(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,r)}}function E(t){return E=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},E(t)}var S=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&w(t,e)}(s,t);var e,r,n,o,i,a,c,u=P(s);function s(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,s),(e=u.call(this,t.form)).customCardFields=t,e.setFocusStyle(),e}return e=s,r=[{key:"setupProperties",value:function(){this.cardFields={},this.hostedCardFieldsContainers={},this.hostedFieldContainerStyleProperties=["height"],this.hostedInputFieldStyleProperties=["color","direction","font-size","letter-spacing","line-height"],this.hostedFocusedInputFieldStyleProperties=["color","border-left-color"],this.hostedInputFieldPlaceholderStyleProperties=["color"],this.styles={container:{},input:{},"input:focus":{},"input:placeholder":{}}}},{key:"renderPaymentMethodOption",value:(c=m(y().mark((function t(){var e,r,n,o,i,a,c=this;return y().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.setupContainerForHostedCardFields(),this.applyStyleToContainer(),e="submit.".concat(this.form.getAttribute("id")),r=this.createOrderHandler.bind(this),t.next=6,this.getComputedInputFieldForHostedField();case 6:return n=t.sent,o=this.getPayPalHostedCardFields(),t.next=10,paypal.HostedFields.render({createOrder:r,styles:n,fields:o}).catch((function(t){c.displayErrorMessage(t)}));case 10:i=t.sent,a=this.onSubmitHandlerForDonationForm.bind(this),this.addEventToHostedFields(i),this.jQueryForm.off(e).on(e,{hostedCardFields:i},a);case 14:case"end":return t.stop()}}),t,this)}))),function(){return c.apply(this,arguments)})},{key:"setupContainerForHostedCardFields",value:function(){var t=this.customCardFields.cardFields,e="";for(var r in t){var n=document.createElement("div");e=t[r].el.getAttribute("name");var o="give-".concat(t[r].el.getAttribute("id")),i=void 0;(i=this.form.querySelector("#".concat(o)))?(i.innerHTML="",this.hostedCardFieldsContainers[this.getFieldTypeByFieldName(e)]=i):(n.setAttribute("id",o),n.setAttribute("class","give-paypal-commerce-cc-field give-input-field-wrapper"),this.hostedCardFieldsContainers[this.getFieldTypeByFieldName(e)]=t[r].el.parentElement.appendChild(n))}this.toggleFields()}},{key:"getPayPalHostedCardFields",value:function(){return{number:{selector:"#".concat(this.hostedCardFieldsContainers.number.getAttribute("id")),placeholder:givePayPalCommerce.cardFieldPlaceholders.cardNumber},cvv:{selector:"#".concat(this.hostedCardFieldsContainers.cvv.getAttribute("id")),placeholder:givePayPalCommerce.cardFieldPlaceholders.cardCvc},expirationDate:{selector:"#".concat(this.hostedCardFieldsContainers.expirationDate.getAttribute("id")),placeholder:givePayPalCommerce.cardFieldPlaceholders.expirationDate}}}},{key:"approvePayment",value:(a=m(y().mark((function t(e){var r;return y().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,fetch("".concat(this.ajaxurl,"?action=give_paypal_commerce_approve_order&order=")+e,{method:"POST",body:j.getFormDataWithoutGiveActionField(this.form)});case 2:return r=t.sent,t.next=5,r.json();case 5:return t.abrupt("return",t.sent);case 6:case"end":return t.stop()}}),t,this)}))),function(t){return a.apply(this,arguments)})},{key:"getComputedInputFieldForHostedField",value:function(){return{input:h(h({},this.styles.input),givePayPalCommerce.hostedCardFieldStyles.input),":focus":h({color:this.styles["input:focus"].color},givePayPalCommerce.hostedCardFieldStyles[":focus"]),":placeholder":h({color:this.styles["input:placeholder"].color},givePayPalCommerce.hostedCardFieldStyles[":placeholder"])}}},{key:"onSubmitHandlerForDonationForm",value:(i=m(y().mark((function t(e){var r,n,o,i;return y().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(j.isPayPalCommerceSelected(this.jQueryForm)){t.next=2;break}return t.abrupt("return",!0);case 2:if(!j.isRecurringDonation(this.form)){t.next=6;break}return Give.form.fn.showProcessingState(window.givePayPalCommerce.textForOverlayScreen),this.submitDonationForm(),t.abrupt("return");case 6:return r=this.hostedFieldOnSubmitErrorHandler.bind(this),e.preventDefault(),Give.form.fn.removeErrors(this.jQueryForm),n=e.data.hostedCardFields,o=this.getExtraCardDetails.bind(this),t.next=13,n.submit(h({contingencies:["SCA_WHEN_REQUIRED"]},o)).catch(r);case 13:if(i=t.sent){t.next=16;break}return t.abrupt("return",!1);case 16:if(!this.canThreeDsAuthorizeCard(i)||this.IsCardThreeDsAuthorized(i)){t.next=19;break}return Give.form.fn.addErrorsAndResetDonationButton(this.jQueryForm,Give.form.fn.getErrorHTML([{message:givePayPalCommerce.threeDsCardAuthenticationFailedNotice}])),t.abrupt("return",!1);case 19:return t.next=21,this.onApproveHandler(i);case 21:return t.abrupt("return",!1);case 22:case"end":return t.stop()}}),t,this)}))),function(t){return i.apply(this,arguments)})},{key:"onApproveHandler",value:(o=m(y().mark((function t(e){var r;return y().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return Give.form.fn.showProcessingState(window.givePayPalCommerce.textForOverlayScreen),t.next=3,this.approvePayment(e.orderId);case 3:if((r=t.sent).success){t.next=8;break}return this.hostedFieldOnSubmitErrorHandler(r.data.error),Give.form.fn.hideProcessingState(),t.abrupt("return");case 8:return t.next=10,j.addFieldToForm(this.form,r.data.order.id,"payPalOrderId");case 10:this.submitDonationForm();case 11:case"end":return t.stop()}}),t,this)}))),function(t){return o.apply(this,arguments)})},{key:"getExtraCardDetails",value:function(){return{cardholderName:this.form.getElementById("#card_name").value}}},{key:"addEventToHostedFields",value:function(t){var e=this;t.on("focus",(function(t){e.hostedCardFieldsContainers[t.emittedBy].classList.add("has-focus")})),t.on("blur",(function(t){e.hostedCardFieldsContainers[t.emittedBy].classList.remove("has-focus")}))}},{key:"applyStyleToContainer",value:function(){this.computedStyles(),this.setHostedFieldContainerHeight(),window.addEventListener("load",this.setHostedFieldContainerHeight.bind(this))}},{key:"computedStyles",value:function(){var t=this,e=this.form.querySelector('input[name="card_name"]'),r=window.getComputedStyle(e,null);Array.from(this.styles.container).length||(this.hostedFieldContainerStyleProperties.forEach((function(e){t.styles.container=h(p({},e,r.getPropertyValue(e)),t.styles.container)})),this.hostedInputFieldStyleProperties.forEach((function(e){t.styles.input=h(p({},e,r.getPropertyValue(e)),t.styles.input)})),this.hostedInputFieldPlaceholderStyleProperties.forEach((function(e){t.styles["input:placeholder"]=h(p({},e,r.getPropertyValue(e)),t.styles["input:placeholder"])})))}},{key:"setHostedFieldContainerHeight",value:function(){if(this.styles.container.height="".concat(this.form.querySelector('input[name="card_name"]').offsetHeight,"px"),!["auto","0px"].includes(this.styles.container.height))for(var t in this.hostedCardFieldsContainers)this.hostedCardFieldsContainers[t].style.setProperty("height",this.styles.container.height)}},{key:"setFocusStyle",value:function(){var t=this;this.form.querySelectorAll('input[type="text"]').forEach((function(e){e.addEventListener("focus",(function(e){if(!Array.from(t.styles["input:focus"]).length){var r=window.getComputedStyle(e.target,null);t.hostedFocusedInputFieldStyleProperties.forEach((function(e){t.styles["input:focus"]=h(p({},e,r.getPropertyValue(e)),t.styles["input:focus"])}))}}),{once:!0})}))}},{key:"canThreeDsAuthorizeCard",value:function(t){return["NO","POSSIBLE"].includes(t.liabilityShift)}},{key:"IsCardThreeDsAuthorized",value:function(t){return t.liabilityShifted&&"POSSIBLE"===t.liabilityShift}},{key:"hostedFieldOnSubmitErrorHandler",value:function(t){var e={},r=[];if(!t)return r.push({message:window.givePayPalCommerce.genericDonorErrorMessage}),Give.form.fn.resetDonationButton(this.jQueryForm),void Give.form.fn.addErrorsAndResetDonationButton(this.jQueryForm,Give.form.fn.getErrorHTML(r));if("string"==typeof t)return r.push({message:t}),Give.form.fn.resetDonationButton(this.jQueryForm),void Give.form.fn.addErrorsAndResetDonationButton(this.jQueryForm,Give.form.fn.getErrorHTML(r));for(var n in t.details.forEach((function(t){if(t.hasOwnProperty("field")){if(!e.hasOwnProperty("".concat(t.field))){var n="";if(-1!==t.field.indexOf("expiry"))n=givePayPalCommerce.paypalCardInfoErrorPrefixes.expirationDateField;else if(-1!==t.field.indexOf("number"))n=givePayPalCommerce.paypalCardInfoErrorPrefixes.cardNumberField;else{if(-1===t.field.indexOf("security_code"))return t.hasOwnProperty("description")?void r.push({message:t.description}):void r.push({message:"".concat(givePayPalCommerce.genericDonorErrorMessage," ").concat(givePayPalCommerce.errorCodeLabel,": ").concat(t.issue)});n=givePayPalCommerce.paypalCardInfoErrorPrefixes.cardCvcField}e["".concat(t.field)]=n?["<strong>".concat(n,"</strong>")]:[]}e["".concat(t.field)].push("".concat(t.description,"."))}else r.push({message:t.description})})),e)r.push({message:e[n].join(" ")});Give.form.fn.addErrorsAndResetDonationButton(this.jQueryForm,Give.form.fn.getErrorHTML(r))}},{key:"submitDonationForm",value:function(){this.jQueryForm.off("submit"),this.jQueryForm.submit()}},{key:"toggleFields",value:function(){var t=j.isRecurringDonation(this.form)?"none":"block",e="none"===t&&!l.canShow(this.form);for(var r in this.toggleCardNameField(e),this.hostedCardFieldsContainers)this.hostedCardFieldsContainers[r].style.display=t,this.hostedCardFieldsContainers[r].parentElement.style.display=e?"none":"block";this.customCardFields.separator&&(this.customCardFields.separator.style.display=e?"none":"flex")}},{key:"toggleCardNameField",value:function(t){var e=this.form.querySelector('input[name="card_name"]');e.parentElement.style.display=t?"none":"block",e.disabled=t}},{key:"getFieldTypeByFieldName",value:function(t){return"card_number"===t?"number":"card_cvc"===t?"cvv":"card_expiry"===t?"expirationDate":void 0}}],n=[{key:"canShow",value:function(){var t;return!0===(null===(t=paypal)||void 0===t||null===(t=t.HostedFields)||void 0===t?void 0:t.isEligible())&&"1"===window.givePayPalCommerce.supportsCustomPayments&&-1!==givePayPalCommerce.payPalSdkQueryParameters.components.indexOf("hosted-fields")}}],r&&g(e.prototype,r),n&&g(e,n),Object.defineProperty(e,"prototype",{writable:!1}),s}(o);const x=S;function O(t){return O="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},O(t)}function F(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(o=n.key,i=void 0,i=function(t,e){if("object"!==O(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==O(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(o,"string"),"symbol"===O(i)?i:String(i)),n)}var o,i}const j=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,r,n;return e=t,n=[{key:"getFormDataWithoutGiveActionField",value:function(t){var e=new FormData(t);return e.delete("give_action"),e}},{key:"addFieldToForm",value:function(t,e,r){var n=document.createElement("input");return n.type="hidden",n.name=r,n.value=e,new Promise((function(e,r){e(t.appendChild(n))}))}},{key:"isPayPalCommerceSelected",value:function(t){return"paypal-commerce"===Give.form.fn.getGateway(t)}},{key:"addErrors",value:function(t,e){t.find("#give-paypal-commerce-smart-buttons-wrap").before(e)}},{key:"isRecurringDonation",value:function(t){var e=t.querySelector('input[name="_give_is_donation_recurring"]');return e&&"1"===e.value}},{key:"trackRecurringHiddenFieldChange",value:function(e,r){new window.MutationObserver((function(e){e[0].oldValue!==e[0].target.value&&t.isPayPalCommerceSelected(jQuery(e[0].target).closest(".give-form"))&&r.call()})).observe(e,{attributeFilter:["value"],attributeOldValue:!0})}},{key:"trackDonationCurrencyChange",value:function(e,r){new window.MutationObserver((function(e){e[0].oldValue!==e[0].target.getAttribute("data-currency_code")&&t.isPayPalCommerceSelected(jQuery(e[0].target))&&r.call()})).observe(e,{attributeFilter:["data-currency_code"],attributeOldValue:!0})}},{key:"toggleDonateNowButton",value:function(e){var r="";(!x.canShow()||t.isRecurringDonation(e)&&!l.canShow(e))&&(r="none"),e.querySelector('input[name="give-purchase"]').style.display=r}}],(r=null)&&F(e.prototype,r),n&&F(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function _(t){return _="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_(t)}function k(){k=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function s(t,e,r,o){var i=e&&e.prototype instanceof d?e:d,a=Object.create(i.prototype),c=new O(o||[]);return n(a,"_invoke",{value:P(t,r,c)}),a}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=s;var f={};function d(){}function h(){}function p(){}var y={};u(y,i,(function(){return this}));var v=Object.getPrototypeOf,m=v&&v(v(F([])));m&&m!==e&&r.call(m,i)&&(y=m);var g=p.prototype=d.prototype=Object.create(y);function b(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function o(n,i,a,c){var u=l(t[n],t,i);if("throw"!==u.type){var s=u.arg,f=s.value;return f&&"object"==_(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){o("next",t,a,c)}),(function(t){o("throw",t,a,c)})):e.resolve(f).then((function(t){s.value=t,a(s)}),(function(t){return o("throw",t,a,c)}))}c(u.arg)}var i;n(this,"_invoke",{value:function(t,r){function n(){return new e((function(e,n){o(t,r,e,n)}))}return i=i?i.then(n,n):n()}})}function P(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return j()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=E(a,r);if(c){if(c===f)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=l(t,e,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===f)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}function E(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,E(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var o=l(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,f;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function S(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function x(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function O(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(S,this),this.reset(!0)}function F(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:j}}function j(){return{value:void 0,done:!0}}return h.prototype=p,n(g,"constructor",{value:p,configurable:!0}),n(p,"constructor",{value:h,configurable:!0}),h.displayName=u(p,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===h||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,u(t,c,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},b(w.prototype),u(w.prototype,a,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new w(s(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},b(g),u(g,c,"Generator"),u(g,i,(function(){return this})),u(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=F,O.prototype={constructor:O,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(x),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),x(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;x(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:F(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function C(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function L(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){C(i,n,o,a,c,"next",t)}function c(t){C(i,n,o,a,c,"throw",t)}a(void 0)}))}}function G(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(o=n.key,i=void 0,i=function(t,e){if("object"!==_(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==_(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(o,"string"),"symbol"===_(i)?i:String(i)),n)}var o,i}function D(t,e){return D=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},D(t,e)}function T(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=A(t);if(e){var o=A(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return function(t,e){if(e&&("object"===_(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,r)}}function A(t){return A=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},A(t)}var N=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&D(t,e)}(s,t);var e,r,n,o,i,a,c,u=T(s);function s(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,s),u.apply(this,arguments)}return e=s,r=[{key:"setupProperties",value:function(){this.ccFieldsContainer=this.form.querySelector('[id^="give_cc_fields-"]'),this.recurringChoiceHiddenField=this.form.querySelector('input[name="_give_is_donation_recurring"]'),this.smartButton=null,this.updateOrderAmount=!1}},{key:"getButtonContainer",value:function(){this.ccFieldsContainer=this.form.querySelector('[id^="give_cc_fields-"]');var t=this.ccFieldsContainer.querySelector("#give-paypal-commerce-smart-buttons-wrap");if(t)return t;var e=document.createElement("div"),r=this.ccFieldsContainer.querySelector(".separator-with-text");e.setAttribute("id","give-paypal-commerce-smart-buttons-wrap");var n=this.ccFieldsContainer.querySelector("[id^=give-card-number-wrap-]");return this.ccFieldsContainer.insertBefore(e,r||n)}},{key:"renderPaymentMethodOption",value:function(){var t=this;this.smartButtonContainer=this.getButtonContainer(),this.smartButton&&this.smartButton.close();var e={onInit:this.onInitHandler.bind(this),onClick:this.onClickHandler.bind(this),createOrder:this.createOrderHandler.bind(this),onApprove:this.orderApproveHandler.bind(this),style:{layout:"vertical",size:"responsive",shape:"rect",label:"paypal",color:"gold",tagline:!1},onError:function(e){t.displayErrorMessage(e)}};return j.isRecurringDonation(this.form)&&(e.createSubscription=this.creatSubscriptionHandler.bind(this),e.onApprove=this.subscriptionApproveHandler.bind(this),delete e.createOrder),j.toggleDonateNowButton(this.form),this.smartButton=paypal.Buttons(e),this.smartButton.render(this.smartButtonContainer)}},{key:"onInitHandler",value:function(t,e){}},{key:"onClickHandler",value:(c=L(k().mark((function t(e,r){var n,o;return k().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=new FormData(this.form),x.canShow()&&(n.delete("card_name"),n.delete("card_cvc"),n.delete("card_number"),n.delete("card_expiry")),Give.form.fn.removeErrors(this.jQueryForm),t.next=5,Give.form.fn.isDonorFilledValidData(this.form,n);case 5:if("success"!==(o=t.sent)){t.next=9;break}return this.observeAmount(),t.abrupt("return",r.resolve());case 9:return this.showError(o),t.abrupt("return",r.reject());case 11:case"end":return t.stop()}}),t,this)}))),function(t,e){return c.apply(this,arguments)})},{key:"observeAmount",value:function(){var t=this,e=t.form.querySelector("#give-amount");e&&new MutationObserver((function(e){t.updateOrderAmount=!0})).observe(e,{attributes:!0,childList:!0,characterData:!0})}},{key:"creatSubscriptionHandler",value:(a=L(k().mark((function t(e,r){var n,o,i,a;return k().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return Give.form.fn.removeErrors(this.jQueryForm),t.next=3,fetch("".concat(this.ajaxurl,"?action=give_paypal_commerce_create_plan_id"),{method:"POST",body:j.getFormDataWithoutGiveActionField(this.form)});case 3:return n=t.sent,t.next=6,n.json();case 6:if((o=t.sent).success){t.next=9;break}throw o.data.error;case 9:return i=new FormData(this.form),a={name:{given_name:i.get("give_first"),surname:i.get("give_last")},email_address:i.get("give_email")},i.get("billing_country")&&(a.shipping_address={name:{full_name:"".concat(i.get("give_first")," ").concat(i.get("give_last")).trim()},address:{address_line_1:i.get("card_address"),address_line_2:i.get("card_address_2"),admin_area_2:i.get("card_city"),admin_area_1:i.get("card_state"),postal_code:i.get("card_zip"),country_code:i.get("billing_country")}}),t.abrupt("return",r.subscription.create({plan_id:o.data.id,subscriber:a}));case 13:case"end":return t.stop()}}),t,this)}))),function(t,e){return a.apply(this,arguments)})},{key:"subscriptionApproveHandler",value:(i=L(k().mark((function t(e,r){return k().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return Give.form.fn.showProcessingState(window.givePayPalCommerce.textForOverlayScreen),t.next=3,j.addFieldToForm(this.form,e.subscriptionID,"payPalSubscriptionId");case 3:this.submitDonationForm();case 4:case"end":return t.stop()}}),t,this)}))),function(t,e){return i.apply(this,arguments)})},{key:"orderApproveHandler",value:(o=L(k().mark((function t(e,r){var n,o,i,a,c;return k().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return Give.form.fn.showProcessingState(window.givePayPalCommerce.textForOverlayScreen),Give.form.fn.disable(this.jQueryForm,!0),Give.form.fn.removeErrors(this.jQueryForm),t.next=5,fetch("".concat(this.ajaxurl,"?action=give_paypal_commerce_approve_order&order=").concat(e.orderID,"&update_amount=").concat(this.updateOrderAmount),{method:"post",body:j.getFormDataWithoutGiveActionField(this.form)});case 5:return n=t.sent,t.next=8,n.json();case 8:if((o=t.sent).success){t.next=18;break}if(Give.form.fn.disable(this.jQueryForm,!1),Give.form.fn.hideProcessingState(),this.displayErrorMessage(o.data.error,!0),!(i=null===(a=o.data.error)||void 0===a||null===(a=a.details)||void 0===a?void 0:a[0])||"INSTRUMENT_DECLINED"!==i.issue){t.next=17;break}return t.abrupt("return",r.restart());case 17:return t.abrupt("return");case 18:return c=o.data.order,t.next=21,j.addFieldToForm(this.form,c.id,"payPalOrderId");case 21:this.submitDonationForm();case 22:case"end":return t.stop()}}),t,this)}))),function(t,e){return o.apply(this,arguments)})},{key:"submitDonationForm",value:function(){this.jQueryForm.off("submit"),this.removeCreditCardFields(),this.form.submit()}},{key:"removeCreditCardFields",value:function(){if(x.canShow()){this.jQueryForm.find('input[name="card_name"]').parent().remove(),this.ccFieldsContainer.querySelector(".separator-with-text").remove();var t=new l(this.form);for(var e in t.cardFields)t.cardFields[e].el.parentElement.remove()}}}],n=[{key:"canShow",value:function(){return-1!==givePayPalCommerce.payPalSdkQueryParameters.components.indexOf("buttons")}}],r&&G(e.prototype,r),n&&G(e,n),Object.defineProperty(e,"prototype",{writable:!1}),s}(o);const H=N;function I(t){var e="https://www.paypal.com/sdk/js";t.sdkBaseURL&&(e=t.sdkBaseURL,delete t.sdkBaseURL),function(t){var e=t["merchant-id"],r=t["data-merchant-id"],n="",o="";Array.isArray(e)?e.length>1?(n="*",o=e.toString()):n=e.toString():"string"==typeof e&&e.length>0?n=e:"string"==typeof r&&r.length>0&&(n="*",o=r);t["merchant-id"]=n,t["data-merchant-id"]=o}(t);var r=Object.keys(t).filter((function(e){return void 0!==t[e]&&null!==t[e]&&""!==t[e]})).reduce((function(e,r){var n=t[r].toString();return"data-"===r.substring(0,5)?e.dataAttributes[r]=n:e.queryParams[r]=n,e}),{queryParams:{},dataAttributes:{}}),n=r.queryParams,o=r.dataAttributes;return{url:"".concat(e,"?").concat(Q(n)),dataAttributes:o}}function Q(t){var e="";return Object.keys(t).forEach((function(r){0!==e.length&&(e+="&"),e+=r+"="+t[r]})),e}function B(t,e){void 0===e&&(e={});var r=document.createElement("script");return r.src=t,Object.keys(e).forEach((function(t){r.setAttribute(t,e[t]),"data-csp-nonce"===t&&r.setAttribute("nonce",e["data-csp-nonce"])})),r}function R(t,e){if(void 0===e&&(e=q()),V(t,e),"undefined"==typeof document)return e.resolve(null);var r=I(t),n=r.url,o=r.dataAttributes,i=o["data-namespace"]||"paypal",a=M(i);return function(t,e){var r=document.querySelector('script[src="'.concat(t,'"]'));if(null===r)return null;var n=B(t,e),o=r.cloneNode();if(delete o.dataset.uidAuto,Object.keys(o.dataset).length!==Object.keys(n.dataset).length)return null;var i=!0;return Object.keys(o.dataset).forEach((function(t){o.dataset[t]!==n.dataset[t]&&(i=!1)})),i?r:null}(n,o)&&a?e.resolve(a):function(t,e){void 0===e&&(e=q());V(t,e);var r=t.url,n=t.attributes;if("string"!=typeof r||0===r.length)throw new Error("Invalid url.");if(void 0!==n&&"object"!=typeof n)throw new Error("Expected attributes to be an object.");return new e((function(t,e){if("undefined"==typeof document)return t();!function(t){var e=t.url,r=t.attributes,n=t.onSuccess,o=t.onError,i=B(e,r);i.onerror=o,i.onload=n,document.head.insertBefore(i,document.head.firstElementChild)}({url:r,attributes:n,onSuccess:function(){return t()},onError:function(){var t=new Error('The script "'.concat(r,'" failed to load.'));return window.fetch?fetch(r).then((function(r){return 200===r.status&&e(t),r.text()})).then((function(t){var r=function(t){var e=t.split("/* Original Error:")[1];return e?e.replace(/\n/g,"").replace("*/","").trim():t}(t);e(new Error(r))})).catch((function(t){e(t)})):e(t)}})}))}({url:n,attributes:o},e).then((function(){var t=M(i);if(t)return t;throw new Error("The window.".concat(i," global variable is not available."))}))}function q(){if("undefined"==typeof Promise)throw new Error("Promise is undefined. To resolve the issue, use a Promise polyfill.");return Promise}function M(t){return window[t]}function V(t,e){if("object"!=typeof t||null===t)throw new Error("Expected an options object.");if(void 0!==e&&"function"!=typeof e)throw new Error("Expected PromisePonyfill to be a function.")}const Y=window.wp.i18n;function z(t){return z="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},z(t)}function W(){W=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function s(t,e,r,o){var i=e&&e.prototype instanceof d?e:d,a=Object.create(i.prototype),c=new O(o||[]);return n(a,"_invoke",{value:P(t,r,c)}),a}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=s;var f={};function d(){}function h(){}function p(){}var y={};u(y,i,(function(){return this}));var v=Object.getPrototypeOf,m=v&&v(v(F([])));m&&m!==e&&r.call(m,i)&&(y=m);var g=p.prototype=d.prototype=Object.create(y);function b(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function o(n,i,a,c){var u=l(t[n],t,i);if("throw"!==u.type){var s=u.arg,f=s.value;return f&&"object"==z(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){o("next",t,a,c)}),(function(t){o("throw",t,a,c)})):e.resolve(f).then((function(t){s.value=t,a(s)}),(function(t){return o("throw",t,a,c)}))}c(u.arg)}var i;n(this,"_invoke",{value:function(t,r){function n(){return new e((function(e,n){o(t,r,e,n)}))}return i=i?i.then(n,n):n()}})}function P(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return j()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=E(a,r);if(c){if(c===f)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=l(t,e,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===f)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}function E(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,E(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var o=l(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,f;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function S(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function x(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function O(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(S,this),this.reset(!0)}function F(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:j}}function j(){return{value:void 0,done:!0}}return h.prototype=p,n(g,"constructor",{value:p,configurable:!0}),n(p,"constructor",{value:h,configurable:!0}),h.displayName=u(p,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===h||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,u(t,c,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},b(w.prototype),u(w.prototype,a,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new w(s(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},b(g),u(g,c,"Generator"),u(g,i,(function(){return this})),u(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=F,O.prototype={constructor:O,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(x),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),x(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;x(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:F(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function U(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function J(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?U(Object(r),!0).forEach((function(e){K(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):U(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function K(t,e,r){return(e=function(t){var e=function(t,e){if("object"!==z(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==z(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===z(e)?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function X(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}document.addEventListener("DOMContentLoaded",(function(){var t=document.querySelectorAll(".give-form-wrap"),e=[];function r(t){!function(t){var e=t.querySelector('input[name="_give_is_donation_recurring"]');e&&j.trackRecurringHiddenFieldChange(e,(function(){i(t)}))}(t),function(t){j.trackDonationCurrencyChange(t,(function(){i(t)}))}(t),function(t){document.addEventListener("give_gateway_loaded",(function(){j.isPayPalCommerceSelected(jQuery(t))&&i(t)}))}(t)}function n(t){var e=new H(t),r=new l(t);if(H.canShow()&&e.boot(),x.canShow()){var n=new x(r);return r.boot(),void n.boot()}r.removeFields()}function o(){var t;return t=W().mark((function t(e){var r,n;return W().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=J({},givePayPalCommerce.payPalSdkQueryParameters),n=j.isRecurringDonation(e),r.intent=n?"subscription":"capture",r.vault=!!n,r.currency=Give.form.fn.getInfo("currency_code",jQuery(e)),t.next=7,R(r);case 7:return t.abrupt("return",t.sent);case 8:case"end":return t.stop()}}),t)})),o=function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){X(i,n,o,a,c,"next",t)}function c(t){X(i,n,o,a,c,"throw",t)}a(void 0)}))},o.apply(this,arguments)}function i(e){(function(t){return o.apply(this,arguments)})(e).then((function(){!function(){var e=function(t){j.isPayPalCommerceSelected(jQuery(t))&&n(t)};t.forEach((function(t){var r=t.querySelector(".give-form");t.classList.contains("give-display-button-only")||t.classList.contains("give-display-modal")||r&&e(r)}));var r=document.querySelector(".mfp-content form.give-form");r&&e(r)}()})).then((function(){var t=givePayPalCommerce.payPalSdkQueryParameters.components.split(",");paypal.hasOwnProperty("HostedFields")&&-1!==t.indexOf("hosted-fields")&&(x.canShow()||(t=t.filter((function(t){return"hosted-fields"!==t})),givePayPalCommerce.payPalSdkQueryParameters.components=t.join(","),i(e)))})).catch((function(t){var r=jQuery(e);Give.form.fn.addErrors(r,Give.form.fn.getErrorHTML([{message:(0,Y.__)("A problem has occurred with the connection between this site and PayPal, preventing donations. Please contact site administrators if reloading the page does not fix the issue. This is usually the result of some JavaScript conflict on the page.","give")}])),Give.form.fn.disable(r,!0),console.error(t)}))}t.forEach((function(t){Give.form.fn.hasDonationForm(t)&&e.push(t)})),e.length&&(i((t=e)[0].querySelector(".give-form")),t.forEach((function(t){var e=t.querySelector(".give-form");t.classList.contains("give-display-button-only")||t.classList.contains("give-display-modal")||r(e)})),jQuery(".give-form-wrap.give-display-button-only button.give-btn-modal, .give-form-wrap.give-display-modal button.give-btn-modal").on("click",(function(){var t=window.setInterval((function(){var e=document.querySelector(".mfp-content form.give-form");e&&(j.isPayPalCommerceSelected(jQuery(e))&&n(e),r(e),window.clearInterval(t))}),100)})),jQuery("form.give-form").on("submit",(function(t){return!j.isPayPalCommerceSelected(jQuery(undefined))||(t.preventDefault(),!1)})))}))})();

Youez - 2016 - github.com/yon3zu
LinuXploit