Spamworldpro Mini Shell
Spamworldpro


Server : Apache
System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64
User : corals ( 1002)
PHP Version : 7.4.33
Disable Function : exec,passthru,shell_exec,system
Directory :  /home/corals/mets.corals.io/wp-content/plugins/give/assets/dist/js/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/corals/mets.corals.io/wp-content/plugins/give/assets/dist/js/paypal-commerce.js
(()=>{var e={87757:(e,t,r)=>{e.exports=r(35666)},35666:e=>{var t=function(e){"use strict";var t,r=Object.prototype,n=r.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function s(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{s({},"")}catch(e){s=function(e,t,r){return e[t]=r}}function u(e,t,r,n){var o=t&&t.prototype instanceof v?t:v,i=Object.create(o.prototype),a=new E(n||[]);return i._invoke=function(e,t,r){var n=f;return function(o,i){if(n===h)throw new Error("Generator is already running");if(n===p){if("throw"===o)throw i;return k()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=O(a,r);if(c){if(c===y)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===f)throw n=p,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=h;var s=l(e,t,r);if("normal"===s.type){if(n=r.done?p:d,s.arg===y)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n=p,r.method="throw",r.arg=s.arg)}}}(e,r,a),i}function l(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=u;var f="suspendedStart",d="suspendedYield",h="executing",p="completed",y={};function v(){}function m(){}function b(){}var g={};g[i]=function(){return this};var w=Object.getPrototypeOf,P=w&&w(w(x([])));P&&P!==r&&n.call(P,i)&&(g=P);var F=b.prototype=v.prototype=Object.create(g);function _(e){["next","throw","return"].forEach((function(t){s(e,t,(function(e){return this._invoke(t,e)}))}))}function C(e,t){function r(o,i,a,c){var s=l(e[o],e,i);if("throw"!==s.type){var u=s.arg,f=u.value;return f&&"object"==typeof f&&n.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,a,c)}),(function(e){r("throw",e,a,c)})):t.resolve(f).then((function(e){u.value=e,a(u)}),(function(e){return r("throw",e,a,c)}))}c(s.arg)}var o;this._invoke=function(e,n){function i(){return new t((function(t,o){r(e,n,t,o)}))}return o=o?o.then(i,i):i()}}function O(e,r){var n=e.iterator[r.method];if(n===t){if(r.delegate=null,"throw"===r.method){if(e.iterator.return&&(r.method="return",r.arg=t,O(e,r),"throw"===r.method))return y;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return y}var o=l(n,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,y;var i=o.arg;return i?i.done?(r[e.resultName]=i.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function S(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function j(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function E(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(S,this),this.reset(!0)}function x(e){if(e){var r=e[i];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,a=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}return{next:k}}function k(){return{value:t,done:!0}}return m.prototype=F.constructor=b,b.constructor=m,m.displayName=s(b,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===m||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,s(e,c,"GeneratorFunction")),e.prototype=Object.create(F),e},e.awrap=function(e){return{__await:e}},_(C.prototype),C.prototype[a]=function(){return this},e.AsyncIterator=C,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new C(u(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},_(F),s(F,c,"Generator"),F[i]=function(){return this},F.toString=function(){return"[object Generator]"},e.keys=function(e){var t=[];for(var r in e)t.push(r);return t.reverse(),function r(){for(;t.length;){var n=t.pop();if(n in e)return r.value=n,r.done=!1,r}return r.done=!0,r}},e.values=x,E.prototype={constructor:E,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(j),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return c.type="throw",c.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var s=n.call(a,"catchLoc"),u=n.call(a,"finallyLoc");if(s&&u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),y},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),j(r),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;j(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:x(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y}},e}(e.exports);try{regeneratorRuntime=t}catch(e){Function("r","regeneratorRuntime = r")(t)}}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,r),i.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";var e=r(87757),t=r.n(e);function n(e,t,r,n,o,i,a){try{var c=e[i](a),s=c.value}catch(e){return void r(e)}c.done?t(s):Promise.resolve(s).then(n,o)}function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var i=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.form=t,this.jQueryForm=jQuery(t),this.ajaxurl=Give.fn.getGlobalVar("ajaxurl"),this.setupProperties()}var r,i,a,c,s;return r=e,i=[{key:"setupProperties",value:function(){}},{key:"boot",value:function(){this.renderPaymentMethodOption()}},{key:"renderPaymentMethodOption",value:function(){}},{key:"showError",value:function(e){e.hasOwnProperty("details")?k.addErrors(this.jQueryForm,Give.form.fn.getErrorHTML([{message:e.details[0].description}])):k.addErrors(this.jQueryForm,e)}},{key:"isInTestMode",value:function(){return"1"===Give.fn.getGlobalVar("is_test_mode")}},{key:"displayErrorMessage",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=Give.form.fn.getErrorHTML([{message:window.givePayPalCommerce.genericDonorErrorMessage}]);(t||this.isInTestMode())&&(r=e),this.showError(r)}},{key:"isProcessingEventForForm",value:function(e){return e===this.form.getAttribute("id")&&k.isPayPalCommerceSelected(this.jQueryForm)}},{key:"createOrderHandler",value:(c=t().mark((function e(r,n){var o,i;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Give.form.fn.removeErrors(this.jQueryForm),e.next=3,fetch("".concat(this.ajaxurl,"?action=give_paypal_commerce_create_order"),{method:"POST",body:k.getFormDataWithoutGiveActionField(this.form)});case 3:return o=e.sent,e.next=6,o.json();case 6:if((i=e.sent).success){e.next=9;break}throw i.data.error;case 9:return e.abrupt("return",i.data.id);case 10:case"end":return e.stop()}}),e,this)})),s=function(){var e=this,t=arguments;return new Promise((function(r,o){var i=c.apply(e,t);function a(e){n(i,r,o,a,s,"next",e)}function s(e){n(i,r,o,a,s,"throw",e)}a(void 0)}))},function(e,t){return s.apply(this,arguments)})}],i&&o(r.prototype,i),a&&o(r,a),Object.defineProperty(r,"prototype",{writable:!1}),e}();const a=i;function c(e){return c="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},c(e)}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function l(e,t){return l=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},l(e,t)}function f(e){var t=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(e){return!1}}();return function(){var r,n=h(e);if(t){var o=h(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return d(this,r)}}function d(e,t){if(t&&("object"===c(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function h(e){return h=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},h(e)}const p=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&l(e,t)}(i,e);var t,r,n,o=f(i);function i(){return s(this,i),o.apply(this,arguments)}return t=i,n=[{key:"canShow",value:function(e){return j.canShow()&&k.isRecurringDonation(e)&&["US","AU"].includes(window.givePayPalCommerce.accountCountry)}}],(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=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 e=i.canShow(this.form)?"block":"none";for(var t in this.cardFields)this.cardFields[t].el.style.display=e,this.cardFields[t].el.disabled="none"===e}},{key:"removeFields",value:function(){for(var e in this.cardFields)this.cardFields[e].el&&this.cardFields[e].el.parentElement.remove();var t=this.form.querySelector('input[name="card_name"]');t&&t.parentElement.remove(),this.separator&&this.separator.remove()}},{key:"separatorHtml",value:function(){var e=document.createElement("div");return e.setAttribute("class","separator-with-text"),e.innerHTML='<div class="dashed-line"></div><div class="label">'.concat(givePayPalCommerce.separatorLabel,'</div><div class="dashed-line"></div>'),e}}])&&u(t.prototype,r),n&&u(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}(a);function y(e){return y="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},y(e)}function v(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 m(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?v(Object(r),!0).forEach((function(t){b(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):v(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function b(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function g(e,t,r,n,o,i,a){try{var c=e[i](a),s=c.value}catch(e){return void r(e)}c.done?t(s):Promise.resolve(s).then(n,o)}function w(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){g(i,n,o,a,c,"next",e)}function c(e){g(i,n,o,a,c,"throw",e)}a(void 0)}))}}function P(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function F(e,t){return F=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},F(e,t)}function _(e){var t=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(e){return!1}}();return function(){var r,n=O(e);if(t){var o=O(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return C(this,r)}}function C(e,t){if(t&&("object"===y(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function O(e){return O=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},O(e)}var S=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&F(e,t)}(l,e);var r,n,o,i,a,c,s,u=_(l);function l(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,l),(t=u.call(this,e.form)).customCardFields=e,t.setFocusStyle(),t}return r=l,n=[{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:(s=w(t().mark((function e(){var r,n,o,i,a,c,s=this;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.setupContainerForHostedCardFields(),this.applyStyleToContainer(),r="submit.".concat(this.form.getAttribute("id")),n=this.createOrderHandler.bind(this),e.next=6,this.getComputedInputFieldForHostedField();case 6:return o=e.sent,i=this.getPayPalHostedCardFields(),e.next=10,paypal.HostedFields.render({createOrder:n,styles:o,fields:i}).catch((function(e){s.displayErrorMessage(e)}));case 10:a=e.sent,c=this.onSubmitHandlerForDonationForm.bind(this),this.addEventToHostedFields(a),this.jQueryForm.off(r).on(r,{hostedCardFields:a},c);case 14:case"end":return e.stop()}}),e,this)}))),function(){return s.apply(this,arguments)})},{key:"setupContainerForHostedCardFields",value:function(){var e=this.customCardFields.cardFields,t="";for(var r in e){var n=document.createElement("div");t=e[r].el.getAttribute("name");var o="give-".concat(e[r].el.getAttribute("id")),i=void 0;(i=this.form.querySelector("#".concat(o)))?(i.innerHTML="",this.hostedCardFieldsContainers[this.getFieldTypeByFieldName(t)]=i):(n.setAttribute("id",o),n.setAttribute("class","give-paypal-commerce-cc-field give-input-field-wrapper"),this.hostedCardFieldsContainers[this.getFieldTypeByFieldName(t)]=e[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:(c=w(t().mark((function e(r){var n;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch("".concat(this.ajaxurl,"?action=give_paypal_commerce_approve_order&order=")+r,{method:"POST",body:k.getFormDataWithoutGiveActionField(this.form)});case 2:return n=e.sent,e.next=5,n.json();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e){return c.apply(this,arguments)})},{key:"getComputedInputFieldForHostedField",value:function(){return{input:m(m({},this.styles.input),givePayPalCommerce.hostedCardFieldStyles.input),":focus":m({color:this.styles["input:focus"].color},givePayPalCommerce.hostedCardFieldStyles[":focus"]),":placeholder":m({color:this.styles["input:placeholder"].color},givePayPalCommerce.hostedCardFieldStyles[":placeholder"])}}},{key:"onSubmitHandlerForDonationForm",value:(a=w(t().mark((function e(r){var n,o,i,a;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(k.isPayPalCommerceSelected(this.jQueryForm)){e.next=2;break}return e.abrupt("return",!0);case 2:if(!k.isRecurringDonation(this.form)){e.next=6;break}return Give.form.fn.showProcessingState(window.givePayPalCommerce.textForOverlayScreen),this.submitDonationForm(),e.abrupt("return");case 6:return n=this.hostedFieldOnSubmitErrorHandler.bind(this),r.preventDefault(),Give.form.fn.removeErrors(this.jQueryForm),o=r.data.hostedCardFields,i=this.getExtraCardDetails.bind(this),e.next=13,o.submit(m({contingencies:["SCA_WHEN_REQUIRED"]},i)).catch(n);case 13:if(a=e.sent){e.next=16;break}return e.abrupt("return",!1);case 16:if(!this.canThreeDsAuthorizeCard(a)||this.IsCardThreeDsAuthorized(a)){e.next=19;break}return Give.form.fn.addErrorsAndResetDonationButton(this.jQueryForm,Give.form.fn.getErrorHTML([{message:givePayPalCommerce.threeDsCardAuthenticationFailedNotice}])),e.abrupt("return",!1);case 19:return e.next=21,this.onApproveHandler(a);case 21:return e.abrupt("return",!1);case 22:case"end":return e.stop()}}),e,this)}))),function(e){return a.apply(this,arguments)})},{key:"onApproveHandler",value:(i=w(t().mark((function e(r){var n;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Give.form.fn.showProcessingState(window.givePayPalCommerce.textForOverlayScreen),e.next=3,this.approvePayment(r.orderId);case 3:if((n=e.sent).success){e.next=7;break}return this.hostedFieldOnSubmitErrorHandler(n.data.error),e.abrupt("return");case 7:return e.next=9,k.addFieldToForm(this.form,n.data.order.id,"payPalOrderId");case 9:this.submitDonationForm();case 10:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"getExtraCardDetails",value:function(){return{cardholderName:this.form.getElementById("#card_name").value}}},{key:"addEventToHostedFields",value:function(e){var t=this;e.on("focus",(function(e){t.hostedCardFieldsContainers[e.emittedBy].classList.add("has-focus")})),e.on("blur",(function(e){t.hostedCardFieldsContainers[e.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 e=this,t=this.form.querySelector('input[name="card_name"]'),r=window.getComputedStyle(t,null);Array.from(this.styles.container).length||(this.hostedFieldContainerStyleProperties.forEach((function(t){e.styles.container=m(b({},t,r.getPropertyValue(t)),e.styles.container)})),this.hostedInputFieldStyleProperties.forEach((function(t){e.styles.input=m(b({},t,r.getPropertyValue(t)),e.styles.input)})),this.hostedInputFieldPlaceholderStyleProperties.forEach((function(t){e.styles["input:placeholder"]=m(b({},t,r.getPropertyValue(t)),e.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 e in this.hostedCardFieldsContainers)this.hostedCardFieldsContainers[e].style.setProperty("height",this.styles.container.height)}},{key:"setFocusStyle",value:function(){var e=this;this.form.querySelectorAll('input[type="text"]').forEach((function(t){t.addEventListener("focus",(function(t){if(!Array.from(e.styles["input:focus"]).length){var r=window.getComputedStyle(t.target,null);e.hostedFocusedInputFieldStyleProperties.forEach((function(t){e.styles["input:focus"]=m(b({},t,r.getPropertyValue(t)),e.styles["input:focus"])}))}}),{once:!0})}))}},{key:"canThreeDsAuthorizeCard",value:function(e){return["NO","POSSIBLE"].includes(e.liabilityShift)}},{key:"IsCardThreeDsAuthorized",value:function(e){return e.liabilityShifted&&"POSSIBLE"===e.liabilityShift}},{key:"hostedFieldOnSubmitErrorHandler",value:function(e){var t={},r=[];if(!Object.values(e).length)throw Give.form.fn.resetDonationButton(this.jQueryForm),window.givePayPalCommerce.genericDonorErrorMessage;for(var n in e.details.forEach((function(e){if(e.hasOwnProperty("field")){if(!t.hasOwnProperty("".concat(e.field))){var n="";if(-1!==e.field.indexOf("expiry"))n=givePayPalCommerce.paypalCardInfoErrorPrefixes.expirationDateField;else if(-1!==e.field.indexOf("number"))n=givePayPalCommerce.paypalCardInfoErrorPrefixes.cardNumberField;else{if(-1===e.field.indexOf("security_code"))return e.hasOwnProperty("description")?void r.push({message:e.description}):void r.push({message:"".concat(givePayPalCommerce.genericDonorErrorMessage," ").concat(givePayPalCommerce.errorCodeLabel,": ").concat(e.issue)});n=givePayPalCommerce.paypalCardInfoErrorPrefixes.cardCvcField}t["".concat(e.field)]=n?["<strong>".concat(n,"</strong>")]:[]}t["".concat(e.field)].push("".concat(e.description,"."))}else r.push({message:e.description})})),t)r.push({message:t[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 e=k.isRecurringDonation(this.form)?"none":"block",t="none"===e&&!p.canShow(this.form);for(var r in this.toggleCardNameField(t),this.hostedCardFieldsContainers)this.hostedCardFieldsContainers[r].style.display=e,this.hostedCardFieldsContainers[r].parentElement.style.display=t?"none":"block";this.customCardFields.separator.style.display=t?"none":"flex"}},{key:"toggleCardNameField",value:function(e){var t=this.form.querySelector('input[name="card_name"]');t.parentElement.style.display=e?"none":"block",t.disabled=e}},{key:"getFieldTypeByFieldName",value:function(e){return"card_number"===e?"number":"card_cvc"===e?"cvv":"card_expiry"===e?"expirationDate":void 0}}],o=[{key:"canShow",value:function(){return!0===paypal.HostedFields.isEligible()&&!!window.givePayPalCommerce.supportsCustomPayments}}],n&&P(r.prototype,n),o&&P(r,o),Object.defineProperty(r,"prototype",{writable:!1}),l}(a);const j=S;function E(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var x=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,r,n;return t=e,n=[{key:"getFormDataWithoutGiveActionField",value:function(e){var t=new FormData(e);return t.delete("give_action"),t}},{key:"addFieldToForm",value:function(e,t,r){var n=document.createElement("input");return n.type="hidden",n.name=r,n.value=t,new Promise((function(t,r){t(e.appendChild(n))}))}},{key:"isPayPalCommerceSelected",value:function(e){return"paypal-commerce"===Give.form.fn.getGateway(e)}},{key:"addErrors",value:function(e,t){e.find("#give-paypal-commerce-smart-buttons-wrap").before(t)}},{key:"isRecurringDonation",value:function(e){var t=e.querySelector('input[name="_give_is_donation_recurring"]');return t&&"1"===t.value}},{key:"trackRecurringHiddenFieldChange",value:function(t,r){new window.MutationObserver((function(t){t[0].oldValue!==t[0].target.value&&e.isPayPalCommerceSelected(jQuery(t[0].target).closest(".give-form"))&&r.call()})).observe(t,{attributeFilter:["value"],attributeOldValue:!0})}},{key:"trackDonationCurrencyChange",value:function(t,r){new window.MutationObserver((function(t){t[0].oldValue!==t[0].target.getAttribute("data-currency_code")&&e.isPayPalCommerceSelected(jQuery(t[0].target))&&r.call()})).observe(t,{attributeFilter:["data-currency_code"],attributeOldValue:!0})}},{key:"toggleDonateNowButton",value:function(t){var r="";(!j.canShow()||e.isRecurringDonation(t)&&!p.canShow(t))&&(r="none"),t.querySelector('input[name="give-purchase"]').style.display=r}}],(r=null)&&E(t.prototype,r),n&&E(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();const k=x;function D(e){return D="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},D(e)}function T(e,t,r,n,o,i,a){try{var c=e[i](a),s=c.value}catch(e){return void r(e)}c.done?t(s):Promise.resolve(s).then(n,o)}function A(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){T(i,n,o,a,c,"next",e)}function c(e){T(i,n,o,a,c,"throw",e)}a(void 0)}))}}function H(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function L(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function G(e,t){return G=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},G(e,t)}function R(e){var t=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(e){return!1}}();return function(){var r,n=q(e);if(t){var o=q(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return I(this,r)}}function I(e,t){if(t&&("object"===D(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function q(e){return q=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},q(e)}var B=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&G(e,t)}(l,e);var r,n,o,i,a,c,s,u=R(l);function l(){return H(this,l),u.apply(this,arguments)}return r=l,n=[{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}},{key:"getButtonContainer",value:function(){this.ccFieldsContainer=this.form.querySelector('[id^="give_cc_fields-"]');var e=this.ccFieldsContainer.querySelector("#give-paypal-commerce-smart-buttons-wrap");if(e)return e;var t=document.createElement("div"),r=this.ccFieldsContainer.querySelector(".separator-with-text");t.setAttribute("id","give-paypal-commerce-smart-buttons-wrap");var n=this.ccFieldsContainer.querySelector("[id^=give-card-number-wrap-]");return this.ccFieldsContainer.insertBefore(t,r||n)}},{key:"renderPaymentMethodOption",value:function(){var e=this;this.smartButtonContainer=this.getButtonContainer(),this.smartButton&&this.smartButton.close();var t={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(t){e.displayErrorMessage(t)}};return k.isRecurringDonation(this.form)&&(t.createSubscription=this.creatSubscriptionHandler.bind(this),t.onApprove=this.subscriptionApproveHandler.bind(this),delete t.createOrder),k.toggleDonateNowButton(this.form),this.smartButton=paypal.Buttons(t),this.smartButton.render(this.smartButtonContainer)}},{key:"onInitHandler",value:function(e,t){}},{key:"onClickHandler",value:(s=A(t().mark((function e(r,n){var o,i;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=new FormData(this.form),j.canShow()&&(o.delete("card_name"),o.delete("card_cvc"),o.delete("card_number"),o.delete("card_expiry")),Give.form.fn.removeErrors(this.jQueryForm),e.next=5,Give.form.fn.isDonorFilledValidData(this.form,o);case 5:if("success"!==(i=e.sent)){e.next=8;break}return e.abrupt("return",n.resolve());case 8:return Give.form.fn.addErrors(this.jQueryForm,i),e.abrupt("return",n.reject());case 10:case"end":return e.stop()}}),e,this)}))),function(e,t){return s.apply(this,arguments)})},{key:"creatSubscriptionHandler",value:(c=A(t().mark((function e(r,n){var o,i;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Give.form.fn.removeErrors(this.jQueryForm),e.next=3,fetch("".concat(this.ajaxurl,"?action=give_paypal_commerce_create_plan_id"),{method:"POST",body:k.getFormDataWithoutGiveActionField(this.form)});case 3:return o=e.sent,e.next=6,o.json();case 6:if((i=e.sent).success){e.next=9;break}throw i.data.error;case 9:return e.abrupt("return",n.subscription.create({plan_id:i.data.id}));case 10:case"end":return e.stop()}}),e,this)}))),function(e,t){return c.apply(this,arguments)})},{key:"subscriptionApproveHandler",value:(a=A(t().mark((function e(r,n){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Give.form.fn.showProcessingState(window.givePayPalCommerce.textForOverlayScreen),e.next=3,k.addFieldToForm(this.form,r.subscriptionID,"payPalSubscriptionId");case 3:this.submitDonationForm();case 4:case"end":return e.stop()}}),e,this)}))),function(e,t){return a.apply(this,arguments)})},{key:"orderApproveHandler",value:(i=A(t().mark((function e(r,n){var o,i,a,c;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Give.form.fn.showProcessingState(window.givePayPalCommerce.textForOverlayScreen),Give.form.fn.disable(this.jQueryForm,!0),Give.form.fn.removeErrors(this.jQueryForm),e.next=5,fetch("".concat(this.ajaxurl,"?action=give_paypal_commerce_approve_order&order=")+r.orderID,{method:"post",body:k.getFormDataWithoutGiveActionField(this.form)});case 5:return o=e.sent,e.next=8,o.json();case 8:if((i=e.sent).success){e.next=18;break}if(Give.form.fn.disable(this.jQueryForm,!1),Give.form.fn.hideProcessingState(),this.displayErrorMessage(i.data.error,!0),!(a=i.data.error.details[0])||"INSTRUMENT_DECLINED"!==a.issue){e.next=17;break}return e.abrupt("return",n.restart());case 17:return e.abrupt("return");case 18:return c=i.data.order,e.next=21,k.addFieldToForm(this.form,c.id,"payPalOrderId");case 21:this.submitDonationForm();case 22:case"end":return e.stop()}}),e,this)}))),function(e,t){return i.apply(this,arguments)})},{key:"submitDonationForm",value:function(){this.jQueryForm.off("submit"),this.removeCreditCardFields(),this.form.submit()}},{key:"removeCreditCardFields",value:function(){if(j.canShow()){this.jQueryForm.find('input[name="card_name"]').parent().remove(),this.ccFieldsContainer.querySelector(".separator-with-text").remove();var e=new p(this.form);for(var t in e.cardFields)e.cardFields[t].el.parentElement.remove()}}}],n&&L(r.prototype,n),o&&L(r,o),Object.defineProperty(r,"prototype",{writable:!1}),l}(a);const Q=B;var M=setTimeout;function N(e){return Boolean(e&&void 0!==e.length)}function V(){}function z(e){if(!(this instanceof z))throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],X(e,this)}function W(e,t){for(;3===e._state;)e=e._value;0!==e._state?(e._handled=!0,z._immediateFn((function(){var r=1===e._state?t.onFulfilled:t.onRejected;if(null!==r){var n;try{n=r(e._value)}catch(e){return void Y(t.promise,e)}U(t.promise,n)}else(1===e._state?U:Y)(t.promise,e._value)}))):e._deferreds.push(t)}function U(e,t){try{if(t===e)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var r=t.then;if(t instanceof z)return e._state=3,e._value=t,void J(e);if("function"==typeof r)return void X((n=r,o=t,function(){n.apply(o,arguments)}),e)}e._state=1,e._value=t,J(e)}catch(t){Y(e,t)}var n,o}function Y(e,t){e._state=2,e._value=t,J(e)}function J(e){2===e._state&&0===e._deferreds.length&&z._immediateFn((function(){e._handled||z._unhandledRejectionFn(e._value)}));for(var t=0,r=e._deferreds.length;t<r;t++)W(e,e._deferreds[t]);e._deferreds=null}function K(e,t,r){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.promise=r}function X(e,t){var r=!1;try{e((function(e){r||(r=!0,U(t,e))}),(function(e){r||(r=!0,Y(t,e))}))}catch(e){if(r)return;r=!0,Y(t,e)}}function Z(e){var t="";return ee(e,(function(r){0!==t.length&&(t+="&"),t+=r+"="+e[r]})),t}function $(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=document.createElement("script");return r.src=e,ee(t,(function(e){r.setAttribute(e,t[e])})),r}function ee(e,t){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t(r)}function te(e){var t=0;return ee(e,(function(){return t++})),t}z.prototype.catch=function(e){return this.then(null,e)},z.prototype.then=function(e,t){var r=new this.constructor(V);return W(this,new K(e,t,r)),r},z.prototype.finally=function(e){var t=this.constructor;return this.then((function(r){return t.resolve(e()).then((function(){return r}))}),(function(r){return t.resolve(e()).then((function(){return t.reject(r)}))}))},z.all=function(e){return new z((function(t,r){if(!N(e))return r(new TypeError("Promise.all accepts an array"));var n=Array.prototype.slice.call(e);if(0===n.length)return t([]);var o=n.length;function i(e,a){try{if(a&&("object"==typeof a||"function"==typeof a)){var c=a.then;if("function"==typeof c)return void c.call(a,(function(t){i(e,t)}),r)}n[e]=a,0==--o&&t(n)}catch(e){r(e)}}for(var a=0;a<n.length;a++)i(a,n[a])}))},z.allSettled=function(e){return new this((function(t,r){if(!e||void 0===e.length)return r(new TypeError(typeof e+" "+e+" is not iterable(cannot read property Symbol(Symbol.iterator))"));var n=Array.prototype.slice.call(e);if(0===n.length)return t([]);var o=n.length;function i(e,r){if(r&&("object"==typeof r||"function"==typeof r)){var a=r.then;if("function"==typeof a)return void a.call(r,(function(t){i(e,t)}),(function(r){n[e]={status:"rejected",reason:r},0==--o&&t(n)}))}n[e]={status:"fulfilled",value:r},0==--o&&t(n)}for(var a=0;a<n.length;a++)i(a,n[a])}))},z.resolve=function(e){return e&&"object"==typeof e&&e.constructor===z?e:new z((function(t){t(e)}))},z.reject=function(e){return new z((function(t,r){r(e)}))},z.race=function(e){return new z((function(t,r){if(!N(e))return r(new TypeError("Promise.race accepts an array"));for(var n=0,o=e.length;n<o;n++)z.resolve(e[n]).then(t,r)}))},z._immediateFn="function"==typeof setImmediate&&function(e){setImmediate(e)}||function(e){M(e,0)},z._unhandledRejectionFn=function(e){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",e)};var re,ne=!1;function oe(e){return ne?re:re=new z((function(t,r){if("undefined"==typeof window)return t(null);var n=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={queryParams:{},dataAttributes:{}};ee(e,(function(r){"data-"===r.substring(0,5)?t.dataAttributes[r]=e[r]:t.queryParams[r]=e[r]}));var r=t.queryParams,n=t.dataAttributes;return{queryString:Z(r),dataAttributes:n}}(e),o=n.queryString,i=n.dataAttributes,a="".concat("https://www.paypal.com/sdk/js","?").concat(o);if(function(e,t){var r=document.querySelector('script[src="'.concat(e,'"]'));if(!r)return null;var n=$(e,t);if(te(r.dataset)!==te(n.dataset))return null;var o=!0;return ee(r.dataset,(function(e){r.dataset[e]!==n.dataset[e]&&(o=!1)})),o?r:null}(a,i)&&window.paypal)return t(window.paypal);ne=!0,function(e){var t=e.url,r=e.dataAttributes,n=e.onSuccess,o=e.onError,i=$(t,r);i.onerror=o,i.onload=n,document.head.insertBefore(i,document.head.firstElementChild)}({url:a,dataAttributes:i,onSuccess:function(){return ne=!1,window.paypal?t(window.paypal):r(new Error("The window.paypal global variable is not available."))},onError:function(){return ne=!1,r(new Error('The script "'.concat(a,"\" didn't load correctly.")))}})}))}const ie=window.wp.i18n;function ae(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 ce(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ae(Object(r),!0).forEach((function(t){se(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ae(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function se(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}document.addEventListener("DOMContentLoaded",(function(){var e=document.querySelectorAll(".give-form-wrap"),t=[];function r(){e.forEach((function(e){var t=e.querySelector(".give-form");k.isPayPalCommerceSelected(jQuery(t))&&function(e){var t=new Q(e),r=new p(e);if(t.boot(),j.canShow()){var n=new j(r);return r.boot(),void n.boot()}r.removeFields()}(t)}))}function n(e){var t,n,o;(t=e,n={},o=k.isRecurringDonation(t),n.intent=o?"subscription":"capture",n.vault=!!o,n.currency=Give.form.fn.getInfo("currency_code",jQuery(t)),oe(ce(ce({},givePayPalCommerce.payPalSdkQueryParameters),n))).then((function(){r()})).catch((function(){var t=jQuery(e);Give.form.fn.addErrors(t,Give.form.fn.getErrorHTML([{message:(0,ie.__)("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(t,!0)}))}e.forEach((function(e){Give.form.fn.hasDonationForm(e)&&t.push(e)})),t.length&&(n((e=t)[0].querySelector(".give-form")),e.forEach((function(e){var t=e.querySelector(".give-form");!function(e){var t=e.querySelector('input[name="_give_is_donation_recurring"]');t&&k.trackRecurringHiddenFieldChange(t,(function(){n(e)}))}(t),function(e){k.trackDonationCurrencyChange(e,(function(){n(e)}))}(t),function(e){document.addEventListener("give_gateway_loaded",(function(){k.isPayPalCommerceSelected(jQuery(e))&&n(e)}))}(t)})),jQuery("form.give-form").on("submit",(function(e){return!k.isPayPalCommerceSelected(jQuery(undefined))||(e.preventDefault(),!1)})))}))})()})();

Spamworldpro Mini