Ubuntu

­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­ (()=>{"use strict";var e={580:e=>{var t=/["'&<>]/;e.exports=function(e){var n,i=""+e,r=t.exec(i);if(!r)return i;var a="",o=0,s=0;for(o=r.index;o{var t=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===n}(e)}(e)},n="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function i(e,t){return!1!==t.clone&&t.isMergeableObject(e)?s((n=e,Array.isArray(n)?[]:{}),e,t):e;var n}function r(e,t,n){return e.concat(t).map(function(e){return i(e,n)})}function a(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return Object.propertyIsEnumerable.call(e,t)}):[]}(e))}function o(e,t){try{return t in e}catch(e){return!1}}function s(e,n,l){(l=l||{}).arrayMerge=l.arrayMerge||r,l.isMergeableObject=l.isMergeableObject||t,l.cloneUnlessOtherwiseSpecified=i;var c=Array.isArray(n);return c===Array.isArray(e)?c?l.arrayMerge(e,n,l):function(e,t,n){var r={};return n.isMergeableObject(e)&&a(e).forEach(function(t){r[t]=i(e[t],n)}),a(t).forEach(function(a){(function(e,t){return o(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,a)||(o(e,a)&&n.isMergeableObject(t[a])?r[a]=function(e,t){if(!t.customMerge)return s;var n=t.customMerge(e);return"function"==typeof n?n:s}(a,n)(e[a],t[a],n):r[a]=i(t[a],n))}),r}(e,n,l):i(n,l)}s.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce(function(e,n){return s(e,n,t)},{})};var l=s;e.exports=l}},t={};function n(i){var r=t[i];if(void 0!==r)return r.exports;var a=t[i]={exports:{}};return e[i](a,a.exports,n),a.exports}function i(e){return i="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},i(e)}function r(e,t){for(var n=0;n{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var o=function(){return e=function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.namespace=t,this.connection=null,this.identity=null,this.profile=null,this.FastlaneCardComponent=null,this.FastlanePaymentComponent=null,this.FastlaneWatermarkComponent=null},(t=[{key:"connect",value:function(e){var t=this;return new Promise(function(n,i){window[t.namespace]?window[t.namespace].Fastlane(e).then(function(e){t.init(e),n()}).catch(function(e){console.error(e),i(e)}):i(new Error("Namespace ".concat(t.namespace," not found on window object")))})}},{key:"init",value:function(e){this.connection=e,this.identity=this.connection.identity,this.profile=this.connection.profile,this.FastlaneCardComponent=this.connection.FastlaneCardComponent,this.FastlanePaymentComponent=this.connection.FastlanePaymentComponent,this.FastlaneWatermarkComponent=this.connection.FastlaneWatermarkComponent}},{key:"setLocale",value:function(e){this.connection.setLocale(e)}}])&&r(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();const s=o;function l(e){var t,n,i,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"info",a=null===(t=window.wc_ppcp_axo)||void 0===t?void 0:t.wp_debug,o=null===(n=window.wc_ppcp_axo)||void 0===n||null===(n=n.ajax)||void 0===n||null===(n=n.frontend_logger)||void 0===n?void 0:n.endpoint,s=null===(i=window.wc_ppcp_axo)||void 0===i?void 0:i.logging_enabled;if(a)switch(r){case"error":console.error("[AXO] ".concat(e));break;case"warn":console.warn("[AXO] ".concat(e));break;default:console.log("[AXO] ".concat(e))}o&&s&&fetch(o,{method:"POST",credentials:"same-origin",body:JSON.stringify({nonce:window.wc_ppcp_axo.ajax.frontend_logger.nonce,log:{message:e,level:r}})})}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 u(e,t){for(var n=0;n *:not(#ppcp-axo-customer-details)"}),this.axoCustomerDetails=new p({id:"ppcp-axo-customer-details",selector:"#ppcp-axo-customer-details",className:"ppcp-axo-customer-details",anchorSelector:"#customer_details"}),this.emailWidgetContainer=new p({id:"ppcp-axo-email-widget",selector:"#ppcp-axo-email-widget",className:"ppcp-axo-email-widget"}),this.shippingAddressContainer=new p({id:"ppcp-axo-shipping-address-container",selector:"#ppcp-axo-shipping-address-container",className:"ppcp-axo-shipping-address-container"}),this.billingAddressContainer=new p({id:"ppcp-axo-billing-address-container",selector:"#ppcp-axo-billing-address-container",className:"ppcp-axo-billing-address-container"}),this.fieldBillingEmail=new p({selector:"#billing_email_field"}),this.billingEmailFieldWrapper=new p({id:"ppcp-axo-billing-email-field-wrapper",selector:"#ppcp-axo-billing-email-field-wrapper"}),this.billingEmailSubmitButton=new p({id:"ppcp-axo-billing-email-submit-button",selector:"#ppcp-axo-billing-email-submit-button",className:"ppcp-axo-billing-email-submit-button-hidden button alt wp-element-button wc-block-components-button"}),this.billingEmailSubmitButtonSpinner=new p({id:"ppcp-axo-billing-email-submit-button-spinner",selector:"#ppcp-axo-billing-email-submit-button-spinner",className:"loader ppcp-axo-overlay"}),this.submitButtonContainer=new p({selector:"#ppcp-axo-submit-button-container"}),this.submitButton=new p({selector:"#ppcp-axo-submit-button-container button"}),this.changeShippingAddressLink=new p({selector:"*[data-ppcp-axo-change-shipping-address]",attributes:"data-ppcp-axo-change-shipping-address"}),this.changeBillingAddressLink=new p({selector:"*[data-ppcp-axo-change-billing-address]",attributes:"data-ppcp-axo-change-billing-address"}),this.changeCardLink=new p({selector:"*[data-ppcp-axo-change-card]",attributes:"data-ppcp-axo-change-card"}),this.showGatewaySelectionLink=new p({selector:"*[data-ppcp-axo-show-gateway-selection]",attributes:"data-ppcp-axo-show-gateway-selection"}),this.axoNonceInput=new p({id:"ppcp-axo-nonce",selector:"#ppcp-axo-nonce"})});var b=n(580),g=n.n(b);function w(e){return w="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},w(e)}function S(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function k(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,i=Array(t);n\n
\n

Shipping

\n Edit\n
\n
Please fill in your shipping details.
\n \n ");var t=e.value("countryCode"),n=e.value("stateCode"),i=r.states[t]&&r.states[t][n]?r.states[t][n]:n;return r.hasEmptyValues(e)?'\n
\n
\n

Shipping

\n Edit\n
\n
Please fill in your shipping details.
\n
\n "):'\n
\n
\n

Shipping

\n Edit\n
\n
").concat(e.value("email"),"
\n
").concat(e.value("company"),"
\n
").concat(e.value("firstName")," ").concat(e.value("lastName"),"
\n
").concat(e.value("street1"),"
\n
").concat(e.value("street2"),"
\n
").concat(e.value("city")).concat(i?", "+i:""," ").concat(e.value("postCode"),"
\n
").concat(function(e,t){if(!t)return"";var n=document.querySelector("#billing_country");if(!n)return t;var i=n.querySelector('option[value="'.concat(t,'"]'));return i?i.textContent:t}(0,t),"
\n
").concat(e.value("phone"),"
\n
\n ")},fields:{email:{valuePath:"email"},firstName:{key:"firstName",selector:"#shipping_first_name_field",valuePath:"shipping.name.firstName",inputName:"shipping_first_name"},lastName:{selector:"#shipping_last_name_field",valuePath:"shipping.name.lastName",inputName:"shipping_last_name"},street1:{selector:"#shipping_address_1_field",valuePath:"shipping.address.addressLine1",inputName:"shipping_address_1"},street2:{selector:"#shipping_address_2_field",valuePath:null,inputName:"shipping_address_2"},postCode:{selector:"#shipping_postcode_field",valuePath:"shipping.address.postalCode",inputName:"shipping_postcode"},city:{selector:"#shipping_city_field",valuePath:"shipping.address.adminArea2",inputName:"shipping_city"},stateCode:{selector:"#shipping_state_field",valuePath:"shipping.address.adminArea1",inputName:"shipping_state"},countryCode:{selector:"#shipping_country_field",valuePath:"shipping.address.countryCode",inputName:"shipping_country"},company:{selector:"#shipping_company_field",valuePath:null,inputName:"shipping_company"},shipDifferentAddress:{selector:"#ship-to-different-address",valuePath:null,inputName:"ship_to_different_address",valueCallback:function(){return!0}},phone:{valueCallback:function(e){var t,n,i="",r=null==e||null===(t=e.shipping)||void 0===t||null===(t=t.phoneNumber)||void 0===t?void 0:t.countryCode,a=null==e||null===(n=e.shipping)||void 0===n||null===(n=n.phoneNumber)||void 0===n?void 0:n.nationalNumber;return r&&(i="+".concat(r," ")),i+a}}}})},(t=[{key:"hasEmptyValues",value:function(e){return!(e.value("email")&&e.value("firstName")&&e.value("lastName")&&e.value("street1")&&e.value("city"))}},{key:"isActive",value:function(){return this.group.active}},{key:"activate",value:function(){this.group.activate(),this.group.syncDataToForm()}},{key:"deactivate",value:function(){this.group.deactivate()}},{key:"refresh",value:function(){this.group.refresh()}},{key:"setData",value:function(e){this.group.setData(e),this.group.syncDataToForm()}},{key:"toSubmitData",value:function(e){return this.group.toSubmitData(e)}}])&&z(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();function J(e){return J="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},J(e)}function X(e,t){for(var n=0;n\n
\n

Billing

\n Edit\n
\n
Please fill in your billing details.
\n \n "):""},fields:{email:{valuePath:"email"},firstName:{selector:"#billing_first_name_field",valuePath:null,inputName:"billing_first_name"},lastName:{selector:"#billing_last_name_field",valuePath:null,inputName:"billing_last_name"},street1:{selector:"#billing_address_1_field",valuePath:"billing.address.addressLine1",inputName:"billing_address_1"},street2:{selector:"#billing_address_2_field",valuePath:null,inputName:"billing_address_2"},postCode:{selector:"#billing_postcode_field",valuePath:"billing.address.postalCode",inputName:"billing_postcode"},city:{selector:"#billing_city_field",valuePath:"billing.address.adminArea2",inputName:"billing_city"},stateCode:{selector:"#billing_state_field",valuePath:"billing.address.adminArea1",inputName:"billing_state"},countryCode:{selector:"#billing_country_field",valuePath:"billing.address.countryCode",inputName:"billing_country"},company:{selector:"#billing_company_field",valuePath:null,inputName:"billing_company"},phone:{selector:"#billing_phone_field",valuePath:"billing.phoneNumber",inputName:"billing_phone"}}})},(t=[{key:"isActive",value:function(){return this.group.active}},{key:"activate",value:function(){this.group.activate()}},{key:"deactivate",value:function(){this.group.deactivate()}},{key:"refresh",value:function(){this.group.refresh()}},{key:"setData",value:function(e){this.group.setData(e)}},{key:"inputValue",value:function(e){return this.group.inputValue(e)}},{key:"fullName",value:function(){return"".concat(this.inputValue("firstName")," ").concat(this.inputValue("lastName")).trim()}},{key:"toSubmitData",value:function(e){return this.group.toSubmitData(e)}}])&&X(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();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 ee(e,t){for(var n=0;nSelect other payment method

"):""};if(e.isEmpty())return'\n
\n '.concat(t(),"\n
\n ");var n=e.value("expiry").split("-");return'\n
\n
\n

Card Details

\n Edit\n
\n
\n
\n \n
\n
\n
').concat(e.value("lastDigits")?"•••• "+e.value("lastDigits"):"",'
\n
').concat(e.value("name"),'
\n
').concat(n[1],"/").concat(n[0],"
\n\n
\n\n
\n ").concat(t(),"\n
\n ")},fields:{brand:{valuePath:"card.paymentSource.card.brand"},expiry:{valuePath:"card.paymentSource.card.expiry"},lastDigits:{valuePath:"card.paymentSource.card.lastDigits"},name:{valuePath:"card.paymentSource.card.name"}}})},(t=[{key:"activate",value:function(){this.group.activate()}},{key:"deactivate",value:function(){this.group.deactivate()}},{key:"refresh",value:function(){this.group.refresh()}},{key:"setData",value:function(e){this.group.setData(e)}},{key:"toSubmitData",value:function(e){var t=this.group.dataValue("name"),n=this.splitName(t),i=n.firstName,r=n.lastName;return e.billing_first_name=i,e.billing_last_name=r||i,this.group.toSubmitData(e)}},{key:"splitName",value:function(e){var t=e.trim().split(" ");return{firstName:t[0],lastName:t.length>1?t[t.length-1]:""}}}])&&ee(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();function ie(e){return ie="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},ie(e)}function re(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function ae(e,t,n){return(t=se(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function oe(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:null,i=function(e){return"string"==typeof e?document.querySelector(e):e}(e);i&&(t?(jQuery(i).removeClass("ppcp-disabled").off("mouseup").find("> *").css("pointer-events",""),function(e,t){jQuery(document).trigger("ppcp-enabled",{handler:"ButtonsDisabler.setEnabled",action:"enable",selector:e,element:t})}(e,i)):(jQuery(i).addClass("ppcp-disabled").on("mouseup",function(e){if(e.stopImmediatePropagation(),n){var t=jQuery(n);t.find(".single_add_to_cart_button").hasClass("disabled")&&t.find(":submit").trigger("click")}}).find("> *").css("pointer-events","none"),function(e,t){jQuery(document).trigger("ppcp-disabled",{handler:"ButtonsDisabler.setEnabled",action:"disable",selector:e,element:t})}(e,i)))},he=function(){var e=document.querySelector('input[name="payment_method"]:checked');return e?e.value:null};function me(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=Array(t);n3?(r=h===i)&&(l=a[(s=a[4])?5:(s=3,3)],a[4]=a[5]=e):a[0]<=f&&((r=n<2&&fi||i>h)&&(a[4]=n,a[5]=i,p.n=h,s=0))}if(r||n>1)return o;throw d=!0,i}return function(r,u,h){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&f(u,h),s=u,l=h;(t=s<2?e:l)||!d;){a||(s?s<3?(s>1&&(p.n=-1),f(s,l)):p.n=l:p.v=l);try{if(c=2,a){if(s||(r="next"),t=a[r]){if(!(t=t.call(a,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=a.return)&&t.call(a),s<2&&(l=TypeError("The iterator does not provide a '"+r+"' method"),s=1);a=e}else if((t=(d=p.n<0)?l:n.call(i,p))!==o)break}catch(t){a=e,s=1,l=t}finally{c=1}}return{value:t,done:d}}}(n,r,a),!0),c}var o={};function s(){}function l(){}function c(){}t=Object.getPrototypeOf;var u=[][i]?t(t([][i]())):(ye(t={},i,function(){return this}),t),d=c.prototype=s.prototype=Object.create(u);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,ye(e,r,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=c,ye(d,"constructor",c),ye(c,"constructor",l),l.displayName="GeneratorFunction",ye(c,r,"GeneratorFunction"),ye(d),ye(d,r,"Generator"),ye(d,i,function(){return this}),ye(d,"toString",function(){return"[object Generator]"}),(ve=function(){return{w:a,m:p}})()}function ye(e,t,n,i){var r=Object.defineProperty;try{r({},"",{})}catch(e){r=0}ye=function(e,t,n,i){function a(t,n){ye(e,t,function(e){return this._invoke(t,n,e)})}t?r?r(e,t,{value:n,enumerable:!i,configurable:!i,writable:!i}):e[t]=n:(a("next",0),a("throw",1),a("return",2))},ye(e,t,n,i)}function be(e,t,n,i,r,a,o){try{var s=e[a](o),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(i,r)}function ge(e){return function(){var t=this,n=arguments;return new Promise(function(i,r){var a=e.apply(t,n);function o(e){be(a,i,r,o,s,"next",e)}function s(e){be(a,i,r,o,s,"throw",e)}o(void 0)})}}function we(e){return we="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},we(e)}function Se(e,t){for(var n=0;n\n '));var t=document.querySelector(e.selector),n=this.el.billingAddressContainer;document.querySelector(n.selector)||t.insertAdjacentHTML("beforeend",'\n
\n '));var i=this.el.shippingAddressContainer;document.querySelector(i.selector)||t.insertAdjacentHTML("beforeend",'\n
\n '));var r=this.el.billingEmailFieldWrapper;document.querySelector(r.selector)||document.querySelector("#billing_email_field .woocommerce-input-wrapper").insertAdjacentHTML("afterend",'\n
\n '));var a=this.el.watermarkContainer;document.querySelector(a.selector)||document.querySelector(r.selector).insertAdjacentHTML("beforeend",'\n
\n '));var o=this.el.paymentContainer;if(document.querySelector(o.selector)||document.querySelector(".payment_method_ppcp-axo-gateway").insertAdjacentHTML("beforeend",'\n
\n
\n
\n
\n ')),this.useEmailWidget()){var s=this.el.emailWidgetContainer;document.querySelector(s.selector)||t.insertAdjacentHTML("afterbegin",'\n
\n --- EMAIL WIDGET PLACEHOLDER ---\n
\n '))}else{var l=document.querySelector(this.el.fieldBillingEmail.selector);t.prepend(l),document.querySelector(this.el.billingEmailFieldWrapper.selector).prepend(document.querySelector("#billing_email_field .woocommerce-input-wrapper"))}}},{key:"initButtonStateManager",value:function(){this.buttonStateManager||(this.buttonStateManager=new le(this.el.billingEmailSubmitButton.selector,this.el.billingEmailSubmitButtonSpinner.selector),l("Button state manager initialized"))}},{key:"registerEmailEventHandlers",value:function(){var e=this,t=document.querySelector("#billing_email_field input");t&&t.addEventListener("keydown",function(){var t=ge(ve().m(function t(n){var i;return ve().w(function(t){for(;;)switch(t.n){case 0:if("Enter"!==n.key||"ppcp-axo-gateway"!==he()){t.n=2;break}if(n.preventDefault(),n.stopPropagation(),l("Enter key on email field - value: ".concat(e.emailInput.value)),e.validateEmail(e.el.fieldBillingEmail.selector),!e.emailInput||null===(i=e.buttonStateManager)||void 0===i||!i.shouldAllowRetry(e.emailInput.value,e.validateEmailFormat.bind(e))){t.n=1;break}return t.n=1,e.onChangeEmail();case 1:return t.a(2,!1);case 2:return t.a(2)}},t)}));return function(_x){return t.apply(this,arguments)}}());var n=document.querySelector(this.el.billingEmailSubmitButton.selector);n&&n.addEventListener("click",function(){var t=ge(ve().m(function t(n){var i;return ve().w(function(t){for(;;)switch(t.n){case 0:if(n.preventDefault(),l("Submit button clicked - email: ".concat(e.emailInput.value)),!e.emailInput||null===(i=e.buttonStateManager)||void 0===i||!i.shouldAllowRetry(e.emailInput.value,e.validateEmailFormat.bind(e))){t.n=1;break}return t.n=1,e.onChangeEmail();case 1:return t.a(2)}},t)}));return function(e){return t.apply(this,arguments)}}())}},{key:"initFastlane",value:(m=ge(ve().m(function e(){return ve().w(function(e){for(;;)switch(e.n){case 0:if(!this.initialized){e.n=1;break}return e.a(2);case 1:return this.initialized=!0,e.n=2,this.connect();case 2:return e.n=3,this.renderWatermark();case 3:return this.renderEmailSubmitButton(),this.initButtonStateManager(),this.registerEmailEventHandlers(),this.watchEmail(),e.n=4,this.restoreSessionAfterFailure();case 4:return e.a(2)}},e,this)})),function(){return m.apply(this,arguments)})},{key:"connect",value:(h=ge(ve().m(function e(){return ve().w(function(e){for(;;)switch(e.n){case 0:return this.axoConfig.environment.is_sandbox&&window.localStorage.setItem("axoEnv","sandbox"),e.n=1,this.fastlane.connect({locale:this.locale,styles:this.styles,cardOptions:{allowedBrands:this.cardOptions},shippingAddressOptions:{allowedLocations:this.enabledShippingLocations}});case 1:this.fastlane.setLocale("en_us");case 2:return e.a(2)}},e,this)})),function(){return h.apply(this,arguments)})},{key:"triggerGatewayChange",value:function(){this.el.gatewayRadioButton.trigger("change")}},{key:"renderWatermark",value:(f=ge(ve().m(function e(){var t,n=arguments;return ve().w(function(e){for(;;)switch(e.n){case 0:return t=!(n.length>0&&void 0!==n[0])||n[0],e.n=1,this.fastlane.FastlaneWatermarkComponent({includeAdditionalInfo:t});case 1:e.v.render(this.el.watermarkContainer.selector),this.toggleWatermarkLoading(this.el.watermarkContainer,"ppcp-axo-watermark-loading","loader");case 2:return e.a(2)}},e,this)})),function(){return f.apply(this,arguments)})},{key:"renderEmailSubmitButton",value:function(){var e=this.el.billingEmailSubmitButton,t=this.el.billingEmailSubmitButtonSpinner;if(!document.querySelector(e.selector)){var n=document.querySelector("#billing_email_field .woocommerce-input-wrapper"),i=document.querySelector("#ppcp-axo-watermark-container");n.insertAdjacentHTML("beforeend",'\n \n '));var r=document.querySelector(e.selector);n.insertBefore(r,i),r.offsetHeight,r.classList.remove("ppcp-axo-billing-email-submit-button-hidden"),r.classList.add("ppcp-axo-billing-email-submit-button-loaded")}}},{key:"watchEmail",value:function(){var e=this;this.useEmailWidget()||(this.emailInput.addEventListener("change",ge(ve().m(function t(){var n;return ve().w(function(t){for(;;)switch(t.n){case 0:l("Change event attempt - emailInput: ".concat(e.emailInput.value)),e.emailInput&&null!==(n=e.buttonStateManager)&&void 0!==n&&n.shouldProcessEmail(e.emailInput.value,e.validateEmailFormat.bind(e))&&(e.validateEmail(e.el.fieldBillingEmail.selector),e.onChangeEmail());case 1:return t.a(2)}},t)}))),l("Checking initial email value: ".concat(this.emailInput.value)),this.emailInput.value&&this.onChangeEmail())}},{key:"initPhoneSyncWooToFastlane",value:function(){var e;this.phoneInput=document.querySelector("#billing_phone"),null===(e=this.phoneInput)||void 0===e||e.addEventListener("change",this.onChangePhone)}},{key:"sanitizePhoneNumber",value:function(e){var t=e.replace(/^\+1/,"").replace(/\D/g,"");return 10===t.length?t:null}},{key:"readPhoneFromWoo",value:function(){if(!this.phoneInput)return!1;var e=this.phoneInput.value,t=this.sanitizePhoneNumber(e);return!!t&&(this.data.phone=t,!0)}},{key:"onChangeEmail",value:(p=ge(ve().m(function e(){var t,n,i,r,a,o;return ve().w(function(e){for(;;)switch(e.p=e.n){case 0:if(this.status.active){e.n=1;break}return l("Email checking skipped, AXO not active."),e.a(2);case 1:if(this.emailInput){e.n=2;break}return l("Email field not initialized."),e.a(2);case 2:if(n=this.emailInput.value,null!==(t=this.buttonStateManager)&&void 0!==t&&t.shouldProcessEmail(n,this.validateEmailFormat.bind(this))){e.n=3;break}return l("Email processing skipped - already processing or same email"),e.a(2);case 3:if(l("Email changed: ".concat(n||"")),this.buttonStateManager.markEmailAsProcessing(n),this.clearData(),this.emailInput.value=this.stripSpaces(this.emailInput.value),this.$(this.el.paymentContainer.selector+"-details").html(""),this.removeFastlaneComponent(),this.setStatus("validEmail",!1),this.setStatus("hasProfile",!1),this.hideGatewaySelection=!1,this.emailInput.value&&this.emailInput.checkValidity()&&this.validateEmailFormat(this.emailInput.value)){e.n=4;break}return l("The email address is not valid."),null===(i=this.buttonStateManager)||void 0===i||i.setDisabled(),e.a(2);case 4:if(this.data.email=this.emailInput.value,this.billingView.setData(this.data),this.readPhoneFromWoo(),this.fastlane.identity){e.n=5;break}return l("Not initialized."),null===(r=this.buttonStateManager)||void 0===r||r.setDisabled(),e.a(2);case 5:return pe.trackSubmitCheckoutEmail({page_type:"checkout"}),this.disableGatewaySelection(),e.p=6,e.n=7,this.lookupCustomerByEmail();case 7:e.n=9;break;case 8:e.p=8,o=e.v,l("Email lookup failed: ".concat(o.message),"error"),null===(a=this.buttonStateManager)||void 0===a||a.handleEmailLookupFailure();case 9:return e.p=9,this.enableGatewaySelection(),e.f(9);case 10:return e.a(2)}},e,this,[[6,8,9,10]])})),function(){return p.apply(this,arguments)})},{key:"onChangePhone",value:(d=ge(ve().m(function e(){return ve().w(function(e){for(;;)switch(e.n){case 0:if(!this.readPhoneFromWoo()||!this.status.active){e.n=1;break}return e.n=1,this.refreshFastlanePrefills();case 1:return e.a(2,Promise.resolve())}},e,this)})),function(){return d.apply(this,arguments)})},{key:"lookupCustomerByEmail",value:(u=ge(ve().m(function e(){var t,n,i,r,a,o,s;return ve().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,this.fastlane.identity.lookupCustomerByEmail(this.emailInput.value);case 1:if(t=e.v,l("lookupCustomerByEmail: ".concat(JSON.stringify(t))),!t.customerContextId){e.n=7;break}return l("Email is associated with a Connect profile or a PayPal member"),e.n=2,this.fastlane.identity.triggerAuthenticationFlow(t.customerContextId);case 2:if(n=e.v,l("AuthResponse - triggerAuthenticationFlow: ".concat(JSON.stringify(n))),"succeeded"!==n.authenticationState){e.n=4;break}return e.n=3,this.handleSuccessfulAuth(n);case 3:null===(i=this.buttonStateManager)||void 0===i||i.handleSuccess(),e.n=6;break;case 4:return l("Authentication Failed or Canceled"),e.n=5,this.handleFailedAuth();case 5:null===(r=this.buttonStateManager)||void 0===r||r.handleAuthFailureOrCancellation();case 6:e.n=9;break;case 7:return l("No profile found with this email address."),e.n=8,this.handleGuestCustomer();case 8:null===(a=this.buttonStateManager)||void 0===a||a.handleSuccess();case 9:e.n=11;break;case 10:throw e.p=10,s=e.v,l("lookupCustomerByEmail error: ".concat(s.message),"error"),null===(o=this.buttonStateManager)||void 0===o||o.handleEmailLookupFailure(),s;case 11:return e.a(2)}},e,this,[[0,10]])})),function(){return u.apply(this,arguments)})},{key:"disableGatewaySelection",value:function(){this.$(".wc_payment_methods input").prop("disabled",!0)}},{key:"enableGatewaySelection",value:function(){this.$(".wc_payment_methods input").prop("disabled",!1)}},{key:"clearData",value:function(){this.data={email:null,phone:null,billing:null,shipping:null,card:null}}},{key:"setShipping",value:function(e){this.data.shipping=e,this.shippingView.setData(this.data)}},{key:"setBilling",value:function(e){this.data.billing=e,this.billingView.setData(this.data)}},{key:"setCard",value:function(e){this.data.card=e,this.cardView.setData(this.data)}},{key:"onClickSubmitButton",value:function(){var e=this;if(this.isRyanFlow){l("Starting Ryan flow."),this.$("#ship-to-different-address-checkbox").prop("checked","checked");var t={};this.billingView.toSubmitData(t),this.shippingView.toSubmitData(t),this.cardView.toSubmitData(t),this.ensureBillingPhoneNumber(t),l("Ryan flow - submitted nonce: ".concat(this.data.card.id)),this.submit(this.data.card.id,t)}else{l("Starting Gary flow.");try{this.cardComponent.getPaymentToken(this.tokenizeData()).then(function(t){l("Gary flow - submitted nonce: ".concat(t.id)),e.submit(t.id)})}catch(e){alert("Error tokenizing data."),l("Error tokenizing data. ".concat(e.message),"error")}}}},{key:"cardComponentData",value:function(){var e={fields:{cardholderName:{enabled:"1"===this.axoConfig.name_on_card}},styles:this.deleteKeysWithEmptyString(this.axoConfig.style_options)};return this.data.phone&&!this.isRyanFlow&&(e.fields.phoneNumber={prefill:this.data.phone}),e}},{key:"initializeFastlaneComponent",value:(c=ge(ve().m(function e(){var t,n;return ve().w(function(e){for(;;)switch(e.n){case 0:if(this.status.active&&!this.cardComponent){e.n=1;break}return e.a(2,Promise.resolve());case 1:return t=this.cardFormSelector,n=this.cardComponentData(),e.n=2,this.fastlane.FastlaneCardComponent(n);case 2:return this.cardComponent=e.v,e.a(2,this.cardComponent.render(t))}},e,this)})),function(){return c.apply(this,arguments)})},{key:"removeFastlaneComponent",value:function(){document.querySelector(this.cardFormSelector).innerHTML="",this.cardComponent=null}},{key:"refreshFastlanePrefills",value:(o=ge(ve().m(function e(){var t,n,i;return ve().w(function(e){for(;;)switch(e.n){case 0:if(this.cardComponent){e.n=1;break}return e.a(2,Promise.resolve());case 1:return t=this.cardComponentData(),n=t.fields,i=Object.keys(n).reduce(function(e,t){return n[t].hasOwnProperty("prefill")&&(e[t]=n[t].prefill),e},{}),e.a(2,this.cardComponent.updatePrefills(i))}},e,this)})),function(){return o.apply(this,arguments)})},{key:"tokenizeData",value:function(){return{cardholderName:{fullName:this.billingView.fullName()},billingAddress:{addressLine1:this.billingView.inputValue("street1"),addressLine2:this.billingView.inputValue("street2"),adminArea1:this.billingView.inputValue("stateCode"),adminArea2:this.billingView.inputValue("city"),postalCode:this.billingView.inputValue("postCode"),countryCode:this.billingView.inputValue("countryCode")}}}},{key:"submit",value:function(e,t){var n=this;if(this.el.axoNonceInput.get()||this.$("form.woocommerce-checkout").append('')),this.el.axoNonceInput.get().value=e,t){var i=document.querySelector("form.woocommerce-checkout"),r=new FormData(i);this.showLoading(),Object.keys(t).forEach(function(e){r.set(e,t[e])}),r.set("fastlane_member",!0),fetch(wc_checkout_params.checkout_url,{method:"POST",body:r}).then(function(e){return e.json()}).then(function(e){if("failure"===e.result){if(e.messages){var t=n.$(".woocommerce-notices-wrapper").eq(0);t.html(e.messages),n.$("html, body").animate({scrollTop:t.offset().top},500)}return l("Error sending checkout form. ".concat(e),"error"),void n.hideLoading()}e.redirect&&(window.location.href=e.redirect)}).catch(function(e){l("Error sending checkout form. ".concat(e.message),"error"),n.hideLoading()})}else this.el.defaultSubmitButton.click()}},{key:"showLoading",value:function(){jQuery("form.woocommerce-checkout").append('
'),function(e){fe(e,!1,arguments.length>1&&void 0!==arguments[1]?arguments[1]:null)}(".woocommerce-checkout-payment")}},{key:"hideLoading",value:function(){jQuery("form.woocommerce-checkout .blockOverlay").remove(),fe(".woocommerce-checkout-payment",!0)}},{key:"useEmailWidget",value:function(){var e;return"use_widget"===(null===(e=this.axoConfig)||void 0===e||null===(e=e.widgets)||void 0===e?void 0:e.email)}},{key:"getCardOptions",value:function(){var e,t=this.axoConfig.merchant_country||"US",n=new Set((null===(e=this.axoConfig.allowed_cards)||void 0===e?void 0:e[t])||["VISA","MASTERCARD","AMEX","DISCOVER"]),i=new Set((this.axoConfig.disable_cards||[]).map(function(e){return e.toUpperCase()}));return function(e){return function(e){if(Array.isArray(e))return me(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return me(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?me(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(n).filter(function(e){return!i.has(e)})}},{key:"ensureBillingPhoneNumber",value:function(e){if(""===e.billing_phone){var t,n,i="",r=null===(t=this.data.shipping)||void 0===t||null===(t=t.phoneNumber)||void 0===t?void 0:t.countryCode,a=null===(n=this.data.shipping)||void 0===n||null===(n=n.phoneNumber)||void 0===n?void 0:n.nationalNumber;r&&(i="+".concat(r," ")),i+=a,e.billing_phone=i}}},{key:"toggleLoaderAndOverlay",value:function(e,t,n){var i=document.querySelector("".concat(e.selector," .").concat(t)),r=document.querySelector("".concat(e.selector," .").concat(n));i&&i.classList.toggle(t),r&&r.classList.toggle(n)}},{key:"spinnerToggleLoaderAndOverlay",value:function(e,t,n){var i=document.querySelector("".concat(e.selector));i&&(i.classList.toggle(t),i.classList.toggle(n))}},{key:"toggleWatermarkLoading",value:function(e,t,n){var i=document.querySelector("".concat(e.selector,".").concat(t)),r=document.querySelector("".concat(e.selector,".").concat(n));i&&i.classList.toggle(t),r&&r.classList.toggle(n)}},{key:"validateEmailFormat",value:function(e){return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e)}},{key:"stripSpaces",value:function(e){return e.replace(/\s+/g,"")}},{key:"validateEmail",value:function(e){var t=document.querySelector(e),n=document.querySelector(e+" input").value;this.validateEmailFormat(n)?(t.classList.remove("woocommerce-invalid"),t.classList.add("woocommerce-validated"),this.setStatus("validEmail",!0)):(t.classList.remove("woocommerce-validated"),t.classList.add("woocommerce-invalid"),this.setStatus("validEmail",!1))}},{key:"reEnableEmailInput",value:function(){var e=this,t=function(t){var n,i,r;null!==(n=e.buttonStateManager)&&void 0!==n&&n.isProcessing()||null===(i=e.emailInput)||void 0===i||!i.value||!e.validateEmailFormat(e.emailInput.value)||null===(r=e.buttonStateManager)||void 0===r||r.setReady()};this.$("#billing_email_field input").on("focus",t),this.$("#billing_email_field input").on("input",t),this.$("#billing_email_field input").on("click",t)}},{key:"restoreSessionAfterFailure",value:(a=ge(ve().m(function e(){var t,n,i,r,a,o,s,c,u,d;return ve().w(function(e){for(;;)switch(e.p=e.n){case 0:if(this.fastlane&&!this.hasProcessedSessionRestore){e.n=1;break}return e.a(2);case 1:if("1"===(t=new URLSearchParams(window.location.search)).get("ppcp_fastlane_error")){e.n=2;break}return e.a(2);case 2:if(t.delete("ppcp_fastlane_error"),(n=new URL(window.location)).search=t.toString(),window.history.replaceState({},"",n),this.hasProcessedSessionRestore=!0,e.p=3,null===(i=this.emailInput)||void 0===i||!i.value){e.n=12;break}return l("Restoring Fastlane session for email: ".concat(this.emailInput.value)),null===(r=this.buttonStateManager)||void 0===r||r.markEmailAsProcessing(this.emailInput.value),e.n=4,this.fastlane.identity.lookupCustomerByEmail(this.emailInput.value);case 4:if(null==(a=e.v)||!a.customerContextId){e.n=10;break}return e.n=5,this.fastlane.identity.triggerAuthenticationFlow(a.customerContextId);case 5:if("succeeded"!==(null==(o=e.v)?void 0:o.authenticationState)){e.n=7;break}return e.n=6,this.handleSuccessfulAuth(o);case 6:null===(s=this.buttonStateManager)||void 0===s||s.handleSuccess(),l("Fastlane session successfully restored"),e.n=9;break;case 7:return e.n=8,this.handleFailedAuth();case 8:null===(c=this.buttonStateManager)||void 0===c||c.handleAuthFailureOrCancellation();case 9:e.n=12;break;case 10:return e.n=11,this.handleGuestCustomer();case 11:null===(u=this.buttonStateManager)||void 0===u||u.handleSuccess();case 12:e.n=14;break;case 13:e.p=13,e.v,l("Failed to restore Fastlane session","warn"),l("Fastlane session restoration error:","error"),null===(d=this.buttonStateManager)||void 0===d||d.handleEmailLookupFailure();case 14:return e.a(2)}},e,this,[[3,13]])})),function(){return a.apply(this,arguments)})},{key:"handleSuccessfulAuth",value:(r=ge(ve().m(function e(t){var n,i,r,a,o,s,l;return ve().w(function(e){for(;;)switch(e.n){case 0:if((i=t.profileData.shippingAddress)&&this.setShipping(i),!t.profileData.card){e.n=1;break}this.setStatus("hasCard",!0),e.n=2;break;case 1:return e.n=2,this.initializeFastlaneComponent();case 2:return(r=null===(n=t.profileData)||void 0===n||null===(n=n.card)||void 0===n||null===(n=n.paymentSource)||void 0===n||null===(n=n.card)||void 0===n?void 0:n.billingAddress)&&(this.setCard(t.profileData.card),s={address:r},(l=null!==(a=null===(o=t.profileData)||void 0===o||null===(o=o.shippingAddress)||void 0===o||null===(o=o.phoneNumber)||void 0===o?void 0:o.nationalNumber)&&void 0!==a?a:"")&&(s.phoneNumber=l),this.setBilling(s)),this.setStatus("validEmail",!0),this.setStatus("hasProfile",!0),this.hideGatewaySelection=!0,this.$(".wc_payment_methods label").hide(),this.$(".wc_payment_methods input").hide(),e.n=3,this.renderWatermark(!1);case 3:this.rerender();case 4:return e.a(2)}},e,this)})),function(e){return r.apply(this,arguments)})},{key:"handleFailedAuth",value:(i=ge(ve().m(function e(){return ve().w(function(e){for(;;)switch(e.n){case 0:return this.setStatus("validEmail",!0),this.setStatus("hasProfile",!1),e.n=1,this.renderWatermark(!0);case 1:return e.n=2,this.initializeFastlaneComponent();case 2:return e.a(2)}},e,this)})),function(){return i.apply(this,arguments)})},{key:"handleGuestCustomer",value:(n=ge(ve().m(function e(){return ve().w(function(e){for(;;)switch(e.n){case 0:return this.setStatus("validEmail",!0),this.setStatus("hasProfile",!1),e.n=1,this.renderWatermark(!0);case 1:return e.n=2,this.initializeFastlaneComponent();case 2:return e.a(2)}},e,this)})),function(){return n.apply(this,arguments)})}],t&&Se(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n,i,r,a,o,c,u,d,p,f,h,m}();const _e=Ee;function Ce(e,t){void 0===t&&(t={});var n=document.createElement("script");return n.src=e,Object.keys(t).forEach(function(e){n.setAttribute(e,t[e]),"data-csp-nonce"===e&&n.setAttribute("nonce",t["data-csp-nonce"])}),n}function je(e,t){if(void 0===t&&(t=Promise),xe(e,t),"undefined"==typeof document)return t.resolve(null);var n=function(e){var t,n,i=e.sdkBaseUrl,r=e.environment,a=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r3&&void 0!==arguments[3]?arguments[3]:null;fetch(t.endpoint,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"same-origin",body:JSON.stringify({nonce:t.nonce})}).then(function(e){return e.json()}).then(function(r){var a;(function(e,t){return!(!e||e.user!==t||(new Date).getTime()>=1e3*e.expiration)})(r,t.user)&&(a=r,sessionStorage.setItem("ppcp-data-client-id",JSON.stringify(a)),e["data-client-token"]=r.token,je(e).then(function(e){"function"==typeof n&&n(e)}).catch(function(e){"function"==typeof i&&i(e)}))})};function Fe(e){return Fe="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},Fe(e)}function Ne(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var i,r,a,o,s=[],l=!0,c=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(i=a.call(n)).done)&&(s.push(i.value),s.length!==t);l=!0);}catch(e){c=!0,r=e}finally{try{if(!l&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(c)throw r}}return s}}(e,t)||Ie(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function De(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=Ie(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var _n=0,i=function(){};return{s:i,n:function(){return _n>=e.length?{done:!0}:{done:!1,value:e[_n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,a=!0,o=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){o=!0,r=e},f:function(){try{a||null==n.return||n.return()}finally{if(o)throw r}}}}function Ie(e,t){if(e){if("string"==typeof e)return Be(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Be(e,t):void 0}}function Be(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=Array(t);n')),n.append(r)),t=r.get(0)}return jQuery(t).length?t:null}},{key:"toKey",value:function(e){return Array.isArray(e)?JSON.stringify(e):e}}])&&Le(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();window.widgetBuilder=window.widgetBuilder||new Me;const qe=window.widgetBuilder;var Ve=n(4744),We=n.n(Ve),Ge=function(e){return e.replace(/([-_]\w)/g,function(e){return e[1].toUpperCase()})},Re=function(e){var t=function(e){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[Ge(n)]=e[n]);return t}(e.url_params);e.script_attributes&&(t=We()(t,e.script_attributes));var n=function(e){var t,n,i=null==e||null===(t=e.save_payment_methods)||void 0===t?void 0:t.id_token;return i&&!0===(null==e||null===(n=e.user)||void 0===n?void 0:n.is_logged)?{"data-user-id-token":i}:{}}(e);return We().all([t,n])};function $e(e){return $e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},$e(e)}function Ue(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function ze(e){for(var t=1;t3?(r=h===i)&&(l=a[(s=a[4])?5:(s=3,3)],a[4]=a[5]=e):a[0]<=f&&((r=n<2&&fi||i>h)&&(a[4]=n,a[5]=i,p.n=h,s=0))}if(r||n>1)return o;throw d=!0,i}return function(r,u,h){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&f(u,h),s=u,l=h;(t=s<2?e:l)||!d;){a||(s?s<3?(s>1&&(p.n=-1),f(s,l)):p.n=l:p.v=l);try{if(c=2,a){if(s||(r="next"),t=a[r]){if(!(t=t.call(a,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=a.return)&&t.call(a),s<2&&(l=TypeError("The iterator does not provide a '"+r+"' method"),s=1);a=e}else if((t=(d=p.n<0)?l:n.call(i,p))!==o)break}catch(t){a=e,s=1,l=t}finally{c=1}}return{value:t,done:d}}}(n,r,a),!0),c}var o={};function s(){}function l(){}function c(){}t=Object.getPrototypeOf;var u=[][i]?t(t([][i]())):(Je(t={},i,function(){return this}),t),d=c.prototype=s.prototype=Object.create(u);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,Je(e,r,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=c,Je(d,"constructor",c),Je(c,"constructor",l),l.displayName="GeneratorFunction",Je(c,r,"GeneratorFunction"),Je(d),Je(d,r,"Generator"),Je(d,i,function(){return this}),Je(d,"toString",function(){return"[object Generator]"}),(Qe=function(){return{w:a,m:p}})()}function Je(e,t,n,i){var r=Object.defineProperty;try{r({},"",{})}catch(e){r=0}Je=function(e,t,n,i){function a(t,n){Je(e,t,function(e){return this._invoke(t,n,e)})}t?r?r(e,t,{value:n,enumerable:!i,configurable:!i,writable:!i}):e[t]=n:(a("next",0),a("throw",1),a("return",2))},Je(e,t,n,i)}function Xe(e,t,n,i,r,a,o){try{var s=e[a](o),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(i,r)}function Ke(e){return function(){var t=this,n=arguments;return new Promise(function(i,r){var a=e.apply(t,n);function o(e){Xe(a,i,r,o,s,"next",e)}function s(e){Xe(a,i,r,o,s,"throw",e)}o(void 0)})}}var Ze,Ye,et,tt,nt=new Map,it=new Map,rt=function(){var e=Ke(Qe().m(function e(t,n){var i;return Qe().w(function(e){for(;;)switch(e.n){case 0:if(null===(i=n.data_client_id)||void 0===i||!i.set_attribute||!0===n.vault_v3_enabled){e.n=1;break}return e.a(2,new Promise(function(e,i){Ae(t,n.data_client_id,function(t){qe.setPaypal(t),e(t)},i)}));case 1:return e.a(2,null)}},e)}));return function(_x,t){return e.apply(this,arguments)}}(),at=function(){var e=Ke(Qe().m(function e(t,n){var i,r,a;return Qe().w(function(e){for(;;)switch(e.n){case 0:if(t){e.n=1;break}throw new Error("Namespace is required");case 1:if(!nt.has(t)){e.n=2;break}return console.log("Script already loaded for namespace: ".concat(t)),e.a(2,nt.get(t));case 2:if(!it.has(t)){e.n=3;break}return console.log("Script loading in progress for namespace: ".concat(t)),e.a(2,it.get(t));case 3:return i=ze(ze({},Re(n)),{},{"data-namespace":t}),e.n=4,rt(i,n);case 4:if(!(r=e.v)){e.n=5;break}return e.a(2,r);case 5:return a=new Promise(function(e,n){je(i).then(function(n){qe.setPaypal(n),nt.set(t,n),console.log("Script loaded for namespace: ".concat(t)),e(n)}).catch(function(e){console.error("Failed to load script for namespace: ".concat(t),e),n(e)}).finally(function(){it.delete(t)})}),it.set(t,a),e.a(2,a)}},e)}));return function(t,n){return e.apply(this,arguments)}}();function ot(e){return ot="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},ot(e)}function st(){var e,t,n="function"==typeof Symbol?Symbol:{},i=n.iterator||"@@iterator",r=n.toStringTag||"@@toStringTag";function a(n,i,r,a){var l=i&&i.prototype instanceof s?i:s,c=Object.create(l.prototype);return lt(c,"_invoke",function(n,i,r){var a,s,l,c=0,u=r||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return a=t,s=0,l=e,p.n=n,o}};function f(n,i){for(s=n,l=i,t=0;!d&&c&&!r&&t3?(r=h===i)&&(l=a[(s=a[4])?5:(s=3,3)],a[4]=a[5]=e):a[0]<=f&&((r=n<2&&fi||i>h)&&(a[4]=n,a[5]=i,p.n=h,s=0))}if(r||n>1)return o;throw d=!0,i}return function(r,u,h){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&f(u,h),s=u,l=h;(t=s<2?e:l)||!d;){a||(s?s<3?(s>1&&(p.n=-1),f(s,l)):p.n=l:p.v=l);try{if(c=2,a){if(s||(r="next"),t=a[r]){if(!(t=t.call(a,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=a.return)&&t.call(a),s<2&&(l=TypeError("The iterator does not provide a '"+r+"' method"),s=1);a=e}else if((t=(d=p.n<0)?l:n.call(i,p))!==o)break}catch(t){a=e,s=1,l=t}finally{c=1}}return{value:t,done:d}}}(n,r,a),!0),c}var o={};function s(){}function l(){}function c(){}t=Object.getPrototypeOf;var u=[][i]?t(t([][i]())):(lt(t={},i,function(){return this}),t),d=c.prototype=s.prototype=Object.create(u);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,lt(e,r,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=c,lt(d,"constructor",c),lt(c,"constructor",l),l.displayName="GeneratorFunction",lt(c,r,"GeneratorFunction"),lt(d),lt(d,r,"Generator"),lt(d,i,function(){return this}),lt(d,"toString",function(){return"[object Generator]"}),(st=function(){return{w:a,m:p}})()}function lt(e,t,n,i){var r=Object.defineProperty;try{r({},"",{})}catch(e){r=0}lt=function(e,t,n,i){function a(t,n){lt(e,t,function(e){return this._invoke(t,n,e)})}t?r?r(e,t,{value:n,enumerable:!i,configurable:!i,writable:!i}):e[t]=n:(a("next",0),a("throw",1),a("return",2))},lt(e,t,n,i)}function ct(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function ut(e){for(var t=1;t